[hkl] 01/13: Imported Upstream version 4.99.99.1610

Frédéric-Emmanuel Picca picca at alioth.debian.org
Mon Aug 26 15:06:39 UTC 2013


This is an automated email from the git hooks/post-receive script.

picca pushed a commit to branch experimental
in repository hkl.

commit efe65bbca1ffe371ac265dbf1184c6ecb4747512
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date:   Sun Aug 25 12:45:16 2013 +0200

    Imported Upstream version 4.99.99.1610
---
 AUTHORS                                            |    3 +-
 ChangeLog                                          |25530 ++++++++++++++------
 Documentation/Makefile.am                          |    2 +-
 Documentation/Makefile.in                          |  447 +-
 Documentation/api/Makefile.am                      |    2 +-
 Documentation/api/Makefile.in                      |  342 +-
 Documentation/api/hkl-sections.txt                 |   92 +-
 Documentation/api/html/annotation-glossary.html    |   49 +
 Documentation/api/html/api-index-full.html         |  709 +-
 Documentation/api/html/ch01.html                   |   14 +-
 Documentation/api/html/hkl-hkl-axis.html           |  586 +-
 .../api/html/hkl-hkl-detector-factory.html         |   40 +-
 Documentation/api/html/hkl-hkl-detector.html       |  137 +-
 Documentation/api/html/hkl-hkl-error.html          |  272 +-
 .../api/html/hkl-hkl-geometry-factory.html         |   72 +-
 Documentation/api/html/hkl-hkl-geometry.html       |  741 +-
 Documentation/api/html/hkl-hkl-interval.html       |  374 +-
 Documentation/api/html/hkl-hkl-lattice.html        |  336 +-
 Documentation/api/html/hkl-hkl-list.html           |  298 +-
 Documentation/api/html/hkl-hkl-macros.html         |  274 +-
 Documentation/api/html/hkl-hkl-matrix.html         |  379 +-
 Documentation/api/html/hkl-hkl-parameter.html      |  475 +-
 .../api/html/hkl-hkl-pseudoaxis-auto.html          |   77 +-
 .../html/hkl-hkl-pseudoaxis-common-eulerians.html  |   36 +-
 .../api/html/hkl-hkl-pseudoaxis-common-hkl.html    |  359 +-
 .../api/html/hkl-hkl-pseudoaxis-common-psi.html    |   89 +-
 .../api/html/hkl-hkl-pseudoaxis-common-q.html      |   52 +-
 .../api/html/hkl-hkl-pseudoaxis-common.html        |   68 +-
 .../api/html/hkl-hkl-pseudoaxis-e4cv.html          |   53 +-
 Documentation/api/html/hkl-hkl-pseudoaxis-e6c.html |   56 +-
 .../api/html/hkl-hkl-pseudoaxis-factory.html       |   42 +-
 .../api/html/hkl-hkl-pseudoaxis-k4cv.html          |   56 +-
 Documentation/api/html/hkl-hkl-pseudoaxis-k6c.html |   56 +-
 .../api/html/hkl-hkl-pseudoaxis-zaxis.html         |   36 +-
 Documentation/api/html/hkl-hkl-pseudoaxis.html     |  942 +-
 Documentation/api/html/hkl-hkl-quaternion.html     |  189 +-
 Documentation/api/html/hkl-hkl-sample.html         |  963 +-
 Documentation/api/html/hkl-hkl-source.html         |  164 +-
 Documentation/api/html/hkl-hkl-unit.html           |   88 +-
 Documentation/api/html/hkl-hkl-vector.html         |  629 +-
 Documentation/api/html/hkl.devhelp                 |  356 -
 Documentation/api/html/hkl.devhelp2                |  234 +-
 Documentation/api/html/index.html                  |   11 +-
 Documentation/api/html/index.sgml                  |  195 +-
 Documentation/api/html/object-tree.html            |   12 +-
 Documentation/api/html/style.css                   |    3 +-
 Documentation/api/tmpl/hkl-axis.sgml               |  233 -
 Documentation/api/tmpl/hkl-detector-factory.sgml   |   31 -
 Documentation/api/tmpl/hkl-detector.sgml           |   76 -
 Documentation/api/tmpl/hkl-error.sgml              |  132 -
 Documentation/api/tmpl/hkl-geometry-factory.sgml   |   41 -
 Documentation/api/tmpl/hkl-geometry.sgml           |  322 -
 Documentation/api/tmpl/hkl-interval.sgml           |  177 -
 Documentation/api/tmpl/hkl-lattice.sgml            |  136 -
 Documentation/api/tmpl/hkl-list.sgml               |  129 -
 Documentation/api/tmpl/hkl-macros.sgml             |  213 -
 Documentation/api/tmpl/hkl-matrix.sgml             |  152 -
 Documentation/api/tmpl/hkl-parameter.sgml          |  178 -
 Documentation/api/tmpl/hkl-pseudoaxis-auto.sgml    |   36 -
 .../api/tmpl/hkl-pseudoaxis-common-eulerians.sgml  |   31 -
 .../api/tmpl/hkl-pseudoaxis-common-hkl.sgml        |  114 -
 .../api/tmpl/hkl-pseudoaxis-common-psi.sgml        |   51 -
 .../api/tmpl/hkl-pseudoaxis-common-q.sgml          |   40 -
 Documentation/api/tmpl/hkl-pseudoaxis-common.sgml  |   35 -
 Documentation/api/tmpl/hkl-pseudoaxis-e4cv.sgml    |   40 -
 Documentation/api/tmpl/hkl-pseudoaxis-e6c.sgml     |   40 -
 Documentation/api/tmpl/hkl-pseudoaxis-factory.sgml |   31 -
 Documentation/api/tmpl/hkl-pseudoaxis-k4cv.sgml    |   40 -
 Documentation/api/tmpl/hkl-pseudoaxis-k6c.sgml     |   40 -
 Documentation/api/tmpl/hkl-pseudoaxis-zaxis.sgml   |   31 -
 Documentation/api/tmpl/hkl-pseudoaxis.sgml         |  337 -
 Documentation/api/tmpl/hkl-quaternion.sgml         |  133 -
 Documentation/api/tmpl/hkl-sample.sgml             |  359 -
 Documentation/api/tmpl/hkl-source.sgml             |   87 -
 Documentation/api/tmpl/hkl-unit.sgml               |   51 -
 Documentation/api/tmpl/hkl-unused.sgml             |   38 -
 Documentation/api/tmpl/hkl-vector.sgml             |  278 -
 Documentation/figures/3S+1D.asy                    |   34 +
 Documentation/figures/3S+1D.png                    |  Bin 0 -> 49035 bytes
 Documentation/figures/4S+2D.asy                    |   34 +
 Documentation/figures/4S+2D.png                    |  Bin 0 -> 58425 bytes
 Documentation/figures/4S+2D_reciprocal.asy         |   58 +
 Documentation/figures/4S+2D_reciprocal.png         |  Bin 0 -> 76400 bytes
 Documentation/figures/4S+2D_reciprocal2.asy        |   50 +
 Documentation/figures/4S+2D_reciprocal2.png        |  Bin 0 -> 74791 bytes
 Documentation/figures/4S+2D_reciprocal3.asy        |   48 +
 Documentation/figures/4S+2D_reciprocal3.png        |  Bin 0 -> 73779 bytes
 Documentation/figures/4S+2D_reciprocal4.asy        |   54 +
 Documentation/figures/4S+2D_reciprocal4.png        |  Bin 0 -> 79030 bytes
 Documentation/figures/B_a.asy                      |   26 +
 Documentation/figures/B_a.png                      |  Bin 0 -> 12118 bytes
 Documentation/figures/B_b.asy                      |   23 +
 Documentation/figures/B_b.png                      |  Bin 0 -> 11568 bytes
 Documentation/figures/B_b3_y.asy                   |   29 +
 Documentation/figures/B_b3_y.png                   |  Bin 0 -> 7106 bytes
 Documentation/figures/Makefile.am                  |   49 +
 Documentation/figures/Makefile.in                  |  526 +
 Documentation/figures/crystal.asy                  |   52 +
 Documentation/figures/crystal.png                  |  Bin 0 -> 14846 bytes
 Documentation/figures/diffractometer.asy           |  180 +
 Documentation/figures/e2k_1.asy                    |   13 +
 Documentation/figures/e2k_1.png                    |  Bin 0 -> 56870 bytes
 Documentation/figures/e2k_2.asy                    |   13 +
 Documentation/figures/e2k_2.png                    |  Bin 0 -> 48259 bytes
 Documentation/figures/e2k_3.asy                    |   13 +
 Documentation/figures/e2k_3.png                    |  Bin 0 -> 61492 bytes
 Documentation/figures/e2k_4.asy                    |   13 +
 Documentation/figures/e2k_4.png                    |  Bin 0 -> 56110 bytes
 Documentation/figures/eulerians.asy                |   36 +
 Documentation/figures/k4cv.asy                     |   36 +
 Documentation/figures/k4cv.png                     |  Bin 0 -> 33576 bytes
 Documentation/figures/k6c.asy                      |   35 +
 Documentation/figures/k6c.png                      |  Bin 0 -> 43080 bytes
 Documentation/figures/qper_qpar.asy                |   66 +
 Documentation/figures/qper_qpar.png                |  Bin 0 -> 11953 bytes
 Documentation/figures/zaxis.asy                    |   71 +
 Documentation/figures/zaxis.png                    |  Bin 0 -> 120967 bytes
 Documentation/hkl.info                             |  595 +-
 Documentation/hkl.texi                             |  242 +-
 Documentation/sphinx/Makefile.am                   |   18 +
 Documentation/sphinx/Makefile.in                   |  492 +
 Documentation/sphinx/source/conf.py.in             |  220 +
 Documentation/sphinx/source/development.rst        |  473 +
 .../sphinx/source/diffractometers/e4cv.rst         |  108 +
 .../sphinx/source/diffractometers/e6c.rst          |  166 +
 .../sphinx/source/diffractometers/k4cv.rst         |  127 +
 .../sphinx/source/diffractometers/k6c.rst          |  185 +
 .../sphinx/source/diffractometers/mars.rst         |  101 +
 .../sphinx/source/diffractometers/med2_2.rst       |   54 +
 .../sphinx/source/diffractometers/zaxis.rst        |   55 +
 Documentation/sphinx/source/index.rst              |   37 +
 Documentation/sphinx/source/introduction.rst       |  818 +
 Documentation/sphinx/source/pseudo.rst             |  117 +
 Documentation/stamp-vti                            |    8 +-
 Documentation/version.texi                         |    8 +-
 INSTALL                                            |   15 +-
 Makefile.am                                        |   95 +-
 Makefile.in                                        |  592 +-
 NEWS                                               |   33 +
 README                                             |   10 +-
 TODO                                               |   59 +-
 aclocal.m4                                         |  934 +-
 config.h.in                                        |  158 +
 config/config.guess                                |  400 +-
 config/config.sub                                  |  284 +-
 config/depcomp                                     |  531 +-
 config/install-sh                                  |   35 +-
 config/ltmain.sh                                   | 4016 +--
 config/mdate-sh                                    |   37 +-
 config/missing                                     |  461 +-
 config/test-driver                                 |  127 +
 config/texinfo.tex                                 | 2376 +-
 configure                                          |10521 +++++---
 configure.ac                                       |  351 +-
 data/Makefile.am                                   |    4 +
 data/Makefile.in                                   |  530 +
 data/diffabs.dae                                   |  701 +
 data/diffabs.yaml                                  |   46 +
 gtk-doc.make                                       |  182 +-
 gui/Makefile.am                                    |   48 +-
 gui/Makefile.in                                    |  557 +-
 gui/ghkl.ui                                        |   72 +-
 gui/hkl-gui-3d.cpp                                 |  244 +
 gui/hkl-gui-3d.h                                   |   91 +
 gui/{ghkl-callbacks.cpp => hkl-gui-callbacks.cpp}  |  605 +-
 gui/{modelcolumns.h => hkl-gui-modelcolumns.h}     |  118 +-
 ...{pseudoaxesframe.cpp => hkl-gui-pseudoaxes.cpp} |  100 +-
 gui/{pseudoaxesframe.h => hkl-gui-pseudoaxes.h}    |   45 +-
 gui/{ghkl.cpp => hkl-gui.cpp}                      |  472 +-
 gui/{ghkl.h => hkl-gui.h}                          |   39 +-
 gui/hkl3d/GL_ShapeDrawer.cpp                       |  805 +
 gui/hkl3d/GL_ShapeDrawer.h                         |  111 +
 gui/hkl3d/Makefile.am                              |   47 +
 gui/hkl3d/Makefile.in                              |  714 +
 gui/hkl3d/hkl3d-gui-gl.c                           |  812 +
 gui/hkl3d/hkl3d-gui-gl.h                           |   64 +
 gui/hkl3d/hkl3d-gui-model.cpp                      |  407 +
 gui/hkl3d/hkl3d-gui-model.h                        |  121 +
 gui/hkl3d/hkl3d-gui-scene.cpp                      |  432 +
 gui/hkl3d/hkl3d-gui-scene.h                        |  120 +
 gui/hkl3d/hkl3d-gui-view.cpp                       |  222 +
 gui/hkl3d/hkl3d-gui-view.h                         |  109 +
 gui/hkl3d/texture.c                                |   42 +
 gui/hkl3d/texture.h                                |   30 +
 gui/hkl3d/trackball.c                              |  323 +
 gui/hkl3d/trackball.h                              |   77 +
 gui/main.cpp                                       |    7 +-
 gui/pseudo.ui                                      |   46 +-
 hkl.h                                              |  490 +-
 hkl.pc.in                                          |    2 +-
 hkl/Makefile.am                                    |  177 +-
 hkl/Makefile.in                                    |  772 +-
 hkl/ccan/Makefile.am                               |   22 +
 hkl/ccan/Makefile.in                               |  731 +
 hkl/ccan/array_size/array_size.h                   |   26 +
 hkl/ccan/autodata/autodata.c                       |   80 +
 hkl/ccan/autodata/autodata.h                       |  108 +
 hkl/ccan/build_assert/build_assert.h               |   40 +
 hkl/ccan/check_type/check_type.h                   |   64 +
 hkl/ccan/compiler/compiler.h                       |  217 +
 hkl/ccan/container_of/container_of.h               |  109 +
 hkl/ccan/darray/darray.h                           |  348 +
 hkl/ccan/list/list.c                               |   43 +
 hkl/ccan/list/list.h                               |  563 +
 hkl/ccan/noerr/noerr.c                             |   43 +
 hkl/ccan/noerr/noerr.h                             |   33 +
 hkl/ccan/ptr_valid/ptr_valid.c                     |  339 +
 hkl/ccan/ptr_valid/ptr_valid.h                     |  229 +
 hkl/{hkl-detector-factory.h => hkl-axis-private.h} |   27 +-
 hkl/hkl-axis.c                                     |  284 +-
 hkl/hkl-axis.h                                     |   99 -
 hkl/hkl-binding-private.h                          |   98 +
 hkl/hkl-binding.c                                  |  409 +
 hkl/hkl-detector-factory.c                         |   20 +-
 hkl/{hkl-detector.h => hkl-detector-private.h}     |   21 +-
 hkl/hkl-detector.c                                 |   85 +-
 hkl/{hkl-error.h => hkl-error-private.h}           |   14 +-
 hkl/hkl-error.c                                    |   90 +-
 ...kl-pseudoaxis-zaxis.h => hkl-factory-private.h} |   13 +-
 hkl/hkl-factory.c                                  |  737 +
 hkl/hkl-geometry-factory.c                         |  169 -
 hkl/hkl-geometry-factory.h                         |   46 -
 hkl/{hkl-geometry.h => hkl-geometry-private.h}     |   96 +-
 hkl/hkl-geometry.c                                 |  893 +-
 hkl/{hkl-interval.h => hkl-interval-private.h}     |   24 +-
 hkl/hkl-interval.c                                 |  166 +-
 ...kl-detector-factory.h => hkl-lattice-private.h} |   26 +-
 hkl/hkl-lattice.c                                  |  403 +-
 hkl/hkl-lattice.h                                  |   65 -
 hkl/hkl-list.h                                     |   88 -
 hkl/{hkl-macros.h => hkl-macros-private.h}         |   90 +-
 hkl/hkl-macros.c                                   |   24 +-
 hkl/{hkl-matrix.h => hkl-matrix-private.h}         |   27 +-
 hkl/hkl-matrix.c                                   |  125 +-
 hkl/hkl-parameter-private.h                        |  214 +
 hkl/hkl-parameter.c                                |  442 +-
 hkl/hkl-parameter.h                                |   80 -
 hkl/hkl-pseudoaxis-auto-private.h                  |  152 +
 hkl/hkl-pseudoaxis-auto.c                          |  223 +-
 hkl/hkl-pseudoaxis-auto.h                          |   38 -
 ...h => hkl-pseudoaxis-common-eulerians-private.h} |   16 +-
 hkl/hkl-pseudoaxis-common-eulerians.c              |  232 +-
 hkl/hkl-pseudoaxis-common-hkl-private.h            |  114 +
 hkl/hkl-pseudoaxis-common-hkl.c                    |  714 +-
 hkl/hkl-pseudoaxis-common-hkl.h                    |   59 -
 ...n-psi.h => hkl-pseudoaxis-common-psi-private.h} |   37 +-
 hkl/hkl-pseudoaxis-common-psi.c                    |  282 +-
 ...-common.h => hkl-pseudoaxis-common-q-private.h} |   21 +-
 hkl/hkl-pseudoaxis-common-q.c                      |  494 +-
 hkl/hkl-pseudoaxis-common.c                        |   49 -
 hkl/hkl-pseudoaxis-e4c-hkl.c                       |  166 +
 ...doaxis-zaxis.h => hkl-pseudoaxis-e4c-private.h} |   13 +-
 hkl/hkl-pseudoaxis-e4c-psi.c                       |   57 +
 hkl/hkl-pseudoaxis-e4cv-hkl.c                      |  140 -
 hkl/hkl-pseudoaxis-e4cv-psi.c                      |   40 -
 hkl/hkl-pseudoaxis-e4cv.h                          |   34 -
 hkl/hkl-pseudoaxis-e6c-hkl.c                       |  400 +-
 ...eudoaxis-e6c.h => hkl-pseudoaxis-e6c-private.h} |    8 +-
 hkl/hkl-pseudoaxis-e6c-psi.c                       |   48 +-
 hkl/hkl-pseudoaxis-factory.c                       |  140 -
 hkl/hkl-pseudoaxis-k4cv-hkl.c                      |  466 +-
 ...doaxis-k4cv.h => hkl-pseudoaxis-k4cv-private.h} |    8 +-
 hkl/hkl-pseudoaxis-k4cv-psi.c                      |   48 +-
 hkl/hkl-pseudoaxis-k6c-hkl.c                       |  805 +-
 ...eudoaxis-k6c.h => hkl-pseudoaxis-k6c-private.h} |    8 +-
 hkl/hkl-pseudoaxis-k6c-psi.c                       |   40 +-
 hkl/hkl-pseudoaxis-petra3-hkl.c                    |  181 +
 ...-common-q.h => hkl-pseudoaxis-petra3-private.h} |   17 +-
 hkl/hkl-pseudoaxis-private.h                       |  348 +
 ....h => hkl-pseudoaxis-soleil-sixs-med-private.h} |   21 +-
 hkl/hkl-pseudoaxis-soleil-sixs-med.c               |  285 +
 hkl/hkl-pseudoaxis-zaxis-hkl.c                     |  108 +-
 ...axis-zaxis.h => hkl-pseudoaxis-zaxis-private.h} |    6 +-
 hkl/hkl-pseudoaxis.c                               |  913 +-
 hkl/hkl-pseudoaxis.h                               |  184 -
 hkl/{hkl-quaternion.h => hkl-quaternion-private.h} |   16 +-
 hkl/hkl-quaternion.c                               |   46 +-
 hkl/{hkl-detector.h => hkl-sample-private.h}       |   50 +-
 hkl/hkl-sample.c                                   |  869 +-
 hkl/hkl-sample.h                                   |  154 -
 hkl/{hkl-source.h => hkl-source-private.h}         |   14 +-
 hkl/hkl-source.c                                   |   88 +-
 hkl/hkl-type-builtins.c                            |   27 +
 hkl/hkl-type-builtins.c.template                   |   38 +
 hkl/hkl-type-builtins.h                            |   19 +
 hkl/hkl-type-builtins.h.template                   |   24 +
 hkl/hkl-types.c                                    |  253 +
 hkl/hkl-types.h                                    |   85 +
 hkl/{hkl-unit.h => hkl-unit-private.h}             |   25 +-
 hkl/hkl-unit.c                                     |   61 +-
 hkl/{hkl-vector.h => hkl-vector-private.h}         |   34 +-
 hkl/hkl-vector.c                                   |  209 +-
 hkl.pc.in => hkl3d.pc.in                           |    9 +-
 hkl3d/Makefile.am                                  |   41 +
 hkl3d/Makefile.in                                  |  847 +
 hkl3d/bullet/AUTHORS                               |   22 +
 hkl3d/bullet/COPYING                               |  674 +
 hkl3d/bullet/ChangeLog                             |  755 +
 hkl3d/bullet/Makefile.am                           |    3 +
 hkl3d/bullet/Makefile.in                           |  656 +
 hkl3d/bullet/NEWS                                  |    4 +
 hkl3d/bullet/README                                |    7 +
 hkl3d/bullet/src/Bullet-C-Api.h                    |  176 +
 .../BroadphaseCollision/btAxisSweep3.cpp           |   37 +
 .../BroadphaseCollision/btAxisSweep3.h             | 1051 +
 .../BroadphaseCollision/btBroadphaseInterface.h    |   82 +
 .../BroadphaseCollision/btBroadphaseProxy.cpp      |   17 +
 .../BroadphaseCollision/btBroadphaseProxy.h        |  270 +
 .../BroadphaseCollision/btCollisionAlgorithm.cpp   |   23 +
 .../BroadphaseCollision/btCollisionAlgorithm.h     |   80 +
 .../BulletCollision/BroadphaseCollision/btDbvt.cpp | 1295 +
 .../BulletCollision/BroadphaseCollision/btDbvt.h   | 1256 +
 .../BroadphaseCollision/btDbvtBroadphase.cpp       |  796 +
 .../BroadphaseCollision/btDbvtBroadphase.h         |  146 +
 .../BroadphaseCollision/btDispatcher.cpp           |   22 +
 .../BroadphaseCollision/btDispatcher.h             |  110 +
 .../BroadphaseCollision/btMultiSapBroadphase.cpp   |  489 +
 .../BroadphaseCollision/btMultiSapBroadphase.h     |  151 +
 .../BroadphaseCollision/btOverlappingPairCache.cpp |  633 +
 .../BroadphaseCollision/btOverlappingPairCache.h   |  469 +
 .../btOverlappingPairCallback.h                    |   40 +
 .../BroadphaseCollision/btQuantizedBvh.cpp         | 1375 ++
 .../BroadphaseCollision/btQuantizedBvh.h           |  579 +
 .../BroadphaseCollision/btSimpleBroadphase.cpp     |  349 +
 .../BroadphaseCollision/btSimpleBroadphase.h       |  171 +
 .../CollisionDispatch/SphereTriangleDetector.cpp   |  201 +
 .../CollisionDispatch/SphereTriangleDetector.h     |   51 +
 .../btActivatingCollisionAlgorithm.cpp             |   47 +
 .../btActivatingCollisionAlgorithm.h               |   36 +
 .../btBox2dBox2dCollisionAlgorithm.cpp             |  435 +
 .../btBox2dBox2dCollisionAlgorithm.h               |   66 +
 .../btBoxBoxCollisionAlgorithm.cpp                 |   85 +
 .../CollisionDispatch/btBoxBoxCollisionAlgorithm.h |   66 +
 .../CollisionDispatch/btBoxBoxDetector.cpp         |  718 +
 .../CollisionDispatch/btBoxBoxDetector.h           |   44 +
 .../CollisionDispatch/btCollisionConfiguration.h   |   48 +
 .../CollisionDispatch/btCollisionCreateFunc.h      |   45 +
 .../CollisionDispatch/btCollisionDispatcher.cpp    |  310 +
 .../CollisionDispatch/btCollisionDispatcher.h      |  172 +
 .../CollisionDispatch/btCollisionObject.cpp        |  116 +
 .../CollisionDispatch/btCollisionObject.h          |  524 +
 .../CollisionDispatch/btCollisionWorld.cpp         | 1513 ++
 .../CollisionDispatch/btCollisionWorld.h           |  509 +
 .../btCompoundCollisionAlgorithm.cpp               |  353 +
 .../btCompoundCollisionAlgorithm.h                 |   86 +
 .../btConvex2dConvex2dAlgorithm.cpp                |  247 +
 .../btConvex2dConvex2dAlgorithm.h                  |   95 +
 .../btConvexConcaveCollisionAlgorithm.cpp          |  312 +
 .../btConvexConcaveCollisionAlgorithm.h            |  116 +
 .../CollisionDispatch/btConvexConvexAlgorithm.cpp  |  679 +
 .../CollisionDispatch/btConvexConvexAlgorithm.h    |  109 +
 .../btConvexPlaneCollisionAlgorithm.cpp            |  155 +
 .../btConvexPlaneCollisionAlgorithm.h              |   84 +
 .../btDefaultCollisionConfiguration.cpp            |  298 +
 .../btDefaultCollisionConfiguration.h              |  135 +
 .../btEmptyCollisionAlgorithm.cpp                  |   34 +
 .../CollisionDispatch/btEmptyCollisionAlgorithm.h  |   54 +
 .../CollisionDispatch/btGhostObject.cpp            |  171 +
 .../CollisionDispatch/btGhostObject.h              |  175 +
 .../CollisionDispatch/btInternalEdgeUtility.cpp    |  842 +
 .../CollisionDispatch/btInternalEdgeUtility.h      |   46 +
 .../CollisionDispatch/btManifoldResult.cpp         |  135 +
 .../CollisionDispatch/btManifoldResult.h           |  128 +
 .../btSimulationIslandManager.cpp                  |  443 +
 .../CollisionDispatch/btSimulationIslandManager.h  |   81 +
 .../btSphereBoxCollisionAlgorithm.cpp              |  260 +
 .../btSphereBoxCollisionAlgorithm.h                |   75 +
 .../btSphereSphereCollisionAlgorithm.cpp           |  105 +
 .../btSphereSphereCollisionAlgorithm.h             |   66 +
 .../btSphereTriangleCollisionAlgorithm.cpp         |   84 +
 .../btSphereTriangleCollisionAlgorithm.h           |   69 +
 .../CollisionDispatch/btUnionFind.cpp              |   82 +
 .../CollisionDispatch/btUnionFind.h                |  129 +
 .../CollisionShapes/btBox2dShape.cpp               |   42 +
 .../BulletCollision/CollisionShapes/btBox2dShape.h |  363 +
 .../BulletCollision/CollisionShapes/btBoxShape.cpp |   41 +
 .../BulletCollision/CollisionShapes/btBoxShape.h   |  318 +
 .../CollisionShapes/btBvhTriangleMeshShape.cpp     |  466 +
 .../CollisionShapes/btBvhTriangleMeshShape.h       |  139 +
 .../CollisionShapes/btCapsuleShape.cpp             |  171 +
 .../CollisionShapes/btCapsuleShape.h               |  173 +
 .../CollisionShapes/btCollisionMargin.h            |   26 +
 .../CollisionShapes/btCollisionShape.cpp           |  119 +
 .../CollisionShapes/btCollisionShape.h             |  150 +
 .../CollisionShapes/btCompoundShape.cpp            |  356 +
 .../CollisionShapes/btCompoundShape.h              |  212 +
 .../CollisionShapes/btConcaveShape.cpp             |   27 +
 .../CollisionShapes/btConcaveShape.h               |   60 +
 .../CollisionShapes/btConeShape.cpp                |  143 +
 .../BulletCollision/CollisionShapes/btConeShape.h  |  103 +
 .../CollisionShapes/btConvex2dShape.cpp            |   92 +
 .../CollisionShapes/btConvex2dShape.h              |   80 +
 .../CollisionShapes/btConvexHullShape.cpp          |  211 +
 .../CollisionShapes/btConvexHullShape.h            |  120 +
 .../CollisionShapes/btConvexInternalShape.cpp      |  151 +
 .../CollisionShapes/btConvexInternalShape.h        |  202 +
 .../CollisionShapes/btConvexPointCloudShape.cpp    |  157 +
 .../CollisionShapes/btConvexPointCloudShape.h      |  105 +
 .../CollisionShapes/btConvexPolyhedron.cpp         |  185 +
 .../CollisionShapes/btConvexPolyhedron.h           |   54 +
 .../CollisionShapes/btConvexShape.cpp              |  429 +
 .../CollisionShapes/btConvexShape.h                |   82 +
 .../CollisionShapes/btConvexTriangleMeshShape.cpp  |  315 +
 .../CollisionShapes/btConvexTriangleMeshShape.h    |   75 +
 .../CollisionShapes/btCylinderShape.cpp            |  279 +
 .../CollisionShapes/btCylinderShape.h              |  200 +
 .../CollisionShapes/btEmptyShape.cpp               |   50 +
 .../BulletCollision/CollisionShapes/btEmptyShape.h |   70 +
 .../CollisionShapes/btHeightfieldTerrainShape.cpp  |  411 +
 .../CollisionShapes/btHeightfieldTerrainShape.h    |  161 +
 .../BulletCollision/CollisionShapes/btMaterial.h   |   35 +
 .../CollisionShapes/btMinkowskiSumShape.cpp        |   60 +
 .../CollisionShapes/btMinkowskiSumShape.h          |   60 +
 .../CollisionShapes/btMultiSphereShape.cpp         |  167 +
 .../CollisionShapes/btMultiSphereShape.h           |   99 +
 .../btMultimaterialTriangleMeshShape.cpp           |   45 +
 .../btMultimaterialTriangleMeshShape.h             |  120 +
 .../CollisionShapes/btOptimizedBvh.cpp             |  391 +
 .../CollisionShapes/btOptimizedBvh.h               |   65 +
 .../CollisionShapes/btPolyhedralConvexShape.cpp    |  338 +
 .../CollisionShapes/btPolyhedralConvexShape.h      |  112 +
 .../btScaledBvhTriangleMeshShape.cpp               |  123 +
 .../CollisionShapes/btScaledBvhTriangleMeshShape.h |   93 +
 .../CollisionShapes/btShapeHull.cpp                |  170 +
 .../BulletCollision/CollisionShapes/btShapeHull.h  |   59 +
 .../CollisionShapes/btSphereShape.cpp              |   71 +
 .../CollisionShapes/btSphereShape.h                |   73 +
 .../CollisionShapes/btStaticPlaneShape.cpp         |  107 +
 .../CollisionShapes/btStaticPlaneShape.h           |  103 +
 .../CollisionShapes/btStridingMeshInterface.cpp    |  379 +
 .../CollisionShapes/btStridingMeshInterface.h      |  162 +
 .../CollisionShapes/btTetrahedronShape.cpp         |  218 +
 .../CollisionShapes/btTetrahedronShape.h           |   74 +
 .../CollisionShapes/btTriangleBuffer.cpp           |   35 +
 .../CollisionShapes/btTriangleBuffer.h             |   69 +
 .../CollisionShapes/btTriangleCallback.cpp         |   28 +
 .../CollisionShapes/btTriangleCallback.h           |   42 +
 .../CollisionShapes/btTriangleIndexVertexArray.cpp |   95 +
 .../CollisionShapes/btTriangleIndexVertexArray.h   |  131 +
 .../btTriangleIndexVertexMaterialArray.cpp         |   86 +
 .../btTriangleIndexVertexMaterialArray.h           |   84 +
 .../CollisionShapes/btTriangleInfoMap.h            |  240 +
 .../CollisionShapes/btTriangleMesh.cpp             |  140 +
 .../CollisionShapes/btTriangleMesh.h               |   69 +
 .../CollisionShapes/btTriangleMeshShape.cpp        |  211 +
 .../CollisionShapes/btTriangleMeshShape.h          |   89 +
 .../CollisionShapes/btTriangleShape.h              |  182 +
 .../CollisionShapes/btUniformScalingShape.cpp      |  160 +
 .../CollisionShapes/btUniformScalingShape.h        |   87 +
 .../src/BulletCollision/Gimpact/btBoxCollision.h   |  647 +
 .../src/BulletCollision/Gimpact/btClipPolygon.h    |  182 +
 .../BulletCollision/Gimpact/btContactProcessing.h  |  145 +
 .../src/BulletCollision/Gimpact/btGImpactBvh.cpp   |  498 +
 .../src/BulletCollision/Gimpact/btGImpactBvh.h     |  396 +
 .../Gimpact/btGImpactCollisionAlgorithm.cpp        |  904 +
 .../Gimpact/btGImpactCollisionAlgorithm.h          |  306 +
 .../BulletCollision/Gimpact/btGImpactMassUtil.h    |   60 +
 .../Gimpact/btGImpactQuantizedBvh.cpp              |  528 +
 .../Gimpact/btGImpactQuantizedBvh.h                |  372 +
 .../src/BulletCollision/Gimpact/btGImpactShape.cpp |  203 +
 .../src/BulletCollision/Gimpact/btGImpactShape.h   | 1171 +
 .../Gimpact/btGenericPoolAllocator.h               |  163 +
 .../BulletCollision/Gimpact/btGeometryOperations.h |  212 +
 .../src/BulletCollision/Gimpact/btQuantization.h   |   88 +
 .../BulletCollision/Gimpact/btTriangleShapeEx.cpp  |  218 +
 .../BulletCollision/Gimpact/btTriangleShapeEx.h    |  180 +
 .../bullet/src/BulletCollision/Gimpact/gim_array.h |  326 +
 .../Gimpact/gim_basic_geometry_operations.h        |  543 +
 .../src/BulletCollision/Gimpact/gim_bitset.h       |  123 +
 .../BulletCollision/Gimpact/gim_box_collision.h    |  590 +
 .../src/BulletCollision/Gimpact/gim_box_set.cpp    |  182 +
 .../src/BulletCollision/Gimpact/gim_box_set.h      |  674 +
 .../src/BulletCollision/Gimpact/gim_clip_polygon.h |  210 +
 .../src/BulletCollision/Gimpact/gim_contact.cpp    |  146 +
 .../src/BulletCollision/Gimpact/gim_contact.h      |  164 +
 .../src/BulletCollision/Gimpact/gim_geom_types.h   |   97 +
 .../src/BulletCollision/Gimpact/gim_geometry.h     |   42 +
 .../src/BulletCollision/Gimpact/gim_hash_table.h   |  902 +
 .../src/BulletCollision/Gimpact/gim_linear_math.h  | 1573 ++
 .../bullet/src/BulletCollision/Gimpact/gim_math.h  |  157 +
 .../src/BulletCollision/Gimpact/gim_memory.cpp     |  135 +
 .../src/BulletCollision/Gimpact/gim_memory.h       |  190 +
 .../src/BulletCollision/Gimpact/gim_radixsort.h    |  406 +
 .../BulletCollision/Gimpact/gim_tri_collision.cpp  |  640 +
 .../BulletCollision/Gimpact/gim_tri_collision.h    |  379 +
 .../btContinuousConvexCollision.cpp                |  243 +
 .../btContinuousConvexCollision.h                  |   59 +
 .../NarrowPhaseCollision/btConvexCast.cpp          |   20 +
 .../NarrowPhaseCollision/btConvexCast.h            |   73 +
 .../btConvexPenetrationDepthSolver.h               |   42 +
 .../btDiscreteCollisionDetectorInterface.h         |   91 +
 .../NarrowPhaseCollision/btGjkConvexCast.cpp       |  176 +
 .../NarrowPhaseCollision/btGjkConvexCast.h         |   50 +
 .../NarrowPhaseCollision/btGjkEpa2.cpp             |  989 +
 .../NarrowPhaseCollision/btGjkEpa2.h               |   75 +
 .../btGjkEpaPenetrationDepthSolver.cpp             |   66 +
 .../btGjkEpaPenetrationDepthSolver.h               |   43 +
 .../NarrowPhaseCollision/btGjkPairDetector.cpp     |  457 +
 .../NarrowPhaseCollision/btGjkPairDetector.h       |  103 +
 .../NarrowPhaseCollision/btManifoldPoint.h         |  158 +
 .../btMinkowskiPenetrationDepthSolver.cpp          |  362 +
 .../btMinkowskiPenetrationDepthSolver.h            |   40 +
 .../NarrowPhaseCollision/btPersistentManifold.cpp  |  260 +
 .../NarrowPhaseCollision/btPersistentManifold.h    |  232 +
 .../NarrowPhaseCollision/btPointCollector.h        |   64 +
 .../btPolyhedralContactClipping.cpp                |  360 +
 .../btPolyhedralContactClipping.h                  |   46 +
 .../NarrowPhaseCollision/btRaycastCallback.cpp     |  177 +
 .../NarrowPhaseCollision/btRaycastCallback.h       |   72 +
 .../btSimplexSolverInterface.h                     |   63 +
 .../btSubSimplexConvexCast.cpp                     |  160 +
 .../NarrowPhaseCollision/btSubSimplexConvexCast.h  |   50 +
 .../btVoronoiSimplexSolver.cpp                     |  609 +
 .../NarrowPhaseCollision/btVoronoiSimplexSolver.h  |  179 +
 .../Character/btCharacterControllerInterface.h     |   46 +
 .../Character/btKinematicCharacterController.cpp   |  641 +
 .../Character/btKinematicCharacterController.h     |  162 +
 .../ConstraintSolver/btConeTwistConstraint.cpp     | 1127 +
 .../ConstraintSolver/btConeTwistConstraint.h       |  346 +
 .../ConstraintSolver/btConstraintSolver.h          |   52 +
 .../ConstraintSolver/btContactConstraint.cpp       |  178 +
 .../ConstraintSolver/btContactConstraint.h         |   71 +
 .../ConstraintSolver/btContactSolverInfo.h         |   87 +
 .../ConstraintSolver/btGeneric6DofConstraint.cpp   | 1070 +
 .../ConstraintSolver/btGeneric6DofConstraint.h     |  614 +
 .../btGeneric6DofSpringConstraint.cpp              |  172 +
 .../btGeneric6DofSpringConstraint.h                |   97 +
 .../ConstraintSolver/btHinge2Constraint.cpp        |   66 +
 .../ConstraintSolver/btHinge2Constraint.h          |   58 +
 .../ConstraintSolver/btHingeConstraint.cpp         | 1033 +
 .../ConstraintSolver/btHingeConstraint.h           |  381 +
 .../ConstraintSolver/btJacobianEntry.h             |  156 +
 .../ConstraintSolver/btPoint2PointConstraint.cpp   |  230 +
 .../ConstraintSolver/btPoint2PointConstraint.h     |  161 +
 .../btSequentialImpulseConstraintSolver.cpp        | 1239 +
 .../btSequentialImpulseConstraintSolver.h          |  128 +
 .../ConstraintSolver/btSliderConstraint.cpp        |  857 +
 .../ConstraintSolver/btSliderConstraint.h          |  333 +
 .../ConstraintSolver/btSolve2LinearConstraint.cpp  |  255 +
 .../ConstraintSolver/btSolve2LinearConstraint.h    |  107 +
 .../BulletDynamics/ConstraintSolver/btSolverBody.h |  191 +
 .../ConstraintSolver/btSolverConstraint.h          |   96 +
 .../ConstraintSolver/btTypedConstraint.cpp         |  214 +
 .../ConstraintSolver/btTypedConstraint.h           |  436 +
 .../ConstraintSolver/btUniversalConstraint.cpp     |   87 +
 .../ConstraintSolver/btUniversalConstraint.h       |   62 +
 .../src/BulletDynamics/Dynamics/Bullet-C-API.cpp   |  405 +
 .../BulletDynamics/Dynamics/btActionInterface.h    |   46 +
 .../Dynamics/btContinuousDynamicsWorld.cpp         |  196 +
 .../Dynamics/btContinuousDynamicsWorld.h           |   46 +
 .../Dynamics/btDiscreteDynamicsWorld.cpp           | 1348 ++
 .../Dynamics/btDiscreteDynamicsWorld.h             |  200 +
 .../src/BulletDynamics/Dynamics/btDynamicsWorld.h  |  151 +
 .../src/BulletDynamics/Dynamics/btRigidBody.cpp    |  402 +
 .../src/BulletDynamics/Dynamics/btRigidBody.h      |  691 +
 .../Dynamics/btSimpleDynamicsWorld.cpp             |  280 +
 .../Dynamics/btSimpleDynamicsWorld.h               |   89 +
 .../BulletDynamics/Vehicle/btRaycastVehicle.cpp    |  771 +
 .../src/BulletDynamics/Vehicle/btRaycastVehicle.h  |  236 +
 .../BulletDynamics/Vehicle/btVehicleRaycaster.h    |   35 +
 .../src/BulletDynamics/Vehicle/btWheelInfo.cpp     |   56 +
 .../src/BulletDynamics/Vehicle/btWheelInfo.h       |  119 +
 .../GpuSoftBodySolvers/CPU/btSoftBodySolverData.h  |  744 +
 .../CPU/btSoftBodySolver_CPU.cpp                   |  979 +
 .../GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h  |  370 +
 hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h |  117 +
 .../src/BulletMultiThreaded/PlatformDefinitions.h  |   99 +
 .../src/BulletMultiThreaded/PosixThreadSupport.cpp |  399 +
 .../src/BulletMultiThreaded/PosixThreadSupport.h   |  142 +
 .../src/BulletMultiThreaded/PpuAddressSpace.h      |   37 +
 .../SequentialThreadSupport.cpp                    |  169 +
 .../BulletMultiThreaded/SequentialThreadSupport.h  |   96 +
 .../SpuCollisionObjectWrapper.cpp                  |   48 +
 .../SpuCollisionObjectWrapper.h                    |   40 +
 .../SpuCollisionTaskProcess.cpp                    |  317 +
 .../BulletMultiThreaded/SpuCollisionTaskProcess.h  |  163 +
 .../SpuContactManifoldCollisionAlgorithm.cpp       |   69 +
 .../SpuContactManifoldCollisionAlgorithm.h         |  120 +
 .../src/BulletMultiThreaded/SpuDoubleBuffer.h      |  126 +
 .../bullet/src/BulletMultiThreaded/SpuFakeDma.cpp  |  215 +
 hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h  |  135 +
 .../SpuGatheringCollisionDispatcher.cpp            |  275 +
 .../SpuGatheringCollisionDispatcher.h              |   72 +
 .../src/BulletMultiThreaded/SpuLibspe2Support.cpp  |  257 +
 .../src/BulletMultiThreaded/SpuLibspe2Support.h    |  180 +
 .../SpuNarrowPhaseCollisionTask/Box.h              |  167 +
 .../SpuCollisionShapes.cpp                         |  302 +
 .../SpuCollisionShapes.h                           |  128 +
 .../SpuContactResult.cpp                           |  248 +
 .../SpuNarrowPhaseCollisionTask/SpuContactResult.h |  106 +
 .../SpuConvexPenetrationDepthSolver.h              |   51 +
 .../SpuGatheringCollisionTask.cpp                  | 1412 ++
 .../SpuGatheringCollisionTask.h                    |  140 +
 .../SpuNarrowPhaseCollisionTask/SpuLocalSupport.h  |   19 +
 .../SpuMinkowskiPenetrationDepthSolver.cpp         |  348 +
 .../SpuMinkowskiPenetrationDepthSolver.h           |   48 +
 .../SpuPreferredPenetrationDirections.h            |   70 +
 .../SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp | 1160 +
 .../SpuNarrowPhaseCollisionTask/boxBoxDistance.h   |   65 +
 .../SpuSampleTask/SpuSampleTask.cpp                |  214 +
 .../SpuSampleTask/SpuSampleTask.h                  |   54 +
 .../BulletMultiThreaded/SpuSampleTaskProcess.cpp   |  222 +
 .../src/BulletMultiThreaded/SpuSampleTaskProcess.h |  153 +
 hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h     |  149 +
 hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h  |   79 +
 hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h |  339 +
 .../src/BulletMultiThreaded/Win32ThreadSupport.cpp |  446 +
 .../src/BulletMultiThreaded/Win32ThreadSupport.h   |  138 +
 .../btThreadSupportInterface.cpp                   |   22 +
 .../BulletMultiThreaded/btThreadSupportInterface.h |   85 +
 hkl3d/bullet/src/LinearMath/btAabbUtil2.h          |  236 +
 hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp |  182 +
 hkl3d/bullet/src/LinearMath/btAlignedAllocator.h   |  107 +
 hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h |  471 +
 hkl3d/bullet/src/LinearMath/btConvexHull.cpp       | 1174 +
 hkl3d/bullet/src/LinearMath/btConvexHull.h         |  241 +
 .../bullet/src/LinearMath/btConvexHullComputer.cpp | 2749 +++
 hkl3d/bullet/src/LinearMath/btConvexHullComputer.h |  103 +
 hkl3d/bullet/src/LinearMath/btDefaultMotionState.h |   40 +
 hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp     |  185 +
 hkl3d/bullet/src/LinearMath/btGeometryUtil.h       |   42 +
 hkl3d/bullet/src/LinearMath/btHashMap.h            |  450 +
 hkl3d/bullet/src/LinearMath/btIDebugDraw.h         |  417 +
 hkl3d/bullet/src/LinearMath/btList.h               |   73 +
 hkl3d/bullet/src/LinearMath/btMatrix3x3.h          |  771 +
 hkl3d/bullet/src/LinearMath/btMinMax.h             |   71 +
 hkl3d/bullet/src/LinearMath/btMotionState.h        |   40 +
 hkl3d/bullet/src/LinearMath/btPoolAllocator.h      |  121 +
 hkl3d/bullet/src/LinearMath/btQuadWord.h           |  180 +
 hkl3d/bullet/src/LinearMath/btQuaternion.h         |  433 +
 hkl3d/bullet/src/LinearMath/btQuickprof.cpp        |  565 +
 hkl3d/bullet/src/LinearMath/btQuickprof.h          |  196 +
 hkl3d/bullet/src/LinearMath/btRandom.h             |   42 +
 hkl3d/bullet/src/LinearMath/btScalar.h             |  522 +
 hkl3d/bullet/src/LinearMath/btSerializer.cpp       |  832 +
 hkl3d/bullet/src/LinearMath/btSerializer.h         |  655 +
 hkl3d/bullet/src/LinearMath/btStackAlloc.h         |  116 +
 hkl3d/bullet/src/LinearMath/btTransform.h          |  307 +
 hkl3d/bullet/src/LinearMath/btTransformUtil.h      |  228 +
 hkl3d/bullet/src/LinearMath/btVector3.h            |  766 +
 hkl3d/bullet/src/Makefile.am                       |  358 +
 hkl3d/bullet/src/Makefile.in                       | 2212 ++
 hkl3d/bullet/src/btBulletCollisionCommon.h         |   69 +
 hkl3d/bullet/src/btBulletDynamicsCommon.h          |   49 +
 hkl3d/hkl3d.cpp                                    | 1233 +
 hkl3d/hkl3d.h                                      |  186 +
 m4/gtk-doc.m4                                      |    6 +
 m4/libtool.m4                                      | 2248 +-
 m4/ltoptions.m4                                    |   32 +-
 m4/ltversion.m4                                    |   12 +-
 m4/lt~obsolete.m4                                  |   12 +-
 test/Makefile.am                                   |   42 -
 test/bench.c                                       |  219 -
 test/hkl-test-axis.c                               |  184 -
 test/hkl-test-lattice.c                            |  237 -
 test/hkl-test-matrix.c                             |  169 -
 test/hkl-test-parameter.c                          |  141 -
 test/hkl-test-pseudoaxis-e4cv.c                    |  479 -
 test/hkl-test-pseudoaxis-e6c.c                     |  255 -
 test/hkl-test-pseudoaxis-k4cv.c                    |  271 -
 test/hkl-test-pseudoaxis-k6c.c                     |  392 -
 test/hkl-test-pseudoaxis.c                         |  191 -
 test/hkl-test-sample.c                             |  494 -
 test/hkl-test-vector.c                             |  219 -
 test/hkl-test.c                                    |  108 -
 test/hkl-test.h                                    |  115 -
 test/main.c                                        |   56 -
 tests/Makefile.am                                  |   64 +
 tests/Makefile.in                                  | 1054 +
 tests/bindings/Makefile.am                         |    9 +
 tests/bindings/Makefile.in                         |  862 +
 tests/bindings/python.py                           |  265 +
 tests/bindings/trajectory.py                       |  144 +
 tests/hkl-axis-t.c                                 |  211 +
 tests/hkl-bench-t.c                                |  191 +
 test/hkl-test-detector.c => tests/hkl-detector-t.c |   60 +-
 test/hkl-test-error.c => tests/hkl-error-t.c       |   73 +-
 test/hkl-test-geometry.c => tests/hkl-geometry-t.c |  218 +-
 test/hkl-test-interval.c => tests/hkl-interval-t.c |  193 +-
 tests/hkl-lattice-t.c                              |  228 +
 tests/hkl-matrix-t.c                               |  153 +
 tests/hkl-parameter-t.c                            |  139 +
 tests/hkl-pseudoaxis-e4ch-t.c                      |  426 +
 tests/hkl-pseudoaxis-e4cv-t.c                      |  428 +
 tests/hkl-pseudoaxis-e6c-t.c                       |  543 +
 tests/hkl-pseudoaxis-k4cv-t.c                      |  229 +
 tests/hkl-pseudoaxis-k6c-t.c                       |  278 +
 tests/hkl-pseudoaxis-soleil-sixs-med-t.c           |  107 +
 tests/hkl-pseudoaxis-t.c                           |  200 +
 tests/hkl-pseudoaxis-zaxis-t.c                     |  107 +
 .../hkl-quaternion-t.c                             |  125 +-
 tests/hkl-sample-t.c                               |  426 +
 test/hkl-test-source.c => tests/hkl-source-t.c     |   70 +-
 gui/main.cpp => tests/hkl-unit-t.c                 |   37 +-
 tests/hkl-vector-t.c                               |  246 +
 tests/hkl3d-test-t.c                               |  160 +
 tests/runtests.c                                   | 1377 ++
 tests/tap/Makefile.am                              |   20 +
 {test => tests/tap}/Makefile.in                    |  472 +-
 tests/tap/basic.c                                  |  629 +
 tests/tap/basic.h                                  |  134 +
 tests/tap/float.c                                  |   67 +
 tests/tap/float.h                                  |   42 +
 tests/tap/hkl-tap.c                                |   89 +
 .../tap/hkl-tap.h                                  |   17 +-
 tests/tap/macros.h                                 |   88 +
 706 files changed, 167658 insertions(+), 38006 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index b66b194..6c17c55 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,4 @@
 Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
 Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
-Jens Krüger <Jens.Krueger at frm2.tum.de>
\ No newline at end of file
+Jens Krüger <Jens.Krueger at frm2.tum.de>
+Oussama Sboui <sboui at synchrotorn-soleil.fr>
\ No newline at end of file
diff --git a/ChangeLog b/ChangeLog
index ceac779..283f881 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,8589 @@
 # Generated by Makefile. Do not edit.
 
+commit 4896e99f93044f072ea8a4ce89c8ebbcb06cd20c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jul 17 15:18:22 2013 +0200
+
+    export the reciprocal lattice method
+
+ hkl/hkl-lattice.c        | 11 ++++++-----
+ tests/bindings/python.py |  4 ++++
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+commit 4fd00ca81dee14f600e3455bd6b17696a45a407f
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jul 17 15:02:58 2013 +0200
+
+    export a few method into the binding
+    
+    hkl_sample_compute_UB_busing_levy
+    hkl_sample_affine
+    hkl_sample_get_reflection_mesured_angle
+    hkl_sample_get_reflection_theoretical_angle
+
+ hkl/hkl-sample.c         | 38 +++++++++++++++++++-------------------
+ tests/bindings/python.py | 14 +++++++++-----
+ 2 files changed, 28 insertions(+), 24 deletions(-)
+
+commit 3907b5835ed03db0b4b4f8ab789c0735a704a420
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jul 17 14:52:52 2013 +0200
+
+    check that the sample.copy() method is working
+
+ tests/bindings/python.py | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+commit 4d200454b738652d9e2d2fff31e4415cf9c5698a
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jul 17 14:41:39 2013 +0200
+
+    now the get/set_hkl method of the HklSampleReflection are exposed into the binding
+
+ hkl/hkl-sample.c         | 24 ++++++++++++------------
+ tests/bindings/python.py | 12 ++++++++++--
+ 2 files changed, 22 insertions(+), 14 deletions(-)
+
+commit 5cd80efd92d2c8747c8c69fa61f8b34f9f8e3fcd
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jul 17 14:30:46 2013 +0200
+
+    now add_reflection and del_reflection are working
+
+ gui/hkl-gui-callbacks.cpp |  3 ++-
+ hkl.h                     |  5 +++--
+ hkl/hkl-binding-private.h |  5 +++++
+ hkl/hkl-binding.c         | 28 ++++++++++++++++++++++++++++
+ hkl/hkl-sample.c          | 26 +++++++++++++++++---------
+ tests/bindings/python.py  | 10 ++++------
+ tests/hkl-sample-t.c      |  5 ++++-
+ 7 files changed, 63 insertions(+), 19 deletions(-)
+
+commit 2b0830e235181c8757a4cd6e64ebebce11565625
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jul 7 22:53:20 2013 +0200
+
+    provide a few method for the binding
+
+ hkl/hkl-binding-private.h |  6 +++++
+ hkl/hkl-binding.c         | 24 +++++++++++++++++++
+ hkl/hkl-matrix.c          |  3 ++-
+ hkl/hkl-parameter.c       |  4 ++--
+ hkl/hkl-sample.c          | 59 ++++++++++++++++++++++++++++-------------------
+ tests/bindings/python.py  | 33 ++++++++++++++++++++++++++
+ 6 files changed, 102 insertions(+), 27 deletions(-)
+
+commit accefa127aa8da0c70910ef6f383267af45f90c1
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 24 13:15:57 2013 +0200
+
+    the geometry stored into the reflection is accessibleo only using the get /set method
+
+ hkl.h            | 2 +-
+ hkl/hkl-sample.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit e0f4cc0ad47d7bf46d4e3ebe7e25a28929f50281
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 24 11:21:44 2013 +0200
+
+    remove from git the .gir file
+
+ hkl/Hkl-5.0.gir | 2490 -------------------------------------------------------
+ 1 file changed, 2490 deletions(-)
+
+commit 0be8b2b3529cf181d6fe55c61e99fca1ca00a25b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 23 22:01:57 2013 +0200
+
+    fix a few segfault in ghkl
+
+ gui/hkl-gui-modelcolumns.h | 3 ++-
+ gui/hkl-gui.cpp            | 5 +++--
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+commit 59c6e9a5623676953adcc6dc0b4cd55e070d3408
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 23 17:36:46 2013 +0200
+
+    use the right version number until we release 5.0.0
+
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit d7fd1980a9a16d46b914d664937d064540c62f70
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 23 17:18:50 2013 +0200
+
+    typo
+
+ hkl.h | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit d8087b837eb17c2a5e4c0dd9cbe3594ce5e2b5e7
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 23 17:16:14 2013 +0200
+
+    the ux, uy, uz getter are now const
+    
+    it is not possible to modify the sample internal without a setter.
+
+ gui/ghkl.ui               |  6 +++---
+ gui/hkl-gui-callbacks.cpp | 40 +++++++++++++---------------------------
+ gui/hkl-gui.cpp           | 24 ++++++++++++------------
+ gui/hkl-gui.h             | 12 ++++++------
+ hkl.h                     |  6 +++---
+ hkl/Hkl-5.0.gir           | 12 ++++++------
+ hkl/hkl-sample.c          | 18 ++++++------------
+ 7 files changed, 49 insertions(+), 69 deletions(-)
+
+commit e892bc6e17752736987855181f83b77c2ca44912
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 23 16:37:59 2013 +0200
+
+    use const for the lattice get/set sample method
+    
+    this way it is not possible to modify the sample internals
+    via the getter. the setter is now mendatory.
+
+ gui/hkl-gui-callbacks.cpp      | 111 ++++++++++-------------------------------
+ gui/hkl-gui.cpp                |   9 ++--
+ hkl.h                          |   8 ++-
+ hkl/Hkl-5.0.gir                |  63 +++++++++++++++++++++--
+ hkl/hkl-lattice.c              |  41 ++++++++++++---
+ hkl/hkl-sample.c               |   6 +--
+ tests/bindings/python.py       |  25 ++++++++--
+ tests/hkl-pseudoaxis-e6c-t.c   |  16 +++---
+ tests/hkl-pseudoaxis-zaxis-t.c |  11 ++--
+ tests/hkl-sample-t.c           |  44 +++++++---------
+ 10 files changed, 180 insertions(+), 154 deletions(-)
+
+commit d1334e203bde1d3d3ace35f623717acd50a62597
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jun 22 11:16:05 2013 +0200
+
+    use the local headers instead of the system one where it is relevant
+
+ hkl/hkl-parameter.c                      | 2 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c    | 2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c          | 2 +-
+ hkl/hkl-pseudoaxis-common-psi.c          | 2 +-
+ hkl/hkl-pseudoaxis-common-q.c            | 2 +-
+ hkl/hkl-pseudoaxis-e4c-hkl.c             | 2 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c             | 2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c             | 2 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c             | 2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c            | 2 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c            | 2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c             | 2 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c             | 2 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c          | 2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c     | 2 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c           | 2 +-
+ hkl/hkl-source.c                         | 3 ++-
+ hkl/hkl-types.c                          | 5 ++---
+ tests/hkl-axis-t.c                       | 4 ++--
+ tests/hkl-bench-t.c                      | 2 +-
+ tests/hkl-detector-t.c                   | 2 +-
+ tests/hkl-error-t.c                      | 2 +-
+ tests/hkl-geometry-t.c                   | 2 +-
+ tests/hkl-interval-t.c                   | 2 +-
+ tests/hkl-lattice-t.c                    | 2 +-
+ tests/hkl-matrix-t.c                     | 2 +-
+ tests/hkl-parameter-t.c                  | 2 +-
+ tests/hkl-pseudoaxis-e4ch-t.c            | 2 +-
+ tests/hkl-pseudoaxis-e4cv-t.c            | 2 +-
+ tests/hkl-pseudoaxis-e6c-t.c             | 2 +-
+ tests/hkl-pseudoaxis-k4cv-t.c            | 2 +-
+ tests/hkl-pseudoaxis-k6c-t.c             | 2 +-
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c | 2 +-
+ tests/hkl-pseudoaxis-t.c                 | 2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           | 2 +-
+ tests/hkl-quaternion-t.c                 | 2 +-
+ tests/hkl-sample-t.c                     | 2 +-
+ tests/hkl-source-t.c                     | 4 ++--
+ tests/hkl-unit-t.c                       | 2 +-
+ tests/hkl-vector-t.c                     | 2 +-
+ 40 files changed, 44 insertions(+), 44 deletions(-)
+
+commit ecccaebfde99ac8434e71c1c1e8aac29573b46f1
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jun 22 09:36:59 2013 +0200
+
+    remove the bool type
+    
+    this C99 type is unknown of gobject-introspection.
+
+ hkl.h               | 17 ++++++++---------
+ hkl/Hkl-5.0.gir     | 40 ++++++++++++----------------------------
+ hkl/hkl-parameter.c |  8 ++++----
+ hkl/hkl-sample.c    |  4 ++--
+ 4 files changed, 26 insertions(+), 43 deletions(-)
+
+commit 1a62b3f5a05db0bf1d3a0b318f15811a9098f62b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jun 22 09:06:29 2013 +0200
+
+    remove the version number from the hkl.h header
+    
+    once I figured out what is the right way to provide this number,
+    I will add it.
+
+ hkl.h | 7 -------
+ 1 file changed, 7 deletions(-)
+
+commit c35fee0fcd94739e4bb196f08758909110e414bc
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 19:54:19 2013 +0200
+
+    now distcheck is working
+
+ hkl/Makefile.am   |  2 +-
+ tests/Makefile.am | 10 ++++++----
+ 2 files changed, 7 insertions(+), 5 deletions(-)
+
+commit 52610211fa6df8844204c9ad23d66b5f8fb563d3
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 19:22:22 2013 +0200
+
+    install all the headers under hkl- @VMAJ@
+    
+    this way it will be possible to install in parallel different major
+    version of the hkl library.
+
+ Makefile.am          | 11 ++++++++---
+ configure.ac         | 39 ++++++++++++++++++++++++++++++++++++---
+ hkl.pc.in            |  2 +-
+ hkl/Makefile.am      | 25 +++++++++++--------------
+ hkl/ccan/Makefile.am |  2 +-
+ 5 files changed, 57 insertions(+), 22 deletions(-)
+
+commit 15176995943856b7a4be301c66a8c8defd2bfdfa
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 18:12:23 2013 +0200
+
+    activtable the -visibility=hiden flag
+    
+    - fix a few method visibility
+    - deactive the hkl3d test since it is broken due to some symbols problem
+      with c++.
+
+ configure.ac                     |  8 +++----
+ hkl.h                            | 12 +++++-----
+ hkl/Hkl-5.0.gir                  | 18 +++++++++++++++
+ hkl/Makefile.am                  |  1 +
+ hkl/hkl-binding-private.h        | 22 +++++++++----------
+ hkl/hkl-geometry.c               | 19 ++++++++++++++++
+ hkl/hkl-type-builtins.h          |  2 +-
+ hkl/hkl-type-builtins.h.template |  2 +-
+ hkl/hkl-types.h                  | 34 ++++++++++++++---------------
+ hkl3d/bullet/src/Makefile.am     |  2 +-
+ hkl3d/hkl3d.cpp                  | 47 +++++++++++++++++++++++++++++++---------
+ hkl3d/hkl3d.h                    |  4 ++--
+ tests/Makefile.am                |  2 ++
+ 13 files changed, 121 insertions(+), 52 deletions(-)
+
+commit 0a6f96a7020aad5e2ee2cd74a913b8e5375d5988
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 14:31:57 2013 +0200
+
+    remove a few method from the public API
+    
+    moves them to the hkl-macros-private.h header
+
+ hkl.h                       | 65 ++-------------------------------
+ hkl/Hkl-5.0.gir             | 10 ------
+ hkl/Makefile.am             |  1 +
+ hkl/hkl-error-private.h     |  1 +
+ hkl/hkl-interval.c          |  1 +
+ hkl/hkl-macros-private.h    | 88 +++++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-macros.c            |  1 +
+ hkl/hkl-matrix.c            |  1 +
+ hkl/hkl-parameter-private.h |  1 +
+ hkl/hkl-quaternion.c        |  1 +
+ hkl/hkl-unit.c              |  1 +
+ hkl/hkl-vector.c            |  1 +
+ tests/tap/hkl-tap.c         |  1 +
+ 13 files changed, 100 insertions(+), 73 deletions(-)
+
+commit 78344cffa51dacbae213ad072d4e1cc52fc07a6c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 14:03:21 2013 +0200
+
+    put all the public API into an unit hkl.h header
+
+ gui/hkl-gui-callbacks.cpp                     |   4 +-
+ gui/hkl-gui-modelcolumns.h                    |   2 +-
+ gui/hkl-gui.cpp                               |  31 +-
+ gui/hkl-gui.h                                 |   2 +-
+ hkl.h                                         | 543 +++++++++++++++++++++++++-
+ hkl/Hkl-5.0.gir                               |  68 ++++
+ hkl/Makefile.am                               |  24 +-
+ hkl/hkl-axis-private.h                        |   2 +-
+ hkl/hkl-binding-private.h                     |   2 +-
+ hkl/hkl-binding.c                             |   3 +-
+ hkl/hkl-detector-factory.c                    |   3 +-
+ hkl/hkl-detector-factory.h                    |  38 --
+ hkl/hkl-detector.h                            |  41 --
+ hkl/hkl-error-private.h                       |   3 +-
+ hkl/hkl-error.h                               |  38 --
+ hkl/hkl-factory-private.h                     |   4 +-
+ hkl/hkl-factory.c                             |   3 +-
+ hkl/hkl-factory.h                             |  45 ---
+ hkl/hkl-geometry-private.h                    |   7 +-
+ hkl/hkl-geometry.h                            |  76 ----
+ hkl/hkl-interval-private.h                    |   2 +-
+ hkl/hkl-lattice-private.h                     |   4 +-
+ hkl/hkl-lattice.h                             |  73 ----
+ hkl/hkl-macros.c                              |   3 +-
+ hkl/hkl-macros.h                              | 159 --------
+ hkl/hkl-matrix-private.h                      |   2 +-
+ hkl/hkl-matrix.c                              |   3 +-
+ hkl/hkl-matrix.h                              |  54 ---
+ hkl/hkl-parameter-private.h                   |   6 +-
+ hkl/hkl-parameter.h                           |  87 -----
+ hkl/hkl-pseudoaxis-common-eulerians-private.h |   2 +-
+ hkl/hkl-pseudoaxis-common-q-private.h         |   2 +-
+ hkl/hkl-pseudoaxis-private.h                  |   4 +-
+ hkl/hkl-pseudoaxis.h                          | 115 ------
+ hkl/hkl-quaternion-private.h                  |   3 +-
+ hkl/hkl-quaternion.c                          |   2 +-
+ hkl/hkl-sample-private.h                      |   5 +-
+ hkl/hkl-sample.c                              |   3 +-
+ hkl/hkl-sample.h                              | 124 ------
+ hkl/hkl-type-builtins.c                       |   2 +-
+ hkl/hkl-type-builtins.h                       |   2 +-
+ hkl/hkl-unit-private.h                        |   2 +-
+ hkl/hkl-vector-private.h                      |   4 +-
+ tests/hkl-pseudoaxis-e4ch-t.c                 |   2 +-
+ tests/hkl-pseudoaxis-e4cv-t.c                 |   2 +-
+ tests/hkl-pseudoaxis-e6c-t.c                  |   2 +-
+ tests/hkl-pseudoaxis-k4cv-t.c                 |   2 +-
+ tests/hkl-pseudoaxis-k6c-t.c                  |   2 +-
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c      |   2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c                |   2 +-
+ tests/tap/Makefile.am                         |   8 +-
+ tests/tap/hkl-tap.c                           |  88 +++++
+ tests/tap/hkl-tap.h                           |  38 ++
+ tests/tap/hkl.c                               |  86 ----
+ tests/tap/hkl.h                               |  39 --
+ 55 files changed, 800 insertions(+), 1075 deletions(-)
+
+commit b88034c233faf4f26de9bc8f3472155e845f6e30
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 12:45:01 2013 +0200
+
+    part of the HklError API is now public
+
+ gui/hkl-gui.cpp                       |   2 +-
+ hkl/Hkl-5.0.gir                       | 392 ++++------------------------------
+ hkl/Makefile.am                       |   1 +
+ hkl/hkl-binding.c                     |   1 +
+ hkl/hkl-error-private.h               |  72 +++++++
+ hkl/hkl-error.c                       |  13 +-
+ hkl/hkl-error.h                       |  36 +---
+ hkl/hkl-pseudoaxis-auto-private.h     |   1 +
+ hkl/hkl-pseudoaxis-auto.c             |   1 +
+ hkl/hkl-pseudoaxis-common-eulerians.c |   1 +
+ hkl/hkl-pseudoaxis-common-hkl.c       |   1 +
+ hkl/hkl-pseudoaxis-common-psi.c       |   1 +
+ hkl/hkl-pseudoaxis.c                  |   1 +
+ hkl/hkl-types.c                       |   1 +
+ tests/hkl-error-t.c                   |   2 +
+ 15 files changed, 133 insertions(+), 393 deletions(-)
+
+commit 611fbae474d69164098866ce0b29156bbd513ab3
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 12:31:00 2013 +0200
+
+    fix a missing stdio.h in hkl-geometry.h
+
+ hkl/hkl-geometry.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 291ec10c5c03332eedff84dbd65fd6b1b48143cd
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 12:12:21 2013 +0200
+
+    HklVector is private
+
+ hkl/Hkl-5.0.gir              | 633 +------------------------------------------
+ hkl/Makefile.am              |   8 +-
+ hkl/hkl-axis-private.h       |   2 +-
+ hkl/hkl-matrix-private.h     |   2 +-
+ hkl/hkl-matrix.c             |   2 +-
+ hkl/hkl-quaternion-private.h |  11 +-
+ hkl/hkl-quaternion.c         |   2 +-
+ hkl/hkl-source-private.h     |   2 +-
+ hkl/hkl-vector-private.h     | 131 +++++++++
+ hkl/hkl-vector.c             |   2 +-
+ hkl/hkl-vector.h             | 131 ---------
+ tests/hkl-vector-t.c         |   2 +-
+ 12 files changed, 152 insertions(+), 776 deletions(-)
+
+commit fcafa97c8738d00738d437afbaaf19ef11b76638
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 12:03:32 2013 +0200
+
+    HklUnit is private
+
+ hkl/Hkl-5.0.gir                  | 98 ++--------------------------------------
+ hkl/Makefile.am                  |  6 +--
+ hkl/hkl-lattice.c                |  2 +-
+ hkl/hkl-parameter-private.h      |  2 +-
+ hkl/hkl-type-builtins.c          | 18 --------
+ hkl/hkl-type-builtins.c.template |  1 -
+ hkl/hkl-type-builtins.h          |  4 --
+ hkl/hkl-unit-private.h           | 58 ++++++++++++++++++++++++
+ hkl/hkl-unit.c                   |  3 +-
+ hkl/hkl-unit.h                   | 58 ------------------------
+ tests/hkl-unit-t.c               |  2 +-
+ 11 files changed, 70 insertions(+), 182 deletions(-)
+
+commit c685b927c015e7d2625f6c0eaa451ee86413bfd0
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 11:51:46 2013 +0200
+
+    HklQuaternion is private
+
+ hkl/Hkl-5.0.gir              | 262 +------------------------------------------
+ hkl/Makefile.am              |   4 +-
+ hkl/hkl-axis-private.h       |   7 +-
+ hkl/hkl-geometry-private.h   |   3 +-
+ hkl/hkl-quaternion-private.h |  71 ++++++++++++
+ hkl/hkl-quaternion.c         |   2 +-
+ hkl/hkl-quaternion.h         |  71 ------------
+ hkl/hkl-types.c              |  12 --
+ hkl/hkl-types.h              |   3 -
+ hkl/hkl-vector.c             |   2 +-
+ tests/hkl-quaternion-t.c     |   2 +-
+ 11 files changed, 80 insertions(+), 359 deletions(-)
+
+commit a72bf8e4aba6b90733bb74604b0058abb4658023
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 11:44:37 2013 +0200
+
+    HklInterval is now private
+
+ hkl/Hkl-5.0.gir             | 270 --------------------------------------------
+ hkl/Makefile.am             |   4 +-
+ hkl/hkl-interval-private.h  |  77 +++++++++++++
+ hkl/hkl-interval.c          |   2 +-
+ hkl/hkl-interval.h          |  77 -------------
+ hkl/hkl-parameter-private.h |   6 +-
+ hkl/hkl-types.c             |  12 --
+ hkl/hkl-types.h             |   3 -
+ tests/hkl-interval-t.c      |   2 +-
+ 9 files changed, 83 insertions(+), 370 deletions(-)
+
+commit 2e16e91ff4448d4603caa326ee3191bf71715324
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Jun 21 11:34:52 2013 +0200
+
+    Hklsource is private
+
+ hkl/Hkl-5.0.gir            | 159 ++-------------------------------------------
+ hkl/Makefile.am            |   6 +-
+ hkl/hkl-geometry-private.h |   8 +--
+ hkl/hkl-source-private.h   |  56 ++++++++++++++++
+ hkl/hkl-source.h           |  56 ----------------
+ hkl/hkl-types.c            |  12 ----
+ hkl/hkl-types.h            |   3 -
+ 7 files changed, 67 insertions(+), 233 deletions(-)
+
+commit 249f2c9df0fa2677b1273151bd71210d9f611961
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jun 19 22:48:54 2013 +0200
+
+    clean the hkl-matrix.h header
+    
+    remove the useless stdio.h and hkl-vector.h
+
+ hkl/Hkl-5.0.gir           | 1278 ++++++++++++++++++++++++++++++++++++---------
+ hkl/hkl-lattice-private.h |    2 +
+ hkl/hkl-matrix.h          |    8 +-
+ tests/hkl-vector-t.c      |    2 +
+ 4 files changed, 1045 insertions(+), 245 deletions(-)
+
+commit 1c46d77815b3fcb805b48d2558656c0a17eb58b9
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jun 19 16:09:58 2013 +0200
+
+    now the internal of the HklMatrix is completly private
+
+ gui/hkl-gui-callbacks.cpp                |  39 +++--
+ gui/hkl-gui.cpp                          |  22 +--
+ hkl.h                                    |   1 +
+ hkl/Hkl-5.0.gir                          | 245 ++++++++++---------------------
+ hkl/Makefile.am                          |   1 +
+ hkl/hkl-lattice.c                        |   7 +-
+ hkl/hkl-matrix-private.h                 |  65 ++++++++
+ hkl/hkl-matrix.c                         |  74 +++++++++-
+ hkl/hkl-matrix.h                         |  50 ++-----
+ hkl/hkl-quaternion.c                     |   8 +-
+ hkl/hkl-sample-private.h                 |   1 +
+ hkl/hkl-vector.c                         |   6 +-
+ tests/hkl-lattice-t.c                    |  35 +++--
+ tests/hkl-matrix-t.c                     |   2 +
+ tests/hkl-pseudoaxis-e6c-t.c             |  24 +--
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |   7 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           |   7 +-
+ tests/hkl-quaternion-t.c                 |  15 +-
+ tests/hkl-sample-t.c                     |  48 +++---
+ tests/hkl-vector-t.c                     |  10 +-
+ 20 files changed, 359 insertions(+), 308 deletions(-)
+
+commit abfe3d4ebbbd02e61b69b75ae0887e4cbb95d35c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 18 17:15:31 2013 +0200
+
+    struct HklLattice is now private.
+
+ gui/hkl-gui-callbacks.cpp |  70 ++++++++++++++----
+ gui/hkl-gui.cpp           |  80 +++++++++++++--------
+ hkl/Hkl-5.0.gir           | 180 +++++++++++++++++++++++++++-------------------
+ hkl/Makefile.am           |   1 +
+ hkl/hkl-lattice-private.h |  49 +++++++++++++
+ hkl/hkl-lattice.c         | 116 +++++++++++++++++++++++++++++-
+ hkl/hkl-lattice.h         |  50 +++++++------
+ hkl/hkl-sample.c          |   1 +
+ hkl/hkl-types.c           |   1 +
+ tests/hkl-lattice-t.c     | 108 ++++++++++++++--------------
+ tests/hkl-sample-t.c      |  24 +++----
+ 11 files changed, 474 insertions(+), 206 deletions(-)
+
+commit 9c905da584ab939517f1626c31ea892d91a5a23f
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jun 13 13:46:37 2013 +0200
+
+    now all the sample API is "clean"
+
+ gui/hkl-gui-callbacks.cpp |   11 +-
+ hkl/Hkl-5.0.gir           | 1360 +++++++++------------------------------------
+ hkl/hkl-sample-private.h  |    4 -
+ hkl/hkl-sample.c          |   26 +-
+ hkl/hkl-sample.h          |   10 +-
+ tests/hkl-sample-t.c      |   72 ++-
+ 6 files changed, 343 insertions(+), 1140 deletions(-)
+
+commit cf3915a88c9e59b1764626f58da7c5b24d8327b7
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 9 21:09:53 2013 +0200
+
+    clean the hkl-sample part
+
+ hkl/hkl-sample-private.h | 7 -------
+ hkl/hkl-sample.c         | 3 ---
+ hkl/hkl-sample.h         | 9 ++-------
+ 3 files changed, 2 insertions(+), 17 deletions(-)
+
+commit 813370a42b3604c8377e182cceb7276a143243a8
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 9 20:52:27 2013 +0200
+
+    use a ccan list for the sample reflections
+
+ INSTALL                    |    8 +-
+ Makefile.am                |    2 +-
+ gui/hkl-gui-callbacks.cpp  |   47 +-
+ gui/hkl-gui-modelcolumns.h |    2 +
+ gui/hkl-gui.cpp            |   11 +-
+ hkl/Hkl-5.0.gir            | 1372 +++++++++++++++++++++++++++++++++++---------
+ hkl/ccan/Makefile.am       |    2 +
+ hkl/ccan/list/LICENSE      |    1 +
+ hkl/ccan/list/list.c       |   43 ++
+ hkl/ccan/list/list.h       |  563 ++++++++++++++++++
+ hkl/hkl-sample-private.h   |   19 +-
+ hkl/hkl-sample.c           |  165 ++----
+ hkl/hkl-sample.h           |   27 +-
+ tests/hkl-sample-t.c       |   42 +-
+ 14 files changed, 1831 insertions(+), 473 deletions(-)
+
+commit aa9049686b0eaa577c2228449fd77d75caa21049
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri May 31 10:55:01 2013 +0200
+
+    move to hkl_sample_UB_get/set
+
+ gui/hkl-gui-callbacks.cpp |  2 +-
+ gui/hkl-gui.cpp           |  2 +-
+ hkl/Hkl-5.0.gir           | 61 ++++++++++++++++++++---------------------------
+ hkl/hkl-lattice.c         |  2 +-
+ hkl/hkl-sample-private.h  |  4 ----
+ hkl/hkl-sample.c          | 28 ++++++++--------------
+ hkl/hkl-sample.h          |  4 ++--
+ tests/hkl-sample-t.c      |  2 +-
+ 8 files changed, 42 insertions(+), 63 deletions(-)
+
+commit eb0080ad4bb2919e9a689df9c9c6b9a969d1b363
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu May 30 13:51:49 2013 +0200
+
+    now we have an hkl_sample_U_get/set method
+    
+    remove the hkl_sample_set_U_from_euler, use HklMatrix method then the
+    hkl_sample_U_set method.
+
+ gui/hkl-gui-callbacks.cpp                | 10 ++++---
+ hkl/Hkl-5.0.gir                          | 46 +++++++++++++++++---------------
+ hkl/hkl-matrix.c                         | 15 +++++++++++
+ hkl/hkl-matrix.h                         |  2 ++
+ hkl/hkl-sample-private.h                 |  3 ---
+ hkl/hkl-sample.c                         | 24 +++--------------
+ hkl/hkl-sample.h                         |  5 ++--
+ tests/hkl-pseudoaxis-e6c-t.c             | 15 +++++++----
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  4 ++-
+ tests/hkl-pseudoaxis-zaxis-t.c           |  4 ++-
+ 10 files changed, 69 insertions(+), 59 deletions(-)
+
+commit b056fa1008e62c0ea05d3e84e6ee3bd8b174fc5f
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed May 29 15:56:22 2013 +0200
+
+    create the hkl_sample_lattice_set method
+
+ Documentation/sphinx/source/bindings/python.py     | 10 ++--
+ Documentation/sphinx/source/pyplots/trajectory.py  | 10 ++--
+ .../sphinx/source/pyplots/trajectory_full.py       | 10 ++--
+ .../sphinx/source/pyplots/trajectory_simple.py     | 10 ++--
+ gui/hkl-gui-callbacks.cpp                          | 31 ++++++-----
+ hkl/Hkl-5.0.gir                                    | 60 ++++++++++------------
+ hkl/hkl-lattice.c                                  | 20 +++++++-
+ hkl/hkl-lattice.h                                  |  2 +
+ hkl/hkl-sample-private.h                           | 12 -----
+ hkl/hkl-sample.c                                   | 32 +++---------
+ hkl/hkl-sample.h                                   |  4 +-
+ tests/bindings/python.py                           | 20 +++++---
+ tests/bindings/trajectory.py                       | 10 ++--
+ tests/hkl-pseudoaxis-e6c-t.c                       | 18 ++++---
+ tests/hkl-pseudoaxis-zaxis-t.c                     | 13 +++--
+ tests/hkl-sample-t.c                               | 18 ++++---
+ 16 files changed, 146 insertions(+), 134 deletions(-)
+
+commit c9c5a9bb70ca81abaabd8ba6ee5f4fea92679e00
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed May 29 10:45:33 2013 +0200
+
+    rename hkl_sample_set_name into hkl_sample_name_set for consistency
+
+ gui/hkl-gui-callbacks.cpp |  4 ++--
+ hkl/Hkl-5.0.gir           | 26 +++++++++++++-------------
+ hkl/hkl-sample-private.h  |  2 +-
+ hkl/hkl-sample.c          |  4 ++--
+ hkl/hkl-sample.h          | 17 +++++++++++------
+ 5 files changed, 29 insertions(+), 24 deletions(-)
+
+commit e1efd72e6464b533c7b7b19c46529957f695b2ba
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed May 29 10:19:36 2013 +0200
+
+    remove the HklSampleType enum
+
+ Documentation/sphinx/source/bindings/python.py     |    2 +-
+ Documentation/sphinx/source/pyplots/trajectory.py  |    2 +-
+ .../sphinx/source/pyplots/trajectory_full.py       |    2 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |    2 +-
+ Documentation/sphinx/source/test.py                |    2 +-
+ gui/hkl-gui-callbacks.cpp                          |    2 +-
+ gui/hkl-gui.cpp                                    |    2 +-
+ hkl/Hkl-5.0.gir                                    | 1285 ++++----------------
+ hkl/hkl-sample-private.h                           |    3 +-
+ hkl/hkl-sample.c                                   |    4 +-
+ hkl/hkl-sample.h                                   |    6 +-
+ hkl/hkl-type-builtins.c                            |   15 -
+ hkl/hkl-type-builtins.h                            |    4 -
+ tests/bindings/python.py                           |    4 +-
+ tests/bindings/trajectory.py                       |    2 +-
+ tests/hkl-bench-t.c                                |    4 +-
+ tests/hkl-pseudoaxis-e4ch-t.c                      |   12 +-
+ tests/hkl-pseudoaxis-e4cv-t.c                      |   12 +-
+ tests/hkl-pseudoaxis-e6c-t.c                       |   10 +-
+ tests/hkl-pseudoaxis-k4cv-t.c                      |    6 +-
+ tests/hkl-pseudoaxis-k6c-t.c                       |    8 +-
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c           |    2 +-
+ tests/hkl-pseudoaxis-t.c                           |    2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c                     |    2 +-
+ tests/hkl-sample-t.c                               |   18 +-
+ 25 files changed, 304 insertions(+), 1109 deletions(-)
+
+commit 027b3fb69eb5f2f81525d66094a6301c33e37332
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue May 28 22:49:12 2013 +0200
+
+    HklSample struct is no more exposed
+
+ gui/hkl-gui-callbacks.cpp       |  97 ++++++++++++-------
+ gui/hkl-gui.cpp                 |  76 +++++++++------
+ gui/hkl-gui.h                   |   1 +
+ hkl/Hkl-5.0.gir                 | 207 ++++++++++++++++++++++++++++++++++------
+ hkl/hkl-parameter.c             |  25 +++++
+ hkl/hkl-parameter.h             |   4 +
+ hkl/hkl-pseudoaxis-common-hkl.c |   1 +
+ hkl/hkl-pseudoaxis-common-psi.c |   2 +-
+ hkl/hkl-sample-private.h        |  13 +++
+ hkl/hkl-sample.c                | 132 +++++++++++++++++++++++++
+ hkl/hkl-sample.h                |  43 ++++-----
+ tests/bindings/python.py        |   2 +-
+ tests/hkl-sample-t.c            |  82 +++++++++-------
+ 13 files changed, 528 insertions(+), 157 deletions(-)
+
+commit 25d135e97c89e2d10f58b0090be499ecdaf24b28
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed May 22 13:31:08 2013 +0200
+
+    HklSampleRection is now an opac struct.
+
+ gui/hkl-gui-callbacks.cpp | 33 ++++++++--------
+ gui/hkl-gui.cpp           | 11 ++++--
+ hkl/Hkl-5.0.gir           | 98 +++++++++++++++++++----------------------------
+ hkl/hkl-sample-private.h  | 14 ++++---
+ hkl/hkl-sample.c          | 60 ++++++++++++++++++++++-------
+ hkl/hkl-sample.h          | 35 +++++++++--------
+ tests/hkl-sample-t.c      |  2 +-
+ 7 files changed, 138 insertions(+), 115 deletions(-)
+
+commit e6199cda30aaf0fd2a31456253b34c21c3a0e3ba
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue May 21 17:05:59 2013 +0200
+
+    autopep8
+
+ Documentation/sphinx/source/pyplots/trajectory.py        |  9 +++++----
+ Documentation/sphinx/source/pyplots/trajectory_full.py   |  4 ++--
+ Documentation/sphinx/source/pyplots/trajectory_simple.py |  3 ++-
+ tests/bindings/python.py                                 | 10 ++++++----
+ tests/bindings/trajectory.py                             |  6 ++++--
+ 5 files changed, 19 insertions(+), 13 deletions(-)
+
+commit 7fda3edbbd686c982255ee472c646c34dd3a8e29
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue May 21 17:05:47 2013 +0200
+
+    removed the HklSampleList.
+    
+    users should deal them self with multiple samples, the way they want.
+    I do not want to enforce a way to deal with these mutiple samples.
+
+ gui/hkl-gui-callbacks.cpp | 189 +++++++++++++-------------------
+ gui/hkl-gui.cpp           |  77 +++++++------
+ gui/hkl-gui.h             |   5 +-
+ hkl/Hkl-5.0.gir           | 212 ------------------------------------
+ hkl/Makefile.am           |   3 +-
+ hkl/hkl-sample-private.h  |  99 +++++++++++++++++
+ hkl/hkl-sample.c          | 267 +---------------------------------------------
+ hkl/hkl-sample.h          |  40 +------
+ hkl/hkl-types.c           |  13 +--
+ hkl/hkl-types.h           |   3 -
+ tests/hkl-sample-t.c      |  81 +-------------
+ 11 files changed, 222 insertions(+), 767 deletions(-)
+
+commit edf2f6f6b12102edf5f14babeceee1e08b982256
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 17 09:43:48 2013 +0200
+
+    move the public API of HklParameterList with the hkl_parameter_list_xxx_get/set
+
+ hkl/Hkl-5.0.gir                 | 50 ++++++++++++++++++++---------------------
+ hkl/hkl-binding-private.h       |  2 +-
+ hkl/hkl-binding.c               | 14 ++++++------
+ hkl/hkl-parameter-private.h     |  4 ++--
+ hkl/hkl-parameter.c             | 12 +++++-----
+ hkl/hkl-parameter.h             |  2 +-
+ hkl/hkl-pseudoaxis-common-psi.c |  4 ++--
+ hkl/hkl-pseudoaxis-k4cv-hkl.c   | 12 +++++-----
+ hkl/hkl-pseudoaxis-k6c-hkl.c    |  8 +++----
+ tests/hkl-bench-t.c             |  4 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c   | 30 ++++++++++++-------------
+ tests/hkl-pseudoaxis-e4cv-t.c   | 32 +++++++++++++-------------
+ tests/hkl-pseudoaxis-e6c-t.c    | 24 ++++++++++----------
+ tests/hkl-pseudoaxis-k4cv-t.c   |  6 ++---
+ tests/hkl-pseudoaxis-k6c-t.c    |  8 +++----
+ tests/hkl-pseudoaxis-zaxis-t.c  |  4 ++--
+ tests/tap/hkl.c                 |  2 +-
+ 17 files changed, 109 insertions(+), 109 deletions(-)
+
+commit f5d49b594260191c4a6356f23d7a347a1d1abbab
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 17 09:09:00 2013 +0200
+
+    now HklParameterList is an obscure struct not exposed to the public API.
+    
+    in fact this structure is nothing else than a darray_parameter. But to
+    expose this struct in the binding we need a namespace so we need this
+    Hklxxx name.
+
+ gui/hkl-gui-pseudoaxes.cpp               |   2 +-
+ gui/hkl-gui.cpp                          |   2 +-
+ hkl/Hkl-5.0.gir                          | 130 +++++++------------------------
+ hkl/hkl-geometry.c                       |   2 +-
+ hkl/hkl-parameter-private.h              | 117 ++--------------------------
+ hkl/hkl-parameter.c                      |  86 +++++++++++++-------
+ hkl/hkl-parameter.h                      |  26 ++-----
+ hkl/hkl-pseudoaxis-private.h             |  17 ++--
+ hkl/hkl-pseudoaxis.c                     |   5 +-
+ hkl/hkl-unit.c                           |   4 +-
+ hkl/hkl-vector.c                         |   2 +-
+ hkl/hkl-vector.h                         |   4 +-
+ tests/bindings/python.py                 |   2 +-
+ tests/hkl-bench-t.c                      |   2 +-
+ tests/hkl-pseudoaxis-e4ch-t.c            |   2 +-
+ tests/hkl-pseudoaxis-e4cv-t.c            |   2 +-
+ tests/hkl-pseudoaxis-e6c-t.c             |   6 +-
+ tests/hkl-pseudoaxis-k4cv-t.c            |   4 +-
+ tests/hkl-pseudoaxis-k6c-t.c             |   4 +-
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |   2 +-
+ 20 files changed, 133 insertions(+), 288 deletions(-)
+
+commit cfd68467cddf379ec23e449d018898910a925667
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon May 13 17:59:24 2013 +0200
+
+    consistant API for HklParameter hkl_parameter_xxx_get/get
+
+ gui/hkl-gui-callbacks.cpp                |   8 +--
+ gui/hkl-gui-pseudoaxes.cpp               |   8 +--
+ gui/hkl-gui.cpp                          |  68 +++++++++----------
+ hkl/Hkl-5.0.gir                          |  62 +++++++++---------
+ hkl/hkl-axis.c                           |   4 +-
+ hkl/hkl-binding.c                        |   4 +-
+ hkl/hkl-factory.c                        |  24 +++----
+ hkl/hkl-geometry.c                       |  14 ++--
+ hkl/hkl-lattice.c                        |  90 +++++++++++++-------------
+ hkl/hkl-parameter-private.h              |  34 ++++++----
+ hkl/hkl-parameter.c                      |  24 +++----
+ hkl/hkl-parameter.h                      |  12 ++--
+ hkl/hkl-pseudoaxis-auto.c                |   2 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c    |   6 +-
+ hkl/hkl-pseudoaxis-common-hkl.c          |  14 ++--
+ hkl/hkl-pseudoaxis-private.h             |   4 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c     |   6 +-
+ hkl/hkl-sample.c                         |  68 +++++++++----------
+ hkl/hkl-type-builtins.c                  |   1 +
+ hkl/hkl-type-builtins.c.template         |   1 +
+ tests/bindings/python.py                 |   2 +-
+ tests/hkl-axis-t.c                       |  72 ++++++++++-----------
+ tests/hkl-bench-t.c                      |   4 +-
+ tests/hkl-detector-t.c                   |   4 +-
+ tests/hkl-geometry-t.c                   |  16 ++---
+ tests/hkl-interval-t.c                   |   2 +
+ tests/hkl-lattice-t.c                    | 108 +++++++++++++++----------------
+ tests/hkl-parameter-t.c                  |   2 +-
+ tests/hkl-pseudoaxis-e4ch-t.c            |   2 +-
+ tests/hkl-pseudoaxis-e4cv-t.c            |   2 +-
+ tests/hkl-pseudoaxis-e6c-t.c             |  14 ++--
+ tests/hkl-pseudoaxis-k4cv-t.c            |   4 +-
+ tests/hkl-pseudoaxis-k6c-t.c             |   6 +-
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |   2 +-
+ tests/hkl-pseudoaxis-t.c                 |   8 +--
+ tests/hkl-sample-t.c                     |  54 ++++++++--------
+ tests/hkl-unit-t.c                       |   2 +
+ tests/tap/hkl.c                          |   2 +-
+ 38 files changed, 382 insertions(+), 378 deletions(-)
+
+commit 6c36c712cfe14dfcb10efd713cfb57e1d2b1640c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 17 08:55:42 2013 +0200
+
+    start to work on the HklParameter interface.
+
+ .../sphinx/source/pyplots/trajectory_full.py       |   2 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |   4 +-
+ gui/hkl-gui-callbacks.cpp                          |  44 ++--
+ gui/hkl-gui-pseudoaxes.cpp                         |   4 +-
+ gui/hkl-gui.cpp                                    |  16 +-
+ hkl/Hkl-5.0.gir                                    | 256 ++++-----------------
+ hkl/hkl-axis-private.h                             |   3 +-
+ hkl/hkl-parameter-private.h                        |  37 +++
+ hkl/hkl-parameter.c                                |  31 +--
+ hkl/hkl-parameter.h                                |  58 +----
+ tests/bindings/python.py                           |   9 +-
+ tests/bindings/trajectory.py                       |   6 +-
+ tests/hkl-axis-t.c                                 |  10 +-
+ tests/hkl-geometry-t.c                             |  14 +-
+ tests/hkl-parameter-t.c                            |   2 +
+ tests/hkl-pseudoaxis-t.c                           |   4 +-
+ 16 files changed, 180 insertions(+), 320 deletions(-)
+
+commit c09c3e53c0b9f9132f95bceacf6430f05e6c04a0
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat May 4 18:48:18 2013 +0200
+
+    the ccan list module is now useless
+
+ Makefile.am                       |   2 +-
+ hkl/ccan/Makefile.am              |   8 +-
+ hkl/ccan/list/LICENSE             |   1 -
+ hkl/ccan/list/list.c              |  43 ---
+ hkl/ccan/list/list.h              | 563 --------------------------------------
+ hkl/hkl-axis.c                    |   1 +
+ hkl/hkl-geometry.c                |   1 +
+ hkl/hkl-parameter-private.h       |   1 -
+ hkl/hkl-pseudoaxis-auto-private.h |   1 +
+ hkl/hkl-pseudoaxis.c              |   1 +
+ tests/hkl-geometry-t.c            |   1 +
+ 11 files changed, 7 insertions(+), 616 deletions(-)
+
+commit e0f3656f8f7bbe9d555f99028fe043d8ea3f0cdc
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat May 4 18:21:11 2013 +0200
+
+    no more hkl-axis.h
+
+ Documentation/sphinx/source/pyplots/trajectory.py  |   2 +-
+ .../sphinx/source/pyplots/trajectory_full.py       |   2 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |   2 +-
+ gui/hkl-gui-callbacks.cpp                          |  20 +--
+ gui/hkl-gui-modelcolumns.h                         |   6 +-
+ gui/hkl-gui.cpp                                    |  26 ++--
+ hkl/Hkl-5.0.gir                                    |  32 ++---
+ hkl/Makefile.am                                    |   2 -
+ hkl/hkl-axis-private.h                             |   5 +-
+ hkl/hkl-axis.c                                     |   4 +-
+ hkl/hkl-axis.h                                     |  41 -------
+ hkl/hkl-binding.c                                  |  12 +-
+ hkl/hkl-factory.c                                  |  24 ++--
+ hkl/hkl-geometry-private.h                         |   9 +-
+ hkl/hkl-geometry.c                                 | 135 ++++++++++-----------
+ hkl/hkl-geometry.h                                 |   7 +-
+ hkl/hkl-parameter-private.h                        |   2 +-
+ hkl/hkl-parameter.h                                |   5 +-
+ hkl/hkl-pseudoaxis-common-hkl.c                    |  20 +--
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c               |  17 +--
+ hkl/hkl-pseudoaxis.h                               |   2 +-
+ hkl/hkl-sample.c                                   |   6 +-
+ hkl3d/hkl3d.cpp                                    |   4 +-
+ tests/bindings/python.py                           |   2 +-
+ tests/bindings/trajectory.py                       |   6 +-
+ tests/hkl-axis-t.c                                 |  36 +++---
+ tests/hkl-detector-t.c                             |   4 +-
+ tests/hkl-geometry-t.c                             |  16 +--
+ tests/hkl-pseudoaxis-e6c-t.c                       |   4 +-
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c           |   4 +-
+ tests/hkl3d-test-t.c                               |   2 +-
+ tests/tap/hkl.c                                    |   6 +-
+ tests/tap/hkl.h                                    |   4 +-
+ 33 files changed, 214 insertions(+), 255 deletions(-)
+
+commit 68a6ee8c30a210480cf464ccce9d1a2945f82aae
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 3 23:08:42 2013 +0200
+
+    create an hkl-axis-private header
+    
+    this is temporary until we use only HklParameter
+
+ gui/hkl-gui-callbacks.cpp                |  2 ++
+ gui/hkl-gui.cpp                          |  2 ++
+ hkl/Hkl-5.0.gir                          |  9 -------
+ hkl/Makefile.am                          |  1 +
+ hkl/hkl-axis-private.h                   | 41 ++++++++++++++++++++++++++++++++
+ hkl/hkl-axis.c                           |  5 ++--
+ hkl/hkl-axis.h                           | 11 +--------
+ hkl/hkl-binding.c                        |  1 +
+ hkl/hkl-factory.c                        | 21 ++++++++--------
+ hkl/hkl-geometry.c                       |  1 +
+ hkl/hkl-pseudoaxis-common-hkl.c          |  1 +
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c     |  1 +
+ hkl/hkl-sample.c                         |  1 +
+ hkl3d/hkl3d.cpp                          |  1 +
+ tests/hkl-axis-t.c                       |  1 +
+ tests/hkl-detector-t.c                   |  1 +
+ tests/hkl-geometry-t.c                   |  2 ++
+ tests/hkl-pseudoaxis-e6c-t.c             |  4 ++--
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  2 ++
+ tests/hkl-quaternion-t.c                 |  2 ++
+ 20 files changed, 76 insertions(+), 34 deletions(-)
+
+commit fd8f271aa6517b032c56a2b70c3553a35d2d0d7c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 3 22:23:35 2013 +0200
+
+    remove hkl_axis_new_copy use hkl_parameter_new_copy instead
+
+ hkl/Hkl-5.0.gir    | 10 ----------
+ hkl/hkl-axis.c     | 12 ------------
+ hkl/hkl-axis.h     |  2 --
+ hkl/hkl-geometry.c |  4 +++-
+ tests/hkl-axis-t.c |  5 ++++-
+ 5 files changed, 7 insertions(+), 26 deletions(-)
+
+commit ea6070d77e12e77b91fd562d2a1f08f222ee1604
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 3 22:07:08 2013 +0200
+
+    remove hkl_axis_free
+
+ hkl/Hkl-5.0.gir    | 10 ----------
+ hkl/hkl-axis.c     |  5 -----
+ hkl/hkl-axis.h     |  2 --
+ hkl/hkl-geometry.c |  2 +-
+ 4 files changed, 1 insertion(+), 18 deletions(-)
+
+commit f91a329f3ea125e4ef66d028360e3a657e8f50d0
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 3 21:52:56 2013 +0200
+
+    remove the hkl_axis_init method
+
+ hkl/Hkl-5.0.gir | 16 ----------------
+ hkl/hkl-axis.c  | 28 +++++++++++-----------------
+ hkl/hkl-axis.h  |  2 --
+ 3 files changed, 11 insertions(+), 35 deletions(-)
+
+commit 4af5a39374f488a0d8e5de67eefb03c3985e6d32
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 3 21:26:32 2013 +0200
+
+    create an init_copy method in the HklParameter class
+
+ hkl/Hkl-5.0.gir             | 30 +++++++++++++++++-------------
+ hkl/hkl-axis.c              | 15 ++++++++++-----
+ hkl/hkl-axis.h              |  2 --
+ hkl/hkl-geometry.c          |  7 ++++---
+ hkl/hkl-parameter-private.h |  8 ++++++++
+ hkl/hkl-parameter.c         | 10 ++++++++++
+ hkl/hkl-parameter.h         |  2 ++
+ 7 files changed, 51 insertions(+), 23 deletions(-)
+
+commit e8970797992533381b09b686840754ecbe1ca04e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri May 3 18:01:44 2013 +0200
+
+    move the set_value_smallest_in_range into the HklParameter interface
+
+ hkl/Hkl-5.0.gir             | 24 +++++++++++++-----------
+ hkl/hkl-axis.c              | 35 ++++++++++++++++++-----------------
+ hkl/hkl-axis.h              |  2 --
+ hkl/hkl-geometry.c          |  2 +-
+ hkl/hkl-parameter-private.h | 23 +++++++++++++++--------
+ hkl/hkl-parameter.c         |  9 +++++++++
+ hkl/hkl-parameter.h         |  2 ++
+ tests/hkl-axis-t.c          | 12 ++++++------
+ 8 files changed, 64 insertions(+), 45 deletions(-)
+
+commit 7655801f8a38d0d455e5ba8f0a2c1852b0bba5ad
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Apr 30 11:48:32 2013 +0200
+
+    remove useless declaration from the public API
+
+ hkl/Hkl-5.0.gir            | 2 --
+ hkl/hkl-geometry-private.h | 1 +
+ hkl/hkl-geometry.h         | 3 ---
+ tests/hkl-source-t.c       | 2 ++
+ 4 files changed, 3 insertions(+), 5 deletions(-)
+
+commit ac549a85915c50f37586194b8c1539eb1b52b83d
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Apr 30 11:35:09 2013 +0200
+
+    prepare the code for -fvisibility=hidden
+
+ hkl/hkl-pseudoaxis.c | 15 +++---------
+ hkl/hkl-pseudoaxis.h | 64 ++++++++++++++++++++++++++--------------------------
+ 2 files changed, 35 insertions(+), 44 deletions(-)
+
+commit 8aa082dcc50bad799b5360454922bd3e14dc081b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Apr 30 11:23:38 2013 +0200
+
+    detector struct are now privates.
+
+ Documentation/sphinx/source/bindings/python.py     |   4 +-
+ Documentation/sphinx/source/pyplots/trajectory.py  |   4 +-
+ .../sphinx/source/pyplots/trajectory_full.py       |   6 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |   4 +-
+ gui/hkl-gui.cpp                                    |   4 +-
+ hkl/Hkl-5.0.gir                                    | 120 ++++++++-------------
+ hkl/Makefile.am                                    |   2 +
+ hkl/hkl-detector-factory.c                         |   1 +
+ hkl/hkl-detector-private.h                         |  47 ++++++++
+ hkl/hkl-detector.c                                 |  29 ++---
+ hkl/hkl-detector.h                                 |  23 ++--
+ hkl/hkl-geometry-private.h                         |  15 +--
+ hkl/hkl-geometry.c                                 |   9 +-
+ hkl/hkl-geometry.h                                 | 110 ++++---------------
+ hkl/hkl-pseudoaxis-auto-private.h                  |   1 +
+ hkl/hkl-pseudoaxis.c                               |   4 +-
+ hkl/hkl-sample.c                                   |   8 +-
+ hkl/hkl-sample.h                                   |   2 +-
+ hkl/hkl-types.c                                    |   4 +-
+ tests/bindings/python.py                           |  30 ++----
+ tests/bindings/trajectory.py                       |   4 +-
+ tests/hkl-bench-t.c                                |   5 +-
+ tests/hkl-detector-t.c                             |   2 +-
+ tests/hkl-pseudoaxis-e4ch-t.c                      |  12 +--
+ tests/hkl-pseudoaxis-e4cv-t.c                      |  12 +--
+ tests/hkl-pseudoaxis-e6c-t.c                       |  10 +-
+ tests/hkl-pseudoaxis-k4cv-t.c                      |   6 +-
+ tests/hkl-pseudoaxis-k6c-t.c                       |   8 +-
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c           |   2 +-
+ tests/hkl-pseudoaxis-t.c                           |   2 +-
+ tests/hkl-pseudoaxis-zaxis-t.c                     |   2 +-
+ tests/hkl-sample-t.c                               |  14 +--
+ 32 files changed, 217 insertions(+), 289 deletions(-)
+
+commit 2389c8c1a93f6bb0266e61f73bcb3004f9606adb
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue May 14 14:45:13 2013 +0200
+
+    use only glib.h
+
+ hkl/Hkl-5.0.gir           | 1377 +++++++++++++++++++++++++++++++++++----------
+ hkl/hkl-binding-private.h |    4 +-
+ 2 files changed, 1069 insertions(+), 312 deletions(-)
+
+commit cf25c86450c7ccef6ca7d2f1c37d8d2c67f24d06
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Apr 9 16:54:52 2013 +0200
+
+    remove the HklGeometryConfig and use the HklFactory instead
+
+ gui/hkl-gui.cpp            |  17 +++---
+ hkl/Hkl-5.0.gir            |   2 -
+ hkl/hkl-factory.c          | 128 +++++++++++++++++++++------------------------
+ hkl/hkl-factory.h          |   4 +-
+ hkl/hkl-geometry-private.h |  27 ++--------
+ hkl/hkl-geometry.c         |  19 +++----
+ hkl/hkl-geometry.h         |   1 -
+ tests/hkl-detector-t.c     |   4 +-
+ tests/hkl-geometry-t.c     |  20 +++----
+ 9 files changed, 95 insertions(+), 127 deletions(-)
+
+commit 100387fdcf8bd86ba72325289258bee784b96b3c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Apr 22 23:27:01 2013 +0200
+
+    first step for a private HklGeometry
+
+ gui/hkl-gui-callbacks.cpp                |  64 ++--
+ gui/hkl-gui-modelcolumns.h               |   9 +-
+ gui/hkl-gui.cpp                          |  59 ++--
+ hkl/Hkl-5.0.gir                          | 131 ++++++++-
+ hkl/hkl-axis.c                           |  22 ++
+ hkl/hkl-axis.h                           |  10 +-
+ hkl/hkl-binding-private.h                |   6 +
+ hkl/hkl-binding.c                        |  57 ++--
+ hkl/hkl-detector.c                       |   2 +-
+ hkl/hkl-factory.c                        |  24 +-
+ hkl/hkl-geometry-private.h               |  20 +-
+ hkl/hkl-geometry.c                       | 481 +++++++++++++++++--------------
+ hkl/hkl-geometry.h                       |  24 +-
+ hkl/hkl-macros.h                         |  63 ++--
+ hkl/hkl-pseudoaxis-common-hkl.c          |  61 ++--
+ hkl/hkl-pseudoaxis-common-psi.c          |  16 +-
+ hkl/hkl-pseudoaxis-common-q.c            |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c             |   4 +-
+ hkl/hkl-pseudoaxis-private.h             |   2 +
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c     |  15 +-
+ hkl/hkl-pseudoaxis.c                     |  27 +-
+ hkl/hkl-pseudoaxis.h                     |   2 +
+ hkl/hkl-sample.c                         |  21 +-
+ hkl3d/hkl3d.cpp                          |  20 +-
+ tests/Makefile.am                        |   6 +-
+ tests/bindings/trajectory.py             |   9 +-
+ tests/hkl-axis-t.c                       |  28 +-
+ tests/hkl-bench-t.c                      |  11 +-
+ tests/hkl-detector-t.c                   |   6 +-
+ tests/hkl-geometry-t.c                   |  50 ++--
+ tests/hkl-pseudoaxis-e4ch-t.c            | 100 ++++---
+ tests/hkl-pseudoaxis-e4cv-t.c            |  32 +-
+ tests/hkl-pseudoaxis-e6c-t.c             | 121 ++++----
+ tests/hkl-pseudoaxis-k4cv-t.c            |  54 ++--
+ tests/hkl-pseudoaxis-k6c-t.c             |  63 ++--
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c |  28 +-
+ tests/hkl-pseudoaxis-t.c                 |  10 +-
+ tests/hkl-pseudoaxis-zaxis-t.c           |  10 +-
+ tests/hkl-sample-t.c                     | 139 +++++----
+ tests/hkl3d-test-t.c                     |  28 +-
+ 40 files changed, 1063 insertions(+), 774 deletions(-)
+
+commit d7e4cbd8a052d89921488581ef670b873ebfef76
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Apr 17 09:55:39 2013 +0200
+
+    to delete
+
+ hkl/Hkl-5.0.gir              | 504 +------------------------------------------
+ hkl/hkl-detector.c           |   2 +
+ hkl/hkl-geometry-private.h   | 185 ++++++++++++++++
+ hkl/hkl-geometry.c           |   2 +-
+ hkl/hkl-geometry.h           | 159 +++++---------
+ hkl/hkl-pseudoaxis-private.h |   4 +-
+ hkl/hkl-sample.c             |   4 +-
+ hkl/hkl-type-builtins.c      |  26 ---
+ hkl/hkl-type-builtins.h      |   4 -
+ 9 files changed, 248 insertions(+), 642 deletions(-)
+
+commit bc488da1b83aee0ce0b9f27466ade8db3a041e92
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Mar 30 18:03:46 2013 +0100
+
+    switch to the new factory API and remove the old one
+
+ Documentation/sphinx/source/bindings/python.py     |   7 +-
+ .../sphinx/source/pyplots/trajectory_full.py       |   7 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |   7 +-
+ gui/hkl-gui-callbacks.cpp                          |  11 +-
+ gui/hkl-gui.cpp                                    |  11 +-
+ hkl/Hkl-5.0.gir                                    | 312 ++------------------
+ hkl/hkl-factory.c                                  | 316 ++++++++++++---------
+ hkl/hkl-factory.h                                  | 194 +------------
+ tests/bindings/python.py                           |  17 +-
+ tests/bindings/trajectory.py                       |  14 +-
+ tests/hkl-axis-t.c                                 |   1 +
+ tests/hkl-bench-t.c                                |  18 +-
+ tests/hkl-pseudoaxis-e4ch-t.c                      |  48 ++--
+ tests/hkl-pseudoaxis-e4cv-t.c                      |  48 ++--
+ tests/hkl-pseudoaxis-e6c-t.c                       |  40 +--
+ tests/hkl-pseudoaxis-k4cv-t.c                      |  24 +-
+ tests/hkl-pseudoaxis-k6c-t.c                       |  32 +--
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c           |   8 +-
+ tests/hkl-pseudoaxis-t.c                           | 122 ++------
+ tests/hkl-pseudoaxis-zaxis-t.c                     |   8 +-
+ tests/hkl-sample-t.c                               |  42 +--
+ tests/hkl3d-test-t.c                               |   6 +-
+ 22 files changed, 402 insertions(+), 891 deletions(-)
+
+commit f85a7573903e27f1ae9fbab207ee93b8deb7c7e3
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Mar 30 17:45:49 2013 +0100
+
+    move some code to be more user friendly
+
+ hkl/hkl-pseudoaxis-auto-private.h | 25 ++++++++++++-------------
+ 1 file changed, 12 insertions(+), 13 deletions(-)
+
+commit 68e6229e2499d60cf20236f6e91053ee3e782d0a
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Mar 30 17:45:03 2013 +0100
+
+    fix a bug when DEBUG was set
+    
+    change list -> darray
+
+ hkl/hkl-pseudoaxis-auto.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 2270e73cdaa27a76e1e9c06258f6b8db16774b21
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Mar 30 17:44:00 2013 +0100
+
+    fix a bug in the constant_incidence K6C mode
+    
+    the .get method was empty.
+
+ hkl/hkl-pseudoaxis-common-hkl-private.h | 6 ++++++
+ hkl/hkl-pseudoaxis-k6c-hkl.c            | 6 ++----
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+commit 6715594ca1cab6b73695874de34a5d33809ff5a8
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Mar 29 13:42:56 2013 +0100
+
+    now use constructor for the hkl_engine_list_xxx
+
+ hkl/hkl-factory.c | 333 ++++++++++++++++++++++++++++++++++++++----------------
+ 1 file changed, 238 insertions(+), 95 deletions(-)
+
+commit feb9e34fa5c0a25b33d410976737fb01e83f9a90
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Mar 29 11:37:43 2013 +0100
+
+    remove the CREATE_CONSTRUCTOR in favor of futur hkl_geometry_new_xxx
+
+ hkl/hkl-factory.c | 167 ++++++++++++++++++++++++------------------------------
+ hkl/hkl-factory.h |   4 +-
+ 2 files changed, 75 insertions(+), 96 deletions(-)
+
+commit 649fa8da98c0b7959af8af970ac4e603db085907
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Mar 27 17:31:47 2013 +0100
+
+    clean does not remove the figures (it takes time to rebuild)
+
+ Documentation/figures/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit d2a263957909971304b19e5dd0c82225244de31d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Mar 26 18:03:25 2013 +0100
+
+    add autodata since it seems to work with gcc and clang
+
+ Makefile.am                    |   2 +-
+ configure.ac                   |  18 ++
+ hkl/Hkl-5.0.gir                |   5 +
+ hkl/Makefile.am                |   1 +
+ hkl/ccan/Makefile.am           |   7 +
+ hkl/ccan/autodata/LICENSE      |   1 +
+ hkl/ccan/autodata/autodata.c   |  80 +++++++++
+ hkl/ccan/autodata/autodata.h   | 108 ++++++++++++
+ hkl/ccan/compiler/LICENSE      |   1 +
+ hkl/ccan/compiler/compiler.h   | 217 ++++++++++++++++++++++++
+ hkl/ccan/list/list.h           |  90 ++++++++++
+ hkl/ccan/noerr/LICENSE         |   1 +
+ hkl/ccan/noerr/noerr.c         |  43 +++++
+ hkl/ccan/noerr/noerr.h         |  33 ++++
+ hkl/ccan/ptr_valid/LICENSE     |   1 +
+ hkl/ccan/ptr_valid/ptr_valid.c | 339 ++++++++++++++++++++++++++++++++++++
+ hkl/ccan/ptr_valid/ptr_valid.h | 229 +++++++++++++++++++++++++
+ hkl/hkl-binding.c              |  18 +-
+ hkl/hkl-factory-private.h      |  34 ++++
+ hkl/hkl-factory.c              | 377 ++++++++++++++++++++++++-----------------
+ hkl/hkl-factory.h              |   2 +
+ 21 files changed, 1440 insertions(+), 167 deletions(-)
+
+commit a5135f4e8f3923888f6aa89792b38f87ea51fcc2
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Mar 26 15:39:31 2013 +0100
+
+    move the geometry-factory and the pseudoaxis-factory inthe same file
+    
+    in order to provide an unifyed factory class, prepare the transition
+    and move all factories in the same hkl-factory unit.
+
+ hkl.h                        |   3 +-
+ hkl/Hkl-5.0.gir              |  23 ++
+ hkl/Makefile.am              |  12 +-
+ hkl/hkl-binding-private.h    |   7 +
+ hkl/hkl-binding.c            |  32 +++
+ hkl/hkl-factory.c            | 516 +++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-factory.h            | 229 +++++++++++++++++++
+ hkl/hkl-geometry-factory.c   | 333 ----------------------------
+ hkl/hkl-geometry-factory.h   | 220 ------------------
+ hkl/hkl-pseudoaxis-factory.c | 179 ---------------
+ hkl/hkl-pseudoaxis-factory.h |  34 ---
+ tests/bindings/python.py     |  15 ++
+ 12 files changed, 827 insertions(+), 776 deletions(-)
+
+commit 90e9dba1f5fed75580b61bbd26ca015c45e66536
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 25 17:43:41 2013 +0100
+
+    remove now useless TESTS file
+
+ tests/Makefile.am |  2 --
+ tests/TESTS       | 22 ----------------------
+ 2 files changed, 24 deletions(-)
+
+commit 90f432f35eae1a8d2ac3fd988457d261b761ca5c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 25 17:38:59 2013 +0100
+
+    move the hkl3d test under tests directory
+
+ configure.ac            |   1 -
+ tests/Makefile.am       |  16 +++--
+ tests/hkl3d-test-t.c    | 158 ++++++++++++++++++++++++++++++++++++++++++++++++
+ tests/hkl3d/Makefile.am |  21 -------
+ tests/hkl3d/test-t.c    | 158 ------------------------------------------------
+ 5 files changed, 169 insertions(+), 185 deletions(-)
+
+commit 0814b7c21510a9c2059ba050d7fad7f17cc9b943
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Mar 25 14:57:39 2013 +0100
+
+    move all hkl tests under tests/
+
+ configure.ac                             |   1 -
+ tests/Makefile.am                        |  52 ++-
+ tests/hkl-axis-t.c                       | 174 ++++++++++
+ tests/hkl-bench-t.c                      | 185 +++++++++++
+ tests/hkl-detector-t.c                   |  97 ++++++
+ tests/hkl-error-t.c                      | 120 +++++++
+ tests/hkl-geometry-t.c                   | 331 +++++++++++++++++++
+ tests/hkl-interval-t.c                   | 316 +++++++++++++++++++
+ tests/hkl-lattice-t.c                    | 223 +++++++++++++
+ tests/hkl-matrix-t.c                     | 151 +++++++++
+ tests/hkl-parameter-t.c                  | 137 ++++++++
+ tests/hkl-pseudoaxis-e4ch-t.c            | 418 ++++++++++++++++++++++++
+ tests/hkl-pseudoaxis-e4cv-t.c            | 420 +++++++++++++++++++++++++
+ tests/hkl-pseudoaxis-e6c-t.c             | 523 +++++++++++++++++++++++++++++++
+ tests/hkl-pseudoaxis-k4cv-t.c            | 225 +++++++++++++
+ tests/hkl-pseudoaxis-k6c-t.c             | 273 ++++++++++++++++
+ tests/hkl-pseudoaxis-soleil-sixs-med-t.c | 110 +++++++
+ tests/hkl-pseudoaxis-t.c                 | 282 +++++++++++++++++
+ tests/hkl-pseudoaxis-zaxis-t.c           | 100 ++++++
+ tests/hkl-quaternion-t.c                 | 158 ++++++++++
+ tests/hkl-sample-t.c                     | 467 +++++++++++++++++++++++++++
+ tests/hkl-source-t.c                     |  93 ++++++
+ tests/hkl-unit-t.c                       |  54 ++++
+ tests/hkl-vector-t.c                     | 244 ++++++++++++++
+ tests/hkl/Makefile.am                    |  39 ---
+ tests/hkl/axis-t.c                       | 174 ----------
+ tests/hkl/bench-t.c                      | 185 -----------
+ tests/hkl/detector-t.c                   |  97 ------
+ tests/hkl/error-t.c                      | 120 -------
+ tests/hkl/geometry-t.c                   | 331 -------------------
+ tests/hkl/interval-t.c                   | 316 -------------------
+ tests/hkl/lattice-t.c                    | 223 -------------
+ tests/hkl/matrix-t.c                     | 151 ---------
+ tests/hkl/parameter-t.c                  | 137 --------
+ tests/hkl/pseudoaxis-e4ch-t.c            | 418 ------------------------
+ tests/hkl/pseudoaxis-e4cv-t.c            | 420 -------------------------
+ tests/hkl/pseudoaxis-e6c-t.c             | 523 -------------------------------
+ tests/hkl/pseudoaxis-k4cv-t.c            | 225 -------------
+ tests/hkl/pseudoaxis-k6c-t.c             | 273 ----------------
+ tests/hkl/pseudoaxis-soleil-sixs-med-t.c | 110 -------
+ tests/hkl/pseudoaxis-t.c                 | 282 -----------------
+ tests/hkl/pseudoaxis-zaxis-t.c           | 100 ------
+ tests/hkl/quaternion-t.c                 | 158 ----------
+ tests/hkl/sample-t.c                     | 467 ---------------------------
+ tests/hkl/source-t.c                     |  93 ------
+ tests/hkl/unit-t.c                       |  54 ----
+ tests/hkl/vector-t.c                     | 244 --------------
+ 47 files changed, 5147 insertions(+), 5147 deletions(-)
+
+commit d200ef67880c145c00d9d65d050220cc887bcf36
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Mar 13 13:36:13 2013 +0100
+
+    fix the ccan-update target
+    
+    now the Makefile.in and the Makefile are not erased during an upgrade
+
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 68df23964052ab3e58466f876bc0bff5320edb82
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Mar 24 11:13:34 2013 +0100
+
+    switch to c-tap-harness 2.1
+
+ Makefile.am                              |    2 +-
+ configure.ac                             |   10 +-
+ test/Makefile.am                         |   20 -
+ test/TESTS                               |   22 -
+ test/bindings/Makefile.am                |    9 -
+ test/bindings/python.py                  |  179 ----
+ test/bindings/trajectory.py              |  143 ----
+ test/hkl/Makefile.am                     |   39 -
+ test/hkl/axis-t.c                        |  174 ----
+ test/hkl/bench-t.c                       |  185 ----
+ test/hkl/detector-t.c                    |   97 ---
+ test/hkl/error-t.c                       |  120 ---
+ test/hkl/geometry-t.c                    |  330 -------
+ test/hkl/interval-t.c                    |  315 -------
+ test/hkl/lattice-t.c                     |  222 -----
+ test/hkl/matrix-t.c                      |  150 ----
+ test/hkl/parameter-t.c                   |  136 ---
+ test/hkl/pseudoaxis-e4ch-t.c             |  418 ---------
+ test/hkl/pseudoaxis-e4cv-t.c             |  420 ---------
+ test/hkl/pseudoaxis-e6c-t.c              |  523 ------------
+ test/hkl/pseudoaxis-k4cv-t.c             |  225 -----
+ test/hkl/pseudoaxis-k6c-t.c              |  273 ------
+ test/hkl/pseudoaxis-soleil-sixs-med-t.c  |  109 ---
+ test/hkl/pseudoaxis-t.c                  |  282 ------
+ test/hkl/pseudoaxis-zaxis-t.c            |  100 ---
+ test/hkl/quaternion-t.c                  |  157 ----
+ test/hkl/sample-t.c                      |  466 ----------
+ test/hkl/source-t.c                      |   92 --
+ test/hkl/unit-t.c                        |   53 --
+ test/hkl/vector-t.c                      |  243 ------
+ test/hkl3d/Makefile.am                   |   21 -
+ test/hkl3d/test-t.c                      |  158 ----
+ test/runtests.c                          | 1172 -------------------------
+ test/tap/Makefile.am                     |   17 -
+ test/tap/basic.c                         |  524 ------------
+ test/tap/basic.h                         |  141 ---
+ test/tap/hkl.c                           |   86 --
+ test/tap/hkl.h                           |   39 -
+ test/tap/libtap.sh                       |  222 -----
+ tests/Makefile.am                        |   20 +
+ tests/TESTS                              |   22 +
+ tests/bindings/Makefile.am               |    9 +
+ tests/bindings/python.py                 |  179 ++++
+ tests/bindings/trajectory.py             |  143 ++++
+ tests/hkl/Makefile.am                    |   39 +
+ tests/hkl/axis-t.c                       |  174 ++++
+ tests/hkl/bench-t.c                      |  185 ++++
+ tests/hkl/detector-t.c                   |   97 +++
+ tests/hkl/error-t.c                      |  120 +++
+ tests/hkl/geometry-t.c                   |  331 +++++++
+ tests/hkl/interval-t.c                   |  316 +++++++
+ tests/hkl/lattice-t.c                    |  223 +++++
+ tests/hkl/matrix-t.c                     |  151 ++++
+ tests/hkl/parameter-t.c                  |  137 +++
+ tests/hkl/pseudoaxis-e4ch-t.c            |  418 +++++++++
+ tests/hkl/pseudoaxis-e4cv-t.c            |  420 +++++++++
+ tests/hkl/pseudoaxis-e6c-t.c             |  523 ++++++++++++
+ tests/hkl/pseudoaxis-k4cv-t.c            |  225 +++++
+ tests/hkl/pseudoaxis-k6c-t.c             |  273 ++++++
+ tests/hkl/pseudoaxis-soleil-sixs-med-t.c |  110 +++
+ tests/hkl/pseudoaxis-t.c                 |  282 ++++++
+ tests/hkl/pseudoaxis-zaxis-t.c           |  100 +++
+ tests/hkl/quaternion-t.c                 |  158 ++++
+ tests/hkl/sample-t.c                     |  467 ++++++++++
+ tests/hkl/source-t.c                     |   93 ++
+ tests/hkl/unit-t.c                       |   54 ++
+ tests/hkl/vector-t.c                     |  244 ++++++
+ tests/hkl3d/Makefile.am                  |   21 +
+ tests/hkl3d/test-t.c                     |  158 ++++
+ tests/runtests.c                         | 1377 ++++++++++++++++++++++++++++++
+ tests/tap/Makefile.am                    |   20 +
+ tests/tap/basic.c                        |  629 ++++++++++++++
+ tests/tap/basic.h                        |  134 +++
+ tests/tap/float.c                        |   67 ++
+ tests/tap/float.h                        |   42 +
+ tests/tap/hkl.c                          |   86 ++
+ tests/tap/hkl.h                          |   39 +
+ tests/tap/libtap.sh                      |  222 +++++
+ tests/tap/macros.h                       |   88 ++
+ 79 files changed, 8402 insertions(+), 7888 deletions(-)
+
+commit a969372f867880af33f05a25ae7d3c36a41dbd6f
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Mar 12 11:09:13 2013 +0100
+
+    bump the gtk-doc api version to 5
+
+ Documentation/api/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 91f3eb5ea2186e2842f8c38fb5f21a53f6a534b3
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Mar 12 11:08:04 2013 +0100
+
+    do not install the .png
+    
+    thoses png will b einstalled with the sphinx documentation
+
+ Documentation/figures/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit a501bf97cb828617679815c70af288e58a1974de
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Mar 12 10:54:06 2013 +0100
+
+    move ccan library at the right place
+
+ Makefile.am                           |  62 ++++-
+ ccan/Makefile.am                      |   9 -
+ ccan/ccan/array_size/LICENSE          |   1 -
+ ccan/ccan/array_size/array_size.h     |  26 --
+ ccan/ccan/build_assert/LICENSE        |   1 -
+ ccan/ccan/build_assert/build_assert.h |  40 ---
+ ccan/ccan/check_type/LICENSE          |   1 -
+ ccan/ccan/check_type/check_type.h     |  64 -----
+ ccan/ccan/container_of/LICENSE        |   1 -
+ ccan/ccan/container_of/container_of.h | 109 --------
+ ccan/ccan/darray/LICENSE              |   1 -
+ ccan/ccan/darray/darray.h             | 348 -------------------------
+ ccan/ccan/list/LICENSE                |   1 -
+ ccan/ccan/list/list.c                 |  43 ----
+ ccan/ccan/list/list.h                 | 473 ----------------------------------
+ ccan/licenses/BSD-MIT                 |  17 --
+ ccan/licenses/CC0                     |  28 --
+ configure.ac                          |   2 +-
+ gui/Makefile.am                       |   1 -
+ gui/hkl3d/Makefile.am                 |   1 -
+ hkl/Makefile.am                       |   4 +-
+ hkl/ccan/Makefile.am                  |  19 ++
+ hkl/ccan/array_size/LICENSE           |   1 +
+ hkl/ccan/array_size/array_size.h      |  26 ++
+ hkl/ccan/build_assert/LICENSE         |   1 +
+ hkl/ccan/build_assert/build_assert.h  |  40 +++
+ hkl/ccan/check_type/LICENSE           |   1 +
+ hkl/ccan/check_type/check_type.h      |  64 +++++
+ hkl/ccan/container_of/LICENSE         |   1 +
+ hkl/ccan/container_of/container_of.h  | 109 ++++++++
+ hkl/ccan/darray/LICENSE               |   1 +
+ hkl/ccan/darray/darray.h              | 348 +++++++++++++++++++++++++
+ hkl/ccan/list/LICENSE                 |   1 +
+ hkl/ccan/list/list.c                  |  43 ++++
+ hkl/ccan/list/list.h                  | 473 ++++++++++++++++++++++++++++++++++
+ hkl/hkl-axis.h                        |   2 +-
+ hkl/hkl-geometry.h                    |   2 +-
+ hkl/hkl-parameter-private.h           |   2 +-
+ hkl/hkl-parameter.h                   |   4 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c |   2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c       |   2 +-
+ hkl/hkl-pseudoaxis-common-psi.c       |   2 +-
+ hkl/hkl-pseudoaxis-common-q.c         |   2 +-
+ hkl/hkl-pseudoaxis-e4c-hkl.c          |   2 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c          |   2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c          |   2 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c          |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c         |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c          |   2 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c          |   2 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c       |   2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c  |   2 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c        |   2 +-
+ hkl/hkl-pseudoaxis.h                  |   2 +-
+ hkl/licenses/BSD-MIT                  |  17 ++
+ hkl/licenses/CC0                      |  28 ++
+ hkl3d/Makefile.am                     |   1 -
+ test/hkl/Makefile.am                  |   1 -
+ test/hkl3d/Makefile.am                |   1 -
+ test/tap/Makefile.am                  |   3 +-
+ 61 files changed, 1246 insertions(+), 1208 deletions(-)
+
+commit 42e6cefff257fbf5dba05205c38891ff629176b3
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Mar 10 17:08:06 2013 +0100
+
+    remove the autodata module for now
+
+ Makefile.am                     |   3 +-
+ ccan/Makefile.am                |   7 -
+ ccan/ccan/autodata/LICENSE      |   1 -
+ ccan/ccan/autodata/autodata.c   |  80 ----------
+ ccan/ccan/autodata/autodata.h   | 108 -------------
+ ccan/ccan/compiler/LICENSE      |   1 -
+ ccan/ccan/compiler/compiler.h   | 217 -------------------------
+ ccan/ccan/noerr/LICENSE         |   1 -
+ ccan/ccan/noerr/noerr.c         |  43 -----
+ ccan/ccan/noerr/noerr.h         |  33 ----
+ ccan/ccan/ptr_valid/LICENSE     |   1 -
+ ccan/ccan/ptr_valid/ptr_valid.c | 339 ----------------------------------------
+ ccan/ccan/ptr_valid/ptr_valid.h | 229 ---------------------------
+ 13 files changed, 2 insertions(+), 1061 deletions(-)
+
+commit a94c4365a7e06f9df0744e0ffa34f36a834107f6
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Mar 10 16:55:05 2013 +0100
+
+    remove the non working swig binding for now
+
+ configure.ac    | 13 -------------
+ hkl/Makefile.am | 21 ---------------------
+ 2 files changed, 34 deletions(-)
+
+commit d8bef91639330f8f1c7e19474285b5ca6e26d05c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Mar 10 16:08:36 2013 +0100
+
+    now the ccan part can be updated with the ccan-update target
+
+ Makefile.am                           |  15 ++
+ ccan/Makefile.am                      |  23 +-
+ ccan/array_size/array_size.h          |  25 --
+ ccan/build_assert/build_assert.h      |  39 ---
+ ccan/ccan/array_size/LICENSE          |   1 +
+ ccan/ccan/array_size/array_size.h     |  26 ++
+ ccan/ccan/autodata/LICENSE            |   1 +
+ ccan/ccan/autodata/autodata.c         |  80 ++++++
+ ccan/ccan/autodata/autodata.h         | 108 ++++++++
+ ccan/ccan/build_assert/LICENSE        |   1 +
+ ccan/ccan/build_assert/build_assert.h |  40 +++
+ ccan/ccan/check_type/LICENSE          |   1 +
+ ccan/ccan/check_type/check_type.h     |  64 +++++
+ ccan/ccan/compiler/LICENSE            |   1 +
+ ccan/ccan/compiler/compiler.h         | 217 ++++++++++++++++
+ ccan/ccan/container_of/LICENSE        |   1 +
+ ccan/ccan/container_of/container_of.h | 109 ++++++++
+ ccan/ccan/darray/LICENSE              |   1 +
+ ccan/ccan/darray/darray.h             | 348 +++++++++++++++++++++++++
+ ccan/ccan/list/LICENSE                |   1 +
+ ccan/ccan/list/list.c                 |  43 ++++
+ ccan/ccan/list/list.h                 | 473 ++++++++++++++++++++++++++++++++++
+ ccan/ccan/noerr/LICENSE               |   1 +
+ ccan/ccan/noerr/noerr.c               |  43 ++++
+ ccan/ccan/noerr/noerr.h               |  33 +++
+ ccan/ccan/ptr_valid/LICENSE           |   1 +
+ ccan/ccan/ptr_valid/ptr_valid.c       | 339 ++++++++++++++++++++++++
+ ccan/ccan/ptr_valid/ptr_valid.h       | 229 ++++++++++++++++
+ ccan/check_type/check_type.h          |  63 -----
+ ccan/container_of/container_of.h      | 108 --------
+ ccan/darray/LICENSE                   |   1 -
+ ccan/darray/darray.h                  | 348 -------------------------
+ ccan/licenses/BSD-MIT                 |  17 ++
+ ccan/licenses/CC0                     |  28 ++
+ ccan/list/list.c                      |  43 ----
+ ccan/list/list.h                      | 469 ---------------------------------
+ gui/Makefile.am                       |   1 +
+ gui/hkl3d/Makefile.am                 |   1 +
+ hkl/Makefile.am                       |   1 +
+ hkl/hkl-macros.h                      |   2 +
+ hkl/hkl-parameter.h                   |   2 +-
+ hkl3d/Makefile.am                     |   1 +
+ test/hkl/Makefile.am                  |   1 +
+ test/hkl3d/Makefile.am                |   3 +-
+ test/tap/Makefile.am                  |   5 +-
+ 45 files changed, 2249 insertions(+), 1109 deletions(-)
+
+commit 0c9b350b7bd0a2746dc66883e59f1ed6b99a525b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Mar 9 19:19:15 2013 +0100
+
+    fix the test suite.
+    
+    hkl3d SUBDIRS was built after . which is wrong.
+    So remove . to avoid this.
+
+ test/Makefile.am | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+commit c3425266e928836b743c3345afbe76d67c764655
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Feb 4 17:35:58 2013 +0100
+
+    pythn API evolves so the python script of the documentaiton should be fixed
+
+ Documentation/sphinx/source/pyplots/trajectory_simple.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 9dce659205905d1336bb70d73dd497f249177df9
+Merge: 8650548 776b325
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Feb 4 17:26:13 2013 +0100
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	hkl/Makefile.am
+    	hkl/hkl-pseudoaxis-common-q.c
+    	hkl/hkl-pseudoaxis-factory.c
+    	hkl/hkl-pseudoaxis-soleil-sixs-med.c
+    	hkl/pom.xml
+    	test/Makefile.am
+
+commit 776b32570079571ce35f7a3afa74d78083c6d30e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Feb 4 14:37:24 2013 +0100
+
+    add the qper_qpar figure
+
+ Documentation/figures/Makefile.am                  |  6 +-
+ Documentation/figures/qper_qpar.asy                | 66 ++++++++++++++++++++++
+ .../sphinx/source/diffractometers/med2_3.rst       |  2 +-
+ Documentation/sphinx/source/pseudo.rst             |  8 ++-
+ 4 files changed, 77 insertions(+), 5 deletions(-)
+
+commit 50df26c679c7f41064b4bd293f3108d93c638f4a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Feb 1 16:54:43 2013 +0100
+
+    switch to C99 and release the soleil-six-med qper_qpar test constrain
+
+ configure.ac                               | 2 +-
+ hkl/Makefile.am                            | 2 +-
+ test/Makefile.am                           | 2 +-
+ test/hkl-test-pseudoaxis-soleil-sixs-med.c | 6 +++---
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+commit 8650548748a4477cfa862767ceee78338609568d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jan 25 18:21:11 2013 +0100
+
+    add a non working swig binding
+
+ configure.ac    | 27 +++++++++++++++++++++++++++
+ hkl/Makefile.am | 22 ++++++++++++++++++++++
+ 2 files changed, 49 insertions(+)
+
+commit 370dcd6bed0b708956b2d6fe26987aa0005fa935
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Nov 6 16:06:00 2012 +0100
+
+    add the HklGeometryConfig description member
+    
+    populate it from the documentation
+    the idea is to use this memeber to auto-generate the diffractometer
+    part documentation. This way the descption of a geometry will be coherent
+    in the documentation and in the code.
+
+ hkl/Hkl-5.0.gir            | 203 +++++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-geometry-factory.h | 189 ++++++++++++++++++++++++++++++++++++++---
+ hkl/hkl-geometry.h         |   1 +
+ 3 files changed, 381 insertions(+), 12 deletions(-)
+
+commit 12998fb67fdd6890a2e7ba2b6f0abb22214d5cab
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Jan 30 22:33:28 2013 +0100
+
+    add the missing test file
+
+ test/Makefile.am                           |   1 +
+ test/hkl-test-pseudoaxis-soleil-sixs-med.c | 106 +++++++++++++++++++++++++++++
+ test/main.c                                |   2 +-
+ 3 files changed, 108 insertions(+), 1 deletion(-)
+
+commit 9e8639a3e673d6e831795088963b6b000509240d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 30 09:55:21 2013 +0100
+
+    unactive for now the soleil-sixs-med-2+3 test until I commit the missing file
+
+ test/Makefile.am | 1 -
+ test/main.c      | 2 +-
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+commit 58729510c1a545bce8fa030bbd9273f95cb91b67
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jan 30 09:46:31 2013 +0100
+
+    now all pseudo axes of the soleil-sixs-med-2-3 diffractometer are using the slits
+
+ hkl/hkl-pseudoaxis-factory.c         |  1 +
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c | 86 +++++++++++++-----------------------
+ hkl/hkl-pseudoaxis-soleil-sixs-med.h |  2 +
+ 3 files changed, 34 insertions(+), 55 deletions(-)
+
+commit 57054a57fb77236d670e1111f412700323a75367
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jan 27 12:49:31 2013 +0100
+
+    add test for soleil-sixs-med2_3 and fix qper_qpar
+
+ hkl/Makefile.am               |  2 +-
+ hkl/hkl-pseudoaxis-common-q.c | 25 +++++++++++++++++++------
+ test/Makefile.am              |  7 ++++---
+ test/main.c                   |  1 +
+ 4 files changed, 25 insertions(+), 10 deletions(-)
+
+commit c50ba8a06ad495dd63c95722ae3d4c25bf60c48e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Jan 15 21:55:23 2013 +0100
+
+    update the pom.xml file for the new release
+
+ hkl/pom.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 43badf8d5a97de4a319a7464b45c5fd2961a4170
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 14 17:35:23 2013 +0100
+
+    copyright for 2013
+
+ Documentation/sphinx/source/conf.py.in        | 2 +-
+ gui/hkl-gui-3d.cpp                            | 2 +-
+ gui/hkl-gui-3d.h                              | 2 +-
+ gui/hkl-gui-callbacks.cpp                     | 2 +-
+ gui/hkl-gui-modelcolumns.h                    | 2 +-
+ gui/hkl-gui-pseudoaxes.cpp                    | 2 +-
+ gui/hkl-gui-pseudoaxes.h                      | 2 +-
+ gui/hkl-gui.cpp                               | 2 +-
+ gui/hkl-gui.h                                 | 2 +-
+ gui/hkl3d/GL_ShapeDrawer.cpp                  | 2 +-
+ gui/hkl3d/GL_ShapeDrawer.h                    | 2 +-
+ gui/hkl3d/hkl3d-gui-model.cpp                 | 2 +-
+ gui/hkl3d/hkl3d-gui-model.h                   | 2 +-
+ gui/hkl3d/hkl3d-gui-scene.cpp                 | 2 +-
+ gui/hkl3d/hkl3d-gui-scene.h                   | 2 +-
+ gui/hkl3d/hkl3d-gui-view.cpp                  | 2 +-
+ gui/hkl3d/hkl3d-gui-view.h                    | 2 +-
+ gui/main.cpp                                  | 2 +-
+ hkl/hkl-axis.c                                | 2 +-
+ hkl/hkl-axis.h                                | 2 +-
+ hkl/hkl-binding-private.h                     | 2 +-
+ hkl/hkl-binding.c                             | 2 +-
+ hkl/hkl-detector-factory.c                    | 2 +-
+ hkl/hkl-detector-factory.h                    | 2 +-
+ hkl/hkl-detector.c                            | 2 +-
+ hkl/hkl-detector.h                            | 2 +-
+ hkl/hkl-geometry-factory.c                    | 2 +-
+ hkl/hkl-geometry-factory.h                    | 2 +-
+ hkl/hkl-geometry.c                            | 2 +-
+ hkl/hkl-geometry.h                            | 2 +-
+ hkl/hkl-interval.c                            | 2 +-
+ hkl/hkl-interval.h                            | 2 +-
+ hkl/hkl-lattice.c                             | 2 +-
+ hkl/hkl-lattice.h                             | 2 +-
+ hkl/hkl-macros.c                              | 2 +-
+ hkl/hkl-macros.h                              | 2 +-
+ hkl/hkl-matrix.c                              | 2 +-
+ hkl/hkl-matrix.h                              | 2 +-
+ hkl/hkl-parameter-private.h                   | 2 +-
+ hkl/hkl-parameter.c                           | 2 +-
+ hkl/hkl-parameter.h                           | 2 +-
+ hkl/hkl-pseudoaxis-auto-private.h             | 2 +-
+ hkl/hkl-pseudoaxis-auto.c                     | 2 +-
+ hkl/hkl-pseudoaxis-common-eulerians-private.h | 2 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c         | 2 +-
+ hkl/hkl-pseudoaxis-common-hkl-private.h       | 2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c               | 2 +-
+ hkl/hkl-pseudoaxis-common-psi-private.h       | 2 +-
+ hkl/hkl-pseudoaxis-common-psi.c               | 2 +-
+ hkl/hkl-pseudoaxis-common-q-private.h         | 2 +-
+ hkl/hkl-pseudoaxis-common-q.c                 | 2 +-
+ hkl/hkl-pseudoaxis-e4c-hkl.c                  | 2 +-
+ hkl/hkl-pseudoaxis-e4c-private.h              | 2 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c                  | 2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c                  | 2 +-
+ hkl/hkl-pseudoaxis-e6c-private.h              | 2 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c                  | 2 +-
+ hkl/hkl-pseudoaxis-factory.c                  | 2 +-
+ hkl/hkl-pseudoaxis-factory.h                  | 2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c                 | 2 +-
+ hkl/hkl-pseudoaxis-k4cv-private.h             | 2 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c                 | 2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c                  | 2 +-
+ hkl/hkl-pseudoaxis-k6c-private.h              | 2 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c                  | 2 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c               | 2 +-
+ hkl/hkl-pseudoaxis-petra3-private.h           | 2 +-
+ hkl/hkl-pseudoaxis-private.h                  | 2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h  | 2 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c                | 2 +-
+ hkl/hkl-pseudoaxis-zaxis-private.h            | 2 +-
+ hkl/hkl-pseudoaxis.c                          | 2 +-
+ hkl/hkl-pseudoaxis.h                          | 2 +-
+ hkl/hkl-quaternion.c                          | 2 +-
+ hkl/hkl-quaternion.h                          | 2 +-
+ hkl/hkl-sample.c                              | 2 +-
+ hkl/hkl-sample.h                              | 2 +-
+ hkl/hkl-source.c                              | 2 +-
+ hkl/hkl-source.h                              | 2 +-
+ hkl/hkl-types.c                               | 2 +-
+ hkl/hkl-types.h                               | 2 +-
+ hkl/hkl-unit.c                                | 2 +-
+ hkl/hkl-unit.h                                | 2 +-
+ hkl/hkl-vector.c                              | 2 +-
+ hkl/hkl-vector.h                              | 2 +-
+ test/bindings/python.py                       | 2 +-
+ test/hkl/axis-t.c                             | 2 +-
+ test/hkl/bench-t.c                            | 2 +-
+ test/hkl/detector-t.c                         | 2 +-
+ test/hkl/error-t.c                            | 2 +-
+ test/hkl/geometry-t.c                         | 2 +-
+ test/hkl/interval-t.c                         | 2 +-
+ test/hkl/lattice-t.c                          | 2 +-
+ test/hkl/main-t.c                             | 2 +-
+ test/hkl/matrix-t.c                           | 2 +-
+ test/hkl/parameter-t.c                        | 2 +-
+ test/hkl/pseudoaxis-e4ch-t.c                  | 2 +-
+ test/hkl/pseudoaxis-e4cv-t.c                  | 2 +-
+ test/hkl/pseudoaxis-e6c-t.c                   | 2 +-
+ test/hkl/pseudoaxis-k4cv-t.c                  | 2 +-
+ test/hkl/pseudoaxis-k6c-t.c                   | 2 +-
+ test/hkl/pseudoaxis-t.c                       | 2 +-
+ test/hkl/pseudoaxis-zaxis-t.c                 | 2 +-
+ test/hkl/quaternion-t.c                       | 2 +-
+ test/hkl/sample-t.c                           | 2 +-
+ test/hkl/source-t.c                           | 2 +-
+ test/hkl/unit-t.c                             | 2 +-
+ test/hkl/vector-t.c                           | 2 +-
+ test/hkl3d/test-t.c                           | 2 +-
+ 109 files changed, 109 insertions(+), 109 deletions(-)
+
+commit 349b0c37f04f1d0253ec135ca4e5f4a67ce45801
+Merge: 11247a9 0720588
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Jan 14 12:28:22 2013 +0100
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	hkl/hkl-geometry-factory.c
+    	hkl/hkl-geometry-factory.h
+    	hkl/hkl-geometry.h
+    	hkl/hkl-pseudoaxis-common-q-private.h
+    	hkl/hkl-pseudoaxis-factory.c
+    	hkl/hkl-pseudoaxis-soleil-sixs-med-private.h
+    	hkl/hkl-pseudoaxis-soleil-sixs-med.c
+    	test/bench.c
+
+commit 11247a9de256db36f2d0c03d18aefa77e8af3ab4
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Dec 30 18:26:18 2012 +0100
+
+    add the HKL_DEPRECATED macros to mark deprecated members and functions
+
+ hkl/hkl-macros.h | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+commit 121b45b6bd424f8b687096879be96ebc13d7d07e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Dec 30 16:57:41 2012 +0100
+
+    HklEngineOperations is now private
+
+ hkl/Hkl-5.0.gir              | 2 --
+ hkl/hkl-pseudoaxis-private.h | 1 +
+ hkl/hkl-pseudoaxis.h         | 1 -
+ 3 files changed, 1 insertion(+), 3 deletions(-)
+
+commit 18f9bf140924ff3fb5ab0bca36b001e126604e9f
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Dec 30 16:49:34 2012 +0100
+
+    HklMode expose only a public API and HklModeInfo in now private
+
+ gui/hkl-gui-pseudoaxes.cpp   |  8 +++++---
+ gui/hkl-gui.cpp              |  5 +++--
+ hkl/Hkl-5.0.gir              | 42 +++++++++++++-----------------------------
+ hkl/hkl-pseudoaxis-private.h | 17 +++++++++++++++++
+ hkl/hkl-pseudoaxis.c         | 22 ++++++++++++++++++++++
+ hkl/hkl-pseudoaxis.h         | 21 ++++-----------------
+ test/bindings/python.py      | 20 ++++++++++++++++++++
+ test/bindings/trajectory.py  |  4 ++--
+ test/hkl/bench-t.c           |  8 +++++---
+ test/hkl/pseudoaxis-e4ch-t.c | 22 +++++++++++++---------
+ test/hkl/pseudoaxis-e4cv-t.c | 29 ++++++++++++++++++-----------
+ test/hkl/pseudoaxis-e6c-t.c  | 23 +++++++++++++----------
+ test/hkl/pseudoaxis-k4cv-t.c | 13 +++++++++----
+ test/hkl/pseudoaxis-k6c-t.c  | 19 +++++++++++++------
+ test/hkl/pseudoaxis-t.c      |  6 +++---
+ 15 files changed, 160 insertions(+), 99 deletions(-)
+
+commit 18a26a250ced536249feba9671e9995ea24f37d9
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Dec 30 13:34:11 2012 +0100
+
+    HklEngineInod is now private
+    
+    this is an implementation detail.
+
+ hkl/Hkl-5.0.gir              | 11 -----------
+ hkl/hkl-pseudoaxis-private.h |  8 ++++++++
+ hkl/hkl-pseudoaxis.h         |  7 -------
+ 3 files changed, 8 insertions(+), 18 deletions(-)
+
+commit dea78b96d506a4f7d973c436a7375fb14a600d1b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Dec 30 13:27:07 2012 +0100
+
+    now HklEngine and HklEngineList expose only a restrained public API
+
+ gui/hkl-gui-pseudoaxes.cpp    | 19 ++++++----
+ gui/hkl-gui.cpp               | 10 +++--
+ hkl/Hkl-5.0.gir               | 87 +++++++++++++++++++++++++------------------
+ hkl/hkl-binding-private.h     |  2 +-
+ hkl/hkl-binding.c             |  6 ++-
+ hkl/hkl-parameter.h           |  4 +-
+ hkl/hkl-pseudoaxis-private.h  | 32 +++++++++++-----
+ hkl/hkl-pseudoaxis.c          | 74 ++++++++++++++++++++++++++++++++++--
+ hkl/hkl-pseudoaxis.h          | 26 ++++++-------
+ hkl/hkl-types.c               | 22 +++++++++++
+ hkl/hkl-types.h               |  3 ++
+ test/Makefile.am              |  4 +-
+ test/bindings/python.py       | 14 ++++---
+ test/bindings/trajectory.py   | 13 +++----
+ test/hkl/bench-t.c            | 36 ++++++++++--------
+ test/hkl/pseudoaxis-e4ch-t.c  | 62 ++++++++++++++++++++----------
+ test/hkl/pseudoaxis-e4cv-t.c  | 57 ++++++++++++++++++----------
+ test/hkl/pseudoaxis-e6c-t.c   | 71 ++++++++++++++++++++++++-----------
+ test/hkl/pseudoaxis-k4cv-t.c  | 28 ++++++++++----
+ test/hkl/pseudoaxis-k6c-t.c   | 42 +++++++++++++++------
+ test/hkl/pseudoaxis-t.c       | 47 ++++++++++++-----------
+ test/hkl/pseudoaxis-zaxis-t.c |  6 ++-
+ test/tap/hkl.c                | 28 ++++++++------
+ 23 files changed, 467 insertions(+), 226 deletions(-)
+
+commit 2a2c163c8b6ebbf17089a22cfae30658b29c97a8
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Nov 2 18:33:02 2012 +0100
+
+    be consistant and rename the darray type as explain in the darray exemples
+
+ hkl/Hkl-5.0.gir      | 30 ++++--------------------------
+ hkl/hkl-pseudoaxis.h |  8 ++++----
+ 2 files changed, 8 insertions(+), 30 deletions(-)
+
+commit 8cfde2224957f5ceae925815a4ab5deae80efbc0
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Nov 2 18:16:20 2012 +0100
+
+    now the HklEngineList is completely private
+
+ Documentation/sphinx/source/pyplots/trajectory.py  |  2 +-
+ .../sphinx/source/pyplots/trajectory_full.py       |  6 +--
+ .../sphinx/source/pyplots/trajectory_simple.py     |  6 +--
+ gui/hkl-gui-callbacks.cpp                          |  3 +-
+ gui/hkl-gui-pseudoaxes.cpp                         |  6 +--
+ gui/hkl-gui.cpp                                    |  9 ++--
+ hkl/Hkl-5.0.gir                                    | 63 ++++++++++++++--------
+ hkl/hkl-binding-private.h                          |  2 +-
+ hkl/hkl-binding.c                                  |  9 ++--
+ hkl/hkl-pseudoaxis-private.h                       |  9 ++++
+ hkl/hkl-pseudoaxis.c                               | 56 +++++++++++++++++++
+ hkl/hkl-pseudoaxis.h                               | 35 ++++++------
+ test/bindings/python.py                            |  6 +--
+ test/bindings/trajectory.py                        |  7 ++-
+ test/hkl/bench-t.c                                 |  3 +-
+ test/hkl/pseudoaxis-e4ch-t.c                       | 18 +++++--
+ test/hkl/pseudoaxis-e4cv-t.c                       | 63 ++++++++++++----------
+ test/hkl/pseudoaxis-e6c-t.c                        | 32 ++++++-----
+ test/hkl/pseudoaxis-k4cv-t.c                       | 16 ++++--
+ test/hkl/pseudoaxis-k6c-t.c                        | 16 ++++--
+ test/hkl/pseudoaxis-t.c                            | 18 +++----
+ test/hkl/pseudoaxis-zaxis-t.c                      |  4 +-
+ 22 files changed, 252 insertions(+), 137 deletions(-)
+
+commit 07205880efe1252cd12d9a12aafc2f956017c9df
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Oct 15 20:40:27 2012 +0200
+
+    invert the eta_a rotation
+
+ Documentation/sphinx/source/diffractometers/med2_3.rst | 2 +-
+ hkl/hkl-geometry-factory.c                             | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 881ba819a44b71084ad7e1037d4f726cdc4eca3c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Oct 14 10:35:29 2012 +0200
+
+    create a dedicated HklModeAutoWithInit
+
+ hkl/Hkl-5.0.gir                   |  9 -----
+ hkl/hkl-pseudoaxis-auto-private.h | 74 +++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis-auto.c         | 13 +++++++
+ hkl/hkl-pseudoaxis-k6c-hkl.c      | 11 +++---
+ hkl/hkl-pseudoaxis-private.h      | 55 +++++++++--------------------
+ hkl/hkl-pseudoaxis.c              |  3 --
+ hkl/hkl-pseudoaxis.h              |  3 --
+ 7 files changed, 110 insertions(+), 58 deletions(-)
+
+commit d89ba8350d8ea3920faa72fb980de6f90a2331e5
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Oct 13 10:52:42 2012 +0200
+
+    rename the HklMode operations op -> ops
+
+ hkl/Hkl-5.0.gir              |  2 +-
+ hkl/hkl-pseudoaxis-private.h |  4 ++--
+ hkl/hkl-pseudoaxis.c         | 46 ++++++++++++++++++++++----------------------
+ hkl/hkl-pseudoaxis.h         |  2 +-
+ 4 files changed, 27 insertions(+), 27 deletions(-)
+
+commit ac115fb74d63846f13c4903179e1a72b9cd442e5
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Oct 11 16:08:56 2012 +0200
+
+    add the SOLEIL SIXS med2+3 geometry
+
+ .../sphinx/source/diffractometers/med2_3.rst       |  64 +++++++
+ Documentation/sphinx/source/index.rst              |   1 +
+ hkl/hkl-geometry-factory.c                         |  21 +++
+ hkl/hkl-geometry-factory.h                         |   1 +
+ hkl/hkl-geometry.h                                 |   3 +-
+ hkl/hkl-pseudoaxis-factory.c                       |   5 +
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c               | 183 +++++++++++++++++++++
+ hkl/hkl-pseudoaxis-soleil-sixs-med.h               |   1 +
+ test/hkl-test-pseudoaxis.c                         |   9 +
+ 9 files changed, 287 insertions(+), 1 deletion(-)
+
+commit cf87857bf7f5266de5d00f5728b6b3e66a6930ff
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Sep 10 22:46:26 2012 +0200
+
+    fix a bunch of clang warning
+
+ hkl/hkl-binding.c            | 1 +
+ hkl/hkl-geometry-factory.c   | 2 ++
+ hkl/hkl-pseudoaxis-auto.c    | 8 ++++----
+ hkl/hkl-pseudoaxis-private.h | 2 ++
+ 4 files changed, 9 insertions(+), 4 deletions(-)
+
+commit 4a16c3f755490afb42b20abcfc16543bdcce0204
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Sep 10 22:46:42 2012 +0200
+
+    use the clean_all script
+
+ hkl/hkl-binding.c                       |  4 +--
+ hkl/hkl-pseudoaxis-auto-private.h       | 16 ++++++------
+ hkl/hkl-pseudoaxis-auto.c               | 16 ++++++------
+ hkl/hkl-pseudoaxis-common-eulerians.c   | 20 +++++++--------
+ hkl/hkl-pseudoaxis-common-hkl-private.h | 24 +++++++++---------
+ hkl/hkl-pseudoaxis-common-hkl.c         | 34 ++++++++++++-------------
+ hkl/hkl-pseudoaxis-common-psi.c         | 24 +++++++++---------
+ hkl/hkl-pseudoaxis-e4c-hkl.c            | 12 ++++-----
+ hkl/hkl-pseudoaxis-e6c-hkl.c            | 26 +++++++++----------
+ hkl/hkl-pseudoaxis-k4cv-hkl.c           | 12 ++++-----
+ hkl/hkl-pseudoaxis-k6c-hkl.c            | 28 ++++++++++-----------
+ hkl/hkl-pseudoaxis-petra3-hkl.c         | 14 +++++------
+ hkl/hkl-pseudoaxis-private.h            | 44 ++++++++++++++++-----------------
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c    |  6 ++---
+ hkl/hkl-pseudoaxis-zaxis-hkl.c          |  4 +--
+ hkl/hkl-pseudoaxis.c                    | 20 +++++++--------
+ hkl/hkl-pseudoaxis.h                    | 14 +++++------
+ 17 files changed, 159 insertions(+), 159 deletions(-)
+
+commit 045a73ba81ab8532c3dc71782fd1a85b6136101c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 10 18:46:50 2012 +0200
+
+    use darray in the hkl-pseudoaxis.h
+
+ gui/hkl-gui-callbacks.cpp             | 20 +++++------
+ gui/hkl-gui-pseudoaxes.cpp            |  8 ++---
+ gui/hkl-gui.cpp                       | 21 ++++++-----
+ hkl/Hkl-5.0.gir                       | 57 ++++++++++++++++--------------
+ hkl/hkl-binding.c                     | 12 +++----
+ hkl/hkl-geometry.c                    | 10 +++---
+ hkl/hkl-geometry.h                    |  4 +--
+ hkl/hkl-pseudoaxis-auto.c             | 17 ++++-----
+ hkl/hkl-pseudoaxis-common-eulerians.c |  6 ++--
+ hkl/hkl-pseudoaxis-private.h          | 25 +++++++-------
+ hkl/hkl-pseudoaxis.c                  | 65 +++++++++++++++++------------------
+ hkl/hkl-pseudoaxis.h                  | 22 ++++++------
+ test/bindings/trajectory.py           |  2 +-
+ test/hkl/bench-t.c                    | 21 +++++------
+ test/hkl/geometry-t.c                 | 18 +++++-----
+ test/hkl/pseudoaxis-e4ch-t.c          | 25 ++++++--------
+ test/hkl/pseudoaxis-e4cv-t.c          | 25 ++++++--------
+ test/hkl/pseudoaxis-e6c-t.c           | 20 +++++------
+ test/hkl/pseudoaxis-k4cv-t.c          | 34 +++++++-----------
+ test/hkl/pseudoaxis-k6c-t.c           | 34 +++++++-----------
+ test/hkl/pseudoaxis-t.c               | 13 +++----
+ 21 files changed, 216 insertions(+), 243 deletions(-)
+
+commit d24ca1fd6bbaa0439cbc8c184976db2d91b8b422
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 10 16:08:46 2012 +0200
+
+    replace list with darray (nicer)
+
+ Makefile.am                                  |   2 +-
+ ccan/darray/LICENSE                          |   1 +
+ ccan/darray/darray.h                         | 348 +++++++++++++++++++++++++++
+ configure.ac                                 |   2 +-
+ gui/hkl-gui-pseudoaxes.cpp                   |  24 +-
+ gui/hkl-gui.cpp                              |  24 +-
+ hkl/Hkl-5.0.gir                              |  11 +-
+ hkl/hkl-binding.c                            |   6 +-
+ hkl/hkl-parameter-private.h                  |  53 ++--
+ hkl/hkl-parameter.c                          |  10 +-
+ hkl/hkl-parameter.h                          |   6 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c        |   7 +-
+ hkl/hkl-pseudoaxis-common-hkl.c              |  30 +--
+ hkl/hkl-pseudoaxis-common-q.c                |   6 +-
+ hkl/hkl-pseudoaxis-k4cv-private.h            |   4 +-
+ hkl/hkl-pseudoaxis-k6c-private.h             |   4 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h |   4 +-
+ hkl/hkl-pseudoaxis-zaxis-private.h           |   2 +-
+ hkl/hkl-pseudoaxis.c                         |  12 +-
+ test/hkl/bench-t.c                           |   6 +-
+ test/hkl/pseudoaxis-e4ch-t.c                 |   2 +-
+ test/hkl/pseudoaxis-e4cv-t.c                 |   2 +-
+ test/hkl/pseudoaxis-e6c-t.c                  |  12 +-
+ test/hkl/pseudoaxis-k4cv-t.c                 |   4 +-
+ test/hkl/pseudoaxis-k6c-t.c                  |   4 +-
+ test/hkl/pseudoaxis-t.c                      |  31 ++-
+ test/tap/hkl.c                               |   4 +-
+ 27 files changed, 494 insertions(+), 127 deletions(-)
+
+commit e310187ac002599e2462ee1433b1fbb2ed6ddbbd
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Sep 7 15:23:57 2012 +0200
+
+    rename HklPseudoAxisEngine -> HklEngine
+    
+    simplicity
+
+ Documentation/api/hkl-sections.txt             |  50 +--
+ Documentation/hkl.texi                         |  60 ++--
+ Documentation/sphinx/source/bindings/python.py |   2 +-
+ Documentation/sphinx/source/development.rst    |  60 ++--
+ Documentation/sphinx/source/test.py            |  18 +-
+ TODO                                           |   6 +-
+ gui/hkl-gui-callbacks.cpp                      |   4 +-
+ gui/hkl-gui-modelcolumns.h                     |   2 +-
+ gui/hkl-gui-pseudoaxes.cpp                     |   8 +-
+ gui/hkl-gui-pseudoaxes.h                       |   4 +-
+ gui/hkl-gui.cpp                                |   4 +-
+ hkl/Hkl-5.0.gir                                | 410 ++++++++++++-------------
+ hkl/hkl-binding-private.h                      |   8 +-
+ hkl/hkl-binding.c                              |  34 +-
+ hkl/hkl-pseudoaxis-auto-private.h              |   2 +-
+ hkl/hkl-pseudoaxis-auto.c                      |  14 +-
+ hkl/hkl-pseudoaxis-common-eulerians-private.h  |   8 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c          |  44 +--
+ hkl/hkl-pseudoaxis-common-hkl-private.h        |  14 +-
+ hkl/hkl-pseudoaxis-common-hkl.c                |  42 +--
+ hkl/hkl-pseudoaxis-common-psi-private.h        |   8 +-
+ hkl/hkl-pseudoaxis-common-psi.c                |  34 +-
+ hkl/hkl-pseudoaxis-common-q-private.h          |  12 +-
+ hkl/hkl-pseudoaxis-common-q.c                  | 116 +++----
+ hkl/hkl-pseudoaxis-e4c-hkl.c                   |  22 +-
+ hkl/hkl-pseudoaxis-e4c-private.h               |   4 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c                   |  10 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c                   |  36 +--
+ hkl/hkl-pseudoaxis-e6c-private.h               |   4 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c                   |  10 +-
+ hkl/hkl-pseudoaxis-factory.c                   |  52 ++--
+ hkl/hkl-pseudoaxis-k4cv-hkl.c                  |  34 +-
+ hkl/hkl-pseudoaxis-k4cv-private.h              |   4 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c                  |  10 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c                   |  46 +--
+ hkl/hkl-pseudoaxis-k6c-private.h               |   4 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c                   |  10 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c                |  24 +-
+ hkl/hkl-pseudoaxis-petra3-private.h            |   2 +-
+ hkl/hkl-pseudoaxis-private.h                   |  54 ++--
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h   |   4 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c           |  22 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c                 |  12 +-
+ hkl/hkl-pseudoaxis-zaxis-private.h             |   2 +-
+ hkl/hkl-pseudoaxis.c                           |  92 +++---
+ hkl/hkl-pseudoaxis.h                           |  32 +-
+ hkl/hkl-types.c                                |  24 +-
+ hkl/hkl-types.h                                |   4 +-
+ test/bindings/python.py                        |   4 +-
+ test/hkl/bench-t.c                             |  18 +-
+ test/hkl/pseudoaxis-e4ch-t.c                   |  64 ++--
+ test/hkl/pseudoaxis-e4cv-t.c                   |  66 ++--
+ test/hkl/pseudoaxis-e6c-t.c                    |  74 ++---
+ test/hkl/pseudoaxis-k4cv-t.c                   |  32 +-
+ test/hkl/pseudoaxis-k6c-t.c                    |  34 +-
+ test/hkl/pseudoaxis-t.c                        |  16 +-
+ test/hkl/pseudoaxis-zaxis-t.c                  |   8 +-
+ test/tap/hkl.c                                 |  10 +-
+ test/tap/hkl.h                                 |   6 +-
+ 59 files changed, 903 insertions(+), 911 deletions(-)
+
+commit 5a59792a0afce70bc007df3d9985e06f0219f2f2
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Sep 7 13:59:46 2012 +0200
+
+    rename HklPseudoAxisEngineMode -> HklMode
+    
+    simplicity :)
+
+ Documentation/api/hkl-sections.txt                 |  20 +--
+ Documentation/hkl.texi                             |  70 ++++-----
+ Documentation/sphinx/source/development.rst        |  70 ++++-----
+ Documentation/sphinx/source/pyplots/trajectory.py  |   2 +-
+ .../sphinx/source/pyplots/trajectory_full.py       |   2 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |   2 +-
+ gui/hkl-gui-pseudoaxes.cpp                         |   2 +-
+ gui/hkl-gui-pseudoaxes.h                           |   2 +-
+ hkl/Hkl-5.0.gir                                    | 169 ++++++++++-----------
+ hkl/hkl-binding.c                                  |   4 +-
+ hkl/hkl-pseudoaxis-auto-private.h                  |  26 ++--
+ hkl/hkl-pseudoaxis-auto.c                          |  20 +--
+ hkl/hkl-pseudoaxis-common-eulerians.c              |  24 +--
+ hkl/hkl-pseudoaxis-common-hkl-private.h            |  28 ++--
+ hkl/hkl-pseudoaxis-common-hkl.c                    |  12 +-
+ hkl/hkl-pseudoaxis-common-psi-private.h            |  10 +-
+ hkl/hkl-pseudoaxis-common-psi.c                    |  28 ++--
+ hkl/hkl-pseudoaxis-common-q.c                      |  42 ++---
+ hkl/hkl-pseudoaxis-e4c-hkl.c                       |  38 ++---
+ hkl/hkl-pseudoaxis-e4c-private.h                   |   2 +-
+ hkl/hkl-pseudoaxis-e4c-psi.c                       |   8 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c                       |  80 +++++-----
+ hkl/hkl-pseudoaxis-e6c-private.h                   |   2 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c                       |   8 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c                      |  38 ++---
+ hkl/hkl-pseudoaxis-k4cv-private.h                  |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c                      |   8 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c                       |  86 +++++------
+ hkl/hkl-pseudoaxis-k6c-private.h                   |   2 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c                       |   8 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c                    |  44 +++---
+ hkl/hkl-pseudoaxis-petra3-private.h                |   2 +-
+ hkl/hkl-pseudoaxis-private.h                       |  60 ++++----
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h       |   2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c               |  22 +--
+ hkl/hkl-pseudoaxis-zaxis-hkl.c                     |  14 +-
+ hkl/hkl-pseudoaxis-zaxis-private.h                 |   2 +-
+ hkl/hkl-pseudoaxis.c                               |  13 +-
+ hkl/hkl-pseudoaxis.h                               |  22 +--
+ test/bindings/python.py                            |   2 +-
+ test/bindings/trajectory.py                        |   2 +-
+ test/hkl/bench-t.c                                 |   4 +-
+ test/hkl/pseudoaxis-e4ch-t.c                       |   6 +-
+ test/hkl/pseudoaxis-e4cv-t.c                       |   6 +-
+ test/hkl/pseudoaxis-e6c-t.c                        |   4 +-
+ test/hkl/pseudoaxis-k4cv-t.c                       |   6 +-
+ test/hkl/pseudoaxis-k6c-t.c                        |   6 +-
+ test/hkl/pseudoaxis-t.c                            |   2 +-
+ 48 files changed, 514 insertions(+), 520 deletions(-)
+
+commit 970809c1b429665dbd7ce0866e24ebe390432aea
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Sep 7 13:11:48 2012 +0200
+
+    rename HklPseudoAxisEngineList -> HklEngineList
+    
+    for simplicity.
+
+ Documentation/api/hkl-sections.txt          |  22 +-
+ Documentation/hkl.texi                      |   8 +-
+ Documentation/sphinx/source/development.rst |   8 +-
+ Documentation/sphinx/source/test.py         |  56 ++---
+ gui/hkl-gui-callbacks.cpp                   |  12 +-
+ gui/hkl-gui.cpp                             |   4 +-
+ gui/hkl-gui.h                               |   2 +-
+ hkl/Hkl-5.0.gir                             | 326 ++++++++++++++--------------
+ hkl/hkl-binding-private.h                   |   2 +-
+ hkl/hkl-binding.c                           |   6 +-
+ hkl/hkl-pseudoaxis-factory.c                |  62 +++---
+ hkl/hkl-pseudoaxis-factory.h                |   2 +-
+ hkl/hkl-pseudoaxis-private.h                |  10 +-
+ hkl/hkl-pseudoaxis.c                        |  58 ++---
+ hkl/hkl-pseudoaxis.h                        |  26 +--
+ hkl/hkl-types.c                             |  20 +-
+ hkl/hkl-types.h                             |   4 +-
+ test/hkl/bench-t.c                          |  22 +-
+ test/hkl/pseudoaxis-e4ch-t.c                |  60 ++---
+ test/hkl/pseudoaxis-e4cv-t.c                |  60 ++---
+ test/hkl/pseudoaxis-e6c-t.c                 |  64 +++---
+ test/hkl/pseudoaxis-k4cv-t.c                |  30 +--
+ test/hkl/pseudoaxis-k6c-t.c                 |  40 ++--
+ test/hkl/pseudoaxis-t.c                     |  70 +++---
+ test/hkl/pseudoaxis-zaxis-t.c               |  10 +-
+ 25 files changed, 490 insertions(+), 494 deletions(-)
+
+commit 11c20a7d4f963ebb92c7ce2c32ba55b92364f747
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Sep 7 11:06:45 2012 +0200
+
+    distcheck is working
+
+ hkl/Makefile.am           | 1 +
+ test/bindings/Makefile.am | 4 +++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+commit 2fcfd93588251009a6a7ec9b17fae0f1fee8bec4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 6 13:53:24 2012 +0200
+
+    add the mode parameters to the qper_qpar engine
+
+ NEWS                          | 11 +++++++++--
+ hkl/hkl-pseudoaxis-common-q.c |  7 +++++--
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+commit f6fca348b3f644841a8065b35fb8db984ad161fa
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 6 13:04:10 2012 +0200
+
+    small bugfix
+
+ hkl/hkl-pseudoaxis-common-q.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 351a62de880fcaceb9e684cb75f0a7a23e63f167
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Sep 5 17:34:12 2012 +0200
+
+    add the qperqpar pseudo axis
+    
+    Conflicts:
+    	hkl/hkl-pseudoaxis-common-q.c
+    	hkl/hkl-pseudoaxis-common-q.h
+    	test/hkl/bench-t.c
+
+ Documentation/sphinx/source/pseudo.rst |  23 ++++++-
+ hkl/hkl-pseudoaxis-auto.c              |   4 +-
+ hkl/hkl-pseudoaxis-common-q.c          | 113 +++++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis-common-q.h          |   7 +-
+ hkl/hkl-pseudoaxis-factory.c           |   5 ++
+ test/bench.c                           |  15 +++++
+ 6 files changed, 162 insertions(+), 5 deletions(-)
+
+commit 777a730f943463f06c71901205e2c294e3e2bb07
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 6 09:44:47 2012 +0200
+
+    fix the gui crash
+
+ gui/hkl-gui-callbacks.cpp  | 37 ++++++++++++++++++++-----------------
+ gui/hkl-gui-modelcolumns.h |  2 ++
+ gui/hkl-gui.cpp            |  1 +
+ 3 files changed, 23 insertions(+), 17 deletions(-)
+
+commit b22c0755a7765bf2fe6f44beb7078fe4a7bc2f11
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 6 09:26:33 2012 +0200
+
+    add the flymake files to .gitignore
+
+ .gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit a5e8008425fad784ee9622a20c65a521438b274c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Sep 5 21:53:29 2012 +0200
+
+    fix a few bug in the gui and the qper_qpar engine
+
+ gui/hkl-gui.cpp               | 2 +-
+ hkl/hkl-pseudoaxis-common-q.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 10216c012e26dd4ce34b82ccfc1c3d7ed3866eb6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Sep 5 17:34:12 2012 +0200
+
+    add the qperqpar pseudo axis
+
+ Documentation/sphinx/source/pseudo.rst |  23 +++-
+ hkl/hkl-pseudoaxis-auto.c              |   4 +-
+ hkl/hkl-pseudoaxis-common-q-private.h  |  12 +-
+ hkl/hkl-pseudoaxis-common-q.c          | 205 ++++++++++++++++++++++++++++-----
+ hkl/hkl-pseudoaxis-factory.c           |   5 +
+ test/hkl/bench-t.c                     |   1 +
+ 6 files changed, 214 insertions(+), 36 deletions(-)
+
+commit 920776a9778ad1db99e441afcb0c364b17444339
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 4 10:11:06 2012 +0200
+
+    plot the trajectories for all availables modes.
+
+ hkl/Hkl-5.0.gir             | 15 +++++--
+ hkl/hkl-binding-private.h   |  2 +
+ hkl/hkl-binding.c           | 26 ++++++++++--
+ hkl/hkl-pseudoaxis.c        |  5 +--
+ test/bindings/trajectory.py | 99 ++++++++++++++++++++++++++++++++-------------
+ 5 files changed, 108 insertions(+), 39 deletions(-)
+
+commit 18fb59c724aa5aa4b6839d8e7c856a94b6852c12
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 3 17:30:24 2012 +0200
+
+    add the possibility to plot only a reduced number of trajectories
+
+ test/bindings/trajectory.py | 20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+commit 789be6a3273170c8f8096556ed2ce808658397ae
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 3 17:19:51 2012 +0200
+
+    produce a pdf document with the hkl 001 -> 011 trajectories
+    
+    the added trajectory.py file, generates during the make check target,
+    a pdf document which can be use for testing purpose. By looking at the
+    curve it is easyer to identify a problem with the calculation.
+
+ test/bindings/Makefile.am   |  5 ++-
+ test/bindings/trajectory.py | 94 +++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 98 insertions(+), 1 deletion(-)
+
+commit 3639fecb337ab27748ca7068c456edf9dc9d474a
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Sep 2 19:47:28 2012 +0200
+
+    add a few const to the HklGeometry methods
+
+ hkl/hkl-geometry.c | 42 +++++++++++++++++++++---------------------
+ hkl/hkl-geometry.h | 13 ++++++++-----
+ 2 files changed, 29 insertions(+), 26 deletions(-)
+
+commit 03ae598ad2b921409cfc3e9af5f64b9e82eb3827
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Sep 2 19:12:51 2012 +0200
+
+    remove a memory leak
+
+ hkl/hkl-geometry-factory.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 046fe11af038f3edc0a141ddf51d3f7b18d44e68
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Aug 28 20:27:44 2012 +0200
+
+    use the HklParameterList for the mode parameters
+    
+    I am not very happy with this transformation, the C API is not
+    convenient enough, when it comes to set individual parameters, like in
+    the test suite.
+
+ gui/hkl-gui-pseudoaxes.cpp                    |  21 ++-
+ gui/hkl-gui.cpp                               |  15 +--
+ hkl/Hkl-5.0.gir                               |  36 +++---
+ hkl/hkl-binding.c                             |   6 +-
+ hkl/hkl-parameter-private.h                   |  70 ++++------
+ hkl/hkl-parameter.c                           |  22 +++-
+ hkl/hkl-parameter.h                           |   8 +-
+ hkl/hkl-pseudoaxis-auto-private.h             |  22 ++--
+ hkl/hkl-pseudoaxis-auto.c                     |  17 +--
+ hkl/hkl-pseudoaxis-common-eulerians-private.h |  10 ++
+ hkl/hkl-pseudoaxis-common-eulerians.c         |  82 ++++++++----
+ hkl/hkl-pseudoaxis-common-hkl-private.h       |  21 ++-
+ hkl/hkl-pseudoaxis-common-hkl.c               | 107 +++++++++++-----
+ hkl/hkl-pseudoaxis-common-psi-private.h       |   7 +
+ hkl/hkl-pseudoaxis-common-psi.c               |  62 +++++----
+ hkl/hkl-pseudoaxis-common-q-private.h         |   3 +
+ hkl/hkl-pseudoaxis-common-q.c                 |  97 +++++++++-----
+ hkl/hkl-pseudoaxis-k4cv-hkl.c                 |  30 ++++-
+ hkl/hkl-pseudoaxis-k6c-hkl.c                  |  43 +++++--
+ hkl/hkl-pseudoaxis-private.h                  | 176 ++++++++++++++++----------
+ hkl/hkl-pseudoaxis.c                          |  74 +++++------
+ hkl/hkl-pseudoaxis.h                          |   9 +-
+ hkl/hkl-sample.c                              |   8 +-
+ test/hkl/bench-t.c                            |  14 +-
+ test/hkl/pseudoaxis-e4ch-t.c                  |  71 +++++------
+ test/hkl/pseudoaxis-e4cv-t.c                  |  68 +++++-----
+ test/hkl/pseudoaxis-e6c-t.c                   |  94 ++++++++------
+ test/hkl/pseudoaxis-k4cv-t.c                  |  16 ++-
+ test/hkl/pseudoaxis-k6c-t.c                   |  18 ++-
+ test/hkl/pseudoaxis-t.c                       |  35 +++--
+ test/hkl/pseudoaxis-zaxis-t.c                 |   2 +
+ test/tap/hkl.c                                |  14 +-
+ test/tap/hkl.h                                |   5 +-
+ 33 files changed, 768 insertions(+), 515 deletions(-)
+
+commit 073a9ee4c7f978d9de2c57717a46d88945faf26a
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Aug 28 08:55:41 2012 +0200
+
+    add -fpermissive to the C++ code
+
+ gui/hkl3d/Makefile.am | 1 +
+ hkl3d/Makefile.am     | 1 +
+ 2 files changed, 2 insertions(+)
+
+commit bcd48cbe2919e4ec1a48f93bfaf1760459493d59
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 27 19:07:36 2012 +0200
+
+    Add an HklParameterList
+    
+    and use it for the HklPseudoAxisEngine pseudo_axes
+    at the end we will have different kind of thoses list
+    to standardize the interaction with the hkl library,
+    and also to minimize the public API.
+    
+    fix the WIP
+
+ .../sphinx/source/pyplots/trajectory_full.py       |   4 +-
+ .../sphinx/source/pyplots/trajectory_simple.py     |   2 +-
+ gui/hkl-gui-callbacks.cpp                          |  34 +--
+ gui/hkl-gui-modelcolumns.h                         |   6 +-
+ gui/hkl-gui-pseudoaxes.cpp                         |  23 +-
+ gui/hkl-gui-pseudoaxes.h                           |   4 +-
+ gui/hkl-gui.cpp                                    |  29 +-
+ gui/hkl-gui.h                                      |   3 +-
+ hkl/Hkl-5.0.gir                                    | 324 +++++++++++----------
+ hkl/hkl-axis.c                                     |  96 +++---
+ hkl/hkl-axis.h                                     |   7 +-
+ hkl/hkl-binding-private.h                          |  21 +-
+ hkl/hkl-binding.c                                  | 133 ++++++---
+ hkl/hkl-geometry.c                                 |  19 +-
+ hkl/hkl-lattice.c                                  |  36 +--
+ hkl/hkl-parameter-private.h                        | 206 ++++++++++++-
+ hkl/hkl-parameter.c                                | 118 +++++++-
+ hkl/hkl-parameter.h                                |  46 ++-
+ hkl/hkl-pseudoaxis-auto.c                          |   3 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c              |   6 +-
+ hkl/hkl-pseudoaxis-common-hkl.c                    |  29 +-
+ hkl/hkl-pseudoaxis-common-psi.c                    |   4 +-
+ hkl/hkl-pseudoaxis-common-q.c                      |   8 +-
+ hkl/hkl-pseudoaxis-factory.c                       |  14 +-
+ hkl/hkl-pseudoaxis-private.h                       |  81 +-----
+ hkl/hkl-pseudoaxis.c                               | 137 +++++----
+ hkl/hkl-pseudoaxis.h                               |  27 +-
+ hkl/hkl-sample.c                                   |  48 +--
+ hkl/hkl-types.c                                    |   8 +-
+ test/bindings/python.py                            |  11 +-
+ test/hkl/axis-t.c                                  |  48 +--
+ test/hkl/bench-t.c                                 |  14 +-
+ test/hkl/detector-t.c                              |   4 +-
+ test/hkl/geometry-t.c                              |   2 +-
+ test/hkl/parameter-t.c                             |   2 +-
+ test/hkl/pseudoaxis-e4ch-t.c                       |  66 ++---
+ test/hkl/pseudoaxis-e4cv-t.c                       |  66 ++---
+ test/hkl/pseudoaxis-e6c-t.c                        |  66 ++---
+ test/hkl/pseudoaxis-k4cv-t.c                       |  12 +-
+ test/hkl/pseudoaxis-k6c-t.c                        |  12 +-
+ test/hkl/pseudoaxis-t.c                            |  20 +-
+ test/hkl/pseudoaxis-zaxis-t.c                      |   4 +-
+ test/tap/hkl.c                                     |  10 +-
+ 43 files changed, 1067 insertions(+), 746 deletions(-)
+
+commit e7c73595075ff6e6eac6d30899067df398b3ce64
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 27 13:16:37 2012 +0200
+
+    remove hkl_axis_is_value_compatible_with_range
+    
+    use hkl_parameter_is_valid instead
+
+ hkl/Hkl-5.0.gir             |  6 ------
+ hkl/hkl-axis.c              | 25 +++++++++++++------------
+ hkl/hkl-axis.h              |  2 --
+ hkl/hkl-geometry.c          |  2 +-
+ hkl/hkl-parameter-private.h | 13 ++++++++++++-
+ hkl/hkl-parameter.c         |  6 +-----
+ test/hkl/axis-t.c           | 18 +++++++++---------
+ test/hkl/geometry-t.c       | 14 +++++++++-----
+ 8 files changed, 45 insertions(+), 41 deletions(-)
+
+commit f77e6e2188fb71e5569eb5d7e64aa368ba86332c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 27 11:45:48 2012 +0200
+
+    avoid to update the HklParamete rinternal when doing range mutliplication
+    
+    rotation internals are identical for angle += n * 2pi.
+    So we can avoid the HklParameter update for the rotation.
+
+ hkl/hkl-geometry.c | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+commit 3e6eddf47443de0703956c57a78b5078c9c9d6d7
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 20:46:01 2012 +0200
+
+    remove a useless method
+
+ hkl/Hkl-5.0.gir | 11 -----------
+ hkl/hkl-axis.c  |  8 --------
+ hkl/hkl-axis.h  |  2 --
+ 3 files changed, 21 deletions(-)
+
+commit e331c4bd068a5cb649800028eb16adc295cf7726
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 20:36:12 2012 +0200
+
+    no need to put get_value and get_value_unit in the HklParameterOperations.
+
+ hkl/hkl-parameter-private.h | 22 +++-------------------
+ hkl/hkl-parameter.c         |  7 +++++--
+ 2 files changed, 8 insertions(+), 21 deletions(-)
+
+commit 57fc27236c459010ca55a2d66dfefec5f4ae364c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 20:19:10 2012 +0200
+
+    move hkl_axis_get_value_closest into HklParameter
+
+ hkl/Hkl-5.0.gir             | 25 +++++++------
+ hkl/hkl-axis.c              | 85 +++++++++++++++++++++++----------------------
+ hkl/hkl-axis.h              |  2 --
+ hkl/hkl-geometry.c          |  3 +-
+ hkl/hkl-parameter-private.h |  9 +++++
+ hkl/hkl-parameter.c         | 16 +++++++++
+ hkl/hkl-parameter.h         |  3 ++
+ test/hkl/axis-t.c           | 12 +++++--
+ 8 files changed, 97 insertions(+), 58 deletions(-)
+
+commit e39b3fabd2da7aec8e055fb966f999d48ed20f44
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 15:08:53 2012 +0200
+
+    remove the useless method in HklAxis
+
+ hkl/Hkl-5.0.gir   | 10 ----------
+ hkl/hkl-axis.c    |  7 -------
+ hkl/hkl-axis.h    | 10 ----------
+ test/hkl/axis-t.c | 19 ++++++++-----------
+ 4 files changed, 8 insertions(+), 38 deletions(-)
+
+commit 6717c79f8aa30a625f220f8403363a7edd6a5389
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 14:54:47 2012 +0200
+
+    HklAxis can use the HklParameter internals
+    
+    to avoid the overhead of method call use directly the HklParameter
+    internals.
+
+ hkl/hkl-axis.c | 21 +++++++++------------
+ 1 file changed, 9 insertions(+), 12 deletions(-)
+
+commit 917d9b1bbf5d2f73cbefdd8bbd6c473af529b068
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 14:41:30 2012 +0200
+
+    remove hkl_axis_is_valid
+    
+    use hkl_parameter_is_valid instead
+
+ hkl/Hkl-5.0.gir    | 5 -----
+ hkl/hkl-axis.c     | 5 -----
+ hkl/hkl-axis.h     | 2 --
+ hkl/hkl-geometry.c | 2 +-
+ 4 files changed, 1 insertion(+), 13 deletions(-)
+
+commit be2933842dd5b5e46abcf81bb745e40286b11b17
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 14:27:58 2012 +0200
+
+    remove hkl_axis_randomize
+    
+    use hkl_parameter_randomize instead
+
+ hkl/Hkl-5.0.gir             |  5 -----
+ hkl/hkl-axis.c              | 27 ++++++++++++++-------------
+ hkl/hkl-axis.h              |  2 --
+ hkl/hkl-geometry.c          |  2 +-
+ hkl/hkl-parameter-private.h | 17 +++++++++++++++--
+ hkl/hkl-parameter.c         |  7 +------
+ 6 files changed, 31 insertions(+), 29 deletions(-)
+
+commit cd64a99df9932871f0cca720fdfab02e3c7b4f18
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 14:04:04 2012 +0200
+
+    remove hkl_axis_set_value_unit
+    
+    now use directly hkl_parameter_set_value_unit
+
+ gui/hkl-gui-callbacks.cpp   |  4 ++--
+ hkl/Hkl-5.0.gir             | 16 +++-------------
+ hkl/hkl-axis.c              | 12 ++++++------
+ hkl/hkl-axis.h              |  2 --
+ hkl/hkl-binding.c           |  3 ++-
+ hkl/hkl-geometry.c          |  3 ++-
+ hkl/hkl-parameter-private.h | 11 ++++++++++-
+ hkl/hkl-parameter.c         | 16 +++++-----------
+ hkl/hkl-parameter.h         |  2 +-
+ test/hkl/axis-t.c           | 34 +++++++++++++++++-----------------
+ 10 files changed, 48 insertions(+), 55 deletions(-)
+
+commit 3b96b0e46bf65aa7c3e90ff5126c2f694615f0ff
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 12:22:19 2012 +0200
+
+    remove the hkl_axis_set_value
+    
+    now use directly hkl_parameter_set_value
+
+ hkl/Hkl-5.0.gir                 | 10 ----------
+ hkl/hkl-axis.c                  | 30 +++++++++++++++++-------------
+ hkl/hkl-axis.h                  |  2 --
+ hkl/hkl-geometry.c              | 10 ++++++----
+ hkl/hkl-parameter-private.h     | 10 +++++++++-
+ hkl/hkl-parameter.c             |  3 +--
+ hkl/hkl-pseudoaxis-auto.c       |  3 ++-
+ hkl/hkl-pseudoaxis-common-hkl.c |  7 ++++---
+ hkl/hkl-pseudoaxis-factory.c    | 12 ++++++------
+ hkl/hkl-pseudoaxis-private.h    |  5 +++--
+ test/hkl/detector-t.c           |  4 ++--
+ test/hkl/geometry-t.c           |  2 +-
+ 12 files changed, 51 insertions(+), 47 deletions(-)
+
+commit d2d7ea6d32e8ff4763955a31c0d9a1dcf4b099aa
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 11:32:49 2012 +0200
+
+    remove all HklAxis method which were in fact HklParameter methods
+
+ hkl/Hkl-5.0.gir       | 44 --------------------------------------------
+ hkl/hkl-axis.c        | 20 --------------------
+ hkl/hkl-axis.h        |  8 --------
+ hkl/hkl-geometry.c    |  2 +-
+ test/hkl/axis-t.c     | 10 +++++-----
+ test/hkl/geometry-t.c | 12 ++++++------
+ 6 files changed, 12 insertions(+), 84 deletions(-)
+
+commit 928c6bdc79970da2ed340b8942fae77432c42583
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 11:21:41 2012 +0200
+
+    remove hkl_axis_get/set_changed
+
+ hkl/Hkl-5.0.gir       | 15 ---------------
+ hkl/hkl-axis.c        | 10 ----------
+ hkl/hkl-axis.h        |  4 ----
+ hkl/hkl-geometry.c    |  4 ++--
+ test/hkl/geometry-t.c |  4 ++--
+ 5 files changed, 4 insertions(+), 33 deletions(-)
+
+commit 1bce20b03855514f813afe5017d130f62b6d3f2e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 10:23:17 2012 +0200
+
+    remove hkl_axis_get_name
+
+ hkl/Hkl-5.0.gir    | 5 -----
+ hkl/hkl-axis.c     | 5 -----
+ hkl/hkl-axis.h     | 2 --
+ hkl/hkl-geometry.c | 8 ++++----
+ hkl/hkl-sample.c   | 2 +-
+ 5 files changed, 5 insertions(+), 17 deletions(-)
+
+commit b2d7295407d0aad0b72b9f9168b5ba051e82ad2c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 26 10:11:42 2012 +0200
+
+    no more hkl_axis_get_value_unit
+
+ gui/hkl-gui.cpp             |  4 ++--
+ hkl/Hkl-5.0.gir             | 31 ++++++++++---------------------
+ hkl/hkl-axis.c              |  7 +------
+ hkl/hkl-axis.h              |  2 --
+ hkl/hkl-parameter-private.h | 16 +++++++++++++++-
+ hkl/hkl-parameter.c         | 33 ++++++++++++++++++++-------------
+ hkl/hkl-parameter.h         | 19 +++----------------
+ test/hkl/axis-t.c           | 22 +++++++++++-----------
+ 8 files changed, 62 insertions(+), 72 deletions(-)
+
+commit 70485aa23ba94923316ef06727f7def96625acd5
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 25 22:15:09 2012 +0200
+
+    test get_value
+
+ hkl/Hkl-5.0.gir                       |  31 +++++-----
+ hkl/hkl-axis.c                        |  55 ++++++++---------
+ hkl/hkl-axis.h                        |   4 +-
+ hkl/hkl-binding.c                     |   2 +-
+ hkl/hkl-geometry.c                    |  19 +++---
+ hkl/hkl-lattice.c                     | 106 ++++++++++++++++++---------------
+ hkl/hkl-parameter-private.h           |   8 +--
+ hkl/hkl-parameter.c                   |  31 ++++------
+ hkl/hkl-parameter.h                   |  19 +++++-
+ hkl/hkl-pseudoaxis-auto.c             |   4 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c |  16 +++--
+ hkl/hkl-pseudoaxis-common-hkl.c       |  35 ++++++-----
+ hkl/hkl-pseudoaxis-common-psi.c       |  13 ++--
+ hkl/hkl-pseudoaxis-common-q.c         |   1 +
+ hkl/hkl-pseudoaxis-e4c-hkl.c          |  13 ++--
+ hkl/hkl-pseudoaxis-e4c-psi.c          |   7 ++-
+ hkl/hkl-pseudoaxis-e6c-hkl.c          |  25 ++++----
+ hkl/hkl-pseudoaxis-e6c-psi.c          |   7 ++-
+ hkl/hkl-pseudoaxis-factory.c          |  12 ++--
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         |  25 ++++----
+ hkl/hkl-pseudoaxis-k4cv-psi.c         |   7 ++-
+ hkl/hkl-pseudoaxis-k6c-hkl.c          |  43 +++++++-------
+ hkl/hkl-pseudoaxis-k6c-psi.c          |   7 ++-
+ hkl/hkl-pseudoaxis.c                  |   4 +-
+ hkl/hkl-sample.c                      |  65 +++++++++++---------
+ test/bindings/python.py               |   2 +-
+ test/hkl/axis-t.c                     |   4 +-
+ test/hkl/bench-t.c                    |   8 +--
+ test/hkl/geometry-t.c                 |  14 ++---
+ test/hkl/lattice-t.c                  | 108 +++++++++++++++++-----------------
+ test/hkl/parameter-t.c                |  11 ++--
+ test/hkl/pseudoaxis-e4ch-t.c          |  68 ++++++++-------------
+ test/hkl/pseudoaxis-e4cv-t.c          |  69 ++++++++--------------
+ test/hkl/pseudoaxis-e6c-t.c           |  24 ++++----
+ test/hkl/pseudoaxis-k4cv-t.c          |   4 +-
+ test/hkl/pseudoaxis-k6c-t.c           |   4 +-
+ test/hkl/pseudoaxis-t.c               |  10 ++--
+ test/hkl/sample-t.c                   |  69 +++++++++++-----------
+ test/tap/hkl.c                        |   7 ++-
+ test/tap/hkl.h                        |   2 +-
+ 40 files changed, 481 insertions(+), 482 deletions(-)
+
+commit b2e0c4f540fcd2f7938a48e8e396252e50468418
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 25 12:15:16 2012 +0200
+
+    hkl_parameter_init from public -> private
+
+ hkl/Hkl-5.0.gir        | 34 ---------------------
+ hkl/hkl-parameter.c    | 76 +++++++++++++++++++---------------------------
+ hkl/hkl-parameter.h    |  5 ----
+ test/hkl/parameter-t.c | 81 +++++++++++++++++++++++++++-----------------------
+ 4 files changed, 73 insertions(+), 123 deletions(-)
+
+commit 384af436c1111750f929c328d28619e4a573eebb
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 25 11:57:32 2012 +0200
+
+    test parameter operations
+
+ hkl/Hkl-5.0.gir             | 15 +++++++++++++++
+ hkl/hkl-axis.c              | 23 ++++++++++++++++-------
+ hkl/hkl-lattice.c           |  1 +
+ hkl/hkl-parameter-private.h | 46 +++++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-parameter.c         | 14 +++++++++++++-
+ hkl/hkl-parameter.h         |  4 ++++
+ hkl/hkl-sample.c            |  1 +
+ 7 files changed, 96 insertions(+), 8 deletions(-)
+
+commit e0eb3844e761f5873128cceeb733ef23cd43e14f
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 25 11:54:37 2012 +0200
+
+    .gitignore
+
+ .gitignore | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit e6fcea5fd07baa97e196ca86dd0ae3a3aaed457b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 25 10:19:43 2012 +0200
+
+    remove an introspection warning - inconsistency
+    
+    the second paramater of the hkl_geometry_distance_xxx method is now
+    consider as the reference HklGeometry to compare with . It is easyer
+    to understand in the rest of the code.
+
+ hkl/Hkl-5.0.gir    | 12 ++++++------
+ hkl/hkl-geometry.c | 14 ++++++--------
+ hkl/hkl-geometry.h |  4 ++--
+ 3 files changed, 14 insertions(+), 16 deletions(-)
+
+commit dedbd84d83b24c038e88a5e879642a7d05895df0
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 25 10:03:05 2012 +0200
+
+    rename in HklParameter parent -> parameter
+
+ Documentation/sphinx/source/pyplots/trajectory.py        |  2 +-
+ Documentation/sphinx/source/pyplots/trajectory_simple.py |  2 +-
+ gui/hkl-gui-pseudoaxes.cpp                               |  4 ++--
+ gui/hkl-gui.cpp                                          |  2 +-
+ hkl/hkl-binding.c                                        |  4 ++--
+ hkl/hkl-pseudoaxis-common-eulerians.c                    |  6 +++---
+ hkl/hkl-pseudoaxis-common-hkl.c                          |  6 +++---
+ hkl/hkl-pseudoaxis-common-psi.c                          |  2 +-
+ hkl/hkl-pseudoaxis-common-q.c                            |  4 ++--
+ hkl/hkl-pseudoaxis-private.h                             |  6 +++---
+ hkl/hkl-pseudoaxis.c                                     |  8 ++++----
+ hkl/hkl-pseudoaxis.h                                     |  2 +-
+ test/bindings/python.py                                  |  2 +-
+ test/hkl/bench-t.c                                       |  2 +-
+ test/hkl/pseudoaxis-e6c-t.c                              | 10 +++++-----
+ test/hkl/pseudoaxis-t.c                                  | 10 +++++-----
+ test/tap/hkl.c                                           |  4 ++--
+ 17 files changed, 38 insertions(+), 38 deletions(-)
+
+commit db0a0a9669cae421fd4bc6650833de15fa923f98
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Aug 24 23:53:57 2012 +0200
+
+    add a few gitignore
+
+ .gitignore | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+commit 5065229841b3de48f54eee7955927bd61cc1594f
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Aug 24 23:53:37 2012 +0200
+
+    rename HklAxis->parent_instance into parameter
+
+ Documentation/sphinx/source/bindings/python.py           | 2 +-
+ Documentation/sphinx/source/pyplots/trajectory.py        | 4 ++--
+ Documentation/sphinx/source/pyplots/trajectory_full.py   | 2 +-
+ Documentation/sphinx/source/pyplots/trajectory_simple.py | 2 +-
+ hkl/Hkl-5.0.gir                                          | 2 +-
+ hkl/hkl-axis.h                                           | 2 +-
+ hkl/hkl-binding.c                                        | 2 +-
+ hkl/hkl-pseudoaxis-auto.c                                | 4 ++--
+ hkl/hkl-pseudoaxis-common-eulerians.c                    | 6 +++---
+ test/bindings/python.py                                  | 2 +-
+ 10 files changed, 14 insertions(+), 14 deletions(-)
+
+commit 14486185d6f2610f9eb2b60c65ca238de31e05bb
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 24 17:25:22 2012 +0200
+
+    start to add a few figures for the trajectories
+    
+    explain the problem of the solution 2..n when computing trajectory.
+    It is necessary to use only the first closest solution for now. If we
+    want to provide fully valid trajectory it will be necessary to work on
+    a dedicated trajectory API.
+
+ Documentation/sphinx/source/bindings/bindings.rst  | 109 ++++++++++++++++++++-
+ Documentation/sphinx/source/pyplots/trajectory.py  |  40 +++-----
+ .../sphinx/source/pyplots/trajectory_full.py       |  66 +++++++++++++
+ .../sphinx/source/pyplots/trajectory_simple.py     |  79 +++++++++++++++
+ hkl/Hkl-5.0.gir                                    |   1 -
+ hkl/hkl-geometry.c                                 |   8 +-
+ test/bindings/python.py                            |   3 +-
+ 7 files changed, 270 insertions(+), 36 deletions(-)
+
+commit d333c9a934a65e736ca9585a1b6204b95c972714
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 24 09:23:30 2012 +0200
+
+    gives access to the hkl_geometry_distance method to bindings
+    
+    d = geometry.distance(geometry2)
+
+ Documentation/sphinx/source/pyplots/trajectory.py |  4 ++--
+ hkl/Hkl-5.0.gir                                   | 10 ++++------
+ hkl/hkl-geometry.c                                |  8 ++++----
+ 3 files changed, 10 insertions(+), 12 deletions(-)
+
+commit 3a41b7c6e77cb12930bb508be3aa82ce27e33b30
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 23 17:48:50 2012 +0200
+
+    add plots to the documentation.
+
+ Documentation/sphinx/source/bindings/bindings.rst |  5 ++
+ Documentation/sphinx/source/conf.py.in            |  6 +-
+ Documentation/sphinx/source/pyplots/trajectory.py | 99 +++++++++++++++++++++++
+ sphinx.make                                       |  4 +-
+ test/bindings/python.py                           |  5 +-
+ 5 files changed, 114 insertions(+), 5 deletions(-)
+
+commit a90e5d5cc34068b3bcf53f797b7fc39aafd8544b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 23 13:31:08 2012 +0200
+
+    acces to HklGeometry axes member is possible
+    
+    exemple:
+      axes = geometry.axes()
+
+ Documentation/sphinx/source/bindings/python.py |  85 +++++++++---------
+ hkl/Hkl-5.0.gir                                |  97 ++++++++++++++++----
+ hkl/hkl-binding-private.h                      |  11 ++-
+ hkl/hkl-binding.c                              | 117 +++++++++++++++++++++----
+ hkl/hkl-geometry.h                             |   6 +-
+ hkl/hkl-pseudoaxis.h                           |  13 ++-
+ test/bindings/python.py                        |  46 +++++++---
+ 7 files changed, 280 insertions(+), 95 deletions(-)
+
+commit db9ac07e164a70270980748f339335da6a1418d0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 22 16:07:30 2012 +0200
+
+    now we can get an array of the pseudo axes values with the units
+    
+    exemple
+    
+    engine.get_values_unit()
+
+ hkl/Hkl-5.0.gir           | 25 ++++++++++++++++++++++---
+ hkl/hkl-binding-private.h |  3 +++
+ hkl/hkl-binding.c         | 23 +++++++++++++++++++++++
+ hkl/hkl-pseudoaxis.c      | 10 +++++-----
+ test/bindings/python.py   |  3 ++-
+ 5 files changed, 55 insertions(+), 9 deletions(-)
+
+commit 6a95753a9cec70d14631e8add12e2312e9b76fb6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 22 15:48:23 2012 +0200
+
+    get all values of and engine at a time
+
+ test/bindings/python.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 38c659adfe6736d88adccde7c3cfd70872bf9e39
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 22 14:57:01 2012 +0200
+
+    improve the documentaiton about the binding
+    
+    hkl_parameter_get_value_unit (skip) -> binding
+
+ Documentation/sphinx/source/bindings/python.py | 24 ++++++++++++++++++++++++
+ hkl/Hkl-5.0.gir                                |  3 +--
+ hkl/hkl-parameter.c                            |  4 ++--
+ 3 files changed, 27 insertions(+), 4 deletions(-)
+
+commit 4a5352a3e42de677f32980924377dee679b68757
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 22 14:55:35 2012 +0200
+
+    check that pseudo axis value is reachable from the python binding
+
+ test/bindings/python.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit bf1918b5fbf5e1561bdb0eb3cf6d520d765d54be
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 22 14:54:46 2012 +0200
+
+    let use the "rad" instead of "" for the angle radian represeantion
+
+ hkl/hkl-unit.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 52cc6c1c4dd69d74ea63dbe5c0787dad934ccdb3
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 18:16:50 2012 +0200
+
+    check also that the geometry member of the geometrylistItem is correct
+
+ test/bindings/python.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 495d876c82040116a4affa7d03110df869ab8bc8
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 18:11:41 2012 +0200
+
+    now we can iterate for each pseudo_axis
+    
+    for pseudo_axis in engine.pseudo_axes():
+    	print pseudo_axis
+
+ hkl/Hkl-5.0.gir           | 10 ++++++++++
+ hkl/hkl-binding-private.h |  6 ++++++
+ hkl/hkl-binding.c         | 19 +++++++++++++++++++
+ test/bindings/python.py   |  2 ++
+ 4 files changed, 37 insertions(+)
+
+commit c4821e27fbd42df4e99674397bcd2145cf1e3586
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 17:10:24 2012 +0200
+
+    reorder the python test to follow the alphabetic order
+    
+    test are executed in the alphabetic order.
+
+ test/bindings/python.py | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+commit a2b26f0ffac694dab71b615750c9c2f8b433d494
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 17:09:46 2012 +0200
+
+    move all the binding method into dedicated files
+
+ hkl/Hkl-5.0.gir           |  31 +++++--------
+ hkl/Makefile.am           |   6 ++-
+ hkl/hkl-binding-private.h |  53 +++++++++++++++++++++++
+ hkl/hkl-binding.c         | 108 ++++++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-geometry.c        |  47 --------------------
+ hkl/hkl-geometry.h        |   7 ---
+ hkl/hkl-pseudoaxis.c      |  30 -------------
+ hkl/hkl-pseudoaxis.h      |   3 --
+ test/bindings/python.py   |   1 +
+ 9 files changed, 178 insertions(+), 108 deletions(-)
+
+commit 42c72141321d43962aaf414b22d4d9e2ee2276c2
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 14:13:24 2012 +0200
+
+    add the .gir file
+    
+    even if this fil is generated, it will be easyer to follow binding
+    evolution when tuning the annotations.
+
+ hkl/Hkl-5.0.gir | 4267 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 4267 insertions(+)
+
+commit 0bb2e3b2cfd726f6c2eb9a007e553a1aaa2c3129
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 14:10:30 2012 +0200
+
+    remove a few const in the struct xxxInfo
+    
+    this should solve the "assignment of read-only location"
+    when creating copy constructors.
+
+ hkl/hkl-pseudoaxis.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit a7bac918ce218eb7bff690ad03be7f97fed42946
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 13:47:23 2012 +0200
+
+    be clear that binding api will not be public in near futur
+
+ hkl/hkl-geometry.c   | 121 ++++++++++++++++++++-------------------------------
+ hkl/hkl-geometry.h   |   2 +-
+ hkl/hkl-pseudoaxis.h |   5 +--
+ 3 files changed, 49 insertions(+), 79 deletions(-)
+
+commit 6f60459c0020f6c24038938a7e784cc1be6cec3f
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 13:46:52 2012 +0200
+
+    now it is possible to iterate over HklGeometryListItem
+    
+    exemple:
+    
+    for item in engine.geometries.items():
+    	print item
+
+ hkl/hkl-geometry.c      | 121 +++++++++++++++++++++++++++++-------------------
+ hkl/hkl-geometry.h      |   3 ++
+ test/bindings/python.py |   8 ++--
+ 3 files changed, 81 insertions(+), 51 deletions(-)
+
+commit 6ee47cc9820a93d27a31cce75f80ea95e9fb257c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 11:33:16 2012 +0200
+
+    add a binding dedicated method to the HklPseudoAxisEngineList
+    
+    now it is possible to iterate on each engine like this
+    
+    for engine in engines.engines():
+    	print engine
+
+ hkl/hkl-pseudoaxis.c    | 30 +++++++++++++++++++++++
+ hkl/hkl-pseudoaxis.h    |  7 ++++++
+ test/bindings/python.py | 65 ++++++++++++++++++++++++++++++++++++++++++-------
+ 3 files changed, 93 insertions(+), 9 deletions(-)
+
+commit e1b4dd8d610469eee847d754ccd7398f5c43200e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 09:51:58 2012 +0200
+
+    remove the hkl-pseudoaxis-engine-common files (useless)
+
+ hkl/Makefile.am                         |  2 -
+ hkl/hkl-pseudoaxis-auto-private.h       |  3 ++
+ hkl/hkl-pseudoaxis-common-eulerians.c   |  1 -
+ hkl/hkl-pseudoaxis-common-hkl-private.h |  2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c         |  3 +-
+ hkl/hkl-pseudoaxis-common-private.h     | 47 --------------------
+ hkl/hkl-pseudoaxis-common-psi.c         |  3 +-
+ hkl/hkl-pseudoaxis-common-q.c           |  4 +-
+ hkl/hkl-pseudoaxis-common.c             | 78 ---------------------------------
+ hkl/hkl-pseudoaxis-private.h            | 32 ++++++++++++--
+ 10 files changed, 36 insertions(+), 139 deletions(-)
+
+commit 150541ffc4d1c4fc5bd07ff459833b2d9bd0cdd1
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 21 09:25:37 2012 +0200
+
+    the struc _HklPseudoAxisEngineModeOperations is now part of private
+
+ hkl/hkl-pseudoaxis-private.h | 22 ++++++++++++++++++++++
+ hkl/hkl-pseudoaxis.h         | 22 ----------------------
+ 2 files changed, 22 insertions(+), 22 deletions(-)
+
+commit 5295ef5f4f7fae295d66d31fb334af251a4c2872
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 19:05:13 2012 +0200
+
+    create an HklPseudoAxisEngineModeInfo for the Automatic modes.
+
+ hkl/hkl-pseudoaxis-auto-private.h       | 26 +++++++++-
+ hkl/hkl-pseudoaxis-auto.c               | 35 ++++++++++++--
+ hkl/hkl-pseudoaxis-common-eulerians.c   |  6 +--
+ hkl/hkl-pseudoaxis-common-psi-private.h |  6 +--
+ hkl/hkl-pseudoaxis-common-psi.c         | 12 ++---
+ hkl/hkl-pseudoaxis-common-q.c           |  8 ++--
+ hkl/hkl-pseudoaxis-e4c-hkl.c            | 36 +++++++-------
+ hkl/hkl-pseudoaxis-e4c-psi.c            |  4 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c            | 78 +++++++++++++++---------------
+ hkl/hkl-pseudoaxis-e6c-psi.c            |  6 +--
+ hkl/hkl-pseudoaxis-k4cv-hkl.c           | 36 +++++++-------
+ hkl/hkl-pseudoaxis-k4cv-psi.c           |  7 +--
+ hkl/hkl-pseudoaxis-k6c-hkl.c            | 84 ++++++++++++++++-----------------
+ hkl/hkl-pseudoaxis-k6c-psi.c            |  7 +--
+ hkl/hkl-pseudoaxis-petra3-hkl.c         | 42 ++++++++---------
+ hkl/hkl-pseudoaxis-private.h            |  9 ----
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c    | 18 +++----
+ hkl/hkl-pseudoaxis-zaxis-hkl.c          | 12 ++---
+ hkl/hkl-pseudoaxis.c                    |  6 ---
+ hkl/hkl-pseudoaxis.h                    |  3 --
+ 20 files changed, 232 insertions(+), 209 deletions(-)
+
+commit 50f29b402a36d5ff0dab0764403b0372a6a463b1
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 16:13:55 2012 +0200
+
+    reorganisation of the .h files to tighten the dependencies
+
+ hkl/hkl-pseudoaxis-auto-private.h       | 13 ++++++++++++-
+ hkl/hkl-pseudoaxis-common-hkl-private.h |  4 ++--
+ hkl/hkl-pseudoaxis-common-hkl.c         |  9 ++++-----
+ hkl/hkl-pseudoaxis-common-psi.c         |  9 +++++----
+ hkl/hkl-pseudoaxis-common-q.c           |  8 +++-----
+ hkl/hkl-pseudoaxis-e4c-hkl.c            |  6 +++---
+ hkl/hkl-pseudoaxis-e4c-psi.c            |  6 ++++--
+ hkl/hkl-pseudoaxis-e6c-hkl.c            |  6 +++---
+ hkl/hkl-pseudoaxis-e6c-psi.c            |  5 +++--
+ hkl/hkl-pseudoaxis-k4cv-hkl.c           |  6 +++---
+ hkl/hkl-pseudoaxis-k4cv-psi.c           |  5 +++--
+ hkl/hkl-pseudoaxis-k6c-hkl.c            |  6 +++---
+ hkl/hkl-pseudoaxis-k6c-psi.c            |  5 +++--
+ hkl/hkl-pseudoaxis-petra3-hkl.c         |  6 +++---
+ hkl/hkl-pseudoaxis-private.h            | 16 ----------------
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c    |  6 +++---
+ hkl/hkl-pseudoaxis-zaxis-hkl.c          |  6 +++---
+ 17 files changed, 60 insertions(+), 62 deletions(-)
+
+commit 2c73502582fa6312febc83527e37822520e94821
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 14:56:49 2012 +0200
+
+    now all code diffractometers specific is private
+
+ hkl/Makefile.am                               | 26 +++----
+ hkl/hkl-pseudoaxis-auto-private.h             | 38 ++++++++++
+ hkl/hkl-pseudoaxis-auto.h                     | 38 ----------
+ hkl/hkl-pseudoaxis-common-eulerians-private.h | 33 +++++++++
+ hkl/hkl-pseudoaxis-common-eulerians.h         | 33 ---------
+ hkl/hkl-pseudoaxis-common-hkl-private.h       | 99 +++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis-common-hkl.h               | 99 ---------------------------
+ hkl/hkl-pseudoaxis-common-private.h           | 47 +++++++++++++
+ hkl/hkl-pseudoaxis-common-q-private.h         | 30 ++++++++
+ hkl/hkl-pseudoaxis-common-q.h                 | 30 --------
+ hkl/hkl-pseudoaxis-common.h                   | 47 -------------
+ hkl/hkl-pseudoaxis-e4c-hkl.c                  |  4 +-
+ hkl/hkl-pseudoaxis-e4c-private.h              | 34 +++++++++
+ hkl/hkl-pseudoaxis-e4c-psi.c                  |  2 +-
+ hkl/hkl-pseudoaxis-e4c.h                      | 34 ---------
+ hkl/hkl-pseudoaxis-e6c-hkl.c                  |  4 +-
+ hkl/hkl-pseudoaxis-e6c-private.h              | 34 +++++++++
+ hkl/hkl-pseudoaxis-e6c.h                      | 34 ---------
+ hkl/hkl-pseudoaxis-factory.c                  | 18 ++---
+ hkl/hkl-pseudoaxis-k4cv-hkl.c                 |  4 +-
+ hkl/hkl-pseudoaxis-k4cv-private.h             | 34 +++++++++
+ hkl/hkl-pseudoaxis-k4cv.h                     | 34 ---------
+ hkl/hkl-pseudoaxis-k6c-hkl.c                  |  4 +-
+ hkl/hkl-pseudoaxis-k6c-private.h              | 34 +++++++++
+ hkl/hkl-pseudoaxis-k6c.h                      | 34 ---------
+ hkl/hkl-pseudoaxis-petra3-hkl.c               |  4 +-
+ hkl/hkl-pseudoaxis-petra3-private.h           | 33 +++++++++
+ hkl/hkl-pseudoaxis-petra3.h                   | 33 ---------
+ hkl/hkl-pseudoaxis-soleil-sixs-med-private.h  | 34 +++++++++
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c          |  4 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.h          | 34 ---------
+ hkl/hkl-pseudoaxis-zaxis-hkl.c                |  4 +-
+ hkl/hkl-pseudoaxis-zaxis-private.h            | 33 +++++++++
+ hkl/hkl-pseudoaxis-zaxis.h                    | 33 ---------
+ 34 files changed, 520 insertions(+), 520 deletions(-)
+
+commit 94b542291a3ab8e396f2d350b3cea7a9541a41cf
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 14:19:40 2012 +0200
+
+    reactive tests for the euerlain4c diffractometer
+
+ test/hkl/pseudoaxis-e4cv-t.c | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+commit 2190b258bb2ce3a36a0f2c7d301bf865cd2b7038
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 14:19:04 2012 +0200
+
+    fix a warning during the introspection
+
+ hkl/hkl-pseudoaxis.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit d1b8846ca11884227afd2f1ad7fccba76ad6a024
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 14:18:02 2012 +0200
+
+    update the hkl.h files to expose only the factories.
+
+ hkl.h                        |  6 +-----
+ test/hkl/pseudoaxis-e4cv-t.c | 10 ----------
+ 2 files changed, 1 insertion(+), 15 deletions(-)
+
+commit 35483be38b7b7582de676b4b137a0f54acff88e3
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 13:55:18 2012 +0200
+
+    clean the public header of the pseudo axes.
+    
+    now it is clear to indentify public/private/protected.
+
+ hkl/hkl-pseudoaxis-auto.c             |   1 +
+ hkl/hkl-pseudoaxis-common-eulerians.c |   1 +
+ hkl/hkl-pseudoaxis-common-hkl.c       |   1 +
+ hkl/hkl-pseudoaxis-common-q.c         |   2 +
+ hkl/hkl-pseudoaxis-private.h          | 235 +++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis.c                  | 291 ----------------------------------
+ hkl/hkl-pseudoaxis.h                  |  48 +-----
+ test/hkl/pseudoaxis-e4ch-t.c          |  13 +-
+ test/hkl/pseudoaxis-e6c-t.c           |  13 +-
+ test/hkl/pseudoaxis-k4cv-t.c          |  11 +-
+ test/hkl/pseudoaxis-k6c-t.c           |  11 +-
+ test/hkl/pseudoaxis-t.c               |  25 ++-
+ 12 files changed, 270 insertions(+), 382 deletions(-)
+
+commit 71ff328851e5b1ce4cb46c27420a5ec4796f7e65
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 11:33:59 2012 +0200
+
+    add the test directory to the clean-all script and use it
+
+ scripts/clean-all       | 4 ++--
+ test/hkl/pseudoaxis-t.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+commit 8a77425a1b81fc6a9183810748769112da6e5120
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 11:02:47 2012 +0200
+
+    use the clean-all script on all relevant files
+
+ configure.ac                    |   2 +-
+ gui/hkl-gui-3d.h                |  12 +--
+ gui/hkl-gui-callbacks.cpp       |   2 +-
+ gui/hkl-gui-modelcolumns.h      | 100 +++++++++++------------
+ gui/hkl-gui.cpp                 |   3 +-
+ hkl/hkl-detector-factory.c      |   4 +-
+ hkl/hkl-detector.c              |  16 ++--
+ hkl/hkl-geometry-factory.c      |  10 +--
+ hkl/hkl-geometry.c              |  96 +++++++++++-----------
+ hkl/hkl-interval.c              |  64 +++++++--------
+ hkl/hkl-lattice.c               |  52 ++++++------
+ hkl/hkl-matrix.c                |  10 +--
+ hkl/hkl-parameter.c             |  90 ++++++++++----------
+ hkl/hkl-pseudoaxis-common-hkl.c |  42 +++++-----
+ hkl/hkl-pseudoaxis-common-hkl.h |   3 +-
+ hkl/hkl-pseudoaxis-common-q.c   |   2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c    |   2 +-
+ hkl/hkl-pseudoaxis-factory.c    |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c    |   2 +-
+ hkl/hkl-pseudoaxis.c            |  37 ++++++---
+ hkl/hkl-quaternion.c            |  10 +--
+ hkl/hkl-sample.c                | 176 ++++++++++++++++++++--------------------
+ hkl/hkl-sample.h                |   3 +-
+ hkl/hkl-source.c                |  14 ++--
+ hkl/hkl-source.h                |   2 +-
+ hkl/hkl-unit.c                  |   4 +-
+ hkl/hkl-vector.c                |   6 +-
+ 27 files changed, 388 insertions(+), 378 deletions(-)
+
+commit e69c69343c3809ebc0ec13658d9fcb78f14886d6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 10:49:34 2012 +0200
+
+    fix the yaml configure part
+
+ configure.ac | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+commit 10588f3b1f8f78008612cbb7223dc803e32daedf
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 20 09:38:32 2012 +0200
+
+    fix for real the introspection Makefile.am part
+
+ hkl/Makefile.am | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+commit 53b1afcae2ff99637122fa01d65a4dceacba5c35
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 19 22:25:53 2012 +0200
+
+    fix the version of the introspection files
+
+ hkl/Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit 5add1f0c67044eef62867050cc59e2dbd3b4ee5e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 19 21:04:42 2012 +0200
+
+    distcheck is now working
+
+ ccan/Makefile.am | 10 +++++++++-
+ hkl/Makefile.am  |  5 +++--
+ 2 files changed, 12 insertions(+), 3 deletions(-)
+
+commit cc7fe4c59f1e478b1c91ab13e4f5410d6fb7a806
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 19 20:40:26 2012 +0200
+
+    fix an header
+
+ hkl/hkl-pseudoaxis-common-psi-private.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit d46fe890051069fc944229d6d3e6afd37c4e1c44
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 19 20:40:07 2012 +0200
+
+    add the python binding unit test
+
+ configure.ac              |  1 +
+ test/Makefile.am          |  3 +++
+ test/bindings/Makefile.am |  4 +++
+ test/bindings/python.py   | 68 +++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 76 insertions(+)
+
+commit c61a0f03918da703ab5bcfffc4c352176b117923
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 19 18:27:15 2012 +0200
+
+    move a few methods of HklPseudoAxisEngineList in the private header
+
+ hkl/hkl-pseudoaxis-factory.c |  1 +
+ hkl/hkl-pseudoaxis-private.h | 13 +++++++++++++
+ hkl/hkl-pseudoaxis.c         |  2 +-
+ hkl/hkl-pseudoaxis.h         |  9 ---------
+ hkl/hkl-types.c              |  1 +
+ 5 files changed, 16 insertions(+), 10 deletions(-)
+
+commit 02b467184ea41c9dc2ab0bb3e287462da4dbec71
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 19 16:27:15 2012 +0200
+
+    start to create hkl-xxx-private.h files
+    
+    at the end only the non-private header will consist of the hkl
+    public API.
+
+ hkl/Makefile.am                         |  4 +--
+ hkl/hkl-pseudoaxis-common-psi-private.h | 56 +++++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis-common-psi.c         |  3 +-
+ hkl/hkl-pseudoaxis-common-psi.h         | 56 ---------------------------------
+ hkl/hkl-pseudoaxis-e4c-psi.c            |  2 +-
+ hkl/hkl-pseudoaxis-e6c-psi.c            |  2 +-
+ hkl/hkl-pseudoaxis-k4cv-psi.c           |  2 +-
+ hkl/hkl-pseudoaxis-k6c-psi.c            |  2 +-
+ 8 files changed, 63 insertions(+), 64 deletions(-)
+
+commit e20364a046b6f554f571857a1e97275381160569
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 19 16:17:38 2012 +0200
+
+    now Hklfunction is private
+
+ hkl/hkl-pseudoaxis-auto.c       |  1 +
+ hkl/hkl-pseudoaxis-common-psi.h |  2 +-
+ hkl/hkl-pseudoaxis-private.h    | 14 ++++++++++++++
+ hkl/hkl-pseudoaxis.h            |  7 -------
+ 4 files changed, 16 insertions(+), 8 deletions(-)
+
+commit 8bb19bf76fcdf41824691241e09bfa6d6f07be4c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 19 12:00:20 2012 +0200
+
+    small optimisation
+
+ hkl/hkl-pseudoaxis-k6c-hkl.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+commit 5b0f28cc95893238b2b670411a9c41937920830c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Aug 17 21:33:55 2012 +0200
+
+    now HklFunction containt the expected number of axes of the method
+
+ hkl/hkl-pseudoaxis-auto.c            |  21 ++++---
+ hkl/hkl-pseudoaxis-common-hkl.c      |   6 +-
+ hkl/hkl-pseudoaxis-common-hkl.h      |  22 ++++++-
+ hkl/hkl-pseudoaxis-common-psi.c      |   2 +-
+ hkl/hkl-pseudoaxis-common-psi.h      |   7 ++-
+ hkl/hkl-pseudoaxis-common-q.c        |  18 ++++--
+ hkl/hkl-pseudoaxis-e4c-hkl.c         |  19 +++---
+ hkl/hkl-pseudoaxis-e4c-psi.c         |   2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c         |  40 ++++++++-----
+ hkl/hkl-pseudoaxis-e6c-psi.c         |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c        |  68 ++++++++++++++++-----
+ hkl/hkl-pseudoaxis-k4cv-psi.c        |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c         | 112 +++++++++++++++++++++++++++--------
+ hkl/hkl-pseudoaxis-k6c-psi.c         |   2 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c      |  28 ++++++---
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c |  13 ++--
+ hkl/hkl-pseudoaxis-zaxis-hkl.c       |  11 +++-
+ hkl/hkl-pseudoaxis.c                 |   3 +
+ hkl/hkl-pseudoaxis.h                 |   9 ++-
+ 19 files changed, 280 insertions(+), 107 deletions(-)
+
+commit eb978ef6f3a0ce8f1790d2bbba08d82cc2622551
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Aug 17 17:07:32 2012 +0200
+
+    put also the parameters in the ModeInfo
+
+ hkl/hkl-pseudoaxis-common-eulerians.c |  15 +--
+ hkl/hkl-pseudoaxis-common-psi.c       |  25 +----
+ hkl/hkl-pseudoaxis-common-q.c         |   4 +-
+ hkl/hkl-pseudoaxis-e4c-hkl.c          |  75 ++++---------
+ hkl/hkl-pseudoaxis-e4c-psi.c          |   7 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c          | 145 +++++++-------------------
+ hkl/hkl-pseudoaxis-e6c-psi.c          |   7 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         |  98 ++++++-----------
+ hkl/hkl-pseudoaxis-k4cv-psi.c         |   7 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c          | 191 ++++++++++------------------------
+ hkl/hkl-pseudoaxis-k6c-psi.c          |   7 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c       |  21 ++--
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c  |   9 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c        |   6 +-
+ hkl/hkl-pseudoaxis.c                  |  29 ++----
+ hkl/hkl-pseudoaxis.h                  |  10 +-
+ 16 files changed, 204 insertions(+), 452 deletions(-)
+
+commit 6f347831706c72d19bdfa2e3cc31d79e40e8409e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Fri Aug 17 11:17:41 2012 +0200
+
+    use the INFO_xxx methods instead of writing all the time the same thing
+
+ hkl/hkl-pseudoaxis-common-eulerians.c |  4 +-
+ hkl/hkl-pseudoaxis-common-q.c         | 13 +-----
+ hkl/hkl-pseudoaxis-e4c-hkl.c          | 36 +++------------
+ hkl/hkl-pseudoaxis-e4c-psi.c          |  6 +--
+ hkl/hkl-pseudoaxis-e6c-hkl.c          | 78 ++++++--------------------------
+ hkl/hkl-pseudoaxis-e6c-psi.c          |  6 +--
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         | 36 +++------------
+ hkl/hkl-pseudoaxis-k4cv-psi.c         |  6 +--
+ hkl/hkl-pseudoaxis-k6c-hkl.c          | 84 ++++++-----------------------------
+ hkl/hkl-pseudoaxis-k6c-psi.c          |  6 +--
+ hkl/hkl-pseudoaxis-petra3-hkl.c       | 42 +++---------------
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c  | 18 ++------
+ hkl/hkl-pseudoaxis-zaxis-hkl.c        | 12 +----
+ hkl/hkl-pseudoaxis.h                  |  3 ++
+ 14 files changed, 61 insertions(+), 289 deletions(-)
+
+commit 29b7162baf5cea5cc1168da936ce998bc661069e
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Aug 16 19:08:48 2012 +0200
+
+    move the functions in the HklPseudoAxisEngineModeInfo
+
+ hkl/hkl-pseudoaxis-auto.c             |  4 +--
+ hkl/hkl-pseudoaxis-common-eulerians.c |  1 -
+ hkl/hkl-pseudoaxis-common-psi.c       |  8 +++--
+ hkl/hkl-pseudoaxis-common-psi.h       |  2 ++
+ hkl/hkl-pseudoaxis-common-q.c         | 14 +++++----
+ hkl/hkl-pseudoaxis-e4c-hkl.c          | 25 +++++++++++-----
+ hkl/hkl-pseudoaxis-e4c-psi.c          |  6 ++--
+ hkl/hkl-pseudoaxis-e6c-hkl.c          | 52 ++++++++++++++++++++++++--------
+ hkl/hkl-pseudoaxis-e6c-psi.c          |  3 ++
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         | 24 +++++++++++----
+ hkl/hkl-pseudoaxis-k4cv-psi.c         |  3 ++
+ hkl/hkl-pseudoaxis-k6c-hkl.c          | 56 ++++++++++++++++++++++++++---------
+ hkl/hkl-pseudoaxis-k6c-psi.c          |  3 ++
+ hkl/hkl-pseudoaxis-petra3-hkl.c       | 28 +++++++++++++-----
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c  | 12 ++++++--
+ hkl/hkl-pseudoaxis-zaxis-hkl.c        |  8 +++--
+ hkl/hkl-pseudoaxis.c                  | 28 ++++--------------
+ hkl/hkl-pseudoaxis.h                  |  9 +++---
+ 18 files changed, 193 insertions(+), 93 deletions(-)
+
+commit b84ec692daefb4e58f440d6e3f251efcd126da04
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Aug 16 17:21:20 2012 +0200
+
+    add the HklPseudoAxisengineModeInfo structure and use it
+
+ gui/hkl-gui-pseudoaxes.cpp            |   2 +-
+ hkl/hkl-pseudoaxis-auto.c             |   4 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c |  43 +--
+ hkl/hkl-pseudoaxis-common-hkl.c       |  51 ++--
+ hkl/hkl-pseudoaxis-common-hkl.h       |   2 +-
+ hkl/hkl-pseudoaxis-common-psi.c       |  12 +-
+ hkl/hkl-pseudoaxis-common-psi.h       |   5 +-
+ hkl/hkl-pseudoaxis-common-q.c         |  86 +++---
+ hkl/hkl-pseudoaxis-e4c-hkl.c          | 223 ++++++++++-----
+ hkl/hkl-pseudoaxis-e4c-psi.c          |  26 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c          | 432 +++++++++++++++++++---------
+ hkl/hkl-pseudoaxis-e6c-psi.c          |  35 ++-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         | 243 ++++++++++------
+ hkl/hkl-pseudoaxis-k4cv-psi.c         |  36 ++-
+ hkl/hkl-pseudoaxis-k6c-hkl.c          | 512 ++++++++++++++++++++++------------
+ hkl/hkl-pseudoaxis-k6c-psi.c          |  28 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c       | 197 ++++++++-----
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c  | 101 ++++---
+ hkl/hkl-pseudoaxis-zaxis-hkl.c        |  72 +++--
+ hkl/hkl-pseudoaxis.c                  |  46 +--
+ hkl/hkl-pseudoaxis.h                  |  18 +-
+ test/hkl/bench-t.c                    |   2 +-
+ test/hkl/pseudoaxis-t.c               |   4 +-
+ 23 files changed, 1423 insertions(+), 757 deletions(-)
+
+commit 44bdd4954c1c2c90fc1244bd2f34b040e1077c0b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Aug 15 21:29:50 2012 +0200
+
+    error in the k4cv diffractometer
+
+ hkl/hkl-pseudoaxis-k4cv-hkl.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 2ec7ce27b29b70c33b9adda3712544a9f98cf661
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Aug 15 15:24:17 2012 +0200
+
+    add a command line option of the number of test in pseudoaxis-t
+    
+    you can define the number of test for each mode with the first
+    command ligne arg
+    
+    test/hkl/pseudoaxis-t 1000
+
+ test/hkl/pseudoaxis-t.c | 32 +++++++++++++++++++-------------
+ 1 file changed, 19 insertions(+), 13 deletions(-)
+
+commit e04641576d6bfbbaaca75de3d97f95c8a1367642
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Aug 15 15:18:43 2012 +0200
+
+    for consistancy use CHECK_NAN in each mode.
+
+ hkl/hkl-pseudoaxis-common-eulerians.c |  60 ++++----
+ hkl/hkl-pseudoaxis-common-hkl.c       |  74 +++-------
+ hkl/hkl-pseudoaxis-common-hkl.h       |   2 +-
+ hkl/hkl-pseudoaxis-common-psi.c       |  50 +++----
+ hkl/hkl-pseudoaxis-common-q.c         |  42 +++---
+ hkl/hkl-pseudoaxis-e4c-hkl.c          |  16 +--
+ hkl/hkl-pseudoaxis-e6c-hkl.c          |  41 +++---
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         | 167 ++++++++-------------
+ hkl/hkl-pseudoaxis-k6c-hkl.c          | 263 ++++++++++++----------------------
+ hkl/hkl-pseudoaxis-petra3-hkl.c       |  27 ++--
+ hkl/hkl-pseudoaxis-private.h          |   6 +
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c  |  20 ++-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c        |  14 +-
+ hkl/hkl-pseudoaxis.c                  |  20 +++
+ hkl/hkl-pseudoaxis.h                  |   3 +
+ 15 files changed, 321 insertions(+), 484 deletions(-)
+
+commit 05301e70d9d840d8bf41fb1b08a5610eab23a414
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Aug 15 09:30:53 2012 +0200
+
+    add an HklPseudoAxisEngineinfo struct
+
+ ccan/array_size/array_size.h          | 25 +++++++++++++++++
+ gui/Makefile.am                       |  3 +-
+ gui/hkl-gui-pseudoaxes.cpp            |  2 +-
+ hkl/hkl-parameter.h                   |  4 +++
+ hkl/hkl-pseudoaxis-common-eulerians.c | 51 +++++++++++++++------------------
+ hkl/hkl-pseudoaxis-common-hkl.c       | 45 ++++++++++++-----------------
+ hkl/hkl-pseudoaxis-common-psi.c       | 29 ++++++++++---------
+ hkl/hkl-pseudoaxis-common-q.c         | 53 ++++++++++++++++-------------------
+ hkl/hkl-pseudoaxis.c                  | 37 +++++-------------------
+ hkl/hkl-pseudoaxis.h                  | 13 ++++++---
+ test/hkl/bench-t.c                    |  2 +-
+ test/hkl/pseudoaxis-t.c               |  2 +-
+ test/tap/hkl.c                        | 14 ++++-----
+ 13 files changed, 137 insertions(+), 143 deletions(-)
+
+commit 85d69265d4b411ef29dd011812b723a3be8a05c8
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Aug 12 15:06:03 2012 +0200
+
+    use the list in the pseudo axis engine axes.
+
+ gui/Makefile.am                 |  3 +--
+ hkl/Makefile.am                 |  5 +++-
+ hkl/hkl-axis.h                  |  2 ++
+ hkl/hkl-pseudoaxis-auto.c       | 32 ++++++++++++++------------
+ hkl/hkl-pseudoaxis-common-hkl.c | 17 +++++---------
+ hkl/hkl-pseudoaxis-common-psi.c |  8 ++-----
+ hkl/hkl-pseudoaxis-common-q.c   | 11 +++------
+ hkl/hkl-pseudoaxis-private.h    | 41 +++++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis.c            | 51 ++++++++++++++++++++---------------------
+ hkl/hkl-pseudoaxis.h            |  5 ++--
+ 10 files changed, 103 insertions(+), 72 deletions(-)
+
+commit 42b6a37d9cd59b1d95046683efd7abc2311f48e9
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 11 23:02:05 2012 +0200
+
+    use also the list for the PseudoAxes
+
+ gui/hkl-gui-pseudoaxes.cpp            | 10 ++--
+ gui/hkl-gui.cpp                       | 16 +++---
+ hkl/Makefile.am                       |  3 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c | 32 ++++++++----
+ hkl/hkl-pseudoaxis-common-hkl.c       | 41 +++++++++------
+ hkl/hkl-pseudoaxis-common-hkl.h       |  9 ++--
+ hkl/hkl-pseudoaxis-common-psi.c       | 14 +++--
+ hkl/hkl-pseudoaxis-common-q.c         | 55 ++++++++++----------
+ hkl/hkl-pseudoaxis.c                  | 69 +++++++++++++++----------
+ hkl/hkl-pseudoaxis.h                  | 16 ++++--
+ test/hkl/bench-t.c                    | 97 +++++++++--------------------------
+ test/hkl/pseudoaxis-e4ch-t.c          | 80 ++++++++++-------------------
+ test/hkl/pseudoaxis-e4cv-t.c          | 96 +++++++++++++---------------------
+ test/hkl/pseudoaxis-e6c-t.c           | 77 ++++++++++-----------------
+ test/hkl/pseudoaxis-k4cv-t.c          | 50 +++++-------------
+ test/hkl/pseudoaxis-k6c-t.c           | 49 +++++-------------
+ test/hkl/pseudoaxis-t.c               | 30 ++++++-----
+ test/hkl/pseudoaxis-zaxis-t.c         | 14 +++--
+ test/tap/hkl.c                        | 52 +++++++++++++++----
+ test/tap/hkl.h                        |  6 ++-
+ 20 files changed, 365 insertions(+), 451 deletions(-)
+
+commit 5ad3ecddc9db48f7153e610290bdb994abc99325
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Aug 9 17:56:45 2012 +0200
+
+    use the list for the modes in the PseudoAxisEngine
+
+ gui/hkl-gui-pseudoaxes.cpp            | 18 +++++++++---------
+ gui/hkl-gui-pseudoaxes.h              |  2 ++
+ gui/pseudo.ui                         | 32 ++++++++++++++++++++++++++++----
+ hkl/hkl-pseudoaxis-common-eulerians.c |  5 ++---
+ hkl/hkl-pseudoaxis-common-q.c         | 12 ++++--------
+ hkl/hkl-pseudoaxis-e4c-hkl.c          |  5 ++---
+ hkl/hkl-pseudoaxis-e4c-psi.c          |  7 +++----
+ hkl/hkl-pseudoaxis-e6c-hkl.c          |  6 ++----
+ hkl/hkl-pseudoaxis-e6c-psi.c          |  7 +++----
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         |  5 ++---
+ hkl/hkl-pseudoaxis-k4cv-psi.c         |  7 +++----
+ hkl/hkl-pseudoaxis-k6c-hkl.c          |  5 ++---
+ hkl/hkl-pseudoaxis-k6c-psi.c          |  7 +++----
+ hkl/hkl-pseudoaxis-petra3-hkl.c       |  5 ++---
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c  | 11 ++++-------
+ hkl/hkl-pseudoaxis-zaxis-hkl.c        |  5 ++---
+ hkl/hkl-pseudoaxis.c                  | 34 +++++++++++++++++++++++++---------
+ hkl/hkl-pseudoaxis.h                  |  9 ++++++---
+ test/hkl/bench-t.c                    | 22 +++++++++++-----------
+ test/hkl/pseudoaxis-e4ch-t.c          | 22 +++++++++++++---------
+ test/hkl/pseudoaxis-e4cv-t.c          | 26 +++++++++++++++-----------
+ test/hkl/pseudoaxis-e6c-t.c           | 20 +++++++++++---------
+ test/hkl/pseudoaxis-k4cv-t.c          | 28 +++++++++++++++-------------
+ test/hkl/pseudoaxis-k6c-t.c           | 25 ++++++++++++++-----------
+ test/hkl/pseudoaxis-t.c               |  7 ++++---
+ 25 files changed, 187 insertions(+), 145 deletions(-)
+
+commit 967e1b44ac73dd1fbbb5c77e1d1021876734259f
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Aug 4 21:01:15 2012 +0200
+
+    use the list in the PseudoAxisEngineList
+
+ gui/hkl-gui.cpp         | 14 ++++++-------
+ hkl/hkl-pseudoaxis.c    | 55 +++++++++++++++++++++++--------------------------
+ hkl/hkl-pseudoaxis.h    |  5 +++--
+ test/hkl/pseudoaxis-t.c |  6 +++---
+ 4 files changed, 38 insertions(+), 42 deletions(-)
+
+commit 4c1ca5c6ad87673852967bb4435d14cb40c38655
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Jul 24 22:23:31 2012 +0200
+
+    test the list.h from ccan
+
+ Makefile.am                      |   4 +-
+ ccan/Makefile.am                 |   3 +
+ ccan/build_assert/build_assert.h |  39 ++++
+ ccan/check_type/check_type.h     |  63 ++++++
+ ccan/container_of/container_of.h | 108 +++++++++
+ ccan/list/list.c                 |  43 ++++
+ ccan/list/list.h                 | 469 +++++++++++++++++++++++++++++++++++++++
+ configure.ac                     |   1 +
+ gui/Makefile.am                  |   5 +-
+ gui/hkl-gui-callbacks.cpp        |  13 +-
+ gui/hkl-gui-modelcolumns.h       |   2 +
+ gui/hkl-gui-pseudoaxes.cpp       |   7 +-
+ gui/hkl-gui.cpp                  |  15 +-
+ hkl/Makefile.am                  |   5 +-
+ hkl/hkl-geometry.c               | 127 ++++++-----
+ hkl/hkl-geometry.h               |  14 +-
+ hkl/hkl-pseudoaxis-common-hkl.c  |  12 +-
+ hkl/hkl-pseudoaxis-factory.c     |  10 +-
+ hkl/hkl-pseudoaxis.c             |   4 +-
+ test/hkl/Makefile.am             |   2 +-
+ test/hkl/bench-t.c               |   7 +-
+ test/hkl/geometry-t.c            |  25 +--
+ test/hkl/pseudoaxis-e4ch-t.c     |  40 ++--
+ test/hkl/pseudoaxis-e4cv-t.c     |  40 ++--
+ test/hkl/pseudoaxis-e6c-t.c      |  54 ++---
+ test/hkl/pseudoaxis-k4cv-t.c     |  30 ++-
+ test/hkl/pseudoaxis-k6c-t.c      |  29 ++-
+ test/hkl/pseudoaxis-t.c          |  12 +-
+ test/hkl/pseudoaxis-zaxis-t.c    |   7 +-
+ test/tap/hkl.c                   |   1 +
+ 30 files changed, 993 insertions(+), 198 deletions(-)
+
+commit 84777a74b060d174acc24280256fa215fa92daf4
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Jul 24 11:53:12 2012 +0200
+
+    now distcheck is working
+
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit adc13e2193dd6e3322c95502fd6354a4ed0d7c26
+Merge: c0ed0ce 50a84fb
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Tue Jul 24 10:54:14 2012 +0200
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	TODO
+    	configure.ac
+    	hkl/hkl-pseudoaxis-e6c-hkl.c
+    	test/hkl/pseudoaxis-e6c-t.c
+    	test/hkl/pseudoaxis-k6c-t.c
+
+commit 50a84fb0aef6f9b7f8766592fdafae65f7a4c42c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jul 21 14:35:27 2012 +0200
+
+    better resolution for the figures of the documentation
+
+ Documentation/figures/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 5e69c9ad41e54d4eb40a13452b8e031b3c84cc6c
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jul 21 14:35:06 2012 +0200
+
+    think about prigo
+
+ TODO | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit ce64b0e6db1804ac4521ba1a161d3cecb2eca708
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jul 19 15:43:55 2012 +0200
+
+    new rc3 for petraIII
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit e45d7afea744c130ada17b8965c7af910885697a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jul 17 17:12:17 2012 +0200
+
+    fix the psi_constant_vertical issue found by petraIII (thanks Sonia)
+    
+    in fact instead of computing UB . h, it was h . UB (wrong)
+    very bad error which affect only the psi values (read and write).
+    I added an unitary test from the mail sent by Sonia.
+    
+    the UB initialisation was wrong also so now I use hkl_sample_set_U_from_euler
+
+ hkl/hkl-pseudoaxis-common-hkl.c |  15 ++-
+ hkl/hkl-pseudoaxis-common-psi.c |   4 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c    |   2 +-
+ test/hkl-test-pseudoaxis-e6c.c  | 227 +++++++++++++++++++++++++++++++++++++++-
+ test/hkl-test-pseudoaxis-k6c.c  |   3 +-
+ 5 files changed, 238 insertions(+), 13 deletions(-)
+
+commit c0ed0cea56675b26ff81ea7c289a5ede9ffff665
+Merge: 4450288 86d308a
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 17 23:05:42 2012 +0200
+
+    Merge branch 'introspection' into next
+    
+    Conflicts:
+    	configure.ac
+    	hkl/hkl-geometry-factory.c
+    	hkl/hkl-geometry.c
+    	hkl/hkl-geometry.h
+    	hkl/hkl-pseudoaxis.c
+    	hkl/hkl-pseudoaxis.h
+    	hkl/hkl-sample.c
+    	hkl/hkl-sample.h
+    	hkl/hkl-unit.c
+    	test/hkl/pseudoaxis-t.c
+
+commit 445028891e4d52770bf77d0a798fd32276e95965
+Merge: 36c0c65 8c599b9
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Jun 17 21:00:31 2012 +0200
+
+    Merge branch 'introspection' into next
+    
+    Conflicts:
+    	configure.ac
+    	gui/hkl-gui-modelcolumns.h
+    	gui/hkl-gui.cpp
+    	hkl/hkl-geometry-factory.c
+    	hkl/hkl-geometry-factory.h
+    	hkl/hkl-geometry.c
+    	hkl/hkl-geometry.h
+    	hkl/hkl-lattice.c
+    	hkl/hkl-list.h
+    	hkl/hkl-pseudoaxis-auto.c
+    	hkl/hkl-pseudoaxis-common-hkl.c
+    	hkl/hkl-pseudoaxis-common-psi.c
+    	hkl/hkl-pseudoaxis-common-q.c
+    	hkl/hkl-pseudoaxis.c
+    	hkl/hkl-pseudoaxis.h
+    	hkl/hkl-sample.c
+    	hkl/hkl-sample.h
+    	hkl/hkl-unit.c
+    	hkl/pom.xml
+    	scripts/clean-all
+    	test/hkl/pseudoaxis-t.c
+
+commit 86d308a76f2aed87bfb96ab8f408814b0cfb20ed
+Merge: fc27d4d 8c599b9
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Jun 16 15:18:12 2012 +0200
+
+    Merge branch 'maint' into introspection
+
+commit fc27d4dae74ade6618fe5925eefbfc5efc23c619
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Thu Jun 7 22:28:10 2012 +0200
+
+    add HklPseudoAxisEngineList introspection
+
+ Documentation/sphinx/source/bindings/python.py |   1 +
+ Documentation/sphinx/source/test.py            |  20 ++-
+ hkl/hkl-detector.c                             |  22 ++-
+ hkl/hkl-detector.h                             |   2 +
+ hkl/hkl-geometry.c                             |   9 +
+ hkl/hkl-pseudoaxis-factory.h                   |   1 -
+ hkl/hkl-pseudoaxis.c                           | 239 +++++++++++++++++--------
+ hkl/hkl-pseudoaxis.h                           |  15 +-
+ hkl/hkl-sample.c                               |   5 +-
+ hkl/hkl-types.c                                |  30 +++-
+ hkl/hkl-types.h                                |   3 +
+ test/hkl-test-pseudoaxis.c                     |  26 +++
+ 12 files changed, 284 insertions(+), 89 deletions(-)
+
+commit 8c599b9e92d809aac8a040cc8ee236128409bab7
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Mon Mar 19 15:14:35 2012 +0100
+
+    first version of the constant_incidence mode for K6C
+
+ .../sphinx/source/diffractometers/k6c.rst          | 19 ++++++
+ NEWS                                               |  2 +
+ hkl/hkl-pseudoaxis-common.c                        | 29 ++++++++
+ hkl/hkl-pseudoaxis-common.h                        |  9 +++
+ hkl/hkl-pseudoaxis-k6c-hkl.c                       | 77 ++++++++++++++++++++++
+ 5 files changed, 136 insertions(+)
+
+commit 2b45fbd5dbc046e6445ac3d2106fdebc27a7519a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Mar 15 11:56:11 2012 +0100
+
+    WORK IN PROGRESS
+
+ Documentation/sphinx/source/bindings/python.py | 11 ++++++
+ hkl/hkl-geometry.c                             | 51 +++++++++++++++++++++++++-
+ hkl/hkl-geometry.h                             |  4 ++
+ 3 files changed, 64 insertions(+), 2 deletions(-)
+
+commit 7b738f9e01bbdde3648cf5f6c5b08adb45c2a60e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 31 16:38:49 2012 +0100
+
+    typo
+
+ hkl/hkl-parameter.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 6feb14ee6fc0816284b349b4c375a150e7d92bed
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 31 16:38:35 2012 +0100
+
+    add the HklPseudoAxisEngineList
+
+ Documentation/sphinx/source/bindings.rst          | 34 ---------
+ Documentation/sphinx/source/bindings/bindings.rst | 14 ++++
+ Documentation/sphinx/source/bindings/python.py    | 45 +++++++++++
+ Documentation/sphinx/source/index.rst             |  2 +-
+ INSTALL                                           |  9 ++-
+ hkl/Makefile.am                                   |  2 +
+ hkl/hkl-geometry-factory.c                        |  4 +-
+ hkl/hkl-pseudoaxis-factory.c                      |  8 ++
+ hkl/hkl-pseudoaxis.c                              | 93 ++++++++++++++++++++++-
+ hkl/hkl-pseudoaxis.h                              | 14 ++--
+ hkl/hkl-types.c                                   | 12 +++
+ hkl/hkl-types.h                                   |  3 +
+ 12 files changed, 191 insertions(+), 49 deletions(-)
+
+commit d9757e93042a66a22be4b747efa913a242b6e6ef
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Nov 25 16:54:22 2011 +0100
+
+    add the HklPseudoAxis struct
+
+ hkl/Makefile.am      |  6 ++++--
+ hkl/hkl-pseudoaxis.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++--
+ hkl/hkl-pseudoaxis.h | 37 ++++++++++++++++++++++------------
+ hkl/hkl-types.c      | 12 +++++++++++
+ hkl/hkl-types.h      |  5 ++++-
+ 5 files changed, 99 insertions(+), 18 deletions(-)
+
+commit 52b3327bfcf1702bfb6f27f2b66f081798ea1c69
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Nov 15 16:42:31 2011 +0100
+
+    add the HklError to the introspection.
+
+ hkl/Makefile.am |  2 ++
+ hkl/hkl-error.c | 58 +++++++++++++++++++++++++++------------------------------
+ hkl/hkl-types.c | 12 ++++++++++++
+ hkl/hkl-types.h |  3 +++
+ 4 files changed, 44 insertions(+), 31 deletions(-)
+
+commit 72bc4760ac3c40d693ba8bdf46010772934c3209
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Nov 13 19:10:18 2011 +0100
+
+    add the sample to the introspection
+
+ Documentation/sphinx/source/bindings.rst |   2 +-
+ hkl/Makefile.am                          |   2 +
+ hkl/hkl-sample.c                         | 460 +++++++++++++++++++++++++------
+ hkl/hkl-sample.h                         |  37 ++-
+ hkl/hkl-types.c                          |  36 +++
+ hkl/hkl-types.h                          |   9 +
+ 6 files changed, 442 insertions(+), 104 deletions(-)
+
+commit 930d24512f0ea00d976cdaa9ee007d9cb6f90e3d
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Nov 13 18:14:33 2011 +0100
+
+    add the HklLattice
+
+ hkl/Makefile.am   |  2 ++
+ hkl/hkl-lattice.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
+ hkl/hkl-lattice.h | 10 +++---
+ hkl/hkl-types.c   | 12 ++++++++
+ hkl/hkl-types.h   |  3 ++
+ 5 files changed, 107 insertions(+), 12 deletions(-)
+
+commit 9447b54c1e2949810e1ff4a29ff6993e6c7e71ba
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Nov 13 17:39:16 2011 +0100
+
+    add the geometry factory
+
+ Documentation/sphinx/source/bindings.rst | 10 ++--
+ hkl/Makefile.am                          |  2 +
+ hkl/hkl-geometry-factory.c               | 86 ++++++++++++++++++++++++--------
+ hkl/hkl-geometry-factory.h               |  3 ++
+ 4 files changed, 76 insertions(+), 25 deletions(-)
+
+commit 421a9aff01ab321a971ca07a128d593e3a6b8610
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Nov 13 14:46:55 2011 +0100
+
+    add the HklGeoemtry to the introspection
+
+ hkl/Makefile.am    |   2 +
+ hkl/hkl-geometry.c | 293 +++++++++++++++++++++++++++++++++++++++++++++++------
+ hkl/hkl-geometry.h |  17 ++--
+ hkl/hkl-types.c    |  36 +++++++
+ hkl/hkl-types.h    |   9 ++
+ 5 files changed, 322 insertions(+), 35 deletions(-)
+
+commit 945b75f6fd07cfccc9b7c53cffdc9c4037daf8c6
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Nov 9 17:14:27 2011 +0100
+
+    add a few more class to the introspection
+
+ Documentation/sphinx/source/bindings.rst |  19 +++-
+ hkl/Makefile.am                          |   6 ++
+ hkl/hkl-interval.c                       | 163 +++++++++++++++++++++++++++++--
+ hkl/hkl-interval.h                       |  18 ++--
+ hkl/hkl-parameter.c                      | 154 +++++++++++++++++++++++++----
+ hkl/hkl-parameter.h                      |  24 ++---
+ hkl/hkl-types.c                          |  36 +++++++
+ hkl/hkl-types.h                          |   9 ++
+ hkl/hkl-unit.c                           |  57 ++++++++++-
+ hkl/hkl-unit.h                           |   9 +-
+ 10 files changed, 443 insertions(+), 52 deletions(-)
+
+commit c6e861b1204f33d18d985628c3a37c9e753948fd
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Oct 23 21:18:45 2011 +0200
+
+    still working on the introspection
+
+ hkl/Makefile.am         | 3 ++-
+ hkl/hkl-type-builtins.c | 8 +++++---
+ hkl/hkl-type-builtins.h | 6 +++---
+ 3 files changed, 10 insertions(+), 7 deletions(-)
+
+commit 7ab17d328d6fb0765f4ae731451db0587e7d8f6b
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Oct 23 18:30:55 2011 +0200
+
+    now the introspection infrastructure is there.
+
+ Documentation/sphinx/source/bindings.rst |  17 +++
+ Documentation/sphinx/source/index.rst    |   1 +
+ Documentation/sphinx/source/test.py      | 221 +++++++++++++++++++++++++++++++
+ configure.ac                             |  17 +--
+ hkl/Makefile.am                          |  51 ++++---
+ hkl/hkl-detector.c                       |  38 ++++++
+ hkl/hkl-sample.h                         |  10 +-
+ hkl/hkl-source.c                         |  77 ++++++++++-
+ hkl/hkl-source.h                         |   6 +-
+ hkl/hkl-type-builtins.c.template         |   1 +
+ hkl/hkl-types.c                          |  24 ++++
+ hkl/hkl-types.h                          |   6 +
+ 12 files changed, 432 insertions(+), 37 deletions(-)
+
+commit baceddf86f4c2617cb39b43543e7a8ed6c3179b1
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Oct 23 11:47:35 2011 +0200
+
+    remove the introspection subdirectory
+
+ hkl/Makefile.am                  | 23 ++++++------
+ hkl/hkl-type-builtins.c          | 81 ++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-type-builtins.c.template | 37 ++++++++++++++++++
+ hkl/hkl-type-builtins.h          | 31 +++++++++++++++
+ hkl/hkl-type-builtins.h.template | 24 ++++++++++++
+ hkl/hkl-types.c                  | 70 ++++++++++++++++++++++++++++++++++
+ hkl/hkl-types.h                  | 46 +++++++++++++++++++++++
+ 7 files changed, 301 insertions(+), 11 deletions(-)
+
+commit feaae00ea53b5ac2ca880fc0d0999b27a0c3bdd1
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Oct 23 10:36:02 2011 +0200
+
+    set up the introspection code
+
+ configure.ac                    | 30 +++++++++++---
+ hkl/Makefile.am                 | 42 +++++++++++++++----
+ hkl/hkl-axis.c                  | 11 +++++
+ hkl/hkl-axis.h                  |  2 +
+ hkl/hkl-detector-factory.c      |  8 ++++
+ hkl/hkl-detector-factory.h      |  7 +---
+ hkl/hkl-error.h                 |  2 +-
+ hkl/hkl-geometry.h              |  7 +---
+ hkl/hkl-matrix.c                | 33 +++++++++++++++
+ hkl/hkl-matrix.h                |  4 ++
+ hkl/hkl-pseudoaxis-common-hkl.c | 46 +++++++++++++++++++--
+ hkl/hkl-quaternion.c            | 31 ++++++++++++++
+ hkl/hkl-quaternion.h            |  4 ++
+ hkl/hkl-sample.h                |  6 +--
+ hkl/hkl-unit.h                  |  6 +--
+ hkl/hkl-vector.c                | 90 ++++++++++++++++++++++++++++-------------
+ hkl/hkl-vector.h                | 12 +++---
+ 17 files changed, 273 insertions(+), 68 deletions(-)
+
+commit de26b4afc3230599620f32eaa12b25e31b92f732
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Oct 8 09:59:57 2011 +0200
+
+    start with only the hklVector object
+
+ hkl/Makefile.am  | 10 +++++++---
+ hkl/hkl-vector.c |  4 ++--
+ hkl/hkl-vector.h | 10 ++++++++--
+ 3 files changed, 17 insertions(+), 7 deletions(-)
+
+commit 2d8f78270ad4fb6e82556c6a9c4c90425c5535db
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Oct 1 17:47:36 2011 +0200
+
+    fixup!
+
+ hkl/Makefile.am                 | 11 +++--------
+ hkl/hkl-pseudoaxis-common-hkl.c | 10 ++++++++++
+ 2 files changed, 13 insertions(+), 8 deletions(-)
+
+commit 606f224e9921d93c6db49663bdbdb49218e7f032
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sat Oct 1 13:10:50 2011 +0200
+
+    add the infrastructure for the gobject-introspection.
+
+ Makefile.am     |  2 +-
+ configure.ac    |  5 ++++-
+ hkl/Makefile.am | 38 ++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 43 insertions(+), 2 deletions(-)
+
+commit a672463176025aa0bedc4b3f27ba7cedae12ba44
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Nov 7 16:42:48 2011 +0100
+
+    MED2_2 : alpha axis -> beta axis
+
+ Documentation/sphinx/source/diffractometers/med2_2.rst | 4 ++--
+ hkl/hkl-geometry-factory.c                             | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+commit 7d748e752a99cc1934160783855394f84efc5695
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Sun Oct 23 10:47:51 2011 +0200
+
+    MED2_2 : pitch axis -> alpha axis
+
+ Documentation/sphinx/source/diffractometers/med2_2.rst | 2 +-
+ hkl/hkl-geometry-factory.c                             | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+commit f6e93f9fec1ef3584864bc48b00152b9f67e0826
+Author: Picca Frédéric-Emmanuel <picca at debian.org>
+Date:   Wed Sep 28 20:48:24 2011 +0200
+
+    more traduction
+
+ Documentation/sphinx/source/introduction.rst | 63 ++++++++++++++--------------
+ 1 file changed, 31 insertions(+), 32 deletions(-)
+
+commit a67c48018678b60970e4345b3daac13dd31bb488
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Oct 11 10:45:58 2011 +0200
+
+    * add the reflectivity mode to the MED2+2
+
+ .../sphinx/source/diffractometers/med2_2.rst       |  8 ++++++
+ NEWS                                               |  5 ++--
+ configure.ac                                       |  2 +-
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c               | 32 ++++++++++++++++++++++
+ 4 files changed, 44 insertions(+), 3 deletions(-)
+
+commit 69c0694f2e299e9baaa2d71622b0380ece98864b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Oct 6 16:41:29 2011 +0200
+
+    the petra3 p09 EH2 phi axis orientation has changed.
+
+ Documentation/sphinx/source/diffractometers/petra3.rst | 2 +-
+ hkl/hkl-geometry-factory.c                             | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 881c7f37c09dc2fffc47b104e4efbf555333d67d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Oct 6 10:28:23 2011 +0200
+
+    prepare a rc1 and add a publish target to publish the documentation.
+
+ Documentation/sphinx/Makefile.am | 3 +++
+ configure.ac                     | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+commit 386e83aacb039943a57f8819f07e5784e7886c5a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Oct 6 10:04:38 2011 +0200
+
+    add new mode to E6C
+    
+    psi_constant_horizontal and constant_mu_horizontal modes
+
+ .../sphinx/source/diffractometers/e6c.rst          | 22 ++++++++++++++++
+ NEWS                                               |  2 ++
+ hkl/hkl-pseudoaxis-e6c-hkl.c                       | 29 ++++++++++++++++++++++
+ 3 files changed, 53 insertions(+)
+
+commit 9307cd5dcef1a9eb138b903ec6e8653cd4fab1fd
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Oct 6 09:47:35 2011 +0200
+
+    add the petra3 p09 eh2 diffractometer
+
+ .../sphinx/source/diffractometers/petra3.rst       |  76 +++++++++++
+ Documentation/sphinx/source/index.rst              |   1 +
+ NEWS                                               |   1 +
+ hkl/Makefile.am                                    |   2 +
+ hkl/hkl-geometry-factory.c                         |  23 +++-
+ hkl/hkl-geometry-factory.h                         |   3 +-
+ hkl/hkl-geometry.h                                 |   5 +-
+ hkl/hkl-pseudoaxis-factory.c                       |   6 +-
+ hkl/hkl-pseudoaxis-factory.h                       |   2 +-
+ hkl/hkl-pseudoaxis-petra3-hkl.c                    | 151 +++++++++++++++++++++
+ hkl/hkl-pseudoaxis-petra3.h                        |  33 +++++
+ test/hkl-test-pseudoaxis.c                         |  11 +-
+ 12 files changed, 307 insertions(+), 7 deletions(-)
+
+commit bb236948782454e3e3c437c4fae452fb026dab47
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Oct 5 10:29:21 2011 +0200
+
+    typo
+
+ Documentation/figures/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit d83aa96675ec60f6d851c75bb8d9ba29c02f2f1c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jul 24 14:28:23 2011 +0200
+
+    traduct into english part of the introduction.rst
+
+ Documentation/sphinx/source/introduction.rst | 101 +++++++++++++--------------
+ 1 file changed, 49 insertions(+), 52 deletions(-)
+
+commit d11d8054dc33d946d4229044c3f769dd1ab60ec8
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jul 17 14:37:10 2011 +0200
+
+    add the eulerian to kappa conversion documentation
+
+ Documentation/figures/Makefile.am      | 11 +++-
+ Documentation/figures/e2k_1.asy        | 13 +++++
+ Documentation/figures/e2k_2.asy        | 13 +++++
+ Documentation/figures/e2k_3.asy        | 13 +++++
+ Documentation/figures/e2k_4.asy        | 13 +++++
+ Documentation/figures/eulerians.asy    | 36 +++++++++++++
+ Documentation/sphinx/Makefile.am       |  3 +-
+ Documentation/sphinx/source/index.rst  |  1 +
+ Documentation/sphinx/source/pseudo.rst | 94 ++++++++++++++++++++++++++++++++++
+ 9 files changed, 195 insertions(+), 2 deletions(-)
+
+commit fe5d7568f600ff56487418a4cdf858e4272a8c12
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jul 7 14:24:17 2011 +0200
+
+    updating the pom.xml for the new version
+
+ hkl/pom.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 00cb4f82a36e5cfb12a6482f8986eddcfa57fb79
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jul 7 14:18:53 2011 +0200
+
+    add the SOLEIL MED1+2 diffractometer
+
+ .../sphinx/source/diffractometers/med1_2.rst       | 45 ++++++++++++++++++++++
+ Documentation/sphinx/source/index.rst              |  1 +
+ hkl/hkl-geometry-factory.c                         | 19 +++++++++
+ hkl/hkl-geometry-factory.h                         |  1 +
+ hkl/hkl-geometry.h                                 |  3 +-
+ hkl/hkl-pseudoaxis-factory.c                       |  4 ++
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c               | 23 +++++++++++
+ hkl/hkl-pseudoaxis-soleil-sixs-med.h               |  1 +
+ test/hkl-test-pseudoaxis.c                         | 11 +++++-
+ 9 files changed, 106 insertions(+), 2 deletions(-)
+
+commit 2698d170d14c4628234e5e999814b953fc56b18b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jul 7 14:12:38 2011 +0200
+
+    fix a bug in the documentation of the MED2+2
+
+ Documentation/sphinx/source/diffractometers/med2_2.rst | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit df769a7799fdf197de00f68f55b1154b4e6f02a1
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 14 15:03:00 2011 +0200
+
+    add the k6c diffractometer figures
+    
+    also modify the axes's colors to be consistant from one
+    diffractometer to the other.
+
+ Documentation/figures/3S+1D.asy                    |  2 +-
+ Documentation/figures/Makefile.am                  |  2 ++
+ Documentation/figures/k4cv.asy                     |  4 +--
+ Documentation/figures/k6c.asy                      | 35 ++++++++++++++++++++++
+ .../sphinx/source/diffractometers/k6c.rst          |  6 ++++
+ 5 files changed, 46 insertions(+), 3 deletions(-)
+
+commit 91dfb7100dd156374256de98da3d181dce3c73fa
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 12 16:45:57 2011 +0200
+
+    better crystal figure
+
+ Documentation/figures/crystal.asy | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit e1c88da60d42c6f96aff108bda7a23f252521510
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 12 16:18:30 2011 +0200
+
+    put the diffractometers pictures at the right place.
+
+ Documentation/sphinx/source/development.rst          | 4 ++--
+ Documentation/sphinx/source/diffractometers/e4cv.rst | 6 +++---
+ Documentation/sphinx/source/diffractometers/e6c.rst  | 6 ++++++
+ Documentation/sphinx/source/diffractometers/k4cv.rst | 6 +++---
+ 4 files changed, 14 insertions(+), 8 deletions(-)
+
+commit 465d76476821edb8dc9179002d09cb96623a6206
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 12 15:30:09 2011 +0200
+
+    improve the documentation
+    
+    - document all the diffractomteres geometries and all pseudo axes
+    - document the configure option for the GUI and the documentation
+
+ Documentation/sphinx/Makefile.am                   |   8 +-
+ Documentation/sphinx/source/development.rst        |  37 ++-
+ Documentation/sphinx/source/diffractometers.rst    | 269 ---------------------
+ .../sphinx/source/diffractometers/e4cv.rst         | 108 +++++++++
+ .../sphinx/source/diffractometers/e6c.rst          | 138 +++++++++++
+ .../sphinx/source/diffractometers/k4cv.rst         | 127 ++++++++++
+ .../sphinx/source/diffractometers/k6c.rst          | 160 ++++++++++++
+ .../sphinx/source/diffractometers/mars.rst         | 101 ++++++++
+ .../sphinx/source/diffractometers/med2_2.rst       |  46 ++++
+ .../sphinx/source/diffractometers/zaxis.rst        |  55 +++++
+ Documentation/sphinx/source/index.rst              |   8 +-
+ Documentation/sphinx/source/introduction.rst       |  47 ++--
+ 12 files changed, 800 insertions(+), 304 deletions(-)
+
+commit 0dea64b3b8457455d31072e0da218b1e4c679a13
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 12 11:24:23 2011 +0200
+
+    update the doc
+
+ Documentation/sphinx/source/diffractometers.rst | 104 ++++++++++++------------
+ 1 file changed, 54 insertions(+), 50 deletions(-)
+
+commit 748b2e79c04863ae64b0e8d673f30ccb25acdb9e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 12 11:24:08 2011 +0200
+
+    add the "pitch" axis to the MED 2_2 diffractometer
+
+ Documentation/sphinx/source/diffractometers.rst | 11 +++++++----
+ hkl/hkl-geometry-factory.c                      |  2 ++
+ 2 files changed, 9 insertions(+), 4 deletions(-)
+
+commit 53cd30679f2d71581a1da40405a1bb58e5e2bc76
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 12 11:00:16 2011 +0200
+
+    add the indent-c++ scripts for c++ files ;) and use it.
+
+ gui/ghkl-callbacks.cpp | 12 +++----
+ gui/ghkl.cpp           | 26 +++++++-------
+ gui/modelcolumns.h     | 98 +++++++++++++++++++++++++-------------------------
+ gui/pseudoaxesframe.h  | 26 +++++++-------
+ scripts/clean-all      |  3 +-
+ scripts/indent-c++     | 13 +++++++
+ 6 files changed, 96 insertions(+), 82 deletions(-)
+
+commit 1ffd3c219f9ed10b9194eaa9039bd1b76bbe09fb
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 12 10:47:54 2011 +0200
+
+    add a few scripts to clean the files and indent using emacs.
+    
+    - cleanfile was taken from the linux scripts directory, it removes
+      the trailling spaces.
+    
+    - indent was adapted from a public domain scripts. it use for now
+      emacs (it is my prefered editor) to indent the files.
+    
+    - clean-all use the two previous script to clean most of the C code
+      for now.
+    
+    it would be nice to modify indent which for now depends on my .emacs file.
+    it would be nice also to adapt the indent script for c++ files.
+
+ hkl/hkl-axis.c                        |   2 +-
+ hkl/hkl-axis.h                        |   8 +-
+ hkl/hkl-detector-factory.c            |   6 +-
+ hkl/hkl-error.c                       |   8 +-
+ hkl/hkl-error.h                       |   2 +-
+ hkl/hkl-geometry-factory.c            |  62 ++++++------
+ hkl/hkl-geometry-factory.h            |   2 +-
+ hkl/hkl-geometry.c                    |  22 ++---
+ hkl/hkl-lattice.c                     |  12 +--
+ hkl/hkl-list.h                        |  14 +--
+ hkl/hkl-macros.c                      |   2 +-
+ hkl/hkl-macros.h                      |  22 ++---
+ hkl/hkl-matrix.c                      |   4 +-
+ hkl/hkl-pseudoaxis-auto.c             |  44 ++++-----
+ hkl/hkl-pseudoaxis-common-eulerians.c |   2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c       |  10 +-
+ hkl/hkl-pseudoaxis-common-hkl.h       |  12 +--
+ hkl/hkl-pseudoaxis-common-psi.c       |  12 +--
+ hkl/hkl-pseudoaxis-common-q.c         |   6 +-
+ hkl/hkl-pseudoaxis-common.c           |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c          |   4 +-
+ hkl/hkl-pseudoaxis.c                  |   6 +-
+ hkl/hkl-quaternion.c                  |   2 +-
+ hkl/hkl-sample.c                      |   8 +-
+ hkl/hkl-source.c                      |   2 +-
+ hkl/hkl-vector.c                      |   8 +-
+ scripts/clean-all                     |   3 +
+ scripts/cleanfile                     | 176 ++++++++++++++++++++++++++++++++++
+ scripts/indent                        |  13 +++
+ 30 files changed, 335 insertions(+), 143 deletions(-)
+
+commit 36c0c65936c81222272b8d9e0a1aa09287d0bd72
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 12 10:37:28 2011 +0200
+
+    reindent all files with the new script scripts/clean-all
+
+ hkl/hkl-detector-factory.c |   6 +-
+ hkl/hkl-geometry-factory.c |  66 ++++++++---------
+ hkl/hkl-geometry.c         |   6 +-
+ hkl/hkl-macros.h           |  20 +++---
+ scripts/clean-all          |   3 +
+ scripts/cleanfile          | 176 +++++++++++++++++++++++++++++++++++++++++++++
+ scripts/indent             |  13 ++++
+ test/hkl/geometry-t.c      |  12 ++--
+ test/hkl/matrix-t.c        |  40 +++++------
+ test/hkl/parameter-t.c     |  24 +++----
+ test/hkl/quaternion-t.c    |   4 +-
+ test/hkl/sample-t.c        |  16 ++---
+ 12 files changed, 289 insertions(+), 97 deletions(-)
+
+commit 8e5dc042164f977407321d8ac1192d45ad16a901
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 11 22:48:07 2011 +0200
+
+    remove plenty of trailling space with the linux cleanfile script
+
+ gui/hkl-gui.cpp                       |  18 +++---
+ gui/hkl3d/GL_ShapeDrawer.cpp          |  54 ++++++++---------
+ gui/hkl3d/GL_ShapeDrawer.h            |   9 ++-
+ gui/hkl3d/hkl3d-gui-gl.c              |   4 +-
+ gui/hkl3d/hkl3d-gui-model.cpp         |  50 ++++++++--------
+ gui/hkl3d/hkl3d-gui-model.h           |   6 +-
+ gui/hkl3d/hkl3d-gui-scene.cpp         |  14 ++---
+ gui/hkl3d/hkl3d-gui-scene.h           |   2 +-
+ gui/hkl3d/hkl3d-gui-view.cpp          |  10 ++--
+ gui/hkl3d/hkl3d-gui-view.h            |   2 +-
+ gui/hkl3d/texture.c                   |   1 -
+ gui/hkl3d/trackball.c                 |   1 -
+ gui/hkl3d/trackball.h                 |   1 -
+ hkl/hkl-axis.c                        |   2 +-
+ hkl/hkl-axis.h                        |   8 +--
+ hkl/hkl-error.c                       |   8 +--
+ hkl/hkl-error.h                       |   2 +-
+ hkl/hkl-geometry-factory.c            |   2 +-
+ hkl/hkl-geometry-factory.h            |   2 +-
+ hkl/hkl-geometry.c                    |  10 ++--
+ hkl/hkl-geometry.h                    |   2 +-
+ hkl/hkl-lattice.c                     |  10 ++--
+ hkl/hkl-macros.c                      |   2 +-
+ hkl/hkl-macros.h                      |   2 +-
+ hkl/hkl-matrix.c                      |   4 +-
+ hkl/hkl-pseudoaxis-auto.c             |  44 +++++++-------
+ hkl/hkl-pseudoaxis-common-eulerians.c |   2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c       |  10 ++--
+ hkl/hkl-pseudoaxis-common-hkl.h       |  12 ++--
+ hkl/hkl-pseudoaxis-common-psi.c       |  12 ++--
+ hkl/hkl-pseudoaxis-common-q.c         |   4 +-
+ hkl/hkl-pseudoaxis-common.c           |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c          |   4 +-
+ hkl/hkl-quaternion.c                  |   2 +-
+ hkl/hkl-sample.c                      |   8 +--
+ hkl/hkl-source.c                      |   2 +-
+ hkl/hkl-unit.c                        |   4 +-
+ hkl/hkl-vector.c                      |   4 +-
+ hkl3d/hkl3d.cpp                       | 106 +++++++++++++++++-----------------
+ hkl3d/hkl3d.h                         |   1 -
+ test/hkl/geometry-t.c                 |   2 +-
+ test/hkl/pseudoaxis-e4ch-t.c          |  12 ++--
+ test/hkl/pseudoaxis-e4cv-t.c          |  14 ++---
+ test/hkl/pseudoaxis-e6c-t.c           |   4 +-
+ test/hkl/pseudoaxis-k4cv-t.c          |   4 +-
+ test/hkl/pseudoaxis-k6c-t.c           |  10 ++--
+ test/hkl/pseudoaxis-t.c               |   4 +-
+ test/hkl/unit-t.c                     |   2 +-
+ test/hkl/vector-t.c                   |   2 +-
+ test/hkl3d/test-t.c                   |   4 +-
+ 51 files changed, 248 insertions(+), 255 deletions(-)
+
+commit eeea735175081608f5b7984f855d06b68f988b93
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 11 17:15:13 2011 +0200
+
+    rename HklPseudoAxisMode::axes_names -> axes.
+
+ hkl/hkl-pseudoaxis-common-hkl.c |  6 +++---
+ hkl/hkl-pseudoaxis.c            | 18 +++++++++---------
+ hkl/hkl-pseudoaxis.h            |  4 ++--
+ 3 files changed, 14 insertions(+), 14 deletions(-)
+
+commit 8c534f8b3f67bd1add0aa3cc44c986b60df1381d
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 11 15:39:33 2011 +0200
+
+    typo
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit b59989e090c9560662c5d97b1a26cb4bf52f9dff
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 11 15:39:24 2011 +0200
+
+    refactor a part of the HklPseudoAxisEngineMode
+    
+    I decided to inspire myself from this article :
+    http://lwn.net/Articles/444910/
+
+ configure.ac                          |  2 +-
+ hkl/Makefile.am                       |  2 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c |  9 +++--
+ hkl/hkl-pseudoaxis-common-hkl.h       | 17 ++++++++++
+ hkl/hkl-pseudoaxis-common-psi.c       | 10 ++++--
+ hkl/hkl-pseudoaxis-common-q.c         | 18 ++++++----
+ hkl/hkl-pseudoaxis-e4c-hkl.c          | 24 ++++----------
+ hkl/hkl-pseudoaxis-e6c-hkl.c          | 44 +++++++------------------
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         | 26 ++++-----------
+ hkl/hkl-pseudoaxis-k6c-hkl.c          | 52 ++++++++---------------------
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c  |  4 +--
+ hkl/hkl-pseudoaxis-zaxis-hkl.c        |  8 ++---
+ hkl/hkl-pseudoaxis.c                  | 62 ++++++++++++++++-------------------
+ hkl/hkl-pseudoaxis.h                  | 42 +++++++++++++++---------
+ 14 files changed, 137 insertions(+), 183 deletions(-)
+
+commit bc0c76ce06686fc241af6353c1bd43f077cf8011
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jun 10 14:55:38 2011 +0200
+
+    put the diffractometers figures at the right place.
+
+ Documentation/sphinx/source/diffractometers.rst | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+commit ca777e0730abee3e6e39bac6e1904bacbc0a0678
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jun 10 14:42:43 2011 +0200
+
+    add the k4cv figure
+
+ Documentation/figures/Makefile.am        |  2 +
+ Documentation/figures/diffractometer.asy | 77 ++++++++++++++++++++++++++------
+ Documentation/figures/k4cv.asy           | 36 +++++++++++++++
+ 3 files changed, 102 insertions(+), 13 deletions(-)
+
+commit a4d3afde63abf984647bef6748542e59b2b6f78e
+Merge: 31f04fb e771ad5
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jun 9 17:43:24 2011 +0200
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	Documentation/Makefile.am
+    	Documentation/figures/3S+1D.asy
+    	Documentation/figures/4S+2D.asy
+    	Documentation/figures/Makefile.am
+    	Documentation/figures/diffractometer.asy
+    	configure.ac
+
+commit e771ad5e8de3eaa5cee35e52a1d68baa6f78fa0d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jun 9 16:38:46 2011 +0200
+
+    no more povray figures.
+
+ Documentation/figures/4S+2D_reciprocal.asy   |  58 +++++++++++
+ Documentation/figures/4S+2D_reciprocal2.asy  |  50 ++++++++++
+ Documentation/figures/4S+2D_reciprocal3.asy  |  48 +++++++++
+ Documentation/figures/4S+2D_reciprocal4.asy  |  54 +++++++++++
+ Documentation/figures/4S+2D_reciproque.pov   | 101 -------------------
+ Documentation/figures/4S+2D_reciproque2.pov  | 100 -------------------
+ Documentation/figures/4S+2D_reciproque3.pov  | 112 ---------------------
+ Documentation/figures/4S+2D_reciproque4.pov  | 127 ------------------------
+ Documentation/figures/Makefile.am            |  32 +++---
+ Documentation/figures/arrows.inc             | 139 ---------------------------
+ Documentation/figures/bravais.inc            |  35 -------
+ Documentation/figures/cristal.ini            |   8 --
+ Documentation/sphinx/source/introduction.rst |  10 +-
+ configure.ac                                 |   6 --
+ 14 files changed, 228 insertions(+), 652 deletions(-)
+
+commit 81721bafef1e9170b5a211564888e0c747e076a7
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 7 15:32:27 2011 +0200
+
+    replace the cristal.pov with crystal.asy
+
+ Documentation/figures/Makefile.am |  4 +--
+ Documentation/figures/cristal.pov | 72 ---------------------------------------
+ Documentation/figures/crystal.asy | 52 ++++++++++++++++++++++++++++
+ 3 files changed, 54 insertions(+), 74 deletions(-)
+
+commit c451c466b477da5d823a25f98f89044a949e51da
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 7 14:48:42 2011 +0200
+
+    remove useless files
+
+ Documentation/figures/Makefile.am |  2 --
+ Documentation/figures/test.pov    | 31 -------------------------------
+ 2 files changed, 33 deletions(-)
+
+commit 01f4f42052325703565c861f740246aa5046344d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 7 14:44:23 2011 +0200
+
+    add the B_b3_y.asy file
+
+ Documentation/figures/B_b3_y.asy  | 29 ++++++++++++++++
+ Documentation/figures/B_b3_y.pov  | 72 ---------------------------------------
+ Documentation/figures/Makefile.am |  5 +--
+ 3 files changed, 32 insertions(+), 74 deletions(-)
+
+commit e2b421118789ae80c4ce884d5b5a1ca29e01c0d6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 7 14:18:45 2011 +0200
+
+    remove useless povray files
+
+ Documentation/figures/3S+1D.pov   | 164 ---------------------------------
+ Documentation/figures/4S+2D.pov   | 187 --------------------------------------
+ Documentation/figures/Makefile.am |   7 +-
+ 3 files changed, 3 insertions(+), 355 deletions(-)
+
+commit 991a69702399dc124e19f0b9ee6301fb7fa05f28
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 7 13:51:51 2011 +0200
+
+    now the carrows in the figures are ok
+
+ Documentation/figures/3S+1D.asy          |  30 ++++---
+ Documentation/figures/4S+2D.asy          |  26 +++---
+ Documentation/figures/diffractometer.asy | 135 +++++++++++--------------------
+ 3 files changed, 78 insertions(+), 113 deletions(-)
+
+commit 245d6389417c346b329aa161c15364b49a4c8d65
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 5 21:54:10 2011 +0200
+
+    add the arrows to the asymptote figures.
+
+ Documentation/figures/diffractometer.asy | 54 +++++++++++++++++++++++++++++++-
+ 1 file changed, 53 insertions(+), 1 deletion(-)
+
+commit 98f97399c71aff1fd13faa3b442337ae3091003c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Jun 2 16:31:06 2011 +0200
+
+    distribute also the sphinx source files.
+
+ Documentation/sphinx/Makefile.am | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+commit b2eb707df93ebf662b3eaaeacd8391bf45dc08fa
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Jun 2 16:16:02 2011 +0200
+
+    backport the figures from the next branch
+
+ Documentation/Makefile.am                   |   2 +-
+ Documentation/figures/3S+1D.asy             |  30 +++++
+ Documentation/figures/3S+1D.pov             | 164 ++++++++++++++++++++++++
+ Documentation/figures/4S+2D.asy             |  30 +++++
+ Documentation/figures/4S+2D.pov             | 187 ++++++++++++++++++++++++++++
+ Documentation/figures/4S+2D_reciproque.pov  | 101 +++++++++++++++
+ Documentation/figures/4S+2D_reciproque2.pov | 100 +++++++++++++++
+ Documentation/figures/4S+2D_reciproque3.pov | 112 +++++++++++++++++
+ Documentation/figures/4S+2D_reciproque4.pov | 127 +++++++++++++++++++
+ Documentation/figures/B_a.asy               |  26 ++++
+ Documentation/figures/B_b.asy               |  23 ++++
+ Documentation/figures/B_b3_y.pov            |  72 +++++++++++
+ Documentation/figures/Makefile.am           |  42 +++++++
+ Documentation/figures/arrows.inc            | 139 +++++++++++++++++++++
+ Documentation/figures/bravais.inc           |  35 ++++++
+ Documentation/figures/cristal.ini           |   8 ++
+ Documentation/figures/cristal.pov           |  72 +++++++++++
+ Documentation/figures/diffractometer.asy    | 120 ++++++++++++++++++
+ Documentation/figures/test.pov              |  31 +++++
+ Documentation/figures/zaxis.asy             |  71 +++++++++++
+ configure.ac                                |  13 ++
+ 21 files changed, 1504 insertions(+), 1 deletion(-)
+
+commit fd31a4b7de38b3f41df6bef94d1e5c9f0db028b0
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue May 31 16:47:31 2011 +0200
+
+    update the news file for the sphinx documentation
+
+ NEWS | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 6d0742d381b5aa143055633bfc238429fb7f5152
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue May 31 16:03:40 2011 +0200
+
+    add the first version of the sphinx documentation
+    
+    at the end it will remain only two systems
+    - api using gtk-doc
+    - html/latex using sphinx
+
+ Documentation/Makefile.am                       |   2 +-
+ Documentation/sphinx/Makefile.am                |   1 +
+ Documentation/sphinx/source/conf.py.in          | 216 +++++++
+ Documentation/sphinx/source/development.rst     | 456 +++++++++++++
+ Documentation/sphinx/source/diffractometers.rst | 244 +++++++
+ Documentation/sphinx/source/index.rst           |  26 +
+ Documentation/sphinx/source/introduction.rst    | 821 ++++++++++++++++++++++++
+ configure.ac                                    |   2 +
+ sphinx.make                                     | 130 ++++
+ 9 files changed, 1897 insertions(+), 1 deletion(-)
+
+commit 31f04fb7386f340c276f29152460dcbe3590a0c8
+Merge: ac1155f 19fea11
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue May 10 11:24:35 2011 +0200
+
+    Merge branch 'maint' into next
+
+commit 19fea1186e97fa081e427217fcf7238f31e110c2
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue May 10 11:24:26 2011 +0200
+
+    update the NEWS file for the MARS diffractometer
+
+ NEWS | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit ac1155fac104a7152cfb1f7579eeb72633783624
+Merge: 75c0154 bd8933b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue May 10 11:23:16 2011 +0200
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	Documentation/hkl.texi
+    	hkl/hkl-geometry-factory.c
+    	hkl/hkl-geometry-factory.h
+    	hkl/hkl-geometry.h
+    	hkl/hkl-pseudoaxis-factory.c
+
+commit bd8933b8f5f5f45d856c7fee812207931a1fa392
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue May 10 11:06:28 2011 +0200
+
+    * backport the SOLEIL MARS beamline diffractometer from the next branch
+    
+    Conflicts:
+    
+    	Documentation/hkl.texi
+    	hkl/hkl-geometry-factory.h
+    	hkl/hkl-geometry.h
+    	hkl/hkl-pseudoaxis-factory.c
+
+ Documentation/hkl.texi       | 30 ++++++++++++++++++++++++------
+ hkl/hkl-geometry-factory.c   | 18 ++++++++++++++++++
+ hkl/hkl-geometry-factory.h   |  1 +
+ hkl/hkl-geometry.h           |  3 ++-
+ hkl/hkl-pseudoaxis-factory.c |  1 +
+ test/hkl-test-pseudoaxis.c   |  9 +++++++++
+ 6 files changed, 55 insertions(+), 7 deletions(-)
+
+commit 75c01548f4e66cb47fca070231e108b081c4bf26
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 9 16:33:58 2011 +0200
+
+    * more statistic in the bench test.
+
+ test/hkl/bench-t.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+commit 5347e4ba57784be8d9024aa0337c4041b7c589d1
+Merge: 41c90a4 2165cc9
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun May 1 18:41:24 2011 +0200
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	Documentation/hkl.texi
+    	NEWS
+    	configure.ac
+    	hkl/hkl-geometry-factory.c
+    	hkl/hkl-geometry-factory.h
+    	hkl/hkl-geometry.c
+    	hkl/hkl-geometry.h
+    	hkl/hkl-pseudoaxis-common-eulerians.c
+    	hkl/hkl-pseudoaxis-common-hkl.c
+    	hkl/hkl-pseudoaxis-common-q.c
+    	hkl/hkl-sample.c
+    	hkl/hkl-vector.c
+    	hkl/pom.xml
+    	test/hkl/pseudoaxis-t.c
+
+commit 41c90a4c60c43787b7c185f1f589116055670ae9
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun May 1 17:13:10 2011 +0200
+
+    * remove the bullet soft body library
+    
+    we are not using this part of bullet, so it reduce
+    a bit the compiling time.
+
+ .../src/BulletSoftBody/btDefaultSoftBodySolver.cpp |  151 -
+ .../src/BulletSoftBody/btDefaultSoftBodySolver.h   |   63 -
+ hkl3d/bullet/src/BulletSoftBody/btSoftBody.cpp     | 3409 --------------------
+ hkl3d/bullet/src/BulletSoftBody/btSoftBody.h       |  978 ------
+ .../btSoftBodyConcaveCollisionAlgorithm.cpp        |  368 ---
+ .../btSoftBodyConcaveCollisionAlgorithm.h          |  153 -
+ hkl3d/bullet/src/BulletSoftBody/btSoftBodyData.h   |  217 --
+ .../src/BulletSoftBody/btSoftBodyHelpers.cpp       | 1055 ------
+ .../bullet/src/BulletSoftBody/btSoftBodyHelpers.h  |  143 -
+ .../src/BulletSoftBody/btSoftBodyInternals.h       |  916 ------
+ .../btSoftBodyRigidBodyCollisionConfiguration.cpp  |  134 -
+ .../btSoftBodyRigidBodyCollisionConfiguration.h    |   48 -
+ .../BulletSoftBody/btSoftBodySolverVertexBuffer.h  |  165 -
+ .../bullet/src/BulletSoftBody/btSoftBodySolvers.h  |  154 -
+ .../btSoftRigidCollisionAlgorithm.cpp              |   84 -
+ .../BulletSoftBody/btSoftRigidCollisionAlgorithm.h |   75 -
+ .../BulletSoftBody/btSoftRigidDynamicsWorld.cpp    |  358 --
+ .../src/BulletSoftBody/btSoftRigidDynamicsWorld.h  |  107 -
+ .../btSoftSoftCollisionAlgorithm.cpp               |   47 -
+ .../BulletSoftBody/btSoftSoftCollisionAlgorithm.h  |   69 -
+ hkl3d/bullet/src/BulletSoftBody/btSparseSDF.h      |  306 --
+ hkl3d/bullet/src/Makefile.am                       |   27 +-
+ 22 files changed, 2 insertions(+), 9025 deletions(-)
+
+commit ab650f37926fad535fb95c691f16f0059fbe396b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Apr 30 22:15:14 2011 +0200
+
+    * remove useless files
+
+ hkl3d/bullet/src/MiniCL/MiniCL.cpp                | 720 ------------------
+ hkl3d/bullet/src/MiniCL/MiniCLTask/MiniCLTask.cpp |  74 --
+ hkl3d/bullet/src/MiniCL/MiniCLTask/MiniCLTask.h   |  62 --
+ hkl3d/bullet/src/MiniCL/MiniCLTaskScheduler.cpp   | 519 -------------
+ hkl3d/bullet/src/MiniCL/MiniCLTaskScheduler.h     | 194 -----
+ hkl3d/bullet/src/MiniCL/cl.h                      | 867 ----------------------
+ hkl3d/bullet/src/MiniCL/cl_MiniCL_Defs.h          | 329 --------
+ hkl3d/bullet/src/MiniCL/cl_gl.h                   | 113 ---
+ hkl3d/bullet/src/MiniCL/cl_platform.h             | 254 -------
+ 9 files changed, 3132 deletions(-)
+
+commit fd1cc1f58d59dd6049ee305a40feb3f7ee300049
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Apr 30 22:14:07 2011 +0200
+
+    * import bullet 2.78
+
+ hkl3d/bullet/src/Bullet-C-Api.h                    |    8 +-
+ .../BroadphaseCollision/btAxisSweep3.h             |    4 +-
+ .../BroadphaseCollision/btBroadphaseInterface.h    |    6 +-
+ .../BroadphaseCollision/btBroadphaseProxy.h        |    6 +-
+ .../BroadphaseCollision/btCollisionAlgorithm.h     |   10 +-
+ .../BulletCollision/BroadphaseCollision/btDbvt.cpp |    2 +-
+ .../BroadphaseCollision/btDispatcher.h             |   14 +-
+ .../BroadphaseCollision/btOverlappingPairCache.h   |    6 +-
+ .../BroadphaseCollision/btQuantizedBvh.h           |    6 +-
+ .../BroadphaseCollision/btSimpleBroadphase.h       |    6 +-
+ .../CollisionDispatch/SphereTriangleDetector.cpp   |   62 +-
+ .../CollisionDispatch/SphereTriangleDetector.h     |    6 +-
+ .../btBox2dBox2dCollisionAlgorithm.cpp             |  870 +++----
+ .../btBox2dBox2dCollisionAlgorithm.h               |  132 +-
+ .../CollisionDispatch/btBoxBoxCollisionAlgorithm.h |    6 +-
+ .../CollisionDispatch/btBoxBoxDetector.cpp         |   14 +
+ .../CollisionDispatch/btBoxBoxDetector.h           |    4 +-
+ .../CollisionDispatch/btCollisionConfiguration.h   |    1 +
+ .../CollisionDispatch/btCollisionCreateFunc.h      |    6 +-
+ .../CollisionDispatch/btCollisionDispatcher.cpp    |   15 +-
+ .../CollisionDispatch/btCollisionDispatcher.h      |   29 +-
+ .../CollisionDispatch/btCollisionObject.cpp        |    1 +
+ .../CollisionDispatch/btCollisionObject.h          |   30 +-
+ .../CollisionDispatch/btCollisionWorld.cpp         |  455 ++--
+ .../CollisionDispatch/btCollisionWorld.h           |   45 +-
+ .../btCompoundCollisionAlgorithm.cpp               |   32 +-
+ .../btCompoundCollisionAlgorithm.h                 |    6 +-
+ .../btConvex2dConvex2dAlgorithm.cpp                |  494 ++--
+ .../btConvex2dConvex2dAlgorithm.h                  |  190 +-
+ .../btConvexConcaveCollisionAlgorithm.cpp          |   15 +-
+ .../btConvexConcaveCollisionAlgorithm.h            |    6 +-
+ .../CollisionDispatch/btConvexConvexAlgorithm.cpp  |  109 +-
+ .../CollisionDispatch/btConvexConvexAlgorithm.h    |    6 +-
+ .../btConvexPlaneCollisionAlgorithm.h              |    6 +-
+ .../CollisionDispatch/btEmptyCollisionAlgorithm.h  |    6 +-
+ .../CollisionDispatch/btGhostObject.h              |    2 +-
+ .../CollisionDispatch/btInternalEdgeUtility.cpp    | 1614 ++++++------
+ .../CollisionDispatch/btInternalEdgeUtility.h      |   92 +-
+ .../CollisionDispatch/btManifoldResult.cpp         |    5 +-
+ .../CollisionDispatch/btManifoldResult.h           |    6 +-
+ .../btSimulationIslandManager.cpp                  |   83 +-
+ .../CollisionDispatch/btSimulationIslandManager.h  |    6 +-
+ .../btSphereBoxCollisionAlgorithm.h                |    6 +-
+ .../btSphereSphereCollisionAlgorithm.h             |    6 +-
+ .../btSphereTriangleCollisionAlgorithm.h           |    6 +-
+ .../CollisionDispatch/btUnionFind.cpp              |    3 +-
+ .../CollisionDispatch/btUnionFind.h                |   11 +-
+ .../CollisionShapes/btBox2dShape.cpp               |   84 +-
+ .../BulletCollision/CollisionShapes/btBox2dShape.h |  726 +++---
+ .../BulletCollision/CollisionShapes/btBoxShape.h   |    8 +-
+ .../CollisionShapes/btBvhTriangleMeshShape.cpp     |    4 +-
+ .../CollisionShapes/btBvhTriangleMeshShape.h       |    8 +-
+ .../CollisionShapes/btCollisionMargin.h            |    6 +-
+ .../CollisionShapes/btCollisionShape.h             |    6 +-
+ .../CollisionShapes/btCompoundShape.cpp            |   41 +-
+ .../CollisionShapes/btCompoundShape.h              |   18 +-
+ .../CollisionShapes/btConcaveShape.h               |    6 +-
+ .../CollisionShapes/btConeShape.cpp                |   10 +
+ .../BulletCollision/CollisionShapes/btConeShape.h  |    9 +-
+ .../CollisionShapes/btConvex2dShape.cpp            |  184 +-
+ .../CollisionShapes/btConvex2dShape.h              |  160 +-
+ .../CollisionShapes/btConvexHullShape.cpp          |   14 +-
+ .../CollisionShapes/btConvexHullShape.h            |    6 +-
+ .../CollisionShapes/btConvexPolyhedron.cpp         |  185 ++
+ .../CollisionShapes/btConvexPolyhedron.h           |   54 +
+ .../CollisionShapes/btConvexShape.h                |    6 +-
+ .../CollisionShapes/btConvexTriangleMeshShape.h    |    6 +-
+ .../CollisionShapes/btCylinderShape.cpp            |   61 +-
+ .../CollisionShapes/btCylinderShape.h              |   22 +-
+ .../BulletCollision/CollisionShapes/btEmptyShape.h |    6 +-
+ .../CollisionShapes/btHeightfieldTerrainShape.h    |    6 +-
+ .../BulletCollision/CollisionShapes/btMaterial.h   |    6 +-
+ .../CollisionShapes/btMinkowskiSumShape.h          |    6 +-
+ .../CollisionShapes/btMultiSphereShape.h           |    6 +-
+ .../btMultimaterialTriangleMeshShape.h             |    7 +-
+ .../CollisionShapes/btOptimizedBvh.h               |    6 +-
+ .../CollisionShapes/btPolyhedralConvexShape.cpp    |  147 +-
+ .../CollisionShapes/btPolyhedralConvexShape.h      |   20 +-
+ .../btScaledBvhTriangleMeshShape.cpp               |    2 +
+ .../CollisionShapes/btScaledBvhTriangleMeshShape.h |   37 +-
+ .../BulletCollision/CollisionShapes/btShapeHull.h  |    6 +-
+ .../CollisionShapes/btSphereShape.h                |    6 +-
+ .../CollisionShapes/btStaticPlaneShape.h           |    6 +-
+ .../CollisionShapes/btStridingMeshInterface.cpp    |   48 +
+ .../CollisionShapes/btStridingMeshInterface.h      |   14 +-
+ .../CollisionShapes/btTetrahedronShape.h           |    6 +-
+ .../CollisionShapes/btTriangleCallback.h           |    6 +-
+ .../CollisionShapes/btTriangleInfoMap.h            |  478 ++--
+ .../CollisionShapes/btTriangleMesh.h               |    6 +-
+ .../CollisionShapes/btTriangleMeshShape.h          |    6 +-
+ .../CollisionShapes/btTriangleShape.h              |    6 +-
+ .../CollisionShapes/btUniformScalingShape.cpp      |   69 +-
+ .../src/BulletCollision/Gimpact/btBoxCollision.h   |    2 +-
+ .../src/BulletCollision/Gimpact/btClipPolygon.h    |    2 +-
+ .../BulletCollision/Gimpact/btContactProcessing.h  |    2 +-
+ .../src/BulletCollision/Gimpact/btGImpactBvh.cpp   |    2 +-
+ .../src/BulletCollision/Gimpact/btGImpactBvh.h     |    6 +-
+ .../Gimpact/btGImpactCollisionAlgorithm.h          |   12 +-
+ .../BulletCollision/Gimpact/btGImpactMassUtil.h    |    2 +-
+ .../Gimpact/btGImpactQuantizedBvh.cpp              |    2 +-
+ .../Gimpact/btGImpactQuantizedBvh.h                |    6 +-
+ .../Gimpact/btGenericPoolAllocator.cpp             |    2 +-
+ .../Gimpact/btGenericPoolAllocator.h               |    2 +-
+ .../BulletCollision/Gimpact/btGeometryOperations.h |    2 +-
+ .../src/BulletCollision/Gimpact/btQuantization.h   |    8 +-
+ .../BulletCollision/Gimpact/btTriangleShapeEx.cpp  |    2 +-
+ .../BulletCollision/Gimpact/btTriangleShapeEx.h    |    8 +-
+ .../bullet/src/BulletCollision/Gimpact/gim_array.h |    2 +-
+ .../Gimpact/gim_basic_geometry_operations.h        |    2 +-
+ .../src/BulletCollision/Gimpact/gim_bitset.h       |    2 +-
+ .../BulletCollision/Gimpact/gim_box_collision.h    |    2 +-
+ .../src/BulletCollision/Gimpact/gim_box_set.h      |    2 +-
+ .../src/BulletCollision/Gimpact/gim_clip_polygon.h |    2 +-
+ .../src/BulletCollision/Gimpact/gim_contact.h      |    2 +-
+ .../src/BulletCollision/Gimpact/gim_geom_types.h   |    2 +-
+ .../src/BulletCollision/Gimpact/gim_geometry.h     |    2 +-
+ .../src/BulletCollision/Gimpact/gim_hash_table.h   |    2 +-
+ .../src/BulletCollision/Gimpact/gim_linear_math.h  |    2 +-
+ .../bullet/src/BulletCollision/Gimpact/gim_math.h  |    2 +-
+ .../src/BulletCollision/Gimpact/gim_memory.h       |    2 +-
+ .../src/BulletCollision/Gimpact/gim_radixsort.h    |    2 +-
+ .../BulletCollision/Gimpact/gim_tri_collision.cpp  |    2 +-
+ .../BulletCollision/Gimpact/gim_tri_collision.h    |    2 +-
+ .../btContinuousConvexCollision.cpp                |  135 +-
+ .../btContinuousConvexCollision.h                  |   15 +-
+ .../NarrowPhaseCollision/btConvexCast.h            |    8 +-
+ .../btConvexPenetrationDepthSolver.h               |    6 +-
+ .../btDiscreteCollisionDetectorInterface.h         |    8 +-
+ .../NarrowPhaseCollision/btGjkConvexCast.h         |    6 +-
+ .../NarrowPhaseCollision/btGjkEpa2.h               |    8 +-
+ .../NarrowPhaseCollision/btGjkPairDetector.cpp     |    9 +-
+ .../NarrowPhaseCollision/btGjkPairDetector.h       |    6 +-
+ .../NarrowPhaseCollision/btManifoldPoint.h         |   32 +-
+ .../btMinkowskiPenetrationDepthSolver.h            |    6 +-
+ .../NarrowPhaseCollision/btPersistentManifold.h    |   48 +-
+ .../NarrowPhaseCollision/btPointCollector.h        |    6 +-
+ .../btPolyhedralContactClipping.cpp                |  360 +++
+ .../btPolyhedralContactClipping.h                  |   46 +
+ .../NarrowPhaseCollision/btRaycastCallback.cpp     |    6 +-
+ .../NarrowPhaseCollision/btRaycastCallback.h       |    9 +-
+ .../btSimplexSolverInterface.h                     |    6 +-
+ .../NarrowPhaseCollision/btSubSimplexConvexCast.h  |    6 +-
+ .../NarrowPhaseCollision/btVoronoiSimplexSolver.h  |    7 +-
+ .../Character/btCharacterControllerInterface.h     |    7 +-
+ .../Character/btKinematicCharacterController.cpp   |  166 +-
+ .../Character/btKinematicCharacterController.h     |   31 +-
+ .../ConstraintSolver/btConeTwistConstraint.cpp     |   10 +
+ .../ConstraintSolver/btConeTwistConstraint.h       |   22 +-
+ .../ConstraintSolver/btConstraintSolver.h          |    6 +-
+ .../ConstraintSolver/btContactConstraint.cpp       |   50 +-
+ .../ConstraintSolver/btContactConstraint.h         |    9 +-
+ .../ConstraintSolver/btContactSolverInfo.h         |    8 +-
+ .../ConstraintSolver/btGeneric6DofConstraint.cpp   |   60 +-
+ .../ConstraintSolver/btGeneric6DofConstraint.h     |   40 +-
+ .../btGeneric6DofSpringConstraint.cpp              |  318 +--
+ .../btGeneric6DofSpringConstraint.h                |  151 +-
+ .../ConstraintSolver/btHinge2Constraint.cpp        |  132 +-
+ .../ConstraintSolver/btHinge2Constraint.h          |  116 +-
+ .../ConstraintSolver/btHingeConstraint.cpp         |  153 +-
+ .../ConstraintSolver/btHingeConstraint.h           |   91 +-
+ .../ConstraintSolver/btJacobianEntry.h             |    6 +-
+ .../ConstraintSolver/btPoint2PointConstraint.cpp   |    1 +
+ .../ConstraintSolver/btPoint2PointConstraint.h     |    6 +-
+ .../btSequentialImpulseConstraintSolver.cpp        |  111 +-
+ .../btSequentialImpulseConstraintSolver.h          |   14 +-
+ .../ConstraintSolver/btSliderConstraint.cpp        |    0
+ .../ConstraintSolver/btSliderConstraint.h          |   20 +-
+ .../ConstraintSolver/btSolve2LinearConstraint.h    |    6 +-
+ .../ConstraintSolver/btSolverConstraint.h          |    4 +-
+ .../ConstraintSolver/btTypedConstraint.cpp         |   82 +-
+ .../ConstraintSolver/btTypedConstraint.h           |  168 +-
+ .../ConstraintSolver/btUniversalConstraint.cpp     |  150 +-
+ .../ConstraintSolver/btUniversalConstraint.h       |  122 +-
+ .../BulletDynamics/Dynamics/btActionInterface.h    |   96 +-
+ .../Dynamics/btDiscreteDynamicsWorld.cpp           |  205 +-
+ .../Dynamics/btDiscreteDynamicsWorld.h             |    2 +
+ .../src/BulletDynamics/Dynamics/btDynamicsWorld.h  |    5 +-
+ .../src/BulletDynamics/Dynamics/btRigidBody.cpp    |   20 +-
+ .../src/BulletDynamics/Dynamics/btRigidBody.h      |   43 +-
+ .../Dynamics/btSimpleDynamicsWorld.cpp             |   29 +-
+ .../Dynamics/btSimpleDynamicsWorld.h               |    8 +
+ .../BulletDynamics/Vehicle/btRaycastVehicle.cpp    |   13 +
+ .../src/BulletDynamics/Vehicle/btRaycastVehicle.h  |  472 ++--
+ .../BulletDynamics/Vehicle/btVehicleRaycaster.h    |    8 +-
+ .../src/BulletDynamics/Vehicle/btWheelInfo.h       |    6 +-
+ .../GpuSoftBodySolvers/CPU/btSoftBodySolverData.h  |  744 ++++++
+ .../CPU/btSoftBodySolver_CPU.cpp                   |  979 +++++++
+ .../GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h  |  370 +++
+ hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h |  117 +
+ .../src/BulletMultiThreaded/PlatformDefinitions.h  |   39 +-
+ .../src/BulletMultiThreaded/PosixThreadSupport.cpp |  164 +-
+ .../src/BulletMultiThreaded/PosixThreadSupport.h   |   28 +-
+ .../src/BulletMultiThreaded/PpuAddressSpace.h      |   35 +-
+ .../SequentialThreadSupport.cpp                    |   76 +
+ .../BulletMultiThreaded/SequentialThreadSupport.h  |   10 +-
+ .../SpuCollisionObjectWrapper.h                    |    6 +-
+ .../SpuCollisionTaskProcess.cpp                    |    1 -
+ .../BulletMultiThreaded/SpuCollisionTaskProcess.h  |    6 +-
+ .../SpuContactManifoldCollisionAlgorithm.h         |    6 +-
+ .../src/BulletMultiThreaded/SpuDoubleBuffer.h      |   20 +-
+ .../bullet/src/BulletMultiThreaded/SpuFakeDma.cpp  |   10 +-
+ hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h  |  270 +-
+ .../SpuGatheringCollisionDispatcher.cpp            |   32 +-
+ .../SpuGatheringCollisionDispatcher.h              |    6 +-
+ .../src/BulletMultiThreaded/SpuLibspe2Support.h    |    6 +-
+ .../SpuNarrowPhaseCollisionTask/Box.h              |   33 +-
+ .../SpuCollisionShapes.h                           |    8 +-
+ .../SpuContactResult.cpp                           |   10 +-
+ .../SpuGatheringCollisionTask.cpp                  |   63 +-
+ .../SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp |  345 +--
+ .../SpuNarrowPhaseCollisionTask/boxBoxDistance.h   |   11 +-
+ .../src/BulletMultiThreaded/SpuSampleTaskProcess.h |    6 +-
+ hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h     |    7 +-
+ hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h  |   79 +
+ hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h |  339 +++
+ .../src/BulletMultiThreaded/Win32ThreadSupport.cpp |  186 +-
+ .../src/BulletMultiThreaded/Win32ThreadSupport.h   |   20 +-
+ .../BulletMultiThreaded/btGpu3DGridBroadphase.cpp  | 1180 ++++-----
+ .../BulletMultiThreaded/btGpu3DGridBroadphase.h    |  276 +-
+ .../btGpu3DGridBroadphaseSharedCode.h              |  860 +++---
+ .../btGpu3DGridBroadphaseSharedDefs.h              |  122 +-
+ .../btGpu3DGridBroadphaseSharedTypes.h             |  134 +-
+ .../src/BulletMultiThreaded/btGpuUtilsSharedCode.h |  110 +-
+ .../src/BulletMultiThreaded/btGpuUtilsSharedDefs.h |  104 +-
+ .../btParallelConstraintSolver.cpp                 | 1463 ++++++++++-
+ .../btParallelConstraintSolver.h                   |  325 ++-
+ .../BulletMultiThreaded/btThreadSupportInterface.h |   43 +-
+ .../src/BulletMultiThreaded/vectormath2bullet.h    |   15 +-
+ .../src/BulletSoftBody/btDefaultSoftBodySolver.cpp |  151 ++
+ .../src/BulletSoftBody/btDefaultSoftBodySolver.h   |   63 +
+ hkl3d/bullet/src/BulletSoftBody/btSoftBody.cpp     |  704 ++++-
+ hkl3d/bullet/src/BulletSoftBody/btSoftBody.h       |  107 +-
+ .../btSoftBodyConcaveCollisionAlgorithm.h          |    6 +-
+ hkl3d/bullet/src/BulletSoftBody/btSoftBodyData.h   |  217 ++
+ .../src/BulletSoftBody/btSoftBodyHelpers.cpp       |  230 +-
+ .../bullet/src/BulletSoftBody/btSoftBodyHelpers.h  |   24 +-
+ .../src/BulletSoftBody/btSoftBodyInternals.h       |   31 +-
+ .../BulletSoftBody/btSoftBodySolverVertexBuffer.h  |  165 ++
+ .../bullet/src/BulletSoftBody/btSoftBodySolvers.h  |  154 ++
+ .../btSoftRigidCollisionAlgorithm.cpp              |    4 +-
+ .../BulletSoftBody/btSoftRigidCollisionAlgorithm.h |    6 +-
+ .../BulletSoftBody/btSoftRigidDynamicsWorld.cpp    |  138 +-
+ .../src/BulletSoftBody/btSoftRigidDynamicsWorld.h  |   18 +-
+ .../btSoftSoftCollisionAlgorithm.cpp               |    3 +-
+ .../BulletSoftBody/btSoftSoftCollisionAlgorithm.h  |    6 +-
+ hkl3d/bullet/src/BulletSoftBody/btSparseSDF.h      |    6 +-
+ hkl3d/bullet/src/LinearMath/btAabbUtil2.h          |    6 +-
+ hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp |   25 +-
+ hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h |    9 +-
+ hkl3d/bullet/src/LinearMath/btConvexHull.h         |    6 +-
+ .../bullet/src/LinearMath/btConvexHullComputer.cpp | 2749 ++++++++++++++++++++
+ hkl3d/bullet/src/LinearMath/btConvexHullComputer.h |  103 +
+ hkl3d/bullet/src/LinearMath/btDefaultMotionState.h |    6 +-
+ hkl3d/bullet/src/LinearMath/btHashMap.h            |   18 +-
+ hkl3d/bullet/src/LinearMath/btIDebugDraw.h         |  109 +-
+ hkl3d/bullet/src/LinearMath/btList.h               |    6 +-
+ hkl3d/bullet/src/LinearMath/btMatrix3x3.h          |   89 +-
+ hkl3d/bullet/src/LinearMath/btMinMax.h             |   12 +-
+ hkl3d/bullet/src/LinearMath/btPoolAllocator.h      |   19 +
+ hkl3d/bullet/src/LinearMath/btQuadWord.h           |    6 +-
+ hkl3d/bullet/src/LinearMath/btQuaternion.h         |    6 +-
+ hkl3d/bullet/src/LinearMath/btQuickprof.cpp        |  223 +-
+ hkl3d/bullet/src/LinearMath/btQuickprof.h          |  202 +-
+ hkl3d/bullet/src/LinearMath/btRandom.h             |    6 +-
+ hkl3d/bullet/src/LinearMath/btScalar.h             |   23 +-
+ hkl3d/bullet/src/LinearMath/btSerializer.cpp       | 1409 ++++++----
+ hkl3d/bullet/src/LinearMath/btSerializer.h         | 1259 ++++-----
+ hkl3d/bullet/src/LinearMath/btTransform.h          |    6 +-
+ hkl3d/bullet/src/LinearMath/btTransformUtil.h      |    8 +-
+ hkl3d/bullet/src/LinearMath/btVector3.h            |   48 +-
+ hkl3d/bullet/src/Makefile.am                       |   19 +-
+ hkl3d/bullet/src/MiniCL/MiniCL.cpp                 |  720 +++++
+ hkl3d/bullet/src/MiniCL/MiniCLTask/MiniCLTask.cpp  |   74 +
+ hkl3d/bullet/src/MiniCL/MiniCLTask/MiniCLTask.h    |   62 +
+ hkl3d/bullet/src/MiniCL/MiniCLTaskScheduler.cpp    |  519 ++++
+ hkl3d/bullet/src/MiniCL/MiniCLTaskScheduler.h      |  194 ++
+ hkl3d/bullet/src/MiniCL/cl.h                       |    2 +
+ hkl3d/bullet/src/MiniCL/cl_MiniCL_Defs.h           |  594 +++--
+ hkl3d/bullet/src/MiniCL/cl_gl.h                    |    2 +-
+ hkl3d/bullet/src/MiniCL/cl_platform.h              |  508 ++--
+ hkl3d/bullet/src/btBulletCollisionCommon.h         |    1 +
+ 281 files changed, 22150 insertions(+), 8371 deletions(-)
+
+commit bf1eefe3f020e10d417f1f35cbeb1265e8cf8f18
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Apr 29 22:52:51 2011 +0200
+
+    * remove a bug triggered by gcc 4.5
+
+ test/hkl/unit-t.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+commit 5fcc583f46993de853c522b6095befb5981934d0
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Apr 29 22:17:26 2011 +0200
+
+    import c-tap-harness 1.7
+
+ test/runtests.c    | 58 ++++++++++++++++++++++++++++++++++++++++++------------
+ test/tap/basic.c   | 35 ++++++++++++++++----------------
+ test/tap/basic.h   | 35 ++++++++++++++++----------------
+ test/tap/libtap.sh |  3 ++-
+ 4 files changed, 81 insertions(+), 50 deletions(-)
+
+commit 2165cc97163034a2adaaef5bc4f5f3416a3b5dfe
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Apr 29 10:47:18 2011 +0200
+
+    * add documentation of the SOLEIL SIXS MED2+2 geometry
+
+ Documentation/hkl.texi | 54 ++++++++++++++++++++++++++++++++++++++++++++++++--
+ NEWS                   |  3 +++
+ 2 files changed, 55 insertions(+), 2 deletions(-)
+
+commit 744156fb0db25b83d18ede8ea249a329351d539f
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Apr 14 19:54:47 2011 +0200
+
+    add also the 4S+2D diffractometer using asymptote.
+
+ Documentation/figures/3S+1D.asy          | 153 ++-----------------------------
+ Documentation/figures/4S+2D.asy          |  30 ++++++
+ Documentation/figures/Makefile.am        |   2 +
+ Documentation/figures/diffractometer.asy | 120 ++++++++++++++++++++++++
+ 4 files changed, 158 insertions(+), 147 deletions(-)
+
+commit 2e4cafd68fa149f1d803d7853179be819729768b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Apr 14 18:56:47 2011 +0200
+
+    add 3S+1D figure implemented with asymptote.
+
+ Documentation/figures/3S+1D.asy   | 171 ++++++++++++++++++++++++++++++++++++++
+ Documentation/figures/Makefile.am |   2 +
+ 2 files changed, 173 insertions(+)
+
+commit 68968287c81e398586c043d612f59d63437e0a36
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Apr 11 22:00:37 2011 +0200
+
+    convert B_b.pov -> B_b.asy
+
+ Documentation/figures/B_b.asy     | 23 ++++++++++++++++
+ Documentation/figures/B_b.pov     | 58 ---------------------------------------
+ Documentation/figures/Makefile.am |  4 +--
+ 3 files changed, 25 insertions(+), 60 deletions(-)
+
+commit 46a88a65186c2a532d4cd6490ee45c376fdc9610
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Apr 11 21:44:47 2011 +0200
+
+    * remove useless files
+
+ Documentation/figures/B_b.py             |  25 -----
+ Documentation/figures/arrows.py          | 114 ----------------------
+ Documentation/figures/bravais.py         |  35 -------
+ Documentation/figures/crystal.py         |  36 -------
+ Documentation/figures/diffractometers.py | 157 -------------------------------
+ 5 files changed, 367 deletions(-)
+
+commit 1d4fa27f537059b2b882054f719e2dda9c5d8b05
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Mar 17 15:03:32 2011 +0100
+
+    * when the mode change the geometries list is reset so emit the changed signal.
+
+ gui/pseudoaxesframe.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 76e7173875246dc28433bc8b936a477c78d465ed
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Mar 17 15:02:50 2011 +0100
+
+    * typo
+
+ hkl/hkl-geometry-factory.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit c43cbe14fe44fae630a8e8b07d7ec5f04d73a30c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Mar 17 15:02:43 2011 +0100
+
+    * add the MED2+2 geometry for the SOLEIL SIXS beamline
+
+ hkl/Makefile.am                      |  2 ++
+ hkl/hkl-geometry-factory.c           | 16 ++++++++++++
+ hkl/hkl-geometry-factory.h           |  3 ++-
+ hkl/hkl-geometry.h                   |  3 ++-
+ hkl/hkl-pseudoaxis-factory.c         |  5 ++++
+ hkl/hkl-pseudoaxis-soleil-sixs-med.c | 50 ++++++++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis-soleil-sixs-med.h | 33 ++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis.c           | 10 ++++++++
+ 8 files changed, 120 insertions(+), 2 deletions(-)
+
+commit 5146fd9cffd7956941595d6ee220ecf4804b9faa
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Mar 2 17:36:52 2011 +0100
+
+    * set up the error message handling in relevant part of the code.
+
+ hkl/hkl-macros.h                      |   2 +
+ hkl/hkl-pseudoaxis-auto.c             |  19 +++-
+ hkl/hkl-pseudoaxis-common-eulerians.c |  19 ++--
+ hkl/hkl-pseudoaxis-common-hkl.c       | 188 ++++++++++++++++++----------------
+ hkl/hkl-pseudoaxis-common-psi.c       |  26 +++--
+ hkl/hkl-pseudoaxis.c                  | 106 +++++++++----------
+ 6 files changed, 195 insertions(+), 165 deletions(-)
+
+commit 261677bca5893b2b76903178dd044177e21b0d6b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Mar 1 11:36:05 2011 +0100
+
+    * remove all references to HKL_SUCCESS and HKL_FAIL
+    
+    now we have only HKL_TRUE and HKL_FALSE. this is less error prone.
+
+ gui/hkl-gui-callbacks.cpp             | 10 +++----
+ gui/hkl-gui-pseudoaxes.cpp            |  4 +--
+ hkl/hkl-detector.c                    |  4 +--
+ hkl/hkl-geometry.c                    | 18 ++++++-------
+ hkl/hkl-lattice.c                     | 43 +++++++++++++++--------------
+ hkl/hkl-macros.h                      |  3 ---
+ hkl/hkl-parameter.c                   | 14 +++++-----
+ hkl/hkl-pseudoaxis-auto.c             | 20 +++++++-------
+ hkl/hkl-pseudoaxis-common-eulerians.c | 21 +++++++--------
+ hkl/hkl-pseudoaxis-common-hkl.c       | 42 +++++++++++------------------
+ hkl/hkl-pseudoaxis-common-psi.c       | 23 +++++++---------
+ hkl/hkl-pseudoaxis-common-q.c         |  4 +--
+ hkl/hkl-pseudoaxis-common.c           |  4 +--
+ hkl/hkl-pseudoaxis.c                  | 21 +++++++--------
+ hkl/hkl-quaternion.c                  |  2 +-
+ hkl/hkl-sample.c                      | 51 ++++++++++++++++-------------------
+ hkl/hkl-source.c                      |  4 +--
+ hkl/hkl-vector.c                      | 15 +++++------
+ test/hkl/bench-t.c                    |  2 +-
+ test/hkl/lattice-t.c                  | 12 ++++-----
+ test/hkl/parameter-t.c                | 12 ++++-----
+ test/hkl/pseudoaxis-e4ch-t.c          | 37 ++++++++++++-------------
+ test/hkl/pseudoaxis-e4cv-t.c          | 36 ++++++++++++-------------
+ test/hkl/pseudoaxis-e6c-t.c           | 22 +++++++--------
+ test/hkl/pseudoaxis-k4cv-t.c          | 18 ++++++-------
+ test/hkl/pseudoaxis-k6c-t.c           | 22 +++++++--------
+ test/hkl/pseudoaxis-t.c               |  8 +++---
+ test/hkl/pseudoaxis-zaxis-t.c         |  8 +++---
+ test/hkl/sample-t.c                   |  4 +--
+ test/tap/hkl.c                        |  2 +-
+ 30 files changed, 227 insertions(+), 259 deletions(-)
+
+commit 4c11dc3daa28d298eda62c7ea7c74aa41d7708f7
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Feb 28 17:40:50 2011 +0100
+
+    * HKL_FAIL = 0 -> HKL_FALSE
+    
+    next step remove the useless HKL_SUCCESS and HKL_FAIL macros.
+
+ hkl/hkl-macros.h |  2 +-
+ hkl/hkl-sample.c | 18 +++++++++---------
+ hkl/hkl-sample.h |  4 ++--
+ 3 files changed, 12 insertions(+), 12 deletions(-)
+
+commit e4004b70cf9d7745e93481165cc6c435ddfd5743
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Feb 28 17:01:09 2011 +0100
+
+    * HKL_SUCCESS -> HKL_TRUE preparation of the transition.
+
+ hkl/hkl-lattice.c             |  4 +--
+ hkl/hkl-macros.h              |  2 +-
+ hkl/hkl-parameter.c           |  2 +-
+ hkl/hkl-pseudoaxis-auto.c     |  4 +--
+ hkl/hkl-pseudoaxis.c          |  2 +-
+ hkl/hkl-sample.c              |  6 ++---
+ test/hkl/pseudoaxis-e4ch-t.c  | 62 +++++++++++++++++++++----------------------
+ test/hkl/pseudoaxis-e4cv-t.c  | 62 +++++++++++++++++++++----------------------
+ test/hkl/pseudoaxis-e6c-t.c   | 32 +++++++++++-----------
+ test/hkl/pseudoaxis-k4cv-t.c  | 22 +++++++--------
+ test/hkl/pseudoaxis-k6c-t.c   | 28 +++++++++----------
+ test/hkl/pseudoaxis-t.c       | 26 +++++++++---------
+ test/hkl/pseudoaxis-zaxis-t.c |  8 +++---
+ test/tap/hkl.c                |  4 +--
+ 14 files changed, 132 insertions(+), 132 deletions(-)
+
+commit 20fc9d38e3743aa055cbe4c081f3d4a3a596a7bb
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Feb 28 15:39:51 2011 +0100
+
+    * add the unit test methods
+
+ test/TESTS           |  1 +
+ test/hkl/Makefile.am |  1 +
+ test/hkl/unit-t.c    | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 59 insertions(+)
+
+commit f4dd9bfe29307b7a89a97928658b3566a6c78287
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Feb 25 14:48:19 2011 +0100
+
+    * do not use the tmpl file with gtk-doc
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 45fdea2ff3c2d65c44e700511825b92830827ae5
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Feb 25 14:47:43 2011 +0100
+
+    * document a bug requiring a so bump.
+
+ hkl/hkl-sample.c | 25 ++++++++++++++++++++++++-
+ 1 file changed, 24 insertions(+), 1 deletion(-)
+
+commit 5913fafd64ccd3e378a310d09f8406915861bafa
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Feb 25 14:46:36 2011 +0100
+
+    * remove a few mode warnings
+
+ hkl/hkl-pseudoaxis-auto.c             |  4 ++--
+ hkl/hkl-pseudoaxis-common-eulerians.c |  2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c       | 10 +++++-----
+ hkl/hkl-pseudoaxis-common-q.c         |  2 +-
+ hkl/hkl-sample.c                      |  2 +-
+ 5 files changed, 10 insertions(+), 10 deletions(-)
+
+commit 1192dcc87ecf9f59aa199b9ca78127e7093723ad
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Feb 25 11:57:13 2011 +0100
+
+    * fix most of the vc9 warnings
+
+ hkl/hkl-geometry.c                    | 2 +-
+ hkl/hkl-pseudoaxis-auto.c             | 2 +-
+ hkl/hkl-pseudoaxis-common-eulerians.c | 4 ++--
+ hkl/hkl-pseudoaxis-common-hkl.c       | 9 ++++-----
+ 4 files changed, 8 insertions(+), 9 deletions(-)
+
+commit fa07e8aef42b69c7ce1b27ee55c7ef248a69b097
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Feb 25 11:21:07 2011 +0100
+
+    * update the pom.xml
+
+ hkl/pom.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 5c052d22953d230bab4cb6d72c9b682960208d3c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Feb 25 11:18:44 2011 +0100
+
+    * avoid and API breakage.
+
+ hkl/hkl-pseudoaxis-common-hkl.c |  8 +++---
+ hkl/hkl-pseudoaxis-common-psi.c |  4 +--
+ hkl/hkl-pseudoaxis-common-q.c   |  4 +--
+ hkl/hkl-vector.c                | 59 +++++++++++++++++++++++++----------------
+ hkl/hkl-vector.h                |  7 +++--
+ test/hkl-test-vector.c          |  2 +-
+ 6 files changed, 50 insertions(+), 34 deletions(-)
+
+commit cd266ff75a1f2d6d1f11cfd1050e3d3151ba5e92
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Feb 24 17:31:52 2011 +0100
+
+    * pom.xml -> SNAPSHOT
+
+ hkl/pom.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 3e544e1abad9445e51a738ba9896d9ab171afdc4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Feb 24 17:25:38 2011 +0100
+
+    * backport the zaxis computation fix from the next branch
+
+ hkl/hkl-geometry.c              |  26 ++++
+ hkl/hkl-geometry.h              |   2 +
+ hkl/hkl-pseudoaxis-common-hkl.c | 298 +++++++++++++++++++++++++++++++++++++++-
+ hkl/hkl-pseudoaxis-common-hkl.h |   7 +
+ hkl/hkl-pseudoaxis-common-psi.c |   4 +-
+ hkl/hkl-pseudoaxis-common-q.c   |   4 +-
+ hkl/hkl-pseudoaxis-zaxis-hkl.c  |   2 +-
+ hkl/hkl-vector.c                |  94 +++++++++++--
+ hkl/hkl-vector.h                |  11 +-
+ test/hkl-test-vector.c          |   2 +-
+ 10 files changed, 430 insertions(+), 20 deletions(-)
+
+commit 2ee1e2d7ec73f8c074124e7d4ba69c13e72fc0a9
+Merge: a432c89 33a1243
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Feb 24 14:27:52 2011 +0100
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	hkl/hkl-pseudoaxis-common-hkl.c
+    	test/hkl/pseudoaxis-e6c-t.c
+
+commit 33a1243c4c40d8f2e3bafdaf4130ba325d48d7ee
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Feb 16 13:31:16 2011 +0100
+
+    * add mode parameters callbacks in ghkl
+
+ gui/pseudo.ui           | 14 ++++++++------
+ gui/pseudoaxesframe.cpp | 33 ++++++++++++++++++++++++++++-----
+ gui/pseudoaxesframe.h   | 19 +++++++++++++++++++
+ 3 files changed, 55 insertions(+), 11 deletions(-)
+
+commit e50499d2a68eb9914328624f9e9165f14a60a349
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Feb 24 11:32:41 2011 +0100
+
+    * better printout for the bench
+
+ test/bench.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit 5a4fefcb69b83b33761b0c0afcddc99ed8766aa4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Feb 24 11:32:25 2011 +0100
+
+    * typo
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 2 +-
+ hkl/hkl-vector.c                | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit c0005f74fa5e5fcc449a79a0a35e56782c8d0950
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Feb 24 11:32:13 2011 +0100
+
+    * proposition of fix for the petra3 psi_constant_vertical problem
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 43 +++++++++++++++++---------
+ hkl/hkl-vector.c                |  4 +--
+ test/hkl-test-pseudoaxis-e6c.c  | 68 +++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 98 insertions(+), 17 deletions(-)
+
+commit a432c89e28ac0ee41d269a1d00e84e48df23c047
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Feb 16 13:31:16 2011 +0100
+
+    * add mode parameters callbacks in ghkl
+
+ gui/hkl-gui-pseudoaxes.cpp | 33 ++++++++++++++++++++++++++++-----
+ gui/hkl-gui-pseudoaxes.h   | 19 +++++++++++++++++++
+ gui/pseudo.ui              | 14 ++++++++------
+ 3 files changed, 55 insertions(+), 11 deletions(-)
+
+commit 02f318c9ba5070cb033e4c5ed61662943e578515
+Merge: 5cde3bf e4dae97
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Feb 16 11:43:46 2011 +0100
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	hkl/pom.xml
+
+commit 5cde3bfbe96492f599afe967867a609da37fe10b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 31 16:29:36 2011 +0100
+
+    * usefull printf when a test fail in the pseudaxis-t method.
+
+ test/hkl/pseudoaxis-t.c | 43 +++++++++++++++++++++----------------------
+ 1 file changed, 21 insertions(+), 22 deletions(-)
+
+commit 50baf3426b140b636f68662687505423b6ea60d6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 31 16:28:58 2011 +0100
+
+    * use the set_hkl method also for the reflectivity mode of the zaxis
+
+ hkl/hkl-pseudoaxis-zaxis-hkl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit f5c81dc798fba1cf01873fcad0fd381bbdc99e3d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jan 31 16:28:25 2011 +0100
+
+    * silent the set_hkl method
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit bc6ff1c1937c9dcf1fcf31f18c559e405dc30c47
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jan 30 21:38:38 2011 +0100
+
+    * impreove a bit the set_hkl method
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 69 ++++++++++++++++++++++++++++++-----------
+ 1 file changed, 51 insertions(+), 18 deletions(-)
+
+commit 5ab51a0172f84b044118de230060c754ab6c1611
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jan 23 14:32:39 2011 -0500
+
+    * print information to stderr if the pseudoaxes test is ko.
+
+ test/hkl/pseudoaxis-t.c | 53 ++++++++++++++++++++++++++++++++-----------------
+ 1 file changed, 35 insertions(+), 18 deletions(-)
+
+commit a34af06c51888f8ad10e45919f51e93d0cb8839d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 16:58:35 2011 +0100
+
+    * update the TODO list.
+
+ TODO | 44 ++++++++++++++++++++++++--------------------
+ 1 file changed, 24 insertions(+), 20 deletions(-)
+
+commit b172eaca6ed415a1de3b3c360d8822979e54c980
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 16:57:42 2011 +0100
+
+    * the detector fit method works on 1 and 2 axes.
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit f9c085c0cf08090bba24de29d107693c256758b6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 16:02:59 2011 +0100
+
+    * silent pseudoaxis-zaxis-t program
+
+ test/hkl/pseudoaxis-zaxis-t.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit e2850cea9fc65fc4856dad0137f2d7418af05282
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 15:37:02 2011 +0100
+
+    * typo
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 764126e3189e8bb37452148a9ed79db5654d67ed
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 15:36:55 2011 +0100
+
+    * I forgot this change.
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit d0564128efe67761b48ee8605aeebe22dea6b691
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 15:28:53 2011 +0100
+
+    * prepare a generalisation of the new hkl set method solver
+    
+    for now this is not yet ready for adoption by all the other geometries.
+    especially for the degenerated case of the k6c geometries.
+    this method do not take into account the degenerated axes which cause
+    troubles. (need more investigation)
+
+ hkl/hkl-pseudoaxis-common-hkl.c | 268 +++++++++++++++++++++++++++++++++++++++-
+ hkl/hkl-pseudoaxis-common-hkl.h |   7 ++
+ hkl/hkl-pseudoaxis-zaxis-hkl.c  | 262 +--------------------------------------
+ 3 files changed, 272 insertions(+), 265 deletions(-)
+
+commit 03308b0c3cf418edbd1821c6a872fa14853299cf
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 14:47:26 2011 +0100
+
+    * better fit of the detector position
+
+ hkl/hkl-pseudoaxis-zaxis-hkl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 094cf3b362f18caa645d9e49e1d4e6143234cc34
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 14:45:04 2011 +0100
+
+    * correction in the DEBUG code
+
+ hkl/hkl-pseudoaxis-zaxis-hkl.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 29cfb476e82d9723a815dc9cf3bec06ea74adcf6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 13 11:34:20 2011 +0100
+
+    * remove useless code
+
+ hkl/hkl-pseudoaxis-zaxis-hkl.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+commit 7164580ee7c81c78e8afd17fc60dafb8fa1e11b9
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 11 17:11:52 2011 +0100
+
+    * update the zaxis figure with the right omega axis orientation
+
+ Documentation/figures/zaxis.asy | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 3dab73325902abd598c0db7eb46f1391065f84f2
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 11 17:06:33 2011 +0100
+
+    * now the test_engines method has a parameter for the number of tests
+
+ test/hkl/pseudoaxis-t.c | 25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+commit d6a18989e2c249dc9ff44cf7a8122ad525049ca1
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 11 17:05:28 2011 +0100
+
+    * update the zaxis mode. now it find more solutions.
+    
+    the idea is to use the ewalds sphere to generate a solution
+    from another one. (see the zaxis figure)
+
+ hkl/hkl-pseudoaxis-zaxis-hkl.c | 304 ++++++++++++++++++++++++++++++++---------
+ test/hkl/pseudoaxis-zaxis-t.c  |   3 +-
+ 2 files changed, 244 insertions(+), 63 deletions(-)
+
+commit e85ca0a6536ccfb33a2e95021356e62c86c2035b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jan 11 16:59:52 2011 +0100
+
+    * add oriented_angle_points, rotated_around_line, modify project_on_plan
+
+ hkl/hkl-pseudoaxis-common-hkl.c |  4 +-
+ hkl/hkl-pseudoaxis-common-psi.c |  4 +-
+ hkl/hkl-pseudoaxis-common-q.c   |  4 +-
+ hkl/hkl-vector.c                | 95 ++++++++++++++++++++++++++++++++++++-----
+ hkl/hkl-vector.h                | 11 ++++-
+ test/hkl/vector-t.c             | 55 +++++++++++++++++++++++-
+ 6 files changed, 153 insertions(+), 20 deletions(-)
+
+commit b1e64ea2b35dccdb46905c9a6088c387d29ce24e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jan 9 05:02:06 2011 -0500
+
+    * povray -> asymptote figure
+
+ Documentation/figures/B_a.asy     | 26 ++++++++++++++
+ Documentation/figures/B_a.pov     | 73 ---------------------------------------
+ Documentation/figures/B_a.py      | 43 -----------------------
+ Documentation/figures/Makefile.am |  4 +--
+ 4 files changed, 28 insertions(+), 118 deletions(-)
+
+commit 8b87f5cd4cd032a095bff175c813cb86ee97faee
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jan 8 07:12:43 2011 -0500
+
+    * switch to c-tap-harness 1.6
+    
+    now they added an epsilon in the is_double check, so we
+    can use it instead of my is_double_epsilon
+
+ test/hkl/axis-t.c       |  40 +++++++++---------
+ test/hkl/geometry-t.c   |  28 ++++++-------
+ test/hkl/interval-t.c   |   4 +-
+ test/hkl/lattice-t.c    | 108 ++++++++++++++++++++++++------------------------
+ test/hkl/matrix-t.c     |  18 ++++----
+ test/hkl/parameter-t.c  |  12 +++---
+ test/hkl/quaternion-t.c |  16 +++----
+ test/hkl/sample-t.c     |  62 +++++++++++++--------------
+ test/hkl/source-t.c     |  12 +++---
+ test/hkl/vector-t.c     |  30 +++++++-------
+ test/runtests.c         |  66 +++++++++++++++++++----------
+ test/tap/basic.c        |  87 ++++++++++++++++++++++----------------
+ test/tap/basic.h        |  23 +++++++++--
+ test/tap/libtap.sh      |  65 ++++++++++++++++++++++++-----
+ 14 files changed, 334 insertions(+), 237 deletions(-)
+
+commit f07df8b98a347c403e4534544b4e5ec73f972ff0
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jan 8 06:55:21 2011 -0500
+
+    * update the zaxis figure and generate pdf instead of png
+    
+    the png generated files where ugly and depends of a working X
+    server. This should FTBFS during the debian package build (no X
+    available). Now we have nice vertorial 3D figures.
+
+ Documentation/figures/Makefile.am |  7 ++++---
+ Documentation/figures/zaxis.asy   | 34 ++++++++++++++--------------------
+ 2 files changed, 18 insertions(+), 23 deletions(-)
+
+commit c49422e6e39413950a4ba176a091ce08534938b6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jan 6 14:30:03 2011 +0100
+
+    * update the zaxis figure and integrate it to the buildsystem.
+
+ Documentation/figures/Makefile.am |  8 ++++--
+ Documentation/figures/zaxis.asy   | 59 ++++++++++++++++++++++++---------------
+ README                            | 12 ++++----
+ configure.ac                      |  6 ++++
+ 4 files changed, 55 insertions(+), 30 deletions(-)
+
+commit 5054481f1af5856b70571f61bbd4030238fe4f3a
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Dec 13 02:25:57 2010 -0500
+
+    * improve the zaxis figure.
+
+ Documentation/figures/zaxis.asy | 55 ++++++++++++++++++++++++++++-------------
+ 1 file changed, 38 insertions(+), 17 deletions(-)
+
+commit 8186328c020d63405689e03dedfc002bbd9e3c79
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Nov 28 16:25:08 2010 -0500
+
+    * work in progress for the zaxis solver
+
+ Documentation/figures/zaxis.asy | 43 +++++++++++++++++++++
+ hkl/hkl-pseudoaxis-zaxis-hkl.c  | 83 ++++++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 125 insertions(+), 1 deletion(-)
+
+commit 329b9f9f3fc9b7f0eb9d49a1f198cef1a7ed22a9
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Nov 25 10:05:29 2010 +0100
+
+    * update the TODO
+
+ TODO | 55 ++++++++++++++++++++++++++++++++++---------------------
+ 1 file changed, 34 insertions(+), 21 deletions(-)
+
+commit 4cbfc3f564bfdba49d0e3d5ad0692d87acde5559
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Nov 25 09:35:06 2010 +0100
+
+    * add the eulerian test in the bench
+
+ test/hkl/bench-t.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 71d803ba843d2674da40376d1daa132b70f44d32
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Nov 24 11:37:19 2010 +0100
+
+    * now lcov works also with the 1.9 version
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 20b16aa131a4252802c9abfcd4437328ec3fcad6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Nov 23 16:51:54 2010 +0100
+
+    * remove a tabulation indentation.
+    
+    it is not allow to use tabulation in the middle of a comment.
+
+ test/hkl/pseudoaxis-e4ch-t.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 6f45b5678f490b7e5f4a8d76603ff07325b877f9
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Nov 23 16:50:25 2010 +0100
+
+    * remove useless comments
+
+ test/hkl/pseudoaxis-e4ch-t.c | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+commit 64f38716412610eaf93c5209c4822e549ffa605c
+Author: Jens Krüger <jens.krueger at frm2.tum.de>
+Date:   Mon Nov 22 11:30:09 2010 +0100
+
+    Improve the use of the povray program.
+    
+    If the configure run does not detect the povray program the echo
+    program will be used as povray.
+
+ Documentation/figures/Makefile.am | 6 ++++--
+ configure.ac                      | 2 +-
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+commit 6f592595064b37cbcef394f18576a037e78c3ff2
+Author: Jens Krüger <jens.krueger at frm2.tum.de>
+Date:   Mon Nov 22 11:30:08 2010 +0100
+
+    Add a first test for the E4CH.
+
+ autogen.sh                   |   2 +-
+ configure.ac                 |   2 +-
+ test/TESTS                   |   1 +
+ test/hkl/Makefile.am         |   3 +-
+ test/hkl/pseudoaxis-e4ch-t.c | 430 +++++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 435 insertions(+), 3 deletions(-)
+
+commit e4dae97e5b495eaf713c24dc5a38aea1884bbe56
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Nov 12 13:50:02 2010 +0100
+
+    * reduce the number of iteration before randomizing the starting point
+    
+    When we try to find the first solution, the starting
+    point is the current position of the diffractometer.
+    If after 100 iterations nothing was found. Just randomize the
+    axes of the diffractometer and restart from this new point.
+
+ hkl/hkl-pseudoaxis-auto.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit e6693cd3194420c9c481160e9bc8bcc76dac08e4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Oct 22 11:15:31 2010 +0200
+
+    * add a zaxis dedicated test method for the hkl pseudo axis
+
+ test/TESTS                    |  1 +
+ test/hkl/Makefile.am          |  3 +-
+ test/hkl/pseudoaxis-zaxis-t.c | 99 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 102 insertions(+), 1 deletion(-)
+
+commit b6cf0a892257baaf69a2682bf9c6ebcf15068ee8
+Author: Jens Krüger <jens.krueger at frm2.tum.de>
+Date:   Mon Sep 13 09:21:52 2010 +0200
+
+    FIX: error message if m4 directory exists.
+
+ autogen.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit c6f2b24df6b3b32c4605592d3c0f4349e873c24f
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 22:53:35 2010 +0200
+
+    * add the --disable-gui and --disable-hkl3d
+
+ Makefile.am  |  2 +-
+ NEWS         |  3 ++-
+ configure.ac | 14 +++++++-------
+ 3 files changed, 10 insertions(+), 9 deletions(-)
+
+commit 62b405325256f95168478e40d17220307acb68ad
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 22:21:16 2010 +0200
+
+    * update the NEWS file
+
+ NEWS | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+commit a8206186daf65a1e209d39506aa03710d6574da8
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 22:13:38 2010 +0200
+
+    * remove an useless precision problem
+
+ test/hkl/pseudoaxis-k6c-t.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit 5ff08efbb0df64637b5bed41052b7bd37f2a8ec5
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 22:07:34 2010 +0200
+
+    * typo
+
+ hkl/hkl-geometry.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit f94484394fe7c839f7b809f7b7fa779abadcce9e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 22:07:28 2010 +0200
+
+    * remove useless methodes of the HklGeometryList
+
+ gui/hkl-gui.cpp              |  2 +-
+ hkl/hkl-geometry.c           | 12 ------------
+ hkl/hkl-geometry.h           |  4 ----
+ hkl/hkl-pseudoaxis.c         |  4 ++--
+ test/hkl/pseudoaxis-e4cv-t.c |  2 +-
+ test/hkl/pseudoaxis-e6c-t.c  |  4 ++--
+ test/hkl/pseudoaxis-k4cv-t.c |  4 ++--
+ test/hkl/pseudoaxis-k6c-t.c  |  4 ++--
+ test/hkl/pseudoaxis-t.c      |  6 +-----
+ 9 files changed, 11 insertions(+), 31 deletions(-)
+
+commit 4485226ba023255766d959984396a37b60adaf86
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 19:53:32 2010 +0200
+
+    * add the SOLEIL MARS beamline diffractometer
+
+ Documentation/hkl.texi       | 111 +++++++++----------------------------------
+ hkl/hkl-geometry-factory.c   |  18 +++++++
+ hkl/hkl-geometry-factory.h   |   1 +
+ hkl/hkl-geometry.h           |   3 +-
+ hkl/hkl-pseudoaxis-factory.c |   1 +
+ test/hkl/pseudoaxis-t.c      |   9 ++++
+ 6 files changed, 54 insertions(+), 89 deletions(-)
+
+commit 98d08f4964aae08879896b401588400e7ee5b961
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 18:08:24 2010 +0200
+
+    * remove all SET_AXES macros
+
+ hkl/hkl-geometry.c           | 18 ++++++++++++++++++
+ hkl/hkl-geometry.h           |  2 ++
+ test/hkl/bench-t.c           | 12 +-----------
+ test/hkl/geometry-t.c        | 22 +++++++++++++++++++++-
+ test/hkl/pseudoaxis-e4cv-t.c | 26 +++++++++-----------------
+ test/hkl/pseudoaxis-e6c-t.c  | 22 ++++++----------------
+ test/hkl/pseudoaxis-k4cv-t.c | 10 +---------
+ test/hkl/pseudoaxis-k6c-t.c  | 14 ++------------
+ 8 files changed, 60 insertions(+), 66 deletions(-)
+
+commit 35a211876f44923115ee3e79d1fd9f4596900ea3
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 17:07:47 2010 +0200
+
+    * fix tests when compiled with something different than gcc.
+    
+    due to rounding errors, the number of valid test in the pseudoaxes part
+    were not always the same from one platform to the other.
+
+ test/hkl/pseudoaxis-e4cv-t.c | 132 +++++++++++++++----------------------
+ test/hkl/pseudoaxis-e6c-t.c  |  66 +++++++------------
+ test/hkl/pseudoaxis-k4cv-t.c |  69 +++++++-------------
+ test/hkl/pseudoaxis-k6c-t.c  | 152 ++++++++-----------------------------------
+ test/hkl/pseudoaxis-t.c      |  46 +++++++------
+ test/tap/Makefile.am         |   7 +-
+ test/tap/hkl.c               |  40 ++++++++++++
+ test/tap/hkl.h               |  34 ++++++++++
+ 8 files changed, 230 insertions(+), 316 deletions(-)
+
+commit 330628dcbe352e93c2dd6f717988d3b2c064d9f7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 14:50:29 2010 +0200
+
+    * indentation
+
+ test/hkl/pseudoaxis-t.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+commit d3c5fc094557e7d18543a205f2256bbc04546c41
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Sep 23 14:49:50 2010 +0200
+
+    * remove C++ comment format
+
+ hkl3d/hkl3d.cpp | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
+
+commit 80e405011234893f28948702a239a339214c9929
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 21 21:50:33 2010 +0200
+
+    * remove the useless Hkl3D _context member.
+
+ hkl3d/hkl3d.cpp | 4 ----
+ hkl3d/hkl3d.h   | 1 -
+ 2 files changed, 5 deletions(-)
+
+commit 067a699d7092b780139168a4b9ce40be85376917
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 21 21:46:53 2010 +0200
+
+    * only renames
+
+ gui/hkl-gui-3d.cpp            |  30 ++++----
+ gui/hkl-gui-3d.h              |   4 +-
+ gui/hkl3d/hkl3d-gui-model.cpp |  34 ++++-----
+ hkl3d/hkl3d.cpp               | 165 +++++++++++++++++++++---------------------
+ hkl3d/hkl3d.h                 |  38 +++++-----
+ test/hkl3d/test-t.c           |  16 ++--
+ 6 files changed, 143 insertions(+), 144 deletions(-)
+
+commit e47e17e1fa5a0ea639ca05a78eb7e5a6c9880d81
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 21 20:53:56 2010 +0200
+
+    * put the model in the Hkl3Config.
+
+ hkl3d/hkl3d.cpp | 39 ++++++++++++++++++++++-----------------
+ hkl3d/hkl3d.h   |  1 +
+ 2 files changed, 23 insertions(+), 17 deletions(-)
+
+commit c59926b8e20392de4a83b0c57a3378361268401c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 21 19:41:21 2010 +0200
+
+    * add a config reference in the Hkl3DObject to simplify the code
+
+ hkl3d/hkl3d.cpp | 35 +++++++++++++++--------------------
+ hkl3d/hkl3d.h   |  2 +-
+ 2 files changed, 16 insertions(+), 21 deletions(-)
+
+commit 7029b31556630d19793e34a3b79bf58f22b204c7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 21 19:40:43 2010 +0200
+
+    * typo
+
+ hkl3d/hkl3d.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit b4e0b0c91136dfbc82558ab855ab27bf4b6d5a5f
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 21 19:40:26 2010 +0200
+
+    * try to clarify the hkl3d_connect_object_to_axis method.
+
+ hkl3d/hkl3d.cpp | 47 ++++++++++++++++++++++++-----------------------
+ hkl3d/hkl3d.h   |  2 +-
+ 2 files changed, 25 insertions(+), 24 deletions(-)
+
+commit 3991d9015f2af9d6ee55495ce46c7cb2b184dadb
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 21 16:35:39 2010 +0200
+
+    * rewrote the hkl3d_axis_detach_object
+
+ hkl3d/hkl3d.cpp     | 31 ++++++++++++-------------------
+ test/hkl3d/test-t.c |  1 +
+ 2 files changed, 13 insertions(+), 19 deletions(-)
+
+commit 179d2d73a6ce7d3a499c3f56cbc63c24ba315b66
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon Sep 20 17:10:14 2010 +0200
+
+    * remove the hkl3d_geometry_remove_object method
+
+ hkl3d/hkl3d.cpp | 34 ++++++++++------------------------
+ hkl3d/hkl3d.h   |  1 +
+ 2 files changed, 11 insertions(+), 24 deletions(-)
+
+commit fe9146efc6a007cfa2eaf6e06505b51927e0804b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 12:31:07 2010 +0200
+
+    * remove an useless variable
+
+ hkl3d/hkl3d.cpp     | 9 ++++-----
+ hkl3d/hkl3d.h       | 1 -
+ test/hkl3d/test-t.c | 2 +-
+ 3 files changed, 5 insertions(+), 7 deletions(-)
+
+commit 6510d4a3f3df15e641e473cbcdfeed1f0707fd2e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 12:11:48 2010 +0200
+
+    * better explaination of the apply_transformation algo
+
+ hkl3d/hkl3d.cpp | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+commit 64a485565afe853b49dd526cf873ea2ef2594e9c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 11:55:15 2010 +0200
+
+    * typo
+
+ hkl3d/hkl3d.cpp | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+commit 7efe4c658bdb42d7078bf94d0e2abec615a1da99
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 11:34:06 2010 +0200
+
+    * remove useless variable
+
+ hkl3d/hkl3d.cpp | 1 -
+ hkl3d/hkl3d.h   | 1 -
+ 2 files changed, 2 deletions(-)
+
+commit 68d2be8dd2dd5e3d0ba6149f9bf253c978eb1c10
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 11:33:56 2010 +0200
+
+    * move the apply transformation from Hkl3D to Hkl3DGeometry
+
+ hkl3d/hkl3d.cpp | 61 +++++++++++++++++++++++++++++++--------------------------
+ hkl3d/hkl3d.h   |  2 +-
+ 2 files changed, 34 insertions(+), 29 deletions(-)
+
+commit 134318d0136ff49f00cb34056cec1766796482e6
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 11:18:22 2010 +0200
+
+    * move the HklGeometry in the Hkl3DGeometry
+
+ hkl3d/hkl3d.cpp     | 49 ++++++++++++++++++++++++-------------------------
+ hkl3d/hkl3d.h       |  4 ++--
+ test/hkl3d/test-t.c | 14 +++++++-------
+ 3 files changed, 33 insertions(+), 34 deletions(-)
+
+commit 986660920a9b54e784945cc83d48b2ff1d819c08
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 10:44:16 2010 +0200
+
+    * doc: explain why only one model instead of one per filename
+
+ hkl3d/hkl3d.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit ea97ef1479de60d63e73bc90bd9cf4fd3d9edf11
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 10:35:11 2010 +0200
+
+    * replace the meaningless init_internal with a config constructor
+    
+    easier to understand
+
+ hkl3d/hkl3d.cpp | 91 +++++++++++++++++++++++++--------------------------------
+ 1 file changed, 40 insertions(+), 51 deletions(-)
+
+commit a8d26c6c7812915fc5f1453c262ce698c6b630e9
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Sep 18 10:02:43 2010 +0200
+
+    * declare typedef for all struct and use it.
+
+ gui/hkl3d/hkl3d-gui-model.cpp |   6 +--
+ gui/hkl3d/hkl3d-gui-model.h   |   8 +--
+ gui/hkl3d/hkl3d-gui-scene.cpp |   2 +-
+ gui/hkl3d/hkl3d-gui-scene.h   |   2 +-
+ hkl3d/hkl3d.cpp               | 122 +++++++++++++++++++++---------------------
+ hkl3d/hkl3d.h                 |  80 ++++++++++++++-------------
+ test/hkl3d/test-t.c           |  12 ++---
+ 7 files changed, 120 insertions(+), 112 deletions(-)
+
+commit 7402e4e761d2730005337bdf03b121c28e54d81d
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Tue Sep 7 10:17:04 2010 +0200
+
+    * now the bench test take an argument for the number of iteration
+    
+    bench-t n
+
+ test/hkl/bench-t.c | 21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+commit f35055c053d0713c8b939b81d2ea69b63676bdef
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 30 16:31:25 2010 +0200
+
+    * release the 4.0.3 for soleil
+
+ hkl/pom.xml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit be344c27456256f466bae55ebea866ea6eae0d9b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 29 13:15:31 2010 +0200
+
+    * typo
+
+ hkl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 4e1415b78d28dadeccb711e860610a76a6cb7e46
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 29 13:12:04 2010 +0200
+
+    * refactoring of the hkl3d tests
+
+ test/Makefile.am                    |   4 +-
+ test/TESTS                          |  18 ++
+ test/hkl/Makefile.am                |  55 ++--
+ test/hkl/axis-t.c                   | 171 +++++++++++++
+ test/hkl/bench-t.c                  | 220 ++++++++++++++++
+ test/hkl/bench.c                    | 219 ----------------
+ test/hkl/detector-t.c               |  97 +++++++
+ test/hkl/error-t.c                  | 120 +++++++++
+ test/hkl/geometry-t.c               | 307 ++++++++++++++++++++++
+ test/hkl/hkl-test-axis.c            | 184 --------------
+ test/hkl/hkl-test-detector.c        | 106 --------
+ test/hkl/hkl-test-error.c           | 135 ----------
+ test/hkl/hkl-test-geometry.c        | 328 ------------------------
+ test/hkl/hkl-test-interval.c        | 345 -------------------------
+ test/hkl/hkl-test-lattice.c         | 237 -----------------
+ test/hkl/hkl-test-matrix.c          | 169 ------------
+ test/hkl/hkl-test-parameter.c       | 141 ----------
+ test/hkl/hkl-test-pseudoaxis-e4cv.c | 479 ----------------------------------
+ test/hkl/hkl-test-pseudoaxis-e6c.c  | 255 -------------------
+ test/hkl/hkl-test-pseudoaxis-k4cv.c | 271 --------------------
+ test/hkl/hkl-test-pseudoaxis-k6c.c  | 392 ----------------------------
+ test/hkl/hkl-test-pseudoaxis.c      | 201 ---------------
+ test/hkl/hkl-test-quaternion.c      | 178 -------------
+ test/hkl/hkl-test-sample.c          | 494 ------------------------------------
+ test/hkl/hkl-test-source.c          | 105 --------
+ test/hkl/hkl-test-vector.c          | 219 ----------------
+ test/hkl/hkl-test.c                 | 108 --------
+ test/hkl/hkl-test.h                 | 115 ---------
+ test/hkl/interval-t.c               | 315 +++++++++++++++++++++++
+ test/hkl/lattice-t.c                | 222 ++++++++++++++++
+ test/hkl/main-t.c                   |  56 ++++
+ test/hkl/main.c                     |  56 ----
+ test/hkl/matrix-t.c                 | 150 +++++++++++
+ test/hkl/parameter-t.c              | 130 ++++++++++
+ test/hkl/pseudoaxis-e4cv-t.c        | 462 +++++++++++++++++++++++++++++++++
+ test/hkl/pseudoaxis-e6c-t.c         | 244 ++++++++++++++++++
+ test/hkl/pseudoaxis-k4cv-t.c        | 260 +++++++++++++++++++
+ test/hkl/pseudoaxis-k6c-t.c         | 376 +++++++++++++++++++++++++++
+ test/hkl/pseudoaxis-t.c             | 191 ++++++++++++++
+ test/hkl/quaternion-t.c             | 157 ++++++++++++
+ test/hkl/sample-t.c                 | 465 +++++++++++++++++++++++++++++++++
+ test/hkl/source-t.c                 |  92 +++++++
+ test/hkl/vector-t.c                 | 192 ++++++++++++++
+ test/hkl3d/Makefile.am              |   4 +-
+ test/hkl3d/main.c                   | 157 ------------
+ test/hkl3d/test-t.c                 | 157 ++++++++++++
+ test/tap/basic.c                    |  26 ++
+ test/tap/basic.h                    |   2 +
+ 48 files changed, 4457 insertions(+), 4930 deletions(-)
+
+commit 6a97e3558f1ec75575f025d7427eed5d121171e7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Aug 28 14:59:18 2010 +0200
+
+    * remove a dependency to glut
+
+ configure.ac          | 4 +---
+ gui/hkl3d/Makefile.am | 3 +--
+ 2 files changed, 2 insertions(+), 5 deletions(-)
+
+commit 329c7062d4772264c7d493bf25df2cf873575a80
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Aug 28 14:08:09 2010 +0200
+
+    * import c-tap-hardness 1.5
+
+ test/runtests.c    | 2 +-
+ test/tap/libtap.sh | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 6af0f383fe5e796eb8803b742f541335670b2ca0
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 22:28:28 2010 +0200
+
+    * reduce the size of the hkl3d_xxx_free methods
+
+ hkl3d/hkl3d.cpp | 23 +++++++++--------------
+ 1 file changed, 9 insertions(+), 14 deletions(-)
+
+commit c3d20a93466d6626d260f5c470d7e6fa2a7d15ff
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 22:27:59 2010 +0200
+
+    * better check in hkl3d_config_add_object
+
+ hkl3d/hkl3d.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 8d0f4c5992ffcdde3711d29ac5981cb8ee87d4d4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 18:27:14 2010 +0200
+
+    * remove a few memory leaks (still one in g3d)
+
+ hkl3d/hkl3d.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit a7d853d115a3578a0981ae59e28cdf9b08d41910
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 18:09:47 2010 +0200
+
+    * remove a valgrind warning
+
+ hkl3d/hkl3d.cpp | 97 +++++++++++++++++++++++++++------------------------------
+ 1 file changed, 46 insertions(+), 51 deletions(-)
+
+commit e1ebd20e48a9048361752d23bf8beb9cc410e903
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 16:43:34 2010 +0200
+
+    * now we can remove object from ghkl
+
+ gui/hkl-gui-3d.cpp | 17 +++++++++++++++++
+ hkl3d/hkl3d.cpp    | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ hkl3d/hkl3d.h      |  3 ++-
+ 3 files changed, 70 insertions(+), 1 deletion(-)
+
+commit 491109a5b6c75d908cd2c35886c7da953234066d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 16:23:42 2010 +0200
+
+    * doc
+
+ hkl3d/hkl3d.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a8832b4fd39fc816de4e426619c15f70405db567
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 15:32:00 2010 +0200
+
+    * add the fprintf method for all structures
+
+ hkl3d/hkl3d.cpp | 46 ++++++++++++++++++++++++++++++++++++++++++++++
+ hkl3d/hkl3d.h   |  2 ++
+ 2 files changed, 48 insertions(+)
+
+commit 4af730a5b3991e1d8d53231d58cb940e62ee8e16
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 15:31:18 2010 +0200
+
+    * typo
+
+ hkl3d/hkl3d.cpp | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 36af9ab091f83eb0371c70a556eddc25fbac3fb9
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 15:30:45 2010 +0200
+
+    * remove a memory leak
+
+ hkl3d/hkl3d.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit f25ffa571aef39746d317d7ed85bad56c7a3e24d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 14:58:52 2010 +0200
+
+    * change the Hkl3DConfig internals and add a test to verify thaht everithings is ok
+
+ gui/hkl-gui-3d.cpp            |  10 +-
+ gui/hkl3d/hkl3d-gui-model.cpp |  22 ++---
+ hkl3d/hkl3d.cpp               | 217 +++++++++++++++++++++---------------------
+ hkl3d/hkl3d.h                 |   2 +-
+ test/hkl3d/main.c             |  13 ++-
+ 5 files changed, 132 insertions(+), 132 deletions(-)
+
+commit b10c562e70454c22b72494671a6229396920c795
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 25 11:57:35 2010 +0200
+
+    * change the Hkl3DConfigs structure.
+
+ gui/hkl-gui-3d.cpp            | 18 +++++++-------
+ gui/hkl3d/hkl3d-gui-model.cpp | 26 +++++++++----------
+ hkl3d/hkl3d.cpp               | 58 +++++++++++++++++++++++++++----------------
+ hkl3d/hkl3d.h                 |  2 +-
+ test/hkl3d/main.c             | 12 ++++-----
+ 5 files changed, 66 insertions(+), 50 deletions(-)
+
+commit cd6a1664a8373e83e826eb0a2d22db7fa3c76d46
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 24 17:59:42 2010 +0200
+
+    * remove the standalone ghkl3d application
+
+ gui/hkl3d/Makefile.am               |  10 --
+ gui/hkl3d/ghkl3d.ui                 | 218 ------------------------------------
+ gui/hkl3d/hkl3d-gui-application.cpp | 201 ---------------------------------
+ gui/hkl3d/hkl3d-gui-application.h   |  81 --------------
+ gui/hkl3d/main.cpp                  |  64 -----------
+ 5 files changed, 574 deletions(-)
+
+commit 535978c05b1e1730df37ff98ac6e28cbda76ef48
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 24 17:34:53 2010 +0200
+
+    * remove the convex decomposition, (does not work for now)
+
+ configure.ac                                       |    2 -
+ hkl3d/ConvexDecomposition/ConvexBuilder.cpp        |  373 ---
+ hkl3d/ConvexDecomposition/ConvexBuilder.h          |  112 -
+ hkl3d/ConvexDecomposition/ConvexDecomposition.cpp  |  375 ---
+ hkl3d/ConvexDecomposition/ConvexDecomposition.h    |  220 --
+ hkl3d/ConvexDecomposition/Makefile.am              |   43 -
+ hkl3d/ConvexDecomposition/bestfit.cpp              |  466 ---
+ hkl3d/ConvexDecomposition/bestfit.h                |   65 -
+ hkl3d/ConvexDecomposition/bestfitobb.cpp           |  173 --
+ hkl3d/ConvexDecomposition/bestfitobb.h             |   43 -
+ hkl3d/ConvexDecomposition/cd_hull.cpp              | 3257 --------------------
+ hkl3d/ConvexDecomposition/cd_hull.h                |  153 -
+ hkl3d/ConvexDecomposition/cd_vector.h              | 1185 -------
+ hkl3d/ConvexDecomposition/cd_wavefront.cpp         |  860 ------
+ hkl3d/ConvexDecomposition/cd_wavefront.h           |   62 -
+ hkl3d/ConvexDecomposition/concavity.cpp            |  795 -----
+ hkl3d/ConvexDecomposition/concavity.h              |   60 -
+ hkl3d/ConvexDecomposition/fitsphere.cpp            |  202 --
+ hkl3d/ConvexDecomposition/fitsphere.h              |   43 -
+ hkl3d/ConvexDecomposition/float_math.cpp           |  257 --
+ hkl3d/ConvexDecomposition/float_math.h             |   72 -
+ hkl3d/ConvexDecomposition/meshvolume.cpp           |  128 -
+ hkl3d/ConvexDecomposition/meshvolume.h             |   45 -
+ hkl3d/ConvexDecomposition/planetri.cpp             |  238 --
+ hkl3d/ConvexDecomposition/planetri.h               |   58 -
+ hkl3d/ConvexDecomposition/raytri.cpp               |  134 -
+ hkl3d/ConvexDecomposition/raytri.h                 |   45 -
+ hkl3d/ConvexDecomposition/splitplane.cpp           |  306 --
+ hkl3d/ConvexDecomposition/splitplane.h             |   59 -
+ hkl3d/ConvexDecomposition/vlookup.cpp              |  307 --
+ hkl3d/ConvexDecomposition/vlookup.h                |  119 -
+ hkl3d/GIMPACTUtils/Makefile.am                     |   18 -
+ .../btGImpactConvexDecompositionShape.cpp          |  234 --
+ .../btGImpactConvexDecompositionShape.h            |   87 -
+ hkl3d/Makefile.am                                  |    8 +-
+ 35 files changed, 2 insertions(+), 10602 deletions(-)
+
+commit 65c80bb849da385e006d633b402e41c0097ede7e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 24 12:00:53 2010 +0200
+
+    * typo
+
+ hkl3d/hkl3d.cpp | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+commit b37719a168b4540d92eed83575037a401a72cf65
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 24 11:39:10 2010 +0200
+
+    * remove useless code
+
+ hkl3d/hkl3d.cpp | 2 --
+ 1 file changed, 2 deletions(-)
+
+commit f9fd5b895f4cb07384f32500d99c430a36e792a3
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 24 11:30:05 2010 +0200
+
+    * refactor the hkl3d test methods
+
+ test/hkl3d/main.c | 151 +++++++++++++++++++++++++++++++-----------------------
+ 1 file changed, 86 insertions(+), 65 deletions(-)
+
+commit 5f2a8a8ee65f7b3706da5601bbc5193824a6511e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 24 10:21:18 2010 +0200
+
+    * add a method to get the collision calculation time in millisecond
+
+ hkl3d/hkl3d.cpp   | 9 +++++++--
+ hkl3d/hkl3d.h     | 1 +
+ test/hkl3d/main.c | 9 ++++++---
+ 3 files changed, 14 insertions(+), 5 deletions(-)
+
+commit 99a62466b0a463340003d0b63938237af3061a68
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 23 16:06:34 2010 +0200
+
+    * add a few DIFFABS model validation tests
+
+ test/hkl3d/main.c | 33 ++++++++++++++++++++++++++++++++-
+ 1 file changed, 32 insertions(+), 1 deletion(-)
+
+commit 7bbd3c70f2c940256680cbeab26c553c813c37ad
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 23 15:33:09 2010 +0200
+
+    * better test for the collision.
+
+ test/hkl3d/main.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+commit 79d7246d60f1fb570b74708b067c8c26af1b3093
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 23 15:10:41 2010 +0200
+
+    * fix a bug in the save config method
+
+ hkl3d/hkl3d.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 9bf19d187656ac639860b99a0adbdb12f01b4723
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 23 15:10:00 2010 +0200
+
+    * update the DIFFABS MODEL to pass all the tests
+
+ data/diffabs.dae  | 266 +++++++++++++++++++++++++++---------------------------
+ data/diffabs.yaml |  22 ++---
+ 2 files changed, 144 insertions(+), 144 deletions(-)
+
+commit d85f06702c044d985eb1d0c7f0f63b89e6854360
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 22 16:27:37 2010 +0200
+
+    * add an lcov target to check the coverage of hkl
+
+ Makefile.am  | 23 +++++++++++++++++++
+ configure.ac | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 95 insertions(+)
+
+commit a3516e201274ca21ea07869b802bc1d27be9b215
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 22 11:34:49 2010 +0200
+
+    * no need to check for enable_xxx values.
+
+ configure.ac | 28 +++++++++++-----------------
+ 1 file changed, 11 insertions(+), 17 deletions(-)
+
+commit 936e7e66956879b5c4917384792f912517e0fbae
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 22 10:46:42 2010 +0200
+
+    * really check for the yaml usability
+
+ configure.ac | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+commit 838d6f296af375dedd10dcc4f22c35da680013d7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 22 10:46:20 2010 +0200
+
+    * better presentation of the configure.ac
+
+ configure.ac | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+commit 84fc138155c6f236b08dd825e2e3e44a0c8036c5
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 22 10:29:23 2010 +0200
+
+    * update to autoconf 2.67
+
+ configure.ac | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+commit 9af196bc82163193f8c446858a931515b973542b
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Aug 22 10:28:13 2010 +0200
+
+    * autoupdate a part of the configure.ac
+
+ configure.ac | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+commit d0ff750037b5a8365c5ad54a2c593d6c0cdc5629
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Aug 21 14:08:06 2010 +0200
+
+    * remove a bunch of clang warnings
+
+ hkl/hkl-sample.c             |  2 +-
+ test/hkl/hkl-test-axis.c     | 12 ++++++------
+ test/hkl/hkl-test-geometry.c |  2 +-
+ test/hkl/hkl-test-interval.c |  4 ++--
+ 4 files changed, 10 insertions(+), 10 deletions(-)
+
+commit 84669e2c7228dc94c61eaa43524d03700c693c41
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Aug 21 11:53:36 2010 +0200
+
+    * remove two memory leaks.
+    
+    still one memory leak in the add_model_from_file, when
+    we concatenate two G3DModels.
+
+ hkl3d/hkl3d.cpp | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+commit aefe7ec0f60d90492916260c924fd66bb1e594e5
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 17:11:34 2010 +0200
+
+    * write the unit test for the diffabs diffractometer.
+    
+    for now the test failed but, I need to understand what
+    is the problem with the 3D model.
+
+ test/hkl3d/main.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+commit 53ff9d7b6bcdfea9d9b6a4e7fcb4b806672905f6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 17:00:59 2010 +0200
+
+    * remove useless code.
+
+ hkl3d/hkl3d.cpp | 4 ----
+ 1 file changed, 4 deletions(-)
+
+commit da26280098cb73ae4ebf856987757649afc8936f
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 16:47:08 2010 +0200
+
+    *correct a bug in the check collision part
+
+ hkl3d/hkl3d.cpp | 59 ++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 29 insertions(+), 30 deletions(-)
+
+commit 406d12f580dfac5b9375fcba679eae9c73cddf16
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 15:59:42 2010 +0200
+
+    * forgot the is_colliding in the hkl3d_object_fprintf
+
+ hkl3d/hkl3d.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 17bf9a7366eb00de570ee0eac4b16ff6ea4df218
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 11:30:46 2010 +0200
+
+    * reduce the number of bench cycles
+
+ test/hkl/bench.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+commit 6220867bd3ace2df267a1bd7f7e3f3b02696942d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 11:30:07 2010 +0200
+
+    * switch the hkl3d test from c++ to C
+    
+    now we can use hkl3d from hkl.
+
+ test/hkl3d/Makefile.am |  9 +++---
+ test/hkl3d/main.c      | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ test/hkl3d/main.cpp    | 88 --------------------------------------------------
+ 3 files changed, 92 insertions(+), 93 deletions(-)
+
+commit 48b940e21bdab3681c51f9524f774afd98449874
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 11:29:26 2010 +0200
+
+    * fix last missing C++ horrors :)
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 4 ++--
+ hkl3d/hkl3d.cpp               | 8 ++++----
+ hkl3d/hkl3d.h                 | 6 +++---
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+commit 3b3e8f8288dab81bc828cc3fb8d25d2cbd9b2e29
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 10:49:51 2010 +0200
+
+    * hkl3d C++ -> C full transition.
+
+ hkl3d/hkl3d.h | 43 +++++++++++++++++++------------------------
+ 1 file changed, 19 insertions(+), 24 deletions(-)
+
+commit fa2034219a823998ea4b3ed6cd52ab21b4d64821
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 20 10:42:01 2010 +0200
+
+    * witch the Hkl3D class -> C
+
+ gui/hkl-gui-3d.cpp                  |  4 +-
+ gui/hkl3d/hkl3d-gui-application.cpp | 52 ++++++++++++-------------
+ gui/hkl3d/hkl3d-gui-application.h   |  4 +-
+ gui/hkl3d/hkl3d-gui-model.cpp       | 51 ++++++++++++-------------
+ gui/hkl3d/hkl3d-gui-model.h         | 10 +++--
+ gui/hkl3d/hkl3d-gui-scene.cpp       |  4 +-
+ gui/hkl3d/hkl3d-gui-scene.h         |  4 +-
+ gui/hkl3d/main.cpp                  |  3 +-
+ hkl3d/hkl3d.cpp                     | 75 ++++++++++++++++++++++---------------
+ hkl3d/hkl3d.h                       |  6 +--
+ test/hkl3d/main.cpp                 | 18 +++++----
+ 11 files changed, 126 insertions(+), 105 deletions(-)
+
+commit b38f3e42873e6805de8e3a8fdc05ac631bb5c1dd
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 19 21:21:37 2010 +0200
+
+    * no more methods in Hkl3D.
+
+ gui/hkl-gui-3d.cpp                  |  4 +--
+ gui/hkl3d/hkl3d-gui-application.cpp | 12 +++----
+ hkl3d/hkl3d.cpp                     | 67 +++++++++++++++++++------------------
+ hkl3d/hkl3d.h                       | 11 +++---
+ test/hkl3d/main.cpp                 |  4 +--
+ 5 files changed, 51 insertions(+), 47 deletions(-)
+
+commit bb33e6d122a20b01777b319473493cb2158a5924
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 19 09:01:41 2010 +0200
+
+    * still removing hkl3d methods
+
+ hkl3d/hkl3d.cpp | 22 ++++++++++++----------
+ hkl3d/hkl3d.h   |  4 ++--
+ 2 files changed, 14 insertions(+), 12 deletions(-)
+
+commit c3b07520986c966d7e6462c0a11f667b8de4e80d
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 19 08:50:59 2010 +0200
+
+    * remove a bunch of Hkl3D methods
+
+ gui/hkl-gui-3d.cpp            |  4 ++--
+ gui/hkl3d/hkl3d-gui-model.cpp | 11 ++++++-----
+ hkl3d/hkl3d.cpp               | 27 ++++++++++++++-------------
+ hkl3d/hkl3d.h                 | 17 +++++++++--------
+ 4 files changed, 31 insertions(+), 28 deletions(-)
+
+commit 781ab69ea740a799d4227d1f2a40be17f2690ecb
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 19 08:31:25 2010 +0200
+
+    * remove the hkl3d::apply_transformation
+
+ hkl3d/hkl3d.cpp | 79 ++++++++++++++++++++++++++++-----------------------------
+ hkl3d/hkl3d.h   |  2 --
+ 2 files changed, 39 insertions(+), 42 deletions(-)
+
+commit 0bd7f57bcef4ee77b45f30ff24309caf9470a0e0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 17:30:00 2010 +0200
+
+    * remove hkl3d::connect_all_axes
+
+ gui/hkl-gui-3d.cpp |  2 +-
+ hkl3d/hkl3d.cpp    | 26 +++++++++++++-------------
+ hkl3d/hkl3d.h      | 11 ++++++++++-
+ 3 files changed, 24 insertions(+), 15 deletions(-)
+
+commit eacbea533f76c27985107e392760220f0d8d5564
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 17:05:53 2010 +0200
+
+    * remove a method from the class
+
+ hkl3d/hkl3d.cpp | 92 ++++++++++++++++++++++++++++-----------------------------
+ hkl3d/hkl3d.h   |  3 +-
+ 2 files changed, 47 insertions(+), 48 deletions(-)
+
+commit 680ccca7c332f18f5cddcdfe6b8edd63abfc1423
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 16:58:42 2010 +0200
+
+    * remove all c++ specific keywords of the headers
+
+ hkl3d/hkl3d.h | 54 +++++++++++++++++++++++++-----------------------------
+ 1 file changed, 25 insertions(+), 29 deletions(-)
+
+commit 6951a991e6ac89de8ef23392132056be892fcede
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 16:00:34 2010 +0200
+
+    * no more <vector> reference c++ -> c is in good way
+
+ hkl3d/hkl3d.cpp | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++------
+ hkl3d/hkl3d.h   |  28 ++++++++++++---
+ 2 files changed, 118 insertions(+), 16 deletions(-)
+
+commit 050e172de3c0a5d57ed6e72365f4842154950a54
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 15:53:40 2010 +0200
+
+    * be c++ friendly
+
+ hkl/hkl-macros.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit e083f53a56afa0e7f4150763cdc1d83625b129de
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 14:03:39 2010 +0200
+
+    * remove a memory leak in the load_config method
+
+ hkl3d/hkl3d.cpp | 276 +++++++++++++++++++++++++++++++++-----------------------
+ hkl3d/hkl3d.h   |   2 +-
+ 2 files changed, 163 insertions(+), 115 deletions(-)
+
+commit 5b6319afd0080c00f1b8608475e9beb756929baf
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 11:22:06 2010 +0200
+
+    * add a few test cases
+
+ test/hkl3d/main.cpp | 51 ++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 38 insertions(+), 13 deletions(-)
+
+commit 7c80d79ababe11fe5a38c9fb65366824b32ae2f6
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 11:21:17 2010 +0200
+
+    * add a few fprintf methods for the different objects
+
+ hkl3d/hkl3d.cpp | 18 +++++++++++++++++-
+ hkl3d/hkl3d.h   |  6 ++++++
+ 2 files changed, 23 insertions(+), 1 deletion(-)
+
+commit c74b29c8c24cf5494aa4f5b1b50d8275217f3c48
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 18 11:16:42 2010 +0200
+
+    * one less vector reference
+
+ gui/hkl-gui-3d.cpp            | 22 +++++------
+ gui/hkl3d/hkl3d-gui-model.cpp | 34 ++++++++---------
+ hkl3d/hkl3d.cpp               | 89 ++++++++++++++++++++++++++++++++++---------
+ hkl3d/hkl3d.h                 | 12 +++++-
+ 4 files changed, 109 insertions(+), 48 deletions(-)
+
+commit f773d466c472eef723a02f3083134617ab000642
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 17:17:43 2010 +0200
+
+    * one less reference to <vector>
+
+ gui/hkl-gui-3d.cpp            |  4 +--
+ gui/hkl3d/hkl3d-gui-model.cpp |  8 +++---
+ hkl3d/hkl3d.cpp               | 59 ++++++++++++++++++++++++++++---------------
+ hkl3d/hkl3d.h                 | 10 +++++---
+ 4 files changed, 50 insertions(+), 31 deletions(-)
+
+commit 4137bb2c41953db4ad3e70ad58bba590d2fb3647
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 16:46:32 2010 +0200
+
+    * still some refactoring
+
+ hkl3d/hkl3d.h | 75 +++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 42 insertions(+), 33 deletions(-)
+
+commit e81ab4a6b6659e3320c0f1f6f2a67031e7236951
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 16:28:02 2010 +0200
+
+    * doc :)
+
+ hkl3d/hkl3d.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit b7bda46bccfeecd071c83ce40f5312601ee48fc0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 16:27:53 2010 +0200
+
+    * reorganize a bit the code
+
+ hkl3d/hkl3d.h | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
+commit 56766fb4cf83052c4fe09d5b854444a2005a843e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 16:10:32 2010 +0200
+
+    * add the Hkl3DStats structure to store a few interesting values.
+
+ hkl3d/hkl3d.cpp | 25 ++++++++++++++++++-------
+ hkl3d/hkl3d.h   | 17 +++++++++++++++++
+ 2 files changed, 35 insertions(+), 7 deletions(-)
+
+commit 5ae5aab55d37f3898e3dbad1060af0b2cddc5168
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 15:58:47 2010 +0200
+
+    * fileNameModel -> filename
+
+ gui/hkl-gui-3d.cpp | 2 +-
+ hkl3d/hkl3d.cpp    | 6 +++---
+ hkl3d/hkl3d.h      | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+commit 8781f8d5e9622479215cf6198775caec77e33fb0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 14:50:18 2010 +0200
+
+    * remove more useless code
+
+ hkl3d/hkl3d.h | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+commit 13582382ae7a2204eb234e9af191688c4012143b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 14:42:50 2010 +0200
+
+    * remove the serialization code
+
+ configure.ac                                       |    3 -
+ hkl3d/Makefile.am                                  |    8 +-
+ hkl3d/Serialize/BulletFileLoader/Makefile.am       |   74 --
+ hkl3d/Serialize/BulletFileLoader/bChunk.cpp        |   75 --
+ hkl3d/Serialize/BulletFileLoader/bChunk.h          |   90 --
+ hkl3d/Serialize/BulletFileLoader/bCommon.h         |   39 -
+ hkl3d/Serialize/BulletFileLoader/bDNA.cpp          |  636 ----------
+ hkl3d/Serialize/BulletFileLoader/bDNA.h            |  110 --
+ hkl3d/Serialize/BulletFileLoader/bDefines.h        |  140 ---
+ hkl3d/Serialize/BulletFileLoader/bFile.cpp         | 1322 --------------------
+ hkl3d/Serialize/BulletFileLoader/bFile.h           |  153 ---
+ hkl3d/Serialize/BulletFileLoader/btBulletFile.cpp  |  384 ------
+ hkl3d/Serialize/BulletFileLoader/btBulletFile.h    |   78 --
+ hkl3d/Serialize/BulletFileLoader/bullet.h          |   69 -
+ hkl3d/Serialize/BulletFileLoader/bullet_Common.h   |   77 --
+ hkl3d/Serialize/BulletFileLoader/bullet_ListBase.h |   40 -
+ .../BulletFileLoader/bullet_PointerArray.h         |   41 -
+ .../BulletFileLoader/bullet_btBvhSubtreeInfoData.h |   42 -
+ .../BulletFileLoader/bullet_btCapsuleShapeData.h   |   42 -
+ .../bullet_btCollisionObjectDoubleData.h           |   64 -
+ .../bullet_btCollisionObjectFloatData.h            |   63 -
+ .../BulletFileLoader/bullet_btCollisionShapeData.h |   41 -
+ .../bullet_btCompoundShapeChildData.h              |   43 -
+ .../BulletFileLoader/bullet_btCompoundShapeData.h  |   43 -
+ .../bullet_btConeTwistConstraintData.h             |   51 -
+ .../BulletFileLoader/bullet_btConstraintInfo1.h    |   40 -
+ .../bullet_btConvexHullShapeData.h                 |   44 -
+ .../bullet_btConvexInternalShapeData.h             |   45 -
+ .../BulletFileLoader/bullet_btCylinderShapeData.h  |   42 -
+ .../bullet_btGImpactMeshShapeData.h                |   46 -
+ .../bullet_btGeneric6DofConstraintData.h           |   50 -
+ .../bullet_btHingeConstraintDoubleData.h           |   53 -
+ .../bullet_btHingeConstraintFloatData.h            |   53 -
+ .../BulletFileLoader/bullet_btIntIndexData.h       |   39 -
+ .../bullet_btMatrix3x3DoubleData.h                 |   40 -
+ .../BulletFileLoader/bullet_btMatrix3x3FloatData.h |   40 -
+ .../BulletFileLoader/bullet_btMeshPartData.h       |   45 -
+ .../bullet_btMultiSphereShapeData.h                |   43 -
+ .../bullet_btOptimizedBvhNodeDoubleData.h          |   45 -
+ .../bullet_btOptimizedBvhNodeFloatData.h           |   45 -
+ .../BulletFileLoader/bullet_btPhysicsSystem.h      |   42 -
+ .../bullet_btPoint2PointConstraintDoubleData.h     |   43 -
+ .../bullet_btPoint2PointConstraintFloatData.h      |   43 -
+ .../BulletFileLoader/bullet_btPositionAndRadius.h  |   41 -
+ .../bullet_btQuantizedBvhDoubleData.h              |   51 -
+ .../bullet_btQuantizedBvhFloatData.h               |   51 -
+ .../bullet_btQuantizedBvhNodeData.h                |   41 -
+ .../bullet_btRigidBodyDoubleData.h                 |   63 -
+ .../BulletFileLoader/bullet_btRigidBodyFloatData.h |   62 -
+ .../BulletFileLoader/bullet_btShortIntIndexData.h  |   40 -
+ .../bullet_btShortIntIndexTripletData.h            |   40 -
+ .../bullet_btSliderConstraintData.h                |   49 -
+ .../bullet_btStaticPlaneShapeData.h                |   45 -
+ .../bullet_btStridingMeshInterfaceData.h           |   43 -
+ .../bullet_btTransformDoubleData.h                 |   42 -
+ .../BulletFileLoader/bullet_btTransformFloatData.h |   42 -
+ .../BulletFileLoader/bullet_btTriangleInfoData.h   |   42 -
+ .../bullet_btTriangleInfoMapData.h                 |   52 -
+ .../bullet_btTriangleMeshShapeData.h               |   47 -
+ .../bullet_btTypedConstraintData.h                 |   49 -
+ .../BulletFileLoader/bullet_btVector3DoubleData.h  |   39 -
+ .../BulletFileLoader/bullet_btVector3FloatData.h   |   39 -
+ hkl3d/Serialize/BulletWorldImporter/Makefile.am    |   18 -
+ .../BulletWorldImporter/btBulletWorldImporter.cpp  | 1205 ------------------
+ .../BulletWorldImporter/btBulletWorldImporter.h    |  180 ---
+ hkl3d/Serialize/Makefile.am                        |    1 -
+ hkl3d/hkl3d.cpp                                    |    7 +-
+ hkl3d/hkl3d.h                                      |    3 -
+ 68 files changed, 6 insertions(+), 6812 deletions(-)
+
+commit e90b41ed86ba70ca7c79bfcbe890f5b0ec351169
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 14:00:02 2010 +0200
+
+    * for now restore the old diffabs model.
+
+ data/diffabs.dae  | 305 +++++++++++++++++++++++-------------------------------
+ data/diffabs.yaml |   2 +-
+ 2 files changed, 133 insertions(+), 174 deletions(-)
+
+commit 0b3bdf8e0af37b3178e888b6a066b097fb763587
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 13:31:46 2010 +0200
+
+    * update the hklGui3d to connect axes after an add_from_file call
+
+ gui/hkl-gui-3d.cpp |  2 ++
+ hkl3d/hkl3d.cpp    | 24 ++++++++++++------------
+ hkl3d/hkl3d.h      |  1 +
+ 3 files changed, 15 insertions(+), 12 deletions(-)
+
+commit e2d276f05b1546538ecb2098000bf57cd7ecf33a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 13:15:04 2010 +0200
+
+    * rework the load_config, add a connect_axis method and more...
+    
+    Conflicts:
+    
+    	hkl3d/hkl3d.h
+
+ gui/hkl-gui-3d.cpp |   2 +-
+ hkl3d/hkl3d.cpp    | 678 +++++++++--------------------------------------------
+ hkl3d/hkl3d.h      |  16 +-
+ 3 files changed, 125 insertions(+), 571 deletions(-)
+
+commit 542c0c5a590e5b73bd90d1a094a4859a965dc9b4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 13:31:06 2010 +0200
+
+    *fix the the loadConfig bug
+
+ data/diffabs.yaml  | 40 +++++++++++++--------------
+ gui/hkl3d/main.cpp |  2 --
+ hkl3d/hkl3d.cpp    | 79 ++++++++++++++++++++++++++++++++++++++++--------------
+ hkl3d/hkl3d.h      |  3 +++
+ 4 files changed, 82 insertions(+), 42 deletions(-)
+
+commit 945c741918ada8d363db1acc74d49afd8effe215
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed Aug 4 10:57:53 2010 +0200
+
+    * fixe typos
+
+ hkl3d/hkl3d.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit b64a0f50627fe32f673a913325ed82f7d1b689d2
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed Aug 4 10:56:32 2010 +0200
+
+    * add an fprintf method for the Hkl3DObject
+
+ hkl3d/hkl3d.cpp | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+commit a6b94de0548b2e9934f0ad24f0d7a88cb27213b7
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 13:28:26 2010 +0200
+
+    * applicate name method transform
+    
+    Conflicts:
+    
+    	gui/hkl3d/main.cpp
+
+ gui/hkl-gui-3d.cpp |   2 +-
+ gui/hkl3d/main.cpp |   1 -
+ hkl3d/hkl3d.cpp    | 426 +++++++++++++++++++++++++++++++++++++++++++++--------
+ 3 files changed, 366 insertions(+), 63 deletions(-)
+
+commit 11e6324f044d7375c99db40c6c2a1e945d8a2fdd
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Tue Aug 3 11:47:45 2010 +0200
+
+    * choose suitable name for a method
+
+ hkl3d/hkl3d.h | 25 ++++++++++++++++++++-----
+ 1 file changed, 20 insertions(+), 5 deletions(-)
+
+commit 1cba9dfecb5325df58f6350ee54de0dc2d2bfaa4
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 13:00:28 2010 +0200
+
+    * perform the config's load by using events (see load_config_model method)
+
+ hkl3d/hkl3d.cpp | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ hkl3d/hkl3d.h   |  1 +
+ 2 files changed, 81 insertions(+), 1 deletion(-)
+
+commit a919de683a82bbbd2bb641a8354571174f235a64
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Thu Jul 8 14:01:02 2010 +0200
+
+    * set the init scale to 7 and the scale min to 1
+
+ gui/hkl3d/hkl3d-gui-view.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 9d93b0340f000c8328a78c0aa885d9358bcd1609
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Thu Jul 8 13:57:52 2010 +0200
+
+    * rectify orthoView method
+
+ gui/hkl3d/hkl3d-gui-scene.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 189c972f73097ad94097a6008d9f765e82b88d4e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 17 11:50:57 2010 +0200
+
+    * fix the hkl3d test
+
+ test/hkl3d/main.cpp | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+commit 6aa6c9721c0f6be27c3d605447131744121700aa
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 12 16:54:55 2010 +0200
+
+    * correct the is colliding method.
+
+ hkl3d/hkl3d.cpp     | 2 +-
+ test/hkl3d/main.cpp | 7 ++++---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+commit 387229cffd607cad5479d5bfb8475972e3eb2aeb
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 12 16:54:19 2010 +0200
+
+    * remove a memory leak
+
+ hkl3d/hkl3d.cpp | 2 --
+ 1 file changed, 2 deletions(-)
+
+commit ca3fcbd8d803cddb9670572d5748fc3329ddbac9
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Aug 12 15:52:23 2010 +0200
+
+    * instrument the hkl3d unit test with c-tap-hadness
+    
+    you can find c-tap-hardness here: http://www.eyrie.org/~eagle/software/c-tap-harness/
+
+ NEWS                   |    1 +
+ configure.ac           |    1 +
+ data/Makefile.am       |    4 +-
+ data/diffabs.dae       |  305 +++++++------
+ hkl3d/hkl3d.cpp        |   10 +-
+ test/Makefile.am       |   16 +-
+ test/TESTS             |    1 +
+ test/hkl3d/Makefile.am |   19 +-
+ test/hkl3d/main.cpp    |   18 +-
+ test/runtests.c        | 1116 ++++++++++++++++++++++++++++++++++++++++++++++++
+ test/tap/Makefile.am   |   14 +
+ test/tap/basic.c       |  484 +++++++++++++++++++++
+ test/tap/basic.h       |  125 ++++++
+ test/tap/libtap.sh     |  178 ++++++++
+ 14 files changed, 2138 insertions(+), 154 deletions(-)
+
+commit 448bf08f1ccdfe4411018f085d8b73f3dbd83bbd
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 11 22:44:49 2010 +0200
+
+    * reduce the exposition of bullet in the hkl3d library
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 28 +++++++++++-----------------
+ hkl3d/hkl3d.cpp               | 33 +++++++++++++++++++++++++++++++++
+ hkl3d/hkl3d.h                 |  7 ++++++-
+ 3 files changed, 50 insertions(+), 18 deletions(-)
+
+commit a295ce16faa1c0bee63d43ad3c5c780475495796
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Aug 6 22:26:51 2010 +0200
+
+    * doc
+
+ hkl/hkl-unit.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+commit 4224d2f341d8b34f08ed7204f6671fc8d66411c7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 4 17:46:47 2010 +0200
+
+    * bugs
+
+ bugs/issue-80f8e725bce85678418b7d3601247605d2162982.yaml | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+commit b50ca091026fbdf32f9e61aea2c710e57fd4c764
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 4 17:43:52 2010 +0200
+
+    * update the author list
+
+ AUTHORS | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 6d7130c6c24acf29c10be49105261741fbb87fca
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Wed Aug 4 17:40:02 2010 +0200
+
+    * bugs
+
+ ...ue-80f8e725bce85678418b7d3601247605d2162982.yaml | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+commit e688947e216336ab5b38b312b038d6886b0b3fd7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 30 21:47:45 2010 +0200
+
+    * put the right figure names
+
+ Documentation/figures/3S+1D.pov                 | 164 +++++++++++++++++++++
+ Documentation/figures/3S+1D_pov.pov             | 164 ---------------------
+ Documentation/figures/4S+2D.pov                 | 187 ++++++++++++++++++++++++
+ Documentation/figures/4S+2D_pov.pov             | 187 ------------------------
+ Documentation/figures/4S+2D_reciproque.pov      | 101 +++++++++++++
+ Documentation/figures/4S+2D_reciproque2.pov     | 100 +++++++++++++
+ Documentation/figures/4S+2D_reciproque2_pov.pov | 100 -------------
+ Documentation/figures/4S+2D_reciproque3.pov     | 112 ++++++++++++++
+ Documentation/figures/4S+2D_reciproque3_pov.pov | 112 --------------
+ Documentation/figures/4S+2D_reciproque4.pov     | 127 ++++++++++++++++
+ Documentation/figures/4S+2D_reciproque4_pov.pov | 127 ----------------
+ Documentation/figures/4S+2D_reciproque_pov.pov  | 101 -------------
+ Documentation/figures/Makefile.am               |  24 +--
+ Documentation/hkl.lyx                           |  14 +-
+ 14 files changed, 810 insertions(+), 810 deletions(-)
+
+commit 59f03f1629eada7ada70a45e4a76d4d2685f3805
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 3 17:27:37 2010 +0200
+
+    * start to implemente a generic freecad diffractometer generator
+
+ Documentation/figures/diffractometers.py | 157 +++++++++++++++++++++++++++++++
+ 1 file changed, 157 insertions(+)
+
+commit 714bf39a6cd7efae95bd5f4bfcfb692672cf61c5
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 3 16:21:36 2010 +0200
+
+    * add more freecad figures
+
+ Documentation/figures/B_a.py | 43 +++++++++++++++++++++++++++++++++++++++++++
+ Documentation/figures/B_b.py | 25 +++++++++++++++++++++++++
+ 2 files changed, 68 insertions(+)
+
+commit 4a3d5f307f31ddd223977c1aa53da3204a446dee
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Aug 3 15:06:20 2010 +0200
+
+    * switch from FCMcro to .py
+
+ Documentation/figures/crystal.FCMacro | 76 -----------------------------------
+ Documentation/figures/crystal.py      | 36 +++++++++++++++++
+ 2 files changed, 36 insertions(+), 76 deletions(-)
+
+commit d16830f31c8dbc349b3071fdb46fbc068f1fb395
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 2 17:55:28 2010 +0200
+
+    * still working on the FreeCAD transition.
+
+ Documentation/figures/arrows.FCMacro  | 112 ---------------------------------
+ Documentation/figures/arrows.py       | 114 ++++++++++++++++++++++++++++++++++
+ Documentation/figures/bravais.py      |  35 +++++++++++
+ Documentation/figures/crystal.FCMacro |  76 +++++++++++++++++++++++
+ 4 files changed, 225 insertions(+), 112 deletions(-)
+
+commit 1a4f65672108c7684d98202f65c3064f08d42258
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Aug 2 16:19:28 2010 +0200
+
+    * start to translate the povray scripts in freecad Macros (python)
+    
+    this way it will be possible to use the freecad 3D models for
+    the anticollision system, I will use also thoses macros
+    to generate screenshoot for the documentation.
+
+ Documentation/figures/arrows.FCMacro | 112 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 112 insertions(+)
+
+commit 487e5de9f1d066d1335c886eed153e1f5ab8b17a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 30 18:19:41 2010 +0200
+
+    * set up properly the camera instead of defining a, b, c
+
+ Documentation/figures/test.pov | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+commit 5671ced4cd25ca5e476474fd82b3d9423c73cd37
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 30 18:09:56 2010 +0200
+
+    * define the soleil coordinates
+    
+    a = -x
+    b = -z
+    c = y
+    
+    
+    Signed-off-by: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+
+ Documentation/figures/test.pov | 42 ++++++++++++++----------------------------
+ 1 file changed, 14 insertions(+), 28 deletions(-)
+
+commit a1a059d8a6f79c5529d9e083c0a192a967641716
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 30 17:24:47 2010 +0200
+
+    * add the povray figures and the begining of a Makefile.am rules
+
+ Documentation/Makefile.am                       |   2 +-
+ Documentation/figures/3S+1D_pov.pov             | 164 +++++++++++++++++++++
+ Documentation/figures/4S+2D_pov.pov             | 187 ++++++++++++++++++++++++
+ Documentation/figures/4S+2D_reciproque2_pov.pov | 100 +++++++++++++
+ Documentation/figures/4S+2D_reciproque3_pov.pov | 112 ++++++++++++++
+ Documentation/figures/4S+2D_reciproque4_pov.pov | 127 ++++++++++++++++
+ Documentation/figures/4S+2D_reciproque_pov.pov  | 101 +++++++++++++
+ Documentation/figures/B_a.pov                   |  73 +++++++++
+ Documentation/figures/B_b.pov                   |  58 ++++++++
+ Documentation/figures/B_b3_y.pov                |  72 +++++++++
+ Documentation/figures/Makefile.am               |  31 ++++
+ Documentation/figures/arrows.inc                | 139 ++++++++++++++++++
+ Documentation/figures/bravais.inc               |  35 +++++
+ Documentation/figures/cristal.ini               |   8 +
+ Documentation/figures/cristal.pov               |  72 +++++++++
+ Documentation/figures/test.pov                  |  43 ++++++
+ configure.ac                                    |   4 +
+ 17 files changed, 1327 insertions(+), 1 deletion(-)
+
+commit 8fe4b115a063b423e2b69d1c827fbea72a1b2c75
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 30 17:23:12 2010 +0200
+
+    * use ditz to keep the bug list in a human readable format.
+
+ ...e-66160af59e044b15e5d662aa382c2805d516d7d2.yaml | 22 ++++++++++++++++++++++
+ bugs/project.yaml                                  | 12 ++++++++++++
+ 2 files changed, 34 insertions(+)
+
+commit cdcc17584183d23ba49cd14f43b10d1c5bcdd68d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jul 27 09:26:36 2010 +0200
+
+    * update the NEWS file
+
+ NEWS | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 72db6d701fac9730606032ee19f67a4cc9279913
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jul 26 11:26:03 2010 +0200
+
+    * update the documentation to reflect the new HklGeometryConfig.
+
+ Documentation/hkl.texi | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+commit e6488ff1a793cfec0ba2a05dd4dfbc584c64ecb2
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jul 24 22:07:05 2010 +0200
+
+    * add the Eulerian 4 circles horizontal geometry
+    
+    refactor also the eulerian 4 circles vertical to use the same
+    code for vertical and horizontal.
+
+ Documentation/hkl.texi              | 101 +++++++++++++++++++++++++-
+ hkl/Makefile.am                     |   6 +-
+ hkl/hkl-geometry-factory.c          |  18 +++++
+ hkl/hkl-geometry-factory.h          |   1 +
+ hkl/hkl-geometry.h                  |   3 +-
+ hkl/hkl-pseudoaxis-common-q.c       |  13 +---
+ hkl/hkl-pseudoaxis-e4c-hkl.c        | 140 ++++++++++++++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis-e4c-psi.c        |  40 +++++++++++
+ hkl/hkl-pseudoaxis-e4c.h            |  34 +++++++++
+ hkl/hkl-pseudoaxis-e4cv-hkl.c       | 140 ------------------------------------
+ hkl/hkl-pseudoaxis-e4cv-psi.c       |  40 -----------
+ hkl/hkl-pseudoaxis-e4cv.h           |  34 ---------
+ hkl/hkl-pseudoaxis-factory.c        |   7 +-
+ test/hkl/hkl-test-pseudoaxis-e4cv.c |   2 +-
+ test/hkl/hkl-test-pseudoaxis.c      |  12 +++-
+ 15 files changed, 356 insertions(+), 235 deletions(-)
+
+commit 3271a5ed2d5368f09c780c5d5b3fe10447947b09
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jul 7 10:29:19 2010 +0200
+
+    * real select comportement.
+    
+    we must unselect all configs's objects.
+
+ gui/hkl-gui-3d.cpp | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+commit 309163a0c24d4005ed53edc30dc188db71378e65
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jul 7 10:18:53 2010 +0200
+
+    * fix the hide when an object was selected.
+    
+    do not show an hidden selected object.
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit d7eb663d16e8736f8ae4574893d5b0913cf979e0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jul 7 10:18:26 2010 +0200
+
+    * fix the build of ghkl to relinkg if a depending library was modify.
+    
+    use the _LDADD for this purpose.
+
+ gui/Makefile.am | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+commit 1bce817ac3edf29e1ceca2e974f7cbb1f93b4e24
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jul 7 10:17:47 2010 +0200
+
+    *use the highlight mode in ghkl
+
+ gui/hkl-gui-3d.cpp | 30 +++++++++++++++++++++++++++++-
+ gui/hkl-gui-3d.h   |  1 +
+ 2 files changed, 30 insertions(+), 1 deletion(-)
+
+commit ce35c4a4d383886cc03dec34b427ba73a773af22
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Tue Jul 6 18:20:44 2010 +0200
+
+    * first highlight version
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 93 +++++++++++++++++++++++++++++++++++++++----
+ gui/hkl3d/hkl3d-gui-model.h   |  8 ++--
+ hkl3d/hkl3d.cpp               |  1 +
+ hkl3d/hkl3d.h                 |  1 +
+ 4 files changed, 92 insertions(+), 11 deletions(-)
+
+commit 323bffef0b8d3545bf069b8b162a664e8592b495
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jul 6 12:09:51 2010 +0200
+
+    * do not save the config file (not yet ready)
+
+ data/cristal4C.yaml | 114 ++++++++++++++++++++++++++--------------------------
+ gui/hkl-gui-3d.cpp  |   4 +-
+ 2 files changed, 59 insertions(+), 59 deletions(-)
+
+commit 6ac0d6ccd894eb4ce868ee68b0cd5fdd59ac0256
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jul 5 16:21:32 2010 +0200
+
+    * save the config file each time a modification is done.
+
+ gui/hkl-gui-3d.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 06d54e2cdca89afeadcc4316fa5b9d58809029f8
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jul 5 16:20:50 2010 +0200
+
+    * save the config filename in the hkl3d structure.
+
+ hkl3d/hkl3d.cpp | 39 +++++++++++++++++++++++++--------------
+ hkl3d/hkl3d.h   |  1 +
+ 2 files changed, 26 insertions(+), 14 deletions(-)
+
+commit dc668d9829bedede5677230313cf520ebcb931b0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 2 14:17:47 2010 +0200
+
+    * now we can hide all models from a file model at once.
+
+ gui/hkl-gui-3d.cpp | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+commit 41f24839ea99715b907f2ff986d30882cf064913
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 2 12:31:29 2010 +0200
+
+    * now we can add pieces from the ghkl interface
+
+ gui/3d.ui          | 138 +++++++++++++++++++++++++++++++++++++++++++++--------
+ gui/hkl-gui-3d.cpp |  46 ++++++++++++++++++
+ gui/hkl-gui-3d.h   |   9 ++++
+ 3 files changed, 174 insertions(+), 19 deletions(-)
+
+commit eca2dc9e68a1a79561a78b0ef827a88b939f581d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 2 11:59:57 2010 +0200
+
+    * no more segfault when adding a model file.
+
+ hkl3d/hkl3d.cpp | 3 ++-
+ hkl3d/hkl3d.h   | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+commit c4b62a8770524c54f5258346a6c0d1cbeda4ef64
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jul 2 08:58:49 2010 +0200
+
+    * fix a crash when we can not read the 3d model file.
+
+ hkl3d/hkl3d.cpp | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+commit f51567e641a3349e64f9ab5147e7d9e906652f67
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Thu Jul 1 15:12:57 2010 +0200
+
+    * create an Hkl3D::hide_object method.
+
+ gui/hkl-gui-3d.cpp            |  2 +-
+ gui/hkl3d/hkl3d-gui-model.cpp |  3 ---
+ hkl3d/hkl3d.cpp               | 58 +++++++++++++++++++------------------------
+ hkl3d/hkl3d.h                 |  2 +-
+ 4 files changed, 27 insertions(+), 38 deletions(-)
+
+commit 8e1256fce5718509126c89be8f915caeee6a1498
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri Jun 25 13:55:31 2010 +0100
+
+    *rectify mistakes in orthoview method
+    
+    Conflicts:
+    
+    	TODO
+    	gui/ghkl3d/hkl3d-gui-model.cpp
+    	gui/hkl3d/hkl3d-gui-scene.cpp
+
+ gui/hkl3d/hkl3d-gui-scene.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 73081127557518da2d6e90e95756512cdf86239d
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri Jun 25 10:46:38 2010 +0200
+
+    *add the zoom mouse scroll
+
+ gui/hkl3d/hkl3d-gui-scene.cpp |  2 ++
+ gui/hkl3d/hkl3d-gui-view.cpp  | 28 ++++++++++++++++++++++++++++
+ gui/hkl3d/hkl3d-gui-view.h    |  1 +
+ 3 files changed, 31 insertions(+)
+
+commit 17aa5f7c479c6eb71cdbdf838d6cea1c4e2d3633
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri Jun 25 09:58:17 2010 +0200
+
+    *add translation view
+
+ gui/hkl3d/hkl3d-gui-view.cpp | 32 +++++++++++++++++++++++---------
+ 1 file changed, 23 insertions(+), 9 deletions(-)
+
+commit 0709bb42492e7afe4a88e269d5e107689dd41747
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed Jun 23 17:11:40 2010 +0100
+
+    * add orth view
+    
+    Conflicts:
+    
+    	gui/ghkl3d/hkl3d-gui-model.cpp
+    	gui/ghkl3d/main.cpp
+    	gui/hkl3d/hkl3d-gui-model.h
+
+ gui/hkl3d/hkl3d-gui-model.cpp |  6 ++++--
+ gui/hkl3d/hkl3d-gui-model.h   |  4 +++-
+ gui/hkl3d/hkl3d-gui-scene.cpp | 21 ++++++++++++++++++---
+ gui/hkl3d/hkl3d-gui-scene.h   |  3 ++-
+ gui/hkl3d/hkl3d-gui-view.cpp  |  9 +++++++++
+ gui/hkl3d/hkl3d-gui-view.h    |  2 +-
+ 6 files changed, 37 insertions(+), 8 deletions(-)
+
+commit 2ad80d55f7a924d3977c6145100b505735495dc5
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 26 11:33:07 2010 +0200
+
+    * increase the timeout.
+    
+    need to figure out why I need to increase it all the time
+    depending on the computer.
+
+ gui/hkl3d/hkl3d-gui-scene.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit b96a7591db6db9e0ca8b52d91e75759753cff6b7
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 26 11:32:11 2010 +0200
+
+    * add the Treeview for the configuration.
+    
+    now we can select pieces one by one.
+
+ gui/3d.ui          | 70 ++++++++++++++++++++++++++++++++++++++++++++----------
+ gui/hkl-gui-3d.cpp | 66 ++++++++++++++++++++++++++++++++++++++++++++++----
+ gui/hkl-gui-3d.h   | 24 +++++++------------
+ 3 files changed, 128 insertions(+), 32 deletions(-)
+
+commit 9619c50069ec0d667b98357b9c98190f6c514f36
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed Jun 23 11:18:54 2010 +0200
+
+    * start to implement a dedicated 3d view with it's own .ui file
+
+ gui/3d.ui                     | 45 ++++++++++++++++++++++
+ gui/Makefile.am               | 22 ++++++-----
+ gui/hkl-gui-3d.cpp            | 74 +++++++++++++++++++++++++++++++++++
+ gui/hkl-gui-3d.h              | 89 +++++++++++++++++++++++++++++++++++++++++++
+ gui/hkl-gui-callbacks.cpp     | 30 +++++++--------
+ gui/hkl-gui.cpp               | 13 ++-----
+ gui/hkl-gui.h                 |  6 +--
+ gui/hkl3d/hkl3d-gui-scene.cpp |  2 +-
+ 8 files changed, 243 insertions(+), 38 deletions(-)
+
+commit 0ce5ef58537fcaabee3acace86d740e90921486b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 16:52:54 2010 +0200
+
+    * only indentation
+
+ gui/hkl3d/GL_ShapeDrawer.cpp | 869 +++++++++++++++++--------------------------
+ gui/hkl3d/GL_ShapeDrawer.h   |  98 +++--
+ 2 files changed, 413 insertions(+), 554 deletions(-)
+
+commit 551f7cad89520ed096587f7f910eaae76d156616
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 16:10:11 2010 +0200
+
+    * remove plenty of useless code.
+
+ configure.ac                          |    1 -
+ gui/Makefile.am                       |    2 +-
+ gui/OpenGL/DebugCastResult.h          |   88 ---
+ gui/OpenGL/DemoApplication.cpp        | 1316 ---------------------------------
+ gui/OpenGL/DemoApplication.h          |  246 ------
+ gui/OpenGL/GLDebugDrawer.cpp          |  140 ----
+ gui/OpenGL/GLDebugDrawer.h            |   38 -
+ gui/OpenGL/GLDebugFont.cpp            |  987 -------------------------
+ gui/OpenGL/GLDebugFont.h              |   27 -
+ gui/OpenGL/GL_DialogDynamicsWorld.cpp |  739 ------------------
+ gui/OpenGL/GL_DialogDynamicsWorld.h   |   91 ---
+ gui/OpenGL/GL_DialogWindow.cpp        |  336 ---------
+ gui/OpenGL/GL_DialogWindow.h          |  283 -------
+ gui/OpenGL/GL_ShapeDrawer.cpp         |  985 ------------------------
+ gui/OpenGL/GL_ShapeDrawer.h           |   70 --
+ gui/OpenGL/GL_Simplex1to4.cpp         |   73 --
+ gui/OpenGL/GL_Simplex1to4.h           |   40 -
+ gui/OpenGL/GlutDemoApplication.cpp    |   71 --
+ gui/OpenGL/GlutDemoApplication.h      |   34 -
+ gui/OpenGL/GlutStuff.cpp              |  109 ---
+ gui/OpenGL/GlutStuff.h                |   84 ---
+ gui/OpenGL/Makefile.am                |   33 -
+ gui/OpenGL/RenderTexture.cpp          |   86 ---
+ gui/OpenGL/RenderTexture.h            |   73 --
+ gui/OpenGL/Win32AppMain.cpp           |  402 ----------
+ gui/OpenGL/Win32DemoApplication.cpp   |   79 --
+ gui/OpenGL/Win32DemoApplication.h     |   40 -
+ 27 files changed, 1 insertion(+), 6472 deletions(-)
+
+commit 70a654a7d8038c8e5890f8716eadbde9a5df3c98
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 16:08:21 2010 +0200
+
+    * remove a reference to libbulletdynamics in the hkl3d-gui part.
+    
+    bullet dynamic is still necessary due to the GL_shapeDrawer.
+
+ gui/Makefile.am               |  1 +
+ gui/hkl3d/Makefile.am         |  3 ++-
+ gui/hkl3d/hkl3d-gui-model.cpp | 10 +++++-----
+ 3 files changed, 8 insertions(+), 6 deletions(-)
+
+commit 906c5a5b1b9e6bc833a160c3c1d740c1f7f67879
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 15:20:40 2010 +0200
+
+    * prepare for the OpenGL (libbulletopenglsupport) supression.
+
+ gui/hkl3d/GL_ShapeDrawer.cpp | 972 +++++++++++++++++++++++++++++++++++++++++++
+ gui/hkl3d/GL_ShapeDrawer.h   |  86 ++++
+ gui/hkl3d/Makefile.am        |   6 +-
+ 3 files changed, 1061 insertions(+), 3 deletions(-)
+
+commit 89e42c2255400866d7f407784e7bfe0bc25ac12d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 14:59:12 2010 +0200
+
+    * typo
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+commit c0ac8d254a917ebd8068575e2ad8890369ba8510
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 14:59:07 2010 +0200
+
+    * remove the GLDebugDrawer dependency.
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+commit a8e95580bd9e3661fe2ad63c589a1894ff3a907f
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 14:39:47 2010 +0200
+
+    * prepare for removing of the GLDebug code.
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++
+ gui/hkl3d/hkl3d-gui-model.h   |  6 ++++++
+ 2 files changed, 49 insertions(+)
+
+commit 87527ef7d4a1f7d071f47d06942d316f790782e9
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 11:03:22 2010 +0200
+
+    * remove an useless dependency
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 4 ----
+ 1 file changed, 4 deletions(-)
+
+commit a8fad9a8f92bbc61beb5e438c1bb35dfb79ff138
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 10:48:17 2010 +0200
+
+    * remove another bunch of useless method from hkl3d-gui-model
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 15 ++++++---------
+ gui/hkl3d/hkl3d-gui-model.h   | 45 +++++--------------------------------------
+ gui/hkl3d/hkl3d-gui-scene.cpp | 24 ++++++++++-------------
+ gui/hkl3d/hkl3d-gui-scene.h   |  6 +++---
+ 4 files changed, 24 insertions(+), 66 deletions(-)
+
+commit 82b87b205d3909f30d6d32de49f5c47fcf972654
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 10:29:20 2010 +0200
+
+    * now Hkl3D::_btWorld can becomes private.
+
+ hkl3d/hkl3d.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a81516c1e8599157ed9ddad8f113711c49fee3f8
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 10:23:41 2010 +0200
+
+    * remoce the home made draw_sphere method in favor of the GL_ShapeDrawer.
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 34 ++--------------------------------
+ gui/hkl3d/hkl3d-gui-model.h   |  1 -
+ 2 files changed, 2 insertions(+), 33 deletions(-)
+
+commit 034b7831e212769cd54e813fc16056e5b3b5cd79
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 10:11:14 2010 +0200
+
+    * remove the GlutDemoApplication dependency
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 20 +++++++-------------
+ gui/hkl3d/hkl3d-gui-model.h   | 13 +++++--------
+ 2 files changed, 12 insertions(+), 21 deletions(-)
+
+commit d6773ec4f6279441247ebf5ef8d7416b9a3e5b7b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 09:42:52 2010 +0200
+
+    * rename a bunch of methods.
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 24 ++++++++++++------------
+ gui/hkl3d/hkl3d-gui-model.h   | 11 ++++++-----
+ 2 files changed, 18 insertions(+), 17 deletions(-)
+
+commit 90efbe57ce2a3f230b5290f330e687d5d4febc1a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 09:31:10 2010 +0200
+
+    * remove useless code.
+
+ gui/hkl3d/hkl3d-gui-model.h | 32 +++++++-------------------------
+ 1 file changed, 7 insertions(+), 25 deletions(-)
+
+commit ddf76bf4d214e00be28f91b9a5af8fcda2993bcd
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 09:22:54 2010 +0200
+
+    * create the DrawingTools only once.
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 3 ++-
+ gui/hkl3d/hkl3d-gui-model.h   | 7 ++-----
+ 2 files changed, 4 insertions(+), 6 deletions(-)
+
+commit 5bc3f13c944b920a65f12545a7a9aec80b4b02bc
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 09:11:35 2010 +0200
+
+    * small optimization call update_objects_visibility only once.
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 20 +++++++-------------
+ 1 file changed, 7 insertions(+), 13 deletions(-)
+
+commit b4fb3b404186c6184e233f3d03a684c113d65cf9
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 09:11:06 2010 +0200
+
+    * typo
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
+
+commit e4d46bd2b60b92aad9141dafe6cdd99037223f51
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 08:52:16 2010 +0200
+
+    * rename update_object_visibility_in_world -> update_objects_visibility
+    
+    now update all the object visibility in the Hkl3D class
+    it simplify a bit the hkl3d-model code.
+
+ gui/hkl3d/hkl3d-gui-model.cpp |  6 ++----
+ hkl3d/hkl3d.cpp               | 38 +++++++++++++++++++++++---------------
+ hkl3d/hkl3d.h                 |  2 +-
+ 3 files changed, 26 insertions(+), 20 deletions(-)
+
+commit 982dc8ea17564b30427a999ab85b887d55812afd
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 08:35:48 2010 +0200
+
+    * typo
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+commit 7d4e51370e78a4e3b42ad0deac08aa7a6110c3d5
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 22 08:35:41 2010 +0200
+
+    * use the Hkl3D::update_object_visibility_in_world
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 45 ++++++++++++++++---------------------------
+ 1 file changed, 17 insertions(+), 28 deletions(-)
+
+commit b7f3b7789b2a404752617c3a8ae15f3719fc2c82
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 21 09:30:31 2010 +0200
+
+    * add a method to update the visibility of an hkl3dObject in the world
+
+ hkl3d/hkl3d.cpp | 25 +++++++++++++++++++++++++
+ hkl3d/hkl3d.h   |  1 +
+ 2 files changed, 26 insertions(+)
+
+commit b390aac4e858dd164e9c26103f6e91706ee2cf69
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon Jun 21 09:11:00 2010 +0200
+
+    * more work to push Hkl3D::_btWorld to a private area.
+
+ gui/hkl3d/hkl3d-gui-model.cpp |  6 ++----
+ hkl3d/hkl3d.cpp               | 12 ++++++++++++
+ hkl3d/hkl3d.h                 |  2 ++
+ 3 files changed, 16 insertions(+), 4 deletions(-)
+
+commit e0257c7e08773b04efd63f795016989b9ca3fce9
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 13:00:15 2010 +0200
+
+    * typo
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+commit a5b3dcac159a10e616099a30ee5cae344045ecb6
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 12:56:31 2010 +0200
+
+    * remove useless code
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+commit d129853e714941ca685dbec36490b46645db3d41
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 12:39:53 2010 +0200
+
+    * rename Hkl3D.._hkl3dConfigs -> configs
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 58 +++++++++++++++++++++----------------------
+ hkl3d/hkl3d.cpp               | 34 ++++++++++++-------------
+ hkl3d/hkl3d.h                 |  2 +-
+ 3 files changed, 47 insertions(+), 47 deletions(-)
+
+commit b6067239a860d10437f313d09897a77c46b26328
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 12:27:42 2010 +0200
+
+    rename Hkl3d::_geometry -> geometry
+
+ gui/hkl3d/hkl3d-gui-application.cpp | 36 ++++++++++++++++++------------------
+ hkl3d/hkl3d.cpp                     | 12 ++++++------
+ hkl3d/hkl3d.h                       |  2 +-
+ 3 files changed, 25 insertions(+), 25 deletions(-)
+
+commit e59beb5270e256cd286dcbb0b80f95d8f67efdcd
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 12:19:11 2010 +0200
+
+    * rename _model -> model (public member)
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 2 +-
+ hkl3d/hkl3d.cpp               | 8 ++++----
+ hkl3d/hkl3d.h                 | 2 +-
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+commit 93d6ca999444d7c342ba6e41b59922c9e9c163d1
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 12:10:56 2010 +0200
+
+    * no more bullet members exposed from hkl3d.h
+    
+    next step will be to do the same for g3d.
+
+ hkl3d/hkl3d.cpp        |  9 ++++++---
+ hkl3d/hkl3d.h          | 10 +++-------
+ test/hkl3d/Makefile.am |  5 ++---
+ 3 files changed, 11 insertions(+), 13 deletions(-)
+
+commit d077821dd67d28eb95d3755b7dd8fdd240354d92
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 12:09:54 2010 +0200
+
+    * fix the hkl3d test
+
+ test/hkl3d/main.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 9bf1de2444d2870e48a254e572bd64d9089edd9e
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 00:57:52 2010 +0200
+
+    * typo
+
+ hkl3d/hkl3d.cpp | 43 +++++++++++++++++++++----------------------
+ 1 file changed, 21 insertions(+), 22 deletions(-)
+
+commit 41a3772412ed4d43ea11ce40ab162d44259c9f42
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 00:46:55 2010 +0200
+
+    * indentation
+
+ hkl3d/hkl3d.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+commit f36fe81dbd0a6f5a2e815c8006be7dceb14b5a68
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 00:45:57 2010 +0200
+
+    * simplify the callback
+
+ hkl3d/hkl3d.cpp | 18 +++++++-----------
+ 1 file changed, 7 insertions(+), 11 deletions(-)
+
+commit 1048ea358248e7e23b08cb84c950c97264f9d9aa
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 20 00:37:06 2010 +0200
+
+    * move the static part on top of the file and the serialized at the end
+
+ hkl3d/hkl3d.cpp | 326 ++++++++++++++++++++++++++++----------------------------
+ hkl3d/hkl3d.h   |   8 +-
+ 2 files changed, 171 insertions(+), 163 deletions(-)
+
+commit 45f0eb3cc2e7a9a1532679ef0652183da2a56d1c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 23:57:21 2010 +0200
+
+    * more rename
+
+ hkl3d/hkl3d.cpp | 6 +++---
+ hkl3d/hkl3d.h   | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+commit 7e0ae05a879882aa532889b8c5e9623d0a59591a
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 23:52:24 2010 +0200
+
+    * one more rename
+
+ hkl3d/hkl3d.cpp | 4 ++--
+ hkl3d/hkl3d.h   | 3 ++-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+commit f928a77189d3fa2fdfce5dd8f740709dac73d486
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 23:43:05 2010 +0200
+
+    * more renames
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 26 +++++++++++++-------------
+ hkl3d/hkl3d.cpp               | 22 +++++++++++-----------
+ hkl3d/hkl3d.h                 | 17 +++++++++--------
+ 3 files changed, 33 insertions(+), 32 deletions(-)
+
+commit 9980e76c9c43fa23cb74ca553acbfd24fa6e7999
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 23:22:08 2010 +0200
+
+    * move initHkl3D to private and rename
+
+ hkl3d/hkl3d.cpp | 4 ++--
+ hkl3d/hkl3d.h   | 4 +++-
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+commit 7b1a51fc5ca87721d4db457081802b26fc5a9221
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 23:15:16 2010 +0200
+
+    * more rename
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 12 ++++++------
+ hkl3d/hkl3d.cpp               |  8 ++++----
+ hkl3d/hkl3d.h                 |  6 +++---
+ 3 files changed, 13 insertions(+), 13 deletions(-)
+
+commit 4f5803c4f9fbfa2cc1f6493cfeec2ef746a8286c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 23:06:30 2010 +0200
+
+    * more rename
+
+ gui/hkl3d/hkl3d-gui-model.cpp | 20 ++++++++++----------
+ hkl3d/hkl3d.cpp               | 18 +++++++++---------
+ hkl3d/hkl3d.h                 |  6 +++---
+ 3 files changed, 22 insertions(+), 22 deletions(-)
+
+commit 13076f8c85f2029812ba0c5ed64822bf84cf2014
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 22:57:03 2010 +0200
+
+    * rename the Hkl3DConfig::hkl3dObjects -> objects
+
+ gui/hkl3d/hkl3d-gui-model.cpp |  50 +++++++++----------
+ hkl3d/hkl3d.cpp               | 113 ++++++++++++++++++++++++++----------------
+ hkl3d/hkl3d.h                 |   4 +-
+ 3 files changed, 96 insertions(+), 71 deletions(-)
+
+commit 5d4bf6cbcfcdaab4988cfc9cd9c9443dd61c7329
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 22:01:31 2010 +0200
+
+    * only typo
+
+ hkl3d/hkl3d.cpp | 105 ++++++++++++++++++++++++++++++--------------------------
+ hkl3d/hkl3d.h   |  30 ++++++++--------
+ 2 files changed, 72 insertions(+), 63 deletions(-)
+
+commit b1b22edaf5e51e68ad368ce865a671c082aae432
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 21:44:27 2010 +0200
+
+    * remove useless constructor
+
+ hkl3d/hkl3d.cpp | 6 ------
+ hkl3d/hkl3d.h   | 1 -
+ 2 files changed, 7 deletions(-)
+
+commit 8c5054e2b3df89238d08a62516a1830163e5821c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 21:32:26 2010 +0200
+
+    * use autoscan to update the configure.ac file
+
+ configure.ac | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+commit 434a7f4aa49f46475976f5c14146d9468d352d12
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 20:54:20 2010 +0200
+
+    * update the README
+    
+    add a few dependencies
+
+ README | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+commit 2267e369e2bc6d2c520a113e482a18978cd30302
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 20:31:33 2010 +0200
+
+    * remove the DiffabsDemo useless files
+
+ configure.ac                    |   1 -
+ gui/DiffabsDemo/DiffabsDemo.cpp | 217 ----------------------------------------
+ gui/DiffabsDemo/DiffabsDemo.h   |  75 --------------
+ gui/DiffabsDemo/Makefile.am     |  34 -------
+ gui/DiffabsDemo/main.cpp        |  50 ---------
+ gui/Makefile.am                 |   2 +-
+ 6 files changed, 1 insertion(+), 378 deletions(-)
+
+commit 1eb65c0534c649c3cb88414d88f5383100a5965c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 19 10:25:30 2010 +0200
+
+    reorganize a bit the ghkl code
+
+ .gitignore                           |  18 +
+ configure.ac                         |   2 +-
+ gui/Makefile.am                      |  18 +-
+ gui/ghkl-callbacks.cpp               | 998 -----------------------------------
+ gui/ghkl.cpp                         | 982 ----------------------------------
+ gui/ghkl.h                           | 283 ----------
+ gui/ghkl3d/Makefile.am               |  56 --
+ gui/ghkl3d/ghkl3d.ui                 | 218 --------
+ gui/ghkl3d/hkl3d-gui-application.cpp | 201 -------
+ gui/ghkl3d/hkl3d-gui-application.h   |  81 ---
+ gui/ghkl3d/hkl3d-gui-gl.c            | 814 ----------------------------
+ gui/ghkl3d/hkl3d-gui-gl.h            |  64 ---
+ gui/ghkl3d/hkl3d-gui-model.cpp       | 362 -------------
+ gui/ghkl3d/hkl3d-gui-model.h         | 168 ------
+ gui/ghkl3d/hkl3d-gui-scene.cpp       | 419 ---------------
+ gui/ghkl3d/hkl3d-gui-scene.h         | 117 ----
+ gui/ghkl3d/hkl3d-gui-view.cpp        | 171 ------
+ gui/ghkl3d/hkl3d-gui-view.h          | 108 ----
+ gui/ghkl3d/main.cpp                  |  66 ---
+ gui/ghkl3d/texture.c                 |  43 --
+ gui/ghkl3d/texture.h                 |  30 --
+ gui/ghkl3d/trackball.c               | 324 ------------
+ gui/ghkl3d/trackball.h               |  78 ---
+ gui/hkl-gui-callbacks.cpp            | 998 +++++++++++++++++++++++++++++++++++
+ gui/hkl-gui-modelcolumns.h           | 161 ++++++
+ gui/hkl-gui-pseudoaxes.cpp           | 204 +++++++
+ gui/hkl-gui-pseudoaxes.h             | 105 ++++
+ gui/hkl-gui.cpp                      | 982 ++++++++++++++++++++++++++++++++++
+ gui/hkl-gui.h                        | 283 ++++++++++
+ gui/hkl3d/Makefile.am                |  56 ++
+ gui/hkl3d/ghkl3d.ui                  | 218 ++++++++
+ gui/hkl3d/hkl3d-gui-application.cpp  | 201 +++++++
+ gui/hkl3d/hkl3d-gui-application.h    |  81 +++
+ gui/hkl3d/hkl3d-gui-gl.c             | 814 ++++++++++++++++++++++++++++
+ gui/hkl3d/hkl3d-gui-gl.h             |  64 +++
+ gui/hkl3d/hkl3d-gui-model.cpp        | 362 +++++++++++++
+ gui/hkl3d/hkl3d-gui-model.h          | 168 ++++++
+ gui/hkl3d/hkl3d-gui-scene.cpp        | 419 +++++++++++++++
+ gui/hkl3d/hkl3d-gui-scene.h          | 117 ++++
+ gui/hkl3d/hkl3d-gui-view.cpp         | 171 ++++++
+ gui/hkl3d/hkl3d-gui-view.h           | 108 ++++
+ gui/hkl3d/main.cpp                   |  66 +++
+ gui/hkl3d/texture.c                  |  43 ++
+ gui/hkl3d/texture.h                  |  30 ++
+ gui/hkl3d/trackball.c                | 324 ++++++++++++
+ gui/hkl3d/trackball.h                |  78 +++
+ gui/main.cpp                         |   2 +-
+ gui/modelcolumns.h                   | 161 ------
+ gui/pseudoaxesframe.cpp              | 204 -------
+ gui/pseudoaxesframe.h                | 105 ----
+ 50 files changed, 6082 insertions(+), 6064 deletions(-)
+
+commit 1ef22172550e5383c461a30e0a9e2e455c9cdff3
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jun 18 13:55:21 2010 +0200
+
+    correct the diffabs.yaml config file.
+
+ data/diffabs.yaml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit b8259f1a807cb13edbfe5d16ed36158a3658b8cd
+Merge: 6869615 7cf255f
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jun 18 13:48:03 2010 +0200
+
+    Merge branch 'next' of ssh://dent-de-scie/home/oussama/hkl into next
+    
+    Conflicts:
+    	TODO
+    	configure.ac
+    	hkl3d/hkl3d.cpp
+
+commit 6869615a2cfafc473fb27c862792c0e6bf8ab9dc
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri Jun 18 08:23:41 2010 +0200
+
+    correct the --enable-hkl3d default [true]
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 7cf255f897133ec009fde369be6ef365979ffb0e
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Thu Jun 17 15:52:28 2010 +0200
+
+    * replace the LogoModel namespace by something else.
+
+ TODO                                 |  3 +--
+ gui/ghkl3d/hkl3d-gui-application.cpp |  4 +--
+ gui/ghkl3d/hkl3d-gui-application.h   |  4 +--
+ gui/ghkl3d/hkl3d-gui-model.cpp       | 50 ++++++++++++++++++------------------
+ gui/ghkl3d/hkl3d-gui-model.h         | 30 ++++++++++------------
+ gui/ghkl3d/hkl3d-gui-scene.cpp       |  4 +--
+ gui/ghkl3d/hkl3d-gui-scene.h         |  6 ++---
+ gui/ghkl3d/hkl3d-gui-view.cpp        |  4 +--
+ gui/ghkl3d/hkl3d-gui-view.h          |  4 +--
+ gui/ghkl3d/main.cpp                  |  2 +-
+ 10 files changed, 53 insertions(+), 58 deletions(-)
+
+commit d754f059ae8b48abc5355f32a4e2b1233a70a9bd
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Thu Jun 17 14:08:42 2010 +0200
+
+    all removed TODO's
+    
+    	* REMOVE std::vector<HKL3DObject> _hkl3dObjects from the Hkl3D class
+    	* put ifdef for Serialization in the  Hkl3D::loadModelInCollisionWorld
+    	* verification that G3DContex in Hkl3D::addFromFile do not leak.
+    	* remove the isModelFilecompatible.
+     	* split loadModelInCollisionWorld ->
+    	  - convertion de G3DObject -> Bullet
+    	  - create the Hkl3DObject from G3DModel and bullet.
+    	  - update the collision world.
+    	  - bullet serialization
+    	* why this hide problem with the base ?
+    	* can we remove the AddedInWorldCollision <-> !hide ???
+    	* how to move from drawModel/Bullet the world collision update ?
+
+ TODO                            |  16 +-
+ gui/DiffabsDemo/DiffabsDemo.cpp |  31 +-
+ gui/ghkl3d/cristal4C.yaml       | 930 +++++++++++++++++++++-------------------
+ gui/ghkl3d/hkl3d-gui-model.cpp  |  38 +-
+ gui/ghkl3d/main.cpp             |   6 +-
+ hkl3d/hkl3d.cpp                 | 366 +++++++++-------
+ hkl3d/hkl3d.h                   |   7 +-
+ 7 files changed, 737 insertions(+), 657 deletions(-)
+
+commit ecc50d829b3f220d176f3d8c62fd3836c1763d14
+Author: unknown <Administrateur at .synchrotron-soleil.fr>
+Date:   Thu Jun 17 13:23:37 2010 +0200
+
+    typo
+
+ hkl/hkl-macros.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 1ca79d7293427f6e4d00762f946d87a111a85102
+Author: unknown <Administrateur at .synchrotron-soleil.fr>
+Date:   Thu Jun 17 13:15:56 2010 +0200
+
+    try to solve the vasprintf problem with win32 (UGLY)
+
+ hkl/hkl-macros.c | 13 +++++++++++++
+ hkl/hkl-macros.h |  3 +++
+ 2 files changed, 16 insertions(+)
+
+commit bc25a2c76b57b3b8cc8bf1266235685a4a30f1ac
+Author: unknown <Administrateur at .synchrotron-soleil.fr>
+Date:   Thu Jun 17 11:17:39 2010 +0200
+
+    * modifications for Visual C++ 2008
+
+ hkl/hkl-error.c           | 11 ++++++++---
+ hkl/hkl-geometry.c        |  4 +++-
+ hkl/hkl-macros.c          |  3 ++-
+ hkl/hkl-macros.h          |  7 +++++--
+ hkl/hkl-pseudoaxis-auto.c |  4 +++-
+ hkl/hkl-pseudoaxis.c      |  4 +++-
+ 6 files changed, 24 insertions(+), 9 deletions(-)
+
+commit ef368d3084b5f0536d9e7b4db2c48a15519639c3
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed Jun 16 18:50:56 2010 +0200
+
+    * first working version with the new config file system.
+
+ TODO                           |   17 +
+ gui/ghkl3d/cristal4C.yaml      | 1306 ++++++++++++++++++++++++++++++++++++++++
+ gui/ghkl3d/diffabs.yaml        |   46 ++
+ gui/ghkl3d/hkl3d-gui-gl.c      |    4 +-
+ gui/ghkl3d/hkl3d-gui-model.cpp |  117 ++--
+ gui/ghkl3d/hkl3d-gui-view.cpp  |    2 +-
+ gui/ghkl3d/main.cpp            |   11 +-
+ hkl3d/hkl3d.cpp                |  197 +++---
+ hkl3d/hkl3d.h                  |   20 +-
+ 9 files changed, 1562 insertions(+), 158 deletions(-)
+
+commit d8cf48fa2972f8943ad79993529df4993e408acf
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Tue Jun 15 17:23:02 2010 +0200
+
+    * add the yaml file config (work in progress) and other stuffs...
+
+ gui/DiffabsDemo/Makefile.am    |   4 +-
+ gui/ghkl3d/hkl3d-gui-model.cpp |   4 +-
+ gui/ghkl3d/hkl3d-gui-scene.cpp |   2 +-
+ gui/ghkl3d/hkl3d-gui-view.cpp  |   2 +-
+ gui/ghkl3d/main.cpp            |  26 ++-
+ hkl3d/Makefile.am              |  11 +-
+ hkl3d/hkl3d.cpp                | 439 ++++++++++++++++++++++++++++++-----------
+ hkl3d/hkl3d.h                  |  29 ++-
+ 8 files changed, 384 insertions(+), 133 deletions(-)
+
+commit 58403317f50633fdfc71970c25dbe5eadf9bea5d
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Jun 8 14:06:41 2010 +0200
+
+    fix a compilation error in hkl3d
+
+ hkl3d/hkl3d.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 1c0129a8dafa1354aa8457a408004938452da783
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Mon Jun 7 11:22:09 2010 +0200
+
+    * juste add flags to prepare the yaml integration
+
+ configure.ac | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+commit db50c61277ad813e9c82672173e972274c8cf63b
+Merge: e453046 338f69c
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 6 09:56:39 2010 +0200
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	NEWS
+    	configure.ac
+
 commit 338f69cdf5a4fb7612bce359a459d421d50d6bbe
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
 Date:   Sun Jun 6 09:50:51 2010 +0200
 
     update also the pom.xml file
 
- hkl/pom.xml |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ hkl/pom.xml | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit ebf1bfba4694543337489551d85d4843bc515f25
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -15,9 +8591,16 @@ Date:   Sun Jun 6 09:45:08 2010 +0200
 
     * update the NEWS and prepare for release
 
- NEWS         |    5 +++++
- configure.ac |    2 +-
- 2 files changed, 6 insertions(+), 1 deletions(-)
+ NEWS         | 5 +++++
+ configure.ac | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+commit e4530461ec51477a05c80434cec378b36c047614
+Merge: dba1999 fc66cc6
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun Jun 6 09:40:15 2010 +0200
+
+    Merge branch 'maint' into next
 
 commit fc66cc69da79c4adc47dddf8a9860191aa7c769d
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -25,8 +8608,8 @@ Date:   Sun Jun 6 09:35:55 2010 +0200
 
     * update the documentation
 
- Documentation/api/hkl-sections.txt |   19 ++++++++++++-------
- 1 files changed, 12 insertions(+), 7 deletions(-)
+ Documentation/api/hkl-sections.txt | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
 
 commit f0cba10fae45742b6ba717eee2c6d43014705a08
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -34,9 +8617,9 @@ Date:   Sat Jun 5 19:37:55 2010 +0200
 
     * remove all clang warnings
 
- hkl/hkl-error.c   |    2 +-
- hkl/hkl-lattice.c |    2 +-
- hkl/hkl-sample.c  |    2 +-
+ hkl/hkl-error.c   | 2 +-
+ hkl/hkl-lattice.c | 2 +-
+ hkl/hkl-sample.c  | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
 
 commit 5b3661b44d0c20a7108640f327b7e3580d9ee7e9
@@ -45,23 +8628,36 @@ Date:   Sun Jun 6 09:08:00 2010 +0200
 
     * remove all git code to avoid a GPL2 GPL3+ incompatibility
 
- hkl/Makefile.am                 |    4 +-
- hkl/hkl-geometry.c              |    8 ++-
- hkl/hkl-macros.c                |   54 +++++++++++++++++++
- hkl/hkl-macros.h                |    9 ---
- hkl/hkl-pseudoaxis-common-psi.c |    6 ++-
- hkl/usage.c                     |  110 ---------------------------------------
- test/hkl-test.c                 |    6 ++-
+ hkl/Makefile.am                 |   4 +-
+ hkl/hkl-geometry.c              |   8 +--
+ hkl/hkl-macros.c                |  54 ++++++++++++++++++++
+ hkl/hkl-macros.h                |   9 ----
+ hkl/hkl-pseudoaxis-common-psi.c |   6 ++-
+ hkl/usage.c                     | 110 ----------------------------------------
+ test/hkl-test.c                 |   6 ++-
  7 files changed, 69 insertions(+), 128 deletions(-)
 
+commit dba19995009ac71e7671b422a2feeb7d364dce97
+Merge: f92337d 1c7c172
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat Jun 5 15:52:33 2010 +0200
+
+    Merge branch 'maint' into next
+    
+    Conflicts:
+    	NEWS
+    	configure.ac
+    	gui/ghkl.cpp
+    	gui/ghkl.h
+
 commit 1c7c172fb9fc51e5d7e5dfb3995a0a80fa5ee51d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Wed Jun 2 15:27:53 2010 +0200
 
     * Fix source and include directories
 
- hkl/pom.xml |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
+ hkl/pom.xml | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
 
 commit 41604e0e53c52633356d1cd1c8af15f27e8d136c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -69,8 +8665,8 @@ Date:   Wed Jun 2 15:21:20 2010 +0200
 
     * update the pom.xml
 
- hkl/pom.xml |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ hkl/pom.xml | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit edf72c24cfb39741754af6fcb2f2a34f162c8611
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -78,10 +8674,10 @@ Date:   Wed Jun 2 15:18:07 2010 +0200
 
     * move the hkl.h file to be SOLEIL hudson friendly ;)
 
- Makefile.am     |    2 ++
- hkl.h           |    7 +++++++
- hkl/Makefile.am |    3 ---
- hkl/hkl.h       |    7 -------
+ Makefile.am     | 2 ++
+ hkl.h           | 7 +++++++
+ hkl/Makefile.am | 3 ---
+ hkl/hkl.h       | 7 -------
  4 files changed, 9 insertions(+), 10 deletions(-)
 
 commit 4cd1fc24832c7270c567334d0d83262b4e255e8e
@@ -90,8 +8686,8 @@ Date:   Wed Jun 2 11:07:16 2010 +0200
 
     * add the pom.xml for soleil compilation
 
- hkl/pom.xml |   70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 70 insertions(+), 0 deletions(-)
+ hkl/pom.xml | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 70 insertions(+)
 
 commit 8e2e695803843ed43acf9026571b9386e92ec8a9
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -99,8 +8695,8 @@ Date:   Tue Jun 1 15:08:05 2010 +0200
 
     * forgot to distribut the file ;)
 
- gui/Makefile.am |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ gui/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit ccd7c82b1a5ad0b8caa74450d17fd321660fa04c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -108,9 +8704,9 @@ Date:   Tue Jun 1 15:00:04 2010 +0200
 
     * install the .desktop file at the right place.
 
- NEWS            |    4 ++++
- gui/Makefile.am |    5 ++++-
- 2 files changed, 8 insertions(+), 1 deletions(-)
+ NEWS            | 4 ++++
+ gui/Makefile.am | 5 ++++-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
 
 commit 810ec16c0745f0777821dd010c505fa125e2ba01
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -118,11 +8714,11 @@ Date:   Tue Jun 1 14:22:48 2010 +0200
 
     * add the ghkl man page and the .desktop file.
 
- Documentation/Makefile.am |    2 +
- Documentation/ghkl.1      |   53 +++++++++++++++++++++++++++++++++++++++++++++
- gui/Makefile.am           |    2 +-
- gui/ghkl.desktop          |   10 ++++++++
- 4 files changed, 66 insertions(+), 1 deletions(-)
+ Documentation/Makefile.am |  2 ++
+ Documentation/ghkl.1      | 53 +++++++++++++++++++++++++++++++++++++++++++++++
+ gui/Makefile.am           |  2 +-
+ gui/ghkl.desktop          | 10 +++++++++
+ 4 files changed, 66 insertions(+), 1 deletion(-)
 
 commit 4702e6053fc4f26e6ec65726c1998518524ae3b2
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -130,9 +8726,9 @@ Date:   Tue Jun 1 14:21:08 2010 +0200
 
     * connect the quit menu item with the gtk_main_quit method
 
- gui/ghkl.cpp |    3 +++
- gui/ghkl.h   |    1 +
- 2 files changed, 4 insertions(+), 0 deletions(-)
+ gui/ghkl.cpp | 3 +++
+ gui/ghkl.h   | 1 +
+ 2 files changed, 4 insertions(+)
 
 commit 524477c58f7e69b54b9b57a7d5691bf83ce59ec7
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -140,8 +8736,531 @@ Date:   Tue Jun 1 14:20:32 2010 +0200
 
     * post release revision number bump
 
- configure.ac |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit f92337dbc8221e08be95bd11c61891cd9abf1acf
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 23:38:27 2010 +0200
+
+    * lets reduce number of copy of the holder idx (common to geometries)
+
+ hkl/hkl-geometry.c | 67 ++++++++++++++++++++++++++++++++++++++++--------------
+ hkl/hkl-geometry.h |  8 +++++--
+ 2 files changed, 56 insertions(+), 19 deletions(-)
+
+commit 89d43925c6d3021d145fb9006e41b8abf33a749a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 18:00:48 2010 +0200
+
+    * remove for real the hkl-list.h file
+
+ hkl/Makefile.am    |  1 -
+ hkl/hkl-geometry.h |  1 -
+ hkl/hkl-list.h     | 88 ------------------------------------------------------
+ hkl/hkl-sample.h   |  1 -
+ 4 files changed, 91 deletions(-)
+
+commit 7d627f49fb1ddaae9eee44995890d03f5debfbf5
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 17:53:08 2010 +0200
+
+    * remove a memory leak
+
+ hkl/hkl-pseudoaxis.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 41865ed6b8cf2ed96249d51002843931c325ce2f
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 17:47:48 2010 +0200
+
+    * one less
+
+ gui/ghkl.cpp     |  2 +-
+ hkl/hkl-sample.c | 74 ++++++++++++++++++++++++++++++++++++++------------------
+ hkl/hkl-sample.h |  4 ++-
+ 3 files changed, 54 insertions(+), 26 deletions(-)
+
+commit a4104c18b6bb15425ab7616ea0bec0f9c7bd541e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 17:08:59 2010 +0200
+
+    * one less
+
+ gui/ghkl.cpp               |  2 +-
+ hkl/hkl-sample.c           | 51 +++++++++++++++++++++++++++++-----------------
+ hkl/hkl-sample.h           |  3 ++-
+ test/hkl/hkl-test-sample.c |  4 ++--
+ 4 files changed, 37 insertions(+), 23 deletions(-)
+
+commit c8069a60b47c424401051b5550047024b8c310ef
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 16:46:19 2010 +0200
+
+    * one less
+
+ gui/ghkl.cpp                   |  4 ++--
+ hkl/hkl-pseudoaxis.c           | 23 +++++++++++++++--------
+ hkl/hkl-pseudoaxis.h           |  3 ++-
+ test/hkl/hkl-test-pseudoaxis.c |  2 +-
+ 4 files changed, 20 insertions(+), 12 deletions(-)
+
+commit 3de4d27eae53770ed9721b27ead83fa6b5d599d7
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 16:32:44 2010 +0200
+
+    * still working on the removal
+
+ gui/ghkl.cpp                    |  2 +-
+ gui/pseudoaxesframe.cpp         |  2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c |  2 +-
+ hkl/hkl-pseudoaxis.c            | 13 +++++++++----
+ hkl/hkl-pseudoaxis.h            |  3 ++-
+ test/hkl/hkl-test-pseudoaxis.c  |  4 ++--
+ 6 files changed, 16 insertions(+), 10 deletions(-)
+
+commit a117edfb8e269ee14236ac01ceb2346e354c5214
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 16:19:26 2010 +0200
+
+    * one more
+
+ hkl/hkl-pseudoaxis-auto.c       |  4 ++--
+ hkl/hkl-pseudoaxis-common-hkl.c |  6 +++---
+ hkl/hkl-pseudoaxis-common-psi.c |  2 +-
+ hkl/hkl-pseudoaxis-common-q.c   |  4 ++--
+ hkl/hkl-pseudoaxis.c            | 10 ++++++----
+ hkl/hkl-pseudoaxis.h            |  3 ++-
+ 6 files changed, 16 insertions(+), 13 deletions(-)
+
+commit 3c84ba1924c53f28b738844c8d3991d45c2d7744
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 16:07:32 2010 +0200
+
+    * one more
+
+ gui/pseudoaxesframe.cpp             |  4 ++--
+ hkl/hkl-pseudoaxis.c                | 15 +++++++++++----
+ hkl/hkl-pseudoaxis.h                |  3 ++-
+ test/hkl/bench.c                    |  4 ++--
+ test/hkl/hkl-test-pseudoaxis-e4cv.c |  6 +++---
+ test/hkl/hkl-test-pseudoaxis-e6c.c  |  4 ++--
+ test/hkl/hkl-test-pseudoaxis-k4cv.c |  6 +++---
+ test/hkl/hkl-test-pseudoaxis-k6c.c  |  6 +++---
+ test/hkl/hkl-test-pseudoaxis.c      |  2 +-
+ 9 files changed, 29 insertions(+), 21 deletions(-)
+
+commit f9e045de397cfd52b811ad5775b63b519165b675
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 15:53:27 2010 +0200
+
+    * one more HKL_LIST removal
+
+ hkl/hkl-pseudoaxis.c | 12 +++++++-----
+ hkl/hkl-pseudoaxis.h |  3 ++-
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+commit 63784e2a981ea912ef00032f5502dfdf5ca7a305
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 15:43:24 2010 +0200
+
+    * still removing the HKL_LIST
+
+ gui/ghkl.cpp                        |  4 ++--
+ gui/pseudoaxesframe.cpp             |  2 +-
+ hkl/hkl-list.h                      |  2 +-
+ hkl/hkl-pseudoaxis.c                | 12 +++++++-----
+ hkl/hkl-pseudoaxis.h                |  3 ++-
+ test/hkl/bench.c                    |  2 +-
+ test/hkl/hkl-test-pseudoaxis-e4cv.c |  2 +-
+ test/hkl/hkl-test-pseudoaxis-e6c.c  |  2 +-
+ test/hkl/hkl-test-pseudoaxis-k6c.c  |  2 +-
+ test/hkl/hkl-test-pseudoaxis.c      |  2 +-
+ 10 files changed, 18 insertions(+), 15 deletions(-)
+
+commit 434df505036ca1f1e8eac2bc1f0063ac19c40c66
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 31 15:43:04 2010 +0200
+
+    * correct the gui part due to the HKL_LIST removal
+
+ gui/ghkl-callbacks.cpp  | 4 ++--
+ gui/ghkl.cpp            | 8 ++++----
+ gui/modelcolumns.h      | 2 +-
+ gui/pseudoaxesframe.cpp | 2 +-
+ hkl3d/hkl3d.cpp         | 6 +++---
+ 5 files changed, 11 insertions(+), 11 deletions(-)
+
+commit 97220cc65aab9dab098b47ca089862f67765fd8a
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun May 30 12:25:07 2010 +0200
+
+    * still removing HKL_LIST
+
+ hkl/hkl-pseudoaxis-auto.c |  2 +-
+ hkl/hkl-pseudoaxis.c      | 10 ++++++----
+ hkl/hkl-pseudoaxis.h      |  3 ++-
+ 3 files changed, 9 insertions(+), 6 deletions(-)
+
+commit 6e1a525bf5c186d3d121ea09751a7bbfff7d2ca2
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun May 30 10:05:41 2010 +0200
+
+    * make the hkl_geometry_list_item method private
+
+ hkl/hkl-geometry.c                  | 71 ++++++++++++++++---------------------
+ hkl/hkl-geometry.h                  | 10 +-----
+ hkl/hkl-pseudoaxis-factory.c        |  4 +--
+ test/hkl/bench.c                    |  2 +-
+ test/hkl/hkl-test-geometry.c        |  6 ++--
+ test/hkl/hkl-test-pseudoaxis-e4cv.c |  8 ++---
+ test/hkl/hkl-test-pseudoaxis-e6c.c  |  4 +--
+ test/hkl/hkl-test-pseudoaxis-k4cv.c |  8 ++---
+ test/hkl/hkl-test-pseudoaxis-k6c.c  | 14 ++++----
+ test/hkl/hkl-test-pseudoaxis.c      |  2 +-
+ 10 files changed, 55 insertions(+), 74 deletions(-)
+
+commit 7529b59bf624d2fbb4afc348e910d0b1db216dfa
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sun May 30 09:45:58 2010 +0200
+
+    * still removing HKL_LIST
+
+ hkl/hkl-geometry.c           | 82 ++++++++++++++++++++++++++++----------------
+ hkl/hkl-geometry.h           |  4 ++-
+ test/hkl/hkl-test-geometry.c | 10 +++---
+ 3 files changed, 60 insertions(+), 36 deletions(-)
+
+commit b2e663ff322ae47dfca3b95952758c70c2c590ef
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat May 29 22:39:12 2010 +0200
+
+    * still removing HKL_LIST
+
+ hkl/hkl-geometry.c | 72 +++++++++++++++++++++++++-----------------------------
+ hkl/hkl-geometry.h |  3 ++-
+ hkl/hkl-sample.c   |  7 ++----
+ 3 files changed, 37 insertions(+), 45 deletions(-)
+
+commit 3e32ddcdf573913289c49d0dfb97291e5c776c67
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat May 29 22:19:43 2010 +0200
+
+    * more HKL_LIST remove
+
+ hkl/hkl-geometry.c           | 32 +++++++++++++-------------------
+ hkl/hkl-geometry.h           |  3 ++-
+ test/hkl/hkl-test-geometry.c |  6 +++---
+ 3 files changed, 18 insertions(+), 23 deletions(-)
+
+commit 08a1cf7f125aaea651113773fd389dce8d4817f5
+Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+Date:   Sat May 29 22:05:21 2010 +0200
+
+    * remove the HKL_LIST from HklHolder
+
+ hkl/hkl-geometry.c | 23 +++++++++++++----------
+ hkl/hkl-geometry.h |  3 ++-
+ 2 files changed, 15 insertions(+), 11 deletions(-)
+
+commit c802593fbc8b460d7a304f5ef04cc780af3cdbd6
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Tue May 25 17:05:36 2010 +0200
+
+    * add the addFromFile method.
+
+ gui/ghkl3d/hkl3d-gui-model.cpp |  14 ++++--
+ gui/ghkl3d/hkl3d-gui-scene.cpp |   2 +-
+ hkl3d/hkl3d.cpp                | 101 ++++++++++++++++++++++++++++++++---------
+ hkl3d/hkl3d.h                  |   5 +-
+ 4 files changed, 93 insertions(+), 29 deletions(-)
+
+commit a7f648c78eed50c5c97f6d1696704b2bd242016a
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri May 21 12:26:35 2010 +0200
+
+    * decrease the World boundaries.
+
+ hkl3d/hkl3d.cpp | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+commit 00125d483c6218ce3a9c3f53268de964a78ebc34
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri May 21 12:25:50 2010 +0200
+
+    * add the serialization
+
+ configure.ac                                       |    3 +
+ hkl3d/Makefile.am                                  |   10 +-
+ hkl3d/Serialize/BulletFileLoader/Makefile.am       |   74 ++
+ hkl3d/Serialize/BulletFileLoader/bChunk.cpp        |   75 ++
+ hkl3d/Serialize/BulletFileLoader/bChunk.h          |   90 ++
+ hkl3d/Serialize/BulletFileLoader/bCommon.h         |   39 +
+ hkl3d/Serialize/BulletFileLoader/bDNA.cpp          |  636 ++++++++++
+ hkl3d/Serialize/BulletFileLoader/bDNA.h            |  110 ++
+ hkl3d/Serialize/BulletFileLoader/bDefines.h        |  140 +++
+ hkl3d/Serialize/BulletFileLoader/bFile.cpp         | 1322 ++++++++++++++++++++
+ hkl3d/Serialize/BulletFileLoader/bFile.h           |  153 +++
+ hkl3d/Serialize/BulletFileLoader/btBulletFile.cpp  |  384 ++++++
+ hkl3d/Serialize/BulletFileLoader/btBulletFile.h    |   78 ++
+ hkl3d/Serialize/BulletFileLoader/bullet.h          |   69 +
+ hkl3d/Serialize/BulletFileLoader/bullet_Common.h   |   77 ++
+ hkl3d/Serialize/BulletFileLoader/bullet_ListBase.h |   40 +
+ .../BulletFileLoader/bullet_PointerArray.h         |   41 +
+ .../BulletFileLoader/bullet_btBvhSubtreeInfoData.h |   42 +
+ .../BulletFileLoader/bullet_btCapsuleShapeData.h   |   42 +
+ .../bullet_btCollisionObjectDoubleData.h           |   64 +
+ .../bullet_btCollisionObjectFloatData.h            |   63 +
+ .../BulletFileLoader/bullet_btCollisionShapeData.h |   41 +
+ .../bullet_btCompoundShapeChildData.h              |   43 +
+ .../BulletFileLoader/bullet_btCompoundShapeData.h  |   43 +
+ .../bullet_btConeTwistConstraintData.h             |   51 +
+ .../BulletFileLoader/bullet_btConstraintInfo1.h    |   40 +
+ .../bullet_btConvexHullShapeData.h                 |   44 +
+ .../bullet_btConvexInternalShapeData.h             |   45 +
+ .../BulletFileLoader/bullet_btCylinderShapeData.h  |   42 +
+ .../bullet_btGImpactMeshShapeData.h                |   46 +
+ .../bullet_btGeneric6DofConstraintData.h           |   50 +
+ .../bullet_btHingeConstraintDoubleData.h           |   53 +
+ .../bullet_btHingeConstraintFloatData.h            |   53 +
+ .../BulletFileLoader/bullet_btIntIndexData.h       |   39 +
+ .../bullet_btMatrix3x3DoubleData.h                 |   40 +
+ .../BulletFileLoader/bullet_btMatrix3x3FloatData.h |   40 +
+ .../BulletFileLoader/bullet_btMeshPartData.h       |   45 +
+ .../bullet_btMultiSphereShapeData.h                |   43 +
+ .../bullet_btOptimizedBvhNodeDoubleData.h          |   45 +
+ .../bullet_btOptimizedBvhNodeFloatData.h           |   45 +
+ .../BulletFileLoader/bullet_btPhysicsSystem.h      |   42 +
+ .../bullet_btPoint2PointConstraintDoubleData.h     |   43 +
+ .../bullet_btPoint2PointConstraintFloatData.h      |   43 +
+ .../BulletFileLoader/bullet_btPositionAndRadius.h  |   41 +
+ .../bullet_btQuantizedBvhDoubleData.h              |   51 +
+ .../bullet_btQuantizedBvhFloatData.h               |   51 +
+ .../bullet_btQuantizedBvhNodeData.h                |   41 +
+ .../bullet_btRigidBodyDoubleData.h                 |   63 +
+ .../BulletFileLoader/bullet_btRigidBodyFloatData.h |   62 +
+ .../BulletFileLoader/bullet_btShortIntIndexData.h  |   40 +
+ .../bullet_btShortIntIndexTripletData.h            |   40 +
+ .../bullet_btSliderConstraintData.h                |   49 +
+ .../bullet_btStaticPlaneShapeData.h                |   45 +
+ .../bullet_btStridingMeshInterfaceData.h           |   43 +
+ .../bullet_btTransformDoubleData.h                 |   42 +
+ .../BulletFileLoader/bullet_btTransformFloatData.h |   42 +
+ .../BulletFileLoader/bullet_btTriangleInfoData.h   |   42 +
+ .../bullet_btTriangleInfoMapData.h                 |   52 +
+ .../bullet_btTriangleMeshShapeData.h               |   47 +
+ .../bullet_btTypedConstraintData.h                 |   49 +
+ .../BulletFileLoader/bullet_btVector3DoubleData.h  |   39 +
+ .../BulletFileLoader/bullet_btVector3FloatData.h   |   39 +
+ hkl3d/Serialize/BulletWorldImporter/Makefile.am    |   18 +
+ .../BulletWorldImporter/btBulletWorldImporter.cpp  | 1205 ++++++++++++++++++
+ .../BulletWorldImporter/btBulletWorldImporter.h    |  180 +++
+ hkl3d/Serialize/Makefile.am                        |    1 +
+ hkl3d/hkl3d.cpp                                    |  126 +-
+ hkl3d/hkl3d.h                                      |    1 +
+ 68 files changed, 6925 insertions(+), 12 deletions(-)
+
+commit b4c86f9e05bbccdbc1de8c554b5fd6eb8f8ff19d
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri May 21 12:20:18 2010 +0200
+
+    * indentation
+
+ hkl3d/ConvexDecomposition/ConvexDecomposition.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 53ebf2b6dad5baf5da6209f99ac1303c34a6634b
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri May 21 12:20:05 2010 +0200
+
+    * increase the timeout
+
+ gui/ghkl3d/hkl3d-gui-scene.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit bb0ec310be0cedd336d4b03f3316bb089d4bd111
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri May 21 12:17:03 2010 +0200
+
+    *split isColliding method on isColliding and applyTransformation
+
+ hkl3d/hkl3d.cpp | 16 +++++++++++-----
+ hkl3d/hkl3d.h   |  6 +++---
+ 2 files changed, 14 insertions(+), 8 deletions(-)
+
+commit 7c75685d6ad85649b91d358903c3cf8091eaccea
+Merge: 44e36d5 031ac8b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 17 17:51:39 2010 +0200
+
+    Merge branch 'next' of ssh://dent-de-scie/home/oussama/hkl into next
+
+commit 44e36d54d3a2d6edaad41b7535c68afd457b0d9a
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 17 15:08:15 2010 +0200
+
+    * add an --enable-hkl3d option
+
+ Makefile.am            |  2 +-
+ NEWS                   |  1 +
+ configure.ac           | 10 ++++++----
+ gui/Makefile.am        | 23 ++++++++++++++++-------
+ gui/ghkl-callbacks.cpp | 15 +++++++++++++++
+ gui/ghkl.cpp           |  6 ++++++
+ gui/ghkl.h             |  9 +++++++--
+ gui/main.cpp           |  2 ++
+ 8 files changed, 54 insertions(+), 14 deletions(-)
+
+commit eded4593a511dd6c3211f389cbe981021c9073e3
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 17 14:20:25 2010 +0200
+
+    * use the right SUBDIRS order
+
+ Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 77fd2b9461a87b21be5712f7a4726107ddf9f4c4
+Merge: 2f3a1dc af18474
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 17 11:19:41 2010 +0200
+
+    Merge branch 'master' into next
+    
+    Conflicts:
+    	Makefile.am
+    	NEWS
+    	configure.ac
+    	gui/Makefile.am
+
+commit 031ac8b8132c0dca4bf457be57eb2a9573396ad1
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Mon May 17 09:19:44 2010 +0200
+
+    *Perform colors for Bullet render
+
+ gui/DiffabsDemo/DiffabsDemo.cpp                          |  3 +--
+ gui/ghkl3d/hkl3d-gui-model.cpp                           |  5 +----
+ hkl3d/GIMPACTUtils/btGImpactConvexDecompositionShape.cpp |  4 ++--
+ hkl3d/hkl3d.cpp                                          | 10 ++--------
+ hkl3d/hkl3d.h                                            |  7 +------
+ 5 files changed, 7 insertions(+), 22 deletions(-)
+
+commit 2f3a1dc17ae8581ce6266f2d3743b9218defb325
+Merge: 2f445b8 ee5f6d0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 17 09:09:29 2010 +0200
+
+    Merge branch 'next' of ssh://dent-de-scie/home/oussama/hkl into next
+    
+    Conflicts:
+    	hkl3d/hkl3d.cpp
+
+commit ee5f6d0205d0ea3517211fc474ad256e50838102
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed May 12 17:32:21 2010 +0200
+
+    *In drawSphere method
+    use GL_QUADS instead of GL LINES in order to perform sphere render
+
+ gui/ghkl3d/hkl3d-gui-model.cpp | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+commit e155dfbaf3171ea10905e54e5931ef5a2c45621c
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed May 12 16:56:59 2010 +0200
+
+    * Collect all hkl3D vectors in one structure hkl3dObject structure and move the render test callback to isColliding method
+
+ gui/DiffabsDemo/DiffabsDemo.cpp | 27 ++-----------
+ gui/ghkl3d/hkl3d-gui-model.cpp  | 90 ++++++++++++++++-------------------------
+ gui/ghkl3d/hkl3d-gui-model.h    |  1 -
+ hkl3d/hkl3d.cpp                 | 62 +++++++++++++++++++++-------
+ hkl3d/hkl3d.h                   | 19 +++++----
+ 5 files changed, 98 insertions(+), 101 deletions(-)
+
+commit 2f445b8d65709965644c563a3d9b5f0e37f81456
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed May 12 13:17:26 2010 +0200
+
+    * update the TODO and NEWS fles
+
+ NEWS | 2 ++
+ TODO | 3 ++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+commit 6376c000e8ede16835bc3cf758da34ecd3012764
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed May 12 13:13:35 2010 +0200
+
+    * add the 3D view to ghkl
+
+ gui/Makefile.am        | 12 +++++++--
+ gui/ghkl-callbacks.cpp | 21 ++++++++++++++++
+ gui/ghkl.cpp           | 38 +++++++++++++++++++++++++++--
+ gui/ghkl.h             |  7 ++++++
+ gui/ghkl.ui            | 66 +++++++++++++++++++++++++++++++++-----------------
+ gui/ghkl3d/Makefile.am |  9 ++++---
+ gui/main.cpp           |  1 +
+ hkl3d/hkl3d.cpp        |  9 ++++---
+ 8 files changed, 130 insertions(+), 33 deletions(-)
+
+commit e8467ad9360312af35c54a1ce50573e586ec78e8
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed May 12 10:43:12 2010 +0200
+
+    * one more missing file.
+
+ gui/ghkl3d/ghkl3d.ui | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 218 insertions(+)
+
+commit f93d79b01f9a3391a064f9aed800fdaae1a074d8
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed May 12 10:37:47 2010 +0200
+
+    * forgotten file
+
+ hkl3d/ConvexDecomposition/concavity.cpp | 795 ++++++++++++++++++++++++++++++++
+ 1 file changed, 795 insertions(+)
+
+commit a6167affcbfd01997791d0706fadcd39dcb7cb8e
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Wed May 12 10:29:09 2010 +0200
+
+    Perform rendering(alpha=0.5 if object collide else alpha=1)
+
+ gui/ghkl3d/hkl3d-gui-gl.c                          |  2 +-
+ gui/ghkl3d/hkl3d-gui-model.cpp                     | 75 +++++++++++++++++-----
+ gui/ghkl3d/hkl3d-gui-model.h                       |  5 +-
+ .../btGImpactConvexDecompositionShape.cpp          |  2 +-
+ hkl3d/hkl3d.cpp                                    | 18 ++++--
+ hkl3d/hkl3d.h                                      |  7 +-
+ 6 files changed, 83 insertions(+), 26 deletions(-)
+
+commit b4c6b60a341517d468fc7dd3000f16bee1716217
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Wed May 12 10:26:00 2010 +0200
+
+    * correct the hkl3d test method to catch collision and no-collision
+
+ test/hkl3d/main.cpp | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+commit 3757e599cadac6e9a16a2c32c819dfe2db831c4c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 10 16:47:26 2010 +0200
+
+    * create the libhkl3d-gui library for inclusion in the ghkl program
+
+ gui/ghkl3d/Makefile.am | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+commit 98f1775e1b21c80cf84b451782b6e4e2321686ea
+Merge: be6187a 5764e2c
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Mon May 10 16:23:24 2010 +0200
+
+    Merge remote branch 'oussama/next' into next
 
 commit af18474e605e5b49db3ad71071d96ebabadd9402
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -149,9 +9268,23 @@ Date:   Mon May 10 16:11:26 2010 +0200
 
     * show the preference dialogue from the begining.
 
- NEWS        |    1 +
- gui/ghkl.ui |    1 +
- 2 files changed, 2 insertions(+), 0 deletions(-)
+ NEWS        | 1 +
+ gui/ghkl.ui | 1 +
+ 2 files changed, 2 insertions(+)
+
+commit 5764e2c61103e04eced290dd1aba62811e64bb69
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Mon May 10 14:01:58 2010 +0200
+
+    Render coordinate system and perform aabb box rendering
+
+ gui/ghkl3d/hkl3d-gui-application.cpp               |   4 +-
+ gui/ghkl3d/hkl3d-gui-model.cpp                     | 178 +++++++--------------
+ gui/ghkl3d/hkl3d-gui-model.h                       |  21 ++-
+ gui/ghkl3d/hkl3d-gui-scene.cpp                     |  44 +++--
+ gui/ghkl3d/hkl3d-gui-scene.h                       |  11 +-
+ .../btGImpactConvexDecompositionShape.cpp          |   6 -
+ 6 files changed, 118 insertions(+), 146 deletions(-)
 
 commit fdfdb36e63f1c1cd646f613f68d1f395b3ad5e22
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -159,9 +9292,9 @@ Date:   Mon May 10 13:31:32 2010 +0200
 
     * add the --enable-ghkl flag to the configure script.
 
- Makefile.am  |    6 +++++-
- NEWS         |    5 +++++
- configure.ac |   14 +++++++++++++-
+ Makefile.am  |  6 +++++-
+ NEWS         |  5 +++++
+ configure.ac | 14 +++++++++++++-
  3 files changed, 23 insertions(+), 2 deletions(-)
 
 commit b3ed054335cb856f9a086c18ac46c99c5f6603c1
@@ -170,8 +9303,8 @@ Date:   Mon May 10 11:50:11 2010 +0200
 
     * add the gsl dependencies to the ghkl program.
 
- gui/Makefile.am |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ gui/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit 6568016fe9a6d0f9b283411222133ee3284c797b
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -179,8 +9312,8 @@ Date:   Mon May 10 11:49:45 2010 +0200
 
     * bump the version
 
- configure.ac |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit a34b077e576f72c3e895e2f53c58368e26bd3c6d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -188,18 +9321,645 @@ Date:   Mon May 10 11:46:17 2010 +0200
 
     * fix the ghkl .ui load exception.
 
- gui/ghkl.cpp            |    4 +++-
- gui/pseudoaxesframe.cpp |    4 +++-
+ gui/ghkl.cpp            | 4 +++-
+ gui/pseudoaxesframe.cpp | 4 +++-
  2 files changed, 6 insertions(+), 2 deletions(-)
 
+commit b25b29a535d8589441f4f5d5056b2cce64c9ed05
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri May 7 18:49:45 2010 +0200
+
+    delete space
+
+ gui/DiffabsDemo/DiffabsDemo.cpp | 4 ----
+ 1 file changed, 4 deletions(-)
+
+commit a12af7ab848af3a91932cae06acfbbfb63880e8f
+Author: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+Date:   Fri May 7 18:46:00 2010 +0200
+
+    Raise Time out and achieve the AAbbBox render
+
+ gui/DiffabsDemo/DiffabsDemo.cpp                    |  18 ++--
+ gui/ghkl3d/hkl3d-gui-model.cpp                     | 100 +++++++++++++++------
+ gui/ghkl3d/hkl3d-gui-model.h                       |   4 +-
+ gui/ghkl3d/hkl3d-gui-scene.cpp                     |   2 +-
+ .../btGImpactConvexDecompositionShape.cpp          |   2 +-
+ 5 files changed, 91 insertions(+), 35 deletions(-)
+
+commit be6187a29dfb18cf0fb3ecf665360fd9d3f18b4b
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri May 7 13:16:47 2010 +0200
+
+    * update the news file
+
+ NEWS | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit 459d644348d961bb5a7700414a0108069bbd8638
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri May 7 11:05:28 2010 +0200
+
+    * add one mode missing file.
+
+ gui/ghkl3d/ghkl3d.ui | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 218 insertions(+)
+
+commit 3c27e8e6d232ddfa7df96e193d061755de82f7d0
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri May 7 10:47:58 2010 +0200
+
+    * forgot a file
+
+ hkl3d/ConvexDecomposition/concavity.cpp | 795 ++++++++++++++++++++++++++++++++
+ 1 file changed, 795 insertions(+)
+
+commit 26a23e3e2f3aa56047418cb8338376900bdc5d0e
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri May 7 10:32:34 2010 +0200
+
+    * reduce the dependency
+
+ gui/DiffabsDemo/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 46fa1e0664206954290a281cd040f1f2ad1f4103
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri May 7 09:57:20 2010 +0200
+
+    * add all the hkl3d gui part.
+
+ configure.ac                          |    5 +
+ gui/DiffabsDemo/DiffabsDemo.cpp       |  234 ++++++
+ gui/DiffabsDemo/DiffabsDemo.h         |   75 ++
+ gui/DiffabsDemo/Makefile.am           |   33 +
+ gui/DiffabsDemo/main.cpp              |   50 ++
+ gui/Makefile.am                       |    2 +
+ gui/OpenGL/DebugCastResult.h          |   88 +++
+ gui/OpenGL/DemoApplication.cpp        | 1316 +++++++++++++++++++++++++++++++++
+ gui/OpenGL/DemoApplication.h          |  246 ++++++
+ gui/OpenGL/GLDebugDrawer.cpp          |  140 ++++
+ gui/OpenGL/GLDebugDrawer.h            |   38 +
+ gui/OpenGL/GLDebugFont.cpp            |  987 +++++++++++++++++++++++++
+ gui/OpenGL/GLDebugFont.h              |   27 +
+ gui/OpenGL/GL_DialogDynamicsWorld.cpp |  739 ++++++++++++++++++
+ gui/OpenGL/GL_DialogDynamicsWorld.h   |   91 +++
+ gui/OpenGL/GL_DialogWindow.cpp        |  336 +++++++++
+ gui/OpenGL/GL_DialogWindow.h          |  283 +++++++
+ gui/OpenGL/GL_ShapeDrawer.cpp         |  985 ++++++++++++++++++++++++
+ gui/OpenGL/GL_ShapeDrawer.h           |   70 ++
+ gui/OpenGL/GL_Simplex1to4.cpp         |   73 ++
+ gui/OpenGL/GL_Simplex1to4.h           |   40 +
+ gui/OpenGL/GlutDemoApplication.cpp    |   71 ++
+ gui/OpenGL/GlutDemoApplication.h      |   34 +
+ gui/OpenGL/GlutStuff.cpp              |  109 +++
+ gui/OpenGL/GlutStuff.h                |   84 +++
+ gui/OpenGL/Makefile.am                |   33 +
+ gui/OpenGL/RenderTexture.cpp          |   86 +++
+ gui/OpenGL/RenderTexture.h            |   73 ++
+ gui/OpenGL/Win32AppMain.cpp           |  402 ++++++++++
+ gui/OpenGL/Win32DemoApplication.cpp   |   79 ++
+ gui/OpenGL/Win32DemoApplication.h     |   40 +
+ gui/ghkl3d/Makefile.am                |   53 ++
+ gui/ghkl3d/hkl3d-gui-application.cpp  |  201 +++++
+ gui/ghkl3d/hkl3d-gui-application.h    |   81 ++
+ gui/ghkl3d/hkl3d-gui-gl.c             |  814 ++++++++++++++++++++
+ gui/ghkl3d/hkl3d-gui-gl.h             |   64 ++
+ gui/ghkl3d/hkl3d-gui-model.cpp        |  316 ++++++++
+ gui/ghkl3d/hkl3d-gui-model.h          |  157 ++++
+ gui/ghkl3d/hkl3d-gui-scene.cpp        |  403 ++++++++++
+ gui/ghkl3d/hkl3d-gui-scene.h          |  112 +++
+ gui/ghkl3d/hkl3d-gui-view.cpp         |  171 +++++
+ gui/ghkl3d/hkl3d-gui-view.h           |  108 +++
+ gui/ghkl3d/main.cpp                   |   66 ++
+ gui/ghkl3d/texture.c                  |   43 ++
+ gui/ghkl3d/texture.h                  |   30 +
+ gui/ghkl3d/trackball.c                |  324 ++++++++
+ gui/ghkl3d/trackball.h                |   78 ++
+ 47 files changed, 9890 insertions(+)
+
+commit 60245c6e789557697dc75c460e35eff3713e7673
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri May 7 09:33:40 2010 +0200
+
+    * resynchronize with the hkl3d project.
+
+ configure.ac                                       |    2 +
+ hkl3d/ConvexDecomposition/ConvexBuilder.cpp        |  373 +++
+ hkl3d/ConvexDecomposition/ConvexBuilder.h          |  112 +
+ hkl3d/ConvexDecomposition/ConvexDecomposition.cpp  |  375 +++
+ hkl3d/ConvexDecomposition/ConvexDecomposition.h    |  220 ++
+ hkl3d/ConvexDecomposition/Makefile.am              |   43 +
+ hkl3d/ConvexDecomposition/bestfit.cpp              |  466 +++
+ hkl3d/ConvexDecomposition/bestfit.h                |   65 +
+ hkl3d/ConvexDecomposition/bestfitobb.cpp           |  173 ++
+ hkl3d/ConvexDecomposition/bestfitobb.h             |   43 +
+ hkl3d/ConvexDecomposition/cd_hull.cpp              | 3257 ++++++++++++++++++++
+ hkl3d/ConvexDecomposition/cd_hull.h                |  153 +
+ hkl3d/ConvexDecomposition/cd_vector.h              | 1185 +++++++
+ hkl3d/ConvexDecomposition/cd_wavefront.cpp         |  860 ++++++
+ hkl3d/ConvexDecomposition/cd_wavefront.h           |   62 +
+ hkl3d/ConvexDecomposition/concavity.h              |   60 +
+ hkl3d/ConvexDecomposition/fitsphere.cpp            |  202 ++
+ hkl3d/ConvexDecomposition/fitsphere.h              |   43 +
+ hkl3d/ConvexDecomposition/float_math.cpp           |  257 ++
+ hkl3d/ConvexDecomposition/float_math.h             |   72 +
+ hkl3d/ConvexDecomposition/meshvolume.cpp           |  128 +
+ hkl3d/ConvexDecomposition/meshvolume.h             |   45 +
+ hkl3d/ConvexDecomposition/planetri.cpp             |  238 ++
+ hkl3d/ConvexDecomposition/planetri.h               |   58 +
+ hkl3d/ConvexDecomposition/raytri.cpp               |  134 +
+ hkl3d/ConvexDecomposition/raytri.h                 |   45 +
+ hkl3d/ConvexDecomposition/splitplane.cpp           |  306 ++
+ hkl3d/ConvexDecomposition/splitplane.h             |   59 +
+ hkl3d/ConvexDecomposition/vlookup.cpp              |  307 ++
+ hkl3d/ConvexDecomposition/vlookup.h                |  119 +
+ hkl3d/GIMPACTUtils/Makefile.am                     |   18 +
+ .../btGImpactConvexDecompositionShape.cpp          |  240 ++
+ .../btGImpactConvexDecompositionShape.h            |   87 +
+ hkl3d/Makefile.am                                  |    8 +-
+ hkl3d/hkl3d.cpp                                    |   31 +-
+ 35 files changed, 9829 insertions(+), 17 deletions(-)
+
+commit bd24ad05b233bd93160dba47d53c7ccb8b71ac38
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Fri May 7 09:02:19 2010 +0200
+
+    * put the models in to my opinion, the right place
+
+ data/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit d0d160df5adc46e32c8587a3a72fdf3bee53d509
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue May 4 12:29:17 2010 +0200
+
+    * add the hkl3d library
+
+ Makefile.am                                        |    6 +-
+ configure.ac                                       |  102 +-
+ data/Makefile.am                                   |    2 +
+ data/diffabs.dae                                   |  701 +++++
+ gui/ghkl.cpp                                       |    6 +-
+ hkl3d.pc.in                                        |   12 +
+ hkl3d/Makefile.am                                  |   36 +
+ hkl3d/bullet/AUTHORS                               |   22 +
+ hkl3d/bullet/BulletLicense.txt                     |   18 +
+ hkl3d/bullet/COPYING                               |  674 +++++
+ hkl3d/bullet/ChangeLog                             |  755 +++++
+ hkl3d/bullet/Doxyfile                              |  768 +++++
+ hkl3d/bullet/LICENSE                               |   19 +
+ hkl3d/bullet/Makefile.am                           |    3 +
+ hkl3d/bullet/NEWS                                  |    4 +
+ hkl3d/bullet/README                                |    7 +
+ hkl3d/bullet/RELEASING.TXT                         |   34 +
+ hkl3d/bullet/VERSION                               |    1 +
+ hkl3d/bullet/bullet.pc                             |   11 +
+ hkl3d/bullet/src/Bullet-C-Api.h                    |  176 ++
+ .../BroadphaseCollision/btAxisSweep3.cpp           |   37 +
+ .../BroadphaseCollision/btAxisSweep3.h             | 1051 +++++++
+ .../BroadphaseCollision/btBroadphaseInterface.h    |   82 +
+ .../BroadphaseCollision/btBroadphaseProxy.cpp      |   17 +
+ .../BroadphaseCollision/btBroadphaseProxy.h        |  270 ++
+ .../BroadphaseCollision/btCollisionAlgorithm.cpp   |   23 +
+ .../BroadphaseCollision/btCollisionAlgorithm.h     |   80 +
+ .../BulletCollision/BroadphaseCollision/btDbvt.cpp | 1295 +++++++++
+ .../BulletCollision/BroadphaseCollision/btDbvt.h   | 1256 +++++++++
+ .../BroadphaseCollision/btDbvtBroadphase.cpp       |  796 ++++++
+ .../BroadphaseCollision/btDbvtBroadphase.h         |  146 +
+ .../BroadphaseCollision/btDispatcher.cpp           |   22 +
+ .../BroadphaseCollision/btDispatcher.h             |  106 +
+ .../BroadphaseCollision/btMultiSapBroadphase.cpp   |  489 ++++
+ .../BroadphaseCollision/btMultiSapBroadphase.h     |  151 +
+ .../BroadphaseCollision/btOverlappingPairCache.cpp |  633 +++++
+ .../BroadphaseCollision/btOverlappingPairCache.h   |  469 ++++
+ .../btOverlappingPairCallback.h                    |   40 +
+ .../BroadphaseCollision/btQuantizedBvh.cpp         | 1375 +++++++++
+ .../BroadphaseCollision/btQuantizedBvh.h           |  579 ++++
+ .../BroadphaseCollision/btSimpleBroadphase.cpp     |  349 +++
+ .../BroadphaseCollision/btSimpleBroadphase.h       |  171 ++
+ .../CollisionDispatch/SphereTriangleDetector.cpp   |  209 ++
+ .../CollisionDispatch/SphereTriangleDetector.h     |   51 +
+ .../btActivatingCollisionAlgorithm.cpp             |   47 +
+ .../btActivatingCollisionAlgorithm.h               |   36 +
+ .../btBox2dBox2dCollisionAlgorithm.cpp             |  435 +++
+ .../btBox2dBox2dCollisionAlgorithm.h               |   66 +
+ .../btBoxBoxCollisionAlgorithm.cpp                 |   85 +
+ .../CollisionDispatch/btBoxBoxCollisionAlgorithm.h |   66 +
+ .../CollisionDispatch/btBoxBoxDetector.cpp         |  704 +++++
+ .../CollisionDispatch/btBoxBoxDetector.h           |   44 +
+ .../CollisionDispatch/btCollisionConfiguration.h   |   47 +
+ .../CollisionDispatch/btCollisionCreateFunc.h      |   45 +
+ .../CollisionDispatch/btCollisionDispatcher.cpp    |  303 ++
+ .../CollisionDispatch/btCollisionDispatcher.h      |  159 ++
+ .../CollisionDispatch/btCollisionObject.cpp        |  115 +
+ .../CollisionDispatch/btCollisionObject.h          |  508 ++++
+ .../CollisionDispatch/btCollisionWorld.cpp         | 1416 ++++++++++
+ .../CollisionDispatch/btCollisionWorld.h           |  470 ++++
+ .../btCompoundCollisionAlgorithm.cpp               |  351 +++
+ .../btCompoundCollisionAlgorithm.h                 |   86 +
+ .../btConvex2dConvex2dAlgorithm.cpp                |  247 ++
+ .../btConvex2dConvex2dAlgorithm.h                  |   95 +
+ .../btConvexConcaveCollisionAlgorithm.cpp          |  321 +++
+ .../btConvexConcaveCollisionAlgorithm.h            |  116 +
+ .../CollisionDispatch/btConvexConvexAlgorithm.cpp  |  574 ++++
+ .../CollisionDispatch/btConvexConvexAlgorithm.h    |  109 +
+ .../btConvexPlaneCollisionAlgorithm.cpp            |  155 ++
+ .../btConvexPlaneCollisionAlgorithm.h              |   84 +
+ .../btDefaultCollisionConfiguration.cpp            |  298 ++
+ .../btDefaultCollisionConfiguration.h              |  135 +
+ .../btEmptyCollisionAlgorithm.cpp                  |   34 +
+ .../CollisionDispatch/btEmptyCollisionAlgorithm.h  |   54 +
+ .../CollisionDispatch/btGhostObject.cpp            |  171 ++
+ .../CollisionDispatch/btGhostObject.h              |  175 ++
+ .../CollisionDispatch/btInternalEdgeUtility.cpp    |  772 ++++++
+ .../CollisionDispatch/btInternalEdgeUtility.h      |   46 +
+ .../CollisionDispatch/btManifoldResult.cpp         |  134 +
+ .../CollisionDispatch/btManifoldResult.h           |  128 +
+ .../btSimulationIslandManager.cpp                  |  392 +++
+ .../CollisionDispatch/btSimulationIslandManager.h  |   81 +
+ .../btSphereBoxCollisionAlgorithm.cpp              |  260 ++
+ .../btSphereBoxCollisionAlgorithm.h                |   75 +
+ .../btSphereSphereCollisionAlgorithm.cpp           |  105 +
+ .../btSphereSphereCollisionAlgorithm.h             |   66 +
+ .../btSphereTriangleCollisionAlgorithm.cpp         |   84 +
+ .../btSphereTriangleCollisionAlgorithm.h           |   69 +
+ .../CollisionDispatch/btUnionFind.cpp              |   81 +
+ .../CollisionDispatch/btUnionFind.h                |  126 +
+ .../CollisionShapes/btBox2dShape.cpp               |   42 +
+ .../BulletCollision/CollisionShapes/btBox2dShape.h |  363 +++
+ .../BulletCollision/CollisionShapes/btBoxShape.cpp |   41 +
+ .../BulletCollision/CollisionShapes/btBoxShape.h   |  318 +++
+ .../CollisionShapes/btBvhTriangleMeshShape.cpp     |  466 ++++
+ .../CollisionShapes/btBvhTriangleMeshShape.h       |  139 +
+ .../CollisionShapes/btCapsuleShape.cpp             |  171 ++
+ .../CollisionShapes/btCapsuleShape.h               |  173 ++
+ .../CollisionShapes/btCollisionMargin.h            |   26 +
+ .../CollisionShapes/btCollisionShape.cpp           |  119 +
+ .../CollisionShapes/btCollisionShape.h             |  150 +
+ .../CollisionShapes/btCompoundShape.cpp            |  323 +++
+ .../CollisionShapes/btCompoundShape.h              |  206 ++
+ .../CollisionShapes/btConcaveShape.cpp             |   27 +
+ .../CollisionShapes/btConcaveShape.h               |   60 +
+ .../CollisionShapes/btConeShape.cpp                |  133 +
+ .../BulletCollision/CollisionShapes/btConeShape.h  |  100 +
+ .../CollisionShapes/btConvex2dShape.cpp            |   92 +
+ .../CollisionShapes/btConvex2dShape.h              |   80 +
+ .../CollisionShapes/btConvexHullShape.cpp          |  223 ++
+ .../CollisionShapes/btConvexHullShape.h            |  120 +
+ .../CollisionShapes/btConvexInternalShape.cpp      |  151 +
+ .../CollisionShapes/btConvexInternalShape.h        |  202 ++
+ .../CollisionShapes/btConvexPointCloudShape.cpp    |  157 ++
+ .../CollisionShapes/btConvexPointCloudShape.h      |  105 +
+ .../CollisionShapes/btConvexShape.cpp              |  429 +++
+ .../CollisionShapes/btConvexShape.h                |   82 +
+ .../CollisionShapes/btConvexTriangleMeshShape.cpp  |  315 +++
+ .../CollisionShapes/btConvexTriangleMeshShape.h    |   75 +
+ .../CollisionShapes/btCylinderShape.cpp            |  222 ++
+ .../CollisionShapes/btCylinderShape.h              |  192 ++
+ .../CollisionShapes/btEmptyShape.cpp               |   50 +
+ .../BulletCollision/CollisionShapes/btEmptyShape.h |   70 +
+ .../CollisionShapes/btHeightfieldTerrainShape.cpp  |  411 +++
+ .../CollisionShapes/btHeightfieldTerrainShape.h    |  161 ++
+ .../BulletCollision/CollisionShapes/btMaterial.h   |   35 +
+ .../CollisionShapes/btMinkowskiSumShape.cpp        |   60 +
+ .../CollisionShapes/btMinkowskiSumShape.h          |   60 +
+ .../CollisionShapes/btMultiSphereShape.cpp         |  167 ++
+ .../CollisionShapes/btMultiSphereShape.h           |   99 +
+ .../btMultimaterialTriangleMeshShape.cpp           |   45 +
+ .../btMultimaterialTriangleMeshShape.h             |  121 +
+ .../CollisionShapes/btOptimizedBvh.cpp             |  391 +++
+ .../CollisionShapes/btOptimizedBvh.h               |   65 +
+ .../CollisionShapes/btPolyhedralConvexShape.cpp    |  193 ++
+ .../CollisionShapes/btPolyhedralConvexShape.h      |   98 +
+ .../btScaledBvhTriangleMeshShape.cpp               |  121 +
+ .../CollisionShapes/btScaledBvhTriangleMeshShape.h |   62 +
+ .../CollisionShapes/btShapeHull.cpp                |  170 ++
+ .../BulletCollision/CollisionShapes/btShapeHull.h  |   59 +
+ .../CollisionShapes/btSphereShape.cpp              |   71 +
+ .../CollisionShapes/btSphereShape.h                |   73 +
+ .../CollisionShapes/btStaticPlaneShape.cpp         |  107 +
+ .../CollisionShapes/btStaticPlaneShape.h           |  103 +
+ .../CollisionShapes/btStridingMeshInterface.cpp    |  331 +++
+ .../CollisionShapes/btStridingMeshInterface.h      |  154 +
+ .../CollisionShapes/btTetrahedronShape.cpp         |  218 ++
+ .../CollisionShapes/btTetrahedronShape.h           |   74 +
+ .../CollisionShapes/btTriangleBuffer.cpp           |   35 +
+ .../CollisionShapes/btTriangleBuffer.h             |   69 +
+ .../CollisionShapes/btTriangleCallback.cpp         |   28 +
+ .../CollisionShapes/btTriangleCallback.h           |   42 +
+ .../CollisionShapes/btTriangleIndexVertexArray.cpp |   95 +
+ .../CollisionShapes/btTriangleIndexVertexArray.h   |  131 +
+ .../btTriangleIndexVertexMaterialArray.cpp         |   86 +
+ .../btTriangleIndexVertexMaterialArray.h           |   84 +
+ .../CollisionShapes/btTriangleInfoMap.h            |  238 ++
+ .../CollisionShapes/btTriangleMesh.cpp             |  140 +
+ .../CollisionShapes/btTriangleMesh.h               |   69 +
+ .../CollisionShapes/btTriangleMeshShape.cpp        |  211 ++
+ .../CollisionShapes/btTriangleMeshShape.h          |   89 +
+ .../CollisionShapes/btTriangleShape.h              |  182 ++
+ .../CollisionShapes/btUniformScalingShape.cpp      |  115 +
+ .../CollisionShapes/btUniformScalingShape.h        |   87 +
+ hkl3d/bullet/src/BulletCollision/Doxyfile          |  746 +++++
+ .../src/BulletCollision/Gimpact/btBoxCollision.h   |  647 +++++
+ .../src/BulletCollision/Gimpact/btClipPolygon.h    |  182 ++
+ .../Gimpact/btContactProcessing.cpp                |  181 ++
+ .../BulletCollision/Gimpact/btContactProcessing.h  |  145 +
+ .../src/BulletCollision/Gimpact/btGImpactBvh.cpp   |  498 ++++
+ .../src/BulletCollision/Gimpact/btGImpactBvh.h     |  396 +++
+ .../Gimpact/btGImpactCollisionAlgorithm.cpp        |  904 ++++++
+ .../Gimpact/btGImpactCollisionAlgorithm.h          |  306 ++
+ .../BulletCollision/Gimpact/btGImpactMassUtil.h    |   60 +
+ .../Gimpact/btGImpactQuantizedBvh.cpp              |  528 ++++
+ .../Gimpact/btGImpactQuantizedBvh.h                |  372 +++
+ .../src/BulletCollision/Gimpact/btGImpactShape.cpp |  203 ++
+ .../src/BulletCollision/Gimpact/btGImpactShape.h   | 1171 ++++++++
+ .../Gimpact/btGenericPoolAllocator.cpp             |  283 ++
+ .../Gimpact/btGenericPoolAllocator.h               |  163 ++
+ .../BulletCollision/Gimpact/btGeometryOperations.h |  212 ++
+ .../src/BulletCollision/Gimpact/btQuantization.h   |   88 +
+ .../BulletCollision/Gimpact/btTriangleShapeEx.cpp  |  218 ++
+ .../BulletCollision/Gimpact/btTriangleShapeEx.h    |  180 ++
+ .../bullet/src/BulletCollision/Gimpact/gim_array.h |  326 +++
+ .../Gimpact/gim_basic_geometry_operations.h        |  543 ++++
+ .../src/BulletCollision/Gimpact/gim_bitset.h       |  123 +
+ .../BulletCollision/Gimpact/gim_box_collision.h    |  590 ++++
+ .../src/BulletCollision/Gimpact/gim_box_set.cpp    |  182 ++
+ .../src/BulletCollision/Gimpact/gim_box_set.h      |  674 +++++
+ .../src/BulletCollision/Gimpact/gim_clip_polygon.h |  210 ++
+ .../src/BulletCollision/Gimpact/gim_contact.cpp    |  146 +
+ .../src/BulletCollision/Gimpact/gim_contact.h      |  164 ++
+ .../src/BulletCollision/Gimpact/gim_geom_types.h   |   97 +
+ .../src/BulletCollision/Gimpact/gim_geometry.h     |   42 +
+ .../src/BulletCollision/Gimpact/gim_hash_table.h   |  902 ++++++
+ .../src/BulletCollision/Gimpact/gim_linear_math.h  | 1573 +++++++++++
+ .../bullet/src/BulletCollision/Gimpact/gim_math.h  |  157 ++
+ .../src/BulletCollision/Gimpact/gim_memory.cpp     |  135 +
+ .../src/BulletCollision/Gimpact/gim_memory.h       |  190 ++
+ .../src/BulletCollision/Gimpact/gim_radixsort.h    |  406 +++
+ .../BulletCollision/Gimpact/gim_tri_collision.cpp  |  640 +++++
+ .../BulletCollision/Gimpact/gim_tri_collision.h    |  379 +++
+ .../btContinuousConvexCollision.cpp                |  236 ++
+ .../btContinuousConvexCollision.h                  |   52 +
+ .../NarrowPhaseCollision/btConvexCast.cpp          |   20 +
+ .../NarrowPhaseCollision/btConvexCast.h            |   73 +
+ .../btConvexPenetrationDepthSolver.h               |   42 +
+ .../btDiscreteCollisionDetectorInterface.h         |   89 +
+ .../NarrowPhaseCollision/btGjkConvexCast.cpp       |  176 ++
+ .../NarrowPhaseCollision/btGjkConvexCast.h         |   50 +
+ .../NarrowPhaseCollision/btGjkEpa2.cpp             |  989 +++++++
+ .../NarrowPhaseCollision/btGjkEpa2.h               |   73 +
+ .../btGjkEpaPenetrationDepthSolver.cpp             |   66 +
+ .../btGjkEpaPenetrationDepthSolver.h               |   43 +
+ .../NarrowPhaseCollision/btGjkPairDetector.cpp     |  456 +++
+ .../NarrowPhaseCollision/btGjkPairDetector.h       |  103 +
+ .../NarrowPhaseCollision/btManifoldPoint.h         |  138 +
+ .../btMinkowskiPenetrationDepthSolver.cpp          |  362 +++
+ .../btMinkowskiPenetrationDepthSolver.h            |   40 +
+ .../NarrowPhaseCollision/btPersistentManifold.cpp  |  260 ++
+ .../NarrowPhaseCollision/btPersistentManifold.h    |  208 ++
+ .../NarrowPhaseCollision/btPointCollector.h        |   64 +
+ .../NarrowPhaseCollision/btRaycastCallback.cpp     |  175 ++
+ .../NarrowPhaseCollision/btRaycastCallback.h       |   71 +
+ .../btSimplexSolverInterface.h                     |   63 +
+ .../btSubSimplexConvexCast.cpp                     |  160 ++
+ .../NarrowPhaseCollision/btSubSimplexConvexCast.h  |   50 +
+ .../btVoronoiSimplexSolver.cpp                     |  609 ++++
+ .../NarrowPhaseCollision/btVoronoiSimplexSolver.h  |  178 ++
+ .../Character/btCharacterControllerInterface.h     |   45 +
+ .../Character/btKinematicCharacterController.cpp   |  553 ++++
+ .../Character/btKinematicCharacterController.h     |  145 +
+ .../ConstraintSolver/btConeTwistConstraint.cpp     | 1117 ++++++++
+ .../ConstraintSolver/btConeTwistConstraint.h       |  332 +++
+ .../ConstraintSolver/btConstraintSolver.h          |   52 +
+ .../ConstraintSolver/btContactConstraint.cpp       |  134 +
+ .../ConstraintSolver/btContactConstraint.h         |   68 +
+ .../ConstraintSolver/btContactSolverInfo.h         |   87 +
+ .../ConstraintSolver/btGeneric6DofConstraint.cpp   | 1012 +++++++
+ .../ConstraintSolver/btGeneric6DofConstraint.h     |  588 ++++
+ .../btGeneric6DofSpringConstraint.cpp              |  146 +
+ .../btGeneric6DofSpringConstraint.h                |   54 +
+ .../ConstraintSolver/btHinge2Constraint.cpp        |   66 +
+ .../ConstraintSolver/btHinge2Constraint.h          |   58 +
+ .../ConstraintSolver/btHingeConstraint.cpp         |  992 +++++++
+ .../ConstraintSolver/btHingeConstraint.h           |  332 +++
+ .../ConstraintSolver/btJacobianEntry.h             |  156 ++
+ .../ConstraintSolver/btPoint2PointConstraint.cpp   |  229 ++
+ .../ConstraintSolver/btPoint2PointConstraint.h     |  161 ++
+ .../btSequentialImpulseConstraintSolver.cpp        | 1174 ++++++++
+ .../btSequentialImpulseConstraintSolver.h          |  132 +
+ .../ConstraintSolver/btSliderConstraint.cpp        |  857 ++++++
+ .../ConstraintSolver/btSliderConstraint.h          |  321 +++
+ .../ConstraintSolver/btSolve2LinearConstraint.cpp  |  255 ++
+ .../ConstraintSolver/btSolve2LinearConstraint.h    |  107 +
+ .../BulletDynamics/ConstraintSolver/btSolverBody.h |  191 ++
+ .../ConstraintSolver/btSolverConstraint.h          |   96 +
+ .../ConstraintSolver/btTypedConstraint.cpp         |  136 +
+ .../ConstraintSolver/btTypedConstraint.h           |  302 ++
+ .../ConstraintSolver/btUniversalConstraint.cpp     |   63 +
+ .../ConstraintSolver/btUniversalConstraint.h       |   60 +
+ .../src/BulletDynamics/Dynamics/Bullet-C-API.cpp   |  405 +++
+ .../BulletDynamics/Dynamics/btActionInterface.h    |   50 +
+ .../Dynamics/btContinuousDynamicsWorld.cpp         |  196 ++
+ .../Dynamics/btContinuousDynamicsWorld.h           |   46 +
+ .../Dynamics/btDiscreteDynamicsWorld.cpp           | 1161 ++++++++
+ .../Dynamics/btDiscreteDynamicsWorld.h             |  198 ++
+ .../src/BulletDynamics/Dynamics/btDynamicsWorld.h  |  148 +
+ .../src/BulletDynamics/Dynamics/btRigidBody.cpp    |  400 +++
+ .../src/BulletDynamics/Dynamics/btRigidBody.h      |  670 +++++
+ .../Dynamics/btSimpleDynamicsWorld.cpp             |  253 ++
+ .../Dynamics/btSimpleDynamicsWorld.h               |   81 +
+ .../BulletDynamics/Vehicle/btRaycastVehicle.cpp    |  758 +++++
+ .../src/BulletDynamics/Vehicle/btRaycastVehicle.h  |  236 ++
+ .../BulletDynamics/Vehicle/btVehicleRaycaster.h    |   35 +
+ .../src/BulletDynamics/Vehicle/btWheelInfo.cpp     |   56 +
+ .../src/BulletDynamics/Vehicle/btWheelInfo.h       |  119 +
+ .../src/BulletMultiThreaded/Makefile.original      |  187 ++
+ hkl3d/bullet/src/BulletMultiThreaded/MiniCL.cpp    |  517 ++++
+ .../BulletMultiThreaded/MiniCLTask/MiniCLTask.cpp  |   74 +
+ .../BulletMultiThreaded/MiniCLTask/MiniCLTask.h    |   62 +
+ .../BulletMultiThreaded/MiniCLTaskScheduler.cpp    |  519 ++++
+ .../src/BulletMultiThreaded/MiniCLTaskScheduler.h  |  194 ++
+ .../src/BulletMultiThreaded/PlatformDefinitions.h  |   84 +
+ .../src/BulletMultiThreaded/PosixThreadSupport.cpp |  249 ++
+ .../src/BulletMultiThreaded/PosixThreadSupport.h   |  124 +
+ .../src/BulletMultiThreaded/PpuAddressSpace.h      |   20 +
+ .../SequentialThreadSupport.cpp                    |   93 +
+ .../BulletMultiThreaded/SequentialThreadSupport.h  |   92 +
+ .../SpuCollisionObjectWrapper.cpp                  |   48 +
+ .../SpuCollisionObjectWrapper.h                    |   40 +
+ .../SpuCollisionTaskProcess.cpp                    |  318 +++
+ .../BulletMultiThreaded/SpuCollisionTaskProcess.h  |  163 ++
+ .../SpuContactManifoldCollisionAlgorithm.cpp       |   69 +
+ .../SpuContactManifoldCollisionAlgorithm.h         |  120 +
+ .../src/BulletMultiThreaded/SpuDoubleBuffer.h      |  110 +
+ .../bullet/src/BulletMultiThreaded/SpuFakeDma.cpp  |  211 ++
+ hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h  |  135 +
+ .../SpuGatheringCollisionDispatcher.cpp            |  251 ++
+ .../SpuGatheringCollisionDispatcher.h              |   72 +
+ .../src/BulletMultiThreaded/SpuLibspe2Support.cpp  |  257 ++
+ .../src/BulletMultiThreaded/SpuLibspe2Support.h    |  180 ++
+ .../SpuNarrowPhaseCollisionTask/Box.h              |  172 ++
+ .../SpuCollisionShapes.cpp                         |  302 ++
+ .../SpuCollisionShapes.h                           |  126 +
+ .../SpuContactResult.cpp                           |  242 ++
+ .../SpuNarrowPhaseCollisionTask/SpuContactResult.h |  106 +
+ .../SpuConvexPenetrationDepthSolver.h              |   51 +
+ .../SpuGatheringCollisionTask.cpp                  | 1381 +++++++++
+ .../SpuGatheringCollisionTask.h                    |  140 +
+ .../SpuNarrowPhaseCollisionTask/SpuLocalSupport.h  |   19 +
+ .../SpuMinkowskiPenetrationDepthSolver.cpp         |  348 +++
+ .../SpuMinkowskiPenetrationDepthSolver.h           |   48 +
+ .../SpuPreferredPenetrationDirections.h            |   70 +
+ .../SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp | 1155 ++++++++
+ .../SpuNarrowPhaseCollisionTask/boxBoxDistance.h   |   66 +
+ .../SpuNarrowPhaseCollisionTask/readme.txt         |    1 +
+ .../SpuSampleTask/SpuSampleTask.cpp                |  214 ++
+ .../SpuSampleTask/SpuSampleTask.h                  |   54 +
+ .../BulletMultiThreaded/SpuSampleTask/readme.txt   |    1 +
+ .../BulletMultiThreaded/SpuSampleTaskProcess.cpp   |  222 ++
+ .../src/BulletMultiThreaded/SpuSampleTaskProcess.h |  153 +
+ hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h     |  148 +
+ .../src/BulletMultiThreaded/Win32ThreadSupport.cpp |  262 ++
+ .../src/BulletMultiThreaded/Win32ThreadSupport.h   |  132 +
+ .../BulletMultiThreaded/btGpu3DGridBroadphase.cpp  |  590 ++++
+ .../BulletMultiThreaded/btGpu3DGridBroadphase.h    |  138 +
+ .../btGpu3DGridBroadphaseSharedCode.h              |  430 +++
+ .../btGpu3DGridBroadphaseSharedDefs.h              |   61 +
+ .../btGpu3DGridBroadphaseSharedTypes.h             |   67 +
+ .../bullet/src/BulletMultiThreaded/btGpuDefines.h  |  211 ++
+ .../src/BulletMultiThreaded/btGpuUtilsSharedCode.h |   55 +
+ .../src/BulletMultiThreaded/btGpuUtilsSharedDefs.h |   52 +
+ .../btParallelConstraintSolver.cpp                 |   74 +
+ .../btParallelConstraintSolver.h                   |   42 +
+ .../btThreadSupportInterface.cpp                   |   22 +
+ .../BulletMultiThreaded/btThreadSupportInterface.h |   50 +
+ .../vectormath/scalar/cpp/boolInVec.h              |  225 ++
+ .../vectormath/scalar/cpp/floatInVec.h             |  343 +++
+ .../vectormath/scalar/cpp/mat_aos.h                | 1630 +++++++++++
+ .../vectormath/scalar/cpp/quat_aos.h               |  433 +++
+ .../vectormath/scalar/cpp/vec_aos.h                | 1426 ++++++++++
+ .../vectormath/scalar/cpp/vectormath_aos.h         | 1872 +++++++++++++
+ .../src/BulletMultiThreaded/vectormath2bullet.h    |   80 +
+ hkl3d/bullet/src/BulletSoftBody/btSoftBody.cpp     | 2931 ++++++++++++++++++++
+ hkl3d/bullet/src/BulletSoftBody/btSoftBody.h       |  891 ++++++
+ .../btSoftBodyConcaveCollisionAlgorithm.cpp        |  368 +++
+ .../btSoftBodyConcaveCollisionAlgorithm.h          |  153 +
+ .../src/BulletSoftBody/btSoftBodyHelpers.cpp       | 1019 +++++++
+ .../bullet/src/BulletSoftBody/btSoftBodyHelpers.h  |  143 +
+ .../src/BulletSoftBody/btSoftBodyInternals.h       |  931 +++++++
+ .../btSoftBodyRigidBodyCollisionConfiguration.cpp  |  134 +
+ .../btSoftBodyRigidBodyCollisionConfiguration.h    |   48 +
+ .../btSoftRigidCollisionAlgorithm.cpp              |   82 +
+ .../BulletSoftBody/btSoftRigidCollisionAlgorithm.h |   75 +
+ .../BulletSoftBody/btSoftRigidDynamicsWorld.cpp    |  292 ++
+ .../src/BulletSoftBody/btSoftRigidDynamicsWorld.h  |   97 +
+ .../btSoftSoftCollisionAlgorithm.cpp               |   46 +
+ .../BulletSoftBody/btSoftSoftCollisionAlgorithm.h  |   69 +
+ hkl3d/bullet/src/BulletSoftBody/btSparseSDF.h      |  306 ++
+ hkl3d/bullet/src/LinearMath/btAabbUtil2.h          |  236 ++
+ hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp |  205 ++
+ hkl3d/bullet/src/LinearMath/btAlignedAllocator.h   |  107 +
+ hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h |  464 ++++
+ hkl3d/bullet/src/LinearMath/btConvexHull.cpp       | 1174 ++++++++
+ hkl3d/bullet/src/LinearMath/btConvexHull.h         |  241 ++
+ hkl3d/bullet/src/LinearMath/btDefaultMotionState.h |   40 +
+ hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp     |  185 ++
+ hkl3d/bullet/src/LinearMath/btGeometryUtil.h       |   42 +
+ hkl3d/bullet/src/LinearMath/btHashMap.h            |  434 +++
+ hkl3d/bullet/src/LinearMath/btIDebugDraw.h         |  316 +++
+ hkl3d/bullet/src/LinearMath/btList.h               |   73 +
+ hkl3d/bullet/src/LinearMath/btMatrix3x3.h          |  688 +++++
+ hkl3d/bullet/src/LinearMath/btMinMax.h             |   69 +
+ hkl3d/bullet/src/LinearMath/btMotionState.h        |   40 +
+ hkl3d/bullet/src/LinearMath/btPoolAllocator.h      |  102 +
+ hkl3d/bullet/src/LinearMath/btQuadWord.h           |  180 ++
+ hkl3d/bullet/src/LinearMath/btQuaternion.h         |  433 +++
+ hkl3d/bullet/src/LinearMath/btQuickprof.cpp        |  346 +++
+ hkl3d/bullet/src/LinearMath/btQuickprof.h          |  370 +++
+ hkl3d/bullet/src/LinearMath/btRandom.h             |   42 +
+ hkl3d/bullet/src/LinearMath/btScalar.h             |  517 ++++
+ hkl3d/bullet/src/LinearMath/btSerializer.cpp       |  577 ++++
+ hkl3d/bullet/src/LinearMath/btSerializer.h         |  604 ++++
+ hkl3d/bullet/src/LinearMath/btStackAlloc.h         |  116 +
+ hkl3d/bullet/src/LinearMath/btTransform.h          |  307 ++
+ hkl3d/bullet/src/LinearMath/btTransformUtil.h      |  228 ++
+ hkl3d/bullet/src/LinearMath/btVector3.h            |  744 +++++
+ hkl3d/bullet/src/Makefile.am                       |  364 +++
+ hkl3d/bullet/src/MiniCL/cl.h                       |  865 ++++++
+ hkl3d/bullet/src/MiniCL/cl_MiniCL_Defs.h           |  265 ++
+ hkl3d/bullet/src/MiniCL/cl_gl.h                    |  113 +
+ hkl3d/bullet/src/MiniCL/cl_platform.h              |  254 ++
+ hkl3d/bullet/src/btBulletCollisionCommon.h         |   68 +
+ hkl3d/bullet/src/btBulletDynamicsCommon.h          |   49 +
+ hkl3d/hkl3d.cpp                                    |  290 ++
+ hkl3d/hkl3d.h                                      |   78 +
+ test/Makefile.am                                   |   43 +-
+ test/bench.c                                       |  219 --
+ test/hkl-test-axis.c                               |  184 --
+ test/hkl-test-detector.c                           |  106 -
+ test/hkl-test-error.c                              |  135 -
+ test/hkl-test-geometry.c                           |  328 ---
+ test/hkl-test-interval.c                           |  345 ---
+ test/hkl-test-lattice.c                            |  237 --
+ test/hkl-test-matrix.c                             |  169 --
+ test/hkl-test-parameter.c                          |  141 -
+ test/hkl-test-pseudoaxis-e4cv.c                    |  479 ----
+ test/hkl-test-pseudoaxis-e6c.c                     |  255 --
+ test/hkl-test-pseudoaxis-k4cv.c                    |  271 --
+ test/hkl-test-pseudoaxis-k6c.c                     |  392 ---
+ test/hkl-test-pseudoaxis.c                         |  191 --
+ test/hkl-test-quaternion.c                         |  178 --
+ test/hkl-test-sample.c                             |  494 ----
+ test/hkl-test-source.c                             |  105 -
+ test/hkl-test-vector.c                             |  219 --
+ test/hkl-test.c                                    |  106 -
+ test/hkl-test.h                                    |  115 -
+ test/hkl/Makefile.am                               |   42 +
+ test/hkl/bench.c                                   |  219 ++
+ test/hkl/hkl-test-axis.c                           |  184 ++
+ test/hkl/hkl-test-detector.c                       |  106 +
+ test/hkl/hkl-test-error.c                          |  135 +
+ test/hkl/hkl-test-geometry.c                       |  328 +++
+ test/hkl/hkl-test-interval.c                       |  345 +++
+ test/hkl/hkl-test-lattice.c                        |  237 ++
+ test/hkl/hkl-test-matrix.c                         |  169 ++
+ test/hkl/hkl-test-parameter.c                      |  141 +
+ test/hkl/hkl-test-pseudoaxis-e4cv.c                |  479 ++++
+ test/hkl/hkl-test-pseudoaxis-e6c.c                 |  255 ++
+ test/hkl/hkl-test-pseudoaxis-k4cv.c                |  271 ++
+ test/hkl/hkl-test-pseudoaxis-k6c.c                 |  392 +++
+ test/hkl/hkl-test-pseudoaxis.c                     |  191 ++
+ test/hkl/hkl-test-quaternion.c                     |  178 ++
+ test/hkl/hkl-test-sample.c                         |  494 ++++
+ test/hkl/hkl-test-source.c                         |  105 +
+ test/hkl/hkl-test-vector.c                         |  219 ++
+ test/hkl/hkl-test.c                                |  106 +
+ test/hkl/hkl-test.h                                |  115 +
+ test/hkl/main.c                                    |   56 +
+ test/hkl3d/Makefile.am                             |   24 +
+ test/hkl3d/main.cpp                                |   50 +
+ test/main.c                                        |   56 -
+ 444 files changed, 109282 insertions(+), 4778 deletions(-)
+
+commit 1d38eebc336ab3b5059b397b52f580fc6ee31e82
+Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
+Date:   Tue Apr 20 10:50:53 2010 +0200
+
+    * add a new method for the hkl3d library
+
+ hkl/hkl-geometry.c | 26 ++++++++++++++++++++++++++
+ hkl/hkl-geometry.h |  3 +++
+ 2 files changed, 29 insertions(+)
+
 commit ab3ed9088ce3346ddc271f221406017bd03404cf
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
 Date:   Wed Apr 14 14:18:15 2010 +0200
 
     * prepare for release
 
- NEWS         |    7 ++++---
- configure.ac |    2 +-
+ NEWS         | 7 ++++---
+ configure.ac | 2 +-
  2 files changed, 5 insertions(+), 4 deletions(-)
 
 commit 7cefeb6687df94811555a5506955b9ce6fb61096
@@ -210,52 +9970,52 @@ Date:   Mon Apr 5 14:33:55 2010 +0200
     
     also use alloca instead of variable length arrays
 
- configure.ac                          |   10 ++--
- hkl/Makefile.am                       |    4 +-
- hkl/hkl-axis.c                        |    4 +-
- hkl/hkl-axis.h                        |    2 +-
- hkl/hkl-detector-factory.h            |    2 +-
- hkl/hkl-detector.c                    |    4 +-
- hkl/hkl-geometry.c                    |   57 ++++++++++--------
- hkl/hkl-geometry.h                    |    2 +-
- hkl/hkl-lattice.c                     |   52 +++++++++--------
- hkl/hkl-macros.h                      |   19 +++---
- hkl/hkl-pseudoaxis-auto.c             |   42 ++++++++------
- hkl/hkl-pseudoaxis-common-eulerians.c |    8 +-
- hkl/hkl-pseudoaxis-common-hkl.c       |   62 ++++++++++----------
- hkl/hkl-pseudoaxis-common-psi.c       |   69 +++++++++++-----------
- hkl/hkl-pseudoaxis-common-q.c         |   20 +++---
- hkl/hkl-pseudoaxis-common.c           |    2 +-
- hkl/hkl-pseudoaxis-e4cv-hkl.c         |   10 +--
- hkl/hkl-pseudoaxis-e4cv-psi.c         |    2 +-
- hkl/hkl-pseudoaxis-e6c-hkl.c          |   10 +--
- hkl/hkl-pseudoaxis-e6c-psi.c          |    2 +-
- hkl/hkl-pseudoaxis-k4cv-hkl.c         |   10 +--
- hkl/hkl-pseudoaxis-k4cv-psi.c         |    2 +-
- hkl/hkl-pseudoaxis-k6c-hkl.c          |   10 +--
- hkl/hkl-pseudoaxis-k6c-psi.c          |    2 +-
- hkl/hkl-pseudoaxis.c                  |   31 ++++++----
- hkl/hkl-quaternion.c                  |   18 +++---
- hkl/hkl-sample.c                      |   38 +++++++-----
- hkl/hkl-unit.c                        |    2 +-
- hkl/hkl-unit.h                        |    2 +-
- hkl/hkl-vector.c                      |    2 +-
- test/Makefile.am                      |    2 +-
- test/bench.c                          |   16 +++---
- test/hkl-test-axis.c                  |    4 +-
- test/hkl-test-geometry.c              |    6 +-
- test/hkl-test-interval.c              |  104 ++++++++++++++++----------------
- test/hkl-test-lattice.c               |   28 +++++-----
- test/hkl-test-pseudoaxis-e4cv.c       |   41 ++++++-------
- test/hkl-test-pseudoaxis-e6c.c        |   22 ++++----
- test/hkl-test-pseudoaxis-k4cv.c       |   32 +++++-----
- test/hkl-test-pseudoaxis-k6c.c        |   42 +++++++-------
- test/hkl-test-pseudoaxis.c            |   39 ++++++------
- test/hkl-test-quaternion.c            |    6 +-
- test/hkl-test-sample.c                |   17 +++--
- test/hkl-test.c                       |    3 +-
- test/hkl-test.h                       |    2 +-
- test/main.c                           |    2 +-
+ configure.ac                          |  10 ++--
+ hkl/Makefile.am                       |   4 +-
+ hkl/hkl-axis.c                        |   4 +-
+ hkl/hkl-axis.h                        |   2 +-
+ hkl/hkl-detector-factory.h            |   2 +-
+ hkl/hkl-detector.c                    |   4 +-
+ hkl/hkl-geometry.c                    |  57 +++++++++++--------
+ hkl/hkl-geometry.h                    |   2 +-
+ hkl/hkl-lattice.c                     |  52 +++++++++--------
+ hkl/hkl-macros.h                      |  19 ++++---
+ hkl/hkl-pseudoaxis-auto.c             |  42 ++++++++------
+ hkl/hkl-pseudoaxis-common-eulerians.c |   8 +--
+ hkl/hkl-pseudoaxis-common-hkl.c       |  62 ++++++++++----------
+ hkl/hkl-pseudoaxis-common-psi.c       |  69 +++++++++++-----------
+ hkl/hkl-pseudoaxis-common-q.c         |  20 +++----
+ hkl/hkl-pseudoaxis-common.c           |   2 +-
+ hkl/hkl-pseudoaxis-e4cv-hkl.c         |  10 ++--
+ hkl/hkl-pseudoaxis-e4cv-psi.c         |   2 +-
+ hkl/hkl-pseudoaxis-e6c-hkl.c          |  10 ++--
+ hkl/hkl-pseudoaxis-e6c-psi.c          |   2 +-
+ hkl/hkl-pseudoaxis-k4cv-hkl.c         |  10 ++--
+ hkl/hkl-pseudoaxis-k4cv-psi.c         |   2 +-
+ hkl/hkl-pseudoaxis-k6c-hkl.c          |  10 ++--
+ hkl/hkl-pseudoaxis-k6c-psi.c          |   2 +-
+ hkl/hkl-pseudoaxis.c                  |  31 +++++-----
+ hkl/hkl-quaternion.c                  |  18 +++---
+ hkl/hkl-sample.c                      |  38 +++++++------
+ hkl/hkl-unit.c                        |   2 +-
+ hkl/hkl-unit.h                        |   2 +-
+ hkl/hkl-vector.c                      |   2 +-
+ test/Makefile.am                      |   2 +-
+ test/bench.c                          |  16 +++---
+ test/hkl-test-axis.c                  |   4 +-
+ test/hkl-test-geometry.c              |   6 +-
+ test/hkl-test-interval.c              | 104 +++++++++++++++++-----------------
+ test/hkl-test-lattice.c               |  28 ++++-----
+ test/hkl-test-pseudoaxis-e4cv.c       |  41 +++++++-------
+ test/hkl-test-pseudoaxis-e6c.c        |  22 +++----
+ test/hkl-test-pseudoaxis-k4cv.c       |  32 +++++------
+ test/hkl-test-pseudoaxis-k6c.c        |  42 +++++++-------
+ test/hkl-test-pseudoaxis.c            |  39 ++++++-------
+ test/hkl-test-quaternion.c            |   6 +-
+ test/hkl-test-sample.c                |  17 +++---
+ test/hkl-test.c                       |   3 +-
+ test/hkl-test.h                       |   2 +-
+ test/main.c                           |   2 +-
  46 files changed, 449 insertions(+), 417 deletions(-)
 
 commit a7a097f3c5550f4a508cfc5ff2731b2db3ab608e
@@ -264,8 +10024,8 @@ Date:   Mon Apr 5 10:17:23 2010 +0200
 
     * do not initialize a geometry from another geometry type
 
- hkl/hkl-geometry.c |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ hkl/hkl-geometry.c | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit 2b78a6dbfb239d4a0bad673d177f9eed7bd57c45
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -273,8 +10033,8 @@ Date:   Mon Apr 5 09:33:22 2010 +0200
 
     * update the TODO list
 
- TODO |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ TODO | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit 55bbdb7a0b082d9769058185dac5506b32b9dda6
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -285,20 +10045,20 @@ Date:   Mon Apr 5 09:31:30 2010 +0200
     that way it will be possible to associate information
     to geometries like (distance, exclusion information)
 
- gui/ghkl-callbacks.cpp          |    6 ++-
- gui/ghkl.cpp                    |    4 +-
- gui/pseudoaxesframe.cpp         |    3 +-
- hkl/hkl-geometry.c              |   89 ++++++++++++++++++++++++++++-----------
- hkl/hkl-geometry.h              |   20 ++++++++-
- hkl/hkl-pseudoaxis-factory.c    |    4 +-
- hkl/hkl-pseudoaxis.c            |    4 +-
- test/bench.c                    |    5 +-
- test/hkl-test-geometry.c        |   22 ++++++----
- test/hkl-test-pseudoaxis-e4cv.c |   20 +++++----
- test/hkl-test-pseudoaxis-e6c.c  |   10 +++--
- test/hkl-test-pseudoaxis-k4cv.c |   18 +++++---
- test/hkl-test-pseudoaxis-k6c.c  |   31 ++++++++-----
- test/hkl-test-pseudoaxis.c      |    5 +-
+ gui/ghkl-callbacks.cpp          |  6 ++-
+ gui/ghkl.cpp                    |  4 +-
+ gui/pseudoaxesframe.cpp         |  3 +-
+ hkl/hkl-geometry.c              | 89 +++++++++++++++++++++++++++++------------
+ hkl/hkl-geometry.h              | 20 ++++++++-
+ hkl/hkl-pseudoaxis-factory.c    |  4 +-
+ hkl/hkl-pseudoaxis.c            |  4 +-
+ test/bench.c                    |  5 ++-
+ test/hkl-test-geometry.c        | 22 ++++++----
+ test/hkl-test-pseudoaxis-e4cv.c | 20 +++++----
+ test/hkl-test-pseudoaxis-e6c.c  | 10 +++--
+ test/hkl-test-pseudoaxis-k4cv.c | 18 +++++----
+ test/hkl-test-pseudoaxis-k6c.c  | 31 ++++++++------
+ test/hkl-test-pseudoaxis.c      |  5 ++-
  14 files changed, 163 insertions(+), 78 deletions(-)
 
 commit 6c38b669163e033762ef34f87aa51d2cfc310316
@@ -307,8 +10067,8 @@ Date:   Wed Mar 24 17:09:16 2010 +0100
 
     * update the readme and news files.
 
- NEWS   |   11 +++++++----
- README |    1 +
+ NEWS   | 11 +++++++----
+ README |  1 +
  2 files changed, 8 insertions(+), 4 deletions(-)
 
 commit dda22cb3fcd41e2245ddb1d30f5641f104341f7c
@@ -317,20 +10077,20 @@ Date:   Wed Mar 24 17:02:45 2010 +0100
 
     * add an HklGeometryConfig struct which contain all common part of the equivalent geometries.
 
- gui/ghkl-callbacks.cpp          |    8 ++--
- hkl/hkl-geometry-factory.c      |   64 +++++++++++++++++++++++++-------------
- hkl/hkl-geometry-factory.h      |   25 ++-------------
- hkl/hkl-geometry.c              |    4 +-
- hkl/hkl-geometry.h              |   21 +++++++++++-
- hkl/hkl-pseudoaxis-factory.c    |    4 +-
- hkl/hkl-pseudoaxis-factory.h    |    2 +-
- test/bench.c                    |   12 +++++--
- test/hkl-test-pseudoaxis-e4cv.c |   36 ++++++++++++++-------
- test/hkl-test-pseudoaxis-e6c.c  |   18 +++++++----
- test/hkl-test-pseudoaxis-k4cv.c |   18 +++++++----
- test/hkl-test-pseudoaxis-k6c.c  |   30 ++++++++++++------
- test/hkl-test-pseudoaxis.c      |   26 ++++++++++------
- test/hkl-test-sample.c          |   28 +++++++++++++----
+ gui/ghkl-callbacks.cpp          |  8 +++---
+ hkl/hkl-geometry-factory.c      | 64 +++++++++++++++++++++++++++--------------
+ hkl/hkl-geometry-factory.h      | 25 +++-------------
+ hkl/hkl-geometry.c              |  4 +--
+ hkl/hkl-geometry.h              | 21 ++++++++++++--
+ hkl/hkl-pseudoaxis-factory.c    |  4 +--
+ hkl/hkl-pseudoaxis-factory.h    |  2 +-
+ test/bench.c                    | 12 +++++---
+ test/hkl-test-pseudoaxis-e4cv.c | 36 +++++++++++++++--------
+ test/hkl-test-pseudoaxis-e6c.c  | 18 ++++++++----
+ test/hkl-test-pseudoaxis-k4cv.c | 18 ++++++++----
+ test/hkl-test-pseudoaxis-k6c.c  | 30 ++++++++++++-------
+ test/hkl-test-pseudoaxis.c      | 26 ++++++++++-------
+ test/hkl-test-sample.c          | 28 +++++++++++++-----
  14 files changed, 187 insertions(+), 109 deletions(-)
 
 commit cd73f424416727c2069773a688b1aff22bf31bd0
@@ -339,8 +10099,8 @@ Date:   Tue Mar 23 22:13:07 2010 +0100
 
     * fix a possible segfault
 
- gui/ghkl-callbacks.cpp |    8 +++++---
- 1 files changed, 5 insertions(+), 3 deletions(-)
+ gui/ghkl-callbacks.cpp | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
 
 commit d8c58cb009a9da9ab591d2453999d49d2272abfc
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -348,9 +10108,9 @@ Date:   Tue Mar 23 22:12:48 2010 +0100
 
     * remove useless code
 
- gui/ghkl-callbacks.cpp |  161 ------------------------------------------------
- gui/ghkl.h             |   15 +----
- 2 files changed, 1 insertions(+), 175 deletions(-)
+ gui/ghkl-callbacks.cpp | 161 -------------------------------------------------
+ gui/ghkl.h             |  15 +----
+ 2 files changed, 1 insertion(+), 175 deletions(-)
 
 commit 1c9734a9c376de903c09fad4fdcaefe7fa900cf6
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -358,11 +10118,11 @@ Date:   Tue Mar 23 21:43:43 2010 +0100
 
     * now we can switch from one diffractometer to another one.
 
- gui/ghkl-callbacks.cpp     |   20 +++++++++
- gui/ghkl.cpp               |  101 ++++++++++++++++++++++++++------------------
- gui/ghkl.h                 |    8 ++--
- gui/main.cpp               |    2 +-
- hkl/hkl-geometry-factory.h |   17 +++++++
+ gui/ghkl-callbacks.cpp     |  20 +++++++++
+ gui/ghkl.cpp               | 101 +++++++++++++++++++++++++++------------------
+ gui/ghkl.h                 |   8 ++--
+ gui/main.cpp               |   2 +-
+ hkl/hkl-geometry-factory.h |  17 ++++++++
  5 files changed, 102 insertions(+), 46 deletions(-)
 
 commit 3ffa80e697ed5c52e3bcb60cbb1b827cd7057b23
@@ -373,7 +10133,7 @@ Date:   Tue Mar 23 10:44:16 2010 +0100
 
  TODO                   |    3 +
  gui/ghkl-callbacks.cpp |  271 +++--------
- gui/ghkl.cpp           |   39 +--
+ gui/ghkl.cpp           |   39 +-
  gui/ghkl.h             |    2 +
  gui/ghkl.ui            | 1255 +++++++++++++++++++++++++-----------------------
  5 files changed, 717 insertions(+), 853 deletions(-)
@@ -384,8 +10144,8 @@ Date:   Tue Mar 23 09:16:46 2010 +0100
 
     * add also LOG in the callbacks
 
- gui/ghkl-callbacks.cpp |  134 ++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 134 insertions(+), 0 deletions(-)
+ gui/ghkl-callbacks.cpp | 134 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 134 insertions(+)
 
 commit c9f76ab5bf93a04096b8b6d5f34c58720cdbfd48
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -393,8 +10153,8 @@ Date:   Mon Mar 22 22:47:07 2010 +0100
 
     * add a log to help dealing with callbacks
 
- gui/ghkl.cpp |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
- gui/ghkl.h   |    3 ++
+ gui/ghkl.cpp | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
+ gui/ghkl.h   |  3 +++
  2 files changed, 58 insertions(+), 4 deletions(-)
 
 commit 3f3e581aa138691c84ae12ec637b254b24db522a
@@ -403,8 +10163,8 @@ Date:   Mon Mar 22 22:31:49 2010 +0100
 
     * small refactoring of the ghkl constructor
 
- gui/ghkl.cpp |   40 ++++++++++++++++++++++++----------------
- gui/ghkl.h   |    3 ++-
+ gui/ghkl.cpp | 40 ++++++++++++++++++++++++----------------
+ gui/ghkl.h   |  3 ++-
  2 files changed, 26 insertions(+), 17 deletions(-)
 
 commit 24562b1bc6e3aac7a97563256880df649ef2a4e3
@@ -413,8 +10173,8 @@ Date:   Mon Mar 22 22:21:49 2010 +0100
 
     * typo
 
- gui/ghkl.cpp |   33 ++++++++++++++++++++++-----------
- gui/ghkl.h   |   48 ++++++++++++++++++++++++++++++++----------------
+ gui/ghkl.cpp | 33 ++++++++++++++++++++++-----------
+ gui/ghkl.h   | 48 ++++++++++++++++++++++++++++++++----------------
  2 files changed, 54 insertions(+), 27 deletions(-)
 
 commit 03e576066bf8939e7986999955ac41e730d251b3
@@ -423,9 +10183,9 @@ Date:   Mon Mar 22 22:18:34 2010 +0100
 
     * remove useless code
 
- gui/ghkl.cpp |    5 -----
- gui/ghkl.h   |    2 --
- 2 files changed, 0 insertions(+), 7 deletions(-)
+ gui/ghkl.cpp | 5 -----
+ gui/ghkl.h   | 2 --
+ 2 files changed, 7 deletions(-)
 
 commit 86e24bcedec33a948989321c0ec362fe62a287cc
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -450,8 +10210,8 @@ Date:   Mon Mar 22 17:23:08 2010 +0100
 
     * add the TAU = 1 define
 
- hkl/hkl-macros.h |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ hkl/hkl-macros.h | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit f44d1d5a5450e1032c689b0710d6844b5732bfa3
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -459,8 +10219,8 @@ Date:   Mon Mar 22 17:22:52 2010 +0100
 
     * remove unneeded fprintf message
 
- test/hkl-test-sample.c |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
+ test/hkl-test-sample.c | 1 -
+ 1 file changed, 1 deletion(-)
 
 commit a13828b04f289543635262030ef4c91ba0892b43
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -468,8 +10228,8 @@ Date:   Mon Mar 22 17:22:36 2010 +0100
 
     * refactor the sample set_UB and afine methods
 
- hkl/hkl-sample.c |  178 ++++++++++++++++++++++++++++++++++-------------------
- hkl/hkl-sample.h |    2 +-
+ hkl/hkl-sample.c | 178 +++++++++++++++++++++++++++++++++++--------------------
+ hkl/hkl-sample.h |   2 +-
  2 files changed, 115 insertions(+), 65 deletions(-)
 
 commit 9d960ae760934c6b14a2b5cc03b174833bd2271a
@@ -478,10 +10238,10 @@ Date:   Sat Mar 20 16:04:49 2010 +0100
 
     * add the setUB toolbutton and reorganize the ui
 
- gui/hkl.ui        | 2816 ++++++++++++++++++++++++++++-------------------------
+ gui/hkl.ui        | 2950 ++++++++++++++++++++++++++++-------------------------
  gui/hklwindow.cpp |   36 +
  gui/hklwindow.h   |   11 +
- 3 files changed, 1531 insertions(+), 1332 deletions(-)
+ 3 files changed, 1598 insertions(+), 1399 deletions(-)
 
 commit 13540127467181511b743aa4bfc3f86a122e456b
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -489,8 +10249,8 @@ Date:   Sat Mar 20 11:01:07 2010 +0100
 
     * remove a memory leak
 
- gui/hklwindow.cpp |   21 ++++++++++++---------
- gui/hklwindow.h   |    1 +
+ gui/hklwindow.cpp | 21 ++++++++++++---------
+ gui/hklwindow.h   |  1 +
  2 files changed, 13 insertions(+), 9 deletions(-)
 
 commit 69a387ab3952daeb829e3971e7904777910ea376
@@ -499,9 +10259,9 @@ Date:   Sat Mar 20 10:14:35 2010 +0100
 
     * remove unneeded columns in treeviews
 
- gui/hklwindow.cpp  |   13 -------------
- gui/modelcolumns.h |    6 ------
- 2 files changed, 0 insertions(+), 19 deletions(-)
+ gui/hklwindow.cpp  | 13 -------------
+ gui/modelcolumns.h |  6 ------
+ 2 files changed, 19 deletions(-)
 
 commit fe708c4181a5607446e9fdf16602734f98784c49
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -509,8 +10269,8 @@ Date:   Sat Mar 20 10:13:56 2010 +0100
 
     * better look of the UB matrix
 
- gui/hklwindow.cpp |   29 ++++++++++++++++++++---------
- 1 files changed, 20 insertions(+), 9 deletions(-)
+ gui/hklwindow.cpp | 29 ++++++++++++++++++++---------
+ 1 file changed, 20 insertions(+), 9 deletions(-)
 
 commit 1120eddb42decb5ec27fd50709e1facf9221fc3b
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -518,8 +10278,8 @@ Date:   Thu Mar 18 17:08:55 2010 +0100
 
     * typo
 
- test/hkl-test-lattice.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ test/hkl-test-lattice.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 93d961238a8fbe61b996e7061795d8af9778f9d7
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -527,10 +10287,10 @@ Date:   Thu Mar 18 17:07:34 2010 +0100
 
     * set the UB matrix from an external one.
 
- hkl/hkl-sample.c       |   24 ++++++++++++++++++++++++
- hkl/hkl-sample.h       |    4 +++-
- test/hkl-test-sample.c |   25 +++++++++++++++++++++++++
- 3 files changed, 52 insertions(+), 1 deletions(-)
+ hkl/hkl-sample.c       | 24 ++++++++++++++++++++++++
+ hkl/hkl-sample.h       |  4 +++-
+ test/hkl-test-sample.c | 25 +++++++++++++++++++++++++
+ 3 files changed, 52 insertions(+), 1 deletion(-)
 
 commit efd8b767eaff8ab30d0fec12bf62e1a15a47c7f8
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -538,10 +10298,10 @@ Date:   Thu Mar 18 17:06:35 2010 +0100
 
     * add the get_1_B method to the HklLattice.
 
- hkl/hkl-lattice.c       |   55 +++++++++++++++++++++++++++++++++++++++++++++++
- hkl/hkl-lattice.h       |    2 +
- test/hkl-test-lattice.c |   26 ++++++++++++++++++++++
- 3 files changed, 83 insertions(+), 0 deletions(-)
+ hkl/hkl-lattice.c       | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
+ hkl/hkl-lattice.h       |  2 ++
+ test/hkl-test-lattice.c | 26 +++++++++++++++++++++++
+ 3 files changed, 83 insertions(+)
 
 commit b9685cf4526319a9313a426d39b65a535b5a7368
 Author: picca <picca at synchrotron-soleil.fr>
@@ -549,9 +10309,9 @@ Date:   Mon Mar 15 18:50:22 2010 +0100
 
     * use the ux uy and uz sample parameters in the gui
 
- gui/hkl.ui        |  445 ++++++++++++++++++++++++++++++-----------------------
- gui/hklwindow.cpp |   52 +++++--
- gui/hklwindow.h   |    8 +-
+ gui/hkl.ui        | 445 ++++++++++++++++++++++++++++++------------------------
+ gui/hklwindow.cpp |  52 +++++--
+ gui/hklwindow.h   |   8 +-
  3 files changed, 293 insertions(+), 212 deletions(-)
 
 commit 1f7b0557427ffa698d1d0f918e7b6b41adc97c95
@@ -560,9 +10320,9 @@ Date:   Mon Mar 15 18:46:35 2010 +0100
 
     * add the ux uy and uz HklParameter into HklSample
 
- hkl/hkl-sample.c       |   54 ++++++++++++++++++++++++++++++++++++++++++-----
- hkl/hkl-sample.h       |    3 ++
- test/hkl-test-sample.c |   12 ++++++++++
+ hkl/hkl-sample.c       | 54 ++++++++++++++++++++++++++++++++++++++++++++------
+ hkl/hkl-sample.h       |  3 +++
+ test/hkl-test-sample.c | 12 +++++++++++
  3 files changed, 63 insertions(+), 6 deletions(-)
 
 commit 2b0d3f55236b76a0f85b8e68baa79bddf301a917
@@ -571,8 +10331,8 @@ Date:   Mon Mar 15 18:45:58 2010 +0100
 
     * remove debug stream
 
- hkl/hkl-pseudoaxis-auto.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ hkl/hkl-pseudoaxis-auto.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit fb5cc8a2f438c41cbab1a160214807ccce593950
 Author: picca <picca at synchrotron-soleil.fr>
@@ -580,8 +10340,8 @@ Date:   Mon Mar 15 16:05:26 2010 +0100
 
     * bug when setting the sample c values in the treeview.
 
- gui/hklwindow.cpp |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ gui/hklwindow.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit b93f76251c0917288b5d15eccedccaf7f2f7b65b
 Author: picca <picca at synchrotron-soleil.fr>
@@ -589,8 +10349,8 @@ Date:   Mon Mar 15 15:56:37 2010 +0100
 
     * remove a few lines in the hkl.ui interface
 
- gui/hkl.ui |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ gui/hkl.ui | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit 9ce86ec1c0f09b0bbddbf6097ec00e0f6deac995
 Author: picca <picca at synchrotron-soleil.fr>
@@ -598,8 +10358,8 @@ Date:   Mon Mar 15 15:56:07 2010 +0100
 
     * set the right unit for ux, uy and uz
 
- gui/hklwindow.cpp |   12 ++++++------
- 1 files changed, 6 insertions(+), 6 deletions(-)
+ gui/hklwindow.cpp | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
 
 commit 196e15a0fa6f72a56e3e0423f2ad5ea04e33063b
 Author: picca <picca at synchrotron-soleil.fr>
@@ -608,7 +10368,7 @@ Date:   Mon Mar 15 11:25:33 2010 +0100
     * remove all the useless affinement part.
 
  gui/hkl.ui        | 1316 +++++++++++++++++++++++------------------------------
- gui/hklwindow.cpp |   74 +---
+ gui/hklwindow.cpp |   74 +--
  gui/hklwindow.h   |    9 -
  3 files changed, 583 insertions(+), 816 deletions(-)
 
@@ -618,8 +10378,8 @@ Date:   Fri Mar 12 18:56:30 2010 +0100
 
     * do not use relection if the flag is unset
 
- hkl/hkl-sample.c |   17 +++++++++++------
- 1 files changed, 11 insertions(+), 6 deletions(-)
+ hkl/hkl-sample.c | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
 
 commit 0ea8b3e3524baf4bc661f60f2f87dc8554b12cd4
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -627,8 +10387,8 @@ Date:   Sun Mar 7 16:38:35 2010 +0100
 
     * update the TODO list for the foating comparison
 
- TODO |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ TODO | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit 5a24f66bf31a5ee081a0be1be173e690360f637d
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -636,8 +10396,8 @@ Date:   Sat Mar 6 11:51:26 2010 +0100
 
     * remove the empty window.
 
- gui/main.cpp |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ gui/main.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 6e234b1bc92175e119b4a6609b911824a4015962
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -645,11 +10405,11 @@ Date:   Sat Mar 6 11:03:40 2010 +0100
 
     * add the liststore to contain all the diffractometers
 
- gui/hkl.ui         |   15 +++++++++++++++
- gui/hklwindow.cpp  |    4 ++++
- gui/hklwindow.h    |    3 +++
- gui/modelcolumns.h |   13 +++++++++++++
- 4 files changed, 35 insertions(+), 0 deletions(-)
+ gui/hkl.ui         | 15 +++++++++++++++
+ gui/hklwindow.cpp  |  4 ++++
+ gui/hklwindow.h    |  3 +++
+ gui/modelcolumns.h | 13 +++++++++++++
+ 4 files changed, 35 insertions(+)
 
 commit f880e2dd4e9ad6ae25b4d9b9ee1608cf549f731c
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -657,9 +10417,9 @@ Date:   Sat Mar 6 10:44:28 2010 +0100
 
     * add the preference dialog
 
- gui/hkl.ui        |   88 +++++++++++++++++++++++++++++++++++++++++++++++++---
- gui/hklwindow.cpp |   30 ++++++++++++++++++
- gui/hklwindow.h   |   11 ++++++
+ gui/hkl.ui        | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++----
+ gui/hklwindow.cpp | 30 +++++++++++++++++++
+ gui/hklwindow.h   | 11 +++++++
  3 files changed, 123 insertions(+), 6 deletions(-)
 
 commit 69f21adbbc6f21c84520548928dc12876eb858a9
@@ -668,8 +10428,8 @@ Date:   Thu Mar 4 15:58:07 2010 +0100
 
     * the missing part of the rename '* _' -> '*_'
 
- gui/hklwindow.h |  118 +++++++++++++++++++++++++++---------------------------
- 1 files changed, 59 insertions(+), 59 deletions(-)
+ gui/hklwindow.h | 118 ++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 59 insertions(+), 59 deletions(-)
 
 commit d05449bb19cd366e6cafd9041221ca807e467229
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -677,8 +10437,8 @@ Date:   Wed Mar 3 16:54:52 2010 +0100
 
     * add some DEBUG capability in the pseudo axes auto file to ease the debugging.
 
- hkl/hkl-pseudoaxis-auto.c |   78 ++++++++++++++++++++++++++++++--------------
- 1 files changed, 53 insertions(+), 25 deletions(-)
+ hkl/hkl-pseudoaxis-auto.c | 78 ++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 53 insertions(+), 25 deletions(-)
 
 commit a9f431588685700e6a3c3758150a86109c6daa66
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -688,8 +10448,8 @@ Date:   Wed Mar 3 15:39:03 2010 +0100
     
     now if only one of the solved function sucess, return success.
 
- hkl/hkl-pseudoaxis-auto.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ hkl/hkl-pseudoaxis-auto.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 42fd3962ce6e04694b5c48eef9cb6300bcc17798
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -697,8 +10457,8 @@ Date:   Wed Mar 3 15:36:30 2010 +0100
 
     * doc :)
 
- gui/pseudoaxesframe.h |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ gui/pseudoaxesframe.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 08c8af0b8c92b954a68da858f65f0558967fdc0a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -706,8 +10466,8 @@ Date:   Wed Mar 3 13:54:40 2010 +0100
 
     * fix a typo in the pseudo.ui file
 
- gui/hkl.ui |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ gui/hkl.ui | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit bfc4a4ecb3c0ad8ec53f43716739a6824b7e1c63
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -715,8 +10475,8 @@ Date:   Wed Mar 3 08:42:27 2010 +0100
 
     * rename members m_ -> _
 
- gui/hklwindow.cpp |  794 ++++++++++++++++++++++++++--------------------------
- gui/hklwindow.h   |  156 ++++++------
+ gui/hklwindow.cpp | 794 +++++++++++++++++++++++++++---------------------------
+ gui/hklwindow.h   | 156 +++++------
  2 files changed, 475 insertions(+), 475 deletions(-)
 
 commit 9cf926035e9cb53e546717e70bd3c047fdd25ce4
@@ -727,9 +10487,9 @@ Date:   Mon Mar 1 19:50:45 2010 +0100
     
     to avoid futur bugs like functions signature discripencies
 
- hkl/Makefile.am  |    2 +-
- hkl/hkl-macros.h |    5 +++++
- 2 files changed, 6 insertions(+), 1 deletions(-)
+ hkl/Makefile.am  | 2 +-
+ hkl/hkl-macros.h | 5 +++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
 
 commit 6de06ff4a5afd0be6d6c6bc83fd5321587e9bd03
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -738,7 +10498,7 @@ Date:   Tue Mar 2 17:18:06 2010 +0100
     * reorganisation of the gui
 
  gui/hkl.ui | 1911 ++++++++++++++++++++++++++++++------------------------------
- 1 files changed, 945 insertions(+), 966 deletions(-)
+ 1 file changed, 945 insertions(+), 966 deletions(-)
 
 commit 51f2311af71ba10ec06736c7a1fa07eac655438c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -746,9 +10506,9 @@ Date:   Tue Mar 2 17:09:43 2010 +0100
 
     * add the uxuyuz part
 
- gui/hkl.ui        |  206 ++++++++++++++++++++++++++++++++++++++++++++--------
- gui/hklwindow.cpp |   37 ++++++++++
- gui/hklwindow.h   |    5 ++
+ gui/hkl.ui        | 206 +++++++++++++++++++++++++++++++++++++++++++++---------
+ gui/hklwindow.cpp |  37 ++++++++++
+ gui/hklwindow.h   |   5 ++
  3 files changed, 216 insertions(+), 32 deletions(-)
 
 commit 9babf4c95577b356653e4652915d6f3fe0052b95
@@ -757,12 +10517,12 @@ Date:   Tue Mar 2 15:07:53 2010 +0100
 
     * another bunch of dead code.
 
- gui/Makefile.am       |    2 -
- gui/axespinbutton.cpp |  179 -------------------------------------------------
- gui/axespinbutton.h   |   74 --------------------
- gui/hklwindow.cpp     |    2 -
- gui/hklwindow.h       |    2 -
- 5 files changed, 0 insertions(+), 259 deletions(-)
+ gui/Makefile.am       |   2 -
+ gui/axespinbutton.cpp | 179 --------------------------------------------------
+ gui/axespinbutton.h   |  74 ---------------------
+ gui/hklwindow.cpp     |   2 -
+ gui/hklwindow.h       |   2 -
+ 5 files changed, 259 deletions(-)
 
 commit 95a228eaf2396cb7f51be2c829d25bb9c42c78e9
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -770,9 +10530,9 @@ Date:   Tue Mar 2 15:04:13 2010 +0100
 
     * remove dead code
 
- gui/hkl.ui        |  198 ++++++-----------------------------------------------
- gui/hklwindow.cpp |  100 ++-------------------------
- gui/hklwindow.h   |    8 --
+ gui/hkl.ui        | 198 ++++++------------------------------------------------
+ gui/hklwindow.cpp | 100 ++-------------------------
+ gui/hklwindow.h   |   8 ---
  3 files changed, 27 insertions(+), 279 deletions(-)
 
 commit 1ec9a447169d5c50370ba95b280fe6d83c8ecbe1
@@ -781,11 +10541,11 @@ Date:   Tue Mar 2 11:52:03 2010 +0100
 
     * add the solution treeview
 
- gui/hkl.ui         |   10 +++++-
- gui/hklwindow.cpp  |   94 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- gui/hklwindow.h    |    7 ++++
- gui/modelcolumns.h |   20 +++++++++++
- 4 files changed, 130 insertions(+), 1 deletions(-)
+ gui/hkl.ui         | 10 +++++-
+ gui/hklwindow.cpp  | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ gui/hklwindow.h    |  7 ++++
+ gui/modelcolumns.h | 20 ++++++++++++
+ 4 files changed, 130 insertions(+), 1 deletion(-)
 
 commit e323cae729cc8735d4b43673ca05c3b38c45824d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -795,8 +10555,8 @@ Date:   Mon Mar 1 17:49:29 2010 +0100
     
     the signature of the hkl_pseudo_axis_engine_init method was wrong.
 
- test/hkl-test-pseudoaxis-k6c.c |   36 ++++++++++++++++++++++++++++++++++++
- 1 files changed, 36 insertions(+), 0 deletions(-)
+ test/hkl-test-pseudoaxis-k6c.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
 
 commit b933a5a1ca2de6d5fb26848760844fd147176e75
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -804,9 +10564,9 @@ Date:   Mon Mar 1 17:16:52 2010 +0100
 
     * connect the initialize button
 
- gui/pseudoaxesframe.cpp |   13 +++++++++++++
- gui/pseudoaxesframe.h   |    2 ++
- 2 files changed, 15 insertions(+), 0 deletions(-)
+ gui/pseudoaxesframe.cpp | 13 +++++++++++++
+ gui/pseudoaxesframe.h   |  2 ++
+ 2 files changed, 15 insertions(+)
 
 commit 2dab8cea9a7dbcf605ccec050c20e0515cec6096
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -817,8 +10577,8 @@ Date:   Mon Mar 1 17:16:34 2010 +0100
     really strange, the compiler did not complain about the wrong
     hkl_pseudo_axis_engine_init_func signature.
 
- hkl/hkl-pseudoaxis-common.c |   11 ++++-------
- 1 files changed, 4 insertions(+), 7 deletions(-)
+ hkl/hkl-pseudoaxis-common.c | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
 
 commit d71dec87ca9e87113a95637fd53f175fcf92c801
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -826,8 +10586,8 @@ Date:   Mon Mar 1 17:15:43 2010 +0100
 
     * remove a warning
 
- hkl/hkl-sample.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ hkl/hkl-sample.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 10ffa2ad957f51cf9787c87f159170cfade7c9d7
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -837,9 +10597,9 @@ Date:   Mon Mar 1 16:06:56 2010 +0100
     
     that way the users know that it must apply the new pseudoAxes values.
 
- gui/hkl.ui              |    2 ++
- gui/pseudoaxesframe.cpp |    9 +++++++++
- 2 files changed, 11 insertions(+), 0 deletions(-)
+ gui/hkl.ui              | 2 ++
+ gui/pseudoaxesframe.cpp | 9 +++++++++
+ 2 files changed, 11 insertions(+)
 
 commit eeac4d21b4d7fe399e8fe962d66818e1720270f6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -847,10 +10607,10 @@ Date:   Mon Mar 1 15:20:52 2010 +0100
 
     * now the PseudoAxesFrames are updated when changing an Axis value.
 
- gui/hklwindow.cpp       |   33 ++++++++++++++++++++++++++++++---
- gui/hklwindow.h         |    2 ++
- gui/pseudoaxesframe.cpp |   29 ++++++++++++++++++++++++++++-
- gui/pseudoaxesframe.h   |   14 ++++++++++++++
+ gui/hklwindow.cpp       | 33 ++++++++++++++++++++++++++++++---
+ gui/hklwindow.h         |  2 ++
+ gui/pseudoaxesframe.cpp | 29 ++++++++++++++++++++++++++++-
+ gui/pseudoaxesframe.h   | 14 ++++++++++++++
  4 files changed, 74 insertions(+), 4 deletions(-)
 
 commit c700e3c503994a70d26ab32b825620c23344c73e
@@ -859,9 +10619,9 @@ Date:   Mon Mar 1 14:26:17 2010 +0100
 
     * now the PseudoAxisFrame PseudoAxis is connected to the hkl part.
 
- gui/pseudo.ui           |   10 +++++---
- gui/pseudoaxesframe.cpp |   49 +++++++++++++++++++++++++++++++++++++++-------
- gui/pseudoaxesframe.h   |   11 +++++++--
+ gui/pseudo.ui           | 10 ++++++----
+ gui/pseudoaxesframe.cpp | 49 +++++++++++++++++++++++++++++++++++++++++--------
+ gui/pseudoaxesframe.h   | 11 ++++++++---
  3 files changed, 55 insertions(+), 15 deletions(-)
 
 commit 31a3bbcf32d9340699494e54108f22541e1e69b2
@@ -870,15 +10630,15 @@ Date:   Sun Feb 28 23:05:49 2010 +0100
 
     * re-work the gui interface
 
- gui/Makefile.am             |    6 +-
- gui/hkl.ui                  |  510 +++++++++++++++++++++++-------------------
- gui/hklwindow.cpp           |   10 +
- gui/hklwindow.h             |  397 +++++++++++++++++-----------------
- gui/pseudo.ui               |  206 +++++++++++++++++
- gui/pseudoaxesframe.cpp     |  119 ++++++++++
- gui/pseudoaxesframe.h       |   84 +++++++
- gui/pseudoaxespinbutton.cpp |  160 --------------
- gui/pseudoaxespinbutton.h   |   68 ------
+ gui/Makefile.am             |   6 +-
+ gui/hkl.ui                  | 510 ++++++++++++++++++++++++--------------------
+ gui/hklwindow.cpp           |  10 +
+ gui/hklwindow.h             | 397 +++++++++++++++++-----------------
+ gui/pseudo.ui               | 206 ++++++++++++++++++
+ gui/pseudoaxesframe.cpp     | 119 +++++++++++
+ gui/pseudoaxesframe.h       |  84 ++++++++
+ gui/pseudoaxespinbutton.cpp | 160 --------------
+ gui/pseudoaxespinbutton.h   |  68 ------
  9 files changed, 900 insertions(+), 660 deletions(-)
 
 commit b7f0da76bdacca56ed55c05fdb0e5680076bdcc8
@@ -887,15 +10647,15 @@ Date:   Sun Feb 28 15:00:31 2010 +0100
 
     * add the copyright headers
 
- gui/axespinbutton.cpp       |   21 +++++++++++++++++++++
- gui/axespinbutton.h         |   21 +++++++++++++++++++++
- gui/hklwindow.cpp           |   21 +++++++++++++++++++++
- gui/hklwindow.h             |   21 +++++++++++++++++++++
- gui/main.cpp                |   21 +++++++++++++++++++++
- gui/modelcolumns.h          |   21 +++++++++++++++++++++
- gui/pseudoaxespinbutton.cpp |   21 +++++++++++++++++++++
- gui/pseudoaxespinbutton.h   |   21 +++++++++++++++++++++
- 8 files changed, 168 insertions(+), 0 deletions(-)
+ gui/axespinbutton.cpp       | 21 +++++++++++++++++++++
+ gui/axespinbutton.h         | 21 +++++++++++++++++++++
+ gui/hklwindow.cpp           | 21 +++++++++++++++++++++
+ gui/hklwindow.h             | 21 +++++++++++++++++++++
+ gui/main.cpp                | 21 +++++++++++++++++++++
+ gui/modelcolumns.h          | 21 +++++++++++++++++++++
+ gui/pseudoaxespinbutton.cpp | 21 +++++++++++++++++++++
+ gui/pseudoaxespinbutton.h   | 21 +++++++++++++++++++++
+ 8 files changed, 168 insertions(+)
 
 commit 679245a19aee30c3ee6a34d590d3729ed456a841
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -903,8 +10663,8 @@ Date:   Sat Feb 27 23:32:18 2010 +0100
 
     * reorganize the hkl.ui
 
- gui/hkl.ui | 1509 +++++++++++++++++++++++++++++++-----------------------------
- 1 files changed, 775 insertions(+), 734 deletions(-)
+ gui/hkl.ui | 1931 +++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 986 insertions(+), 945 deletions(-)
 
 commit 9e3fba61b59559856697b8ec97d2aa66b6b076a1
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -912,8 +10672,8 @@ Date:   Sat Feb 27 23:32:05 2010 +0100
 
     * fix the sample alpha beta and gamma set values
 
- gui/hklwindow.cpp |   87 ++++++++++++++++++++++++++---------------------------
- 1 files changed, 43 insertions(+), 44 deletions(-)
+ gui/hklwindow.cpp | 87 +++++++++++++++++++++++++++----------------------------
+ 1 file changed, 43 insertions(+), 44 deletions(-)
 
 commit f0ce182d27d94dd431c6190f49cb3b1ddb80b19d
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -921,9 +10681,9 @@ Date:   Sat Feb 27 21:52:45 2010 +0100
 
     * now the ghkl also look for the pkgdatadir file for hkl.ui
 
- gui/Makefile.am   |    1 +
- gui/hklwindow.cpp |    6 +++++-
- 2 files changed, 6 insertions(+), 1 deletions(-)
+ gui/Makefile.am   | 1 +
+ gui/hklwindow.cpp | 6 +++++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
 
 commit d921844b9a690d0460b45106467939e946214448
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -931,8 +10691,8 @@ Date:   Sat Feb 27 19:40:01 2010 +0100
 
     * fix the gui Makefile.am
 
- gui/Makefile.am |    6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
+ gui/Makefile.am | 6 ++++++
+ 1 file changed, 6 insertions(+)
 
 commit a8865210f03c25279b01b4ac19523269de5030b1
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -940,15 +10700,15 @@ Date:   Sat Feb 27 19:08:14 2010 +0100
 
     * rename the sample type enum
 
- gui/hklwindow.cpp               |    4 ++--
- hkl/hkl-sample.h                |    2 +-
- test/bench.c                    |    4 ++--
- test/hkl-test-pseudoaxis-e4cv.c |   12 ++++++------
- test/hkl-test-pseudoaxis-e6c.c  |    6 +++---
- test/hkl-test-pseudoaxis-k4cv.c |    6 +++---
- test/hkl-test-pseudoaxis-k6c.c  |    8 ++++----
- test/hkl-test-pseudoaxis.c      |    2 +-
- test/hkl-test-sample.c          |   26 +++++++++++++-------------
+ gui/hklwindow.cpp               |  4 ++--
+ hkl/hkl-sample.h                |  2 +-
+ test/bench.c                    |  4 ++--
+ test/hkl-test-pseudoaxis-e4cv.c | 12 ++++++------
+ test/hkl-test-pseudoaxis-e6c.c  |  6 +++---
+ test/hkl-test-pseudoaxis-k4cv.c |  6 +++---
+ test/hkl-test-pseudoaxis-k6c.c  |  8 ++++----
+ test/hkl-test-pseudoaxis.c      |  2 +-
+ test/hkl-test-sample.c          | 26 +++++++++++++-------------
  9 files changed, 35 insertions(+), 35 deletions(-)
 
 commit 45783d41cef824a954089ffd72492c9c80e536ae
@@ -957,8 +10717,8 @@ Date:   Sat Feb 27 18:55:08 2010 +0100
 
     * remove a bug
 
- hkl/hkl-vector.h |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ hkl/hkl-vector.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit e248f8f76f455060845bc67ca4257c772407de7b
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -978,7 +10738,7 @@ Date:   Sat Feb 27 18:47:06 2010 +0100
  gui/modelcolumns.h          |  113 +++
  gui/pseudoaxespinbutton.cpp |  139 +++
  gui/pseudoaxespinbutton.h   |   47 +
- 12 files changed, 4647 insertions(+), 1 deletions(-)
+ 12 files changed, 4647 insertions(+), 1 deletion(-)
 
 commit 4ef0743dcd076a784438520d63186dfa42d90e13
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -986,8 +10746,8 @@ Date:   Mon Feb 22 14:42:05 2010 +0100
 
     * fix a bunch or gtk-doc warning for the HklError
 
- hkl/hkl-error.c |    6 +-----
- 1 files changed, 1 insertions(+), 5 deletions(-)
+ hkl/hkl-error.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
 
 commit 708844de310afdd8a5bd5e7330216c4e7e5fcce1
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -995,8 +10755,8 @@ Date:   Mon Feb 22 14:36:36 2010 +0100
 
     * remove a warning during the gtk-doc generation process
 
- Documentation/api/hkl-sections.txt |    6 ++----
- hkl/hkl-matrix.c                   |    4 ++--
+ Documentation/api/hkl-sections.txt | 6 ++----
+ hkl/hkl-matrix.c                   | 4 ++--
  2 files changed, 4 insertions(+), 6 deletions(-)
 
 commit ed1bd4c108586fc7d0b432e9b576da083c1bf9fd
@@ -1005,12 +10765,12 @@ Date:   Mon Feb 22 14:31:10 2010 +0100
 
     * update the HklVector files
 
- Documentation/api/hkl-sections.txt |    2 +-
- hkl/hkl-pseudoaxis-common-hkl.c    |    4 +-
- hkl/hkl-pseudoaxis-common-psi.c    |    4 +-
- hkl/hkl-vector.c                   |   50 +++++++++++++++---------------
- hkl/hkl-vector.h                   |   58 ++++++++++++++++++------------------
- test/hkl-test-vector.c             |    6 ++--
+ Documentation/api/hkl-sections.txt |  2 +-
+ hkl/hkl-pseudoaxis-common-hkl.c    |  4 +--
+ hkl/hkl-pseudoaxis-common-psi.c    |  4 +--
+ hkl/hkl-vector.c                   | 50 ++++++++++++++++----------------
+ hkl/hkl-vector.h                   | 58 +++++++++++++++++++-------------------
+ test/hkl-test-vector.c             |  6 ++--
  6 files changed, 62 insertions(+), 62 deletions(-)
 
 commit 63c68d876157e5d40eef27651e56fa4ac46f37b9
@@ -1019,13 +10779,13 @@ Date:   Mon Feb 22 14:21:05 2010 +0100
 
     * add the Hklquaternnion documentation
 
- Documentation/api/hkl-sections.txt |    6 +-
- hkl/hkl-axis.c                     |    7 +-
- hkl/hkl-pseudoaxis-common-hkl.c    |    2 +-
- hkl/hkl-pseudoaxis-common-psi.c    |    4 +-
- hkl/hkl-quaternion.c               |  124 ++++++++++++++++++++++++++++--------
- hkl/hkl-quaternion.h               |   63 +++---------------
- test/hkl-test-quaternion.c         |   22 +++---
+ Documentation/api/hkl-sections.txt |   6 +-
+ hkl/hkl-axis.c                     |   7 ++-
+ hkl/hkl-pseudoaxis-common-hkl.c    |   2 +-
+ hkl/hkl-pseudoaxis-common-psi.c    |   4 +-
+ hkl/hkl-quaternion.c               | 124 +++++++++++++++++++++++++++++--------
+ hkl/hkl-quaternion.h               |  63 +++----------------
+ test/hkl-test-quaternion.c         |  22 +++----
  7 files changed, 129 insertions(+), 99 deletions(-)
 
 commit 6dd1ca45bd0760b2c4fdfff8d795ee09b78ab931
@@ -1034,14 +10794,14 @@ Date:   Mon Feb 22 13:47:57 2010 +0100
 
     * add doc for HklMatrix and rename a bunch of methods
 
- Documentation/api/hkl-sections.txt |    6 +-
- hkl/hkl-matrix.c                   |  136 +++++++++++++++++++++++++++++++----
- hkl/hkl-matrix.h                   |   27 ++++----
- hkl/hkl-pseudoaxis-common-hkl.c    |    2 +-
- hkl/hkl-pseudoaxis-common-psi.c    |    4 +-
- hkl/hkl-sample.c                   |   14 ++--
- test/hkl-test-matrix.c             |   18 +++---
- test/hkl-test-pseudoaxis-k6c.c     |    4 +-
+ Documentation/api/hkl-sections.txt |   6 +-
+ hkl/hkl-matrix.c                   | 136 ++++++++++++++++++++++++++++++++-----
+ hkl/hkl-matrix.h                   |  27 ++++----
+ hkl/hkl-pseudoaxis-common-hkl.c    |   2 +-
+ hkl/hkl-pseudoaxis-common-psi.c    |   4 +-
+ hkl/hkl-sample.c                   |  14 ++--
+ test/hkl-test-matrix.c             |  18 ++---
+ test/hkl-test-pseudoaxis-k6c.c     |   4 +-
  8 files changed, 158 insertions(+), 53 deletions(-)
 
 commit 64d65316fbca4432acfe291c4497460df1df3923
@@ -1050,8 +10810,8 @@ Date:   Mon Feb 22 12:59:16 2010 +0100
 
     * correct the api Makefile dependencies.
 
- Documentation/api/Makefile.am |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ Documentation/api/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 14b8749a29cd2fbc31cc27b7283c63e7a74fef93
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1059,8 +10819,8 @@ Date:   Mon Feb 22 12:58:54 2010 +0100
 
     * correcte a few spelling errors.
 
- hkl/hkl-vector.c |   12 ++++++------
- 1 files changed, 6 insertions(+), 6 deletions(-)
+ hkl/hkl-vector.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
 
 commit 51704dec42bba17284400f5ccdd5e34f6ed3ac28
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1068,8 +10828,8 @@ Date:   Mon Feb 22 09:09:31 2010 +0100
 
     * add the HklVector documentation
 
- hkl/hkl-vector.c |  215 ++++++++++++++++++++++++++++++++++++++++++++++++++----
- hkl/hkl-vector.h |    2 +-
+ hkl/hkl-vector.c | 215 +++++++++++++++++++++++++++++++++++++++++++++++++++----
+ hkl/hkl-vector.h |   2 +-
  2 files changed, 201 insertions(+), 16 deletions(-)
 
 commit a210f5ad539e7bdcbad33f6ce78ab50d33ef50b0
@@ -1078,8 +10838,8 @@ Date:   Sun Feb 21 10:36:29 2010 +0100
 
     * update the NEWS file
 
- NEWS |    6 ++++--
- 1 files changed, 4 insertions(+), 2 deletions(-)
+ NEWS | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
 
 commit 7693ade54031c56d4dbedb9e63bec2ac2e994654
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1087,8 +10847,8 @@ Date:   Sun Feb 21 09:59:38 2010 +0100
 
     * update the dependencies for the build
 
- README |   14 ++------------
- 1 files changed, 2 insertions(+), 12 deletions(-)
+ README | 14 ++------------
+ 1 file changed, 2 insertions(+), 12 deletions(-)
 
 commit d34cf43596e0f5f7d5e0900a4e2d8b4408126bde
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1096,9 +10856,10 @@ Date:   Sun Feb 21 09:18:04 2010 +0100
 
     * add a few gtk-doc files
 
- Documentation/api/hkl-docs.sgml    |   61 +++++
- Documentation/api/hkl-sections.txt |  431 ++++++++++++++++++++++++++++++++++++
- 2 files changed, 492 insertions(+), 0 deletions(-)
+ Documentation/api/hkl-docs.sgml    |  61 ++++++
+ Documentation/api/hkl-sections.txt | 431 +++++++++++++++++++++++++++++++++++++
+ Documentation/api/hkl.types        |   0
+ 3 files changed, 492 insertions(+)
 
 commit acfa07b7ad660cc337b22eaf1217ff264b11afd0
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1106,8 +10867,8 @@ Date:   Sat Feb 20 23:48:08 2010 +0100
 
     * add a missong file
 
- hkl/usage.c |  110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 110 insertions(+), 0 deletions(-)
+ hkl/usage.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 110 insertions(+)
 
 commit da3e130d5226c0a62a98f3b82f98c427300b09ff
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1115,8 +10876,8 @@ Date:   Sat Feb 20 23:36:01 2010 +0100
 
     * add the m library in the Libs.private
 
- hkl.pc.in |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ hkl.pc.in | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit 2db8aceb5b2bebc673303a25fdfc89cc4bf6b00e
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1124,25 +10885,25 @@ Date:   Sat Feb 20 23:30:46 2010 +0100
 
     * clean and rename gtk-doc -> api
 
- Documentation/Doxyfile                        | 1342 --
- Documentation/Makefile.am                     |    2 +-
- Documentation/Maxima/E4C_bissector.max        |   12 -
- Documentation/Maxima/E4C_constant_chi.max     |   12 -
- Documentation/Maxima/E4C_constant_chi_phi.max |   12 -
- Documentation/Maxima/E4C_constant_omega.max   |   12 -
- Documentation/Maxima/E4C_delta_omega.max      |   12 -
- Documentation/api/Makefile.am                 |  101 +
- Documentation/example/SConscript              |   15 -
- Documentation/example/plot.gnuplot            |   85 -
- Documentation/example/psi.cpp                 |   50 -
- Documentation/gtk-doc/Makefile.am             |  101 -
- Documentation/uml/hkl.dia                     |22193 ------------------------
- Documentation/uml/next_hkl.dia                |22726 -------------------------
- configure.ac                                  |    2 +-
- fbuildroot.py                                 |   29 -
- test/wscript_build                            |   27 -
- waf                                           |  Bin 84763 -> 0 bytes
- wscript                                       |   59 -
+ Documentation/Doxyfile                        |  1342 --
+ Documentation/Makefile.am                     |     2 +-
+ Documentation/Maxima/E4C_bissector.max        |    12 -
+ Documentation/Maxima/E4C_constant_chi.max     |    12 -
+ Documentation/Maxima/E4C_constant_chi_phi.max |    12 -
+ Documentation/Maxima/E4C_constant_omega.max   |    12 -
+ Documentation/Maxima/E4C_delta_omega.max      |    12 -
+ Documentation/api/Makefile.am                 |   101 +
+ Documentation/example/SConscript              |    15 -
+ Documentation/example/plot.gnuplot            |    85 -
+ Documentation/example/psi.cpp                 |    50 -
+ Documentation/gtk-doc/Makefile.am             |   101 -
+ Documentation/uml/hkl.dia                     | 22193 -----------------------
+ Documentation/uml/next_hkl.dia                | 22726 ------------------------
+ configure.ac                                  |     2 +-
+ fbuildroot.py                                 |    29 -
+ test/wscript_build                            |    27 -
+ waf                                           |   Bin 84763 -> 0 bytes
+ wscript                                       |    59 -
  19 files changed, 103 insertions(+), 46689 deletions(-)
 
 commit b32692c84d5275a6318f6ca043f6eef2a37fa36b
@@ -1151,145 +10912,145 @@ Date:   Sat Feb 20 23:15:59 2010 +0100
 
     * reorganize the code to be more gtk-doc compatible
 
- Documentation/Makefile.am                     |    2 +
- Documentation/gtk-doc/Makefile.am             |  101 ++++
- INSTALL                                       |  254 ++++++++---
- Makefile.am                                   |    3 +-
- autogen.sh                                    |    3 +-
- configure.ac                                  |   11 +-
- hkl/Makefile.am                               |   86 ++++
- hkl/hkl-axis.c                                |  251 ++++++++++
- hkl/hkl-axis.h                                |   99 ++++
- hkl/hkl-detector-factory.c                    |   37 ++
- hkl/hkl-detector-factory.h                    |   41 ++
- hkl/hkl-detector.c                            |   75 +++
- hkl/hkl-detector.h                            |   50 ++
- hkl/hkl-error.c                               |  324 +++++++++++++
- hkl/hkl-error.h                               |   72 +++
- hkl/hkl-geometry-factory.c                    |  149 ++++++
- hkl/hkl-geometry-factory.h                    |   46 ++
- hkl/hkl-geometry.c                            |  592 +++++++++++++++++++++++
- hkl/hkl-geometry.h                            |  124 +++++
- hkl/hkl-interval.c                            |  467 ++++++++++++++++++
- hkl/hkl-interval.h                            |   73 +++
- hkl/hkl-lattice.c                             |  355 ++++++++++++++
- hkl/hkl-lattice.h                             |   63 +++
- hkl/hkl-list.h                                |   88 ++++
- hkl/hkl-macros.h                              |  125 +++++
- hkl/hkl-matrix.c                              |  236 +++++++++
- hkl/hkl-matrix.h                              |   69 +++
- hkl/hkl-parameter.c                           |  178 +++++++
- hkl/hkl-parameter.h                           |   80 ++++
- hkl/hkl-pseudoaxis-auto.c                     |  324 +++++++++++++
- hkl/hkl-pseudoaxis-auto.h                     |   38 ++
- hkl/hkl-pseudoaxis-common-eulerians.c         |  163 +++++++
- hkl/hkl-pseudoaxis-common-eulerians.h         |   33 ++
- hkl/hkl-pseudoaxis-common-hkl.c               |  327 +++++++++++++
- hkl/hkl-pseudoaxis-common-hkl.h               |   59 +++
- hkl/hkl-pseudoaxis-common-psi.c               |  270 +++++++++++
- hkl/hkl-pseudoaxis-common-psi.h               |   50 ++
- hkl/hkl-pseudoaxis-common-q.c                 |  245 ++++++++++
- hkl/hkl-pseudoaxis-common-q.h                 |   30 ++
- hkl/hkl-pseudoaxis-common.c                   |   52 ++
- hkl/hkl-pseudoaxis-common.h                   |   38 ++
- hkl/hkl-pseudoaxis-e4cv-hkl.c                 |  142 ++++++
- hkl/hkl-pseudoaxis-e4cv-psi.c                 |   40 ++
- hkl/hkl-pseudoaxis-e4cv.h                     |   34 ++
- hkl/hkl-pseudoaxis-e6c-hkl.c                  |  220 +++++++++
- hkl/hkl-pseudoaxis-e6c-psi.c                  |   40 ++
- hkl/hkl-pseudoaxis-e6c.h                      |   34 ++
- hkl/hkl-pseudoaxis-factory.c                  |  140 ++++++
- hkl/hkl-pseudoaxis-factory.h                  |   35 ++
- hkl/hkl-pseudoaxis-k4cv-hkl.c                 |  341 +++++++++++++
- hkl/hkl-pseudoaxis-k4cv-psi.c                 |   40 ++
- hkl/hkl-pseudoaxis-k4cv.h                     |   34 ++
- hkl/hkl-pseudoaxis-k6c-hkl.c                  |  504 ++++++++++++++++++++
- hkl/hkl-pseudoaxis-k6c-psi.c                  |   40 ++
- hkl/hkl-pseudoaxis-k6c.h                      |   34 ++
- hkl/hkl-pseudoaxis-zaxis-hkl.c                |   80 ++++
- hkl/hkl-pseudoaxis-zaxis.h                    |   33 ++
- hkl/hkl-pseudoaxis.c                          |  609 ++++++++++++++++++++++++
- hkl/hkl-pseudoaxis.h                          |  184 +++++++
- hkl/hkl-quaternion.c                          |  207 ++++++++
- hkl/hkl-quaternion.h                          |  110 +++++
- hkl/hkl-sample.c                              |  632 +++++++++++++++++++++++++
- hkl/hkl-sample.h                              |  149 ++++++
- hkl/hkl-source.c                              |   69 +++
- hkl/hkl-source.h                              |   52 ++
- hkl/hkl-unit.c                                |  106 ++++
- hkl/hkl-unit.h                                |   57 +++
- hkl/hkl-vector.c                              |  324 +++++++++++++
- hkl/hkl-vector.h                              |  109 +++++
- hkl/hkl.h                                     |    7 +
- include/Makefile.am                           |   32 --
- include/hkl.h                                 |    7 -
- include/hkl/SConscript                        |   26 -
- include/hkl/hkl-axis.h                        |   99 ----
- include/hkl/hkl-detector-factory.h            |   41 --
- include/hkl/hkl-detector.h                    |   50 --
- include/hkl/hkl-error.h                       |   72 ---
- include/hkl/hkl-geometry-factory.h            |   46 --
- include/hkl/hkl-geometry.h                    |  124 -----
- include/hkl/hkl-interval.h                    |   73 ---
- include/hkl/hkl-lattice.h                     |   63 ---
- include/hkl/hkl-list.h                        |   88 ----
- include/hkl/hkl-macros.h                      |  125 -----
- include/hkl/hkl-matrix.h                      |   69 ---
- include/hkl/hkl-parameter.h                   |   80 ----
- include/hkl/hkl-pseudoaxis-auto.h             |   38 --
- include/hkl/hkl-pseudoaxis-common-eulerians.h |   33 --
- include/hkl/hkl-pseudoaxis-common-hkl.h       |   59 ---
- include/hkl/hkl-pseudoaxis-common-psi.h       |   50 --
- include/hkl/hkl-pseudoaxis-common-q.h         |   30 --
- include/hkl/hkl-pseudoaxis-common.h           |   38 --
- include/hkl/hkl-pseudoaxis-e4cv.h             |   34 --
- include/hkl/hkl-pseudoaxis-e6c.h              |   34 --
- include/hkl/hkl-pseudoaxis-factory.h          |   35 --
- include/hkl/hkl-pseudoaxis-k4cv.h             |   34 --
- include/hkl/hkl-pseudoaxis-k6c.h              |   34 --
- include/hkl/hkl-pseudoaxis-zaxis.h            |   33 --
- include/hkl/hkl-pseudoaxis.h                  |  184 -------
- include/hkl/hkl-quaternion.h                  |  110 -----
- include/hkl/hkl-sample.h                      |  149 ------
- include/hkl/hkl-source.h                      |   52 --
- include/hkl/hkl-unit.h                        |   57 ---
- include/hkl/hkl-vector.h                      |  109 -----
- src/Makefile.am                               |   53 --
- src/hkl-axis.c                                |  251 ----------
- src/hkl-detector-factory.c                    |   37 --
- src/hkl-detector.c                            |   75 ---
- src/hkl-error.c                               |  324 -------------
- src/hkl-geometry-factory.c                    |  149 ------
- src/hkl-geometry.c                            |  592 -----------------------
- src/hkl-interval.c                            |  467 ------------------
- src/hkl-lattice.c                             |  355 --------------
- src/hkl-matrix.c                              |  236 ---------
- src/hkl-parameter.c                           |  178 -------
- src/hkl-pseudoaxis-auto.c                     |  324 -------------
- src/hkl-pseudoaxis-common-eulerians.c         |  163 -------
- src/hkl-pseudoaxis-common-hkl.c               |  327 -------------
- src/hkl-pseudoaxis-common-psi.c               |  270 -----------
- src/hkl-pseudoaxis-common-q.c                 |  245 ----------
- src/hkl-pseudoaxis-common.c                   |   52 --
- src/hkl-pseudoaxis-e4cv-hkl.c                 |  142 ------
- src/hkl-pseudoaxis-e4cv-psi.c                 |   40 --
- src/hkl-pseudoaxis-e6c-hkl.c                  |  220 ---------
- src/hkl-pseudoaxis-e6c-psi.c                  |   40 --
- src/hkl-pseudoaxis-factory.c                  |  140 ------
- src/hkl-pseudoaxis-k4cv-hkl.c                 |  341 -------------
- src/hkl-pseudoaxis-k4cv-psi.c                 |   40 --
- src/hkl-pseudoaxis-k6c-hkl.c                  |  504 --------------------
- src/hkl-pseudoaxis-k6c-psi.c                  |   40 --
- src/hkl-pseudoaxis-zaxis-hkl.c                |   80 ----
- src/hkl-pseudoaxis.c                          |  609 ------------------------
- src/hkl-quaternion.c                          |  207 --------
- src/hkl-sample.c                              |  632 -------------------------
- src/hkl-source.c                              |   69 ---
- src/hkl-unit.c                                |  106 ----
- src/hkl-vector.c                              |  324 -------------
- src/usage.c                                   |  110 -----
- src/wscript_build                             |   12 -
- test/Makefile.am                              |   14 +-
+ Documentation/Makefile.am                     |   2 +
+ Documentation/gtk-doc/Makefile.am             | 101 ++++
+ INSTALL                                       | 254 ++++++++---
+ Makefile.am                                   |   3 +-
+ autogen.sh                                    |   3 +-
+ configure.ac                                  |  11 +-
+ hkl/Makefile.am                               |  86 ++++
+ hkl/hkl-axis.c                                | 251 ++++++++++
+ hkl/hkl-axis.h                                |  99 ++++
+ hkl/hkl-detector-factory.c                    |  37 ++
+ hkl/hkl-detector-factory.h                    |  41 ++
+ hkl/hkl-detector.c                            |  75 +++
+ hkl/hkl-detector.h                            |  50 ++
+ hkl/hkl-error.c                               | 324 +++++++++++++
+ hkl/hkl-error.h                               |  72 +++
+ hkl/hkl-geometry-factory.c                    | 149 ++++++
+ hkl/hkl-geometry-factory.h                    |  46 ++
+ hkl/hkl-geometry.c                            | 592 ++++++++++++++++++++++++
+ hkl/hkl-geometry.h                            | 124 +++++
+ hkl/hkl-interval.c                            | 467 +++++++++++++++++++
+ hkl/hkl-interval.h                            |  73 +++
+ hkl/hkl-lattice.c                             | 355 +++++++++++++++
+ hkl/hkl-lattice.h                             |  63 +++
+ hkl/hkl-list.h                                |  88 ++++
+ hkl/hkl-macros.h                              | 125 +++++
+ hkl/hkl-matrix.c                              | 236 ++++++++++
+ hkl/hkl-matrix.h                              |  69 +++
+ hkl/hkl-parameter.c                           | 178 ++++++++
+ hkl/hkl-parameter.h                           |  80 ++++
+ hkl/hkl-pseudoaxis-auto.c                     | 324 +++++++++++++
+ hkl/hkl-pseudoaxis-auto.h                     |  38 ++
+ hkl/hkl-pseudoaxis-common-eulerians.c         | 163 +++++++
+ hkl/hkl-pseudoaxis-common-eulerians.h         |  33 ++
+ hkl/hkl-pseudoaxis-common-hkl.c               | 327 +++++++++++++
+ hkl/hkl-pseudoaxis-common-hkl.h               |  59 +++
+ hkl/hkl-pseudoaxis-common-psi.c               | 270 +++++++++++
+ hkl/hkl-pseudoaxis-common-psi.h               |  50 ++
+ hkl/hkl-pseudoaxis-common-q.c                 | 245 ++++++++++
+ hkl/hkl-pseudoaxis-common-q.h                 |  30 ++
+ hkl/hkl-pseudoaxis-common.c                   |  52 +++
+ hkl/hkl-pseudoaxis-common.h                   |  38 ++
+ hkl/hkl-pseudoaxis-e4cv-hkl.c                 | 142 ++++++
+ hkl/hkl-pseudoaxis-e4cv-psi.c                 |  40 ++
+ hkl/hkl-pseudoaxis-e4cv.h                     |  34 ++
+ hkl/hkl-pseudoaxis-e6c-hkl.c                  | 220 +++++++++
+ hkl/hkl-pseudoaxis-e6c-psi.c                  |  40 ++
+ hkl/hkl-pseudoaxis-e6c.h                      |  34 ++
+ hkl/hkl-pseudoaxis-factory.c                  | 140 ++++++
+ hkl/hkl-pseudoaxis-factory.h                  |  35 ++
+ hkl/hkl-pseudoaxis-k4cv-hkl.c                 | 341 ++++++++++++++
+ hkl/hkl-pseudoaxis-k4cv-psi.c                 |  40 ++
+ hkl/hkl-pseudoaxis-k4cv.h                     |  34 ++
+ hkl/hkl-pseudoaxis-k6c-hkl.c                  | 504 ++++++++++++++++++++
+ hkl/hkl-pseudoaxis-k6c-psi.c                  |  40 ++
+ hkl/hkl-pseudoaxis-k6c.h                      |  34 ++
+ hkl/hkl-pseudoaxis-zaxis-hkl.c                |  80 ++++
+ hkl/hkl-pseudoaxis-zaxis.h                    |  33 ++
+ hkl/hkl-pseudoaxis.c                          | 609 +++++++++++++++++++++++++
+ hkl/hkl-pseudoaxis.h                          | 184 ++++++++
+ hkl/hkl-quaternion.c                          | 207 +++++++++
+ hkl/hkl-quaternion.h                          | 110 +++++
+ hkl/hkl-sample.c                              | 632 ++++++++++++++++++++++++++
+ hkl/hkl-sample.h                              | 149 ++++++
+ hkl/hkl-source.c                              |  69 +++
+ hkl/hkl-source.h                              |  52 +++
+ hkl/hkl-unit.c                                | 106 +++++
+ hkl/hkl-unit.h                                |  57 +++
+ hkl/hkl-vector.c                              | 324 +++++++++++++
+ hkl/hkl-vector.h                              | 109 +++++
+ hkl/hkl.h                                     |   7 +
+ include/Makefile.am                           |  32 --
+ include/hkl.h                                 |   7 -
+ include/hkl/SConscript                        |  26 --
+ include/hkl/hkl-axis.h                        |  99 ----
+ include/hkl/hkl-detector-factory.h            |  41 --
+ include/hkl/hkl-detector.h                    |  50 --
+ include/hkl/hkl-error.h                       |  72 ---
+ include/hkl/hkl-geometry-factory.h            |  46 --
+ include/hkl/hkl-geometry.h                    | 124 -----
+ include/hkl/hkl-interval.h                    |  73 ---
+ include/hkl/hkl-lattice.h                     |  63 ---
+ include/hkl/hkl-list.h                        |  88 ----
+ include/hkl/hkl-macros.h                      | 125 -----
+ include/hkl/hkl-matrix.h                      |  69 ---
+ include/hkl/hkl-parameter.h                   |  80 ----
+ include/hkl/hkl-pseudoaxis-auto.h             |  38 --
+ include/hkl/hkl-pseudoaxis-common-eulerians.h |  33 --
+ include/hkl/hkl-pseudoaxis-common-hkl.h       |  59 ---
+ include/hkl/hkl-pseudoaxis-common-psi.h       |  50 --
+ include/hkl/hkl-pseudoaxis-common-q.h         |  30 --
+ include/hkl/hkl-pseudoaxis-common.h           |  38 --
+ include/hkl/hkl-pseudoaxis-e4cv.h             |  34 --
+ include/hkl/hkl-pseudoaxis-e6c.h              |  34 --
+ include/hkl/hkl-pseudoaxis-factory.h          |  35 --
+ include/hkl/hkl-pseudoaxis-k4cv.h             |  34 --
+ include/hkl/hkl-pseudoaxis-k6c.h              |  34 --
+ include/hkl/hkl-pseudoaxis-zaxis.h            |  33 --
+ include/hkl/hkl-pseudoaxis.h                  | 184 --------
+ include/hkl/hkl-quaternion.h                  | 110 -----
+ include/hkl/hkl-sample.h                      | 149 ------
+ include/hkl/hkl-source.h                      |  52 ---
+ include/hkl/hkl-unit.h                        |  57 ---
+ include/hkl/hkl-vector.h                      | 109 -----
+ src/Makefile.am                               |  53 ---
+ src/hkl-axis.c                                | 251 ----------
+ src/hkl-detector-factory.c                    |  37 --
+ src/hkl-detector.c                            |  75 ---
+ src/hkl-error.c                               | 324 -------------
+ src/hkl-geometry-factory.c                    | 149 ------
+ src/hkl-geometry.c                            | 592 ------------------------
+ src/hkl-interval.c                            | 467 -------------------
+ src/hkl-lattice.c                             | 355 ---------------
+ src/hkl-matrix.c                              | 236 ----------
+ src/hkl-parameter.c                           | 178 --------
+ src/hkl-pseudoaxis-auto.c                     | 324 -------------
+ src/hkl-pseudoaxis-common-eulerians.c         | 163 -------
+ src/hkl-pseudoaxis-common-hkl.c               | 327 -------------
+ src/hkl-pseudoaxis-common-psi.c               | 270 -----------
+ src/hkl-pseudoaxis-common-q.c                 | 245 ----------
+ src/hkl-pseudoaxis-common.c                   |  52 ---
+ src/hkl-pseudoaxis-e4cv-hkl.c                 | 142 ------
+ src/hkl-pseudoaxis-e4cv-psi.c                 |  40 --
+ src/hkl-pseudoaxis-e6c-hkl.c                  | 220 ---------
+ src/hkl-pseudoaxis-e6c-psi.c                  |  40 --
+ src/hkl-pseudoaxis-factory.c                  | 140 ------
+ src/hkl-pseudoaxis-k4cv-hkl.c                 | 341 --------------
+ src/hkl-pseudoaxis-k4cv-psi.c                 |  40 --
+ src/hkl-pseudoaxis-k6c-hkl.c                  | 504 --------------------
+ src/hkl-pseudoaxis-k6c-psi.c                  |  40 --
+ src/hkl-pseudoaxis-zaxis-hkl.c                |  80 ----
+ src/hkl-pseudoaxis.c                          | 609 -------------------------
+ src/hkl-quaternion.c                          | 207 ---------
+ src/hkl-sample.c                              | 632 --------------------------
+ src/hkl-source.c                              |  69 ---
+ src/hkl-unit.c                                | 106 -----
+ src/hkl-vector.c                              | 324 -------------
+ src/usage.c                                   | 110 -----
+ src/wscript_build                             |  12 -
+ test/Makefile.am                              |  14 +-
  139 files changed, 10031 insertions(+), 9934 deletions(-)
 
 commit 25072b4420d63fbf031a6424af735fdb4c6d2171
@@ -1298,14 +11059,14 @@ Date:   Sat Feb 20 19:10:43 2010 +0100
 
     * correct a few warnings
 
- include/hkl/hkl-pseudoaxis-auto.h       |    3 ++-
- include/hkl/hkl-pseudoaxis-common-hkl.h |    6 ++++--
- include/hkl/hkl-pseudoaxis-common-psi.h |    4 ++--
- src/hkl-pseudoaxis-auto.c               |    3 ++-
- src/hkl-pseudoaxis-common-eulerians.c   |    6 ++++--
- src/hkl-pseudoaxis-common-hkl.c         |    6 ++++--
- src/hkl-pseudoaxis-common-psi.c         |    6 ++++--
- src/hkl-pseudoaxis-common-q.c           |    6 ++++--
+ include/hkl/hkl-pseudoaxis-auto.h       | 3 ++-
+ include/hkl/hkl-pseudoaxis-common-hkl.h | 6 ++++--
+ include/hkl/hkl-pseudoaxis-common-psi.h | 4 ++--
+ src/hkl-pseudoaxis-auto.c               | 3 ++-
+ src/hkl-pseudoaxis-common-eulerians.c   | 6 ++++--
+ src/hkl-pseudoaxis-common-hkl.c         | 6 ++++--
+ src/hkl-pseudoaxis-common-psi.c         | 6 ++++--
+ src/hkl-pseudoaxis-common-q.c           | 6 ++++--
  8 files changed, 26 insertions(+), 14 deletions(-)
 
 commit 45a9e3cec68b45d657f3ba741ed0d84b6df921fe
@@ -1314,14 +11075,14 @@ Date:   Sat Feb 20 18:13:39 2010 +0100
 
     * prepare for Error handling in the pseudo axes part
 
- include/hkl/hkl-pseudoaxis.h    |   10 ++++---
- src/hkl-pseudoaxis.c            |   52 +++++++++++++++++++++++++++-----------
- test/bench.c                    |    6 ++--
- test/hkl-test-pseudoaxis-e4cv.c |   46 +++++++++++++++++-----------------
- test/hkl-test-pseudoaxis-e6c.c  |   20 +++++++-------
- test/hkl-test-pseudoaxis-k4cv.c |   16 ++++++------
- test/hkl-test-pseudoaxis-k6c.c  |   22 ++++++++--------
- test/hkl-test-pseudoaxis.c      |    6 ++--
+ include/hkl/hkl-pseudoaxis.h    | 10 ++++----
+ src/hkl-pseudoaxis.c            | 52 +++++++++++++++++++++++++++++------------
+ test/bench.c                    |  6 ++---
+ test/hkl-test-pseudoaxis-e4cv.c | 46 ++++++++++++++++++------------------
+ test/hkl-test-pseudoaxis-e6c.c  | 20 ++++++++--------
+ test/hkl-test-pseudoaxis-k4cv.c | 16 ++++++-------
+ test/hkl-test-pseudoaxis-k6c.c  | 22 ++++++++---------
+ test/hkl-test-pseudoaxis.c      |  6 ++---
  8 files changed, 101 insertions(+), 77 deletions(-)
 
 commit ee4a447a87d9de7c6dc66fdeed53d04ee3f77345
@@ -1330,8 +11091,8 @@ Date:   Wed Feb 10 15:53:13 2010 +0100
 
     * use the right dircategory for the texinfo documentation
 
- Documentation/hkl.texi |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ Documentation/hkl.texi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit f6e92376f3bbed247227c853fbb129697f9c96d3
 Author: Picca Frederic-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1339,8 +11100,8 @@ Date:   Tue Feb 9 13:39:15 2010 +0100
 
     * update the authors list
 
- AUTHORS |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
+ AUTHORS | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
 commit d36f012b712a7e5e94cad397c07a6eb8a0ab42b6
 Author: Picca Frederic-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1348,8 +11109,8 @@ Date:   Mon Feb 8 14:42:35 2010 +0100
 
     * fix the texindo documentation
 
- Documentation/hkl.texi |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ Documentation/hkl.texi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 28d63c951adbbae155ee82b5e2978e7382409212
 Author: Picca Frederic-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1357,8 +11118,8 @@ Date:   Mon Feb 8 14:40:21 2010 +0100
 
     * use LIBADD instead of LIBS
 
- src/Makefile.am |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ src/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit f896c5dbf9ded04de6fec34d1251665113b4346d
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1366,8 +11127,8 @@ Date:   Sat Feb 6 10:39:56 2010 +0100
 
     * extract the waf VERSION from the configure.ac
 
- wscript |   17 ++++++++++++-----
- 1 files changed, 12 insertions(+), 5 deletions(-)
+ wscript | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
 
 commit 07619a50136a1fe1a6245945b1f80d57b7930b55
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -1375,8 +11136,8 @@ Date:   Tue Feb 2 13:39:46 2010 +0100
 
     * update the test makefile to compile correctly.
 
- test/Makefile.am |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ test/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 84db9c2a18433ba9b7fe75f92e80a376fef50f34
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1384,8 +11145,8 @@ Date:   Fri Jan 22 16:01:34 2010 +0100
 
     * add a dist-hook to generate the changelog from the git repository.
 
- Makefile.am |   15 +++++++++++++++
- 1 files changed, 15 insertions(+), 0 deletions(-)
+ Makefile.am | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
 
 commit 653355321c6c2fcc98ae449a8237ab3579080493
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1393,8 +11154,8 @@ Date:   Tue Jan 19 11:52:08 2010 +0100
 
     * downgrad autoconf 2.65 -> 2.59 to allow working with the brand new RHEL 4!!!
 
- INSTALL      |  169 +++++++++++++++++-----------------------------------------
- configure.ac |   13 +++--
+ INSTALL      | 169 +++++++++++++++++------------------------------------------
+ configure.ac |  13 +++--
  2 files changed, 58 insertions(+), 124 deletions(-)
 
 commit b6cf1d7bdb5ed74df8e3dcd3bcf670467de9fa7c
@@ -1403,8 +11164,8 @@ Date:   Wed Jan 20 22:12:18 2010 +0100
 
     * add the fbuild buildsystem.
 
- fbuildroot.py |   29 +++++++++++++++++++++++++++++
- 1 files changed, 29 insertions(+), 0 deletions(-)
+ fbuildroot.py | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
 
 commit 58ac27a28ae1c5356cc877ce91a9d12493d1ebc3
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1412,8 +11173,8 @@ Date:   Thu Jan 14 15:19:32 2010 +0100
 
     * small optimization to avoid geometry copy if just updating the current reflection geometry.
 
- src/hkl-sample.c |   11 ++++++++---
- 1 files changed, 8 insertions(+), 3 deletions(-)
+ src/hkl-sample.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
 
 commit 28d37361ce776a40054f28732973fe9f8e554fac
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1421,8 +11182,8 @@ Date:   Tue Jan 19 10:12:25 2010 +0100
 
     * doc of the eulerian 4 circle "hkl" pseudo axes.
 
- Documentation/hkl.texi |   78 +++++++++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 77 insertions(+), 1 deletions(-)
+ Documentation/hkl.texi | 78 +++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 77 insertions(+), 1 deletion(-)
 
 commit 6dccb39b8a98fa0d658df8be8f00c61480706708
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1430,8 +11191,8 @@ Date:   Mon Jan 18 16:33:04 2010 +0100
 
     * update the documentation Licence GPL-3
 
- Documentation/hkl.texi |   34 ++++++++++++++++++----------------
- 1 files changed, 18 insertions(+), 16 deletions(-)
+ Documentation/hkl.texi | 34 ++++++++++++++++++----------------
+ 1 file changed, 18 insertions(+), 16 deletions(-)
 
 commit 48a6d23fd95524f98a037b27bf5115a2ee226b3a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1439,8 +11200,8 @@ Date:   Mon Jan 18 13:42:28 2010 +0100
 
     * wrote the documentation of all the diffractometer geometries
 
- Documentation/hkl.texi |  163 ++++++++++++++++++++++++++++++++++++++++++++----
- 1 files changed, 151 insertions(+), 12 deletions(-)
+ Documentation/hkl.texi | 163 +++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 151 insertions(+), 12 deletions(-)
 
 commit 8233620a251b9f0b81d09c52f670443a989b24c1
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1448,12 +11209,12 @@ Date:   Sun Jan 17 19:39:06 2010 +0100
 
     * add the texinfo doc
 
- Documentation/Makefile.am    |    1 +
- Documentation/SConscript     |   10 -
- Documentation/hkl.texi       |  589 ++++++++++++++++++++++++++++++++++++++++++
- Documentation/user-guide.txt |  530 -------------------------------------
- Makefile.am                  |    2 +-
- configure.ac                 |    3 +-
+ Documentation/Makefile.am    |   1 +
+ Documentation/SConscript     |  10 -
+ Documentation/hkl.texi       | 589 +++++++++++++++++++++++++++++++++++++++++++
+ Documentation/user-guide.txt | 530 --------------------------------------
+ Makefile.am                  |   2 +-
+ configure.ac                 |   3 +-
  6 files changed, 593 insertions(+), 542 deletions(-)
 
 commit 674b41687256469e016c1e56119939ccd9f582a5
@@ -1462,8 +11223,8 @@ Date:   Fri Jan 15 23:34:57 2010 +0100
 
     * fix for real the inline problem.
 
- include/hkl/hkl-macros.h |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ include/hkl/hkl-macros.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 02525fabaa3e37920f9dedb0c95a249137767e1e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1471,8 +11232,8 @@ Date:   Fri Jan 15 17:18:27 2010 +0100
 
     * correct the generation of the hkl.pc file
 
- hkl.pc.in |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ hkl.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 3388bc4fd288aa49fe693e6dab9de129f67e1d57
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1480,10 +11241,10 @@ Date:   Thu Jan 14 15:06:06 2010 +0100
 
     * add a method to set the HklSampleReflection geometry part.
 
- include/hkl/hkl-sample.h |    2 +
- src/hkl-parameter.c      |   10 ++++---
- src/hkl-sample.c         |   44 +++++++++++++++++++++++--------
- test/hkl-test-sample.c   |   63 ++++++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/hkl-sample.h |  2 ++
+ src/hkl-parameter.c      | 10 +++++---
+ src/hkl-sample.c         | 44 ++++++++++++++++++++++++---------
+ test/hkl-test-sample.c   | 63 ++++++++++++++++++++++++++++++++++++++++++++++++
  4 files changed, 103 insertions(+), 16 deletions(-)
 
 commit f0441ebe3febbf8d3aea1b1502b40df262a5ceff
@@ -1492,8 +11253,8 @@ Date:   Tue Jan 12 10:14:18 2010 +0100
 
     * solve an inline problem with the gcc3.4 compiler used at SOLEIL
 
- include/hkl/hkl-macros.h |   11 +----------
- src/usage.c              |   11 +++++++++++
+ include/hkl/hkl-macros.h | 11 +----------
+ src/usage.c              | 11 +++++++++++
  2 files changed, 12 insertions(+), 10 deletions(-)
 
 commit ef917fcb81effb14a51dbe721c677c2025d0d712
@@ -1502,8 +11263,8 @@ Date:   Mon Jan 11 14:51:07 2010 +0100
 
     * remove an unused variable
 
- src/hkl-error.c |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
+ src/hkl-error.c | 1 -
+ 1 file changed, 1 deletion(-)
 
 commit 621cb73f742af96eab421301e0fa0a58588a4ecf
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1511,8 +11272,8 @@ Date:   Mon Jan 11 17:12:37 2010 +0100
 
     * indentation
 
- include/hkl/hkl-macros.h |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ include/hkl/hkl-macros.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 046776c0b46431b7415e03fbe7d8b6ce6c8f67b0
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1520,8 +11281,8 @@ Date:   Mon Jan 11 17:12:04 2010 +0100
 
     * use an optimized vector_rotated_quaternion method.
 
- src/hkl-vector.c |   35 +++++++++++++++++++++--------------
- 1 files changed, 21 insertions(+), 14 deletions(-)
+ src/hkl-vector.c | 35 +++++++++++++++++++++--------------
+ 1 file changed, 21 insertions(+), 14 deletions(-)
 
 commit 041fedff1fdce0eb5507d4361ae6b3503c7f6762
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1529,8 +11290,8 @@ Date:   Sun Jan 10 19:52:39 2010 +0100
 
     * remove clang warning
 
- include/hkl/hkl-macros.h |    5 +++--
- 1 files changed, 3 insertions(+), 2 deletions(-)
+ include/hkl/hkl-macros.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
 
 commit fad99b91f53c9ab4c0bea768ddc368c442070c21
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1538,8 +11299,8 @@ Date:   Sun Jan 10 18:58:56 2010 +0100
 
     * few optimizations
 
- src/hkl-pseudoaxis-k4cv-hkl.c |    5 ++---
- src/hkl-quaternion.c          |   22 ++++++++++++----------
+ src/hkl-pseudoaxis-k4cv-hkl.c |  5 ++---
+ src/hkl-quaternion.c          | 22 ++++++++++++----------
  2 files changed, 14 insertions(+), 13 deletions(-)
 
 commit c19e2fbdfd9abadecdf6b3f652e3db3a05059041
@@ -1548,9 +11309,9 @@ Date:   Sun Jan 10 17:34:05 2010 +0100
 
     * rename getter -> get in HklPseudoAxisEngineList
 
- include/hkl/hkl-pseudoaxis.h   |    2 +-
- src/hkl-pseudoaxis.c           |    2 +-
- test/hkl-test-pseudoaxis-k6c.c |    4 ++--
+ include/hkl/hkl-pseudoaxis.h   | 2 +-
+ src/hkl-pseudoaxis.c           | 2 +-
+ test/hkl-test-pseudoaxis-k6c.c | 4 ++--
  3 files changed, 4 insertions(+), 4 deletions(-)
 
 commit 2ec04b89ccea50a0c4b0c2dfd2a8d08dc35d97f0
@@ -1559,14 +11320,14 @@ Date:   Sun Jan 10 17:26:34 2010 +0100
 
     * rename init -> initialize in HklPseudoAxisEngineMode
 
- include/hkl/hkl-pseudoaxis.h    |   12 +++++-----
- src/hkl-pseudoaxis.c            |   20 ++++++++--------
- test/bench.c                    |    6 ++--
- test/hkl-test-pseudoaxis-e4cv.c |   46 +++++++++++++++++++-------------------
- test/hkl-test-pseudoaxis-e6c.c  |   20 ++++++++--------
- test/hkl-test-pseudoaxis-k4cv.c |   16 ++++++------
- test/hkl-test-pseudoaxis-k6c.c  |   22 +++++++++---------
- test/hkl-test-pseudoaxis.c      |    8 +++---
+ include/hkl/hkl-pseudoaxis.h    | 12 +++++------
+ src/hkl-pseudoaxis.c            | 20 +++++++++---------
+ test/bench.c                    |  6 +++---
+ test/hkl-test-pseudoaxis-e4cv.c | 46 ++++++++++++++++++++---------------------
+ test/hkl-test-pseudoaxis-e6c.c  | 20 +++++++++---------
+ test/hkl-test-pseudoaxis-k4cv.c | 16 +++++++-------
+ test/hkl-test-pseudoaxis-k6c.c  | 22 ++++++++++----------
+ test/hkl-test-pseudoaxis.c      |  8 +++----
  8 files changed, 75 insertions(+), 75 deletions(-)
 
 commit ec5b3b163bc8c839e2253dbcd19c2fa5d0b21fb1
@@ -1575,8 +11336,8 @@ Date:   Sun Jan 10 17:08:38 2010 +0100
 
     * remove useless lines
 
- src/hkl-pseudoaxis-common-eulerians.c |    9 ---------
- 1 files changed, 0 insertions(+), 9 deletions(-)
+ src/hkl-pseudoaxis-common-eulerians.c | 9 ---------
+ 1 file changed, 9 deletions(-)
 
 commit 8a3e0bfc3b73c464166fd3a491da9256a34d093e
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1584,14 +11345,14 @@ Date:   Sun Jan 10 16:51:07 2010 +0100
 
     * use the init method of HklPseudoAxisEngineMode in the constructor method
 
- include/hkl/hkl-pseudoaxis.h          |    2 +-
- src/hkl-pseudoaxis-common-eulerians.c |    2 +-
- src/hkl-pseudoaxis-common-psi.c       |   34 ++++++++++++--------
- src/hkl-pseudoaxis-e4cv-hkl.c         |    4 +-
- src/hkl-pseudoaxis-e6c-hkl.c          |    6 ++--
- src/hkl-pseudoaxis-k4cv-hkl.c         |   10 +++---
- src/hkl-pseudoaxis-k6c-hkl.c          |   14 ++++----
- src/hkl-pseudoaxis.c                  |   54 ++++++++++++++++-----------------
+ include/hkl/hkl-pseudoaxis.h          |  2 +-
+ src/hkl-pseudoaxis-common-eulerians.c |  2 +-
+ src/hkl-pseudoaxis-common-psi.c       | 34 +++++++++++++---------
+ src/hkl-pseudoaxis-e4cv-hkl.c         |  4 +--
+ src/hkl-pseudoaxis-e6c-hkl.c          |  6 ++--
+ src/hkl-pseudoaxis-k4cv-hkl.c         | 10 +++----
+ src/hkl-pseudoaxis-k6c-hkl.c          | 14 ++++-----
+ src/hkl-pseudoaxis.c                  | 54 +++++++++++++++++------------------
  8 files changed, 65 insertions(+), 61 deletions(-)
 
 commit 85c3e8efd6cbcfd9fd02ce95aaa388eec0254804
@@ -1600,8 +11361,8 @@ Date:   Sun Jan 10 13:22:05 2010 +0100
 
     * indentation
 
- src/hkl-error.c |   14 +++++++-------
- 1 files changed, 7 insertions(+), 7 deletions(-)
+ src/hkl-error.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
 
 commit a2ce285ec88593c6b614ce753421f8469900fe9f
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1609,8 +11370,8 @@ Date:   Sun Jan 10 13:19:22 2010 +0100
 
     * doc
 
- include/hkl/hkl-macros.h |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ include/hkl/hkl-macros.h | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit ca814c452952270aaad5f3bb4f251b2543149edc
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1618,16 +11379,16 @@ Date:   Sun Jan 10 13:19:07 2010 +0100
 
     * standardise the memory allocation with the HKL_MALLOC macro
 
- include/hkl/hkl-macros.h        |   19 +++++++++++++++++--
- src/hkl-axis.c                  |    4 +---
- src/hkl-detector.c              |    8 ++------
- src/hkl-error.c                 |    8 +++-----
- src/hkl-geometry.c              |   12 +++---------
- src/hkl-lattice.c               |    8 ++------
- src/hkl-parameter.c             |    8 ++------
- src/hkl-pseudoaxis-common-psi.c |    4 +---
- src/hkl-pseudoaxis.c            |   17 +++++------------
- src/hkl-sample.c                |   20 +++++---------------
+ include/hkl/hkl-macros.h        | 19 +++++++++++++++++--
+ src/hkl-axis.c                  |  4 +---
+ src/hkl-detector.c              |  8 ++------
+ src/hkl-error.c                 |  8 +++-----
+ src/hkl-geometry.c              | 12 +++---------
+ src/hkl-lattice.c               |  8 ++------
+ src/hkl-parameter.c             |  8 ++------
+ src/hkl-pseudoaxis-common-psi.c |  4 +---
+ src/hkl-pseudoaxis.c            | 17 +++++------------
+ src/hkl-sample.c                | 20 +++++---------------
  10 files changed, 41 insertions(+), 67 deletions(-)
 
 commit 08ec35fecde509b250f31a691b25c31a00a99999
@@ -1636,16 +11397,16 @@ Date:   Sat Jan 9 11:05:17 2010 +0100
 
     * refactoring of the HklPseudoAxisModeFunc
 
- include/hkl/hkl-pseudoaxis-auto.h       |    3 +-
- include/hkl/hkl-pseudoaxis-common-hkl.h |   14 ++++++----
- include/hkl/hkl-pseudoaxis-common.h     |    3 +-
- include/hkl/hkl-pseudoaxis.h            |   41 ++++++++++++-------------------
- src/hkl-pseudoaxis-auto.c               |   11 ++++----
- src/hkl-pseudoaxis-common-eulerians.c   |   14 ++++++----
- src/hkl-pseudoaxis-common-hkl.c         |   30 ++++++++++++----------
- src/hkl-pseudoaxis-common-psi.c         |   27 +++++++++-----------
- src/hkl-pseudoaxis-common-q.c           |   14 ++++++----
- src/hkl-pseudoaxis.c                    |   27 ++++++++++----------
+ include/hkl/hkl-pseudoaxis-auto.h       |  3 ++-
+ include/hkl/hkl-pseudoaxis-common-hkl.h | 14 ++++++-----
+ include/hkl/hkl-pseudoaxis-common.h     |  3 ++-
+ include/hkl/hkl-pseudoaxis.h            | 41 +++++++++++++--------------------
+ src/hkl-pseudoaxis-auto.c               | 11 +++++----
+ src/hkl-pseudoaxis-common-eulerians.c   | 14 ++++++-----
+ src/hkl-pseudoaxis-common-hkl.c         | 30 +++++++++++++-----------
+ src/hkl-pseudoaxis-common-psi.c         | 27 ++++++++++------------
+ src/hkl-pseudoaxis-common-q.c           | 14 ++++++-----
+ src/hkl-pseudoaxis.c                    | 27 +++++++++++-----------
  10 files changed, 92 insertions(+), 92 deletions(-)
 
 commit 93af3bdef8aee90b70223c61acd0af5db0a4642a
@@ -1654,21 +11415,21 @@ Date:   Fri Jan 8 22:30:03 2010 +0100
 
     * simplification using an array to store the function to solve.
 
- include/hkl/hkl-pseudoaxis-auto.h       |    7 +-
- include/hkl/hkl-pseudoaxis-common-hkl.h |   72 ++------------
- include/hkl/hkl-pseudoaxis-common.h     |    1 +
- include/hkl/hkl-pseudoaxis.h            |    4 +
- src/hkl-pseudoaxis-auto.c               |   21 ++++-
- src/hkl-pseudoaxis-common-eulerians.c   |    3 +-
- src/hkl-pseudoaxis-common-hkl.c         |   32 +------
- src/hkl-pseudoaxis-common-psi.c         |   14 +--
- src/hkl-pseudoaxis-common-q.c           |   26 +----
- src/hkl-pseudoaxis-e4cv-hkl.c           |   40 ++++----
- src/hkl-pseudoaxis-e6c-hkl.c            |   74 ++++++--------
- src/hkl-pseudoaxis-k4cv-hkl.c           |   90 ++++-------------
- src/hkl-pseudoaxis-k6c-hkl.c            |  168 +++++++-----------------------
- src/hkl-pseudoaxis-zaxis-hkl.c          |   18 +--
- src/hkl-pseudoaxis.c                    |   21 +++-
+ include/hkl/hkl-pseudoaxis-auto.h       |   7 +-
+ include/hkl/hkl-pseudoaxis-common-hkl.h |  72 ++------------
+ include/hkl/hkl-pseudoaxis-common.h     |   1 +
+ include/hkl/hkl-pseudoaxis.h            |   4 +
+ src/hkl-pseudoaxis-auto.c               |  21 +++-
+ src/hkl-pseudoaxis-common-eulerians.c   |   3 +-
+ src/hkl-pseudoaxis-common-hkl.c         |  32 +-----
+ src/hkl-pseudoaxis-common-psi.c         |  14 +--
+ src/hkl-pseudoaxis-common-q.c           |  26 ++---
+ src/hkl-pseudoaxis-e4cv-hkl.c           |  40 ++++----
+ src/hkl-pseudoaxis-e6c-hkl.c            |  74 +++++++-------
+ src/hkl-pseudoaxis-k4cv-hkl.c           |  90 ++++-------------
+ src/hkl-pseudoaxis-k6c-hkl.c            | 168 ++++++++------------------------
+ src/hkl-pseudoaxis-zaxis-hkl.c          |  18 ++--
+ src/hkl-pseudoaxis.c                    |  21 +++-
  15 files changed, 184 insertions(+), 407 deletions(-)
 
 commit e635c89c750d01517448921bbb644f7a5d2af3d2
@@ -1677,9 +11438,9 @@ Date:   Fri Jan 8 15:39:07 2010 +0100
 
     * add the reflectivity mode for the zaxis geometry.
 
- NEWS                           |    4 ++++
- src/hkl-pseudoaxis-zaxis-hkl.c |   34 ++++++++++++++++++++++++++++++++++
- 2 files changed, 38 insertions(+), 0 deletions(-)
+ NEWS                           |  4 ++++
+ src/hkl-pseudoaxis-zaxis-hkl.c | 34 ++++++++++++++++++++++++++++++++++
+ 2 files changed, 38 insertions(+)
 
 commit 830eb71d6ba16465da38329187fc45db4eebca79
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1687,8 +11448,8 @@ Date:   Thu Jan 7 17:13:37 2010 +0100
 
     * the HklPseudoAxisEngine setter method fail if there is 0 geometries computed
 
- src/hkl-pseudoaxis.c |    3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis.c | 3 +++
+ 1 file changed, 3 insertions(+)
 
 commit c72eeb00a35409fd19414977cc65f7f63fcd4ff0
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1701,8 +11462,8 @@ Date:   Thu Jan 7 14:08:14 2010 +0100
     
     do do the right calculation.
 
- src/hkl-pseudoaxis.c |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis.c | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit b1138cae1e37256e394c73594e91c3486e6402dd
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1710,8 +11471,8 @@ Date:   Thu Jan 7 14:06:47 2010 +0100
 
     * add the q2 pseudo axis to the zaxis geometry.
 
- src/hkl-pseudoaxis-factory.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-factory.c | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit 04b6c34010478a811000e1bf9bfb3e6db99d0072
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1721,9 +11482,9 @@ Date:   Wed Jan 6 22:14:13 2010 +0100
     
     thus correction of the geometry validity check.
 
- src/hkl-parameter.c      |    3 +-
- test/hkl-test-geometry.c |   52 ++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 54 insertions(+), 1 deletions(-)
+ src/hkl-parameter.c      |  3 ++-
+ test/hkl-test-geometry.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 54 insertions(+), 1 deletion(-)
 
 commit 3423bdbfe0873be8ce9c0db286b53ec83ab90b8f
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1731,8 +11492,8 @@ Date:   Wed Jan 6 22:07:54 2010 +0100
 
     * remove wrong authors for the zaxis geometry
 
- src/hkl-pseudoaxis-zaxis-hkl.c |    2 --
- 1 files changed, 0 insertions(+), 2 deletions(-)
+ src/hkl-pseudoaxis-zaxis-hkl.c | 2 --
+ 1 file changed, 2 deletions(-)
 
 commit ba89b16abf616e408642ac5b20bafef5af92e91b
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1740,8 +11501,8 @@ Date:   Wed Jan 6 22:06:56 2010 +0100
 
     * better presentation of the Makefile.am of the include files.
 
- include/Makefile.am |   43 ++++++++++++++++++++++++++++++++-----------
- 1 files changed, 32 insertions(+), 11 deletions(-)
+ include/Makefile.am | 43 ++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 32 insertions(+), 11 deletions(-)
 
 commit b7f7fffea82612d705e7349d305e50768c593e1a
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1749,8 +11510,8 @@ Date:   Wed Jan 6 17:47:32 2010 +0100
 
     * now HklGeometryList::remove_invalid is ok.
 
- src/hkl-geometry.c |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
+ src/hkl-geometry.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
 commit f66f33c6f42148ae4537ec46de9562d0ccfce523
 Author: System User <picca at b1460-srv2.sixs.rcl>
@@ -1758,15 +11519,15 @@ Date:   Wed Jan 6 17:45:31 2010 +0100
 
     * add the zaxis geometry
 
- include/Makefile.am                |    2 +-
- include/hkl/hkl-geometry-factory.h |    1 +
- include/hkl/hkl-pseudoaxis-zaxis.h |   33 ++++++++++++++++++++++
- src/Makefile.am                    |    1 +
- src/hkl-geometry-factory.c         |   17 +++++++++++
- src/hkl-pseudoaxis-factory.c       |    4 ++
- src/hkl-pseudoaxis-zaxis-hkl.c     |   54 ++++++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis.c         |    7 ++++
- 8 files changed, 118 insertions(+), 1 deletions(-)
+ include/Makefile.am                |  2 +-
+ include/hkl/hkl-geometry-factory.h |  1 +
+ include/hkl/hkl-pseudoaxis-zaxis.h | 33 +++++++++++++++++++++++
+ src/Makefile.am                    |  1 +
+ src/hkl-geometry-factory.c         | 17 ++++++++++++
+ src/hkl-pseudoaxis-factory.c       |  4 +++
+ src/hkl-pseudoaxis-zaxis-hkl.c     | 54 ++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis.c         |  7 +++++
+ 8 files changed, 118 insertions(+), 1 deletion(-)
 
 commit 5206c73b460efda8d01d45c6b2e301870d3fb0c0
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1774,12 +11535,12 @@ Date:   Tue Jan 5 22:56:24 2010 +0100
 
     * remove all warning due to clang
 
- src/hkl-axis.c                  |    2 +-
- src/hkl-matrix.c                |    3 +-
- src/hkl-pseudoaxis-auto.c       |    2 +-
- src/hkl-pseudoaxis-common-psi.c |    2 -
- src/hkl-pseudoaxis-k4cv-hkl.c   |    6 -----
- src/hkl-pseudoaxis-k6c-hkl.c    |   46 ++++----------------------------------
+ src/hkl-axis.c                  |  2 +-
+ src/hkl-matrix.c                |  3 ++-
+ src/hkl-pseudoaxis-auto.c       |  2 +-
+ src/hkl-pseudoaxis-common-psi.c |  2 --
+ src/hkl-pseudoaxis-k4cv-hkl.c   |  6 ------
+ src/hkl-pseudoaxis-k6c-hkl.c    | 46 +++++------------------------------------
  6 files changed, 9 insertions(+), 52 deletions(-)
 
 commit 72fa2115662feedddb316967fdfc680d5cfdff1e
@@ -1788,11 +11549,11 @@ Date:   Tue Jan 5 19:57:14 2010 +0100
 
     * remove warning from gcc 4.4.2 and switch to c99
 
- configure.ac                  |    2 +-
- src/hkl-error.c               |    3 ++-
- src/hkl-pseudoaxis-common-q.c |    1 +
- test/bench.c                  |    4 ++--
- test/hkl-test.h               |   15 ++++++++-------
+ configure.ac                  |  2 +-
+ src/hkl-error.c               |  3 ++-
+ src/hkl-pseudoaxis-common-q.c |  1 +
+ test/bench.c                  |  4 ++--
+ test/hkl-test.h               | 15 ++++++++-------
  5 files changed, 14 insertions(+), 11 deletions(-)
 
 commit 1928f66d8fe460120c931f9f77e694b69558726f
@@ -1801,8 +11562,8 @@ Date:   Tue Jan 5 19:55:55 2010 +0100
 
     * better printf for HklGeometry
 
- src/hkl-geometry.c |    5 ++++-
- 1 files changed, 4 insertions(+), 1 deletions(-)
+ src/hkl-geometry.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
 
 commit f6141c5f67379561faa054f73285cd1d01a26c43
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1810,8 +11571,8 @@ Date:   Tue Jan 5 13:55:47 2010 +0100
 
     * the number of randomize test per PseudoAxisEngine is now define using a constant.
 
- test/hkl-test-pseudoaxis.c |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
+ test/hkl-test-pseudoaxis.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
 
 commit 7e1c13a54c7f20be4b4d3f8f0d1415f337827fa0
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1819,8 +11580,8 @@ Date:   Tue Jan 5 13:47:53 2010 +0100
 
     * use the new HKL_ASSERT_STRING_EQUAL everywhere :)
 
- test/hkl-test-axis.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ test/hkl-test-axis.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 2c5f7691d3fc1ead52038f46ac453ebe3d7e1b66
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1828,8 +11589,8 @@ Date:   Tue Jan 5 13:43:54 2010 +0100
 
     * indent
 
- test/hkl-test.h |   60 +++++++++++++++++++++++++++---------------------------
- 1 files changed, 30 insertions(+), 30 deletions(-)
+ test/hkl-test.h | 60 ++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 30 insertions(+), 30 deletions(-)
 
 commit af91ea7658d731fd4bdfa86edb67bc20bd4e7046
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1837,26 +11598,26 @@ Date:   Tue Jan 5 13:42:27 2010 +0100
 
     * forgot the 2009 -> 2010 copyright change of the test part.
 
- test/bench.c                    |    2 +-
- test/hkl-test-axis.c            |    2 +-
- test/hkl-test-detector.c        |    2 +-
- test/hkl-test-geometry.c        |    2 +-
- test/hkl-test-interval.c        |    2 +-
- test/hkl-test-lattice.c         |    2 +-
- test/hkl-test-matrix.c          |    2 +-
- test/hkl-test-parameter.c       |    2 +-
- test/hkl-test-pseudoaxis-e4cv.c |    2 +-
- test/hkl-test-pseudoaxis-e6c.c  |    2 +-
- test/hkl-test-pseudoaxis-k4cv.c |    2 +-
- test/hkl-test-pseudoaxis-k6c.c  |    2 +-
- test/hkl-test-pseudoaxis.c      |    2 +-
- test/hkl-test-quaternion.c      |    2 +-
- test/hkl-test-sample.c          |    2 +-
- test/hkl-test-source.c          |    2 +-
- test/hkl-test-vector.c          |    2 +-
- test/hkl-test.c                 |    2 +-
- test/hkl-test.h                 |    2 +-
- test/main.c                     |    2 +-
+ test/bench.c                    | 2 +-
+ test/hkl-test-axis.c            | 2 +-
+ test/hkl-test-detector.c        | 2 +-
+ test/hkl-test-geometry.c        | 2 +-
+ test/hkl-test-interval.c        | 2 +-
+ test/hkl-test-lattice.c         | 2 +-
+ test/hkl-test-matrix.c          | 2 +-
+ test/hkl-test-parameter.c       | 2 +-
+ test/hkl-test-pseudoaxis-e4cv.c | 2 +-
+ test/hkl-test-pseudoaxis-e6c.c  | 2 +-
+ test/hkl-test-pseudoaxis-k4cv.c | 2 +-
+ test/hkl-test-pseudoaxis-k6c.c  | 2 +-
+ test/hkl-test-pseudoaxis.c      | 2 +-
+ test/hkl-test-quaternion.c      | 2 +-
+ test/hkl-test-sample.c          | 2 +-
+ test/hkl-test-source.c          | 2 +-
+ test/hkl-test-vector.c          | 2 +-
+ test/hkl-test.c                 | 2 +-
+ test/hkl-test.h                 | 2 +-
+ test/main.c                     | 2 +-
  20 files changed, 20 insertions(+), 20 deletions(-)
 
 commit 55e7bab1ed489b0329c604f785d10f5a4e70154e
@@ -1865,10 +11626,10 @@ Date:   Tue Jan 5 13:39:46 2010 +0100
 
     * add the test methods for HklError
 
- test/Makefile.am      |    2 +
- test/hkl-test-error.c |  135 +++++++++++++++++++++++++++++++++++++++++++++++++
- test/main.c           |    1 +
- 3 files changed, 138 insertions(+), 0 deletions(-)
+ test/Makefile.am      |   2 +
+ test/hkl-test-error.c | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ test/main.c           |   1 +
+ 3 files changed, 138 insertions(+)
 
 commit c46d337eb25130de53b7338c81cbeff18a5e725d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1876,9 +11637,9 @@ Date:   Tue Jan 5 13:38:43 2010 +0100
 
     * rename functions to follow the hkl convention.
 
- include/hkl.h           |    1 +
- include/hkl/hkl-error.h |   14 +++++++-------
- src/hkl-error.c         |   33 +++++++++++++++++++--------------
+ include/hkl.h           |  1 +
+ include/hkl/hkl-error.h | 14 +++++++-------
+ src/hkl-error.c         | 33 +++++++++++++++++++--------------
  3 files changed, 27 insertions(+), 21 deletions(-)
 
 commit a14d9979ec63868b4a66acde8e26c680ef52f3a2
@@ -1887,8 +11648,8 @@ Date:   Tue Jan 5 11:09:03 2010 +0100
 
     * add the HKL_ASSERT_STRING_EQUAL macro
 
- test/hkl-test.h |    9 +++++++++
- 1 files changed, 9 insertions(+), 0 deletions(-)
+ test/hkl-test.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
 
 commit 0cc5e087f24c818ac46f86a2a4151f4a3387cb3f
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -1896,12 +11657,12 @@ Date:   Mon Jan 4 21:39:43 2010 +0100
 
     * add the HklError class.
 
- include/Makefile.am      |    2 +-
- include/hkl/hkl-error.h  |   72 ++++++++++
- include/hkl/hkl-macros.h |    4 +
- src/Makefile.am          |    1 +
- src/hkl-error.c          |  321 ++++++++++++++++++++++++++++++++++++++++++++++
- 5 files changed, 399 insertions(+), 1 deletions(-)
+ include/Makefile.am      |   2 +-
+ include/hkl/hkl-error.h  |  72 +++++++++++
+ include/hkl/hkl-macros.h |   4 +
+ src/Makefile.am          |   1 +
+ src/hkl-error.c          | 321 +++++++++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 399 insertions(+), 1 deletion(-)
 
 commit a6e309cd9e016e8f2892aa90af071feac3fdca86
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1909,65 +11670,65 @@ Date:   Mon Jan 4 17:25:47 2010 +0100
 
     * update the copyright year
 
- include/hkl/hkl-axis.h                        |    2 +-
- include/hkl/hkl-detector-factory.h            |    2 +-
- include/hkl/hkl-detector.h                    |    2 +-
- include/hkl/hkl-geometry-factory.h            |    2 +-
- include/hkl/hkl-geometry.h                    |    2 +-
- include/hkl/hkl-interval.h                    |    2 +-
- include/hkl/hkl-lattice.h                     |    2 +-
- include/hkl/hkl-list.h                        |    2 +-
- include/hkl/hkl-macros.h                      |    2 +-
- include/hkl/hkl-matrix.h                      |    2 +-
- include/hkl/hkl-parameter.h                   |    2 +-
- include/hkl/hkl-pseudoaxis-auto.h             |    2 +-
- include/hkl/hkl-pseudoaxis-common-eulerians.h |    2 +-
- include/hkl/hkl-pseudoaxis-common-hkl.h       |    2 +-
- include/hkl/hkl-pseudoaxis-common-psi.h       |    2 +-
- include/hkl/hkl-pseudoaxis-common-q.h         |    2 +-
- include/hkl/hkl-pseudoaxis-common.h           |    2 +-
- include/hkl/hkl-pseudoaxis-e4cv.h             |    2 +-
- include/hkl/hkl-pseudoaxis-e6c.h              |    2 +-
- include/hkl/hkl-pseudoaxis-factory.h          |    2 +-
- include/hkl/hkl-pseudoaxis-k4cv.h             |    2 +-
- include/hkl/hkl-pseudoaxis-k6c.h              |    2 +-
- include/hkl/hkl-pseudoaxis.h                  |    2 +-
- include/hkl/hkl-quaternion.h                  |    2 +-
- include/hkl/hkl-sample.h                      |    2 +-
- include/hkl/hkl-source.h                      |    2 +-
- include/hkl/hkl-unit.h                        |    2 +-
- include/hkl/hkl-vector.h                      |    2 +-
- src/hkl-axis.c                                |    2 +-
- src/hkl-detector-factory.c                    |    2 +-
- src/hkl-detector.c                            |    2 +-
- src/hkl-geometry-factory.c                    |    2 +-
- src/hkl-geometry.c                            |    2 +-
- src/hkl-interval.c                            |    2 +-
- src/hkl-lattice.c                             |    2 +-
- src/hkl-matrix.c                              |    2 +-
- src/hkl-parameter.c                           |    2 +-
- src/hkl-pseudoaxis-auto.c                     |    2 +-
- src/hkl-pseudoaxis-common-eulerians.c         |    2 +-
- src/hkl-pseudoaxis-common-hkl.c               |    2 +-
- src/hkl-pseudoaxis-common-psi.c               |    2 +-
- src/hkl-pseudoaxis-common-q.c                 |    2 +-
- src/hkl-pseudoaxis-common.c                   |    2 +-
- src/hkl-pseudoaxis-e4cv-hkl.c                 |    2 +-
- src/hkl-pseudoaxis-e4cv-psi.c                 |    2 +-
- src/hkl-pseudoaxis-e6c-hkl.c                  |    2 +-
- src/hkl-pseudoaxis-e6c-psi.c                  |    2 +-
- src/hkl-pseudoaxis-factory.c                  |    2 +-
- src/hkl-pseudoaxis-k4cv-hkl.c                 |    2 +-
- src/hkl-pseudoaxis-k4cv-psi.c                 |    2 +-
- src/hkl-pseudoaxis-k6c-hkl.c                  |    2 +-
- src/hkl-pseudoaxis-k6c-psi.c                  |    2 +-
- src/hkl-pseudoaxis.c                          |    2 +-
- src/hkl-quaternion.c                          |    2 +-
- src/hkl-sample.c                              |    2 +-
- src/hkl-source.c                              |    2 +-
- src/hkl-unit.c                                |    2 +-
- src/hkl-vector.c                              |    2 +-
- src/usage.c                                   |    2 +-
+ include/hkl/hkl-axis.h                        | 2 +-
+ include/hkl/hkl-detector-factory.h            | 2 +-
+ include/hkl/hkl-detector.h                    | 2 +-
+ include/hkl/hkl-geometry-factory.h            | 2 +-
+ include/hkl/hkl-geometry.h                    | 2 +-
+ include/hkl/hkl-interval.h                    | 2 +-
+ include/hkl/hkl-lattice.h                     | 2 +-
+ include/hkl/hkl-list.h                        | 2 +-
+ include/hkl/hkl-macros.h                      | 2 +-
+ include/hkl/hkl-matrix.h                      | 2 +-
+ include/hkl/hkl-parameter.h                   | 2 +-
+ include/hkl/hkl-pseudoaxis-auto.h             | 2 +-
+ include/hkl/hkl-pseudoaxis-common-eulerians.h | 2 +-
+ include/hkl/hkl-pseudoaxis-common-hkl.h       | 2 +-
+ include/hkl/hkl-pseudoaxis-common-psi.h       | 2 +-
+ include/hkl/hkl-pseudoaxis-common-q.h         | 2 +-
+ include/hkl/hkl-pseudoaxis-common.h           | 2 +-
+ include/hkl/hkl-pseudoaxis-e4cv.h             | 2 +-
+ include/hkl/hkl-pseudoaxis-e6c.h              | 2 +-
+ include/hkl/hkl-pseudoaxis-factory.h          | 2 +-
+ include/hkl/hkl-pseudoaxis-k4cv.h             | 2 +-
+ include/hkl/hkl-pseudoaxis-k6c.h              | 2 +-
+ include/hkl/hkl-pseudoaxis.h                  | 2 +-
+ include/hkl/hkl-quaternion.h                  | 2 +-
+ include/hkl/hkl-sample.h                      | 2 +-
+ include/hkl/hkl-source.h                      | 2 +-
+ include/hkl/hkl-unit.h                        | 2 +-
+ include/hkl/hkl-vector.h                      | 2 +-
+ src/hkl-axis.c                                | 2 +-
+ src/hkl-detector-factory.c                    | 2 +-
+ src/hkl-detector.c                            | 2 +-
+ src/hkl-geometry-factory.c                    | 2 +-
+ src/hkl-geometry.c                            | 2 +-
+ src/hkl-interval.c                            | 2 +-
+ src/hkl-lattice.c                             | 2 +-
+ src/hkl-matrix.c                              | 2 +-
+ src/hkl-parameter.c                           | 2 +-
+ src/hkl-pseudoaxis-auto.c                     | 2 +-
+ src/hkl-pseudoaxis-common-eulerians.c         | 2 +-
+ src/hkl-pseudoaxis-common-hkl.c               | 2 +-
+ src/hkl-pseudoaxis-common-psi.c               | 2 +-
+ src/hkl-pseudoaxis-common-q.c                 | 2 +-
+ src/hkl-pseudoaxis-common.c                   | 2 +-
+ src/hkl-pseudoaxis-e4cv-hkl.c                 | 2 +-
+ src/hkl-pseudoaxis-e4cv-psi.c                 | 2 +-
+ src/hkl-pseudoaxis-e6c-hkl.c                  | 2 +-
+ src/hkl-pseudoaxis-e6c-psi.c                  | 2 +-
+ src/hkl-pseudoaxis-factory.c                  | 2 +-
+ src/hkl-pseudoaxis-k4cv-hkl.c                 | 2 +-
+ src/hkl-pseudoaxis-k4cv-psi.c                 | 2 +-
+ src/hkl-pseudoaxis-k6c-hkl.c                  | 2 +-
+ src/hkl-pseudoaxis-k6c-psi.c                  | 2 +-
+ src/hkl-pseudoaxis.c                          | 2 +-
+ src/hkl-quaternion.c                          | 2 +-
+ src/hkl-sample.c                              | 2 +-
+ src/hkl-source.c                              | 2 +-
+ src/hkl-unit.c                                | 2 +-
+ src/hkl-vector.c                              | 2 +-
+ src/usage.c                                   | 2 +-
  59 files changed, 59 insertions(+), 59 deletions(-)
 
 commit 833c91a2e3c539d531cb523b3cdfb59323be2880
@@ -1976,8 +11737,8 @@ Date:   Mon Jan 4 17:24:19 2010 +0100
 
     * update the NEWS file
 
- NEWS |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
+ NEWS | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
 
 commit 4104f391c39dfa9061de2fd1e77e92e21d1da942
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -1985,12 +11746,12 @@ Date:   Mon Jan 4 17:13:35 2010 +0100
 
     * fix for 64bit machines thanks Jens Krüger
 
- src/hkl-pseudoaxis-common-eulerians.c |    3 ++-
- src/hkl-pseudoaxis-common-q.c         |    5 +++--
- src/hkl-pseudoaxis-e4cv-hkl.c         |   13 +++++++------
- src/hkl-pseudoaxis-e6c-hkl.c          |   23 ++++++++++++-----------
- src/hkl-pseudoaxis-k4cv-hkl.c         |   13 +++++++------
- src/hkl-pseudoaxis-k6c-hkl.c          |   27 ++++++++++++++-------------
+ src/hkl-pseudoaxis-common-eulerians.c |  3 ++-
+ src/hkl-pseudoaxis-common-q.c         |  5 +++--
+ src/hkl-pseudoaxis-e4cv-hkl.c         | 13 +++++++------
+ src/hkl-pseudoaxis-e6c-hkl.c          | 23 ++++++++++++-----------
+ src/hkl-pseudoaxis-k4cv-hkl.c         | 13 +++++++------
+ src/hkl-pseudoaxis-k6c-hkl.c          | 27 ++++++++++++++-------------
  6 files changed, 45 insertions(+), 39 deletions(-)
 
 commit 97186a53710c8561b8beb65f05ea3614f3fbfe10
@@ -1999,8 +11760,8 @@ Date:   Mon Jan 4 17:02:34 2010 +0100
 
     * fix the installation of the hkl.h files thanks Jens Krüger
 
- wscript |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
+ wscript | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
 commit 19102358345b9bb858a5aa9caa7f24cfc441a9f4
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2017,8 +11778,8 @@ Date:   Mon Jan 4 16:49:18 2010 +0100
     
     that way I avoid this rounding problem present on the 13th digits.
 
- src/hkl-geometry.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-geometry.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit eb5e5d34aa0aa77da882863e92a6a87d535b6cf6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2026,8 +11787,8 @@ Date:   Tue Dec 15 18:41:27 2009 +0100
 
     * remove a valgrind warning
 
- test/hkl-test.c |   20 ++++++++++----------
- 1 files changed, 10 insertions(+), 10 deletions(-)
+ test/hkl-test.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
 
 commit dc18121dc35034b4518b97e4ab99c8c8a38f1baf
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2039,8 +11800,8 @@ Date:   Tue Dec 15 18:30:01 2009 +0100
     
     	test/hkl-test-pseudoaxis.c
 
- test/hkl-test-pseudoaxis.c |   25 +++++++++++++++++--------
- 1 files changed, 17 insertions(+), 8 deletions(-)
+ test/hkl-test-pseudoaxis.c | 25 +++++++++++++++++--------
+ 1 file changed, 17 insertions(+), 8 deletions(-)
 
 commit 5d2edcb2aa2cdc8add5d6bb88e061b8f361ee285
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2052,8 +11813,8 @@ Date:   Tue Dec 15 17:56:21 2009 +0100
     
     	test/hkl-test.c
 
- test/hkl-test.c |   29 ++++++++++++++++++++++++-----
- 1 files changed, 24 insertions(+), 5 deletions(-)
+ test/hkl-test.c | 29 ++++++++++++++++++++++++-----
+ 1 file changed, 24 insertions(+), 5 deletions(-)
 
 commit 441ed39a55a2359af9d125c1c7476971120098a3
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2061,8 +11822,8 @@ Date:   Tue Dec 15 17:30:01 2009 +0100
 
     * solve a bug in the q pseudo axis.
 
- src/hkl-pseudoaxis-common-q.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-pseudoaxis-common-q.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 6165ae2823ed0e6a2f85d969faa0b808d11a190e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2070,8 +11831,8 @@ Date:   Tue Dec 15 17:27:11 2009 +0100
 
     * add a debug section in the pseudo_axis_auto part.
 
- src/hkl-pseudoaxis-auto.c |    6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
 
 commit 44968237a7a11a6a6df0b176f40e358e530bc195
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2079,8 +11840,8 @@ Date:   Tue Dec 15 15:23:45 2009 +0100
 
     * be less strict when comparing double.
 
- test/hkl-test.h |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ test/hkl-test.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 85eae3b9ba4be48ad171c0d2da21d66fbe9b780e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2088,8 +11849,8 @@ Date:   Tue Dec 15 15:22:54 2009 +0100
 
     * better precision in the parameter fprintf method
 
- src/hkl-parameter.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ src/hkl-parameter.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 98fc860becb5af5979e8763bb33e661d30d6da7a
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -2097,8 +11858,8 @@ Date:   Sun Jan 3 11:47:59 2010 +0100
 
     * bench all engines of the k6c geometry
 
- test/bench.c |  118 +++++++++++++++++++++++++++++++++++++++++++---------------
- 1 files changed, 88 insertions(+), 30 deletions(-)
+ test/bench.c | 118 ++++++++++++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 88 insertions(+), 30 deletions(-)
 
 commit 27608d38b69d75bfa244f9deb6f7e3eb2c7a5874
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -2106,21 +11867,21 @@ Date:   Sun Jan 3 11:16:15 2010 +0100
 
     * use fit instead of not_to_fit in HklParameter (less error prone)
 
- include/hkl/hkl-parameter.h           |    8 +++-----
- src/hkl-axis.c                        |    2 +-
- src/hkl-lattice.c                     |   26 +++++++++++++-------------
- src/hkl-parameter.c                   |   10 +++++-----
- src/hkl-pseudoaxis-common-eulerians.c |    6 +++---
- src/hkl-pseudoaxis-common-hkl.c       |    6 +++---
- src/hkl-pseudoaxis-common-psi.c       |    8 ++++----
- src/hkl-pseudoaxis-common-q.c         |    6 +++---
- src/hkl-pseudoaxis-e4cv-hkl.c         |   14 +++++++-------
- src/hkl-pseudoaxis-e6c-hkl.c          |    8 ++++----
- src/hkl-pseudoaxis-k4cv-hkl.c         |    8 ++++----
- src/hkl-pseudoaxis-k6c-hkl.c          |    8 ++++----
- src/hkl-sample.c                      |   12 ++++++------
- test/hkl-test-axis.c                  |    2 +-
- test/hkl-test-parameter.c             |   32 ++++++++++++++++----------------
+ include/hkl/hkl-parameter.h           |  8 +++-----
+ src/hkl-axis.c                        |  2 +-
+ src/hkl-lattice.c                     | 26 +++++++++++++-------------
+ src/hkl-parameter.c                   | 10 +++++-----
+ src/hkl-pseudoaxis-common-eulerians.c |  6 +++---
+ src/hkl-pseudoaxis-common-hkl.c       |  6 +++---
+ src/hkl-pseudoaxis-common-psi.c       |  8 ++++----
+ src/hkl-pseudoaxis-common-q.c         |  6 +++---
+ src/hkl-pseudoaxis-e4cv-hkl.c         | 14 +++++++-------
+ src/hkl-pseudoaxis-e6c-hkl.c          |  8 ++++----
+ src/hkl-pseudoaxis-k4cv-hkl.c         |  8 ++++----
+ src/hkl-pseudoaxis-k6c-hkl.c          |  8 ++++----
+ src/hkl-sample.c                      | 12 ++++++------
+ test/hkl-test-axis.c                  |  2 +-
+ test/hkl-test-parameter.c             | 32 ++++++++++++++++----------------
  15 files changed, 77 insertions(+), 79 deletions(-)
 
 commit c88d0783d6483d2b5300759d6559f2eff76d4db5
@@ -2129,10 +11890,10 @@ Date:   Sat Jan 2 18:02:45 2010 +0100
 
     * typo
 
- test/hkl-test-pseudoaxis-e4cv.c |   20 ++++++++++----------
- test/hkl-test-pseudoaxis-e6c.c  |   24 ++++++++++++------------
- test/hkl-test-pseudoaxis-k4cv.c |   20 ++++++++++----------
- test/hkl-test-pseudoaxis-k6c.c  |   18 +++++++++---------
+ test/hkl-test-pseudoaxis-e4cv.c | 20 ++++++++++----------
+ test/hkl-test-pseudoaxis-e6c.c  | 24 ++++++++++++------------
+ test/hkl-test-pseudoaxis-k4cv.c | 20 ++++++++++----------
+ test/hkl-test-pseudoaxis-k6c.c  | 18 +++++++++---------
  4 files changed, 41 insertions(+), 41 deletions(-)
 
 commit b9ff314b339a14d622921a7822559a4e2479e091
@@ -2141,8 +11902,8 @@ Date:   Sat Jan 2 13:47:15 2010 +0100
 
     * now all tests are ok
 
- test/hkl-test-pseudoaxis.c |   21 ++++++++++++---------
- test/main.c                |    2 +-
+ test/hkl-test-pseudoaxis.c | 21 ++++++++++++---------
+ test/main.c                |  2 +-
  2 files changed, 13 insertions(+), 10 deletions(-)
 
 commit bebd5e4b375416114aa8bf3510766c2bbf818e8f
@@ -2151,8 +11912,8 @@ Date:   Sat Jan 2 13:36:46 2010 +0100
 
     * stop when a test failed.
 
- test/hkl-test.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ test/hkl-test.c | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit 8e7f5e9dbb6e34d3911eb3202520b1f1e52a5194
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -2160,11 +11921,11 @@ Date:   Sat Jan 2 13:34:46 2010 +0100
 
     * restor a part of the tests
 
- src/hkl-pseudoaxis.c            |   10 ++++++++--
- test/hkl-test-pseudoaxis-e4cv.c |    6 +++---
- test/hkl-test-pseudoaxis-e6c.c  |   11 +++++------
- test/hkl-test-pseudoaxis-k4cv.c |    8 ++++----
- test/hkl-test-pseudoaxis-k6c.c  |   10 +++++-----
+ src/hkl-pseudoaxis.c            | 10 ++++++++--
+ test/hkl-test-pseudoaxis-e4cv.c |  6 +++---
+ test/hkl-test-pseudoaxis-e6c.c  | 11 +++++------
+ test/hkl-test-pseudoaxis-k4cv.c |  8 ++++----
+ test/hkl-test-pseudoaxis-k6c.c  | 10 +++++-----
  5 files changed, 25 insertions(+), 20 deletions(-)
 
 commit afa3ffe47c9f6a8795c8a053bb265ef49058e1e3
@@ -2173,9 +11934,9 @@ Date:   Sat Jan 2 12:48:18 2010 +0100
 
     add the support for flymake
 
- src/Makefile.am  |    7 +++++++
- test/Makefile.am |    7 +++++++
- 2 files changed, 14 insertions(+), 0 deletions(-)
+ src/Makefile.am  | 7 +++++++
+ test/Makefile.am | 7 +++++++
+ 2 files changed, 14 insertions(+)
 
 commit 364260eb3596ed7e68665a8f2c38ddc13a8934ed
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -2183,16 +11944,16 @@ Date:   Thu Dec 24 21:59:47 2009 +0100
 
     * use HKL_GEOMETRY_TYPE_* instead of HKL_GEOMETRY_*
 
- include/hkl/hkl-geometry-factory.h |   10 +++++-----
- src/hkl-geometry-factory.c         |   10 +++++-----
- src/hkl-pseudoaxis-factory.c       |   10 +++++-----
- test/bench.c                       |    8 ++++----
- test/hkl-test-pseudoaxis-e4cv.c    |   24 ++++++++++++------------
- test/hkl-test-pseudoaxis-e6c.c     |   12 ++++++------
- test/hkl-test-pseudoaxis-k4cv.c    |   12 ++++++------
- test/hkl-test-pseudoaxis-k6c.c     |   16 ++++++++--------
- test/hkl-test-pseudoaxis.c         |   16 ++++++++--------
- test/hkl-test-sample.c             |   12 ++++++------
+ include/hkl/hkl-geometry-factory.h | 10 +++++-----
+ src/hkl-geometry-factory.c         | 10 +++++-----
+ src/hkl-pseudoaxis-factory.c       | 10 +++++-----
+ test/bench.c                       |  8 ++++----
+ test/hkl-test-pseudoaxis-e4cv.c    | 24 ++++++++++++------------
+ test/hkl-test-pseudoaxis-e6c.c     | 12 ++++++------
+ test/hkl-test-pseudoaxis-k4cv.c    | 12 ++++++------
+ test/hkl-test-pseudoaxis-k6c.c     | 16 ++++++++--------
+ test/hkl-test-pseudoaxis.c         | 16 ++++++++--------
+ test/hkl-test-sample.c             | 12 ++++++------
  10 files changed, 65 insertions(+), 65 deletions(-)
 
 commit c08d68fb4edf31ab36d2d9eb52db28024601a15c
@@ -2201,24 +11962,24 @@ Date:   Fri Dec 11 16:59:52 2009 +0100
 
     * WORK IN PROGRESS
 
- include/hkl/hkl-pseudoaxis.h          |   26 +------
- src/hkl-pseudoaxis-common-eulerians.c |   14 ++--
- src/hkl-pseudoaxis-common-hkl.c       |   10 ---
- src/hkl-pseudoaxis-common-psi.c       |    3 -
- src/hkl-pseudoaxis-common-q.c         |    6 --
- src/hkl-pseudoaxis-e4cv-hkl.c         |    3 -
- src/hkl-pseudoaxis-e6c-hkl.c          |    6 --
- src/hkl-pseudoaxis-k4cv-hkl.c         |   12 ---
- src/hkl-pseudoaxis-k6c-hkl.c          |   24 -------
- src/hkl-pseudoaxis.c                  |  120 ++++++++++++++++++--------------
- test/bench.c                          |    6 +-
- test/hkl-test-detector.c              |    4 +-
- test/hkl-test-pseudoaxis-e4cv.c       |   48 +++++++-------
- test/hkl-test-pseudoaxis-e6c.c        |   20 +++---
- test/hkl-test-pseudoaxis-k4cv.c       |   17 +++--
- test/hkl-test-pseudoaxis-k6c.c        |   26 ++++----
- test/hkl-test-pseudoaxis.c            |    6 +-
- test/main.c                           |    2 +-
+ include/hkl/hkl-pseudoaxis.h          |  26 ++------
+ src/hkl-pseudoaxis-common-eulerians.c |  14 ++--
+ src/hkl-pseudoaxis-common-hkl.c       |  10 ---
+ src/hkl-pseudoaxis-common-psi.c       |   3 -
+ src/hkl-pseudoaxis-common-q.c         |   6 --
+ src/hkl-pseudoaxis-e4cv-hkl.c         |   3 -
+ src/hkl-pseudoaxis-e6c-hkl.c          |   6 --
+ src/hkl-pseudoaxis-k4cv-hkl.c         |  12 ----
+ src/hkl-pseudoaxis-k6c-hkl.c          |  24 -------
+ src/hkl-pseudoaxis.c                  | 120 +++++++++++++++++++---------------
+ test/bench.c                          |   6 +-
+ test/hkl-test-detector.c              |   4 +-
+ test/hkl-test-pseudoaxis-e4cv.c       |  48 +++++++-------
+ test/hkl-test-pseudoaxis-e6c.c        |  20 +++---
+ test/hkl-test-pseudoaxis-k4cv.c       |  17 ++---
+ test/hkl-test-pseudoaxis-k6c.c        |  26 ++++----
+ test/hkl-test-pseudoaxis.c            |   6 +-
+ test/main.c                           |   2 +-
  18 files changed, 142 insertions(+), 211 deletions(-)
 
 commit 07c848a8ba2dbf6e19289b637ba619a76ff2f277
@@ -2227,8 +11988,8 @@ Date:   Fri Dec 4 16:12:31 2009 +0100
 
     * typo
 
- include/hkl/hkl-pseudoaxis.h |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ include/hkl/hkl-pseudoaxis.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 5d4825cc9b87ec92f47a47dbc4afb16d2ef0c219
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2240,14 +12001,14 @@ Date:   Fri Dec 4 16:05:03 2009 +0100
     add the hkl_pseudo_axis_engine_list_init method to initialize thoses new
     members.
 
- include/hkl/hkl-pseudoaxis.h    |    8 ++++++++
- src/hkl-pseudoaxis.c            |   14 ++++++++++++++
- test/bench.c                    |    2 ++
- test/hkl-test-pseudoaxis-e4cv.c |   12 ++++++++++++
- test/hkl-test-pseudoaxis-e6c.c  |    6 ++++++
- test/hkl-test-pseudoaxis-k4cv.c |    6 ++++++
- test/hkl-test-pseudoaxis-k6c.c  |    7 +++++++
- test/hkl-test-pseudoaxis.c      |   31 ++++++++++++++++---------------
+ include/hkl/hkl-pseudoaxis.h    |  8 ++++++++
+ src/hkl-pseudoaxis.c            | 14 ++++++++++++++
+ test/bench.c                    |  2 ++
+ test/hkl-test-pseudoaxis-e4cv.c | 12 ++++++++++++
+ test/hkl-test-pseudoaxis-e6c.c  |  6 ++++++
+ test/hkl-test-pseudoaxis-k4cv.c |  6 ++++++
+ test/hkl-test-pseudoaxis-k6c.c  |  7 +++++++
+ test/hkl-test-pseudoaxis.c      | 31 ++++++++++++++++---------------
  8 files changed, 71 insertions(+), 15 deletions(-)
 
 commit a2aa2680ed99373f2984e6a0a63bcae0859689dc
@@ -2256,8 +12017,8 @@ Date:   Fri Dec 4 14:51:04 2009 +0100
 
     * optimisation, only one detector new/free for all pseudoaxes tests.
 
- test/hkl-test-pseudoaxis.c |   27 ++++++++++++++-------------
- 1 files changed, 14 insertions(+), 13 deletions(-)
+ test/hkl-test-pseudoaxis.c | 27 ++++++++++++++-------------
+ 1 file changed, 14 insertions(+), 13 deletions(-)
 
 commit 786d21c44703b4e358a3f4b5b0c9ca6e77ffbe1e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2265,14 +12026,14 @@ Date:   Fri Dec 4 14:36:50 2009 +0100
 
     * use the detector factory in the test methods
 
- test/bench.c                    |   16 ++++++---
- test/hkl-test-detector.c        |    2 +-
- test/hkl-test-pseudoaxis-e4cv.c |   12 +++---
- test/hkl-test-pseudoaxis-e6c.c  |    6 ++--
- test/hkl-test-pseudoaxis-k4cv.c |    6 ++--
- test/hkl-test-pseudoaxis-k6c.c  |    8 ++--
- test/hkl-test-pseudoaxis.c      |    2 +-
- test/hkl-test-sample.c          |   77 ++++++++++++++++++++++++++-------------
+ test/bench.c                    | 16 ++++++---
+ test/hkl-test-detector.c        |  2 +-
+ test/hkl-test-pseudoaxis-e4cv.c | 12 +++----
+ test/hkl-test-pseudoaxis-e6c.c  |  6 ++--
+ test/hkl-test-pseudoaxis-k4cv.c |  6 ++--
+ test/hkl-test-pseudoaxis-k6c.c  |  8 ++---
+ test/hkl-test-pseudoaxis.c      |  2 +-
+ test/hkl-test-sample.c          | 77 ++++++++++++++++++++++++++++-------------
  8 files changed, 81 insertions(+), 48 deletions(-)
 
 commit 02eb9d91ee62074f3f14dad5b1a330e5a03e1274
@@ -2281,12 +12042,12 @@ Date:   Fri Dec 4 14:20:22 2009 +0100
 
     * add the detector factory.
 
- include/Makefile.am                |    3 +-
- include/hkl.h                      |    1 +
- include/hkl/hkl-detector-factory.h |   41 ++++++++++++++++++++++++++++++++++++
- src/Makefile.am                    |    1 +
- src/hkl-detector-factory.c         |   37 ++++++++++++++++++++++++++++++++
- 5 files changed, 82 insertions(+), 1 deletions(-)
+ include/Makefile.am                |  3 ++-
+ include/hkl.h                      |  1 +
+ include/hkl/hkl-detector-factory.h | 41 ++++++++++++++++++++++++++++++++++++++
+ src/Makefile.am                    |  1 +
+ src/hkl-detector-factory.c         | 37 ++++++++++++++++++++++++++++++++++
+ 5 files changed, 82 insertions(+), 1 deletion(-)
 
 commit 74613a034057088c430d03fa829d1c24d589b4b7
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2294,9 +12055,9 @@ Date:   Fri Dec 4 13:50:42 2009 +0100
 
     * remove a memory leak
 
- include/hkl/hkl-pseudoaxis.h |    2 +-
- src/hkl-pseudoaxis-common.c  |    4 +++-
- src/hkl-pseudoaxis.c         |    7 ++++++-
+ include/hkl/hkl-pseudoaxis.h | 2 +-
+ src/hkl-pseudoaxis-common.c  | 4 +++-
+ src/hkl-pseudoaxis.c         | 7 ++++++-
  3 files changed, 10 insertions(+), 3 deletions(-)
 
 commit ffde8218cf281b9b096c340fe68fd426a5204db9
@@ -2305,8 +12066,8 @@ Date:   Fri Dec 4 13:22:04 2009 +0100
 
     * do not modify the Holder from the HklDetector struct
 
- include/hkl/hkl-detector.h |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ include/hkl/hkl-detector.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit df9658b076c0fc6524ea79841b6b3182a4b7766e
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -2314,12 +12075,12 @@ Date:   Tue Nov 24 21:59:37 2009 +0100
 
     * use the HklDetector new/free methods.
 
- NEWS                            |    4 ++
- test/hkl-test-pseudoaxis-e4cv.c |   82 +++++++++++++++++++++++++--------------
- test/hkl-test-pseudoaxis-e6c.c  |   42 +++++++++++++-------
- test/hkl-test-pseudoaxis-k4cv.c |   38 ++++++++++++------
- test/hkl-test-pseudoaxis-k6c.c  |   54 ++++++++++++++++---------
- test/hkl-test-pseudoaxis.c      |   13 ++++--
+ NEWS                            |  4 ++
+ test/hkl-test-pseudoaxis-e4cv.c | 82 ++++++++++++++++++++++++++---------------
+ test/hkl-test-pseudoaxis-e6c.c  | 42 +++++++++++++--------
+ test/hkl-test-pseudoaxis-k4cv.c | 38 ++++++++++++-------
+ test/hkl-test-pseudoaxis-k6c.c  | 54 +++++++++++++++++----------
+ test/hkl-test-pseudoaxis.c      | 13 +++++--
  6 files changed, 153 insertions(+), 80 deletions(-)
 
 commit 06f05dcf2dc5dd605db6b52cded9023b9aabb160
@@ -2328,9 +12089,9 @@ Date:   Sun Nov 22 12:34:34 2009 +0100
 
     * add the HklDetector constructor / destructor / attach to holder
 
- include/hkl/hkl-detector.h |    9 ++++++
- src/hkl-detector.c         |   42 +++++++++++++++++++++++++++++-
- test/hkl-test-detector.c   |   61 ++++++++++++++++++++++++++++++++++++++------
+ include/hkl/hkl-detector.h |  9 +++++++
+ src/hkl-detector.c         | 42 ++++++++++++++++++++++++++++++-
+ test/hkl-test-detector.c   | 61 ++++++++++++++++++++++++++++++++++++++++------
  3 files changed, 103 insertions(+), 9 deletions(-)
 
 commit 942d52772b5c473358a8fef245cb3773336323aa
@@ -2339,8 +12100,8 @@ Date:   Sun Nov 22 11:29:35 2009 +0100
 
     * typo
 
- include/hkl/hkl-detector.h |    2 +-
- src/hkl-geometry-factory.c |   20 ++++++++++----------
+ include/hkl/hkl-detector.h |  2 +-
+ src/hkl-geometry-factory.c | 20 ++++++++++----------
  2 files changed, 11 insertions(+), 11 deletions(-)
 
 commit 109bb176d86500dc1e011fc6cd974b55643c388e
@@ -2349,8 +12110,8 @@ Date:   Sun Nov 8 10:00:19 2009 +0100
 
     * add the autogen.sh script
 
- autogen.sh |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ autogen.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit 9c84b23ff8ff333ccd293863ba00389befa4b0d5
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -2358,8 +12119,8 @@ Date:   Tue Nov 3 22:17:47 2009 +0100
 
     * do not stopthe test if an error occured.
 
- test/hkl-test.c |    2 --
- 1 files changed, 0 insertions(+), 2 deletions(-)
+ test/hkl-test.c | 2 --
+ 1 file changed, 2 deletions(-)
 
 commit 0497e74e6c06c01436a9ac0236370b2003ab93ae
 Author: Picca Frederic-Emmanuel <picca at mordor.(none)>
@@ -2367,8 +12128,8 @@ Date:   Tue Nov 3 22:17:24 2009 +0100
 
     * correct the test suite
 
- test/hkl-test-pseudoaxis-k4cv.c |    6 ++++--
- test/hkl-test-pseudoaxis-k6c.c  |    6 +++---
+ test/hkl-test-pseudoaxis-k4cv.c | 6 ++++--
+ test/hkl-test-pseudoaxis-k6c.c  | 6 +++---
  2 files changed, 7 insertions(+), 5 deletions(-)
 
 commit 6c183bb90c230f9a85dc4ec15a9be2959d8452b5
@@ -2377,20 +12138,20 @@ Date:   Sat Oct 24 14:29:10 2009 +0200
 
     * add the autoconf/automake files
 
- .gitignore          |    8 +
- AUTHORS             |    1 +
- COPYING             |  675 +++++++++++++++++++++++++++++++++++++++++++++++++++
- ChangeLog           |    2 +
- INSTALL             |  302 +++++++++++++++++++++++
- Makefile.am         |   10 +
- configure.ac        |   45 ++++
- hkl.pc.in           |    2 +-
- include/Makefile.am |   10 +
- src/Makefile.am     |   43 ++++
- src/Makefile.linux  |  157 ------------
- src/Makefile.vc     |   90 -------
- test/Makefile.am    |   33 +++
- wscript             |    4 +-
+ .gitignore          |   8 +
+ AUTHORS             |   1 +
+ COPYING             | 675 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ ChangeLog           |   2 +
+ INSTALL             | 302 +++++++++++++++++++++++
+ Makefile.am         |  10 +
+ configure.ac        |  45 ++++
+ hkl.pc.in           |   2 +-
+ include/Makefile.am |  10 +
+ src/Makefile.am     |  43 ++++
+ src/Makefile.linux  | 157 ------------
+ src/Makefile.vc     |  90 -------
+ test/Makefile.am    |  33 +++
+ wscript             |   4 +-
  14 files changed, 1132 insertions(+), 250 deletions(-)
 
 commit 504e27f5b84999bfc4f3bb92e6e92a1688b4c1a6
@@ -2406,10 +12167,10 @@ Date:   Fri Oct 23 11:32:30 2009 +0200
 
     * prepare for the 3.0.1 release.
 
- NEWS    |   10 +++++++++-
- README  |    4 ++--
- TODO    |    4 +---
- wscript |    2 +-
+ NEWS    | 10 +++++++++-
+ README  |  4 ++--
+ TODO    |  4 +---
+ wscript |  2 +-
  4 files changed, 13 insertions(+), 7 deletions(-)
 
 commit 9b8f9b3ab90408d308956aa5da53659edd566a12
@@ -2418,13 +12179,13 @@ Date:   Fri Oct 23 11:11:20 2009 +0200
 
     * add Maria Teresa as autor for the psi_constant mode.
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |    1 +
- src/hkl-pseudoaxis-common-hkl.c         |    1 +
- src/hkl-pseudoaxis-e4cv-hkl.c           |    1 +
- src/hkl-pseudoaxis-e6c-hkl.c            |    1 +
- src/hkl-pseudoaxis-k4cv-hkl.c           |    1 +
- src/hkl-pseudoaxis-k6c-hkl.c            |    1 +
- 6 files changed, 6 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-common-hkl.h | 1 +
+ src/hkl-pseudoaxis-common-hkl.c         | 1 +
+ src/hkl-pseudoaxis-e4cv-hkl.c           | 1 +
+ src/hkl-pseudoaxis-e6c-hkl.c            | 1 +
+ src/hkl-pseudoaxis-k4cv-hkl.c           | 1 +
+ src/hkl-pseudoaxis-k6c-hkl.c            | 1 +
+ 6 files changed, 6 insertions(+)
 
 commit 83ee906e0a6e35511d21cb2c7079709f938fa85c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2434,16 +12195,16 @@ Date:   Wed Oct 14 16:35:32 2009 +0200
     
     a non valid geometry is a geometry with an axis values out of range.
 
- include/hkl/hkl-axis.h      |    2 ++
- include/hkl/hkl-geometry.h  |    4 ++++
- include/hkl/hkl-list.h      |    6 ++++++
- include/hkl/hkl-parameter.h |    2 ++
- src/hkl-axis.c              |    5 +++++
- src/hkl-geometry.c          |   29 +++++++++++++++++++++++++++--
- src/hkl-parameter.c         |    8 ++++++++
- src/hkl-pseudoaxis.c        |    1 +
- test/hkl-test-geometry.c    |   23 +++++++++++++++++++++++
- test/hkl-test-parameter.c   |   16 ++++++++++++++++
+ include/hkl/hkl-axis.h      |  2 ++
+ include/hkl/hkl-geometry.h  |  4 ++++
+ include/hkl/hkl-list.h      |  6 ++++++
+ include/hkl/hkl-parameter.h |  2 ++
+ src/hkl-axis.c              |  5 +++++
+ src/hkl-geometry.c          | 29 +++++++++++++++++++++++++++--
+ src/hkl-parameter.c         |  8 ++++++++
+ src/hkl-pseudoaxis.c        |  1 +
+ test/hkl-test-geometry.c    | 23 +++++++++++++++++++++++
+ test/hkl-test-parameter.c   | 16 ++++++++++++++++
  10 files changed, 94 insertions(+), 2 deletions(-)
 
 commit f141954ca418bc7af40f80399eb88dce80a8fdcf
@@ -2452,8 +12213,8 @@ Date:   Wed Sep 23 09:45:29 2009 +0200
 
     * no need to put vertical in mode names for the vertical geometries
 
- src/hkl-pseudoaxis-e4cv-hkl.c |    4 ++--
- src/hkl-pseudoaxis-k4cv-hkl.c |    4 ++--
+ src/hkl-pseudoaxis-e4cv-hkl.c | 4 ++--
+ src/hkl-pseudoaxis-k4cv-hkl.c | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
 
 commit 644aabb27587fda190a37b0a2062c4920882a637
@@ -2462,8 +12223,8 @@ Date:   Mon Sep 21 11:37:20 2009 +0200
 
     * omega = +/-pi is also valid for the horizontal modes.
 
- src/hkl-pseudoaxis-e6c-hkl.c |    2 +-
- src/hkl-pseudoaxis-k6c-hkl.c |   14 +++++++-------
+ src/hkl-pseudoaxis-e6c-hkl.c |  2 +-
+ src/hkl-pseudoaxis-k6c-hkl.c | 14 +++++++-------
  2 files changed, 8 insertions(+), 8 deletions(-)
 
 commit 8455255dc4e8d0a838199e60bad793c891da10c6
@@ -2472,8 +12233,8 @@ Date:   Tue Sep 22 17:35:09 2009 +0200
 
     * forgot a fprintf
 
- test/hkl-test-pseudoaxis-e4cv.c |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
+ test/hkl-test-pseudoaxis-e4cv.c | 1 -
+ 1 file changed, 1 deletion(-)
 
 commit fd77ff95f115357f87bdab9f2b18126215108236
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2481,8 +12242,8 @@ Date:   Tue Sep 22 17:28:08 2009 +0200
 
     * typo
 
- src/hkl-pseudoaxis-common-hkl.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis-common-hkl.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit 13c2acacabcc672d2bd92c4d097f18560dfc43dc
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2490,8 +12251,8 @@ Date:   Tue Sep 22 17:26:35 2009 +0200
 
     * better presentation of the PseduoAxis fprintf method
 
- src/hkl-pseudoaxis.c |    9 +++++----
- 1 files changed, 5 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
 
 commit a2cf58268e983b602e43f7e35730754fff4e83c4
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2499,8 +12260,8 @@ Date:   Tue Sep 22 17:26:12 2009 +0200
 
     * add a test method for the psi_constant_vertical mode nd correct the init method
 
- src/hkl-pseudoaxis-common-hkl.c |   10 +++---
- test/hkl-test-pseudoaxis-e4cv.c |   65 +++++++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-common-hkl.c | 10 +++----
+ test/hkl-test-pseudoaxis-e4cv.c | 65 +++++++++++++++++++++++++++++++++++++++++
  2 files changed, 70 insertions(+), 5 deletions(-)
 
 commit 2211fe2f1d51309f355f4306718af98e4e1534ab
@@ -2509,13 +12270,13 @@ Date:   Tue Sep 22 10:12:42 2009 +0200
 
     * indent nothing more
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |   12 ++++----
- src/hkl-pseudoaxis-common-hkl.c         |   46 +++++++++++++++++-------------
- src/hkl-pseudoaxis-common-psi.c         |   34 +++++++++++-----------
- src/hkl-pseudoaxis-e4cv-hkl.c           |   31 +++++---------------
- src/hkl-pseudoaxis-e6c-hkl.c            |   28 +++++--------------
- src/hkl-pseudoaxis-k4cv-hkl.c           |   17 +++---------
- src/hkl-pseudoaxis-k6c-hkl.c            |   45 +++++++++---------------------
+ include/hkl/hkl-pseudoaxis-common-hkl.h | 12 ++++-----
+ src/hkl-pseudoaxis-common-hkl.c         | 46 +++++++++++++++++++--------------
+ src/hkl-pseudoaxis-common-psi.c         | 34 ++++++++++++------------
+ src/hkl-pseudoaxis-e4cv-hkl.c           | 31 ++++++----------------
+ src/hkl-pseudoaxis-e6c-hkl.c            | 28 +++++---------------
+ src/hkl-pseudoaxis-k4cv-hkl.c           | 17 +++---------
+ src/hkl-pseudoaxis-k6c-hkl.c            | 45 ++++++++++----------------------
  7 files changed, 82 insertions(+), 131 deletions(-)
 
 commit d3ad49784201fbdc3b8889869c9f431447c71b90
@@ -2524,8 +12285,8 @@ Date:   Tue Sep 22 10:08:59 2009 +0200
 
     * correct the psi_constant init method
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |    4 ++--
- src/hkl-pseudoaxis-common-hkl.c         |   13 +++++++++----
+ include/hkl/hkl-pseudoaxis-common-hkl.h |  4 ++--
+ src/hkl-pseudoaxis-common-hkl.c         | 13 +++++++++----
  2 files changed, 11 insertions(+), 6 deletions(-)
 
 commit f5c83725f3cc354566f13b7501f0f6896d4f893b
@@ -2534,13 +12295,13 @@ Date:   Mon Sep 21 14:59:05 2009 +0200
 
     "Again psi constant (4)'
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |   25 +++++++
- src/hkl-pseudoaxis-common-hkl.c         |  114 ++++++++++++++++++++++++++++++-
- src/hkl-pseudoaxis-e4cv-hkl.c           |   27 +++++++
- src/hkl-pseudoaxis-e6c-hkl.c            |   27 +++++++
- src/hkl-pseudoaxis-k4cv-hkl.c           |   30 ++++++++
- src/hkl-pseudoaxis-k6c-hkl.c            |   28 ++++++++
- 6 files changed, 250 insertions(+), 1 deletions(-)
+ include/hkl/hkl-pseudoaxis-common-hkl.h |  25 +++++++
+ src/hkl-pseudoaxis-common-hkl.c         | 114 +++++++++++++++++++++++++++++++-
+ src/hkl-pseudoaxis-e4cv-hkl.c           |  27 ++++++++
+ src/hkl-pseudoaxis-e6c-hkl.c            |  27 ++++++++
+ src/hkl-pseudoaxis-k4cv-hkl.c           |  30 +++++++++
+ src/hkl-pseudoaxis-k6c-hkl.c            |  28 ++++++++
+ 6 files changed, 250 insertions(+), 1 deletion(-)
 
 commit 105a5f062f42d9e303c6ad502bfd1a4804595e65
 Author: teresa <tnunez at mail.desy.de>
@@ -2548,8 +12309,8 @@ Date:   Mon Sep 14 14:21:31 2009 +0200
 
     Change of the explanation of the bissector horizontal method (and some small other changes)'
 
- Documentation/user-guide.txt |   48 +++++++++++++++++++++++++++--------------
- 1 files changed, 31 insertions(+), 17 deletions(-)
+ Documentation/user-guide.txt | 48 ++++++++++++++++++++++++++++----------------
+ 1 file changed, 31 insertions(+), 17 deletions(-)
 
 commit 71b934ee4264b937c80b0cebe4e2007e40bd72a6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2557,8 +12318,8 @@ Date:   Fri Sep 11 16:11:06 2009 +0200
 
     * add more documentation
 
- Documentation/user-guide.txt |   87 +++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 85 insertions(+), 2 deletions(-)
+ Documentation/user-guide.txt | 87 +++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 85 insertions(+), 2 deletions(-)
 
 commit df3db041c4742173ae9f953486442c26bdf2d9fb
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2566,8 +12327,8 @@ Date:   Thu Sep 10 17:56:28 2009 +0200
 
     * still working on the pseudo axis tutorial
 
- Documentation/user-guide.txt |   31 +++++++++++++++++++++++++++++++
- 1 files changed, 31 insertions(+), 0 deletions(-)
+ Documentation/user-guide.txt | 31 +++++++++++++++++++++++++++++++
+ 1 file changed, 31 insertions(+)
 
 commit cd96c35997040addfdd3441fd930c3eec3939b47
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2575,8 +12336,8 @@ Date:   Thu Sep 10 17:56:09 2009 +0200
 
     * correction thanks to teresa
 
- Documentation/user-guide.txt |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ Documentation/user-guide.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit bf32ee581d7b55f6df2771ac205e8d8815518ab6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2584,8 +12345,8 @@ Date:   Thu Sep 10 09:49:28 2009 +0200
 
     * start working on the hkl user-guide.
 
- Documentation/user-guide.txt |  196 +++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 195 insertions(+), 1 deletions(-)
+ Documentation/user-guide.txt | 196 ++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 195 insertions(+), 1 deletion(-)
 
 commit fa5c98d2f47d8a051de16921700c5cdfce26a8d6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2593,8 +12354,8 @@ Date:   Thu Sep 10 09:54:59 2009 +0200
 
     * post merge version increment
 
- NEWS |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ NEWS | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 6e5215cc770ddb95eb2ae68c8d5247af33efef6d
 Author: System User <picca at b1181-srv2.diffabs.rcl>
@@ -2602,10 +12363,10 @@ Date:   Thu Jul 16 14:43:06 2009 +0200
 
     * switch to waf 1.5.8 to prepare the windows compilation.
 
- src/wscript_build  |   16 ++++++++--------
- test/wscript_build |   40 +++++++++++++++++++++-------------------
- waf                |  Bin 75487 -> 84763 bytes
- wscript            |   12 +++---------
+ src/wscript_build  |  16 ++++++++--------
+ test/wscript_build |  40 +++++++++++++++++++++-------------------
+ waf                | Bin 75487 -> 84763 bytes
+ wscript            |  12 +++---------
  4 files changed, 32 insertions(+), 36 deletions(-)
 
 commit 36e37104c318d56670e42e1f578a4d0ff81e357e
@@ -2831,8 +12592,8 @@ Date:   Fri Jun 5 16:42:27 2009 +0200
 
     * better initialization of the Psi pseudoAxisEngine parameters
 
- src/hkl-pseudoaxis-common-psi.c |   29 +++++++++++++++--------------
- 1 files changed, 15 insertions(+), 14 deletions(-)
+ src/hkl-pseudoaxis-common-psi.c | 29 +++++++++++++++--------------
+ 1 file changed, 15 insertions(+), 14 deletions(-)
 
 commit 4c2a571f8985e7032333b09dda46708854b1ec19
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2840,12 +12601,12 @@ Date:   Fri Jun 5 11:50:04 2009 +0200
 
     * add the q2 pseudo axis engine for the 6 circles geometries.
 
- include/hkl/hkl-pseudoaxis-common-q.h |    1 +
- src/hkl-pseudoaxis-common-q.c         |  129 +++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis-factory.c          |    2 +
- test/hkl-test-pseudoaxis-e6c.c        |   63 ++++++++++++++++
- test/hkl-test-pseudoaxis-k6c.c        |   63 ++++++++++++++++
- 5 files changed, 258 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-common-q.h |   1 +
+ src/hkl-pseudoaxis-common-q.c         | 129 ++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-factory.c          |   2 +
+ test/hkl-test-pseudoaxis-e6c.c        |  63 +++++++++++++++++
+ test/hkl-test-pseudoaxis-k6c.c        |  63 +++++++++++++++++
+ 5 files changed, 258 insertions(+)
 
 commit d3d7541260b2f88eb4165fca5477a3d9b46690a6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2853,8 +12614,8 @@ Date:   Fri Jun 5 11:49:13 2009 +0200
 
     * move around comments
 
- src/hkl-pseudoaxis-common-q.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis-common-q.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit 6b508c9263a1709a9811407008a90f1a015d8c46
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2862,8 +12623,8 @@ Date:   Fri Jun 5 11:48:55 2009 +0200
 
     * add also the q test in the k4c geometry
 
- test/hkl-test-pseudoaxis-k4cv.c |   57 +++++++++++++++++++++++++++++++++++++++
- 1 files changed, 57 insertions(+), 0 deletions(-)
+ test/hkl-test-pseudoaxis-k4cv.c | 57 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 57 insertions(+)
 
 commit 427c663d6b1844756ae57c028a5501596f966e11
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2871,11 +12632,11 @@ Date:   Fri Jun 5 09:53:04 2009 +0200
 
     ** add the q HklPseudoAxisEngine for e4cv and k4cv geometries.
 
- include/hkl/hkl-pseudoaxis-common-q.h |   29 +++++++
- src/hkl-pseudoaxis-common-q.c         |  130 +++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis-factory.c          |    3 +
- test/hkl-test-pseudoaxis-e4cv.c       |   56 ++++++++++++++
- 4 files changed, 218 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-common-q.h |  29 ++++++++
+ src/hkl-pseudoaxis-common-q.c         | 130 ++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-factory.c          |   3 +
+ test/hkl-test-pseudoaxis-e4cv.c       |  56 +++++++++++++++
+ 4 files changed, 218 insertions(+)
 
 commit e7955991bac2ae40506daf7f9698ba50dfd6fbe8
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2883,10 +12644,10 @@ Date:   Fri Jun 5 09:22:31 2009 +0200
 
     * add the get_wavelength to the HklSource class.
 
- include/hkl/hkl-source.h |    2 ++
- src/hkl-source.c         |    5 +++++
- test/hkl-test-source.c   |   12 ++++++++++++
- 3 files changed, 19 insertions(+), 0 deletions(-)
+ include/hkl/hkl-source.h |  2 ++
+ src/hkl-source.c         |  5 +++++
+ test/hkl-test-source.c   | 12 ++++++++++++
+ 3 files changed, 19 insertions(+)
 
 commit 626b4896ade2cb0cbd9e1261e642f875c94ee0d0
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2894,9 +12655,9 @@ Date:   Thu Jun 4 11:42:21 2009 +0200
 
     * update the "eulerians" pseudo axis test method.
 
- test/hkl-test-pseudoaxis-k4cv.c |   26 ++++++++++++++------------
- test/hkl-test-pseudoaxis-k6c.c  |   25 ++++++++++++++-----------
- test/hkl-test-pseudoaxis.c      |    3 +++
+ test/hkl-test-pseudoaxis-k4cv.c | 26 ++++++++++++++------------
+ test/hkl-test-pseudoaxis-k6c.c  | 25 ++++++++++++++-----------
+ test/hkl-test-pseudoaxis.c      |  3 +++
  3 files changed, 31 insertions(+), 23 deletions(-)
 
 commit 23117b990d103fd164b21910f84228d2498b4a56
@@ -2905,11 +12666,11 @@ Date:   Thu Jun 4 10:10:54 2009 +0200
 
     * first working version of the cut problem
 
- include/hkl/hkl-geometry.h |    2 +
- src/hkl-geometry.c         |   66 ++++++++++++++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis.c       |    1 +
- test/hkl-test-geometry.c   |   35 +++++++++++++++++++++++
- 4 files changed, 104 insertions(+), 0 deletions(-)
+ include/hkl/hkl-geometry.h |  2 ++
+ src/hkl-geometry.c         | 66 ++++++++++++++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis.c       |  1 +
+ test/hkl-test-geometry.c   | 35 ++++++++++++++++++++++++
+ 4 files changed, 104 insertions(+)
 
 commit d7f4f0a85063a8a93677e4bb9220b47e1ddc500c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2917,11 +12678,11 @@ Date:   Wed Jun 3 18:03:24 2009 +0200
 
     * add the HklAxis get_max method
 
- include/hkl/hkl-axis.h      |    2 ++
- include/hkl/hkl-parameter.h |    2 ++
- src/hkl-axis.c              |    5 +++++
- src/hkl-parameter.c         |    6 ++++++
- 4 files changed, 15 insertions(+), 0 deletions(-)
+ include/hkl/hkl-axis.h      | 2 ++
+ include/hkl/hkl-parameter.h | 2 ++
+ src/hkl-axis.c              | 5 +++++
+ src/hkl-parameter.c         | 6 ++++++
+ 4 files changed, 15 insertions(+)
 
 commit dfe3916cb0b0fdd4a0ad384005f5ee2fe5319510
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2929,10 +12690,10 @@ Date:   Wed Jun 3 16:28:49 2009 +0200
 
     * add the HklAxis set_value_smallest_in_range method with test.
 
- include/hkl/hkl-axis.h |    2 ++
- src/hkl-axis.c         |   13 +++++++++++++
- test/hkl-test-axis.c   |   39 +++++++++++++++++++++++++++++++++++++++
- 3 files changed, 54 insertions(+), 0 deletions(-)
+ include/hkl/hkl-axis.h |  2 ++
+ src/hkl-axis.c         | 13 +++++++++++++
+ test/hkl-test-axis.c   | 39 +++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 54 insertions(+)
 
 commit 1f0255022c3b79f7df038159471e8a6b5f875e9f
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2940,8 +12701,8 @@ Date:   Wed Jun 3 16:08:15 2009 +0200
 
     * add the extern keyword in the HklInterval struct
 
- include/hkl/hkl-interval.h |   30 +++++++++++++++---------------
- 1 files changed, 15 insertions(+), 15 deletions(-)
+ include/hkl/hkl-interval.h | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
 
 commit 0fb60655442844d20c02b7b8da802844df856fb8
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2949,12 +12710,12 @@ Date:   Wed Jun 3 16:07:44 2009 +0200
 
     * remove a bug in the HklAxis is_value_compatible_with_range.
 
- include/hkl/hkl-axis.h     |    2 ++
- include/hkl/hkl-interval.h |    2 ++
- src/hkl-axis.c             |   38 +++++++++++++++++++++++---------------
- src/hkl-interval.c         |    7 +++++++
- test/hkl-test-axis.c       |   35 +++++++++++++++++++++++++++++++++++
- 5 files changed, 69 insertions(+), 15 deletions(-)
+ include/hkl/hkl-axis.h     |  2 ++
+ include/hkl/hkl-interval.h |  2 ++
+ src/hkl-axis.c             | 40 ++++++++++++++++++++++++----------------
+ src/hkl-interval.c         |  7 +++++++
+ test/hkl-test-axis.c       | 35 +++++++++++++++++++++++++++++++++++
+ 5 files changed, 70 insertions(+), 16 deletions(-)
 
 commit 0679e0da81c06d926820daed8dd2d811a760f8aa
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -2964,13 +12725,13 @@ Date:   Tue Jun 2 15:18:19 2009 +0200
     
     get_name, get/set_changed and _get_value.
 
- include/hkl/hkl-axis.h       |   10 ++++++-
- src/hkl-axis.c               |   58 ++++++++++++++++++++++++++++-------------
- src/hkl-geometry.c           |   30 +++++++++++-----------
- src/hkl-pseudoaxis-auto.c    |    4 +-
- src/hkl-pseudoaxis-factory.c |   12 ++++----
- src/hkl-sample.c             |    2 +-
- test/hkl-test-geometry.c     |   16 ++++++------
+ include/hkl/hkl-axis.h       | 10 +++++++-
+ src/hkl-axis.c               | 58 +++++++++++++++++++++++++++++---------------
+ src/hkl-geometry.c           | 30 +++++++++++------------
+ src/hkl-pseudoaxis-auto.c    |  4 +--
+ src/hkl-pseudoaxis-factory.c | 12 ++++-----
+ src/hkl-sample.c             |  2 +-
+ test/hkl-test-geometry.c     | 16 ++++++------
  7 files changed, 80 insertions(+), 52 deletions(-)
 
 commit 66a1fa468f7366393266bab31e2f54e08612cd0b
@@ -2981,26 +12742,26 @@ Date:   Sun May 24 14:18:23 2009 +0200
     
     Just #include <hkl.h> to use the hkl library
 
- include/hkl.h                   |    5 +++++
- test/bench.c                    |    5 +----
- test/hkl-test-axis.c            |    5 +----
- test/hkl-test-detector.c        |    4 +---
- test/hkl-test-geometry.c        |    4 +---
- test/hkl-test-interval.c        |    4 +---
- test/hkl-test-lattice.c         |    2 +-
- test/hkl-test-matrix.c          |    5 +----
- test/hkl-test-parameter.c       |    4 +---
- test/hkl-test-pseudoaxis-e4cv.c |    5 +----
- test/hkl-test-pseudoaxis-e6c.c  |    5 +----
- test/hkl-test-pseudoaxis-k4cv.c |    5 +----
- test/hkl-test-pseudoaxis-k6c.c  |    5 +----
- test/hkl-test-pseudoaxis.c      |    3 +--
- test/hkl-test-quaternion.c      |    6 +-----
- test/hkl-test-sample.c          |    5 +----
- test/hkl-test-source.c          |    4 +---
- test/hkl-test-vector.c          |    5 +----
- test/hkl-test.c                 |    5 +----
- wscript                         |    1 +
+ include/hkl.h                   | 5 +++++
+ test/bench.c                    | 5 +----
+ test/hkl-test-axis.c            | 5 +----
+ test/hkl-test-detector.c        | 4 +---
+ test/hkl-test-geometry.c        | 4 +---
+ test/hkl-test-interval.c        | 4 +---
+ test/hkl-test-lattice.c         | 2 +-
+ test/hkl-test-matrix.c          | 5 +----
+ test/hkl-test-parameter.c       | 4 +---
+ test/hkl-test-pseudoaxis-e4cv.c | 5 +----
+ test/hkl-test-pseudoaxis-e6c.c  | 5 +----
+ test/hkl-test-pseudoaxis-k4cv.c | 5 +----
+ test/hkl-test-pseudoaxis-k6c.c  | 5 +----
+ test/hkl-test-pseudoaxis.c      | 3 +--
+ test/hkl-test-quaternion.c      | 6 +-----
+ test/hkl-test-sample.c          | 5 +----
+ test/hkl-test-source.c          | 4 +---
+ test/hkl-test-vector.c          | 5 +----
+ test/hkl-test.c                 | 5 +----
+ wscript                         | 1 +
  20 files changed, 24 insertions(+), 63 deletions(-)
 
 commit c6f782d0b1499f2ca8f276fab4853c68ba540b41
@@ -3009,9 +12770,9 @@ Date:   Sat May 23 22:05:36 2009 +0200
 
     * add the sample set_name method
 
- include/hkl/hkl-sample.h |    2 ++
- src/hkl-sample.c         |   10 ++++++++++
- 2 files changed, 12 insertions(+), 0 deletions(-)
+ include/hkl/hkl-sample.h |  2 ++
+ src/hkl-sample.c         | 10 ++++++++++
+ 2 files changed, 12 insertions(+)
 
 commit 666d953cf77cf9629a55c7b5d9979cf19a828e44
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3019,8 +12780,8 @@ Date:   Sat May 23 14:46:09 2009 +0200
 
     * we can create a sample reflection with null <hkl> vector
 
- src/hkl-sample.c |    5 +----
- 1 files changed, 1 insertions(+), 4 deletions(-)
+ src/hkl-sample.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
 
 commit 6f348abff9ec1934943588b079c9f4abbc6effb1
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3028,8 +12789,8 @@ Date:   Sat May 23 14:45:42 2009 +0200
 
     * bug in the get reflection parameter check
 
- src/hkl-sample.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ src/hkl-sample.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit 787b32c8b122376cc35b2ea3488f34f8029227a0
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3037,8 +12798,8 @@ Date:   Sat May 23 14:45:12 2009 +0200
 
     * do not add the reflection if it is NULL
 
- src/hkl-sample.c |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
+ src/hkl-sample.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
 
 commit 413fbe337800a0ef18295cc15b17b0bd5d126cfb
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3046,8 +12807,8 @@ Date:   Sat May 23 14:44:45 2009 +0200
 
     * remove a valgrind warning.
 
- src/hkl-sample.c |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ src/hkl-sample.c | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit 1dffbcccdad87a3d1450cf382d603711d761b95e
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3055,8 +12816,8 @@ Date:   Sat May 23 14:44:12 2009 +0200
 
     * no more assert in the vector angle method
 
- src/hkl-vector.c |    9 +++++----
- 1 files changed, 5 insertions(+), 4 deletions(-)
+ src/hkl-vector.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
 
 commit 5526c2d9273725e329c89524174982aae92687a9
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3064,8 +12825,8 @@ Date:   Fri May 15 16:20:58 2009 +0200
 
     * now the HklSample compute_UB matrix update also the UB matrix !!!
 
- src/hkl-sample.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ src/hkl-sample.c | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit c4ee40c1e0df7235618a4ebc075cb71f5dab2ba5
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3073,10 +12834,10 @@ Date:   Thu May 14 16:18:33 2009 +0200
 
     * print a backtrace when an assert failed.
 
- include/hkl/hkl-macros.h |   12 ++++++++++++
- src/hkl-quaternion.c     |    5 ++---
- src/hkl-vector.c         |    5 ++---
- src/usage.c              |   17 +++++++++++++++++
+ include/hkl/hkl-macros.h | 12 ++++++++++++
+ src/hkl-quaternion.c     |  5 ++---
+ src/hkl-vector.c         |  5 ++---
+ src/usage.c              | 17 +++++++++++++++++
  4 files changed, 33 insertions(+), 6 deletions(-)
 
 commit 8fadc24c74696d71e79a1d2ac28e3fb971095340
@@ -3085,9 +12846,9 @@ Date:   Thu May 14 15:19:04 2009 +0200
 
     * add the HklSampleList fprintf method
 
- include/hkl/hkl-sample.h |    2 ++
- src/hkl-sample.c         |    7 +++++++
- 2 files changed, 9 insertions(+), 0 deletions(-)
+ include/hkl/hkl-sample.h | 2 ++
+ src/hkl-sample.c         | 7 +++++++
+ 2 files changed, 9 insertions(+)
 
 commit 22b15be7816c910237d81400cead68450b0d3bc3
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3095,14 +12856,14 @@ Date:   Thu May 14 14:52:46 2009 +0200
 
     * split the factory.h files into .c and .h part
 
- include/hkl/hkl-geometry-factory.h   |  107 +---------------------------
- include/hkl/hkl-pseudoaxis-factory.h |  107 +---------------------------
- src/hkl-geometry-factory.c           |  132 ++++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis-factory.c         |  130 +++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis-e4cv.c      |    1 +
- test/hkl-test-pseudoaxis-e6c.c       |    1 +
- test/hkl-test-pseudoaxis-k4cv.c      |    1 +
- test/hkl-test-pseudoaxis-k6c.c       |    1 +
+ include/hkl/hkl-geometry-factory.h   | 107 +---------------------------
+ include/hkl/hkl-pseudoaxis-factory.h | 107 +---------------------------
+ src/hkl-geometry-factory.c           | 132 +++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-factory.c         | 130 ++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis-e4cv.c      |   1 +
+ test/hkl-test-pseudoaxis-e6c.c       |   1 +
+ test/hkl-test-pseudoaxis-k4cv.c      |   1 +
+ test/hkl-test-pseudoaxis-k6c.c       |   1 +
  8 files changed, 269 insertions(+), 211 deletions(-)
 
 commit 391b0fef4efb6a3774f50d581ef95f5e7edd3477
@@ -3111,8 +12872,8 @@ Date:   Thu May 14 10:13:31 2009 +0200
 
     * add an rpath in the test part instead of modifing the LD_LIBRARY_PATH
 
- test/wscript_build |    2 ++
- wscript            |    4 ----
+ test/wscript_build | 2 ++
+ wscript            | 4 ----
  2 files changed, 2 insertions(+), 4 deletions(-)
 
 commit 746f612b1184c8f3e2923474f6a32e239d694425
@@ -3121,10 +12882,10 @@ Date:   Thu May 14 10:08:08 2009 +0200
 
     * add the clear and test method to the HklSampleList
 
- include/hkl/hkl-sample.h |    2 ++
- src/hkl-sample.c         |    9 +++++++++
- test/hkl-test-sample.c   |   25 +++++++++++++++++++++++++
- 3 files changed, 36 insertions(+), 0 deletions(-)
+ include/hkl/hkl-sample.h |  2 ++
+ src/hkl-sample.c         |  9 +++++++++
+ test/hkl-test-sample.c   | 25 +++++++++++++++++++++++++
+ 3 files changed, 36 insertions(+)
 
 commit 0a63cf49d6fda50cc8719f1eea00c3baec9f98ac
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3132,8 +12893,8 @@ Date:   Thu May 14 09:58:10 2009 +0200
 
     * update the HklSample get_reflection test method
 
- test/hkl-test-sample.c |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ test/hkl-test-sample.c | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit b89520c560dc86a47832406a0c5145361170c081
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3143,8 +12904,8 @@ Date:   Thu May 14 09:56:36 2009 +0200
     	- e6c omega, phi, mu
     	- k6c komega, kphi, mu
 
- src/hkl-pseudoaxis-e6c-hkl.c |   24 ++++++++++++++++++++++--
- src/hkl-pseudoaxis-k6c-hkl.c |   24 ++++++++++++++++++++++--
+ src/hkl-pseudoaxis-e6c-hkl.c | 24 ++++++++++++++++++++++--
+ src/hkl-pseudoaxis-k6c-hkl.c | 24 ++++++++++++++++++++++--
  2 files changed, 44 insertions(+), 4 deletions(-)
 
 commit f850c1def2baa1de27760129186cf7dc0935f4c1
@@ -3153,8 +12914,8 @@ Date:   Thu May 14 09:50:52 2009 +0200
 
     * add the SampleReflection print in the Sample fprintf method
 
- include/hkl/hkl-sample.h |    2 +-
- src/hkl-sample.c         |   33 ++++++++++++++++++++++++++++++++-
+ include/hkl/hkl-sample.h |  2 +-
+ src/hkl-sample.c         | 33 ++++++++++++++++++++++++++++++++-
  2 files changed, 33 insertions(+), 2 deletions(-)
 
 commit 866faed1fbc38cb738941467ce6633dfe9618331
@@ -3163,8 +12924,8 @@ Date:   Thu May 14 09:36:56 2009 +0200
 
     * remove a memory leak in the geometry multiplication
 
- include/hkl/hkl-pseudoaxis-factory.h |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-factory.h | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit 2b2b4ffa125d0bf6df00dc27cc80f2f8ad7de259
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3172,8 +12933,8 @@ Date:   Thu Apr 23 14:25:34 2009 +0200
 
     * no more restriction in the eulerian kappa conversion
 
- src/hkl-pseudoaxis-common-eulerians.c |   12 ++++++------
- 1 files changed, 6 insertions(+), 6 deletions(-)
+ src/hkl-pseudoaxis-common-eulerians.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
 
 commit f14f7dec81fd31f9eed366a7f76a837707162fa9
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3181,8 +12942,8 @@ Date:   Thu Apr 23 14:25:12 2009 +0200
 
     * remove a bug in the eulerian kappa conversion
 
- src/hkl-pseudoaxis-common-eulerians.c |    8 +++++---
- 1 files changed, 5 insertions(+), 3 deletions(-)
+ src/hkl-pseudoaxis-common-eulerians.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
 
 commit 3c654e5091f43849b8d392551e14df8ab4df9218
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3190,8 +12951,8 @@ Date:   Thu Apr 23 14:23:53 2009 +0200
 
     * the axis distance is equal to the real distance not the orthodromic
 
- src/hkl-geometry.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-geometry.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit b539a9bf177daf122c787d07652c80b98b3adbb5
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3199,8 +12960,8 @@ Date:   Thu Apr 23 09:25:19 2009 +0200
 
     * print the geometries with more digits.
 
- src/hkl-geometry.c |   11 ++++++-----
- 1 files changed, 6 insertions(+), 5 deletions(-)
+ src/hkl-geometry.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
 
 commit 1c671cacd687933d61fa297667952da6dfd58763
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3208,8 +12969,8 @@ Date:   Thu Apr 23 09:17:09 2009 +0200
 
     * wrong test_sector criterium
 
- src/hkl-pseudoaxis-auto.c |    3 +--
- 1 files changed, 1 insertions(+), 2 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
 
 commit 85c3cbb2e67983aff2df4f86740a3727400452f0
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3217,12 +12978,12 @@ Date:   Fri Apr 17 11:13:08 2009 +0200
 
     * add get_value_closest_unit
 
- include/hkl/hkl-axis.h      |    6 ++++++
- include/hkl/hkl-parameter.h |    2 ++
- src/hkl-axis.c              |   18 ++++++++++++++++++
- src/hkl-parameter.c         |    9 +++++++++
- src/hkl-pseudoaxis-auto.c   |   11 +++++++++--
- src/wscript_build           |    3 ++-
+ include/hkl/hkl-axis.h      |  6 ++++++
+ include/hkl/hkl-parameter.h |  2 ++
+ src/hkl-axis.c              | 18 ++++++++++++++++++
+ src/hkl-parameter.c         |  9 +++++++++
+ src/hkl-pseudoaxis-auto.c   | 11 +++++++++--
+ src/wscript_build           |  3 ++-
  6 files changed, 46 insertions(+), 3 deletions(-)
 
 commit 4f03fe73063080531fd945cb415817cbbf059186
@@ -3231,9 +12992,9 @@ Date:   Fri Apr 10 19:29:42 2009 +0200
 
     * smae things for an all geometry.
 
- include/hkl/hkl-geometry.h |    2 ++
- src/hkl-geometry.c         |   25 +++++++++++++++++++++++++
- 2 files changed, 27 insertions(+), 0 deletions(-)
+ include/hkl/hkl-geometry.h |  2 ++
+ src/hkl-geometry.c         | 25 +++++++++++++++++++++++++
+ 2 files changed, 27 insertions(+)
 
 commit 608d115603d416815d7457c3422e429c9d66c741
 Author: System User <picca at b1225-srv2.cristal.rcl>
@@ -3244,10 +13005,10 @@ Date:   Fri Apr 10 19:28:59 2009 +0200
     now with get_value_closest you can get the angle of the Axis1 closest
     to the axis2 position taking into account the axis1 range.
 
- include/hkl/hkl-axis.h |    6 +++
- src/hkl-axis.c         |   89 ++++++++++++++++++++++++++++++++++++++++++++++++
- test/hkl-test-axis.c   |   29 +++++++++++++++
- 3 files changed, 124 insertions(+), 0 deletions(-)
+ include/hkl/hkl-axis.h |  6 ++++
+ src/hkl-axis.c         | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-axis.c   | 29 ++++++++++++++++
+ 3 files changed, 124 insertions(+)
 
 commit 3ff90643d91490e423620c9a1d0e325084cd441a
 Author: System User <picca at b1225-srv2.cristal.rcl>
@@ -3255,9 +13016,9 @@ Date:   Fri Apr 10 19:26:54 2009 +0200
 
     * add the HklParameter set_range methodes.
 
- include/hkl/hkl-parameter.h |    4 ++++
- src/hkl-parameter.c         |   15 +++++++++++++++
- 2 files changed, 19 insertions(+), 0 deletions(-)
+ include/hkl/hkl-parameter.h |  4 ++++
+ src/hkl-parameter.c         | 15 +++++++++++++++
+ 2 files changed, 19 insertions(+)
 
 commit 776bafd497c755b43b8987e0ce3d6992cca17be0
 Author: System User <picca at b1225-srv2.cristal.rcl>
@@ -3265,10 +13026,10 @@ Date:   Fri Apr 10 18:15:40 2009 +0200
 
     * add the interval length method
 
- include/hkl/hkl-interval.h |    2 ++
- src/hkl-interval.c         |    5 +++++
- test/hkl-test-interval.c   |   16 ++++++++++++++++
- 3 files changed, 23 insertions(+), 0 deletions(-)
+ include/hkl/hkl-interval.h |  2 ++
+ src/hkl-interval.c         |  5 +++++
+ test/hkl-test-interval.c   | 16 ++++++++++++++++
+ 3 files changed, 23 insertions(+)
 
 commit 918ea7febc6cfbea081c6fad11ab4250c5f63c87
 Author: System User <picca at b1225-srv2.cristal.rcl>
@@ -3278,9 +13039,9 @@ Date:   Fri Apr 10 12:44:38 2009 +0200
     
     use it in the HklGeometryList add method.
 
- include/hkl/hkl-geometry.h |    2 ++
- src/hkl-geometry.c         |   26 +++++++++++++++++++++++++-
- 2 files changed, 27 insertions(+), 1 deletions(-)
+ include/hkl/hkl-geometry.h |  2 ++
+ src/hkl-geometry.c         | 26 +++++++++++++++++++++++++-
+ 2 files changed, 27 insertions(+), 1 deletion(-)
 
 commit 99692680c3c0c4cddcc7e260cb1756ce672f7db3
 Author: System User <picca at b1225-srv2.cristal.rcl>
@@ -3288,11 +13049,11 @@ Date:   Thu Apr 9 18:09:56 2009 +0200
 
     * now the geometry multiplication is working
 
- include/hkl/hkl-geometry.h           |    6 +-
- include/hkl/hkl-pseudoaxis-factory.h |   69 ++++++++++++
- src/hkl-geometry.c                   |   11 +-
- src/hkl-pseudoaxis-k6c-hkl.c         |  190 ++--------------------------------
- src/hkl-pseudoaxis.c                 |    1 +
+ include/hkl/hkl-geometry.h           |   6 +-
+ include/hkl/hkl-pseudoaxis-factory.h |  69 +++++++++++++
+ src/hkl-geometry.c                   |  11 +-
+ src/hkl-pseudoaxis-k6c-hkl.c         | 190 ++---------------------------------
+ src/hkl-pseudoaxis.c                 |   1 +
  5 files changed, 89 insertions(+), 188 deletions(-)
 
 commit 05916707d0f31327857498e3ddae847a57f2affa
@@ -3303,10 +13064,10 @@ Date:   Wed Apr 8 10:43:14 2009 +0200
     
     for now only the bissector vertical system.
 
- include/hkl/hkl-geometry.h   |    5 +++++
- src/hkl-geometry.c           |   14 ++++++++++++++
- src/hkl-pseudoaxis-k6c-hkl.c |   37 ++++++++++++++++++++++++++++++++++++-
- 3 files changed, 55 insertions(+), 1 deletions(-)
+ include/hkl/hkl-geometry.h   |  5 +++++
+ src/hkl-geometry.c           | 14 ++++++++++++++
+ src/hkl-pseudoaxis-k6c-hkl.c | 37 ++++++++++++++++++++++++++++++++++++-
+ 3 files changed, 55 insertions(+), 1 deletion(-)
 
 commit ef5f8240879e26cdf5905d19a31ec9e235e2d379
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3314,8 +13075,8 @@ Date:   Mon Apr 6 10:40:07 2009 +0200
 
     * reoarganize a little bit the hkl-test-pseudoAxis methods
 
- test/hkl-test-pseudoaxis.c |    9 ++++-----
- 1 files changed, 4 insertions(+), 5 deletions(-)
+ test/hkl-test-pseudoaxis.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
 
 commit 912953c5f204bc62ae9d03ef9614a23e3e42b1f8
 Author: System User <picca at b1225-srv2.cristal.rcl>
@@ -3323,8 +13084,8 @@ Date:   Fri Apr 3 15:52:14 2009 +0200
 
     * update the bissector modes for the kappa geometries.
 
- src/hkl-pseudoaxis-k4cv-hkl.c |    4 ++--
- src/hkl-pseudoaxis-k6c-hkl.c  |    8 ++++----
+ src/hkl-pseudoaxis-k4cv-hkl.c | 4 ++--
+ src/hkl-pseudoaxis-k6c-hkl.c  | 8 ++++----
  2 files changed, 6 insertions(+), 6 deletions(-)
 
 commit 96611cab46574f0f2bfc6f33a0b22c2515d5d718
@@ -3333,9 +13094,9 @@ Date:   Wed Apr 1 09:57:06 2009 +0200
 
     * add the HklAxis get/set_value_unit.
 
- include/hkl/hkl-axis.h |    4 ++++
- src/hkl-axis.c         |   11 +++++++++++
- 2 files changed, 15 insertions(+), 0 deletions(-)
+ include/hkl/hkl-axis.h |  4 ++++
+ src/hkl-axis.c         | 11 +++++++++++
+ 2 files changed, 15 insertions(+)
 
 commit 4dbcdb93cb8a8ff5ce857133b83d89058802639f
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3343,8 +13104,8 @@ Date:   Fri Mar 27 17:12:08 2009 +0100
 
     * sort the geometries after an hkl_pseudo_axis_engine_setter.
 
- src/hkl-pseudoaxis.c |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis.c | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit 8b3b1561b55eb119a28f389e2dd91d088d5af9a9
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3354,9 +13115,9 @@ Date:   Fri Mar 27 17:11:13 2009 +0100
     
     use it in the hkl_pseudo_axis_engine_fprintf method.
 
- include/hkl/hkl-geometry.h |    3 +++
- src/hkl-geometry.c         |   41 +++++++++++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis.c       |   41 +++++------------------------------------
+ include/hkl/hkl-geometry.h |  3 +++
+ src/hkl-geometry.c         | 41 +++++++++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis.c       | 41 +++++------------------------------------
  3 files changed, 49 insertions(+), 36 deletions(-)
 
 commit af98c37c2b39a37cba7901349c1374dbbf85b53b
@@ -3365,8 +13126,8 @@ Date:   Fri Mar 27 17:10:06 2009 +0100
 
     * typo
 
- src/hkl-geometry.c |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
+ src/hkl-geometry.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
 
 commit 3ecc49b8811057581a44edb01d88ebc97ac494dd
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3374,8 +13135,8 @@ Date:   Fri Mar 27 17:08:54 2009 +0100
 
     * remove a bug in the sort method
 
- src/hkl-geometry.c |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
+ src/hkl-geometry.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
 
 commit 52c101ee34917220dd2076f113954b02205061d5
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3383,9 +13144,9 @@ Date:   Fri Mar 27 15:42:46 2009 +0100
 
     * add the hkl_geometry_list_sort method
 
- include/hkl/hkl-geometry.h |    1 +
- src/hkl-geometry.c         |   40 +++++++++++++++++++++++++++++++++++++---
- test/hkl-test-geometry.c   |   43 +++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/hkl-geometry.h |  1 +
+ src/hkl-geometry.c         | 40 +++++++++++++++++++++++++++++++++++++---
+ test/hkl-test-geometry.c   | 43 +++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 81 insertions(+), 3 deletions(-)
 
 commit 41270cb713360307a49e6425b39d75373bb80b42
@@ -3394,8 +13155,8 @@ Date:   Sat Mar 21 19:05:07 2009 +0100
 
     * typo
 
- include/hkl/hkl-geometry-factory.h |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ include/hkl/hkl-geometry-factory.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit f1abf875bdc99748d7244594fe0e5193cbd5d387
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3403,8 +13164,8 @@ Date:   Sat Mar 21 14:03:54 2009 +0100
 
     * add the documentation for the HklGeometry
 
- Documentation/user-guide.txt |  146 +++++++++++++++++++++++++++++++++++-------
- 1 files changed, 122 insertions(+), 24 deletions(-)
+ Documentation/user-guide.txt | 146 ++++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 122 insertions(+), 24 deletions(-)
 
 commit 6f581645f736f37b6e28ddee1beb1a5c0fcf9c07
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3412,8 +13173,8 @@ Date:   Thu Mar 19 12:14:19 2009 +0100
 
     * explain in the userg-guide howto build and hack hkl
 
- Documentation/user-guide.txt |   69 ++++++++++++++++++++++++++++++-----------
- 1 files changed, 50 insertions(+), 19 deletions(-)
+ Documentation/user-guide.txt | 69 ++++++++++++++++++++++++++++++++------------
+ 1 file changed, 50 insertions(+), 19 deletions(-)
 
 commit a789dd7b34bc9d9b0bdd06cb92f1c08aaa6eeb1f
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -3423,8 +13184,8 @@ Date:   Thu Mar 19 11:23:18 2009 +0100
     
     explain how to compile with waf and the roadmap.
 
- README |   27 +++++++-------------
- TODO   |   83 ++++++++++++++++-----------------------------------------------
+ README | 27 ++++++++--------------
+ TODO   | 83 +++++++++++++++++-------------------------------------------------
  2 files changed, 31 insertions(+), 79 deletions(-)
 
 commit 01f32726bfd2daf70e0e95f5a619bc9ab6e263b9
@@ -3433,8 +13194,8 @@ Date:   Wed Mar 18 16:41:08 2009 +0100
 
     * update the NEWS file
 
- NEWS |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 51 insertions(+), 1 deletions(-)
+ NEWS | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 51 insertions(+), 1 deletion(-)
 
 commit edd9b90835f76464d7dc1e5c4b0fcc30f11a999b
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3442,80 +13203,80 @@ Date:   Wed Mar 18 15:51:33 2009 +0100
 
     * add the GPL header
 
- include/hkl/hkl-axis.h                        |   21 +++++++++++++++++++++
- include/hkl/hkl-detector.h                    |   21 +++++++++++++++++++++
- include/hkl/hkl-geometry-factory.h            |   21 +++++++++++++++++++++
- include/hkl/hkl-geometry.h                    |   21 +++++++++++++++++++++
- include/hkl/hkl-interval.h                    |   21 +++++++++++++++++++++
- include/hkl/hkl-lattice.h                     |   21 +++++++++++++++++++++
- include/hkl/hkl-list.h                        |   21 +++++++++++++++++++++
- include/hkl/hkl-macros.h                      |   21 +++++++++++++++++++++
- include/hkl/hkl-matrix.h                      |   21 +++++++++++++++++++++
- include/hkl/hkl-parameter.h                   |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-auto.h             |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-common-eulerians.h |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-common-hkl.h       |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-common-psi.h       |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-common.h           |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-e4cv.h             |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-e6c.h              |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-factory.h          |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-k4cv.h             |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis-k6c.h              |   21 +++++++++++++++++++++
- include/hkl/hkl-pseudoaxis.h                  |   21 +++++++++++++++++++++
- include/hkl/hkl-quaternion.h                  |   21 +++++++++++++++++++++
- include/hkl/hkl-sample.h                      |   21 +++++++++++++++++++++
- include/hkl/hkl-source.h                      |   21 +++++++++++++++++++++
- include/hkl/hkl-unit.h                        |   21 +++++++++++++++++++++
- include/hkl/hkl-vector.h                      |   21 +++++++++++++++++++++
- src/hkl-axis.c                                |   21 +++++++++++++++++++++
- src/hkl-detector.c                            |   21 +++++++++++++++++++++
- src/hkl-geometry.c                            |   21 +++++++++++++++++++++
- src/hkl-interval.c                            |   21 +++++++++++++++++++++
- src/hkl-lattice.c                             |   21 +++++++++++++++++++++
- src/hkl-matrix.c                              |   21 +++++++++++++++++++++
- src/hkl-parameter.c                           |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-auto.c                     |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-common-eulerians.c         |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-common-hkl.c               |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-common-psi.c               |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-common.c                   |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-e4cv-hkl.c                 |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-e4cv-psi.c                 |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-e6c-hkl.c                  |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-e6c-psi.c                  |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-k4cv-hkl.c                 |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-k4cv-psi.c                 |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-k6c-hkl.c                  |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis-k6c-psi.c                  |   21 +++++++++++++++++++++
- src/hkl-pseudoaxis.c                          |   21 +++++++++++++++++++++
- src/hkl-quaternion.c                          |   21 +++++++++++++++++++++
- src/hkl-sample.c                              |   21 +++++++++++++++++++++
- src/hkl-source.c                              |   21 +++++++++++++++++++++
- src/hkl-unit.c                                |   21 +++++++++++++++++++++
- src/hkl-vector.c                              |   21 +++++++++++++++++++++
- src/usage.c                                   |   21 +++++++++++++++++++++
- test/bench.c                                  |   21 +++++++++++++++++++++
- test/hkl-test-axis.c                          |   21 +++++++++++++++++++++
- test/hkl-test-detector.c                      |   21 +++++++++++++++++++++
- test/hkl-test-geometry.c                      |   21 +++++++++++++++++++++
- test/hkl-test-interval.c                      |   21 +++++++++++++++++++++
- test/hkl-test-lattice.c                       |   21 +++++++++++++++++++++
- test/hkl-test-matrix.c                        |   21 +++++++++++++++++++++
- test/hkl-test-parameter.c                     |   21 +++++++++++++++++++++
- test/hkl-test-pseudoaxis-e4cv.c               |   21 +++++++++++++++++++++
- test/hkl-test-pseudoaxis-e6c.c                |   21 +++++++++++++++++++++
- test/hkl-test-pseudoaxis-k4cv.c               |   21 +++++++++++++++++++++
- test/hkl-test-pseudoaxis-k6c.c                |   21 +++++++++++++++++++++
- test/hkl-test-pseudoaxis.c                    |   21 +++++++++++++++++++++
- test/hkl-test-quaternion.c                    |   21 +++++++++++++++++++++
- test/hkl-test-sample.c                        |   21 +++++++++++++++++++++
- test/hkl-test-source.c                        |   21 +++++++++++++++++++++
- test/hkl-test-vector.c                        |   21 +++++++++++++++++++++
- test/hkl-test.c                               |   21 +++++++++++++++++++++
- test/hkl-test.h                               |   21 +++++++++++++++++++++
- test/main.c                                   |   21 +++++++++++++++++++++
- 73 files changed, 1533 insertions(+), 0 deletions(-)
+ include/hkl/hkl-axis.h                        | 21 +++++++++++++++++++++
+ include/hkl/hkl-detector.h                    | 21 +++++++++++++++++++++
+ include/hkl/hkl-geometry-factory.h            | 21 +++++++++++++++++++++
+ include/hkl/hkl-geometry.h                    | 21 +++++++++++++++++++++
+ include/hkl/hkl-interval.h                    | 21 +++++++++++++++++++++
+ include/hkl/hkl-lattice.h                     | 21 +++++++++++++++++++++
+ include/hkl/hkl-list.h                        | 21 +++++++++++++++++++++
+ include/hkl/hkl-macros.h                      | 21 +++++++++++++++++++++
+ include/hkl/hkl-matrix.h                      | 21 +++++++++++++++++++++
+ include/hkl/hkl-parameter.h                   | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-auto.h             | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-common-eulerians.h | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-common-hkl.h       | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-common-psi.h       | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-common.h           | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-e4cv.h             | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-e6c.h              | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-factory.h          | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-k4cv.h             | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-k6c.h              | 21 +++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis.h                  | 21 +++++++++++++++++++++
+ include/hkl/hkl-quaternion.h                  | 21 +++++++++++++++++++++
+ include/hkl/hkl-sample.h                      | 21 +++++++++++++++++++++
+ include/hkl/hkl-source.h                      | 21 +++++++++++++++++++++
+ include/hkl/hkl-unit.h                        | 21 +++++++++++++++++++++
+ include/hkl/hkl-vector.h                      | 21 +++++++++++++++++++++
+ src/hkl-axis.c                                | 21 +++++++++++++++++++++
+ src/hkl-detector.c                            | 21 +++++++++++++++++++++
+ src/hkl-geometry.c                            | 21 +++++++++++++++++++++
+ src/hkl-interval.c                            | 21 +++++++++++++++++++++
+ src/hkl-lattice.c                             | 21 +++++++++++++++++++++
+ src/hkl-matrix.c                              | 21 +++++++++++++++++++++
+ src/hkl-parameter.c                           | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-auto.c                     | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-common-eulerians.c         | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-common-hkl.c               | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-common-psi.c               | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-common.c                   | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-e4cv-hkl.c                 | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-e4cv-psi.c                 | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-e6c-hkl.c                  | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-e6c-psi.c                  | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-k4cv-hkl.c                 | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-k4cv-psi.c                 | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-k6c-hkl.c                  | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis-k6c-psi.c                  | 21 +++++++++++++++++++++
+ src/hkl-pseudoaxis.c                          | 21 +++++++++++++++++++++
+ src/hkl-quaternion.c                          | 21 +++++++++++++++++++++
+ src/hkl-sample.c                              | 21 +++++++++++++++++++++
+ src/hkl-source.c                              | 21 +++++++++++++++++++++
+ src/hkl-unit.c                                | 21 +++++++++++++++++++++
+ src/hkl-vector.c                              | 21 +++++++++++++++++++++
+ src/usage.c                                   | 21 +++++++++++++++++++++
+ test/bench.c                                  | 21 +++++++++++++++++++++
+ test/hkl-test-axis.c                          | 21 +++++++++++++++++++++
+ test/hkl-test-detector.c                      | 21 +++++++++++++++++++++
+ test/hkl-test-geometry.c                      | 21 +++++++++++++++++++++
+ test/hkl-test-interval.c                      | 21 +++++++++++++++++++++
+ test/hkl-test-lattice.c                       | 21 +++++++++++++++++++++
+ test/hkl-test-matrix.c                        | 21 +++++++++++++++++++++
+ test/hkl-test-parameter.c                     | 21 +++++++++++++++++++++
+ test/hkl-test-pseudoaxis-e4cv.c               | 21 +++++++++++++++++++++
+ test/hkl-test-pseudoaxis-e6c.c                | 21 +++++++++++++++++++++
+ test/hkl-test-pseudoaxis-k4cv.c               | 21 +++++++++++++++++++++
+ test/hkl-test-pseudoaxis-k6c.c                | 21 +++++++++++++++++++++
+ test/hkl-test-pseudoaxis.c                    | 21 +++++++++++++++++++++
+ test/hkl-test-quaternion.c                    | 21 +++++++++++++++++++++
+ test/hkl-test-sample.c                        | 21 +++++++++++++++++++++
+ test/hkl-test-source.c                        | 21 +++++++++++++++++++++
+ test/hkl-test-vector.c                        | 21 +++++++++++++++++++++
+ test/hkl-test.c                               | 21 +++++++++++++++++++++
+ test/hkl-test.h                               | 21 +++++++++++++++++++++
+ test/main.c                                   | 21 +++++++++++++++++++++
+ 73 files changed, 1533 insertions(+)
 
 commit fb5b7b93eaf3ee04a6d1ddb7bbf32722e6a7a4a3
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3523,8 +13284,8 @@ Date:   Wed Mar 18 14:38:15 2009 +0100
 
     * reordon the pseudoAxes Modes in the e6c and k6c geometries.
 
- src/hkl-pseudoaxis-e6c-hkl.c |   20 ++++++------
- src/hkl-pseudoaxis-k6c-hkl.c |   68 +++++++++++++++++++++---------------------
+ src/hkl-pseudoaxis-e6c-hkl.c | 20 ++++++-------
+ src/hkl-pseudoaxis-k6c-hkl.c | 68 ++++++++++++++++++++++----------------------
  2 files changed, 44 insertions(+), 44 deletions(-)
 
 commit a22e4329dac984a8bc8f5d61880380157ee6daa6
@@ -3533,8 +13294,8 @@ Date:   Wed Mar 18 14:09:27 2009 +0100
 
     * remove valgrind warning about uninitialized values.
 
- src/hkl-pseudoaxis.c |   27 ++++++++++++++-------------
- 1 files changed, 14 insertions(+), 13 deletions(-)
+ src/hkl-pseudoaxis.c | 27 ++++++++++++++-------------
+ 1 file changed, 14 insertions(+), 13 deletions(-)
 
 commit 251d243b133b956806ce13ed30d633cdffd460ea
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3542,14 +13303,14 @@ Date:   Wed Mar 18 14:08:56 2009 +0100
 
     * remove the unneeded len member of HklGeometryList
 
- include/hkl/hkl-geometry.h      |    1 -
- src/hkl-geometry.c              |    5 +----
- test/bench.c                    |    2 +-
- test/hkl-test-pseudoaxis-e4cv.c |    4 ++--
- test/hkl-test-pseudoaxis-e6c.c  |    2 +-
- test/hkl-test-pseudoaxis-k4cv.c |    4 ++--
- test/hkl-test-pseudoaxis-k6c.c  |   20 ++++++++++----------
- test/hkl-test-pseudoaxis.c      |    6 ++++--
+ include/hkl/hkl-geometry.h      |  1 -
+ src/hkl-geometry.c              |  5 +----
+ test/bench.c                    |  2 +-
+ test/hkl-test-pseudoaxis-e4cv.c |  4 ++--
+ test/hkl-test-pseudoaxis-e6c.c  |  2 +-
+ test/hkl-test-pseudoaxis-k4cv.c |  4 ++--
+ test/hkl-test-pseudoaxis-k6c.c  | 20 ++++++++++----------
+ test/hkl-test-pseudoaxis.c      |  6 ++++--
  8 files changed, 21 insertions(+), 23 deletions(-)
 
 commit 05fd3fe6f030d376a8e55c4366cfb0367e1faa2f
@@ -3558,8 +13319,8 @@ Date:   Wed Mar 18 10:56:47 2009 +0100
 
     * remove a memory leak
 
- src/hkl-geometry.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ src/hkl-geometry.c | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit 5ad1d77a9f0ee3ca8e261c1eeab960372e2d2ae1
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3570,14 +13331,14 @@ Date:   Wed Mar 18 10:56:37 2009 +0100
     As this List contain the HklGeometryList all engines of this List refer to
     this geometry list.
 
- include/hkl/hkl-pseudoaxis.h    |    2 +-
- src/hkl-pseudoaxis.c            |   17 +++++--------
- test/bench.c                    |   26 ++++++++++----------
- test/hkl-test-pseudoaxis-e4cv.c |   44 +++++++++++++++++++----------------
- test/hkl-test-pseudoaxis-e6c.c  |   22 +++++++++--------
- test/hkl-test-pseudoaxis-k4cv.c |   28 ++++++++++++----------
- test/hkl-test-pseudoaxis-k6c.c  |   49 +++++++++++++++++++--------------------
- test/hkl-test-pseudoaxis.c      |    4 +-
+ include/hkl/hkl-pseudoaxis.h    |  2 +-
+ src/hkl-pseudoaxis.c            | 17 ++++++--------
+ test/bench.c                    | 26 +++++++++++-----------
+ test/hkl-test-pseudoaxis-e4cv.c | 44 +++++++++++++++++++-----------------
+ test/hkl-test-pseudoaxis-e6c.c  | 22 +++++++++---------
+ test/hkl-test-pseudoaxis-k4cv.c | 28 ++++++++++++-----------
+ test/hkl-test-pseudoaxis-k6c.c  | 49 ++++++++++++++++++++---------------------
+ test/hkl-test-pseudoaxis.c      |  4 ++--
  8 files changed, 98 insertions(+), 94 deletions(-)
 
 commit a242d8fc19db357baba22a35fe7d3c0e0cdd1e08
@@ -3586,9 +13347,9 @@ Date:   Wed Mar 18 09:50:56 2009 +0100
 
     * add an HklGeometryList in the HklPseudoAxisEngineList
 
- include/hkl/hkl-pseudoaxis.h |    1 +
- src/hkl-pseudoaxis.c         |    3 +++
- 2 files changed, 4 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis.h | 1 +
+ src/hkl-pseudoaxis.c         | 3 +++
+ 2 files changed, 4 insertions(+)
 
 commit f19386200eba38ce472f3950cf9993a38421e24a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3598,16 +13359,16 @@ Date:   Wed Mar 18 09:39:06 2009 +0100
     
     this is to share beetween all PseudoAxesEngine the same geometry list.
 
- include/hkl/hkl-geometry.h      |   27 +++++++++++++++++-
- include/hkl/hkl-pseudoaxis.h    |    4 +--
- src/hkl-geometry.c              |   57 +++++++++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis.c            |   51 +++++++---------------------------
- test/bench.c                    |    4 +-
- test/hkl-test-pseudoaxis-e4cv.c |    8 +++---
- test/hkl-test-pseudoaxis-e6c.c  |    4 +-
- test/hkl-test-pseudoaxis-k4cv.c |    8 +++---
- test/hkl-test-pseudoaxis-k6c.c  |   18 ++++++------
- test/hkl-test-pseudoaxis.c      |    4 +-
+ include/hkl/hkl-geometry.h      | 27 +++++++++++++++++--
+ include/hkl/hkl-pseudoaxis.h    |  4 +--
+ src/hkl-geometry.c              | 57 +++++++++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis.c            | 51 ++++++++----------------------------
+ test/bench.c                    |  4 +--
+ test/hkl-test-pseudoaxis-e4cv.c |  8 +++---
+ test/hkl-test-pseudoaxis-e6c.c  |  4 +--
+ test/hkl-test-pseudoaxis-k4cv.c |  8 +++---
+ test/hkl-test-pseudoaxis-k6c.c  | 18 ++++++-------
+ test/hkl-test-pseudoaxis.c      |  4 +--
  10 files changed, 117 insertions(+), 68 deletions(-)
 
 commit 31d3a73a7640b653117051dc92dd71382455c621
@@ -3616,11 +13377,11 @@ Date:   Tue Mar 17 16:45:53 2009 +0100
 
     * put the holder part in the hkl-geometry.c file
 
- include/hkl/hkl-geometry.h |    5 --
- src/hkl-geometry.c         |  102 ++++++++++++++++++++++++++++++++++++++++++--
- src/hkl-holder.c           |   93 ----------------------------------------
- test/hkl-test-holder.c     |   47 --------------------
- test/main.c                |    1 -
+ include/hkl/hkl-geometry.h |   5 ---
+ src/hkl-geometry.c         | 102 +++++++++++++++++++++++++++++++++++++++++++--
+ src/hkl-holder.c           |  93 -----------------------------------------
+ test/hkl-test-holder.c     |  47 ---------------------
+ test/main.c                |   1 -
  5 files changed, 98 insertions(+), 150 deletions(-)
 
 commit 7b4feba042da13a871dd088ae0808342eb7c52ab
@@ -3629,15 +13390,15 @@ Date:   Tue Mar 17 16:22:51 2009 +0100
 
     * optimize the computation 4% (speedup :)
 
- include/hkl/hkl-axis.h          |    5 ++++
- src/hkl-axis.c                  |   19 +++++++++++++++
- src/hkl-geometry.c              |   14 ++++-------
- src/hkl-pseudoaxis-auto.c       |    8 +-----
- src/hkl-pseudoaxis-common-hkl.c |    4 +-
- src/hkl-pseudoaxis-common-psi.c |    2 +-
- test/hkl-test-detector.c        |    4 +-
- test/hkl-test-geometry.c        |    2 +-
- test/hkl-test-sample.c          |   48 +++++++++++++++-----------------------
+ include/hkl/hkl-axis.h          |  5 +++++
+ src/hkl-axis.c                  | 19 ++++++++++++++++
+ src/hkl-geometry.c              | 14 +++++-------
+ src/hkl-pseudoaxis-auto.c       |  8 ++-----
+ src/hkl-pseudoaxis-common-hkl.c |  4 ++--
+ src/hkl-pseudoaxis-common-psi.c |  2 +-
+ test/hkl-test-detector.c        |  4 ++--
+ test/hkl-test-geometry.c        |  2 +-
+ test/hkl-test-sample.c          | 48 ++++++++++++++++-------------------------
  9 files changed, 56 insertions(+), 50 deletions(-)
 
 commit 7487feee314f12cc79fbfe041329bceb56b924da
@@ -3646,23 +13407,23 @@ Date:   Tue Mar 17 13:53:21 2009 +0100
 
     * rename old get_set method -> mode
 
- include/hkl/hkl-pseudoaxis.h          |    4 ++--
- src/hkl-pseudoaxis-common-eulerians.c |    4 ++--
- src/hkl-pseudoaxis-e4cv-hkl.c         |   12 ++++++------
- src/hkl-pseudoaxis-e4cv-psi.c         |    4 ++--
- src/hkl-pseudoaxis-e6c-hkl.c          |   18 +++++++++---------
- src/hkl-pseudoaxis-e6c-psi.c          |    4 ++--
- src/hkl-pseudoaxis-k4cv-hkl.c         |   12 ++++++------
- src/hkl-pseudoaxis-k4cv-psi.c         |    4 ++--
- src/hkl-pseudoaxis-k6c-hkl.c          |   22 +++++++++++-----------
- src/hkl-pseudoaxis-k6c-psi.c          |    4 ++--
- src/hkl-pseudoaxis.c                  |    4 ++--
- test/bench.c                          |    4 ++--
- test/hkl-test-pseudoaxis-e4cv.c       |   10 +++++-----
- test/hkl-test-pseudoaxis-e6c.c        |    4 ++--
- test/hkl-test-pseudoaxis-k4cv.c       |    4 ++--
- test/hkl-test-pseudoaxis-k6c.c        |    8 ++++----
- test/hkl-test-pseudoaxis.c            |    2 +-
+ include/hkl/hkl-pseudoaxis.h          |  4 ++--
+ src/hkl-pseudoaxis-common-eulerians.c |  4 ++--
+ src/hkl-pseudoaxis-e4cv-hkl.c         | 12 ++++++------
+ src/hkl-pseudoaxis-e4cv-psi.c         |  4 ++--
+ src/hkl-pseudoaxis-e6c-hkl.c          | 18 +++++++++---------
+ src/hkl-pseudoaxis-e6c-psi.c          |  4 ++--
+ src/hkl-pseudoaxis-k4cv-hkl.c         | 12 ++++++------
+ src/hkl-pseudoaxis-k4cv-psi.c         |  4 ++--
+ src/hkl-pseudoaxis-k6c-hkl.c          | 22 +++++++++++-----------
+ src/hkl-pseudoaxis-k6c-psi.c          |  4 ++--
+ src/hkl-pseudoaxis.c                  |  4 ++--
+ test/bench.c                          |  4 ++--
+ test/hkl-test-pseudoaxis-e4cv.c       | 10 +++++-----
+ test/hkl-test-pseudoaxis-e6c.c        |  4 ++--
+ test/hkl-test-pseudoaxis-k4cv.c       |  4 ++--
+ test/hkl-test-pseudoaxis-k6c.c        |  8 ++++----
+ test/hkl-test-pseudoaxis.c            |  2 +-
  17 files changed, 62 insertions(+), 62 deletions(-)
 
 commit 742c9a92ee7c600446585d026d1ffb462da9015c
@@ -3671,26 +13432,26 @@ Date:   Tue Mar 17 11:44:05 2009 +0100
 
     * renames getset -> mode
 
- include/hkl/hkl-pseudoaxis.h          |    6 ++--
- src/hkl-pseudoaxis-common-eulerians.c |   10 +++---
- src/hkl-pseudoaxis-common-hkl.c       |    6 ++--
- src/hkl-pseudoaxis-common-psi.c       |   20 ++++++------
- src/hkl-pseudoaxis-common.c           |   20 ++++++------
- src/hkl-pseudoaxis-e4cv-hkl.c         |   22 ++++++------
- src/hkl-pseudoaxis-e4cv-psi.c         |    6 ++--
- src/hkl-pseudoaxis-e6c-hkl.c          |   34 +++++++++---------
- src/hkl-pseudoaxis-e6c-psi.c          |    6 ++--
- src/hkl-pseudoaxis-k4cv-hkl.c         |   34 +++++++++---------
- src/hkl-pseudoaxis-k4cv-psi.c         |    6 ++--
- src/hkl-pseudoaxis-k6c-hkl.c          |   58 ++++++++++++++++----------------
- src/hkl-pseudoaxis-k6c-psi.c          |    6 ++--
- src/hkl-pseudoaxis.c                  |   46 +++++++++++++-------------
- test/bench.c                          |   12 +++---
- test/hkl-test-pseudoaxis-e4cv.c       |   20 ++++++------
- test/hkl-test-pseudoaxis-e6c.c        |    6 ++--
- test/hkl-test-pseudoaxis-k4cv.c       |    8 ++--
- test/hkl-test-pseudoaxis-k6c.c        |   16 ++++----
- test/hkl-test-pseudoaxis.c            |    8 ++--
+ include/hkl/hkl-pseudoaxis.h          |  6 ++--
+ src/hkl-pseudoaxis-common-eulerians.c | 10 +++---
+ src/hkl-pseudoaxis-common-hkl.c       |  6 ++--
+ src/hkl-pseudoaxis-common-psi.c       | 20 ++++++------
+ src/hkl-pseudoaxis-common.c           | 20 ++++++------
+ src/hkl-pseudoaxis-e4cv-hkl.c         | 22 ++++++-------
+ src/hkl-pseudoaxis-e4cv-psi.c         |  6 ++--
+ src/hkl-pseudoaxis-e6c-hkl.c          | 34 ++++++++++----------
+ src/hkl-pseudoaxis-e6c-psi.c          |  6 ++--
+ src/hkl-pseudoaxis-k4cv-hkl.c         | 34 ++++++++++----------
+ src/hkl-pseudoaxis-k4cv-psi.c         |  6 ++--
+ src/hkl-pseudoaxis-k6c-hkl.c          | 58 +++++++++++++++++------------------
+ src/hkl-pseudoaxis-k6c-psi.c          |  6 ++--
+ src/hkl-pseudoaxis.c                  | 46 +++++++++++++--------------
+ test/bench.c                          | 12 ++++----
+ test/hkl-test-pseudoaxis-e4cv.c       | 20 ++++++------
+ test/hkl-test-pseudoaxis-e6c.c        |  6 ++--
+ test/hkl-test-pseudoaxis-k4cv.c       |  8 ++---
+ test/hkl-test-pseudoaxis-k6c.c        | 16 +++++-----
+ test/hkl-test-pseudoaxis.c            |  8 ++---
  20 files changed, 175 insertions(+), 175 deletions(-)
 
 commit 5b93c9db781295504b37d88a3274501ad3a8b560
@@ -3699,21 +13460,21 @@ Date:   Tue Mar 17 11:42:17 2009 +0100
 
     * rename hkl_pseudo_axis_engine_get_set -> hkl_pseudo_axis_engine_mode
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |    6 ++--
- include/hkl/hkl-pseudoaxis-common-psi.h |    2 +-
- include/hkl/hkl-pseudoaxis.h            |    6 ++--
- src/hkl-pseudoaxis-common-eulerians.c   |   10 +++---
- src/hkl-pseudoaxis-common-hkl.c         |    6 ++--
- src/hkl-pseudoaxis-common-psi.c         |   16 +++++-----
- src/hkl-pseudoaxis-e4cv-hkl.c           |   28 +++++++++---------
- src/hkl-pseudoaxis-e4cv-psi.c           |    2 +-
- src/hkl-pseudoaxis-e6c-hkl.c            |   44 ++++++++++++++--------------
- src/hkl-pseudoaxis-e6c-psi.c            |    2 +-
- src/hkl-pseudoaxis-k4cv-hkl.c           |   22 +++++++-------
- src/hkl-pseudoaxis-k4cv-psi.c           |    2 +-
- src/hkl-pseudoaxis-k6c-hkl.c            |   48 +++++++++++++++---------------
- src/hkl-pseudoaxis-k6c-psi.c            |    2 +-
- src/hkl-pseudoaxis.c                    |   12 ++++----
+ include/hkl/hkl-pseudoaxis-common-hkl.h |  6 ++---
+ include/hkl/hkl-pseudoaxis-common-psi.h |  2 +-
+ include/hkl/hkl-pseudoaxis.h            |  6 ++---
+ src/hkl-pseudoaxis-common-eulerians.c   | 10 +++----
+ src/hkl-pseudoaxis-common-hkl.c         |  6 ++---
+ src/hkl-pseudoaxis-common-psi.c         | 16 +++++------
+ src/hkl-pseudoaxis-e4cv-hkl.c           | 28 +++++++++----------
+ src/hkl-pseudoaxis-e4cv-psi.c           |  2 +-
+ src/hkl-pseudoaxis-e6c-hkl.c            | 44 +++++++++++++++---------------
+ src/hkl-pseudoaxis-e6c-psi.c            |  2 +-
+ src/hkl-pseudoaxis-k4cv-hkl.c           | 22 +++++++--------
+ src/hkl-pseudoaxis-k4cv-psi.c           |  2 +-
+ src/hkl-pseudoaxis-k6c-hkl.c            | 48 ++++++++++++++++-----------------
+ src/hkl-pseudoaxis-k6c-psi.c            |  2 +-
+ src/hkl-pseudoaxis.c                    | 12 ++++-----
  15 files changed, 104 insertions(+), 104 deletions(-)
 
 commit 509b7d069a8f77240fdb19de8af9bf730335c1d0
@@ -3722,20 +13483,20 @@ Date:   Tue Mar 17 11:39:02 2009 +0100
 
     * rename the HklPseudoAxisEngineGetSet ->HklPseudoAxisEngineMode
 
- include/hkl/hkl-pseudoaxis-common-psi.h |    8 +++---
- include/hkl/hkl-pseudoaxis.h            |   18 ++++++++--------
- src/hkl-pseudoaxis-common-eulerians.c   |    2 +-
- src/hkl-pseudoaxis-common-psi.c         |   22 ++++++++++----------
- src/hkl-pseudoaxis-common.c             |    2 +-
- src/hkl-pseudoaxis-e4cv-hkl.c           |    2 +-
- src/hkl-pseudoaxis-e4cv-psi.c           |    4 +-
- src/hkl-pseudoaxis-e6c-hkl.c            |    2 +-
- src/hkl-pseudoaxis-e6c-psi.c            |    4 +-
- src/hkl-pseudoaxis-k4cv-hkl.c           |    2 +-
- src/hkl-pseudoaxis-k4cv-psi.c           |    4 +-
- src/hkl-pseudoaxis-k6c-hkl.c            |    2 +-
- src/hkl-pseudoaxis-k6c-psi.c            |    4 +-
- src/hkl-pseudoaxis.c                    |   32 +++++++++++++++---------------
+ include/hkl/hkl-pseudoaxis-common-psi.h |  8 ++++----
+ include/hkl/hkl-pseudoaxis.h            | 18 +++++++++---------
+ src/hkl-pseudoaxis-common-eulerians.c   |  2 +-
+ src/hkl-pseudoaxis-common-psi.c         | 22 +++++++++++-----------
+ src/hkl-pseudoaxis-common.c             |  2 +-
+ src/hkl-pseudoaxis-e4cv-hkl.c           |  2 +-
+ src/hkl-pseudoaxis-e4cv-psi.c           |  4 ++--
+ src/hkl-pseudoaxis-e6c-hkl.c            |  2 +-
+ src/hkl-pseudoaxis-e6c-psi.c            |  4 ++--
+ src/hkl-pseudoaxis-k4cv-hkl.c           |  2 +-
+ src/hkl-pseudoaxis-k4cv-psi.c           |  4 ++--
+ src/hkl-pseudoaxis-k6c-hkl.c            |  2 +-
+ src/hkl-pseudoaxis-k6c-psi.c            |  4 ++--
+ src/hkl-pseudoaxis.c                    | 32 ++++++++++++++++----------------
  14 files changed, 54 insertions(+), 54 deletions(-)
 
 commit dcaa59f88283f498a3668c477d6ca4c56c044a5a
@@ -3744,11 +13505,11 @@ Date:   Tue Mar 17 11:30:36 2009 +0100
 
     * remove the HKLList
 
- include/hkl/hkl-list.h |   36 ---------
- src/hkl-list.c         |  138 --------------------------------
- test/hkl-test-list.c   |  203 ------------------------------------------------
- test/main.c            |    1 -
- 4 files changed, 0 insertions(+), 378 deletions(-)
+ include/hkl/hkl-list.h |  36 ---------
+ src/hkl-list.c         | 138 ---------------------------------
+ test/hkl-test-list.c   | 203 -------------------------------------------------
+ test/main.c            |   1 -
+ 4 files changed, 378 deletions(-)
 
 commit afd5a5fa948ae447ed6ef097c7682b2980008610
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3756,9 +13517,9 @@ Date:   Tue Mar 17 11:22:12 2009 +0100
 
     * use the HKL_LISt in the Sample part
 
- include/hkl/hkl-sample.h |    2 +-
- src/hkl-sample.c         |  160 ++++++++++++++++++++++++----------------------
- test/hkl-test-sample.c   |    2 +-
+ include/hkl/hkl-sample.h |   2 +-
+ src/hkl-sample.c         | 160 +++++++++++++++++++++++++----------------------
+ test/hkl-test-sample.c   |   2 +-
  3 files changed, 86 insertions(+), 78 deletions(-)
 
 commit e8254ce6a3f3955d95efff4703cf12131dc96b88
@@ -3767,8 +13528,8 @@ Date:   Tue Mar 17 10:47:17 2009 +0100
 
     * typo
 
- src/hkl-sample.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-sample.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 44a1d7503fadd8b2222b2f599956a03eb492bfd3
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3776,8 +13537,8 @@ Date:   Tue Mar 17 10:42:26 2009 +0100
 
     * remove an error in the detector test method
 
- test/hkl-test-detector.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ test/hkl-test-detector.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit 5178184fa824078145cc27343b4f4907bf64d742
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3785,9 +13546,9 @@ Date:   Tue Mar 17 10:30:21 2009 +0100
 
     * use the HKL_LIST in the HklSampleList
 
- include/hkl/hkl-list.h   |   15 +++++++++++++++
- include/hkl/hkl-sample.h |    2 +-
- src/hkl-sample.c         |   37 ++++++++++++-------------------------
+ include/hkl/hkl-list.h   | 15 +++++++++++++++
+ include/hkl/hkl-sample.h |  2 +-
+ src/hkl-sample.c         | 37 ++++++++++++-------------------------
  3 files changed, 28 insertions(+), 26 deletions(-)
 
 commit 37bd79de6bb3d30731399ce3412dda9aae0a1f90
@@ -3796,9 +13557,9 @@ Date:   Tue Mar 17 09:59:29 2009 +0100
 
     * use the HKL_LIST in the HklPseudoAxisEngineList
 
- include/hkl/hkl-pseudoaxis.h |    3 +--
- src/hkl-pseudoaxis.c         |   26 +++++++-------------------
- test/hkl-test-pseudoaxis.c   |    2 +-
+ include/hkl/hkl-pseudoaxis.h |  3 +--
+ src/hkl-pseudoaxis.c         | 26 +++++++-------------------
+ test/hkl-test-pseudoaxis.c   |  2 +-
  3 files changed, 9 insertions(+), 22 deletions(-)
 
 commit 69838d345b10d1368200312cf6da2ed8943bd4ec
@@ -3807,10 +13568,10 @@ Date:   Tue Mar 17 09:52:22 2009 +0100
 
     * use the HKL_LIST for the pseudoAxes list in the HklPseudoAxisEngine.
 
- include/hkl/hkl-pseudoaxis.h    |    3 +--
- src/hkl-pseudoaxis-common-hkl.c |    2 +-
- src/hkl-pseudoaxis.c            |   32 ++++++++++++--------------------
- test/hkl-test-pseudoaxis.c      |   11 +++++++----
+ include/hkl/hkl-pseudoaxis.h    |  3 +--
+ src/hkl-pseudoaxis-common-hkl.c |  2 +-
+ src/hkl-pseudoaxis.c            | 32 ++++++++++++--------------------
+ test/hkl-test-pseudoaxis.c      | 11 +++++++----
  4 files changed, 21 insertions(+), 27 deletions(-)
 
 commit 6b292ce7532a7507de5e4f38b485b150126d1899
@@ -3819,11 +13580,11 @@ Date:   Tue Mar 17 09:39:55 2009 +0100
 
     * use the HKL_LIST for the axes in the HklPseudoAxisEngine
 
- include/hkl/hkl-pseudoaxis.h    |    3 +--
- src/hkl-pseudoaxis-auto.c       |   39 ++++++++++++++++++++-------------------
- src/hkl-pseudoaxis-common-hkl.c |    4 ++--
- src/hkl-pseudoaxis-common-psi.c |    4 +++-
- src/hkl-pseudoaxis.c            |   18 +++++++-----------
+ include/hkl/hkl-pseudoaxis.h    |  3 +--
+ src/hkl-pseudoaxis-auto.c       | 39 ++++++++++++++++++++-------------------
+ src/hkl-pseudoaxis-common-hkl.c |  4 ++--
+ src/hkl-pseudoaxis-common-psi.c |  4 +++-
+ src/hkl-pseudoaxis.c            | 18 +++++++-----------
  5 files changed, 33 insertions(+), 35 deletions(-)
 
 commit c99ad8b43acf04654acbbe8727a7449a514745d8
@@ -3832,15 +13593,15 @@ Date:   Mon Mar 16 18:24:54 2009 +0100
 
     * more HKl_LIST replacement
 
- include/hkl/hkl-list.h          |    9 +++++++++
- include/hkl/hkl-pseudoaxis.h    |    3 +--
- src/hkl-pseudoaxis.c            |   14 +++-----------
- test/bench.c                    |    4 ++--
- test/hkl-test-pseudoaxis-e4cv.c |    4 ++--
- test/hkl-test-pseudoaxis-e6c.c  |    2 +-
- test/hkl-test-pseudoaxis-k4cv.c |    4 ++--
- test/hkl-test-pseudoaxis-k6c.c  |    4 ++--
- test/hkl-test-pseudoaxis.c      |    2 +-
+ include/hkl/hkl-list.h          |  9 +++++++++
+ include/hkl/hkl-pseudoaxis.h    |  3 +--
+ src/hkl-pseudoaxis.c            | 14 +++-----------
+ test/bench.c                    |  4 ++--
+ test/hkl-test-pseudoaxis-e4cv.c |  4 ++--
+ test/hkl-test-pseudoaxis-e6c.c  |  2 +-
+ test/hkl-test-pseudoaxis-k4cv.c |  4 ++--
+ test/hkl-test-pseudoaxis-k6c.c  |  4 ++--
+ test/hkl-test-pseudoaxis.c      |  2 +-
  9 files changed, 23 insertions(+), 23 deletions(-)
 
 commit 3bdd1c269a72034a42c73b4cfe0fb6ab051f316c
@@ -3849,8 +13610,8 @@ Date:   Mon Mar 16 18:06:05 2009 +0100
 
     * use the HKL_LIST macros for the HklPseudoAxisEngineGetSet->axes_names
 
- include/hkl/hkl-pseudoaxis.h |    3 +--
- src/hkl-pseudoaxis.c         |   16 ++++------------
+ include/hkl/hkl-pseudoaxis.h |  3 +--
+ src/hkl-pseudoaxis.c         | 16 ++++------------
  2 files changed, 5 insertions(+), 14 deletions(-)
 
 commit c327909a518d9e34dd4b02dd7ace5fdf8ccea39e
@@ -3859,15 +13620,15 @@ Date:   Mon Mar 16 17:11:50 2009 +0100
 
     * use the LIST in the PseudoAxisEngineGetSet
 
- include/hkl/hkl-list.h          |   15 ++++++++-------
- include/hkl/hkl-pseudoaxis.h    |    3 +--
- src/hkl-geometry.c              |    2 +-
- src/hkl-pseudoaxis.c            |   15 ++++-----------
- test/bench.c                    |    2 +-
- test/hkl-test-pseudoaxis-e4cv.c |    2 +-
- test/hkl-test-pseudoaxis-e6c.c  |    2 +-
- test/hkl-test-pseudoaxis-k6c.c  |    2 +-
- test/hkl-test-pseudoaxis.c      |    2 +-
+ include/hkl/hkl-list.h          | 15 ++++++++-------
+ include/hkl/hkl-pseudoaxis.h    |  3 +--
+ src/hkl-geometry.c              |  2 +-
+ src/hkl-pseudoaxis.c            | 15 ++++-----------
+ test/bench.c                    |  2 +-
+ test/hkl-test-pseudoaxis-e4cv.c |  2 +-
+ test/hkl-test-pseudoaxis-e6c.c  |  2 +-
+ test/hkl-test-pseudoaxis-k6c.c  |  2 +-
+ test/hkl-test-pseudoaxis.c      |  2 +-
  9 files changed, 19 insertions(+), 26 deletions(-)
 
 commit f9bd4c312f34ab3774c2a9f3f71bd287b92120ab
@@ -3876,11 +13637,11 @@ Date:   Mon Mar 16 16:32:50 2009 +0100
 
     * remove the HklAxis list in the Holder.
 
- include/hkl/hkl-geometry.h |    1 -
- src/hkl-geometry.c         |    6 ++++--
- src/hkl-holder.c           |   19 +------------------
- test/hkl-test-holder.c     |    6 +++---
- test/wscript_build         |    2 +-
+ include/hkl/hkl-geometry.h |  1 -
+ src/hkl-geometry.c         |  6 ++++--
+ src/hkl-holder.c           | 19 +------------------
+ test/hkl-test-holder.c     |  6 +++---
+ test/wscript_build         |  2 +-
  5 files changed, 9 insertions(+), 25 deletions(-)
 
 commit 2edc1c932ab133466a433789c0b4022d02fa7f12
@@ -3889,9 +13650,9 @@ Date:   Mon Mar 16 16:06:20 2009 +0100
 
     * add the bench test
 
- test/bench.c       |  130 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- test/wscript_build |   11 ++++
- 2 files changed, 141 insertions(+), 0 deletions(-)
+ test/bench.c       | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ test/wscript_build |  11 +++++
+ 2 files changed, 141 insertions(+)
 
 commit 48244049f3ea725cebddb61888ce8067ce88a77a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3899,16 +13660,16 @@ Date:   Mon Mar 16 14:38:26 2009 +0100
 
     * use a verctor of axis in the geometry instead of *axis.
 
- include/hkl/hkl-axis.h     |    2 +
- include/hkl/hkl-geometry.h |    2 +-
- include/hkl/hkl-list.h     |   13 +++++----
- src/hkl-axis.c             |   17 ++++++++----
- src/hkl-geometry.c         |   60 +++++++++++++++++++-------------------------
- src/hkl-holder.c           |   25 +++++++++++++-----
- src/hkl-pseudoaxis.c       |   15 ++++++-----
- test/hkl-test-geometry.c   |   38 ++++++++++++++-------------
- test/hkl-test-holder.c     |    6 ++--
- test/hkl-test-sample.c     |    8 +++---
+ include/hkl/hkl-axis.h     |  2 ++
+ include/hkl/hkl-geometry.h |  2 +-
+ include/hkl/hkl-list.h     | 13 +++++-----
+ src/hkl-axis.c             | 17 ++++++++-----
+ src/hkl-geometry.c         | 60 ++++++++++++++++++++--------------------------
+ src/hkl-holder.c           | 25 +++++++++++++------
+ src/hkl-pseudoaxis.c       | 15 ++++++------
+ test/hkl-test-geometry.c   | 38 +++++++++++++++--------------
+ test/hkl-test-holder.c     |  6 ++---
+ test/hkl-test-sample.c     |  8 +++----
  10 files changed, 100 insertions(+), 86 deletions(-)
 
 commit f7427db677e141c24bf03b1bf8b533a78b53bf19
@@ -3917,8 +13678,8 @@ Date:   Fri Mar 13 18:39:13 2009 +0100
 
     * small optimization
 
- src/hkl-holder.c |   10 +++++-----
- 1 files changed, 5 insertions(+), 5 deletions(-)
+ src/hkl-holder.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
 
 commit 3f7687c7eaca451a2dec8e511f69ef2687e99d74
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3926,10 +13687,10 @@ Date:   Fri Mar 13 18:23:15 2009 +0100
 
     * use list macros in all geometry and add an idx array in the holder
 
- include/hkl/hkl-geometry.h |    1 +
- include/hkl/hkl-list.h     |    9 ++++++
- src/hkl-geometry.c         |   50 +++++++++++++++++-----------------
- src/hkl-holder.c           |   65 +++++++++++++++++++++++--------------------
+ include/hkl/hkl-geometry.h |  1 +
+ include/hkl/hkl-list.h     |  9 +++++++
+ src/hkl-geometry.c         | 50 +++++++++++++++++------------------
+ src/hkl-holder.c           | 65 +++++++++++++++++++++++++---------------------
  4 files changed, 70 insertions(+), 55 deletions(-)
 
 commit b8d509221a2cbc6409b647f9c901b38a7d276e40
@@ -3938,8 +13699,8 @@ Date:   Fri Mar 13 18:22:05 2009 +0100
 
     * use also debug in the test
 
- test/wscript_build |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ test/wscript_build | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit 4c9ccbe2b28bb2abcd7e2ff5e2ced020f18590a0
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -3947,9 +13708,9 @@ Date:   Fri Mar 13 17:14:34 2009 +0100
 
     * use the list macros in the geometry
 
- include/hkl/hkl-geometry.h |    6 ++----
- src/hkl-geometry.c         |    8 +++-----
- src/hkl-holder.c           |   16 +++++++---------
+ include/hkl/hkl-geometry.h |  6 ++----
+ src/hkl-geometry.c         |  8 +++-----
+ src/hkl-holder.c           | 16 +++++++---------
  3 files changed, 12 insertions(+), 18 deletions(-)
 
 commit 481c4d430ad664e0d0c3b89d8a02585d4e39d127
@@ -3958,9 +13719,9 @@ Date:   Fri Mar 13 17:02:17 2009 +0100
 
     * start working on an HKL_LIST macros
 
- include/hkl/hkl-geometry.h |    3 +--
- include/hkl/hkl-list.h     |   15 +++++++++++++++
- src/hkl-geometry.c         |   32 +++++++++++++++-----------------
+ include/hkl/hkl-geometry.h |  3 +--
+ include/hkl/hkl-list.h     | 15 +++++++++++++++
+ src/hkl-geometry.c         | 32 +++++++++++++++-----------------
  3 files changed, 31 insertions(+), 19 deletions(-)
 
 commit 659fa88a581e5d2c6bf07ff019ef50f2169646a9
@@ -3969,16 +13730,16 @@ Date:   Tue Mar 10 10:16:57 2009 +0100
 
     * work done when updating the Diffractometer device.
 
- include/hkl/hkl-parameter.h   |    8 ++++++--
- include/hkl/hkl-sample.h      |   10 +++++++++-
- src/hkl-parameter.c           |   15 ++++++++++++---
- src/hkl-pseudoaxis-e4cv-hkl.c |   16 +++++++++++++---
- src/hkl-pseudoaxis-e6c-hkl.c  |   16 +++++++++++++---
- src/hkl-pseudoaxis-k4cv-hkl.c |   27 ++++++++++++++++++++-------
- src/hkl-pseudoaxis-k6c-hkl.c  |   41 ++++++++++++++++++++++++++++++++---------
- src/hkl-pseudoaxis.c          |   21 +++++++++++++++------
- src/hkl-sample.c              |   26 ++++++++++++++++++++++++--
- wscript                       |    2 +-
+ include/hkl/hkl-parameter.h   |  8 ++++++--
+ include/hkl/hkl-sample.h      | 10 +++++++++-
+ src/hkl-parameter.c           | 15 ++++++++++++---
+ src/hkl-pseudoaxis-e4cv-hkl.c | 16 +++++++++++++---
+ src/hkl-pseudoaxis-e6c-hkl.c  | 16 +++++++++++++---
+ src/hkl-pseudoaxis-k4cv-hkl.c | 27 ++++++++++++++++++++-------
+ src/hkl-pseudoaxis-k6c-hkl.c  | 41 ++++++++++++++++++++++++++++++++---------
+ src/hkl-pseudoaxis.c          | 21 +++++++++++++++------
+ src/hkl-sample.c              | 26 ++++++++++++++++++++++++--
+ wscript                       |  2 +-
  10 files changed, 145 insertions(+), 37 deletions(-)
 
 commit 83976b781db2e1b91a56db4b46db6f97232d5c58
@@ -3987,8 +13748,8 @@ Date:   Mon Feb 16 15:44:17 2009 +0100
 
     * add the soleil compile options
 
- src/wscript_build |    1 +
- wscript           |   10 ++++++++--
+ src/wscript_build |  1 +
+ wscript           | 10 ++++++++--
  2 files changed, 9 insertions(+), 2 deletions(-)
 
 commit 52f9e8bbfba5b75a0e52aa6ff04b3c94e802f52a
@@ -3997,8 +13758,8 @@ Date:   Tue Feb 10 17:15:13 2009 +0100
 
     * typo
 
- test/hkl-test-sample.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ test/hkl-test-sample.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 28e6b8b6db347d09ea5dc904846947113f620f25
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4006,9 +13767,9 @@ Date:   Tue Feb 10 17:15:03 2009 +0100
 
     * add to HklPseudoAxisEngineList an get_pseudo_axis_by_name method.
 
- include/hkl/hkl-pseudoaxis.h |    3 +++
- src/hkl-pseudoaxis.c         |   22 ++++++++++++++++++++++
- 2 files changed, 25 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis.h |  3 +++
+ src/hkl-pseudoaxis.c         | 22 ++++++++++++++++++++++
+ 2 files changed, 25 insertions(+)
 
 commit 6193374546e2921db6c669c5e900fa0152d77e1f
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4016,9 +13777,9 @@ Date:   Tue Feb 10 15:14:25 2009 +0100
 
     * change the HklSampleList append method signature.
 
- include/hkl/hkl-sample.h |    3 +--
- src/hkl-sample.c         |   15 ++++-----------
- test/hkl-test-sample.c   |   31 +++++++++++++++----------------
+ include/hkl/hkl-sample.h |  3 +--
+ src/hkl-sample.c         | 15 ++++-----------
+ test/hkl-test-sample.c   | 31 +++++++++++++++----------------
  3 files changed, 20 insertions(+), 29 deletions(-)
 
 commit 9f9d616618874a6b077c30ddbf26065aeb0ceef6
@@ -4027,8 +13788,8 @@ Date:   Mon Feb 9 17:03:16 2009 +0100
 
     * just typo in the HklSample struct
 
- src/hkl-sample.c |   55 ++++++++++++++++++++++++++++++++---------------------
- 1 files changed, 33 insertions(+), 22 deletions(-)
+ src/hkl-sample.c | 53 ++++++++++++++++++++++++++++++++---------------------
+ 1 file changed, 32 insertions(+), 21 deletions(-)
 
 commit 1992293424283dc6e611e7c434011513079f6935
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4036,9 +13797,9 @@ Date:   Mon Feb 9 17:02:58 2009 +0100
 
     * add a get_value using the unit to the HklParameter class.
 
- include/hkl/hkl-parameter.h |    2 ++
- src/hkl-parameter.c         |    8 ++++++++
- 2 files changed, 10 insertions(+), 0 deletions(-)
+ include/hkl/hkl-parameter.h | 2 ++
+ src/hkl-parameter.c         | 8 ++++++++
+ 2 files changed, 10 insertions(+)
 
 commit afe988852b5b21cbb02487cbc620b7e6f5d47c11
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4046,11 +13807,11 @@ Date:   Fri Feb 6 15:52:59 2009 +0100
 
     * add the hkl_sample_list_del method to remove a sample
 
- include/hkl/hkl-list.h   |    3 +++
- include/hkl/hkl-sample.h |    2 ++
- src/hkl-list.c           |   14 +++++++++++++-
- src/hkl-sample.c         |    9 +++++++++
- 4 files changed, 27 insertions(+), 1 deletions(-)
+ include/hkl/hkl-list.h   |  3 +++
+ include/hkl/hkl-sample.h |  2 ++
+ src/hkl-list.c           | 14 +++++++++++++-
+ src/hkl-sample.c         |  9 +++++++++
+ 4 files changed, 27 insertions(+), 1 deletion(-)
 
 commit daabe75da94e7939eed7931fa57507c72d2c65a1
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4058,8 +13819,8 @@ Date:   Fri Feb 6 14:47:54 2009 +0100
 
     * now the HklSample::affine method return the size of the simplex.
 
- include/hkl/hkl-sample.h |    5 ++++-
- src/hkl-sample.c         |   22 ++++++++++++++++++++--
+ include/hkl/hkl-sample.h |  5 ++++-
+ src/hkl-sample.c         | 22 ++++++++++++++++++++--
  2 files changed, 24 insertions(+), 3 deletions(-)
 
 commit f407f99a2effc6fb605a1ea79035ebba4a0f4f1a
@@ -4068,9 +13829,9 @@ Date:   Fri Feb 6 13:47:48 2009 +0100
 
     * rename the hkl_sample_list_append_sample -> hkl_sample_list_append
 
- include/hkl/hkl-sample.h |    6 +++---
- src/hkl-sample.c         |    4 ++--
- test/hkl-test-sample.c   |   20 ++++++++++----------
+ include/hkl/hkl-sample.h |  6 +++---
+ src/hkl-sample.c         |  4 ++--
+ test/hkl-test-sample.c   | 20 ++++++++++----------
  3 files changed, 15 insertions(+), 15 deletions(-)
 
 commit 820c26a7ada6d0e75764a3df597ab0818dcd41f0
@@ -4079,9 +13840,9 @@ Date:   Wed Feb 4 16:06:09 2009 +0100
 
     * rename the hkl_sample_(get_reflection -> get_ith_reflection)
 
- include/hkl/hkl-sample.h |    5 +++--
- src/hkl-sample.c         |    2 +-
- test/hkl-test-sample.c   |    2 +-
+ include/hkl/hkl-sample.h | 5 +++--
+ src/hkl-sample.c         | 2 +-
+ test/hkl-test-sample.c   | 2 +-
  3 files changed, 5 insertions(+), 4 deletions(-)
 
 commit 7936b1b04e2647f8e73c0a8b8dc087f2a0ab9df9
@@ -4090,9 +13851,9 @@ Date:   Wed Feb 4 15:49:29 2009 +0100
 
     * add the get_ith and len to the HklSampleList
 
- include/hkl/hkl-sample.h |    4 ++++
- src/hkl-sample.c         |   17 +++++++++++++++++
- 2 files changed, 21 insertions(+), 0 deletions(-)
+ include/hkl/hkl-sample.h |  4 ++++
+ src/hkl-sample.c         | 17 +++++++++++++++++
+ 2 files changed, 21 insertions(+)
 
 commit 73404b4ae11d91dac95475aeb83c13e755141ff2
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4100,9 +13861,9 @@ Date:   Wed Feb 4 15:14:42 2009 +0100
 
     * add a method to set U from the eulerian angles
 
- include/hkl/hkl-sample.h |    3 +++
- src/hkl-sample.c         |   12 ++++++++++++
- 2 files changed, 15 insertions(+), 0 deletions(-)
+ include/hkl/hkl-sample.h |  3 +++
+ src/hkl-sample.c         | 12 ++++++++++++
+ 2 files changed, 15 insertions(+)
 
 commit 6fc71956a1c0f1cd25fd016fd70b2bcc24137bd2
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4110,9 +13871,9 @@ Date:   Wed Feb 4 12:22:06 2009 +0100
 
     * add the SampleReflection mesured and theoretical angles.
 
- include/hkl/hkl-sample.h |   10 +++++++-
- src/hkl-sample.c         |   35 +++++++++++++++++++++++++++++++
- test/hkl-test-sample.c   |   52 ++++++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/hkl-sample.h | 10 ++++++++--
+ src/hkl-sample.c         | 35 ++++++++++++++++++++++++++++++++
+ test/hkl-test-sample.c   | 52 ++++++++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 95 insertions(+), 2 deletions(-)
 
 commit a652ecb7ec1b3929953c525672ec4a8379d2c67b
@@ -4121,11 +13882,11 @@ Date:   Fri Jan 30 18:03:59 2009 +0100
 
     * add the HklSampleList
 
- TODO                     |    1 +
- include/hkl/hkl-sample.h |   28 ++++++++++++++
- src/hkl-sample.c         |   94 +++++++++++++++++++++++++++++++++++++++++++++-
- test/hkl-test-sample.c   |   60 +++++++++++++++++++++++++++++
- 4 files changed, 182 insertions(+), 1 deletions(-)
+ TODO                     |  1 +
+ include/hkl/hkl-sample.h | 28 +++++++++++++++
+ src/hkl-sample.c         | 94 +++++++++++++++++++++++++++++++++++++++++++++++-
+ test/hkl-test-sample.c   | 60 +++++++++++++++++++++++++++++++
+ 4 files changed, 182 insertions(+), 1 deletion(-)
 
 commit a5e3d24519eb7f0242f9e987d16cf83d0f154db5
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4133,8 +13894,8 @@ Date:   Fri Jan 30 18:02:40 2009 +0100
 
     * remove a memory leak.
 
- src/hkl-pseudoaxis.c |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis.c | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit cfe77654ec061f543e298c2c1713b79344f0433d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4142,9 +13903,9 @@ Date:   Fri Jan 30 16:02:06 2009 +0100
 
     * no more enum problem with g++
 
- include/hkl/hkl-geometry-factory.h |    4 ++--
- include/hkl/hkl-sample.h           |    3 ++-
- include/hkl/hkl-unit.h             |    3 ++-
+ include/hkl/hkl-geometry-factory.h | 4 ++--
+ include/hkl/hkl-sample.h           | 3 ++-
+ include/hkl/hkl-unit.h             | 3 ++-
  3 files changed, 6 insertions(+), 4 deletions(-)
 
 commit 882701fe4dff2b930eab5fb52108ecba3b221223
@@ -4155,14 +13916,14 @@ Date:   Mon Jan 26 14:35:38 2009 +0100
     
     E4CV -> e4cv etc...
 
- test/hkl-test-pseudoaxis-E4CV.c |  285 ---------------------------------------
- test/hkl-test-pseudoaxis-E6C.c  |  146 --------------------
- test/hkl-test-pseudoaxis-K4CV.c |  160 ----------------------
- test/hkl-test-pseudoaxis-K6C.c  |  232 -------------------------------
- test/hkl-test-pseudoaxis-e4cv.c |  285 +++++++++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis-e6c.c  |  146 ++++++++++++++++++++
- test/hkl-test-pseudoaxis-k4cv.c |  160 ++++++++++++++++++++++
- test/hkl-test-pseudoaxis-k6c.c  |  232 +++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis-E4CV.c | 285 ----------------------------------------
+ test/hkl-test-pseudoaxis-E6C.c  | 146 --------------------
+ test/hkl-test-pseudoaxis-K4CV.c | 160 ----------------------
+ test/hkl-test-pseudoaxis-K6C.c  | 232 --------------------------------
+ test/hkl-test-pseudoaxis-e4cv.c | 285 ++++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis-e6c.c  | 146 ++++++++++++++++++++
+ test/hkl-test-pseudoaxis-k4cv.c | 160 ++++++++++++++++++++++
+ test/hkl-test-pseudoaxis-k6c.c  | 232 ++++++++++++++++++++++++++++++++
  8 files changed, 823 insertions(+), 823 deletions(-)
 
 commit 972575c825f312f58f5cdebe5c6c721adb05a12a
@@ -4173,10 +13934,10 @@ Date:   Mon Jan 26 14:18:51 2009 +0100
     
     also reactive the eulerians pseudoaxis tests.
 
- include/hkl/hkl-pseudoaxis-factory.h  |   70 +++++++++++++++++---------------
- include/hkl/hkl-pseudoaxis-k4cv.h     |    1 -
- src/hkl-pseudoaxis-common-eulerians.c |    9 ++++
- test/hkl-test-pseudoaxis.c            |   32 +++++----------
+ include/hkl/hkl-pseudoaxis-factory.h  | 70 ++++++++++++++++++-----------------
+ include/hkl/hkl-pseudoaxis-k4cv.h     |  1 -
+ src/hkl-pseudoaxis-common-eulerians.c |  9 +++++
+ test/hkl-test-pseudoaxis.c            | 32 +++++-----------
  4 files changed, 56 insertions(+), 56 deletions(-)
 
 commit 8c640f6617d778993a4c50bd48a5a0245e0fd6c8
@@ -4185,14 +13946,14 @@ Date:   Sat Jan 24 11:04:23 2009 +0100
 
     * clean up the #include
 
- src/hkl-pseudoaxis-e4cv-hkl.c |    2 --
- src/hkl-pseudoaxis-e4cv-psi.c |    4 ----
- src/hkl-pseudoaxis-e6c-hkl.c  |    3 ---
- src/hkl-pseudoaxis-e6c-psi.c  |    4 ----
- src/hkl-pseudoaxis-k4cv-hkl.c |    2 --
- src/hkl-pseudoaxis-k4cv-psi.c |    4 ----
- src/hkl-pseudoaxis-k6c-hkl.c  |    6 ++----
- src/hkl-pseudoaxis-k6c-psi.c  |    4 ----
+ src/hkl-pseudoaxis-e4cv-hkl.c | 2 --
+ src/hkl-pseudoaxis-e4cv-psi.c | 4 ----
+ src/hkl-pseudoaxis-e6c-hkl.c  | 3 ---
+ src/hkl-pseudoaxis-e6c-psi.c  | 4 ----
+ src/hkl-pseudoaxis-k4cv-hkl.c | 2 --
+ src/hkl-pseudoaxis-k4cv-psi.c | 4 ----
+ src/hkl-pseudoaxis-k6c-hkl.c  | 6 ++----
+ src/hkl-pseudoaxis-k6c-psi.c  | 4 ----
  8 files changed, 2 insertions(+), 27 deletions(-)
 
 commit 77242bb2b2805f11751eb467adba6bf031df8ea9
@@ -4201,11 +13962,11 @@ Date:   Sat Jan 24 10:44:57 2009 +0100
 
     * no more warning
 
- include/hkl/hkl-pseudoaxis-common.h |   15 +++++++++++++++
- src/hkl-pseudoaxis-common-hkl.c     |   29 +----------------------------
- src/hkl-pseudoaxis-common-psi.c     |    1 +
- src/hkl-pseudoaxis-common.c         |   29 +++++++++++++++++++++++++++++
- src/wscript_build                   |    2 +-
+ include/hkl/hkl-pseudoaxis-common.h | 15 +++++++++++++++
+ src/hkl-pseudoaxis-common-hkl.c     | 29 +----------------------------
+ src/hkl-pseudoaxis-common-psi.c     |  1 +
+ src/hkl-pseudoaxis-common.c         | 29 +++++++++++++++++++++++++++++
+ src/wscript_build                   |  2 +-
  5 files changed, 47 insertions(+), 29 deletions(-)
 
 commit 4e00de6bec3f2834c19d1c1a2d49e23011d850b0
@@ -4214,8 +13975,8 @@ Date:   Sat Jan 24 10:18:20 2009 +0100
 
     * remove few more warnings
 
- include/hkl/hkl-unit.h |    6 +++---
- src/hkl-unit.c         |    1 +
+ include/hkl/hkl-unit.h | 6 +++---
+ src/hkl-unit.c         | 1 +
  2 files changed, 4 insertions(+), 3 deletions(-)
 
 commit 171a4145fdacec78ea9642dc7c7700fe2f0b4563
@@ -4224,23 +13985,23 @@ Date:   Fri Jan 23 17:24:45 2009 +0100
 
     * typo and warning clean
 
- include/hkl/hkl-pseudoaxis.h          |   10 +++++-----
- src/hkl-axis.c                        |    1 -
- src/hkl-geometry.c                    |    2 --
- src/hkl-parameter.c                   |    2 ++
- src/hkl-pseudoaxis-common-eulerians.c |    2 +-
- src/hkl-pseudoaxis-common-hkl.c       |    1 +
- src/hkl-pseudoaxis-common-psi.c       |    4 +---
- src/hkl-pseudoaxis-e4cv-hkl.c         |    2 +-
- src/hkl-pseudoaxis-e4cv-psi.c         |    1 -
- src/hkl-pseudoaxis-e6c-hkl.c          |    3 ++-
- src/hkl-pseudoaxis-e6c-psi.c          |    1 -
- src/hkl-pseudoaxis-k4cv-hkl.c         |    2 +-
- src/hkl-pseudoaxis-k4cv-psi.c         |    1 -
- src/hkl-pseudoaxis-k6c-hkl.c          |    2 +-
- src/hkl-pseudoaxis-k6c-psi.c          |    1 -
- src/hkl-pseudoaxis.c                  |   32 +++++++++++++++++++++++---------
- src/wscript_build                     |    2 +-
+ include/hkl/hkl-pseudoaxis.h          | 10 +++++-----
+ src/hkl-axis.c                        |  1 -
+ src/hkl-geometry.c                    |  2 --
+ src/hkl-parameter.c                   |  2 ++
+ src/hkl-pseudoaxis-common-eulerians.c |  2 +-
+ src/hkl-pseudoaxis-common-hkl.c       |  1 +
+ src/hkl-pseudoaxis-common-psi.c       |  4 +---
+ src/hkl-pseudoaxis-e4cv-hkl.c         |  2 +-
+ src/hkl-pseudoaxis-e4cv-psi.c         |  1 -
+ src/hkl-pseudoaxis-e6c-hkl.c          |  3 ++-
+ src/hkl-pseudoaxis-e6c-psi.c          |  1 -
+ src/hkl-pseudoaxis-k4cv-hkl.c         |  2 +-
+ src/hkl-pseudoaxis-k4cv-psi.c         |  1 -
+ src/hkl-pseudoaxis-k6c-hkl.c          |  2 +-
+ src/hkl-pseudoaxis-k6c-psi.c          |  1 -
+ src/hkl-pseudoaxis.c                  | 32 +++++++++++++++++++++++---------
+ src/wscript_build                     |  2 +-
  17 files changed, 39 insertions(+), 30 deletions(-)
 
 commit af9976834c8df28cee39078957d757041ed93984
@@ -4249,14 +14010,14 @@ Date:   Fri Jan 23 16:59:14 2009 +0100
 
     * now all pseudoAxes are usable after construction.
 
- src/hkl-pseudoaxis-e4cv-hkl.c |    2 ++
- src/hkl-pseudoaxis-e4cv-psi.c |    2 ++
- src/hkl-pseudoaxis-e6c-hkl.c  |    2 ++
- src/hkl-pseudoaxis-e6c-psi.c  |    2 ++
- src/hkl-pseudoaxis-k4cv-hkl.c |    2 ++
- src/hkl-pseudoaxis-k4cv-psi.c |    2 ++
- src/hkl-pseudoaxis-k6c-hkl.c  |    2 ++
- 7 files changed, 14 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-e4cv-hkl.c | 2 ++
+ src/hkl-pseudoaxis-e4cv-psi.c | 2 ++
+ src/hkl-pseudoaxis-e6c-hkl.c  | 2 ++
+ src/hkl-pseudoaxis-e6c-psi.c  | 2 ++
+ src/hkl-pseudoaxis-k4cv-hkl.c | 2 ++
+ src/hkl-pseudoaxis-k4cv-psi.c | 2 ++
+ src/hkl-pseudoaxis-k6c-hkl.c  | 2 ++
+ 7 files changed, 14 insertions(+)
 
 commit 0641359ca13bff057f330d645319e7a1d34bfaf8
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4264,21 +14025,21 @@ Date:   Fri Jan 23 16:48:48 2009 +0100
 
     * use the HklParameter in the HklAxis
 
- include/hkl/hkl-axis.h                |   31 ++----------
- include/hkl/hkl-parameter.h           |    2 +
- src/hkl-axis.c                        |   66 +++++++-----------------
- src/hkl-geometry.c                    |   35 ++++++-------
- src/hkl-holder.c                      |    5 +-
- src/hkl-parameter.c                   |    7 +++
- src/hkl-pseudoaxis-auto.c             |   17 +++---
- src/hkl-pseudoaxis-common-eulerians.c |    6 +-
- src/hkl-pseudoaxis-common-hkl.c       |   14 ++----
- src/hkl-pseudoaxis-common-psi.c       |    7 +--
- src/hkl-pseudoaxis.c                  |   26 +++++++---
- test/hkl-test-axis.c                  |   88 +++++++--------------------------
- test/hkl-test-detector.c              |    7 +--
- test/hkl-test-geometry.c              |   15 ++---
- test/hkl-test-sample.c                |   67 ++++++-------------------
+ include/hkl/hkl-axis.h                | 31 ++----------
+ include/hkl/hkl-parameter.h           |  2 +
+ src/hkl-axis.c                        | 66 ++++++++------------------
+ src/hkl-geometry.c                    | 35 ++++++--------
+ src/hkl-holder.c                      |  5 +-
+ src/hkl-parameter.c                   |  7 +++
+ src/hkl-pseudoaxis-auto.c             | 17 +++----
+ src/hkl-pseudoaxis-common-eulerians.c |  6 +--
+ src/hkl-pseudoaxis-common-hkl.c       | 14 ++----
+ src/hkl-pseudoaxis-common-psi.c       |  7 +--
+ src/hkl-pseudoaxis.c                  | 26 +++++++----
+ test/hkl-test-axis.c                  | 88 +++++++----------------------------
+ test/hkl-test-detector.c              |  7 +--
+ test/hkl-test-geometry.c              | 15 +++---
+ test/hkl-test-sample.c                | 67 +++++++-------------------
  15 files changed, 130 insertions(+), 263 deletions(-)
 
 commit 4cdb573258f14fa4cf5a601bd76fb10eec356bd0
@@ -4287,14 +14048,14 @@ Date:   Fri Jan 23 14:46:00 2009 +0100
 
     * add the changed member to HklParameter
 
- include/hkl/hkl-parameter.h           |    5 ++-
- src/hkl-lattice.c                     |   18 +++++++++-----
- src/hkl-parameter.c                   |   11 +++++---
- src/hkl-pseudoaxis-common-eulerians.c |    6 ++--
- src/hkl-pseudoaxis-common-hkl.c       |    6 ++--
- src/hkl-pseudoaxis-common-psi.c       |    2 +-
- src/hkl-pseudoaxis.c                  |    2 +-
- test/hkl-test-parameter.c             |   41 ++++++++++++++++++++++----------
+ include/hkl/hkl-parameter.h           |  5 +++--
+ src/hkl-lattice.c                     | 18 ++++++++++-----
+ src/hkl-parameter.c                   | 11 ++++++----
+ src/hkl-pseudoaxis-common-eulerians.c |  6 ++---
+ src/hkl-pseudoaxis-common-hkl.c       |  6 ++---
+ src/hkl-pseudoaxis-common-psi.c       |  2 +-
+ src/hkl-pseudoaxis.c                  |  2 +-
+ test/hkl-test-parameter.c             | 41 ++++++++++++++++++++++++-----------
  8 files changed, 58 insertions(+), 33 deletions(-)
 
 commit 47a75c86a39efeb641406c688d3fb3b30205f0af
@@ -4303,12 +14064,12 @@ Date:   Fri Jan 23 14:27:24 2009 +0100
 
     * factorize the "psi" HklPseudoAxisEngine construction.
 
- include/hkl/hkl-pseudoaxis-common-psi.h |    2 ++
- src/hkl-pseudoaxis-common-psi.c         |   16 ++++++++++++++++
- src/hkl-pseudoaxis-e4cv-psi.c           |    9 +--------
- src/hkl-pseudoaxis-e6c-psi.c            |    9 +--------
- src/hkl-pseudoaxis-k4cv-psi.c           |    9 +--------
- src/hkl-pseudoaxis-k6c-psi.c            |    9 +--------
+ include/hkl/hkl-pseudoaxis-common-psi.h |  2 ++
+ src/hkl-pseudoaxis-common-psi.c         | 16 ++++++++++++++++
+ src/hkl-pseudoaxis-e4cv-psi.c           |  9 +--------
+ src/hkl-pseudoaxis-e6c-psi.c            |  9 +--------
+ src/hkl-pseudoaxis-k4cv-psi.c           |  9 +--------
+ src/hkl-pseudoaxis-k6c-psi.c            |  9 +--------
  6 files changed, 22 insertions(+), 32 deletions(-)
 
 commit e7eb9ef5d2574016a3b151aed00c7706e36798e9
@@ -4317,12 +14078,12 @@ Date:   Fri Jan 23 14:23:25 2009 +0100
 
     * factorize the "hkl" HklPseudoAxisEngine construction
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |    2 ++
- src/hkl-pseudoaxis-common-hkl.c         |   28 ++++++++++++++++++++++++++++
- src/hkl-pseudoaxis-e4cv-hkl.c           |   21 +--------------------
- src/hkl-pseudoaxis-e6c-hkl.c            |   21 +--------------------
- src/hkl-pseudoaxis-k4cv-hkl.c           |   21 +--------------------
- src/hkl-pseudoaxis-k6c-hkl.c            |   21 +--------------------
+ include/hkl/hkl-pseudoaxis-common-hkl.h |  2 ++
+ src/hkl-pseudoaxis-common-hkl.c         | 28 ++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-e4cv-hkl.c           | 21 +--------------------
+ src/hkl-pseudoaxis-e6c-hkl.c            | 21 +--------------------
+ src/hkl-pseudoaxis-k4cv-hkl.c           | 21 +--------------------
+ src/hkl-pseudoaxis-k6c-hkl.c            | 21 +--------------------
  6 files changed, 34 insertions(+), 80 deletions(-)
 
 commit 2b7b1fc085f44a69dd93826a673a94c146127def
@@ -4331,27 +14092,27 @@ Date:   Fri Jan 23 14:22:35 2009 +0100
 
     * use directly pointers for the PseudoAxes in the HklPseudoAxisEngine.
 
- include/hkl/hkl-parameter.h           |    8 +++---
- include/hkl/hkl-pseudoaxis.h          |    9 ++++++-
- src/hkl-parameter.c                   |   10 +++++---
- src/hkl-pseudoaxis-common-eulerians.c |   38 ++++++++++++++++++++++----------
- src/hkl-pseudoaxis-common-hkl.c       |   18 ++++++---------
- src/hkl-pseudoaxis-common-psi.c       |    4 +-
- src/hkl-pseudoaxis-e4cv-hkl.c         |   23 +++++++++++++++----
- src/hkl-pseudoaxis-e4cv-psi.c         |   11 +++++----
- src/hkl-pseudoaxis-e6c-hkl.c          |   25 ++++++++++++++++-----
- src/hkl-pseudoaxis-e6c-psi.c          |   11 +++++----
- src/hkl-pseudoaxis-k4cv-hkl.c         |   23 +++++++++++++++----
- src/hkl-pseudoaxis-k4cv-psi.c         |   11 +++++----
- src/hkl-pseudoaxis-k6c-hkl.c          |   23 +++++++++++++++----
- src/hkl-pseudoaxis-k6c-psi.c          |   11 +++++----
- src/hkl-pseudoaxis.c                  |   31 ++++++++++++++++++++++----
- test/hkl-test-parameter.c             |   32 +++++++++++++-------------
- test/hkl-test-pseudoaxis-E4CV.c       |   16 +++++++-------
- test/hkl-test-pseudoaxis-E6C.c        |   12 +++++-----
- test/hkl-test-pseudoaxis-K4CV.c       |   18 +++++++-------
- test/hkl-test-pseudoaxis-K6C.c        |   19 ++++++++-------
- test/hkl-test-pseudoaxis.c            |    6 ++--
+ include/hkl/hkl-parameter.h           |  8 ++++----
+ include/hkl/hkl-pseudoaxis.h          |  9 +++++++--
+ src/hkl-parameter.c                   | 10 +++++----
+ src/hkl-pseudoaxis-common-eulerians.c | 38 ++++++++++++++++++++++++-----------
+ src/hkl-pseudoaxis-common-hkl.c       | 18 +++++++----------
+ src/hkl-pseudoaxis-common-psi.c       |  4 ++--
+ src/hkl-pseudoaxis-e4cv-hkl.c         | 23 ++++++++++++++++-----
+ src/hkl-pseudoaxis-e4cv-psi.c         | 11 +++++-----
+ src/hkl-pseudoaxis-e6c-hkl.c          | 25 +++++++++++++++++------
+ src/hkl-pseudoaxis-e6c-psi.c          | 11 +++++-----
+ src/hkl-pseudoaxis-k4cv-hkl.c         | 23 ++++++++++++++++-----
+ src/hkl-pseudoaxis-k4cv-psi.c         | 11 +++++-----
+ src/hkl-pseudoaxis-k6c-hkl.c          | 23 ++++++++++++++++-----
+ src/hkl-pseudoaxis-k6c-psi.c          | 11 +++++-----
+ src/hkl-pseudoaxis.c                  | 31 +++++++++++++++++++++++-----
+ test/hkl-test-parameter.c             | 32 ++++++++++++++---------------
+ test/hkl-test-pseudoaxis-E4CV.c       | 16 +++++++--------
+ test/hkl-test-pseudoaxis-E6C.c        | 12 +++++------
+ test/hkl-test-pseudoaxis-K4CV.c       | 18 ++++++++---------
+ test/hkl-test-pseudoaxis-K6C.c        | 19 +++++++++---------
+ test/hkl-test-pseudoaxis.c            |  6 +++---
  21 files changed, 227 insertions(+), 132 deletions(-)
 
 commit d20a530dcccc739a8ebeb467912c14a25ae4a322
@@ -4362,8 +14123,8 @@ Date:   Fri Jan 23 10:38:55 2009 +0100
     
     the unit and punit can be NULL so we need to take this into account.
 
- src/hkl-parameter.c |   19 +++++++++++++------
- 1 files changed, 13 insertions(+), 6 deletions(-)
+ src/hkl-parameter.c | 19 +++++++++++++------
+ 1 file changed, 13 insertions(+), 6 deletions(-)
 
 commit 5608c8c6e0d2b5b442fee2a497192e8447d1708a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4371,25 +14132,25 @@ Date:   Fri Jan 23 10:30:07 2009 +0100
 
     * use HklParameter in the HklPseudoAxis
 
- include/hkl/hkl-pseudoaxis.h          |    7 +-
- src/hkl-pseudoaxis-common-eulerians.c |   23 ++++----
- src/hkl-pseudoaxis-common-hkl.c       |   27 +++++----
- src/hkl-pseudoaxis-common-psi.c       |    4 +-
- src/hkl-pseudoaxis-e4cv-hkl.c         |    4 +-
- src/hkl-pseudoaxis-e4cv-psi.c         |    4 +-
- src/hkl-pseudoaxis-e6c-hkl.c          |    4 +-
- src/hkl-pseudoaxis-e6c-psi.c          |    4 +-
- src/hkl-pseudoaxis-k4cv-hkl.c         |    4 +-
- src/hkl-pseudoaxis-k4cv-psi.c         |    4 +-
- src/hkl-pseudoaxis-k6c-hkl.c          |    4 +-
- src/hkl-pseudoaxis-k6c-psi.c          |    4 +-
- src/hkl-pseudoaxis.c                  |   21 +++----
- src/hkl-unit.c                        |  104 +++++++++++++++++----------------
- test/hkl-test-pseudoaxis-E4CV.c       |   28 +++++-----
- test/hkl-test-pseudoaxis-E6C.c        |   24 ++++----
- test/hkl-test-pseudoaxis-K4CV.c       |   30 +++++-----
- test/hkl-test-pseudoaxis-K6C.c        |   18 +++---
- test/hkl-test-pseudoaxis.c            |   11 ++--
+ include/hkl/hkl-pseudoaxis.h          |   7 +--
+ src/hkl-pseudoaxis-common-eulerians.c |  23 ++++----
+ src/hkl-pseudoaxis-common-hkl.c       |  27 ++++-----
+ src/hkl-pseudoaxis-common-psi.c       |   4 +-
+ src/hkl-pseudoaxis-e4cv-hkl.c         |   4 +-
+ src/hkl-pseudoaxis-e4cv-psi.c         |   4 +-
+ src/hkl-pseudoaxis-e6c-hkl.c          |   4 +-
+ src/hkl-pseudoaxis-e6c-psi.c          |   4 +-
+ src/hkl-pseudoaxis-k4cv-hkl.c         |   4 +-
+ src/hkl-pseudoaxis-k4cv-psi.c         |   4 +-
+ src/hkl-pseudoaxis-k6c-hkl.c          |   4 +-
+ src/hkl-pseudoaxis-k6c-psi.c          |   4 +-
+ src/hkl-pseudoaxis.c                  |  21 ++++---
+ src/hkl-unit.c                        | 104 ++++++++++++++++++----------------
+ test/hkl-test-pseudoaxis-E4CV.c       |  28 ++++-----
+ test/hkl-test-pseudoaxis-E6C.c        |  24 ++++----
+ test/hkl-test-pseudoaxis-K4CV.c       |  30 +++++-----
+ test/hkl-test-pseudoaxis-K6C.c        |  18 +++---
+ test/hkl-test-pseudoaxis.c            |  11 ++--
  19 files changed, 166 insertions(+), 163 deletions(-)
 
 commit 988dcb204ac34aa77b19b22ded4ae9b85817ff88
@@ -4398,8 +14159,8 @@ Date:   Thu Jan 22 16:37:12 2009 +0100
 
     * print also the range with the right unit
 
- src/hkl-parameter.c |    7 ++++---
- 1 files changed, 4 insertions(+), 3 deletions(-)
+ src/hkl-parameter.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
 
 commit 4b390fdc3b75ba1832cb98c97fe227bc9700d9f1
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4407,12 +14168,12 @@ Date:   Thu Jan 22 14:19:39 2009 +0100
 
     * first version of the unit system
 
- include/hkl/hkl-parameter.h |   12 +++++-
- include/hkl/hkl-unit.h      |   35 +++++++++++++++++++
- src/hkl-lattice.c           |   25 ++++++++++---
- src/hkl-parameter.c         |   20 +++++++---
- src/hkl-unit.c              |   80 +++++++++++++++++++++++++++++++++++++++++++
- test/hkl-test-parameter.c   |   45 ++++++++++++++++++------
+ include/hkl/hkl-parameter.h | 12 +++++--
+ include/hkl/hkl-unit.h      | 35 ++++++++++++++++++++
+ src/hkl-lattice.c           | 25 ++++++++++----
+ src/hkl-parameter.c         | 20 ++++++++----
+ src/hkl-unit.c              | 80 +++++++++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-parameter.c   | 45 ++++++++++++++++++-------
  6 files changed, 191 insertions(+), 26 deletions(-)
 
 commit 9e9522ff4fec38bf7063e36faa45429e06195ddc
@@ -4421,8 +14182,8 @@ Date:   Thu Jan 22 11:27:06 2009 +0100
 
     * update the gitignore file
 
- .gitignore |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ .gitignore | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit c84bd9aafdd1b0578256fd1816ec69df6d3b8ab5
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4430,10 +14191,10 @@ Date:   Thu Jan 22 11:17:58 2009 +0100
 
     * add the eulerians test method but unactive them for now.
 
- test/hkl-test-pseudoaxis-K4CV.c |    1 +
- test/hkl-test-pseudoaxis-K6C.c  |  137 +++++++++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis.c      |    4 +-
- 3 files changed, 141 insertions(+), 1 deletions(-)
+ test/hkl-test-pseudoaxis-K4CV.c |   1 +
+ test/hkl-test-pseudoaxis-K6C.c  | 137 ++++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis.c      |   4 +-
+ 3 files changed, 141 insertions(+), 1 deletion(-)
 
 commit 7d85c97fe5601be288363228b8cb48f404a7d858
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4441,10 +14202,10 @@ Date:   Thu Jan 22 10:49:02 2009 +0100
 
     * add the common eulerians pseudo axes
 
- include/hkl/hkl-pseudoaxis-common-eulerians.h |   12 +++
- src/hkl-pseudoaxis-common-eulerians.c         |  121 +++++++++++++++++++++++++
- src/hkl-pseudoaxis-k4cv-eulerians.c           |  120 ------------------------
- test/hkl-test-pseudoaxis-K4CV.c               |    2 +-
+ include/hkl/hkl-pseudoaxis-common-eulerians.h |  12 +++
+ src/hkl-pseudoaxis-common-eulerians.c         | 121 ++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-k4cv-eulerians.c           | 120 -------------------------
+ test/hkl-test-pseudoaxis-K4CV.c               |   2 +-
  4 files changed, 134 insertions(+), 121 deletions(-)
 
 commit 6a5ba8be5f9230125987559ea81158309432239f
@@ -4453,12 +14214,12 @@ Date:   Wed Jan 21 15:36:40 2009 +0100
 
     * rename the hkl get set
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |   16 ++++++++--------
- src/hkl-pseudoaxis-common-hkl.c         |   16 ++++++++--------
- src/hkl-pseudoaxis-e4cv-hkl.c           |   16 ++++++++--------
- src/hkl-pseudoaxis-e6c-hkl.c            |   24 ++++++++++++------------
- src/hkl-pseudoaxis-k4cv-hkl.c           |   10 +++++-----
- src/hkl-pseudoaxis-k6c-hkl.c            |   22 +++++++++++-----------
+ include/hkl/hkl-pseudoaxis-common-hkl.h | 16 ++++++++--------
+ src/hkl-pseudoaxis-common-hkl.c         | 16 ++++++++--------
+ src/hkl-pseudoaxis-e4cv-hkl.c           | 16 ++++++++--------
+ src/hkl-pseudoaxis-e6c-hkl.c            | 24 ++++++++++++------------
+ src/hkl-pseudoaxis-k4cv-hkl.c           | 10 +++++-----
+ src/hkl-pseudoaxis-k6c-hkl.c            | 22 +++++++++++-----------
  6 files changed, 52 insertions(+), 52 deletions(-)
 
 commit 3b49422eb08cdf0a32b96be5c126ef64b694fdb5
@@ -4467,13 +14228,13 @@ Date:   Wed Jan 21 15:27:02 2009 +0100
 
     * add the vertical and horizontal double diffraction.
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |   30 ++++++----
- src/hkl-pseudoaxis-common-hkl.c         |   73 ++++++----------------
- src/hkl-pseudoaxis-e4cv-hkl.c           |   13 +++-
- src/hkl-pseudoaxis-e6c-hkl.c            |   27 +++++++--
- src/hkl-pseudoaxis-k4cv-hkl.c           |   13 +++-
- src/hkl-pseudoaxis-k6c-hkl.c            |  101 +++++++++++++++++++++++++++++--
- src/hkl-pseudoaxis.c                    |    5 +-
+ include/hkl/hkl-pseudoaxis-common-hkl.h |  30 ++++++----
+ src/hkl-pseudoaxis-common-hkl.c         |  73 ++++++-----------------
+ src/hkl-pseudoaxis-e4cv-hkl.c           |  13 +++-
+ src/hkl-pseudoaxis-e6c-hkl.c            |  27 +++++++--
+ src/hkl-pseudoaxis-k4cv-hkl.c           |  13 +++-
+ src/hkl-pseudoaxis-k6c-hkl.c            | 101 ++++++++++++++++++++++++++++++--
+ src/hkl-pseudoaxis.c                    |   5 +-
  7 files changed, 179 insertions(+), 83 deletions(-)
 
 commit dc58d486193f1e579672794598e9a8b123d2f52a
@@ -4482,8 +14243,8 @@ Date:   Wed Jan 21 13:14:37 2009 +0100
 
     * now the k6c psi pseudoaxes is working even if not initialized.
 
- src/hkl-pseudoaxis-k6c-psi.c |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-k6c-psi.c | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit a3c2939ba23053134e03ab40b048b9331db7e07c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4491,8 +14252,8 @@ Date:   Wed Jan 21 13:13:52 2009 +0100
 
     * remove a bug in the double_diffraction_func
 
- src/hkl-pseudoaxis-common-hkl.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-common-hkl.c | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit 10629f5da40a96622214c77d3ff0c23a2b0f3081
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4500,8 +14261,8 @@ Date:   Wed Jan 21 13:12:51 2009 +0100
 
     add the -g flag to build with the debug symbols
 
- src/wscript_build |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ src/wscript_build | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit 0fa594896944c45efc99b304f4aaf72d076c1f9e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4511,8 +14272,8 @@ Date:   Wed Jan 21 13:12:22 2009 +0100
     
     The UB matrix was not updated.
 
- src/hkl-sample.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-sample.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 18db4171124eea3dd61d98b1f74436160a8a598b
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4520,14 +14281,14 @@ Date:   Wed Jan 21 13:11:31 2009 +0100
 
     * add a bunch of fprintf methods
 
- NEWS                      |    3 +++
- TODO                      |    7 +++++++
- include/hkl/hkl-lattice.h |    2 ++
- include/hkl/hkl-sample.h  |    2 ++
- include/hkl/hkl-source.h  |    2 ++
- src/hkl-lattice.c         |   16 ++++++++++++++++
- src/hkl-sample.c          |   26 ++++++++++++++++++++------
- src/hkl-source.c          |    7 +++++++
+ NEWS                      |  3 +++
+ TODO                      |  7 +++++++
+ include/hkl/hkl-lattice.h |  2 ++
+ include/hkl/hkl-sample.h  |  2 ++
+ include/hkl/hkl-source.h  |  2 ++
+ src/hkl-lattice.c         | 16 ++++++++++++++++
+ src/hkl-sample.c          | 26 ++++++++++++++++++++------
+ src/hkl-source.c          |  7 +++++++
  8 files changed, 59 insertions(+), 6 deletions(-)
 
 commit 2017043c6c42d89e761af551283c6a555817f7bf
@@ -4536,8 +14297,8 @@ Date:   Tue Jan 13 15:54:56 2009 +0100
 
     * use the HklPseudoAxisEgnineList in the tests
 
- test/hkl-test-pseudoaxis.c |   77 ++++++++++++++++----------------------------
- 1 files changed, 28 insertions(+), 49 deletions(-)
+ test/hkl-test-pseudoaxis.c | 77 +++++++++++++++++-----------------------------
+ 1 file changed, 28 insertions(+), 49 deletions(-)
 
 commit 432290d96a33da1476fe600f967890be3fbb3ab6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4545,9 +14306,9 @@ Date:   Tue Jan 13 15:54:30 2009 +0100
 
     * add the HklPseudoAxisEngineList
 
- include/hkl/hkl-pseudoaxis.h |   30 ++++++++++++++
- src/hkl-pseudoaxis.c         |   89 ++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 119 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis.h | 30 +++++++++++++++
+ src/hkl-pseudoaxis.c         | 89 ++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 119 insertions(+)
 
 commit 35a124fcbb06b3fe772920002306c0917b09a58e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4555,8 +14316,8 @@ Date:   Tue Jan 13 14:43:40 2009 +0100
 
     * typo
 
- include/hkl/hkl-pseudoaxis.h |    1 +
- src/hkl-pseudoaxis.c         |    6 +++---
+ include/hkl/hkl-pseudoaxis.h | 1 +
+ src/hkl-pseudoaxis.c         | 6 +++---
  2 files changed, 4 insertions(+), 3 deletions(-)
 
 commit a09625afcd6e2e8f6f13c5911802a41081a8b511
@@ -4565,8 +14326,8 @@ Date:   Tue Jan 13 13:19:11 2009 +0100
 
     * update the wscript to let the test run (hugly hack)
 
- wscript |    9 ++++++++-
- 1 files changed, 8 insertions(+), 1 deletions(-)
+ wscript | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
 
 commit 932422f06c1e4b998f6d0f964d0810096e92e2fc
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4574,10 +14335,10 @@ Date:   Mon Jan 12 16:44:32 2009 +0100
 
     * better gestion of the VERSION number
 
- VERSION           |    1 -
- hkl.pc.in         |    2 +-
- src/wscript_build |    2 +-
- wscript           |    5 ++---
+ VERSION           | 1 -
+ hkl.pc.in         | 2 +-
+ src/wscript_build | 2 +-
+ wscript           | 5 ++---
  4 files changed, 4 insertions(+), 6 deletions(-)
 
 commit c243a721edc390ef13680f687132577e21b4bbb4
@@ -4586,9 +14347,9 @@ Date:   Mon Jan 12 15:40:54 2009 +0100
 
     * add the pkgconfig file
 
- hkl.pc.in |   12 ++++++++++++
- wscript   |   15 +++++++++++++++
- 2 files changed, 27 insertions(+), 0 deletions(-)
+ hkl.pc.in | 12 ++++++++++++
+ wscript   | 15 +++++++++++++++
+ 2 files changed, 27 insertions(+)
 
 commit 61e437f35363aa0be45a80abeaa33e1d45b3b4ab
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4596,9 +14357,9 @@ Date:   Mon Jan 12 15:40:37 2009 +0100
 
     * update the waf script with the 1.5.2 version
 
- src/wscript_build |    1 +
- waf               |  Bin 76581 -> 75487 bytes
- 2 files changed, 1 insertions(+), 0 deletions(-)
+ src/wscript_build |   1 +
+ waf               | Bin 76581 -> 75487 bytes
+ 2 files changed, 1 insertion(+)
 
 commit 4050f4a2dbde9e999295dba6606d7653aa47988f
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -4606,17 +14367,17 @@ Date:   Sun Jan 11 23:49:21 2009 +0100
 
     * first waf build version
 
- CMakeLists.txt        |    7 --
- SConstruct            |  147 -------------------------------------------------
- src/CMakeLists.txt    |    5 --
- src/README-compil.txt |    6 --
- src/SConscript        |   40 -------------
- src/wscript_build     |    8 +++
- test/CMakeLists.txt   |    6 --
- test/SConscript       |   46 ---------------
- test/wscript_build    |   11 ++++
- waf                   |  Bin 0 -> 76581 bytes
- wscript               |   32 +++++++++++
+ CMakeLists.txt        |   7 ---
+ SConstruct            | 147 --------------------------------------------------
+ src/CMakeLists.txt    |   5 --
+ src/README-compil.txt |   6 ---
+ src/SConscript        |  40 --------------
+ src/wscript_build     |   8 +++
+ test/CMakeLists.txt   |   6 ---
+ test/SConscript       |  46 ----------------
+ test/wscript_build    |  11 ++++
+ waf                   | Bin 0 -> 76581 bytes
+ wscript               |  32 +++++++++++
  11 files changed, 51 insertions(+), 257 deletions(-)
 
 commit 7982ac2b32c3fee16655ec82fb111174fb4bdf47
@@ -4625,15 +14386,15 @@ Date:   Sun Jan 11 12:51:09 2009 +0100
 
     * rename hkl-pseudoaxis-common -> hkl-pseudoaxis-common-hkl
 
- include/hkl/hkl-pseudoaxis-common-hkl.h |   52 +++++++
- include/hkl/hkl-pseudoaxis-common.h     |   52 -------
- src/hkl-pseudoaxis-common-hkl.c         |  255 +++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis-common.c             |  255 -------------------------------
- src/hkl-pseudoaxis-e4cv-hkl.c           |    2 +-
- src/hkl-pseudoaxis-e6c-hkl.c            |    2 +-
- src/hkl-pseudoaxis-k4cv-eulerians.c     |    6 +-
- src/hkl-pseudoaxis-k4cv-hkl.c           |    2 +-
- src/hkl-pseudoaxis-k6c-hkl.c            |    2 +-
+ include/hkl/hkl-pseudoaxis-common-hkl.h |  52 +++++++
+ include/hkl/hkl-pseudoaxis-common.h     |  52 -------
+ src/hkl-pseudoaxis-common-hkl.c         | 255 ++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-common.c             | 255 --------------------------------
+ src/hkl-pseudoaxis-e4cv-hkl.c           |   2 +-
+ src/hkl-pseudoaxis-e6c-hkl.c            |   2 +-
+ src/hkl-pseudoaxis-k4cv-eulerians.c     |   6 +-
+ src/hkl-pseudoaxis-k4cv-hkl.c           |   2 +-
+ src/hkl-pseudoaxis-k6c-hkl.c            |   2 +-
  9 files changed, 314 insertions(+), 314 deletions(-)
 
 commit 94743046909a70c00e6ce7fc8746c3e5624871cf
@@ -4642,12 +14403,12 @@ Date:   Sun Jan 11 12:39:10 2009 +0100
 
     * refactor a part of the double_diffraction
 
- include/hkl/hkl-pseudoaxis-common.h |   26 ++----
- src/hkl-pseudoaxis-common.c         |  160 ++++++++++++++++++++++------------
- src/hkl-pseudoaxis-e4cv-hkl.c       |   13 +--
- src/hkl-pseudoaxis-e6c-hkl.c        |   15 +---
- src/hkl-pseudoaxis-k4cv-hkl.c       |   13 +--
- src/hkl-pseudoaxis-k6c-hkl.c        |   13 +--
+ include/hkl/hkl-pseudoaxis-common.h |  26 +++---
+ src/hkl-pseudoaxis-common.c         | 160 +++++++++++++++++++++++-------------
+ src/hkl-pseudoaxis-e4cv-hkl.c       |  13 +--
+ src/hkl-pseudoaxis-e6c-hkl.c        |  15 +---
+ src/hkl-pseudoaxis-k4cv-hkl.c       |  13 +--
+ src/hkl-pseudoaxis-k6c-hkl.c        |  13 +--
  6 files changed, 126 insertions(+), 114 deletions(-)
 
 commit 1da570b3127a08ec9a7c714ba25bb024fe4b14a0
@@ -4656,15 +14417,15 @@ Date:   Sun Jan 11 12:06:29 2009 +0100
 
     * add the double diffraction mode to all geoemtries
 
- VERSION                             |    2 +-
- include/hkl/hkl-pseudoaxis-common.h |   22 +++++++++++-
- include/hkl/hkl-vector.h            |    2 +
- src/hkl-pseudoaxis-common.c         |   63 +++++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis-e4cv-hkl.c       |   14 ++++++++
- src/hkl-pseudoaxis-e6c-hkl.c        |   14 ++++++++
- src/hkl-pseudoaxis-k4cv-hkl.c       |   14 ++++++++
- src/hkl-pseudoaxis-k6c-hkl.c        |   14 ++++++++
- src/hkl-vector.c                    |    7 ++++
+ VERSION                             |  2 +-
+ include/hkl/hkl-pseudoaxis-common.h | 22 +++++++++++--
+ include/hkl/hkl-vector.h            |  2 ++
+ src/hkl-pseudoaxis-common.c         | 63 +++++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-e4cv-hkl.c       | 14 +++++++++
+ src/hkl-pseudoaxis-e6c-hkl.c        | 14 +++++++++
+ src/hkl-pseudoaxis-k4cv-hkl.c       | 14 +++++++++
+ src/hkl-pseudoaxis-k6c-hkl.c        | 14 +++++++++
+ src/hkl-vector.c                    |  7 +++++
  9 files changed, 149 insertions(+), 3 deletions(-)
 
 commit 0f541101e104da19c1771c91a8933074d2522dc9
@@ -4673,33 +14434,33 @@ Date:   Sat Jan 10 10:59:28 2009 +0100
 
     * reduce the number of headers for the pseudoAxisengines
 
- include/hkl/hkl-pseudoaxis-e4cv-hkl.h       |   12 ------------
- include/hkl/hkl-pseudoaxis-e4cv-psi.h       |   12 ------------
- include/hkl/hkl-pseudoaxis-e4cv.h           |   13 +++++++++++++
- include/hkl/hkl-pseudoaxis-e6c-hkl.h        |   12 ------------
- include/hkl/hkl-pseudoaxis-e6c-psi.h        |   12 ------------
- include/hkl/hkl-pseudoaxis-e6c.h            |   13 +++++++++++++
- include/hkl/hkl-pseudoaxis-k4cv-eulerians.h |   12 ------------
- include/hkl/hkl-pseudoaxis-k4cv-hkl.h       |   12 ------------
- include/hkl/hkl-pseudoaxis-k4cv-psi.h       |   12 ------------
- include/hkl/hkl-pseudoaxis-k4cv.h           |   14 ++++++++++++++
- include/hkl/hkl-pseudoaxis-k6c-hkl.h        |   12 ------------
- include/hkl/hkl-pseudoaxis-k6c-psi.h        |   12 ------------
- include/hkl/hkl-pseudoaxis-k6c.h            |   13 +++++++++++++
- src/hkl-pseudoaxis-e4cv-hkl.c               |    2 +-
- src/hkl-pseudoaxis-e4cv-psi.c               |    2 +-
- src/hkl-pseudoaxis-e6c-hkl.c                |    2 +-
- src/hkl-pseudoaxis-e6c-psi.c                |    2 +-
- src/hkl-pseudoaxis-k4cv-eulerians.c         |    2 +-
- src/hkl-pseudoaxis-k4cv-hkl.c               |    2 +-
- src/hkl-pseudoaxis-k4cv-psi.c               |    2 +-
- src/hkl-pseudoaxis-k6c-hkl.c                |    2 +-
- src/hkl-pseudoaxis-k6c-psi.c                |    2 +-
- test/hkl-test-pseudoaxis-E4CV.c             |    3 +--
- test/hkl-test-pseudoaxis-E6C.c              |    2 +-
- test/hkl-test-pseudoaxis-K4CV.c             |    3 +--
- test/hkl-test-pseudoaxis-K6C.c              |    2 +-
- test/hkl-test-pseudoaxis.c                  |   13 ++++---------
+ include/hkl/hkl-pseudoaxis-e4cv-hkl.h       | 12 ------------
+ include/hkl/hkl-pseudoaxis-e4cv-psi.h       | 12 ------------
+ include/hkl/hkl-pseudoaxis-e4cv.h           | 13 +++++++++++++
+ include/hkl/hkl-pseudoaxis-e6c-hkl.h        | 12 ------------
+ include/hkl/hkl-pseudoaxis-e6c-psi.h        | 12 ------------
+ include/hkl/hkl-pseudoaxis-e6c.h            | 13 +++++++++++++
+ include/hkl/hkl-pseudoaxis-k4cv-eulerians.h | 12 ------------
+ include/hkl/hkl-pseudoaxis-k4cv-hkl.h       | 12 ------------
+ include/hkl/hkl-pseudoaxis-k4cv-psi.h       | 12 ------------
+ include/hkl/hkl-pseudoaxis-k4cv.h           | 14 ++++++++++++++
+ include/hkl/hkl-pseudoaxis-k6c-hkl.h        | 12 ------------
+ include/hkl/hkl-pseudoaxis-k6c-psi.h        | 12 ------------
+ include/hkl/hkl-pseudoaxis-k6c.h            | 13 +++++++++++++
+ src/hkl-pseudoaxis-e4cv-hkl.c               |  2 +-
+ src/hkl-pseudoaxis-e4cv-psi.c               |  2 +-
+ src/hkl-pseudoaxis-e6c-hkl.c                |  2 +-
+ src/hkl-pseudoaxis-e6c-psi.c                |  2 +-
+ src/hkl-pseudoaxis-k4cv-eulerians.c         |  2 +-
+ src/hkl-pseudoaxis-k4cv-hkl.c               |  2 +-
+ src/hkl-pseudoaxis-k4cv-psi.c               |  2 +-
+ src/hkl-pseudoaxis-k6c-hkl.c                |  2 +-
+ src/hkl-pseudoaxis-k6c-psi.c                |  2 +-
+ test/hkl-test-pseudoaxis-E4CV.c             |  3 +--
+ test/hkl-test-pseudoaxis-E6C.c              |  2 +-
+ test/hkl-test-pseudoaxis-K4CV.c             |  3 +--
+ test/hkl-test-pseudoaxis-K6C.c              |  2 +-
+ test/hkl-test-pseudoaxis.c                  | 13 ++++---------
  27 files changed, 70 insertions(+), 132 deletions(-)
 
 commit 4b55504dd4b564bdf1392eb430d8d9d972010379
@@ -4708,28 +14469,28 @@ Date:   Fri Jan 9 21:29:31 2009 +0100
 
     * function name consistency in the pseudo axes part
 
- include/hkl/hkl-pseudoaxis-auto.h     |    4 +-
- include/hkl/hkl-pseudoaxis-e6c-hkl.h  |    2 +-
- include/hkl/hkl-pseudoaxis-k4cv-hkl.h |    2 +-
- include/hkl/hkl-pseudoaxis-k6c-hkl.h  |    2 +-
- src/hkl-pseudoaxis-auto.c             |    6 +-
- src/hkl-pseudoaxis-common-psi.c       |    6 +-
- src/hkl-pseudoaxis-common.c           |    6 +-
- src/hkl-pseudoaxis-e4cv-hkl.c         |    8 ++--
- src/hkl-pseudoaxis-e4cv-psi.c         |    4 +-
- src/hkl-pseudoaxis-e6c-hkl.c          |   31 +++++++------
- src/hkl-pseudoaxis-e6c-psi.c          |    4 +-
- src/hkl-pseudoaxis-k4cv-eulerians.c   |   16 +++---
- src/hkl-pseudoaxis-k4cv-hkl.c         |   66 +++++++++-------------------
- src/hkl-pseudoaxis-k4cv-psi.c         |    4 +-
- src/hkl-pseudoaxis-k6c-hkl.c          |   76 ++++++++++++++++----------------
- src/hkl-pseudoaxis-k6c-psi.c          |    4 +-
- src/hkl-pseudoaxis.c                  |   40 +++++++++---------
- test/hkl-test-pseudoaxis-E4CV.c       |   68 +++++++++++++++---------------
- test/hkl-test-pseudoaxis-E6C.c        |   34 +++++++-------
- test/hkl-test-pseudoaxis-K4CV.c       |   28 ++++++------
- test/hkl-test-pseudoaxis-K6C.c        |   18 ++++----
- test/hkl-test-pseudoaxis.c            |   36 ++++++++--------
+ include/hkl/hkl-pseudoaxis-auto.h     |  4 +-
+ include/hkl/hkl-pseudoaxis-e6c-hkl.h  |  2 +-
+ include/hkl/hkl-pseudoaxis-k4cv-hkl.h |  2 +-
+ include/hkl/hkl-pseudoaxis-k6c-hkl.h  |  2 +-
+ src/hkl-pseudoaxis-auto.c             |  6 +--
+ src/hkl-pseudoaxis-common-psi.c       |  6 +--
+ src/hkl-pseudoaxis-common.c           |  6 +--
+ src/hkl-pseudoaxis-e4cv-hkl.c         |  8 ++--
+ src/hkl-pseudoaxis-e4cv-psi.c         |  4 +-
+ src/hkl-pseudoaxis-e6c-hkl.c          | 31 +++++++-------
+ src/hkl-pseudoaxis-e6c-psi.c          |  4 +-
+ src/hkl-pseudoaxis-k4cv-eulerians.c   | 16 ++++----
+ src/hkl-pseudoaxis-k4cv-hkl.c         | 66 ++++++++++--------------------
+ src/hkl-pseudoaxis-k4cv-psi.c         |  4 +-
+ src/hkl-pseudoaxis-k6c-hkl.c          | 76 +++++++++++++++++------------------
+ src/hkl-pseudoaxis-k6c-psi.c          |  4 +-
+ src/hkl-pseudoaxis.c                  | 40 +++++++++---------
+ test/hkl-test-pseudoaxis-E4CV.c       | 68 +++++++++++++++----------------
+ test/hkl-test-pseudoaxis-E6C.c        | 34 ++++++++--------
+ test/hkl-test-pseudoaxis-K4CV.c       | 28 ++++++-------
+ test/hkl-test-pseudoaxis-K6C.c        | 18 ++++-----
+ test/hkl-test-pseudoaxis.c            | 36 ++++++++---------
  22 files changed, 222 insertions(+), 243 deletions(-)
 
 commit a169da5f6c5bd130803af7e83d12b43a86b7c2ec
@@ -4738,8 +14499,8 @@ Date:   Mon Jan 5 09:35:10 2009 +0100
 
     * update the CMakeList.txt file
 
- CMakeLists.txt |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit 5250d22489a21d5f99d6ff674676b523cdd544e0
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -4747,8 +14508,8 @@ Date:   Fri Dec 5 14:48:42 2008 +0100
 
     * remove a bug in the psi pseudo axis method.
 
- src/hkl-pseudoaxis-common-psi.c |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
+ src/hkl-pseudoaxis-common-psi.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
 
 commit 4bef14134f62fe1e0280c6d88b440d3294e52c9d
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -4756,8 +14517,8 @@ Date:   Fri Dec 5 13:00:01 2008 +0100
 
     * add a kphi and phi constant mode.
 
- src/hkl-pseudoaxis-k6c-hkl.c |  179 ++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 179 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-k6c-hkl.c | 179 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 179 insertions(+)
 
 commit b0be5acd46bef5e682daca66b824e6b3b201419f
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -4765,8 +14526,8 @@ Date:   Wed Dec 3 14:08:32 2008 +0100
 
     * only add a solution to the pseudoAxes geometries if it is different.
 
- src/hkl-pseudoaxis.c |   38 ++++++++++++++++++++++++--------------
- 1 files changed, 24 insertions(+), 14 deletions(-)
+ src/hkl-pseudoaxis.c | 36 +++++++++++++++++++++++-------------
+ 1 file changed, 23 insertions(+), 13 deletions(-)
 
 commit 090fa9651fafe17630ff57045328e5e41e582c24
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -4774,11 +14535,11 @@ Date:   Wed Dec 3 13:46:29 2008 +0100
 
     * use and update the set_values_v geometry method.
 
- src/hkl-geometry.c              |    6 ++++--
- test/hkl-test-pseudoaxis-E4CV.c |   29 +++++++++--------------------
- test/hkl-test-pseudoaxis-E6C.c  |   33 ++++++++-------------------------
- test/hkl-test-pseudoaxis-K4CV.c |   25 +++++++------------------
- test/hkl-test-pseudoaxis-K6C.c  |   10 ++++++++++
+ src/hkl-geometry.c              |  6 ++++--
+ test/hkl-test-pseudoaxis-E4CV.c | 29 +++++++++--------------------
+ test/hkl-test-pseudoaxis-E6C.c  | 33 ++++++++-------------------------
+ test/hkl-test-pseudoaxis-K4CV.c | 25 +++++++------------------
+ test/hkl-test-pseudoaxis-K6C.c  | 10 ++++++++++
  5 files changed, 38 insertions(+), 65 deletions(-)
 
 commit 580d38baf59f0a2bb0c5a1d09fb0e28e4d583932
@@ -4787,9 +14548,9 @@ Date:   Tue Dec 2 13:55:02 2008 +0100
 
     * the set_values_v and distance method to the geometry.
 
- include/hkl/hkl-geometry.h |    6 +++-
- src/hkl-geometry.c         |   38 +++++++++++++++++++++++-
- test/hkl-test-geometry.c   |   71 ++++++++++++++++++++++++++++++++++++-------
+ include/hkl/hkl-geometry.h |  6 +++-
+ src/hkl-geometry.c         | 38 ++++++++++++++++++++++++-
+ test/hkl-test-geometry.c   | 71 ++++++++++++++++++++++++++++++++++++++--------
  3 files changed, 101 insertions(+), 14 deletions(-)
 
 commit 053359a203feaedf3bc85b2265f54158611c1d97
@@ -4798,8 +14559,8 @@ Date:   Tue Dec 2 10:56:20 2008 +0100
 
     * indent the geometry part
 
- include/hkl/hkl-geometry.h |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ include/hkl/hkl-geometry.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit e5651705af8f98436dbf7990bb7378fa5b21e843
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -4807,8 +14568,8 @@ Date:   Tue Dec 2 10:54:59 2008 +0100
 
     * ensure all sample operations.
 
- include/hkl/hkl-sample.h |    6 ++-
- src/hkl-sample.c         |  106 +++++++++++++++++++++++++++++++---------------
+ include/hkl/hkl-sample.h |   6 ++-
+ src/hkl-sample.c         | 106 ++++++++++++++++++++++++++++++++---------------
  2 files changed, 77 insertions(+), 35 deletions(-)
 
 commit 5fc495bf546eba65f1fe1b248386459ff5c7f201
@@ -4817,12 +14578,12 @@ Date:   Fri Jan 9 17:40:57 2009 +0100
 
     * work in progress
 
- include/hkl/hkl-pseudoaxis-auto.h     |    4 +-
- include/hkl/hkl-pseudoaxis-e4cv-hkl.h |    2 +-
- include/hkl/hkl-pseudoaxis-e6c-hkl.h  |    2 +-
- include/hkl/hkl-pseudoaxis-factory.h  |    6 ++--
- include/hkl/hkl-pseudoaxis.h          |   48 ++++++++++++++++----------------
- src/hkl-pseudoaxis-e4cv-hkl.c         |   12 ++++----
+ include/hkl/hkl-pseudoaxis-auto.h     |  4 +--
+ include/hkl/hkl-pseudoaxis-e4cv-hkl.h |  2 +-
+ include/hkl/hkl-pseudoaxis-e6c-hkl.h  |  2 +-
+ include/hkl/hkl-pseudoaxis-factory.h  |  6 ++---
+ include/hkl/hkl-pseudoaxis.h          | 48 +++++++++++++++++------------------
+ src/hkl-pseudoaxis-e4cv-hkl.c         | 12 ++++-----
  6 files changed, 37 insertions(+), 37 deletions(-)
 
 commit 0f5cb6efc3fa97635a6078604902dcfe51e4e01a
@@ -4831,11 +14592,11 @@ Date:   Fri Nov 28 17:47:26 2008 +0100
 
     * first version of the eulerians pseudo axes.
 
- include/hkl/hkl-pseudoaxis-k4cv-eulerians.h |   12 +++
- src/hkl-pseudoaxis-k4cv-eulerians.c         |  120 +++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis-K4CV.c             |   61 +++++++++++++-
- test/hkl-test-pseudoaxis.c                  |    8 ++
- 4 files changed, 200 insertions(+), 1 deletions(-)
+ include/hkl/hkl-pseudoaxis-k4cv-eulerians.h |  12 +++
+ src/hkl-pseudoaxis-k4cv-eulerians.c         | 120 ++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis-K4CV.c             |  61 +++++++++++++-
+ test/hkl-test-pseudoaxis.c                  |   8 ++
+ 4 files changed, 200 insertions(+), 1 deletion(-)
 
 commit dc67f5082dd51be73f17a1d91edecbe6efe1116d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4843,8 +14604,8 @@ Date:   Wed Nov 26 15:10:33 2008 +0100
 
     * remove non necessary method in the k4cv hkl pseudo axis.
 
- include/hkl/hkl-pseudoaxis-k4cv-hkl.h |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
+ include/hkl/hkl-pseudoaxis-k4cv-hkl.h | 1 -
+ 1 file changed, 1 deletion(-)
 
 commit 0c3a5f5aa293da1aa06784de33394a99e419f4c6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4852,8 +14613,8 @@ Date:   Wed Nov 26 14:28:23 2008 +0100
 
     * update the psi pseudo axis engine test
 
- test/hkl-test-pseudoaxis-E4CV.c |   43 ++++++++++++++++++++------------------
- 1 files changed, 23 insertions(+), 20 deletions(-)
+ test/hkl-test-pseudoaxis-E4CV.c | 43 ++++++++++++++++++++++-------------------
+ 1 file changed, 23 insertions(+), 20 deletions(-)
 
 commit ea1a653ae3d860b8304afd10bb4fb29775c10d0b
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4861,12 +14622,12 @@ Date:   Wed Nov 26 11:08:47 2008 +0100
 
     * refactor the psi pseudo axes engine.
 
- include/hkl/hkl-pseudoaxis-common-psi.h |   17 +-------
- src/hkl-pseudoaxis-common-psi.c         |   65 +++++++++++++++++++++++++------
- src/hkl-pseudoaxis-e4cv-psi.c           |   42 +-------------------
- src/hkl-pseudoaxis-e6c-psi.c            |   42 +-------------------
- src/hkl-pseudoaxis-k4cv-psi.c           |   42 +-------------------
- src/hkl-pseudoaxis-k6c-psi.c            |   42 +-------------------
+ include/hkl/hkl-pseudoaxis-common-psi.h | 17 ++-------
+ src/hkl-pseudoaxis-common-psi.c         | 65 +++++++++++++++++++++++++++------
+ src/hkl-pseudoaxis-e4cv-psi.c           | 42 +--------------------
+ src/hkl-pseudoaxis-e6c-psi.c            | 42 +--------------------
+ src/hkl-pseudoaxis-k4cv-psi.c           | 42 +--------------------
+ src/hkl-pseudoaxis-k6c-psi.c            | 42 +--------------------
  6 files changed, 64 insertions(+), 186 deletions(-)
 
 commit 3ae4d7033610db98f3807116ec23e69e69aa217b
@@ -4875,8 +14636,8 @@ Date:   Tue Nov 25 17:07:23 2008 +0100
 
     * rename the "psi e4cv" -> "psi vertical" pseudo axis engine
 
- src/hkl-pseudoaxis-e6c-psi.c |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
+ src/hkl-pseudoaxis-e6c-psi.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
 
 commit ffc9a49669e0435f9df6a7889aad8d7f4230005c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4884,10 +14645,10 @@ Date:   Tue Nov 25 17:01:37 2008 +0100
 
     * add to k6c the "psi vertical" pseudo axis engine
 
- include/hkl/hkl-pseudoaxis-k6c-psi.h |   12 ++++++
- src/hkl-pseudoaxis-k6c-psi.c         |   66 ++++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis.c           |    8 ++++
- 3 files changed, 86 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-k6c-psi.h | 12 +++++++
+ src/hkl-pseudoaxis-k6c-psi.c         | 66 ++++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis.c           |  8 +++++
+ 3 files changed, 86 insertions(+)
 
 commit 9e9d69b2b4dce5504f7ef9f355836e840d8f6bab
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4895,11 +14656,11 @@ Date:   Tue Nov 25 16:52:49 2008 +0100
 
     * add to e6c the "psi e4cv" pseudo axis engine
 
- include/hkl/hkl-pseudoaxis-e6c-psi.h |   12 ++++++
- src/SConscript                       |    1 +
- src/hkl-pseudoaxis-e6c-psi.c         |   66 ++++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis.c           |   10 +++++-
- 4 files changed, 88 insertions(+), 1 deletions(-)
+ include/hkl/hkl-pseudoaxis-e6c-psi.h | 12 +++++++
+ src/SConscript                       |  1 +
+ src/hkl-pseudoaxis-e6c-psi.c         | 66 ++++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis.c           | 10 +++++-
+ 4 files changed, 88 insertions(+), 1 deletion(-)
 
 commit ab3b1fd02340070d945442bd9b175c0f9185ec0e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4907,13 +14668,13 @@ Date:   Tue Nov 25 16:37:14 2008 +0100
 
     * now add the K4C psi pseudo axis engine
 
- include/hkl/hkl-pseudoaxis-common-psi.h |   38 ++++++
- include/hkl/hkl-pseudoaxis-k4cv-psi.h   |   12 ++
- src/SConscript                          |    2 +
- src/hkl-pseudoaxis-common-psi.c         |  201 ++++++++++++++++++++++++++++
- src/hkl-pseudoaxis-e4cv-psi.c           |  216 +------------------------------
- src/hkl-pseudoaxis-k4cv-psi.c           |   66 ++++++++++
- test/hkl-test-pseudoaxis.c              |   10 ++-
+ include/hkl/hkl-pseudoaxis-common-psi.h |  38 ++++++
+ include/hkl/hkl-pseudoaxis-k4cv-psi.h   |  12 ++
+ src/SConscript                          |   2 +
+ src/hkl-pseudoaxis-common-psi.c         | 201 +++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-e4cv-psi.c           | 216 +-------------------------------
+ src/hkl-pseudoaxis-k4cv-psi.c           |  66 ++++++++++
+ test/hkl-test-pseudoaxis.c              |  10 +-
  7 files changed, 334 insertions(+), 211 deletions(-)
 
 commit e623473a01cdfd0e98b13cf3e3ecf02429d7ccd8
@@ -4922,30 +14683,30 @@ Date:   Tue Nov 25 15:57:21 2008 +0100
 
     * refactor the file names.
 
- include/hkl/hkl-pseudoaxis-E4CV.h     |   13 -
- include/hkl/hkl-pseudoaxis-E6C.h      |   12 -
- include/hkl/hkl-pseudoaxis-K4CV.h     |   13 -
- include/hkl/hkl-pseudoaxis-K6C.h      |   12 -
- include/hkl/hkl-pseudoaxis-e4cv-hkl.h |   12 +
- include/hkl/hkl-pseudoaxis-e4cv-psi.h |   12 +
- include/hkl/hkl-pseudoaxis-e6c-hkl.h  |   12 +
- include/hkl/hkl-pseudoaxis-k4cv-hkl.h |   13 +
- include/hkl/hkl-pseudoaxis-k6c-hkl.h  |   12 +
- src/SConscript                        |    9 +-
- src/hkl-pseudoaxis-E4CV.c             |  363 ---------------------------
- src/hkl-pseudoaxis-E6C.c              |  149 -----------
- src/hkl-pseudoaxis-K4CV.c             |  371 ---------------------------
- src/hkl-pseudoaxis-K6C.c              |  441 ---------------------------------
- src/hkl-pseudoaxis-e4cv-hkl.c         |   94 +++++++
- src/hkl-pseudoaxis-e4cv-psi.c         |  270 ++++++++++++++++++++
- src/hkl-pseudoaxis-e6c-hkl.c          |  149 +++++++++++
- src/hkl-pseudoaxis-k4cv-hkl.c         |  371 +++++++++++++++++++++++++++
- src/hkl-pseudoaxis-k6c-hkl.c          |  441 +++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis-E4CV.c       |    7 +-
- test/hkl-test-pseudoaxis-E6C.c        |    2 +-
- test/hkl-test-pseudoaxis-K4CV.c       |    2 +-
- test/hkl-test-pseudoaxis-K6C.c        |    2 +-
- test/hkl-test-pseudoaxis.c            |   11 +-
+ include/hkl/hkl-pseudoaxis-E4CV.h     |  13 -
+ include/hkl/hkl-pseudoaxis-E6C.h      |  12 -
+ include/hkl/hkl-pseudoaxis-K4CV.h     |  13 -
+ include/hkl/hkl-pseudoaxis-K6C.h      |  12 -
+ include/hkl/hkl-pseudoaxis-e4cv-hkl.h |  12 +
+ include/hkl/hkl-pseudoaxis-e4cv-psi.h |  12 +
+ include/hkl/hkl-pseudoaxis-e6c-hkl.h  |  12 +
+ include/hkl/hkl-pseudoaxis-k4cv-hkl.h |  13 +
+ include/hkl/hkl-pseudoaxis-k6c-hkl.h  |  12 +
+ src/SConscript                        |   9 +-
+ src/hkl-pseudoaxis-E4CV.c             | 363 ----------------------------
+ src/hkl-pseudoaxis-E6C.c              | 149 ------------
+ src/hkl-pseudoaxis-K4CV.c             | 371 ----------------------------
+ src/hkl-pseudoaxis-K6C.c              | 441 ----------------------------------
+ src/hkl-pseudoaxis-e4cv-hkl.c         |  94 ++++++++
+ src/hkl-pseudoaxis-e4cv-psi.c         | 270 +++++++++++++++++++++
+ src/hkl-pseudoaxis-e6c-hkl.c          | 149 ++++++++++++
+ src/hkl-pseudoaxis-k4cv-hkl.c         | 371 ++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis-k6c-hkl.c          | 441 ++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis-E4CV.c       |   7 +-
+ test/hkl-test-pseudoaxis-E6C.c        |   2 +-
+ test/hkl-test-pseudoaxis-K4CV.c       |   2 +-
+ test/hkl-test-pseudoaxis-K6C.c        |   2 +-
+ test/hkl-test-pseudoaxis.c            |  11 +-
  24 files changed, 1404 insertions(+), 1389 deletions(-)
 
 commit 89c7a9f58fa2e1930bee9dc37da1bc0a27a8f165
@@ -4954,8 +14715,8 @@ Date:   Tue Nov 25 13:44:21 2008 +0100
 
     * typo
 
- src/hkl-pseudoaxis-E4CV.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ src/hkl-pseudoaxis-E4CV.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 95a8a33ee43195a700adc23df91b9d61077fade3
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4963,8 +14724,8 @@ Date:   Mon Nov 24 17:08:38 2008 +0100
 
     * now psi seems to work correctly
 
- src/hkl-pseudoaxis-E4CV.c |  111 ++++++++++++++++++++++++---------------------
- 1 files changed, 60 insertions(+), 51 deletions(-)
+ src/hkl-pseudoaxis-E4CV.c | 111 +++++++++++++++++++++++++---------------------
+ 1 file changed, 60 insertions(+), 51 deletions(-)
 
 commit 76279d34ee16edbdd9c2cc33809caa9e3a759e26
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -4972,8 +14733,8 @@ Date:   Mon Nov 24 16:15:48 2008 +0100
 
     * better psi initialization and getter
 
- src/hkl-pseudoaxis-E4CV.c |   59 ++++++++++++++++++++++++++-------------------
- 1 files changed, 34 insertions(+), 25 deletions(-)
+ src/hkl-pseudoaxis-E4CV.c | 59 +++++++++++++++++++++++++++--------------------
+ 1 file changed, 34 insertions(+), 25 deletions(-)
 
 commit ca174ba55becfc8e1da160a3f17da1ceae67037f
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -4981,9 +14742,9 @@ Date:   Sat Nov 22 22:18:07 2008 +0100
 
     * set the random test for the psi pseudoaxe
 
- src/hkl-pseudoaxis-E4CV.c  |   11 +++++++++++
- test/hkl-test-pseudoaxis.c |   20 +++++++++++++++-----
- test/main.c                |    2 +-
+ src/hkl-pseudoaxis-E4CV.c  | 11 +++++++++++
+ test/hkl-test-pseudoaxis.c | 20 +++++++++++++++-----
+ test/main.c                |  2 +-
  3 files changed, 27 insertions(+), 6 deletions(-)
 
 commit 81b2dac096a76f27a999db1b935fa03f6958a7b3
@@ -4992,13 +14753,13 @@ Date:   Sat Nov 22 17:56:21 2008 +0100
 
     * first version of psi for e4c
 
- include/hkl/hkl-pseudoaxis-E4CV.h |    1 +
- include/hkl/hkl-pseudoaxis.h      |   17 ++-
- src/hkl-pseudoaxis-E4CV.c         |  254 +++++++++++++++++++++++++++++++++++--
- src/hkl-pseudoaxis-common.c       |   28 ++++
- src/hkl-pseudoaxis.c              |   71 ++++++++++-
- test/hkl-test-pseudoaxis-E4CV.c   |  144 ++++++++++++++++++++-
- test/main.c                       |    2 +-
+ include/hkl/hkl-pseudoaxis-E4CV.h |   1 +
+ include/hkl/hkl-pseudoaxis.h      |  17 ++-
+ src/hkl-pseudoaxis-E4CV.c         | 254 ++++++++++++++++++++++++++++++++++++--
+ src/hkl-pseudoaxis-common.c       |  28 +++++
+ src/hkl-pseudoaxis.c              |  71 ++++++++++-
+ test/hkl-test-pseudoaxis-E4CV.c   | 144 ++++++++++++++++++++-
+ test/main.c                       |   2 +-
  7 files changed, 495 insertions(+), 22 deletions(-)
 
 commit c9923fb4aa08dcffe176aefa15562cc362c2ef72
@@ -5007,11 +14768,11 @@ Date:   Sat Nov 22 17:07:00 2008 +0100
 
     * add the vector oriented_angle method
 
- TODO                     |    1 +
- include/hkl/hkl-vector.h |    4 ++++
- src/hkl-vector.c         |   19 +++++++++++++++++++
- test/hkl-test-vector.c   |   25 +++++++++++++++++++++++++
- 4 files changed, 49 insertions(+), 0 deletions(-)
+ TODO                     |  1 +
+ include/hkl/hkl-vector.h |  4 ++++
+ src/hkl-vector.c         | 19 +++++++++++++++++++
+ test/hkl-test-vector.c   | 25 +++++++++++++++++++++++++
+ 4 files changed, 49 insertions(+)
 
 commit 3f6a8af31129497083122584edce11e13aa168d0
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -5019,10 +14780,10 @@ Date:   Sat Nov 22 16:04:41 2008 +0100
 
     * add the vector project_on_plan method
 
- include/hkl/hkl-vector.h |    3 +++
- src/hkl-vector.c         |   11 +++++++++++
- test/hkl-test-vector.c   |   15 +++++++++++++++
- 3 files changed, 29 insertions(+), 0 deletions(-)
+ include/hkl/hkl-vector.h |  3 +++
+ src/hkl-vector.c         | 11 +++++++++++
+ test/hkl-test-vector.c   | 15 +++++++++++++++
+ 3 files changed, 29 insertions(+)
 
 commit ff394f5cd27e87836a2b4e7d27d4e4b11693165b
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -5030,8 +14791,8 @@ Date:   Sat Nov 22 15:32:16 2008 +0100
 
     * update the TODO list
 
- TODO |    5 +++++
- 1 files changed, 5 insertions(+), 0 deletions(-)
+ TODO | 5 +++++
+ 1 file changed, 5 insertions(+)
 
 commit 5c668bb12ad5e5743d9751b2c6f8b1d0a4decb0a
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -5039,8 +14800,8 @@ Date:   Sat Nov 22 15:31:35 2008 +0100
 
     * update the vector angle test
 
- test/hkl-test-vector.c |    8 ++++++++
- 1 files changed, 8 insertions(+), 0 deletions(-)
+ test/hkl-test-vector.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
 
 commit 2933142c18370fcd45d6e8416725a904b75648b4
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5048,8 +14809,8 @@ Date:   Tue Nov 4 11:49:42 2008 +0100
 
     * update the TODO  liste
 
- TODO |   11 +++++------
- 1 files changed, 5 insertions(+), 6 deletions(-)
+ TODO | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
 
 commit c7774f9e8507707f528de8ef21cbdfc5fa607da6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5057,12 +14818,12 @@ Date:   Tue Nov 4 11:49:32 2008 +0100
 
     * add the init infracstructure for the pseudoAxes engines.
 
- include/hkl/hkl-pseudoaxis.h |   10 ++++++++++
- src/hkl-pseudoaxis-E4CV.c    |    4 ++++
- src/hkl-pseudoaxis-E6C.c     |    6 ++++++
- src/hkl-pseudoaxis-K4CV.c    |    4 ++++
- src/hkl-pseudoaxis-K6C.c     |    6 ++++++
- src/hkl-pseudoaxis.c         |   29 +++++++++++++++++++++++++++--
+ include/hkl/hkl-pseudoaxis.h | 10 ++++++++++
+ src/hkl-pseudoaxis-E4CV.c    |  4 ++++
+ src/hkl-pseudoaxis-E6C.c     |  6 ++++++
+ src/hkl-pseudoaxis-K4CV.c    |  4 ++++
+ src/hkl-pseudoaxis-K6C.c     |  6 ++++++
+ src/hkl-pseudoaxis.c         | 29 +++++++++++++++++++++++++++--
  6 files changed, 57 insertions(+), 2 deletions(-)
 
 commit 41de52319b0f0e2ed59069225778a0b8b4b4ac71
@@ -5071,8 +14832,8 @@ Date:   Tue Nov 4 11:02:40 2008 +0100
 
     * update the TODO liste
 
- TODO |   10 +++++-----
- 1 files changed, 5 insertions(+), 5 deletions(-)
+ TODO | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
 
 commit c42474726338390342a17373e95bb31e9a4595d5
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5080,8 +14841,8 @@ Date:   Tue Nov 4 09:40:44 2008 +0100
 
     * remove the fprintf from the degenerated tests.
 
- test/hkl-test-pseudoaxis-E4CV.c |    2 +-
- test/hkl-test-pseudoaxis-K6C.c  |    3 ++-
+ test/hkl-test-pseudoaxis-E4CV.c | 2 +-
+ test/hkl-test-pseudoaxis-K6C.c  | 3 ++-
  2 files changed, 3 insertions(+), 2 deletions(-)
 
 commit 3249774a4b8da0a693454a35688d20ba9ad9fead
@@ -5090,8 +14851,8 @@ Date:   Tue Nov 4 09:38:25 2008 +0100
 
     * add a degenerated case for the E6CV pseudoAxes.
 
- test/hkl-test-pseudoaxis-E6C.c |   59 ++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 59 insertions(+), 0 deletions(-)
+ test/hkl-test-pseudoaxis-E6C.c | 59 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 59 insertions(+)
 
 commit 1a600718805e7e8805179a93b9f18f7d3c60ac02
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5099,8 +14860,8 @@ Date:   Tue Nov 4 09:28:12 2008 +0100
 
     * add a degenerated case for the E4CV geometry.
 
- test/hkl-test-pseudoaxis-E4CV.c |   59 +++++++++++++++++++++++++++++++++++++++
- 1 files changed, 59 insertions(+), 0 deletions(-)
+ test/hkl-test-pseudoaxis-E4CV.c | 59 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 59 insertions(+)
 
 commit 82a46e0502cd3df01fc35f93518b6af157ac8217
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5108,8 +14869,8 @@ Date:   Mon Nov 3 18:36:49 2008 +0100
 
     * now degenerated axes are not used during the permutations.
 
- src/hkl-pseudoaxis-auto.c |   48 ++++++++++++++++++++++++++++++---------------
- 1 files changed, 32 insertions(+), 16 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 48 +++++++++++++++++++++++++++++++----------------
+ 1 file changed, 32 insertions(+), 16 deletions(-)
 
 commit 71f9c9ef8e0b262a64b6bbfc8c37ba3c9727eb2a
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -5117,8 +14878,8 @@ Date:   Sat Oct 25 16:01:23 2008 +0200
 
     * the vector part
 
- include/hkl/hkl-vector.h |   58 +++++++++++-------
- src/hkl-vector.c         |  147 ++++++++++++++++++++++++----------------------
+ include/hkl/hkl-vector.h |  58 ++++++++++++-------
+ src/hkl-vector.c         | 147 ++++++++++++++++++++++++-----------------------
  2 files changed, 112 insertions(+), 93 deletions(-)
 
 commit e6c89b340c7b4b9d4c99c29d54c8b8847efcc47b
@@ -5127,8 +14888,8 @@ Date:   Sat Oct 25 15:38:27 2008 +0200
 
     * the source part was reindent
 
- include/hkl/hkl-source.h |    2 +-
- src/hkl-source.c         |   16 +++++-----------
+ include/hkl/hkl-source.h |  2 +-
+ src/hkl-source.c         | 16 +++++-----------
  2 files changed, 6 insertions(+), 12 deletions(-)
 
 commit f604d42204b03cac6403892f0539c63aa85255e9
@@ -5137,8 +14898,8 @@ Date:   Fri Oct 24 18:26:53 2008 +0200
 
     * the sample part
 
- include/hkl/hkl-sample.h |   23 +++++-----
- src/hkl-sample.c         |  101 +++++++++++++++++++++++-----------------------
+ include/hkl/hkl-sample.h |  23 +++++------
+ src/hkl-sample.c         | 101 +++++++++++++++++++++++------------------------
  2 files changed, 62 insertions(+), 62 deletions(-)
 
 commit 83f7801416989188ea3f5dc18eeef4ac6b5da85d
@@ -5147,8 +14908,8 @@ Date:   Fri Oct 24 18:17:55 2008 +0200
 
     * now the quaternion part
 
- include/hkl/hkl-quaternion.h |   45 ++++++++++++-----------
- src/hkl-quaternion.c         |   81 +++++++++++++++++++++--------------------
+ include/hkl/hkl-quaternion.h | 45 ++++++++++++------------
+ src/hkl-quaternion.c         | 81 ++++++++++++++++++++++----------------------
  2 files changed, 65 insertions(+), 61 deletions(-)
 
 commit 4bb227fea5784d8e8fef77425beaaa057664e2ba
@@ -5157,8 +14918,8 @@ Date:   Fri Oct 24 18:14:27 2008 +0200
 
     * now the pseudoAxes and add an Init method
 
- include/hkl/hkl-pseudoaxis.h |   45 +++++++++++++++++++++++++++--------------
- src/hkl-pseudoaxis.c         |   12 +++++-----
+ include/hkl/hkl-pseudoaxis.h | 45 ++++++++++++++++++++++++++++----------------
+ src/hkl-pseudoaxis.c         | 12 ++++++------
  2 files changed, 35 insertions(+), 22 deletions(-)
 
 commit fa40963ce2ad341dfe3fbc422eb59f631009434f
@@ -5167,8 +14928,8 @@ Date:   Fri Oct 24 18:04:30 2008 +0200
 
     * all remaining pseudoaxes classes.
 
- src/hkl-pseudoaxis-E4CV.c |   47 +++++++++++-----------
- src/hkl-pseudoaxis-K6C.c  |   95 +++++++++++++++++++++++---------------------
+ src/hkl-pseudoaxis-E4CV.c | 47 +++++++++++------------
+ src/hkl-pseudoaxis-K6C.c  | 95 +++++++++++++++++++++++++----------------------
  2 files changed, 74 insertions(+), 68 deletions(-)
 
 commit e6b2f939adbd06276f860aba94020756246769a2
@@ -5177,8 +14938,8 @@ Date:   Fri Oct 24 18:02:36 2008 +0200
 
     * now the K4C part
 
- src/hkl-pseudoaxis-K4CV.c |  106 +++++++++++++++++++++++---------------------
- 1 files changed, 55 insertions(+), 51 deletions(-)
+ src/hkl-pseudoaxis-K4CV.c | 106 ++++++++++++++++++++++++----------------------
+ 1 file changed, 55 insertions(+), 51 deletions(-)
 
 commit da19220525f23e72552a9baf0538f14a6336d411
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5186,8 +14947,8 @@ Date:   Fri Oct 24 18:00:21 2008 +0200
 
     * update the E6C pseudoAxes part.
 
- src/hkl-pseudoaxis-E6C.c |   72 +++++++++++++++++++++++-----------------------
- 1 files changed, 36 insertions(+), 36 deletions(-)
+ src/hkl-pseudoaxis-E6C.c | 72 ++++++++++++++++++++++++------------------------
+ 1 file changed, 36 insertions(+), 36 deletions(-)
 
 commit acb77019e986ef29bce3d909f01b236c95b4cd1e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5195,8 +14956,8 @@ Date:   Fri Oct 24 17:58:08 2008 +0200
 
     * now the common part
 
- include/hkl/hkl-pseudoaxis-common.h |   10 ++++++----
- src/hkl-pseudoaxis-common.c         |   21 +++++++++++----------
+ include/hkl/hkl-pseudoaxis-common.h | 10 ++++++----
+ src/hkl-pseudoaxis-common.c         | 21 +++++++++++----------
  2 files changed, 17 insertions(+), 14 deletions(-)
 
 commit e2d69bce0993e22edb7f854154b0f9667deb7f0d
@@ -5205,8 +14966,8 @@ Date:   Fri Oct 24 17:55:47 2008 +0200
 
     * update the pseudoAxis auto part.
 
- include/hkl/hkl-pseudoaxis-auto.h |    2 +-
- src/hkl-pseudoaxis-auto.c         |   62 ++++++++++++++++++------------------
+ include/hkl/hkl-pseudoaxis-auto.h |  2 +-
+ src/hkl-pseudoaxis-auto.c         | 62 +++++++++++++++++++--------------------
  2 files changed, 32 insertions(+), 32 deletions(-)
 
 commit ab5be360f38bb68757b2e6a1a98abb3fa44e96ca
@@ -5215,8 +14976,8 @@ Date:   Fri Oct 24 17:52:56 2008 +0200
 
     * update HklParameter class.
 
- include/hkl/hkl-parameter.h |   13 +++++----
- src/hkl-parameter.c         |   54 ++++++++++++++++++++++--------------------
+ include/hkl/hkl-parameter.h | 13 ++++++-----
+ src/hkl-parameter.c         | 54 +++++++++++++++++++++++----------------------
  2 files changed, 35 insertions(+), 32 deletions(-)
 
 commit 4507c791459bc95901ebeb5cd7fce6fd13f310f1
@@ -5225,8 +14986,8 @@ Date:   Fri Oct 24 17:47:24 2008 +0200
 
     * update the HklMatrix class
 
- include/hkl/hkl-matrix.h |   38 ++++++++++++------------
- src/hkl-matrix.c         |   74 +++++++++++++++++++++++-----------------------
+ include/hkl/hkl-matrix.h | 38 ++++++++++++-------------
+ src/hkl-matrix.c         | 74 ++++++++++++++++++++++++------------------------
  2 files changed, 56 insertions(+), 56 deletions(-)
 
 commit d572e585c6920fde5da31f2fc5d915b2e7b4c092
@@ -5235,9 +14996,9 @@ Date:   Fri Oct 24 17:36:55 2008 +0200
 
     * update the list class
 
- include/hkl/hkl-list.h |   18 ++++----
- src/hkl-list.c         |   96 ++++++++++++++++++++++++------------------------
- test/hkl-test-list.c   |   20 +++++-----
+ include/hkl/hkl-list.h | 18 +++++-----
+ src/hkl-list.c         | 96 +++++++++++++++++++++++++-------------------------
+ test/hkl-test-list.c   | 20 +++++------
  3 files changed, 67 insertions(+), 67 deletions(-)
 
 commit c5c4ef2ae2348a9887af6ea6651d784c8fb1a958
@@ -5246,8 +15007,8 @@ Date:   Fri Oct 24 17:24:15 2008 +0200
 
     * update the lattice class
 
- include/hkl/hkl-lattice.h |   17 ++-
- src/hkl-lattice.c         |  313 +++++++++++++++++++++++----------------------
+ include/hkl/hkl-lattice.h |  17 +--
+ src/hkl-lattice.c         | 313 +++++++++++++++++++++++-----------------------
  2 files changed, 168 insertions(+), 162 deletions(-)
 
 commit ee47835c8ba94ddab171e5e60f870510ec6c5f5a
@@ -5256,9 +15017,9 @@ Date:   Fri Oct 24 17:13:55 2008 +0200
 
     * indentation
 
- src/hkl-axis.c     |    4 ++--
- src/hkl-detector.c |    2 +-
- src/hkl-geometry.c |    4 ++--
+ src/hkl-axis.c     | 4 ++--
+ src/hkl-detector.c | 2 +-
+ src/hkl-geometry.c | 4 ++--
  3 files changed, 5 insertions(+), 5 deletions(-)
 
 commit de802720ed6cbb3a5ea3f5465b780b02a4017090
@@ -5267,8 +15028,8 @@ Date:   Fri Oct 24 17:13:43 2008 +0200
 
     * update the interval class
 
- include/hkl/hkl-interval.h |   30 ++--
- src/hkl-interval.c         |  547 ++++++++++++++++++++++----------------------
+ include/hkl/hkl-interval.h |  30 +--
+ src/hkl-interval.c         | 547 ++++++++++++++++++++++-----------------------
  2 files changed, 288 insertions(+), 289 deletions(-)
 
 commit 6bbd6810c790c40559252cf94979059e971ce220
@@ -5277,9 +15038,9 @@ Date:   Fri Oct 24 16:29:47 2008 +0200
 
     * just typo and indentation
 
- src/hkl-axis.c                 |    1 -
- src/hkl-pseudoaxis.c           |   39 ++++++++++++++++++++-------------------
- test/hkl-test-pseudoaxis-K6C.c |    2 +-
+ src/hkl-axis.c                 |  1 -
+ src/hkl-pseudoaxis.c           | 39 ++++++++++++++++++++-------------------
+ test/hkl-test-pseudoaxis-K6C.c |  2 +-
  3 files changed, 21 insertions(+), 21 deletions(-)
 
 commit 4d9fcb2f23b4aaed651596b19790ac082c617f50
@@ -5288,8 +15049,8 @@ Date:   Thu Oct 23 18:28:42 2008 +0200
 
     * separate test printout for each geometry.
 
- test/hkl-test-pseudoaxis.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ test/hkl-test-pseudoaxis.c | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit a2932b156ffbcad4bc55a4a1fcf4e59488901341
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5297,10 +15058,10 @@ Date:   Thu Oct 23 18:27:51 2008 +0200
 
     * add all the default range for the hkl pseudoAxes.
 
- src/hkl-pseudoaxis-E4CV.c |    7 +++++++
- src/hkl-pseudoaxis-E6C.c  |    7 +++++++
- src/hkl-pseudoaxis-K4CV.c |    7 +++++++
- 3 files changed, 21 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-E4CV.c | 7 +++++++
+ src/hkl-pseudoaxis-E6C.c  | 7 +++++++
+ src/hkl-pseudoaxis-K4CV.c | 7 +++++++
+ 3 files changed, 21 insertions(+)
 
 commit 59f65ba2a7ff730cb7b9d931bb7aa2576010ca88
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5308,8 +15069,8 @@ Date:   Thu Oct 23 17:44:39 2008 +0200
 
     * do the random tests on only 100 iterations.
 
- test/hkl-test-pseudoaxis.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ test/hkl-test-pseudoaxis.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 228bbaf89de83530b81b16d026498c1139cd9c58
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5317,8 +15078,8 @@ Date:   Thu Oct 23 16:59:08 2008 +0200
 
     * put a default range for the K6C_HKL pseudo axis.
 
- src/hkl-pseudoaxis-K6C.c |    7 +++++++
- 1 files changed, 7 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-K6C.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
 
 commit 3723a3fcf3a321708080daeb5680e4ba0cd22bd9
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5328,8 +15089,8 @@ Date:   Thu Oct 23 16:49:23 2008 +0200
     
     use the fprintf method in the hkl_pseudoAxisEngine_fprintf
 
- include/hkl/hkl-pseudoaxis.h |   11 ++++++++++-
- src/hkl-pseudoaxis.c         |   38 +++++++++++++++++++++++++++++++-------
+ include/hkl/hkl-pseudoaxis.h | 11 ++++++++++-
+ src/hkl-pseudoaxis.c         | 38 +++++++++++++++++++++++++++++++-------
  2 files changed, 41 insertions(+), 8 deletions(-)
 
 commit b7ea0130392db7796d07be4e16c25e9c4dbfdf19
@@ -5338,9 +15099,9 @@ Date:   Thu Oct 23 16:45:14 2008 +0200
 
     * add the hkl_parameter_fprintf method
 
- include/hkl/hkl-parameter.h |    3 +++
- src/hkl-parameter.c         |    9 +++++++++
- 2 files changed, 12 insertions(+), 0 deletions(-)
+ include/hkl/hkl-parameter.h | 3 +++
+ src/hkl-parameter.c         | 9 +++++++++
+ 2 files changed, 12 insertions(+)
 
 commit c733540c9f817cd8e73ab38c299c151a367ac278
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5348,8 +15109,8 @@ Date:   Thu Oct 23 16:44:39 2008 +0200
 
     * add the hkl_axis_config_fprintf method
 
- include/hkl/hkl-axis.h |    6 ++++--
- src/hkl-axis.c         |    6 ++++++
+ include/hkl/hkl-axis.h | 6 ++++--
+ src/hkl-axis.c         | 6 ++++++
  2 files changed, 10 insertions(+), 2 deletions(-)
 
 commit 58da4becd54354dbe0832a181fbc647931a336e8
@@ -5358,8 +15119,8 @@ Date:   Wed Oct 22 15:02:43 2008 +0200
 
     * use the parameter randomize method in the pseudoAxis tests.
 
- test/hkl-test-pseudoaxis.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ test/hkl-test-pseudoaxis.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit f5d545b44444757df2fdbb4b7daf4e7a8bb43066
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5367,10 +15128,10 @@ Date:   Wed Oct 22 14:53:30 2008 +0200
 
     * add the "lifting_detector" mode for E6C and K6C
 
- src/hkl-pseudoaxis-E6C.c       |    9 +++++++++
- src/hkl-pseudoaxis-K6C.c       |    9 +++++++++
- test/hkl-test-pseudoaxis-K6C.c |    2 +-
- 3 files changed, 19 insertions(+), 1 deletions(-)
+ src/hkl-pseudoaxis-E6C.c       | 9 +++++++++
+ src/hkl-pseudoaxis-K6C.c       | 9 +++++++++
+ test/hkl-test-pseudoaxis-K6C.c | 2 +-
+ 3 files changed, 19 insertions(+), 1 deletion(-)
 
 commit 958b658012de849038f935714eab0a2deda59fb9
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5381,10 +15142,10 @@ Date:   Mon Oct 20 17:18:01 2008 +0200
     This min and max is used in the random test. so put a dummy min and max
     for the hkl getter.
 
- include/hkl/hkl-axis.h      |    3 +++
- src/hkl-axis.c              |    9 +++++++++
- src/hkl-pseudoaxis-common.c |   18 ++++++++++++++----
- test/hkl-test-pseudoaxis.c  |    7 +++++--
+ include/hkl/hkl-axis.h      |  3 +++
+ src/hkl-axis.c              |  9 +++++++++
+ src/hkl-pseudoaxis-common.c | 18 ++++++++++++++----
+ test/hkl-test-pseudoaxis.c  |  7 +++++--
  4 files changed, 31 insertions(+), 6 deletions(-)
 
 commit 2ad1283a8e8aa4972dcead9a471483e31fe2d0d4
@@ -5395,11 +15156,11 @@ Date:   Mon Oct 20 16:03:35 2008 +0200
     
     This methode randomize all axis of a geometry.
 
- include/hkl/hkl-axis.h     |   10 ++++++++++
- include/hkl/hkl-geometry.h |    2 ++
- src/hkl-axis.c             |   15 +++++++++++++++
- src/hkl-geometry.c         |    9 +++++++++
- test/hkl-test-pseudoaxis.c |    4 +---
+ include/hkl/hkl-axis.h     | 10 ++++++++++
+ include/hkl/hkl-geometry.h |  2 ++
+ src/hkl-axis.c             | 15 +++++++++++++++
+ src/hkl-geometry.c         |  9 +++++++++
+ test/hkl-test-pseudoaxis.c |  4 +---
  5 files changed, 37 insertions(+), 3 deletions(-)
 
 commit 3d2ebf580e70ed6bfa168a7bc1926c1283a4d728
@@ -5408,8 +15169,8 @@ Date:   Mon Oct 20 15:20:32 2008 +0200
 
     * update the README for cmake
 
- README |   56 ++++++++++++++++++++------------------------------------
- 1 files changed, 20 insertions(+), 36 deletions(-)
+ README | 56 ++++++++++++++++++++------------------------------------
+ 1 file changed, 20 insertions(+), 36 deletions(-)
 
 commit 757e6ce924ae77bdd67ac98edbabb2d0e368af80
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5417,8 +15178,8 @@ Date:   Mon Oct 20 14:55:38 2008 +0200
 
     * update the test with cmake
 
- CMakeLists.txt      |    3 ++-
- test/CMakeLists.txt |    5 +++--
+ CMakeLists.txt      | 3 ++-
+ test/CMakeLists.txt | 5 +++--
  2 files changed, 5 insertions(+), 3 deletions(-)
 
 commit 6a6f925dea36b51797782609352d90ccf3a9c495
@@ -5427,9 +15188,9 @@ Date:   Mon Oct 20 13:52:52 2008 +0200
 
     * remove config files from scons
 
- config-linux2.py |    1 -
- config-win32.py  |    2 --
- 2 files changed, 0 insertions(+), 3 deletions(-)
+ config-linux2.py | 1 -
+ config-win32.py  | 2 --
+ 2 files changed, 3 deletions(-)
 
 commit 1080eb819a7f027747c93ab61dc5381e3659f0fc
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5437,9 +15198,9 @@ Date:   Mon Oct 20 13:27:38 2008 +0200
 
     * start working on the eulerian pseudoaxes
 
- include/hkl/hkl-pseudoaxis-K4CV.h |    1 +
- src/hkl-pseudoaxis-K4CV.c         |   22 ++++++++++++++++++++++
- 2 files changed, 23 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-K4CV.h |  1 +
+ src/hkl-pseudoaxis-K4CV.c         | 22 ++++++++++++++++++++++
+ 2 files changed, 23 insertions(+)
 
 commit a089f651520261576e9048b3c4bda55c8af00df5
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5447,8 +15208,8 @@ Date:   Mon Oct 20 13:19:37 2008 +0200
 
     * add comments
 
- src/hkl-pseudoaxis-K4CV.c |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-K4CV.c | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit 732715b3ce66da01bd5686a9ef3b7dd677f76c37
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -5456,16 +15217,16 @@ Date:   Sun Oct 19 18:15:46 2008 +0200
 
     * factorize all the random pseudoAxes tests
 
- include/hkl/hkl-geometry-factory.h |    5 ++
- include/hkl/hkl-geometry.h         |    1 +
- src/hkl-geometry.c                 |    2 +
- test/SConscript                    |    1 +
- test/hkl-test-pseudoaxis-E4CV.c    |   63 -------------------
- test/hkl-test-pseudoaxis-E6C.c     |   62 ------------------
- test/hkl-test-pseudoaxis-K4CV.c    |   62 ------------------
- test/hkl-test-pseudoaxis-K6C.c     |   64 -------------------
- test/hkl-test-pseudoaxis.c         |  121 ++++++++++++++++++++++++++++++++++++
- test/main.c                        |    1 +
+ include/hkl/hkl-geometry-factory.h |   5 ++
+ include/hkl/hkl-geometry.h         |   1 +
+ src/hkl-geometry.c                 |   2 +
+ test/SConscript                    |   1 +
+ test/hkl-test-pseudoaxis-E4CV.c    |  63 -------------------
+ test/hkl-test-pseudoaxis-E6C.c     |  62 -------------------
+ test/hkl-test-pseudoaxis-K4CV.c    |  62 -------------------
+ test/hkl-test-pseudoaxis-K6C.c     |  64 --------------------
+ test/hkl-test-pseudoaxis.c         | 121 +++++++++++++++++++++++++++++++++++++
+ test/main.c                        |   1 +
  10 files changed, 131 insertions(+), 251 deletions(-)
 
 commit 704e0d021675926e7f6da2cdf53e3c3813465975
@@ -5474,9 +15235,9 @@ Date:   Sun Oct 19 16:47:14 2008 +0200
 
     * build a share lib with cmake
 
- CMakeLists.txt      |    1 -
- src/CMakeLists.txt  |    4 +++-
- test/CMakeLists.txt |    1 -
+ CMakeLists.txt      | 1 -
+ src/CMakeLists.txt  | 4 +++-
+ test/CMakeLists.txt | 1 -
  3 files changed, 3 insertions(+), 3 deletions(-)
 
 commit 2815f66e89a9372a2c7384a54c43b2c944231c48
@@ -5485,10 +15246,10 @@ Date:   Sun Oct 19 15:41:26 2008 +0200
 
     * add the cmake build system
 
- CMakeLists.txt      |    5 +++++
- src/CMakeLists.txt  |    3 +++
- test/CMakeLists.txt |    6 ++++++
- 3 files changed, 14 insertions(+), 0 deletions(-)
+ CMakeLists.txt      | 5 +++++
+ src/CMakeLists.txt  | 3 +++
+ test/CMakeLists.txt | 6 ++++++
+ 3 files changed, 14 insertions(+)
 
 commit 6b59f9efa971da03eff2939d167ea75004a536ee
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -5496,8 +15257,8 @@ Date:   Sat Oct 11 11:14:17 2008 +0200
 
     * update the TODO list
 
- TODO |  147 ++++++++++++++++++++++--------------------------------------------
- 1 files changed, 49 insertions(+), 98 deletions(-)
+ TODO | 147 +++++++++++++++++++++++--------------------------------------------
+ 1 file changed, 49 insertions(+), 98 deletions(-)
 
 commit 27f113607d07d9661226139f61fa01e26fa8abc6
 Author: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
@@ -5505,8 +15266,8 @@ Date:   Sat Oct 11 10:49:38 2008 +0200
 
     * add and update documentation
 
- src/hkl-pseudoaxis.c |   53 ++++++++++++++++++++++++++++++++++++++++++++-----
- 1 files changed, 47 insertions(+), 6 deletions(-)
+ src/hkl-pseudoaxis.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++------
+ 1 file changed, 47 insertions(+), 6 deletions(-)
 
 commit 51baa88538511145756e4fcc7606092237b74623
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5514,8 +15275,8 @@ Date:   Thu Sep 25 14:53:55 2008 +0200
 
     * add some doc for the pseudoaxis-common part.
 
- include/hkl/hkl-pseudoaxis-common.h |   27 +++++++++++++++++++++++++++
- 1 files changed, 27 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-common.h | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
 
 commit 976d9a675801346f6677770006ff825eb96c031d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5523,10 +15284,10 @@ Date:   Thu Sep 25 14:24:43 2008 +0200
 
     * remove all warnings
 
- include/hkl/hkl-pseudoaxis-common.h |    4 ++--
- src/hkl-pseudoaxis-E4CV.c           |    1 -
- src/hkl-pseudoaxis-E6C.c            |    1 -
- src/hkl-pseudoaxis-common.c         |    4 ++--
+ include/hkl/hkl-pseudoaxis-common.h | 4 ++--
+ src/hkl-pseudoaxis-E4CV.c           | 1 -
+ src/hkl-pseudoaxis-E6C.c            | 1 -
+ src/hkl-pseudoaxis-common.c         | 4 ++--
  4 files changed, 4 insertions(+), 6 deletions(-)
 
 commit 4bebd89c88c9ac7584e006acf1bb51ac40d3b88c
@@ -5535,10 +15296,10 @@ Date:   Thu Sep 25 13:28:25 2008 +0200
 
     * factorization of the standdard hkl setter.
 
- include/hkl/hkl-pseudoaxis-common.h |    4 ++++
- src/hkl-pseudoaxis-E4CV.c           |   28 +++-------------------------
- src/hkl-pseudoaxis-E6C.c            |   28 +++-------------------------
- src/hkl-pseudoaxis-common.c         |   29 ++++++++++++++++++++++++++---
+ include/hkl/hkl-pseudoaxis-common.h |  4 ++++
+ src/hkl-pseudoaxis-E4CV.c           | 28 +++-------------------------
+ src/hkl-pseudoaxis-E6C.c            | 28 +++-------------------------
+ src/hkl-pseudoaxis-common.c         | 29 ++++++++++++++++++++++++++---
  4 files changed, 36 insertions(+), 53 deletions(-)
 
 commit a7667ec4fcc747556c2066df76a26801d525db57
@@ -5547,8 +15308,8 @@ Date:   Thu Sep 25 13:20:48 2008 +0200
 
     * simplification of the E6C pseudoAxes.
 
- src/hkl-pseudoaxis-E6C.c       |   80 ++++++----------------------------------
- test/hkl-test-pseudoaxis-E6C.c |    3 +-
+ src/hkl-pseudoaxis-E6C.c       | 80 +++++++-----------------------------------
+ test/hkl-test-pseudoaxis-E6C.c |  3 +-
  2 files changed, 13 insertions(+), 70 deletions(-)
 
 commit 38f21be94dece5b86706aea6f2f81466bac73e7b
@@ -5557,8 +15318,8 @@ Date:   Thu Sep 25 12:13:23 2008 +0200
 
     * simplification of the E4CV modes (faster and less code)
 
- src/hkl-pseudoaxis-E4CV.c       |   80 ++++++---------------------------------
- test/hkl-test-pseudoaxis-E4CV.c |    4 +-
+ src/hkl-pseudoaxis-E4CV.c       | 80 +++++++----------------------------------
+ test/hkl-test-pseudoaxis-E4CV.c |  4 +--
  2 files changed, 14 insertions(+), 70 deletions(-)
 
 commit 2a75499c2d263c8d14b9500c09aae605792883c2
@@ -5567,13 +15328,13 @@ Date:   Wed Sep 24 17:24:46 2008 +0200
 
     * add the E6C diffractometer.
 
- include/hkl/hkl-pseudoaxis-E6C.h |   12 ++
- src/SConscript                   |    1 +
- src/hkl-pseudoaxis-E6C.c         |  206 ++++++++++++++++++++++++++++++++++++++
- test/SConscript                  |    1 +
- test/hkl-test-pseudoaxis-E6C.c   |  167 ++++++++++++++++++++++++++++++
- test/main.c                      |    1 +
- 6 files changed, 388 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-E6C.h |  12 +++
+ src/SConscript                   |   1 +
+ src/hkl-pseudoaxis-E6C.c         | 206 +++++++++++++++++++++++++++++++++++++++
+ test/SConscript                  |   1 +
+ test/hkl-test-pseudoaxis-E6C.c   | 167 +++++++++++++++++++++++++++++++
+ test/main.c                      |   1 +
+ 6 files changed, 388 insertions(+)
 
 commit a5c32b134959b2670bbfb3b278e254d8db4dd253
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5581,8 +15342,8 @@ Date:   Wed Sep 17 12:01:20 2008 +0200
 
     * add the constant mode to the K4CV diffractometer.
 
- src/hkl-pseudoaxis-K4CV.c |  224 +++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 224 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-K4CV.c | 224 ++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 224 insertions(+)
 
 commit 33e5a6f397b6e3d6d7efaba052d938fa1807ef0b
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5590,8 +15351,8 @@ Date:   Wed Sep 17 11:49:40 2008 +0200
 
     * rework the K4C bissector mode equations
 
- src/hkl-pseudoaxis-K4CV.c |   14 ++++++--------
- 1 files changed, 6 insertions(+), 8 deletions(-)
+ src/hkl-pseudoaxis-K4CV.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
 
 commit 605b8f7dbc9db13aacf50372bf5ab1cfdc7a6e3b
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5599,8 +15360,8 @@ Date:   Tue Sep 16 17:08:46 2008 +0200
 
     * add the constant phi vertical mode to the K6C geometry.
 
- src/hkl-pseudoaxis-K6C.c |   75 ++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 75 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-K6C.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 75 insertions(+)
 
 commit e6f35e119ad9ceea80a15cf9d1d247396bdcdc25
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5608,8 +15369,8 @@ Date:   Tue Sep 16 17:02:49 2008 +0200
 
     * add the constant chi vertical mode to the K6C diffractometer.
 
- src/hkl-pseudoaxis-K6C.c |   73 ++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 73 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis-K6C.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 73 insertions(+)
 
 commit 34c5514074b764b0d97a955ed58862a174043d36
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5617,8 +15378,8 @@ Date:   Tue Sep 16 08:56:42 2008 +0200
 
     * add the constant omega vertical mode to the K6C diffractometer.
 
- src/hkl-pseudoaxis-K6C.c |   84 +++++++++++++++++++++++++++++++++++++++++++--
- 1 files changed, 80 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis-K6C.c | 84 +++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 80 insertions(+), 4 deletions(-)
 
 commit b9bce4641aba35e10c60c6201dead3b467129af8
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5626,8 +15387,8 @@ Date:   Mon Sep 15 15:22:20 2008 +0200
 
     * add the bissector vertical mode.
 
- src/hkl-pseudoaxis-K6C.c       |   95 ++++++++++++++++++++++++++++++++++++---
- test/hkl-test-pseudoaxis-K6C.c |    4 +-
+ src/hkl-pseudoaxis-K6C.c       | 95 ++++++++++++++++++++++++++++++++++++++----
+ test/hkl-test-pseudoaxis-K6C.c |  4 +-
  2 files changed, 89 insertions(+), 10 deletions(-)
 
 commit 3eec3944db4fc247fed43b44c0e6dd76a5beaf84
@@ -5636,8 +15397,8 @@ Date:   Thu Sep 4 18:25:43 2008 +0200
 
     * no more gsl_vector_prt function use the data member of gsl_vector.
 
- src/hkl-pseudoaxis-K6C.c  |    8 ++++----
- src/hkl-pseudoaxis-auto.c |    8 ++++----
+ src/hkl-pseudoaxis-K6C.c  | 8 ++++----
+ src/hkl-pseudoaxis-auto.c | 8 ++++----
  2 files changed, 8 insertions(+), 8 deletions(-)
 
 commit 8982c2feead9ee0230f40294f3b28a56decea485
@@ -5646,8 +15407,8 @@ Date:   Thu Sep 4 18:06:09 2008 +0200
 
     * better E4CV bissector mode function.
 
- src/hkl-pseudoaxis-E4CV.c |    7 +++----
- 1 files changed, 3 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis-E4CV.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
 
 commit ea788d5ce0cefaa006728e1bd0a74d7768cef911
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5655,8 +15416,8 @@ Date:   Thu Sep 4 17:04:09 2008 +0200
 
     * typo
 
- src/hkl-pseudoaxis-auto.c |    6 +-----
- 1 files changed, 1 insertions(+), 5 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
 
 commit 48672b6efa87d67f1fbd85cba81022972407bc06
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5664,8 +15425,8 @@ Date:   Thu Sep 4 17:03:59 2008 +0200
 
     * better K6C bissector horizontal function
 
- src/hkl-pseudoaxis-K6C.c |    6 ++----
- 1 files changed, 2 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis-K6C.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
 
 commit 97e77a1d5db8f8d11ac48221c75cceb0e5f7e2c8
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5673,8 +15434,8 @@ Date:   Thu Sep 4 17:03:27 2008 +0200
 
     * do not restrict the angle after the search.
 
- src/hkl-pseudoaxis-auto.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 60a136dd38bb5bbcd136644a0d79149d42b3b676
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5682,8 +15443,8 @@ Date:   Thu Sep 4 16:59:11 2008 +0200
 
     * fprintf of a pseudoAxes also return the restricted symm angle
 
- src/hkl-pseudoaxis.c |   12 +++++++++---
- 1 files changed, 9 insertions(+), 3 deletions(-)
+ src/hkl-pseudoaxis.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
 
 commit c14e22930a719af90270306b58d106300818ca4a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5691,8 +15452,8 @@ Date:   Thu Sep 4 14:37:23 2008 +0200
 
     * remove un unnecessary variable in the test_sector function.
 
- src/hkl-pseudoaxis-auto.c |    8 ++------
- 1 files changed, 2 insertions(+), 6 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
 
 commit e58f8a4cecb8a207cfe91c124678a58cd89456d6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5700,8 +15461,8 @@ Date:   Thu Sep 4 08:33:51 2008 +0200
 
     * small documentation improvement.
 
- src/hkl-pseudoaxis.c |    8 +++++---
- 1 files changed, 5 insertions(+), 3 deletions(-)
+ src/hkl-pseudoaxis.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
 
 commit 1ad5ec21c3cf78cac779f4a47db48da8cc11e370
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5709,11 +15470,11 @@ Date:   Thu Sep 4 08:24:58 2008 +0200
 
     * no more miss computation of the missed mode computation during tests
 
- src/hkl-pseudoaxis-K6C.c        |    8 ++++----
- src/hkl-pseudoaxis-auto.c       |   24 ++++++++++++++++++------
- test/hkl-test-pseudoaxis-E4CV.c |    2 +-
- test/hkl-test-pseudoaxis-K4CV.c |    4 ++--
- test/hkl-test-pseudoaxis-K6C.c  |    3 ++-
+ src/hkl-pseudoaxis-K6C.c        |  8 ++++----
+ src/hkl-pseudoaxis-auto.c       | 24 ++++++++++++++++++------
+ test/hkl-test-pseudoaxis-E4CV.c |  2 +-
+ test/hkl-test-pseudoaxis-K4CV.c |  4 ++--
+ test/hkl-test-pseudoaxis-K6C.c  |  3 ++-
  5 files changed, 27 insertions(+), 14 deletions(-)
 
 commit 4437886435c231aa51bcd63bf2a5c15ea121bccb
@@ -5724,8 +15485,8 @@ Date:   Thu Sep 4 08:02:27 2008 +0200
     
     It seems easier to understrand.
 
- src/hkl-pseudoaxis-auto.c |   12 ++++++++----
- 1 files changed, 8 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
 
 commit 82a2ad63d3dea403c956017949025cf9227aeb91
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5733,8 +15494,8 @@ Date:   Thu Sep 4 08:00:16 2008 +0200
 
     * small bug in the permutation calculation.
 
- src/hkl-pseudoaxis-auto.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit dc8c0b8d1ceca59bfb19ef6c7b441dc2a14f25a9
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5742,9 +15503,9 @@ Date:   Wed Sep 3 17:45:41 2008 +0200
 
     * print the miss calculated pseudoAxes for each mode.
 
- test/hkl-test-pseudoaxis-E4CV.c |    3 ++-
- test/hkl-test-pseudoaxis-K4CV.c |    3 ++-
- test/hkl-test-pseudoaxis-K6C.c  |    3 ++-
+ test/hkl-test-pseudoaxis-E4CV.c | 3 ++-
+ test/hkl-test-pseudoaxis-K4CV.c | 3 ++-
+ test/hkl-test-pseudoaxis-K6C.c  | 3 ++-
  3 files changed, 6 insertions(+), 3 deletions(-)
 
 commit 468aff0f9daaf360f09c9af967bb99ba0aaff9aa
@@ -5753,14 +15514,14 @@ Date:   Wed Sep 3 17:19:18 2008 +0200
 
     * first kappa6C pseudoAxeEngine.
 
- include/hkl/hkl-pseudoaxis-K6C.h |   12 +++
- src/SConscript                   |    1 +
- src/hkl-pseudoaxis-K6C.c         |  113 +++++++++++++++++++++++++++++
- src/hkl-pseudoaxis.c             |    3 +-
- test/SConscript                  |    1 +
- test/hkl-test-pseudoaxis-K6C.c   |  145 ++++++++++++++++++++++++++++++++++++++
- test/main.c                      |    1 +
- 7 files changed, 275 insertions(+), 1 deletions(-)
+ include/hkl/hkl-pseudoaxis-K6C.h |  12 ++++
+ src/SConscript                   |   1 +
+ src/hkl-pseudoaxis-K6C.c         | 113 ++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis.c             |   3 +-
+ test/SConscript                  |   1 +
+ test/hkl-test-pseudoaxis-K6C.c   | 145 +++++++++++++++++++++++++++++++++++++++
+ test/main.c                      |   1 +
+ 7 files changed, 275 insertions(+), 1 deletion(-)
 
 commit d84ab9d6a1f790b7befa206693dd6f57537f1359
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5768,8 +15529,8 @@ Date:   Wed Sep 3 09:57:32 2008 +0200
 
     * use the right mode in the kappa pseudoAxesEngine
 
- src/hkl-pseudoaxis-K4CV.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ src/hkl-pseudoaxis-K4CV.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 849392b81bc461bed8c1e65882d59f8e0a0f8f8a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5781,18 +15542,18 @@ Date:   Tue Sep 2 16:51:57 2008 +0200
     pseudoAxes. As self->geometry is set each time we call the setter, the
     solver is slover.
 
- include/hkl/hkl-pseudoaxis-E4CV.h |  125 +----------
- include/hkl/hkl-pseudoaxis-K4CV.h |   91 +-------
- include/hkl/hkl-pseudoaxis-auto.h |   14 +
- include/hkl/hkl-pseudoaxis.h      |   49 +---
- src/SConscript                    |    3 +
- src/hkl-pseudoaxis-E4CV.c         |  170 +++++++++++++
- src/hkl-pseudoaxis-K4CV.c         |  108 +++++++++
- src/hkl-pseudoaxis-auto.c         |  250 ++++++++++++++++++++
- src/hkl-pseudoaxis-common.c       |    4 +
- src/hkl-pseudoaxis.c              |  472 ++++++-------------------------------
- test/hkl-test-pseudoaxis-E4CV.c   |    8 +-
- test/hkl-test-pseudoaxis-K4CV.c   |   18 +-
+ include/hkl/hkl-pseudoaxis-E4CV.h | 125 +---------
+ include/hkl/hkl-pseudoaxis-K4CV.h |  91 +-------
+ include/hkl/hkl-pseudoaxis-auto.h |  14 ++
+ include/hkl/hkl-pseudoaxis.h      |  49 +---
+ src/SConscript                    |   3 +
+ src/hkl-pseudoaxis-E4CV.c         | 170 ++++++++++++++
+ src/hkl-pseudoaxis-K4CV.c         | 108 +++++++++
+ src/hkl-pseudoaxis-auto.c         | 250 ++++++++++++++++++++
+ src/hkl-pseudoaxis-common.c       |   4 +
+ src/hkl-pseudoaxis.c              | 472 ++++++--------------------------------
+ test/hkl-test-pseudoaxis-E4CV.c   |   8 +-
+ test/hkl-test-pseudoaxis-K4CV.c   |  18 +-
  12 files changed, 649 insertions(+), 663 deletions(-)
 
 commit 4a9cb31dd474dda40135528009e1be029986c1f5
@@ -5801,11 +15562,11 @@ Date:   Tue Sep 2 09:04:04 2008 +0200
 
     * remove the to_pseudoAxes from PseudoAxesEngine.
 
- include/hkl/hkl-pseudoaxis-K4CV.h |   10 +++++++
- include/hkl/hkl-pseudoaxis.h      |    2 -
- src/hkl-pseudoaxis.c              |   30 -----------------------
- test/hkl-test-pseudoaxis-E4CV.c   |    3 +-
- test/hkl-test-pseudoaxis-K4CV.c   |   48 +++---------------------------------
+ include/hkl/hkl-pseudoaxis-K4CV.h | 10 ++++++++
+ include/hkl/hkl-pseudoaxis.h      |  2 --
+ src/hkl-pseudoaxis.c              | 30 ------------------------
+ test/hkl-test-pseudoaxis-E4CV.c   |  3 ++-
+ test/hkl-test-pseudoaxis-K4CV.c   | 48 ++++-----------------------------------
  5 files changed, 16 insertions(+), 77 deletions(-)
 
 commit 40d89e587d47577e75627bd74c0c32ce589e4279
@@ -5814,8 +15575,8 @@ Date:   Tue Sep 2 08:53:46 2008 +0200
 
     * no more crash of fprintf if the geometry was no set in PseudoAxesEngine.
 
- src/hkl-pseudoaxis.c            |   44 ++++++++++++++++++++++----------------
- test/hkl-test-pseudoaxis-E4CV.c |   26 +++++++++++-----------
+ src/hkl-pseudoaxis.c            | 44 +++++++++++++++++++++++------------------
+ test/hkl-test-pseudoaxis-E4CV.c | 26 ++++++++++++------------
  2 files changed, 38 insertions(+), 32 deletions(-)
 
 commit 5f342e4330da4452c6e88027fe4905a47de83d4c
@@ -5824,9 +15585,9 @@ Date:   Tue Sep 2 08:10:05 2008 +0200
 
     * start to use the get set in the E4CV pseudoAxeEngine.
 
- include/hkl/hkl-pseudoaxis-E4CV.h |   10 ++++++++++
- include/hkl/hkl-pseudoaxis.h      |    4 ++--
- src/hkl-pseudoaxis.c              |   11 +++++------
+ include/hkl/hkl-pseudoaxis-E4CV.h | 10 ++++++++++
+ include/hkl/hkl-pseudoaxis.h      |  4 ++--
+ src/hkl-pseudoaxis.c              | 11 +++++------
  3 files changed, 17 insertions(+), 8 deletions(-)
 
 commit b004305209632113451d5f2d5cbff2daf0ea3992
@@ -5835,13 +15596,13 @@ Date:   Fri Aug 29 17:57:44 2008 +0200
 
     * create a common part for the pseudoAxeEngine.
 
- include/hkl/hkl-pseudoaxis-E4CV.h   |    1 +
- include/hkl/hkl-pseudoaxis-K4CV.h   |    1 +
- include/hkl/hkl-pseudoaxis-common.h |    7 +++
- include/hkl/hkl-pseudoaxis.h        |    4 +-
- src/SConscript                      |    1 +
- src/hkl-pseudoaxis-common.c         |   80 +++++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis.c                |   45 -------------------
+ include/hkl/hkl-pseudoaxis-E4CV.h   |  1 +
+ include/hkl/hkl-pseudoaxis-K4CV.h   |  1 +
+ include/hkl/hkl-pseudoaxis-common.h |  7 ++++
+ include/hkl/hkl-pseudoaxis.h        |  4 +-
+ src/SConscript                      |  1 +
+ src/hkl-pseudoaxis-common.c         | 80 +++++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis.c                | 45 ---------------------
  7 files changed, 91 insertions(+), 48 deletions(-)
 
 commit 95cb64e01583e346302b40027fd160f1e5e3bc57
@@ -5850,8 +15611,8 @@ Date:   Fri Aug 29 17:31:30 2008 +0200
 
     * refactor the getset part of the pseudoAxesEngine
 
- include/hkl/hkl-pseudoaxis.h |   51 ++++++++------------
- src/hkl-pseudoaxis.c         |  104 +++++++++++++++++++++++++++++++----------
+ include/hkl/hkl-pseudoaxis.h |  51 +++++++++------------
+ src/hkl-pseudoaxis.c         | 104 ++++++++++++++++++++++++++++++++-----------
  2 files changed, 99 insertions(+), 56 deletions(-)
 
 commit 7feb06b7d190f1b9032e71446f6356839562df5e
@@ -5862,12 +15623,12 @@ Date:   Fri Aug 29 16:54:29 2008 +0200
     
     also refactoring of the PseudoAxis geometry specific constructors.
 
- include/hkl/hkl-pseudoaxis-E4CV.h |   85 ++++++------
- include/hkl/hkl-pseudoaxis-K4CV.h |   30 ++---
- include/hkl/hkl-pseudoaxis.h      |   84 +++++++++++--
- src/hkl-pseudoaxis.c              |  256 +++++++++++++++++++++++++++++--------
- test/hkl-test-pseudoaxis-E4CV.c   |    2 +-
- test/hkl-test-pseudoaxis-K4CV.c   |    4 +-
+ include/hkl/hkl-pseudoaxis-E4CV.h |  85 +++++++------
+ include/hkl/hkl-pseudoaxis-K4CV.h |  30 +++--
+ include/hkl/hkl-pseudoaxis.h      |  84 +++++++++++--
+ src/hkl-pseudoaxis.c              | 256 ++++++++++++++++++++++++++++++--------
+ test/hkl-test-pseudoaxis-E4CV.c   |   2 +-
+ test/hkl-test-pseudoaxis-K4CV.c   |   4 +-
  6 files changed, 335 insertions(+), 126 deletions(-)
 
 commit d0aca04cc00766f8ece48497d29887776f2f7976
@@ -5876,12 +15637,12 @@ Date:   Fri Aug 29 10:51:09 2008 +0200
 
     * revert all inlining till I understand well the inlining...
 
- include/hkl/hkl-axis.h       |    7 +------
- include/hkl/hkl-quaternion.h |   41 +++--------------------------------------
- include/hkl/hkl-vector.h     |    6 +-----
- src/hkl-axis.c               |    7 +++++++
- src/hkl-quaternion.c         |   38 ++++++++++++++++++++++++++++++++++++++
- src/hkl-vector.c             |    5 +++++
+ include/hkl/hkl-axis.h       |  7 +------
+ include/hkl/hkl-quaternion.h | 41 +++--------------------------------------
+ include/hkl/hkl-vector.h     |  6 +-----
+ src/hkl-axis.c               |  7 +++++++
+ src/hkl-quaternion.c         | 38 ++++++++++++++++++++++++++++++++++++++
+ src/hkl-vector.c             |  5 +++++
  6 files changed, 55 insertions(+), 49 deletions(-)
 
 commit c00fc96aaadd7b4a3b094843916c14674b72a2c0
@@ -5890,8 +15651,8 @@ Date:   Thu Aug 28 15:03:47 2008 +0200
 
     * documentation.
 
- src/hkl-pseudoaxis.c |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
+ src/hkl-pseudoaxis.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
 commit 8d7c11a002ca19931d2543d3152c1139358abc28
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5899,12 +15660,12 @@ Date:   Thu Aug 28 14:31:36 2008 +0200
 
     * inline a few more methods to speed calculation.
 
- include/hkl/hkl-axis.h       |   15 +++++++++++-
- include/hkl/hkl-quaternion.h |   53 +++++++++++++++++++++++++++++++++++++++--
- include/hkl/hkl-vector.h     |    7 ++++-
- src/hkl-axis.c               |    6 ----
- src/hkl-quaternion.c         |   40 -------------------------------
- src/hkl-vector.c             |    6 ----
+ include/hkl/hkl-axis.h       | 15 ++++++++++++-
+ include/hkl/hkl-quaternion.h | 53 +++++++++++++++++++++++++++++++++++++++++---
+ include/hkl/hkl-vector.h     |  7 +++++-
+ src/hkl-axis.c               |  6 -----
+ src/hkl-quaternion.c         | 40 ---------------------------------
+ src/hkl-vector.c             |  6 -----
  6 files changed, 70 insertions(+), 57 deletions(-)
 
 commit 811236af9a8b3006b3f65418192a8234abbe5c76
@@ -5913,8 +15674,8 @@ Date:   Thu Aug 28 11:48:56 2008 +0200
 
     * the geometry_init_geometry now also copy the holders no more dirty axes.
 
- src/hkl-geometry.c |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
+ src/hkl-geometry.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
 
 commit 742b8b08a46e0fd4f33ed399006f24db9cf4ff2d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5922,8 +15683,8 @@ Date:   Thu Aug 28 11:02:31 2008 +0200
 
     * use the x[] instead of *x notation in the method decalrations.
 
- src/hkl-pseudoaxis.c |   12 ++++++------
- 1 files changed, 6 insertions(+), 6 deletions(-)
+ src/hkl-pseudoaxis.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
 
 commit 8b829b7d80ec7f0c89e95ff5f6f4aaa96abb5762
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5931,8 +15692,8 @@ Date:   Thu Aug 28 10:50:06 2008 +0200
 
     * comments updated
 
- src/hkl-pseudoaxis.c |   10 +++++-----
- 1 files changed, 5 insertions(+), 5 deletions(-)
+ src/hkl-pseudoaxis.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
 
 commit 92e18ce57b340078df0b5aead6ab8bc106034a55
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5940,8 +15701,8 @@ Date:   Thu Aug 28 10:46:04 2008 +0200
 
     * add the find_first_geometry documentation
 
- src/hkl-pseudoaxis.c |   11 +++++++++++
- 1 files changed, 11 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
 
 commit 8b4358a346d33151c8395577987424b54bdc27f6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5949,8 +15710,8 @@ Date:   Thu Aug 28 10:39:52 2008 +0200
 
     * add documentation
 
- src/hkl-pseudoaxis.c |   10 ++++++++++
- 1 files changed, 10 insertions(+), 0 deletions(-)
+ src/hkl-pseudoaxis.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
 
 commit 2b2c2d5d7074a1b4d4c0fdf1b47d3be2adc7be5c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5958,8 +15719,8 @@ Date:   Thu Aug 28 10:39:29 2008 +0200
 
     * use self instead of engine in the add_geometry method.
 
- src/hkl-pseudoaxis.c |   22 +++++++++++-----------
- 1 files changed, 11 insertions(+), 11 deletions(-)
+ src/hkl-pseudoaxis.c | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
 
 commit b3f24cec4a1519bade3abd839225bef38f420ba2
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5967,8 +15728,8 @@ Date:   Thu Aug 28 10:31:20 2008 +0200
 
     * use the variable array length of C99 in the to_geometry.
 
- src/hkl-pseudoaxis.c |    9 +++------
- 1 files changed, 3 insertions(+), 6 deletions(-)
+ src/hkl-pseudoaxis.c | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
 
 commit b44e9b99e983450d5826f82561275e70a7c8f0d6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5976,8 +15737,8 @@ Date:   Thu Aug 28 10:21:02 2008 +0200
 
     * fix indentation
 
- src/hkl-pseudoaxis.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-pseudoaxis.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 4f40c28710b151fc33ecfb1c59c1c73341bec3f9
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5985,8 +15746,8 @@ Date:   Thu Aug 28 10:20:35 2008 +0200
 
     * rename jacobian into find_degenerated
 
- src/hkl-pseudoaxis.c |   28 +++++++++++++++++++++-------
- 1 files changed, 21 insertions(+), 7 deletions(-)
+ src/hkl-pseudoaxis.c | 28 +++++++++++++++++++++-------
+ 1 file changed, 21 insertions(+), 7 deletions(-)
 
 commit 46df53194eb957bc33652ac69748603fa02e6e74
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -5994,8 +15755,8 @@ Date:   Thu Aug 28 09:36:55 2008 +0200
 
     rename the find_geoemtry method to be more explicite
 
- src/hkl-pseudoaxis.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ src/hkl-pseudoaxis.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit b3d22b2e0c53478bc9d8c86cafd35d73587807fd
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6003,8 +15764,8 @@ Date:   Thu Aug 28 09:36:34 2008 +0200
 
     * use the right signature for the compute_jacobian function
 
- src/hkl-pseudoaxis.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit 0c93e56099932a3da1bc43b87e24c74247ee0d46
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6012,8 +15773,8 @@ Date:   Thu Aug 28 08:57:52 2008 +0200
 
     * add a degenerated case in the K4CV pseudoAxesEngine.
 
- test/hkl-test-pseudoaxis-K4CV.c |   65 ++++++++++++++++++++++++++++++++++----
- 1 files changed, 58 insertions(+), 7 deletions(-)
+ test/hkl-test-pseudoaxis-K4CV.c | 65 ++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 58 insertions(+), 7 deletions(-)
 
 commit 7fa62fdb8bf540981ac097630231a519327c25c5
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6021,8 +15782,8 @@ Date:   Thu Aug 28 08:49:23 2008 +0200
 
     * add a compute_jacobian method to work on degenerated axes.
 
- src/hkl-pseudoaxis.c |   55 ++++++++++++++++++++++++++++++++-----------------
- 1 files changed, 36 insertions(+), 19 deletions(-)
+ src/hkl-pseudoaxis.c | 55 ++++++++++++++++++++++++++++++++++------------------
+ 1 file changed, 36 insertions(+), 19 deletions(-)
 
 commit 563378cd78bb1fe252a9089b0292cc350f067ab1
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6030,8 +15791,8 @@ Date:   Thu Aug 28 08:30:34 2008 +0200
 
     * use fprintf to stderr instead of stdout in the test methods
 
- test/hkl-test.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ test/hkl-test.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 112b986c20506d2299e55e8cf75907c0e4cc48cf
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6039,8 +15800,8 @@ Date:   Thu Aug 28 08:30:08 2008 +0200
 
     * print the number of missed calculated pseudoAxes.
 
- test/hkl-test-pseudoaxis-E4CV.c |    5 ++++-
- test/hkl-test-pseudoaxis-K4CV.c |    5 ++++-
+ test/hkl-test-pseudoaxis-E4CV.c | 5 ++++-
+ test/hkl-test-pseudoaxis-K4CV.c | 5 ++++-
  2 files changed, 8 insertions(+), 2 deletions(-)
 
 commit bd9d6010ecab0c53a7751b2831a2cef81754e2c9
@@ -6049,8 +15810,8 @@ Date:   Thu Aug 28 08:29:42 2008 +0200
 
     *small optimisation of the solver
 
- src/hkl-pseudoaxis.c |    7 ++-----
- 1 files changed, 2 insertions(+), 5 deletions(-)
+ src/hkl-pseudoaxis.c | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
 
 commit b94a3b99c558a1ecb71790f0963efca861c06598
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6058,8 +15819,8 @@ Date:   Thu Aug 28 08:17:12 2008 +0200
 
     * update the fdjacobian in the test sector method.
 
- src/hkl-pseudoaxis.c |   32 ++++++++++++++++----------------
- 1 files changed, 16 insertions(+), 16 deletions(-)
+ src/hkl-pseudoaxis.c | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
 
 commit 4fbe97da009f017c1c385d1ccd9587110808def6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6070,8 +15831,8 @@ Date:   Thu Aug 28 08:16:38 2008 +0200
     leak when the solution could not be found -> status = GSL_CONTINUE
     return without deallocating the memory.
 
- src/hkl-pseudoaxis.c |   26 ++++++++++++++------------
- 1 files changed, 14 insertions(+), 12 deletions(-)
+ src/hkl-pseudoaxis.c | 28 +++++++++++++++-------------
+ 1 file changed, 15 insertions(+), 13 deletions(-)
 
 commit 1528f75b705605ce9c8e9a52902e4587c51a3ef1
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6079,8 +15840,8 @@ Date:   Wed Aug 27 17:43:54 2008 +0200
 
     * remove un-needed method
 
- src/hkl-holder.c       |    6 ------
- test/hkl-test-holder.c |    6 +++---
+ src/hkl-holder.c       | 6 ------
+ test/hkl-test-holder.c | 6 +++---
  2 files changed, 3 insertions(+), 9 deletions(-)
 
 commit acfa0f8bb65c121d2a226cd76c1eea6ce195b36c
@@ -6089,13 +15850,13 @@ Date:   Wed Aug 27 17:38:18 2008 +0200
 
     * first kappa4C working HKL pseudoAxesEngine.
 
- include/hkl/hkl-pseudoaxis-K4CV.h |   90 +++++++++++++++++++++
- src/hkl-pseudoaxis.c              |   26 +++----
- test/SConscript                   |    3 +-
- test/hkl-test-pseudoaxis-E4CV.c   |  154 +++++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis-K4CV.c   |  161 +++++++++++++++++++++++++++++++++++++
- test/hkl-test-pseudoaxis.c        |  154 -----------------------------------
- test/main.c                       |    3 +-
+ include/hkl/hkl-pseudoaxis-K4CV.h |  90 +++++++++++++++++++++
+ src/hkl-pseudoaxis.c              |  26 +++---
+ test/SConscript                   |   3 +-
+ test/hkl-test-pseudoaxis-E4CV.c   | 154 ++++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis-K4CV.c   | 161 ++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-pseudoaxis.c        | 154 ------------------------------------
+ test/main.c                       |   3 +-
  7 files changed, 419 insertions(+), 172 deletions(-)
 
 commit 4030c3a55495d2e408536fecb814ad6fcfa922fd
@@ -6104,8 +15865,8 @@ Date:   Wed Aug 27 15:11:49 2008 +0200
 
     * compact the E4CV pseudoAxes initialization
 
- include/hkl/hkl-pseudoaxis-E4CV.h |   44 +++++++-----------------------------
- 1 files changed, 9 insertions(+), 35 deletions(-)
+ include/hkl/hkl-pseudoaxis-E4CV.h | 44 ++++++++-------------------------------
+ 1 file changed, 9 insertions(+), 35 deletions(-)
 
 commit 4cfa20f3cc15727a5390a7ed0054827826f3de45
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6113,10 +15874,10 @@ Date:   Wed Aug 27 15:00:33 2008 +0200
 
     * now use directly the right function instead of a copy
 
- include/hkl/hkl-pseudoaxis-E4CV.h |    6 +++---
- include/hkl/hkl-pseudoaxis.h      |    2 +-
- src/hkl-pseudoaxis.c              |    6 +++---
- test/hkl-test-pseudoaxis.c        |    2 +-
+ include/hkl/hkl-pseudoaxis-E4CV.h | 6 +++---
+ include/hkl/hkl-pseudoaxis.h      | 2 +-
+ src/hkl-pseudoaxis.c              | 6 +++---
+ test/hkl-test-pseudoaxis.c        | 2 +-
  4 files changed, 8 insertions(+), 8 deletions(-)
 
 commit 0d61c9b9cb8b8c0dc3f73f4ad1aadc5a57149cf3
@@ -6127,10 +15888,10 @@ Date:   Wed Aug 27 14:55:38 2008 +0200
     
     also reduce the number of iteration before stopping looking for a solution.
 
- include/hkl/hkl-pseudoaxis-E4CV.h |  105 +++++++++++++++++++++++++++++--------
- include/hkl/hkl-pseudoaxis.h      |    1 +
- src/hkl-pseudoaxis.c              |    2 +-
- test/hkl-test-pseudoaxis.c        |   53 ++++++++++--------
+ include/hkl/hkl-pseudoaxis-E4CV.h | 105 +++++++++++++++++++++++++++++---------
+ include/hkl/hkl-pseudoaxis.h      |   1 +
+ src/hkl-pseudoaxis.c              |   2 +-
+ test/hkl-test-pseudoaxis.c        |  53 ++++++++++---------
  4 files changed, 113 insertions(+), 48 deletions(-)
 
 commit 1b13f88466aa89d32e1071622abe2eba9ef72480
@@ -6139,8 +15900,8 @@ Date:   Wed Aug 27 13:00:26 2008 +0200
 
     * better fprintf in the PseudoAxesengine.
 
- src/hkl-pseudoaxis.c |   13 +++++++++----
- 1 files changed, 9 insertions(+), 4 deletions(-)
+ src/hkl-pseudoaxis.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
 
 commit 13e0866b82136ab35c962ba4eea8b7ee62036065
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6148,8 +15909,8 @@ Date:   Wed Aug 27 11:46:21 2008 +0200
 
     refactoring of the PseudoAxesEngien test
 
- test/hkl-test-pseudoaxis.c |   29 +++++++++++------------------
- 1 files changed, 11 insertions(+), 18 deletions(-)
+ test/hkl-test-pseudoaxis.c | 29 +++++++++++------------------
+ 1 file changed, 11 insertions(+), 18 deletions(-)
 
 commit e0eacc5049c48fa1b93abe01bb343f2c46d69c83
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6159,11 +15920,11 @@ Date:   Wed Aug 27 11:42:31 2008 +0200
     
     add also the pseudoAxes fprintf method.
 
- include/hkl/hkl-pseudoaxis-E4CV.h |   17 +++++++++------
- include/hkl/hkl-pseudoaxis.h      |    4 ++-
- src/hkl-geometry.c                |    6 +++-
- src/hkl-pseudoaxis.c              |   38 +++++++++++++++++++++++++++++-------
- test/hkl-test-pseudoaxis.c        |   25 +++++++++++++----------
+ include/hkl/hkl-pseudoaxis-E4CV.h | 17 ++++++++++-------
+ include/hkl/hkl-pseudoaxis.h      |  4 +++-
+ src/hkl-geometry.c                |  6 ++++--
+ src/hkl-pseudoaxis.c              | 38 ++++++++++++++++++++++++++++++--------
+ test/hkl-test-pseudoaxis.c        | 25 ++++++++++++++-----------
  5 files changed, 61 insertions(+), 29 deletions(-)
 
 commit 2d62bdd073a1e35cd43e32a3eb8f4280b85fc70a
@@ -6172,8 +15933,8 @@ Date:   Wed Aug 27 10:39:49 2008 +0200
 
     * optimization
 
- src/hkl-pseudoaxis.c |   64 +++++++++++++++++++++++++------------------------
- 1 files changed, 33 insertions(+), 31 deletions(-)
+ src/hkl-pseudoaxis.c | 64 +++++++++++++++++++++++++++-------------------------
+ 1 file changed, 33 insertions(+), 31 deletions(-)
 
 commit 9bbc2206e4df3aec6d36aa75df63a1349a6aea88
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6185,10 +15946,10 @@ Date:   Wed Aug 27 10:00:21 2008 +0200
     axes config part from the engine->geometry to the engine->geometries with
     the new hkl_geometry_init_geometry method.
 
- include/hkl/hkl-geometry.h   |    3 ++
- include/hkl/hkl-pseudoaxis.h |    1 +
- src/hkl-geometry.c           |   16 ++++++++++++++
- src/hkl-pseudoaxis.c         |   45 +++++++++++++++++++++++------------------
+ include/hkl/hkl-geometry.h   |  3 +++
+ include/hkl/hkl-pseudoaxis.h |  1 +
+ src/hkl-geometry.c           | 16 ++++++++++++++++
+ src/hkl-pseudoaxis.c         | 45 ++++++++++++++++++++++++--------------------
  4 files changed, 45 insertions(+), 20 deletions(-)
 
 commit d9f14f10cffff3b03f26afe7e5fd934a1c0e01b5
@@ -6197,8 +15958,8 @@ Date:   Wed Aug 27 09:22:49 2008 +0200
 
     * now all geometries are provided.
 
- src/hkl-pseudoaxis.c       |  465 ++++++++++++++++++++++----------------------
- test/hkl-test-pseudoaxis.c |    2 +-
+ src/hkl-pseudoaxis.c       | 465 ++++++++++++++++++++++-----------------------
+ test/hkl-test-pseudoaxis.c |   2 +-
  2 files changed, 231 insertions(+), 236 deletions(-)
 
 commit bbbb9105b407efb0145d3fe9975f42f0502d1696
@@ -6207,17 +15968,17 @@ Date:   Tue Aug 26 14:48:16 2008 +0200
 
     * refactoring of all the PseudoAxes
 
- SConstruct                        |    2 +-
- config-linux2.py                  |    1 +
- include/hkl/hkl-geometry.h        |    3 +
- include/hkl/hkl-pseudoaxis-E4CV.h |   38 +++-
- include/hkl/hkl-pseudoaxis.h      |   91 +++-----
- src/SConscript                    |    1 -
- src/hkl-geometry.c                |   13 +
- src/hkl-pseudoaxis-auto.c         |  339 ---------------------------
- src/hkl-pseudoaxis.c              |  466 +++++++++++++++++++++++++-----------
- test/hkl-test-pseudoaxis.c        |  200 ++++-------------
- test/main.c                       |    2 +-
+ SConstruct                        |   2 +-
+ config-linux2.py                  |   1 +
+ include/hkl/hkl-geometry.h        |   3 +
+ include/hkl/hkl-pseudoaxis-E4CV.h |  38 +++-
+ include/hkl/hkl-pseudoaxis.h      |  91 +++-----
+ src/SConscript                    |   1 -
+ src/hkl-geometry.c                |  13 ++
+ src/hkl-pseudoaxis-auto.c         | 339 ---------------------------
+ src/hkl-pseudoaxis.c              | 466 ++++++++++++++++++++++++++------------
+ test/hkl-test-pseudoaxis.c        | 200 ++++------------
+ test/main.c                       |   2 +-
  11 files changed, 452 insertions(+), 704 deletions(-)
 
 commit acfd67299960d732b457f75f24d97280ca3e6c91
@@ -6226,11 +15987,11 @@ Date:   Mon Aug 25 18:06:49 2008 +0200
 
     * reorganize a little bit the geometry + holder to improve speed.
 
- include/hkl/hkl-geometry.h |    8 --------
- src/hkl-geometry.c         |   35 +++++++++++++++++++++++++++++------
- src/hkl-holder.c           |   24 ------------------------
- test/hkl-test-geometry.c   |    4 ++++
- test/hkl-test-holder.c     |   36 ------------------------------------
+ include/hkl/hkl-geometry.h |  8 --------
+ src/hkl-geometry.c         | 35 +++++++++++++++++++++++++++++------
+ src/hkl-holder.c           | 24 ------------------------
+ test/hkl-test-geometry.c   |  4 ++++
+ test/hkl-test-holder.c     | 36 ------------------------------------
  5 files changed, 33 insertions(+), 74 deletions(-)
 
 commit a91150cd8c10e17df16786b42362ed64cf20cd4e
@@ -6239,15 +16000,15 @@ Date:   Mon Aug 25 17:45:12 2008 +0200
 
     * now Detector is normal struct no more new/free
 
- include/hkl/hkl-detector.h |    7 +----
- include/hkl/hkl-sample.h   |    2 +-
- src/hkl-detector.c         |   33 ++----------------------
- src/hkl-pseudoaxis-auto.c  |    2 +-
- src/hkl-pseudoaxis.c       |    2 +-
- src/hkl-sample.c           |    5 +--
- test/hkl-test-detector.c   |   35 +++-----------------------
- test/hkl-test-pseudoaxis.c |   21 ++++-----------
- test/hkl-test-sample.c     |   59 ++++++++++++++-----------------------------
+ include/hkl/hkl-detector.h |  7 +-----
+ include/hkl/hkl-sample.h   |  2 +-
+ src/hkl-detector.c         | 33 +++-----------------------
+ src/hkl-pseudoaxis-auto.c  |  2 +-
+ src/hkl-pseudoaxis.c       |  2 +-
+ src/hkl-sample.c           |  5 ++--
+ test/hkl-test-detector.c   | 35 ++++-----------------------
+ test/hkl-test-pseudoaxis.c | 21 +++++------------
+ test/hkl-test-sample.c     | 59 +++++++++++++++-------------------------------
  9 files changed, 38 insertions(+), 128 deletions(-)
 
 commit fb019aa91616bf61cb04e50959d3605126464149
@@ -6256,8 +16017,8 @@ Date:   Mon Aug 25 17:42:44 2008 +0200
 
     * optimization in the holder part.
 
- src/hkl-holder.c |    6 ++++--
- 1 files changed, 4 insertions(+), 2 deletions(-)
+ src/hkl-holder.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
 
 commit 1fe5c074edaa948556984f93af3b588ecdfeb3c5
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6265,8 +16026,8 @@ Date:   Mon Aug 25 14:09:19 2008 +0200
 
     * small refactoring of the geometry add holder class
 
- src/hkl-geometry.c |    6 ++++--
- 1 files changed, 4 insertions(+), 2 deletions(-)
+ src/hkl-geometry.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
 
 commit 30d0f50331b1d04e8fdee6d79beae442f210b633
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6274,8 +16035,8 @@ Date:   Mon Aug 25 14:08:40 2008 +0200
 
     * just a refactoring of the geometry factory
 
- include/hkl/hkl-geometry-factory.h |   40 ++++++++++++++++++------------------
- 1 files changed, 20 insertions(+), 20 deletions(-)
+ include/hkl/hkl-geometry-factory.h | 40 +++++++++++++++++++-------------------
+ 1 file changed, 20 insertions(+), 20 deletions(-)
 
 commit 5b35453ab6735910b26ff84892e27d7c6b04a70a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6283,8 +16044,8 @@ Date:   Mon Aug 25 13:48:15 2008 +0200
 
     * remove a leak in the Geometry.
 
- src/hkl-geometry.c |   15 ++++++++++-----
- 1 files changed, 10 insertions(+), 5 deletions(-)
+ src/hkl-geometry.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
 
 commit 3dc4907085bb73661e5094087a8d6411f1ee4410
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6292,9 +16053,9 @@ Date:   Mon Aug 25 13:33:31 2008 +0200
 
     * use sel fin the geometry class
 
- include/hkl/hkl-geometry.h |   23 ++++++++-------
- src/hkl-geometry.c         |   38 +++++++++++++-------------
- src/hkl-holder.c           |   65 +++++++++++++++++++++-----------------------
+ include/hkl/hkl-geometry.h | 23 ++++++++--------
+ src/hkl-geometry.c         | 38 +++++++++++++--------------
+ src/hkl-holder.c           | 65 ++++++++++++++++++++++------------------------
  3 files changed, 62 insertions(+), 64 deletions(-)
 
 commit 658e2a265361ce8008f7de7c64edda77ff5eb6ca
@@ -6303,17 +16064,17 @@ Date:   Fri Aug 22 17:27:58 2008 +0200
 
     * no more list in the Geometry
 
- include/hkl/hkl-axis.h     |    5 +--
- include/hkl/hkl-geometry.h |    7 +---
- src/hkl-axis.c             |   36 ++-------------------
- src/hkl-geometry.c         |   45 +++++++++-----------------
- src/hkl-holder.c           |   30 ++++++++---------
- src/hkl-pseudoaxis-auto.c  |   11 +++---
- src/hkl-pseudoaxis.c       |    2 +-
- test/hkl-test-axis.c       |   75 +++++++++++++++++++------------------------
- test/hkl-test-geometry.c   |    6 ++--
- test/hkl-test-pseudoaxis.c |    8 ++--
- test/hkl-test-sample.c     |   16 +++++-----
+ include/hkl/hkl-axis.h     |  5 +---
+ include/hkl/hkl-geometry.h |  7 ++---
+ src/hkl-axis.c             | 36 +++-------------------
+ src/hkl-geometry.c         | 45 ++++++++++------------------
+ src/hkl-holder.c           | 30 +++++++++----------
+ src/hkl-pseudoaxis-auto.c  | 11 +++----
+ src/hkl-pseudoaxis.c       |  2 +-
+ test/hkl-test-axis.c       | 75 ++++++++++++++++++++--------------------------
+ test/hkl-test-geometry.c   |  6 ++--
+ test/hkl-test-pseudoaxis.c |  8 ++---
+ test/hkl-test-sample.c     | 16 +++++-----
  11 files changed, 91 insertions(+), 150 deletions(-)
 
 commit 89f2689eeeaad0e0af83c108c0c413500b91d902
@@ -6322,8 +16083,8 @@ Date:   Fri Aug 22 16:33:12 2008 +0200
 
     * no more HklList in the holder
 
- include/hkl/hkl-geometry.h |    3 ++-
- src/hkl-holder.c           |   34 ++++++++++++++++++----------------
+ include/hkl/hkl-geometry.h |  3 ++-
+ src/hkl-holder.c           | 34 ++++++++++++++++++----------------
  2 files changed, 20 insertions(+), 17 deletions(-)
 
 commit 2687356c7b704469d9c64d60714477bb2274d135
@@ -6332,11 +16093,11 @@ Date:   Fri Aug 22 16:07:42 2008 +0200
 
     * now holder and geometry are thigten
 
- include/hkl/hkl-geometry.h |   31 ++++++++-
- include/hkl/hkl-holder.h   |   32 ---------
- src/hkl-geometry.c         |    4 +-
- src/hkl-holder.c           |   18 +++---
- test/hkl-test-holder.c     |  161 +++-----------------------------------------
+ include/hkl/hkl-geometry.h |  31 ++++++++-
+ include/hkl/hkl-holder.h   |  32 ---------
+ src/hkl-geometry.c         |   4 +-
+ src/hkl-holder.c           |  18 ++---
+ test/hkl-test-holder.c     | 161 +++------------------------------------------
  5 files changed, 50 insertions(+), 196 deletions(-)
 
 commit ee6cdb5eee2f161d578ad575d62b59d0c68ad904
@@ -6345,17 +16106,17 @@ Date:   Fri Aug 22 14:28:52 2008 +0200
 
     * change the type of the HklHolder list in the HklGeometry
 
- include/hkl/hkl-geometry.h |    3 +-
- include/hkl/hkl-holder.h   |    7 ++--
- src/hkl-detector.c         |    2 +-
- src/hkl-geometry.c         |   40 ++++++++++---------------
- src/hkl-holder.c           |   46 ++++++++++------------------
- src/hkl-pseudoaxis-auto.c  |    2 +-
- src/hkl-pseudoaxis.c       |    2 +-
- src/hkl-sample.c           |    4 +-
- test/hkl-test-geometry.c   |    9 ++---
- test/hkl-test-holder.c     |   70 +++++++++++++++++++++----------------------
- test/main.c                |    2 +-
+ include/hkl/hkl-geometry.h |  3 +-
+ include/hkl/hkl-holder.h   |  7 ++---
+ src/hkl-detector.c         |  2 +-
+ src/hkl-geometry.c         | 40 +++++++++++---------------
+ src/hkl-holder.c           | 46 +++++++++++-------------------
+ src/hkl-pseudoaxis-auto.c  |  2 +-
+ src/hkl-pseudoaxis.c       |  2 +-
+ src/hkl-sample.c           |  4 +--
+ test/hkl-test-geometry.c   |  9 +++---
+ test/hkl-test-holder.c     | 70 ++++++++++++++++++++++------------------------
+ test/main.c                |  2 +-
  11 files changed, 82 insertions(+), 105 deletions(-)
 
 commit f601b9cdd4f19bc8924c913d4f72c730f57b56e7
@@ -6364,15 +16125,15 @@ Date:   Fri Aug 22 13:41:45 2008 +0200
 
     * idem for the source
 
- include/hkl/hkl-geometry.h |    2 +-
- include/hkl/hkl-source.h   |   12 ++-----
- src/hkl-detector.c         |    2 +-
- src/hkl-geometry.c         |    6 +--
- src/hkl-pseudoaxis-auto.c  |    2 +-
- src/hkl-pseudoaxis.c       |    2 +-
- src/hkl-sample.c           |    2 +-
- src/hkl-source.c           |   75 ++++++++----------------------------------
- test/hkl-test-source.c     |   77 ++++++++++++++------------------------------
+ include/hkl/hkl-geometry.h |  2 +-
+ include/hkl/hkl-source.h   | 12 ++------
+ src/hkl-detector.c         |  2 +-
+ src/hkl-geometry.c         |  6 ++--
+ src/hkl-pseudoaxis-auto.c  |  2 +-
+ src/hkl-pseudoaxis.c       |  2 +-
+ src/hkl-sample.c           |  2 +-
+ src/hkl-source.c           | 75 +++++++++-----------------------------------
+ test/hkl-test-source.c     | 77 +++++++++++++++-------------------------------
  9 files changed, 48 insertions(+), 132 deletions(-)
 
 commit 41c7c35790f7f162483d6ac8e79fae97c5c938f7
@@ -6381,16 +16142,16 @@ Date:   Fri Aug 22 10:07:49 2008 +0200
 
     * idem for quaternions
 
- include/hkl/hkl-holder.h     |    2 +-
- include/hkl/hkl-quaternion.h |   10 ++--------
- src/hkl-detector.c           |    2 +-
- src/hkl-holder.c             |    9 ++++-----
- src/hkl-pseudoaxis-auto.c    |    2 +-
- src/hkl-pseudoaxis.c         |    2 +-
- src/hkl-quaternion.c         |   32 +-------------------------------
- src/hkl-sample.c             |    4 ++--
- test/hkl-test-holder.c       |   16 ++++++++--------
- test/hkl-test-quaternion.c   |   33 ++++++++-------------------------
+ include/hkl/hkl-holder.h     |  2 +-
+ include/hkl/hkl-quaternion.h | 10 ++--------
+ src/hkl-detector.c           |  2 +-
+ src/hkl-holder.c             |  9 ++++-----
+ src/hkl-pseudoaxis-auto.c    |  2 +-
+ src/hkl-pseudoaxis.c         |  2 +-
+ src/hkl-quaternion.c         | 32 +-------------------------------
+ src/hkl-sample.c             |  4 ++--
+ test/hkl-test-holder.c       | 16 ++++++++--------
+ test/hkl-test-quaternion.c   | 33 ++++++++-------------------------
  10 files changed, 29 insertions(+), 83 deletions(-)
 
 commit 0656b8f4b7386dd6ae3b7947758b89f9ff171750
@@ -6399,14 +16160,14 @@ Date:   Fri Aug 22 10:00:58 2008 +0200
 
     *idem for the HklMatrix
 
- include/hkl/hkl-matrix.h  |   11 +-------
- include/hkl/hkl-sample.h  |    4 +-
- src/hkl-matrix.c          |   48 ++++--------------------------------
- src/hkl-pseudoaxis-auto.c |    2 +-
- src/hkl-pseudoaxis.c      |    2 +-
- src/hkl-sample.c          |   24 ++++++++----------
- test/hkl-test-matrix.c    |   59 +++++++++++++-------------------------------
- test/hkl-test-sample.c    |    6 ++--
+ include/hkl/hkl-matrix.h  | 11 ++-------
+ include/hkl/hkl-sample.h  |  4 ++--
+ src/hkl-matrix.c          | 48 +++++---------------------------------
+ src/hkl-pseudoaxis-auto.c |  2 +-
+ src/hkl-pseudoaxis.c      |  2 +-
+ src/hkl-sample.c          | 24 +++++++++----------
+ test/hkl-test-matrix.c    | 59 +++++++++++++++--------------------------------
+ test/hkl-test-sample.c    |  6 ++---
  8 files changed, 44 insertions(+), 112 deletions(-)
 
 commit a2f666a279147533a4af3f32a93457377848fe38
@@ -6415,16 +16176,16 @@ Date:   Fri Aug 22 09:36:23 2008 +0200
 
     * use Hklvector as a struct no more pointer in other struct.
 
- include/hkl/hkl-source.h |    2 +-
- include/hkl/hkl-vector.h |    7 +------
- src/hkl-detector.c       |    2 +-
- src/hkl-pseudoaxis.c     |    2 +-
- src/hkl-source.c         |   13 ++++++-------
- src/hkl-vector.c         |   35 +----------------------------------
- test/hkl-test-axis.c     |   24 ++++++++----------------
- test/hkl-test-holder.c   |   10 ++++------
- test/hkl-test-source.c   |   14 +++++++-------
- test/hkl-test-vector.c   |   40 +++-------------------------------------
+ include/hkl/hkl-source.h |  2 +-
+ include/hkl/hkl-vector.h |  7 +------
+ src/hkl-detector.c       |  2 +-
+ src/hkl-pseudoaxis.c     |  2 +-
+ src/hkl-source.c         | 13 ++++++-------
+ src/hkl-vector.c         | 35 +----------------------------------
+ test/hkl-test-axis.c     | 24 ++++++++----------------
+ test/hkl-test-holder.c   | 10 ++++------
+ test/hkl-test-source.c   | 14 +++++++-------
+ test/hkl-test-vector.c   | 40 +++-------------------------------------
  10 files changed, 33 insertions(+), 116 deletions(-)
 
 commit 4314c1f5b42ed3187a964bd7c682c097773c4d0d
@@ -6433,10 +16194,10 @@ Date:   Mon Jun 16 15:30:23 2008 +0200
 
     * move the hkl common part to the pseudoAxis.c file
 
- include/hkl/hkl-pseudoaxis-E4CV.h |   56 +-----------------------------------
- include/hkl/hkl-pseudoaxis.h      |    2 +
- src/hkl-pseudoaxis-auto.c         |    6 ++--
- src/hkl-pseudoaxis.c              |   52 ++++++++++++++++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis-E4CV.h | 56 ++-------------------------------------
+ include/hkl/hkl-pseudoaxis.h      |  2 ++
+ src/hkl-pseudoaxis-auto.c         |  6 ++---
+ src/hkl-pseudoaxis.c              | 52 ++++++++++++++++++++++++++++++++++++
  4 files changed, 59 insertions(+), 57 deletions(-)
 
 commit 1495158d7f152769ff977850ca25d6f705075f0d
@@ -6445,11 +16206,11 @@ Date:   Fri Jun 13 15:46:28 2008 +0200
 
     * add the pseudoAxisEngineFunc class to help deal with more pseudoAxes.
 
- include/hkl/hkl-pseudoaxis-E4CV.h |  109 ++++++++++++++++++++++++++++
- include/hkl/hkl-pseudoaxis.h      |   27 ++++++--
- src/hkl-pseudoaxis-auto.c         |  143 +++++++------------------------------
- src/hkl-pseudoaxis.c              |   15 +++--
- test/hkl-test-pseudoaxis.c        |   14 +++-
+ include/hkl/hkl-pseudoaxis-E4CV.h | 109 +++++++++++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis.h      |  27 +++++--
+ src/hkl-pseudoaxis-auto.c         | 143 +++++++-------------------------------
+ src/hkl-pseudoaxis.c              |  15 ++--
+ test/hkl-test-pseudoaxis.c        |  14 ++--
  5 files changed, 175 insertions(+), 133 deletions(-)
 
 commit 999a74ed397bb2cc32573f77f5aa01357f3a3eb5
@@ -6458,8 +16219,8 @@ Date:   Fri Jun 13 13:53:26 2008 +0200
 
     * split the auto_equiv_geometries in 4 functions.
 
- src/hkl-pseudoaxis-auto.c |  252 ++++++++++++++++++++++++++++-----------------
- 1 files changed, 157 insertions(+), 95 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 252 +++++++++++++++++++++++++++++-----------------
+ 1 file changed, 157 insertions(+), 95 deletions(-)
 
 commit c2717261e06481b77c2357d029205de363a3b1ec
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6467,9 +16228,9 @@ Date:   Fri Jun 13 11:49:38 2008 +0200
 
     * add a get_axis_const to the HklGeometry class.
 
- include/hkl/hkl-geometry.h |    2 ++
- src/hkl-geometry.c         |    9 +++++++++
- 2 files changed, 11 insertions(+), 0 deletions(-)
+ include/hkl/hkl-geometry.h | 2 ++
+ src/hkl-geometry.c         | 9 +++++++++
+ 2 files changed, 11 insertions(+)
 
 commit 667e007db7162bd6374f3d92b270c6d78d4e3b57
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6477,8 +16238,8 @@ Date:   Fri Jun 13 10:08:53 2008 +0200
 
     * bug in the holder test suite
 
- test/hkl-test-holder.c |    7 +++++--
- 1 files changed, 5 insertions(+), 2 deletions(-)
+ test/hkl-test-holder.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
 
 commit 4bc1df996dfa200dac8e69c9bdd149b30aba6d64
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6489,11 +16250,11 @@ Date:   Fri Jun 13 09:20:29 2008 +0200
     Now from one solution the equiv_geometry gives you the other solutions
     in the different quadrant of [0 2pi] for each axis.
 
- include/hkl/hkl-pseudoaxis.h |    3 +
- src/SConscript               |    3 +-
- src/hkl-pseudoaxis-auto.c    |  152 +++++++++++++++++++++++++++++++++++++++--
- src/hkl-pseudoaxis.c         |    5 ++
- test/hkl-test-pseudoaxis.c   |  150 +++++++++++++++++++++++++++--------------
+ include/hkl/hkl-pseudoaxis.h |   3 +
+ src/SConscript               |   3 +-
+ src/hkl-pseudoaxis-auto.c    | 152 ++++++++++++++++++++++++++++++++++++++++---
+ src/hkl-pseudoaxis.c         |   5 ++
+ test/hkl-test-pseudoaxis.c   | 150 +++++++++++++++++++++++++++---------------
  5 files changed, 252 insertions(+), 61 deletions(-)
 
 commit e9e449928e3a3e6126c7da9e98c79cada4c5bf5d
@@ -6504,8 +16265,8 @@ Date:   Thu Jun 12 17:55:22 2008 +0200
     
     No more [-pi pi] conversion of the angles.
 
- src/hkl-geometry.c |    8 +++++---
- 1 files changed, 5 insertions(+), 3 deletions(-)
+ src/hkl-geometry.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
 
 commit 82d18573131af57907dc38996d6f3ab27ef5cd79
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6513,8 +16274,8 @@ Date:   Thu Jun 12 17:53:51 2008 +0200
 
     * correct the kappa geometries
 
- include/hkl/hkl-geometry-factory.h |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ include/hkl/hkl-geometry-factory.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit 232aaa388e9e94edd8b8cdcd059bac9203000864
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6522,9 +16283,9 @@ Date:   Tue Jun 10 13:36:28 2008 +0200
 
     * add a printf method to the Geometry class.
 
- include/hkl/hkl-geometry.h |    2 ++
- src/hkl-geometry.c         |   16 +++++++++++++++-
- 2 files changed, 17 insertions(+), 1 deletions(-)
+ include/hkl/hkl-geometry.h |  2 ++
+ src/hkl-geometry.c         | 16 +++++++++++++++-
+ 2 files changed, 17 insertions(+), 1 deletion(-)
 
 commit 3423efbc9ce2807c52dfdf72350e5e4bfefc12de
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6532,8 +16293,8 @@ Date:   Tue Jun 10 09:43:28 2008 +0200
 
     * remove an unneeded part in the pseudoAxis
 
- src/hkl-pseudoaxis-auto.c |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 1 -
+ 1 file changed, 1 deletion(-)
 
 commit 92c8bf89b4020498d845e355964498ca3e797756
 Merge: 6da710f 7b690cb
@@ -6548,8 +16309,8 @@ Date:   Fri Jun 6 15:27:58 2008 +0200
 
     *remove useless method in the PseudoAxesEngine class
 
- include/hkl/hkl-pseudoaxis.h |    5 -----
- 1 files changed, 0 insertions(+), 5 deletions(-)
+ include/hkl/hkl-pseudoaxis.h | 5 -----
+ 1 file changed, 5 deletions(-)
 
 commit 5e3bace68d4ec7b4747244a1e537715c336e8e39
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6561,19 +16322,19 @@ Date:   Fri Jun 6 14:48:20 2008 +0200
     If you have de current and consign part you need to use two different
     geometry to store the current value and the consign values.
 
- include/hkl/hkl-axis.h     |    6 +---
- include/hkl/hkl-detector.h |    2 +-
- include/hkl/hkl-holder.h   |    4 +--
- src/hkl-axis.c             |    9 ++----
- src/hkl-detector.c         |    6 +---
- src/hkl-holder.c           |   21 +++-----------
- src/hkl-pseudoaxis-auto.c  |   60 +++++++++++-------------------------------
- test/hkl-test-axis.c       |   32 ++++++----------------
- test/hkl-test-detector.c   |   10 ++-----
- test/hkl-test-geometry.c   |    3 +-
- test/hkl-test-holder.c     |   62 +-------------------------------------------
- test/hkl-test-pseudoaxis.c |   46 +++++++++-----------------------
- test/hkl-test-sample.c     |   16 +++++-----
+ include/hkl/hkl-axis.h     |  6 ++---
+ include/hkl/hkl-detector.h |  2 +-
+ include/hkl/hkl-holder.h   |  4 +--
+ src/hkl-axis.c             |  9 +++----
+ src/hkl-detector.c         |  6 ++---
+ src/hkl-holder.c           | 21 ++++------------
+ src/hkl-pseudoaxis-auto.c  | 60 ++++++++++++--------------------------------
+ test/hkl-test-axis.c       | 32 +++++++-----------------
+ test/hkl-test-detector.c   | 10 +++-----
+ test/hkl-test-geometry.c   |  3 +--
+ test/hkl-test-holder.c     | 62 +---------------------------------------------
+ test/hkl-test-pseudoaxis.c | 46 ++++++++++------------------------
+ test/hkl-test-sample.c     | 16 ++++++------
  13 files changed, 65 insertions(+), 212 deletions(-)
 
 commit ab6a91e74cc7b6a734179b02f3616e6f16746663
@@ -6772,7 +16533,7 @@ Date:   Fri Jun 6 14:23:36 2008 +0200
  test/twoC_vertical_pseudoaxeengine_test.h         |   32 -
  test/value_test.cpp                               |  105 -
  test/value_test.h                                 |   39 -
- 190 files changed, 0 insertions(+), 35429 deletions(-)
+ 190 files changed, 35429 deletions(-)
 
 commit f22e9f09857904521d6f4a17a121979090692110
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6780,8 +16541,8 @@ Date:   Thu Jun 5 16:53:10 2008 +0200
 
     * split the bissector mode in two parts hkl + mode
 
- src/hkl-pseudoaxis-auto.c |  161 +++++++++++++++++++++++----------------------
- 1 files changed, 81 insertions(+), 80 deletions(-)
+ src/hkl-pseudoaxis-auto.c | 161 +++++++++++++++++++++++-----------------------
+ 1 file changed, 81 insertions(+), 80 deletions(-)
 
 commit 3b2b4b28ad6d143d9678b2af2c75f3c01ad0a4d9
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6789,8 +16550,8 @@ Date:   Thu Jun 5 15:18:29 2008 +0200
 
     *  now the pseudoAxes works for on the current and consign part.
 
- src/hkl-pseudoaxis-auto.c  |   60 +++++++++++++++++++++++++++++++++++--------
- test/hkl-test-pseudoaxis.c |   22 ++++++++++++++-
+ src/hkl-pseudoaxis-auto.c  | 60 +++++++++++++++++++++++++++++++++++++---------
+ test/hkl-test-pseudoaxis.c | 22 +++++++++++++++--
  2 files changed, 69 insertions(+), 13 deletions(-)
 
 commit 784ec30dcdec2c3ee17105c274d81f0ac2403cd4
@@ -6801,9 +16562,9 @@ Date:   Thu Jun 5 13:46:48 2008 +0200
     
     fuzion of set and set_pseudoAxes in the HklPseudoAxesEngine class.
 
- include/hkl/hkl-pseudoaxis.h |    4 +--
- src/hkl-pseudoaxis.c         |   44 ++++++++++++++++++++---------------------
- test/hkl-test-pseudoaxis.c   |    7 ++---
+ include/hkl/hkl-pseudoaxis.h |  4 +---
+ src/hkl-pseudoaxis.c         | 44 +++++++++++++++++++++-----------------------
+ test/hkl-test-pseudoaxis.c   |  7 +++----
  3 files changed, 25 insertions(+), 30 deletions(-)
 
 commit e5b404294127c44068eaf0e48613d361c809839b
@@ -6812,11 +16573,11 @@ Date:   Thu Jun 5 10:42:09 2008 +0200
 
     * start refactoring the pseudoAxes code.
 
- include/hkl/hkl-pseudoaxis.h |   49 +++++---
- src/SConscript               |    1 +
- src/hkl-pseudoaxis-auto.c    |  223 ++++++++++++++++++++++++++++++++++
- src/hkl-pseudoaxis.c         |  272 +++++++++---------------------------------
- test/hkl-test-pseudoaxis.c   |   53 +++++----
+ include/hkl/hkl-pseudoaxis.h |  49 ++++----
+ src/SConscript               |   1 +
+ src/hkl-pseudoaxis-auto.c    | 223 +++++++++++++++++++++++++++++++++++
+ src/hkl-pseudoaxis.c         | 272 +++++++++----------------------------------
+ test/hkl-test-pseudoaxis.c   |  53 +++++----
  5 files changed, 336 insertions(+), 262 deletions(-)
 
 commit 220d4461fc1e8bc7f3d24d915deee320ee0c4f03
@@ -6825,8 +16586,8 @@ Date:   Tue Jun 3 10:57:48 2008 +0200
 
     * add a todo for optimizing the quaternion to matrix.
 
- src/hkl-quaternion.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ src/hkl-quaternion.c | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit d201fa3a264b57b85036c3e98c0ca317363848c4
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6834,8 +16595,8 @@ Date:   Tue Jun 3 10:52:34 2008 +0200
 
     * trivial refactoring in the quaternion class
 
- src/hkl-quaternion.c |    5 ++++-
- 1 files changed, 4 insertions(+), 1 deletions(-)
+ src/hkl-quaternion.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
 
 commit 632aef6586d54304a06b575ad464f3551a3320a1
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6843,8 +16604,8 @@ Date:   Tue Jun 3 09:37:27 2008 +0200
 
     * more readable quaternin to matrix method
 
- src/hkl-quaternion.c |   22 +++++++++++++---------
- 1 files changed, 13 insertions(+), 9 deletions(-)
+ src/hkl-quaternion.c | 22 +++++++++++++---------
+ 1 file changed, 13 insertions(+), 9 deletions(-)
 
 commit 86812ee058cb5dde446209be2c73b2b8f6ffec05
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6852,8 +16613,8 @@ Date:   Tue Jun 3 09:32:28 2008 +0200
 
     * modification of the quaternion times quaternion method to be readable.
 
- src/hkl-quaternion.c |   20 +++++++++++---------
- 1 files changed, 11 insertions(+), 9 deletions(-)
+ src/hkl-quaternion.c | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
 
 commit 5bc9efbd69efaa0357f593fdad2d8435b25d464e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6861,8 +16622,8 @@ Date:   Mon Jun 2 18:21:24 2008 +0200
 
     * small optimization in the quaternion class
 
- src/hkl-quaternion.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ src/hkl-quaternion.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit 62ade124087dc34efcfa5c1cf3b8661fe92cef08
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6870,8 +16631,8 @@ Date:   Mon Jun 2 17:54:05 2008 +0200
 
     * first working version of the pseudoAxeEngine set method.
 
- src/hkl-pseudoaxis.c       |   52 +++++++++++++++++++++++++++-----------------
- test/hkl-test-pseudoaxis.c |    2 +-
+ src/hkl-pseudoaxis.c       | 52 ++++++++++++++++++++++++++++------------------
+ test/hkl-test-pseudoaxis.c |  2 +-
  2 files changed, 33 insertions(+), 21 deletions(-)
 
 commit 7b690cbb90a247db980b3935d749fdc7986ef524
@@ -6882,8 +16643,8 @@ Date:   Thu May 8 11:21:25 2008 +0200
     
     gsl_inc_path and gsl_lib_path
 
- SConstruct |   18 +++++++++++-------
- 1 files changed, 11 insertions(+), 7 deletions(-)
+ SConstruct | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
 
 commit 56094b1c338b85aae82fb98e05e854e23e7c4dbe
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6891,9 +16652,9 @@ Date:   Thu May 8 11:09:08 2008 +0200
 
     * remove unneeded part of the Sconsfiles and build a shared library
 
- SConstruct      |   15 +++----------
- src/SConscript  |   57 ++----------------------------------------------------
- test/SConscript |    6 +---
+ SConstruct      | 15 ++++-----------
+ src/SConscript  | 57 +++------------------------------------------------------
+ test/SConscript |  6 ++----
  3 files changed, 9 insertions(+), 69 deletions(-)
 
 commit ee71ea3938c3c6d7508b379bd7043e1ba0dff9a0
@@ -6906,9 +16667,9 @@ Date:   Mon May 5 17:22:44 2008 +0200
     than the hybrids one. The algo is not robust enought for now. If I take
     1000 instead of 100 random test they fail. Need to find a better algo.
 
- include/hkl/hkl-pseudoaxis.h |    5 +-
- src/hkl-pseudoaxis.c         |  103 +++++++++++++++++++++--------------------
- test/hkl-test-pseudoaxis.c   |  105 ++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/hkl-pseudoaxis.h |   5 ++-
+ src/hkl-pseudoaxis.c         | 103 +++++++++++++++++++++---------------------
+ test/hkl-test-pseudoaxis.c   | 105 +++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 160 insertions(+), 53 deletions(-)
 
 commit aaf2e6309abf9ca76123b8fe34b5b5f13ab1982a
@@ -6917,10 +16678,10 @@ Date:   Thu May 1 12:51:48 2008 +0200
 
     * add the doc sconscript
 
- Documentation/SConscript |   10 +++++++++-
- SConstruct               |    6 ++++--
- include/SConscript       |   27 ---------------------------
- include/hkl/SConscript   |   26 ++++++++++++++++++++++++++
+ Documentation/SConscript | 10 +++++++++-
+ SConstruct               |  6 ++++--
+ include/SConscript       | 27 ---------------------------
+ include/hkl/SConscript   | 26 ++++++++++++++++++++++++++
  4 files changed, 39 insertions(+), 30 deletions(-)
 
 commit 522188b4dbd4a20c2c8da398f3ac55bdef195e1c
@@ -6931,11 +16692,11 @@ Date:   Thu May 1 12:22:57 2008 +0200
     
     need more work to install files at the right place
 
- SConstruct         |   22 +++++-
- include/SConscript |   27 +++++++
- src/SConscript     |    2 +-
- test/SConscript    |   40 +----------
- tool/doxygen.py    |  203 ----------------------------------------------------
+ SConstruct         |  22 ++++--
+ include/SConscript |  27 +++++++
+ src/SConscript     |   2 +-
+ test/SConscript    |  40 +----------
+ tool/doxygen.py    | 203 -----------------------------------------------------
  5 files changed, 48 insertions(+), 246 deletions(-)
 
 commit 4238087b43024b756a44357108bd0ceb83254cbb
@@ -6946,11 +16707,11 @@ Date:   Tue Apr 29 17:41:53 2008 +0200
     
     I added the test for the hkl pseudoAxes.
 
- README                               |    3 +-
- include/hkl/hkl-pseudoaxis-factory.h |    8 +-
- include/hkl/hkl-pseudoaxis.h         |   38 +++++--
- src/hkl-pseudoaxis.c                 |  217 +++++++++++++++++++++++++++++++++-
- test/hkl-test-pseudoaxis.c           |   96 +++++++++++++++
+ README                               |   3 +-
+ include/hkl/hkl-pseudoaxis-factory.h |   8 +-
+ include/hkl/hkl-pseudoaxis.h         |  38 ++++--
+ src/hkl-pseudoaxis.c                 | 217 ++++++++++++++++++++++++++++++++++-
+ test/hkl-test-pseudoaxis.c           |  96 ++++++++++++++++
  5 files changed, 344 insertions(+), 18 deletions(-)
 
 commit 745edd33148a0d9d3758e5b146a4f9d6c169eacb
@@ -6959,18 +16720,18 @@ Date:   Tue Apr 29 16:26:17 2008 +0200
 
     * add a HKL_ASSERT_POINTER_EQUAL and print the result of the failed test.
 
- test/hkl-test-axis.c       |   68 ++++++++++++++++++++++----------------------
- test/hkl-test-geometry.c   |   10 +++---
- test/hkl-test-holder.c     |    4 +-
- test/hkl-test-lattice.c    |    2 +-
- test/hkl-test-list.c       |   12 ++++----
- test/hkl-test-matrix.c     |   36 +++++++++++-----------
- test/hkl-test-parameter.c  |   22 +++++++-------
- test/hkl-test-quaternion.c |   18 ++++++------
- test/hkl-test-sample.c     |    2 +-
- test/hkl-test-source.c     |   28 ++++++++---------
- test/hkl-test-vector.c     |   18 ++++++------
- test/hkl-test.h            |   17 +++++++++-
+ test/hkl-test-axis.c       | 68 +++++++++++++++++++++++-----------------------
+ test/hkl-test-geometry.c   | 10 +++----
+ test/hkl-test-holder.c     |  4 +--
+ test/hkl-test-lattice.c    |  2 +-
+ test/hkl-test-list.c       | 12 ++++----
+ test/hkl-test-matrix.c     | 36 ++++++++++++------------
+ test/hkl-test-parameter.c  | 22 +++++++--------
+ test/hkl-test-quaternion.c | 18 ++++++------
+ test/hkl-test-sample.c     |  2 +-
+ test/hkl-test-source.c     | 28 +++++++++----------
+ test/hkl-test-vector.c     | 18 ++++++------
+ test/hkl-test.h            | 17 ++++++++++--
  12 files changed, 124 insertions(+), 113 deletions(-)
 
 commit 0d30f6d95868a70a09d3f2134743b877b680a473
@@ -6979,14 +16740,14 @@ Date:   Sun Mar 23 16:17:00 2008 +0100
 
     * first version of the HklPseudoAxisEngine
 
- include/hkl/hkl-pseudoaxis-factory.h |   42 +++++++++++++++
- include/hkl/hkl-pseudoaxis.h         |   56 ++++++++++++++++++++
- src/SConscript                       |    1 +
- src/hkl-pseudoaxis.c                 |   93 ++++++++++++++++++++++++++++++++++
- test/SConscript                      |    1 +
- test/hkl-test-pseudoaxis.c           |   27 ++++++++++
- test/main.c                          |    1 +
- 7 files changed, 221 insertions(+), 0 deletions(-)
+ include/hkl/hkl-pseudoaxis-factory.h | 42 ++++++++++++++++
+ include/hkl/hkl-pseudoaxis.h         | 56 ++++++++++++++++++++++
+ src/SConscript                       |  1 +
+ src/hkl-pseudoaxis.c                 | 93 ++++++++++++++++++++++++++++++++++++
+ test/SConscript                      |  1 +
+ test/hkl-test-pseudoaxis.c           | 27 +++++++++++
+ test/main.c                          |  1 +
+ 7 files changed, 221 insertions(+)
 
 commit a27341b1f4aea7adbb3a36a5dcb6ab1913170fa7
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -6994,11 +16755,11 @@ Date:   Sun Mar 23 15:33:26 2008 +0100
 
     * remove un-needed files
 
- include/hkl/hkl-diffractometer.h    |   33 -----------------------
- include/hkl/hkl-diffractometer_2C.h |   30 ---------------------
- src/SConscript                      |    1 -
- src/hkl-diffractometer.c            |   49 -----------------------------------
- 4 files changed, 0 insertions(+), 113 deletions(-)
+ include/hkl/hkl-diffractometer.h    | 33 -------------------------
+ include/hkl/hkl-diffractometer_2C.h | 30 -----------------------
+ src/SConscript                      |  1 -
+ src/hkl-diffractometer.c            | 49 -------------------------------------
+ 4 files changed, 113 deletions(-)
 
 commit 33283de9e18eb2caece98323f386637e474072cf
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7009,8 +16770,8 @@ Date:   Fri Mar 21 20:59:39 2008 +0100
     for now the default simplex method works when the setarting point is not to
     far from the solution.
 
- src/hkl-sample.c       |   18 +-----------------
- test/hkl-test-sample.c |    6 +++---
+ src/hkl-sample.c       | 18 +-----------------
+ test/hkl-test-sample.c |  6 +++---
  2 files changed, 4 insertions(+), 20 deletions(-)
 
 commit 8f4855b291865203e346f57635ee96b08a2203ee
@@ -7022,11 +16783,11 @@ Date:   Sun Mar 16 21:50:45 2008 +0100
     now the HKL_FAIL = -1 and HKL_SUCCESS = 0, the affinement do not handle
     the case of a wrong lattice computation during the simplex affinement.
 
- include/hkl/hkl-macros.h |    4 +-
- src/hkl-lattice.c        |   13 +++++--
- src/hkl-parameter.c      |    8 ++--
- src/hkl-sample.c         |   77 +++++++++++++++++++++++++++++++++------------
- test/hkl-test-sample.c   |   33 ++++++++++++++++++-
+ include/hkl/hkl-macros.h |  4 +--
+ src/hkl-lattice.c        | 13 +++++---
+ src/hkl-parameter.c      |  8 ++---
+ src/hkl-sample.c         | 77 +++++++++++++++++++++++++++++++++++-------------
+ test/hkl-test-sample.c   | 33 +++++++++++++++++++--
  5 files changed, 102 insertions(+), 33 deletions(-)
 
 commit 98dfdc59ae9b72784f9c6a759914d0c791cf4a44
@@ -7035,10 +16796,10 @@ Date:   Sun Mar 16 14:23:06 2008 +0100
 
     * add the first affinement method using GSL (simplex method)
 
- include/hkl/hkl-sample.h |    2 +-
- src/hkl-sample.c         |   90 +++++++++++++++++++++++-----------------------
- test/SConscript          |    2 +-
- test/hkl-test-sample.c   |   56 ++++++++++++++++++++++++++++
+ include/hkl/hkl-sample.h |  2 +-
+ src/hkl-sample.c         | 90 ++++++++++++++++++++++++------------------------
+ test/SConscript          |  2 +-
+ test/hkl-test-sample.c   | 56 ++++++++++++++++++++++++++++++
  4 files changed, 103 insertions(+), 47 deletions(-)
 
 commit 782780d56c8991efd6699732e28bd91bbbe14288
@@ -7047,8 +16808,8 @@ Date:   Sun Mar 16 12:47:14 2008 +0100
 
     * remove some warnings
 
- include/hkl/hkl-diffractometer_2C.h |   12 ++++++------
- src/hkl-diffractometer.c            |    4 ++--
+ include/hkl/hkl-diffractometer_2C.h | 12 ++++++------
+ src/hkl-diffractometer.c            |  4 ++--
  2 files changed, 8 insertions(+), 8 deletions(-)
 
 commit bd3e167f77c7380a098c35ba34ea8d98a823f067
@@ -7057,13 +16818,13 @@ Date:   Sat Mar 15 13:22:44 2008 +0100
 
     * hkl_smatrix -> hkl_matrix
 
- include/hkl/hkl-matrix.h   |   30 +++++++++++++++---------------
- src/hkl-matrix.c           |   34 +++++++++++++++++-----------------
- src/hkl-sample.c           |   32 ++++++++++++++++----------------
- test/hkl-test-lattice.c    |    2 +-
- test/hkl-test-matrix.c     |   38 +++++++++++++++++++-------------------
- test/hkl-test-quaternion.c |    2 +-
- test/hkl-test-sample.c     |    4 ++--
+ include/hkl/hkl-matrix.h   | 30 +++++++++++++++---------------
+ src/hkl-matrix.c           | 34 +++++++++++++++++-----------------
+ src/hkl-sample.c           | 32 ++++++++++++++++----------------
+ test/hkl-test-lattice.c    |  2 +-
+ test/hkl-test-matrix.c     | 38 +++++++++++++++++++-------------------
+ test/hkl-test-quaternion.c |  2 +-
+ test/hkl-test-sample.c     |  4 ++--
  7 files changed, 71 insertions(+), 71 deletions(-)
 
 commit b502da0fddd6e72e41ac129d256d4bce260d9eba
@@ -7074,8 +16835,8 @@ Date:   Fri Mar 14 17:04:32 2008 +0100
     
     clearer to read.
 
- src/hkl-matrix.c |  161 +++++++++++++++++++++++++++++++-----------------------
- 1 files changed, 92 insertions(+), 69 deletions(-)
+ src/hkl-matrix.c | 161 +++++++++++++++++++++++++++++++------------------------
+ 1 file changed, 92 insertions(+), 69 deletions(-)
 
 commit 4f21544482b1b2d1cdd56a4351e8fbf982244c0e
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7083,9 +16844,9 @@ Date:   Fri Mar 14 15:10:21 2008 +0100
 
     * now the busing et levy computation is working
 
- include/hkl/hkl-sample.h |   10 ++-
- src/hkl-sample.c         |  157 +++++++++++++++++++++++++++++++---------------
- test/hkl-test-sample.c   |   70 ++++++++++++++++++++-
+ include/hkl/hkl-sample.h |  10 ++-
+ src/hkl-sample.c         | 157 ++++++++++++++++++++++++++++++++---------------
+ test/hkl-test-sample.c   |  70 ++++++++++++++++++++-
  3 files changed, 183 insertions(+), 54 deletions(-)
 
 commit 244374b573bbef69fe5b43d48f9e7bf8d161f119
@@ -7094,8 +16855,8 @@ Date:   Thu Mar 13 16:59:11 2008 +0100
 
     * remove a bad bug in HklHolder
 
- src/hkl-holder.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-holder.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 9f210900302ffacd34c5eac9d89a35d06058ce72
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7105,9 +16866,9 @@ Date:   Thu Mar 13 12:04:57 2008 +0100
     
     add also the test functions, and some refactoring.
 
- include/hkl/hkl-matrix.h |   24 ++++++++++++++++---
- src/hkl-matrix.c         |   47 ++++++++++++++++++++++++++++++++++++++
- test/hkl-test-matrix.c   |   56 ++++++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/hkl-matrix.h | 24 +++++++++++++++++----
+ src/hkl-matrix.c         | 47 ++++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-matrix.c   | 56 ++++++++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 123 insertions(+), 4 deletions(-)
 
 commit ea8a14de604703fa07691582e8127b1ae7153dad
@@ -7116,11 +16877,11 @@ Date:   Wed Mar 12 14:46:02 2008 +0100
 
     * add the first HklSample structure.
 
- include/hkl/hkl-sample.h |   45 ++++++----
- src/hkl-sample.c         |  200 +++++++++++++++++++++++++++++++++++++++++-----
- test/SConscript          |    1 +
- test/hkl-test-sample.c   |  106 ++++++++++++++++++++++++
- test/main.c              |    1 +
+ include/hkl/hkl-sample.h |  45 ++++++-----
+ src/hkl-sample.c         | 200 ++++++++++++++++++++++++++++++++++++++++++-----
+ test/SConscript          |   1 +
+ test/hkl-test-sample.c   | 106 +++++++++++++++++++++++++
+ test/main.c              |   1 +
  5 files changed, 316 insertions(+), 37 deletions(-)
 
 commit 61992ee06ad1b4491a2ec61f8f9ab32d8d44dc4d
@@ -7129,10 +16890,10 @@ Date:   Thu Mar 6 15:47:34 2008 +0100
 
     * add the hkl_list_get_by_idx method
 
- include/hkl/hkl-list.h |    2 ++
- src/hkl-list.c         |    7 +++++++
- test/hkl-test-list.c   |   28 ++++++++++++++++++++++++++++
- 3 files changed, 37 insertions(+), 0 deletions(-)
+ include/hkl/hkl-list.h |  2 ++
+ src/hkl-list.c         |  7 +++++++
+ test/hkl-test-list.c   | 28 ++++++++++++++++++++++++++++
+ 3 files changed, 37 insertions(+)
 
 commit 8c29b7d9c05451979a6e84079dbe19c3ed6660a3
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7140,9 +16901,9 @@ Date:   Thu Mar 6 15:32:24 2008 +0100
 
     * modification of the managed list to allow easy new_copy.
 
- include/hkl/hkl-list.h |    5 +++-
- src/hkl-list.c         |   24 ++++++++++++++++++++-
- test/hkl-test-list.c   |   53 +++++++++++++++++++++++++++++++++++++++++++----
+ include/hkl/hkl-list.h |  5 ++++-
+ src/hkl-list.c         | 24 ++++++++++++++++++++++-
+ test/hkl-test-list.c   | 53 +++++++++++++++++++++++++++++++++++++++++++++-----
  3 files changed, 75 insertions(+), 7 deletions(-)
 
 commit 148843ad1bea637a7f0193809a973e1c4366874a
@@ -7151,9 +16912,9 @@ Date:   Thu Mar 6 13:42:05 2008 +0100
 
     * the new_copy method to the HklDetector structure
 
- include/hkl/hkl-detector.h |    1 +
- src/hkl-detector.c         |   10 ++++++++++
- 2 files changed, 11 insertions(+), 0 deletions(-)
+ include/hkl/hkl-detector.h |  1 +
+ src/hkl-detector.c         | 10 ++++++++++
+ 2 files changed, 11 insertions(+)
 
 commit b5b48196313238f6eae61423e226255cf4686ab4
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7169,8 +16930,8 @@ Date:   Wed Mar 5 16:21:49 2008 +0100
     HKL_GEOMETRY_EULERIAN6C,
     HKL_GEOMETRY_KAPPA6C
 
- include/hkl/hkl-geometry-factory.h |  124 ++++++++++++++++++++++++++++++++++++
- 1 files changed, 124 insertions(+), 0 deletions(-)
+ include/hkl/hkl-geometry-factory.h | 124 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 124 insertions(+)
 
 commit f61000fcd3c9ea4e0c75c353d15ba7840acd5939
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7180,12 +16941,12 @@ Date:   Wed Mar 5 14:49:59 2008 +0100
     
     only 0D detector now.
 
- include/hkl/hkl-detector.h |   24 ++++++++++++++
- src/SConscript             |    2 +-
- src/hkl-detector.c         |   37 +++++++++++++++++++++
- test/SConscript            |    2 +-
- test/hkl-test-detector.c   |   76 ++++++++++++++++++++++++++++++++++++++++++++
- test/main.c                |    2 +-
+ include/hkl/hkl-detector.h | 24 +++++++++++++++
+ src/SConscript             |  2 +-
+ src/hkl-detector.c         | 37 ++++++++++++++++++++++
+ test/SConscript            |  2 +-
+ test/hkl-test-detector.c   | 76 ++++++++++++++++++++++++++++++++++++++++++++++
+ test/main.c                |  2 +-
  6 files changed, 140 insertions(+), 3 deletions(-)
 
 commit 3485666cd6ccd0481b0ccb2f14dfbda3f3da9366
@@ -7194,10 +16955,10 @@ Date:   Wed Mar 5 14:10:12 2008 +0100
 
     * add get_axis and update to the HklGeometry struct with test methods
 
- include/hkl/hkl-geometry.h |    6 +++-
- src/hkl-geometry.c         |   20 ++++++++++++++
- test/hkl-test-geometry.c   |   60 ++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 85 insertions(+), 1 deletions(-)
+ include/hkl/hkl-geometry.h |  6 ++++-
+ src/hkl-geometry.c         | 20 ++++++++++++++++
+ test/hkl-test-geometry.c   | 60 ++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 85 insertions(+), 1 deletion(-)
 
 commit d40b4429052124fa61b9153d1d676e998abae4a6
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7207,14 +16968,14 @@ Date:   Wed Mar 5 13:48:05 2008 +0100
     
     hkl_vector_cmp return 0 is both vector are equals 1 otherwise
 
- include/hkl/hkl-holder.h   |    7 +++
- src/hkl-holder.c           |   50 +++++++++++++++++-
- src/hkl-vector.c           |    8 ++--
- test/hkl-test-holder.c     |  118 ++++++++++++++++++++++++++++++++++++-------
- test/hkl-test-matrix.c     |    2 +-
- test/hkl-test-quaternion.c |    4 +-
- test/hkl-test-source.c     |    2 +-
- test/hkl-test-vector.c     |   12 ++--
+ include/hkl/hkl-holder.h   |   7 +++
+ src/hkl-holder.c           |  50 +++++++++++++++++--
+ src/hkl-vector.c           |   8 +--
+ test/hkl-test-holder.c     | 118 +++++++++++++++++++++++++++++++++++++--------
+ test/hkl-test-matrix.c     |   2 +-
+ test/hkl-test-quaternion.c |   4 +-
+ test/hkl-test-source.c     |   2 +-
+ test/hkl-test-vector.c     |  12 ++---
  8 files changed, 166 insertions(+), 37 deletions(-)
 
 commit 7147a7f14b2d8269a10d358ae631032d9a5d0016
@@ -7223,8 +16984,8 @@ Date:   Wed Mar 5 11:21:06 2008 +0100
 
     * indentation
 
- src/usage.c |   32 ++++++++++++++++----------------
- 1 files changed, 16 insertions(+), 16 deletions(-)
+ src/usage.c | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
 
 commit 307a972dd1fecb5503a5df14d4b0bf6c917c4dc4
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7232,8 +16993,8 @@ Date:   Wed Mar 5 11:20:28 2008 +0100
 
     lest hkl-macros.h be compatible with c++
 
- include/hkl/hkl-macros.h |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ include/hkl/hkl-macros.h | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit cd34319de875c55a7d068fe65a319717b02887be
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7244,12 +17005,12 @@ Date:   Wed Mar 5 11:15:23 2008 +0100
     now an axis config contain a dirty flag that set by the set_config
     method. this flag is used to recompute or not the holders quaternions.
 
- include/hkl/hkl-axis.h |   10 +++
- src/hkl-axis.c         |   28 +++++++++-
- test/SConscript        |    1 +
- test/hkl-test-axis.c   |  146 ++++++++++++++++++++++++++++++++++++++++++++++++
- test/main.c            |    1 +
- 5 files changed, 185 insertions(+), 1 deletions(-)
+ include/hkl/hkl-axis.h |  10 ++++
+ src/hkl-axis.c         |  28 +++++++++-
+ test/SConscript        |   1 +
+ test/hkl-test-axis.c   | 146 +++++++++++++++++++++++++++++++++++++++++++++++++
+ test/main.c            |   1 +
+ 5 files changed, 185 insertions(+), 1 deletion(-)
 
 commit f2e19227d85247d9aad32f3a96141458193f705c
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7257,10 +17018,10 @@ Date:   Wed Feb 20 17:27:18 2008 +0100
 
     * add the new new_copy and set method to the Hklquaternion
 
- include/hkl/hkl-quaternion.h |    9 +++++++++
- src/hkl-quaternion.c         |   42 ++++++++++++++++++++++++++++++++++++++++++
- test/hkl-test-quaternion.c   |   31 +++++++++++++++++++++++++++++++
- 3 files changed, 82 insertions(+), 0 deletions(-)
+ include/hkl/hkl-quaternion.h |  9 +++++++++
+ src/hkl-quaternion.c         | 42 ++++++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-quaternion.c   | 31 +++++++++++++++++++++++++++++++
+ 3 files changed, 82 insertions(+)
 
 commit 2a3bd9739f85661ff4e19b3bc835f734abd6c951
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7268,13 +17029,13 @@ Date:   Mon Feb 11 17:32:00 2008 +0100
 
     * add a get_holder method to the geometry
 
- include/hkl/hkl-geometry.h |    1 +
- src/SConscript             |    3 ++-
- src/hkl-geometry.c         |    9 +++++++++
- test/SConscript            |    1 +
- test/hkl-test-geometry.c   |    3 +++
- test/main.c                |    1 +
- 6 files changed, 17 insertions(+), 1 deletions(-)
+ include/hkl/hkl-geometry.h | 1 +
+ src/SConscript             | 3 ++-
+ src/hkl-geometry.c         | 9 +++++++++
+ test/SConscript            | 1 +
+ test/hkl-test-geometry.c   | 3 +++
+ test/main.c                | 1 +
+ 6 files changed, 17 insertions(+), 1 deletion(-)
 
 commit 755158dd5431598bc71d1ccc061ede35bccef7e8
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7282,15 +17043,15 @@ Date:   Tue Feb 5 15:35:14 2008 +0100
 
     * remove the HklHolders an put directly in the HklGeometry
 
- include/hkl/hkl-geometry.h |   15 ++++++---
- include/hkl/hkl-holders.h  |   24 --------------
- src/SConscript             |    1 -
- src/hkl-geometry.c         |   73 +++++++++++++++++++++++++++++++++++++------
- src/hkl-holders.c          |   63 --------------------------------------
- test/SConscript            |    2 +-
- test/hkl-test-geometry.c   |   39 +++++++++++++++++++++++
- test/hkl-test-holders.c    |   39 -----------------------
- test/main.c                |    2 +-
+ include/hkl/hkl-geometry.h | 15 ++++++----
+ include/hkl/hkl-holders.h  | 24 ---------------
+ src/SConscript             |  1 -
+ src/hkl-geometry.c         | 73 +++++++++++++++++++++++++++++++++++++++-------
+ src/hkl-holders.c          | 63 ---------------------------------------
+ test/SConscript            |  2 +-
+ test/hkl-test-geometry.c   | 39 +++++++++++++++++++++++++
+ test/hkl-test-holders.c    | 39 -------------------------
+ test/main.c                |  2 +-
  9 files changed, 113 insertions(+), 145 deletions(-)
 
 commit 62efc16c24039ca5b38df67624104275f34d686c
@@ -7299,12 +17060,12 @@ Date:   Tue Feb 5 15:08:35 2008 +0100
 
     * add the copy constructor for HklHolder and HklHolders
 
- include/hkl/hkl-holder.h  |    1 +
- include/hkl/hkl-holders.h |    5 ++-
- src/hkl-holder.c          |   50 ++++++++++++++++++++++++++++++++++---------
- src/hkl-holders.c         |   33 +++++++++++++++++++++++++---
- src/usage.c               |   22 ++++++++++++++++++-
- test/hkl-test-holder.c    |   51 +++++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/hkl-holder.h  |  1 +
+ include/hkl/hkl-holders.h |  5 +++--
+ src/hkl-holder.c          | 50 ++++++++++++++++++++++++++++++++++++----------
+ src/hkl-holders.c         | 33 ++++++++++++++++++++++++++----
+ src/usage.c               | 22 +++++++++++++++++++-
+ test/hkl-test-holder.c    | 51 +++++++++++++++++++++++++++++++++++++++++++++++
  6 files changed, 144 insertions(+), 18 deletions(-)
 
 commit 72e02496a62b0404dd4f5a24f3e5f4e8c8105a7c
@@ -7313,10 +17074,10 @@ Date:   Tue Feb 5 13:54:57 2008 +0100
 
     * add get_idx in the HklList + test
 
- include/hkl/hkl-list.h |    2 ++
- src/hkl-list.c         |   11 +++++++++++
- test/hkl-test-list.c   |   18 ++++++++++++++++++
- 3 files changed, 31 insertions(+), 0 deletions(-)
+ include/hkl/hkl-list.h |  2 ++
+ src/hkl-list.c         | 11 +++++++++++
+ test/hkl-test-list.c   | 18 ++++++++++++++++++
+ 3 files changed, 31 insertions(+)
 
 commit b90077da68d58d8d208a603d00e8d2a89d915181
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7324,9 +17085,9 @@ Date:   Tue Feb 5 13:45:58 2008 +0100
 
     * add a copy contructor to HklAxis
 
- include/hkl/hkl-axis.h |    1 +
- src/hkl-axis.c         |   15 +++++++++++++++
- 2 files changed, 16 insertions(+), 0 deletions(-)
+ include/hkl/hkl-axis.h |  1 +
+ src/hkl-axis.c         | 15 +++++++++++++++
+ 2 files changed, 16 insertions(+)
 
 commit ab6a17715499959f1ce43e5ae55c72eb4ccc6cc2
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7334,8 +17095,8 @@ Date:   Tue Feb 5 09:07:09 2008 +0100
 
     * add the gitignore file
 
- .gitignore |    6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
+ .gitignore | 6 ++++++
+ 1 file changed, 6 insertions(+)
 
 commit 1c208475db11937a574c49639e655cb3f1c9f316
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7343,9 +17104,9 @@ Date:   Mon Feb 4 17:28:17 2008 +0100
 
     * now the managed list take a deallocator pointer function
 
- include/hkl/hkl-list.h |    4 ++--
- src/hkl-list.c         |   14 +++++++-------
- test/hkl-test-list.c   |    6 +++---
+ include/hkl/hkl-list.h |  4 ++--
+ src/hkl-list.c         | 14 +++++++-------
+ test/hkl-test-list.c   |  6 +++---
  3 files changed, 12 insertions(+), 12 deletions(-)
 
 commit 7a8e32b4a39ebab38d167c0c313f64b6ca596e69
@@ -7354,17 +17115,17 @@ Date:   Mon Feb 4 14:33:43 2008 +0100
 
     * remove the HklAxes struct
 
- include/hkl/hkl-axes.h    |   25 --------
- include/hkl/hkl-holder.h  |   11 ++-
- include/hkl/hkl-holders.h |    3 +-
- src/SConscript            |    5 +-
- src/hkl-axes.c            |   55 ------------------
- src/hkl-holder.c          |   54 +++++++++++++++--
- src/hkl-holders.c         |    8 +-
- test/SConscript           |    1 -
- test/hkl-test-axis.c      |  140 ---------------------------------------------
- test/hkl-test-holder.c    |  107 ++++++++++++++++++++++++++++++++--
- test/main.c               |    1 -
+ include/hkl/hkl-axes.h    |  25 ---------
+ include/hkl/hkl-holder.h  |  11 ++--
+ include/hkl/hkl-holders.h |   3 +-
+ src/SConscript            |   5 +-
+ src/hkl-axes.c            |  55 ------------------
+ src/hkl-holder.c          |  54 +++++++++++++++---
+ src/hkl-holders.c         |   8 +--
+ test/SConscript           |   1 -
+ test/hkl-test-axis.c      | 140 ----------------------------------------------
+ test/hkl-test-holder.c    | 107 +++++++++++++++++++++++++++++++++--
+ test/main.c               |   1 -
  11 files changed, 162 insertions(+), 248 deletions(-)
 
 commit 01c0e705098639320a1da1cf44bb4266cf689758
@@ -7373,11 +17134,11 @@ Date:   Mon Feb 4 13:58:07 2008 +0100
 
     * use HklList in the HklHolder and HklHolders struct.
 
- include/hkl/hkl-holder.h  |    8 +-------
- include/hkl/hkl-holders.h |    5 ++---
- src/hkl-holder.c          |   39 ++++++++-------------------------------
- src/hkl-holders.c         |   35 ++++++++++-------------------------
- test/hkl-test-holders.c   |    6 +++---
+ include/hkl/hkl-holder.h  |  8 +-------
+ include/hkl/hkl-holders.h |  5 ++---
+ src/hkl-holder.c          | 39 ++++++++-------------------------------
+ src/hkl-holders.c         | 35 ++++++++++-------------------------
+ test/hkl-test-holders.c   |  6 +++---
  5 files changed, 24 insertions(+), 69 deletions(-)
 
 commit 4e4d869d9498549380719006f5e58d1a7011eaac
@@ -7388,15 +17149,15 @@ Date:   Mon Feb 4 13:35:04 2008 +0100
     
     The aim of this refactoring is to supress HklAxes.
 
- include/hkl/hkl-axes.h    |   12 +++-------
- include/hkl/hkl-axis.h    |    4 ++-
- include/hkl/hkl-holder.h  |    5 ++-
- include/hkl/hkl-holders.h |    6 +----
- src/hkl-axes.c            |   51 ++++++++++++--------------------------------
- src/hkl-axis.c            |   16 +++++++++++++-
- src/hkl-holders.c         |   25 ++++++++-------------
- test/hkl-test-axis.c      |   31 +++++++++++++++------------
- test/hkl-test-holder.c    |    3 ++
+ include/hkl/hkl-axes.h    | 12 ++++-------
+ include/hkl/hkl-axis.h    |  4 +++-
+ include/hkl/hkl-holder.h  |  5 +++--
+ include/hkl/hkl-holders.h |  6 +-----
+ src/hkl-axes.c            | 51 +++++++++++++----------------------------------
+ src/hkl-axis.c            | 16 ++++++++++++++-
+ src/hkl-holders.c         | 25 ++++++++++-------------
+ test/hkl-test-axis.c      | 31 +++++++++++++++-------------
+ test/hkl-test-holder.c    |  3 +++
  9 files changed, 70 insertions(+), 83 deletions(-)
 
 commit ed89e10b8217b898b352e198afe3cd54cfb32f7e
@@ -7407,8 +17168,8 @@ Date:   Fri Feb 1 17:18:25 2008 +0100
     
     Now return 0 if success -1 otherwise.
 
- include/hkl/hkl-source.h |    9 +++++----
- src/hkl-source.c         |   11 ++++++++---
+ include/hkl/hkl-source.h |  9 +++++----
+ src/hkl-source.c         | 11 ++++++++---
  2 files changed, 13 insertions(+), 7 deletions(-)
 
 commit 19ac276128bae56edfc41a63af2dbb2fb442948f
@@ -7419,9 +17180,9 @@ Date:   Fri Feb 1 17:08:40 2008 +0100
     
     now the direction member is a pointer.
 
- include/hkl/hkl-source.h |   10 +++--
- src/hkl-source.c         |   74 ++++++++++++++++++++++++++----------------
- test/hkl-test-source.c   |   82 ++++++++++++++++++++++++++++++++++++---------
+ include/hkl/hkl-source.h | 10 +++---
+ src/hkl-source.c         | 74 ++++++++++++++++++++++++++-----------------
+ test/hkl-test-source.c   | 82 ++++++++++++++++++++++++++++++++++++++----------
  3 files changed, 117 insertions(+), 49 deletions(-)
 
 commit d342aa0eb04e735f07fb05a6ef059fe1f1360dbe
@@ -7432,11 +17193,11 @@ Date:   Fri Feb 1 14:28:40 2008 +0100
     
     now it use HklParameters* instead of HklParameter.
 
- include/hkl/hkl-lattice.h |   28 +++--
- src/hkl-lattice.c         |  310 +++++++++++++++++++++++++++------------------
- test/SConscript           |    2 +-
- test/hkl-test-lattice.c   |  199 ++++++++++++++++++-----------
- test/main.c               |    2 +-
+ include/hkl/hkl-lattice.h |  28 +++--
+ src/hkl-lattice.c         | 310 +++++++++++++++++++++++++++-------------------
+ test/SConscript           |   2 +-
+ test/hkl-test-lattice.c   | 199 +++++++++++++++++------------
+ test/main.c               |   2 +-
  5 files changed, 325 insertions(+), 216 deletions(-)
 
 commit 38eb424e1536c766c82c7e3b289234820075ac4c
@@ -7445,21 +17206,21 @@ Date:   Fri Feb 1 11:37:37 2008 +0100
 
     * svector -> vector normalization
 
- include/hkl/hkl-matrix.h     |    4 +-
- include/hkl/hkl-quaternion.h |    4 +-
- include/hkl/hkl-vector.h     |   49 ++++++++++--------
- src/SConscript               |    2 +-
- src/hkl-axes.c               |    2 +-
- src/hkl-matrix.c             |   14 +++---
- src/hkl-quaternion.c         |    8 ++--
- src/hkl-source.c             |   10 ++--
- src/hkl-vector.c             |  114 +++++++++++++++++++++++++++---------------
- test/SConscript              |    2 +-
- test/hkl-test-matrix.c       |   14 +++---
- test/hkl-test-quaternion.c   |   12 ++--
- test/hkl-test-source.c       |    2 +-
- test/hkl-test-vector.c       |  104 ++++++++++++++++++++++++++++----------
- test/main.c                  |    4 +-
+ include/hkl/hkl-matrix.h     |   4 +-
+ include/hkl/hkl-quaternion.h |   4 +-
+ include/hkl/hkl-vector.h     |  49 ++++++++++---------
+ src/SConscript               |   2 +-
+ src/hkl-axes.c               |   2 +-
+ src/hkl-matrix.c             |  14 +++---
+ src/hkl-quaternion.c         |   8 +--
+ src/hkl-source.c             |  10 ++--
+ src/hkl-vector.c             | 114 +++++++++++++++++++++++++++----------------
+ test/SConscript              |   2 +-
+ test/hkl-test-matrix.c       |  14 +++---
+ test/hkl-test-quaternion.c   |  12 ++---
+ test/hkl-test-source.c       |   2 +-
+ test/hkl-test-vector.c       | 104 ++++++++++++++++++++++++++++-----------
+ test/main.c                  |   4 +-
  15 files changed, 215 insertions(+), 130 deletions(-)
 
 commit 768f2403b92c34f39544a8d975f3a4a78eb6180d
@@ -7468,9 +17229,9 @@ Date:   Fri Feb 1 11:12:19 2008 +0100
 
     * add a new_copy method to the HklParameter struct
 
- include/hkl/hkl-parameter.h |   13 +++++----
- src/hkl-parameter.c         |   58 ++++++++++++++++++++++++++----------------
- test/hkl-test-parameter.c   |   48 ++++++++++++++++++++++++++---------
+ include/hkl/hkl-parameter.h | 13 +++++-----
+ src/hkl-parameter.c         | 58 ++++++++++++++++++++++++++++-----------------
+ test/hkl-test-parameter.c   | 48 +++++++++++++++++++++++++++----------
  3 files changed, 79 insertions(+), 40 deletions(-)
 
 commit 0af0377c2714a6162cd9ef12d55ccac5e9886bc4
@@ -7482,9 +17243,9 @@ Date:   Fri Feb 1 10:35:02 2008 +0100
     For now the HklList can only managed memory that must be
     release with a simple free.
 
- include/hkl/hkl-list.h |    9 +++++++++
- src/hkl-list.c         |   31 +++++++++++++++++++++++++++----
- test/hkl-test-list.c   |   37 +++++++++++++++++++++++++++++++++++--
+ include/hkl/hkl-list.h |  9 +++++++++
+ src/hkl-list.c         | 31 +++++++++++++++++++++++++++----
+ test/hkl-test-list.c   | 37 +++++++++++++++++++++++++++++++++++--
  3 files changed, 71 insertions(+), 6 deletions(-)
 
 commit 792c1634693c14e2214bc0c284dcda6b6637d149
@@ -7493,13 +17254,13 @@ Date:   Thu Jan 31 17:40:47 2008 +0100
 
     * add the hklList struct
 
- include/hkl/hkl-list.h |   28 ++++++++++++++++
- src/SConscript         |    2 +
- src/hkl-list.c         |   63 +++++++++++++++++++++++++++++++++++++
- test/SConscript        |    1 +
- test/hkl-test-list.c   |   81 ++++++++++++++++++++++++++++++++++++++++++++++++
- test/main.c            |    1 +
- 6 files changed, 176 insertions(+), 0 deletions(-)
+ include/hkl/hkl-list.h | 28 +++++++++++++++++
+ src/SConscript         |  2 ++
+ src/hkl-list.c         | 63 +++++++++++++++++++++++++++++++++++++++
+ test/SConscript        |  1 +
+ test/hkl-test-list.c   | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ test/main.c            |  1 +
+ 6 files changed, 176 insertions(+)
 
 commit af1efa92f594a8e8e9c32dc7905f34542b249dbf
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7507,8 +17268,8 @@ Date:   Thu Jan 31 13:23:10 2008 +0100
 
     * update the README file to explain the compilation procedure
 
- README |   40 ++++++++++------------------------------
- 1 files changed, 10 insertions(+), 30 deletions(-)
+ README | 40 ++++++++++------------------------------
+ 1 file changed, 10 insertions(+), 30 deletions(-)
 
 commit 0eead3f93fd48ed362aa582186e45b5f890a7dc7
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7516,213 +17277,213 @@ Date:   Thu Jan 31 11:56:59 2008 +0100
 
     * switch to 2008 year in the copyright
 
- include/hkl/HKLException.h                        |    2 +-
- include/hkl/HolderList.h                          |    2 +-
- include/hkl/affinement.h                          |    2 +-
- include/hkl/affinement_simplex.h                  |    2 +-
- include/hkl/affinementlist.h                      |    2 +-
- include/hkl/axe.h                                 |    2 +-
- include/hkl/axe_rotation.h                        |    2 +-
- include/hkl/axefactory.h                          |    2 +-
- include/hkl/constant.h                            |    2 +-
- include/hkl/convenience.h                         |    2 +-
- include/hkl/derived_mode.h                        |    2 +-
- include/hkl/derived_pseudoaxeengine.h             |    2 +-
- include/hkl/diffractometer.h                      |    2 +-
- include/hkl/diffractometerfactory.h               |    2 +-
- include/hkl/eulerian4C_vertical_diffractometer.h  |    2 +-
- include/hkl/eulerian4C_vertical_geometry.h        |    2 +-
- include/hkl/eulerian4C_vertical_mode.h            |    2 +-
- include/hkl/eulerian4C_vertical_pseudoaxeengine.h |    2 +-
- include/hkl/eulerian6C_diffractometer.h           |    2 +-
- include/hkl/eulerian6C_geometry.h                 |    2 +-
- include/hkl/eulerian6C_mode.h                     |    2 +-
- include/hkl/eulerian6C_pseudoaxeengine.h          |    2 +-
- include/hkl/fitparameter.h                        |    2 +-
- include/hkl/fitparameterlist.h                    |    2 +-
- include/hkl/geometry.h                            |    2 +-
- include/hkl/geometry_kappa.h                      |    2 +-
- include/hkl/hklobject.h                           |    2 +-
- include/hkl/holder.h                              |    2 +-
- include/hkl/interval.h                            |    2 +-
- include/hkl/kappa4C_vertical_diffractometer.h     |    2 +-
- include/hkl/kappa4C_vertical_geometry.h           |    2 +-
- include/hkl/kappa4C_vertical_mode.h               |    2 +-
- include/hkl/kappa4C_vertical_pseudoaxeengine.h    |    2 +-
- include/hkl/kappa6C_diffractometer.h              |    2 +-
- include/hkl/kappa6C_geometry.h                    |    2 +-
- include/hkl/kappa6C_mode.h                        |    2 +-
- include/hkl/kappa6C_pseudoaxeengine.h             |    2 +-
- include/hkl/lattice.h                             |    2 +-
- include/hkl/mode.h                                |    2 +-
- include/hkl/modelist.h                            |    2 +-
- include/hkl/mymap.h                               |    2 +-
- include/hkl/object.h                              |    2 +-
- include/hkl/observer.h                            |    2 +-
- include/hkl/parameter.h                           |    2 +-
- include/hkl/parameterlist.h                       |    2 +-
- include/hkl/portability.h                         |    2 +-
- include/hkl/pseudoaxe.h                           |    2 +-
- include/hkl/pseudoaxeengine.h                     |    2 +-
- include/hkl/pseudoaxeenginelist.h                 |    2 +-
- include/hkl/pseudoaxelist.h                       |    2 +-
- include/hkl/quaternion.h                          |    2 +-
- include/hkl/range.h                               |    2 +-
- include/hkl/reflection.h                          |    2 +-
- include/hkl/reflection_monocrystal.h              |    2 +-
- include/hkl/reflectionfactory.h                   |    2 +-
- include/hkl/reflectionlist.h                      |    2 +-
- include/hkl/sample.h                              |    2 +-
- include/hkl/sample_monocrystal.h                  |    2 +-
- include/hkl/samplefactory.h                       |    2 +-
- include/hkl/samplelist.h                          |    2 +-
- include/hkl/source.h                              |    2 +-
- include/hkl/strbuf.h                              |    2 +-
- include/hkl/svector.h                             |    2 +-
- include/hkl/twoC_vertical_diffractometer.h        |    2 +-
- include/hkl/twoC_vertical_geometry.h              |    2 +-
- include/hkl/twoC_vertical_mode.h                  |    2 +-
- include/hkl/twoC_vertical_pseudoaxeengine.h       |    2 +-
- include/hkl/value.h                               |    2 +-
- src/HKLException.cpp                              |    2 +-
- src/affinement.cpp                                |    2 +-
- src/affinement_simplex.cpp                        |    2 +-
- src/affinementlist.cpp                            |    2 +-
- src/axe.cpp                                       |    2 +-
- src/axe_rotation.cpp                              |    2 +-
- src/axefactory.cpp                                |    2 +-
- src/constant.cpp                                  |    2 +-
- src/convenience.cpp                               |    2 +-
- src/diffractometer.cpp                            |    2 +-
- src/diffractometerfactory.cpp                     |    2 +-
- src/eulerian4C_vertical_diffractometer.cpp        |    2 +-
- src/eulerian4C_vertical_geometry.cpp              |    2 +-
- src/eulerian4C_vertical_mode.cpp                  |    2 +-
- src/eulerian4C_vertical_pseudoaxeengine.cpp       |    2 +-
- src/eulerian6C_diffractometer.cpp                 |    2 +-
- src/eulerian6C_geometry.cpp                       |    2 +-
- src/eulerian6C_pseudoaxeengine.cpp                |    2 +-
- src/fitparameter.cpp                              |    2 +-
- src/fitparameterlist.cpp                          |    2 +-
- src/geometry.cpp                                  |    2 +-
- src/geometry_kappa.cpp                            |    2 +-
- src/hklobject.cpp                                 |    2 +-
- src/holder.cpp                                    |    2 +-
- src/interval.cpp                                  |    2 +-
- src/kappa4C_vertical_diffractometer.cpp           |    2 +-
- src/kappa4C_vertical_geometry.cpp                 |    2 +-
- src/kappa4C_vertical_pseudoaxeengine.cpp          |    2 +-
- src/kappa6C_diffractometer.cpp                    |    2 +-
- src/kappa6C_geometry.cpp                          |    2 +-
- src/lattice.cpp                                   |    2 +-
- src/mode.cpp                                      |    2 +-
- src/modelist.cpp                                  |    2 +-
- src/object.cpp                                    |    2 +-
- src/observer.cpp                                  |    2 +-
- src/parameter.cpp                                 |    2 +-
- src/parameterlist.cpp                             |    2 +-
- src/pseudoaxe.cpp                                 |    2 +-
- src/pseudoaxeengine.cpp                           |    2 +-
- src/pseudoaxeenginelist.cpp                       |    2 +-
- src/pseudoaxelist.cpp                             |    2 +-
- src/quaternion.cpp                                |    2 +-
- src/range.cpp                                     |    2 +-
- src/reflection.cpp                                |    2 +-
- src/reflection_monocrystal.cpp                    |    2 +-
- src/reflectionfactory.cpp                         |    2 +-
- src/reflectionlist.cpp                            |    2 +-
- src/sample.cpp                                    |    2 +-
- src/sample_monocrystal.cpp                        |    2 +-
- src/samplefactory.cpp                             |    2 +-
- src/samplelist.cpp                                |    2 +-
- src/source.cpp                                    |    2 +-
- src/strbuf.cpp                                    |    2 +-
- src/svector.cpp                                   |    2 +-
- src/twoC_vertical_diffractometer.cpp              |    2 +-
- src/twoC_vertical_geometry.cpp                    |    2 +-
- src/twoC_vertical_mode.cpp                        |    2 +-
- src/twoC_vertical_pseudoaxeengine.cpp             |    2 +-
- src/value.cpp                                     |    2 +-
- test/affinement_simplex_test.cpp                  |    2 +-
- test/affinement_simplex_test.h                    |    2 +-
- test/axe_rotation_test.cpp                        |    2 +-
- test/axe_rotation_test.h                          |    2 +-
- test/diffractometer_eulerian4C_test.cpp           |    2 +-
- test/diffractometer_eulerian4C_test.h             |    2 +-
- test/diffractometer_kappa4C_test.cpp              |    2 +-
- test/diffractometer_kappa4C_test.h                |    2 +-
- test/diffractometer_kappa6C_test.cpp              |    2 +-
- test/diffractometer_kappa6C_test.h                |    2 +-
- test/diffractometer_test.cpp                      |    2 +-
- test/diffractometer_test.h                        |    2 +-
- test/diffractometer_twoC_test.cpp                 |    2 +-
- test/diffractometer_twoC_test.h                   |    2 +-
- test/fitparameter_test.cpp                        |    2 +-
- test/fitparameter_test.h                          |    2 +-
- test/geometry_eulerian4C_test.cpp                 |    2 +-
- test/geometry_eulerian4C_test.h                   |    2 +-
- test/geometry_eulerian6C_test.cpp                 |    2 +-
- test/geometry_eulerian6C_test.h                   |    2 +-
- test/geometry_kappa4C_test.cpp                    |    2 +-
- test/geometry_kappa4C_test.h                      |    2 +-
- test/geometry_kappa6C_test.cpp                    |    2 +-
- test/geometry_kappa6C_test.h                      |    2 +-
- test/geometry_test.cpp                            |    2 +-
- test/geometry_test.h                              |    2 +-
- test/geometry_twoC_test.cpp                       |    2 +-
- test/geometry_twoC_test.h                         |    2 +-
- test/hklobject_test.cpp                           |    2 +-
- test/hklobject_test.h                             |    2 +-
- test/holder_test.cpp                              |    2 +-
- test/holder_test.h                                |    2 +-
- test/holderlist_test.cpp                          |    2 +-
- test/holderlist_test.h                            |    2 +-
- test/interval_test.cpp                            |    2 +-
- test/interval_test.h                              |    2 +-
- test/lattice_test.cpp                             |    2 +-
- test/lattice_test.h                               |    2 +-
- test/libHKL_test.cpp                              |    2 +-
- test/main.cpp                                     |    2 +-
- test/mode_eulerian4C_test.cpp                     |    2 +-
- test/mode_eulerian4C_test.h                       |    2 +-
- test/mode_kappa4C_test.cpp                        |    2 +-
- test/mode_kappa4C_test.h                          |    2 +-
- test/mode_kappa6C_test.cpp                        |    2 +-
- test/mode_kappa6C_test.h                          |    2 +-
- test/mode_twoC_test.cpp                           |    2 +-
- test/mode_twoC_test.h                             |    2 +-
- test/object_test.cpp                              |    2 +-
- test/object_test.h                                |    2 +-
- test/parameter_test.cpp                           |    2 +-
- test/parameter_test.h                             |    2 +-
- test/pseudoaxe_eulerian4C_test.cpp                |    2 +-
- test/pseudoaxe_eulerian4C_test.h                  |    2 +-
- test/pseudoaxe_eulerian6C_test.cpp                |    2 +-
- test/pseudoaxe_eulerian6C_test.h                  |    2 +-
- test/pseudoaxe_kappa4C_test.cpp                   |    2 +-
- test/pseudoaxe_kappa4C_test.h                     |    2 +-
- test/pseudoaxe_kappa6C_test.cpp                   |    2 +-
- test/pseudoaxe_kappa6C_test.h                     |    2 +-
- test/pseudoaxe_twoC_test.cpp                      |    2 +-
- test/pseudoaxe_twoC_test.h                        |    2 +-
- test/quaternion_test.cpp                          |    2 +-
- test/quaternion_test.h                            |    2 +-
- test/range_test.cpp                               |    2 +-
- test/range_test.h                                 |    2 +-
- test/reflection_test.cpp                          |    2 +-
- test/reflection_test.h                            |    2 +-
- test/reflectionlist_test.cpp                      |    2 +-
- test/reflectionlist_test.h                        |    2 +-
- test/sample_test.cpp                              |    2 +-
- test/sample_test.h                                |    2 +-
- test/samplelist_test.cpp                          |    2 +-
- test/samplelist_test.h                            |    2 +-
- test/source_test.cpp                              |    2 +-
- test/source_test.h                                |    2 +-
- test/svecmat_test.cpp                             |    2 +-
- test/svecmat_test.h                               |    2 +-
- test/value_test.cpp                               |    2 +-
- test/value_test.h                                 |    2 +-
+ include/hkl/HKLException.h                        | 2 +-
+ include/hkl/HolderList.h                          | 2 +-
+ include/hkl/affinement.h                          | 2 +-
+ include/hkl/affinement_simplex.h                  | 2 +-
+ include/hkl/affinementlist.h                      | 2 +-
+ include/hkl/axe.h                                 | 2 +-
+ include/hkl/axe_rotation.h                        | 2 +-
+ include/hkl/axefactory.h                          | 2 +-
+ include/hkl/constant.h                            | 2 +-
+ include/hkl/convenience.h                         | 2 +-
+ include/hkl/derived_mode.h                        | 2 +-
+ include/hkl/derived_pseudoaxeengine.h             | 2 +-
+ include/hkl/diffractometer.h                      | 2 +-
+ include/hkl/diffractometerfactory.h               | 2 +-
+ include/hkl/eulerian4C_vertical_diffractometer.h  | 2 +-
+ include/hkl/eulerian4C_vertical_geometry.h        | 2 +-
+ include/hkl/eulerian4C_vertical_mode.h            | 2 +-
+ include/hkl/eulerian4C_vertical_pseudoaxeengine.h | 2 +-
+ include/hkl/eulerian6C_diffractometer.h           | 2 +-
+ include/hkl/eulerian6C_geometry.h                 | 2 +-
+ include/hkl/eulerian6C_mode.h                     | 2 +-
+ include/hkl/eulerian6C_pseudoaxeengine.h          | 2 +-
+ include/hkl/fitparameter.h                        | 2 +-
+ include/hkl/fitparameterlist.h                    | 2 +-
+ include/hkl/geometry.h                            | 2 +-
+ include/hkl/geometry_kappa.h                      | 2 +-
+ include/hkl/hklobject.h                           | 2 +-
+ include/hkl/holder.h                              | 2 +-
+ include/hkl/interval.h                            | 2 +-
+ include/hkl/kappa4C_vertical_diffractometer.h     | 2 +-
+ include/hkl/kappa4C_vertical_geometry.h           | 2 +-
+ include/hkl/kappa4C_vertical_mode.h               | 2 +-
+ include/hkl/kappa4C_vertical_pseudoaxeengine.h    | 2 +-
+ include/hkl/kappa6C_diffractometer.h              | 2 +-
+ include/hkl/kappa6C_geometry.h                    | 2 +-
+ include/hkl/kappa6C_mode.h                        | 2 +-
+ include/hkl/kappa6C_pseudoaxeengine.h             | 2 +-
+ include/hkl/lattice.h                             | 2 +-
+ include/hkl/mode.h                                | 2 +-
+ include/hkl/modelist.h                            | 2 +-
+ include/hkl/mymap.h                               | 2 +-
+ include/hkl/object.h                              | 2 +-
+ include/hkl/observer.h                            | 2 +-
+ include/hkl/parameter.h                           | 2 +-
+ include/hkl/parameterlist.h                       | 2 +-
+ include/hkl/portability.h                         | 2 +-
+ include/hkl/pseudoaxe.h                           | 2 +-
+ include/hkl/pseudoaxeengine.h                     | 2 +-
+ include/hkl/pseudoaxeenginelist.h                 | 2 +-
+ include/hkl/pseudoaxelist.h                       | 2 +-
+ include/hkl/quaternion.h                          | 2 +-
+ include/hkl/range.h                               | 2 +-
+ include/hkl/reflection.h                          | 2 +-
+ include/hkl/reflection_monocrystal.h              | 2 +-
+ include/hkl/reflectionfactory.h                   | 2 +-
+ include/hkl/reflectionlist.h                      | 2 +-
+ include/hkl/sample.h                              | 2 +-
+ include/hkl/sample_monocrystal.h                  | 2 +-
+ include/hkl/samplefactory.h                       | 2 +-
+ include/hkl/samplelist.h                          | 2 +-
+ include/hkl/source.h                              | 2 +-
+ include/hkl/strbuf.h                              | 2 +-
+ include/hkl/svector.h                             | 2 +-
+ include/hkl/twoC_vertical_diffractometer.h        | 2 +-
+ include/hkl/twoC_vertical_geometry.h              | 2 +-
+ include/hkl/twoC_vertical_mode.h                  | 2 +-
+ include/hkl/twoC_vertical_pseudoaxeengine.h       | 2 +-
+ include/hkl/value.h                               | 2 +-
+ src/HKLException.cpp                              | 2 +-
+ src/affinement.cpp                                | 2 +-
+ src/affinement_simplex.cpp                        | 2 +-
+ src/affinementlist.cpp                            | 2 +-
+ src/axe.cpp                                       | 2 +-
+ src/axe_rotation.cpp                              | 2 +-
+ src/axefactory.cpp                                | 2 +-
+ src/constant.cpp                                  | 2 +-
+ src/convenience.cpp                               | 2 +-
+ src/diffractometer.cpp                            | 2 +-
+ src/diffractometerfactory.cpp                     | 2 +-
+ src/eulerian4C_vertical_diffractometer.cpp        | 2 +-
+ src/eulerian4C_vertical_geometry.cpp              | 2 +-
+ src/eulerian4C_vertical_mode.cpp                  | 2 +-
+ src/eulerian4C_vertical_pseudoaxeengine.cpp       | 2 +-
+ src/eulerian6C_diffractometer.cpp                 | 2 +-
+ src/eulerian6C_geometry.cpp                       | 2 +-
+ src/eulerian6C_pseudoaxeengine.cpp                | 2 +-
+ src/fitparameter.cpp                              | 2 +-
+ src/fitparameterlist.cpp                          | 2 +-
+ src/geometry.cpp                                  | 2 +-
+ src/geometry_kappa.cpp                            | 2 +-
+ src/hklobject.cpp                                 | 2 +-
+ src/holder.cpp                                    | 2 +-
+ src/interval.cpp                                  | 2 +-
+ src/kappa4C_vertical_diffractometer.cpp           | 2 +-
+ src/kappa4C_vertical_geometry.cpp                 | 2 +-
+ src/kappa4C_vertical_pseudoaxeengine.cpp          | 2 +-
+ src/kappa6C_diffractometer.cpp                    | 2 +-
+ src/kappa6C_geometry.cpp                          | 2 +-
+ src/lattice.cpp                                   | 2 +-
+ src/mode.cpp                                      | 2 +-
+ src/modelist.cpp                                  | 2 +-
+ src/object.cpp                                    | 2 +-
+ src/observer.cpp                                  | 2 +-
+ src/parameter.cpp                                 | 2 +-
+ src/parameterlist.cpp                             | 2 +-
+ src/pseudoaxe.cpp                                 | 2 +-
+ src/pseudoaxeengine.cpp                           | 2 +-
+ src/pseudoaxeenginelist.cpp                       | 2 +-
+ src/pseudoaxelist.cpp                             | 2 +-
+ src/quaternion.cpp                                | 2 +-
+ src/range.cpp                                     | 2 +-
+ src/reflection.cpp                                | 2 +-
+ src/reflection_monocrystal.cpp                    | 2 +-
+ src/reflectionfactory.cpp                         | 2 +-
+ src/reflectionlist.cpp                            | 2 +-
+ src/sample.cpp                                    | 2 +-
+ src/sample_monocrystal.cpp                        | 2 +-
+ src/samplefactory.cpp                             | 2 +-
+ src/samplelist.cpp                                | 2 +-
+ src/source.cpp                                    | 2 +-
+ src/strbuf.cpp                                    | 2 +-
+ src/svector.cpp                                   | 2 +-
+ src/twoC_vertical_diffractometer.cpp              | 2 +-
+ src/twoC_vertical_geometry.cpp                    | 2 +-
+ src/twoC_vertical_mode.cpp                        | 2 +-
+ src/twoC_vertical_pseudoaxeengine.cpp             | 2 +-
+ src/value.cpp                                     | 2 +-
+ test/affinement_simplex_test.cpp                  | 2 +-
+ test/affinement_simplex_test.h                    | 2 +-
+ test/axe_rotation_test.cpp                        | 2 +-
+ test/axe_rotation_test.h                          | 2 +-
+ test/diffractometer_eulerian4C_test.cpp           | 2 +-
+ test/diffractometer_eulerian4C_test.h             | 2 +-
+ test/diffractometer_kappa4C_test.cpp              | 2 +-
+ test/diffractometer_kappa4C_test.h                | 2 +-
+ test/diffractometer_kappa6C_test.cpp              | 2 +-
+ test/diffractometer_kappa6C_test.h                | 2 +-
+ test/diffractometer_test.cpp                      | 2 +-
+ test/diffractometer_test.h                        | 2 +-
+ test/diffractometer_twoC_test.cpp                 | 2 +-
+ test/diffractometer_twoC_test.h                   | 2 +-
+ test/fitparameter_test.cpp                        | 2 +-
+ test/fitparameter_test.h                          | 2 +-
+ test/geometry_eulerian4C_test.cpp                 | 2 +-
+ test/geometry_eulerian4C_test.h                   | 2 +-
+ test/geometry_eulerian6C_test.cpp                 | 2 +-
+ test/geometry_eulerian6C_test.h                   | 2 +-
+ test/geometry_kappa4C_test.cpp                    | 2 +-
+ test/geometry_kappa4C_test.h                      | 2 +-
+ test/geometry_kappa6C_test.cpp                    | 2 +-
+ test/geometry_kappa6C_test.h                      | 2 +-
+ test/geometry_test.cpp                            | 2 +-
+ test/geometry_test.h                              | 2 +-
+ test/geometry_twoC_test.cpp                       | 2 +-
+ test/geometry_twoC_test.h                         | 2 +-
+ test/hklobject_test.cpp                           | 2 +-
+ test/hklobject_test.h                             | 2 +-
+ test/holder_test.cpp                              | 2 +-
+ test/holder_test.h                                | 2 +-
+ test/holderlist_test.cpp                          | 2 +-
+ test/holderlist_test.h                            | 2 +-
+ test/interval_test.cpp                            | 2 +-
+ test/interval_test.h                              | 2 +-
+ test/lattice_test.cpp                             | 2 +-
+ test/lattice_test.h                               | 2 +-
+ test/libHKL_test.cpp                              | 2 +-
+ test/main.cpp                                     | 2 +-
+ test/mode_eulerian4C_test.cpp                     | 2 +-
+ test/mode_eulerian4C_test.h                       | 2 +-
+ test/mode_kappa4C_test.cpp                        | 2 +-
+ test/mode_kappa4C_test.h                          | 2 +-
+ test/mode_kappa6C_test.cpp                        | 2 +-
+ test/mode_kappa6C_test.h                          | 2 +-
+ test/mode_twoC_test.cpp                           | 2 +-
+ test/mode_twoC_test.h                             | 2 +-
+ test/object_test.cpp                              | 2 +-
+ test/object_test.h                                | 2 +-
+ test/parameter_test.cpp                           | 2 +-
+ test/parameter_test.h                             | 2 +-
+ test/pseudoaxe_eulerian4C_test.cpp                | 2 +-
+ test/pseudoaxe_eulerian4C_test.h                  | 2 +-
+ test/pseudoaxe_eulerian6C_test.cpp                | 2 +-
+ test/pseudoaxe_eulerian6C_test.h                  | 2 +-
+ test/pseudoaxe_kappa4C_test.cpp                   | 2 +-
+ test/pseudoaxe_kappa4C_test.h                     | 2 +-
+ test/pseudoaxe_kappa6C_test.cpp                   | 2 +-
+ test/pseudoaxe_kappa6C_test.h                     | 2 +-
+ test/pseudoaxe_twoC_test.cpp                      | 2 +-
+ test/pseudoaxe_twoC_test.h                        | 2 +-
+ test/quaternion_test.cpp                          | 2 +-
+ test/quaternion_test.h                            | 2 +-
+ test/range_test.cpp                               | 2 +-
+ test/range_test.h                                 | 2 +-
+ test/reflection_test.cpp                          | 2 +-
+ test/reflection_test.h                            | 2 +-
+ test/reflectionlist_test.cpp                      | 2 +-
+ test/reflectionlist_test.h                        | 2 +-
+ test/sample_test.cpp                              | 2 +-
+ test/sample_test.h                                | 2 +-
+ test/samplelist_test.cpp                          | 2 +-
+ test/samplelist_test.h                            | 2 +-
+ test/source_test.cpp                              | 2 +-
+ test/source_test.h                                | 2 +-
+ test/svecmat_test.cpp                             | 2 +-
+ test/svecmat_test.h                               | 2 +-
+ test/value_test.cpp                               | 2 +-
+ test/value_test.h                                 | 2 +-
  207 files changed, 207 insertions(+), 207 deletions(-)
 
 commit cb0e45c867e5cb8322a064d1c94c8060c186d6b4
@@ -7731,214 +17492,214 @@ Date:   Thu Jan 31 11:45:47 2008 +0100
 
     * add GPL 3 or + licence
 
- include/hkl/HKLException.h                        |   21 +++++++++++++++++++++
- include/hkl/HolderList.h                          |   21 +++++++++++++++++++++
- include/hkl/affinement.h                          |   21 +++++++++++++++++++++
- include/hkl/affinement_simplex.h                  |   21 +++++++++++++++++++++
- include/hkl/affinementlist.h                      |   21 +++++++++++++++++++++
- include/hkl/axe.h                                 |   21 +++++++++++++++++++++
- include/hkl/axe_rotation.h                        |   21 +++++++++++++++++++++
- include/hkl/axefactory.h                          |   21 +++++++++++++++++++++
- include/hkl/constant.h                            |   21 +++++++++++++++++++++
- include/hkl/convenience.h                         |   21 +++++++++++++++++++++
- include/hkl/derived_mode.h                        |   21 +++++++++++++++++++++
- include/hkl/derived_pseudoaxeengine.h             |   21 +++++++++++++++++++++
- include/hkl/diffractometer.h                      |   21 +++++++++++++++++++++
- include/hkl/diffractometerfactory.h               |   21 +++++++++++++++++++++
- include/hkl/eulerian4C_vertical_diffractometer.h  |   21 +++++++++++++++++++++
- include/hkl/eulerian4C_vertical_geometry.h        |   21 +++++++++++++++++++++
- include/hkl/eulerian4C_vertical_mode.h            |   21 +++++++++++++++++++++
- include/hkl/eulerian4C_vertical_pseudoaxeengine.h |   21 +++++++++++++++++++++
- include/hkl/eulerian6C_diffractometer.h           |   21 +++++++++++++++++++++
- include/hkl/eulerian6C_geometry.h                 |   21 +++++++++++++++++++++
- include/hkl/eulerian6C_mode.h                     |   21 +++++++++++++++++++++
- include/hkl/eulerian6C_pseudoaxeengine.h          |   21 +++++++++++++++++++++
- include/hkl/fitparameter.h                        |   21 +++++++++++++++++++++
- include/hkl/fitparameterlist.h                    |   21 +++++++++++++++++++++
- include/hkl/geometry.h                            |   21 +++++++++++++++++++++
- include/hkl/geometry_kappa.h                      |   21 +++++++++++++++++++++
- include/hkl/hklobject.h                           |   21 +++++++++++++++++++++
- include/hkl/holder.h                              |   21 +++++++++++++++++++++
- include/hkl/interval.h                            |   21 +++++++++++++++++++++
- include/hkl/kappa4C_vertical_diffractometer.h     |   21 +++++++++++++++++++++
- include/hkl/kappa4C_vertical_geometry.h           |   21 +++++++++++++++++++++
- include/hkl/kappa4C_vertical_mode.h               |   21 +++++++++++++++++++++
- include/hkl/kappa4C_vertical_pseudoaxeengine.h    |   21 +++++++++++++++++++++
- include/hkl/kappa6C_diffractometer.h              |   21 +++++++++++++++++++++
- include/hkl/kappa6C_geometry.h                    |   21 +++++++++++++++++++++
- include/hkl/kappa6C_mode.h                        |   21 +++++++++++++++++++++
- include/hkl/kappa6C_pseudoaxeengine.h             |   21 +++++++++++++++++++++
- include/hkl/lattice.h                             |   21 +++++++++++++++++++++
- include/hkl/mode.h                                |   21 +++++++++++++++++++++
- include/hkl/modelist.h                            |   21 +++++++++++++++++++++
- include/hkl/mymap.h                               |   21 +++++++++++++++++++++
- include/hkl/object.h                              |   21 +++++++++++++++++++++
- include/hkl/observer.h                            |   21 +++++++++++++++++++++
- include/hkl/parameter.h                           |   21 +++++++++++++++++++++
- include/hkl/parameterlist.h                       |   21 +++++++++++++++++++++
- include/hkl/portability.h                         |   21 +++++++++++++++++++++
- include/hkl/pseudoaxe.h                           |   21 +++++++++++++++++++++
- include/hkl/pseudoaxeengine.h                     |   21 +++++++++++++++++++++
- include/hkl/pseudoaxeenginelist.h                 |   21 +++++++++++++++++++++
- include/hkl/pseudoaxelist.h                       |   21 +++++++++++++++++++++
- include/hkl/quaternion.h                          |   21 +++++++++++++++++++++
- include/hkl/range.h                               |   21 +++++++++++++++++++++
- include/hkl/reflection.h                          |   21 +++++++++++++++++++++
- include/hkl/reflection_monocrystal.h              |   21 +++++++++++++++++++++
- include/hkl/reflectionfactory.h                   |   21 +++++++++++++++++++++
- include/hkl/reflectionlist.h                      |   21 +++++++++++++++++++++
- include/hkl/sample.h                              |   21 +++++++++++++++++++++
- include/hkl/sample_monocrystal.h                  |   21 +++++++++++++++++++++
- include/hkl/samplefactory.h                       |   21 +++++++++++++++++++++
- include/hkl/samplelist.h                          |   21 +++++++++++++++++++++
- include/hkl/source.h                              |   21 +++++++++++++++++++++
- include/hkl/strbuf.h                              |   21 +++++++++++++++++++++
- include/hkl/svector.h                             |   21 +++++++++++++++++++++
- include/hkl/twoC_vertical_diffractometer.h        |   21 +++++++++++++++++++++
- include/hkl/twoC_vertical_geometry.h              |   21 +++++++++++++++++++++
- include/hkl/twoC_vertical_mode.h                  |   21 +++++++++++++++++++++
- include/hkl/twoC_vertical_pseudoaxeengine.h       |   21 +++++++++++++++++++++
- include/hkl/value.h                               |   21 +++++++++++++++++++++
- src/HKLException.cpp                              |   21 +++++++++++++++++++++
- src/affinement.cpp                                |   21 +++++++++++++++++++++
- src/affinement_simplex.cpp                        |   21 +++++++++++++++++++++
- src/affinementlist.cpp                            |   21 +++++++++++++++++++++
- src/axe.cpp                                       |   21 +++++++++++++++++++++
- src/axe_rotation.cpp                              |   21 +++++++++++++++++++++
- src/axefactory.cpp                                |   21 +++++++++++++++++++++
- src/constant.cpp                                  |   21 +++++++++++++++++++++
- src/convenience.cpp                               |   21 +++++++++++++++++++++
- src/diffractometer.cpp                            |   21 +++++++++++++++++++++
- src/diffractometerfactory.cpp                     |   21 +++++++++++++++++++++
- src/eulerian4C_vertical_diffractometer.cpp        |   21 +++++++++++++++++++++
- src/eulerian4C_vertical_geometry.cpp              |   21 +++++++++++++++++++++
- src/eulerian4C_vertical_mode.cpp                  |   21 +++++++++++++++++++++
- src/eulerian4C_vertical_pseudoaxeengine.cpp       |   21 +++++++++++++++++++++
- src/eulerian6C_diffractometer.cpp                 |   21 +++++++++++++++++++++
- src/eulerian6C_geometry.cpp                       |   21 +++++++++++++++++++++
- src/eulerian6C_pseudoaxeengine.cpp                |   21 +++++++++++++++++++++
- src/fitparameter.cpp                              |   21 +++++++++++++++++++++
- src/fitparameterlist.cpp                          |   21 +++++++++++++++++++++
- src/geometry.cpp                                  |   21 +++++++++++++++++++++
- src/geometry_kappa.cpp                            |   21 +++++++++++++++++++++
- src/hklobject.cpp                                 |   21 +++++++++++++++++++++
- src/holder.cpp                                    |   21 +++++++++++++++++++++
- src/interval.cpp                                  |   21 +++++++++++++++++++++
- src/kappa4C_vertical_diffractometer.cpp           |   21 +++++++++++++++++++++
- src/kappa4C_vertical_geometry.cpp                 |   21 +++++++++++++++++++++
- src/kappa4C_vertical_pseudoaxeengine.cpp          |   21 +++++++++++++++++++++
- src/kappa6C_diffractometer.cpp                    |   21 +++++++++++++++++++++
- src/kappa6C_geometry.cpp                          |   21 +++++++++++++++++++++
- src/lattice.cpp                                   |   21 +++++++++++++++++++++
- src/mode.cpp                                      |   21 +++++++++++++++++++++
- src/modelist.cpp                                  |   21 +++++++++++++++++++++
- src/object.cpp                                    |   21 +++++++++++++++++++++
- src/observer.cpp                                  |   21 +++++++++++++++++++++
- src/parameter.cpp                                 |   21 +++++++++++++++++++++
- src/parameterlist.cpp                             |   21 +++++++++++++++++++++
- src/pseudoaxe.cpp                                 |   21 +++++++++++++++++++++
- src/pseudoaxeengine.cpp                           |   21 +++++++++++++++++++++
- src/pseudoaxeenginelist.cpp                       |   21 +++++++++++++++++++++
- src/pseudoaxelist.cpp                             |   21 +++++++++++++++++++++
- src/quaternion.cpp                                |   21 +++++++++++++++++++++
- src/range.cpp                                     |   21 +++++++++++++++++++++
- src/reflection.cpp                                |   21 +++++++++++++++++++++
- src/reflection_monocrystal.cpp                    |   21 +++++++++++++++++++++
- src/reflectionfactory.cpp                         |   21 +++++++++++++++++++++
- src/reflectionlist.cpp                            |   21 +++++++++++++++++++++
- src/sample.cpp                                    |   21 +++++++++++++++++++++
- src/sample_monocrystal.cpp                        |   21 +++++++++++++++++++++
- src/samplefactory.cpp                             |   21 +++++++++++++++++++++
- src/samplelist.cpp                                |   21 +++++++++++++++++++++
- src/source.cpp                                    |   21 +++++++++++++++++++++
- src/strbuf.cpp                                    |   21 +++++++++++++++++++++
- src/svector.cpp                                   |   21 +++++++++++++++++++++
- src/twoC_vertical_diffractometer.cpp              |   21 +++++++++++++++++++++
- src/twoC_vertical_geometry.cpp                    |   21 +++++++++++++++++++++
- src/twoC_vertical_mode.cpp                        |   21 +++++++++++++++++++++
- src/twoC_vertical_pseudoaxeengine.cpp             |   21 +++++++++++++++++++++
- src/value.cpp                                     |   21 +++++++++++++++++++++
- test/affinement_simplex_test.cpp                  |   21 +++++++++++++++++++++
- test/affinement_simplex_test.h                    |   21 +++++++++++++++++++++
- test/axe_rotation_test.cpp                        |   21 +++++++++++++++++++++
- test/axe_rotation_test.h                          |   21 +++++++++++++++++++++
- test/diffractometer_eulerian4C_test.cpp           |   21 +++++++++++++++++++++
- test/diffractometer_eulerian4C_test.h             |   21 +++++++++++++++++++++
- test/diffractometer_kappa4C_test.cpp              |   21 +++++++++++++++++++++
- test/diffractometer_kappa4C_test.h                |   21 +++++++++++++++++++++
- test/diffractometer_kappa6C_test.cpp              |   21 +++++++++++++++++++++
- test/diffractometer_kappa6C_test.h                |   21 +++++++++++++++++++++
- test/diffractometer_test.cpp                      |   21 +++++++++++++++++++++
- test/diffractometer_test.h                        |   21 +++++++++++++++++++++
- test/diffractometer_twoC_test.cpp                 |   21 +++++++++++++++++++++
- test/diffractometer_twoC_test.h                   |   21 +++++++++++++++++++++
- test/fitparameter_test.cpp                        |   21 +++++++++++++++++++++
- test/fitparameter_test.h                          |   21 +++++++++++++++++++++
- test/geometry_eulerian4C_test.cpp                 |   21 +++++++++++++++++++++
- test/geometry_eulerian4C_test.h                   |   21 +++++++++++++++++++++
- test/geometry_eulerian6C_test.cpp                 |   21 +++++++++++++++++++++
- test/geometry_eulerian6C_test.h                   |   21 +++++++++++++++++++++
- test/geometry_kappa4C_test.cpp                    |   21 +++++++++++++++++++++
- test/geometry_kappa4C_test.h                      |   21 +++++++++++++++++++++
- test/geometry_kappa6C_test.cpp                    |   21 +++++++++++++++++++++
- test/geometry_kappa6C_test.h                      |   21 +++++++++++++++++++++
- test/geometry_test.cpp                            |   21 +++++++++++++++++++++
- test/geometry_test.h                              |   21 +++++++++++++++++++++
- test/geometry_twoC_test.cpp                       |   21 +++++++++++++++++++++
- test/geometry_twoC_test.h                         |   21 +++++++++++++++++++++
- test/hklobject_test.cpp                           |   21 +++++++++++++++++++++
- test/hklobject_test.h                             |   21 +++++++++++++++++++++
- test/holder_test.cpp                              |   21 +++++++++++++++++++++
- test/holder_test.h                                |   21 +++++++++++++++++++++
- test/holderlist_test.cpp                          |   21 +++++++++++++++++++++
- test/holderlist_test.h                            |   21 +++++++++++++++++++++
- test/interval_test.cpp                            |   21 +++++++++++++++++++++
- test/interval_test.h                              |   21 +++++++++++++++++++++
- test/lattice_test.cpp                             |   21 +++++++++++++++++++++
- test/lattice_test.h                               |   21 +++++++++++++++++++++
- test/libHKL_test.cpp                              |   21 +++++++++++++++++++++
- test/main.cpp                                     |   21 +++++++++++++++++++++
- test/mode_eulerian4C_test.cpp                     |   21 +++++++++++++++++++++
- test/mode_eulerian4C_test.h                       |   21 +++++++++++++++++++++
- test/mode_kappa4C_test.cpp                        |   21 +++++++++++++++++++++
- test/mode_kappa4C_test.h                          |   21 +++++++++++++++++++++
- test/mode_kappa6C_test.cpp                        |   21 +++++++++++++++++++++
- test/mode_kappa6C_test.h                          |   21 +++++++++++++++++++++
- test/mode_twoC_test.cpp                           |   21 +++++++++++++++++++++
- test/mode_twoC_test.h                             |   21 +++++++++++++++++++++
- test/object_test.cpp                              |   21 +++++++++++++++++++++
- test/object_test.h                                |   21 +++++++++++++++++++++
- test/parameter_test.cpp                           |   21 +++++++++++++++++++++
- test/parameter_test.h                             |   21 +++++++++++++++++++++
- test/pseudoaxe_eulerian4C_test.cpp                |   21 +++++++++++++++++++++
- test/pseudoaxe_eulerian4C_test.h                  |   21 +++++++++++++++++++++
- test/pseudoaxe_eulerian6C_test.cpp                |   21 +++++++++++++++++++++
- test/pseudoaxe_eulerian6C_test.h                  |   21 +++++++++++++++++++++
- test/pseudoaxe_kappa4C_test.cpp                   |   21 +++++++++++++++++++++
- test/pseudoaxe_kappa4C_test.h                     |   21 +++++++++++++++++++++
- test/pseudoaxe_kappa6C_test.cpp                   |   21 +++++++++++++++++++++
- test/pseudoaxe_kappa6C_test.h                     |   21 +++++++++++++++++++++
- test/pseudoaxe_twoC_test.cpp                      |   21 +++++++++++++++++++++
- test/pseudoaxe_twoC_test.h                        |   21 +++++++++++++++++++++
- test/quaternion_test.cpp                          |   21 +++++++++++++++++++++
- test/quaternion_test.h                            |   21 +++++++++++++++++++++
- test/range_test.cpp                               |   21 +++++++++++++++++++++
- test/range_test.h                                 |   21 +++++++++++++++++++++
- test/reflection_test.cpp                          |   21 +++++++++++++++++++++
- test/reflection_test.h                            |   21 +++++++++++++++++++++
- test/reflectionlist_test.cpp                      |   21 +++++++++++++++++++++
- test/reflectionlist_test.h                        |   21 +++++++++++++++++++++
- test/sample_test.cpp                              |   21 +++++++++++++++++++++
- test/sample_test.h                                |   21 +++++++++++++++++++++
- test/samplelist_test.cpp                          |   21 +++++++++++++++++++++
- test/samplelist_test.h                            |   21 +++++++++++++++++++++
- test/source_test.cpp                              |   21 +++++++++++++++++++++
- test/source_test.h                                |   21 +++++++++++++++++++++
- test/svecmat_test.cpp                             |   21 +++++++++++++++++++++
- test/svecmat_test.h                               |   21 +++++++++++++++++++++
- test/value_test.cpp                               |   21 +++++++++++++++++++++
- test/value_test.h                                 |   21 +++++++++++++++++++++
- 207 files changed, 4347 insertions(+), 0 deletions(-)
+ include/hkl/HKLException.h                        | 21 +++++++++++++++++++++
+ include/hkl/HolderList.h                          | 21 +++++++++++++++++++++
+ include/hkl/affinement.h                          | 21 +++++++++++++++++++++
+ include/hkl/affinement_simplex.h                  | 21 +++++++++++++++++++++
+ include/hkl/affinementlist.h                      | 21 +++++++++++++++++++++
+ include/hkl/axe.h                                 | 21 +++++++++++++++++++++
+ include/hkl/axe_rotation.h                        | 21 +++++++++++++++++++++
+ include/hkl/axefactory.h                          | 21 +++++++++++++++++++++
+ include/hkl/constant.h                            | 21 +++++++++++++++++++++
+ include/hkl/convenience.h                         | 21 +++++++++++++++++++++
+ include/hkl/derived_mode.h                        | 21 +++++++++++++++++++++
+ include/hkl/derived_pseudoaxeengine.h             | 21 +++++++++++++++++++++
+ include/hkl/diffractometer.h                      | 21 +++++++++++++++++++++
+ include/hkl/diffractometerfactory.h               | 21 +++++++++++++++++++++
+ include/hkl/eulerian4C_vertical_diffractometer.h  | 21 +++++++++++++++++++++
+ include/hkl/eulerian4C_vertical_geometry.h        | 21 +++++++++++++++++++++
+ include/hkl/eulerian4C_vertical_mode.h            | 21 +++++++++++++++++++++
+ include/hkl/eulerian4C_vertical_pseudoaxeengine.h | 21 +++++++++++++++++++++
+ include/hkl/eulerian6C_diffractometer.h           | 21 +++++++++++++++++++++
+ include/hkl/eulerian6C_geometry.h                 | 21 +++++++++++++++++++++
+ include/hkl/eulerian6C_mode.h                     | 21 +++++++++++++++++++++
+ include/hkl/eulerian6C_pseudoaxeengine.h          | 21 +++++++++++++++++++++
+ include/hkl/fitparameter.h                        | 21 +++++++++++++++++++++
+ include/hkl/fitparameterlist.h                    | 21 +++++++++++++++++++++
+ include/hkl/geometry.h                            | 21 +++++++++++++++++++++
+ include/hkl/geometry_kappa.h                      | 21 +++++++++++++++++++++
+ include/hkl/hklobject.h                           | 21 +++++++++++++++++++++
+ include/hkl/holder.h                              | 21 +++++++++++++++++++++
+ include/hkl/interval.h                            | 21 +++++++++++++++++++++
+ include/hkl/kappa4C_vertical_diffractometer.h     | 21 +++++++++++++++++++++
+ include/hkl/kappa4C_vertical_geometry.h           | 21 +++++++++++++++++++++
+ include/hkl/kappa4C_vertical_mode.h               | 21 +++++++++++++++++++++
+ include/hkl/kappa4C_vertical_pseudoaxeengine.h    | 21 +++++++++++++++++++++
+ include/hkl/kappa6C_diffractometer.h              | 21 +++++++++++++++++++++
+ include/hkl/kappa6C_geometry.h                    | 21 +++++++++++++++++++++
+ include/hkl/kappa6C_mode.h                        | 21 +++++++++++++++++++++
+ include/hkl/kappa6C_pseudoaxeengine.h             | 21 +++++++++++++++++++++
+ include/hkl/lattice.h                             | 21 +++++++++++++++++++++
+ include/hkl/mode.h                                | 21 +++++++++++++++++++++
+ include/hkl/modelist.h                            | 21 +++++++++++++++++++++
+ include/hkl/mymap.h                               | 21 +++++++++++++++++++++
+ include/hkl/object.h                              | 21 +++++++++++++++++++++
+ include/hkl/observer.h                            | 21 +++++++++++++++++++++
+ include/hkl/parameter.h                           | 21 +++++++++++++++++++++
+ include/hkl/parameterlist.h                       | 21 +++++++++++++++++++++
+ include/hkl/portability.h                         | 21 +++++++++++++++++++++
+ include/hkl/pseudoaxe.h                           | 21 +++++++++++++++++++++
+ include/hkl/pseudoaxeengine.h                     | 21 +++++++++++++++++++++
+ include/hkl/pseudoaxeenginelist.h                 | 21 +++++++++++++++++++++
+ include/hkl/pseudoaxelist.h                       | 21 +++++++++++++++++++++
+ include/hkl/quaternion.h                          | 21 +++++++++++++++++++++
+ include/hkl/range.h                               | 21 +++++++++++++++++++++
+ include/hkl/reflection.h                          | 21 +++++++++++++++++++++
+ include/hkl/reflection_monocrystal.h              | 21 +++++++++++++++++++++
+ include/hkl/reflectionfactory.h                   | 21 +++++++++++++++++++++
+ include/hkl/reflectionlist.h                      | 21 +++++++++++++++++++++
+ include/hkl/sample.h                              | 21 +++++++++++++++++++++
+ include/hkl/sample_monocrystal.h                  | 21 +++++++++++++++++++++
+ include/hkl/samplefactory.h                       | 21 +++++++++++++++++++++
+ include/hkl/samplelist.h                          | 21 +++++++++++++++++++++
+ include/hkl/source.h                              | 21 +++++++++++++++++++++
+ include/hkl/strbuf.h                              | 21 +++++++++++++++++++++
+ include/hkl/svector.h                             | 21 +++++++++++++++++++++
+ include/hkl/twoC_vertical_diffractometer.h        | 21 +++++++++++++++++++++
+ include/hkl/twoC_vertical_geometry.h              | 21 +++++++++++++++++++++
+ include/hkl/twoC_vertical_mode.h                  | 21 +++++++++++++++++++++
+ include/hkl/twoC_vertical_pseudoaxeengine.h       | 21 +++++++++++++++++++++
+ include/hkl/value.h                               | 21 +++++++++++++++++++++
+ src/HKLException.cpp                              | 21 +++++++++++++++++++++
+ src/affinement.cpp                                | 21 +++++++++++++++++++++
+ src/affinement_simplex.cpp                        | 21 +++++++++++++++++++++
+ src/affinementlist.cpp                            | 21 +++++++++++++++++++++
+ src/axe.cpp                                       | 21 +++++++++++++++++++++
+ src/axe_rotation.cpp                              | 21 +++++++++++++++++++++
+ src/axefactory.cpp                                | 21 +++++++++++++++++++++
+ src/constant.cpp                                  | 21 +++++++++++++++++++++
+ src/convenience.cpp                               | 21 +++++++++++++++++++++
+ src/diffractometer.cpp                            | 21 +++++++++++++++++++++
+ src/diffractometerfactory.cpp                     | 21 +++++++++++++++++++++
+ src/eulerian4C_vertical_diffractometer.cpp        | 21 +++++++++++++++++++++
+ src/eulerian4C_vertical_geometry.cpp              | 21 +++++++++++++++++++++
+ src/eulerian4C_vertical_mode.cpp                  | 21 +++++++++++++++++++++
+ src/eulerian4C_vertical_pseudoaxeengine.cpp       | 21 +++++++++++++++++++++
+ src/eulerian6C_diffractometer.cpp                 | 21 +++++++++++++++++++++
+ src/eulerian6C_geometry.cpp                       | 21 +++++++++++++++++++++
+ src/eulerian6C_pseudoaxeengine.cpp                | 21 +++++++++++++++++++++
+ src/fitparameter.cpp                              | 21 +++++++++++++++++++++
+ src/fitparameterlist.cpp                          | 21 +++++++++++++++++++++
+ src/geometry.cpp                                  | 21 +++++++++++++++++++++
+ src/geometry_kappa.cpp                            | 21 +++++++++++++++++++++
+ src/hklobject.cpp                                 | 21 +++++++++++++++++++++
+ src/holder.cpp                                    | 21 +++++++++++++++++++++
+ src/interval.cpp                                  | 21 +++++++++++++++++++++
+ src/kappa4C_vertical_diffractometer.cpp           | 21 +++++++++++++++++++++
+ src/kappa4C_vertical_geometry.cpp                 | 21 +++++++++++++++++++++
+ src/kappa4C_vertical_pseudoaxeengine.cpp          | 21 +++++++++++++++++++++
+ src/kappa6C_diffractometer.cpp                    | 21 +++++++++++++++++++++
+ src/kappa6C_geometry.cpp                          | 21 +++++++++++++++++++++
+ src/lattice.cpp                                   | 21 +++++++++++++++++++++
+ src/mode.cpp                                      | 21 +++++++++++++++++++++
+ src/modelist.cpp                                  | 21 +++++++++++++++++++++
+ src/object.cpp                                    | 21 +++++++++++++++++++++
+ src/observer.cpp                                  | 21 +++++++++++++++++++++
+ src/parameter.cpp                                 | 21 +++++++++++++++++++++
+ src/parameterlist.cpp                             | 21 +++++++++++++++++++++
+ src/pseudoaxe.cpp                                 | 21 +++++++++++++++++++++
+ src/pseudoaxeengine.cpp                           | 21 +++++++++++++++++++++
+ src/pseudoaxeenginelist.cpp                       | 21 +++++++++++++++++++++
+ src/pseudoaxelist.cpp                             | 21 +++++++++++++++++++++
+ src/quaternion.cpp                                | 21 +++++++++++++++++++++
+ src/range.cpp                                     | 21 +++++++++++++++++++++
+ src/reflection.cpp                                | 21 +++++++++++++++++++++
+ src/reflection_monocrystal.cpp                    | 21 +++++++++++++++++++++
+ src/reflectionfactory.cpp                         | 21 +++++++++++++++++++++
+ src/reflectionlist.cpp                            | 21 +++++++++++++++++++++
+ src/sample.cpp                                    | 21 +++++++++++++++++++++
+ src/sample_monocrystal.cpp                        | 21 +++++++++++++++++++++
+ src/samplefactory.cpp                             | 21 +++++++++++++++++++++
+ src/samplelist.cpp                                | 21 +++++++++++++++++++++
+ src/source.cpp                                    | 21 +++++++++++++++++++++
+ src/strbuf.cpp                                    | 21 +++++++++++++++++++++
+ src/svector.cpp                                   | 21 +++++++++++++++++++++
+ src/twoC_vertical_diffractometer.cpp              | 21 +++++++++++++++++++++
+ src/twoC_vertical_geometry.cpp                    | 21 +++++++++++++++++++++
+ src/twoC_vertical_mode.cpp                        | 21 +++++++++++++++++++++
+ src/twoC_vertical_pseudoaxeengine.cpp             | 21 +++++++++++++++++++++
+ src/value.cpp                                     | 21 +++++++++++++++++++++
+ test/affinement_simplex_test.cpp                  | 21 +++++++++++++++++++++
+ test/affinement_simplex_test.h                    | 21 +++++++++++++++++++++
+ test/axe_rotation_test.cpp                        | 21 +++++++++++++++++++++
+ test/axe_rotation_test.h                          | 21 +++++++++++++++++++++
+ test/diffractometer_eulerian4C_test.cpp           | 21 +++++++++++++++++++++
+ test/diffractometer_eulerian4C_test.h             | 21 +++++++++++++++++++++
+ test/diffractometer_kappa4C_test.cpp              | 21 +++++++++++++++++++++
+ test/diffractometer_kappa4C_test.h                | 21 +++++++++++++++++++++
+ test/diffractometer_kappa6C_test.cpp              | 21 +++++++++++++++++++++
+ test/diffractometer_kappa6C_test.h                | 21 +++++++++++++++++++++
+ test/diffractometer_test.cpp                      | 21 +++++++++++++++++++++
+ test/diffractometer_test.h                        | 21 +++++++++++++++++++++
+ test/diffractometer_twoC_test.cpp                 | 21 +++++++++++++++++++++
+ test/diffractometer_twoC_test.h                   | 21 +++++++++++++++++++++
+ test/fitparameter_test.cpp                        | 21 +++++++++++++++++++++
+ test/fitparameter_test.h                          | 21 +++++++++++++++++++++
+ test/geometry_eulerian4C_test.cpp                 | 21 +++++++++++++++++++++
+ test/geometry_eulerian4C_test.h                   | 21 +++++++++++++++++++++
+ test/geometry_eulerian6C_test.cpp                 | 21 +++++++++++++++++++++
+ test/geometry_eulerian6C_test.h                   | 21 +++++++++++++++++++++
+ test/geometry_kappa4C_test.cpp                    | 21 +++++++++++++++++++++
+ test/geometry_kappa4C_test.h                      | 21 +++++++++++++++++++++
+ test/geometry_kappa6C_test.cpp                    | 21 +++++++++++++++++++++
+ test/geometry_kappa6C_test.h                      | 21 +++++++++++++++++++++
+ test/geometry_test.cpp                            | 21 +++++++++++++++++++++
+ test/geometry_test.h                              | 21 +++++++++++++++++++++
+ test/geometry_twoC_test.cpp                       | 21 +++++++++++++++++++++
+ test/geometry_twoC_test.h                         | 21 +++++++++++++++++++++
+ test/hklobject_test.cpp                           | 21 +++++++++++++++++++++
+ test/hklobject_test.h                             | 21 +++++++++++++++++++++
+ test/holder_test.cpp                              | 21 +++++++++++++++++++++
+ test/holder_test.h                                | 21 +++++++++++++++++++++
+ test/holderlist_test.cpp                          | 21 +++++++++++++++++++++
+ test/holderlist_test.h                            | 21 +++++++++++++++++++++
+ test/interval_test.cpp                            | 21 +++++++++++++++++++++
+ test/interval_test.h                              | 21 +++++++++++++++++++++
+ test/lattice_test.cpp                             | 21 +++++++++++++++++++++
+ test/lattice_test.h                               | 21 +++++++++++++++++++++
+ test/libHKL_test.cpp                              | 21 +++++++++++++++++++++
+ test/main.cpp                                     | 21 +++++++++++++++++++++
+ test/mode_eulerian4C_test.cpp                     | 21 +++++++++++++++++++++
+ test/mode_eulerian4C_test.h                       | 21 +++++++++++++++++++++
+ test/mode_kappa4C_test.cpp                        | 21 +++++++++++++++++++++
+ test/mode_kappa4C_test.h                          | 21 +++++++++++++++++++++
+ test/mode_kappa6C_test.cpp                        | 21 +++++++++++++++++++++
+ test/mode_kappa6C_test.h                          | 21 +++++++++++++++++++++
+ test/mode_twoC_test.cpp                           | 21 +++++++++++++++++++++
+ test/mode_twoC_test.h                             | 21 +++++++++++++++++++++
+ test/object_test.cpp                              | 21 +++++++++++++++++++++
+ test/object_test.h                                | 21 +++++++++++++++++++++
+ test/parameter_test.cpp                           | 21 +++++++++++++++++++++
+ test/parameter_test.h                             | 21 +++++++++++++++++++++
+ test/pseudoaxe_eulerian4C_test.cpp                | 21 +++++++++++++++++++++
+ test/pseudoaxe_eulerian4C_test.h                  | 21 +++++++++++++++++++++
+ test/pseudoaxe_eulerian6C_test.cpp                | 21 +++++++++++++++++++++
+ test/pseudoaxe_eulerian6C_test.h                  | 21 +++++++++++++++++++++
+ test/pseudoaxe_kappa4C_test.cpp                   | 21 +++++++++++++++++++++
+ test/pseudoaxe_kappa4C_test.h                     | 21 +++++++++++++++++++++
+ test/pseudoaxe_kappa6C_test.cpp                   | 21 +++++++++++++++++++++
+ test/pseudoaxe_kappa6C_test.h                     | 21 +++++++++++++++++++++
+ test/pseudoaxe_twoC_test.cpp                      | 21 +++++++++++++++++++++
+ test/pseudoaxe_twoC_test.h                        | 21 +++++++++++++++++++++
+ test/quaternion_test.cpp                          | 21 +++++++++++++++++++++
+ test/quaternion_test.h                            | 21 +++++++++++++++++++++
+ test/range_test.cpp                               | 21 +++++++++++++++++++++
+ test/range_test.h                                 | 21 +++++++++++++++++++++
+ test/reflection_test.cpp                          | 21 +++++++++++++++++++++
+ test/reflection_test.h                            | 21 +++++++++++++++++++++
+ test/reflectionlist_test.cpp                      | 21 +++++++++++++++++++++
+ test/reflectionlist_test.h                        | 21 +++++++++++++++++++++
+ test/sample_test.cpp                              | 21 +++++++++++++++++++++
+ test/sample_test.h                                | 21 +++++++++++++++++++++
+ test/samplelist_test.cpp                          | 21 +++++++++++++++++++++
+ test/samplelist_test.h                            | 21 +++++++++++++++++++++
+ test/source_test.cpp                              | 21 +++++++++++++++++++++
+ test/source_test.h                                | 21 +++++++++++++++++++++
+ test/svecmat_test.cpp                             | 21 +++++++++++++++++++++
+ test/svecmat_test.h                               | 21 +++++++++++++++++++++
+ test/value_test.cpp                               | 21 +++++++++++++++++++++
+ test/value_test.h                                 | 21 +++++++++++++++++++++
+ 207 files changed, 4347 insertions(+)
 
 commit 0c063b778173c61c57aadc35769f5c191d24097a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7946,10 +17707,10 @@ Date:   Tue Jan 8 16:47:41 2008 +0100
 
     * add the new/free method to the HklParameter struct
 
- include/hkl/hkl-parameter.h |    6 ++++++
- src/hkl-parameter.c         |   24 ++++++++++++++++++++++++
- test/hkl-test-parameter.c   |   17 +++++++++++++++++
- 3 files changed, 47 insertions(+), 0 deletions(-)
+ include/hkl/hkl-parameter.h |  6 ++++++
+ src/hkl-parameter.c         | 24 ++++++++++++++++++++++++
+ test/hkl-test-parameter.c   | 17 +++++++++++++++++
+ 3 files changed, 47 insertions(+)
 
 commit 582eb906fd9db4ec1bd4b61d5716f1440ddb84d1
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7960,14 +17721,14 @@ Date:   Tue Dec 25 18:24:54 2007 +0100
     refactor a part of geometry and diffractometer to use new and free
     method of most structures.
 
- include/hkl/hkl-diffractometer.h    |    8 +++++---
- include/hkl/hkl-diffractometer_2C.h |   30 +++++++++++++++---------------
- include/hkl/hkl-geometry.h          |   10 ++++------
- include/hkl/hkl-source.h            |    4 ++++
- src/hkl-diffractometer.c            |   16 +++++++++++++---
- src/hkl-geometry.c                  |   18 ++++++++++++++----
- src/hkl-source.c                    |   16 ++++++++++++++++
- test/hkl-test-source.c              |   12 ++++++++++++
+ include/hkl/hkl-diffractometer.h    |  8 +++++---
+ include/hkl/hkl-diffractometer_2C.h | 30 +++++++++++++++---------------
+ include/hkl/hkl-geometry.h          | 10 ++++------
+ include/hkl/hkl-source.h            |  4 ++++
+ src/hkl-diffractometer.c            | 16 +++++++++++++---
+ src/hkl-geometry.c                  | 18 ++++++++++++++----
+ src/hkl-source.c                    | 16 ++++++++++++++++
+ test/hkl-test-source.c              | 12 ++++++++++++
  8 files changed, 83 insertions(+), 31 deletions(-)
 
 commit 36650f8c47349bda49e4f6426c1e4e861e7c408c
@@ -7976,11 +17737,11 @@ Date:   Tue Dec 25 17:34:40 2007 +0100
 
     * remove unecessary files and small typo
 
- include/hkl/hkl-holder.h |    2 -
- test/hkl-test-holder.c   |    1 -
- test/holder_test.cpp     |   78 ----------------------------------------------
- test/holder_test.h       |   33 -------------------
- 4 files changed, 0 insertions(+), 114 deletions(-)
+ include/hkl/hkl-holder.h |  2 --
+ test/hkl-test-holder.c   |  1 -
+ test/holder_test.cpp     | 78 ------------------------------------------------
+ test/holder_test.h       | 33 --------------------
+ 4 files changed, 114 deletions(-)
 
 commit 73ac85afb08b655480fa8c02dfce3da2b0fad56b
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -7988,11 +17749,11 @@ Date:   Thu Dec 20 11:27:24 2007 +0100
 
     * add the HklHolders tests.
 
- include/hkl/hkl-holders.h |    2 --
- src/hkl-holders.c         |   13 +++++++++----
- test/SConscript           |    3 +--
- test/hkl-test-holders.c   |   39 +++++++++++++++++++++++++++++++++++++++
- test/main.c               |    1 +
+ include/hkl/hkl-holders.h |  2 --
+ src/hkl-holders.c         | 13 +++++++++----
+ test/SConscript           |  3 +--
+ test/hkl-test-holders.c   | 39 +++++++++++++++++++++++++++++++++++++++
+ test/main.c               |  1 +
  5 files changed, 50 insertions(+), 8 deletions(-)
 
 commit b0b46ec7e034b6422abacb843e5ad85934949979
@@ -8001,8 +17762,8 @@ Date:   Thu Dec 20 09:21:40 2007 +0100
 
     * minor typo changes
 
- src/hkl-holders.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ src/hkl-holders.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit 7be4b4fe77a519eb580b8074347ea329911096e8
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -8010,10 +17771,10 @@ Date:   Thu Dec 20 00:22:20 2007 +0100
 
     * add the HklHolder tests
 
- src/hkl-holder.c       |   16 ++++--------
- test/SConscript        |    1 +
- test/hkl-test-holder.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++
- test/main.c            |    1 +
+ src/hkl-holder.c       | 16 +++++--------
+ test/SConscript        |  1 +
+ test/hkl-test-holder.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ test/main.c            |  1 +
  4 files changed, 69 insertions(+), 10 deletions(-)
 
 commit 289ae5d418cb4f060ac300eeb740982831407850
@@ -8022,8 +17783,8 @@ Date:   Thu Dec 20 00:20:24 2007 +0100
 
     *die if you try to add two axis with the same name but a different axis_v.
 
- src/hkl-axes.c       |    7 +++++--
- test/hkl-test-axis.c |    5 -----
+ src/hkl-axes.c       | 7 +++++--
+ test/hkl-test-axis.c | 5 -----
  2 files changed, 5 insertions(+), 7 deletions(-)
 
 commit c0f0f1ac56ec44a5ec4e1de7bd967a70d339cab5
@@ -8032,8 +17793,8 @@ Date:   Wed Dec 19 23:57:47 2007 +0100
 
     * remove a bug in the Hklholder class
 
- src/hkl-holder.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/hkl-holder.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 8e4184f78b44623f4e39b73c963abe9bef4132e2
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -8041,8 +17802,8 @@ Date:   Wed Dec 19 23:56:29 2007 +0100
 
     * indentation
 
- include/hkl/hkl-macros.h |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
+ include/hkl/hkl-macros.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 commit c7845549930f423dfde84e9b9151f987c8be8d7a
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -8050,8 +17811,8 @@ Date:   Wed Dec 19 21:08:29 2007 +0100
 
     * remove a bug in the axes list and put a test for it
 
- src/hkl-axes.c       |    2 +-
- test/hkl-test-axis.c |   18 +++++++++++++++---
+ src/hkl-axes.c       |  2 +-
+ test/hkl-test-axis.c | 18 +++++++++++++++---
  2 files changed, 16 insertions(+), 4 deletions(-)
 
 commit 64e5182ac58601fb1d69b40a246e4b1b02192ddb
@@ -8060,8 +17821,8 @@ Date:   Wed Dec 19 20:14:08 2007 +0100
 
     * add the new/free axes tests.
 
- include/hkl/hkl-axes.h |    2 --
- test/hkl-test-axis.c   |   16 ++++++++--------
+ include/hkl/hkl-axes.h |  2 --
+ test/hkl-test-axis.c   | 16 ++++++++--------
  2 files changed, 8 insertions(+), 10 deletions(-)
 
 commit eb6c657ce67645d92f1a31c4ef11dbb287602573
@@ -8070,28 +17831,28 @@ Date:   Wed Dec 19 19:59:25 2007 +0100
 
     * rename all test files with the right convention
 
- test/SConscript            |   18 ++--
- test/axis_test.c           |  130 ------------------
- test/hkl-test-axis.c       |  130 ++++++++++++++++++
- test/hkl-test-interval.c   |  310 ++++++++++++++++++++++++++++++++++++++++++++
- test/hkl-test-lattice.c    |  147 +++++++++++++++++++++
- test/hkl-test-matrix.c     |  118 +++++++++++++++++
- test/hkl-test-parameter.c  |   29 ++++
- test/hkl-test-quaternion.c |  147 +++++++++++++++++++++
- test/hkl-test-source.c     |   45 +++++++
- test/hkl-test-vector.c     |  139 ++++++++++++++++++++
- test/hkl-test.c            |   69 ++++++++++
- test/hkl-test.h            |   71 ++++++++++
- test/interval_test.c       |  310 --------------------------------------------
- test/lattice_test.c        |  147 ---------------------
- test/main.c                |    2 +-
- test/parameter_test.c      |   29 ----
- test/quaternion_test.c     |  147 ---------------------
- test/smatrix_test.c        |  118 -----------------
- test/source_test.c         |   45 -------
- test/svector_test.c        |  139 --------------------
- test/test.c                |   69 ----------
- test/test.h                |   71 ----------
+ test/SConscript            |  18 +--
+ test/axis_test.c           | 130 -------------------
+ test/hkl-test-axis.c       | 130 +++++++++++++++++++
+ test/hkl-test-interval.c   | 310 +++++++++++++++++++++++++++++++++++++++++++++
+ test/hkl-test-lattice.c    | 147 +++++++++++++++++++++
+ test/hkl-test-matrix.c     | 118 +++++++++++++++++
+ test/hkl-test-parameter.c  |  29 +++++
+ test/hkl-test-quaternion.c | 147 +++++++++++++++++++++
+ test/hkl-test-source.c     |  45 +++++++
+ test/hkl-test-vector.c     | 139 ++++++++++++++++++++
+ test/hkl-test.c            |  69 ++++++++++
+ test/hkl-test.h            |  71 +++++++++++
+ test/interval_test.c       | 310 ---------------------------------------------
+ test/lattice_test.c        | 147 ---------------------
+ test/main.c                |   2 +-
+ test/parameter_test.c      |  29 -----
+ test/quaternion_test.c     | 147 ---------------------
+ test/smatrix_test.c        | 118 -----------------
+ test/source_test.c         |  45 -------
+ test/svector_test.c        | 139 --------------------
+ test/test.c                |  69 ----------
+ test/test.h                |  71 -----------
  22 files changed, 1215 insertions(+), 1215 deletions(-)
 
 commit 62904e51058a456303a8d16b8f8cccf7b0344e9c
@@ -8100,15 +17861,15 @@ Date:   Wed Dec 19 19:51:37 2007 +0100
 
     * now all tests are OK.
 
- test/axis_test.c       |    5 +-
- test/interval_test.c   |   26 ++++++++++++
- test/lattice_test.c    |  105 +++++++++++++++++++++++++----------------------
- test/parameter_test.c  |    2 +
- test/quaternion_test.c |   16 +++++++
- test/smatrix_test.c    |   12 +++++
- test/source_test.c     |   30 ++++++++------
- test/svector_test.c    |   18 ++++++++
- test/test.h            |    8 +---
+ test/axis_test.c       |   5 ++-
+ test/interval_test.c   |  26 ++++++++++++
+ test/lattice_test.c    | 105 ++++++++++++++++++++++++++-----------------------
+ test/parameter_test.c  |   2 +
+ test/quaternion_test.c |  16 ++++++++
+ test/smatrix_test.c    |  12 ++++++
+ test/source_test.c     |  30 ++++++++------
+ test/svector_test.c    |  18 +++++++++
+ test/test.h            |   8 +---
  9 files changed, 152 insertions(+), 70 deletions(-)
 
 commit c8d26b6c045be29765093335c1ac4f9132f886b5
@@ -8121,12 +17882,12 @@ Date:   Wed Dec 19 16:17:22 2007 +0100
     from the HKL_ASSERT_EQUAL macro. It return True if the test pass
     so I can put only one test per funvtion, this is not good.
 
- include/hkl/hkl-axes.h   |    6 ++++++
- include/hkl/hkl-holder.h |    6 ++++++
- src/hkl-axes.c           |   18 ++++++++++++++++++
- src/hkl-holder.c         |   15 +++++++++++++++
- src/hkl-holders.c        |   15 +++++++++++++++
- test/axis_test.c         |   45 ++++++++++++++++++++++++---------------------
+ include/hkl/hkl-axes.h   |  6 ++++++
+ include/hkl/hkl-holder.h |  6 ++++++
+ src/hkl-axes.c           | 18 ++++++++++++++++++
+ src/hkl-holder.c         | 15 +++++++++++++++
+ src/hkl-holders.c        | 15 +++++++++++++++
+ test/axis_test.c         | 45 ++++++++++++++++++++++++---------------------
  6 files changed, 84 insertions(+), 21 deletions(-)
 
 commit 15ef7cfedf958161e011f22485a2ace10537dec6
@@ -8135,8 +17896,8 @@ Date:   Wed Dec 19 15:14:38 2007 +0100
 
     * remove the print env.Dump (debugging)
 
- test/SConscript |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ test/SConscript | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 5bcd7e3f16e0f5fff048a8dd8ecbe3b47ee9b982
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -8146,78 +17907,78 @@ Date:   Wed Dec 19 15:13:24 2007 +0100
     
      It clearer to read hkl-myclass instead of hklmyclass
 
- config-win32.py                     |    2 -
- include/hkl/hkl-axes.h              |   25 ++
- include/hkl/hkl-axis.h              |   29 +++
- include/hkl/hkl-diffractometer.h    |   31 +++
- include/hkl/hkl-diffractometer_2C.h |   30 +++
- include/hkl/hkl-geometry.h          |   24 ++
- include/hkl/hkl-holder.h            |   25 ++
- include/hkl/hkl-holders.h           |   31 +++
- include/hkl/hkl-interval.h          |   48 ++++
- include/hkl/hkl-lattice.h           |   31 +++
- include/hkl/hkl-macros.h            |   76 ++++++
- include/hkl/hkl-matrix.h            |   39 +++
- include/hkl/hkl-parameter.h         |   23 ++
- include/hkl/hkl-quaternion.h        |   71 ++++++
- include/hkl/hkl-sample.h            |   45 ++++
- include/hkl/hkl-source.h            |   26 ++
- include/hkl/hkl-vector.h            |   64 +++++
- include/hkl/hklaxes.h               |   25 --
- include/hkl/hklaxis.h               |   29 ---
- include/hkl/hkldiffractometer.h     |   31 ---
- include/hkl/hkldiffractometer_2C.h  |   30 ---
- include/hkl/hklgeometry.h           |   24 --
- include/hkl/hklholder.h             |   25 --
- include/hkl/hklholders.h            |   25 --
- include/hkl/hklinterval.h           |   48 ----
- include/hkl/hkllattice.h            |   31 ---
- include/hkl/hklmacros.h             |   76 ------
- include/hkl/hklmatrix.h             |   39 ---
- include/hkl/hklparameter.h          |   23 --
- include/hkl/hklquaternion.h         |   71 ------
- include/hkl/hklsource.h             |   26 --
- include/hkl/hklvector.h             |   64 -----
- src/SConscript                      |   26 +-
- src/hkl-axes.c                      |   57 +++++
- src/hkl-axis.c                      |   12 +
- src/hkl-diffractometer.c            |   39 +++
- src/hkl-geometry.c                  |   12 +
- src/hkl-holder.c                    |   52 ++++
- src/hkl-holders.c                   |   38 +++
- src/hkl-interval.c                  |  435 +++++++++++++++++++++++++++++++++++
- src/hkl-lattice.c                   |  235 +++++++++++++++++++
- src/hkl-matrix.c                    |  180 +++++++++++++++
- src/hkl-parameter.c                 |   24 ++
- src/hkl-quaternion.c                |  164 +++++++++++++
- src/hkl-sample.c                    |   48 ++++
- src/hkl-source.c                    |   51 ++++
- src/hkl-vector.c                    |  256 ++++++++++++++++++++
- src/hklaxes.c                       |   57 -----
- src/hklaxis.c                       |   12 -
- src/hkldiffractometer.c             |   39 ---
- src/hklgeometry.c                   |   12 -
- src/hklholder.c                     |   52 ----
- src/hklholders.c                    |   38 ---
- src/hklinterval.c                   |  435 -----------------------------------
- src/hkllattice.c                    |  235 -------------------
- src/hklmatrix.c                     |  180 ---------------
- src/hklparameter.c                  |   24 --
- src/hklquaternion.c                 |  164 -------------
- src/hklsource.c                     |   51 ----
- src/hklvector.c                     |  256 --------------------
- src/usage.c                         |    2 +-
- test/SConscript                     |    2 +-
- test/axis_test.c                    |    2 +-
- test/interval_test.c                |    2 +-
- test/lattice_test.c                 |    2 +-
- test/main.c                         |    1 +
- test/parameter_test.c               |    2 +-
- test/quaternion_test.c              |    6 +-
- test/smatrix_test.c                 |    4 +-
- test/source_test.c                  |    2 +-
- test/svector_test.c                 |    4 +-
- test/test.c                         |    3 +-
+ config-win32.py                     |   2 -
+ include/hkl/hkl-axes.h              |  25 +++
+ include/hkl/hkl-axis.h              |  29 +++
+ include/hkl/hkl-diffractometer.h    |  31 +++
+ include/hkl/hkl-diffractometer_2C.h |  30 +++
+ include/hkl/hkl-geometry.h          |  24 ++
+ include/hkl/hkl-holder.h            |  25 +++
+ include/hkl/hkl-holders.h           |  31 +++
+ include/hkl/hkl-interval.h          |  48 ++++
+ include/hkl/hkl-lattice.h           |  31 +++
+ include/hkl/hkl-macros.h            |  76 +++++++
+ include/hkl/hkl-matrix.h            |  39 ++++
+ include/hkl/hkl-parameter.h         |  23 ++
+ include/hkl/hkl-quaternion.h        |  71 ++++++
+ include/hkl/hkl-sample.h            |  45 ++++
+ include/hkl/hkl-source.h            |  26 +++
+ include/hkl/hkl-vector.h            |  64 ++++++
+ include/hkl/hklaxes.h               |  25 ---
+ include/hkl/hklaxis.h               |  29 ---
+ include/hkl/hkldiffractometer.h     |  31 ---
+ include/hkl/hkldiffractometer_2C.h  |  30 ---
+ include/hkl/hklgeometry.h           |  24 --
+ include/hkl/hklholder.h             |  25 ---
+ include/hkl/hklholders.h            |  25 ---
+ include/hkl/hklinterval.h           |  48 ----
+ include/hkl/hkllattice.h            |  31 ---
+ include/hkl/hklmacros.h             |  76 -------
+ include/hkl/hklmatrix.h             |  39 ----
+ include/hkl/hklparameter.h          |  23 --
+ include/hkl/hklquaternion.h         |  71 ------
+ include/hkl/hklsource.h             |  26 ---
+ include/hkl/hklvector.h             |  64 ------
+ src/SConscript                      |  26 +--
+ src/hkl-axes.c                      |  57 +++++
+ src/hkl-axis.c                      |  12 +
+ src/hkl-diffractometer.c            |  39 ++++
+ src/hkl-geometry.c                  |  12 +
+ src/hkl-holder.c                    |  52 +++++
+ src/hkl-holders.c                   |  38 ++++
+ src/hkl-interval.c                  | 435 ++++++++++++++++++++++++++++++++++++
+ src/hkl-lattice.c                   | 235 +++++++++++++++++++
+ src/hkl-matrix.c                    | 180 +++++++++++++++
+ src/hkl-parameter.c                 |  24 ++
+ src/hkl-quaternion.c                | 164 ++++++++++++++
+ src/hkl-sample.c                    |  48 ++++
+ src/hkl-source.c                    |  51 +++++
+ src/hkl-vector.c                    | 256 +++++++++++++++++++++
+ src/hklaxes.c                       |  57 -----
+ src/hklaxis.c                       |  12 -
+ src/hkldiffractometer.c             |  39 ----
+ src/hklgeometry.c                   |  12 -
+ src/hklholder.c                     |  52 -----
+ src/hklholders.c                    |  38 ----
+ src/hklinterval.c                   | 435 ------------------------------------
+ src/hkllattice.c                    | 235 -------------------
+ src/hklmatrix.c                     | 180 ---------------
+ src/hklparameter.c                  |  24 --
+ src/hklquaternion.c                 | 164 --------------
+ src/hklsource.c                     |  51 -----
+ src/hklvector.c                     | 256 ---------------------
+ src/usage.c                         |   2 +-
+ test/SConscript                     |   2 +-
+ test/axis_test.c                    |   2 +-
+ test/interval_test.c                |   2 +-
+ test/lattice_test.c                 |   2 +-
+ test/main.c                         |   1 +
+ test/parameter_test.c               |   2 +-
+ test/quaternion_test.c              |   6 +-
+ test/smatrix_test.c                 |   4 +-
+ test/source_test.c                  |   2 +-
+ test/svector_test.c                 |   4 +-
+ test/test.c                         |   3 +-
  72 files changed, 2251 insertions(+), 2152 deletions(-)
 
 commit d8323e8373f81f632d21d4afae3a717aabcc7d19
@@ -8226,10 +17987,10 @@ Date:   Tue Dec 18 17:53:36 2007 +0100
 
     * now compile with VC6.
 
- SConstruct       |    2 +-
- test/SConscript  |   23 ++++++++++++-----------
- test/axis_test.c |    2 ++
- test/test.h      |    9 +++++----
+ SConstruct       |  2 +-
+ test/SConscript  | 23 ++++++++++++-----------
+ test/axis_test.c |  2 ++
+ test/test.h      |  9 +++++----
  4 files changed, 20 insertions(+), 16 deletions(-)
 
 commit 2e7e05e38a327038184935b541a838a019597f2b
@@ -8238,8 +17999,8 @@ Date:   Fri Dec 14 07:38:48 2007 +0100
 
     * juste add the reflection file
 
- src/reflection.c |  123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 123 insertions(+), 0 deletions(-)
+ src/reflection.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 123 insertions(+)
 
 commit 3d497b2f984cca43e0823568e0d09af468b70c66
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -8247,73 +18008,73 @@ Date:   Sun Dec 9 22:40:22 2007 +0100
 
     * use the gtk style for the source files.
 
- include/hkl/axes.h                 |   33 ---
- include/hkl/axis.h                 |   31 ---
- include/hkl/config.h               |   66 ------
- include/hkl/diffractometer.h       |   36 ---
- include/hkl/diffractometer_2C.h    |   38 ---
- include/hkl/geometry.h             |   33 ---
- include/hkl/hklaxes.h              |   25 ++
- include/hkl/hklaxis.h              |   29 +++
- include/hkl/hkldiffractometer.h    |   31 +++
- include/hkl/hkldiffractometer_2C.h |   30 +++
- include/hkl/hklgeometry.h          |   24 ++
- include/hkl/hklholder.h            |   25 ++
- include/hkl/hklholders.h           |   25 ++
- include/hkl/hklinterval.h          |   48 ++++
- include/hkl/hkllattice.h           |   31 +++
- include/hkl/hklmacros.h            |   76 +++++++
- include/hkl/hklmatrix.h            |   39 ++++
- include/hkl/hklparameter.h         |   23 ++
- include/hkl/hklquaternion.h        |   71 ++++++
- include/hkl/hklsource.h            |   26 +++
- include/hkl/hklvector.h            |   64 ++++++
- include/hkl/holder.h               |   33 ---
- include/hkl/holders.h              |   33 ---
- include/hkl/interval.h             |   50 ----
- include/hkl/lattice.h              |   38 ---
- include/hkl/parameter.h            |   27 ---
- include/hkl/reflection.h           |  184 +--------------
- include/hkl/smatrix.h              |   46 ----
- include/hkl/source.h               |   30 ---
- include/hkl/svector.h              |   71 ------
- src/SConscript                     |   30 ++--
- src/axes.c                         |   59 -----
- src/axis.c                         |   13 -
- src/diffractometer.c               |   39 ----
- src/geometry.c                     |   12 -
- src/hklaxes.c                      |   57 +++++
- src/hklaxis.c                      |   12 +
- src/hkldiffractometer.c            |   39 ++++
- src/hklgeometry.c                  |   12 +
- src/hklholder.c                    |   52 +++++
- src/hklholders.c                   |   38 +++
- src/hklinterval.c                  |  435 +++++++++++++++++++++++++++++++++++
- src/hkllattice.c                   |  235 +++++++++++++++++++
- src/hklmatrix.c                    |  180 +++++++++++++++
- src/hklparameter.c                 |   24 ++
- src/hklquaternion.c                |  164 ++++++++++++++
- src/hklsource.c                    |   51 +++++
- src/hklvector.c                    |  256 +++++++++++++++++++++
- src/holder.c                       |   56 -----
- src/holders.c                      |   41 ----
- src/interval.c                     |  436 ------------------------------------
- src/lattice.c                      |  238 --------------------
- src/parameter.c                    |   25 --
- src/quaternion.c                   |  164 --------------
- src/smatrix.c                      |  180 ---------------
- src/source.c                       |   52 -----
- src/svector.c                      |  256 ---------------------
- src/usage.c                        |    2 +-
- test/axis_test.c                   |   23 +-
- test/interval_test.c               |   59 +++---
- test/lattice_test.c                |   20 +-
- test/parameter_test.c              |    5 +-
- test/quaternion_test.c             |   53 +++---
- test/smatrix_test.c                |   35 ++--
- test/source_test.c                 |   15 +-
- test/svector_test.c                |   51 ++---
- test/test.c                        |    2 +-
+ include/hkl/axes.h                 |  33 ---
+ include/hkl/axis.h                 |  31 ---
+ include/hkl/config.h               |  66 ------
+ include/hkl/diffractometer.h       |  36 ---
+ include/hkl/diffractometer_2C.h    |  38 ----
+ include/hkl/geometry.h             |  33 ---
+ include/hkl/hklaxes.h              |  25 +++
+ include/hkl/hklaxis.h              |  29 +++
+ include/hkl/hkldiffractometer.h    |  31 +++
+ include/hkl/hkldiffractometer_2C.h |  30 +++
+ include/hkl/hklgeometry.h          |  24 ++
+ include/hkl/hklholder.h            |  25 +++
+ include/hkl/hklholders.h           |  25 +++
+ include/hkl/hklinterval.h          |  48 ++++
+ include/hkl/hkllattice.h           |  31 +++
+ include/hkl/hklmacros.h            |  76 +++++++
+ include/hkl/hklmatrix.h            |  39 ++++
+ include/hkl/hklparameter.h         |  23 ++
+ include/hkl/hklquaternion.h        |  71 ++++++
+ include/hkl/hklsource.h            |  26 +++
+ include/hkl/hklvector.h            |  64 ++++++
+ include/hkl/holder.h               |  33 ---
+ include/hkl/holders.h              |  33 ---
+ include/hkl/interval.h             |  50 -----
+ include/hkl/lattice.h              |  38 ----
+ include/hkl/parameter.h            |  27 ---
+ include/hkl/reflection.h           | 184 +---------------
+ include/hkl/smatrix.h              |  46 ----
+ include/hkl/source.h               |  30 ---
+ include/hkl/svector.h              |  71 ------
+ src/SConscript                     |  30 +--
+ src/axes.c                         |  59 -----
+ src/axis.c                         |  13 --
+ src/diffractometer.c               |  39 ----
+ src/geometry.c                     |  12 -
+ src/hklaxes.c                      |  57 +++++
+ src/hklaxis.c                      |  12 +
+ src/hkldiffractometer.c            |  39 ++++
+ src/hklgeometry.c                  |  12 +
+ src/hklholder.c                    |  52 +++++
+ src/hklholders.c                   |  38 ++++
+ src/hklinterval.c                  | 435 ++++++++++++++++++++++++++++++++++++
+ src/hkllattice.c                   | 235 ++++++++++++++++++++
+ src/hklmatrix.c                    | 180 +++++++++++++++
+ src/hklparameter.c                 |  24 ++
+ src/hklquaternion.c                | 164 ++++++++++++++
+ src/hklsource.c                    |  51 +++++
+ src/hklvector.c                    | 256 ++++++++++++++++++++++
+ src/holder.c                       |  56 -----
+ src/holders.c                      |  41 ----
+ src/interval.c                     | 436 -------------------------------------
+ src/lattice.c                      | 238 --------------------
+ src/parameter.c                    |  25 ---
+ src/quaternion.c                   | 164 --------------
+ src/smatrix.c                      | 180 ---------------
+ src/source.c                       |  52 -----
+ src/svector.c                      | 256 ----------------------
+ src/usage.c                        |   2 +-
+ test/axis_test.c                   |  23 +-
+ test/interval_test.c               |  59 +++--
+ test/lattice_test.c                |  20 +-
+ test/parameter_test.c              |   5 +-
+ test/quaternion_test.c             |  53 +++--
+ test/smatrix_test.c                |  35 ++-
+ test/source_test.c                 |  15 +-
+ test/svector_test.c                |  51 +++--
+ test/test.c                        |   2 +-
  67 files changed, 2277 insertions(+), 2460 deletions(-)
 
 commit cb81cfb13de08f368c2d350c5ecca30fc30fec28
@@ -8322,22 +18083,22 @@ Date:   Sun Dec 2 23:22:43 2007 +0100
 
     * add the parameter an lattice C part with tests
 
- include/hkl/fitparameter.h |  118 ---------
- include/hkl/lattice.h      |  250 +++-----------------
- include/hkl/parameter.h    |   75 ++-----
- src/SConscript             |    5 +-
- src/lattice.c              |  238 ++++++++++++++++++
- src/lattice.cpp            |  571 --------------------------------------------
- src/parameter.c            |   25 ++
- src/parameter.cpp          |   46 ----
- test/SConscript            |    4 +-
- test/lattice_test.c        |  142 +++++++++++
- test/lattice_test.cpp      |  204 ----------------
- test/lattice_test.h        |   37 ---
- test/main.c                |   14 +-
- test/parameter_test.c      |   28 +++
- test/parameter_test.cpp    |   22 --
- test/parameter_test.h      |   24 --
+ include/hkl/fitparameter.h | 118 ----------
+ include/hkl/lattice.h      | 250 +++-----------------
+ include/hkl/parameter.h    |  75 ++----
+ src/SConscript             |   5 +-
+ src/lattice.c              | 238 +++++++++++++++++++
+ src/lattice.cpp            | 571 ---------------------------------------------
+ src/parameter.c            |  25 ++
+ src/parameter.cpp          |  46 ----
+ test/SConscript            |   4 +-
+ test/lattice_test.c        | 142 +++++++++++
+ test/lattice_test.cpp      | 204 ----------------
+ test/lattice_test.h        |  37 ---
+ test/main.c                |  14 +-
+ test/parameter_test.c      |  28 +++
+ test/parameter_test.cpp    |  22 --
+ test/parameter_test.h      |  24 --
  16 files changed, 493 insertions(+), 1310 deletions(-)
 
 commit b8b7db6212989abf427b24155426d99678c0a35a
@@ -8346,11 +18107,11 @@ Date:   Sat Dec 1 22:59:46 2007 +0100
 
     * all tests are OK now.
 
- src/SConscript       |    1 +
- src/axes.c           |    2 +-
- src/axis.c           |    4 +++-
- src/diffractometer.c |    1 -
- test/axis_test.c     |    9 ++++++---
+ src/SConscript       | 1 +
+ src/axes.c           | 2 +-
+ src/axis.c           | 4 +++-
+ src/diffractometer.c | 1 -
+ test/axis_test.c     | 9 ++++++---
  5 files changed, 11 insertions(+), 6 deletions(-)
 
 commit b48dd2da540a992e22c7b128895d7bf087eb9bdb
@@ -8361,32 +18122,32 @@ Date:   Sat Dec 1 00:47:27 2007 +0100
     
     test do not compile.
 
- include/hkl/axes.h                  |   33 ++
- include/hkl/axis.h                  |   55 +--
- include/hkl/config.h                |   19 +-
- include/hkl/diffractometer.h        |  341 ++--------------
- include/hkl/diffractometer_2C.h     |   38 ++
- include/hkl/geometry.h              |  223 +---------
- include/hkl/holder.h                |   43 +--
- include/hkl/holders.h               |   33 ++
- include/hkl/new_diffractometer.h    |   48 ---
- include/hkl/new_diffractometer_2C.h |   40 --
- include/hkl/new_geometry.h          |   45 --
- include/hkl/source.h                |   20 +-
- src/SConscript                      |   18 +-
- src/axes.c                          |   59 +++
- src/axis.c                          |  165 +-------
- src/diffractometer.c                |   40 ++
- src/diffractometer.cpp              |   49 ---
- src/geometry.c                      |   12 +
- src/holder.c                        |  114 ++----
- src/holders.c                       |   41 ++
- src/interval.c                      |  792 ++++++++++++++++-------------------
- src/new_diffractometer.c            |   74 ----
- src/new_geometry.c                  |   36 --
- src/quaternion.c                    |  161 ++++----
- src/smatrix.c                       |  236 +++++------
- src/source.c                        |   56 ++-
+ include/hkl/axes.h                  |  33 ++
+ include/hkl/axis.h                  |  55 +--
+ include/hkl/config.h                |  19 +-
+ include/hkl/diffractometer.h        | 341 ++--------------
+ include/hkl/diffractometer_2C.h     |  38 ++
+ include/hkl/geometry.h              | 223 +---------
+ include/hkl/holder.h                |  43 +-
+ include/hkl/holders.h               |  33 ++
+ include/hkl/new_diffractometer.h    |  48 ---
+ include/hkl/new_diffractometer_2C.h |  40 --
+ include/hkl/new_geometry.h          |  45 --
+ include/hkl/source.h                |  20 +-
+ src/SConscript                      |  18 +-
+ src/axes.c                          |  59 +++
+ src/axis.c                          | 165 +-------
+ src/diffractometer.c                |  40 ++
+ src/diffractometer.cpp              |  49 ---
+ src/geometry.c                      |  12 +
+ src/holder.c                        | 114 ++----
+ src/holders.c                       |  41 ++
+ src/interval.c                      | 792 +++++++++++++++++-------------------
+ src/new_diffractometer.c            |  74 ----
+ src/new_geometry.c                  |  36 --
+ src/quaternion.c                    | 161 ++++----
+ src/smatrix.c                       | 236 ++++++-----
+ src/source.c                        |  56 +--
  26 files changed, 980 insertions(+), 1811 deletions(-)
 
 commit cb89c56cb060e63da61134ac9f0385e59b3c85ee
@@ -8395,11 +18156,11 @@ Date:   Wed Nov 21 17:15:27 2007 +0100
 
     * add the axis source test
 
- test/SConscript    |    2 +-
- test/axis_test.c   |  124 ++++++++++++++++++++++++++++++++++++++++++++++++++++
- test/axis_test.cpp |  120 --------------------------------------------------
- test/axis_test.h   |   25 ----------
- test/main.c        |    1 +
+ test/SConscript    |   2 +-
+ test/axis_test.c   | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ test/axis_test.cpp | 120 ---------------------------------------------------
+ test/axis_test.h   |  25 -----------
+ test/main.c        |   1 +
  5 files changed, 126 insertions(+), 146 deletions(-)
 
 commit 144be6c394472ce6a0612ffc8a742f31c51ea906
@@ -8408,23 +18169,23 @@ Date:   Wed Nov 21 17:01:25 2007 +0100
 
     * add more C tests (interval + source)
 
- include/hkl/config.h   |    1 +
- test/SConscript        |    7 +-
- test/interval_test.c   |  285 +++++++++++++++++++++++++++++++++++++++++++++++
- test/interval_test.cpp |  291 ------------------------------------------------
- test/interval_test.h   |   51 ---------
- test/libHKL_test.cpp   |   16 ---
- test/main.c            |    5 +-
- test/quaternion_test.c |   42 ++++---
- test/quaternion_test.h |    6 -
- test/smatrix_test.c    |  107 ++++++++++++++++++
- test/source_test.c     |   42 +++++++
- test/source_test.cpp   |   36 ------
- test/source_test.h     |   27 -----
- test/svecmat_test.c    |  207 ----------------------------------
- test/svecmat_test.h    |    6 -
- test/svector_test.c    |  122 ++++++++++++++++++++
- test/test.h            |   19 ++-
+ include/hkl/config.h   |   1 +
+ test/SConscript        |   7 +-
+ test/interval_test.c   | 285 ++++++++++++++++++++++++++++++++++++++++++++++++
+ test/interval_test.cpp | 291 -------------------------------------------------
+ test/interval_test.h   |  51 ---------
+ test/libHKL_test.cpp   |  16 ---
+ test/main.c            |   5 +-
+ test/quaternion_test.c |  42 +++----
+ test/quaternion_test.h |   6 -
+ test/smatrix_test.c    | 107 ++++++++++++++++++
+ test/source_test.c     |  42 +++++++
+ test/source_test.cpp   |  36 ------
+ test/source_test.h     |  27 -----
+ test/svecmat_test.c    | 207 -----------------------------------
+ test/svecmat_test.h    |   6 -
+ test/svector_test.c    | 122 +++++++++++++++++++++
+ test/test.h            |  19 +++-
  17 files changed, 600 insertions(+), 670 deletions(-)
 
 commit 4d992f063aa068fd159cf4cbecce94d3d4c86ed5
@@ -8433,13 +18194,13 @@ Date:   Tue Nov 20 16:36:47 2007 +0100
 
     * refactor the quaternion tests
 
- test/SConscript          |    2 +-
- test/main.c              |    2 +
- test/quaternion_test.c   |  128 +++++++++++++++++++++++++++++++++++++++++++++
- test/quaternion_test.cpp |  130 ----------------------------------------------
- test/quaternion_test.h   |   35 +------------
- test/svecmat_test.c      |   32 ++++++-----
- test/test.h              |    2 +-
+ test/SConscript          |   2 +-
+ test/main.c              |   2 +
+ test/quaternion_test.c   | 128 ++++++++++++++++++++++++++++++++++++++++++++++
+ test/quaternion_test.cpp | 130 -----------------------------------------------
+ test/quaternion_test.h   |  35 +------------
+ test/svecmat_test.c      |  32 ++++++------
+ test/test.h              |   2 +-
  7 files changed, 150 insertions(+), 181 deletions(-)
 
 commit bcb5b74ed3edc54c2061bfbb392545f0c4b0682a
@@ -8450,16 +18211,16 @@ Date:   Tue Nov 20 16:01:13 2007 +0100
     
     Add an home made test system.
 
- SConstruct            |    4 +-
- src/svector.c         |  248 ++++++++++++++++++++++++------------------------
- test/SConscript       |   32 +++----
- test/main.c           |   19 ++++
- test/main.cpp         |   16 ---
- test/svecmat_test.c   |  205 ++++++++++++++++++++++++++++++++++++++++
- test/svecmat_test.cpp |  210 -----------------------------------------
- test/svecmat_test.h   |   54 +-----------
- test/test.c           |   68 ++++++++++++++
- test/test.h           |   67 +++++++++++++
+ SConstruct            |   4 +-
+ src/svector.c         | 248 +++++++++++++++++++++++++-------------------------
+ test/SConscript       |  32 +++----
+ test/main.c           |  19 ++++
+ test/main.cpp         |  16 ----
+ test/svecmat_test.c   | 205 +++++++++++++++++++++++++++++++++++++++++
+ test/svecmat_test.cpp | 210 ------------------------------------------
+ test/svecmat_test.h   |  54 +----------
+ test/test.c           |  68 ++++++++++++++
+ test/test.h           |  67 ++++++++++++++
  10 files changed, 498 insertions(+), 425 deletions(-)
 
 commit 67931efdc5dd90a5a05eaef33e8c42d19b5f3274
@@ -8468,9 +18229,9 @@ Date:   Tue Oct 30 22:18:33 2007 +0100
 
     * pass all axis tests
 
- include/hkl/axis.h |    4 +-
- src/geometry.cpp   |    4 +-
- test/axis_test.cpp |  131 ++++++++++++++++++++++++++++------------------------
+ include/hkl/axis.h |   4 +-
+ src/geometry.cpp   |   4 +-
+ test/axis_test.cpp | 131 ++++++++++++++++++++++++++++-------------------------
  3 files changed, 74 insertions(+), 65 deletions(-)
 
 commit acd06ff9f217bf1fd422c868a55d6b31bf4e0d2a
@@ -8479,10 +18240,10 @@ Date:   Tue Oct 30 21:43:37 2007 +0100
 
     * the first part of the axis test is OK
 
- config-linux2.py   |    1 -
- src/axis.c         |    7 ++++---
- test/SConscript    |    7 ++++---
- test/axis_test.cpp |   36 ++++++++++++++++++++++--------------
+ config-linux2.py   |  1 -
+ src/axis.c         |  7 ++++---
+ test/SConscript    |  7 ++++---
+ test/axis_test.cpp | 36 ++++++++++++++++++++++--------------
  4 files changed, 30 insertions(+), 21 deletions(-)
 
 commit d39479e206a97e98894893e4a137bff5e9707a30
@@ -8491,10 +18252,10 @@ Date:   Mon Oct 29 22:02:57 2007 +0100
 
     * work on the axis test (do not compile)
 
- include/hkl/axis.h |    4 +-
- src/axis.c         |   34 +++++++++
- test/axis_test.cpp |  189 ++++++++++++++++++++++------------------------------
- test/axis_test.h   |   12 ++--
+ include/hkl/axis.h |   4 +-
+ src/axis.c         |  34 ++++++++++
+ test/axis_test.cpp | 189 +++++++++++++++++++++++------------------------------
+ test/axis_test.h   |  12 ++--
  4 files changed, 122 insertions(+), 117 deletions(-)
 
 commit 0f17ffcc448678b34bd0cd5fb47165ea7f34db38
@@ -8514,10 +18275,10 @@ Date:   Sun Oct 28 23:07:44 2007 +0100
  include/hkl/kappa6C_geometry.h              |  396 +++++------
  include/hkl/new_geometry.h                  |    4 +-
  include/hkl/new_holder.h                    |   41 --
- include/hkl/pseudoaxe.h                     |  270 ++++----
+ include/hkl/pseudoaxe.h                     |  270 ++++---
  include/hkl/pseudoaxeengine.h               |   13 +-
  include/hkl/twoC_vertical_geometry.h        |  263 +++----
- include/hkl/twoC_vertical_pseudoaxeengine.h |  187 +++---
+ include/hkl/twoC_vertical_pseudoaxeengine.h |  187 +++--
  src/SConscript                              |   11 +-
  src/geometry.cpp                            |  613 ++++++++--------
  src/holder.c                                |  112 +++
@@ -8526,9 +18287,9 @@ Date:   Sun Oct 28 23:07:44 2007 +0100
  src/pseudoaxe.cpp                           |    4 +-
  src/reflection.cpp                          |  232 +++---
  src/sample.cpp                              |  297 ++++----
- src/twoC_vertical_geometry.cpp              |  564 ++++++++--------
+ src/twoC_vertical_geometry.cpp              |  564 ++++++++-------
  src/twoC_vertical_mode.cpp                  |  146 ++--
- src/twoC_vertical_pseudoaxeengine.cpp       |  576 ++++++++--------
+ src/twoC_vertical_pseudoaxeengine.cpp       |  576 ++++++++-------
  test/SConscript                             |   18 +-
  test/axe_rotation_test.cpp                  |  129 ----
  test/axe_rotation_test.h                    |   31 -
@@ -8558,19 +18319,19 @@ Date:   Fri Oct 26 16:18:41 2007 +0200
 
     * start working on the axe C++ -> C transition
 
- include/hkl/axe.h          |  256 ------------------------
- include/hkl/axe_rotation.h |  150 --------------
- include/hkl/axefactory.h   |   34 ----
- include/hkl/axis.h         |   56 ++++++
- include/hkl/holder.h       |  424 +++++++++++++++-------------------------
- include/hkl/new_axe.h      |   50 -----
- src/SConscript             |    5 +-
- src/axe.cpp                |  279 --------------------------
- src/axe_rotation.cpp       |  149 --------------
- src/axefactory.cpp         |   34 ----
- src/axis.c                 |  137 +++++++++++++
- src/holder.cpp             |  465 +++++++++++++++++++++++---------------------
- src/new_axe.c              |  124 ------------
+ include/hkl/axe.h          | 256 -------------------------
+ include/hkl/axe_rotation.h | 150 ---------------
+ include/hkl/axefactory.h   |  34 ----
+ include/hkl/axis.h         |  56 ++++++
+ include/hkl/holder.h       | 424 ++++++++++++++++-------------------------
+ include/hkl/new_axe.h      |  50 -----
+ src/SConscript             |   5 +-
+ src/axe.cpp                | 279 ---------------------------
+ src/axe_rotation.cpp       | 149 ---------------
+ src/axefactory.cpp         |  34 ----
+ src/axis.c                 | 137 +++++++++++++
+ src/holder.cpp             | 465 +++++++++++++++++++++++----------------------
+ src/new_axe.c              | 124 ------------
  13 files changed, 595 insertions(+), 1568 deletions(-)
 
 commit 621048230d4eb2041a6c7b394de5b0802c84cb70
@@ -8579,16 +18340,16 @@ Date:   Wed Oct 24 13:54:03 2007 +0200
 
     * working on the C version of the geometry
 
- include/hkl/new_axe.h               |   51 ++++---
- include/hkl/new_diffractometer.h    |   48 +++++++
- include/hkl/new_diffractometer_2C.h |   40 ++++++
- include/hkl/new_geometry.h          |  255 +++--------------------------------
- include/hkl/new_holder.h            |   42 +++---
- src/SConscript                      |    1 +
- src/new_axe.c                       |  138 +++++++++++++------
- src/new_diffractometer.c            |   74 ++++++++++
- src/new_geometry.c                  |   36 +++++
- src/new_holder.c                    |  136 ++++++++++++-------
+ include/hkl/new_axe.h               |  51 ++++----
+ include/hkl/new_diffractometer.h    |  48 +++++++
+ include/hkl/new_diffractometer_2C.h |  40 ++++++
+ include/hkl/new_geometry.h          | 255 +++---------------------------------
+ include/hkl/new_holder.h            |  42 +++---
+ src/SConscript                      |   1 +
+ src/new_axe.c                       | 138 +++++++++++++------
+ src/new_diffractometer.c            |  74 +++++++++++
+ src/new_geometry.c                  |  36 +++++
+ src/new_holder.c                    | 136 ++++++++++++-------
  10 files changed, 449 insertions(+), 372 deletions(-)
 
 commit 22cbd15ea9c4d9890f320ed05af1cf12592d8cdd
@@ -8597,15 +18358,15 @@ Date:   Thu Oct 4 17:54:49 2007 +0200
 
     * start adding the holder and axe C version
 
- include/hkl/config.h       |   32 ++++++
- include/hkl/new_axe.h      |   43 +++++++
- include/hkl/new_geometry.h |  264 ++++++++++++++++++++++++++++++++++++++++++++
- include/hkl/new_holder.h   |   41 +++++++
- src/SConscript             |    4 +
- src/new_axe.c              |   72 ++++++++++++
- src/new_holder.c           |   74 ++++++++++++
- src/usage.c                |   41 +++++++
- 8 files changed, 571 insertions(+), 0 deletions(-)
+ include/hkl/config.h       |  32 ++++++
+ include/hkl/new_axe.h      |  43 ++++++++
+ include/hkl/new_geometry.h | 264 +++++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/new_holder.h   |  41 +++++++
+ src/SConscript             |   4 +
+ src/new_axe.c              |  72 +++++++++++++
+ src/new_holder.c           |  74 +++++++++++++
+ src/usage.c                |  41 +++++++
+ 8 files changed, 571 insertions(+)
 
 commit 601317ef9c914de05f53531b28a4db0fde448af0
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -8613,8 +18374,8 @@ Date:   Tue Oct 2 17:09:54 2007 +0200
 
     * remove gcc warnings
 
- src/interval.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
+ src/interval.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
 commit 6aafd1c470b22ed7f1f12657521c0d96496f7ef3
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -8624,45 +18385,45 @@ Date:   Tue Oct 2 15:53:18 2007 +0200
     
     win32 compilation is ok now
 
- config-linux2.py                      |    1 +
- include/hkl/geometry.h                |   50 ++-----------
- include/hkl/mode.h                    |    5 +-
- include/hkl/source.h                  |  130 +++++----------------------------
- include/hkl/svector.h                 |    1 +
- src/SConscript                        |    2 +-
- src/axefactory.cpp                    |    1 +
- src/eulerian4C_vertical_geometry.cpp  |   18 +++--
- src/eulerian6C_geometry.cpp           |   14 ++--
- src/eulerian6C_pseudoaxeengine.cpp    |    8 +-
- src/geometry.cpp                      |   61 ++++++++++------
- src/holder.cpp                        |    2 +-
- src/interval.c                        |   20 ++++--
- src/kappa4C_vertical_geometry.cpp     |   14 ++--
- src/kappa6C_geometry.cpp              |   14 ++--
- src/reflection.cpp                    |    2 +-
- src/source.c                          |   44 +++++++++++
- src/svector.c                         |   31 +++++++-
- src/twoC_vertical_geometry.cpp        |   20 +++--
- src/twoC_vertical_pseudoaxeengine.cpp |    8 +-
- test/affinement_simplex_test.cpp      |    2 +-
- test/geometry_eulerian4C_test.cpp     |    3 +-
- test/geometry_eulerian6C_test.cpp     |    7 +-
- test/geometry_kappa4C_test.cpp        |    4 +-
- test/geometry_kappa6C_test.cpp        |    4 +-
- test/geometry_twoC_test.cpp           |    5 +-
- test/mode_eulerian4C_test.cpp         |    2 +-
- test/mode_twoC_test.cpp               |    6 +-
- test/pseudoaxe_eulerian6C_test.cpp    |    6 +-
- test/pseudoaxe_kappa4C_test.cpp       |   10 +-
- test/pseudoaxe_kappa6C_test.cpp       |    8 +-
- test/pseudoaxe_twoC_test.cpp          |    4 +-
- test/reflection_test.cpp              |    3 +-
- test/reflection_test.h                |    2 +-
- test/reflectionlist_test.cpp          |   10 +-
- test/sample_test.cpp                  |    2 +-
- test/sample_test.h                    |    2 +-
- test/source_test.cpp                  |   90 ++++------------------
- test/source_test.h                    |   23 +-----
+ config-linux2.py                      |   1 +
+ include/hkl/geometry.h                |  50 +++----------
+ include/hkl/mode.h                    |   5 +-
+ include/hkl/source.h                  | 130 +++++-----------------------------
+ include/hkl/svector.h                 |   1 +
+ src/SConscript                        |   2 +-
+ src/axefactory.cpp                    |   1 +
+ src/eulerian4C_vertical_geometry.cpp  |  18 ++---
+ src/eulerian6C_geometry.cpp           |  14 ++--
+ src/eulerian6C_pseudoaxeengine.cpp    |   8 +--
+ src/geometry.cpp                      |  61 ++++++++++------
+ src/holder.cpp                        |   2 +-
+ src/interval.c                        |  20 ++++--
+ src/kappa4C_vertical_geometry.cpp     |  14 ++--
+ src/kappa6C_geometry.cpp              |  14 ++--
+ src/reflection.cpp                    |   2 +-
+ src/source.c                          |  44 ++++++++++++
+ src/svector.c                         |  31 +++++++-
+ src/twoC_vertical_geometry.cpp        |  20 +++---
+ src/twoC_vertical_pseudoaxeengine.cpp |   8 +--
+ test/affinement_simplex_test.cpp      |   2 +-
+ test/geometry_eulerian4C_test.cpp     |   3 +-
+ test/geometry_eulerian6C_test.cpp     |   7 +-
+ test/geometry_kappa4C_test.cpp        |   4 +-
+ test/geometry_kappa6C_test.cpp        |   4 +-
+ test/geometry_twoC_test.cpp           |   5 +-
+ test/mode_eulerian4C_test.cpp         |   2 +-
+ test/mode_twoC_test.cpp               |   6 +-
+ test/pseudoaxe_eulerian6C_test.cpp    |   6 +-
+ test/pseudoaxe_kappa4C_test.cpp       |  10 +--
+ test/pseudoaxe_kappa6C_test.cpp       |   8 +--
+ test/pseudoaxe_twoC_test.cpp          |   4 +-
+ test/reflection_test.cpp              |   3 +-
+ test/reflection_test.h                |   2 +-
+ test/reflectionlist_test.cpp          |  10 +--
+ test/sample_test.cpp                  |   2 +-
+ test/sample_test.h                    |   2 +-
+ test/source_test.cpp                  |  90 +++++------------------
+ test/source_test.h                    |  23 ++----
  39 files changed, 278 insertions(+), 361 deletions(-)
 
 commit ee4bcceeb75ec2fd5c77a2c8ce4bd6ee82f63b45
@@ -8671,10 +18432,10 @@ Date:   Tue Oct 2 13:09:14 2007 +0200
 
     * add forgotten files
 
- include/hkl/smatrix.h |   46 +++++
- include/hkl/svector.h |   70 +++++++
- src/interval.c        |  492 +++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 608 insertions(+), 0 deletions(-)
+ include/hkl/smatrix.h |  46 +++++
+ include/hkl/svector.h |  70 +++++++
+ src/interval.c        | 492 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 608 insertions(+)
 
 commit 707e123fd2820f379950e5c2b305b45a0a0afe62
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -8682,16 +18443,16 @@ Date:   Tue Oct 2 11:56:35 2007 +0200
 
     * rafactoring de interval C++ -> C (cleaner)
 
- include/hkl/config.h                     |    2 +-
- include/hkl/interval.h                   |  242 ++----------
- include/hkl/kappa4C_vertical_geometry.h  |   50 ++-
- src/SConscript                           |    2 +-
- src/eulerian6C_pseudoaxeengine.cpp       |   75 ++--
- src/interval.cpp                         |  639 ------------------------------
- src/kappa4C_vertical_pseudoaxeengine.cpp |   14 +-
- src/twoC_vertical_pseudoaxeengine.cpp    |   20 +-
- test/interval_test.cpp                   |  439 ++++++++-------------
- test/interval_test.h                     |   53 ++-
+ include/hkl/config.h                     |   2 +-
+ include/hkl/interval.h                   | 242 ++----------
+ include/hkl/kappa4C_vertical_geometry.h  |  50 ++-
+ src/SConscript                           |   2 +-
+ src/eulerian6C_pseudoaxeengine.cpp       |  75 ++--
+ src/interval.cpp                         | 639 -------------------------------
+ src/kappa4C_vertical_pseudoaxeengine.cpp |  14 +-
+ src/twoC_vertical_pseudoaxeengine.cpp    |  20 +-
+ test/interval_test.cpp                   | 439 ++++++++-------------
+ test/interval_test.h                     |  53 +--
  10 files changed, 331 insertions(+), 1205 deletions(-)
 
 commit 4b80bee8317c4ce53629f7e29e4b89ad09685653
@@ -8702,52 +18463,52 @@ Date:   Mon Oct 1 16:58:47 2007 +0200
     
     try to have a nicer separation beetween svector and smatrix
 
- include/hkl/axe_rotation.h                        |    2 +-
- include/hkl/derived_mode.h                        |    2 +-
- include/hkl/eulerian4C_vertical_pseudoaxeengine.h |   25 +----
- include/hkl/eulerian6C_pseudoaxeengine.h          |   21 +----
- include/hkl/geometry.h                            |    3 +-
- include/hkl/kappa4C_vertical_geometry.h           |   48 ++---------
- include/hkl/lattice.h                             |    6 +-
- include/hkl/mode.h                                |    4 +-
- include/hkl/quaternion.h                          |    7 ++-
- include/hkl/reflection.h                          |    2 +-
- include/hkl/sample.h                              |   14 +--
- include/hkl/sample_monocrystal.h                  |    2 +-
- include/hkl/source.h                              |    2 +-
- include/hkl/svecmat.h                             |   99 ---------------------
- src/axe.cpp                                       |    2 +-
- src/axe_rotation.cpp                              |    1 +
- src/eulerian4C_vertical_mode.cpp                  |    3 +-
- src/eulerian4C_vertical_pseudoaxeengine.cpp       |    2 +-
- src/eulerian6C_pseudoaxeengine.cpp                |    2 +-
- src/holder.cpp                                    |    2 +-
- src/lattice.cpp                                   |    2 +
- src/quaternion.c                                  |    4 +
- src/reflection.cpp                                |    2 +-
- src/reflection_monocrystal.cpp                    |    4 +-
- src/reflectionlist.cpp                            |    2 +-
- src/sample.cpp                                    |    2 +-
- src/sample_monocrystal.cpp                        |    1 +
- src/smatrix.c                                     |    6 +-
- src/source.cpp                                    |    1 +
- src/svector.c                                     |    6 +-
- src/twoC_vertical_mode.cpp                        |    2 +-
- src/twoC_vertical_pseudoaxeengine.cpp             |    2 +-
- test/affinement_simplex_test.cpp                  |    1 +
- test/axe_rotation_test.cpp                        |    3 +
- test/geometry_kappa6C_test.cpp                    |    1 +
- test/holder_test.cpp                              |    1 +
- test/lattice_test.cpp                             |    1 +
- test/pseudoaxe_eulerian4C_test.cpp                |    4 +-
- test/pseudoaxe_eulerian6C_test.cpp                |    4 +-
- test/pseudoaxe_twoC_test.cpp                      |    4 +-
- test/quaternion_test.cpp                          |    5 +
- test/reflection_test.cpp                          |    1 +
- test/sample_test.cpp                              |    1 +
- test/source_test.cpp                              |    1 +
- test/svecmat_test.cpp                             |   24 +++---
- test/svecmat_test.h                               |    2 +-
+ include/hkl/axe_rotation.h                        |  2 +-
+ include/hkl/derived_mode.h                        |  2 +-
+ include/hkl/eulerian4C_vertical_pseudoaxeengine.h | 25 ++----
+ include/hkl/eulerian6C_pseudoaxeengine.h          | 21 ++---
+ include/hkl/geometry.h                            |  3 +-
+ include/hkl/kappa4C_vertical_geometry.h           | 48 ++---------
+ include/hkl/lattice.h                             |  6 +-
+ include/hkl/mode.h                                |  4 +-
+ include/hkl/quaternion.h                          |  7 +-
+ include/hkl/reflection.h                          |  2 +-
+ include/hkl/sample.h                              | 14 ++--
+ include/hkl/sample_monocrystal.h                  |  2 +-
+ include/hkl/source.h                              |  2 +-
+ include/hkl/svecmat.h                             | 99 -----------------------
+ src/axe.cpp                                       |  2 +-
+ src/axe_rotation.cpp                              |  1 +
+ src/eulerian4C_vertical_mode.cpp                  |  3 +-
+ src/eulerian4C_vertical_pseudoaxeengine.cpp       |  2 +-
+ src/eulerian6C_pseudoaxeengine.cpp                |  2 +-
+ src/holder.cpp                                    |  2 +-
+ src/lattice.cpp                                   |  2 +
+ src/quaternion.c                                  |  4 +
+ src/reflection.cpp                                |  2 +-
+ src/reflection_monocrystal.cpp                    |  4 +-
+ src/reflectionlist.cpp                            |  2 +-
+ src/sample.cpp                                    |  2 +-
+ src/sample_monocrystal.cpp                        |  1 +
+ src/smatrix.c                                     |  6 +-
+ src/source.cpp                                    |  1 +
+ src/svector.c                                     |  6 +-
+ src/twoC_vertical_mode.cpp                        |  2 +-
+ src/twoC_vertical_pseudoaxeengine.cpp             |  2 +-
+ test/affinement_simplex_test.cpp                  |  1 +
+ test/axe_rotation_test.cpp                        |  3 +
+ test/geometry_kappa6C_test.cpp                    |  1 +
+ test/holder_test.cpp                              |  1 +
+ test/lattice_test.cpp                             |  1 +
+ test/pseudoaxe_eulerian4C_test.cpp                |  4 +-
+ test/pseudoaxe_eulerian6C_test.cpp                |  4 +-
+ test/pseudoaxe_twoC_test.cpp                      |  4 +-
+ test/quaternion_test.cpp                          |  5 ++
+ test/reflection_test.cpp                          |  1 +
+ test/sample_test.cpp                              |  1 +
+ test/source_test.cpp                              |  1 +
+ test/svecmat_test.cpp                             | 24 +++---
+ test/svecmat_test.h                               |  2 +-
  46 files changed, 110 insertions(+), 226 deletions(-)
 
 commit f75f49bad64f0a73205d31160625a058c6c00bfa
@@ -8756,96 +18517,96 @@ Date:   Mon Oct 1 16:20:06 2007 +0200
 
     * remove all serialization code
 
- include/hkl/affinement.h                          |   17 +---
- include/hkl/affinementlist.h                      |   17 +---
- include/hkl/axe.h                                 |   33 +------
- include/hkl/axe_rotation.h                        |   16 +---
- include/hkl/derived_pseudoaxeengine.h             |   95 +------------------
- include/hkl/diffractometer.h                      |   16 +---
- include/hkl/eulerian4C_vertical_pseudoaxeengine.h |   16 ---
- include/hkl/eulerian6C_pseudoaxeengine.h          |   32 ------
- include/hkl/fitparameter.h                        |   14 ---
- include/hkl/fitparameterlist.h                    |   14 ---
- include/hkl/geometry.h                            |   16 +---
- include/hkl/geometry_kappa.h                      |   16 +---
- include/hkl/hklobject.h                           |   15 ---
- include/hkl/holder.h                              |   31 ------
- include/hkl/interval.h                            |   14 ---
- include/hkl/kappa4C_vertical_pseudoaxeengine.h    |   15 ---
- include/hkl/lattice.h                             |   16 ---
- include/hkl/modelist.h                            |   15 ---
- include/hkl/mymap.h                               |   63 ------------
- include/hkl/object.h                              |   15 ---
- include/hkl/parameter.h                           |   14 ---
- include/hkl/parameterlist.h                       |   14 ---
- include/hkl/pseudoaxeengine.h                     |   48 ---------
- include/hkl/pseudoaxeenginelist.h                 |   15 ---
- include/hkl/range.h                               |   14 ---
- include/hkl/reflection.h                          |   15 ---
- include/hkl/reflectionlist.h                      |   15 ---
- include/hkl/sample.h                              |   15 ---
- include/hkl/sample_monocrystal.h                  |   15 ---
- include/hkl/samplelist.h                          |   15 ---
- include/hkl/twoC_vertical_pseudoaxeengine.h       |   45 ---------
- include/hkl/value.h                               |   13 ---
- src/affinement.cpp                                |   34 -------
- src/affinementlist.cpp                            |   38 -------
- src/axe.cpp                                       |   73 --------------
- src/axe_rotation.cpp                              |   25 -----
- src/diffractometer.cpp                            |   40 --------
- src/eulerian4C_vertical_pseudoaxeengine.cpp       |   27 -----
- src/eulerian6C_pseudoaxeengine.cpp                |   57 -----------
- src/fitparameter.cpp                              |   31 ------
- src/fitparameterlist.cpp                          |   35 -------
- src/geometry.cpp                                  |   26 -----
- src/geometry_kappa.cpp                            |   26 -----
- src/hklobject.cpp                                 |   28 ------
- src/holder.cpp                                    |  108 ---------------------
- src/interval.cpp                                  |   25 -----
- src/kappa4C_vertical_pseudoaxeengine.cpp          |   28 ------
- src/lattice.cpp                                   |   42 --------
- src/modelist.cpp                                  |   38 -------
- src/object.cpp                                    |   27 -----
- src/parameter.cpp                                 |   25 -----
- src/parameterlist.cpp                             |   35 -------
- src/pseudoaxeenginelist.cpp                       |   38 -------
- src/range.cpp                                     |   31 ------
- src/reflection.cpp                                |   28 ------
- src/reflectionlist.cpp                            |   46 ---------
- src/sample.cpp                                    |   30 ------
- src/sample_monocrystal.cpp                        |   32 ------
- src/samplelist.cpp                                |   56 -----------
- src/twoC_vertical_pseudoaxeengine.cpp             |   82 ----------------
- src/value.cpp                                     |   24 -----
- test/fitparameter_test.cpp                        |   29 ------
- test/fitparameter_test.h                          |    2 -
- test/geometry_eulerian6C_test.cpp                 |   16 ---
- test/geometry_eulerian6C_test.h                   |    2 -
- test/geometry_kappa4C_test.cpp                    |   20 ----
- test/geometry_kappa4C_test.h                      |    2 -
- test/geometry_kappa6C_test.cpp                    |   20 ----
- test/geometry_kappa6C_test.h                      |    2 -
- test/geometry_test.cpp                            |   16 ---
- test/geometry_test.h                              |    2 -
- test/geometry_twoC_test.cpp                       |   16 ---
- test/geometry_twoC_test.h                         |    2 -
- test/hklobject_test.cpp                           |   19 ----
- test/hklobject_test.h                             |    2 -
- test/holderlist_test.cpp                          |    2 -
- test/interval_test.cpp                            |   19 ----
- test/interval_test.h                              |    2 -
- test/lattice_test.cpp                             |   18 ----
- test/lattice_test.h                               |    2 -
- test/object_test.cpp                              |   18 ----
- test/object_test.h                                |    2 -
- test/parameter_test.cpp                           |   18 ----
- test/parameter_test.h                             |    2 -
- test/range_test.cpp                               |   19 ----
- test/range_test.h                                 |    2 -
- test/samplelist_test.cpp                          |   16 ---
- test/samplelist_test.h                            |    2 -
- test/value_test.cpp                               |   19 ----
- test/value_test.h                                 |    3 -
+ include/hkl/affinement.h                          |  17 +---
+ include/hkl/affinementlist.h                      |  17 +---
+ include/hkl/axe.h                                 |  33 +------
+ include/hkl/axe_rotation.h                        |  16 +---
+ include/hkl/derived_pseudoaxeengine.h             |  95 +------------------
+ include/hkl/diffractometer.h                      |  16 +---
+ include/hkl/eulerian4C_vertical_pseudoaxeengine.h |  16 ----
+ include/hkl/eulerian6C_pseudoaxeengine.h          |  32 -------
+ include/hkl/fitparameter.h                        |  14 ---
+ include/hkl/fitparameterlist.h                    |  14 ---
+ include/hkl/geometry.h                            |  16 +---
+ include/hkl/geometry_kappa.h                      |  16 +---
+ include/hkl/hklobject.h                           |  15 ---
+ include/hkl/holder.h                              |  31 -------
+ include/hkl/interval.h                            |  14 ---
+ include/hkl/kappa4C_vertical_pseudoaxeengine.h    |  15 ---
+ include/hkl/lattice.h                             |  16 ----
+ include/hkl/modelist.h                            |  15 ---
+ include/hkl/mymap.h                               |  63 -------------
+ include/hkl/object.h                              |  15 ---
+ include/hkl/parameter.h                           |  14 ---
+ include/hkl/parameterlist.h                       |  14 ---
+ include/hkl/pseudoaxeengine.h                     |  48 ----------
+ include/hkl/pseudoaxeenginelist.h                 |  15 ---
+ include/hkl/range.h                               |  14 ---
+ include/hkl/reflection.h                          |  15 ---
+ include/hkl/reflectionlist.h                      |  15 ---
+ include/hkl/sample.h                              |  15 ---
+ include/hkl/sample_monocrystal.h                  |  15 ---
+ include/hkl/samplelist.h                          |  15 ---
+ include/hkl/twoC_vertical_pseudoaxeengine.h       |  45 ---------
+ include/hkl/value.h                               |  13 ---
+ src/affinement.cpp                                |  34 -------
+ src/affinementlist.cpp                            |  38 --------
+ src/axe.cpp                                       |  73 ---------------
+ src/axe_rotation.cpp                              |  25 -----
+ src/diffractometer.cpp                            |  40 --------
+ src/eulerian4C_vertical_pseudoaxeengine.cpp       |  27 ------
+ src/eulerian6C_pseudoaxeengine.cpp                |  57 ------------
+ src/fitparameter.cpp                              |  31 -------
+ src/fitparameterlist.cpp                          |  35 -------
+ src/geometry.cpp                                  |  26 ------
+ src/geometry_kappa.cpp                            |  26 ------
+ src/hklobject.cpp                                 |  28 ------
+ src/holder.cpp                                    | 108 ----------------------
+ src/interval.cpp                                  |  25 -----
+ src/kappa4C_vertical_pseudoaxeengine.cpp          |  28 ------
+ src/lattice.cpp                                   |  42 ---------
+ src/modelist.cpp                                  |  38 --------
+ src/object.cpp                                    |  27 ------
+ src/parameter.cpp                                 |  25 -----
+ src/parameterlist.cpp                             |  35 -------
+ src/pseudoaxeenginelist.cpp                       |  38 --------
+ src/range.cpp                                     |  31 -------
+ src/reflection.cpp                                |  28 ------
+ src/reflectionlist.cpp                            |  46 ---------
+ src/sample.cpp                                    |  30 ------
+ src/sample_monocrystal.cpp                        |  32 -------
+ src/samplelist.cpp                                |  56 -----------
+ src/twoC_vertical_pseudoaxeengine.cpp             |  82 ----------------
+ src/value.cpp                                     |  24 -----
+ test/fitparameter_test.cpp                        |  29 ------
+ test/fitparameter_test.h                          |   2 -
+ test/geometry_eulerian6C_test.cpp                 |  16 ----
+ test/geometry_eulerian6C_test.h                   |   2 -
+ test/geometry_kappa4C_test.cpp                    |  20 ----
+ test/geometry_kappa4C_test.h                      |   2 -
+ test/geometry_kappa6C_test.cpp                    |  20 ----
+ test/geometry_kappa6C_test.h                      |   2 -
+ test/geometry_test.cpp                            |  16 ----
+ test/geometry_test.h                              |   2 -
+ test/geometry_twoC_test.cpp                       |  16 ----
+ test/geometry_twoC_test.h                         |   2 -
+ test/hklobject_test.cpp                           |  19 ----
+ test/hklobject_test.h                             |   2 -
+ test/holderlist_test.cpp                          |   2 -
+ test/interval_test.cpp                            |  19 ----
+ test/interval_test.h                              |   2 -
+ test/lattice_test.cpp                             |  18 ----
+ test/lattice_test.h                               |   2 -
+ test/object_test.cpp                              |  18 ----
+ test/object_test.h                                |   2 -
+ test/parameter_test.cpp                           |  18 ----
+ test/parameter_test.h                             |   2 -
+ test/range_test.cpp                               |  19 ----
+ test/range_test.h                                 |   2 -
+ test/samplelist_test.cpp                          |  16 ----
+ test/samplelist_test.h                            |   2 -
+ test/value_test.cpp                               |  19 ----
+ test/value_test.h                                 |   3 -
  90 files changed, 9 insertions(+), 2144 deletions(-)
 
 commit 8cd30e8a7ff4c9ab59f3a10227946b0e9c17d6cf
@@ -8854,34 +18615,34 @@ Date:   Mon Oct 1 15:42:54 2007 +0200
 
     * pass all tests
 
- include/hkl/svecmat.h                       |    2 +
- src/eulerian4C_vertical_pseudoaxeengine.cpp |   54 ++--
- src/eulerian6C_pseudoaxeengine.cpp          |    7 +-
- src/quaternion.c                            |   68 ++++--
- src/quaternion.cpp                          |  374 ---------------------------
- src/svector.c                               |   34 ++-
- test/SConscript                             |   10 +-
- test/diffractometer_eulerian4C_test.cpp     |  169 ++++--------
- test/diffractometer_eulerian4C_test.h       |    2 -
- test/diffractometer_kappa4C_test.cpp        |   65 +-----
- test/diffractometer_kappa4C_test.h          |    2 -
- test/diffractometer_kappa6C_test.cpp        |   75 +-----
- test/diffractometer_kappa6C_test.h          |    2 -
- test/diffractometer_twoC_test.cpp           |  107 ++------
- test/diffractometer_twoC_test.h             |    2 -
- test/pseudoaxe_eulerian4C_test.cpp          |  182 ++++++--------
- test/pseudoaxe_eulerian4C_test.h            |    2 -
- test/pseudoaxe_eulerian6C_test.cpp          |  263 +++++++++----------
- test/pseudoaxe_eulerian6C_test.h            |    2 -
- test/pseudoaxe_kappa4C_test.cpp             |  370 ++++++++++++---------------
- test/pseudoaxe_kappa4C_test.h               |    2 -
- test/pseudoaxe_kappa6C_test.cpp             |  303 ++++++++++------------
- test/pseudoaxe_kappa6C_test.h               |    2 -
- test/pseudoaxe_twoC_test.cpp                |  149 +++++------
- test/pseudoaxe_twoC_test.h                  |    2 -
- test/quaternion_test.cpp                    |   71 ++++--
- test/svecmat_test.cpp                       |   11 +
- test/svecmat_test.h                         |    2 +
+ include/hkl/svecmat.h                       |   2 +
+ src/eulerian4C_vertical_pseudoaxeengine.cpp |  54 ++--
+ src/eulerian6C_pseudoaxeengine.cpp          |   7 +-
+ src/quaternion.c                            |  68 +++--
+ src/quaternion.cpp                          | 374 ----------------------------
+ src/svector.c                               |  34 ++-
+ test/SConscript                             |  10 +-
+ test/diffractometer_eulerian4C_test.cpp     | 169 ++++---------
+ test/diffractometer_eulerian4C_test.h       |   2 -
+ test/diffractometer_kappa4C_test.cpp        |  65 +----
+ test/diffractometer_kappa4C_test.h          |   2 -
+ test/diffractometer_kappa6C_test.cpp        |  75 +-----
+ test/diffractometer_kappa6C_test.h          |   2 -
+ test/diffractometer_twoC_test.cpp           | 107 +++-----
+ test/diffractometer_twoC_test.h             |   2 -
+ test/pseudoaxe_eulerian4C_test.cpp          | 182 ++++++--------
+ test/pseudoaxe_eulerian4C_test.h            |   2 -
+ test/pseudoaxe_eulerian6C_test.cpp          | 263 +++++++++----------
+ test/pseudoaxe_eulerian6C_test.h            |   2 -
+ test/pseudoaxe_kappa4C_test.cpp             | 370 +++++++++++++--------------
+ test/pseudoaxe_kappa4C_test.h               |   2 -
+ test/pseudoaxe_kappa6C_test.cpp             | 303 ++++++++++------------
+ test/pseudoaxe_kappa6C_test.h               |   2 -
+ test/pseudoaxe_twoC_test.cpp                | 149 +++++------
+ test/pseudoaxe_twoC_test.h                  |   2 -
+ test/quaternion_test.cpp                    |  71 ++++--
+ test/svecmat_test.cpp                       |  11 +
+ test/svecmat_test.h                         |   2 +
  28 files changed, 827 insertions(+), 1507 deletions(-)
 
 commit f44523ed65c1da302a03ef7aef99d658051e8cba
@@ -8890,9 +18651,9 @@ Date:   Fri Sep 28 15:56:53 2007 +0200
 
     * the kappa6c modes are ok
 
- test/SConscript            |    2 +-
- test/mode_kappa6C_test.cpp |  307 +++++++++++++++++++++-----------------------
- test/mode_kappa6C_test.h   |    2 -
+ test/SConscript            |   2 +-
+ test/mode_kappa6C_test.cpp | 307 +++++++++++++++++++++------------------------
+ test/mode_kappa6C_test.h   |   2 -
  3 files changed, 145 insertions(+), 166 deletions(-)
 
 commit 0d1433eb9feb572fce8c2afc428f2d52f3daae33
@@ -8901,9 +18662,9 @@ Date:   Fri Sep 28 15:52:13 2007 +0200
 
     * the kappa4c modes are ok
 
- test/SConscript            |    2 +-
- test/mode_kappa4C_test.cpp |  270 ++++++++++++++++++++-----------------------
- test/mode_kappa4C_test.h   |    2 -
+ test/SConscript            |   2 +-
+ test/mode_kappa4C_test.cpp | 270 +++++++++++++++++++++------------------------
+ test/mode_kappa4C_test.h   |   2 -
  3 files changed, 127 insertions(+), 147 deletions(-)
 
 commit f124d703565098a33f8a459e17b902179da6ec5d
@@ -8912,11 +18673,11 @@ Date:   Fri Sep 28 15:44:04 2007 +0200
 
     * eulerian4C vertical mode are ok
 
- include/hkl/svecmat.h         |    2 +
- src/svector.c                 |    8 ++
- test/SConscript               |    2 +-
- test/mode_eulerian4C_test.cpp |  265 +++++++++++++++++++----------------------
- test/mode_eulerian4C_test.h   |    2 -
+ include/hkl/svecmat.h         |   2 +
+ src/svector.c                 |   8 ++
+ test/SConscript               |   2 +-
+ test/mode_eulerian4C_test.cpp | 265 ++++++++++++++++++++----------------------
+ test/mode_eulerian4C_test.h   |   2 -
  5 files changed, 134 insertions(+), 145 deletions(-)
 
 commit 95a43361e65cf9bb0f1f47cd064d525be273856c
@@ -8925,10 +18686,10 @@ Date:   Fri Sep 28 14:40:45 2007 +0200
 
     * twoC modes are ok
 
- include/hkl/config.h    |    7 ++-
- test/SConscript         |    2 +-
- test/mode_twoC_test.cpp |  124 ++++++++++++++++++++++-------------------------
- test/mode_twoC_test.h   |    2 -
+ include/hkl/config.h    |   7 +--
+ test/SConscript         |   2 +-
+ test/mode_twoC_test.cpp | 124 ++++++++++++++++++++++--------------------------
+ test/mode_twoC_test.h   |   2 -
  4 files changed, 63 insertions(+), 72 deletions(-)
 
 commit aca10eff44c0c1a97d3c08d79625e22589efb4c1
@@ -8937,9 +18698,9 @@ Date:   Fri Sep 28 13:58:19 2007 +0200
 
     * the affinement Tests are ok
 
- test/SConscript                  |    4 +-
- test/affinement_simplex_test.cpp |  141 ++++++++++++++++++--------------------
- test/affinement_simplex_test.h   |    2 -
+ test/SConscript                  |   4 +-
+ test/affinement_simplex_test.cpp | 141 +++++++++++++++++++--------------------
+ test/affinement_simplex_test.h   |   2 -
  3 files changed, 70 insertions(+), 77 deletions(-)
 
 commit 2dfb17954d44eedf08f16157d49bbcfda39fd0a4
@@ -8948,10 +18709,10 @@ Date:   Fri Sep 28 13:51:40 2007 +0200
 
     * the SampleTest are ok
 
- src/sample_monocrystal.cpp |    4 +-
- test/SConscript            |    2 +-
- test/sample_test.cpp       |  150 ++++++++++++++++----------------------------
- test/sample_test.h         |    2 -
+ src/sample_monocrystal.cpp |   4 +-
+ test/SConscript            |   2 +-
+ test/sample_test.cpp       | 150 +++++++++++++++++----------------------------
+ test/sample_test.h         |   2 -
  4 files changed, 59 insertions(+), 99 deletions(-)
 
 commit bd0857f8a63f9654725d08396d187308e2565539
@@ -8960,11 +18721,11 @@ Date:   Fri Sep 28 13:32:27 2007 +0200
 
     * the ReflectionList test are ok.
 
- src/reflectionfactory.cpp    |    4 ++-
- src/reflectionlist.cpp       |    2 +-
- test/SConscript              |    2 +-
- test/reflectionlist_test.cpp |   50 +++++++++++++++++++++---------------------
- test/reflectionlist_test.h   |    2 -
+ src/reflectionfactory.cpp    |  4 +++-
+ src/reflectionlist.cpp       |  2 +-
+ test/SConscript              |  2 +-
+ test/reflectionlist_test.cpp | 50 ++++++++++++++++++++++----------------------
+ test/reflectionlist_test.h   |  2 --
  5 files changed, 30 insertions(+), 30 deletions(-)
 
 commit 98d8c0bb11c2902f00a9e4a28769287eff01d4ec
@@ -8973,11 +18734,11 @@ Date:   Fri Sep 28 13:18:32 2007 +0200
 
     * the reflection tests passed
 
- src/eulerian4C_vertical_pseudoaxeengine.cpp |    7 ++-
- src/svector.c                               |   10 +--
- test/SConscript                             |    2 +-
- test/reflection_test.cpp                    |   92 +++++++++++++--------------
- test/reflection_test.h                      |    2 -
+ src/eulerian4C_vertical_pseudoaxeengine.cpp |  7 ++-
+ src/svector.c                               | 10 +---
+ test/SConscript                             |  2 +-
+ test/reflection_test.cpp                    | 92 ++++++++++++++---------------
+ test/reflection_test.h                      |  2 -
  5 files changed, 54 insertions(+), 59 deletions(-)
 
 commit 7ec138a22b19ca89f26db7c7e0c78038e545d677
@@ -8986,9 +18747,9 @@ Date:   Fri Sep 28 11:32:28 2007 +0200
 
     * now geometry kappa6c is ok
 
- test/SConscript                |    2 +-
- test/geometry_kappa6C_test.cpp |  249 ++++++++++++++++++++++------------------
- test/geometry_kappa6C_test.h   |    4 +-
+ test/SConscript                |   2 +-
+ test/geometry_kappa6C_test.cpp | 249 +++++++++++++++++++++++------------------
+ test/geometry_kappa6C_test.h   |   4 +-
  3 files changed, 140 insertions(+), 115 deletions(-)
 
 commit b05db879601d4312733a5f443c34417fdda141b3
@@ -8997,9 +18758,9 @@ Date:   Fri Sep 28 11:15:29 2007 +0200
 
     * now kappa4C geometry is ok
 
- test/SConscript                |    2 +-
- test/geometry_kappa4C_test.cpp |  297 ++++++++++++++++++++++------------------
- test/geometry_kappa4C_test.h   |    4 +-
+ test/SConscript                |   2 +-
+ test/geometry_kappa4C_test.cpp | 297 ++++++++++++++++++++++-------------------
+ test/geometry_kappa4C_test.h   |   4 +-
  3 files changed, 164 insertions(+), 139 deletions(-)
 
 commit 4c7ae82a6a6973c16d15dfd58171ebe28bed6a71
@@ -9008,8 +18769,8 @@ Date:   Fri Sep 28 11:00:14 2007 +0200
 
     * eulerian6C geometry is ok
 
- test/SConscript                   |    2 +-
- test/geometry_eulerian6C_test.cpp |  281 +++++++++++++++++++++----------------
+ test/SConscript                   |   2 +-
+ test/geometry_eulerian6C_test.cpp | 281 ++++++++++++++++++++++----------------
  2 files changed, 161 insertions(+), 122 deletions(-)
 
 commit 6a2adb9853e8fa7132b5b38c9c8f1af4c07ea5df
@@ -9018,39 +18779,39 @@ Date:   Fri Sep 28 10:43:00 2007 +0200
 
     eulerian4C vertical geometry is ok + remove of constant.h
 
- include/hkl/config.h                        |    3 +
- include/hkl/constant.h                      |   43 ------
- include/hkl/kappa4C_vertical_geometry.h     |   65 +++++-----
- include/hkl/svecmat.h                       |   36 -----
- include/hkl/value.h                         |    6 +-
- src/SConscript                              |    1 -
- src/affinement.cpp                          |    8 +-
- src/affinement_simplex.cpp                  |    7 +-
- src/axe.cpp                                 |    2 +-
- src/axe_rotation.cpp                        |    8 +-
- src/axefactory.cpp                          |    2 +-
- src/constant.cpp                            |   22 ---
- src/convenience.cpp                         |   17 +--
- src/eulerian4C_vertical_mode.cpp            |    8 +-
- src/eulerian4C_vertical_pseudoaxeengine.cpp |   18 ++--
- src/eulerian6C_pseudoaxeengine.cpp          |   26 ++--
- src/holder.cpp                              |    2 +-
- src/lattice.cpp                             |   36 +++---
- src/reflection.cpp                          |    2 +-
- src/sample.cpp                              |    6 +-
- src/sample_monocrystal.cpp                  |    6 +-
- src/source.cpp                              |    2 +-
- src/twoC_vertical_pseudoaxeengine.cpp       |   24 ++--
- src/value.cpp                               |   19 ++--
- test/SConscript                             |    2 +-
- test/axe_rotation_test.cpp                  |   13 +-
- test/geometry_eulerian4C_test.cpp           |  190 ++++++++++++++-------------
- test/geometry_eulerian4C_test.h             |    2 -
- test/geometry_twoC_test.cpp                 |   54 ++++----
- test/holder_test.cpp                        |    2 +-
- test/interval_test.cpp                      |   31 +++--
- test/lattice_test.cpp                       |   84 ++++++------
- test/value_test.cpp                         |    5 +-
+ include/hkl/config.h                        |   3 +
+ include/hkl/constant.h                      |  43 -------
+ include/hkl/kappa4C_vertical_geometry.h     |  65 +++++-----
+ include/hkl/svecmat.h                       |  36 ------
+ include/hkl/value.h                         |   6 +-
+ src/SConscript                              |   1 -
+ src/affinement.cpp                          |   8 +-
+ src/affinement_simplex.cpp                  |   7 +-
+ src/axe.cpp                                 |   2 +-
+ src/axe_rotation.cpp                        |   8 +-
+ src/axefactory.cpp                          |   2 +-
+ src/constant.cpp                            |  22 ----
+ src/convenience.cpp                         |  17 ++-
+ src/eulerian4C_vertical_mode.cpp            |   8 +-
+ src/eulerian4C_vertical_pseudoaxeengine.cpp |  18 +--
+ src/eulerian6C_pseudoaxeengine.cpp          |  26 ++--
+ src/holder.cpp                              |   2 +-
+ src/lattice.cpp                             |  36 +++---
+ src/reflection.cpp                          |   2 +-
+ src/sample.cpp                              |   6 +-
+ src/sample_monocrystal.cpp                  |   6 +-
+ src/source.cpp                              |   2 +-
+ src/twoC_vertical_pseudoaxeengine.cpp       |  24 ++--
+ src/value.cpp                               |  19 +--
+ test/SConscript                             |   2 +-
+ test/axe_rotation_test.cpp                  |  13 +-
+ test/geometry_eulerian4C_test.cpp           | 190 ++++++++++++++--------------
+ test/geometry_eulerian4C_test.h             |   2 -
+ test/geometry_twoC_test.cpp                 |  54 ++++----
+ test/holder_test.cpp                        |   2 +-
+ test/interval_test.cpp                      |  31 ++---
+ test/lattice_test.cpp                       |  84 ++++++------
+ test/value_test.cpp                         |   5 +-
  33 files changed, 327 insertions(+), 425 deletions(-)
 
 commit 9f1f67a314b9d37d8c904b21cd6af4db2b27d6e0
@@ -9061,33 +18822,33 @@ Date:   Thu Sep 27 19:23:12 2007 +0200
     
     start to write the user-guide using asciidoc
 
- Documentation/Doxyfile                        | 1342 ++
- Documentation/Maxima/E4C_bissector.max        |   12 +
- Documentation/Maxima/E4C_constant_chi.max     |   12 +
- Documentation/Maxima/E4C_constant_chi_phi.max |   12 +
- Documentation/Maxima/E4C_constant_omega.max   |   12 +
- Documentation/Maxima/E4C_delta_omega.max      |   12 +
- Documentation/SConscript                      |    2 +
- Documentation/example/SConscript              |   15 +
- Documentation/example/plot.gnuplot            |   85 +
- Documentation/example/psi.cpp                 |   50 +
- Documentation/hkl.lyx                         | 3402 ++++
- Documentation/uml/hkl.dia                     |22193 ++++++++++++++++++++++++
- Documentation/uml/next_hkl.dia                |22726 +++++++++++++++++++++++++
- Documentation/user-guide.txt                  |   79 +
- doc/Doxyfile                                  | 1342 --
- doc/Maxima/E4C_bissector.max                  |   12 -
- doc/Maxima/E4C_constant_chi.max               |   12 -
- doc/Maxima/E4C_constant_chi_phi.max           |   12 -
- doc/Maxima/E4C_constant_omega.max             |   12 -
- doc/Maxima/E4C_delta_omega.max                |   12 -
- doc/SConscript                                |    2 -
- doc/example/SConscript                        |   15 -
- doc/example/plot.gnuplot                      |   85 -
- doc/example/psi.cpp                           |   50 -
- doc/hkl.lyx                                   | 3402 ----
- doc/uml/hkl.dia                               |22193 ------------------------
- doc/uml/next_hkl.dia                          |22726 -------------------------
+ Documentation/Doxyfile                        |  1342 ++
+ Documentation/Maxima/E4C_bissector.max        |    12 +
+ Documentation/Maxima/E4C_constant_chi.max     |    12 +
+ Documentation/Maxima/E4C_constant_chi_phi.max |    12 +
+ Documentation/Maxima/E4C_constant_omega.max   |    12 +
+ Documentation/Maxima/E4C_delta_omega.max      |    12 +
+ Documentation/SConscript                      |     2 +
+ Documentation/example/SConscript              |    15 +
+ Documentation/example/plot.gnuplot            |    85 +
+ Documentation/example/psi.cpp                 |    50 +
+ Documentation/hkl.lyx                         |  3402 ++++
+ Documentation/uml/hkl.dia                     | 22193 +++++++++++++++++++++++
+ Documentation/uml/next_hkl.dia                | 22726 ++++++++++++++++++++++++
+ Documentation/user-guide.txt                  |    79 +
+ doc/Doxyfile                                  |  1342 --
+ doc/Maxima/E4C_bissector.max                  |    12 -
+ doc/Maxima/E4C_constant_chi.max               |    12 -
+ doc/Maxima/E4C_constant_chi_phi.max           |    12 -
+ doc/Maxima/E4C_constant_omega.max             |    12 -
+ doc/Maxima/E4C_delta_omega.max                |    12 -
+ doc/SConscript                                |     2 -
+ doc/example/SConscript                        |    15 -
+ doc/example/plot.gnuplot                      |    85 -
+ doc/example/psi.cpp                           |    50 -
+ doc/hkl.lyx                                   |  3402 ----
+ doc/uml/hkl.dia                               | 22193 -----------------------
+ doc/uml/next_hkl.dia                          | 22726 ------------------------
  27 files changed, 49954 insertions(+), 49875 deletions(-)
 
 commit 8ada71a3c00d92199ac4a30b29bd5fa04e60f11e
@@ -9096,16 +18857,16 @@ Date:   Thu Sep 27 19:01:52 2007 +0200
 
     * now the twoC geometry pass the tests.
 
- include/hkl/source.h        |   17 +-------
- src/geometry.cpp            |    8 +++-
- src/lattice.cpp             |   40 +++++++----------
- src/source.cpp              |   27 +----------
- src/svector.c               |    4 +-
- test/SConscript             |    8 ++--
- test/geometry_twoC_test.cpp |  100 ++++++++++++++++++++++---------------------
- test/lattice_test.cpp       |    4 +-
- test/source_test.cpp        |   34 ++-------------
- test/source_test.h          |    2 -
+ include/hkl/source.h        |  17 +-------
+ src/geometry.cpp            |   8 +++-
+ src/lattice.cpp             |  40 ++++++++----------
+ src/source.cpp              |  27 ++----------
+ src/svector.c               |   4 +-
+ test/SConscript             |   8 ++--
+ test/geometry_twoC_test.cpp | 100 ++++++++++++++++++++++----------------------
+ test/lattice_test.cpp       |   4 +-
+ test/source_test.cpp        |  34 ++-------------
+ test/source_test.h          |   2 -
  10 files changed, 90 insertions(+), 154 deletions(-)
 
 commit 27e1d0e96570392dd7e7974fea06d139f1628cc8
@@ -9114,37 +18875,37 @@ Date:   Thu Sep 20 18:38:33 2007 +0200
 
     * now more unit test are working with the C files
 
- include/hkl/config.h                              |    4 +
- include/hkl/derived_mode.h                        |    6 +-
- include/hkl/eulerian4C_vertical_mode.h            |   10 +-
- include/hkl/eulerian4C_vertical_pseudoaxeengine.h |    8 +-
- include/hkl/eulerian6C_pseudoaxeengine.h          |    4 +-
- include/hkl/mode.h                                |   33 +++--
- include/hkl/svecmat.h                             |   45 ++++++-
- include/hkl/twoC_vertical_mode.h                  |    4 +-
- src/eulerian4C_vertical_geometry.cpp              |   28 +++--
- src/eulerian4C_vertical_mode.cpp                  |   72 +++++-----
- src/eulerian4C_vertical_pseudoaxeengine.cpp       |  103 ++++++++-------
- src/eulerian6C_geometry.cpp                       |   36 +++--
- src/eulerian6C_pseudoaxeengine.cpp                |   46 +++++--
- src/kappa4C_vertical_geometry.cpp                 |   28 +++--
- src/kappa6C_geometry.cpp                          |   38 ++++--
- src/sample_monocrystal.cpp                        |   73 +++++++++--
- src/smatrix.c                                     |   23 ++--
- src/svector.c                                     |   62 +++++----
- src/twoC_vertical_geometry.cpp                    |   18 ++-
- src/twoC_vertical_mode.cpp                        |   14 +-
- test/SConscript                                   |    9 +-
- test/axe_rotation_test.cpp                        |  149 ++++++++++-----------
- test/axe_rotation_test.h                          |    2 -
- test/geometry_twoC_test.cpp                       |   74 ++++++++---
- test/holder_test.cpp                              |   62 ++++-----
- test/holder_test.h                                |    2 -
- test/holderlist_test.cpp                          |   30 +----
- test/holderlist_test.h                            |    2 -
- test/lattice_test.cpp                             |   45 +++---
- test/source_test.cpp                              |   55 +++++---
- test/source_test.h                                |    2 +-
+ include/hkl/config.h                              |   4 +
+ include/hkl/derived_mode.h                        |   6 +-
+ include/hkl/eulerian4C_vertical_mode.h            |  10 +-
+ include/hkl/eulerian4C_vertical_pseudoaxeengine.h |   8 +-
+ include/hkl/eulerian6C_pseudoaxeengine.h          |   4 +-
+ include/hkl/mode.h                                |  33 +++--
+ include/hkl/svecmat.h                             |  45 ++++++-
+ include/hkl/twoC_vertical_mode.h                  |   4 +-
+ src/eulerian4C_vertical_geometry.cpp              |  28 ++--
+ src/eulerian4C_vertical_mode.cpp                  |  72 +++++------
+ src/eulerian4C_vertical_pseudoaxeengine.cpp       | 103 ++++++++-------
+ src/eulerian6C_geometry.cpp                       |  36 ++++--
+ src/eulerian6C_pseudoaxeengine.cpp                |  46 ++++---
+ src/kappa4C_vertical_geometry.cpp                 |  28 ++--
+ src/kappa6C_geometry.cpp                          |  38 ++++--
+ src/sample_monocrystal.cpp                        |  73 +++++++++--
+ src/smatrix.c                                     |  23 ++--
+ src/svector.c                                     |  62 +++++----
+ src/twoC_vertical_geometry.cpp                    |  18 ++-
+ src/twoC_vertical_mode.cpp                        |  14 +-
+ test/SConscript                                   |   9 +-
+ test/axe_rotation_test.cpp                        | 149 ++++++++++------------
+ test/axe_rotation_test.h                          |   2 -
+ test/geometry_twoC_test.cpp                       |  74 ++++++++---
+ test/holder_test.cpp                              |  62 ++++-----
+ test/holder_test.h                                |   2 -
+ test/holderlist_test.cpp                          |  30 +----
+ test/holderlist_test.h                            |   2 -
+ test/lattice_test.cpp                             |  45 +++----
+ test/source_test.cpp                              |  55 +++++---
+ test/source_test.h                                |   2 +-
  31 files changed, 635 insertions(+), 452 deletions(-)
 
 commit 33df56287ffe4361713204f94e83141b1000c3b5
@@ -9153,14 +18914,14 @@ Date:   Thu Sep 20 13:59:10 2007 +0200
 
     * add the c files svector.c smatrix.c quaternion.c
 
- include/hkl/config.h  |   26 +++++++
- include/hkl/svecmat.h |   88 ++++++++++++++++++++++
- src/geometry.cpp      |    8 +-
- src/lattice.cpp       |    4 +-
- src/quaternion.c      |  131 +++++++++++++++++++++++++++++++++
- src/smatrix.c         |  179 +++++++++++++++++++++++++++++++++++++++++++++
- src/source.cpp        |    4 +-
- src/svector.c         |  195 +++++++++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/config.h  |  26 +++++++
+ include/hkl/svecmat.h |  88 +++++++++++++++++++++++
+ src/geometry.cpp      |   8 +--
+ src/lattice.cpp       |   4 +-
+ src/quaternion.c      | 131 +++++++++++++++++++++++++++++++++
+ src/smatrix.c         | 179 +++++++++++++++++++++++++++++++++++++++++++++
+ src/source.cpp        |   4 +-
+ src/svector.c         | 195 ++++++++++++++++++++++++++++++++++++++++++++++++++
  8 files changed, 627 insertions(+), 8 deletions(-)
 
 commit dfa4716bb49ec441ee3647166330ad56b7156982
@@ -9169,40 +18930,40 @@ Date:   Fri Sep 14 18:54:38 2007 +0200
 
     * working on the C version
 
- SConstruct                           |   13 +-
- config-win32.py                      |    1 +
- include/hkl/axe.h                    |   11 +-
- include/hkl/axe_rotation.h           |   33 +-
- include/hkl/geometry.h               |   24 +-
- include/hkl/holder.h                 |   16 +-
- include/hkl/lattice.h                |    8 +-
- include/hkl/pseudoaxe.h              |    1 +
- include/hkl/quaternion.h             |  264 ++++------------
- include/hkl/reflection.h             |   24 +-
- include/hkl/reflection_monocrystal.h |    2 +-
- include/hkl/reflectionlist.h         |    2 +-
- include/hkl/sample.h                 |    4 +-
- include/hkl/sample_monocrystal.h     |   12 +-
- include/hkl/source.h                 |   34 +-
- include/hkl/svector.h                |  188 -----------
- src/SConscript                       |    5 +-
- src/axe_rotation.cpp                 |   56 ++--
- src/axefactory.cpp                   |    4 +-
- src/geometry.cpp                     |  202 ++++++-------
- src/holder.cpp                       |    8 +-
- src/lattice.cpp                      |  155 ++++++---
- src/reflection.cpp                   |   30 +--
- src/reflection_monocrystal.cpp       |   12 +-
- src/reflectionfactory.cpp            |    7 +-
- src/reflectionlist.cpp               |    4 +-
- src/sample_monocrystal.cpp           |   27 +-
- src/source.cpp                       |  108 ++++----
- src/svector.cpp                      |  584 ----------------------------------
- test/SConscript                      |    8 +-
- test/quaternion_test.cpp             |  214 +++----------
- test/quaternion_test.h               |   59 +---
- test/svecmat_test.cpp                |  351 +++++++--------------
- test/svecmat_test.h                  |   96 ++----
+ SConstruct                           |  13 +-
+ config-win32.py                      |   1 +
+ include/hkl/axe.h                    |  11 +-
+ include/hkl/axe_rotation.h           |  33 +-
+ include/hkl/geometry.h               |  24 +-
+ include/hkl/holder.h                 |  16 +-
+ include/hkl/lattice.h                |   8 +-
+ include/hkl/pseudoaxe.h              |   1 +
+ include/hkl/quaternion.h             | 264 ++++------------
+ include/hkl/reflection.h             |  24 +-
+ include/hkl/reflection_monocrystal.h |   2 +-
+ include/hkl/reflectionlist.h         |   2 +-
+ include/hkl/sample.h                 |   4 +-
+ include/hkl/sample_monocrystal.h     |  12 +-
+ include/hkl/source.h                 |  34 +-
+ include/hkl/svector.h                | 188 -----------
+ src/SConscript                       |   5 +-
+ src/axe_rotation.cpp                 |  56 ++--
+ src/axefactory.cpp                   |   4 +-
+ src/geometry.cpp                     | 202 ++++++------
+ src/holder.cpp                       |   8 +-
+ src/lattice.cpp                      | 155 +++++++---
+ src/reflection.cpp                   |  30 +-
+ src/reflection_monocrystal.cpp       |  12 +-
+ src/reflectionfactory.cpp            |   7 +-
+ src/reflectionlist.cpp               |   4 +-
+ src/sample_monocrystal.cpp           |  27 +-
+ src/source.cpp                       | 108 +++----
+ src/svector.cpp                      | 584 -----------------------------------
+ test/SConscript                      |   8 +-
+ test/quaternion_test.cpp             | 214 ++++---------
+ test/quaternion_test.h               |  59 +---
+ test/svecmat_test.cpp                | 351 +++++++--------------
+ test/svecmat_test.h                  |  96 ++----
  34 files changed, 695 insertions(+), 1872 deletions(-)
 
 commit 583660448352c5f4890c94844b5e6b68954f8583
@@ -9229,44 +18990,44 @@ Date:   Wed Sep 12 10:18:28 2007 +0200
  bouml/hkl/hkl.prj                                 |   11 +-
  include/hkl/HKLException.h                        |   70 +-
  include/hkl/HolderList.h                          |   27 +-
- include/hkl/affinement.h                          |  129 ++--
+ include/hkl/affinement.h                          |  129 +--
  include/hkl/affinement_simplex.h                  |   46 +-
  include/hkl/affinementlist.h                      |  283 +++---
  include/hkl/axe.h                                 |  495 +++++-----
  include/hkl/axe_rotation.h                        |  260 +++---
  include/hkl/axefactory.h                          |   33 +-
  include/hkl/constant.h                            |   42 +-
- include/hkl/derived_mode.h                        |  125 ++--
- include/hkl/derived_pseudoaxeengine.h             |  952 ++++++++++----------
- include/hkl/diffractometer.h                      |  629 +++++++-------
+ include/hkl/derived_mode.h                        |  125 +--
+ include/hkl/derived_pseudoaxeengine.h             |  952 +++++++++----------
+ include/hkl/diffractometer.h                      |  629 ++++++-------
  include/hkl/diffractometerfactory.h               |   66 +-
  include/hkl/eulerian4C_vertical_diffractometer.h  |   24 +-
  include/hkl/eulerian4C_vertical_geometry.h        |  328 ++++---
- include/hkl/eulerian4C_vertical_mode.h            |  194 +++--
+ include/hkl/eulerian4C_vertical_mode.h            |  194 ++--
  include/hkl/eulerian4C_vertical_pseudoaxeengine.h |  320 ++++---
  include/hkl/eulerian6C_diffractometer.h           |   93 +-
- include/hkl/eulerian6C_geometry.h                 |  390 +++++----
+ include/hkl/eulerian6C_geometry.h                 |  390 ++++----
  include/hkl/eulerian6C_mode.h                     |   23 +-
- include/hkl/eulerian6C_pseudoaxeengine.h          |  507 ++++++-----
- include/hkl/fitparameter.h                        |  210 +++--
- include/hkl/fitparameterlist.h                    |  253 +++---
+ include/hkl/eulerian6C_pseudoaxeengine.h          |  507 +++++-----
+ include/hkl/fitparameter.h                        |  210 ++---
+ include/hkl/fitparameterlist.h                    |  253 ++---
  include/hkl/geometry.h                            |  465 +++++-----
  include/hkl/geometry_kappa.h                      |   71 +-
  include/hkl/hklobject.h                           |   80 +-
- include/hkl/holder.h                              |  552 ++++++------
+ include/hkl/holder.h                              |  552 +++++------
  include/hkl/interval.h                            |  410 ++++----
  include/hkl/kappa4C_vertical_diffractometer.h     |  204 ++--
  include/hkl/kappa4C_vertical_geometry.h           |  553 ++++++-----
  include/hkl/kappa4C_vertical_mode.h               |   28 +-
  include/hkl/kappa4C_vertical_pseudoaxeengine.h    |  281 +++---
  include/hkl/kappa6C_diffractometer.h              |   19 +-
- include/hkl/kappa6C_geometry.h                    |  394 +++++----
+ include/hkl/kappa6C_geometry.h                    |  394 ++++----
  include/hkl/kappa6C_mode.h                        |   23 +-
  include/hkl/kappa6C_pseudoaxeengine.h             |   21 +-
- include/hkl/lattice.h                             |  430 +++++-----
- include/hkl/mode.h                                |  343 ++++----
+ include/hkl/lattice.h                             |  430 ++++-----
+ include/hkl/mode.h                                |  343 +++----
  include/hkl/modelist.h                            |  283 +++---
- include/hkl/mymap.h                               |  528 ++++++------
+ include/hkl/mymap.h                               |  528 +++++------
  include/hkl/mystring.h                            |   54 --
  include/hkl/object.h                              |  307 +++---
  include/hkl/observer.h                            |   85 +-
@@ -9278,61 +19039,61 @@ Date:   Wed Sep 12 10:18:28 2007 +0200
  include/hkl/pseudoaxeenginelist.h                 |   77 +-
  include/hkl/pseudoaxelist.h                       |   75 +-
  include/hkl/quaternion.h                          |  368 ++++----
- include/hkl/range.h                               |  340 ++++----
- include/hkl/reflection.h                          |  325 ++++----
+ include/hkl/range.h                               |  340 +++----
+ include/hkl/reflection.h                          |  325 +++----
  include/hkl/reflection_monocrystal.h              |   87 +-
  include/hkl/reflectionfactory.h                   |   52 +-
  include/hkl/reflectionlist.h                      |  282 +++---
- include/hkl/sample.h                              |  221 +++---
- include/hkl/sample_monocrystal.h                  |  241 +++---
+ include/hkl/sample.h                              |  221 ++---
+ include/hkl/sample_monocrystal.h                  |  241 ++---
  include/hkl/samplefactory.h                       |   50 +-
- include/hkl/samplelist.h                          |  333 ++++----
- include/hkl/source.h                              |  222 +++---
+ include/hkl/samplelist.h                          |  333 +++----
+ include/hkl/source.h                              |  222 ++---
  include/hkl/strbuf.h                              |   19 +
  include/hkl/svector.h                             |  187 ++--
- include/hkl/twoC_vertical_diffractometer.h        |   94 ++-
+ include/hkl/twoC_vertical_diffractometer.h        |   94 +-
  include/hkl/twoC_vertical_geometry.h              |  260 +++---
  include/hkl/twoC_vertical_mode.h                  |   86 +-
  include/hkl/twoC_vertical_pseudoaxeengine.h       |  262 +++---
- include/hkl/value.h                               |  136 ++--
+ include/hkl/value.h                               |  136 +--
  src/HKLException.cpp                              |  259 +++---
  src/SConscript                                    |    2 +-
  src/affinement.cpp                                |  159 ++--
- src/affinement_simplex.cpp                        |  134 ++--
- src/affinementlist.cpp                            |  491 +++++------
- src/axe.cpp                                       |  667 +++++++-------
- src/axe_rotation.cpp                              |  346 ++++----
+ src/affinement_simplex.cpp                        |  134 ++-
+ src/affinementlist.cpp                            |  491 +++++-----
+ src/axe.cpp                                       |  667 +++++++------
+ src/axe_rotation.cpp                              |  346 ++++---
  src/axefactory.cpp                                |   49 +-
  src/constant.cpp                                  |   19 +-
- src/diffractometer.cpp                            |  123 ++--
+ src/diffractometer.cpp                            |  123 ++-
  src/diffractometerfactory.cpp                     |   99 +-
  src/eulerian4C_vertical_diffractometer.cpp        |   83 +-
- src/eulerian4C_vertical_geometry.cpp              |  661 +++++++-------
- src/eulerian4C_vertical_mode.cpp                  |  564 ++++++------
- src/eulerian4C_vertical_pseudoaxeengine.cpp       |  532 ++++++------
+ src/eulerian4C_vertical_geometry.cpp              |  661 +++++++------
+ src/eulerian4C_vertical_mode.cpp                  |  564 ++++++-----
+ src/eulerian4C_vertical_pseudoaxeengine.cpp       |  532 ++++++-----
  src/eulerian6C_diffractometer.cpp                 |   28 +-
  src/eulerian6C_geometry.cpp                       |  760 +++++++--------
- src/eulerian6C_pseudoaxeengine.cpp                |  797 ++++++++---------
+ src/eulerian6C_pseudoaxeengine.cpp                |  797 ++++++++--------
  src/fitparameter.cpp                              |  285 +++---
  src/fitparameterlist.cpp                          |  267 +++---
- src/geometry.cpp                                  |  715 +++++++--------
+ src/geometry.cpp                                  |  715 +++++++-------
  src/geometry_kappa.cpp                            |  110 +--
- src/hklobject.cpp                                 |  123 ++--
- src/holder.cpp                                    |  606 ++++++-------
- src/interval.cpp                                  |  663 +++++++-------
+ src/hklobject.cpp                                 |  123 ++-
+ src/holder.cpp                                    |  606 ++++++------
+ src/interval.cpp                                  |  663 +++++++------
  src/kappa4C_vertical_diffractometer.cpp           |   85 +-
- src/kappa4C_vertical_geometry.cpp                 |  663 +++++++-------
- src/kappa4C_vertical_pseudoaxeengine.cpp          |  306 +++----
+ src/kappa4C_vertical_geometry.cpp                 |  663 +++++++------
+ src/kappa4C_vertical_pseudoaxeengine.cpp          |  306 +++---
  src/kappa6C_diffractometer.cpp                    |   62 +-
  src/kappa6C_geometry.cpp                          |  626 ++++++-------
  src/lattice.cpp                                   | 1033 ++++++++++-----------
  src/mode.cpp                                      |   31 +-
- src/modelist.cpp                                  |  495 +++++------
+ src/modelist.cpp                                  |  495 +++++-----
  src/mystring.cpp                                  |   87 --
  src/object.cpp                                    |  423 ++++-----
- src/observer.cpp                                  |  153 ++--
+ src/observer.cpp                                  |  153 ++-
  src/parameter.cpp                                 |  109 +--
- src/parameterlist.cpp                             |  289 +++----
+ src/parameterlist.cpp                             |  289 +++---
  src/pseudoaxe.cpp                                 |  379 ++++----
  src/pseudoaxeengine.cpp                           |   59 +-
  src/pseudoaxeenginelist.cpp                       |  165 ++--
@@ -9340,19 +19101,19 @@ Date:   Wed Sep 12 10:18:28 2007 +0200
  src/quaternion.cpp                                |  661 ++++++-------
  src/range.cpp                                     |  363 ++++----
  src/reflection.cpp                                |  267 +++---
- src/reflection_monocrystal.cpp                    |  102 +--
+ src/reflection_monocrystal.cpp                    |  102 +-
  src/reflectionfactory.cpp                         |   71 +-
  src/reflectionlist.cpp                            |  545 +++++------
- src/sample.cpp                                    |  237 +++---
+ src/sample.cpp                                    |  237 +++--
  src/sample_monocrystal.cpp                        |  324 +++----
  src/samplefactory.cpp                             |   79 +-
  src/samplelist.cpp                                |  646 ++++++-------
- src/source.cpp                                    |  335 ++++----
+ src/source.cpp                                    |  335 ++++---
  src/strbuf.cpp                                    |   27 +
- src/svector.cpp                                   |  963 +++++++++-----------
+ src/svector.cpp                                   |  963 +++++++++----------
  src/twoC_vertical_diffractometer.cpp              |   73 +-
  src/twoC_vertical_geometry.cpp                    |  535 +++++------
- src/twoC_vertical_mode.cpp                        |  146 ++--
+ src/twoC_vertical_mode.cpp                        |  146 ++-
  src/twoC_vertical_pseudoaxeengine.cpp             |  758 +++++++--------
  src/value.cpp                                     |  312 +++----
  test/SConscript                                   |    1 -
@@ -9371,55 +19132,55 @@ Date:   Tue Sep 11 10:20:04 2007 +0200
 
     * compile and all test pass on linux
 
- bouml/hkl/128258.diagram                    |   10 +-
- bouml/hkl/128642.diagram                    |   34 ++-
- bouml/hkl/132482                            |   34 ++-
- bouml/hkl/133122                            |    6 +-
- bouml/hkl/133378                            |  154 ++++-----
- bouml/hkl/136834.bodies                     |   41 +++-
- bouml/hkl/136962.bodies                     |   76 ++---
- bouml/hkl/hkl.prj                           |    2 +-
- include/hkl/eulerian6C_pseudoaxeengine.h    |   38 ++-
- include/hkl/kappa4C_vertical_geometry.h     |    2 +-
- include/hkl/twoC_vertical_pseudoaxeengine.h |    1 +
- src/SConscript                              |    6 +-
- src/eulerian6C_pseudoaxeengine.cpp          |  349 ++++++++------------
- src/holder.cpp                              |    2 +-
- src/twoC_vertical_pseudoaxeengine.cpp       |   14 +-
- test/SConscript                             |   10 +-
- test/axe_rotation_test.cpp                  |    6 +-
- test/diffractometer_eulerian4C_test.cpp     |   10 +-
- test/diffractometer_kappa4C_test.cpp        |   28 +-
- test/diffractometer_kappa6C_test.cpp        |   28 +-
- test/diffractometer_test.cpp                |    3 +-
- test/diffractometer_twoC_test.cpp           |    4 +-
- test/fitparameter_test.cpp                  |    6 +-
- test/geometry_eulerian4C_test.cpp           |    6 +-
- test/geometry_eulerian6C_test.cpp           |    6 +-
- test/geometry_kappa4C_test.cpp              |   22 +-
- test/geometry_kappa6C_test.cpp              |    6 +-
- test/geometry_twoC_test.cpp                 |    6 +-
- test/hklobject_test.cpp                     |    6 +-
- test/holder_test.cpp                        |    2 +-
- test/interval_test.cpp                      |    3 +-
- test/lattice_test.cpp                       |    6 +-
- test/mode_eulerian4C_test.cpp               |   12 +-
- test/mode_kappa4C_test.cpp                  |   26 +-
- test/mode_kappa4C_test.h                    |   10 +-
- test/mode_kappa6C_test.cpp                  |   27 +-
- test/mystring_test.cpp                      |    6 +-
- test/object_test.cpp                        |    3 +-
- test/parameter_test.cpp                     |    6 +-
- test/pseudoaxe_eulerian4C_test.cpp          |   36 +-
- test/pseudoaxe_eulerian6C_test.cpp          |  326 +++++++------------
- test/pseudoaxe_kappa4C_test.cpp             |   40 +--
- test/pseudoaxe_kappa6C_test.cpp             |  475 +++++++++-----------------
- test/quaternion_test.cpp                    |    6 +-
- test/range_test.cpp                         |    3 +-
- test/sample_test.cpp                        |   24 +-
- test/source_test.cpp                        |    3 +-
- test/svecmat_test.cpp                       |    6 +-
- test/value_test.cpp                         |    3 +-
+ bouml/hkl/128258.diagram                    |  10 +-
+ bouml/hkl/128642.diagram                    |  34 +-
+ bouml/hkl/132482                            |  34 +-
+ bouml/hkl/133122                            |   6 +-
+ bouml/hkl/133378                            | 154 ++++-----
+ bouml/hkl/136834.bodies                     |  41 ++-
+ bouml/hkl/136962.bodies                     |  76 +++--
+ bouml/hkl/hkl.prj                           |   2 +-
+ include/hkl/eulerian6C_pseudoaxeengine.h    |  38 ++-
+ include/hkl/kappa4C_vertical_geometry.h     |   2 +-
+ include/hkl/twoC_vertical_pseudoaxeengine.h |   1 +
+ src/SConscript                              |   6 +-
+ src/eulerian6C_pseudoaxeengine.cpp          | 349 +++++++++-----------
+ src/holder.cpp                              |   2 +-
+ src/twoC_vertical_pseudoaxeengine.cpp       |  14 +-
+ test/SConscript                             |  10 +-
+ test/axe_rotation_test.cpp                  |   6 +-
+ test/diffractometer_eulerian4C_test.cpp     |  10 +-
+ test/diffractometer_kappa4C_test.cpp        |  28 +-
+ test/diffractometer_kappa6C_test.cpp        |  28 +-
+ test/diffractometer_test.cpp                |   3 +-
+ test/diffractometer_twoC_test.cpp           |   4 +-
+ test/fitparameter_test.cpp                  |   6 +-
+ test/geometry_eulerian4C_test.cpp           |   6 +-
+ test/geometry_eulerian6C_test.cpp           |   6 +-
+ test/geometry_kappa4C_test.cpp              |  22 +-
+ test/geometry_kappa6C_test.cpp              |   6 +-
+ test/geometry_twoC_test.cpp                 |   6 +-
+ test/hklobject_test.cpp                     |   6 +-
+ test/holder_test.cpp                        |   2 +-
+ test/interval_test.cpp                      |   3 +-
+ test/lattice_test.cpp                       |   6 +-
+ test/mode_eulerian4C_test.cpp               |  12 +-
+ test/mode_kappa4C_test.cpp                  |  26 +-
+ test/mode_kappa4C_test.h                    |  10 +-
+ test/mode_kappa6C_test.cpp                  |  27 +-
+ test/mystring_test.cpp                      |   6 +-
+ test/object_test.cpp                        |   3 +-
+ test/parameter_test.cpp                     |   6 +-
+ test/pseudoaxe_eulerian4C_test.cpp          |  36 +--
+ test/pseudoaxe_eulerian6C_test.cpp          | 326 +++++++------------
+ test/pseudoaxe_kappa4C_test.cpp             |  40 +--
+ test/pseudoaxe_kappa6C_test.cpp             | 475 ++++++++++------------------
+ test/quaternion_test.cpp                    |   6 +-
+ test/range_test.cpp                         |   3 +-
+ test/sample_test.cpp                        |  24 +-
+ test/source_test.cpp                        |   3 +-
+ test/svecmat_test.cpp                       |   6 +-
+ test/value_test.cpp                         |   3 +-
  49 files changed, 819 insertions(+), 1120 deletions(-)
 
 commit ff95a17d5498b7475e0eda8700d787d98e07586f
@@ -9428,32 +19189,32 @@ Date:   Wed Sep 5 17:16:04 2007 +0200
 
     * add the Interval class and his test methods
 
- bouml/hkl/128060.bodies                  |    3 +
- bouml/hkl/128188.diagram                 |   24 +-
- bouml/hkl/129794.bodies                  |  343 -------------
- bouml/hkl/130306.diagram                 |   44 +-
- bouml/hkl/132994                         |    3 +-
- bouml/hkl/133122                         |   85 +---
- bouml/hkl/136706.bodies                  |   51 +-
- bouml/hkl/153474.bodies                  |  475 ++++++++++++++++++
- bouml/hkl/2.session                      |   11 +-
- bouml/hkl/hkl.prj                        |  805 +++++++++++++++++++++---------
- include/hkl/interval.h                   |  224 +++++++++
- include/hkl/kappa4C_vertical_geometry.h  |   65 +--
- include/hkl/range.h                      |  125 -----
- src/SConscript                           |    1 +
- src/interval.cpp                         |  705 ++++++++++++++++++++++++++
- src/kappa4C_vertical_pseudoaxeengine.cpp |   51 +-
- src/range.cpp                            |  467 -----------------
- src/value.cpp                            |    3 +
- test/SConscript                          |    9 +-
- test/geometry_kappa4C_test.cpp           |   11 +-
- test/interval_test.cpp                   |  423 ++++++++++++++++
- test/interval_test.h                     |   44 ++
- test/pseudoaxe_kappa4C_test.cpp          |   56 +-
- test/range_test.cpp                      |  347 -------------
- test/range_test.h                        |   14 -
- 25 files changed, 2611 insertions(+), 1778 deletions(-)
+ bouml/hkl/128060.bodies                  |   3 +
+ bouml/hkl/128188.diagram                 |  24 +-
+ bouml/hkl/129794.bodies                  | 343 -------------
+ bouml/hkl/130306.diagram                 |  44 +-
+ bouml/hkl/132994                         |   3 +-
+ bouml/hkl/133122                         |  85 +---
+ bouml/hkl/136706.bodies                  |  51 +-
+ bouml/hkl/153474.bodies                  | 475 ++++++++++++++++++
+ bouml/hkl/2.session                      |  11 +-
+ bouml/hkl/hkl.prj                        | 823 +++++++++++++++++++++----------
+ include/hkl/interval.h                   | 224 +++++++++
+ include/hkl/kappa4C_vertical_geometry.h  |  65 +--
+ include/hkl/range.h                      | 125 -----
+ src/SConscript                           |   1 +
+ src/interval.cpp                         | 705 ++++++++++++++++++++++++++
+ src/kappa4C_vertical_pseudoaxeengine.cpp |  53 +-
+ src/range.cpp                            | 467 ------------------
+ src/value.cpp                            |   3 +
+ test/SConscript                          |   9 +-
+ test/geometry_kappa4C_test.cpp           |  11 +-
+ test/interval_test.cpp                   | 423 ++++++++++++++++
+ test/interval_test.h                     |  44 ++
+ test/pseudoaxe_kappa4C_test.cpp          |  56 +--
+ test/range_test.cpp                      | 347 -------------
+ test/range_test.h                        |  14 -
+ 25 files changed, 2621 insertions(+), 1788 deletions(-)
 
 commit fe0cfa4c3f1c0b6d2ec642502713e32c88c872bb
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -9474,17 +19235,17 @@ Date:   Fri Aug 31 18:01:38 2007 +0200
  bouml/hkl/132866.bodies                        |    8 +-
  bouml/hkl/132994                               |   95 +--
  bouml/hkl/132994.bodies                        |    8 +-
- bouml/hkl/133122                               |  313 +++++++-
+ bouml/hkl/133122                               |  313 ++++++-
  bouml/hkl/133250                               |   26 +-
  bouml/hkl/133634                               |   28 +-
  bouml/hkl/134146                               |   16 +-
- bouml/hkl/136706.bodies                        |   94 +--
+ bouml/hkl/136706.bodies                        |   94 +-
  bouml/hkl/145026.bodies                        |    8 +-
  bouml/hkl/2.session                            |   11 +-
  bouml/hkl/generation_settings                  |   34 +-
- bouml/hkl/hkl.prj                              |  587 +++++++-------
+ bouml/hkl/hkl.prj                              |  587 +++++++------
  doc/Doxyfile                                   | 1089 +++++++++++++++++++++++-
- include/hkl/constant.h                         |   79 +--
+ include/hkl/constant.h                         |   79 +-
  include/hkl/derived_pseudoaxeengine.h          |    8 +-
  include/hkl/kappa4C_vertical_diffractometer.h  |   90 ++
  include/hkl/kappa4C_vertical_geometry.h        |  161 ++++
@@ -9500,7 +19261,7 @@ Date:   Fri Aug 31 18:01:38 2007 +0200
  src/kappa4C_vertical_pseudoaxeengine.cpp       |  101 +--
  src/kappa6C_geometry.cpp                       |    8 +-
  src/pseudoaxeengine.cpp                        |    2 +-
- src/range.cpp                                  |  390 +++++++++-
+ src/range.cpp                                  |  390 ++++++++-
  test/SConscript                                |   10 +-
  test/mode_kappa4C_test.cpp                     |    8 +-
  test/mode_kappa4C_test.h                       |   10 +-
@@ -9515,32 +19276,32 @@ Date:   Tue Aug 28 15:28:49 2007 +0200
 
     * now the Eulerian4C::Vertical pseudoAxes are OK.
 
- bouml/hkl/128770                                  |   28 +--
- bouml/hkl/131202.bodies                           |    2 +-
- bouml/hkl/131970                                  |   72 ++---
- bouml/hkl/132482                                  |    2 +-
- bouml/hkl/134786.bodies                           |   15 +-
- bouml/hkl/135042.bodies                           |    2 +-
- bouml/hkl/135170.bodies                           |   10 +-
- bouml/hkl/136194.bodies                           |   25 +-
- bouml/hkl/136322.bodies                           |   23 +-
- bouml/hkl/136450.bodies                           |    1 -
- bouml/hkl/136578.bodies                           |  316 ++++++---------
- bouml/hkl/137090.bodies                           |    2 -
- bouml/hkl/145026.bodies                           |    2 -
- bouml/hkl/2.session                               |    3 +-
- bouml/hkl/hkl.prj                                 |    2 +-
- include/hkl/derived_pseudoaxeengine.h             |   20 -
- include/hkl/eulerian4C_vertical_pseudoaxeengine.h |   21 +-
- include/hkl/pseudoaxeengine.h                     |   10 +-
- src/SConscript                                    |    5 +-
- src/eulerian4C_vertical_pseudoaxeengine.cpp       |  339 +++++++----------
- src/hklobject.cpp                                 |    2 +-
- src/pseudoaxe.cpp                                 |   15 +-
- src/pseudoaxelist.cpp                             |    2 +-
- src/twoC_vertical_pseudoaxeengine.cpp             |   51 +--
- test/SConscript                                   |    2 +-
- test/pseudoaxe_eulerian4C_test.cpp                |  425 ++++++---------------
+ bouml/hkl/128770                                  |  28 +-
+ bouml/hkl/131202.bodies                           |   2 +-
+ bouml/hkl/131970                                  |  72 ++--
+ bouml/hkl/132482                                  |   2 +-
+ bouml/hkl/134786.bodies                           |  15 +-
+ bouml/hkl/135042.bodies                           |   2 +-
+ bouml/hkl/135170.bodies                           |  10 +-
+ bouml/hkl/136194.bodies                           |  25 +-
+ bouml/hkl/136322.bodies                           |  23 +-
+ bouml/hkl/136450.bodies                           |   1 -
+ bouml/hkl/136578.bodies                           | 316 +++++++---------
+ bouml/hkl/137090.bodies                           |   2 -
+ bouml/hkl/145026.bodies                           |   2 -
+ bouml/hkl/2.session                               |   3 +-
+ bouml/hkl/hkl.prj                                 |   2 +-
+ include/hkl/derived_pseudoaxeengine.h             |  20 -
+ include/hkl/eulerian4C_vertical_pseudoaxeengine.h |  21 +-
+ include/hkl/pseudoaxeengine.h                     |  10 +-
+ src/SConscript                                    |   5 +-
+ src/eulerian4C_vertical_pseudoaxeengine.cpp       | 339 +++++++----------
+ src/hklobject.cpp                                 |   2 +-
+ src/pseudoaxe.cpp                                 |  15 +-
+ src/pseudoaxelist.cpp                             |   2 +-
+ src/twoC_vertical_pseudoaxeengine.cpp             |  51 +--
+ test/SConscript                                   |   2 +-
+ test/pseudoaxe_eulerian4C_test.cpp                | 425 ++++++----------------
  26 files changed, 491 insertions(+), 906 deletions(-)
 
 commit 0b0ca9a49df717ae85cee6652bff9b8ea7b44b2f
@@ -9549,53 +19310,53 @@ Date:   Tue Aug 28 10:16:48 2007 +0200
 
     * the twoC vertical pseudoAxes are working.
 
- bouml/hkl/131458.diagram                    |    4 +-
- bouml/hkl/132482                            |   34 ++-
- bouml/hkl/134786.bodies                     |   50 +++--
- bouml/hkl/134914.bodies                     |    5 +-
- bouml/hkl/135042.bodies                     |    8 -
- bouml/hkl/136194.bodies                     |   81 +++---
- bouml/hkl/136322.bodies                     |   74 +++---
- bouml/hkl/136450.bodies                     |   45 ++--
- bouml/hkl/2.session                         |    8 +-
- bouml/hkl/hkl.prj                           |   72 ++----
- include/hkl/pseudoaxe.h                     |   12 +-
- include/hkl/pseudoaxeengine.h               |    3 +-
- include/hkl/pseudoaxelist.h                 |    2 -
- include/hkl/twoC_vertical_pseudoaxeengine.h |    8 +-
- src/axe.cpp                                 |    3 +-
- src/pseudoaxe.cpp                           |   57 +++--
- src/pseudoaxeengine.cpp                     |    6 +-
- src/pseudoaxelist.cpp                       |   13 -
- src/twoC_vertical_pseudoaxeengine.cpp       |  220 +++++++--------
- test/SConscript                             |    3 +-
- test/affinement_simplex_test.cpp            |    2 +-
- test/axe_rotation_test.cpp                  |   30 +-
- test/diffractometer_eulerian4C_test.cpp     |  196 +++++++-------
- test/diffractometer_kappa4C_test.cpp        |    4 +-
- test/diffractometer_kappa6C_test.cpp        |   12 +-
- test/diffractometer_test.cpp                |   40 ++--
- test/diffractometer_twoC_test.cpp           |  164 ++++++------
- test/geometry_eulerian4C_test.cpp           |  124 +++++-----
- test/geometry_eulerian6C_test.cpp           |   70 +++---
- test/geometry_kappa4C_test.cpp              |  390 +++++++++++++-------------
- test/geometry_kappa6C_test.cpp              |  302 +++++++++++-----------
- test/geometry_test.cpp                      |    8 +-
- test/geometry_twoC_test.cpp                 |   48 ++--
- test/holderlist_test.cpp                    |   14 +-
- test/lattice_test.cpp                       |    2 +-
- test/mode_eulerian4C_test.cpp               |   24 +-
- test/mode_kappa4C_test.cpp                  |   20 +-
- test/mode_kappa6C_test.cpp                  |   20 +-
- test/mode_twoC_test.cpp                     |  176 ++++++------
- test/pseudoaxe_eulerian4C_test.cpp          |   28 +-
- test/pseudoaxe_eulerian6C_test.cpp          |   12 +-
- test/pseudoaxe_kappa4C_test.cpp             |   22 +-
- test/pseudoaxe_kappa6C_test.cpp             |   18 +-
- test/pseudoaxe_twoC_test.cpp                |  265 ++++++++-----------
- test/reflectionlist_test.cpp                |   22 +-
- test/sample_test.cpp                        |  284 ++++++++++----------
- 46 files changed, 1457 insertions(+), 1548 deletions(-)
+ bouml/hkl/131458.diagram                    |   4 +-
+ bouml/hkl/132482                            |  34 +--
+ bouml/hkl/134786.bodies                     |  50 ++--
+ bouml/hkl/134914.bodies                     |   5 +-
+ bouml/hkl/135042.bodies                     |   8 -
+ bouml/hkl/136194.bodies                     |  81 +++---
+ bouml/hkl/136322.bodies                     |  74 +++---
+ bouml/hkl/136450.bodies                     |  45 ++--
+ bouml/hkl/2.session                         |   8 +-
+ bouml/hkl/hkl.prj                           |  72 ++---
+ include/hkl/pseudoaxe.h                     |  12 +-
+ include/hkl/pseudoaxeengine.h               |   3 +-
+ include/hkl/pseudoaxelist.h                 |   2 -
+ include/hkl/twoC_vertical_pseudoaxeengine.h |   8 +-
+ src/axe.cpp                                 |   3 +-
+ src/pseudoaxe.cpp                           |  57 ++--
+ src/pseudoaxeengine.cpp                     |   6 +-
+ src/pseudoaxelist.cpp                       |  13 -
+ src/twoC_vertical_pseudoaxeengine.cpp       | 220 ++++++++--------
+ test/SConscript                             |   3 +-
+ test/affinement_simplex_test.cpp            |   2 +-
+ test/axe_rotation_test.cpp                  |  34 +--
+ test/diffractometer_eulerian4C_test.cpp     | 196 +++++++-------
+ test/diffractometer_kappa4C_test.cpp        |   4 +-
+ test/diffractometer_kappa6C_test.cpp        |  12 +-
+ test/diffractometer_test.cpp                |  40 +--
+ test/diffractometer_twoC_test.cpp           | 164 ++++++------
+ test/geometry_eulerian4C_test.cpp           | 124 ++++-----
+ test/geometry_eulerian6C_test.cpp           |  70 ++---
+ test/geometry_kappa4C_test.cpp              | 390 ++++++++++++++--------------
+ test/geometry_kappa6C_test.cpp              | 302 ++++++++++-----------
+ test/geometry_test.cpp                      |   8 +-
+ test/geometry_twoC_test.cpp                 |  48 ++--
+ test/holderlist_test.cpp                    |  14 +-
+ test/lattice_test.cpp                       |   2 +-
+ test/mode_eulerian4C_test.cpp               |  24 +-
+ test/mode_kappa4C_test.cpp                  |  20 +-
+ test/mode_kappa6C_test.cpp                  |  20 +-
+ test/mode_twoC_test.cpp                     | 176 ++++++-------
+ test/pseudoaxe_eulerian4C_test.cpp          |  28 +-
+ test/pseudoaxe_eulerian6C_test.cpp          |  12 +-
+ test/pseudoaxe_kappa4C_test.cpp             |  22 +-
+ test/pseudoaxe_kappa6C_test.cpp             |  18 +-
+ test/pseudoaxe_twoC_test.cpp                | 265 ++++++++-----------
+ test/reflectionlist_test.cpp                |  22 +-
+ test/sample_test.cpp                        | 284 ++++++++++----------
+ 46 files changed, 1459 insertions(+), 1550 deletions(-)
 
 commit ba51e6c59239bf0d5d520c5664a2ae3bf5b3f26b
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -9606,35 +19367,35 @@ Date:   Mon Aug 27 15:20:59 2007 +0200
     Remove a bug in the eulerian4C -> kappa6C Geometry conversion.
     Add the compute_HKL_consign to the Geometry class.
 
- bouml/hkl/129154.bodies          |   16 ++--
- bouml/hkl/131714.bodies          |   38 ++++++++-
- bouml/hkl/132098                 |    2 +-
- bouml/hkl/132610                 |    2 +-
- bouml/hkl/132994.bodies          |    6 +-
- bouml/hkl/133634                 |    2 +-
- bouml/hkl/139522.bodies          |   12 ++--
- bouml/hkl/139650.bodies          |   12 ++--
- bouml/hkl/139778.bodies          |   12 ++--
- bouml/hkl/139906.bodies          |   12 ++--
- bouml/hkl/140034.bodies          |   12 ++--
- bouml/hkl/140162.bodies          |    8 +-
- bouml/hkl/140290.bodies          |    6 +-
- bouml/hkl/2.session              |    5 +-
- bouml/hkl/hkl.prj                |   50 +++++++++---
- include/hkl/geometry.h           |   11 ++-
- src/eulerian4C_vertical_mode.cpp |   60 +++++++-------
- src/geometry.cpp                 |   50 ++++++++++-
- src/kappa6C_geometry.cpp         |    6 +-
- src/mystring.cpp                 |    4 +
- src/object.cpp                   |   16 ++--
- src/twoC_vertical_mode.cpp       |   14 ++--
- test/SConscript                  |    7 +-
- test/geometry_twoC_test.cpp      |   11 ++-
- test/geometry_twoC_test.h        |    4 +-
- test/mode_eulerian4C_test.cpp    |  102 +++++++++++-----------
- test/mode_kappa4C_test.cpp       |  114 ++++++++++++------------
- test/mode_kappa6C_test.cpp       |  158 +++++++++++++++++-----------------
- test/mode_twoC_test.cpp          |  176 +++++++++++++++++++-------------------
+ bouml/hkl/129154.bodies          |  16 ++--
+ bouml/hkl/131714.bodies          |  38 ++++++++-
+ bouml/hkl/132098                 |   2 +-
+ bouml/hkl/132610                 |   2 +-
+ bouml/hkl/132994.bodies          |   6 +-
+ bouml/hkl/133634                 |   2 +-
+ bouml/hkl/139522.bodies          |  12 +--
+ bouml/hkl/139650.bodies          |  12 +--
+ bouml/hkl/139778.bodies          |  12 +--
+ bouml/hkl/139906.bodies          |  12 +--
+ bouml/hkl/140034.bodies          |  12 +--
+ bouml/hkl/140162.bodies          |   8 +-
+ bouml/hkl/140290.bodies          |   6 +-
+ bouml/hkl/2.session              |   5 +-
+ bouml/hkl/hkl.prj                |  50 ++++++++---
+ include/hkl/geometry.h           |  11 ++-
+ src/eulerian4C_vertical_mode.cpp |  60 ++++++-------
+ src/geometry.cpp                 |  50 ++++++++++-
+ src/kappa6C_geometry.cpp         |   6 +-
+ src/mystring.cpp                 |   4 +
+ src/object.cpp                   |  16 ++--
+ src/twoC_vertical_mode.cpp       |  14 ++--
+ test/SConscript                  |   7 +-
+ test/geometry_twoC_test.cpp      |  11 ++-
+ test/geometry_twoC_test.h        |   4 +-
+ test/mode_eulerian4C_test.cpp    | 102 +++++++++++------------
+ test/mode_kappa4C_test.cpp       | 114 ++++++++++++-------------
+ test/mode_kappa6C_test.cpp       | 158 +++++++++++++++++------------------
+ test/mode_twoC_test.cpp          | 176 +++++++++++++++++++--------------------
  29 files changed, 527 insertions(+), 401 deletions(-)
 
 commit 16f9e073698e8fe0e2003974c8f21c16890d8972
@@ -9645,50 +19406,50 @@ Date:   Mon Aug 27 11:51:52 2007 +0200
     
     Now need to do the same for the modes.
 
- bouml/hkl/128514                           |    2 +-
- bouml/hkl/131714.bodies                    |   90 +------
- bouml/hkl/131842                           |   44 +++-
- bouml/hkl/131842.bodies                    |   18 +-
- bouml/hkl/132354                           |   36 ++-
- bouml/hkl/132482.bodies                    |   48 ++--
- bouml/hkl/132610.bodies                    |   18 +-
- bouml/hkl/132866.bodies                    |   36 ++--
- bouml/hkl/132994.bodies                    |   24 +-
- bouml/hkl/133122                           |   44 +++-
- bouml/hkl/133250                           |   31 +++-
- bouml/hkl/133634                           |   52 +++-
- bouml/hkl/133890.bodies                    |    4 +-
- bouml/hkl/134146                           |    2 +-
- bouml/hkl/145282.bodies                    |    2 +-
- bouml/hkl/148482.bodies                    |    2 +-
- bouml/hkl/2.session                        |    5 +-
- bouml/hkl/hkl.prj                          |   91 ++------
- include/hkl/eulerian4C_vertical_geometry.h |   13 +-
- include/hkl/eulerian6C_geometry.h          |   13 +-
- include/hkl/geometry.h                     |   34 +--
- include/hkl/kappa4C_vertical_geometry.h    |   19 +-
- include/hkl/kappa6C_geometry.h             |   21 ++-
- include/hkl/twoC_vertical_geometry.h       |   11 +-
- src/axe.cpp                                |    2 +-
- src/eulerian4C_vertical_geometry.cpp       |   36 ++-
- src/eulerian6C_geometry.cpp                |   54 +++--
- src/geometry.cpp                           |  139 ++---------
- src/holder.cpp                             |    2 +-
- src/kappa4C_vertical_geometry.cpp          |   42 ++--
- src/kappa6C_geometry.cpp                   |   48 +++--
- src/reflection_monocrystal.cpp             |    4 +-
- src/twoC_vertical_geometry.cpp             |   64 +++--
- test/SConscript                            |    8 +-
- test/geometry_eulerian4C_test.cpp          |  142 +++++++----
- test/geometry_eulerian4C_test.h            |   12 +-
- test/geometry_eulerian6C_test.cpp          |  151 +++++++++----
- test/geometry_eulerian6C_test.h            |   16 +-
- test/geometry_kappa4C_test.cpp             |  359 +++++++++++++++------------
- test/geometry_kappa4C_test.h               |   16 +-
- test/geometry_kappa6C_test.cpp             |  245 +++++++++++--------
- test/geometry_kappa6C_test.h               |   12 +-
- test/geometry_twoC_test.cpp                |   15 +-
- test/sample_test.cpp                       |  284 +++++++++++-----------
+ bouml/hkl/128514                           |   2 +-
+ bouml/hkl/131714.bodies                    |  90 +-------
+ bouml/hkl/131842                           |  44 +++-
+ bouml/hkl/131842.bodies                    |  18 +-
+ bouml/hkl/132354                           |  36 ++-
+ bouml/hkl/132482.bodies                    |  48 ++--
+ bouml/hkl/132610.bodies                    |  18 +-
+ bouml/hkl/132866.bodies                    |  36 ++-
+ bouml/hkl/132994.bodies                    |  24 +-
+ bouml/hkl/133122                           |  44 +++-
+ bouml/hkl/133250                           |  31 ++-
+ bouml/hkl/133634                           |  52 +++--
+ bouml/hkl/133890.bodies                    |   4 +-
+ bouml/hkl/134146                           |   2 +-
+ bouml/hkl/145282.bodies                    |   2 +-
+ bouml/hkl/148482.bodies                    |   2 +-
+ bouml/hkl/2.session                        |   5 +-
+ bouml/hkl/hkl.prj                          |  91 ++------
+ include/hkl/eulerian4C_vertical_geometry.h |  13 +-
+ include/hkl/eulerian6C_geometry.h          |  13 +-
+ include/hkl/geometry.h                     |  34 +--
+ include/hkl/kappa4C_vertical_geometry.h    |  19 +-
+ include/hkl/kappa6C_geometry.h             |  21 +-
+ include/hkl/twoC_vertical_geometry.h       |  11 +-
+ src/axe.cpp                                |   2 +-
+ src/eulerian4C_vertical_geometry.cpp       |  36 +--
+ src/eulerian6C_geometry.cpp                |  54 +++--
+ src/geometry.cpp                           | 139 ++---------
+ src/holder.cpp                             |   2 +-
+ src/kappa4C_vertical_geometry.cpp          |  42 ++--
+ src/kappa6C_geometry.cpp                   |  48 ++--
+ src/reflection_monocrystal.cpp             |   4 +-
+ src/twoC_vertical_geometry.cpp             |  64 ++---
+ test/SConscript                            |   8 +-
+ test/geometry_eulerian4C_test.cpp          | 142 ++++++++----
+ test/geometry_eulerian4C_test.h            |  12 +-
+ test/geometry_eulerian6C_test.cpp          | 151 ++++++++----
+ test/geometry_eulerian6C_test.h            |  16 +-
+ test/geometry_kappa4C_test.cpp             | 359 ++++++++++++++++-------------
+ test/geometry_kappa4C_test.h               |  16 +-
+ test/geometry_kappa6C_test.cpp             | 245 +++++++++++---------
+ test/geometry_kappa6C_test.h               |  12 +-
+ test/geometry_twoC_test.cpp                |  15 +-
+ test/sample_test.cpp                       | 284 +++++++++++------------
  44 files changed, 1230 insertions(+), 1081 deletions(-)
 
 commit 52b0f1da87e2a53259023cf74e8e8616124843b6
@@ -9705,35 +19466,35 @@ Date:   Fri Aug 24 16:46:59 2007 +0200
       getSampleQuaternion -> get_sample_quaternion, get_sample_quaternion_consign
       getSampleRotationMatrix -> get_sample_rotation_matrix, get_sample_rotation_matrix_consign
 
- bouml/hkl/128060.bodies              |    2 +
- bouml/hkl/131714.bodies              |  122 ++++++++++++++++----
- bouml/hkl/131842                     |    2 +-
- bouml/hkl/131842.bodies              |  179 +++++++++++++++++++----------
- bouml/hkl/132354                     |    2 +-
- bouml/hkl/132482.bodies              |  173 +++++++++++++++++++---------
- bouml/hkl/132610.bodies              |  189 ++++++++++++++++++-------------
- bouml/hkl/132866.bodies              |  177 +++++++++++++++++++----------
- bouml/hkl/132994.bodies              |  138 +++++++++++++++-------
- bouml/hkl/133122                     |    2 +-
- bouml/hkl/133250                     |    2 +-
- bouml/hkl/133634                     |    2 +-
- bouml/hkl/134146                     |    2 +-
- bouml/hkl/145410.bodies              |   12 ++
- bouml/hkl/2.session                  |    6 +-
- bouml/hkl/hkl.prj                    |  196 +++++++++++++++++++++++++++++++-
- include/hkl/axe.h                    |    9 ++-
- include/hkl/geometry.h               |   61 ++++++++++
- include/hkl/value.h                  |    2 +
- src/axe.cpp                          |   24 ++++-
- src/eulerian4C_vertical_geometry.cpp |  183 ++++++++++++++++++++----------
- src/eulerian6C_geometry.cpp          |  181 +++++++++++++++++++----------
- src/geometry.cpp                     |  210 +++++++++++++++++++++++++++++----
- src/kappa4C_vertical_geometry.cpp    |  197 +++++++++++++++++++-------------
- src/kappa6C_geometry.cpp             |  144 ++++++++++++++++--------
- src/twoC_vertical_geometry.cpp       |  177 ++++++++++++++++++++---------
- src/value.cpp                        |    7 +
- test/geometry_twoC_test.cpp          |   96 ++++++++++------
- test/geometry_twoC_test.h            |   12 +-
+ bouml/hkl/128060.bodies              |   2 +
+ bouml/hkl/131714.bodies              | 122 +++++++++++++++-----
+ bouml/hkl/131842                     |   2 +-
+ bouml/hkl/131842.bodies              | 179 +++++++++++++++++++----------
+ bouml/hkl/132354                     |   2 +-
+ bouml/hkl/132482.bodies              | 173 ++++++++++++++++++++---------
+ bouml/hkl/132610.bodies              | 189 ++++++++++++++++++-------------
+ bouml/hkl/132866.bodies              | 177 +++++++++++++++++++----------
+ bouml/hkl/132994.bodies              | 138 ++++++++++++++++-------
+ bouml/hkl/133122                     |   2 +-
+ bouml/hkl/133250                     |   2 +-
+ bouml/hkl/133634                     |   2 +-
+ bouml/hkl/134146                     |   2 +-
+ bouml/hkl/145410.bodies              |  12 ++
+ bouml/hkl/2.session                  |   6 +-
+ bouml/hkl/hkl.prj                    | 196 +++++++++++++++++++++++++++++++-
+ include/hkl/axe.h                    |   9 +-
+ include/hkl/geometry.h               |  61 ++++++++++
+ include/hkl/value.h                  |   2 +
+ src/axe.cpp                          |  24 +++-
+ src/eulerian4C_vertical_geometry.cpp | 183 ++++++++++++++++++++----------
+ src/eulerian6C_geometry.cpp          | 181 +++++++++++++++++++-----------
+ src/geometry.cpp                     | 210 ++++++++++++++++++++++++++++++-----
+ src/kappa4C_vertical_geometry.cpp    | 197 ++++++++++++++++++--------------
+ src/kappa6C_geometry.cpp             | 144 ++++++++++++++++--------
+ src/twoC_vertical_geometry.cpp       | 177 ++++++++++++++++++++---------
+ src/value.cpp                        |   7 ++
+ test/geometry_twoC_test.cpp          |  96 ++++++++++------
+ test/geometry_twoC_test.h            |  12 +-
  29 files changed, 1809 insertions(+), 700 deletions(-)
 
 commit bf771c516b5b3c056c09b54bb27377d43d40e18c
@@ -9744,22 +19505,22 @@ Date:   Fri Aug 24 14:21:00 2007 +0200
     
     It is time to make the modifications in the Geometry class.
 
- bouml/hkl/130050.bodies    |   61 +++++++++++++++++++++---------
- bouml/hkl/131330.diagram   |   16 +++++---
- bouml/hkl/131458.diagram   |   10 ++--
- bouml/hkl/134146           |   80 +++++++++++++++++++++++++++++++++++++++-
- bouml/hkl/145282.bodies    |   24 +++++------
- bouml/hkl/148482.bodies    |   12 +++++-
- bouml/hkl/2.session        |   11 +++--
- bouml/hkl/hkl.prj          |   64 ++++++++++++++++++++++++++++++-
- include/hkl/axe.h          |   38 +++++++++++++++---
- include/hkl/axe_rotation.h |   27 +++++++++++++
- include/hkl/holder.h       |    8 ++++
- src/axe.cpp                |   12 +----
- src/axe_rotation.cpp       |   88 ++++++++++++++++++++++++++++++++++---------
- src/holder.cpp             |   23 +++++++++++-
- test/axe_rotation_test.cpp |   45 ++++++++++++++++++++++
- test/holder_test.cpp       |    2 +
+ bouml/hkl/130050.bodies    | 61 ++++++++++++++++++++++----------
+ bouml/hkl/131330.diagram   | 16 +++++----
+ bouml/hkl/131458.diagram   | 10 +++---
+ bouml/hkl/134146           | 80 ++++++++++++++++++++++++++++++++++++++++-
+ bouml/hkl/145282.bodies    | 24 ++++++-------
+ bouml/hkl/148482.bodies    | 12 ++++++-
+ bouml/hkl/2.session        | 11 +++---
+ bouml/hkl/hkl.prj          | 64 +++++++++++++++++++++++++++++++--
+ include/hkl/axe.h          | 38 ++++++++++++++++----
+ include/hkl/axe_rotation.h | 27 ++++++++++++++
+ include/hkl/holder.h       |  8 +++++
+ src/axe.cpp                | 12 ++-----
+ src/axe_rotation.cpp       | 88 ++++++++++++++++++++++++++++++++++++----------
+ src/holder.cpp             | 23 +++++++++++-
+ test/axe_rotation_test.cpp | 45 ++++++++++++++++++++++++
+ test/holder_test.cpp       |  2 ++
  16 files changed, 432 insertions(+), 89 deletions(-)
 
 commit 25e3d60cdd4543877880fca14213b18dcc494105
@@ -9771,71 +19532,71 @@ Date:   Fri Aug 24 12:08:39 2007 +0200
     begining of the pseudoAxes refactoring but before
     we must add the consign to the Axes.
 
- bouml/hkl/128002                            |    2 +-
- bouml/hkl/128002.bodies                     |    6 +-
- bouml/hkl/128060.bodies                     |   14 +-
- bouml/hkl/128130.diagram                    |   30 +-
- bouml/hkl/128514.bodies                     |   68 ++--
- bouml/hkl/128642                            |    2 +-
- bouml/hkl/128770.bodies                     |    6 +-
- bouml/hkl/128898.bodies                     |    6 +-
- bouml/hkl/129154.bodies                     |    8 +-
- bouml/hkl/129794.bodies                     |  112 ++++---
- bouml/hkl/129922.bodies                     |    1 +
- bouml/hkl/130178.bodies                     |   15 +-
- bouml/hkl/131074.bodies                     |   29 +-
- bouml/hkl/131330.bodies                     |   27 +-
- bouml/hkl/131586.bodies                     |   24 +-
- bouml/hkl/131970                            |    2 +-
- bouml/hkl/132482                            |   82 +-----
- bouml/hkl/132610.bodies                     |    4 +-
- bouml/hkl/132738.bodies                     |    4 +-
- bouml/hkl/133122                            |    2 +-
- bouml/hkl/133378                            |    2 +-
- bouml/hkl/133378.bodies                     |   20 +-
- bouml/hkl/133634.bodies                     |   48 ++--
- bouml/hkl/134146.bodies                     |   10 +-
- bouml/hkl/134274.bodies                     |    4 +-
- bouml/hkl/134402.bodies                     |    8 +-
- bouml/hkl/134786.bodies                     |   38 ++--
- bouml/hkl/134914.bodies                     |    5 +
- bouml/hkl/135042.bodies                     |    4 +-
- bouml/hkl/135170.bodies                     |    8 +-
- bouml/hkl/135426.bodies                     |   22 +-
- bouml/hkl/136194.bodies                     |   34 +--
- bouml/hkl/136322.bodies                     |   18 +-
- bouml/hkl/136450.bodies                     |   21 +-
- bouml/hkl/136578.bodies                     |    2 +-
- bouml/hkl/136834.bodies                     |    2 +-
- bouml/hkl/139138.bodies                     |    6 +-
- bouml/hkl/142466.bodies                     |    4 +-
- bouml/hkl/142978.bodies                     |    6 +-
- bouml/hkl/143362.bodies                     |    4 +-
- bouml/hkl/145410.bodies                     |    2 +-
- bouml/hkl/148482.bodies                     |   35 +--
- bouml/hkl/149762.bodies                     |  196 ++++++------
- bouml/hkl/2.session                         |    8 +-
- bouml/hkl/hkl.prj                           |  434 ++++++++++++++++-----------
- include/hkl/lattice.h                       |    1 +
- include/hkl/pseudoaxe.h                     |   25 +-
- include/hkl/pseudoaxeengine.h               |   13 +-
- include/hkl/range.h                         |  127 +++++----
- include/hkl/twoC_vertical_pseudoaxeengine.h |   17 -
- src/SConscript                              |   15 +-
- src/fitparameter.cpp                        |   11 +-
- src/fitparameterlist.cpp                    |    1 +
- src/lattice.cpp                             |   25 +-
- src/object.cpp                              |    4 +-
- src/parameter.cpp                           |    3 +-
- src/parameterlist.cpp                       |    1 +
- src/pseudoaxe.cpp                           |   42 +--
- src/pseudoaxeengine.cpp                     |   17 +
- src/range.cpp                               |  160 ++++++----
- src/twoC_vertical_pseudoaxeengine.cpp       |  106 +++-----
- src/value.cpp                               |   10 +-
- test/SConscript                             |    2 +-
- test/pseudoaxe_twoC_test.cpp                |   43 +--
- test/range_test.cpp                         |   16 +-
+ bouml/hkl/128002                            |   2 +-
+ bouml/hkl/128002.bodies                     |   6 +-
+ bouml/hkl/128060.bodies                     |  14 +-
+ bouml/hkl/128130.diagram                    |  30 +-
+ bouml/hkl/128514.bodies                     |  68 ++---
+ bouml/hkl/128642                            |   2 +-
+ bouml/hkl/128770.bodies                     |   6 +-
+ bouml/hkl/128898.bodies                     |   6 +-
+ bouml/hkl/129154.bodies                     |   8 +-
+ bouml/hkl/129794.bodies                     | 112 ++++---
+ bouml/hkl/129922.bodies                     |   1 +
+ bouml/hkl/130178.bodies                     |  15 +-
+ bouml/hkl/131074.bodies                     |  29 +-
+ bouml/hkl/131330.bodies                     |  27 +-
+ bouml/hkl/131586.bodies                     |  24 +-
+ bouml/hkl/131970                            |   2 +-
+ bouml/hkl/132482                            |  82 +-----
+ bouml/hkl/132610.bodies                     |   4 +-
+ bouml/hkl/132738.bodies                     |   4 +-
+ bouml/hkl/133122                            |   2 +-
+ bouml/hkl/133378                            |   2 +-
+ bouml/hkl/133378.bodies                     |  20 +-
+ bouml/hkl/133634.bodies                     |  48 +--
+ bouml/hkl/134146.bodies                     |  10 +-
+ bouml/hkl/134274.bodies                     |   4 +-
+ bouml/hkl/134402.bodies                     |   8 +-
+ bouml/hkl/134786.bodies                     |  38 ++-
+ bouml/hkl/134914.bodies                     |   5 +
+ bouml/hkl/135042.bodies                     |   4 +-
+ bouml/hkl/135170.bodies                     |   8 +-
+ bouml/hkl/135426.bodies                     |  22 +-
+ bouml/hkl/136194.bodies                     |  34 +--
+ bouml/hkl/136322.bodies                     |  18 +-
+ bouml/hkl/136450.bodies                     |  21 +-
+ bouml/hkl/136578.bodies                     |   2 +-
+ bouml/hkl/136834.bodies                     |   2 +-
+ bouml/hkl/139138.bodies                     |   6 +-
+ bouml/hkl/142466.bodies                     |   4 +-
+ bouml/hkl/142978.bodies                     |   6 +-
+ bouml/hkl/143362.bodies                     |   4 +-
+ bouml/hkl/145410.bodies                     |   2 +-
+ bouml/hkl/148482.bodies                     |  35 +--
+ bouml/hkl/149762.bodies                     | 196 ++++++-------
+ bouml/hkl/2.session                         |   8 +-
+ bouml/hkl/hkl.prj                           | 434 ++++++++++++++++------------
+ include/hkl/lattice.h                       |   1 +
+ include/hkl/pseudoaxe.h                     |  25 +-
+ include/hkl/pseudoaxeengine.h               |  13 +-
+ include/hkl/range.h                         | 127 ++++----
+ include/hkl/twoC_vertical_pseudoaxeengine.h |  17 --
+ src/SConscript                              |  15 +-
+ src/fitparameter.cpp                        |  11 +-
+ src/fitparameterlist.cpp                    |   1 +
+ src/lattice.cpp                             |  25 +-
+ src/object.cpp                              |   4 +-
+ src/parameter.cpp                           |   3 +-
+ src/parameterlist.cpp                       |   1 +
+ src/pseudoaxe.cpp                           |  42 +--
+ src/pseudoaxeengine.cpp                     |  17 ++
+ src/range.cpp                               | 160 ++++++----
+ src/twoC_vertical_pseudoaxeengine.cpp       | 106 +++----
+ src/value.cpp                               |  10 +-
+ test/SConscript                             |   2 +-
+ test/pseudoaxe_twoC_test.cpp                |  43 +--
+ test/range_test.cpp                         |  16 +-
  65 files changed, 1023 insertions(+), 1001 deletions(-)
 
 commit c61e9bc574bdd6a340b41e287acaa9a43d82a784
@@ -9849,140 +19610,140 @@ Date:   Thu Aug 23 14:32:51 2007 +0200
     Remove all using namespace std from the code, so we must put std:: in front
     of all methods of the std library.
 
- bouml/hkl/128002                                  |   14 +-
- bouml/hkl/128130.diagram                          |   36 +-
- bouml/hkl/128258.diagram                          |   28 +-
- bouml/hkl/128514                                  |    2 +-
- bouml/hkl/128642                                  |   10 +-
- bouml/hkl/128770                                  |   30 +-
- bouml/hkl/128770.diagram                          |   44 +-
- bouml/hkl/129922                                  |    2 +-
- bouml/hkl/131074                                  |    2 +-
- bouml/hkl/131970                                  |   10 +-
- bouml/hkl/132482                                  |   26 +-
- bouml/hkl/132738.diagram                          |   46 +-
- bouml/hkl/132994                                  |   10 +-
- bouml/hkl/133378                                  |   18 +-
- bouml/hkl/134018                                  |   37 +-
- bouml/hkl/134146                                  |   14 +-
- bouml/hkl/2.session                               |   10 +-
- bouml/hkl/cpp_includes                            |    6 +-
- bouml/hkl/generation_settings                     |    3 +-
- bouml/hkl/hkl.prj                                 |  683 ++++++++++-----------
- include/hkl/HKLException.h                        |    2 -
- include/hkl/affinement.h                          |   15 +-
- include/hkl/affinementlist.h                      |   19 +-
- include/hkl/axe.h                                 |   31 +-
- include/hkl/axe_rotation.h                        |   11 +-
- include/hkl/axefactory.h                          |    1 -
- include/hkl/derived_mode.h                        |    1 -
- include/hkl/derived_pseudoaxeengine.h             |   32 +-
- include/hkl/diffractometer.h                      |   11 +-
- include/hkl/eulerian4C_vertical_mode.h            |    1 -
- include/hkl/eulerian4C_vertical_pseudoaxeengine.h |    8 +-
- include/hkl/eulerian6C_pseudoaxeengine.h          |   12 +-
- include/hkl/fitparameter.h                        |   15 +-
- include/hkl/fitparameterlist.h                    |   20 +-
- include/hkl/geometry.h                            |   18 +-
- include/hkl/geometry_kappa.h                      |   11 +-
- include/hkl/hklobject.h                           |   15 +-
- include/hkl/holder.h                              |  163 +++++-
- include/hkl/holderlist.h                          |  139 -----
- include/hkl/kappa4C_vertical_pseudoaxeengine.h    |    8 +-
- include/hkl/lattice.h                             |   14 +-
- include/hkl/mode.h                                |    1 -
- include/hkl/modelist.h                            |   19 +-
- include/hkl/mymap.h                               |   19 +-
- include/hkl/mystring.h                            |    9 +-
- include/hkl/object.h                              |   14 +-
- include/hkl/parameter.h                           |   15 +-
- include/hkl/parameterlist.h                       |   23 +-
- include/hkl/pseudoaxe.h                           |   10 +-
- include/hkl/pseudoaxeengine.h                     |   28 +-
- include/hkl/pseudoaxeenginelist.h                 |   10 +-
- include/hkl/pseudoaxelist.h                       |   18 +-
- include/hkl/quaternion.h                          |   13 +-
- include/hkl/range.h                               |   14 +-
- include/hkl/reflection.h                          |   10 +-
- include/hkl/reflectionlist.h                      |   14 +-
- include/hkl/sample.h                              |   11 +-
- include/hkl/sample_monocrystal.h                  |    9 +-
- include/hkl/samplefactory.h                       |    4 +-
- include/hkl/samplelist.h                          |   21 +-
- include/hkl/source.h                              |   14 +-
- include/hkl/svector.h                             |   32 +-
- include/hkl/twoC_vertical_mode.h                  |    1 -
- include/hkl/twoC_vertical_pseudoaxeengine.h       |   16 +-
- include/hkl/value.h                               |   10 +-
- src/SConscript                                    |    2 +-
- src/affinement.cpp                                |   10 +-
- src/affinementlist.cpp                            |   12 +-
- src/axe.cpp                                       |   14 +-
- src/axe_rotation.cpp                              |    6 +-
- src/diffractometer.cpp                            |   10 +-
- src/eulerian4C_vertical_pseudoaxeengine.cpp       |    6 +-
- src/eulerian6C_pseudoaxeengine.cpp                |   10 +-
- src/fitparameter.cpp                              |   14 +-
- src/fitparameterlist.cpp                          |   32 +-
- src/geometry.cpp                                  |   10 +-
- src/geometry_kappa.cpp                            |   10 +-
- src/hklobject.cpp                                 |    6 +-
- src/holder.cpp                                    |  237 +++++++-
- src/holderlist.cpp                                |  195 ------
- src/kappa4C_vertical_geometry.cpp                 |    4 +-
- src/kappa4C_vertical_pseudoaxeengine.cpp          |    4 +-
- src/lattice.cpp                                   |    6 +-
- src/modelist.cpp                                  |   12 +-
- src/mystring.cpp                                  |   18 +-
- src/object.cpp                                    |   14 +-
- src/parameter.cpp                                 |    6 +-
- src/parameterlist.cpp                             |   34 +-
- src/pseudoaxe.cpp                                 |   16 +-
- src/pseudoaxeenginelist.cpp                       |   28 +-
- src/pseudoaxelist.cpp                             |    6 +-
- src/quaternion.cpp                                |   12 +-
- src/range.cpp                                     |   12 +-
- src/reflection.cpp                                |    6 +-
- src/reflectionlist.cpp                            |   54 +-
- src/sample.cpp                                    |   26 +-
- src/sample_monocrystal.cpp                        |   14 +-
- src/samplefactory.cpp                             |    4 +-
- src/samplelist.cpp                                |   14 +-
- src/source.cpp                                    |    6 +-
- src/svector.cpp                                   |  138 ++--
- src/twoC_vertical_pseudoaxeengine.cpp             |   20 +-
- src/value.cpp                                     |   10 +-
- test/SConscript                                   |   10 +-
- test/axe_rotation_test.cpp                        |    2 +-
- test/fitparameter_test.cpp                        |    2 +-
- test/geometry_eulerian4C_test.cpp                 |    2 +-
- test/geometry_eulerian6C_test.cpp                 |    2 +-
- test/geometry_kappa4C_test.cpp                    |    2 +-
- test/geometry_kappa6C_test.cpp                    |    2 +-
- test/geometry_twoC_test.cpp                       |    2 +-
- test/hklobject_test.cpp                           |    6 +-
- test/holder_test.cpp                              |   18 +-
- test/holder_test.h                                |    2 +-
- test/holderlist_test.cpp                          |    2 +-
- test/holderlist_test.h                            |    2 +-
- test/lattice_test.cpp                             |    2 +-
- test/mode_eulerian4C_test.cpp                     |    2 +-
- test/mode_kappa4C_test.cpp                        |    2 +-
- test/mode_kappa6C_test.cpp                        |    2 +-
- test/mode_twoC_test.cpp                           |    2 +-
- test/mystring_test.cpp                            |    2 +-
- test/object_test.cpp                              |    8 +-
- test/parameter_test.cpp                           |    2 +-
- test/pseudoaxe_twoC_test.cpp                      |    2 +-
- test/quaternion_test.cpp                          |    2 +-
- test/range_test.cpp                               |    2 +-
- test/reflection_test.cpp                          |    2 +-
- test/reflectionlist_test.cpp                      |    2 +-
- test/sample_test.cpp                              |    4 +-
- test/samplelist_test.cpp                          |    4 +-
- test/source_test.cpp                              |    2 +-
- test/svecmat_test.cpp                             |    4 +-
- test/value_test.cpp                               |    2 +-
+ bouml/hkl/128002                                  |  14 +-
+ bouml/hkl/128130.diagram                          |  36 +-
+ bouml/hkl/128258.diagram                          |  28 +-
+ bouml/hkl/128514                                  |   2 +-
+ bouml/hkl/128642                                  |  10 +-
+ bouml/hkl/128770                                  |  30 +-
+ bouml/hkl/128770.diagram                          |  44 +-
+ bouml/hkl/129922                                  |   2 +-
+ bouml/hkl/131074                                  |   2 +-
+ bouml/hkl/131970                                  |  10 +-
+ bouml/hkl/132482                                  |  26 +-
+ bouml/hkl/132738.diagram                          |  46 +-
+ bouml/hkl/132994                                  |  10 +-
+ bouml/hkl/133378                                  |  18 +-
+ bouml/hkl/134018                                  |  37 +-
+ bouml/hkl/134146                                  |  14 +-
+ bouml/hkl/2.session                               |  10 +-
+ bouml/hkl/cpp_includes                            |   6 +-
+ bouml/hkl/generation_settings                     |   3 +-
+ bouml/hkl/hkl.prj                                 | 683 +++++++++++-----------
+ include/hkl/HKLException.h                        |   2 -
+ include/hkl/affinement.h                          |  15 +-
+ include/hkl/affinementlist.h                      |  19 +-
+ include/hkl/axe.h                                 |  31 +-
+ include/hkl/axe_rotation.h                        |  11 +-
+ include/hkl/axefactory.h                          |   1 -
+ include/hkl/derived_mode.h                        |   1 -
+ include/hkl/derived_pseudoaxeengine.h             |  32 +-
+ include/hkl/diffractometer.h                      |  11 +-
+ include/hkl/eulerian4C_vertical_mode.h            |   1 -
+ include/hkl/eulerian4C_vertical_pseudoaxeengine.h |   8 +-
+ include/hkl/eulerian6C_pseudoaxeengine.h          |  12 +-
+ include/hkl/fitparameter.h                        |  15 +-
+ include/hkl/fitparameterlist.h                    |  20 +-
+ include/hkl/geometry.h                            |  18 +-
+ include/hkl/geometry_kappa.h                      |  11 +-
+ include/hkl/hklobject.h                           |  15 +-
+ include/hkl/holder.h                              | 163 +++++-
+ include/hkl/holderlist.h                          | 139 -----
+ include/hkl/kappa4C_vertical_pseudoaxeengine.h    |   8 +-
+ include/hkl/lattice.h                             |  14 +-
+ include/hkl/mode.h                                |   1 -
+ include/hkl/modelist.h                            |  19 +-
+ include/hkl/mymap.h                               |  19 +-
+ include/hkl/mystring.h                            |   9 +-
+ include/hkl/object.h                              |  14 +-
+ include/hkl/parameter.h                           |  15 +-
+ include/hkl/parameterlist.h                       |  23 +-
+ include/hkl/pseudoaxe.h                           |  10 +-
+ include/hkl/pseudoaxeengine.h                     |  28 +-
+ include/hkl/pseudoaxeenginelist.h                 |  10 +-
+ include/hkl/pseudoaxelist.h                       |  18 +-
+ include/hkl/quaternion.h                          |  13 +-
+ include/hkl/range.h                               |  14 +-
+ include/hkl/reflection.h                          |  10 +-
+ include/hkl/reflectionlist.h                      |  14 +-
+ include/hkl/sample.h                              |  11 +-
+ include/hkl/sample_monocrystal.h                  |   9 +-
+ include/hkl/samplefactory.h                       |   4 +-
+ include/hkl/samplelist.h                          |  21 +-
+ include/hkl/source.h                              |  14 +-
+ include/hkl/svector.h                             |  32 +-
+ include/hkl/twoC_vertical_mode.h                  |   1 -
+ include/hkl/twoC_vertical_pseudoaxeengine.h       |  16 +-
+ include/hkl/value.h                               |  10 +-
+ src/SConscript                                    |   2 +-
+ src/affinement.cpp                                |  10 +-
+ src/affinementlist.cpp                            |  12 +-
+ src/axe.cpp                                       |  14 +-
+ src/axe_rotation.cpp                              |   6 +-
+ src/diffractometer.cpp                            |  10 +-
+ src/eulerian4C_vertical_pseudoaxeengine.cpp       |   6 +-
+ src/eulerian6C_pseudoaxeengine.cpp                |  10 +-
+ src/fitparameter.cpp                              |  14 +-
+ src/fitparameterlist.cpp                          |  32 +-
+ src/geometry.cpp                                  |  10 +-
+ src/geometry_kappa.cpp                            |  10 +-
+ src/hklobject.cpp                                 |   6 +-
+ src/holder.cpp                                    | 237 +++++++-
+ src/holderlist.cpp                                | 195 ------
+ src/kappa4C_vertical_geometry.cpp                 |   4 +-
+ src/kappa4C_vertical_pseudoaxeengine.cpp          |   4 +-
+ src/lattice.cpp                                   |   6 +-
+ src/modelist.cpp                                  |  12 +-
+ src/mystring.cpp                                  |  18 +-
+ src/object.cpp                                    |  14 +-
+ src/parameter.cpp                                 |   6 +-
+ src/parameterlist.cpp                             |  34 +-
+ src/pseudoaxe.cpp                                 |  16 +-
+ src/pseudoaxeenginelist.cpp                       |  28 +-
+ src/pseudoaxelist.cpp                             |   6 +-
+ src/quaternion.cpp                                |  12 +-
+ src/range.cpp                                     |  12 +-
+ src/reflection.cpp                                |   6 +-
+ src/reflectionlist.cpp                            |  54 +-
+ src/sample.cpp                                    |  26 +-
+ src/sample_monocrystal.cpp                        |  14 +-
+ src/samplefactory.cpp                             |   4 +-
+ src/samplelist.cpp                                |  14 +-
+ src/source.cpp                                    |   6 +-
+ src/svector.cpp                                   | 138 ++---
+ src/twoC_vertical_pseudoaxeengine.cpp             |  20 +-
+ src/value.cpp                                     |  10 +-
+ test/SConscript                                   |  10 +-
+ test/axe_rotation_test.cpp                        |   2 +-
+ test/fitparameter_test.cpp                        |   2 +-
+ test/geometry_eulerian4C_test.cpp                 |   2 +-
+ test/geometry_eulerian6C_test.cpp                 |   2 +-
+ test/geometry_kappa4C_test.cpp                    |   2 +-
+ test/geometry_kappa6C_test.cpp                    |   2 +-
+ test/geometry_twoC_test.cpp                       |   2 +-
+ test/hklobject_test.cpp                           |   6 +-
+ test/holder_test.cpp                              |  18 +-
+ test/holder_test.h                                |   2 +-
+ test/holderlist_test.cpp                          |   2 +-
+ test/holderlist_test.h                            |   2 +-
+ test/lattice_test.cpp                             |   2 +-
+ test/mode_eulerian4C_test.cpp                     |   2 +-
+ test/mode_kappa4C_test.cpp                        |   2 +-
+ test/mode_kappa6C_test.cpp                        |   2 +-
+ test/mode_twoC_test.cpp                           |   2 +-
+ test/mystring_test.cpp                            |   2 +-
+ test/object_test.cpp                              |   8 +-
+ test/parameter_test.cpp                           |   2 +-
+ test/pseudoaxe_twoC_test.cpp                      |   2 +-
+ test/quaternion_test.cpp                          |   2 +-
+ test/range_test.cpp                               |   2 +-
+ test/reflection_test.cpp                          |   2 +-
+ test/reflectionlist_test.cpp                      |   2 +-
+ test/sample_test.cpp                              |   4 +-
+ test/samplelist_test.cpp                          |   4 +-
+ test/source_test.cpp                              |   2 +-
+ test/svecmat_test.cpp                             |   4 +-
+ test/value_test.cpp                               |   2 +-
  134 files changed, 1485 insertions(+), 1568 deletions(-)
 
 commit cfc73d10502550c0199db91e59d91e97b77afc42
@@ -9993,80 +19754,80 @@ Date:   Tue Aug 21 17:14:11 2007 +0200
     
     Working on the PseudoAxes to set a correct min and max range.
 
- bouml/hkl/128188.diagram                 |   52 ++++---
- bouml/hkl/128770                         |   18 ++-
- bouml/hkl/129794.bodies                  |   12 +-
- bouml/hkl/131458.diagram                 |   48 ++-----
- bouml/hkl/131714.bodies                  |    8 +-
- bouml/hkl/131842                         |    2 +-
- bouml/hkl/131842.bodies                  |   21 ++-
- bouml/hkl/132482                         |    2 +-
- bouml/hkl/132610.bodies                  |   62 +++-----
- bouml/hkl/132866.bodies                  |   20 ++-
- bouml/hkl/132994                         |    2 +-
- bouml/hkl/132994.bodies                  |  129 ++++++++--------
- bouml/hkl/133122                         |    2 +-
- bouml/hkl/133250                         |    2 +-
- bouml/hkl/133378                         |    2 +-
- bouml/hkl/133634                         |    2 +-
- bouml/hkl/136194.bodies                  |   49 +++---
- bouml/hkl/136322.bodies                  |   63 +++++----
- bouml/hkl/136706.bodies                  |   57 ++------
- bouml/hkl/136834.bodies                  |   89 ++++++------
- bouml/hkl/137090.bodies                  |  109 +++++++++-----
- bouml/hkl/144130.bodies                  |   16 +-
- bouml/hkl/144258.bodies                  |   24 ++--
- bouml/hkl/145026.bodies                  |   78 +++++-----
- bouml/hkl/145282.bodies                  |   16 ++-
- bouml/hkl/148482.bodies                  |    4 +-
- bouml/hkl/2.session                      |   12 +-
- bouml/hkl/hkl.prj                        |  245 +++++++++++++++---------------
- include/hkl/axe.h                        |   59 +++-----
- include/hkl/constant.h                   |   82 ++++++++++
- include/hkl/derived_pseudoaxeengine.h    |  182 ++++++++++++++--------
- src/axe.cpp                              |    9 +-
- src/eulerian4C_vertical_geometry.cpp     |   21 ++-
- src/eulerian6C_geometry.cpp              |   20 ++-
- src/eulerian6C_pseudoaxeengine.cpp       |   28 ++--
- src/geometry.cpp                         |    8 +-
- src/holder.cpp                           |    4 +-
- src/kappa4C_vertical_geometry.cpp        |   62 +++-----
- src/kappa4C_vertical_pseudoaxeengine.cpp |   57 ++------
- src/kappa6C_diffractometer.cpp           |    2 +-
- src/kappa6C_geometry.cpp                 |   68 +++-----
- src/pseudoaxe.cpp                        |    1 +
- src/range.cpp                            |   12 +-
- src/twoC_vertical_pseudoaxeengine.cpp    |  151 ++++++++++---------
- test/SConscript                          |   21 ++--
- test/affinement_simplex_test.cpp         |   80 +++++-----
- test/affinement_simplex_test.h           |    2 +-
- test/axe_rotation_test.cpp               |    6 +-
- test/geometry_eulerian4C_test.cpp        |   49 +++---
- test/geometry_eulerian4C_test.h          |    2 +-
- test/geometry_eulerian6C_test.cpp        |  137 +++++++++--------
- test/geometry_eulerian6C_test.h          |    2 +-
- test/geometry_kappa4C_test.cpp           |   60 ++++----
- test/geometry_kappa6C_test.cpp           |   55 ++++---
- test/geometry_twoC_test.cpp              |   48 +++---
- test/geometry_twoC_test.h                |    2 +-
- test/holderlist_test.cpp                 |    4 +-
- test/mode_kappa4C_test.cpp               |  126 ++++++++--------
- test/mode_kappa4C_test.h                 |    2 +-
- test/mode_kappa6C_test.cpp               |  170 +++++++++++----------
- test/mode_kappa6C_test.h                 |    2 +-
- test/pseudoaxe_eulerian4C_test.cpp       |  154 ++++++++++---------
- test/pseudoaxe_eulerian4C_test.h         |    2 +-
- test/pseudoaxe_eulerian6C_test.cpp       |  133 ++++++++--------
- test/pseudoaxe_eulerian6C_test.h         |    2 +-
- test/pseudoaxe_kappa4C_test.cpp          |  211 +++++++++++++-------------
- test/pseudoaxe_kappa4C_test.h            |    4 +-
- test/pseudoaxe_kappa6C_test.cpp          |  183 ++++++++++++-----------
- test/pseudoaxe_kappa6C_test.h            |   10 +-
- test/pseudoaxe_twoC_test.cpp             |  119 +++++++++------
- test/pseudoaxe_twoC_test.h               |    2 +-
- test/reflection_test.cpp                 |   34 +++--
- test/reflection_test.h                   |    2 +-
- test/sample_test.cpp                     |   54 ++++----
+ bouml/hkl/128188.diagram                 |  52 ++++---
+ bouml/hkl/128770                         |  18 ++-
+ bouml/hkl/129794.bodies                  |  12 +-
+ bouml/hkl/131458.diagram                 |  48 ++----
+ bouml/hkl/131714.bodies                  |   8 +-
+ bouml/hkl/131842                         |   2 +-
+ bouml/hkl/131842.bodies                  |  21 +--
+ bouml/hkl/132482                         |   2 +-
+ bouml/hkl/132610.bodies                  |  62 +++-----
+ bouml/hkl/132866.bodies                  |  20 ++-
+ bouml/hkl/132994                         |   2 +-
+ bouml/hkl/132994.bodies                  | 129 ++++++++--------
+ bouml/hkl/133122                         |   2 +-
+ bouml/hkl/133250                         |   2 +-
+ bouml/hkl/133378                         |   2 +-
+ bouml/hkl/133634                         |   2 +-
+ bouml/hkl/136194.bodies                  |  49 +++----
+ bouml/hkl/136322.bodies                  |  63 ++++----
+ bouml/hkl/136706.bodies                  |  57 ++-----
+ bouml/hkl/136834.bodies                  |  89 +++++------
+ bouml/hkl/137090.bodies                  | 109 +++++++++-----
+ bouml/hkl/144130.bodies                  |  16 +-
+ bouml/hkl/144258.bodies                  |  24 +--
+ bouml/hkl/145026.bodies                  |  78 +++++-----
+ bouml/hkl/145282.bodies                  |  16 +-
+ bouml/hkl/148482.bodies                  |   4 +-
+ bouml/hkl/2.session                      |  12 +-
+ bouml/hkl/hkl.prj                        | 245 +++++++++++++++----------------
+ include/hkl/axe.h                        |  59 +++-----
+ include/hkl/constant.h                   |  82 +++++++++++
+ include/hkl/derived_pseudoaxeengine.h    | 182 ++++++++++++++---------
+ src/axe.cpp                              |   9 +-
+ src/eulerian4C_vertical_geometry.cpp     |  21 +--
+ src/eulerian6C_geometry.cpp              |  20 ++-
+ src/eulerian6C_pseudoaxeengine.cpp       |  28 ++--
+ src/geometry.cpp                         |   8 +-
+ src/holder.cpp                           |   4 +-
+ src/kappa4C_vertical_geometry.cpp        |  62 +++-----
+ src/kappa4C_vertical_pseudoaxeengine.cpp |  57 ++-----
+ src/kappa6C_diffractometer.cpp           |   2 +-
+ src/kappa6C_geometry.cpp                 |  68 ++++-----
+ src/pseudoaxe.cpp                        |   1 +
+ src/range.cpp                            |  12 +-
+ src/twoC_vertical_pseudoaxeengine.cpp    | 151 ++++++++++---------
+ test/SConscript                          |  21 ++-
+ test/affinement_simplex_test.cpp         |  80 +++++-----
+ test/affinement_simplex_test.h           |   2 +-
+ test/axe_rotation_test.cpp               |   6 +-
+ test/geometry_eulerian4C_test.cpp        |  49 ++++---
+ test/geometry_eulerian4C_test.h          |   2 +-
+ test/geometry_eulerian6C_test.cpp        | 137 ++++++++---------
+ test/geometry_eulerian6C_test.h          |   2 +-
+ test/geometry_kappa4C_test.cpp           |  60 ++++----
+ test/geometry_kappa6C_test.cpp           |  55 +++----
+ test/geometry_twoC_test.cpp              |  48 +++---
+ test/geometry_twoC_test.h                |   2 +-
+ test/holderlist_test.cpp                 |   4 +-
+ test/mode_kappa4C_test.cpp               | 126 ++++++++--------
+ test/mode_kappa4C_test.h                 |   2 +-
+ test/mode_kappa6C_test.cpp               | 170 ++++++++++-----------
+ test/mode_kappa6C_test.h                 |   2 +-
+ test/pseudoaxe_eulerian4C_test.cpp       | 154 +++++++++----------
+ test/pseudoaxe_eulerian4C_test.h         |   2 +-
+ test/pseudoaxe_eulerian6C_test.cpp       | 133 ++++++++---------
+ test/pseudoaxe_eulerian6C_test.h         |   2 +-
+ test/pseudoaxe_kappa4C_test.cpp          | 211 +++++++++++++-------------
+ test/pseudoaxe_kappa4C_test.h            |   4 +-
+ test/pseudoaxe_kappa6C_test.cpp          | 183 ++++++++++++-----------
+ test/pseudoaxe_kappa6C_test.h            |  10 +-
+ test/pseudoaxe_twoC_test.cpp             | 119 +++++++++------
+ test/pseudoaxe_twoC_test.h               |   2 +-
+ test/reflection_test.cpp                 |  34 +++--
+ test/reflection_test.h                   |   2 +-
+ test/sample_test.cpp                     |  54 +++----
  74 files changed, 1863 insertions(+), 1727 deletions(-)
 
 commit 58c71caa93f3fe82caf53f45934bba4545f52d2d
@@ -10075,14 +19836,14 @@ Date:   Sun Aug 19 19:11:53 2007 +0200
 
     * ready to deal with the Geometry Assignation problem.
 
- bouml/hkl/128770                      |    6 +-
- bouml/hkl/2.session                   |    6 +-
- include/hkl/derived_pseudoaxeengine.h |   24 +++++-----
- src/eulerian6C_diffractometer.cpp     |   16 +++---
- src/eulerian6C_pseudoaxeengine.cpp    |   85 +++++++++++++++++---------------
- src/kappa6C_diffractometer.cpp        |   24 +++++-----
- src/kappa6C_geometry.cpp              |   57 ++++++++++++++--------
- test/geometry_twoC_test.cpp           |    6 ++-
+ bouml/hkl/128770                      |  6 +--
+ bouml/hkl/2.session                   |  6 +--
+ include/hkl/derived_pseudoaxeengine.h | 24 +++++-----
+ src/eulerian6C_diffractometer.cpp     | 16 +++----
+ src/eulerian6C_pseudoaxeengine.cpp    | 85 ++++++++++++++++++-----------------
+ src/kappa6C_diffractometer.cpp        | 24 +++++-----
+ src/kappa6C_geometry.cpp              | 57 ++++++++++++++---------
+ test/geometry_twoC_test.cpp           |  6 ++-
  8 files changed, 124 insertions(+), 100 deletions(-)
 
 commit 2f65d53e5bdfd92d92710ea37c848d510c4fcae5
@@ -10091,74 +19852,74 @@ Date:   Fri Aug 17 18:04:35 2007 +0200
 
     * close to the end of the refactoring of the geometry. (do not compile)
 
- bouml/hkl/128002                            |    2 +-
- bouml/hkl/128060.bodies                     |    2 +-
- bouml/hkl/128770                            |    2 +-
- bouml/hkl/129922.diagram                    |   33 ++-
- bouml/hkl/130050.bodies                     |   15 +-
- bouml/hkl/131330.diagram                    |   34 ++--
- bouml/hkl/131458.diagram                    |   34 ++-
- bouml/hkl/131842                            |    6 +-
- bouml/hkl/131842.bodies                     |   91 ++++----
- bouml/hkl/131970                            |    2 +-
- bouml/hkl/132354                            |    2 +-
- bouml/hkl/132482.bodies                     |   17 +-
- bouml/hkl/132610.bodies                     |   51 +++--
- bouml/hkl/132738.diagram                    |   50 +++--
- bouml/hkl/132866.bodies                     |   61 ++++--
- bouml/hkl/133122                            |   42 ++--
- bouml/hkl/133250                            |    9 +-
- bouml/hkl/133634                            |   46 ++--
- bouml/hkl/134146                            |   21 +-
- bouml/hkl/136578.bodies                     |    4 +-
- bouml/hkl/137090.bodies                     |    2 +-
- bouml/hkl/143490.bodies                     |   10 +-
- bouml/hkl/143618.bodies                     |   10 +-
- bouml/hkl/143746.bodies                     |   18 +-
- bouml/hkl/143874.bodies                     |   20 +-
- bouml/hkl/145026.bodies                     |    2 +-
- bouml/hkl/145282.bodies                     |    6 -
- bouml/hkl/145410.bodies                     |   44 +---
- bouml/hkl/148482.bodies                     |   64 +-----
- bouml/hkl/149762.bodies                     |   38 +++-
- bouml/hkl/150914.bodies                     |   13 +
- bouml/hkl/2.session                         |   12 +-
- bouml/hkl/hkl.prj                           |  329 ++++++++++++++++++++-------
- include/hkl/axe.h                           |   36 ++--
- include/hkl/axe_rotation.h                  |   13 +-
- include/hkl/axefactory.h                    |   30 +++
- include/hkl/derived_pseudoaxeengine.h       |    4 +-
- include/hkl/diffractometer.h                |   21 ++-
- include/hkl/holder.h                        |   87 +++++++-
- include/hkl/holderlist.h                    |    3 +
- include/hkl/kappa4C_vertical_geometry.h     |   18 +-
- include/hkl/kappa6C_geometry.h              |   22 +-
- src/HKLException.cpp                        |    2 +-
- src/SConscript                              |   14 +-
- src/axe.cpp                                 |  124 ++--------
- src/axe_rotation.cpp                        |   24 +--
- src/axefactory.cpp                          |   34 +++
- src/eulerian4C_vertical_diffractometer.cpp  |   18 +-
- src/eulerian4C_vertical_geometry.cpp        |   94 ++++----
- src/eulerian4C_vertical_pseudoaxeengine.cpp |    4 +-
- src/eulerian6C_geometry.cpp                 |   65 ++++--
- src/holder.cpp                              |   68 +-----
- src/holderlist.cpp                          |   40 +++-
- src/kappa4C_vertical_diffractometer.cpp     |   22 +-
- src/kappa4C_vertical_geometry.cpp           |   69 ++++--
- src/kappa6C_diffractometer.cpp              |    2 +-
- src/kappa6C_geometry.cpp                    |   26 ++-
- src/twoC_vertical_diffractometer.cpp        |   10 +-
- src/twoC_vertical_geometry.cpp              |   16 +-
- src/value.cpp                               |    2 +-
- test/SConscript                             |   12 +-
- test/axe_test.cpp                           |   97 --------
- test/axe_test.h                             |   33 ---
- test/geometry_test.cpp                      |   45 +---
- test/geometry_test.h                        |    2 -
- test/holder_test.cpp                        |   52 ++---
- test/holderlist_test.cpp                    |   28 ++-
- test/holderlist_test.h                      |    5 +
+ bouml/hkl/128002                            |   2 +-
+ bouml/hkl/128060.bodies                     |   2 +-
+ bouml/hkl/128770                            |   2 +-
+ bouml/hkl/129922.diagram                    |  33 ++-
+ bouml/hkl/130050.bodies                     |  15 +-
+ bouml/hkl/131330.diagram                    |  34 +--
+ bouml/hkl/131458.diagram                    |  34 +--
+ bouml/hkl/131842                            |   6 +-
+ bouml/hkl/131842.bodies                     |  91 ++++----
+ bouml/hkl/131970                            |   2 +-
+ bouml/hkl/132354                            |   2 +-
+ bouml/hkl/132482.bodies                     |  17 +-
+ bouml/hkl/132610.bodies                     |  51 +++--
+ bouml/hkl/132738.diagram                    |  50 +++--
+ bouml/hkl/132866.bodies                     |  61 ++++--
+ bouml/hkl/133122                            |  42 ++--
+ bouml/hkl/133250                            |   9 +-
+ bouml/hkl/133634                            |  46 ++--
+ bouml/hkl/134146                            |  21 +-
+ bouml/hkl/136578.bodies                     |   4 +-
+ bouml/hkl/137090.bodies                     |   2 +-
+ bouml/hkl/143490.bodies                     |  10 +-
+ bouml/hkl/143618.bodies                     |  10 +-
+ bouml/hkl/143746.bodies                     |  18 +-
+ bouml/hkl/143874.bodies                     |  20 +-
+ bouml/hkl/145026.bodies                     |   2 +-
+ bouml/hkl/145282.bodies                     |   6 -
+ bouml/hkl/145410.bodies                     |  44 +---
+ bouml/hkl/148482.bodies                     |  64 +-----
+ bouml/hkl/149762.bodies                     |  38 +++-
+ bouml/hkl/150914.bodies                     |  13 ++
+ bouml/hkl/2.session                         |  12 +-
+ bouml/hkl/hkl.prj                           | 329 +++++++++++++++++++++-------
+ include/hkl/axe.h                           |  36 ++-
+ include/hkl/axe_rotation.h                  |  13 +-
+ include/hkl/axefactory.h                    |  30 +++
+ include/hkl/derived_pseudoaxeengine.h       |   4 +-
+ include/hkl/diffractometer.h                |  21 +-
+ include/hkl/holder.h                        |  87 +++++++-
+ include/hkl/holderlist.h                    |   3 +
+ include/hkl/kappa4C_vertical_geometry.h     |  18 +-
+ include/hkl/kappa6C_geometry.h              |  22 +-
+ src/HKLException.cpp                        |   2 +-
+ src/SConscript                              |  14 +-
+ src/axe.cpp                                 | 124 ++---------
+ src/axe_rotation.cpp                        |  24 +-
+ src/axefactory.cpp                          |  34 +++
+ src/eulerian4C_vertical_diffractometer.cpp  |  18 +-
+ src/eulerian4C_vertical_geometry.cpp        |  94 ++++----
+ src/eulerian4C_vertical_pseudoaxeengine.cpp |   4 +-
+ src/eulerian6C_geometry.cpp                 |  65 ++++--
+ src/holder.cpp                              |  68 +-----
+ src/holderlist.cpp                          |  40 +++-
+ src/kappa4C_vertical_diffractometer.cpp     |  22 +-
+ src/kappa4C_vertical_geometry.cpp           |  69 +++---
+ src/kappa6C_diffractometer.cpp              |   2 +-
+ src/kappa6C_geometry.cpp                    |  26 ++-
+ src/twoC_vertical_diffractometer.cpp        |  10 +-
+ src/twoC_vertical_geometry.cpp              |  16 +-
+ src/value.cpp                               |   2 +-
+ test/SConscript                             |  12 +-
+ test/axe_test.cpp                           |  97 --------
+ test/axe_test.h                             |  33 ---
+ test/geometry_test.cpp                      |  45 +---
+ test/geometry_test.h                        |   2 -
+ test/holder_test.cpp                        |  52 ++---
+ test/holderlist_test.cpp                    |  28 ++-
+ test/holderlist_test.h                      |   5 +
  68 files changed, 1184 insertions(+), 1050 deletions(-)
 
 commit d6a66ab0ddfc6441c9acf9f77b2fdf2d647be437
@@ -10170,25 +19931,25 @@ Date:   Tue Aug 14 17:51:16 2007 +0200
     The holderList must properly manage its memory. The serialization
     via from/to Stream must be tune.
 
- bouml/hkl/128060.bodies  |    2 +-
- bouml/hkl/130050.bodies  |   73 ++++++++--------
- bouml/hkl/132738.diagram |   18 ++--
- bouml/hkl/134146         |    2 +-
- bouml/hkl/145410.bodies  |    3 +-
- bouml/hkl/148482.bodies  |   27 +++---
- bouml/hkl/149762.bodies  |   67 ++++++++++++---
- bouml/hkl/2.session      |   12 ++-
- bouml/hkl/hkl.prj        |  218 +++++++++++++++++++++++++++------------------
- include/hkl/holder.h     |    6 +-
- include/hkl/holderlist.h |   24 +++++
- src/axe_rotation.cpp     |  139 ++++++++++++++---------------
- src/holder.cpp           |   32 ++++----
- src/holderlist.cpp       |   86 +++++++++++++++---
- src/value.cpp            |    2 +-
- test/SConscript          |    3 +-
- test/holder_test.cpp     |    6 +-
- test/holderlist_test.cpp |   74 ++++++++++++++++
- test/holderlist_test.h   |   31 +++++++
+ bouml/hkl/128060.bodies  |   2 +-
+ bouml/hkl/130050.bodies  |  73 ++++++++--------
+ bouml/hkl/132738.diagram |  18 ++--
+ bouml/hkl/134146         |   2 +-
+ bouml/hkl/145410.bodies  |   3 +-
+ bouml/hkl/148482.bodies  |  27 +++---
+ bouml/hkl/149762.bodies  |  67 ++++++++++++---
+ bouml/hkl/2.session      |  12 +--
+ bouml/hkl/hkl.prj        | 218 ++++++++++++++++++++++++++++-------------------
+ include/hkl/holder.h     |   6 +-
+ include/hkl/holderlist.h |  24 ++++++
+ src/axe_rotation.cpp     | 139 +++++++++++++++---------------
+ src/holder.cpp           |  32 +++----
+ src/holderlist.cpp       |  86 ++++++++++++++++---
+ src/value.cpp            |   2 +-
+ test/SConscript          |   3 +-
+ test/holder_test.cpp     |   6 +-
+ test/holderlist_test.cpp |  74 ++++++++++++++++
+ test/holderlist_test.h   |  31 +++++++
  19 files changed, 551 insertions(+), 274 deletions(-)
 
 commit b5aa59ffae74482079843b69615288fa796eb654
@@ -10199,16 +19960,16 @@ Date:   Tue Aug 14 10:39:18 2007 +0200
     
     Add the test case of the Holder class.
 
- bouml/hkl/132738.diagram |   30 ++++----
- bouml/hkl/145410.bodies  |   85 +++++++++++--------
- bouml/hkl/148482.bodies  |   22 +++++-
- bouml/hkl/2.session      |    7 +-
- bouml/hkl/hkl.prj        |   14 +++-
- include/hkl/axe.h        |    9 ++
- src/axe.cpp              |    5 +-
- src/axe_rotation.cpp     |  210 ++++++++++++++++++++++++----------------------
- src/holder.cpp           |    1 +
- test/holder_test.cpp     |    1 -
+ bouml/hkl/132738.diagram |  30 +++----
+ bouml/hkl/145410.bodies  |  85 +++++++++++--------
+ bouml/hkl/148482.bodies  |  22 ++++-
+ bouml/hkl/2.session      |   7 +-
+ bouml/hkl/hkl.prj        |  14 +++-
+ include/hkl/axe.h        |   9 ++
+ src/axe.cpp              |   5 +-
+ src/axe_rotation.cpp     | 210 ++++++++++++++++++++++++-----------------------
+ src/holder.cpp           |   1 +
+ test/holder_test.cpp     |   1 -
  10 files changed, 223 insertions(+), 161 deletions(-)
 
 commit 70de209fa1673f9086ccd57e1740a08f1e809336
@@ -10217,44 +19978,44 @@ Date:   Mon Aug 13 22:36:15 2007 +0200
 
     * start adding test case of the holder class.
 
- bouml/hkl/128002                      |   13 +-
- bouml/hkl/128770                      |    2 +-
- bouml/hkl/130050.bodies               |    3 +
- bouml/hkl/131714.bodies               |   95 ++-------
- bouml/hkl/132354                      |    6 +-
- bouml/hkl/132482.bodies               |   34 ++--
- bouml/hkl/132738.diagram              |   38 ++--
- bouml/hkl/133122.bodies               |   12 +-
- bouml/hkl/133378.bodies               |    6 +-
- bouml/hkl/134146                      |    2 +-
- bouml/hkl/137090.bodies               |   12 +-
- bouml/hkl/145026.bodies               |   70 ++++----
- bouml/hkl/145410.bodies               |   20 +-
- bouml/hkl/148482.bodies               |   72 +++++--
- bouml/hkl/149762.bodies               |   32 +++-
- bouml/hkl/2.session                   |    8 +-
- bouml/hkl/hkl.prj                     |  358 +++++++++++++++++++++++----------
- include/hkl/axe.h                     |   13 +-
- include/hkl/derived_pseudoaxeengine.h |   82 ++++----
- include/hkl/geometry.h                |   64 ++++---
- include/hkl/geometry_kappa.h          |    2 +-
- include/hkl/holder.h                  |   39 ++++-
- include/hkl/holderlist.h              |   88 ++++++++-
- src/HKLException.cpp                  |    2 +-
- src/SConscript                        |   24 +-
- src/axe.cpp                           |  124 +++++++-----
- src/axe_rotation.cpp                  |    2 +
- src/geometry.cpp                      |  116 ++---------
- src/geometry_kappa.cpp                |    6 +-
- src/holder.cpp                        |  125 ++++++++++--
- src/holderlist.cpp                    |   70 ++++++-
- src/reflection.cpp                    |   12 +-
- src/sample.cpp                        |    6 +-
- src/twoC_vertical_geometry.cpp        |   38 ++--
- test/SConscript                       |    3 +-
- test/geometry_test.cpp                |    4 +-
- test/holder_test.cpp                  |  100 +++++++++
- test/holder_test.h                    |   35 ++++
+ bouml/hkl/128002                      |  13 +-
+ bouml/hkl/128770                      |   2 +-
+ bouml/hkl/130050.bodies               |   3 +
+ bouml/hkl/131714.bodies               |  95 ++-------
+ bouml/hkl/132354                      |   6 +-
+ bouml/hkl/132482.bodies               |  34 ++--
+ bouml/hkl/132738.diagram              |  38 ++--
+ bouml/hkl/133122.bodies               |  12 +-
+ bouml/hkl/133378.bodies               |   6 +-
+ bouml/hkl/134146                      |   2 +-
+ bouml/hkl/137090.bodies               |  12 +-
+ bouml/hkl/145026.bodies               |  70 +++----
+ bouml/hkl/145410.bodies               |  20 +-
+ bouml/hkl/148482.bodies               |  72 +++++--
+ bouml/hkl/149762.bodies               |  32 ++-
+ bouml/hkl/2.session                   |   8 +-
+ bouml/hkl/hkl.prj                     | 358 ++++++++++++++++++++++++----------
+ include/hkl/axe.h                     |  13 +-
+ include/hkl/derived_pseudoaxeengine.h |  82 ++++----
+ include/hkl/geometry.h                |  64 +++---
+ include/hkl/geometry_kappa.h          |   2 +-
+ include/hkl/holder.h                  |  39 +++-
+ include/hkl/holderlist.h              |  88 ++++++++-
+ src/HKLException.cpp                  |   2 +-
+ src/SConscript                        |  24 +--
+ src/axe.cpp                           | 124 +++++++-----
+ src/axe_rotation.cpp                  |   2 +
+ src/geometry.cpp                      | 116 ++---------
+ src/geometry_kappa.cpp                |   6 +-
+ src/holder.cpp                        | 125 +++++++++---
+ src/holderlist.cpp                    |  70 ++++++-
+ src/reflection.cpp                    |  12 +-
+ src/sample.cpp                        |   6 +-
+ src/twoC_vertical_geometry.cpp        |  38 ++--
+ test/SConscript                       |   3 +-
+ test/geometry_test.cpp                |   4 +-
+ test/holder_test.cpp                  | 100 ++++++++++
+ test/holder_test.h                    |  35 ++++
  38 files changed, 1117 insertions(+), 621 deletions(-)
 
 commit f773c89502eda9d614357202334ab18dc4da56d1
@@ -10263,74 +20024,74 @@ Date:   Sun Aug 12 23:43:17 2007 +0200
 
     * add all the .h autogenerated files
 
- include/hkl/HKLException.h                        |   74 +++
- include/hkl/HolderList.h                          |   29 +
- include/hkl/affinement.h                          |  106 ++++
- include/hkl/affinement_simplex.h                  |   42 ++
- include/hkl/affinementlist.h                      |  160 ++++++
- include/hkl/axe.h                                 |  268 ++++++++++
- include/hkl/axe_rotation.h                        |  126 +++++
- include/hkl/constant.h                            |   34 ++
- include/hkl/convenience.h                         |   37 ++
- include/hkl/derived_mode.h                        |   93 ++++
- include/hkl/derived_pseudoaxeengine.h             |  581 +++++++++++++++++++++
- include/hkl/diffractometer.h                      |  324 ++++++++++++
- include/hkl/diffractometerfactory.h               |   43 ++
- include/hkl/eulerian4C_vertical_diffractometer.h  |   29 +
- include/hkl/eulerian4C_vertical_geometry.h        |  149 ++++++
- include/hkl/eulerian4C_vertical_mode.h            |  131 +++++
- include/hkl/eulerian4C_vertical_pseudoaxeengine.h |  164 ++++++
- include/hkl/eulerian6C_diffractometer.h           |   57 ++
- include/hkl/eulerian6C_geometry.h                 |  177 +++++++
- include/hkl/eulerian6C_mode.h                     |   26 +
- include/hkl/eulerian6C_pseudoaxeengine.h          |  256 +++++++++
- include/hkl/fitparameter.h                        |  131 +++++
- include/hkl/fitparameterlist.h                    |  147 ++++++
- include/hkl/geometry.h                            |  210 ++++++++
- include/hkl/geometry_kappa.h                      |   59 +++
- include/hkl/hklobject.h                           |   75 +++
- include/hkl/holder.h                              |   66 +++
- include/hkl/holderlist.h                          |   32 ++
- include/hkl/kappa4C_vertical_diffractometer.h     |   29 +
- include/hkl/kappa4C_vertical_geometry.h           |  149 ++++++
- include/hkl/kappa4C_vertical_mode.h               |   30 ++
- include/hkl/kappa4C_vertical_pseudoaxeengine.h    |  163 ++++++
- include/hkl/kappa6C_diffractometer.h              |   25 +
- include/hkl/kappa6C_geometry.h                    |  177 +++++++
- include/hkl/kappa6C_mode.h                        |   26 +
- include/hkl/kappa6C_pseudoaxeengine.h             |   27 +
- include/hkl/lattice.h                             |  239 +++++++++
- include/hkl/mode.h                                |  199 +++++++
- include/hkl/modelist.h                            |  160 ++++++
- include/hkl/mymap.h                               |  307 +++++++++++
- include/hkl/mystring.h                            |   55 ++
- include/hkl/object.h                              |  169 ++++++
- include/hkl/observer.h                            |   66 +++
- include/hkl/parameter.h                           |   72 +++
- include/hkl/parameterlist.h                       |  116 ++++
- include/hkl/portability.h                         |    5 +
- include/hkl/pseudoaxe.h                           |  151 ++++++
- include/hkl/pseudoaxeengine.h                     |  381 ++++++++++++++
- include/hkl/pseudoaxeenginelist.h                 |   67 +++
- include/hkl/pseudoaxelist.h                       |   80 +++
- include/hkl/quaternion.h                          |  203 +++++++
- include/hkl/range.h                               |  315 +++++++++++
- include/hkl/reflection.h                          |  187 +++++++
- include/hkl/reflection_monocrystal.h              |   59 +++
- include/hkl/reflectionfactory.h                   |   39 ++
- include/hkl/reflectionlist.h                      |  156 ++++++
- include/hkl/sample.h                              |  133 +++++
- include/hkl/sample_monocrystal.h                  |  134 +++++
- include/hkl/samplefactory.h                       |   42 ++
- include/hkl/samplelist.h                          |  183 +++++++
- include/hkl/source.h                              |  135 +++++
- include/hkl/svector.h                             |  185 +++++++
- include/hkl/twoC_vertical_diffractometer.h        |   33 ++
- include/hkl/twoC_vertical_geometry.h              |  117 +++++
- include/hkl/twoC_vertical_mode.h                  |   63 +++
- include/hkl/twoC_vertical_pseudoaxeengine.h       |  190 +++++++
- include/hkl/value.h                               |  138 +++++
- 67 files changed, 8631 insertions(+), 0 deletions(-)
+ include/hkl/HKLException.h                        |  74 +++
+ include/hkl/HolderList.h                          |  29 ++
+ include/hkl/affinement.h                          | 106 ++++
+ include/hkl/affinement_simplex.h                  |  42 ++
+ include/hkl/affinementlist.h                      | 160 ++++++
+ include/hkl/axe.h                                 | 268 ++++++++++
+ include/hkl/axe_rotation.h                        | 126 +++++
+ include/hkl/constant.h                            |  34 ++
+ include/hkl/convenience.h                         |  37 ++
+ include/hkl/derived_mode.h                        |  93 ++++
+ include/hkl/derived_pseudoaxeengine.h             | 581 ++++++++++++++++++++++
+ include/hkl/diffractometer.h                      | 324 ++++++++++++
+ include/hkl/diffractometerfactory.h               |  43 ++
+ include/hkl/eulerian4C_vertical_diffractometer.h  |  29 ++
+ include/hkl/eulerian4C_vertical_geometry.h        | 149 ++++++
+ include/hkl/eulerian4C_vertical_mode.h            | 131 +++++
+ include/hkl/eulerian4C_vertical_pseudoaxeengine.h | 164 ++++++
+ include/hkl/eulerian6C_diffractometer.h           |  57 +++
+ include/hkl/eulerian6C_geometry.h                 | 177 +++++++
+ include/hkl/eulerian6C_mode.h                     |  26 +
+ include/hkl/eulerian6C_pseudoaxeengine.h          | 256 ++++++++++
+ include/hkl/fitparameter.h                        | 131 +++++
+ include/hkl/fitparameterlist.h                    | 147 ++++++
+ include/hkl/geometry.h                            | 210 ++++++++
+ include/hkl/geometry_kappa.h                      |  59 +++
+ include/hkl/hklobject.h                           |  75 +++
+ include/hkl/holder.h                              |  66 +++
+ include/hkl/holderlist.h                          |  32 ++
+ include/hkl/kappa4C_vertical_diffractometer.h     |  29 ++
+ include/hkl/kappa4C_vertical_geometry.h           | 149 ++++++
+ include/hkl/kappa4C_vertical_mode.h               |  30 ++
+ include/hkl/kappa4C_vertical_pseudoaxeengine.h    | 163 ++++++
+ include/hkl/kappa6C_diffractometer.h              |  25 +
+ include/hkl/kappa6C_geometry.h                    | 177 +++++++
+ include/hkl/kappa6C_mode.h                        |  26 +
+ include/hkl/kappa6C_pseudoaxeengine.h             |  27 +
+ include/hkl/lattice.h                             | 239 +++++++++
+ include/hkl/mode.h                                | 199 ++++++++
+ include/hkl/modelist.h                            | 160 ++++++
+ include/hkl/mymap.h                               | 307 ++++++++++++
+ include/hkl/mystring.h                            |  55 ++
+ include/hkl/object.h                              | 169 +++++++
+ include/hkl/observer.h                            |  66 +++
+ include/hkl/parameter.h                           |  72 +++
+ include/hkl/parameterlist.h                       | 116 +++++
+ include/hkl/portability.h                         |   5 +
+ include/hkl/pseudoaxe.h                           | 151 ++++++
+ include/hkl/pseudoaxeengine.h                     | 381 ++++++++++++++
+ include/hkl/pseudoaxeenginelist.h                 |  67 +++
+ include/hkl/pseudoaxelist.h                       |  80 +++
+ include/hkl/quaternion.h                          | 203 ++++++++
+ include/hkl/range.h                               | 315 ++++++++++++
+ include/hkl/reflection.h                          | 187 +++++++
+ include/hkl/reflection_monocrystal.h              |  59 +++
+ include/hkl/reflectionfactory.h                   |  39 ++
+ include/hkl/reflectionlist.h                      | 156 ++++++
+ include/hkl/sample.h                              | 133 +++++
+ include/hkl/sample_monocrystal.h                  | 134 +++++
+ include/hkl/samplefactory.h                       |  42 ++
+ include/hkl/samplelist.h                          | 183 +++++++
+ include/hkl/source.h                              | 135 +++++
+ include/hkl/svector.h                             | 185 +++++++
+ include/hkl/twoC_vertical_diffractometer.h        |  33 ++
+ include/hkl/twoC_vertical_geometry.h              | 117 +++++
+ include/hkl/twoC_vertical_mode.h                  |  63 +++
+ include/hkl/twoC_vertical_pseudoaxeengine.h       | 190 +++++++
+ include/hkl/value.h                               | 138 +++++
+ 67 files changed, 8631 insertions(+)
 
 commit dab80e547f3adaf24cc146727b7dc0e21cde499d
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -10338,162 +20099,162 @@ Date:   Sun Aug 12 23:41:36 2007 +0200
 
     * redo the refoactoring work and add the autogenerates files.
 
- bouml/hkl/128002                            |    2 +-
- bouml/hkl/128002.bodies                     |  298 ++++++------
- bouml/hkl/128060.bodies                     |   78 ++--
- bouml/hkl/128182.bodies                     |   50 +-
- bouml/hkl/128310.bodies                     |   16 +-
- bouml/hkl/128514                            |   12 +-
- bouml/hkl/128514.bodies                     |  356 +++++++-------
- bouml/hkl/128642                            |   12 +-
- bouml/hkl/128770                            |   14 +-
- bouml/hkl/128770.bodies                     |  270 ++++++------
- bouml/hkl/128898.bodies                     |   26 +-
- bouml/hkl/129154.bodies                     |   78 ++--
- bouml/hkl/129282.bodies                     |    4 +-
- bouml/hkl/129410.bodies                     |    4 +-
- bouml/hkl/129538.bodies                     |    4 +-
- bouml/hkl/129666.bodies                     |   42 +-
- bouml/hkl/129794.bodies                     |  222 +++++-----
- bouml/hkl/129922                            |   14 +-
- bouml/hkl/129922.bodies                     |   22 +-
- bouml/hkl/130050.bodies                     |   80 ++--
- bouml/hkl/130178.bodies                     |   76 ++--
- bouml/hkl/130306.bodies                     |  272 ++++++------
- bouml/hkl/131074                            |   14 +-
- bouml/hkl/131074.bodies                     |  146 +++---
- bouml/hkl/131202.bodies                     |   30 +-
- bouml/hkl/131330.bodies                     |  132 +++---
- bouml/hkl/131458.bodies                     |  140 +++---
- bouml/hkl/131458.diagram                    |   16 +-
- bouml/hkl/131586.bodies                     |  630 +++++++++++++-------------
- bouml/hkl/131714.bodies                     |  445 +++++++-----------
- bouml/hkl/131842                            |    2 +-
- bouml/hkl/131842.bodies                     |  206 ++++----
- bouml/hkl/131970                            |   14 +-
- bouml/hkl/132098                            |    2 +-
- bouml/hkl/132354                            |    2 +-
- bouml/hkl/132482                            |   14 +-
- bouml/hkl/132482.bodies                     |  155 +++----
- bouml/hkl/132610                            |   16 +-
- bouml/hkl/132610.bodies                     |  270 ++++++------
- bouml/hkl/132738.bodies                     |   20 +-
- bouml/hkl/132738.diagram                    |   12 +
- bouml/hkl/132866.bodies                     |  192 ++++----
- bouml/hkl/132994                            |   14 +-
- bouml/hkl/132994.bodies                     |  230 +++++-----
- bouml/hkl/133122                            |    2 +-
- bouml/hkl/133122.bodies                     |   78 ++--
- bouml/hkl/133250                            |    2 +-
- bouml/hkl/133378                            |    2 +-
- bouml/hkl/133378.bodies                     |  210 +++++-----
- bouml/hkl/133506.bodies                     |   22 +-
- bouml/hkl/133634                            |    2 +-
- bouml/hkl/133634.bodies                     |  332 +++++++-------
- bouml/hkl/133890.bodies                     |    6 +-
- bouml/hkl/134146                            |    2 +-
- bouml/hkl/134146.bodies                     |  302 ++++++------
- bouml/hkl/134274.bodies                     |   30 +-
- bouml/hkl/134402.bodies                     |  332 +++++++-------
- bouml/hkl/134786.bodies                     |  104 ++--
- bouml/hkl/135042.bodies                     |   96 ++--
- bouml/hkl/135170.bodies                     |   42 +-
- bouml/hkl/135426.bodies                     |  126 +++---
- bouml/hkl/136194.bodies                     |  178 ++++----
- bouml/hkl/136322.bodies                     |  168 ++++----
- bouml/hkl/136450.bodies                     |  116 +++---
- bouml/hkl/136578.bodies                     |  486 ++++++++++----------
- bouml/hkl/136706.bodies                     |  262 ++++++------
- bouml/hkl/136834.bodies                     |  448 +++++++++---------
- bouml/hkl/136962.bodies                     |  220 +++++-----
- bouml/hkl/137090.bodies                     |  134 +++---
- bouml/hkl/138882.bodies                     |   58 ++--
- bouml/hkl/139138.bodies                     |  238 +++++-----
- bouml/hkl/139522.bodies                     |   58 ++--
- bouml/hkl/139650.bodies                     |   68 ++--
- bouml/hkl/139778.bodies                     |   64 ++--
- bouml/hkl/139906.bodies                     |   66 ++--
- bouml/hkl/140034.bodies                     |   64 ++--
- bouml/hkl/140162.bodies                     |   18 +-
- bouml/hkl/140290.bodies                     |   16 +-
- bouml/hkl/140418.bodies                     |   12 +-
- bouml/hkl/142466.bodies                     |   42 +-
- bouml/hkl/142594.bodies                     |  496 ++++++++++----------
- bouml/hkl/142978.bodies                     |  236 +++++-----
- bouml/hkl/143362.bodies                     |   70 ++--
- bouml/hkl/143490.bodies                     |    6 +-
- bouml/hkl/143618.bodies                     |   24 +-
- bouml/hkl/143746.bodies                     |   32 +-
- bouml/hkl/143874.bodies                     |   34 +-
- bouml/hkl/144130.bodies                     |   26 +-
- bouml/hkl/144258.bodies                     |   34 +-
- bouml/hkl/144386.bodies                     |   46 +-
- bouml/hkl/145026.bodies                     |  134 +++---
- bouml/hkl/145282.bodies                     |   39 +-
- bouml/hkl/145410.bodies                     |  296 +++++-------
- bouml/hkl/148482.bodies                     |  113 +++--
- bouml/hkl/149762.bodies                     |   20 +
- bouml/hkl/2.session                         |   14 +-
- bouml/hkl/hkl.prj                           |  109 ++++-
- src/HKLException.cpp                        |  161 +++++++
- src/SConscript                              |    1 +
- src/affinement.cpp                          |  102 ++++
- src/affinement_simplex.cpp                  |  330 +++++++++++++
- src/affinementlist.cpp                      |  324 +++++++++++++
- src/axe.cpp                                 |  440 +++++++++++++++++
- src/axe_rotation.cpp                        |  162 +++++++
- src/constant.cpp                            |   21 +
- src/convenience.cpp                         |   51 ++
- src/diffractometer.cpp                      |  100 ++++
- src/diffractometerfactory.cpp               |   59 +++
- src/eulerian4C_vertical_diffractometer.cpp  |   47 ++
- src/eulerian4C_vertical_geometry.cpp        |  303 ++++++++++++
- src/eulerian4C_vertical_mode.cpp            |  317 +++++++++++++
- src/eulerian4C_vertical_pseudoaxeengine.cpp |  355 ++++++++++++++
- src/eulerian6C_diffractometer.cpp           |   37 ++
- src/eulerian6C_geometry.cpp                 |  336 +++++++++++++
- src/eulerian6C_pseudoaxeengine.cpp          |  515 ++++++++++++++++++++
- src/fitparameter.cpp                        |  177 +++++++
- src/fitparameterlist.cpp                    |  195 ++++++++
- src/geometry.cpp                            |  391 ++++++++++++++++
- src/geometry_kappa.cpp                      |   69 +++
- src/hklobject.cpp                           |   86 ++++
- src/holder.cpp                              |  139 ++++++
- src/holderlist.cpp                          |   47 ++
- src/kappa4C_vertical_diffractometer.cpp     |   48 ++
- src/kappa4C_vertical_geometry.cpp           |  336 +++++++++++++
- src/kappa4C_vertical_pseudoaxeengine.cpp    |  226 +++++++++
- src/kappa6C_diffractometer.cpp              |   43 ++
- src/kappa6C_geometry.cpp                    |  355 ++++++++++++++
- src/lattice.cpp                             |  600 ++++++++++++++++++++++++
- src/mode.cpp                                |   26 +
- src/modelist.cpp                            |  326 +++++++++++++
- src/mystring.cpp                            |   83 ++++
- src/object.cpp                              |  257 ++++++++++
- src/observer.cpp                            |  108 +++++
- src/parameter.cpp                           |   79 ++++
- src/parameterlist.cpp                       |  204 ++++++++
- src/pseudoaxe.cpp                           |  245 ++++++++++
- src/pseudoaxeengine.cpp                     |   23 +
- src/pseudoaxeenginelist.cpp                 |  134 ++++++
- src/pseudoaxelist.cpp                       |  139 ++++++
- src/quaternion.cpp                          |  431 +++++++++++++++++
- src/range.cpp                               |  306 ++++++++++++
- src/reflection.cpp                          |  178 +++++++
- src/reflection_monocrystal.cpp              |   61 +++
- src/reflectionfactory.cpp                   |   45 ++
- src/reflectionlist.cpp                      |  353 ++++++++++++++
- src/sample.cpp                              |  213 +++++++++
- src/sample_monocrystal.cpp                  |  319 +++++++++++++
- src/samplefactory.cpp                       |   53 +++
- src/samplelist.cpp                          |  405 ++++++++++++++++
- src/source.cpp                              |  196 ++++++++
- src/svector.cpp                             |  677 +++++++++++++++++++++++++++
- src/twoC_vertical_diffractometer.cpp        |   44 ++
- src/twoC_vertical_geometry.cpp              |  232 +++++++++
- src/twoC_vertical_mode.cpp                  |   92 ++++
- src/twoC_vertical_pseudoaxeengine.cpp       |  468 ++++++++++++++++++
- src/value.cpp                               |  191 ++++++++
+ bouml/hkl/128002                            |   2 +-
+ bouml/hkl/128002.bodies                     | 298 ++++++------
+ bouml/hkl/128060.bodies                     |  78 ++--
+ bouml/hkl/128182.bodies                     |  50 +-
+ bouml/hkl/128310.bodies                     |  16 +-
+ bouml/hkl/128514                            |  12 +-
+ bouml/hkl/128514.bodies                     | 356 +++++++--------
+ bouml/hkl/128642                            |  12 +-
+ bouml/hkl/128770                            |  14 +-
+ bouml/hkl/128770.bodies                     | 270 +++++------
+ bouml/hkl/128898.bodies                     |  26 +-
+ bouml/hkl/129154.bodies                     |  78 ++--
+ bouml/hkl/129282.bodies                     |   4 +-
+ bouml/hkl/129410.bodies                     |   4 +-
+ bouml/hkl/129538.bodies                     |   4 +-
+ bouml/hkl/129666.bodies                     |  42 +-
+ bouml/hkl/129794.bodies                     | 222 ++++-----
+ bouml/hkl/129922                            |  14 +-
+ bouml/hkl/129922.bodies                     |  22 +-
+ bouml/hkl/130050.bodies                     |  80 ++--
+ bouml/hkl/130178.bodies                     |  76 ++--
+ bouml/hkl/130306.bodies                     | 272 +++++------
+ bouml/hkl/131074                            |  14 +-
+ bouml/hkl/131074.bodies                     | 146 +++---
+ bouml/hkl/131202.bodies                     |  30 +-
+ bouml/hkl/131330.bodies                     | 132 +++---
+ bouml/hkl/131458.bodies                     | 140 +++---
+ bouml/hkl/131458.diagram                    |  16 +-
+ bouml/hkl/131586.bodies                     | 630 +++++++++++++-------------
+ bouml/hkl/131714.bodies                     | 445 ++++++++----------
+ bouml/hkl/131842                            |   2 +-
+ bouml/hkl/131842.bodies                     | 206 ++++-----
+ bouml/hkl/131970                            |  14 +-
+ bouml/hkl/132098                            |   2 +-
+ bouml/hkl/132354                            |   2 +-
+ bouml/hkl/132482                            |  14 +-
+ bouml/hkl/132482.bodies                     | 155 ++++---
+ bouml/hkl/132610                            |  16 +-
+ bouml/hkl/132610.bodies                     | 270 +++++------
+ bouml/hkl/132738.bodies                     |  20 +-
+ bouml/hkl/132738.diagram                    |  12 +
+ bouml/hkl/132866.bodies                     | 192 ++++----
+ bouml/hkl/132994                            |  14 +-
+ bouml/hkl/132994.bodies                     | 230 +++++-----
+ bouml/hkl/133122                            |   2 +-
+ bouml/hkl/133122.bodies                     |  78 ++--
+ bouml/hkl/133250                            |   2 +-
+ bouml/hkl/133378                            |   2 +-
+ bouml/hkl/133378.bodies                     | 210 ++++-----
+ bouml/hkl/133506.bodies                     |  22 +-
+ bouml/hkl/133634                            |   2 +-
+ bouml/hkl/133634.bodies                     | 332 +++++++-------
+ bouml/hkl/133890.bodies                     |   6 +-
+ bouml/hkl/134146                            |   2 +-
+ bouml/hkl/134146.bodies                     | 302 ++++++-------
+ bouml/hkl/134274.bodies                     |  30 +-
+ bouml/hkl/134402.bodies                     | 332 +++++++-------
+ bouml/hkl/134786.bodies                     | 104 ++---
+ bouml/hkl/135042.bodies                     |  96 ++--
+ bouml/hkl/135170.bodies                     |  42 +-
+ bouml/hkl/135426.bodies                     | 126 +++---
+ bouml/hkl/136194.bodies                     | 178 ++++----
+ bouml/hkl/136322.bodies                     | 168 +++----
+ bouml/hkl/136450.bodies                     | 116 ++---
+ bouml/hkl/136578.bodies                     | 486 ++++++++++----------
+ bouml/hkl/136706.bodies                     | 262 +++++------
+ bouml/hkl/136834.bodies                     | 448 +++++++++---------
+ bouml/hkl/136962.bodies                     | 220 ++++-----
+ bouml/hkl/137090.bodies                     | 134 +++---
+ bouml/hkl/138882.bodies                     |  58 +--
+ bouml/hkl/139138.bodies                     | 238 +++++-----
+ bouml/hkl/139522.bodies                     |  58 +--
+ bouml/hkl/139650.bodies                     |  68 +--
+ bouml/hkl/139778.bodies                     |  64 +--
+ bouml/hkl/139906.bodies                     |  66 +--
+ bouml/hkl/140034.bodies                     |  64 +--
+ bouml/hkl/140162.bodies                     |  18 +-
+ bouml/hkl/140290.bodies                     |  16 +-
+ bouml/hkl/140418.bodies                     |  12 +-
+ bouml/hkl/142466.bodies                     |  42 +-
+ bouml/hkl/142594.bodies                     | 496 ++++++++++----------
+ bouml/hkl/142978.bodies                     | 236 +++++-----
+ bouml/hkl/143362.bodies                     |  70 +--
+ bouml/hkl/143490.bodies                     |   6 +-
+ bouml/hkl/143618.bodies                     |  24 +-
+ bouml/hkl/143746.bodies                     |  32 +-
+ bouml/hkl/143874.bodies                     |  34 +-
+ bouml/hkl/144130.bodies                     |  26 +-
+ bouml/hkl/144258.bodies                     |  34 +-
+ bouml/hkl/144386.bodies                     |  46 +-
+ bouml/hkl/145026.bodies                     | 134 +++---
+ bouml/hkl/145282.bodies                     |  39 +-
+ bouml/hkl/145410.bodies                     | 296 ++++++------
+ bouml/hkl/148482.bodies                     | 113 +++--
+ bouml/hkl/149762.bodies                     |  20 +
+ bouml/hkl/2.session                         |  14 +-
+ bouml/hkl/hkl.prj                           | 109 ++++-
+ src/HKLException.cpp                        | 161 +++++++
+ src/SConscript                              |   1 +
+ src/affinement.cpp                          | 102 +++++
+ src/affinement_simplex.cpp                  | 330 ++++++++++++++
+ src/affinementlist.cpp                      | 324 +++++++++++++
+ src/axe.cpp                                 | 440 ++++++++++++++++++
+ src/axe_rotation.cpp                        | 162 +++++++
+ src/constant.cpp                            |  21 +
+ src/convenience.cpp                         |  51 +++
+ src/diffractometer.cpp                      | 100 ++++
+ src/diffractometerfactory.cpp               |  59 +++
+ src/eulerian4C_vertical_diffractometer.cpp  |  47 ++
+ src/eulerian4C_vertical_geometry.cpp        | 303 +++++++++++++
+ src/eulerian4C_vertical_mode.cpp            | 317 +++++++++++++
+ src/eulerian4C_vertical_pseudoaxeengine.cpp | 355 +++++++++++++++
+ src/eulerian6C_diffractometer.cpp           |  37 ++
+ src/eulerian6C_geometry.cpp                 | 336 ++++++++++++++
+ src/eulerian6C_pseudoaxeengine.cpp          | 515 +++++++++++++++++++++
+ src/fitparameter.cpp                        | 177 ++++++++
+ src/fitparameterlist.cpp                    | 195 ++++++++
+ src/geometry.cpp                            | 391 ++++++++++++++++
+ src/geometry_kappa.cpp                      |  69 +++
+ src/hklobject.cpp                           |  86 ++++
+ src/holder.cpp                              | 139 ++++++
+ src/holderlist.cpp                          |  47 ++
+ src/kappa4C_vertical_diffractometer.cpp     |  48 ++
+ src/kappa4C_vertical_geometry.cpp           | 336 ++++++++++++++
+ src/kappa4C_vertical_pseudoaxeengine.cpp    | 226 ++++++++++
+ src/kappa6C_diffractometer.cpp              |  43 ++
+ src/kappa6C_geometry.cpp                    | 355 +++++++++++++++
+ src/lattice.cpp                             | 600 ++++++++++++++++++++++++
+ src/mode.cpp                                |  26 ++
+ src/modelist.cpp                            | 326 ++++++++++++++
+ src/mystring.cpp                            |  83 ++++
+ src/object.cpp                              | 257 +++++++++++
+ src/observer.cpp                            | 108 +++++
+ src/parameter.cpp                           |  79 ++++
+ src/parameterlist.cpp                       | 204 +++++++++
+ src/pseudoaxe.cpp                           | 245 ++++++++++
+ src/pseudoaxeengine.cpp                     |  23 +
+ src/pseudoaxeenginelist.cpp                 | 134 ++++++
+ src/pseudoaxelist.cpp                       | 139 ++++++
+ src/quaternion.cpp                          | 431 ++++++++++++++++++
+ src/range.cpp                               | 306 +++++++++++++
+ src/reflection.cpp                          | 178 ++++++++
+ src/reflection_monocrystal.cpp              |  61 +++
+ src/reflectionfactory.cpp                   |  45 ++
+ src/reflectionlist.cpp                      | 353 +++++++++++++++
+ src/sample.cpp                              | 213 +++++++++
+ src/sample_monocrystal.cpp                  | 319 +++++++++++++
+ src/samplefactory.cpp                       |  53 +++
+ src/samplelist.cpp                          | 405 +++++++++++++++++
+ src/source.cpp                              | 196 ++++++++
+ src/svector.cpp                             | 677 ++++++++++++++++++++++++++++
+ src/twoC_vertical_diffractometer.cpp        |  44 ++
+ src/twoC_vertical_geometry.cpp              | 232 ++++++++++
+ src/twoC_vertical_mode.cpp                  |  92 ++++
+ src/twoC_vertical_pseudoaxeengine.cpp       | 468 +++++++++++++++++++
+ src/value.cpp                               | 191 ++++++++
  156 files changed, 17675 insertions(+), 5375 deletions(-)
 
 commit d3f99bbaec09cac0adea16d6aab2588607e6e0bd
@@ -10504,69 +20265,69 @@ Date:   Fri Aug 10 18:06:03 2007 +0200
     
     not yet ok but it compiles.
 
- SConstruct                              |    3 +-
- bouml/hkl/128002                        |   23 +-
- bouml/hkl/128002.diagram                |   48 ++-
- bouml/hkl/128130.diagram                |   33 +-
- bouml/hkl/128188.diagram                |  126 ++---
- bouml/hkl/128386.diagram                |   58 ++-
- bouml/hkl/129154.diagram                |   21 +-
- bouml/hkl/129794.bodies                 |   17 -
- bouml/hkl/130050.bodies                 |   43 +-
- bouml/hkl/130050.diagram                |   63 ++-
- bouml/hkl/130946.diagram                |   64 ++-
- bouml/hkl/131074.diagram                |   49 ++-
- bouml/hkl/131458.diagram                |   62 +--
- bouml/hkl/131714.bodies                 |   36 +-
- bouml/hkl/131842                        |  147 +++---
- bouml/hkl/131842.bodies                 |   55 ++-
- bouml/hkl/132098                        |   14 +-
- bouml/hkl/132354                        |   26 +-
- bouml/hkl/132482.bodies                 |   28 +-
- bouml/hkl/132610                        |    6 +-
- bouml/hkl/132610.bodies                 |    9 -
- bouml/hkl/132738.diagram                |   31 +
- bouml/hkl/132866.bodies                 |    9 -
- bouml/hkl/132994.bodies                 |    9 -
- bouml/hkl/133122                        |   37 +-
- bouml/hkl/133250                        |   45 +-
- bouml/hkl/133378                        |   22 +-
- bouml/hkl/133634                        |   45 +-
- bouml/hkl/134018                        |   40 +-
- bouml/hkl/134146                        |  151 +++---
- bouml/hkl/145282.bodies                 |   14 +-
- bouml/hkl/145410.bodies                 |   75 +++-
- bouml/hkl/148482.bodies                 |   43 ++
- bouml/hkl/2.session                     |   17 +-
- bouml/hkl/cpp_includes                  |    6 +-
- bouml/hkl/generation_settings           |    8 +-
- bouml/hkl/hkl.prj                       |  902 ++++++++++++++++++++-----------
- config-linux2.py                        |    1 -
- src/SConscript                          |    1 +
- test/SConscript                         |   12 +-
- test/affinement_simplex_test.cpp        |   40 +-
- test/axe_rotation_test.cpp              |   91 +++
- test/axe_rotation_test.h                |   33 ++
- test/axe_test.cpp                       |   95 ++--
- test/axe_test.h                         |   10 +-
- test/diffractometer_eulerian4C_test.cpp |  246 +++++-----
- test/diffractometer_eulerian4C_test.h   |    3 -
- test/diffractometer_kappa4C_test.cpp    |   40 +-
- test/diffractometer_kappa6C_test.cpp    |   60 +-
- test/diffractometer_twoC_test.cpp       |   20 +-
- test/geometry_eulerian4C_test.cpp       |  116 ++---
- test/geometry_eulerian4C_test.h         |    8 +-
- test/geometry_eulerian6C_test.cpp       |   82 ++--
- test/geometry_eulerian6C_test.h         |    6 +-
- test/geometry_kappa4C_test.cpp          |   72 +--
- test/geometry_kappa4C_test.h            |    6 +-
- test/geometry_kappa6C_test.cpp          |   64 +--
- test/geometry_kappa6C_test.h            |    6 +-
- test/geometry_test.cpp                  |   54 ++-
- test/geometry_test.h                    |    2 -
- test/geometry_twoC_test.cpp             |   47 +-
- test/geometry_twoC_test.h               |    6 +-
- test/pseudoaxe_twoC_test.cpp            |   24 +-
+ SConstruct                              |   3 +-
+ bouml/hkl/128002                        |  23 +-
+ bouml/hkl/128002.diagram                |  48 +-
+ bouml/hkl/128130.diagram                |  33 +-
+ bouml/hkl/128188.diagram                | 126 +++--
+ bouml/hkl/128386.diagram                |  58 +-
+ bouml/hkl/129154.diagram                |  21 +-
+ bouml/hkl/129794.bodies                 |  17 -
+ bouml/hkl/130050.bodies                 |  43 +-
+ bouml/hkl/130050.diagram                |  63 ++-
+ bouml/hkl/130946.diagram                |  64 ++-
+ bouml/hkl/131074.diagram                |  49 +-
+ bouml/hkl/131458.diagram                |  62 +--
+ bouml/hkl/131714.bodies                 |  36 +-
+ bouml/hkl/131842                        | 147 +++---
+ bouml/hkl/131842.bodies                 |  55 +-
+ bouml/hkl/132098                        |  14 +-
+ bouml/hkl/132354                        |  26 +-
+ bouml/hkl/132482.bodies                 |  28 +-
+ bouml/hkl/132610                        |   6 +-
+ bouml/hkl/132610.bodies                 |   9 -
+ bouml/hkl/132738.diagram                |  31 ++
+ bouml/hkl/132866.bodies                 |   9 -
+ bouml/hkl/132994.bodies                 |   9 -
+ bouml/hkl/133122                        |  37 +-
+ bouml/hkl/133250                        |  45 +-
+ bouml/hkl/133378                        |  22 +-
+ bouml/hkl/133634                        |  45 +-
+ bouml/hkl/134018                        |  40 +-
+ bouml/hkl/134146                        | 151 +++---
+ bouml/hkl/145282.bodies                 |  14 +-
+ bouml/hkl/145410.bodies                 |  75 ++-
+ bouml/hkl/148482.bodies                 |  43 ++
+ bouml/hkl/2.session                     |  17 +-
+ bouml/hkl/cpp_includes                  |   6 +-
+ bouml/hkl/generation_settings           |   8 +-
+ bouml/hkl/hkl.prj                       | 902 ++++++++++++++++++++------------
+ config-linux2.py                        |   1 -
+ src/SConscript                          |   1 +
+ test/SConscript                         |  12 +-
+ test/affinement_simplex_test.cpp        |  40 +-
+ test/axe_rotation_test.cpp              |  91 ++++
+ test/axe_rotation_test.h                |  33 ++
+ test/axe_test.cpp                       |  95 ++--
+ test/axe_test.h                         |  10 +-
+ test/diffractometer_eulerian4C_test.cpp | 246 ++++-----
+ test/diffractometer_eulerian4C_test.h   |   3 -
+ test/diffractometer_kappa4C_test.cpp    |  40 +-
+ test/diffractometer_kappa6C_test.cpp    |  60 +--
+ test/diffractometer_twoC_test.cpp       |  20 +-
+ test/geometry_eulerian4C_test.cpp       | 116 ++--
+ test/geometry_eulerian4C_test.h         |   8 +-
+ test/geometry_eulerian6C_test.cpp       |  82 ++-
+ test/geometry_eulerian6C_test.h         |   6 +-
+ test/geometry_kappa4C_test.cpp          |  72 ++-
+ test/geometry_kappa4C_test.h            |   6 +-
+ test/geometry_kappa6C_test.cpp          |  64 +--
+ test/geometry_kappa6C_test.h            |   6 +-
+ test/geometry_test.cpp                  |  54 +-
+ test/geometry_test.h                    |   2 -
+ test/geometry_twoC_test.cpp             |  47 +-
+ test/geometry_twoC_test.h               |   6 +-
+ test/pseudoaxe_twoC_test.cpp            |  24 +-
  63 files changed, 2002 insertions(+), 1528 deletions(-)
 
 commit 34cce5bc1f4447713517e1a750f391f0e6ff9cac
@@ -10575,104 +20336,104 @@ Date:   Fri Jun 8 17:59:06 2007 +0200
 
     * start refactoring the Geometry (do not compile)
 
- bouml/hkl/128002              |    2 +-
- bouml/hkl/128002.bodies       |  294 +++++++++---------
- bouml/hkl/128002.diagram      |   70 ++---
- bouml/hkl/128060.bodies       |   78 +++---
- bouml/hkl/128182.bodies       |   52 ++--
- bouml/hkl/128310.bodies       |   18 +-
- bouml/hkl/128514              |    2 +-
- bouml/hkl/128514.bodies       |  356 +++++++++++-----------
- bouml/hkl/128642              |    2 +-
- bouml/hkl/128770              |    2 +-
- bouml/hkl/128770.bodies       |  267 ++++++++--------
- bouml/hkl/128898.bodies       |   26 +-
- bouml/hkl/129154.bodies       |   78 +++---
- bouml/hkl/129282.bodies       |    4 +-
- bouml/hkl/129410.bodies       |    4 +-
- bouml/hkl/129538.bodies       |    4 +-
- bouml/hkl/129666.bodies       |   40 ++--
- bouml/hkl/129794.bodies       |  256 ++++++++--------
- bouml/hkl/129922              |    2 +-
- bouml/hkl/129922.bodies       |   22 +-
- bouml/hkl/130050.bodies       |  105 ++++---
- bouml/hkl/130178.bodies       |   76 +++---
- bouml/hkl/130306.bodies       |  242 ++++++++--------
- bouml/hkl/130306.diagram      |    2 +-
- bouml/hkl/131074              |    2 +-
- bouml/hkl/131074.bodies       |  140 +++++-----
- bouml/hkl/131202.bodies       |   30 +-
- bouml/hkl/131330.bodies       |  122 ++++----
- bouml/hkl/131330.diagram      |   28 ++-
- bouml/hkl/131458.bodies       |  132 ++++----
- bouml/hkl/131458.diagram      |   28 ++-
- bouml/hkl/131586.bodies       |  574 +++++++++++++++++-----------------
- bouml/hkl/131714.bodies       |  592 +++++++++++++++++-------------------
- bouml/hkl/131842              |   26 +-
- bouml/hkl/131842.bodies       |  194 ++++++------
- bouml/hkl/131970              |   10 +-
- bouml/hkl/132098              |    2 +-
- bouml/hkl/132354              |   21 +--
- bouml/hkl/132482              |   12 +-
- bouml/hkl/132482.bodies       |  163 +++++-----
- bouml/hkl/132610              |    2 +-
- bouml/hkl/132610.bodies       |  258 ++++++++--------
- bouml/hkl/132738.bodies       |   20 +-
- bouml/hkl/132866.bodies       |  232 +++++++-------
- bouml/hkl/132994              |    8 +-
- bouml/hkl/132994.bodies       |  260 ++++++++--------
- bouml/hkl/133122              |   26 +-
- bouml/hkl/133122.bodies       |   76 +++---
- bouml/hkl/133250              |   38 ++--
- bouml/hkl/133378              |   10 +-
- bouml/hkl/133378.bodies       |  190 ++++++------
- bouml/hkl/133506.bodies       |   22 +-
- bouml/hkl/133634              |   38 ++--
- bouml/hkl/133634.bodies       |  296 +++++++++---------
- bouml/hkl/133890.bodies       |    6 +-
- bouml/hkl/134146              |  184 ++++++++---
- bouml/hkl/134146.bodies       |  288 +++++++++---------
- bouml/hkl/134274.bodies       |   30 +-
- bouml/hkl/134402.bodies       |  314 ++++++++++----------
- bouml/hkl/134786.bodies       |  104 ++++----
- bouml/hkl/135042.bodies       |   98 +++---
- bouml/hkl/135170.bodies       |   42 ++--
- bouml/hkl/135426.bodies       |  116 ++++----
- bouml/hkl/136194.bodies       |  172 ++++++------
- bouml/hkl/136322.bodies       |  162 +++++-----
- bouml/hkl/136450.bodies       |  116 ++++----
- bouml/hkl/136578.bodies       |  406 ++++++++++++------------
- bouml/hkl/136706.bodies       |  246 ++++++++--------
- bouml/hkl/136834.bodies       |  390 ++++++++++++------------
- bouml/hkl/136962.bodies       |  218 +++++++-------
- bouml/hkl/137090.bodies       |  134 ++++----
- bouml/hkl/138882.bodies       |   58 ++--
- bouml/hkl/139138.bodies       |  220 +++++++-------
- bouml/hkl/139522.bodies       |   58 ++--
- bouml/hkl/139650.bodies       |   68 ++--
- bouml/hkl/139778.bodies       |   64 ++--
- bouml/hkl/139906.bodies       |   66 ++--
- bouml/hkl/140034.bodies       |   64 ++--
- bouml/hkl/140162.bodies       |   18 +-
- bouml/hkl/140290.bodies       |   16 +-
- bouml/hkl/140418.bodies       |   12 +-
- bouml/hkl/142466.bodies       |   42 ++--
- bouml/hkl/142594.bodies       |  460 ++++++++++++++--------------
- bouml/hkl/142978.bodies       |  218 +++++++-------
- bouml/hkl/143362.bodies       |   70 +++---
- bouml/hkl/143490.bodies       |    6 +-
- bouml/hkl/143618.bodies       |   24 +-
- bouml/hkl/143746.bodies       |   32 +-
- bouml/hkl/143874.bodies       |   34 +-
- bouml/hkl/144130.bodies       |   26 +-
- bouml/hkl/144258.bodies       |   34 +-
- bouml/hkl/144386.bodies       |   46 ++--
- bouml/hkl/145026.bodies       |  134 ++++----
- bouml/hkl/145282.bodies       |   57 ++---
- bouml/hkl/145410.bodies       |  117 +++++++
- bouml/hkl/2.session           |   15 +-
- bouml/hkl/generation_settings |   17 +-
- bouml/hkl/hkl.prj             |  679 +++++++++++++++++++++++++----------------
+ bouml/hkl/128002              |   2 +-
+ bouml/hkl/128002.bodies       | 294 +++++++++---------
+ bouml/hkl/128002.diagram      |  70 ++---
+ bouml/hkl/128060.bodies       |  78 ++---
+ bouml/hkl/128182.bodies       |  52 ++--
+ bouml/hkl/128310.bodies       |  18 +-
+ bouml/hkl/128514              |   2 +-
+ bouml/hkl/128514.bodies       | 356 +++++++++++-----------
+ bouml/hkl/128642              |   2 +-
+ bouml/hkl/128770              |   2 +-
+ bouml/hkl/128770.bodies       | 267 +++++++++--------
+ bouml/hkl/128898.bodies       |  26 +-
+ bouml/hkl/129154.bodies       |  78 ++---
+ bouml/hkl/129282.bodies       |   4 +-
+ bouml/hkl/129410.bodies       |   4 +-
+ bouml/hkl/129538.bodies       |   4 +-
+ bouml/hkl/129666.bodies       |  40 +--
+ bouml/hkl/129794.bodies       | 256 ++++++++--------
+ bouml/hkl/129922              |   2 +-
+ bouml/hkl/129922.bodies       |  22 +-
+ bouml/hkl/130050.bodies       | 105 ++++---
+ bouml/hkl/130178.bodies       |  76 ++---
+ bouml/hkl/130306.bodies       | 242 +++++++--------
+ bouml/hkl/130306.diagram      |   2 +-
+ bouml/hkl/131074              |   2 +-
+ bouml/hkl/131074.bodies       | 140 ++++-----
+ bouml/hkl/131202.bodies       |  30 +-
+ bouml/hkl/131330.bodies       | 122 ++++----
+ bouml/hkl/131330.diagram      |  28 +-
+ bouml/hkl/131458.bodies       | 132 ++++----
+ bouml/hkl/131458.diagram      |  28 +-
+ bouml/hkl/131586.bodies       | 574 +++++++++++++++++------------------
+ bouml/hkl/131714.bodies       | 592 +++++++++++++++++-------------------
+ bouml/hkl/131842              |  26 +-
+ bouml/hkl/131842.bodies       | 194 ++++++------
+ bouml/hkl/131970              |  10 +-
+ bouml/hkl/132098              |   2 +-
+ bouml/hkl/132354              |  21 +-
+ bouml/hkl/132482              |  12 +-
+ bouml/hkl/132482.bodies       | 163 +++++-----
+ bouml/hkl/132610              |   2 +-
+ bouml/hkl/132610.bodies       | 258 ++++++++--------
+ bouml/hkl/132738.bodies       |  20 +-
+ bouml/hkl/132866.bodies       | 232 +++++++--------
+ bouml/hkl/132994              |   8 +-
+ bouml/hkl/132994.bodies       | 260 ++++++++--------
+ bouml/hkl/133122              |  26 +-
+ bouml/hkl/133122.bodies       |  76 ++---
+ bouml/hkl/133250              |  38 +--
+ bouml/hkl/133378              |  10 +-
+ bouml/hkl/133378.bodies       | 190 ++++++------
+ bouml/hkl/133506.bodies       |  22 +-
+ bouml/hkl/133634              |  38 +--
+ bouml/hkl/133634.bodies       | 296 +++++++++---------
+ bouml/hkl/133890.bodies       |   6 +-
+ bouml/hkl/134146              | 184 +++++++++---
+ bouml/hkl/134146.bodies       | 288 +++++++++---------
+ bouml/hkl/134274.bodies       |  30 +-
+ bouml/hkl/134402.bodies       | 314 +++++++++----------
+ bouml/hkl/134786.bodies       | 104 +++----
+ bouml/hkl/135042.bodies       |  98 +++---
+ bouml/hkl/135170.bodies       |  42 +--
+ bouml/hkl/135426.bodies       | 116 ++++----
+ bouml/hkl/136194.bodies       | 172 +++++------
+ bouml/hkl/136322.bodies       | 162 +++++-----
+ bouml/hkl/136450.bodies       | 116 ++++----
+ bouml/hkl/136578.bodies       | 406 ++++++++++++-------------
+ bouml/hkl/136706.bodies       | 246 +++++++--------
+ bouml/hkl/136834.bodies       | 390 ++++++++++++------------
+ bouml/hkl/136962.bodies       | 218 +++++++-------
+ bouml/hkl/137090.bodies       | 134 ++++-----
+ bouml/hkl/138882.bodies       |  58 ++--
+ bouml/hkl/139138.bodies       | 220 +++++++-------
+ bouml/hkl/139522.bodies       |  58 ++--
+ bouml/hkl/139650.bodies       |  68 ++---
+ bouml/hkl/139778.bodies       |  64 ++--
+ bouml/hkl/139906.bodies       |  66 ++--
+ bouml/hkl/140034.bodies       |  64 ++--
+ bouml/hkl/140162.bodies       |  18 +-
+ bouml/hkl/140290.bodies       |  16 +-
+ bouml/hkl/140418.bodies       |  12 +-
+ bouml/hkl/142466.bodies       |  42 +--
+ bouml/hkl/142594.bodies       | 460 ++++++++++++++--------------
+ bouml/hkl/142978.bodies       | 218 +++++++-------
+ bouml/hkl/143362.bodies       |  70 ++---
+ bouml/hkl/143490.bodies       |   6 +-
+ bouml/hkl/143618.bodies       |  24 +-
+ bouml/hkl/143746.bodies       |  32 +-
+ bouml/hkl/143874.bodies       |  34 +--
+ bouml/hkl/144130.bodies       |  26 +-
+ bouml/hkl/144258.bodies       |  34 +--
+ bouml/hkl/144386.bodies       |  46 +--
+ bouml/hkl/145026.bodies       | 134 ++++-----
+ bouml/hkl/145282.bodies       |  57 ++--
+ bouml/hkl/145410.bodies       | 117 ++++++++
+ bouml/hkl/2.session           |  15 +-
+ bouml/hkl/generation_settings |  17 +-
+ bouml/hkl/hkl.prj             | 679 +++++++++++++++++++++++++-----------------
  98 files changed, 5774 insertions(+), 5463 deletions(-)
 
 commit 414ae42cd4a668395ea785316ce38c4fb4fb1aa5
@@ -10681,106 +20442,106 @@ Date:   Tue Jun 5 21:58:21 2007 +0200
 
     * start refactoring of the Axes (do not compile)
 
- TODO                          |    8 +-
- bouml/hkl/128002              |    2 +-
- bouml/hkl/128002.bodies       |  298 ++++++++++----------
- bouml/hkl/128060.bodies       |   78 +++---
- bouml/hkl/128182.bodies       |   50 ++--
- bouml/hkl/128188.diagram      |   50 ++--
- bouml/hkl/128310.bodies       |   16 +-
- bouml/hkl/128514              |    2 +-
- bouml/hkl/128514.bodies       |  356 +++++++++++-----------
- bouml/hkl/128642              |    2 +-
- bouml/hkl/128770              |    2 +-
- bouml/hkl/128770.bodies       |  262 +++++++++---------
- bouml/hkl/128898.bodies       |   26 +-
- bouml/hkl/129154.bodies       |   78 +++---
- bouml/hkl/129282.bodies       |    4 +-
- bouml/hkl/129410.bodies       |    4 +-
- bouml/hkl/129538.bodies       |    4 +-
- bouml/hkl/129666.bodies       |   42 ++--
- bouml/hkl/129794.bodies       |  256 ++++++++--------
- bouml/hkl/129922              |    2 +-
- bouml/hkl/129922.bodies       |   22 +-
- bouml/hkl/130050.bodies       |   94 +++---
- bouml/hkl/130178.bodies       |   76 +++---
- bouml/hkl/130306.bodies       |  272 +++++++++---------
- bouml/hkl/131074              |    2 +-
- bouml/hkl/131074.bodies       |  146 +++++-----
- bouml/hkl/131202              |   61 ----
- bouml/hkl/131202.bodies       |   30 +-
- bouml/hkl/131330.bodies       |  132 +++++-----
- bouml/hkl/131330.diagram      |   15 +
- bouml/hkl/131458.bodies       |  140 +++++-----
- bouml/hkl/131458.diagram      |   55 ++++
- bouml/hkl/131586.bodies       |  630 ++++++++++++++++++++--------------------
- bouml/hkl/131714.bodies       |  648 ++++++++++++++++++++--------------------
- bouml/hkl/131842              |    2 +-
- bouml/hkl/131842.bodies       |  184 ++++++------
- bouml/hkl/131970              |    2 +-
- bouml/hkl/132098              |    2 +-
- bouml/hkl/132354              |   14 +-
- bouml/hkl/132482              |    2 +-
- bouml/hkl/132482.bodies       |  148 +++++-----
- bouml/hkl/132610              |    2 +-
- bouml/hkl/132610.bodies       |  286 +++++++++---------
- bouml/hkl/132738.bodies       |   20 +-
- bouml/hkl/132866.bodies       |  208 +++++++-------
- bouml/hkl/132994              |    2 +-
- bouml/hkl/132994.bodies       |  246 ++++++++--------
- bouml/hkl/133122              |    2 +-
- bouml/hkl/133122.bodies       |   78 +++---
- bouml/hkl/133250              |    2 +-
- bouml/hkl/133378              |    2 +-
- bouml/hkl/133378.bodies       |  210 +++++++-------
- bouml/hkl/133506.bodies       |   22 +-
- bouml/hkl/133634              |    2 +-
- bouml/hkl/133634.bodies       |  332 +++++++++++-----------
- bouml/hkl/133890.bodies       |    6 +-
- bouml/hkl/134018              |    9 +-
- bouml/hkl/134146              |  273 +++++++++++++++++
- bouml/hkl/134146.bodies       |  302 ++++++++++----------
- bouml/hkl/134274.bodies       |   30 +-
- bouml/hkl/134402.bodies       |  332 +++++++++++-----------
- bouml/hkl/134786.bodies       |  104 ++++----
- bouml/hkl/135042.bodies       |   96 +++---
- bouml/hkl/135170.bodies       |   42 ++--
- bouml/hkl/135426.bodies       |  126 ++++----
- bouml/hkl/136194.bodies       |  178 ++++++------
- bouml/hkl/136322.bodies       |  168 ++++++------
- bouml/hkl/136450.bodies       |  116 ++++----
- bouml/hkl/136578.bodies       |  486 +++++++++++++++---------------
- bouml/hkl/136706.bodies       |  262 +++++++++---------
- bouml/hkl/136834.bodies       |  446 ++++++++++++++--------------
- bouml/hkl/136962.bodies       |  220 +++++++-------
- bouml/hkl/137090.bodies       |  134 +++++-----
- bouml/hkl/138882.bodies       |   58 ++--
- bouml/hkl/139138.bodies       |  238 ++++++++--------
- bouml/hkl/139522.bodies       |   58 ++--
- bouml/hkl/139650.bodies       |   68 +++---
- bouml/hkl/139778.bodies       |   64 ++--
- bouml/hkl/139906.bodies       |   66 ++--
- bouml/hkl/140034.bodies       |   64 ++--
- bouml/hkl/140162.bodies       |   18 +-
- bouml/hkl/140290.bodies       |   16 +-
- bouml/hkl/140418.bodies       |   12 +-
- bouml/hkl/142466.bodies       |   42 ++--
- bouml/hkl/142594.bodies       |  496 ++++++++++++++++----------------
- bouml/hkl/142978.bodies       |  236 ++++++++--------
- bouml/hkl/143362.bodies       |   70 +++---
- bouml/hkl/143490.bodies       |    6 +-
- bouml/hkl/143618.bodies       |   24 +-
- bouml/hkl/143746.bodies       |   32 +-
- bouml/hkl/143874.bodies       |   34 +-
- bouml/hkl/144130.bodies       |   26 +-
- bouml/hkl/144258.bodies       |   34 +-
- bouml/hkl/144386.bodies       |   46 ++--
- bouml/hkl/145026.bodies       |  134 +++++-----
- bouml/hkl/145282.bodies       |   41 +++
- bouml/hkl/2.session           |   17 +-
- bouml/hkl/generation_settings |    8 +-
- bouml/hkl/hkl.prj             |  370 ++++++++++++++++-------
- src/SConscript                |    1 +
+ TODO                          |   8 +-
+ bouml/hkl/128002              |   2 +-
+ bouml/hkl/128002.bodies       | 298 +++++++++----------
+ bouml/hkl/128060.bodies       |  78 ++---
+ bouml/hkl/128182.bodies       |  50 ++--
+ bouml/hkl/128188.diagram      |  50 ++--
+ bouml/hkl/128310.bodies       |  16 +-
+ bouml/hkl/128514              |   2 +-
+ bouml/hkl/128514.bodies       | 356 +++++++++++------------
+ bouml/hkl/128642              |   2 +-
+ bouml/hkl/128770              |   2 +-
+ bouml/hkl/128770.bodies       | 262 ++++++++---------
+ bouml/hkl/128898.bodies       |  26 +-
+ bouml/hkl/129154.bodies       |  78 ++---
+ bouml/hkl/129282.bodies       |   4 +-
+ bouml/hkl/129410.bodies       |   4 +-
+ bouml/hkl/129538.bodies       |   4 +-
+ bouml/hkl/129666.bodies       |  42 +--
+ bouml/hkl/129794.bodies       | 256 ++++++++---------
+ bouml/hkl/129922              |   2 +-
+ bouml/hkl/129922.bodies       |  22 +-
+ bouml/hkl/130050.bodies       |  94 +++---
+ bouml/hkl/130178.bodies       |  76 ++---
+ bouml/hkl/130306.bodies       | 272 +++++++++---------
+ bouml/hkl/131074              |   2 +-
+ bouml/hkl/131074.bodies       | 146 +++++-----
+ bouml/hkl/131202              |  61 ----
+ bouml/hkl/131202.bodies       |  30 +-
+ bouml/hkl/131330.bodies       | 132 ++++-----
+ bouml/hkl/131330.diagram      |  15 +
+ bouml/hkl/131458.bodies       | 140 ++++-----
+ bouml/hkl/131458.diagram      |  55 ++++
+ bouml/hkl/131586.bodies       | 630 ++++++++++++++++++++--------------------
+ bouml/hkl/131714.bodies       | 648 +++++++++++++++++++++---------------------
+ bouml/hkl/131842              |   2 +-
+ bouml/hkl/131842.bodies       | 184 ++++++------
+ bouml/hkl/131970              |   2 +-
+ bouml/hkl/132098              |   2 +-
+ bouml/hkl/132354              |  14 +-
+ bouml/hkl/132482              |   2 +-
+ bouml/hkl/132482.bodies       | 148 +++++-----
+ bouml/hkl/132610              |   2 +-
+ bouml/hkl/132610.bodies       | 286 +++++++++----------
+ bouml/hkl/132738.bodies       |  20 +-
+ bouml/hkl/132866.bodies       | 208 +++++++-------
+ bouml/hkl/132994              |   2 +-
+ bouml/hkl/132994.bodies       | 246 ++++++++--------
+ bouml/hkl/133122              |   2 +-
+ bouml/hkl/133122.bodies       |  78 ++---
+ bouml/hkl/133250              |   2 +-
+ bouml/hkl/133378              |   2 +-
+ bouml/hkl/133378.bodies       | 210 +++++++-------
+ bouml/hkl/133506.bodies       |  22 +-
+ bouml/hkl/133634              |   2 +-
+ bouml/hkl/133634.bodies       | 332 +++++++++++-----------
+ bouml/hkl/133890.bodies       |   6 +-
+ bouml/hkl/134018              |   9 +-
+ bouml/hkl/134146              | 273 ++++++++++++++++++
+ bouml/hkl/134146.bodies       | 302 ++++++++++----------
+ bouml/hkl/134274.bodies       |  30 +-
+ bouml/hkl/134402.bodies       | 332 +++++++++++-----------
+ bouml/hkl/134786.bodies       | 104 +++----
+ bouml/hkl/135042.bodies       |  96 +++----
+ bouml/hkl/135170.bodies       |  42 +--
+ bouml/hkl/135426.bodies       | 126 ++++----
+ bouml/hkl/136194.bodies       | 178 ++++++------
+ bouml/hkl/136322.bodies       | 168 +++++------
+ bouml/hkl/136450.bodies       | 116 ++++----
+ bouml/hkl/136578.bodies       | 486 +++++++++++++++----------------
+ bouml/hkl/136706.bodies       | 262 ++++++++---------
+ bouml/hkl/136834.bodies       | 446 ++++++++++++++---------------
+ bouml/hkl/136962.bodies       | 220 +++++++-------
+ bouml/hkl/137090.bodies       | 134 ++++-----
+ bouml/hkl/138882.bodies       |  58 ++--
+ bouml/hkl/139138.bodies       | 238 ++++++++--------
+ bouml/hkl/139522.bodies       |  58 ++--
+ bouml/hkl/139650.bodies       |  68 ++---
+ bouml/hkl/139778.bodies       |  64 ++---
+ bouml/hkl/139906.bodies       |  66 ++---
+ bouml/hkl/140034.bodies       |  64 ++---
+ bouml/hkl/140162.bodies       |  18 +-
+ bouml/hkl/140290.bodies       |  16 +-
+ bouml/hkl/140418.bodies       |  12 +-
+ bouml/hkl/142466.bodies       |  42 +--
+ bouml/hkl/142594.bodies       | 496 ++++++++++++++++----------------
+ bouml/hkl/142978.bodies       | 236 +++++++--------
+ bouml/hkl/143362.bodies       |  70 ++---
+ bouml/hkl/143490.bodies       |   6 +-
+ bouml/hkl/143618.bodies       |  24 +-
+ bouml/hkl/143746.bodies       |  32 +--
+ bouml/hkl/143874.bodies       |  34 +--
+ bouml/hkl/144130.bodies       |  26 +-
+ bouml/hkl/144258.bodies       |  34 +--
+ bouml/hkl/144386.bodies       |  46 +--
+ bouml/hkl/145026.bodies       | 134 ++++-----
+ bouml/hkl/145282.bodies       |  41 +++
+ bouml/hkl/2.session           |  17 +-
+ bouml/hkl/generation_settings |   8 +-
+ bouml/hkl/hkl.prj             | 370 ++++++++++++++++--------
+ src/SConscript                |   1 +
  100 files changed, 5852 insertions(+), 5390 deletions(-)
 
 commit 45d2357ae3f6311fe10716bc89413bf2bca35e27
@@ -10789,109 +20550,109 @@ Date:   Tue Jun 5 17:11:08 2007 +0200
 
     * now PseudoAxeEngineWithSample is working.
 
- bouml/hkl/128002                   |    8 +-
- bouml/hkl/128002.bodies            |  298 +++++++++---------
- bouml/hkl/128060.bodies            |   78 +++---
- bouml/hkl/128182.bodies            |   50 ++--
- bouml/hkl/128310.bodies            |   16 +-
- bouml/hkl/128514                   |    8 +-
- bouml/hkl/128514.bodies            |  356 ++++++++++----------
- bouml/hkl/128514.diagram           |   41 ++-
- bouml/hkl/128642                   |    8 +-
- bouml/hkl/128642.diagram           |   35 ++-
- bouml/hkl/128770                   |   12 +-
- bouml/hkl/128770.bodies            |  262 ++++++++--------
- bouml/hkl/128770.diagram           |   18 +-
- bouml/hkl/128898.bodies            |   26 +-
- bouml/hkl/129154.bodies            |   78 +++---
- bouml/hkl/129282.bodies            |    4 +-
- bouml/hkl/129410.bodies            |    4 +-
- bouml/hkl/129538.bodies            |    4 +-
- bouml/hkl/129666.bodies            |   42 ++--
- bouml/hkl/129794.bodies            |  256 +++++++-------
- bouml/hkl/129922                   |   10 +-
- bouml/hkl/129922.bodies            |   22 +-
- bouml/hkl/130050.bodies            |   86 +++---
- bouml/hkl/130178.bodies            |   76 +++---
- bouml/hkl/130306.bodies            |  272 ++++++++--------
- bouml/hkl/130818.diagram           |   31 ++-
- bouml/hkl/131074                   |   10 +-
- bouml/hkl/131074.bodies            |  146 ++++----
- bouml/hkl/131202.bodies            |   30 +-
- bouml/hkl/131330.bodies            |  132 ++++----
- bouml/hkl/131458.bodies            |  140 ++++----
- bouml/hkl/131586.bodies            |  630 +++++++++++++++++-----------------
- bouml/hkl/131714.bodies            |  648 ++++++++++++++++++------------------
- bouml/hkl/131842                   |    2 +-
- bouml/hkl/131842.bodies            |  184 +++++-----
- bouml/hkl/131970                   |    2 +-
- bouml/hkl/132098                   |   10 +-
- bouml/hkl/132354                   |   10 +-
- bouml/hkl/132482                   |   10 +-
- bouml/hkl/132482.bodies            |  148 ++++----
- bouml/hkl/132610                   |   10 +-
- bouml/hkl/132610.bodies            |  286 ++++++++--------
- bouml/hkl/132738.bodies            |   20 +-
- bouml/hkl/132866.bodies            |  208 ++++++------
- bouml/hkl/132994                   |   18 +-
- bouml/hkl/132994.bodies            |  246 +++++++-------
- bouml/hkl/133122                   |    2 +-
- bouml/hkl/133122.bodies            |   78 +++---
- bouml/hkl/133250                   |    2 +-
- bouml/hkl/133378                   |   22 +-
- bouml/hkl/133378.bodies            |  210 ++++++------
- bouml/hkl/133506.bodies            |   22 +-
- bouml/hkl/133634                   |    2 +-
- bouml/hkl/133634.bodies            |  332 +++++++++---------
- bouml/hkl/133762                   |   22 +-
- bouml/hkl/133890.bodies            |    6 +-
- bouml/hkl/134146.bodies            |  302 +++++++++---------
- bouml/hkl/134274.bodies            |   30 +-
- bouml/hkl/134402.bodies            |  332 +++++++++---------
- bouml/hkl/134786.bodies            |  104 +++---
- bouml/hkl/135042.bodies            |   96 +++---
- bouml/hkl/135170.bodies            |   42 ++--
- bouml/hkl/135426.bodies            |  126 ++++----
- bouml/hkl/136194.bodies            |  178 +++++-----
- bouml/hkl/136322.bodies            |  168 +++++-----
- bouml/hkl/136450.bodies            |  116 ++++----
- bouml/hkl/136578.bodies            |  488 ++++++++++++++--------------
- bouml/hkl/136706.bodies            |  262 ++++++++--------
- bouml/hkl/136834.bodies            |  446 +++++++++++++-------------
- bouml/hkl/136962.bodies            |  220 ++++++------
- bouml/hkl/137090.bodies            |  134 ++++----
- bouml/hkl/138882.bodies            |   58 ++--
- bouml/hkl/139138.bodies            |  238 +++++++-------
- bouml/hkl/139522.bodies            |   58 ++--
- bouml/hkl/139650.bodies            |   68 ++--
- bouml/hkl/139778.bodies            |   64 ++--
- bouml/hkl/139906.bodies            |   66 ++--
- bouml/hkl/140034.bodies            |   64 ++--
- bouml/hkl/140162.bodies            |   18 +-
- bouml/hkl/140290.bodies            |   16 +-
- bouml/hkl/140418.bodies            |   12 +-
- bouml/hkl/142466.bodies            |   42 ++--
- bouml/hkl/142594.bodies            |  496 ++++++++++++++--------------
- bouml/hkl/142978.bodies            |  236 +++++++-------
- bouml/hkl/143362.bodies            |   70 ++--
- bouml/hkl/143490.bodies            |    6 +-
- bouml/hkl/143618.bodies            |   24 +-
- bouml/hkl/143746.bodies            |   32 +-
- bouml/hkl/143874.bodies            |   34 +-
- bouml/hkl/144130.bodies            |   26 +-
- bouml/hkl/144258.bodies            |   34 +-
- bouml/hkl/144386.bodies            |   46 ++--
- bouml/hkl/145026.bodies            |  134 ++++----
- bouml/hkl/2.session                |   17 +-
- bouml/hkl/hkl.prj                  |   11 +-
- test/pseudoaxe_eulerian4C_test.cpp |   13 +-
- test/pseudoaxe_eulerian4C_test.h   |    1 +
- test/pseudoaxe_eulerian6C_test.cpp |   12 +-
- test/pseudoaxe_eulerian6C_test.h   |    1 +
- test/pseudoaxe_kappa4C_test.cpp    |   12 +-
- test/pseudoaxe_kappa4C_test.h      |    1 +
- test/pseudoaxe_kappa6C_test.cpp    |   12 +-
- test/pseudoaxe_kappa6C_test.h      |    1 +
+ bouml/hkl/128002                   |   8 +-
+ bouml/hkl/128002.bodies            | 298 ++++++++---------
+ bouml/hkl/128060.bodies            |  78 ++---
+ bouml/hkl/128182.bodies            |  50 +--
+ bouml/hkl/128310.bodies            |  16 +-
+ bouml/hkl/128514                   |   8 +-
+ bouml/hkl/128514.bodies            | 356 ++++++++++----------
+ bouml/hkl/128514.diagram           |  41 ++-
+ bouml/hkl/128642                   |   8 +-
+ bouml/hkl/128642.diagram           |  35 +-
+ bouml/hkl/128770                   |  12 +-
+ bouml/hkl/128770.bodies            | 262 +++++++--------
+ bouml/hkl/128770.diagram           |  18 +-
+ bouml/hkl/128898.bodies            |  26 +-
+ bouml/hkl/129154.bodies            |  78 ++---
+ bouml/hkl/129282.bodies            |   4 +-
+ bouml/hkl/129410.bodies            |   4 +-
+ bouml/hkl/129538.bodies            |   4 +-
+ bouml/hkl/129666.bodies            |  42 +--
+ bouml/hkl/129794.bodies            | 256 +++++++--------
+ bouml/hkl/129922                   |  10 +-
+ bouml/hkl/129922.bodies            |  22 +-
+ bouml/hkl/130050.bodies            |  86 ++---
+ bouml/hkl/130178.bodies            |  76 ++---
+ bouml/hkl/130306.bodies            | 272 ++++++++--------
+ bouml/hkl/130818.diagram           |  31 +-
+ bouml/hkl/131074                   |  10 +-
+ bouml/hkl/131074.bodies            | 146 ++++-----
+ bouml/hkl/131202.bodies            |  30 +-
+ bouml/hkl/131330.bodies            | 132 ++++----
+ bouml/hkl/131458.bodies            | 140 ++++----
+ bouml/hkl/131586.bodies            | 630 ++++++++++++++++++------------------
+ bouml/hkl/131714.bodies            | 648 ++++++++++++++++++-------------------
+ bouml/hkl/131842                   |   2 +-
+ bouml/hkl/131842.bodies            | 184 +++++------
+ bouml/hkl/131970                   |   2 +-
+ bouml/hkl/132098                   |  10 +-
+ bouml/hkl/132354                   |  10 +-
+ bouml/hkl/132482                   |  10 +-
+ bouml/hkl/132482.bodies            | 148 ++++-----
+ bouml/hkl/132610                   |  10 +-
+ bouml/hkl/132610.bodies            | 286 ++++++++--------
+ bouml/hkl/132738.bodies            |  20 +-
+ bouml/hkl/132866.bodies            | 208 ++++++------
+ bouml/hkl/132994                   |  18 +-
+ bouml/hkl/132994.bodies            | 246 +++++++-------
+ bouml/hkl/133122                   |   2 +-
+ bouml/hkl/133122.bodies            |  78 ++---
+ bouml/hkl/133250                   |   2 +-
+ bouml/hkl/133378                   |  22 +-
+ bouml/hkl/133378.bodies            | 210 ++++++------
+ bouml/hkl/133506.bodies            |  22 +-
+ bouml/hkl/133634                   |   2 +-
+ bouml/hkl/133634.bodies            | 332 +++++++++----------
+ bouml/hkl/133762                   |  22 +-
+ bouml/hkl/133890.bodies            |   6 +-
+ bouml/hkl/134146.bodies            | 302 ++++++++---------
+ bouml/hkl/134274.bodies            |  30 +-
+ bouml/hkl/134402.bodies            | 332 +++++++++----------
+ bouml/hkl/134786.bodies            | 104 +++---
+ bouml/hkl/135042.bodies            |  96 +++---
+ bouml/hkl/135170.bodies            |  42 +--
+ bouml/hkl/135426.bodies            | 126 ++++----
+ bouml/hkl/136194.bodies            | 178 +++++-----
+ bouml/hkl/136322.bodies            | 168 +++++-----
+ bouml/hkl/136450.bodies            | 116 +++----
+ bouml/hkl/136578.bodies            | 488 ++++++++++++++--------------
+ bouml/hkl/136706.bodies            | 262 +++++++--------
+ bouml/hkl/136834.bodies            | 446 ++++++++++++-------------
+ bouml/hkl/136962.bodies            | 220 ++++++-------
+ bouml/hkl/137090.bodies            | 134 ++++----
+ bouml/hkl/138882.bodies            |  58 ++--
+ bouml/hkl/139138.bodies            | 238 +++++++-------
+ bouml/hkl/139522.bodies            |  58 ++--
+ bouml/hkl/139650.bodies            |  68 ++--
+ bouml/hkl/139778.bodies            |  64 ++--
+ bouml/hkl/139906.bodies            |  66 ++--
+ bouml/hkl/140034.bodies            |  64 ++--
+ bouml/hkl/140162.bodies            |  18 +-
+ bouml/hkl/140290.bodies            |  16 +-
+ bouml/hkl/140418.bodies            |  12 +-
+ bouml/hkl/142466.bodies            |  42 +--
+ bouml/hkl/142594.bodies            | 496 ++++++++++++++--------------
+ bouml/hkl/142978.bodies            | 236 +++++++-------
+ bouml/hkl/143362.bodies            |  70 ++--
+ bouml/hkl/143490.bodies            |   6 +-
+ bouml/hkl/143618.bodies            |  24 +-
+ bouml/hkl/143746.bodies            |  32 +-
+ bouml/hkl/143874.bodies            |  34 +-
+ bouml/hkl/144130.bodies            |  26 +-
+ bouml/hkl/144258.bodies            |  34 +-
+ bouml/hkl/144386.bodies            |  46 +--
+ bouml/hkl/145026.bodies            | 134 ++++----
+ bouml/hkl/2.session                |  17 +-
+ bouml/hkl/hkl.prj                  |  11 +-
+ test/pseudoaxe_eulerian4C_test.cpp |  13 +-
+ test/pseudoaxe_eulerian4C_test.h   |   1 +
+ test/pseudoaxe_eulerian6C_test.cpp |  12 +-
+ test/pseudoaxe_eulerian6C_test.h   |   1 +
+ test/pseudoaxe_kappa4C_test.cpp    |  12 +-
+ test/pseudoaxe_kappa4C_test.h      |   1 +
+ test/pseudoaxe_kappa6C_test.cpp    |  12 +-
+ test/pseudoaxe_kappa6C_test.h      |   1 +
  103 files changed, 5354 insertions(+), 5302 deletions(-)
 
 commit 0eea12680d26b863d83a988588a2b589fcb38493
@@ -10900,105 +20661,105 @@ Date:   Tue Jun 5 08:14:49 2007 +0200
 
     * start working on the PseudoAxeEngineWithSample (do not compile)
 
- bouml/hkl/128002              |    2 +-
- bouml/hkl/128002.bodies       |  298 ++++++++++----------
- bouml/hkl/128002.diagram      |   52 ++--
- bouml/hkl/128060.bodies       |   78 +++---
- bouml/hkl/128182.bodies       |   50 ++--
- bouml/hkl/128188.diagram      |  112 +++++---
- bouml/hkl/128310.bodies       |   16 +-
- bouml/hkl/128386.diagram      |   59 +++--
- bouml/hkl/128514              |    2 +-
- bouml/hkl/128514.bodies       |  356 +++++++++++-----------
- bouml/hkl/128642              |    2 +-
- bouml/hkl/128770              |  277 +++++++++++++++++-
- bouml/hkl/128770.bodies       |  262 +++++++++---------
- bouml/hkl/128770.diagram      |   64 ++++-
- bouml/hkl/128898.bodies       |   26 +-
- bouml/hkl/129154.bodies       |   78 +++---
- bouml/hkl/129282.bodies       |    4 +-
- bouml/hkl/129410.bodies       |    4 +-
- bouml/hkl/129538.bodies       |    4 +-
- bouml/hkl/129666.bodies       |   42 ++--
- bouml/hkl/129794.bodies       |  256 ++++++++--------
- bouml/hkl/129922              |    3 +-
- bouml/hkl/129922.bodies       |   22 +-
- bouml/hkl/129922.diagram      |   20 +-
- bouml/hkl/130050.bodies       |   86 +++---
- bouml/hkl/130178.bodies       |   76 +++---
- bouml/hkl/130306.bodies       |  272 +++++++++---------
- bouml/hkl/130306.diagram      |   44 ++-
- bouml/hkl/131074              |    2 +-
- bouml/hkl/131074.bodies       |  146 +++++-----
- bouml/hkl/131202.bodies       |   30 +-
- bouml/hkl/131202.diagram      |   20 +-
- bouml/hkl/131330.bodies       |  132 +++++-----
- bouml/hkl/131458.bodies       |  140 +++++-----
- bouml/hkl/131586.bodies       |  630 ++++++++++++++++++++--------------------
- bouml/hkl/131714.bodies       |  648 ++++++++++++++++++++--------------------
- bouml/hkl/131842              |   13 +-
- bouml/hkl/131842.bodies       |  184 ++++++------
- bouml/hkl/131970              |   29 +-
- bouml/hkl/132098              |    3 +-
- bouml/hkl/132354              |   15 +-
- bouml/hkl/132482              |    2 +-
- bouml/hkl/132482.bodies       |  148 +++++-----
- bouml/hkl/132610              |    2 +-
- bouml/hkl/132610.bodies       |  286 +++++++++---------
- bouml/hkl/132738.bodies       |   20 +-
- bouml/hkl/132866.bodies       |  208 +++++++-------
- bouml/hkl/132994              |   10 +-
- bouml/hkl/132994.bodies       |  246 ++++++++--------
- bouml/hkl/133122              |   10 +-
- bouml/hkl/133122.bodies       |   78 +++---
- bouml/hkl/133250              |   10 +-
- bouml/hkl/133378              |    2 +-
- bouml/hkl/133378.bodies       |  210 +++++++-------
- bouml/hkl/133506.bodies       |   22 +-
- bouml/hkl/133634              |   29 +-
- bouml/hkl/133634.bodies       |  332 +++++++++++-----------
- bouml/hkl/133890.bodies       |    6 +-
- bouml/hkl/134018              |   85 ++++++
- bouml/hkl/134146.bodies       |  302 ++++++++++----------
- bouml/hkl/134274.bodies       |   30 +-
- bouml/hkl/134402.bodies       |  332 +++++++++++-----------
- bouml/hkl/134786.bodies       |  104 ++++----
- bouml/hkl/135042.bodies       |   96 +++---
- bouml/hkl/135170.bodies       |   42 ++--
- bouml/hkl/135426.bodies       |  126 ++++----
- bouml/hkl/136194.bodies       |  178 ++++++------
- bouml/hkl/136322.bodies       |  168 ++++++------
- bouml/hkl/136450.bodies       |  116 ++++----
- bouml/hkl/136578.bodies       |  486 +++++++++++++++---------------
- bouml/hkl/136706.bodies       |  262 +++++++++---------
- bouml/hkl/136834.bodies       |  445 ++++++++++++++--------------
- bouml/hkl/136962.bodies       |  220 +++++++-------
- bouml/hkl/137090.bodies       |  134 +++++-----
- bouml/hkl/138882.bodies       |   58 ++--
- bouml/hkl/139138.bodies       |  238 ++++++++--------
- bouml/hkl/139522.bodies       |   58 ++--
- bouml/hkl/139650.bodies       |   70 +++---
- bouml/hkl/139778.bodies       |   66 ++--
- bouml/hkl/139906.bodies       |   68 +++---
- bouml/hkl/140034.bodies       |   66 ++--
- bouml/hkl/140162.bodies       |   18 +-
- bouml/hkl/140290.bodies       |   16 +-
- bouml/hkl/140418.bodies       |   12 +-
- bouml/hkl/142466.bodies       |   42 ++--
- bouml/hkl/142594.bodies       |  496 ++++++++++++++++----------------
- bouml/hkl/142978.bodies       |  236 ++++++++--------
- bouml/hkl/143362.bodies       |   70 +++---
- bouml/hkl/143490.bodies       |    6 +-
- bouml/hkl/143618.bodies       |   24 +-
- bouml/hkl/143746.bodies       |   32 +-
- bouml/hkl/143874.bodies       |   34 +-
- bouml/hkl/144130.bodies       |   26 +-
- bouml/hkl/144258.bodies       |   34 +-
- bouml/hkl/144386.bodies       |   46 ++--
- bouml/hkl/145026.bodies       |   81 +++++
- bouml/hkl/2.session           |   13 +-
- bouml/hkl/generation_settings |   18 +-
- bouml/hkl/hkl.prj             |  146 ++++++----
+ bouml/hkl/128002              |   2 +-
+ bouml/hkl/128002.bodies       | 298 +++++++++----------
+ bouml/hkl/128002.diagram      |  52 ++--
+ bouml/hkl/128060.bodies       |  78 ++---
+ bouml/hkl/128182.bodies       |  50 ++--
+ bouml/hkl/128188.diagram      | 112 +++++---
+ bouml/hkl/128310.bodies       |  16 +-
+ bouml/hkl/128386.diagram      |  59 ++--
+ bouml/hkl/128514              |   2 +-
+ bouml/hkl/128514.bodies       | 356 +++++++++++------------
+ bouml/hkl/128642              |   2 +-
+ bouml/hkl/128770              | 277 +++++++++++++++++-
+ bouml/hkl/128770.bodies       | 262 ++++++++---------
+ bouml/hkl/128770.diagram      |  64 ++++-
+ bouml/hkl/128898.bodies       |  26 +-
+ bouml/hkl/129154.bodies       |  78 ++---
+ bouml/hkl/129282.bodies       |   4 +-
+ bouml/hkl/129410.bodies       |   4 +-
+ bouml/hkl/129538.bodies       |   4 +-
+ bouml/hkl/129666.bodies       |  42 +--
+ bouml/hkl/129794.bodies       | 256 ++++++++---------
+ bouml/hkl/129922              |   3 +-
+ bouml/hkl/129922.bodies       |  22 +-
+ bouml/hkl/129922.diagram      |  20 +-
+ bouml/hkl/130050.bodies       |  86 +++---
+ bouml/hkl/130178.bodies       |  76 ++---
+ bouml/hkl/130306.bodies       | 272 +++++++++---------
+ bouml/hkl/130306.diagram      |  44 ++-
+ bouml/hkl/131074              |   2 +-
+ bouml/hkl/131074.bodies       | 146 +++++-----
+ bouml/hkl/131202.bodies       |  30 +-
+ bouml/hkl/131202.diagram      |  20 +-
+ bouml/hkl/131330.bodies       | 132 ++++-----
+ bouml/hkl/131458.bodies       | 140 ++++-----
+ bouml/hkl/131586.bodies       | 630 ++++++++++++++++++++--------------------
+ bouml/hkl/131714.bodies       | 648 +++++++++++++++++++++---------------------
+ bouml/hkl/131842              |  13 +-
+ bouml/hkl/131842.bodies       | 184 ++++++------
+ bouml/hkl/131970              |  29 +-
+ bouml/hkl/132098              |   3 +-
+ bouml/hkl/132354              |  15 +-
+ bouml/hkl/132482              |   2 +-
+ bouml/hkl/132482.bodies       | 148 +++++-----
+ bouml/hkl/132610              |   2 +-
+ bouml/hkl/132610.bodies       | 286 +++++++++----------
+ bouml/hkl/132738.bodies       |  20 +-
+ bouml/hkl/132866.bodies       | 208 +++++++-------
+ bouml/hkl/132994              |  10 +-
+ bouml/hkl/132994.bodies       | 246 ++++++++--------
+ bouml/hkl/133122              |  10 +-
+ bouml/hkl/133122.bodies       |  78 ++---
+ bouml/hkl/133250              |  10 +-
+ bouml/hkl/133378              |   2 +-
+ bouml/hkl/133378.bodies       | 210 +++++++-------
+ bouml/hkl/133506.bodies       |  22 +-
+ bouml/hkl/133634              |  29 +-
+ bouml/hkl/133634.bodies       | 332 +++++++++++-----------
+ bouml/hkl/133890.bodies       |   6 +-
+ bouml/hkl/134018              |  85 ++++++
+ bouml/hkl/134146.bodies       | 302 ++++++++++----------
+ bouml/hkl/134274.bodies       |  30 +-
+ bouml/hkl/134402.bodies       | 332 +++++++++++-----------
+ bouml/hkl/134786.bodies       | 104 +++----
+ bouml/hkl/135042.bodies       |  96 +++----
+ bouml/hkl/135170.bodies       |  42 +--
+ bouml/hkl/135426.bodies       | 126 ++++----
+ bouml/hkl/136194.bodies       | 178 ++++++------
+ bouml/hkl/136322.bodies       | 168 +++++------
+ bouml/hkl/136450.bodies       | 116 ++++----
+ bouml/hkl/136578.bodies       | 486 +++++++++++++++----------------
+ bouml/hkl/136706.bodies       | 262 ++++++++---------
+ bouml/hkl/136834.bodies       | 445 ++++++++++++++---------------
+ bouml/hkl/136962.bodies       | 220 +++++++-------
+ bouml/hkl/137090.bodies       | 134 ++++-----
+ bouml/hkl/138882.bodies       |  58 ++--
+ bouml/hkl/139138.bodies       | 238 ++++++++--------
+ bouml/hkl/139522.bodies       |  58 ++--
+ bouml/hkl/139650.bodies       |  70 ++---
+ bouml/hkl/139778.bodies       |  66 ++---
+ bouml/hkl/139906.bodies       |  68 ++---
+ bouml/hkl/140034.bodies       |  66 ++---
+ bouml/hkl/140162.bodies       |  18 +-
+ bouml/hkl/140290.bodies       |  16 +-
+ bouml/hkl/140418.bodies       |  12 +-
+ bouml/hkl/142466.bodies       |  42 +--
+ bouml/hkl/142594.bodies       | 496 ++++++++++++++++----------------
+ bouml/hkl/142978.bodies       | 236 +++++++--------
+ bouml/hkl/143362.bodies       |  70 ++---
+ bouml/hkl/143490.bodies       |   6 +-
+ bouml/hkl/143618.bodies       |  24 +-
+ bouml/hkl/143746.bodies       |  32 +--
+ bouml/hkl/143874.bodies       |  34 +--
+ bouml/hkl/144130.bodies       |  26 +-
+ bouml/hkl/144258.bodies       |  34 +--
+ bouml/hkl/144386.bodies       |  46 +--
+ bouml/hkl/145026.bodies       |  81 ++++++
+ bouml/hkl/2.session           |  13 +-
+ bouml/hkl/generation_settings |  18 +-
+ bouml/hkl/hkl.prj             | 146 ++++++----
  99 files changed, 5926 insertions(+), 5354 deletions(-)
 
 commit bbf71d0a147d47de061f811eee0236d3e9068ae5
@@ -11007,9 +20768,9 @@ Date:   Fri Jun 1 17:18:45 2007 +0200
 
     * now eulerian6C::pseudoAxeEngine::Tth is working.
 
- bouml/hkl/133378        |    2 +-
- bouml/hkl/136834.bodies |   81 ++++++++++++++++++++++++++++++----------------
- bouml/hkl/hkl.prj       |    4 +-
+ bouml/hkl/133378        |  2 +-
+ bouml/hkl/136834.bodies | 81 ++++++++++++++++++++++++++++++++-----------------
+ bouml/hkl/hkl.prj       |  4 +--
  3 files changed, 56 insertions(+), 31 deletions(-)
 
 commit 014738530b905c08706f30f7456e0c3e46b84d24
@@ -11018,10 +20779,10 @@ Date:   Fri Jun 1 15:34:12 2007 +0200
 
     * now parameters of the pseudoAxes can be used.
 
- src/gui/diffractometer2.glade |   54 +++++++++++++++++----
- src/gui/hklwindow.cpp         |  102 +++++++++++++++++++++++++++++++++++++++-
- src/gui/hklwindow.h           |    8 +++
- src/gui/modelcolumns.h        |   15 ++++++
+ src/gui/diffractometer2.glade |  54 +++++++++++++++++-----
+ src/gui/hklwindow.cpp         | 102 ++++++++++++++++++++++++++++++++++++++++--
+ src/gui/hklwindow.h           |   8 ++++
+ src/gui/modelcolumns.h        |  15 +++++++
  4 files changed, 165 insertions(+), 14 deletions(-)
 
 commit 32f0f6df9bf2955f7a4b74ef552b1a3d28809d68
@@ -11030,12 +20791,12 @@ Date:   Thu May 31 16:59:09 2007 +0200
 
     * rewamp the gui interface to be space econome.
 
- bouml/hkl/2.session           |    7 +-
- bouml/hkl/hkl.prj             |    4 +-
- src/gui/diffractometer2.glade |  217 ++++++++++-----------
- src/gui/hklwindow.cpp         |  430 +++++++++++++++++++++++++++++++----------
- src/gui/hklwindow.h           |   38 +++-
- src/gui/modelcolumns.h        |   47 +++++
+ bouml/hkl/2.session           |   7 +-
+ bouml/hkl/hkl.prj             |   4 +-
+ src/gui/diffractometer2.glade | 217 ++++++++++-----------
+ src/gui/hklwindow.cpp         | 430 ++++++++++++++++++++++++++++++++----------
+ src/gui/hklwindow.h           |  38 ++--
+ src/gui/modelcolumns.h        |  47 +++++
  6 files changed, 514 insertions(+), 229 deletions(-)
 
 commit 0d73aa8f2597164d365bc185e3ede943c7955eb0
@@ -11044,13 +20805,13 @@ Date:   Fri May 25 17:13:00 2007 +0200
 
     * now the gui is working
 
- bouml/hkl/135042.bodies         |    2 +
- bouml/hkl/2.session             |    5 +-
- bouml/hkl/hkl.prj               |   19 +++-
- src/gui/hklwindow.cpp           |  292 ++++++++++++++++++---------------------
- src/gui/hklwindow.h             |    2 +-
- src/gui/main.cpp                |   15 +-
- src/gui/pseudoaxespinbutton.cpp |   12 +-
+ bouml/hkl/135042.bodies         |   2 +
+ bouml/hkl/2.session             |   5 +-
+ bouml/hkl/hkl.prj               |  19 ++-
+ src/gui/hklwindow.cpp           | 292 +++++++++++++++++++---------------------
+ src/gui/hklwindow.h             |   2 +-
+ src/gui/main.cpp                |  15 ++-
+ src/gui/pseudoaxespinbutton.cpp |  12 +-
  7 files changed, 174 insertions(+), 173 deletions(-)
 
 commit d53537a617822c9f154e54bf7d59bb62e8bd4fe9
@@ -11059,11 +20820,11 @@ Date:   Thu May 24 16:56:23 2007 +0200
 
     * update the hkl::eulerian6C::pseudoAxeEngine::Tth documentation
 
- bouml/hkl/133378              |   77 ++++++++++++++++++-----------------------
- bouml/hkl/2.session           |   10 ++----
- bouml/hkl/generation_settings |    1 +
- bouml/hkl/hkl.prj             |   14 ++++----
- doc/Doxyfile                  |    4 +-
+ bouml/hkl/133378              | 77 +++++++++++++++++++------------------------
+ bouml/hkl/2.session           | 10 ++----
+ bouml/hkl/generation_settings |  1 +
+ bouml/hkl/hkl.prj             | 14 ++++----
+ doc/Doxyfile                  |  4 +--
  5 files changed, 47 insertions(+), 59 deletions(-)
 
 commit 4e8bb16e9bad46b9e8bb3fb5256199064a75f4f3
@@ -11072,117 +20833,117 @@ Date:   Fri May 11 17:00:36 2007 +0200
 
     * refactoring of the code to be diffractometer directory closer (waiting for bouml to have a relativ path to a specific directory)
 
- bouml/hkl/128002                        | 1070 +------------------------------
- bouml/hkl/128002.bodies                 |  298 +++++-----
- bouml/hkl/128060.bodies                 |   78 ++--
- bouml/hkl/128130                        |  474 --------------
+ bouml/hkl/128002                        | 1198 +++----------------------------
+ bouml/hkl/128002.bodies                 |  298 ++++----
+ bouml/hkl/128060.bodies                 |   78 +-
+ bouml/hkl/128130                        |  474 ------------
  bouml/hkl/128182.bodies                 |   60 +-
- bouml/hkl/128258                        |  382 -----------
+ bouml/hkl/128258                        |  382 ----------
  bouml/hkl/128258.diagram                |   20 +-
  bouml/hkl/128310.bodies                 |   18 +-
- bouml/hkl/128386                        |  476 --------------
- bouml/hkl/128386.diagram                |   79 ++-
+ bouml/hkl/128386                        |  476 ------------
+ bouml/hkl/128386.diagram                |   79 +-
  bouml/hkl/128514                        |   42 +-
- bouml/hkl/128514.bodies                 |  356 +++++-----
- bouml/hkl/128514.diagram                |   45 ++-
+ bouml/hkl/128514.bodies                 |  356 ++++-----
+ bouml/hkl/128514.diagram                |   45 +-
  bouml/hkl/128642                        |   42 +-
  bouml/hkl/128642.diagram                |   22 +-
  bouml/hkl/128770                        |   55 +-
- bouml/hkl/128770.bodies                 |  262 ++++----
+ bouml/hkl/128770.bodies                 |  262 +++----
  bouml/hkl/128898                        |   30 -
  bouml/hkl/128898.bodies                 |   26 +-
- bouml/hkl/129026                        |  708 --------------------
+ bouml/hkl/129026                        |  708 ------------------
  bouml/hkl/129154                        |   30 -
- bouml/hkl/129154.bodies                 |   80 ++--
- bouml/hkl/129282                        |  456 -------------
+ bouml/hkl/129154.bodies                 |   80 +--
+ bouml/hkl/129282                        |  456 ------------
  bouml/hkl/129282.bodies                 |    4 +-
  bouml/hkl/129410                        |   30 -
  bouml/hkl/129410.bodies                 |    4 +-
- bouml/hkl/129538                        |  473 --------------
+ bouml/hkl/129538                        |  473 ------------
  bouml/hkl/129538.bodies                 |    4 +-
- bouml/hkl/129666                        |  692 --------------------
+ bouml/hkl/129666                        |  692 ------------------
  bouml/hkl/129666.bodies                 |   42 +-
  bouml/hkl/129794                        |  137 ----
- bouml/hkl/129794.bodies                 |  256 ++++----
+ bouml/hkl/129794.bodies                 |  256 +++----
  bouml/hkl/129922                        |   53 +-
  bouml/hkl/129922.bodies                 |   22 +-
  bouml/hkl/130050                        |   30 -
- bouml/hkl/130050.bodies                 |   86 ++--
- bouml/hkl/130050.diagram                |   47 ++-
- bouml/hkl/130178                        |  498 --------------
- bouml/hkl/130178.bodies                 |   76 ++--
+ bouml/hkl/130050.bodies                 |   86 +--
+ bouml/hkl/130050.diagram                |   47 +-
+ bouml/hkl/130178                        |  498 -------------
+ bouml/hkl/130178.bodies                 |   76 +-
  bouml/hkl/130178.diagram                |   12 +-
  bouml/hkl/130306                        |   30 -
- bouml/hkl/130306.bodies                 |  272 ++++----
- bouml/hkl/130306.diagram                |   98 +++-
- bouml/hkl/130434                        |  234 -------
+ bouml/hkl/130306.bodies                 |  272 +++----
+ bouml/hkl/130306.diagram                |   98 ++-
+ bouml/hkl/130434                        |  234 ------
  bouml/hkl/130562                        |   30 -
- bouml/hkl/130562.diagram                |   76 ++-
+ bouml/hkl/130562.diagram                |   76 +-
  bouml/hkl/130690                        |  213 ------
  bouml/hkl/130690.diagram                |   27 +
  bouml/hkl/130818                        |  213 ------
  bouml/hkl/130818.diagram                |   34 +
  bouml/hkl/130946                        |  213 ------
- bouml/hkl/130946.diagram                |   73 +++
+ bouml/hkl/130946.diagram                |   73 ++
  bouml/hkl/131074                        |   44 +-
- bouml/hkl/131074.bodies                 |  146 +++---
- bouml/hkl/131074.diagram                |   76 +++
- bouml/hkl/131202                        |  225 +------
+ bouml/hkl/131074.bodies                 |  146 ++--
+ bouml/hkl/131074.diagram                |   76 ++
+ bouml/hkl/131202                        |  225 +-----
  bouml/hkl/131202.bodies                 |   30 +-
  bouml/hkl/131202.diagram                |   41 ++
  bouml/hkl/131330                        |  165 -----
  bouml/hkl/131330.bodies                 |  140 ++--
- bouml/hkl/131458                        |  238 -------
+ bouml/hkl/131458                        |  238 ------
  bouml/hkl/131458.bodies                 |  140 ++--
- bouml/hkl/131586                        |  227 -------
- bouml/hkl/131586.bodies                 |  632 +++++++++---------
+ bouml/hkl/131586                        |  227 ------
+ bouml/hkl/131586.bodies                 |  632 ++++++++--------
  bouml/hkl/131714                        |   33 +
- bouml/hkl/131714.bodies                 |  648 ++++++++++----------
- bouml/hkl/131842                        |  574 +++++++++++++++++
+ bouml/hkl/131714.bodies                 |  648 ++++++++---------
+ bouml/hkl/131842                        |  574 +++++++++++++++
  bouml/hkl/131842.bodies                 |  202 +++---
- bouml/hkl/131970                        |  490 ++++++++++++++
- bouml/hkl/132098                        |  509 +++++++++++++++
+ bouml/hkl/131970                        |  490 +++++++++++++
+ bouml/hkl/132098                        |  509 +++++++++++++
  bouml/hkl/132226                        |   30 +
- bouml/hkl/132354                        |  505 +++++++++++++++
- bouml/hkl/132482                        |  714 +++++++++++++++++++++
- bouml/hkl/132482.bodies                 |  166 +++---
- bouml/hkl/132610                        |  238 +++++++
- bouml/hkl/132610.bodies                 |  304 +++++-----
+ bouml/hkl/132354                        |  505 +++++++++++++
+ bouml/hkl/132482                        |  714 ++++++++++++++++++
+ bouml/hkl/132482.bodies                 |  166 ++---
+ bouml/hkl/132610                        |  238 ++++++
+ bouml/hkl/132610.bodies                 |  304 ++++----
  bouml/hkl/132738                        |   33 +
  bouml/hkl/132738.bodies                 |   20 +-
  bouml/hkl/132866                        |  208 ++++++
- bouml/hkl/132866.bodies                 |  226 ++++----
- bouml/hkl/132994                        |  517 +++++++++++++++
- bouml/hkl/132994.bodies                 |  264 ++++----
- bouml/hkl/133122                        |  642 ++++++++++++++++++
- bouml/hkl/133122.bodies                 |   78 ++--
- bouml/hkl/133250                        |  743 +++++++++++++++++++++
- bouml/hkl/133378                        |  706 ++++++++++++++++++++
+ bouml/hkl/132866.bodies                 |  226 +++---
+ bouml/hkl/132994                        |  517 +++++++++++++
+ bouml/hkl/132994.bodies                 |  264 +++----
+ bouml/hkl/133122                        |  642 +++++++++++++++++
+ bouml/hkl/133122.bodies                 |   78 +-
+ bouml/hkl/133250                        |  743 +++++++++++++++++++
+ bouml/hkl/133378                        |  706 ++++++++++++++++++
  bouml/hkl/133378.bodies                 |  210 +++---
  bouml/hkl/133506                        |  207 ++++++
  bouml/hkl/133506.bodies                 |   22 +-
- bouml/hkl/133634                        |  726 +++++++++++++++++++++
- bouml/hkl/133634.bodies                 |  332 +++++-----
- bouml/hkl/133762                        |  183 ++++++
+ bouml/hkl/133634                        |  726 +++++++++++++++++++
+ bouml/hkl/133634.bodies                 |  332 ++++-----
+ bouml/hkl/133762                        |  183 +++++
  bouml/hkl/133890                        |  207 ++++++
  bouml/hkl/133890.bodies                 |    8 +-
- bouml/hkl/134146.bodies                 |  302 +++++-----
+ bouml/hkl/134146.bodies                 |  302 ++++----
  bouml/hkl/134274.bodies                 |   32 +-
- bouml/hkl/134402.bodies                 |  334 +++++-----
- bouml/hkl/134786.bodies                 |  104 ++--
- bouml/hkl/135042.bodies                 |   92 ++--
+ bouml/hkl/134402.bodies                 |  334 ++++-----
+ bouml/hkl/134786.bodies                 |  104 +--
+ bouml/hkl/135042.bodies                 |   92 +--
  bouml/hkl/135170.bodies                 |   42 +-
  bouml/hkl/135426.bodies                 |  126 ++--
- bouml/hkl/136194.bodies                 |  180 +++---
- bouml/hkl/136322.bodies                 |  170 +++---
- bouml/hkl/136450.bodies                 |  118 ++--
- bouml/hkl/136578.bodies                 |  488 +++++++-------
- bouml/hkl/136706.bodies                 |  264 ++++----
- bouml/hkl/136834.bodies                 |  410 ++++++------
- bouml/hkl/136962.bodies                 |  222 ++++----
+ bouml/hkl/136194.bodies                 |  180 ++---
+ bouml/hkl/136322.bodies                 |  170 ++---
+ bouml/hkl/136450.bodies                 |  118 +--
+ bouml/hkl/136578.bodies                 |  488 ++++++-------
+ bouml/hkl/136706.bodies                 |  264 +++----
+ bouml/hkl/136834.bodies                 |  410 +++++------
+ bouml/hkl/136962.bodies                 |  222 +++---
  bouml/hkl/137090.bodies                 |  134 ++--
  bouml/hkl/138882.bodies                 |   58 +-
- bouml/hkl/139138.bodies                 |  241 ++++----
+ bouml/hkl/139138.bodies                 |  241 +++----
  bouml/hkl/139522.bodies                 |   58 +-
  bouml/hkl/139650.bodies                 |   70 +-
  bouml/hkl/139778.bodies                 |   66 +-
@@ -11192,8 +20953,8 @@ Date:   Fri May 11 17:00:36 2007 +0200
  bouml/hkl/140290.bodies                 |   16 +-
  bouml/hkl/140418.bodies                 |   12 +-
  bouml/hkl/142466.bodies                 |   42 +-
- bouml/hkl/142594.bodies                 |  496 +++++++-------
- bouml/hkl/142978.bodies                 |  242 ++++----
+ bouml/hkl/142594.bodies                 |  496 ++++++-------
+ bouml/hkl/142978.bodies                 |  242 +++----
  bouml/hkl/143362.bodies                 |   70 +-
  bouml/hkl/143490.bodies                 |    6 +-
  bouml/hkl/143618.bodies                 |   30 +-
@@ -11204,52 +20965,52 @@ Date:   Fri May 11 17:00:36 2007 +0200
  bouml/hkl/144386.bodies                 |   48 +-
  bouml/hkl/2.session                     |   10 +-
  bouml/hkl/generation_settings           |    1 +
- bouml/hkl/hkl.prj                       |  454 ++++++++-----
+ bouml/hkl/hkl.prj                       |  454 +++++++-----
  src/SConscript                          |   32 +-
- test/affinement_simplex_test.cpp        |  110 ++--
+ test/affinement_simplex_test.cpp        |  110 +--
  test/affinement_simplex_test.h          |    9 +-
  test/diffractometer_eulerian4C_test.cpp |    4 +-
  test/diffractometer_eulerian4C_test.h   |    2 +-
- test/diffractometer_kappa4C_test.cpp    |   80 ++--
+ test/diffractometer_kappa4C_test.cpp    |   80 +--
  test/diffractometer_kappa4C_test.h      |    4 +-
- test/diffractometer_kappa6C_test.cpp    |  108 ++--
+ test/diffractometer_kappa6C_test.cpp    |  108 +--
  test/diffractometer_kappa6C_test.h      |    4 +-
  test/diffractometer_twoC_test.cpp       |  136 ++--
  test/diffractometer_twoC_test.h         |    7 +-
  test/geometry_eulerian4C_test.cpp       |   34 +-
  test/geometry_eulerian4C_test.h         |    4 +-
- test/geometry_eulerian6C_test.cpp       |  215 +++----
+ test/geometry_eulerian6C_test.cpp       |  215 +++---
  test/geometry_eulerian6C_test.h         |    6 +-
- test/geometry_kappa4C_test.cpp          |  176 +++---
+ test/geometry_kappa4C_test.cpp          |  176 ++---
  test/geometry_kappa4C_test.h            |    6 +-
  test/geometry_kappa6C_test.cpp          |  144 ++--
  test/geometry_kappa6C_test.h            |    6 +-
  test/geometry_twoC_test.cpp             |  120 ++--
  test/geometry_twoC_test.h               |    8 +-
- test/mode_eulerian4C_test.cpp           |  100 ++--
+ test/mode_eulerian4C_test.cpp           |  100 +--
  test/mode_eulerian4C_test.h             |    4 +-
- test/mode_kappa4C_test.cpp              |  192 +++---
+ test/mode_kappa4C_test.cpp              |  192 ++---
  test/mode_kappa4C_test.h                |    7 +-
- test/mode_kappa6C_test.cpp              |  236 ++++----
+ test/mode_kappa6C_test.cpp              |  236 +++---
  test/mode_kappa6C_test.h                |    7 +-
- test/mode_twoC_test.cpp                 |   84 ++--
+ test/mode_twoC_test.cpp                 |   84 +--
  test/mode_twoC_test.h                   |    8 +-
- test/pseudoaxe_eulerian4C_test.cpp      |  380 ++++++------
+ test/pseudoaxe_eulerian4C_test.cpp      |  380 +++++-----
  test/pseudoaxe_eulerian4C_test.h        |    7 +-
- test/pseudoaxe_eulerian6C_test.cpp      |  362 ++++++------
+ test/pseudoaxe_eulerian6C_test.cpp      |  362 +++++-----
  test/pseudoaxe_eulerian6C_test.h        |    8 +-
- test/pseudoaxe_kappa4C_test.cpp         |  528 ++++++++--------
+ test/pseudoaxe_kappa4C_test.cpp         |  528 +++++++-------
  test/pseudoaxe_kappa4C_test.h           |   10 +-
- test/pseudoaxe_kappa6C_test.cpp         |  516 ++++++++--------
+ test/pseudoaxe_kappa6C_test.cpp         |  516 ++++++-------
  test/pseudoaxe_kappa6C_test.h           |   14 +-
- test/pseudoaxe_twoC_test.cpp            |  180 +++---
+ test/pseudoaxe_twoC_test.cpp            |  180 ++---
  test/pseudoaxe_twoC_test.h              |    8 +-
  test/reflection_test.cpp                |    2 +-
  test/reflection_test.h                  |    4 +-
  test/reflectionlist_test.h              |    4 +-
  test/sample_test.h                      |    4 +-
  test/samplelist_test.h                  |    4 +-
- 177 files changed, 15337 insertions(+), 14724 deletions(-)
+ 177 files changed, 15401 insertions(+), 14788 deletions(-)
 
 commit cc030b9807c4c5c8f184931fba900fddc9f3ba17
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11257,10 +21018,10 @@ Date:   Thu Mar 15 14:41:47 2007 +0100
 
     * add the PseudoAxeList::printToStream
 
- bouml/hkl/134786.bodies |    2 ++
- bouml/hkl/135042.bodies |    9 +++++++++
- bouml/hkl/2.session     |    6 ++----
- bouml/hkl/hkl.prj       |   31 ++++++++++++++++++++++++++++++-
+ bouml/hkl/134786.bodies |  2 ++
+ bouml/hkl/135042.bodies |  9 +++++++++
+ bouml/hkl/2.session     |  6 ++----
+ bouml/hkl/hkl.prj       | 31 ++++++++++++++++++++++++++++++-
  4 files changed, 43 insertions(+), 5 deletions(-)
 
 commit e8fb75079abc87d88bda61824cd7af2ffd337f74
@@ -11269,29 +21030,29 @@ Date:   Tue Mar 13 10:53:19 2007 +0100
 
     * add the tests for PseudoAxe::set_write_from_read
 
- bouml/hkl/128770                   |    4 +-
- bouml/hkl/129026                   |    8 +-
- bouml/hkl/129282                   |    4 +-
- bouml/hkl/129538                   |    4 +-
- bouml/hkl/129666                   |    6 +-
- bouml/hkl/134786.bodies            |    4 +-
- bouml/hkl/135042.bodies            |    4 +-
- bouml/hkl/136194.bodies            |    6 +-
- bouml/hkl/136322.bodies            |    6 +-
- bouml/hkl/136450.bodies            |    5 +-
- bouml/hkl/136578.bodies            |    5 +-
- bouml/hkl/136706.bodies            |    9 +-
- bouml/hkl/136834.bodies            |    6 +-
- bouml/hkl/136962.bodies            |    6 +-
- bouml/hkl/137090.bodies            |    4 +-
- bouml/hkl/2.session                |    7 +-
- bouml/hkl/hkl.prj                  |    8 +-
- config-linux2.py                   |    1 +
- test/pseudoaxe_eulerian4C_test.cpp |  111 +++++++++++++++++++++-
- test/pseudoaxe_eulerian6C_test.cpp |   91 ++++++++++++++++++
- test/pseudoaxe_kappa4C_test.cpp    |  182 ++++++++++++++++++++++++++++++++++++
- test/pseudoaxe_kappa6C_test.cpp    |  180 +++++++++++++++++++++++++++++++++++
- test/pseudoaxe_twoC_test.cpp       |   66 +++++++++++++
+ bouml/hkl/128770                   |   4 +-
+ bouml/hkl/129026                   |   8 +-
+ bouml/hkl/129282                   |   4 +-
+ bouml/hkl/129538                   |   4 +-
+ bouml/hkl/129666                   |   6 +-
+ bouml/hkl/134786.bodies            |   4 +-
+ bouml/hkl/135042.bodies            |   4 +-
+ bouml/hkl/136194.bodies            |   6 +-
+ bouml/hkl/136322.bodies            |   6 +-
+ bouml/hkl/136450.bodies            |   5 +-
+ bouml/hkl/136578.bodies            |   5 +-
+ bouml/hkl/136706.bodies            |   9 +-
+ bouml/hkl/136834.bodies            |   6 +-
+ bouml/hkl/136962.bodies            |   6 +-
+ bouml/hkl/137090.bodies            |   4 +-
+ bouml/hkl/2.session                |   7 +-
+ bouml/hkl/hkl.prj                  |   8 +-
+ config-linux2.py                   |   1 +
+ test/pseudoaxe_eulerian4C_test.cpp | 111 +++++++++++++++++++++-
+ test/pseudoaxe_eulerian6C_test.cpp |  91 +++++++++++++++++++
+ test/pseudoaxe_kappa4C_test.cpp    | 182 +++++++++++++++++++++++++++++++++++++
+ test/pseudoaxe_kappa6C_test.cpp    | 180 ++++++++++++++++++++++++++++++++++++
+ test/pseudoaxe_twoC_test.cpp       |  66 ++++++++++++++
  23 files changed, 681 insertions(+), 46 deletions(-)
 
 commit 54ac249a1b1c3b1d5fac5567fdeb03c2169d6d12
@@ -11301,23 +21062,23 @@ Date:   Mon Mar 12 16:17:16 2007 +0100
     * add an operation to update the write part of pseudoAxes from the read part.
     * add an operation to PseudoAxe to get the read and the write part.
 
- bouml/hkl/128770        |   15 ++++++++++-
- bouml/hkl/129026        |   41 +++++++++++++++++++++++++++++-
- bouml/hkl/129282        |   15 ++++++++++-
- bouml/hkl/129538        |   15 ++++++++++-
- bouml/hkl/129666        |   28 ++++++++++++++++++++-
- bouml/hkl/134786.bodies |   20 ++++++++++++--
- bouml/hkl/135042.bodies |    8 ++++++
- bouml/hkl/136194.bodies |    2 +
- bouml/hkl/136322.bodies |    2 +
- bouml/hkl/136450.bodies |    2 +
- bouml/hkl/136578.bodies |    2 +
- bouml/hkl/136706.bodies |    4 +++
- bouml/hkl/136834.bodies |    2 +
- bouml/hkl/136962.bodies |    2 +
- bouml/hkl/137090.bodies |    2 +
- bouml/hkl/2.session     |    9 +-----
- bouml/hkl/hkl.prj       |   63 ++++++++++++++++++++++++++++++++++++++++++++--
+ bouml/hkl/128770        | 15 +++++++++++-
+ bouml/hkl/129026        | 41 +++++++++++++++++++++++++++++++-
+ bouml/hkl/129282        | 15 +++++++++++-
+ bouml/hkl/129538        | 15 +++++++++++-
+ bouml/hkl/129666        | 28 +++++++++++++++++++++-
+ bouml/hkl/134786.bodies | 20 +++++++++++++---
+ bouml/hkl/135042.bodies |  8 +++++++
+ bouml/hkl/136194.bodies |  2 ++
+ bouml/hkl/136322.bodies |  2 ++
+ bouml/hkl/136450.bodies |  2 ++
+ bouml/hkl/136578.bodies |  2 ++
+ bouml/hkl/136706.bodies |  4 ++++
+ bouml/hkl/136834.bodies |  2 ++
+ bouml/hkl/136962.bodies |  2 ++
+ bouml/hkl/137090.bodies |  2 ++
+ bouml/hkl/2.session     |  9 ++-----
+ bouml/hkl/hkl.prj       | 63 ++++++++++++++++++++++++++++++++++++++++++++++---
  17 files changed, 214 insertions(+), 18 deletions(-)
 
 commit 498f72e2739f18798bbb9c71203062ad732ed98b
@@ -11326,10 +21087,10 @@ Date:   Tue Mar 6 15:38:38 2007 +0100
 
     * check that all derived PseudoAxes of "psi" are working.
 
- bouml/hkl/2.session                |    4 ++--
- bouml/hkl/hkl.prj                  |    4 ++--
- test/SConscript                    |   12 ++++++------
- test/pseudoaxe_eulerian4C_test.cpp |    1 -
+ bouml/hkl/2.session                |  4 ++--
+ bouml/hkl/hkl.prj                  |  4 ++--
+ test/SConscript                    | 12 ++++++------
+ test/pseudoaxe_eulerian4C_test.cpp |  1 -
  4 files changed, 10 insertions(+), 11 deletions(-)
 
 commit 3301696015b8ad67169a936b895d8186790e9d85
@@ -11338,12 +21099,12 @@ Date:   Tue Mar 6 15:32:55 2007 +0100
 
     * now the "psi" pseudoAxis is working with a desorientation parameter.
 
- bouml/hkl/128002.bodies            |    4 +++-
- bouml/hkl/129282                   |    2 +-
- bouml/hkl/136578.bodies            |   31 +++++++++++++++++++++++--------
- bouml/hkl/2.session                |    5 +++--
- bouml/hkl/hkl.prj                  |    2 +-
- test/pseudoaxe_eulerian4C_test.cpp |   11 ++++-------
+ bouml/hkl/128002.bodies            |  4 +++-
+ bouml/hkl/129282                   |  2 +-
+ bouml/hkl/136578.bodies            | 31 +++++++++++++++++++++++--------
+ bouml/hkl/2.session                |  5 +++--
+ bouml/hkl/hkl.prj                  |  2 +-
+ test/pseudoaxe_eulerian4C_test.cpp | 11 ++++-------
  6 files changed, 35 insertions(+), 20 deletions(-)
 
 commit 9a0c3c99dec075d87d983e65d24c5ec622bdfb13
@@ -11352,14 +21113,14 @@ Date:   Mon Mar 5 17:43:43 2007 +0100
 
     * works on the Psi pseudoAxe.
 
- bouml/hkl/128386.diagram           |   41 ++++++++++++++++++++++-------------
- bouml/hkl/129282                   |   11 ++++++++-
- bouml/hkl/136578.bodies            |   18 ++++++++++++---
- bouml/hkl/2.session                |    8 +++---
- bouml/hkl/hkl.prj                  |    6 ++--
- config-linux2.py                   |    1 -
- test/SConscript                    |   12 +++++-----
- test/pseudoaxe_eulerian4C_test.cpp |   23 ++++++++++++--------
+ bouml/hkl/128386.diagram           | 41 ++++++++++++++++++++++++--------------
+ bouml/hkl/129282                   | 11 +++++++++-
+ bouml/hkl/136578.bodies            | 18 +++++++++++++----
+ bouml/hkl/2.session                |  8 ++++----
+ bouml/hkl/hkl.prj                  |  6 +++---
+ config-linux2.py                   |  1 -
+ test/SConscript                    | 12 +++++------
+ test/pseudoaxe_eulerian4C_test.cpp | 23 ++++++++++++---------
  8 files changed, 77 insertions(+), 43 deletions(-)
 
 commit 238b299f071a228c4d137caddf9858e96af7f0b9
@@ -11368,8 +21129,8 @@ Date:   Mon Mar 5 12:05:38 2007 +0100
 
     * add the CVS Makefile.vc
 
- src/Makefile.vc |   85 +++++++++++++++++++++++++++++++++++++------------------
- 1 files changed, 57 insertions(+), 28 deletions(-)
+ src/Makefile.vc | 85 ++++++++++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 57 insertions(+), 28 deletions(-)
 
 commit 68d5ecba8136571f1ff688b370a4fad7607da095
 Author: Frédéric-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11378,24 +21139,24 @@ Date:   Mon Mar 5 11:06:36 2007 +0100
     * set _current = NULL in ModeList constructor.
     * add the relatedAxes in the PseudoAxeEngines
 
- bouml/hkl/128130        |    2 +-
- bouml/hkl/128770        |    2 +-
- bouml/hkl/129026        |    2 +-
- bouml/hkl/129282        |    3 +-
- bouml/hkl/129538        |    2 +-
- bouml/hkl/129666        |    2 +-
- bouml/hkl/129922        |    2 +-
- bouml/hkl/136194.bodies |    4 ++
- bouml/hkl/136322.bodies |    4 ++
- bouml/hkl/136450.bodies |    3 ++
- bouml/hkl/136578.bodies |    7 ++++
- bouml/hkl/136706.bodies |    5 +++
- bouml/hkl/136834.bodies |   79 ++++++++++++++++++++++++----------------------
- bouml/hkl/136962.bodies |    5 ++-
- bouml/hkl/137090.bodies |    9 +++++
- bouml/hkl/140418.bodies |    2 +-
- bouml/hkl/2.session     |    5 +--
- bouml/hkl/hkl.prj       |   47 ++++++++++++++-------------
+ bouml/hkl/128130        |  2 +-
+ bouml/hkl/128770        |  2 +-
+ bouml/hkl/129026        |  2 +-
+ bouml/hkl/129282        |  3 +-
+ bouml/hkl/129538        |  2 +-
+ bouml/hkl/129666        |  2 +-
+ bouml/hkl/129922        |  2 +-
+ bouml/hkl/136194.bodies |  4 +++
+ bouml/hkl/136322.bodies |  4 +++
+ bouml/hkl/136450.bodies |  3 ++
+ bouml/hkl/136578.bodies |  7 +++++
+ bouml/hkl/136706.bodies |  5 ++++
+ bouml/hkl/136834.bodies | 79 +++++++++++++++++++++++++------------------------
+ bouml/hkl/136962.bodies |  5 +++-
+ bouml/hkl/137090.bodies |  9 ++++++
+ bouml/hkl/140418.bodies |  2 +-
+ bouml/hkl/2.session     |  5 +---
+ bouml/hkl/hkl.prj       | 47 +++++++++++++++--------------
  18 files changed, 110 insertions(+), 75 deletions(-)
 
 commit 0e7fe107e916139c88f9bc7e118cab95f5b29889
@@ -11404,10 +21165,10 @@ Date:   Tue Feb 27 15:44:22 2007 +0100
 
     * small bug before 2.3.0
 
- bouml/hkl/128258        |    2 +-
- bouml/hkl/134786.bodies |    2 ++
- bouml/hkl/2.session     |    7 ++++---
- bouml/hkl/hkl.prj       |   25 ++++++++++++++++++++++---
+ bouml/hkl/128258        |  2 +-
+ bouml/hkl/134786.bodies |  2 ++
+ bouml/hkl/2.session     |  7 ++++---
+ bouml/hkl/hkl.prj       | 25 ++++++++++++++++++++++---
  4 files changed, 29 insertions(+), 7 deletions(-)
 
 commit f5eed0256c2fd59edcb708e19c3862445d9f843e
@@ -11416,12 +21177,12 @@ Date:   Mon Feb 26 13:50:34 2007 +0100
 
     * remove a bug in the eulerian4C diffractometer
 
- bouml/hkl/130178        |    2 +-
- bouml/hkl/131458        |    6 ++++--
- bouml/hkl/131586        |    2 +-
- bouml/hkl/143746.bodies |    6 +++---
- bouml/hkl/2.session     |    6 ++++--
- bouml/hkl/hkl.prj       |    2 +-
+ bouml/hkl/130178        | 2 +-
+ bouml/hkl/131458        | 6 ++++--
+ bouml/hkl/131586        | 2 +-
+ bouml/hkl/143746.bodies | 6 +++---
+ bouml/hkl/2.session     | 6 ++++--
+ bouml/hkl/hkl.prj       | 2 +-
  6 files changed, 14 insertions(+), 10 deletions(-)
 
 commit 45bfdbda543d11511fc68eaf050493868e1cddab
@@ -11430,11 +21191,11 @@ Date:   Mon Feb 26 13:40:31 2007 +0100
 
     * remove unnecessary files.
 
- bouml/hkl/2.session               |    5 +-
- include/hkl/enums.h               |   38 ---
- include/hkl/myvector.h            |  605 -------------------------------------
- src/HKLException.cpp              |  126 --------
- src/diffractometer_eulerian4C.cpp |   42 ---
+ bouml/hkl/2.session               |   5 +-
+ include/hkl/enums.h               |  38 ---
+ include/hkl/myvector.h            | 605 --------------------------------------
+ src/HKLException.cpp              | 126 --------
+ src/diffractometer_eulerian4C.cpp |  42 ---
  5 files changed, 2 insertions(+), 814 deletions(-)
 
 commit 5d2f339fa282de88d8ecc84a1311da92edd8c40f
@@ -11443,10 +21204,10 @@ Date:   Mon Feb 26 13:13:15 2007 +0100
 
     * Clean the SampleList
 
- bouml/hkl/128188.diagram |    4 ++--
- bouml/hkl/134402.bodies  |   18 ++----------------
- bouml/hkl/2.session      |    5 +++--
- bouml/hkl/hkl.prj        |   25 +++----------------------
+ bouml/hkl/128188.diagram |  4 ++--
+ bouml/hkl/134402.bodies  | 18 ++----------------
+ bouml/hkl/2.session      |  5 +++--
+ bouml/hkl/hkl.prj        | 25 +++----------------------
  4 files changed, 10 insertions(+), 42 deletions(-)
 
 commit d85184ac45f855736bf4882a35955eb324e95b99
@@ -11463,10 +21224,10 @@ Date:   Thu Feb 22 17:42:34 2007 +0100
  bouml/hkl/130562.diagram                |   20 +
  bouml/hkl/130818                        |    2 +-
  bouml/hkl/131074.bodies                 |   20 +-
- bouml/hkl/131202                        |  246 ++++
- bouml/hkl/131330                        |  165 +++
- bouml/hkl/131458                        |  236 ++++
- bouml/hkl/131586                        |  227 ++++
+ bouml/hkl/131202                        |  246 +
+ bouml/hkl/131330                        |  165 +
+ bouml/hkl/131458                        |  236 +
+ bouml/hkl/131586                        |  227 +
  bouml/hkl/131714.bodies                 |    2 +
  bouml/hkl/134402.bodies                 |   27 +-
  bouml/hkl/143362.bodies                 |   41 +
@@ -11478,15 +21239,15 @@ Date:   Thu Feb 22 17:42:34 2007 +0100
  bouml/hkl/144258.bodies                 |   20 +
  bouml/hkl/144386.bodies                 |   25 +
  bouml/hkl/2.session                     |   10 +-
- bouml/hkl/hkl.prj                       | 2002 +++++++++++++++++++++----------
- include/hkl/diffractometer.h            |  306 -----
- include/hkl/diffractometer_eulerian4C.h |  145 ---
- include/hkl/diffractometer_eulerian6C.h |   74 --
- include/hkl/diffractometer_kappa4C.h    |  137 ---
+ bouml/hkl/hkl.prj                       | 8306 +++++++++++++++++--------------
+ include/hkl/diffractometer.h            |  306 --
+ include/hkl/diffractometer_eulerian4C.h |  145 -
+ include/hkl/diffractometer_eulerian6C.h |   74 -
+ include/hkl/diffractometer_kappa4C.h    |  137 -
  include/hkl/diffractometer_kappa6C.h    |   42 -
- include/hkl/diffractometer_twoC.h       |   74 --
+ include/hkl/diffractometer_twoC.h       |   74 -
  include/hkl/diffractometerfactory.h     |   40 -
- src/diffractometer.cpp                  |   68 --
+ src/diffractometer.cpp                  |   68 -
  src/diffractometer_eulerian6C.cpp       |   35 -
  src/diffractometer_kappa4C.cpp          |   43 -
  src/diffractometer_kappa6C.cpp          |   39 -
@@ -11496,7 +21257,7 @@ Date:   Thu Feb 22 17:42:34 2007 +0100
  test/diffractometer_kappa4C_test.cpp    |   27 +-
  test/diffractometer_kappa6C_test.cpp    |   22 +-
  test/diffractometer_twoC_test.cpp       |   14 +-
- 41 files changed, 2641 insertions(+), 1756 deletions(-)
+ 41 files changed, 5793 insertions(+), 4908 deletions(-)
 
 commit 09463a8c9eb9f8f5219cdfdb52137a244de64703
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11504,23 +21265,23 @@ Date:   Wed Feb 21 15:14:46 2007 +0100
 
     * Add the affinement part to bouml.
 
- bouml/hkl/128188.diagram         |   39 ++-
- bouml/hkl/129282                 |    5 +-
- bouml/hkl/129794.diagram         |   13 +
- bouml/hkl/131074                 |  182 +++++++++
- bouml/hkl/142466.bodies          |   25 ++
- bouml/hkl/142594.bodies          |  282 ++++++++++++++
- bouml/hkl/142978.bodies          |  137 +++++++
- bouml/hkl/2.session              |    9 +-
- bouml/hkl/cpp_includes           |    3 +
- bouml/hkl/hkl.prj                |  767 +++++++++++++++++++++++++++++++++++++-
- include/hkl/affinement.h         |  172 ---------
- include/hkl/affinementlist.h     |  102 -----
- src/affinement.cpp               |   48 ---
- src/affinement_simplex.cpp       |  313 ----------------
- src/affinementlist.cpp           |  134 -------
- test/affinement_simplex_test.cpp |   10 +-
- test/affinement_simplex_test.h   |    2 +-
+ bouml/hkl/128188.diagram         |  39 +-
+ bouml/hkl/129282                 |   5 +-
+ bouml/hkl/129794.diagram         |  13 +
+ bouml/hkl/131074                 | 182 ++++++++++
+ bouml/hkl/142466.bodies          |  25 ++
+ bouml/hkl/142594.bodies          | 282 ++++++++++++++
+ bouml/hkl/142978.bodies          | 137 +++++++
+ bouml/hkl/2.session              |   9 +-
+ bouml/hkl/cpp_includes           |   3 +
+ bouml/hkl/hkl.prj                | 767 ++++++++++++++++++++++++++++++++++++++-
+ include/hkl/affinement.h         | 172 ---------
+ include/hkl/affinementlist.h     | 102 ------
+ src/affinement.cpp               |  48 ---
+ src/affinement_simplex.cpp       | 313 ----------------
+ src/affinementlist.cpp           | 134 -------
+ test/affinement_simplex_test.cpp |  10 +-
+ test/affinement_simplex_test.h   |   2 +-
  17 files changed, 1443 insertions(+), 800 deletions(-)
 
 commit 1f547b2a818b33dff1fe378289732461d4caf463
@@ -11529,10 +21290,10 @@ Date:   Tue Feb 20 14:30:17 2007 +0100
 
     * remove a bug to compile with VC6
 
- bouml/hkl/129922    |    4 ++--
- bouml/hkl/130946    |    2 +-
- bouml/hkl/2.session |    2 +-
- bouml/hkl/hkl.prj   |    2 +-
+ bouml/hkl/129922    | 4 ++--
+ bouml/hkl/130946    | 2 +-
+ bouml/hkl/2.session | 2 +-
+ bouml/hkl/hkl.prj   | 2 +-
  4 files changed, 5 insertions(+), 5 deletions(-)
 
 commit 94dd848f6507d898fb69823db99397fa6668c668
@@ -11541,56 +21302,56 @@ Date:   Tue Feb 20 14:11:37 2007 +0100
 
     * add all Modes to bouml
 
- bouml/hkl/128770                  |    2 +-
- bouml/hkl/128898.diagram          |   33 ++
- bouml/hkl/129026.diagram          |   66 ++++
- bouml/hkl/129154.diagram          |   24 ++
- bouml/hkl/129282.diagram          |   15 +
- bouml/hkl/129410.diagram          |   41 +++
- bouml/hkl/129538                  |    2 +-
- bouml/hkl/129538.diagram          |   41 +++
- bouml/hkl/129666.diagram          |   41 +++
- bouml/hkl/129922                  |  191 +++++++++++
- bouml/hkl/130050                  |   30 ++
- bouml/hkl/130178                  |  498 +++++++++++++++++++++++++++
- bouml/hkl/130306                  |   30 ++
- bouml/hkl/130434                  |  234 +++++++++++++
- bouml/hkl/130562                  |   30 ++
- bouml/hkl/130690                  |  213 ++++++++++++
- bouml/hkl/130818                  |  213 ++++++++++++
- bouml/hkl/130946                  |  213 ++++++++++++
- bouml/hkl/138882.bodies           |   32 ++
- bouml/hkl/139138.bodies           |  137 ++++++++
- bouml/hkl/139522.bodies           |   31 ++
- bouml/hkl/139650.bodies           |   38 ++
- bouml/hkl/139778.bodies           |   36 ++
- bouml/hkl/139906.bodies           |   37 ++
- bouml/hkl/140034.bodies           |   36 ++
- bouml/hkl/140162.bodies           |   11 +
- bouml/hkl/140290.bodies           |   10 +
- bouml/hkl/140418.bodies           |   10 +
- bouml/hkl/2.session               |   11 +-
- bouml/hkl/hkl.prj                 |  685 ++++++++++++++++++++++++++++++++++++-
- include/hkl/derivedmode.h         |   56 ---
- include/hkl/mode.h                |  162 ---------
- include/hkl/mode_eulerian4C.h     |  112 ------
- include/hkl/mode_eulerian6C.h     |   74 ----
- include/hkl/mode_kappa4C.h        |   31 --
- include/hkl/mode_kappa6C.h        |   31 --
- include/hkl/mode_twoC.h           |   58 ----
- include/hkl/modelist.h            |  102 ------
- src/SConscript                    |    1 -
- src/diffractometer_eulerian6C.cpp |   10 +-
- src/diffractometer_kappa4C.cpp    |   10 +-
- src/diffractometer_kappa6C.cpp    |   10 +-
- src/mode.cpp                      |   14 -
- src/mode_eulerian4C.cpp           |  268 ---------------
- src/mode_eulerian6C.cpp           |  438 ------------------------
- src/mode_twoC.cpp                 |   68 ----
- src/modelist.cpp                  |  134 --------
- test/mode_kappa4C_test.cpp        |   20 +-
- test/mode_kappa6C_test.cpp        |   20 +-
- 49 files changed, 3015 insertions(+), 1595 deletions(-)
+ bouml/hkl/128770                  |   2 +-
+ bouml/hkl/128898.diagram          |  33 ++
+ bouml/hkl/129026.diagram          |  66 +++
+ bouml/hkl/129154.diagram          |  24 ++
+ bouml/hkl/129282.diagram          |  15 +
+ bouml/hkl/129410.diagram          |  41 ++
+ bouml/hkl/129538                  |   2 +-
+ bouml/hkl/129538.diagram          |  41 ++
+ bouml/hkl/129666.diagram          |  41 ++
+ bouml/hkl/129922                  | 191 +++++++++
+ bouml/hkl/130050                  |  30 ++
+ bouml/hkl/130178                  | 498 ++++++++++++++++++++++
+ bouml/hkl/130306                  |  30 ++
+ bouml/hkl/130434                  | 234 ++++++++++
+ bouml/hkl/130562                  |  30 ++
+ bouml/hkl/130690                  | 213 +++++++++
+ bouml/hkl/130818                  | 213 +++++++++
+ bouml/hkl/130946                  | 213 +++++++++
+ bouml/hkl/138882.bodies           |  32 ++
+ bouml/hkl/139138.bodies           | 137 ++++++
+ bouml/hkl/139522.bodies           |  31 ++
+ bouml/hkl/139650.bodies           |  38 ++
+ bouml/hkl/139778.bodies           |  36 ++
+ bouml/hkl/139906.bodies           |  37 ++
+ bouml/hkl/140034.bodies           |  36 ++
+ bouml/hkl/140162.bodies           |  11 +
+ bouml/hkl/140290.bodies           |  10 +
+ bouml/hkl/140418.bodies           |  10 +
+ bouml/hkl/2.session               |  11 +-
+ bouml/hkl/hkl.prj                 | 877 +++++++++++++++++++++++++++++++++-----
+ include/hkl/derivedmode.h         |  56 ---
+ include/hkl/mode.h                | 162 -------
+ include/hkl/mode_eulerian4C.h     | 112 -----
+ include/hkl/mode_eulerian6C.h     |  74 ----
+ include/hkl/mode_kappa4C.h        |  31 --
+ include/hkl/mode_kappa6C.h        |  31 --
+ include/hkl/mode_twoC.h           |  58 ---
+ include/hkl/modelist.h            | 102 -----
+ src/SConscript                    |   1 -
+ src/diffractometer_eulerian6C.cpp |  10 +-
+ src/diffractometer_kappa4C.cpp    |  10 +-
+ src/diffractometer_kappa6C.cpp    |  10 +-
+ src/mode.cpp                      |  14 -
+ src/mode_eulerian4C.cpp           | 268 ------------
+ src/mode_eulerian6C.cpp           | 438 -------------------
+ src/mode_twoC.cpp                 |  68 ---
+ src/modelist.cpp                  | 134 ------
+ test/mode_kappa4C_test.cpp        |  20 +-
+ test/mode_kappa6C_test.cpp        |  20 +-
+ 49 files changed, 3111 insertions(+), 1691 deletions(-)
 
 commit 0ac640f75188e070b51dea8b298a9e5f502fc67b
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11598,8 +21359,8 @@ Date:   Mon Feb 19 11:39:25 2007 +0100
 
     * remove some VC6 bugs
 
- test/diffractometer_kappa6C_test.cpp |   12 ++++++------
- test/pseudoaxe_twoC_test.cpp         |    4 ++--
+ test/diffractometer_kappa6C_test.cpp | 12 ++++++------
+ test/pseudoaxe_twoC_test.cpp         |  4 ++--
  2 files changed, 8 insertions(+), 8 deletions(-)
 
 commit b7aed1e90fb1943b08d7fddac590d91da7249521
@@ -11622,7 +21383,7 @@ Date:   Mon Feb 19 11:19:11 2007 +0100
  bouml/hkl/131714.bodies              |    1 -
  bouml/hkl/133378.bodies              |    1 -
  bouml/hkl/135426.bodies              |   21 +-
- bouml/hkl/hkl.prj                    | 2566 +++++++++++++++++-----------------
+ bouml/hkl/hkl.prj                    | 6072 +++++++++++++++++-----------------
  config-linux2.py                     |    1 +
  include/hkl/affinementlist.h         |    2 +-
  include/hkl/diffractometer.h         |    4 +-
@@ -11639,7 +21400,7 @@ Date:   Mon Feb 19 11:19:11 2007 +0100
  test/pseudoaxe_kappa4C_test.cpp      |    2 +-
  test/pseudoaxe_kappa6C_test.cpp      |    2 +-
  test/reflectionlist_test.cpp         |    2 +-
- 31 files changed, 1449 insertions(+), 1309 deletions(-)
+ 31 files changed, 3202 insertions(+), 3062 deletions(-)
 
 commit 3cfe4a2431fd6c436fbcc3a3c7ef756631a0c759
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11653,18 +21414,18 @@ Date:   Mon Feb 19 10:03:03 2007 +0100
  bouml/hkl/128386.diagram                 |   64 ++
  bouml/hkl/128514.diagram                 |   13 +
  bouml/hkl/128642.diagram                 |   20 +
- bouml/hkl/128770                         |  348 ++++++++
+ bouml/hkl/128770                         |  348 +++++++
  bouml/hkl/128770.diagram                 |   31 +
  bouml/hkl/128898                         |   30 +
- bouml/hkl/129026                         |  670 +++++++++++++++
+ bouml/hkl/129026                         |  670 +++++++++++++
  bouml/hkl/129154                         |   30 +
- bouml/hkl/129282                         |  436 ++++++++++
+ bouml/hkl/129282                         |  436 +++++++++
  bouml/hkl/129410                         |   30 +
- bouml/hkl/129538                         |  460 +++++++++++
- bouml/hkl/129666                         |  666 +++++++++++++++
- bouml/hkl/129794                         |  137 ++++
+ bouml/hkl/129538                         |  460 +++++++++
+ bouml/hkl/129666                         |  666 +++++++++++++
+ bouml/hkl/129794                         |  137 +++
  bouml/hkl/130050.bodies                  |    4 +-
- bouml/hkl/134786.bodies                  |   51 ++
+ bouml/hkl/134786.bodies                  |   51 +
  bouml/hkl/135042.bodies                  |   42 +
  bouml/hkl/135170.bodies                  |   32 +
  bouml/hkl/135426.bodies                  |   72 ++
@@ -11673,19 +21434,19 @@ Date:   Mon Feb 19 10:03:03 2007 +0100
  bouml/hkl/136450.bodies                  |   61 ++
  bouml/hkl/136578.bodies                  |  219 +++++
  bouml/hkl/136706.bodies                  |  130 +++
- bouml/hkl/136834.bodies                  |  207 +++++
+ bouml/hkl/136834.bodies                  |  207 ++++
  bouml/hkl/136962.bodies                  |  113 +++
  bouml/hkl/137090.bodies                  |   70 ++
  bouml/hkl/2.session                      |   16 +-
- bouml/hkl/hkl.prj                        | 1298 +++++++++++++++++++++++++++++-
+ bouml/hkl/hkl.prj                        | 1504 +++++++++++++++++++++++++++---
  config-linux2.py                         |    1 -
- include/hkl/derivedpseudoaxeengine.h     |  199 -----
- include/hkl/pseudoaxe.h                  |  150 ----
- include/hkl/pseudoaxeengine.h            |  229 ------
- include/hkl/pseudoaxeengine_eulerian4C.h |  148 ----
+ include/hkl/derivedpseudoaxeengine.h     |  199 ----
+ include/hkl/pseudoaxe.h                  |  150 ---
+ include/hkl/pseudoaxeengine.h            |  229 -----
+ include/hkl/pseudoaxeengine_eulerian4C.h |  148 ---
  include/hkl/pseudoaxeengine_eulerian6C.h |  107 ---
  include/hkl/pseudoaxeengine_kappa4C.h    |   76 --
- include/hkl/pseudoaxeengine_kappa6C.h    |   46 --
+ include/hkl/pseudoaxeengine_kappa6C.h    |   46 -
  include/hkl/pseudoaxeengine_twoC.h       |  113 ---
  include/hkl/pseudoaxeenginelist.h        |   82 --
  include/hkl/pseudoaxelist.h              |   78 --
@@ -11697,19 +21458,19 @@ Date:   Mon Feb 19 10:03:03 2007 +0100
  src/diffractometer_twoC.cpp              |    6 +-
  src/pseudoaxe.cpp                        |  105 ---
  src/pseudoaxeengine.cpp                  |   13 -
- src/pseudoaxeengine_eulerian4C.cpp       |  277 -------
- src/pseudoaxeengine_eulerian6C.cpp       |  343 --------
+ src/pseudoaxeengine_eulerian4C.cpp       |  277 ------
+ src/pseudoaxeengine_eulerian6C.cpp       |  343 -------
  src/pseudoaxeengine_kappa4C.cpp          |  158 ----
- src/pseudoaxeengine_twoC.cpp             |  347 --------
+ src/pseudoaxeengine_twoC.cpp             |  347 -------
  src/pseudoaxeenginelist.cpp              |  105 ---
  src/pseudoaxelist.cpp                    |  112 ---
  test/diffractometer_kappa6C_test.cpp     |    1 +
  test/pseudoaxe_eulerian4C_test.cpp       |   86 +-
  test/pseudoaxe_eulerian6C_test.cpp       |   74 +-
- test/pseudoaxe_kappa4C_test.cpp          |  154 ++--
- test/pseudoaxe_kappa6C_test.cpp          |  136 ++--
+ test/pseudoaxe_kappa4C_test.cpp          |  154 +--
+ test/pseudoaxe_kappa6C_test.cpp          |  136 +--
  test/pseudoaxe_twoC_test.cpp             |   51 +-
- 62 files changed, 5773 insertions(+), 2995 deletions(-)
+ 62 files changed, 5876 insertions(+), 3098 deletions(-)
 
 commit e28e873c44b57a6b41b8e54f50359219ddedcc4a
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11717,21 +21478,21 @@ Date:   Tue Feb 13 11:37:29 2007 +0100
 
     * add the SampleList and SampleFactory to bouml
 
- bouml/hkl/128188.diagram                |   30 +-
- bouml/hkl/128642                        |    2 +-
- bouml/hkl/134274.bodies                 |   18 +
- bouml/hkl/134402.bodies                 |  186 +++++++++
- bouml/hkl/2.session                     |    9 +-
- bouml/hkl/hkl.prj                       |  692 +++++++++++++++++++++++++++++--
- include/hkl/samplefactory.h             |   50 ---
- include/hkl/samplelist.h                |  124 ------
- src/samplefactory.cpp                   |   40 --
- src/samplelist.cpp                      |  190 ---------
- test/diffractometer_eulerian4C_test.cpp |    2 +-
- test/diffractometer_kappa6C_test.cpp    |    2 +-
- test/diffractometer_twoC_test.cpp       |    2 +-
- test/samplelist_test.cpp                |    2 +-
- 14 files changed, 884 insertions(+), 465 deletions(-)
+ bouml/hkl/128188.diagram                |  30 +-
+ bouml/hkl/128642                        |   2 +-
+ bouml/hkl/134274.bodies                 |  18 +
+ bouml/hkl/134402.bodies                 | 186 +++++++
+ bouml/hkl/2.session                     |   9 +-
+ bouml/hkl/hkl.prj                       | 924 ++++++++++++++++++++++++++------
+ include/hkl/samplefactory.h             |  50 --
+ include/hkl/samplelist.h                | 124 -----
+ src/samplefactory.cpp                   |  40 --
+ src/samplelist.cpp                      | 190 -------
+ test/diffractometer_eulerian4C_test.cpp |   2 +-
+ test/diffractometer_kappa6C_test.cpp    |   2 +-
+ test/diffractometer_twoC_test.cpp       |   2 +-
+ test/samplelist_test.cpp                |   2 +-
+ 14 files changed, 1000 insertions(+), 581 deletions(-)
 
 commit 184df38ad347947957ed19ee7891983803cb8d05
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11739,36 +21500,36 @@ Date:   Fri Feb 9 18:09:17 2007 +0100
 
     * add the reflection and part of the sample to bouml (memory leak for now)
 
- bouml/hkl/128188.diagram             |   56 ++-
+ bouml/hkl/128188.diagram             |   56 +-
  bouml/hkl/128514                     |  172 +++++
- bouml/hkl/128642                     |  419 ++++++++++++
+ bouml/hkl/128642                     |  419 +++++++++++
  bouml/hkl/133122.bodies              |   48 ++
- bouml/hkl/133378.bodies              |  115 ++++
+ bouml/hkl/133378.bodies              |  115 +++
  bouml/hkl/133506.bodies              |   13 +
- bouml/hkl/133634.bodies              |  182 ++++++
+ bouml/hkl/133634.bodies              |  182 +++++
  bouml/hkl/133890.bodies              |    6 +
  bouml/hkl/134146.bodies              |  168 +++++
  bouml/hkl/2.session                  |   12 +-
- bouml/hkl/hkl.prj                    | 1190 +++++++++++++++++++++++++++++++++-
+ bouml/hkl/hkl.prj                    | 1358 +++++++++++++++++++++++++++++++---
  include/hkl/diffractometerfactory.h  |    1 +
  include/hkl/enums.h                  |    6 +-
- include/hkl/reflection.h             |  190 ------
+ include/hkl/reflection.h             |  190 -----
  include/hkl/reflection_monocrystal.h |   61 --
  include/hkl/reflectionfactory.h      |   42 --
  include/hkl/reflectionlist.h         |  144 ----
- include/hkl/sample.h                 |  146 -----
+ include/hkl/sample.h                 |  146 ----
  include/hkl/sample_monocrystal.h     |  131 ----
  src/reflection.cpp                   |   97 ---
  src/reflection_monocrystal.cpp       |   36 -
  src/reflectionfactory.cpp            |   32 -
- src/reflectionlist.cpp               |  237 -------
- src/sample.cpp                       |  150 -----
- src/sample_monocrystal.cpp           |  227 -------
+ src/reflectionlist.cpp               |  237 ------
+ src/sample.cpp                       |  150 ----
+ src/sample_monocrystal.cpp           |  227 ------
  src/samplelist.cpp                   |    2 +-
  test/affinement_simplex_test.cpp     |    1 +
  test/mode_twoC_test.cpp              |    1 +
  test/sample_test.cpp                 |    1 +
- 29 files changed, 2377 insertions(+), 1509 deletions(-)
+ 29 files changed, 2461 insertions(+), 1593 deletions(-)
 
 commit 636facbf7228f02179feefd4726a8459649805e2
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11819,12 +21580,12 @@ Date:   Wed Feb 7 13:44:14 2007 +0100
 
  bouml/hkl/128002.diagram          |   10 +
  bouml/hkl/131330.bodies           |    1 +
- bouml/hkl/131714.bodies           |  343 ++++
+ bouml/hkl/131714.bodies           |  343 +++
  bouml/hkl/2.session               |   11 +-
- bouml/hkl/hkl.prj                 | 3107 ++++++++++++++++++++++---------------
- include/hkl/geometry.h            |  237 ---
+ bouml/hkl/hkl.prj                 | 5847 ++++++++++++++++++++-----------------
+ include/hkl/geometry.h            |  237 --
  include/hkl/portability.h         |   19 -
- src/geometry.cpp                  |  433 ------
+ src/geometry.cpp                  |  433 ---
  src/reflection.cpp                |    2 +-
  src/sample.cpp                    |    2 +-
  test/geometry_eulerian4C_test.cpp |   10 +-
@@ -11832,7 +21593,7 @@ Date:   Wed Feb 7 13:44:14 2007 +0100
  test/geometry_kappa4C_test.cpp    |   10 +-
  test/geometry_kappa6C_test.cpp    |   14 +-
  test/geometry_twoC_test.cpp       |    6 +-
- 15 files changed, 2230 insertions(+), 1989 deletions(-)
+ 15 files changed, 3600 insertions(+), 3359 deletions(-)
 
 commit 7b1dcbae546d0d073e0cb7a5330a44216738837a
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11840,14 +21601,14 @@ Date:   Wed Feb 7 10:53:21 2007 +0100
 
     * add the Lattice class to bouml
 
- bouml/hkl/128002.diagram |    3 +
- bouml/hkl/128188.diagram |    2 +
- bouml/hkl/131458.bodies  |    2 +-
- bouml/hkl/131586.bodies  |  342 ++++++++++++++++++++++++
- bouml/hkl/2.session      |   13 +-
- bouml/hkl/hkl.prj        |  645 +++++++++++++++++++++++++++++++++++++++++++++-
- include/hkl/lattice.h    |  259 -------------------
- src/lattice.cpp          |  391 ----------------------------
+ bouml/hkl/128002.diagram |   3 +
+ bouml/hkl/128188.diagram |   2 +
+ bouml/hkl/131458.bodies  |   2 +-
+ bouml/hkl/131586.bodies  | 342 +++++++++++++++++++++++++
+ bouml/hkl/2.session      |  13 +-
+ bouml/hkl/hkl.prj        | 645 ++++++++++++++++++++++++++++++++++++++++++++++-
+ include/hkl/lattice.h    | 259 -------------------
+ src/lattice.cpp          | 391 ----------------------------
  8 files changed, 997 insertions(+), 660 deletions(-)
 
 commit 4881f3f69b3f0f7c87ac35d50e818baa380a94cd
@@ -11856,17 +21617,17 @@ Date:   Tue Feb 6 14:31:10 2007 +0100
 
     * aFitParameterList and Source are bouml managed.
 
- bouml/hkl/128002.diagram       |   29 ++
- bouml/hkl/128188.diagram       |   24 +-
- bouml/hkl/131330.bodies        |   77 +++++
- bouml/hkl/131458.bodies        |   80 +++++
- bouml/hkl/2.session            |    7 +-
- bouml/hkl/hkl.prj              |  666 +++++++++++++++++++++++++++++++++++++++-
- include/hkl/fitparameterlist.h |  160 ----------
- include/hkl/source.h           |  147 ---------
- src/fitparameterlist.cpp       |   91 ------
- src/source.cpp                 |  133 --------
- 10 files changed, 872 insertions(+), 542 deletions(-)
+ bouml/hkl/128002.diagram       |  29 ++
+ bouml/hkl/128188.diagram       |  24 +-
+ bouml/hkl/131330.bodies        |  77 +++++
+ bouml/hkl/131458.bodies        |  80 +++++
+ bouml/hkl/2.session            |   7 +-
+ bouml/hkl/hkl.prj              | 676 ++++++++++++++++++++++++++++++++++++++++-
+ include/hkl/fitparameterlist.h | 160 ----------
+ include/hkl/source.h           | 147 ---------
+ src/fitparameterlist.cpp       |  91 ------
+ src/source.cpp                 | 133 --------
+ 10 files changed, 877 insertions(+), 547 deletions(-)
 
 commit 2e1a3a48cadd744b63eb96c7e2a3b2ce7f8ee634
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11874,16 +21635,16 @@ Date:   Mon Feb 5 16:16:43 2007 +0100
 
     * HKLObject an ParameterList are bouml managed.
 
- bouml/hkl/128188.diagram    |   21 +-
- bouml/hkl/131074.bodies     |   76 ++++
- bouml/hkl/131202.bodies     |   21 ++
- bouml/hkl/2.session         |   12 +-
- bouml/hkl/hkl.prj           |  827 ++++++++++++++++++++++++++++++++-----------
- include/hkl/hklobject.h     |   82 -----
- include/hkl/parameterlist.h |  130 -------
- src/hklobject.cpp           |   47 ---
- src/parameterlist.cpp       |  104 ------
- 9 files changed, 753 insertions(+), 567 deletions(-)
+ bouml/hkl/128188.diagram    |  21 +-
+ bouml/hkl/131074.bodies     |  76 ++++
+ bouml/hkl/131202.bodies     |  21 ++
+ bouml/hkl/2.session         |  12 +-
+ bouml/hkl/hkl.prj           | 833 +++++++++++++++++++++++++++++++++-----------
+ include/hkl/hklobject.h     |  82 -----
+ include/hkl/parameterlist.h | 130 -------
+ src/hklobject.cpp           |  47 ---
+ src/parameterlist.cpp       | 104 ------
+ 9 files changed, 756 insertions(+), 570 deletions(-)
 
 commit 50b9494bd0e6d702a65f813a3fac5325c56e0e2e
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11903,13 +21664,13 @@ Date:   Mon Feb 5 11:43:00 2007 +0100
  bouml/hkl/130306.bodies       |  145 ++
  bouml/hkl/2.session           |   14 +-
  bouml/hkl/generation_settings |   10 +-
- bouml/hkl/hkl.prj             | 3509 ++++++++++++++++++++++++-----------------
+ bouml/hkl/hkl.prj             | 4001 +++++++++++++++++++++++------------------
  include/hkl/axe.h             |  127 --
  include/hkl/fitparameter.h    |  140 --
  include/hkl/mymap.h           |  614 -------
- src/axe.cpp                   |   90 --
+ src/axe.cpp                   |   90 -
  src/fitparameter.cpp          |   74 -
- 18 files changed, 2378 insertions(+), 2592 deletions(-)
+ 18 files changed, 2624 insertions(+), 2838 deletions(-)
 
 commit 68ccd8720ac48484b25d20f162f8919be47e1d84
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11917,12 +21678,12 @@ Date:   Tue Jan 30 17:22:30 2007 +0100
 
     * Parameter is now bouml managed.
 
- bouml/hkl/128188.diagram |   39 +++++++----
- bouml/hkl/129922.bodies  |   16 ++++
- bouml/hkl/2.session      |    4 +-
- bouml/hkl/hkl.prj        |  180 +++++++++++++++++++++++++++++++++++++++++++++-
- include/hkl/parameter.h  |   73 -------------------
- src/parameter.cpp        |   45 ------------
+ bouml/hkl/128188.diagram |  39 ++++++----
+ bouml/hkl/129922.bodies  |  16 +++++
+ bouml/hkl/2.session      |   4 +-
+ bouml/hkl/hkl.prj        | 180 ++++++++++++++++++++++++++++++++++++++++++++++-
+ include/hkl/parameter.h  |  73 -------------------
+ src/parameter.cpp        |  45 ------------
  6 files changed, 222 insertions(+), 135 deletions(-)
 
 commit e490365fbaba4b6b3a80b1a6c229329e509426ee
@@ -11931,13 +21692,13 @@ Date:   Tue Jan 30 16:25:05 2007 +0100
 
     * Range is bouml managed
 
- bouml/hkl/128060.bodies  |    2 +
- bouml/hkl/128188.diagram |   29 ++-
- bouml/hkl/129794.bodies  |  150 +++++++++++
- bouml/hkl/2.session      |    7 +-
- bouml/hkl/hkl.prj        |  637 ++++++++++++++++++++++++++++++++++++++++++++++
- include/hkl/range.h      |  183 -------------
- src/range.cpp            |  314 -----------------------
+ bouml/hkl/128060.bodies  |   2 +
+ bouml/hkl/128188.diagram |  29 ++-
+ bouml/hkl/129794.bodies  | 150 +++++++++++
+ bouml/hkl/2.session      |   7 +-
+ bouml/hkl/hkl.prj        | 637 +++++++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/range.h      | 183 --------------
+ src/range.cpp            | 314 -----------------------
  7 files changed, 818 insertions(+), 504 deletions(-)
 
 commit 2b5c38a07b61633fad9e58b762645ced3bf2aa35
@@ -11949,12 +21710,12 @@ Date:   Tue Jan 30 14:57:46 2007 +0100
  bouml/hkl/128188.diagram |   12 +-
  bouml/hkl/129282.bodies  |    4 +-
  bouml/hkl/129538.bodies  |    5 +
- bouml/hkl/129666.bodies  |   29 ++
+ bouml/hkl/129666.bodies  |   29 +
  bouml/hkl/2.session      |    5 +-
- bouml/hkl/hkl.prj        | 1093 +++++++++++++++++++++++++++-------------------
- include/hkl/observer.h   |   90 ----
- src/observer.cpp         |   70 ---
- 8 files changed, 705 insertions(+), 603 deletions(-)
+ bouml/hkl/hkl.prj        | 2693 +++++++++++++++++++++++++---------------------
+ include/hkl/observer.h   |   90 --
+ src/observer.cpp         |   70 --
+ 8 files changed, 1505 insertions(+), 1403 deletions(-)
 
 commit 568483fbc7888a3e68e01cf040eb62496bc51ead
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -11962,12 +21723,12 @@ Date:   Tue Jan 30 14:05:55 2007 +0100
 
      Value is bouml managed
 
- bouml/hkl/128060.bodies  |   19 +++--
- bouml/hkl/128188.diagram |    2 +-
- bouml/hkl/2.session      |    6 +-
- bouml/hkl/hkl.prj        |  133 +++++++++++++++++++++++--------
- include/hkl/value.h      |  199 ----------------------------------------------
- src/value.cpp            |  129 ------------------------------
+ bouml/hkl/128060.bodies  |  19 +++--
+ bouml/hkl/128188.diagram |   2 +-
+ bouml/hkl/2.session      |   6 +-
+ bouml/hkl/hkl.prj        | 133 ++++++++++++++++++++++---------
+ include/hkl/value.h      | 199 -----------------------------------------------
+ src/value.cpp            | 129 ------------------------------
  6 files changed, 113 insertions(+), 375 deletions(-)
 
 commit aa975171751766a64a6a1fd7ca52d2886c6053b2
@@ -11976,23 +21737,23 @@ Date:   Tue Jan 30 11:54:11 2007 +0100
 
     * Object is bouml managed.
 
- bouml/hkl/128188.diagram      |   27 ++-
- bouml/hkl/129154.bodies       |   54 +++++
- bouml/hkl/129282.bodies       |    5 +
- bouml/hkl/129410.bodies       |    5 +
- bouml/hkl/2.session           |    7 +-
- bouml/hkl/generation_settings |    2 +-
- bouml/hkl/hkl.prj             |  528 ++++++++++++++++++++++++++++++++++++++++-
- include/hkl/affinement.h      |    2 +-
- include/hkl/object.h          |  192 ---------------
- src/affinement.cpp            |    4 +-
- src/affinement_simplex.cpp    |    2 +-
- src/object.cpp                |   95 --------
- src/sample.cpp                |    2 +-
- test/axe_test.cpp             |    8 +-
- test/hklobject_test.cpp       |    4 +-
- test/object_test.cpp          |    9 +-
- test/sample_test.cpp          |    2 +-
+ bouml/hkl/128188.diagram      |  27 ++-
+ bouml/hkl/129154.bodies       |  54 +++++
+ bouml/hkl/129282.bodies       |   5 +
+ bouml/hkl/129410.bodies       |   5 +
+ bouml/hkl/2.session           |   7 +-
+ bouml/hkl/generation_settings |   2 +-
+ bouml/hkl/hkl.prj             | 528 +++++++++++++++++++++++++++++++++++++++++-
+ include/hkl/affinement.h      |   2 +-
+ include/hkl/object.h          | 192 ---------------
+ src/affinement.cpp            |   4 +-
+ src/affinement_simplex.cpp    |   2 +-
+ src/object.cpp                |  95 --------
+ src/sample.cpp                |   2 +-
+ test/axe_test.cpp             |   8 +-
+ test/hklobject_test.cpp       |   4 +-
+ test/object_test.cpp          |   9 +-
+ test/sample_test.cpp          |   2 +-
  17 files changed, 637 insertions(+), 311 deletions(-)
 
 commit 838a48d419dc5ec791d6a0d79be902cd0cf1d9e3
@@ -12001,13 +21762,13 @@ Date:   Mon Jan 29 18:19:00 2007 +0100
 
     * MyString is now bouml managed.
 
- bouml/hkl/128188.diagram   |   10 ++
- bouml/hkl/128898.bodies    |   16 ++++
- bouml/hkl/2.session        |    7 +-
- bouml/hkl/hkl.prj          |  199 +++++++++++++++++++++++++++++++++++++++++++-
- include/hkl/HKLException.h |   74 ----------------
- include/hkl/mystring.h     |   51 -----------
- src/mystring.cpp           |   51 -----------
+ bouml/hkl/128188.diagram   |  10 +++
+ bouml/hkl/128898.bodies    |  16 ++++
+ bouml/hkl/2.session        |   7 +-
+ bouml/hkl/hkl.prj          | 199 ++++++++++++++++++++++++++++++++++++++++++++-
+ include/hkl/HKLException.h |  74 -----------------
+ include/hkl/mystring.h     |  51 ------------
+ src/mystring.cpp           |  51 ------------
  7 files changed, 227 insertions(+), 181 deletions(-)
 
 commit 62aa9de3bb9a1c4d5d11614380c3a399a5381551
@@ -12016,16 +21777,16 @@ Date:   Mon Jan 29 17:16:10 2007 +0100
 
     * now convenience and Quaternion are bouml managed.
 
- bouml/hkl/128188.diagram  |   21 +-
- bouml/hkl/128770.bodies   |  164 +++++++++++
- bouml/hkl/2.session       |    6 +-
- bouml/hkl/hkl.prj         |  697 ++++++++++++++++++++++++++++++++++++++++++++-
- include/hkl/convenience.h |   37 ---
- include/hkl/quaternion.h  |  160 -----------
- src/convenience.cpp       |   55 ----
- src/geometry.cpp          |    4 +-
- src/quaternion.cpp        |  224 ---------------
- test/quaternion_test.cpp  |   40 ++--
+ bouml/hkl/128188.diagram  |  21 +-
+ bouml/hkl/128770.bodies   | 164 +++++++++++
+ bouml/hkl/2.session       |   6 +-
+ bouml/hkl/hkl.prj         | 697 +++++++++++++++++++++++++++++++++++++++++++++-
+ include/hkl/convenience.h |  37 ---
+ include/hkl/quaternion.h  | 160 -----------
+ src/convenience.cpp       |  55 ----
+ src/geometry.cpp          |   4 +-
+ src/quaternion.cpp        | 224 ---------------
+ test/quaternion_test.cpp  |  40 +--
  10 files changed, 897 insertions(+), 511 deletions(-)
 
 commit ef0240a554f14f2a3b263ddcf2f8f2247f88a504
@@ -12034,68 +21795,68 @@ Date:   Mon Jan 29 15:34:18 2007 +0100
 
     * HKLException svector smatrix are bouml managed
 
- bouml/hkl/128002.bodies              |   75 +++++-
- bouml/hkl/128188.diagram             |   14 +-
- bouml/hkl/128514.bodies              |  183 +++++++++++++
- bouml/hkl/2.session                  |    9 +-
- bouml/hkl/hkl.prj                    |  389 ++++++++++++++++++++++++++-
- bouml/hkl/stereotypes                |    2 +-
- include/hkl/axe.h                    |    1 -
- include/hkl/constants.h              |   28 --
- include/hkl/geometry.h               |    4 -
- include/hkl/lattice.h                |    2 +-
- include/hkl/mode.h                   |   10 +-
- include/hkl/quaternion.h             |    4 +-
- include/hkl/source.h                 |    1 -
- include/hkl/svecmat.h                |  475 ----------------------------------
- include/hkl/value.h                  |    2 +-
- src/SConscript                       |    1 +
- src/convenience.cpp                  |   14 +-
- src/fitparameterlist.cpp             |    1 +
- src/geometry.cpp                     |    2 +-
- src/geometry_eulerian4C.cpp          |    8 +-
- src/geometry_kappa4C.cpp             |    1 -
- src/geometry_twoC.cpp                |   24 +-
- src/lattice.cpp                      |    8 +-
- src/mode_eulerian6C.cpp              |   34 ++--
- src/pseudoaxeengine_eulerian4C.cpp   |   14 +-
- src/pseudoaxeengine_twoC.cpp         |    4 +-
- src/quaternion.cpp                   |   12 +-
- src/reflection.cpp                   |    2 +-
- src/smatrix.cpp                      |  310 ----------------------
- src/source.cpp                       |    4 +-
- src/svector.cpp                      |  288 --------------------
- src/value.cpp                        |    3 +-
- test/axe_test.cpp                    |   12 +-
- test/axe_test.h                      |    1 -
- test/diffractometer_kappa4C_test.cpp |    1 -
- test/diffractometer_kappa6C_test.cpp |    1 -
- test/geometry_eulerian4C_test.cpp    |    5 +-
- test/geometry_eulerian6C_test.cpp    |   29 +-
- test/geometry_kappa4C_test.cpp       |   13 +-
- test/geometry_kappa6C_test.cpp       |    5 +-
- test/geometry_twoC_test.cpp          |   11 +-
- test/lattice_test.h                  |    1 -
- test/mode_eulerian4C_test.cpp        |   30 +-
- test/mode_kappa4C_test.cpp           |   30 +-
- test/mode_kappa6C_test.cpp           |   30 +-
- test/mode_twoC_test.h                |    1 -
- test/pseudoaxe_eulerian4C_test.cpp   |    4 +-
- test/pseudoaxe_eulerian4C_test.h     |    1 -
- test/pseudoaxe_eulerian6C_test.cpp   |    8 +-
- test/pseudoaxe_eulerian6C_test.h     |    1 -
- test/pseudoaxe_kappa4C_test.cpp      |   17 +-
- test/pseudoaxe_kappa6C_test.cpp      |   15 +-
- test/pseudoaxe_twoC_test.h           |    1 -
- test/quaternion_test.cpp             |   24 +-
- test/quaternion_test.h               |    1 -
- test/reflection_test.cpp             |    6 +-
- test/reflection_test.h               |    1 -
- test/sample_test.cpp                 |    2 +-
- test/source_test.h                   |    2 -
- test/svecmat_test.cpp                |   40 +--
- test/svecmat_test.h                  |    5 +-
- test/value_test.cpp                  |    4 +-
+ bouml/hkl/128002.bodies              |  75 +++++-
+ bouml/hkl/128188.diagram             |  14 +-
+ bouml/hkl/128514.bodies              | 183 ++++++++++++++
+ bouml/hkl/2.session                  |   9 +-
+ bouml/hkl/hkl.prj                    | 389 ++++++++++++++++++++++++++--
+ bouml/hkl/stereotypes                |   2 +-
+ include/hkl/axe.h                    |   1 -
+ include/hkl/constants.h              |  28 ---
+ include/hkl/geometry.h               |   4 -
+ include/hkl/lattice.h                |   2 +-
+ include/hkl/mode.h                   |  10 +-
+ include/hkl/quaternion.h             |   4 +-
+ include/hkl/source.h                 |   1 -
+ include/hkl/svecmat.h                | 475 -----------------------------------
+ include/hkl/value.h                  |   2 +-
+ src/SConscript                       |   1 +
+ src/convenience.cpp                  |  14 +-
+ src/fitparameterlist.cpp             |   1 +
+ src/geometry.cpp                     |   2 +-
+ src/geometry_eulerian4C.cpp          |   8 +-
+ src/geometry_kappa4C.cpp             |   1 -
+ src/geometry_twoC.cpp                |  24 +-
+ src/lattice.cpp                      |   8 +-
+ src/mode_eulerian6C.cpp              |  34 +--
+ src/pseudoaxeengine_eulerian4C.cpp   |  14 +-
+ src/pseudoaxeengine_twoC.cpp         |   4 +-
+ src/quaternion.cpp                   |  12 +-
+ src/reflection.cpp                   |   2 +-
+ src/smatrix.cpp                      | 310 -----------------------
+ src/source.cpp                       |   4 +-
+ src/svector.cpp                      | 288 ---------------------
+ src/value.cpp                        |   3 +-
+ test/axe_test.cpp                    |  12 +-
+ test/axe_test.h                      |   1 -
+ test/diffractometer_kappa4C_test.cpp |   1 -
+ test/diffractometer_kappa6C_test.cpp |   1 -
+ test/geometry_eulerian4C_test.cpp    |   5 +-
+ test/geometry_eulerian6C_test.cpp    |  29 ++-
+ test/geometry_kappa4C_test.cpp       |  13 +-
+ test/geometry_kappa6C_test.cpp       |   5 +-
+ test/geometry_twoC_test.cpp          |  11 +-
+ test/lattice_test.h                  |   1 -
+ test/mode_eulerian4C_test.cpp        |  30 +--
+ test/mode_kappa4C_test.cpp           |  30 +--
+ test/mode_kappa6C_test.cpp           |  30 +--
+ test/mode_twoC_test.h                |   1 -
+ test/pseudoaxe_eulerian4C_test.cpp   |   4 +-
+ test/pseudoaxe_eulerian4C_test.h     |   1 -
+ test/pseudoaxe_eulerian6C_test.cpp   |   8 +-
+ test/pseudoaxe_eulerian6C_test.h     |   1 -
+ test/pseudoaxe_kappa4C_test.cpp      |  17 +-
+ test/pseudoaxe_kappa6C_test.cpp      |  15 +-
+ test/pseudoaxe_twoC_test.h           |   1 -
+ test/quaternion_test.cpp             |  24 +-
+ test/quaternion_test.h               |   1 -
+ test/reflection_test.cpp             |   6 +-
+ test/reflection_test.h               |   1 -
+ test/sample_test.cpp                 |   2 +-
+ test/source_test.h                   |   2 -
+ test/svecmat_test.cpp                |  40 ++-
+ test/svecmat_test.h                  |   5 +-
+ test/value_test.cpp                  |   4 +-
  62 files changed, 843 insertions(+), 1388 deletions(-)
 
 commit 008cf44e81d92b9317a8229c92bb846537d52339
@@ -12104,9 +21865,9 @@ Date:   Mon Jan 29 10:32:03 2007 +0100
 
      test of profilling with valgrind
 
- config-linux2.py          |    1 -
- include/hkl/portability.h |    2 +-
- test/SConscript           |   10 +++++-----
+ config-linux2.py          |  1 -
+ include/hkl/portability.h |  2 +-
+ test/SConscript           | 10 +++++-----
  3 files changed, 6 insertions(+), 7 deletions(-)
 
 commit 529450d746bc50af97cf7db3cb8629ed04e0aaeb
@@ -12130,9 +21891,9 @@ Date:   Sun Jan 28 12:04:56 2007 +0100
  bouml/hkl/stereotypes         |   54 ++
  bouml/hkl/tools               |   20 +
  include/hkl/HKLException.h    |  280 ++------
- src/HKLException.cpp          |  154 ++---
+ src/HKLException.cpp          |  154 ++--
  src/SConscript                |    1 -
- src/svector.cpp               |  574 ++++++++--------
+ src/svector.cpp               |  574 ++++++++-------
  test/geometry_test.h          |    2 +
  test/lattice_test.h           |    2 +
  test/reflectionlist_test.h    |    2 +
@@ -12144,8 +21905,8 @@ Date:   Thu Jan 25 10:40:58 2007 +0100
 
     * now the gui is working.
 
- src/gui/hklwindow.cpp |    3 +--
- 1 files changed, 1 insertions(+), 2 deletions(-)
+ src/gui/hklwindow.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
 
 commit 563f72742a6438e1d396d2d55aeaafa1897a4786
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -12155,21 +21916,21 @@ Date:   Wed Jan 24 15:02:34 2007 +0100
     * clean up the code.
     * add the NEWS file
 
- NEWS                           |   69 +
- TODO                           |   65 +-
- config-linux2.py               |    1 +
- doc/uml/hkl.dia                | 5973 +++++++++++++++++++++++++---------------
- doc/uml/next_hkl.dia           | 4542 +++++++++++++++++++++---------
- include/hkl/derivedmode.h      |    3 +-
- include/hkl/fitparameterlist.h |   66 +-
- include/hkl/parameterlist.h    |   56 +-
- include/hkl/pseudoaxe.h        |   14 -
- include/hkl/pseudoaxelist.h    |   17 -
- include/hkl/reflection.h       |   24 +-
- include/hkl/samplelist.h       |    1 -
- src/pseudoaxe.cpp              |   14 -
- src/pseudoaxelist.cpp          |   29 -
- 14 files changed, 7146 insertions(+), 3728 deletions(-)
+ NEWS                           |    69 +
+ TODO                           |    65 +-
+ config-linux2.py               |     1 +
+ doc/uml/hkl.dia                | 11001 ++++++++++++++++++++++-----------------
+ doc/uml/next_hkl.dia           |  7392 ++++++++++++++++----------
+ include/hkl/derivedmode.h      |     3 +-
+ include/hkl/fitparameterlist.h |    66 +-
+ include/hkl/parameterlist.h    |    56 +-
+ include/hkl/pseudoaxe.h        |    14 -
+ include/hkl/pseudoaxelist.h    |    17 -
+ include/hkl/reflection.h       |    24 +-
+ include/hkl/samplelist.h       |     1 -
+ src/pseudoaxe.cpp              |    14 -
+ src/pseudoaxelist.cpp          |    29 -
+ 14 files changed, 11085 insertions(+), 7667 deletions(-)
 
 commit 1ccff1d7f69f8b2dceb5c8238e22625101c1e1a8
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -12177,11 +21938,11 @@ Date:   Wed Jan 24 09:49:58 2007 +0100
 
     * use astyle to format the code.
 
- include/hkl/pseudoaxe.h                  |   22 +++++++++++-----------
- include/hkl/pseudoaxeengine.h            |   20 ++++++++++----------
- include/hkl/pseudoaxeengine_eulerian4C.h |    6 +++---
- include/hkl/pseudoaxelist.h              |    2 +-
- test/pseudoaxe_kappa6C_test.cpp          |    2 +-
+ include/hkl/pseudoaxe.h                  | 22 +++++++++++-----------
+ include/hkl/pseudoaxeengine.h            | 20 ++++++++++----------
+ include/hkl/pseudoaxeengine_eulerian4C.h |  6 +++---
+ include/hkl/pseudoaxelist.h              |  2 +-
+ test/pseudoaxe_kappa6C_test.cpp          |  2 +-
  5 files changed, 26 insertions(+), 26 deletions(-)
 
 commit 6d4da713ff94bfe9e4a3d864c972d29b085c4bee
@@ -12192,33 +21953,33 @@ Date:   Mon Jan 22 14:01:58 2007 +0100
     * remove some memory problem causing computation errors in the win32 port.
     * clean up the pseudoAxeEngine code.
 
- include/hkl/affinementlist.h             |    2 +-
- include/hkl/axe.h                        |    2 +-
- include/hkl/derivedpseudoaxe.h           |  220 --------------------
- include/hkl/derivedpseudoaxeengine.h     |    7 +-
- include/hkl/modelist.h                   |    2 +-
- include/hkl/pseudoaxe.h                  |   79 +++++++-
- include/hkl/pseudoaxeengine.h            |   42 ++++-
- include/hkl/pseudoaxeengine_eulerian4C.h |   23 ++-
- include/hkl/pseudoaxeengine_eulerian6C.h |   14 +-
- include/hkl/pseudoaxeengine_kappa4C.h    |   20 +-
- include/hkl/pseudoaxeengine_kappa6C.h    |    2 +-
- include/hkl/pseudoaxeengine_twoC.h       |   20 +-
- include/hkl/pseudoaxeenginelist.h        |   15 +-
- include/hkl/pseudoaxelist.h              |    6 +
- include/hkl/reflectionlist.h             |    2 +-
- include/hkl/samplelist.h                 |    2 +-
- src/pseudoaxe_kappa4C.cpp                |  325 ------------------------------
- src/pseudoaxe_twoC.cpp                   |  261 ------------------------
- src/pseudoaxeengine_eulerian4C.cpp       |    4 -
- src/pseudoaxeengine_eulerian6C.cpp       |    4 +-
- src/pseudoaxeengine_twoC.cpp             |   20 +--
- test/SConscript                          |    1 +
- test/pseudoaxe_eulerian4C_test.cpp       |   25 ++-
- test/pseudoaxe_eulerian6C_test.cpp       |   10 +
- test/pseudoaxe_kappa4C_test.cpp          |   20 ++
- test/pseudoaxe_kappa6C_test.cpp          |   16 ++
- test/pseudoaxe_twoC_test.cpp             |   10 +
+ include/hkl/affinementlist.h             |   2 +-
+ include/hkl/axe.h                        |   2 +-
+ include/hkl/derivedpseudoaxe.h           | 220 ---------------------
+ include/hkl/derivedpseudoaxeengine.h     |   7 +-
+ include/hkl/modelist.h                   |   2 +-
+ include/hkl/pseudoaxe.h                  |  79 +++++++-
+ include/hkl/pseudoaxeengine.h            |  42 +++-
+ include/hkl/pseudoaxeengine_eulerian4C.h |  23 ++-
+ include/hkl/pseudoaxeengine_eulerian6C.h |  14 +-
+ include/hkl/pseudoaxeengine_kappa4C.h    |  20 +-
+ include/hkl/pseudoaxeengine_kappa6C.h    |   2 +-
+ include/hkl/pseudoaxeengine_twoC.h       |  20 +-
+ include/hkl/pseudoaxeenginelist.h        |  15 +-
+ include/hkl/pseudoaxelist.h              |   6 +
+ include/hkl/reflectionlist.h             |   2 +-
+ include/hkl/samplelist.h                 |   2 +-
+ src/pseudoaxe_kappa4C.cpp                | 325 -------------------------------
+ src/pseudoaxe_twoC.cpp                   | 261 -------------------------
+ src/pseudoaxeengine_eulerian4C.cpp       |   4 -
+ src/pseudoaxeengine_eulerian6C.cpp       |   4 +-
+ src/pseudoaxeengine_twoC.cpp             |  20 +-
+ test/SConscript                          |   1 +
+ test/pseudoaxe_eulerian4C_test.cpp       |  25 ++-
+ test/pseudoaxe_eulerian6C_test.cpp       |  10 +
+ test/pseudoaxe_kappa4C_test.cpp          |  20 ++
+ test/pseudoaxe_kappa6C_test.cpp          |  16 ++
+ test/pseudoaxe_twoC_test.cpp             |  10 +
  27 files changed, 261 insertions(+), 893 deletions(-)
 
 commit 59c84357baaaf7a5eebea2641e4206e870be2f3a
@@ -12227,21 +21988,21 @@ Date:   Fri Jan 19 14:37:53 2007 +0100
 
     * update diffractometers with the PseudoAxeEngine
 
- include/hkl/diffractometer.h         |    6 +++---
- include/hkl/diffractometer_kappa4C.h |    2 --
- include/hkl/diffractometer_kappa6C.h |    2 --
- include/hkl/pseudoaxe.h              |    3 +++
- src/SConscript                       |    6 +++---
- src/diffractometer.cpp               |    8 ++++----
- src/diffractometer_eulerian4C.cpp    |   22 +++++++++++-----------
- src/diffractometer_eulerian6C.cpp    |   20 ++++++++++----------
- src/diffractometer_kappa4C.cpp       |   34 +++++++++++++---------------------
- src/diffractometer_kappa6C.cpp       |   28 ++++++++++------------------
- src/diffractometer_twoC.cpp          |   14 +++++++-------
- src/pseudoaxe.cpp                    |    3 ++-
- test/SConscript                      |    8 ++++----
- test/diffractometer_kappa4C_test.cpp |   10 +++++-----
- test/diffractometer_kappa6C_test.cpp |   10 +++++-----
+ include/hkl/diffractometer.h         |  6 +++---
+ include/hkl/diffractometer_kappa4C.h |  2 --
+ include/hkl/diffractometer_kappa6C.h |  2 --
+ include/hkl/pseudoaxe.h              |  3 +++
+ src/SConscript                       |  6 +++---
+ src/diffractometer.cpp               |  8 ++++----
+ src/diffractometer_eulerian4C.cpp    | 22 +++++++++++-----------
+ src/diffractometer_eulerian6C.cpp    | 20 ++++++++++----------
+ src/diffractometer_kappa4C.cpp       | 34 +++++++++++++---------------------
+ src/diffractometer_kappa6C.cpp       | 28 ++++++++++------------------
+ src/diffractometer_twoC.cpp          | 14 +++++++-------
+ src/pseudoaxe.cpp                    |  3 ++-
+ test/SConscript                      |  8 ++++----
+ test/diffractometer_kappa4C_test.cpp | 10 +++++-----
+ test/diffractometer_kappa6C_test.cpp | 10 +++++-----
  15 files changed, 80 insertions(+), 96 deletions(-)
 
 commit c571ef78c48aafbf50b8e48f03266b6d2ef2a15d
@@ -12250,12 +22011,12 @@ Date:   Fri Jan 19 13:57:51 2007 +0100
 
     * add the PseudoAxeEngineList class
 
- include/hkl/pseudoaxeengine.h     |    9 ++--
- include/hkl/pseudoaxeenginelist.h |   75 ++++++++++++++++++++++++++
- include/hkl/pseudoaxelist.h       |    2 +
- src/SConscript                    |    1 +
- src/pseudoaxeenginelist.cpp       |  105 +++++++++++++++++++++++++++++++++++++
- src/pseudoaxelist.cpp             |    6 ++
+ include/hkl/pseudoaxeengine.h     |   9 ++--
+ include/hkl/pseudoaxeenginelist.h |  75 +++++++++++++++++++++++++++
+ include/hkl/pseudoaxelist.h       |   2 +
+ src/SConscript                    |   1 +
+ src/pseudoaxeenginelist.cpp       | 105 ++++++++++++++++++++++++++++++++++++++
+ src/pseudoaxelist.cpp             |   6 +++
  6 files changed, 194 insertions(+), 4 deletions(-)
 
 commit 5778cc415731c45d99683c788ae9c7726f2e2adb
@@ -12264,14 +22025,14 @@ Date:   Thu Jan 18 18:28:24 2007 +0100
 
     * now all pseudoaxeengine seems to work
 
- include/hkl/derivedpseudoaxeengine.h |    8 +-
- include/hkl/pseudoaxe_kappa4C.h      |  116 -----------------------------
- include/hkl/pseudoaxe_kappa6C.h      |   49 ------------
- src/pseudoaxeengine_eulerian4C.cpp   |  136 +++++++++++++++++-----------------
- src/pseudoaxeengine_kappa4C.cpp      |    2 +
- src/pseudoaxeengine_twoC.cpp         |   52 +++++++-------
- test/SConscript                      |   10 +-
- test/pseudoaxe_twoC_test.cpp         |    2 +-
+ include/hkl/derivedpseudoaxeengine.h |   8 +--
+ include/hkl/pseudoaxe_kappa4C.h      | 116 ------------------------------
+ include/hkl/pseudoaxe_kappa6C.h      |  49 -------------
+ src/pseudoaxeengine_eulerian4C.cpp   | 136 +++++++++++++++++------------------
+ src/pseudoaxeengine_kappa4C.cpp      |   2 +
+ src/pseudoaxeengine_twoC.cpp         |  52 +++++++-------
+ test/SConscript                      |  10 +--
+ test/pseudoaxe_twoC_test.cpp         |   2 +-
  8 files changed, 106 insertions(+), 269 deletions(-)
 
 commit b638af06a4923a993d4d0999626de8751929b360
@@ -12280,10 +22041,10 @@ Date:   Thu Jan 18 18:25:07 2007 +0100
 
     * pseudoaxe_kappa6C -> pseudoaxeengine_kappa6C
 
- include/hkl/pseudoaxeengine_kappa6C.h |    8 +++++---
- test/SConscript                       |    4 ++--
- test/pseudoaxe_kappa6C_test.cpp       |   28 +++++++++++++++++-----------
- test/pseudoaxe_kappa6C_test.h         |    2 +-
+ include/hkl/pseudoaxeengine_kappa6C.h |  8 +++++---
+ test/SConscript                       |  4 ++--
+ test/pseudoaxe_kappa6C_test.cpp       | 28 +++++++++++++++++-----------
+ test/pseudoaxe_kappa6C_test.h         |  2 +-
  4 files changed, 25 insertions(+), 17 deletions(-)
 
 commit 31ae60f90fca7d49f6ffff723afd72956030603f
@@ -12292,14 +22053,14 @@ Date:   Thu Jan 18 18:15:05 2007 +0100
 
     * pseudoaxe_eulerian6C -> pseudoaxeengine_eulerian6C
 
- include/hkl/pseudoaxe_eulerian6C.h       |  101 ---------
- include/hkl/pseudoaxeengine_eulerian6C.h |  107 ++++++++++
- src/SConscript                           |    3 +-
- src/pseudoaxe_eulerian6C.cpp             |  323 ----------------------------
- src/pseudoaxeengine_eulerian6C.cpp       |  341 ++++++++++++++++++++++++++++++
- test/SConscript                          |    4 +-
- test/pseudoaxe_eulerian6C_test.cpp       |   13 +-
- test/pseudoaxe_eulerian6C_test.h         |    2 +-
+ include/hkl/pseudoaxe_eulerian6C.h       | 101 ---------
+ include/hkl/pseudoaxeengine_eulerian6C.h | 107 ++++++++++
+ src/SConscript                           |   3 +-
+ src/pseudoaxe_eulerian6C.cpp             | 323 -----------------------------
+ src/pseudoaxeengine_eulerian6C.cpp       | 341 +++++++++++++++++++++++++++++++
+ test/SConscript                          |   4 +-
+ test/pseudoaxe_eulerian6C_test.cpp       |  13 +-
+ test/pseudoaxe_eulerian6C_test.h         |   2 +-
  8 files changed, 460 insertions(+), 434 deletions(-)
 
 commit 55424bddf60b7a448df6fef42ad9e23b7b78a5bd
@@ -12308,11 +22069,11 @@ Date:   Thu Jan 18 17:29:10 2007 +0100
 
     * pseudoaxe_kappa4C -> pseudoaxeengine_kappa4C
 
- include/hkl/pseudoaxeengine_kappa4C.h |   27 +++++++++++---
- src/pseudoaxeengine_kappa4C.cpp       |   64 ++++++++++++++++++---------------
- test/SConscript                       |    4 +-
- test/pseudoaxe_kappa4C_test.cpp       |   31 ++++++++++------
- test/pseudoaxe_kappa4C_test.h         |    2 +-
+ include/hkl/pseudoaxeengine_kappa4C.h | 27 ++++++++++++---
+ src/pseudoaxeengine_kappa4C.cpp       | 64 +++++++++++++++++++----------------
+ test/SConscript                       |  4 +--
+ test/pseudoaxe_kappa4C_test.cpp       | 31 ++++++++++-------
+ test/pseudoaxe_kappa4C_test.h         |  2 +-
  5 files changed, 79 insertions(+), 49 deletions(-)
 
 commit d263ca5dde243fd04049b6ab7ab3205698f1fecc
@@ -12321,18 +22082,18 @@ Date:   Thu Jan 18 16:58:19 2007 +0100
 
     * pseudoaxe_eulerian4C -> pseudoaxeengine_eulerian4C
 
- include/hkl/derivedpseudoaxeengine.h     |   13 ++-
- include/hkl/pseudoaxe.h                  |    1 +
- include/hkl/pseudoaxe_eulerian4C.h       |  134 --------------
- include/hkl/pseudoaxeengine_eulerian4C.h |  141 +++++++++++++++
- src/HKLException.cpp                     |    2 +-
- src/SConscript                           |    3 +-
- src/pseudoaxe.cpp                        |    8 +-
- src/pseudoaxe_eulerian4C.cpp             |  247 --------------------------
- src/pseudoaxeengine_eulerian4C.cpp       |  281 ++++++++++++++++++++++++++++++
- test/SConscript                          |    4 +-
- test/pseudoaxe_eulerian4C_test.cpp       |   16 +-
- test/pseudoaxe_eulerian4C_test.h         |    2 +-
+ include/hkl/derivedpseudoaxeengine.h     |  13 +-
+ include/hkl/pseudoaxe.h                  |   1 +
+ include/hkl/pseudoaxe_eulerian4C.h       | 134 ---------------
+ include/hkl/pseudoaxeengine_eulerian4C.h | 141 ++++++++++++++++
+ src/HKLException.cpp                     |   2 +-
+ src/SConscript                           |   3 +-
+ src/pseudoaxe.cpp                        |   8 +-
+ src/pseudoaxe_eulerian4C.cpp             | 247 ---------------------------
+ src/pseudoaxeengine_eulerian4C.cpp       | 281 +++++++++++++++++++++++++++++++
+ test/SConscript                          |   4 +-
+ test/pseudoaxe_eulerian4C_test.cpp       |  16 +-
+ test/pseudoaxe_eulerian4C_test.h         |   2 +-
  12 files changed, 456 insertions(+), 396 deletions(-)
 
 commit 232ddefd7cb9ad0b620a755cba3e9c02f6ccb2d5
@@ -12341,18 +22102,18 @@ Date:   Thu Jan 18 14:19:17 2007 +0100
 
     * pseudoAxe_twoC -> pseudoAxeEngine_twoC
 
- include/hkl/pseudoaxe.h            |  245 ++++---------------------
- include/hkl/pseudoaxe_twoC.h       |   92 ---------
- include/hkl/pseudoaxeengine.h      |    9 +-
- include/hkl/pseudoaxeengine_twoC.h |  113 ++++++++++++
- include/hkl/pseudomultiaxe.h       |   97 ----------
- src/SConscript                     |   17 +-
- src/pseudoaxe.cpp                  |   93 +++++-----
- src/pseudoaxeengine_twoC.cpp       |  355 ++++++++++++++++++++++++++++++++++++
- src/pseudomultiaxe.cpp             |  112 -----------
- test/SConscript                    |    6 +-
- test/pseudoaxe_twoC_test.cpp       |   13 +-
- test/pseudoaxe_twoC_test.h         |    2 +-
+ include/hkl/pseudoaxe.h            | 245 ++++---------------------
+ include/hkl/pseudoaxe_twoC.h       |  92 ----------
+ include/hkl/pseudoaxeengine.h      |   9 +-
+ include/hkl/pseudoaxeengine_twoC.h | 113 ++++++++++++
+ include/hkl/pseudomultiaxe.h       |  97 ----------
+ src/SConscript                     |  17 +-
+ src/pseudoaxe.cpp                  |  93 +++++-----
+ src/pseudoaxeengine_twoC.cpp       | 355 +++++++++++++++++++++++++++++++++++++
+ src/pseudomultiaxe.cpp             | 112 ------------
+ test/SConscript                    |   6 +-
+ test/pseudoaxe_twoC_test.cpp       |  13 +-
+ test/pseudoaxe_twoC_test.h         |   2 +-
  12 files changed, 580 insertions(+), 574 deletions(-)
 
 commit 3fc071e226f160b6f7be9062bce2de9795fea6e1
@@ -12361,13 +22122,13 @@ Date:   Mon Jan 15 17:47:27 2007 +0100
 
     * remove a memory leak in the PseudoAxeEngine class.
 
- doc/uml/next_hkl.dia                 |  364 ++++++++++++++--------------------
- include/hkl/pseudoaxeengine.h        |    2 +
- src/diffractometer_kappa6C.cpp       |    2 +
- src/pseudoaxeengine.cpp              |    3 +
- src/pseudoaxeengine_kappa4C.cpp      |    3 -
- test/diffractometer_kappa4C_test.cpp |    4 -
- test/diffractometer_kappa6C_test.cpp |   14 ++-
+ doc/uml/next_hkl.dia                 | 364 ++++++++++++++---------------------
+ include/hkl/pseudoaxeengine.h        |   2 +
+ src/diffractometer_kappa6C.cpp       |   2 +
+ src/pseudoaxeengine.cpp              |   3 +
+ src/pseudoaxeengine_kappa4C.cpp      |   3 -
+ test/diffractometer_kappa4C_test.cpp |   4 -
+ test/diffractometer_kappa6C_test.cpp |  14 +-
  7 files changed, 167 insertions(+), 225 deletions(-)
 
 commit ae54470262416bec21952c8a5a91a6b17d064353
@@ -12376,9 +22137,9 @@ Date:   Mon Jan 15 16:43:59 2007 +0100
 
     * put the right eulerian <-> kappa conversion in the PseudoAxeEngine_kappa4C
 
- include/hkl/diffractometer_kappa4C.h |    2 +-
- src/pseudoaxeengine_kappa4C.cpp      |    6 +++---
- test/diffractometer_kappa4C_test.cpp |   16 +++++++++++++++-
+ include/hkl/diffractometer_kappa4C.h |  2 +-
+ src/pseudoaxeengine_kappa4C.cpp      |  6 +++---
+ test/diffractometer_kappa4C_test.cpp | 16 +++++++++++++++-
  3 files changed, 19 insertions(+), 5 deletions(-)
 
 commit 0f10d45ac763753bdf817b01ac021d978008630c
@@ -12387,30 +22148,30 @@ Date:   Sun Jan 14 17:43:51 2007 +0100
 
     * add the DerivedPseudoAxeEngine
 
- doc/uml/next_hkl.dia                  |  236 +++++++++++----------------------
- include/hkl/derivedpseudoaxeengine.h  |  193 +++++++++++++++++++++++++++
- include/hkl/diffractometer_kappa4C.h  |    2 +-
- include/hkl/diffractometer_kappa6C.h  |    3 +
- include/hkl/pseudoaxeengine.h         |   39 +++---
- include/hkl/pseudoaxeengine_kappa4C.h |    7 +
- include/hkl/pseudoaxeengine_kappa6C.h |   44 ++++++
- include/hkl/pseudomultiaxe.h          |    5 +-
- src/diffractometer_eulerian6C.cpp     |    4 +-
- src/diffractometer_kappa6C.cpp        |    4 +
- src/geometry.cpp                      |    2 +-
- src/geometry_eulerian4C.cpp           |    5 +-
- src/mode_eulerian6C.cpp               |   24 ++--
- src/pseudoaxe.cpp                     |   18 ++--
- src/pseudoaxeengine.cpp               |    4 +-
- src/pseudoaxeengine_kappa4C.cpp       |   79 +++++++-----
- src/pseudomultiaxe.cpp                |   13 +-
- src/samplelist.cpp                    |    2 +-
- src/smatrix.cpp                       |   10 +-
- src/svector.cpp                       |    4 +-
- test/SConscript                       |    2 +-
- test/diffractometer_kappa4C_test.cpp  |   11 +-
- test/diffractometer_kappa6C_test.cpp  |   32 +++++
- test/diffractometer_kappa6C_test.h    |    2 +
+ doc/uml/next_hkl.dia                  | 236 +++++++++++-----------------------
+ include/hkl/derivedpseudoaxeengine.h  | 193 +++++++++++++++++++++++++++
+ include/hkl/diffractometer_kappa4C.h  |   2 +-
+ include/hkl/diffractometer_kappa6C.h  |   3 +
+ include/hkl/pseudoaxeengine.h         |  39 +++---
+ include/hkl/pseudoaxeengine_kappa4C.h |   7 +
+ include/hkl/pseudoaxeengine_kappa6C.h |  44 +++++++
+ include/hkl/pseudomultiaxe.h          |   5 +-
+ src/diffractometer_eulerian6C.cpp     |   4 +-
+ src/diffractometer_kappa6C.cpp        |   4 +
+ src/geometry.cpp                      |   2 +-
+ src/geometry_eulerian4C.cpp           |   5 +-
+ src/mode_eulerian6C.cpp               |  24 ++--
+ src/pseudoaxe.cpp                     |  18 +--
+ src/pseudoaxeengine.cpp               |   4 +-
+ src/pseudoaxeengine_kappa4C.cpp       |  79 +++++++-----
+ src/pseudomultiaxe.cpp                |  13 +-
+ src/samplelist.cpp                    |   2 +-
+ src/smatrix.cpp                       |  10 +-
+ src/svector.cpp                       |   4 +-
+ test/SConscript                       |   2 +-
+ test/diffractometer_kappa4C_test.cpp  |  11 +-
+ test/diffractometer_kappa6C_test.cpp  |  32 +++++
+ test/diffractometer_kappa6C_test.h    |   2 +
  24 files changed, 478 insertions(+), 267 deletions(-)
 
 commit 0bd1c2e4bdc0a1b1de5ea86c2220bb509de348e4
@@ -12419,22 +22180,22 @@ Date:   Thu Jan 11 18:14:24 2007 +0100
 
     * work on the pseudoAxeEngine (in progress)
 
- config-linux2.py                           |    1 -
- doc/uml/next_hkl.dia                       |  886 ++++++++++++++++++----------
- include/hkl/diffractometer_kappa4C.h       |    6 +-
- include/hkl/pseudoaxeengine.h              |  200 +++++++
- include/hkl/pseudoaxeengine_kappa4C.h      |   52 ++
- include/hkl/pseudomultiaxe.h               |   27 +-
- include/hkl/pseudomultiaxeengine.h         |  254 --------
- include/hkl/pseudomultiaxeengine_kappa4C.h |   52 --
- src/SConscript                             |    4 +-
- src/diffractometer_kappa4C.cpp             |   10 +-
- src/pseudoaxeengine.cpp                    |   10 +
- src/pseudoaxeengine_kappa4C.cpp            |  138 +++++
- src/pseudomultiaxe.cpp                     |   24 +-
- src/pseudomultiaxeengine.cpp               |   62 --
- src/pseudomultiaxeengine_kappa4C.cpp       |  133 -----
- test/diffractometer_kappa4C_test.cpp       |    6 +-
+ config-linux2.py                           |   1 -
+ doc/uml/next_hkl.dia                       | 886 ++++++++++++++++++-----------
+ include/hkl/diffractometer_kappa4C.h       |   6 +-
+ include/hkl/pseudoaxeengine.h              | 200 +++++++
+ include/hkl/pseudoaxeengine_kappa4C.h      |  52 ++
+ include/hkl/pseudomultiaxe.h               |  27 +-
+ include/hkl/pseudomultiaxeengine.h         | 254 ---------
+ include/hkl/pseudomultiaxeengine_kappa4C.h |  52 --
+ src/SConscript                             |   4 +-
+ src/diffractometer_kappa4C.cpp             |  10 +-
+ src/pseudoaxeengine.cpp                    |  10 +
+ src/pseudoaxeengine_kappa4C.cpp            | 138 +++++
+ src/pseudomultiaxe.cpp                     |  24 +-
+ src/pseudomultiaxeengine.cpp               |  62 --
+ src/pseudomultiaxeengine_kappa4C.cpp       | 133 -----
+ test/diffractometer_kappa4C_test.cpp       |   6 +-
  16 files changed, 986 insertions(+), 879 deletions(-)
 
 commit 75a57cb3218148b3b03242ced00db1acbe071bae
@@ -12443,26 +22204,26 @@ Date:   Wed Jan 10 18:03:40 2007 +0100
 
     begin of the pseudoAxes refactoring
 
- config-linux2.py                           |    1 +
- include/hkl/derivedpseudoaxe.h             |   18 +-
- include/hkl/diffractometer_kappa4C.h       |    3 +
- include/hkl/pseudoaxe.h                    |    6 +-
- include/hkl/pseudomultiaxe.h               |  109 ++++++++++++
- include/hkl/pseudomultiaxeengine.h         |  254 ++++++++++++++++++++++++++++
- include/hkl/pseudomultiaxeengine_kappa4C.h |   52 ++++++
- src/HKLException.cpp                       |    2 +-
- src/SConscript                             |    3 +
- src/diffractometer_kappa4C.cpp             |   13 +-
- src/gui/pseudoaxespinbutton.cpp            |    1 -
- src/pseudoaxe.cpp                          |   18 ++-
- src/pseudoaxelist.cpp                      |    2 +-
- src/pseudomultiaxe.cpp                     |  119 +++++++++++++
- src/pseudomultiaxeengine.cpp               |   62 +++++++
- src/pseudomultiaxeengine_kappa4C.cpp       |  133 +++++++++++++++
- src/sample_monocrystal.cpp                 |   10 +-
- test/SConscript                            |   14 +-
- test/diffractometer_kappa4C_test.cpp       |   56 +++---
- test/diffractometer_kappa4C_test.h         |   13 +-
+ config-linux2.py                           |   1 +
+ include/hkl/derivedpseudoaxe.h             |  18 +-
+ include/hkl/diffractometer_kappa4C.h       |   3 +
+ include/hkl/pseudoaxe.h                    |   6 +-
+ include/hkl/pseudomultiaxe.h               | 109 +++++++++++++
+ include/hkl/pseudomultiaxeengine.h         | 254 +++++++++++++++++++++++++++++
+ include/hkl/pseudomultiaxeengine_kappa4C.h |  52 ++++++
+ src/HKLException.cpp                       |   2 +-
+ src/SConscript                             |   3 +
+ src/diffractometer_kappa4C.cpp             |  13 +-
+ src/gui/pseudoaxespinbutton.cpp            |   1 -
+ src/pseudoaxe.cpp                          |  18 +-
+ src/pseudoaxelist.cpp                      |   2 +-
+ src/pseudomultiaxe.cpp                     | 119 ++++++++++++++
+ src/pseudomultiaxeengine.cpp               |  62 +++++++
+ src/pseudomultiaxeengine_kappa4C.cpp       | 133 +++++++++++++++
+ src/sample_monocrystal.cpp                 |  10 +-
+ test/SConscript                            |  14 +-
+ test/diffractometer_kappa4C_test.cpp       |  56 +++----
+ test/diffractometer_kappa4C_test.h         |  13 +-
  20 files changed, 814 insertions(+), 75 deletions(-)
 
 commit 7521ced3d553d598ac7974139c55a08065400726
@@ -12471,11 +22232,11 @@ Date:   Mon Jan 8 10:43:28 2007 +0100
 
     * changes to remove msvc6 warnings. now FitParameterList::ready_to_fit no more throw exception.
 
- include/hkl/derivedpseudoaxe.h   |    1 -
- include/hkl/fitparameterlist.h   |    2 +-
- include/hkl/sample_monocrystal.h |    2 +-
- src/HKLException.cpp             |    2 +-
- src/sample_monocrystal.cpp       |   19 +++++++++++--------
+ include/hkl/derivedpseudoaxe.h   |  1 -
+ include/hkl/fitparameterlist.h   |  2 +-
+ include/hkl/sample_monocrystal.h |  2 +-
+ src/HKLException.cpp             |  2 +-
+ src/sample_monocrystal.cpp       | 19 +++++++++++--------
  5 files changed, 14 insertions(+), 12 deletions(-)
 
 commit 643d85b64312b0a5d3e29d431c407a2251a2df0a
@@ -12504,13 +22265,13 @@ Date:   Sun Jan 7 17:37:23 2007 +0100
  src/diffractometer_eulerian6C.cpp |    2 +-
  src/fitparameterlist.cpp          |   14 +
  src/geometry.cpp                  |   86 +-
- src/gui/axespinbutton.cpp         |  198 ++--
+ src/gui/axespinbutton.cpp         |  198 +--
  src/gui/axespinbutton.h           |    4 +-
  src/gui/hklwindow.cpp             | 2894 ++++++++++++++++++-------------------
  src/gui/hklwindow.h               |   14 +-
  src/gui/main.cpp                  |  109 +-
  src/gui/modelcolumns.h            |   29 +-
- src/gui/pseudoaxespinbutton.cpp   |  239 ++--
+ src/gui/pseudoaxespinbutton.cpp   |  239 ++-
  src/gui/pseudoaxespinbutton.h     |    8 +-
  src/modelist.cpp                  |   70 +-
  src/mystring.cpp                  |   39 +-
@@ -12527,8 +22288,8 @@ Date:   Wed Dec 20 17:05:09 2006 +0100
 
     * start updating the uml diagram
 
- doc/uml/hkl.dia |20688 +++++++++++++------------------------------------------
- 1 files changed, 4732 insertions(+), 15956 deletions(-)
+ doc/uml/hkl.dia | 26504 ++++++++++++++++--------------------------------------
+ 1 file changed, 7640 insertions(+), 18864 deletions(-)
 
 commit 539424773790dcd3141326af5607ffb2260a9898
 Author: Frederic-Emmanuel PICCA <picca at synchrotron-soleil.fr>
@@ -12536,11 +22297,11 @@ Date:   Wed Dec 20 16:19:58 2006 +0100
 
     * start refactoring of the frontend (gui).
 
- include/hkl/mystring.h        |    7 +++++++
- src/gui/axespinbutton.cpp     |   16 ++++++++--------
- src/gui/hklwindow.cpp         |    2 +-
- src/gui/hklwindow.h           |    4 ++--
- src/gui/pseudoaxespinbutton.h |    4 ++--
+ include/hkl/mystring.h        |  7 +++++++
+ src/gui/axespinbutton.cpp     | 16 ++++++++--------
+ src/gui/hklwindow.cpp         |  2 +-
+ src/gui/hklwindow.h           |  4 ++--
+ src/gui/pseudoaxespinbutton.h |  4 ++--
  5 files changed, 20 insertions(+), 13 deletions(-)
 
 commit dc5db55efee0d37527686df1e834cb53aab452c6
@@ -12549,11 +22310,11 @@ Date:   Wed Dec 20 14:37:11 2006 +0100
 
     * add a parameter to the eulerian pseudoAxes to switch between the 2 possible solutions.
 
- TODO                                 |    3 +-
- VERSION                              |    2 +-
- include/hkl/diffractometer_kappa4C.h |    2 +-
- include/hkl/pseudoaxe_kappa4C.h      |    3 +
- src/pseudoaxe_kappa4C.cpp            |  117 +++++++++++++++++++++++++++-------
+ TODO                                 |   3 +-
+ VERSION                              |   2 +-
+ include/hkl/diffractometer_kappa4C.h |   2 +-
+ include/hkl/pseudoaxe_kappa4C.h      |   3 +
+ src/pseudoaxe_kappa4C.cpp            | 117 ++++++++++++++++++++++++++++-------
  5 files changed, 101 insertions(+), 26 deletions(-)
 
 commit 293e58372246a02a653f60dbc3ed4f8bd9daca39
@@ -12562,16 +22323,16 @@ Date:   Tue Dec 19 17:32:08 2006 +0100
 
     * add the DiffractometerFactory
 
- include/hkl/diffractometer_kappa4C.h |    2 +-
- include/hkl/diffractometer_kappa6C.h |    2 +-
- include/hkl/diffractometerfactory.h  |   39 ++++++++++++++++++++++++++++
- include/hkl/enums.h                  |   11 ++++++++
- src/SConscript                       |    1 +
- src/diffractometer_kappa4C.cpp       |    2 +-
- src/diffractometer_kappa6C.cpp       |    2 +-
- src/diffractometerfactory.cpp        |   46 ++++++++++++++++++++++++++++++++++
- test/diffractometer_kappa4C_test.cpp |    4 +-
- test/diffractometer_kappa6C_test.cpp |    4 +-
+ include/hkl/diffractometer_kappa4C.h |  2 +-
+ include/hkl/diffractometer_kappa6C.h |  2 +-
+ include/hkl/diffractometerfactory.h  | 39 ++++++++++++++++++++++++++++++
+ include/hkl/enums.h                  | 11 +++++++++
+ src/SConscript                       |  1 +
+ src/diffractometer_kappa4C.cpp       |  2 +-
+ src/diffractometer_kappa6C.cpp       |  2 +-
+ src/diffractometerfactory.cpp        | 46 ++++++++++++++++++++++++++++++++++++
+ test/diffractometer_kappa4C_test.cpp |  4 ++--
+ test/diffractometer_kappa6C_test.cpp |  4 ++--
  10 files changed, 105 insertions(+), 8 deletions(-)
 
 commit 893095ed322aa3c8b4f41ca54fd9cce24bb26dc9
@@ -12580,65 +22341,65 @@ Date:   Tue Dec 19 16:30:57 2006 +0100
 
     * second part of the documentation.
 
- include/hkl/HKLException.h              |   18 +-
- include/hkl/affinement.h                |  294 ++++++------
- include/hkl/axe.h                       |  190 ++++----
- include/hkl/constants.h                 |   40 +-
- include/hkl/convenience.h               |   48 +-
- include/hkl/derivedmode.h               |   76 ++--
- include/hkl/derivedpseudoaxe.h          |  280 ++++++------
- include/hkl/diffractometer.h            |  160 +++---
- include/hkl/diffractometer_eulerian4C.h |   58 ++--
- include/hkl/diffractometer_eulerian6C.h |   52 +-
- include/hkl/diffractometer_kappa4C.h    |   60 ++--
- include/hkl/diffractometer_kappa6C.h    |   52 +-
- include/hkl/diffractometer_twoC.h       |   58 ++--
- include/hkl/enums.h                     |   26 +-
- include/hkl/fitparameter.h              |  220 +++++-----
- include/hkl/fitparameterlist.h          |  264 +++++-----
- include/hkl/geometry.h                  |  402 ++++++++--------
- include/hkl/geometry_eulerian4C.h       |  385 ++++++++-------
- include/hkl/geometry_eulerian6C.h       |  382 +++++++++-------
- include/hkl/geometry_kappa.h            |  106 ++--
- include/hkl/geometry_kappa4C.h          |  312 +++++++------
- include/hkl/geometry_kappa6C.h          |  394 +++++++++-------
- include/hkl/geometry_twoC.h             |  286 ++++++------
- include/hkl/hklobject.h                 |  122 +++---
- include/hkl/lattice.h                   |  454 +++++++++---------
- include/hkl/mode.h                      |  228 +++++-----
- include/hkl/mode_eulerian4C.h           |  204 ++++----
- include/hkl/mode_eulerian6C.h           |  112 +++---
- include/hkl/mode_kappa4C.h              |   36 +-
- include/hkl/mode_kappa6C.h              |   36 +-
- include/hkl/mode_twoC.h                 |   96 ++--
- include/hkl/modelist.h                  |  176 ++++----
- include/hkl/mymap.h                     |  788 +++++++++++++++---------------
- include/hkl/mystring.h                  |  134 +++---
- include/hkl/myvector.h                  |  802 +++++++++++++++---------------
- include/hkl/object.h                    |  318 ++++++------
- include/hkl/observer.h                  |  152 +++---
- include/hkl/parameter.h                 |   86 ++--
- include/hkl/parameterlist.h             |  194 ++++----
- include/hkl/pseudoaxe.h                 |  430 +++++++++--------
- include/hkl/pseudoaxe_eulerian4C.h      |  234 +++++-----
- include/hkl/pseudoaxe_eulerian6C.h      |  122 +++---
- include/hkl/pseudoaxe_kappa4C.h         |  142 +++---
- include/hkl/pseudoaxe_kappa6C.h         |   70 ++--
- include/hkl/pseudoaxe_twoC.h            |  110 +++---
- include/hkl/pseudoaxelist.h             |  174 ++++----
- include/hkl/quaternion.h                |  280 ++++++------
- include/hkl/range.h                     |  259 ++++++-----
- include/hkl/reflection.h                |  322 ++++++------
- include/hkl/reflection_monocrystal.h    |   61 ++-
- include/hkl/reflectionfactory.h         |   43 +-
- include/hkl/reflectionlist.h            |  203 +++++----
- include/hkl/sample.h                    |  175 +++++---
- include/hkl/sample_monocrystal.h        |  186 ++++---
- include/hkl/samplefactory.h             |   56 ++-
- include/hkl/samplelist.h                |  150 +++++--
- include/hkl/source.h                    |  238 +++++-----
- include/hkl/svecmat.h                   |  767 ++++++++++++++++--------------
- include/hkl/value.h                     |  302 ++++++------
+ include/hkl/HKLException.h              |  18 +-
+ include/hkl/affinement.h                | 294 ++++++------
+ include/hkl/axe.h                       | 190 ++++----
+ include/hkl/constants.h                 |  40 +-
+ include/hkl/convenience.h               |  48 +-
+ include/hkl/derivedmode.h               |  76 +--
+ include/hkl/derivedpseudoaxe.h          | 280 +++++------
+ include/hkl/diffractometer.h            | 160 +++----
+ include/hkl/diffractometer_eulerian4C.h |  58 +--
+ include/hkl/diffractometer_eulerian6C.h |  52 +--
+ include/hkl/diffractometer_kappa4C.h    |  60 +--
+ include/hkl/diffractometer_kappa6C.h    |  52 +--
+ include/hkl/diffractometer_twoC.h       |  58 +--
+ include/hkl/enums.h                     |  26 +-
+ include/hkl/fitparameter.h              | 220 ++++-----
+ include/hkl/fitparameterlist.h          | 264 +++++------
+ include/hkl/geometry.h                  | 402 ++++++++--------
+ include/hkl/geometry_eulerian4C.h       | 385 ++++++++-------
+ include/hkl/geometry_eulerian6C.h       | 382 ++++++++-------
+ include/hkl/geometry_kappa.h            | 106 ++---
+ include/hkl/geometry_kappa4C.h          | 312 +++++++------
+ include/hkl/geometry_kappa6C.h          | 394 +++++++++-------
+ include/hkl/geometry_twoC.h             | 286 ++++++------
+ include/hkl/hklobject.h                 | 122 ++---
+ include/hkl/lattice.h                   | 454 +++++++++---------
+ include/hkl/mode.h                      | 228 ++++-----
+ include/hkl/mode_eulerian4C.h           | 204 ++++----
+ include/hkl/mode_eulerian6C.h           | 112 ++---
+ include/hkl/mode_kappa4C.h              |  36 +-
+ include/hkl/mode_kappa6C.h              |  36 +-
+ include/hkl/mode_twoC.h                 |  96 ++--
+ include/hkl/modelist.h                  | 176 +++----
+ include/hkl/mymap.h                     | 788 +++++++++++++++----------------
+ include/hkl/mystring.h                  | 134 +++---
+ include/hkl/myvector.h                  | 802 ++++++++++++++++----------------
+ include/hkl/object.h                    | 318 ++++++-------
+ include/hkl/observer.h                  | 152 +++---
+ include/hkl/parameter.h                 |  86 ++--
+ include/hkl/parameterlist.h             | 194 ++++----
+ include/hkl/pseudoaxe.h                 | 430 +++++++++--------
+ include/hkl/pseudoaxe_eulerian4C.h      | 234 +++++-----
+ include/hkl/pseudoaxe_eulerian6C.h      | 122 ++---
+ include/hkl/pseudoaxe_kappa4C.h         | 142 +++---
+ include/hkl/pseudoaxe_kappa6C.h         |  70 +--
+ include/hkl/pseudoaxe_twoC.h            | 110 ++---
+ include/hkl/pseudoaxelist.h             | 174 +++----
+ include/hkl/quaternion.h                | 280 +++++------
+ include/hkl/range.h                     | 259 ++++++-----
+ include/hkl/reflection.h                | 322 ++++++-------
+ include/hkl/reflection_monocrystal.h    |  61 ++-
+ include/hkl/reflectionfactory.h         |  43 +-
+ include/hkl/reflectionlist.h            | 203 ++++----
+ include/hkl/sample.h                    | 175 ++++---
+ include/hkl/sample_monocrystal.h        | 186 ++++----
+ include/hkl/samplefactory.h             |  56 ++-
+ include/hkl/samplelist.h                | 150 ++++--
+ include/hkl/source.h                    | 238 +++++-----
+ include/hkl/svecmat.h                   | 767 ++++++++++++++++--------------
+ include/hkl/value.h                     | 302 ++++++------
  59 files changed, 6505 insertions(+), 5920 deletions(-)
 
 commit 158dae8abe9b987b3e06214b3c5585485d040b58
@@ -12647,29 +22408,29 @@ Date:   Sun Dec 17 16:16:28 2006 +0100
 
     * first part of the documentation before release 2.3.0
 
- doc/Doxyfile                      |    8 +-
- include/hkl/axe.h                 |    4 +-
- include/hkl/derivedmode.h         |   11 ++-
- include/hkl/derivedpseudoaxe.h    |  319 ++++++++++++++++++-------------------
- include/hkl/diffractometer.h      |  215 +++++++++++++++----------
- include/hkl/diffractometer_twoC.h |    2 +-
- include/hkl/enums.h               |    6 +
- include/hkl/fitparameterlist.h    |   71 ++++++++-
- include/hkl/geometry.h            |   48 ++++--
- include/hkl/hklobject.h           |   46 +++---
- include/hkl/lattice.h             |  140 +++++++++++++++--
- include/hkl/mode.h                |   38 +++--
- include/hkl/modelist.h            |   70 ++++++++-
- include/hkl/mystring.h            |   50 ++++--
- include/hkl/myvector.h            |   46 ++++++
- include/hkl/object.h              |   53 +++---
- include/hkl/observer.h            |   44 +++++-
- include/hkl/parameter.h           |    9 +
- include/hkl/parameterlist.h       |   56 +++++++-
- include/hkl/pseudoaxe.h           |   58 ++++++--
- include/hkl/pseudoaxelist.h       |   68 ++++++++-
- include/hkl/reflection.h          |   87 ++++++++++-
- src/object.cpp                    |   20 ++--
+ doc/Doxyfile                      |   8 +-
+ include/hkl/axe.h                 |   4 +-
+ include/hkl/derivedmode.h         |  11 +-
+ include/hkl/derivedpseudoaxe.h    | 319 ++++++++++++++++++--------------------
+ include/hkl/diffractometer.h      | 215 ++++++++++++++-----------
+ include/hkl/diffractometer_twoC.h |   2 +-
+ include/hkl/enums.h               |   6 +
+ include/hkl/fitparameterlist.h    |  71 ++++++++-
+ include/hkl/geometry.h            |  48 ++++--
+ include/hkl/hklobject.h           |  46 +++---
+ include/hkl/lattice.h             | 140 +++++++++++++++--
+ include/hkl/mode.h                |  38 +++--
+ include/hkl/modelist.h            |  70 ++++++++-
+ include/hkl/mystring.h            |  50 ++++--
+ include/hkl/myvector.h            |  46 ++++++
+ include/hkl/object.h              |  53 +++----
+ include/hkl/observer.h            |  44 +++++-
+ include/hkl/parameter.h           |   9 ++
+ include/hkl/parameterlist.h       |  56 ++++++-
+ include/hkl/pseudoaxe.h           |  58 +++++--
+ include/hkl/pseudoaxelist.h       |  68 +++++++-
+ include/hkl/reflection.h          |  87 ++++++++++-
+ src/object.cpp                    |  20 +--
  23 files changed, 1066 insertions(+), 403 deletions(-)
 
 commit 0d071da4ad04fd7289c84f3d68839ff2f511c4e5
@@ -12678,69 +22439,69 @@ Date:   Sat Dec 16 21:55:26 2006 +0100
 
     * start updating the documentation
 
- include/hkl/HKLException.h              |   18 +-
- include/hkl/affinement.h                |  298 ++++++------
- include/hkl/axe.h                       |  191 ++++----
- include/hkl/constants.h                 |   42 +-
- include/hkl/convenience.h               |   48 +-
- include/hkl/derivedmode.h               |   58 ++--
- include/hkl/derivedpseudoaxe.h          |  266 ++++++------
- include/hkl/diffractometer.h            |   86 ++--
- include/hkl/diffractometer_eulerian4C.h |   58 ++--
- include/hkl/diffractometer_eulerian6C.h |   52 +-
- include/hkl/diffractometer_kappa4C.h    |   62 ++--
- include/hkl/diffractometer_kappa6C.h    |   52 +-
- include/hkl/diffractometer_twoC.h       |   58 ++--
- include/hkl/enums.h                     |   14 +-
- include/hkl/fitparameter.h              |  219 +++++-----
- include/hkl/fitparameterlist.h          |  120 +++---
- include/hkl/geometry.h                  |  360 +++++++-------
- include/hkl/geometry_eulerian4C.h       |  348 +++++++-------
- include/hkl/geometry_eulerian6C.h       |  334 +++++++-------
- include/hkl/geometry_kappa.h            |  106 ++--
- include/hkl/geometry_kappa4C.h          |  283 ++++++------
- include/hkl/geometry_kappa6C.h          |  347 +++++++-------
- include/hkl/geometry_twoC.h             |  272 ++++++------
- include/hkl/hklobject.h                 |  118 +++---
- include/hkl/lattice.h                   |  192 ++++----
- include/hkl/mode.h                      |  194 ++++----
- include/hkl/mode_eulerian4C.h           |  204 ++++----
- include/hkl/mode_eulerian6C.h           |  113 +++---
- include/hkl/mode_kappa4C.h              |   36 +-
- include/hkl/mode_kappa6C.h              |   36 +-
- include/hkl/mode_twoC.h                 |   96 ++--
- include/hkl/modelist.h                  |   44 +-
- include/hkl/mymap.h                     |  785 ++++++++++++++++---------------
- include/hkl/mystring.h                  |   76 ++--
- include/hkl/myvector.h                  |  696 ++++++++++++++--------------
- include/hkl/object.h                    |  316 +++++++-------
- include/hkl/observer.h                  |   56 ++--
- include/hkl/parameter.h                 |   69 ++--
- include/hkl/parameterlist.h             |   66 ++--
- include/hkl/pseudoaxe.h                 |  306 ++++++------
- include/hkl/pseudoaxe_eulerian4C.h      |  226 +++++-----
- include/hkl/pseudoaxe_eulerian6C.h      |  116 +++---
- include/hkl/pseudoaxe_kappa4C.h         |  142 +++---
- include/hkl/pseudoaxe_kappa6C.h         |   70 ++--
- include/hkl/pseudoaxe_twoC.h            |  110 +++---
- include/hkl/pseudoaxelist.h             |   44 +-
- include/hkl/quaternion.h                |  280 ++++++------
- include/hkl/range.h                     |  221 +++++-----
- include/hkl/reflection.h                |  166 ++++----
- include/hkl/reflection_monocrystal.h    |   38 +-
- include/hkl/reflectionfactory.h         |   41 +-
- include/hkl/reflectionlist.h            |  181 ++++----
- include/hkl/sample.h                    |   92 ++--
- include/hkl/sample_monocrystal.h        |  103 +++--
- include/hkl/samplefactory.h             |   22 +-
- include/hkl/samplelist.h                |   56 ++--
- include/hkl/source.h                    |  242 +++++-----
- include/hkl/svecmat.h                   |  702 ++++++++++++++--------------
- include/hkl/value.h                     |  302 ++++++------
- src/diffractometer_kappa.cpp            |   17 -
- src/range.cpp                           |   12 +-
- src/sample.cpp                          |    9 -
- src/sample_monocrystal.cpp              |   17 -
+ include/hkl/HKLException.h              |  18 +-
+ include/hkl/affinement.h                | 298 ++++++------
+ include/hkl/axe.h                       | 191 ++++----
+ include/hkl/constants.h                 |  42 +-
+ include/hkl/convenience.h               |  48 +-
+ include/hkl/derivedmode.h               |  58 +--
+ include/hkl/derivedpseudoaxe.h          | 266 ++++++-----
+ include/hkl/diffractometer.h            |  86 ++--
+ include/hkl/diffractometer_eulerian4C.h |  58 +--
+ include/hkl/diffractometer_eulerian6C.h |  52 +--
+ include/hkl/diffractometer_kappa4C.h    |  62 +--
+ include/hkl/diffractometer_kappa6C.h    |  52 +--
+ include/hkl/diffractometer_twoC.h       |  58 +--
+ include/hkl/enums.h                     |  14 +-
+ include/hkl/fitparameter.h              | 219 ++++-----
+ include/hkl/fitparameterlist.h          | 120 ++---
+ include/hkl/geometry.h                  | 360 +++++++--------
+ include/hkl/geometry_eulerian4C.h       | 348 +++++++-------
+ include/hkl/geometry_eulerian6C.h       | 334 +++++++-------
+ include/hkl/geometry_kappa.h            | 106 ++---
+ include/hkl/geometry_kappa4C.h          | 283 ++++++------
+ include/hkl/geometry_kappa6C.h          | 347 +++++++-------
+ include/hkl/geometry_twoC.h             | 272 +++++------
+ include/hkl/hklobject.h                 | 118 ++---
+ include/hkl/lattice.h                   | 192 ++++----
+ include/hkl/mode.h                      | 194 ++++----
+ include/hkl/mode_eulerian4C.h           | 204 ++++-----
+ include/hkl/mode_eulerian6C.h           | 113 +++--
+ include/hkl/mode_kappa4C.h              |  36 +-
+ include/hkl/mode_kappa6C.h              |  36 +-
+ include/hkl/mode_twoC.h                 |  96 ++--
+ include/hkl/modelist.h                  |  44 +-
+ include/hkl/mymap.h                     | 785 ++++++++++++++++----------------
+ include/hkl/mystring.h                  |  76 ++--
+ include/hkl/myvector.h                  | 696 ++++++++++++++--------------
+ include/hkl/object.h                    | 316 ++++++-------
+ include/hkl/observer.h                  |  56 +--
+ include/hkl/parameter.h                 |  69 ++-
+ include/hkl/parameterlist.h             |  66 +--
+ include/hkl/pseudoaxe.h                 | 306 +++++++------
+ include/hkl/pseudoaxe_eulerian4C.h      | 226 ++++-----
+ include/hkl/pseudoaxe_eulerian6C.h      | 116 ++---
+ include/hkl/pseudoaxe_kappa4C.h         | 142 +++---
+ include/hkl/pseudoaxe_kappa6C.h         |  70 +--
+ include/hkl/pseudoaxe_twoC.h            | 110 ++---
+ include/hkl/pseudoaxelist.h             |  44 +-
+ include/hkl/quaternion.h                | 280 ++++++------
+ include/hkl/range.h                     | 221 ++++-----
+ include/hkl/reflection.h                | 166 ++++---
+ include/hkl/reflection_monocrystal.h    |  38 +-
+ include/hkl/reflectionfactory.h         |  41 +-
+ include/hkl/reflectionlist.h            | 181 ++++----
+ include/hkl/sample.h                    |  92 ++--
+ include/hkl/sample_monocrystal.h        | 103 +++--
+ include/hkl/samplefactory.h             |  22 +-
+ include/hkl/samplelist.h                |  56 +--
+ include/hkl/source.h                    | 242 +++++-----
+ include/hkl/svecmat.h                   | 702 ++++++++++++++--------------
+ include/hkl/value.h                     | 302 ++++++------
+ src/diffractometer_kappa.cpp            |  17 -
+ src/range.cpp                           |  12 +-
+ src/sample.cpp                          |   9 -
+ src/sample_monocrystal.cpp              |  17 -
  63 files changed, 5128 insertions(+), 5176 deletions(-)
 
 commit e47ae27c08352ceb7e93e705753404c4e336d3b9
@@ -12749,21 +22510,21 @@ Date:   Fri Dec 15 16:30:13 2006 +0100
 
     * update the diffractometer tests.
 
- include/hkl/samplelist.h                |    3 +
- src/diffractometer_eulerian4C.cpp       |    6 +-
- src/diffractometer_eulerian6C.cpp       |   12 +-
- src/diffractometer_kappa4C.cpp          |    8 +-
- src/diffractometer_kappa6C.cpp          |   12 +-
- src/samplelist.cpp                      |   22 ++-
- test/SConscript                         |    8 +-
- test/diffractometer_eulerian4C_test.cpp |  234 ++++++++--------
- test/diffractometer_eulerian4C_test.h   |   75 +++---
- test/diffractometer_kappa4C_test.cpp    |   72 +++++-
- test/diffractometer_kappa4C_test.h      |   17 +-
- test/diffractometer_kappa6C_test.cpp    |   84 +++++-
- test/diffractometer_kappa6C_test.h      |   17 +-
- test/diffractometer_twoC_test.cpp       |  470 +++++++++++++++----------------
- test/diffractometer_twoC_test.h         |   65 +++--
+ include/hkl/samplelist.h                |   3 +
+ src/diffractometer_eulerian4C.cpp       |   6 +-
+ src/diffractometer_eulerian6C.cpp       |  12 +-
+ src/diffractometer_kappa4C.cpp          |   8 +-
+ src/diffractometer_kappa6C.cpp          |  12 +-
+ src/samplelist.cpp                      |  22 +-
+ test/SConscript                         |   8 +-
+ test/diffractometer_eulerian4C_test.cpp | 234 ++++++++--------
+ test/diffractometer_eulerian4C_test.h   |  75 ++---
+ test/diffractometer_kappa4C_test.cpp    |  72 ++++-
+ test/diffractometer_kappa4C_test.h      |  17 +-
+ test/diffractometer_kappa6C_test.cpp    |  84 +++++-
+ test/diffractometer_kappa6C_test.h      |  17 +-
+ test/diffractometer_twoC_test.cpp       | 470 ++++++++++++++++----------------
+ test/diffractometer_twoC_test.h         |  65 ++---
  15 files changed, 630 insertions(+), 475 deletions(-)
 
 commit b6f4df3cc3a11a599b42b357c9491fee868dc5f1
@@ -12774,7 +22535,7 @@ Date:   Thu Dec 14 17:03:21 2006 +0100
     * modification of all diffractometers class
 
  config-linux2.py                        |    1 +
- doc/uml/next_hkl.dia                    |  749 ++++++++++++++--
+ doc/uml/next_hkl.dia                    |  749 +++++++++++++--
  include/hkl/diffractometer.h            | 1506 +------------------------------
  include/hkl/diffractometer_eulerian4C.h |    2 +-
  include/hkl/diffractometer_eulerian6C.h |    2 +-
@@ -12801,24 +22562,24 @@ Date:   Fri Dec 8 17:32:04 2006 +0100
 
     * now all modes are ok
 
- include/hkl/derivedmode.h         |   69 +++------
- include/hkl/derivedpseudoaxe.h    |    2 -
- include/hkl/geometry_kappa6C.h    |    5 -
- include/hkl/mode_eulerian4C.h     |   54 ++++----
- include/hkl/mode_eulerian6C.h     |   11 +-
- include/hkl/parameterlist.h       |    2 +-
- src/SConscript                    |    4 +-
- src/diffractometer_eulerian4C.cpp |   10 +-
- src/mode_eulerian4C.cpp           |  193 +++++++++++++------------
- src/mode_eulerian6C.cpp           |   58 ++++----
- src/parameterlist.cpp             |   14 ++
- test/SConscript                   |    6 +-
- test/mode_eulerian4C_test.cpp     |  258 ++++++++++++++++-----------------
- test/mode_eulerian4C_test.h       |   15 +--
- test/mode_kappa4C_test.cpp        |  231 +++++++++++++++---------------
- test/mode_kappa4C_test.h          |   10 +-
- test/mode_kappa6C_test.cpp        |  289 +++++++++++++++++++------------------
- test/mode_kappa6C_test.h          |   10 +-
+ include/hkl/derivedmode.h         |  69 +++------
+ include/hkl/derivedpseudoaxe.h    |   2 -
+ include/hkl/geometry_kappa6C.h    |   5 -
+ include/hkl/mode_eulerian4C.h     |  54 +++----
+ include/hkl/mode_eulerian6C.h     |  11 +-
+ include/hkl/parameterlist.h       |   2 +-
+ src/SConscript                    |   4 +-
+ src/diffractometer_eulerian4C.cpp |  10 +-
+ src/mode_eulerian4C.cpp           | 193 ++++++++++++-------------
+ src/mode_eulerian6C.cpp           |  58 ++++----
+ src/parameterlist.cpp             |  14 ++
+ test/SConscript                   |   6 +-
+ test/mode_eulerian4C_test.cpp     | 258 +++++++++++++++++-----------------
+ test/mode_eulerian4C_test.h       |  15 +-
+ test/mode_kappa4C_test.cpp        | 231 +++++++++++++++---------------
+ test/mode_kappa4C_test.h          |  10 +-
+ test/mode_kappa6C_test.cpp        | 289 +++++++++++++++++++-------------------
+ test/mode_kappa6C_test.h          |  10 +-
  18 files changed, 604 insertions(+), 637 deletions(-)
 
 commit 1c401e16f5ce16562079a081ea5d0f2f71a6fe3b
@@ -12827,16 +22588,16 @@ Date:   Fri Dec 8 11:58:19 2006 +0100
 
     * start refactoring of the mode part.
 
- include/hkl/mode.h          |  197 ++++++++++++++++++++-----------------------
- include/hkl/mode_twoC.h     |   20 ++--
- include/hkl/pseudoaxe.h     |    1 -
- src/SConscript              |    3 +-
- src/diffractometer_twoC.cpp |   10 +-
- src/mode.cpp                |   14 +++
- src/mode_twoC.cpp           |   44 ++++------
- test/SConscript             |    2 +-
- test/mode_twoC_test.cpp     |  139 ++++++++++++++++--------------
- test/mode_twoC_test.h       |    7 +-
+ include/hkl/mode.h          | 197 +++++++++++++++++++++-----------------------
+ include/hkl/mode_twoC.h     |  20 ++---
+ include/hkl/pseudoaxe.h     |   1 -
+ src/SConscript              |   3 +-
+ src/diffractometer_twoC.cpp |  10 +--
+ src/mode.cpp                |  14 ++++
+ src/mode_twoC.cpp           |  44 +++++-----
+ test/SConscript             |   2 +-
+ test/mode_twoC_test.cpp     | 139 ++++++++++++++++---------------
+ test/mode_twoC_test.h       |   7 +-
  10 files changed, 221 insertions(+), 216 deletions(-)
 
 commit e641789b202fb6751499486f01448533ea819c7b
@@ -12845,28 +22606,28 @@ Date:   Thu Dec 7 16:42:57 2006 +0100
 
     * update to compile on win32 and add the axes method to the geometries
 
- SConstruct                         |   15 +----
- include/hkl/geometry_eulerian4C.h  |   45 +++++++++++++--
- include/hkl/geometry_eulerian6C.h  |   35 ++++++++++--
- include/hkl/geometry_kappa4C.h     |   45 +++++++++++++--
- include/hkl/geometry_kappa6C.h     |   30 ++++++++++
- include/hkl/geometry_twoC.h        |   25 +++++++--
- include/hkl/pseudoaxe_eulerian4C.h |    8 +-
- include/hkl/pseudoaxe_twoC.h       |   10 ++--
- src/SConscript                     |    1 +
- src/geometry_eulerian4C.cpp        |   36 ++++++------
- src/geometry_eulerian6C.cpp        |   40 +++++++-------
- src/geometry_kappa4C.cpp           |   44 +++++++-------
- src/geometry_kappa6C.cpp           |   38 +++++++------
- src/geometry_twoC.cpp              |   40 +++++++-------
- src/gui/SConscript                 |    1 +
- src/pseudoaxe_eulerian4C.cpp       |   39 ++++++-------
- src/pseudoaxe_twoC.cpp             |   60 ++++++++++----------
- src/range.cpp                      |    8 ++-
- test/pseudoaxe_eulerian4C_test.cpp |   88 ++++++++++-------------------
- test/pseudoaxe_eulerian6C_test.cpp |  110 ++++++++++++------------------------
- test/pseudoaxe_kappa4C_test.cpp    |   98 +++++++++++--------------------
- test/pseudoaxe_kappa6C_test.cpp    |   42 ++++++--------
+ SConstruct                         |  15 ++---
+ include/hkl/geometry_eulerian4C.h  |  45 +++++++++++++--
+ include/hkl/geometry_eulerian6C.h  |  35 ++++++++++--
+ include/hkl/geometry_kappa4C.h     |  45 +++++++++++++--
+ include/hkl/geometry_kappa6C.h     |  30 ++++++++++
+ include/hkl/geometry_twoC.h        |  25 +++++++--
+ include/hkl/pseudoaxe_eulerian4C.h |   8 +--
+ include/hkl/pseudoaxe_twoC.h       |  10 ++--
+ src/SConscript                     |   1 +
+ src/geometry_eulerian4C.cpp        |  36 ++++++------
+ src/geometry_eulerian6C.cpp        |  40 +++++++-------
+ src/geometry_kappa4C.cpp           |  44 +++++++--------
+ src/geometry_kappa6C.cpp           |  38 +++++++------
+ src/geometry_twoC.cpp              |  40 +++++++-------
+ src/gui/SConscript                 |   1 +
+ src/pseudoaxe_eulerian4C.cpp       |  39 ++++++-------
+ src/pseudoaxe_twoC.cpp             |  60 ++++++++++----------
+ src/range.cpp                      |   8 ++-
+ test/pseudoaxe_eulerian4C_test.cpp |  88 ++++++++++-------------------
+ test/pseudoaxe_eulerian6C_test.cpp | 110 +++++++++++++------------------------
+ test/pseudoaxe_kappa4C_test.cpp    |  98 ++++++++++++---------------------
+ test/pseudoaxe_kappa6C_test.cpp    |  42 +++++++-------
  22 files changed, 449 insertions(+), 409 deletions(-)
 
 commit da12d2c27a5c64608140117722e6fbee640b36f5
@@ -12878,8 +22639,8 @@ Date:   Thu Dec 7 10:40:25 2006 +0100
 
  SConstruct                              |    5 +-
  config-linux2.py                        |    1 -
- doc/uml/next_hkl.dia                    | 2489 +++++++++++++++++++++++++++----
- include/hkl/derivedpseudoaxe.h          |  191 ++--
+ doc/uml/next_hkl.dia                    | 2643 ++++++++++++++++++++++++++-----
+ include/hkl/derivedpseudoaxe.h          |  191 +--
  include/hkl/fitparameter.h              |    2 +-
  include/hkl/fitparameterlist.h          |    1 -
  include/hkl/geometry.h                  |   15 +-
@@ -12914,10 +22675,10 @@ Date:   Thu Dec 7 10:40:25 2006 +0100
  src/parameterlist.cpp                   |   90 ++
  src/pseudoaxe.cpp                       |   93 ++
  src/pseudoaxe_eulerian4C.cpp            |  202 ++-
- src/pseudoaxe_eulerian6C.cpp            |  415 +++---
+ src/pseudoaxe_eulerian6C.cpp            |  415 ++---
  src/pseudoaxe_kappa4C.cpp               |  368 ++---
- src/pseudoaxe_twoC.cpp                  |  377 +++---
- src/range.cpp                           |  230 +++-
+ src/pseudoaxe_twoC.cpp                  |  377 ++---
+ src/range.cpp                           |  230 ++-
  src/reflection.cpp                      |    7 +-
  src/source.cpp                          |   14 +-
  src/svector.cpp                         |   25 +
@@ -12926,7 +22687,7 @@ Date:   Thu Dec 7 10:40:25 2006 +0100
  test/affinement_simplex_test.h          |    4 +-
  test/axe_test.cpp                       |   38 +-
  test/axe_test.h                         |   42 +-
- test/diffractometer_eulerian4C_test.cpp |  702 +++++-----
+ test/diffractometer_eulerian4C_test.cpp |  702 ++++----
  test/diffractometer_eulerian4C_test.h   |    5 +-
  test/diffractometer_kappa4C_test.cpp    |   44 +-
  test/diffractometer_kappa4C_test.h      |   27 +-
@@ -12934,33 +22695,33 @@ Date:   Thu Dec 7 10:40:25 2006 +0100
  test/diffractometer_kappa6C_test.h      |   31 +-
  test/diffractometer_test.cpp            |  135 +-
  test/diffractometer_test.h              |   45 +-
- test/diffractometer_twoC_test.cpp       |  522 ++++----
+ test/diffractometer_twoC_test.cpp       |  522 +++---
  test/diffractometer_twoC_test.h         |   77 +-
  test/fitparameter_test.cpp              |   82 +-
  test/fitparameter_test.h                |   30 +-
- test/geometry_eulerian4C_test.cpp       |  179 ++--
+ test/geometry_eulerian4C_test.cpp       |  179 ++-
  test/geometry_eulerian4C_test.h         |    5 +-
  test/geometry_eulerian6C_test.cpp       |  271 ++--
  test/geometry_eulerian6C_test.h         |   77 +-
  test/geometry_kappa4C_test.cpp          |  305 ++--
  test/geometry_kappa4C_test.h            |    5 +-
- test/geometry_kappa6C_test.cpp          |  241 ++--
+ test/geometry_kappa6C_test.cpp          |  241 +--
  test/geometry_kappa6C_test.h            |    5 +-
  test/geometry_test.cpp                  |  136 +-
  test/geometry_test.h                    |    7 +-
- test/geometry_twoC_test.cpp             |  218 ++--
+ test/geometry_twoC_test.cpp             |  218 +--
  test/geometry_twoC_test.h               |   11 +-
  test/hklobject_test.cpp                 |   10 +-
  test/hklobject_test.h                   |   26 +-
- test/lattice_test.cpp                   |  364 +++---
+ test/lattice_test.cpp                   |  364 +++--
  test/lattice_test.h                     |   47 +-
  test/libHKL_test.cpp                    |    4 +-
  test/main.cpp                           |   12 +-
- test/mode_eulerian4C_test.cpp           |  501 ++++----
+ test/mode_eulerian4C_test.cpp           |  501 +++---
  test/mode_eulerian4C_test.h             |   49 +-
  test/mode_kappa4C_test.cpp              |  459 +++---
  test/mode_kappa4C_test.h                |   47 +-
- test/mode_kappa6C_test.cpp              |  507 ++++----
+ test/mode_kappa6C_test.cpp              |  507 +++---
  test/mode_kappa6C_test.h                |   47 +-
  test/mode_twoC_test.cpp                 |  165 +-
  test/mode_twoC_test.h                   |   37 +-
@@ -12970,15 +22731,15 @@ Date:   Thu Dec 7 10:40:25 2006 +0100
  test/object_test.h                      |   42 +-
  test/parameter_test.cpp                 |   13 +-
  test/parameter_test.h                   |   26 +-
- test/pseudoaxe_eulerian4C_test.cpp      |  789 +++++-----
+ test/pseudoaxe_eulerian4C_test.cpp      |  789 +++++----
  test/pseudoaxe_eulerian4C_test.h        |   34 +-
- test/pseudoaxe_eulerian6C_test.cpp      |  678 ++++-----
+ test/pseudoaxe_eulerian6C_test.cpp      |  678 ++++----
  test/pseudoaxe_eulerian6C_test.h        |    4 +-
- test/pseudoaxe_kappa4C_test.cpp         | 1033 +++++++-------
+ test/pseudoaxe_kappa4C_test.cpp         | 1033 ++++++------
  test/pseudoaxe_kappa4C_test.h           |   52 +-
- test/pseudoaxe_kappa6C_test.cpp         |  757 ++++++----
+ test/pseudoaxe_kappa6C_test.cpp         |  757 +++++----
  test/pseudoaxe_kappa6C_test.h           |   52 +-
- test/pseudoaxe_twoC_test.cpp            |  429 +++---
+ test/pseudoaxe_twoC_test.cpp            |  429 ++---
  test/pseudoaxe_twoC_test.h              |   30 +-
  test/quaternion_test.cpp                |   34 +-
  test/quaternion_test.h                  |   90 +-
@@ -12999,7 +22760,7 @@ Date:   Thu Dec 7 10:40:25 2006 +0100
  test/value_test.cpp                     |   13 +-
  test/value_test.h                       |   53 +-
  tool/doxygen.py                         |   23 +-
- 123 files changed, 9506 insertions(+), 6850 deletions(-)
+ 123 files changed, 9583 insertions(+), 6927 deletions(-)
 
 commit 6fb04d11f854219e6713a97da7d0d4984168663c
 Author: picca <picca at grisette.localdomain>
@@ -13007,12 +22768,12 @@ Date:   Thu Nov 9 17:23:22 2006 +0100
 
     * add some throw to method declaration.
 
- include/hkl/reflection_monocrystal.h |    2 +-
- include/hkl/reflectionfactory.h      |    2 +-
- include/hkl/reflectionlist.h         |    2 +-
- src/reflection_monocrystal.cpp       |    2 +-
- src/reflectionfactory.cpp            |    2 +-
- src/reflectionlist.cpp               |    2 +-
+ include/hkl/reflection_monocrystal.h | 2 +-
+ include/hkl/reflectionfactory.h      | 2 +-
+ include/hkl/reflectionlist.h         | 2 +-
+ src/reflection_monocrystal.cpp       | 2 +-
+ src/reflectionfactory.cpp            | 2 +-
+ src/reflectionlist.cpp               | 2 +-
  6 files changed, 6 insertions(+), 6 deletions(-)
 
 commit 28447f70ea71205cc903c119e0c1a865d23b5994
@@ -13021,25 +22782,25 @@ Date:   Thu Nov 9 16:45:20 2006 +0100
 
     * made modifications to pass all tests.
 
- doc/uml/next_hkl.dia                 |  282 ++++++++++++++++++++++++++++------
- include/hkl/lattice.h                |   20 ++-
- include/hkl/range.h                  |   12 ++-
- include/hkl/reflection.h             |    6 +-
- include/hkl/reflection_monocrystal.h |   10 +-
- include/hkl/reflectionlist.h         |    2 +-
- src/lattice.cpp                      |  129 +++++++++-------
- src/range.cpp                        |   37 ++---
- src/reflection.cpp                   |   17 +--
- src/reflection_monocrystal.cpp       |   48 ------
- src/reflectionlist.cpp               |    4 +-
- src/sample.cpp                       |    2 +-
- src/sample_monocrystal.cpp           |   16 +-
- test/SConscript                      |   11 +-
- test/range_test.cpp                  |   14 +-
- test/reflection_test.cpp             |   46 +++----
- test/reflectionlist_test.cpp         |   30 ++--
- test/sample_test.cpp                 |   20 ++--
- test/svecmat_test.cpp                |   12 +-
+ doc/uml/next_hkl.dia                 | 282 +++++++++++++++++++++++++++++------
+ include/hkl/lattice.h                |  20 +--
+ include/hkl/range.h                  |  12 +-
+ include/hkl/reflection.h             |   6 +-
+ include/hkl/reflection_monocrystal.h |  10 +-
+ include/hkl/reflectionlist.h         |   2 +-
+ src/lattice.cpp                      | 129 ++++++++--------
+ src/range.cpp                        |  37 +++--
+ src/reflection.cpp                   |  17 +--
+ src/reflection_monocrystal.cpp       |  48 ------
+ src/reflectionlist.cpp               |   4 +-
+ src/sample.cpp                       |   2 +-
+ src/sample_monocrystal.cpp           |  16 +-
+ test/SConscript                      |  11 +-
+ test/range_test.cpp                  |  14 +-
+ test/reflection_test.cpp             |  46 +++---
+ test/reflectionlist_test.cpp         |  30 ++--
+ test/sample_test.cpp                 |  20 +--
+ test/svecmat_test.cpp                |  12 +-
  19 files changed, 430 insertions(+), 288 deletions(-)
 
 commit 7b19f1caecce6fe0fe79cc16bad40fdc91919015
@@ -13048,15 +22809,15 @@ Date:   Thu Nov 9 14:02:59 2006 +0100
 
     * another fit optimization.
 
- SConstruct                       |    2 +-
- include/hkl/fitparameterlist.h   |    4 ++
- include/hkl/lattice.h            |    4 +-
- include/hkl/sample_monocrystal.h |    6 ++-
- include/hkl/value.h              |    4 +-
- src/affinement_simplex.cpp       |  112 ++++++++++----------------------------
- src/lattice.cpp                  |   11 ++--
- src/sample_monocrystal.cpp       |   32 +++++++++---
- src/value.cpp                    |    2 +-
+ SConstruct                       |   2 +-
+ include/hkl/fitparameterlist.h   |   4 ++
+ include/hkl/lattice.h            |   4 +-
+ include/hkl/sample_monocrystal.h |   6 ++-
+ include/hkl/value.h              |   4 +-
+ src/affinement_simplex.cpp       | 112 +++++++++++----------------------------
+ src/lattice.cpp                  |  11 ++--
+ src/sample_monocrystal.cpp       |  32 ++++++++---
+ src/value.cpp                    |   2 +-
  9 files changed, 76 insertions(+), 101 deletions(-)
 
 commit 61e92b7c8c21a4936fa20f3f7e2dc67ced762516
@@ -13065,27 +22826,27 @@ Date:   Wed Nov 8 19:13:58 2006 +0100
 
     * new profiling day.
 
- config-win32.py                      |    1 +
- include/hkl/lattice.h                |   11 ++-
- include/hkl/range.h                  |    2 +
- include/hkl/reflection.h             |   56 ++++---------
- include/hkl/reflection_monocrystal.h |    4 +-
- include/hkl/reflectionlist.h         |    2 +-
- include/hkl/svecmat.h                |   37 +++++++-
- src/axe.cpp                          |    2 +-
- src/geometry.cpp                     |   18 ++--
- src/lattice.cpp                      |  108 ++++++++++++++++--------
- src/quaternion.cpp                   |   32 ++++----
- src/range.cpp                        |   14 +++
- src/reflection.cpp                   |   56 +++----------
- src/reflection_monocrystal.cpp       |   10 ++-
- src/reflectionfactory.cpp            |    2 +-
- src/reflectionlist.cpp               |   10 +--
- src/sample_monocrystal.cpp           |   11 ++-
- src/smatrix.cpp                      |   47 +++++++----
- src/source.cpp                       |    8 +-
- src/svector.cpp                      |  155 ++++++++++++++++++----------------
- test/affinement_simplex_test.cpp     |   10 +-
+ config-win32.py                      |   1 +
+ include/hkl/lattice.h                |  11 ++-
+ include/hkl/range.h                  |   2 +
+ include/hkl/reflection.h             |  56 ++++---------
+ include/hkl/reflection_monocrystal.h |   4 +-
+ include/hkl/reflectionlist.h         |   2 +-
+ include/hkl/svecmat.h                |  37 +++++++--
+ src/axe.cpp                          |   2 +-
+ src/geometry.cpp                     |  18 ++--
+ src/lattice.cpp                      | 108 ++++++++++++++++--------
+ src/quaternion.cpp                   |  32 ++++----
+ src/range.cpp                        |  14 ++++
+ src/reflection.cpp                   |  56 +++----------
+ src/reflection_monocrystal.cpp       |  10 ++-
+ src/reflectionfactory.cpp            |   2 +-
+ src/reflectionlist.cpp               |  10 +--
+ src/sample_monocrystal.cpp           |  11 ++-
+ src/smatrix.cpp                      |  47 +++++++----
+ src/source.cpp                       |   8 +-
+ src/svector.cpp                      | 155 ++++++++++++++++++-----------------
+ test/affinement_simplex_test.cpp     |  10 +--
  21 files changed, 328 insertions(+), 268 deletions(-)
 
 commit da02f6f255f8a3424d092d69bf38af3d53f06d80
@@ -13094,11 +22855,11 @@ Date:   Tue Nov 7 18:42:15 2006 +0100
 
     * after refactoring of the svector code.
 
- config-linux2.py           |    2 +-
- include/hkl/svecmat.h      |   22 ++++++-
- src/sample_monocrystal.cpp |    7 ++-
- src/smatrix.cpp            |    6 +-
- src/svector.cpp            |  146 +++++++++++++++++++++++++++-----------------
+ config-linux2.py           |   2 +-
+ include/hkl/svecmat.h      |  22 +++++--
+ src/sample_monocrystal.cpp |   7 ++-
+ src/smatrix.cpp            |   6 +-
+ src/svector.cpp            | 146 ++++++++++++++++++++++++++++-----------------
  5 files changed, 118 insertions(+), 65 deletions(-)
 
 commit d5b2a6b68de660889f63cc047ee970f78f7bac20
@@ -13107,14 +22868,14 @@ Date:   Tue Nov 7 17:02:52 2006 +0100
 
     * profiling of simplex before svector refactoring
 
- doc/uml/next_hkl.dia             |  120 +++++++++--
- include/hkl/affinement.h         |    4 +-
- include/hkl/fitparameterlist.h   |    3 +
- include/hkl/sample_monocrystal.h |    2 +
- include/hkl/svecmat.h            |    7 +-
- src/affinement_simplex.cpp       |  475 +++++++++++++++++++-------------------
- src/sample_monocrystal.cpp       |   53 +++--
- src/svector.cpp                  |    2 +-
+ doc/uml/next_hkl.dia             | 120 ++++++++--
+ include/hkl/affinement.h         |   4 +-
+ include/hkl/fitparameterlist.h   |   3 +
+ include/hkl/sample_monocrystal.h |   2 +
+ include/hkl/svecmat.h            |   7 +-
+ src/affinement_simplex.cpp       | 475 ++++++++++++++++++++-------------------
+ src/sample_monocrystal.cpp       |  53 ++---
+ src/svector.cpp                  |   2 +-
  8 files changed, 386 insertions(+), 280 deletions(-)
 
 commit cd23eceacb7d0dcbaeb87ddda1d7bb8f64e11f34
@@ -13124,20 +22885,20 @@ Date:   Tue Nov 7 15:05:53 2006 +0100
     * now affinement_simplex works.
     * add the config-*.py files.
 
- config-linux2.py                 |    1 +
- config-win32.py                  |    2 +
- include/hkl/fitparameterlist.h   |    9 +++
- include/hkl/lattice.h            |    3 +
- include/hkl/sample_monocrystal.h |    2 +
- src/HKLException.cpp             |    2 +-
- src/affinement_simplex.cpp       |  118 +++++++++++++++++++++++--------------
- src/lattice.cpp                  |  101 ++++++++++++++------------------
- src/range.cpp                    |   34 ++++++------
- src/reflection.cpp               |    3 +-
- src/sample_monocrystal.cpp       |   19 ++++--
- src/smatrix.cpp                  |    2 +
- test/SConscript                  |   26 ++++++---
- test/affinement_simplex_test.cpp |    4 +-
+ config-linux2.py                 |   1 +
+ config-win32.py                  |   2 +
+ include/hkl/fitparameterlist.h   |   9 +++
+ include/hkl/lattice.h            |   3 +
+ include/hkl/sample_monocrystal.h |   2 +
+ src/HKLException.cpp             |   2 +-
+ src/affinement_simplex.cpp       | 118 ++++++++++++++++++++++++---------------
+ src/lattice.cpp                  | 101 +++++++++++++++------------------
+ src/range.cpp                    |  34 +++++------
+ src/reflection.cpp               |   3 +-
+ src/sample_monocrystal.cpp       |  19 ++++---
+ src/smatrix.cpp                  |   2 +
+ test/SConscript                  |  26 ++++++---
+ test/affinement_simplex_test.cpp |   4 +-
  14 files changed, 187 insertions(+), 139 deletions(-)
 
 commit 8dbda93747238b72c6ffe5f1a7b1d5b930555db0
@@ -13147,10 +22908,10 @@ Date:   Mon Nov 6 16:13:05 2006 +0100
     * remove a bug in the Reflection. _hkl_phi menber was
       declared in Reflection and reflection::MonoCrystal.
 
- include/hkl/reflection.h             |    6 +++---
- include/hkl/reflection_monocrystal.h |    9 ---------
- src/reflection.cpp                   |    6 ++++--
- src/reflection_monocrystal.cpp       |    2 +-
+ include/hkl/reflection.h             | 6 +++---
+ include/hkl/reflection_monocrystal.h | 9 ---------
+ src/reflection.cpp                   | 6 ++++--
+ src/reflection_monocrystal.cpp       | 2 +-
  4 files changed, 8 insertions(+), 15 deletions(-)
 
 commit db64d690fe6b6f3e5edfea39126f13c413388883
@@ -13176,44 +22937,44 @@ Date:   Mon Nov 6 13:08:18 2006 +0100
  include/hkl/fitparameter.h              |   45 +-
  include/hkl/fitparameterlist.h          |   33 +-
  include/hkl/geometry.h                  |   53 +-
- include/hkl/geometry_eulerian4C.h       |  283 ++--
- include/hkl/geometry_eulerian6C.h       |  231 ++--
+ include/hkl/geometry_eulerian4C.h       |  283 +--
+ include/hkl/geometry_eulerian6C.h       |  231 +--
  include/hkl/geometry_kappa.h            |  115 +-
- include/hkl/geometry_kappa4C.h          |  219 ++--
- include/hkl/geometry_kappa6C.h          |  243 ++--
- include/hkl/geometry_twoC.h             |  247 ++--
+ include/hkl/geometry_kappa4C.h          |  219 +--
+ include/hkl/geometry_kappa6C.h          |  243 +--
+ include/hkl/geometry_twoC.h             |  247 +--
  include/hkl/hklobject.h                 |   28 +-
- include/hkl/lattice.h                   |  187 ++-
- include/hkl/mode.h                      |  249 ++--
- include/hkl/mode_eulerian4C.h           |  198 ++--
+ include/hkl/lattice.h                   |  187 +-
+ include/hkl/mode.h                      |  249 +--
+ include/hkl/mode_eulerian4C.h           |  198 +--
  include/hkl/mode_eulerian6C.h           |  113 +-
  include/hkl/mode_kappa4C.h              |   33 +-
  include/hkl/mode_kappa6C.h              |   33 +-
  include/hkl/mode_twoC.h                 |   94 +-
- include/hkl/mymap.h                     |  966 ++++++------
+ include/hkl/mymap.h                     |  966 +++++------
  include/hkl/mystring.h                  |   17 +-
  include/hkl/myvector.h                  |  893 +++++-----
  include/hkl/object.h                    |  193 ++-
  include/hkl/parameter.h                 |   25 +-
  include/hkl/portability.h               |   12 +-
  include/hkl/pseudoaxe.h                 |  309 ++--
- include/hkl/pseudoaxe_eulerian4C.h      |  219 ++--
+ include/hkl/pseudoaxe_eulerian4C.h      |  219 +--
  include/hkl/pseudoaxe_eulerian6C.h      |  107 +-
  include/hkl/pseudoaxe_kappa4C.h         |  120 +-
  include/hkl/pseudoaxe_kappa6C.h         |   64 +-
  include/hkl/pseudoaxe_twoC.h            |   90 +-
  include/hkl/quaternion.h                |   15 +-
  include/hkl/range.h                     |   32 +-
- include/hkl/reflection.h                |  189 ++-
+ include/hkl/reflection.h                |  189 +-
  include/hkl/reflection_monocrystal.h    |   51 +-
  include/hkl/reflectionfactory.h         |   43 +-
- include/hkl/reflectionlist.h            |  203 ++--
+ include/hkl/reflectionlist.h            |  203 +--
  include/hkl/sample.h                    |   59 +-
  include/hkl/sample_monocrystal.h        |   67 +-
  include/hkl/samplefactory.h             |   23 +-
  include/hkl/samplelist.h                |   49 +-
  include/hkl/source.h                    |   38 +-
- include/hkl/svecmat.h                   |  630 ++++----
+ include/hkl/svecmat.h                   |  630 +++----
  include/hkl/value.h                     |   35 +-
  src/HKLException.cpp                    |  108 +-
  src/affinement.cpp                      |   65 +-
@@ -13230,36 +22991,36 @@ Date:   Mon Nov 6 13:08:18 2006 +0100
  src/fitparameterlist.cpp                |  115 +-
  src/geometry.cpp                        |  710 ++++----
  src/geometry_eulerian4C.cpp             |  347 ++--
- src/geometry_eulerian6C.cpp             |  276 ++--
+ src/geometry_eulerian6C.cpp             |  276 +--
  src/geometry_kappa.cpp                  |  112 +-
  src/geometry_kappa4C.cpp                |  357 ++--
  src/geometry_kappa6C.cpp                |  308 ++--
- src/geometry_twoC.cpp                   |  247 ++--
+ src/geometry_twoC.cpp                   |  247 +--
  src/hklobject.cpp                       |   79 +-
- src/lattice.cpp                         |  631 ++++----
+ src/lattice.cpp                         |  631 +++----
  src/mode_eulerian4C.cpp                 |  509 +++---
- src/mode_eulerian6C.cpp                 |  861 +++++-----
+ src/mode_eulerian6C.cpp                 |  861 ++++-----
  src/mode_twoC.cpp                       |  114 +-
  src/mystring.cpp                        |   99 +-
  src/object.cpp                          |  143 +-
  src/parameter.cpp                       |   71 +-
- src/pseudoaxe_eulerian4C.cpp            |  412 +++---
+ src/pseudoaxe_eulerian4C.cpp            |  412 ++---
  src/pseudoaxe_eulerian6C.cpp            |  499 +++---
  src/pseudoaxe_kappa4C.cpp               |  558 +++---
  src/pseudoaxe_twoC.cpp                  |  522 +++---
- src/quaternion.cpp                      |  399 +++---
+ src/quaternion.cpp                      |  399 ++---
  src/range.cpp                           |  137 +-
- src/reflection.cpp                      |  228 ++--
+ src/reflection.cpp                      |  228 +--
  src/reflection_monocrystal.cpp          |  128 +-
  src/reflectionfactory.cpp               |   37 +-
  src/reflectionlist.cpp                  |  385 +++--
- src/sample.cpp                          |  252 ++--
- src/sample_monocrystal.cpp              |  394 +++---
+ src/sample.cpp                          |  252 +--
+ src/sample_monocrystal.cpp              |  394 ++---
  src/samplefactory.cpp                   |   45 +-
  src/samplelist.cpp                      |  325 ++--
- src/source.cpp                          |  239 ++--
+ src/source.cpp                          |  239 +--
  src/svector.cpp                         |  355 ++--
- src/value.cpp                           |  237 ++--
+ src/value.cpp                           |  237 +--
  101 files changed, 11320 insertions(+), 10864 deletions(-)
 
 commit 442cda584d275ef3f95e083a9bb3474e939f613c
@@ -13268,8 +23029,8 @@ Date:   Sat Nov 4 09:40:49 2006 +0100
 
     * remove a bug in smatrix::operator == when nan
 
- src/smatrix.cpp |  564 +++++++++++++++++++++++++++----------------------------
- 1 files changed, 279 insertions(+), 285 deletions(-)
+ src/smatrix.cpp | 564 ++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 279 insertions(+), 285 deletions(-)
 
 commit 26c7507a35ca2db6bb3ad91ed07ad6b3a1833c8b
 Author: picca <picca at grisette.localdomain>
@@ -13287,10 +23048,10 @@ Date:   Thu Nov 2 18:20:04 2006 +0100
  src/HKLException.cpp             |    2 +-
  src/affinement_simplex.cpp       |   14 +-
  src/fitparameter.cpp             |    2 +-
- src/lattice.cpp                  |   38 ++-
+ src/lattice.cpp                  |   38 +-
  src/range.cpp                    |    1 +
  test/SConscript                  |    3 +-
- test/affinement_simplex_test.cpp |  162 ++++---
+ test/affinement_simplex_test.cpp |  162 +++---
  test/affinement_simplex_test.h   |   40 +-
  test/crystallist_test.cpp        |   80 ---
  test/crystallist_test.h          |   40 --
@@ -13303,23 +23064,23 @@ Date:   Thu Nov 2 16:44:59 2006 +0100
     * add the SampleList and SampleFactory classes.
     * add the SampleList tests.
 
- doc/uml/next_hkl.dia                        |  700 ++++++++++++++++++++++-----
- include/hkl/enums.h                         |   10 +
- include/hkl/reflection.h                    |   17 +-
- include/hkl/reflectionfactory_monocrystal.h |   35 --
- include/hkl/sample.h                        |    2 +
- include/hkl/sample_monocrystal.h            |    4 +-
- include/hkl/samplefactory.h                 |   29 ++
- include/hkl/samplelist.h                    |   42 ++
- src/SConscript                              |    2 +
- src/reflection.cpp                          |   20 +-
- src/reflectionfactory_monocrystal.cpp       |   23 -
- src/samplefactory.cpp                       |   39 ++
- src/samplelist.cpp                          |  190 ++++++++
- test/SConscript                             |    1 +
- test/samplelist_test.cpp                    |   48 ++
- test/samplelist_test.h                      |   28 ++
- 16 files changed, 988 insertions(+), 202 deletions(-)
+ doc/uml/next_hkl.dia                        | 718 ++++++++++++++++++++++------
+ include/hkl/enums.h                         |  10 +
+ include/hkl/reflection.h                    |  17 +-
+ include/hkl/reflectionfactory_monocrystal.h |  35 --
+ include/hkl/sample.h                        |   2 +
+ include/hkl/sample_monocrystal.h            |   4 +-
+ include/hkl/samplefactory.h                 |  29 ++
+ include/hkl/samplelist.h                    |  42 ++
+ src/SConscript                              |   2 +
+ src/reflection.cpp                          |  20 +-
+ src/reflectionfactory_monocrystal.cpp       |  23 -
+ src/samplefactory.cpp                       |  39 ++
+ src/samplelist.cpp                          | 190 ++++++++
+ test/SConscript                             |   1 +
+ test/samplelist_test.cpp                    |  48 ++
+ test/samplelist_test.h                      |  28 ++
+ 16 files changed, 997 insertions(+), 211 deletions(-)
 
 commit d4e10584fb2683eae1c7739f51ea13fadafdfa42
 Author: picca <picca at grisette.localdomain>
@@ -13327,9 +23088,9 @@ Date:   Tue Oct 31 20:14:06 2006 +0100
 
     * update the uml diagramme
 
- doc/uml/next_hkl.dia |  361 ++++++++++++++++++++++++++++++++++++++------------
- include/hkl/sample.h |    6 +-
- test/SConscript      |    2 +-
+ doc/uml/next_hkl.dia | 361 +++++++++++++++++++++++++++++++++++++++------------
+ include/hkl/sample.h |   6 +-
+ test/SConscript      |   2 +-
  3 files changed, 279 insertions(+), 90 deletions(-)
 
 commit 132226fb106619ef700910cc663fe9bb1327aed5
@@ -13338,31 +23099,31 @@ Date:   Tue Oct 31 19:59:31 2006 +0100
 
     * now the sample Class is ok.
 
- doc/uml/next_hkl.dia             |  312 ++++++++++++++++++++++++++++-------
- include/hkl/fitparameterlist.h   |   17 +--
- include/hkl/lattice.h            |    9 +-
- include/hkl/mystring.h           |   21 ++-
- include/hkl/sample.h             |   11 +-
- include/hkl/sample_monocrystal.h |    6 +-
- src/fitparameter.cpp             |    9 +-
- src/fitparameterlist.cpp         |   33 +----
- src/geometry_eulerian4C.cpp      |    8 +-
- src/lattice.cpp                  |   24 +++-
- src/mystring.cpp                 |   38 ++++-
- src/range.cpp                    |    2 +-
- src/reflection.cpp               |   13 +-
- src/reflectionlist.cpp           |    5 +-
- src/sample.cpp                   |  334 +++-----------------------------------
- src/sample_monocrystal.cpp       |  183 +++++++--------------
- test/SConscript                  |    4 +-
- test/fitparameter_test.cpp       |   11 ++
- test/lattice_test.cpp            |   18 ++
- test/lattice_test.h              |    2 +
- test/reflection_test.cpp         |    9 +
- test/reflectionlist_test.cpp     |   47 ++++---
- test/sample_test.cpp             |  333 ++++----------------------------------
- test/sample_test.h               |   20 ---
- 24 files changed, 548 insertions(+), 921 deletions(-)
+ doc/uml/next_hkl.dia             | 312 +++++++++++++++++++++++++++++-------
+ include/hkl/fitparameterlist.h   |  15 +-
+ include/hkl/lattice.h            |   9 +-
+ include/hkl/mystring.h           |  21 ++-
+ include/hkl/sample.h             |  11 +-
+ include/hkl/sample_monocrystal.h |   6 +-
+ src/fitparameter.cpp             |   9 +-
+ src/fitparameterlist.cpp         |  33 +---
+ src/geometry_eulerian4C.cpp      |   8 +-
+ src/lattice.cpp                  |  24 ++-
+ src/mystring.cpp                 |  38 ++++-
+ src/range.cpp                    |   2 +-
+ src/reflection.cpp               |  13 +-
+ src/reflectionlist.cpp           |   5 +-
+ src/sample.cpp                   | 334 +++------------------------------------
+ src/sample_monocrystal.cpp       | 183 +++++++--------------
+ test/SConscript                  |   4 +-
+ test/fitparameter_test.cpp       |  11 ++
+ test/lattice_test.cpp            |  18 +++
+ test/lattice_test.h              |   2 +
+ test/reflection_test.cpp         |   9 ++
+ test/reflectionlist_test.cpp     |  47 +++---
+ test/sample_test.cpp             | 333 ++++----------------------------------
+ test/sample_test.h               |  20 ---
+ 24 files changed, 547 insertions(+), 920 deletions(-)
 
 commit 0ea586ae18cd488630dcc636f67ff173a478c709
 Author: picca <picca at grisette.localdomain>
@@ -13370,25 +23131,25 @@ Date:   Mon Oct 30 19:52:15 2006 +0100
 
     * start working on the sample part and the fitparameterlist
 
- TODO                                 |    1 +
- doc/uml/next_hkl.dia                 |  964 +++++++++++++++++++++++-----------
- include/hkl/fitparameterlist.h       |  135 ++---
- include/hkl/reflection.h             |    7 +-
- include/hkl/reflection_monocrystal.h |    2 +
- include/hkl/reflectionlist.h         |    4 +
- include/hkl/sample.h                 |   75 +++
- include/hkl/sample_monocrystal.h     |   67 +++
- include/hkl/svecmat.h                |    2 +
- src/SConscript                       |    1 +
- src/affinement_simplex.cpp           |   10 +-
- src/fitparameterlist.cpp             |  133 +++---
- src/reflection.cpp                   |    4 +-
- src/sample.cpp                       |  431 +++++++++++++++
- src/sample_monocrystal.cpp           |  268 ++++++++++
- src/smatrix.cpp                      |   23 +
- test/reflection_test.cpp             |    2 +-
- test/sample_test.cpp                 |  465 ++++++++++++++++
- test/sample_test.h                   |   59 ++
+ TODO                                 |   1 +
+ doc/uml/next_hkl.dia                 | 964 ++++++++++++++++++++++++-----------
+ include/hkl/fitparameterlist.h       | 135 ++---
+ include/hkl/reflection.h             |   7 +-
+ include/hkl/reflection_monocrystal.h |   2 +
+ include/hkl/reflectionlist.h         |   4 +
+ include/hkl/sample.h                 |  75 +++
+ include/hkl/sample_monocrystal.h     |  67 +++
+ include/hkl/svecmat.h                |   2 +
+ src/SConscript                       |   1 +
+ src/affinement_simplex.cpp           |  10 +-
+ src/fitparameterlist.cpp             | 133 +++--
+ src/reflection.cpp                   |   4 +-
+ src/sample.cpp                       | 431 ++++++++++++++++
+ src/sample_monocrystal.cpp           | 268 ++++++++++
+ src/smatrix.cpp                      |  23 +
+ test/reflection_test.cpp             |   2 +-
+ test/sample_test.cpp                 | 465 +++++++++++++++++
+ test/sample_test.h                   |  59 +++
  19 files changed, 2191 insertions(+), 462 deletions(-)
 
 commit 4afe5d3fb464579b0f666b3e6090893e10a26ff3
@@ -13398,18 +23159,18 @@ Date:   Fri Oct 27 16:27:45 2006 +0200
     * remove the relevance in the Reflection class.
     * update all the reflection test.
 
- doc/uml/next_hkl.dia                 |  100 +++++++++++++++++++++-------------
- include/hkl/enums.h                  |   16 +++---
- include/hkl/reflection.h             |    9 +---
- include/hkl/reflection_monocrystal.h |    1 -
- include/hkl/reflectionfactory.h      |    1 -
- src/reflection.cpp                   |   17 +-----
- src/reflection_monocrystal.cpp       |   22 ++++----
- src/reflectionfactory.cpp            |    2 +-
- test/SConscript                      |    2 +-
- test/reflection_test.cpp             |   99 ++++++++++++++++++----------------
- test/reflection_test.h               |    5 +-
- test/reflectionlist_test.cpp         |    4 +-
+ doc/uml/next_hkl.dia                 | 100 +++++++++++++++++++++--------------
+ include/hkl/enums.h                  |  16 +++---
+ include/hkl/reflection.h             |   9 +---
+ include/hkl/reflection_monocrystal.h |   1 -
+ include/hkl/reflectionfactory.h      |   1 -
+ src/reflection.cpp                   |  17 +-----
+ src/reflection_monocrystal.cpp       |  22 ++++----
+ src/reflectionfactory.cpp            |   2 +-
+ test/SConscript                      |   2 +-
+ test/reflection_test.cpp             |  99 ++++++++++++++++++----------------
+ test/reflection_test.h               |   5 +-
+ test/reflectionlist_test.cpp         |   4 +-
  12 files changed, 140 insertions(+), 138 deletions(-)
 
 commit c087c58e900471cb4e99d870a7fd98e708454f7f
@@ -13418,13 +23179,13 @@ Date:   Fri Oct 27 15:10:06 2006 +0200
 
     * modification of the ReflectionFactory
 
- doc/uml/next_hkl.dia            |  552 +++------------------------------------
- include/hkl/enums.h             |    6 +
- include/hkl/reflectionfactory.h |   18 +-
- include/hkl/reflectionlist.h    |    1 -
- src/SConscript                  |    1 -
- src/reflectionfactory.cpp       |   21 ++-
- src/reflectionlist.cpp          |   16 +-
+ doc/uml/next_hkl.dia            | 552 +++-------------------------------------
+ include/hkl/enums.h             |   6 +
+ include/hkl/reflectionfactory.h |  18 +-
+ include/hkl/reflectionlist.h    |   1 -
+ src/SConscript                  |   1 -
+ src/reflectionfactory.cpp       |  21 +-
+ src/reflectionlist.cpp          |  16 +-
  7 files changed, 71 insertions(+), 544 deletions(-)
 
 commit a0de38547101f60ddc8c6730c2da0d9f47a59d54
@@ -13433,9 +23194,9 @@ Date:   Fri Oct 27 14:00:29 2006 +0200
 
     * add many ReflectionList test methods.
 
- doc/uml/next_hkl.dia         |    6 ++--
- test/reflectionlist_test.cpp |   51 +++++++++++++++++++++++++++++++++++++----
- test/reflectionlist_test.h   |    6 +++++
+ doc/uml/next_hkl.dia         |  6 +++---
+ test/reflectionlist_test.cpp | 51 +++++++++++++++++++++++++++++++++++++++-----
+ test/reflectionlist_test.h   |  6 ++++++
  3 files changed, 55 insertions(+), 8 deletions(-)
 
 commit 588de2c474613ef4e9335a88211c644f6b34b6ea
@@ -13444,9 +23205,9 @@ Date:   Fri Oct 27 13:32:44 2006 +0200
 
     * add the forgotten reflectionlist test files.
 
- test/reflectionlist_test.cpp |   58 ++++++++++++++++++++++++++++++++++++++++++
- test/reflectionlist_test.h   |   32 +++++++++++++++++++++++
- 2 files changed, 90 insertions(+), 0 deletions(-)
+ test/reflectionlist_test.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++
+ test/reflectionlist_test.h   | 32 ++++++++++++++++++++++++
+ 2 files changed, 90 insertions(+)
 
 commit 5f62637397c7c185a77cf69d5d77316e46249f55
 Author: picca <picca at grisette.localdomain>
@@ -13484,7 +23245,7 @@ Date:   Wed Oct 25 18:03:40 2006 +0200
     (cherry picked from 0484821076069bc9e86ebf8b73a85e74fb659383 commit)
 
  TODO                                            |    1 +
- doc/uml/next_hkl.dia                            | 6849 +++++++++++++++++------
+ doc/uml/next_hkl.dia                            | 8943 ++++++++++++++++-------
  include/hkl/axe.h                               |   11 +-
  include/hkl/geometry.h                          |   29 +-
  include/hkl/geometry_eulerian4C.h               |   38 +-
@@ -13495,11 +23256,11 @@ Date:   Wed Oct 25 18:03:40 2006 +0200
  include/hkl/geometry_twoC.h                     |   17 +-
  include/hkl/mymap.h                             |   18 +-
  include/hkl/pseudoaxe.h                         |    8 +-
- include/hkl/reflection.h                        |  365 +--
+ include/hkl/reflection.h                        |  365 +-
  include/hkl/reflection_monocrystal.h            |   55 +
  include/hkl/reflectionfactory.h                 |   38 +
  include/hkl/reflectionfactory_monocrystal.h     |   35 +
- include/hkl/reflectionlist.h                    |  653 ---
+ include/hkl/reflectionlist.h                    |  653 --
  include/hkl/reflectionlistfactory.h             |  111 +
  include/hkl/reflectionlistfactory_monocrystal.h |   28 +
  src/SConscript                                  |   13 +-
@@ -13527,7 +23288,7 @@ Date:   Wed Oct 25 18:03:40 2006 +0200
  test/reflection_test.h                          |    5 +-
  test/reflectionlistfactory_test.cpp             |   39 +
  test/reflectionlistfactory_test.h               |   28 +
- 44 files changed, 6654 insertions(+), 4109 deletions(-)
+ 44 files changed, 7701 insertions(+), 5156 deletions(-)
 
 commit ad8d853aa33c066fc8b5f180fc99ae96b21adf8b
 Author: picca <picca at grisette.localdomain>
@@ -13536,7 +23297,7 @@ Date:   Wed Oct 4 15:59:30 2006 +0200
     * modification of the lyx doc
 
  doc/hkl.lyx | 2225 ++++++++++++++++++++++++++++++++---------------------------
- 1 files changed, 1198 insertions(+), 1027 deletions(-)
+ 1 file changed, 1198 insertions(+), 1027 deletions(-)
 
 commit f35e7ca54f65406989e734269661c07c7729f4be
 Author: picca <picca at grisette.localdomain>
@@ -13545,13 +23306,13 @@ Date:   Wed Oct 4 15:58:54 2006 +0200
     * add the Lattice tests
 
  TODO                  |    1 +
- doc/uml/next_hkl.dia  | 2070 ++++++++++++++++++++++++++-----------------------
+ doc/uml/next_hkl.dia  | 5554 +++++++++++++++++++++++++------------------------
  include/hkl/lattice.h |   15 +-
- src/lattice.cpp       |  100 ++-
+ src/lattice.cpp       |  100 +-
  test/SConscript       |    3 +-
- test/lattice_test.cpp |  288 +++++---
+ test/lattice_test.cpp |  288 ++-
  test/lattice_test.h   |   30 +-
- 7 files changed, 1376 insertions(+), 1131 deletions(-)
+ 7 files changed, 3118 insertions(+), 2873 deletions(-)
 
 commit f89fbf519fdb1e1e28eb9fd6d71d816d35107159
 Author: picca <picca at grisette.localdomain>
@@ -13559,8 +23320,8 @@ Date:   Wed Oct 4 15:56:18 2006 +0200
 
     * modification of a HKLException message of the set_current methode.
 
- src/range.cpp |    7 ++++++-
- 1 files changed, 6 insertions(+), 1 deletions(-)
+ src/range.cpp | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
 
 commit 0e087db1b5eca592cfc87c40a22a3803eea18618
 Author: picca <picca at grisette.localdomain>
@@ -13568,8 +23329,8 @@ Date:   Wed Oct 4 15:54:45 2006 +0200
 
     * change the printToStream format of FitParameter
 
- src/fitparameter.cpp |   10 +++++-----
- 1 files changed, 5 insertions(+), 5 deletions(-)
+ src/fitparameter.cpp | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
 
 commit 1f785b3d36631856cbe1b317ad8893e913835c23
 Author: picca <picca at grisette.localdomain>
@@ -13577,9 +23338,9 @@ Date:   Fri Sep 22 18:19:26 2006 +0200
 
     * update the uml diagramme.
 
- doc/uml/newt_hkl.dia |15134 --------------------------------------------------
- doc/uml/next_hkl.dia |14937 +++++++++++++++++++++++++++++++++++++++++++++++++-
- 2 files changed, 14921 insertions(+), 15150 deletions(-)
+ doc/uml/newt_hkl.dia | 15134 -------------------------------------------------
+ doc/uml/next_hkl.dia | 14959 +++++++++++++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 14932 insertions(+), 15161 deletions(-)
 
 commit c20a3234495f3530a3acd1abeda7d396f3d178e5
 Author: picca <picca at grisette.localdomain>
@@ -13587,35 +23348,35 @@ Date:   Thu Sep 7 18:53:47 2006 +0200
 
      DO NOT COMPILE
 
- doc/uml/newt_hkl.dia           |15134 ++++++++++++++++++++++++++++++++++++++++
- include/hkl/axe.h              |    4 +-
- include/hkl/crystal.h          |  244 +-
- include/hkl/fitparameterlist.h |  142 +-
- include/hkl/geometry.h         |    6 +-
- include/hkl/hklobject.h        |   78 +
- include/hkl/lattice.h          |   82 +
- include/hkl/parameter.h        |   76 +
- include/hkl/portability.h      |   19 +
- include/hkl/reflectionlist.h   |  653 ++
- include/hkl/source.h           |   30 +-
- include/hkl/value.h            |   39 +
- src/SConscript                 |    7 +-
- src/affinement.cpp             |    2 +
- src/affinement_simplex.cpp     |    6 +-
- src/axe.cpp                    |    2 +-
- src/fitparameterlist.cpp       |   32 +-
- src/hklobject.cpp              |   43 +
- src/lattice.cpp                |  287 +
- src/parameter.cpp              |   44 +
- src/source.cpp                 |  104 +-
- src/value.cpp                  |   12 +
- test/SConscript                |    4 +-
- test/crystal_test.cpp          |   60 +-
- test/hklobject_test.cpp        |   48 +
- test/hklobject_test.h          |   26 +
- test/parameter_test.cpp        |   43 +
- test/parameter_test.h          |   26 +
- test/source_test.cpp           |    4 +-
+ doc/uml/newt_hkl.dia           | 15134 +++++++++++++++++++++++++++++++++++++++
+ include/hkl/axe.h              |     4 +-
+ include/hkl/crystal.h          |   244 +-
+ include/hkl/fitparameterlist.h |   142 +-
+ include/hkl/geometry.h         |     6 +-
+ include/hkl/hklobject.h        |    78 +
+ include/hkl/lattice.h          |    82 +
+ include/hkl/parameter.h        |    76 +
+ include/hkl/portability.h      |    19 +
+ include/hkl/reflectionlist.h   |   653 ++
+ include/hkl/source.h           |    30 +-
+ include/hkl/value.h            |    39 +
+ src/SConscript                 |     7 +-
+ src/affinement.cpp             |     2 +
+ src/affinement_simplex.cpp     |     6 +-
+ src/axe.cpp                    |     2 +-
+ src/fitparameterlist.cpp       |    32 +-
+ src/hklobject.cpp              |    43 +
+ src/lattice.cpp                |   287 +
+ src/parameter.cpp              |    44 +
+ src/source.cpp                 |   104 +-
+ src/value.cpp                  |    12 +
+ test/SConscript                |     4 +-
+ test/crystal_test.cpp          |    60 +-
+ test/hklobject_test.cpp        |    48 +
+ test/hklobject_test.h          |    26 +
+ test/parameter_test.cpp        |    43 +
+ test/parameter_test.h          |    26 +
+ test/source_test.cpp           |     4 +-
  29 files changed, 16939 insertions(+), 318 deletions(-)
 
 commit fe136dc24ab598e9124aacc5ffae37965cfb30b4
@@ -13624,56 +23385,56 @@ Date:   Fri Sep 1 18:47:03 2006 +0200
 
     * begin of the refactoring DO NOT COMPILE yet
 
- SConstruct                              |    2 +-
- TODO                                    |   11 +-
- doc/Doxyfile                            |    1 -
- doc/uml/next_hkl.dia                    |26631 +------------------------------
- include/hkl/axe.h                       |  204 +-
- include/hkl/config.h                    |   19 -
- include/hkl/constants.h                 |    2 +
- include/hkl/diffractometer.h            |   94 +-
- include/hkl/diffractometer_eulerian6C.h |    2 +-
- include/hkl/fitparameter.h              |   94 +-
- include/hkl/fitparameterlist.h          |  128 +-
- include/hkl/mymap.h                     |    2 +-
- include/hkl/myvector.h                  |    2 +-
- include/hkl/objectwithparameters.h      |  117 -
- include/hkl/pseudoaxe.h                 |    8 +-
- include/hkl/range.h                     |  115 +-
- include/hkl/svecmat.h                   |    2 +-
- include/hkl/value.h                     |  100 +-
- src/SConscript                          |   16 +-
- src/axe.cpp                             |  168 +-
- src/convenience.cpp                     |    2 +-
- src/diffractometer_eulerian6C.cpp       |   10 +-
- src/fitparameter.cpp                    |   75 +-
- src/fitparameterlist.cpp                |   11 -
- src/gui/axespinbutton.cpp               |  150 +-
- src/gui/axespinbutton.h                 |   35 +-
- src/gui/diffractometer2.glade           |    4 +-
- src/gui/hklwindow.cpp                   |   68 +-
- src/gui/hklwindow.h                     |    7 +-
- src/gui/main.cpp                        |   10 +-
- src/gui/pseudoaxespinbutton.cpp         |  169 +-
- src/gui/pseudoaxespinbutton.h           |   33 +-
- src/mystring.cpp                        |    2 +-
- src/objectwithparameters.cpp            |   89 -
- src/pseudoaxe_eulerian6C.cpp            |   32 +-
- src/pseudoaxe_twoC.cpp                  |   10 +
- src/range.cpp                           |   78 +-
- src/value.cpp                           |   98 +-
- test/SConscript                         |   13 +-
- test/axe_test.cpp                       |  124 +-
- test/axe_test.h                         |    2 -
- test/fitparameter_test.cpp              |   89 +-
- test/fitparameter_test.h                |   18 +-
- test/objectwithparameters_test.cpp      |   66 -
- test/objectwithparameters_test.h        |   28 -
- test/range_test.cpp                     |   63 +-
- test/range_test.h                       |    8 +-
- test/value_test.cpp                     |   75 +-
- test/value_test.h                       |   11 +-
- 49 files changed, 1196 insertions(+), 27902 deletions(-)
+ SConstruct                              |     2 +-
+ TODO                                    |    11 +-
+ doc/Doxyfile                            |     1 -
+ doc/uml/next_hkl.dia                    | 26653 +-----------------------------
+ include/hkl/axe.h                       |   204 +-
+ include/hkl/config.h                    |    19 -
+ include/hkl/constants.h                 |     2 +
+ include/hkl/diffractometer.h            |    94 +-
+ include/hkl/diffractometer_eulerian6C.h |     2 +-
+ include/hkl/fitparameter.h              |    94 +-
+ include/hkl/fitparameterlist.h          |   128 +-
+ include/hkl/mymap.h                     |     2 +-
+ include/hkl/myvector.h                  |     2 +-
+ include/hkl/objectwithparameters.h      |   117 -
+ include/hkl/pseudoaxe.h                 |     8 +-
+ include/hkl/range.h                     |   115 +-
+ include/hkl/svecmat.h                   |     2 +-
+ include/hkl/value.h                     |   100 +-
+ src/SConscript                          |    16 +-
+ src/axe.cpp                             |   168 +-
+ src/convenience.cpp                     |     2 +-
+ src/diffractometer_eulerian6C.cpp       |    10 +-
+ src/fitparameter.cpp                    |    75 +-
+ src/fitparameterlist.cpp                |    11 -
+ src/gui/axespinbutton.cpp               |   150 +-
+ src/gui/axespinbutton.h                 |    35 +-
+ src/gui/diffractometer2.glade           |     4 +-
+ src/gui/hklwindow.cpp                   |    68 +-
+ src/gui/hklwindow.h                     |     7 +-
+ src/gui/main.cpp                        |    10 +-
+ src/gui/pseudoaxespinbutton.cpp         |   169 +-
+ src/gui/pseudoaxespinbutton.h           |    33 +-
+ src/mystring.cpp                        |     2 +-
+ src/objectwithparameters.cpp            |    89 -
+ src/pseudoaxe_eulerian6C.cpp            |    32 +-
+ src/pseudoaxe_twoC.cpp                  |    10 +
+ src/range.cpp                           |    78 +-
+ src/value.cpp                           |    98 +-
+ test/SConscript                         |    13 +-
+ test/axe_test.cpp                       |   124 +-
+ test/axe_test.h                         |     2 -
+ test/fitparameter_test.cpp              |    89 +-
+ test/fitparameter_test.h                |    18 +-
+ test/objectwithparameters_test.cpp      |    66 -
+ test/objectwithparameters_test.h        |    28 -
+ test/range_test.cpp                     |    63 +-
+ test/range_test.h                       |     8 +-
+ test/value_test.cpp                     |    75 +-
+ test/value_test.h                       |    11 +-
+ 49 files changed, 1207 insertions(+), 27913 deletions(-)
 
 commit a421ea546daf149771bfc3be131ef734ab6cd19b
 Author: picca <picca at grisette.localdomain>
@@ -13682,8 +23443,8 @@ Date:   Thu Aug 31 18:54:30 2006 +0200
     * add the ObjectReadOnly class. with this class you can only
         set the name and the description in the constructor.
 
- include/hkl/object.h |  197 +++++++++++++++++++++++++++++++++-----------------
- src/object.cpp       |   89 ++++++++++-------------
+ include/hkl/object.h | 197 +++++++++++++++++++++++++++++++++------------------
+ src/object.cpp       |  89 +++++++++++------------
  2 files changed, 170 insertions(+), 116 deletions(-)
 
 commit d987346c3f727cfb4a25fd61c74085a793eba6d5
@@ -13698,44 +23459,44 @@ Date:   Wed Aug 23 17:21:08 2006 +0200
         + get_max()
     * add all the related test functions.
 
- TODO                               |   13 ++-
- include/hkl/derivedpseudoaxe.h     |   76 ++++++++--
- include/hkl/diffractometer.h       |   20 ++-
- include/hkl/geometry.h             |   10 ++
- include/hkl/geometry_kappa.h       |    7 +
- include/hkl/pseudoaxe.h            |  189 ++++++++++++++---------
- include/hkl/pseudoaxe_eulerian4C.h |    9 +-
- include/hkl/pseudoaxe_eulerian6C.h |   16 ++-
- include/hkl/pseudoaxe_kappa4C.h    |   24 ++-
- include/hkl/pseudoaxe_twoC.h       |   32 +++--
- src/axe.cpp                        |    4 +-
- src/geometry.cpp                   |    9 +
- src/geometry_kappa.cpp             |   10 ++
- src/gui/SConscript                 |    1 +
- src/gui/axespinbutton.cpp          |    1 -
- src/gui/hklwindow.cpp              |   81 +++++++++-
- src/gui/hklwindow.h                |    9 +
- src/gui/main.cpp                   |    9 +-
- src/gui/pseudoaxespinbutton.cpp    |   89 +++++++++++
- src/gui/pseudoaxespinbutton.h      |   30 ++++
- src/pseudoaxe_eulerian4C.cpp       |  108 +++++++------
- src/pseudoaxe_eulerian6C.cpp       |  166 ++++++++++++--------
- src/pseudoaxe_kappa4C.cpp          |  187 +++++++++++++----------
- src/pseudoaxe_twoC.cpp             |  274 +++++++++++++++++----------------
- test/axe_test.cpp                  |    8 +-
- test/geometry_eulerian4C_test.cpp  |    3 +-
- test/geometry_eulerian4C_test.h    |   64 ++++----
- test/geometry_eulerian6C_test.cpp  |    6 +-
- test/geometry_kappa6C_test.cpp     |    2 +-
- test/geometry_kappa6C_test.h       |   62 ++++----
- test/geometry_test.cpp             |   12 ++
- test/geometry_test.h               |    2 +
- test/geometry_twoC_test.h          |   70 +++++-----
- test/pseudoaxe_eulerian4C_test.cpp |  156 +++++++++++++++----
- test/pseudoaxe_eulerian6C_test.cpp |   76 ++++++++--
- test/pseudoaxe_kappa4C_test.cpp    |  297 +++++++++++++++++++++++++++---------
- test/pseudoaxe_kappa6C_test.cpp    |  181 ++++++++++++++++++-----
- test/pseudoaxe_twoC_test.cpp       |  124 +++++++++++----
+ TODO                               |  13 +-
+ include/hkl/derivedpseudoaxe.h     |  76 ++++++++--
+ include/hkl/diffractometer.h       |  20 ++-
+ include/hkl/geometry.h             |  10 ++
+ include/hkl/geometry_kappa.h       |   7 +
+ include/hkl/pseudoaxe.h            | 189 +++++++++++++----------
+ include/hkl/pseudoaxe_eulerian4C.h |   9 +-
+ include/hkl/pseudoaxe_eulerian6C.h |  16 +-
+ include/hkl/pseudoaxe_kappa4C.h    |  24 +--
+ include/hkl/pseudoaxe_twoC.h       |  32 ++--
+ src/axe.cpp                        |   4 +-
+ src/geometry.cpp                   |   9 ++
+ src/geometry_kappa.cpp             |  10 ++
+ src/gui/SConscript                 |   1 +
+ src/gui/axespinbutton.cpp          |   1 -
+ src/gui/hklwindow.cpp              |  81 ++++++++--
+ src/gui/hklwindow.h                |   9 ++
+ src/gui/main.cpp                   |   9 +-
+ src/gui/pseudoaxespinbutton.cpp    |  89 +++++++++++
+ src/gui/pseudoaxespinbutton.h      |  30 ++++
+ src/pseudoaxe_eulerian4C.cpp       | 108 +++++++-------
+ src/pseudoaxe_eulerian6C.cpp       | 166 +++++++++++++--------
+ src/pseudoaxe_kappa4C.cpp          | 187 +++++++++++++----------
+ src/pseudoaxe_twoC.cpp             | 274 +++++++++++++++++-----------------
+ test/axe_test.cpp                  |   8 +-
+ test/geometry_eulerian4C_test.cpp  |   3 +-
+ test/geometry_eulerian4C_test.h    |  64 ++++----
+ test/geometry_eulerian6C_test.cpp  |   6 +-
+ test/geometry_kappa6C_test.cpp     |   2 +-
+ test/geometry_kappa6C_test.h       |  62 ++++----
+ test/geometry_test.cpp             |  12 ++
+ test/geometry_test.h               |   2 +
+ test/geometry_twoC_test.h          |  70 ++++-----
+ test/pseudoaxe_eulerian4C_test.cpp | 156 ++++++++++++++-----
+ test/pseudoaxe_eulerian6C_test.cpp |  76 ++++++++--
+ test/pseudoaxe_kappa4C_test.cpp    | 297 +++++++++++++++++++++++++++----------
+ test/pseudoaxe_kappa6C_test.cpp    | 181 +++++++++++++++++-----
+ test/pseudoaxe_twoC_test.cpp       | 124 ++++++++++++----
  38 files changed, 1684 insertions(+), 753 deletions(-)
 
 commit a9980b3eaa90952072e1c17e3c40cb73ca805f8e
@@ -13785,11 +23546,11 @@ Date:   Fri Aug 11 15:39:19 2006 +0200
     * resolv a bug in the simplex affinement method
     * add some usefull methode to the DiffractometerInterface: getAxe and setAxesFromCrystalReflection
 
- include/hkl/crystal.h            |  137 +++++++++-----
- include/hkl/diffractometer.h     |  157 ++++++++++++++-
- src/affinement_simplex.cpp       |   66 ++++++-
- test/affinement_simplex_test.cpp |  151 +++++++-------
- test/crystal_test.cpp            |  411 ++++++++++++++++++++------------------
+ include/hkl/crystal.h            | 137 ++++++++-----
+ include/hkl/diffractometer.h     | 157 ++++++++++++++-
+ src/affinement_simplex.cpp       |  66 ++++++-
+ test/affinement_simplex_test.cpp | 151 +++++++-------
+ test/crystal_test.cpp            | 411 ++++++++++++++++++++-------------------
  5 files changed, 593 insertions(+), 329 deletions(-)
 
 commit 94116eb4fc55be62962a7c405866595b598efa76
@@ -13798,8 +23559,8 @@ Date:   Wed Jul 26 18:34:39 2006 +0200
 
     * add the pseudoAxes to the geometry::printToStream()
 
- include/hkl/diffractometer.h |   35 +++++++++++++++++++++++++++--------
- include/hkl/pseudoaxe.h      |    2 +-
+ include/hkl/diffractometer.h | 35 +++++++++++++++++++++++++++--------
+ include/hkl/pseudoaxe.h      |  2 +-
  2 files changed, 28 insertions(+), 9 deletions(-)
 
 commit 7b73c78de34324e6d4fb58516a492a5eaa6e7272
@@ -13808,8 +23569,8 @@ Date:   Wed Jul 26 17:32:05 2006 +0200
 
     * update the TODO list
 
- TODO |   13 ++++---------
- 1 files changed, 4 insertions(+), 9 deletions(-)
+ TODO | 13 ++++---------
+ 1 file changed, 4 insertions(+), 9 deletions(-)
 
 commit 5d2db5585e4ed98197b3fcc749af358d46fae024
 Author: picca <picca at grisette.localdomain>
@@ -13817,8 +23578,8 @@ Date:   Wed Jul 26 16:55:11 2006 +0200
 
     * update the unit test with non deprecated class
 
- test/main.cpp |   18 +++++++++---------
- 1 files changed, 9 insertions(+), 9 deletions(-)
+ test/main.cpp | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
 
 commit b98373bcd1eb4f319cb777e2664320254f605d8f
 Author: picca <picca at grisette.localdomain>
@@ -13826,8 +23587,8 @@ Date:   Wed Jul 26 16:34:45 2006 +0200
 
     * add the profile option to the build system
 
- SConstruct |   27 +++++++++++++++++++++------
- 1 files changed, 21 insertions(+), 6 deletions(-)
+ SConstruct | 27 +++++++++++++++++++++------
+ 1 file changed, 21 insertions(+), 6 deletions(-)
 
 commit bbaff8ac1a2cd83456d599d6072dca5854b85687
 Author: picca <picca at grisette.localdomain>
@@ -13835,9 +23596,9 @@ Date:   Wed Jul 26 14:36:08 2006 +0200
 
     * put all the myvector files into only one.
 
- include/hkl/linux/myvector.h |  503 ---------------------------------------
- include/hkl/myvector.h       |  542 +++++++++++++++++++++++++++++++++++++++++-
- include/hkl/win32/myvector.h |  444 ----------------------------------
+ include/hkl/linux/myvector.h | 503 ---------------------------------------
+ include/hkl/myvector.h       | 542 ++++++++++++++++++++++++++++++++++++++++++-
+ include/hkl/win32/myvector.h | 444 -----------------------------------
  3 files changed, 540 insertions(+), 949 deletions(-)
 
 commit 1b77d370affa8238ff2fbcf5327367db2d9af8f3
@@ -13846,63 +23607,63 @@ Date:   Tue Jul 25 18:40:41 2006 +0200
 
     now most of the library is based on templates.
 
- include/hkl/crystal.h                   |   46 +-
- include/hkl/derivedmode.h               |   17 +-
- include/hkl/derivedpseudoaxe.h          |    6 +-
- include/hkl/diffractometer.h            |  370 +++++++-------
- include/hkl/linux/mymap.h               |  541 --------------------
- include/hkl/linux/myvector.h            |   47 +-
- include/hkl/mode.h                      |   74 +++-
- include/hkl/mymap.h                     |  595 ++++++++++++++++++++++-
- include/hkl/object.h                    |  181 ++++----
- include/hkl/pseudoaxe.h                 |   17 +-
- include/hkl/source.h                    |  197 +-------
- include/hkl/win32/mymap.h               |  424 ----------------
- src/HKLException.cpp                    |   21 +-
- src/SConscript                          |    6 +-
- src/diffractometer_eulerian4C.cpp       |    4 +-
- src/diffractometer_kappa4C.cpp          |    2 +-
- src/geometry.cpp                        |   33 +-
- src/geometry_eulerian4C.cpp             |    4 +
- src/geometry_eulerian6C.cpp             |    4 +
- src/geometry_kappa4C.cpp                |   28 +-
- src/geometry_kappa6C.cpp                |   12 +-
- src/geometry_twoC.cpp                   |    4 +
- src/mode_eulerian4C.cpp                 |  308 +++++-------
- src/mode_twoC.cpp                       |   54 +--
- src/mystring.cpp                        |    5 +-
- src/object.cpp                          |   16 +-
- src/pseudoaxe_eulerian4C.cpp            |  162 ++++---
- src/pseudoaxe_eulerian6C.cpp            |   31 +-
- src/pseudoaxe_kappa4C.cpp               |   14 +-
- src/pseudoaxe_twoC.cpp                  |   73 ++--
- src/quaternion.cpp                      |    9 +-
- src/source.cpp                          |  169 ++++---
- src/svector.cpp                         |   13 +-
- src/value.cpp                           |    2 +-
- test/SConscript                         |   15 +-
- test/crystal_test.cpp                   |    2 +
- test/crystallist_test.cpp               |   12 +
- test/crystallist_test.h                 |    2 +
- test/diffractometer_eulerian4C_test.cpp |  830 +++++++++++++++---------------
- test/diffractometer_kappa4C_test.cpp    |    1 -
- test/geometry_eulerian4C_test.cpp       |   12 +-
- test/geometry_kappa4C_test.cpp          |   65 +++-
- test/geometry_kappa6C_test.cpp          |   47 ++-
- test/geometry_test.cpp                  |   31 +-
- test/geometry_twoC_test.cpp             |   12 +-
- test/mode_eulerian4C_test.cpp           |  115 +++--
- test/mode_twoC_test.cpp                 |   70 ++-
- test/pseudoaxe_eulerian4C_test.cpp      |   33 +-
- test/pseudoaxe_eulerian6C_test.cpp      |   19 +-
- test/pseudoaxe_kappa4C_test.cpp         |  235 +++++-----
- test/pseudoaxe_kappa4C_test.h           |    4 +-
- test/pseudoaxe_kappa6C_test.cpp         |  140 +++---
- test/pseudoaxe_kappa6C_test.h           |    8 +-
- test/pseudoaxe_twoC_test.cpp            |    6 +-
- test/source_test.cpp                    |   18 +-
- test/source_test.h                      |    2 +
- test/svecmat_test.cpp                   |    2 +-
+ include/hkl/crystal.h                   |  46 +-
+ include/hkl/derivedmode.h               |  17 +-
+ include/hkl/derivedpseudoaxe.h          |   6 +-
+ include/hkl/diffractometer.h            | 370 +++++++-------
+ include/hkl/linux/mymap.h               | 541 ---------------------
+ include/hkl/linux/myvector.h            |  47 +-
+ include/hkl/mode.h                      |  74 ++-
+ include/hkl/mymap.h                     | 595 ++++++++++++++++++++++-
+ include/hkl/object.h                    | 181 ++++---
+ include/hkl/pseudoaxe.h                 |  17 +-
+ include/hkl/source.h                    | 197 +-------
+ include/hkl/win32/mymap.h               | 424 ----------------
+ src/HKLException.cpp                    |  21 +-
+ src/SConscript                          |   6 +-
+ src/diffractometer_eulerian4C.cpp       |   4 +-
+ src/diffractometer_kappa4C.cpp          |   2 +-
+ src/geometry.cpp                        |  33 +-
+ src/geometry_eulerian4C.cpp             |   4 +
+ src/geometry_eulerian6C.cpp             |   4 +
+ src/geometry_kappa4C.cpp                |  28 +-
+ src/geometry_kappa6C.cpp                |  12 +-
+ src/geometry_twoC.cpp                   |   4 +
+ src/mode_eulerian4C.cpp                 | 308 ++++++------
+ src/mode_twoC.cpp                       |  54 +--
+ src/mystring.cpp                        |   5 +-
+ src/object.cpp                          |  16 +-
+ src/pseudoaxe_eulerian4C.cpp            | 162 ++++---
+ src/pseudoaxe_eulerian6C.cpp            |  31 +-
+ src/pseudoaxe_kappa4C.cpp               |  14 +-
+ src/pseudoaxe_twoC.cpp                  |  73 +--
+ src/quaternion.cpp                      |   9 +-
+ src/source.cpp                          | 169 ++++---
+ src/svector.cpp                         |  13 +-
+ src/value.cpp                           |   2 +-
+ test/SConscript                         |  15 +-
+ test/crystal_test.cpp                   |   2 +
+ test/crystallist_test.cpp               |  12 +
+ test/crystallist_test.h                 |   2 +
+ test/diffractometer_eulerian4C_test.cpp | 830 ++++++++++++++++----------------
+ test/diffractometer_kappa4C_test.cpp    |   1 -
+ test/geometry_eulerian4C_test.cpp       |  12 +-
+ test/geometry_kappa4C_test.cpp          |  65 ++-
+ test/geometry_kappa6C_test.cpp          |  47 +-
+ test/geometry_test.cpp                  |  31 +-
+ test/geometry_twoC_test.cpp             |  12 +-
+ test/mode_eulerian4C_test.cpp           | 115 +++--
+ test/mode_twoC_test.cpp                 |  70 +--
+ test/pseudoaxe_eulerian4C_test.cpp      |  33 +-
+ test/pseudoaxe_eulerian6C_test.cpp      |  19 +-
+ test/pseudoaxe_kappa4C_test.cpp         | 235 ++++-----
+ test/pseudoaxe_kappa4C_test.h           |   4 +-
+ test/pseudoaxe_kappa6C_test.cpp         | 140 +++---
+ test/pseudoaxe_kappa6C_test.h           |   8 +-
+ test/pseudoaxe_twoC_test.cpp            |   6 +-
+ test/source_test.cpp                    |  18 +-
+ test/source_test.h                      |   2 +
+ test/svecmat_test.cpp                   |   2 +-
  57 files changed, 2512 insertions(+), 2658 deletions(-)
 
 commit 8c63bafe19f3eddf38ae425c261f6e7cd197775e
@@ -13912,8 +23673,8 @@ Date:   Thu Jun 29 14:37:20 2006 +0200
     * DO NOT COMPILE
 
  include/hkl/axe.h                       |   13 +-
- include/hkl/crystal.h                   | 1038 ++++++++++++++----
- include/hkl/crystallist.h               |  105 ++-
+ include/hkl/crystal.h                   | 1038 +++++++++++++----
+ include/hkl/crystallist.h               |  105 +-
  include/hkl/derivedmode.h               |   67 ++
  include/hkl/derivedpseudoaxe.h          |  163 +++
  include/hkl/diffractometer.h            | 1840 ++++++++++++++++++++++---------
@@ -13924,23 +23685,23 @@ Date:   Thu Jun 29 14:37:20 2006 +0200
  include/hkl/diffractometer_kappa6C.h    |    8 +-
  include/hkl/diffractometer_twoC.h       |   23 +-
  include/hkl/geometry.h                  |   37 +-
- include/hkl/geometry_eulerian4C.h       |   71 ++-
+ include/hkl/geometry_eulerian4C.h       |   71 +-
  include/hkl/geometry_eulerian6C.h       |  170 ++-
  include/hkl/geometry_kappa.h            |    6 +
  include/hkl/geometry_kappa4C.h          |   76 +-
- include/hkl/geometry_kappa6C.h          |   91 ++-
- include/hkl/geometry_twoC.h             |   76 ++-
+ include/hkl/geometry_kappa6C.h          |   91 +-
+ include/hkl/geometry_twoC.h             |   76 +-
  include/hkl/mode.h                      |  123 ++-
  include/hkl/mode_eulerian4C.h           |   52 +-
- include/hkl/mode_eulerian6C.h           |  153 +---
+ include/hkl/mode_eulerian6C.h           |  153 +--
  include/hkl/mode_kappa4C.h              |  131 +--
- include/hkl/mode_kappa6C.h              |  143 +---
+ include/hkl/mode_kappa6C.h              |  143 +--
  include/hkl/mode_twoC.h                 |    9 +-
  include/hkl/pseudoaxe.h                 |  170 ++-
- include/hkl/pseudoaxe_eulerian4C.h      |  173 +---
- include/hkl/pseudoaxe_eulerian6C.h      |  104 +--
+ include/hkl/pseudoaxe_eulerian4C.h      |  173 +--
+ include/hkl/pseudoaxe_eulerian6C.h      |  104 +-
  include/hkl/pseudoaxe_kappa4C.h         |  195 +---
- include/hkl/pseudoaxe_kappa6C.h         |  222 +----
+ include/hkl/pseudoaxe_kappa6C.h         |  222 +---
  include/hkl/pseudoaxe_twoC.h            |   60 +-
  include/hkl/reflection.h                |  697 ++++++------
  src/SConscript                          |   28 +-
@@ -13957,20 +23718,20 @@ Date:   Thu Jun 29 14:37:20 2006 +0200
  src/geometry_eulerian6C.cpp             |  269 +++--
  src/geometry_kappa.cpp                  |    8 +
  src/geometry_kappa4C.cpp                |  265 +++--
- src/geometry_kappa6C.cpp                |  293 +++---
+ src/geometry_kappa6C.cpp                |  293 ++---
  src/geometry_twoC.cpp                   |  158 ++-
  src/mode.cpp                            |   38 -
  src/mode_eulerian4C.cpp                 |   60 +-
- src/mode_eulerian6C.cpp                 |  191 +----
+ src/mode_eulerian6C.cpp                 |  191 +---
  src/mode_kappa4C.cpp                    |  189 ----
  src/mode_kappa6C.cpp                    |  194 ----
  src/mode_twoC.cpp                       |   46 +-
  src/pseudoaxe.cpp                       |   18 -
- src/pseudoaxe_eulerian4C.cpp            |  302 +-----
+ src/pseudoaxe_eulerian4C.cpp            |  302 +----
  src/pseudoaxe_eulerian6C.cpp            |  215 +---
  src/pseudoaxe_kappa4C.cpp               |  420 +------
  src/pseudoaxe_kappa6C.cpp               |  488 --------
- src/pseudoaxe_twoC.cpp                  |  119 +--
+ src/pseudoaxe_twoC.cpp                  |  119 +-
  src/reflection.cpp                      |  161 ---
  test/SConscript                         |   24 +-
  test/affinement_simplex_test.cpp        |   22 +-
@@ -13979,7 +23740,7 @@ Date:   Thu Jun 29 14:37:20 2006 +0200
  test/crystal_test.h                     |    2 +-
  test/crystallist_test.cpp               |   46 +-
  test/crystallist_test.h                 |    3 +
- test/diffractometer_eulerian4C_test.cpp |  472 ++++-----
+ test/diffractometer_eulerian4C_test.cpp |  472 ++++----
  test/diffractometer_eulerian4C_test.h   |  102 +-
  test/diffractometer_kappa4C_test.cpp    |   41 +-
  test/diffractometer_kappa4C_test.h      |    2 +-
@@ -13998,14 +23759,14 @@ Date:   Thu Jun 29 14:37:20 2006 +0200
  test/mode_kappa4C_test.h                |    4 +-
  test/mode_kappa6C_test.cpp              |  222 ++--
  test/mode_kappa6C_test.h                |    4 +-
- test/mode_twoC_test.cpp                 |  142 ++--
+ test/mode_twoC_test.cpp                 |  142 +--
  test/mode_twoC_test.h                   |    2 +-
  test/pseudoaxe_eulerian4C_test.cpp      |   38 +-
  test/pseudoaxe_eulerian6C_test.cpp      |   26 +-
  test/pseudoaxe_kappa4C_test.cpp         |   17 +-
  test/pseudoaxe_kappa6C_test.cpp         |   60 +-
  test/pseudoaxe_kappa6C_test.h           |    2 +-
- test/reflection_test.cpp                |  124 +-
+ test/reflection_test.cpp                |  124 +--
  95 files changed, 5785 insertions(+), 7955 deletions(-)
 
 commit 2c89d376ca102d5ddef064f5b90d872351de58a5
@@ -14014,12 +23775,12 @@ Date:   Thu Jun 22 14:04:41 2006 +0200
 
     * add the psi pseudoAxe to the kappa diffractometers
 
- TODO                           |    2 +-
- include/hkl/HKLException.h     |    3 -
- include/hkl/svecmat.h          |  185 -------------------------
- src/HKLException.cpp           |  300 +++++++++++-----------------------------
- src/diffractometer_kappa4C.cpp |    1 +
- src/diffractometer_kappa6C.cpp |    1 +
+ TODO                           |   2 +-
+ include/hkl/HKLException.h     |   3 -
+ include/hkl/svecmat.h          | 185 -------------------------
+ src/HKLException.cpp           | 300 ++++++++++++-----------------------------
+ src/diffractometer_kappa4C.cpp |   1 +
+ src/diffractometer_kappa6C.cpp |   1 +
  6 files changed, 87 insertions(+), 405 deletions(-)
 
 commit 2ae66cf84550dd8cc7d3846ff926b57737f54dac
@@ -14028,8 +23789,8 @@ Date:   Mon Jun 19 15:27:50 2006 +0200
 
     * update the version of the library
 
- VERSION              |    2 +-
- include/hkl/config.h |    2 +-
+ VERSION              | 2 +-
+ include/hkl/config.h | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
 
 commit 1e4a35be57e58cb4760d163aee3ec0679c1de83b
@@ -14039,14 +23800,14 @@ Date:   Mon Jun 19 15:19:29 2006 +0200
     * modification of the pseudoAxe API (add the uninitialize method)
     * add the doc/SConscript file to generate the doc with : scons doc
 
- doc/SConscript               |    2 +
- include/hkl/pseudoaxe.h      |   28 +++++++------------------
- src/mystring.cpp             |    6 ++--
- src/pseudoaxe.cpp            |    7 ++---
- src/pseudoaxe_eulerian4C.cpp |    2 +-
- src/pseudoaxe_eulerian6C.cpp |    7 ++---
- src/pseudoaxe_kappa4C.cpp    |   46 +++++++++++++++++++++---------------------
- src/pseudoaxe_twoC.cpp       |   14 ++++++------
+ doc/SConscript               |  2 ++
+ include/hkl/pseudoaxe.h      | 28 ++++++++-------------------
+ src/mystring.cpp             |  6 +++---
+ src/pseudoaxe.cpp            |  7 +++----
+ src/pseudoaxe_eulerian4C.cpp |  2 +-
+ src/pseudoaxe_eulerian6C.cpp |  7 +++----
+ src/pseudoaxe_kappa4C.cpp    | 46 ++++++++++++++++++++++----------------------
+ src/pseudoaxe_twoC.cpp       | 14 +++++++-------
  8 files changed, 50 insertions(+), 62 deletions(-)
 
 commit 0ea3b21303830b11e066b7081d0150392cff5ea9
@@ -14057,27 +23818,27 @@ Date:   Thu Jun 8 16:11:28 2006 +0200
       - remove the bksys directory
       - add a tool directory with the doxygen tool
 
- SConstruct                          |  164 +++++++++++++++++++---------
- binding/python/SConscript           |   20 ++--
- bksys/__init__.py                   |  116 -------------------
- bksys/bksys.py                      |  170 ----------------------------
- bksys/boost_python.py               |  117 --------------------
- bksys/cppunit.py                    |  127 ---------------------
- bksys/generic.py                    |  191 --------------------------------
- bksys/gtkmm.py                      |  132 ----------------------
- bksys/gtkmm2.4.py                   |  130 ----------------------
- bksys/linux2/detect_bksys.py        |   34 ------
- bksys/linux2/detect_boost_python.py |   17 ---
- bksys/linux2/detect_cppunit.py      |   26 -----
- bksys/linux2/detect_generic.py      |   11 --
- bksys/linux2/detect_python.py       |   19 ---
- bksys/python.py                     |   89 ---------------
- bksys/win32/detect_bksys.py         |   36 ------
- bksys/win32/detect_cppunit.py       |   13 --
- bksys/win32/detect_generic.py       |   17 ---
- src/SConscript                      |   12 +--
- test/SConscript                     |   26 +++-
- tool/doxygen.py                     |  208 +++++++++++++++++++++++++++++++++++
+ SConstruct                          | 164 +++++++++++++++++++---------
+ binding/python/SConscript           |  20 ++--
+ bksys/__init__.py                   | 116 --------------------
+ bksys/bksys.py                      | 170 -----------------------------
+ bksys/boost_python.py               | 117 --------------------
+ bksys/cppunit.py                    | 127 ----------------------
+ bksys/generic.py                    | 191 ---------------------------------
+ bksys/gtkmm.py                      | 132 -----------------------
+ bksys/gtkmm2.4.py                   | 130 ----------------------
+ bksys/linux2/detect_bksys.py        |  34 ------
+ bksys/linux2/detect_boost_python.py |  17 ---
+ bksys/linux2/detect_cppunit.py      |  26 -----
+ bksys/linux2/detect_generic.py      |  11 --
+ bksys/linux2/detect_python.py       |  19 ----
+ bksys/python.py                     |  89 ---------------
+ bksys/win32/detect_bksys.py         |  36 -------
+ bksys/win32/detect_cppunit.py       |  13 ---
+ bksys/win32/detect_generic.py       |  17 ---
+ src/SConscript                      |  12 +--
+ test/SConscript                     |  26 +++--
+ tool/doxygen.py                     | 208 ++++++++++++++++++++++++++++++++++++
  21 files changed, 355 insertions(+), 1320 deletions(-)
 
 commit f63cfd1efc3e90f3e3e5424b96a2f19eb2313b0e
@@ -14086,11 +23847,11 @@ Date:   Wed Jun 7 10:57:08 2006 +0200
 
     * update the doc
 
- include/hkl/geometry_kappa6C.h     |    6 +++---
- include/hkl/geometry_twoC.h        |    2 +-
- include/hkl/linux/mymap.h          |   10 +++++-----
- include/hkl/objectwithparameters.h |   19 +++++++------------
- test/pseudoaxe_kappa6C_test.cpp    |    2 +-
+ include/hkl/geometry_kappa6C.h     |  6 +++---
+ include/hkl/geometry_twoC.h        |  2 +-
+ include/hkl/linux/mymap.h          | 10 +++++-----
+ include/hkl/objectwithparameters.h | 19 +++++++------------
+ test/pseudoaxe_kappa6C_test.cpp    |  2 +-
  5 files changed, 17 insertions(+), 22 deletions(-)
 
 commit ba96243587b546daae215fcd513ddf2d81f9c7ba
@@ -14099,9 +23860,9 @@ Date:   Tue Jun 6 18:04:47 2006 +0200
 
     * add the random test to the euleria4C and kappa4C pseudoAxe
 
- test/pseudoaxe_eulerian4C_test.cpp |   59 ++++++++++++++++++++++++++++++++++
- test/pseudoaxe_kappa4C_test.cpp    |   61 +++++++++++++++++++++++++++++++++++-
- 2 files changed, 119 insertions(+), 1 deletions(-)
+ test/pseudoaxe_eulerian4C_test.cpp | 59 ++++++++++++++++++++++++++++++++++++
+ test/pseudoaxe_kappa4C_test.cpp    | 61 +++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 119 insertions(+), 1 deletion(-)
 
 commit 14525001e82a37dc696e5fba8d18d1a89bb30d1c
 Author: picca <picca at grisette.localdomain>
@@ -14113,38 +23874,38 @@ Date:   Tue Jun 6 17:15:05 2006 +0200
       if direction = 1 choose the vertical diffraction plan
       if direction = 0 choose the horizontal one.
 
- TODO                                         |    1 +
- binding/python/diffractometer_kappa_wrap.cpp |    3 +-
- binding/python/diffractometer_wrap.cpp       |    2 +-
- include/hkl/affinement.h                     |    2 +-
- include/hkl/diffractometer.h                 |    8 +-
- include/hkl/geometry.h                       |   13 +-
- include/hkl/mode_eulerian6C.h                |  426 ++++++++++------------
- include/hkl/objectwithparameters.h           |   10 +-
- include/hkl/pseudoaxe_eulerian6C.h           |   63 ++--
- src/SConscript                               |    1 +
- src/diffractometer.cpp                       |   36 +--
- src/diffractometer_kappa.cpp                 |    3 +-
- src/geometry.cpp                             |   39 ++
- src/mode_eulerian4C.cpp                      |   19 +-
- src/mode_eulerian6C.cpp                      |  491 +++++++++-----------------
- src/objectwithparameters.cpp                 |   11 +-
- src/pseudoaxe_eulerian6C.cpp                 |   96 +++---
- src/value.cpp                                |    2 +-
- test/affinement_simplex_test.cpp             |    2 +
- test/diffractometer_eulerian4C_test.cpp      |    8 +-
- test/diffractometer_twoC_test.cpp            |    6 +-
- test/geometry_twoC_test.cpp                  |   20 +-
- test/geometry_twoC_test.h                    |    4 +
- test/mode_eulerian4C_test.cpp                |  346 ++++++++++++------
- test/mode_eulerian4C_test.h                  |    8 +-
- test/mode_kappa4C_test.cpp                   |  113 ++++++
- test/mode_kappa4C_test.h                     |    6 +
- test/mode_kappa6C_test.cpp                   |  113 ++++++
- test/mode_kappa6C_test.h                     |    6 +
- test/objectwithparameters_test.cpp           |   10 +-
- test/pseudoaxe_eulerian6C_test.cpp           |    6 +-
- 31 files changed, 1061 insertions(+), 813 deletions(-)
+ TODO                                         |   1 +
+ binding/python/diffractometer_kappa_wrap.cpp |   3 +-
+ binding/python/diffractometer_wrap.cpp       |   2 +-
+ include/hkl/affinement.h                     |   2 +-
+ include/hkl/diffractometer.h                 |   8 +-
+ include/hkl/geometry.h                       |  13 +-
+ include/hkl/mode_eulerian6C.h                | 426 +++++++++++------------
+ include/hkl/objectwithparameters.h           |  10 +-
+ include/hkl/pseudoaxe_eulerian6C.h           |  63 ++--
+ src/SConscript                               |   1 +
+ src/diffractometer.cpp                       |  36 +-
+ src/diffractometer_kappa.cpp                 |   3 +-
+ src/geometry.cpp                             |  39 +++
+ src/mode_eulerian4C.cpp                      |  19 +-
+ src/mode_eulerian6C.cpp                      | 487 +++++++++------------------
+ src/objectwithparameters.cpp                 |  11 +-
+ src/pseudoaxe_eulerian6C.cpp                 |  96 +++---
+ src/value.cpp                                |   2 +-
+ test/affinement_simplex_test.cpp             |   2 +
+ test/diffractometer_eulerian4C_test.cpp      |   8 +-
+ test/diffractometer_twoC_test.cpp            |   6 +-
+ test/geometry_twoC_test.cpp                  |  20 +-
+ test/geometry_twoC_test.h                    |   4 +
+ test/mode_eulerian4C_test.cpp                | 346 ++++++++++++-------
+ test/mode_eulerian4C_test.h                  |   8 +-
+ test/mode_kappa4C_test.cpp                   | 113 +++++++
+ test/mode_kappa4C_test.h                     |   6 +
+ test/mode_kappa6C_test.cpp                   | 113 +++++++
+ test/mode_kappa6C_test.h                     |   6 +
+ test/objectwithparameters_test.cpp           |  10 +-
+ test/pseudoaxe_eulerian6C_test.cpp           |   6 +-
+ 31 files changed, 1059 insertions(+), 811 deletions(-)
 
 commit 91a32a12d876ba9e91cc5f9a928fd96f514213fd
 Author: picca <picca at grisette.localdomain>
@@ -14152,18 +23913,18 @@ Date:   Thu Jun 1 15:04:09 2006 +0200
 
     * add the pseudoAxe::kappa6C "tth" and "q" + test functions
 
- TODO                            |    6 +-
- include/hkl/geometry_kappa4C.h  |    6 ++
- include/hkl/geometry_kappa6C.h  |   13 ++++
- include/hkl/pseudoaxe_kappa6C.h |   94 ++++++++++++++++++++++--
- src/diffractometer_kappa6C.cpp  |    2 +
- src/geometry_kappa4C.cpp        |    4 +
- src/geometry_kappa6C.cpp        |   38 ++++++++++
- src/pseudoaxe_eulerian6C.cpp    |   43 ++++++-----
- src/pseudoaxe_kappa6C.cpp       |  152 +++++++++++++++++++++++++++++++++++++++
- test/SConscript                 |    2 +-
- test/pseudoaxe_kappa6C_test.cpp |  137 ++++++++++++++++++++++++++++-------
- test/pseudoaxe_kappa6C_test.h   |    7 ++-
+ TODO                            |   6 +-
+ include/hkl/geometry_kappa4C.h  |   6 ++
+ include/hkl/geometry_kappa6C.h  |  13 ++++
+ include/hkl/pseudoaxe_kappa6C.h |  94 +++++++++++++++++++++++--
+ src/diffractometer_kappa6C.cpp  |   2 +
+ src/geometry_kappa4C.cpp        |   4 ++
+ src/geometry_kappa6C.cpp        |  38 ++++++++++
+ src/pseudoaxe_eulerian6C.cpp    |  43 +++++++-----
+ src/pseudoaxe_kappa6C.cpp       | 152 ++++++++++++++++++++++++++++++++++++++++
+ test/SConscript                 |   2 +-
+ test/pseudoaxe_kappa6C_test.cpp | 137 +++++++++++++++++++++++++++++-------
+ test/pseudoaxe_kappa6C_test.h   |   7 +-
  12 files changed, 447 insertions(+), 57 deletions(-)
 
 commit 507a5b5d88f7ac7a23892c90b38e79af2516705d
@@ -14172,23 +23933,23 @@ Date:   Wed May 31 16:22:18 2006 +0200
 
     * add the pseudoAxe::eulerian6C::Tth, Q and eulerian4C::vertical::Psi + test functions
 
- TODO                               |    8 +-
- include/hkl/geometry.h             |    6 +
- include/hkl/geometry_eulerian6C.h  |   13 +
- include/hkl/pseudoaxe_eulerian6C.h |  129 ++++++++++
- src/SConscript                     |    1 +
- src/affinement_simplex.cpp         |  459 +++++++++++++++++++-----------------
- src/diffractometer_eulerian6C.cpp  |   12 +-
- src/geometry.cpp                   |   19 ++
- src/geometry_eulerian4C.cpp        |   15 ++
- src/geometry_eulerian6C.cpp        |   22 ++
- src/pseudoaxe_eulerian6C.cpp       |  334 ++++++++++++++++++++++++++
- src/svector.cpp                    |   20 +-
- test/SConscript                    |    1 +
- test/geometry_eulerian6C_test.cpp  |   57 ++++-
- test/geometry_eulerian6C_test.h    |    4 +
- test/pseudoaxe_eulerian6C_test.cpp |  297 +++++++++++++++++++++++
- test/pseudoaxe_eulerian6C_test.h   |   39 +++
+ TODO                               |   8 +-
+ include/hkl/geometry.h             |   6 +
+ include/hkl/geometry_eulerian6C.h  |  13 ++
+ include/hkl/pseudoaxe_eulerian6C.h | 129 +++++++++++
+ src/SConscript                     |   1 +
+ src/affinement_simplex.cpp         | 459 +++++++++++++++++++------------------
+ src/diffractometer_eulerian6C.cpp  |  12 +-
+ src/geometry.cpp                   |  19 ++
+ src/geometry_eulerian4C.cpp        |  15 ++
+ src/geometry_eulerian6C.cpp        |  22 ++
+ src/pseudoaxe_eulerian6C.cpp       | 334 +++++++++++++++++++++++++++
+ src/svector.cpp                    |  20 +-
+ test/SConscript                    |   1 +
+ test/geometry_eulerian6C_test.cpp  |  57 ++++-
+ test/geometry_eulerian6C_test.h    |   4 +
+ test/pseudoaxe_eulerian6C_test.cpp | 297 ++++++++++++++++++++++++
+ test/pseudoaxe_eulerian6C_test.h   |  39 ++++
  17 files changed, 1190 insertions(+), 246 deletions(-)
 
 commit e5e4e3ffd1a9b10ee6fca12d8a2bcb6b0090967b
@@ -14197,11 +23958,11 @@ Date:   Tue May 23 14:09:26 2006 +0200
 
     * add the geometry::Eulerian6C::setFromGeometry method and its test function.
 
- include/hkl/geometry_eulerian6C.h |    8 +++
- src/geometry_eulerian6C.cpp       |  101 +++++++++++++++++++++++++++++++++++++
- test/geometry_eulerian6C_test.cpp |   39 ++++++++++++++
- test/geometry_eulerian6C_test.h   |    2 +
- 4 files changed, 150 insertions(+), 0 deletions(-)
+ include/hkl/geometry_eulerian6C.h |   8 +++
+ src/geometry_eulerian6C.cpp       | 101 ++++++++++++++++++++++++++++++++++++++
+ test/geometry_eulerian6C_test.cpp |  39 +++++++++++++++
+ test/geometry_eulerian6C_test.h   |   2 +
+ 4 files changed, 150 insertions(+)
 
 commit 1ecb565292dba5fe75061e84a1f2945cd88175fa
 Author: picca <picca at grisette.localdomain>
@@ -14209,9 +23970,9 @@ Date:   Tue May 23 10:59:20 2006 +0200
 
     * clean the pseudoAxe code (remove the unnecessary dynamic_cast)
 
- src/pseudoaxe_eulerian4C.cpp |    6 +++---
- src/pseudoaxe_kappa4C.cpp    |    2 +-
- src/pseudoaxe_kappa6C.cpp    |   20 +++-----------------
+ src/pseudoaxe_eulerian4C.cpp |  6 +++---
+ src/pseudoaxe_kappa4C.cpp    |  2 +-
+ src/pseudoaxe_kappa6C.cpp    | 20 +++-----------------
  3 files changed, 7 insertions(+), 21 deletions(-)
 
 commit eaf5395c0f4ed24556f8c66c310fee5fba7862b1
@@ -14233,8 +23994,8 @@ Date:   Mon May 22 18:08:38 2006 +0200
  src/diffractometer_eulerian6C.cpp |  189 +----
  src/diffractometer_kappa4C.cpp    |   49 +-
  src/diffractometer_kappa6C.cpp    |   53 +-
- src/fitparameter.cpp              |  140 ++--
- src/fitparameterlist.cpp          |  188 ++--
+ src/fitparameter.cpp              |  140 +--
+ src/fitparameterlist.cpp          |  188 ++---
  src/geometry.cpp                  |   24 +-
  src/geometry_eulerian4C.cpp       |    5 +-
  src/geometry_eulerian6C.cpp       |   44 +-
@@ -14248,12 +24009,12 @@ Date:   Mon May 22 18:08:38 2006 +0200
  src/mode_kappa6C.cpp              |   60 +-
  src/mystring.cpp                  |   84 +-
  src/object.cpp                    |  164 ++--
- src/objectwithparameters.cpp      |  138 ++--
+ src/objectwithparameters.cpp      |  138 +--
  src/pseudoaxe_eulerian4C.cpp      |    9 +-
  src/pseudoaxe_kappa4C.cpp         |   50 +-
  src/pseudoaxe_twoC.cpp            |   50 +-
- src/range.cpp                     |  116 ++--
- src/smatrix.cpp                   |  701 ++++++----------
+ src/range.cpp                     |  116 +--
+ src/smatrix.cpp                   |  701 ++++++---------
  src/source.cpp                    |    5 +-
  src/svector.cpp                   |  180 ----
  src/value.cpp                     |  152 ++--
@@ -14265,9 +24026,9 @@ Date:   Mon May 22 15:00:57 2006 +0200
 
     * update the gtk frontend
 
- TODO                                   |    6 +-
- binding/python/diffractometer.gazpacho |  152 ++++++++++++++++++++++++++++----
- binding/python/diffractometer2.py      |  101 +++++++++++++--------
+ TODO                                   |   6 +-
+ binding/python/diffractometer.gazpacho | 152 ++++++++++++++++++++++++++++-----
+ binding/python/diffractometer2.py      | 101 ++++++++++++++--------
  3 files changed, 200 insertions(+), 59 deletions(-)
 
 commit 70b2fbbbf483fdb58cbbd3956c3da8468d4a5857
@@ -14278,24 +24039,24 @@ Date:   Fri May 19 15:33:08 2006 +0200
     * now pseudoAxe::initialize throw an exception depending one pseudoAxe.
     * modification in the pseudoAxe to call correctly all virtual method with int the virtual method.
 
- TODO                               |    1 +
- include/hkl/geometry_kappa4C.h     |   10 +
- include/hkl/pseudoaxe.h            |    2 +-
- include/hkl/pseudoaxe_eulerian4C.h |   10 +-
- include/hkl/pseudoaxe_kappa4C.h    |   96 ++++++++-
- include/hkl/pseudoaxe_kappa6C.h    |    8 +-
- include/hkl/pseudoaxe_twoC.h       |   35 ++-
- src/geometry_kappa4C.cpp           |    9 +
- src/pseudoaxe_eulerian4C.cpp       |   49 +++--
- src/pseudoaxe_kappa4C.cpp          |  437 +++++++++++++++++++++++++++++-------
- src/pseudoaxe_kappa6C.cpp          |    8 +-
- src/pseudoaxe_twoC.cpp             |  154 +++++++++----
- test/SConscript                    |    5 +-
- test/geometry_kappa4C_test.cpp     |   15 ++
- test/geometry_kappa4C_test.h       |   68 +++---
- test/pseudoaxe_kappa4C_test.cpp    |  232 +++++++++++++++++---
- test/pseudoaxe_kappa4C_test.h      |    8 +-
- test/pseudoaxe_twoC_test.cpp       |   35 ++-
+ TODO                               |   1 +
+ include/hkl/geometry_kappa4C.h     |  10 +
+ include/hkl/pseudoaxe.h            |   2 +-
+ include/hkl/pseudoaxe_eulerian4C.h |  10 +-
+ include/hkl/pseudoaxe_kappa4C.h    |  96 +++++++-
+ include/hkl/pseudoaxe_kappa6C.h    |   8 +-
+ include/hkl/pseudoaxe_twoC.h       |  35 ++-
+ src/geometry_kappa4C.cpp           |   9 +
+ src/pseudoaxe_eulerian4C.cpp       |  49 +++--
+ src/pseudoaxe_kappa4C.cpp          | 437 ++++++++++++++++++++++++++++++-------
+ src/pseudoaxe_kappa6C.cpp          |   8 +-
+ src/pseudoaxe_twoC.cpp             | 154 ++++++++-----
+ test/SConscript                    |   5 +-
+ test/geometry_kappa4C_test.cpp     |  15 ++
+ test/geometry_kappa4C_test.h       |  68 +++---
+ test/pseudoaxe_kappa4C_test.cpp    | 232 +++++++++++++++++---
+ test/pseudoaxe_kappa4C_test.h      |   8 +-
+ test/pseudoaxe_twoC_test.cpp       |  35 ++-
  18 files changed, 936 insertions(+), 246 deletions(-)
 
 commit 53bd70219dd900673f763b420503477cf50a8e15
@@ -14307,35 +24068,35 @@ Date:   Thu May 18 17:18:39 2006 +0200
     * modification of the setFromGeometry function, add a stric flag to deal
         with the extra axes when doing conversion between Geometries.
 
- TODO                               |   11 +-
- include/hkl/geometry.h             |    3 +-
- include/hkl/geometry_eulerian4C.h  |    8 +-
- include/hkl/geometry_kappa4C.h     |    3 +-
- include/hkl/geometry_kappa6C.h     |    3 +-
- include/hkl/geometry_twoC.h        |    9 ++-
- include/hkl/pseudoaxe_eulerian4C.h |  114 +++++++++++-------
- src/geometry.cpp                   |    2 +-
- src/geometry_eulerian4C.cpp        |   21 ++-
- src/geometry_kappa4C.cpp           |   19 ++-
- src/geometry_kappa6C.cpp           |   37 +++++-
- src/geometry_twoC.cpp              |   20 ++--
- src/mode_kappa4C.cpp               |   20 ++--
- src/mode_kappa6C.cpp               |   20 ++--
- src/pseudoaxe_eulerian4C.cpp       |  213 +++++++++++++++++++++++++++++++++
- src/pseudoaxe_kappa4C.cpp          |   22 ++--
- src/pseudoaxe_kappa6C.cpp          |   40 +++---
- test/geometry_eulerian4C_test.cpp  |   10 +-
- test/geometry_kappa4C_test.cpp     |    6 +-
- test/geometry_kappa6C_test.cpp     |    6 +-
- test/geometry_twoC_test.cpp        |   16 ++--
- test/mode_kappa4C_test.cpp         |    4 +-
- test/mode_kappa6C_test.cpp         |    4 +-
- test/pseudoaxe_eulerian4C_test.cpp |  231 ++++++++++++++++++++++++++++++------
- test/pseudoaxe_eulerian4C_test.h   |    8 +-
- test/pseudoaxe_kappa4C_test.cpp    |   10 +-
- test/pseudoaxe_kappa6C_test.cpp    |   24 ++--
- test/pseudoaxe_twoC_test.cpp       |   84 +++++++-------
- test/pseudoaxe_twoC_test.h         |    2 +-
+ TODO                               |  11 +-
+ include/hkl/geometry.h             |   3 +-
+ include/hkl/geometry_eulerian4C.h  |   8 +-
+ include/hkl/geometry_kappa4C.h     |   3 +-
+ include/hkl/geometry_kappa6C.h     |   3 +-
+ include/hkl/geometry_twoC.h        |   9 +-
+ include/hkl/pseudoaxe_eulerian4C.h | 114 ++++++++++--------
+ src/geometry.cpp                   |   2 +-
+ src/geometry_eulerian4C.cpp        |  21 ++--
+ src/geometry_kappa4C.cpp           |  19 ++-
+ src/geometry_kappa6C.cpp           |  37 ++++--
+ src/geometry_twoC.cpp              |  20 ++--
+ src/mode_kappa4C.cpp               |  20 ++--
+ src/mode_kappa6C.cpp               |  20 ++--
+ src/pseudoaxe_eulerian4C.cpp       | 213 ++++++++++++++++++++++++++++++++++
+ src/pseudoaxe_kappa4C.cpp          |  22 ++--
+ src/pseudoaxe_kappa6C.cpp          |  40 +++----
+ test/geometry_eulerian4C_test.cpp  |  10 +-
+ test/geometry_kappa4C_test.cpp     |   6 +-
+ test/geometry_kappa6C_test.cpp     |   6 +-
+ test/geometry_twoC_test.cpp        |  16 +--
+ test/mode_kappa4C_test.cpp         |   4 +-
+ test/mode_kappa6C_test.cpp         |   4 +-
+ test/pseudoaxe_eulerian4C_test.cpp | 231 +++++++++++++++++++++++++++++++------
+ test/pseudoaxe_eulerian4C_test.h   |   8 +-
+ test/pseudoaxe_kappa4C_test.cpp    |  10 +-
+ test/pseudoaxe_kappa6C_test.cpp    |  24 ++--
+ test/pseudoaxe_twoC_test.cpp       |  84 +++++++-------
+ test/pseudoaxe_twoC_test.h         |   2 +-
  29 files changed, 709 insertions(+), 261 deletions(-)
 
 commit 7d9a8c7b4e298b1e9a49b329e079fa51556b657c
@@ -14344,12 +24105,12 @@ Date:   Wed May 17 16:28:25 2006 +0200
 
     * update the setFromGeometry method of all geometries
 
- include/hkl/geometry_twoC.h |   22 ++--------
- src/geometry_eulerian4C.cpp |   59 +++++++++++++++++----------
- src/geometry_kappa4C.cpp    |   54 +++++++++++++++++--------
- src/geometry_kappa6C.cpp    |   60 ++++++++++++++++++---------
- src/geometry_twoC.cpp       |   94 ++++++++++++++++++++++++------------------
- src/pseudoaxe_kappa4C.cpp   |    2 +-
+ include/hkl/geometry_twoC.h | 22 ++---------
+ src/geometry_eulerian4C.cpp | 59 +++++++++++++++++-----------
+ src/geometry_kappa4C.cpp    | 54 ++++++++++++++++++--------
+ src/geometry_kappa6C.cpp    | 60 +++++++++++++++++++----------
+ src/geometry_twoC.cpp       | 94 ++++++++++++++++++++++++++-------------------
+ src/pseudoaxe_kappa4C.cpp   |  2 +-
  6 files changed, 173 insertions(+), 118 deletions(-)
 
 commit a52d8862905d6246d56c65f54666d31ee0ec7e19
@@ -14358,8 +24119,8 @@ Date:   Wed May 17 14:06:34 2006 +0200
 
     * update the TODO
 
- TODO |   18 ++++++++++++++----
- 1 files changed, 14 insertions(+), 4 deletions(-)
+ TODO | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
 
 commit 0f0e44befc03e319e519420643a1d1c5850c7d2a
 Author: picca <picca at grisette.localdomain>
@@ -14367,14 +24128,14 @@ Date:   Wed May 17 13:58:25 2006 +0200
 
     * add the diffractometer::twoC::Vertical and test functions
 
- bksys/linux2/detect_bksys.py      |    4 +-
- include/hkl/diffractometer_twoC.h |   58 +++++
- src/SConscript                    |    1 +
- src/diffractometer_twoC.cpp       |   44 ++++
- src/mode_twoC.cpp                 |    2 +-
- test/SConscript                   |    1 +
- test/diffractometer_twoC_test.cpp |  421 +++++++++++++++++++++++++++++++++++++
- test/diffractometer_twoC_test.h   |   61 ++++++
+ bksys/linux2/detect_bksys.py      |   4 +-
+ include/hkl/diffractometer_twoC.h |  58 ++++++
+ src/SConscript                    |   1 +
+ src/diffractometer_twoC.cpp       |  44 ++++
+ src/mode_twoC.cpp                 |   2 +-
+ test/SConscript                   |   1 +
+ test/diffractometer_twoC_test.cpp | 421 ++++++++++++++++++++++++++++++++++++++
+ test/diffractometer_twoC_test.h   |  61 ++++++
  8 files changed, 589 insertions(+), 3 deletions(-)
 
 commit 571bf7231e5310c7fce4f3f133270fb7484fcecb
@@ -14383,13 +24144,13 @@ Date:   Tue May 16 16:42:25 2006 +0200
 
     * add the twoC modes "symetric" and "fix_incidence" and test functions
 
- TODO                    |    7 ++-
- include/hkl/mode_twoC.h |   53 +++++++++++++++++++++++
- src/SConscript          |    1 +
- src/mode_twoC.cpp       |   72 ++++++++++++++++++++++++++++++++
- test/SConscript         |    1 +
- test/mode_twoC_test.cpp |  106 +++++++++++++++++++++++++++++++++++++++++++++++
- test/mode_twoC_test.h   |   41 ++++++++++++++++++
+ TODO                    |   7 ++--
+ include/hkl/mode_twoC.h |  53 ++++++++++++++++++++++++
+ src/SConscript          |   1 +
+ src/mode_twoC.cpp       |  72 ++++++++++++++++++++++++++++++++
+ test/SConscript         |   1 +
+ test/mode_twoC_test.cpp | 106 ++++++++++++++++++++++++++++++++++++++++++++++++
+ test/mode_twoC_test.h   |  41 +++++++++++++++++++
  7 files changed, 278 insertions(+), 3 deletions(-)
 
 commit b0f9651709be4acb7b8f950b911b36af2eb5fafc
@@ -14400,36 +24161,36 @@ Date:   Tue May 16 13:58:07 2006 +0200
     * add the setFromGeometry method to Geometries.
     * remove CVS header of some files.
 
- TODO                                    |   12 +-
- include/hkl/constants.h                 |  145 +--------
- include/hkl/crystal.h                   |  266 ---------------
- include/hkl/geometry.h                  |  235 +-------------
- include/hkl/geometry_eulerian4C.h       |   24 +--
- include/hkl/geometry_kappa4C.h          |   23 +--
- include/hkl/geometry_kappa6C.h          |   13 +-
- include/hkl/pseudoaxe.h                 |    4 +-
- include/hkl/pseudoaxe_eulerian4C.h      |   85 +++++-
- include/hkl/pseudoaxe_kappa4C.h         |   24 +-
- include/hkl/pseudoaxe_kappa6C.h         |   16 +-
- include/hkl/pseudoaxe_twoC.h            |  111 +++++++
- src/SConscript                          |    1 +
- src/crystal.cpp                         |  303 +-----------------
- src/diffractometer.cpp                  |    9 +-
- src/geometry.cpp                        |    4 +
- src/geometry_eulerian4C.cpp             |  117 +++-----
- src/geometry_kappa4C.cpp                |  137 ++++-----
- src/geometry_kappa6C.cpp                |   74 +++--
- src/pseudoaxe_eulerian4C.cpp            |   29 +-
- src/pseudoaxe_kappa4C.cpp               |   48 ++--
- src/pseudoaxe_kappa6C.cpp               |   71 +++--
- src/pseudoaxe_twoC.cpp                  |  247 ++++++++++++++
- src/reflection.cpp                      |  536 +++++++++----------------------
- src/source.cpp                          |  364 ++++++---------------
- test/SConscript                         |    1 +
- test/crystal_test.cpp                   |   36 +-
- test/diffractometer_eulerian4C_test.cpp |    6 +-
- test/pseudoaxe_twoC_test.cpp            |  152 +++++++++
- test/pseudoaxe_twoC_test.h              |   39 +++
+ TODO                                    |  12 +-
+ include/hkl/constants.h                 | 145 +--------
+ include/hkl/crystal.h                   | 266 ----------------
+ include/hkl/geometry.h                  | 235 +-------------
+ include/hkl/geometry_eulerian4C.h       |  24 +-
+ include/hkl/geometry_kappa4C.h          |  23 +-
+ include/hkl/geometry_kappa6C.h          |  13 +-
+ include/hkl/pseudoaxe.h                 |   4 +-
+ include/hkl/pseudoaxe_eulerian4C.h      |  85 ++++-
+ include/hkl/pseudoaxe_kappa4C.h         |  24 +-
+ include/hkl/pseudoaxe_kappa6C.h         |  16 +-
+ include/hkl/pseudoaxe_twoC.h            | 111 +++++++
+ src/SConscript                          |   1 +
+ src/crystal.cpp                         | 303 +-----------------
+ src/diffractometer.cpp                  |   9 +-
+ src/geometry.cpp                        |   4 +
+ src/geometry_eulerian4C.cpp             | 117 +++----
+ src/geometry_kappa4C.cpp                | 137 ++++----
+ src/geometry_kappa6C.cpp                |  74 +++--
+ src/pseudoaxe_eulerian4C.cpp            |  29 +-
+ src/pseudoaxe_kappa4C.cpp               |  48 +--
+ src/pseudoaxe_kappa6C.cpp               |  71 +++--
+ src/pseudoaxe_twoC.cpp                  | 247 +++++++++++++++
+ src/reflection.cpp                      | 536 +++++++++-----------------------
+ src/source.cpp                          | 364 +++++++---------------
+ test/SConscript                         |   1 +
+ test/crystal_test.cpp                   |  36 +--
+ test/diffractometer_eulerian4C_test.cpp |   6 +-
+ test/pseudoaxe_twoC_test.cpp            | 152 +++++++++
+ test/pseudoaxe_twoC_test.h              |  39 +++
  30 files changed, 1190 insertions(+), 1942 deletions(-)
 
 commit 2b17a2dead48bf0ba572ac93aecfe715c8c98d81
@@ -14438,14 +24199,14 @@ Date:   Thu May 11 15:31:06 2006 +0200
 
     * add the twoC geometry and is test functions
 
- TODO                        |    4 +
- include/hkl/geometry_twoC.h |   79 +++++++++++++++++++++
- src/SConscript              |    1 +
- src/geometry_twoC.cpp       |   90 ++++++++++++++++++++++++
- test/SConscript             |    1 +
- test/geometry_twoC_test.cpp |  163 +++++++++++++++++++++++++++++++++++++++++++
- test/geometry_twoC_test.h   |   45 ++++++++++++
- 7 files changed, 383 insertions(+), 0 deletions(-)
+ TODO                        |   4 ++
+ include/hkl/geometry_twoC.h |  79 +++++++++++++++++++++
+ src/SConscript              |   1 +
+ src/geometry_twoC.cpp       |  90 ++++++++++++++++++++++++
+ test/SConscript             |   1 +
+ test/geometry_twoC_test.cpp | 163 ++++++++++++++++++++++++++++++++++++++++++++
+ test/geometry_twoC_test.h   |  45 ++++++++++++
+ 7 files changed, 383 insertions(+)
 
 commit 3457b83d80db3dbf3fc3054595c971aa5b95d691
 Author: picca <picca at grisette.localdomain>
@@ -14454,8 +24215,8 @@ Date:   Tue May 9 17:47:29 2006 +0200
     * update the TODO list
     * change the name of pseudoAxe::kappa6C::kappa4C::psi in "psi_v"
 
- TODO                      |   16 +++++++++++-----
- src/pseudoaxe_kappa6C.cpp |    2 +-
+ TODO                      | 16 +++++++++++-----
+ src/pseudoaxe_kappa6C.cpp |  2 +-
  2 files changed, 12 insertions(+), 6 deletions(-)
 
 commit a6903bfeba68d9aab12b6acb071a1a0220de034c
@@ -14464,20 +24225,20 @@ Date:   Tue May 9 16:59:50 2006 +0200
 
     * add the pseudoAxe::kappa6C::kappa4C::vertical and their test functions
 
- include/hkl/geometry_eulerian4C.h |    2 +-
- include/hkl/geometry_kappa4C.h    |   13 ++-
- include/hkl/geometry_kappa6C.h    |    7 +
- include/hkl/pseudoaxe_kappa4C.h   |    9 +-
- include/hkl/pseudoaxe_kappa6C.h   |  103 +++++++++++-----
- src/geometry_eulerian4C.cpp       |    4 +-
- src/geometry_kappa4C.cpp          |   40 ++++++-
- src/geometry_kappa6C.cpp          |   12 ++
- src/pseudoaxe_eulerian4C.cpp      |    2 +-
- src/pseudoaxe_kappa6C.cpp         |  256 ++++++++++++++++++++++++++++--------
- test/SConscript                   |    1 +
- test/geometry_kappa6C_test.cpp    |    1 -
- test/pseudoaxe_kappa6C_test.cpp   |  179 ++++++++++++++++++++++++++
- test/pseudoaxe_kappa6C_test.h     |   41 ++++++
+ include/hkl/geometry_eulerian4C.h |   2 +-
+ include/hkl/geometry_kappa4C.h    |  13 +-
+ include/hkl/geometry_kappa6C.h    |   7 ++
+ include/hkl/pseudoaxe_kappa4C.h   |   9 +-
+ include/hkl/pseudoaxe_kappa6C.h   | 103 ++++++++++-----
+ src/geometry_eulerian4C.cpp       |   4 +-
+ src/geometry_kappa4C.cpp          |  40 +++++-
+ src/geometry_kappa6C.cpp          |  12 ++
+ src/pseudoaxe_eulerian4C.cpp      |   2 +-
+ src/pseudoaxe_kappa6C.cpp         | 256 +++++++++++++++++++++++++++++---------
+ test/SConscript                   |   1 +
+ test/geometry_kappa6C_test.cpp    |   1 -
+ test/pseudoaxe_kappa6C_test.cpp   | 179 ++++++++++++++++++++++++++
+ test/pseudoaxe_kappa6C_test.h     |  41 ++++++
  14 files changed, 569 insertions(+), 101 deletions(-)
 
 commit dbbfc43f62ff6c5535b3d0dba0a881f4aeeb7272
@@ -14486,18 +24247,18 @@ Date:   Thu May 4 13:48:53 2006 +0200
 
     * add the pseudoAxe::kappa4C::vertical::Psi and is test function
 
- TODO                              |   22 ++--
- include/hkl/geometry_eulerian4C.h |  139 +++++++++++++++++-------
- include/hkl/geometry_kappa4C.h    |   47 ++++++++-
- include/hkl/pseudoaxe_kappa4C.h   |   68 +++++++++---
- include/hkl/pseudoaxe_kappa6C.h   |    6 +-
- src/geometry_eulerian4C.cpp       |  209 ++++++++++++++++++++++++++-----------
- src/geometry_kappa4C.cpp          |  143 ++++++++++++++++++--------
- src/pseudoaxe_eulerian4C.cpp      |   18 ++--
- src/pseudoaxe_kappa4C.cpp         |   85 ++++++++++++++--
- src/pseudoaxe_kappa6C.cpp         |   27 ++---
- test/pseudoaxe_kappa4C_test.cpp   |  111 +++++++++++++++++---
- test/pseudoaxe_kappa4C_test.h     |    7 +-
+ TODO                              |  22 ++--
+ include/hkl/geometry_eulerian4C.h | 139 +++++++++++++++++--------
+ include/hkl/geometry_kappa4C.h    |  47 ++++++++-
+ include/hkl/pseudoaxe_kappa4C.h   |  68 +++++++++----
+ include/hkl/pseudoaxe_kappa6C.h   |   6 +-
+ src/geometry_eulerian4C.cpp       | 209 ++++++++++++++++++++++++++------------
+ src/geometry_kappa4C.cpp          | 143 ++++++++++++++++++--------
+ src/pseudoaxe_eulerian4C.cpp      |  18 ++--
+ src/pseudoaxe_kappa4C.cpp         |  85 ++++++++++++++--
+ src/pseudoaxe_kappa6C.cpp         |  27 +++--
+ test/pseudoaxe_kappa4C_test.cpp   | 111 +++++++++++++++++---
+ test/pseudoaxe_kappa4C_test.h     |   7 +-
  12 files changed, 653 insertions(+), 229 deletions(-)
 
 commit 452fef17be32c9bd7346a3f9e099decd8a00f56b
@@ -14506,15 +24267,15 @@ Date:   Wed Apr 26 15:20:11 2006 +0200
 
     * now all vertical modes are working on win32 and linux
 
- include/hkl/mode_eulerian4C.h |    2 +-
- include/hkl/mode_kappa4C.h    |   16 ++---
- include/hkl/mode_kappa6C.h    |   56 +++++++++++---
- src/mode_kappa6C.cpp          |   66 ++++++++++++----
- test/SConscript               |    1 +
- test/mode_kappa4C_test.cpp    |  154 +++++++++++++++++++++++++++++++++++
- test/mode_kappa4C_test.h      |   39 +++++++++
- test/mode_kappa6C_test.cpp    |  178 +++++++++++++++++++++++++++++++++++++++++
- test/mode_kappa6C_test.h      |   39 +++++++++
+ include/hkl/mode_eulerian4C.h |   2 +-
+ include/hkl/mode_kappa4C.h    |  16 ++--
+ include/hkl/mode_kappa6C.h    |  56 ++++++++++---
+ src/mode_kappa6C.cpp          |  66 ++++++++++++----
+ test/SConscript               |   1 +
+ test/mode_kappa4C_test.cpp    | 154 ++++++++++++++++++++++++++++++++++++
+ test/mode_kappa4C_test.h      |  39 +++++++++
+ test/mode_kappa6C_test.cpp    | 178 ++++++++++++++++++++++++++++++++++++++++++
+ test/mode_kappa6C_test.h      |  39 +++++++++
  9 files changed, 514 insertions(+), 37 deletions(-)
 
 commit c97c726da8fea13916fc9e0bf7328780ba502824
@@ -14523,8 +24284,8 @@ Date:   Wed Apr 26 13:33:15 2006 +0200
 
     * now mode::kappa4C works properly on windows
 
- include/hkl/mode_kappa4C.h |   44 ++++++++++++++++++-
- src/mode_kappa4C.cpp       |  106 ++++++++++++++++++++++++++++++--------------
+ include/hkl/mode_kappa4C.h |  44 ++++++++++++++++++-
+ src/mode_kappa4C.cpp       | 106 +++++++++++++++++++++++++++++++--------------
  2 files changed, 116 insertions(+), 34 deletions(-)
 
 commit 6445604fb1297a76d8f9b98a27d6a628d7ef5bc3
@@ -14533,10 +24294,10 @@ Date:   Wed Apr 26 10:29:57 2006 +0200
 
     * update the mode::kappa4C before refactoring of the mode du to a bug of VC6
 
- include/hkl/mode_eulerian4C.h |   24 ++++++++++++------------
- include/hkl/mode_kappa4C.h    |   30 +++++++++++++++---------------
- src/mode_kappa4C.cpp          |    3 ++-
- test/SConscript               |    1 +
+ include/hkl/mode_eulerian4C.h | 24 ++++++++++++------------
+ include/hkl/mode_kappa4C.h    | 30 +++++++++++++++---------------
+ src/mode_kappa4C.cpp          |  3 ++-
+ test/SConscript               |  1 +
  4 files changed, 30 insertions(+), 28 deletions(-)
 
 commit 6ca268ec4a66b3bb58dd7ed373a9b8767a6dab2c
@@ -14545,14 +24306,14 @@ Date:   Mon Apr 24 13:32:16 2006 +0200
 
     * add the test functions for the setFromGeometry of the kappa4C::Vertical and Kappa6C classes
 
- include/hkl/geometry_kappa4C.h |    8 +++++-
- include/hkl/geometry_kappa6C.h |    9 ++++++-
- src/geometry_kappa4C.cpp       |   43 ++++++++++++++++++++++------------
- src/geometry_kappa6C.cpp       |   49 +++++++++++++++++++++++++--------------
- test/geometry_kappa4C_test.cpp |   26 +++++++++++++++++++++
- test/geometry_kappa4C_test.h   |    2 +
- test/geometry_kappa6C_test.cpp |   29 +++++++++++++++++++++++
- test/geometry_kappa6C_test.h   |    2 +
+ include/hkl/geometry_kappa4C.h |  8 ++++++-
+ include/hkl/geometry_kappa6C.h |  9 +++++++-
+ src/geometry_kappa4C.cpp       | 43 +++++++++++++++++++++++-------------
+ src/geometry_kappa6C.cpp       | 49 ++++++++++++++++++++++++++----------------
+ test/geometry_kappa4C_test.cpp | 26 ++++++++++++++++++++++
+ test/geometry_kappa4C_test.h   |  2 ++
+ test/geometry_kappa6C_test.cpp | 29 +++++++++++++++++++++++++
+ test/geometry_kappa6C_test.h   |  2 ++
  8 files changed, 133 insertions(+), 35 deletions(-)
 
 commit f10e489f3815a2fde2dfb20700fe4a9484b301c4
@@ -14561,11 +24322,11 @@ Date:   Mon Apr 24 11:46:16 2006 +0200
 
     * add the test functions for geometry::eulerian4C::Vertical::setFromGeometry
 
- TODO                              |    2 +-
- include/hkl/geometry_eulerian4C.h |   11 ++++++++++-
- src/geometry_eulerian4C.cpp       |   36 ++++++++++++++++++++++--------------
- test/geometry_eulerian4C_test.cpp |   37 +++++++++++++++++++++++++++++++++++++
- test/geometry_eulerian4C_test.h   |    2 ++
+ TODO                              |  2 +-
+ include/hkl/geometry_eulerian4C.h | 11 ++++++++++-
+ src/geometry_eulerian4C.cpp       | 36 ++++++++++++++++++++++--------------
+ test/geometry_eulerian4C_test.cpp | 37 +++++++++++++++++++++++++++++++++++++
+ test/geometry_eulerian4C_test.h   |  2 ++
  5 files changed, 72 insertions(+), 16 deletions(-)
 
 commit 40066244225ec7ab1140bdc5ef819d66f2777639
@@ -14574,8 +24335,8 @@ Date:   Thu Apr 20 17:39:12 2006 +0200
 
     * update the TODO list
 
- TODO                      |   20 ++++++++++++++------
- src/pseudoaxe_kappa6C.cpp |    6 +++---
+ TODO                      | 20 ++++++++++++++------
+ src/pseudoaxe_kappa6C.cpp |  6 +++---
  2 files changed, 17 insertions(+), 9 deletions(-)
 
 commit 33b5e3ebc11e03ba3a514e1ba631d92a2977dafe
@@ -14584,12 +24345,12 @@ Date:   Thu Apr 20 16:26:34 2006 +0200
 
     * add the pseudoAxe::kappa6C::kappa4C::Vertical
 
- include/hkl/pseudoaxe_kappa4C.h |    4 +-
- include/hkl/pseudoaxe_kappa6C.h |  120 +++++++++++++++++++++++
- src/SConscript                  |    1 +
- src/diffractometer_kappa4C.cpp  |    6 +-
- src/diffractometer_kappa6C.cpp  |    6 +
- src/pseudoaxe_kappa6C.cpp       |  200 +++++++++++++++++++++++++++++++++++++++
+ include/hkl/pseudoaxe_kappa4C.h |   4 +-
+ include/hkl/pseudoaxe_kappa6C.h | 120 ++++++++++++++++++++++++
+ src/SConscript                  |   1 +
+ src/diffractometer_kappa4C.cpp  |   6 +-
+ src/diffractometer_kappa6C.cpp  |   6 ++
+ src/pseudoaxe_kappa6C.cpp       | 200 ++++++++++++++++++++++++++++++++++++++++
  6 files changed, 332 insertions(+), 5 deletions(-)
 
 commit 77e3988300d8ed4f0124a782e4a434d53e31615e
@@ -14598,18 +24359,18 @@ Date:   Wed Apr 19 17:03:54 2006 +0200
 
     * add the kappa6C modes using the mode::eulerian4C::Vertical
 
- include/hkl/geometry_eulerian4C.h |    7 +-
- include/hkl/geometry_kappa4C.h    |    8 +-
- include/hkl/geometry_kappa6C.h    |    3 +
- include/hkl/mode_eulerian6C.h     |  463 +++++++++++++++++++------------------
- include/hkl/mode_kappa6C.h        |  119 ++++++++++
- src/SConscript                    |    1 +
- src/diffractometer_kappa6C.cpp    |    9 +-
- src/geometry_eulerian4C.cpp       |   24 ++-
- src/geometry_kappa4C.cpp          |    2 +-
- src/geometry_kappa6C.cpp          |   23 ++
- src/mode_kappa4C.cpp              |   20 +-
- src/mode_kappa6C.cpp              |  160 +++++++++++++
+ include/hkl/geometry_eulerian4C.h |   7 +-
+ include/hkl/geometry_kappa4C.h    |   8 +-
+ include/hkl/geometry_kappa6C.h    |   3 +
+ include/hkl/mode_eulerian6C.h     | 463 +++++++++++++++++++-------------------
+ include/hkl/mode_kappa6C.h        | 119 ++++++++++
+ src/SConscript                    |   1 +
+ src/diffractometer_kappa6C.cpp    |   9 +-
+ src/geometry_eulerian4C.cpp       |  24 +-
+ src/geometry_kappa4C.cpp          |   2 +-
+ src/geometry_kappa6C.cpp          |  23 ++
+ src/mode_kappa4C.cpp              |  20 +-
+ src/mode_kappa6C.cpp              | 160 +++++++++++++
  12 files changed, 585 insertions(+), 254 deletions(-)
 
 commit ee4176cf30d082dd0fa18204c33c4eee91121464
@@ -14618,13 +24379,13 @@ Date:   Wed Apr 19 15:05:21 2006 +0200
 
     * add a free method to the MyMap class.
 
- binding/python/diffractometer_eulerian4C_wrap.cpp |   17 +-
- binding/python/diffractometer_kappa4C_wrap.cpp    |   16 +-
- include/hkl/linux/mymap.h                         |  966 +++++++++++----------
- include/hkl/win32/mymap.h                         |  747 ++++++++--------
- src/diffractometer_eulerian4C.cpp                 |   17 +-
- src/diffractometer_kappa4C.cpp                    |   16 +-
- src/diffractometer_kappa6C.cpp                    |   10 +-
+ binding/python/diffractometer_eulerian4C_wrap.cpp |  17 +-
+ binding/python/diffractometer_kappa4C_wrap.cpp    |  16 +-
+ include/hkl/linux/mymap.h                         | 966 +++++++++++-----------
+ include/hkl/win32/mymap.h                         | 747 +++++++++--------
+ src/diffractometer_eulerian4C.cpp                 |  17 +-
+ src/diffractometer_kappa4C.cpp                    |  16 +-
+ src/diffractometer_kappa6C.cpp                    |  10 +-
  7 files changed, 890 insertions(+), 899 deletions(-)
 
 commit 189f3e1636869714943c893fef306e7657d64ff5
@@ -14633,9 +24394,9 @@ Date:   Wed Apr 19 12:45:56 2006 +0200
 
     * small modifications to make it compile with MSVC6
 
- bksys/win32/detect_generic.py |    2 +-
- src/mode_kappa4C.cpp          |   11 ++++++-----
- src/pseudoaxe_eulerian4C.cpp  |    6 +++---
+ bksys/win32/detect_generic.py |  2 +-
+ src/mode_kappa4C.cpp          | 11 ++++++-----
+ src/pseudoaxe_eulerian4C.cpp  |  6 +++---
  3 files changed, 10 insertions(+), 9 deletions(-)
 
 commit 034cea905926d8ad7910b96484c1c3c87ac0f272
@@ -14644,39 +24405,39 @@ Date:   Wed Apr 19 11:52:22 2006 +0200
 
     * modification to separate vertical and horizontal diffractometers
 
- binding/python/diffractometer_eulerian4C_wrap.cpp |   14 +-
- binding/python/diffractometer_kappa4C_wrap.cpp    |   18 +-
- doc/example/psi.cpp                               |    4 +-
- include/hkl/diffractometer_kappa4C.h              |    6 +-
- include/hkl/geometry_eulerian4C.h                 |   21 +-
- include/hkl/geometry_kappa4C.h                    |   71 ++--
- include/hkl/mode_eulerian4C.h                     |  244 +++++-----
- include/hkl/mode_kappa4C.h                        |  123 +++---
- include/hkl/pseudoaxe_eulerian4C.h                |  249 +++++-----
- include/hkl/pseudoaxe_kappa4C.h                   |  141 +++---
- src/diffractometer_eulerian4C.cpp                 |   14 +-
- src/diffractometer_kappa4C.cpp                    |   24 +-
- src/geometry_eulerian4C.cpp                       |   12 +-
- src/geometry_kappa4C.cpp                          |   10 +-
- src/mode_eulerian4C.cpp                           |  558 +++++++++++----------
- src/mode_kappa4C.cpp                              |  240 +++++-----
- src/pseudoaxe_eulerian4C.cpp                      |  288 ++++++------
- src/pseudoaxe_kappa4C.cpp                         |  350 +++++++-------
- test/affinement_simplex_test.h                    |    2 +-
- test/crystal_test.h                               |    2 +-
- test/diffractometer_kappa4C_test.cpp              |    4 +-
- test/diffractometer_kappa4C_test.h                |    4 +-
- test/geometry_eulerian4C_test.cpp                 |   28 +-
- test/geometry_eulerian4C_test.h                   |    2 +-
- test/geometry_kappa4C_test.cpp                    |   36 +-
- test/geometry_kappa4C_test.h                      |    2 +-
- test/mode_eulerian4C_test.cpp                     |   14 +-
- test/mode_eulerian4C_test.h                       |    6 +-
- test/pseudoaxe_eulerian4C_test.cpp                |   40 +-
- test/pseudoaxe_eulerian4C_test.h                  |    6 +-
- test/pseudoaxe_kappa4C_test.cpp                   |   12 +-
- test/pseudoaxe_kappa4C_test.h                     |    2 +-
- test/reflection_test.h                            |    2 +-
+ binding/python/diffractometer_eulerian4C_wrap.cpp |  14 +-
+ binding/python/diffractometer_kappa4C_wrap.cpp    |  18 +-
+ doc/example/psi.cpp                               |   4 +-
+ include/hkl/diffractometer_kappa4C.h              |   6 +-
+ include/hkl/geometry_eulerian4C.h                 |  21 +-
+ include/hkl/geometry_kappa4C.h                    |  71 +--
+ include/hkl/mode_eulerian4C.h                     | 244 +++++-----
+ include/hkl/mode_kappa4C.h                        | 123 ++---
+ include/hkl/pseudoaxe_eulerian4C.h                | 249 +++++-----
+ include/hkl/pseudoaxe_kappa4C.h                   | 141 +++---
+ src/diffractometer_eulerian4C.cpp                 |  14 +-
+ src/diffractometer_kappa4C.cpp                    |  24 +-
+ src/geometry_eulerian4C.cpp                       |  12 +-
+ src/geometry_kappa4C.cpp                          |  10 +-
+ src/mode_eulerian4C.cpp                           | 558 +++++++++++-----------
+ src/mode_kappa4C.cpp                              | 240 +++++-----
+ src/pseudoaxe_eulerian4C.cpp                      | 288 +++++------
+ src/pseudoaxe_kappa4C.cpp                         | 350 +++++++-------
+ test/affinement_simplex_test.h                    |   2 +-
+ test/crystal_test.h                               |   2 +-
+ test/diffractometer_kappa4C_test.cpp              |   4 +-
+ test/diffractometer_kappa4C_test.h                |   4 +-
+ test/geometry_eulerian4C_test.cpp                 |  28 +-
+ test/geometry_eulerian4C_test.h                   |   2 +-
+ test/geometry_kappa4C_test.cpp                    |  36 +-
+ test/geometry_kappa4C_test.h                      |   2 +-
+ test/mode_eulerian4C_test.cpp                     |  14 +-
+ test/mode_eulerian4C_test.h                       |   6 +-
+ test/pseudoaxe_eulerian4C_test.cpp                |  40 +-
+ test/pseudoaxe_eulerian4C_test.h                  |   6 +-
+ test/pseudoaxe_kappa4C_test.cpp                   |  12 +-
+ test/pseudoaxe_kappa4C_test.h                     |   2 +-
+ test/reflection_test.h                            |   2 +-
  33 files changed, 1290 insertions(+), 1259 deletions(-)
 
 commit 10ed094e41256eee225f1afea84d9835407b200b
@@ -14685,9 +24446,9 @@ Date:   Tue Apr 18 13:24:10 2006 +0200
 
     * remove unnecessary members of the Kappa4C pseudoAxe.
 
- include/hkl/pseudoaxe_kappa4C.h |    4 ----
- src/pseudoaxe_kappa4C.cpp       |    4 ----
- test/pseudoaxe_kappa4C_test.cpp |    3 ++-
+ include/hkl/pseudoaxe_kappa4C.h | 4 ----
+ src/pseudoaxe_kappa4C.cpp       | 4 ----
+ test/pseudoaxe_kappa4C_test.cpp | 3 ++-
  3 files changed, 2 insertions(+), 9 deletions(-)
 
 commit d5dc5995bb5f13dc59d8bda16525d3133a4a3ad1
@@ -14696,18 +24457,18 @@ Date:   Wed Apr 12 14:52:11 2006 +0200
 
     * now kappa4C is ready with all eulerian4C modes implemented.
 
- SConstruct                                     |    1 +
- TODO                                           |   15 ++-
- binding/python/diffractometer2.py              |    2 +-
- binding/python/diffractometer_kappa4C_wrap.cpp |    7 +-
- include/hkl/geometry_eulerian4C.h              |   61 ++++++-----
- include/hkl/geometry_kappa4C.h                 |    5 +
- include/hkl/mode_kappa4C.h                     |  133 ++++++++++++++--------
- src/SConscript                                 |    1 +
- src/diffractometer_kappa4C.cpp                 |    7 +-
- src/geometry_eulerian4C.cpp                    |   80 ++++++++-----
- src/geometry_kappa4C.cpp                       |   21 ++++
- src/mode_kappa4C.cpp                           |  145 ++++++++++++++++++++++++
+ SConstruct                                     |   1 +
+ TODO                                           |  15 ++-
+ binding/python/diffractometer2.py              |   2 +-
+ binding/python/diffractometer_kappa4C_wrap.cpp |   7 +-
+ include/hkl/geometry_eulerian4C.h              |  61 ++++++-----
+ include/hkl/geometry_kappa4C.h                 |   5 +
+ include/hkl/mode_kappa4C.h                     | 133 ++++++++++++++---------
+ src/SConscript                                 |   1 +
+ src/diffractometer_kappa4C.cpp                 |   7 +-
+ src/geometry_eulerian4C.cpp                    |  80 +++++++++-----
+ src/geometry_kappa4C.cpp                       |  21 ++++
+ src/mode_kappa4C.cpp                           | 145 +++++++++++++++++++++++++
  12 files changed, 363 insertions(+), 115 deletions(-)
 
 commit 54d87dcd37066cb290f3b1802e4aa4fbb81a21fd
@@ -14716,13 +24477,13 @@ Date:   Mon Apr 10 10:58:42 2006 +0200
 
     * add the Eulerian pseudoAxes and their test fonctions for the kappa4C geometry.
 
- binding/python/diffractometer_kappa4C_wrap.cpp |    6 +-
- include/hkl/pseudoaxe.h                        |    2 +-
- include/hkl/pseudoaxe_eulerian4C.h             |    4 +-
- include/hkl/pseudoaxe_kappa4C.h                |    8 +-
- src/pseudoaxe_eulerian4C.cpp                   |    2 +-
- src/pseudoaxe_kappa4C.cpp                      |  101 ++++++++++++++----------
- test/pseudoaxe_kappa4C_test.cpp                |   84 +------------------
+ binding/python/diffractometer_kappa4C_wrap.cpp |   6 +-
+ include/hkl/pseudoaxe.h                        |   2 +-
+ include/hkl/pseudoaxe_eulerian4C.h             |   4 +-
+ include/hkl/pseudoaxe_kappa4C.h                |   8 +-
+ src/pseudoaxe_eulerian4C.cpp                   |   2 +-
+ src/pseudoaxe_kappa4C.cpp                      | 101 ++++++++++++++-----------
+ test/pseudoaxe_kappa4C_test.cpp                |  84 ++------------------
  7 files changed, 74 insertions(+), 133 deletions(-)
 
 commit 55879b90df4a5a416be1ba7abd9c27901bc472ca
@@ -14731,23 +24492,23 @@ Date:   Thu Apr 6 16:14:06 2006 +0200
 
     * start the pseudoaxe refactoring
 
- binding/python/diffractometer2.py                 |   12 +-
- binding/python/diffractometer_eulerian4C_wrap.cpp |    3 +-
- binding/python/diffractometer_eulerian4C_wrap.h   |    1 -
- binding/python/diffractometer_kappa4C_wrap.cpp    |   52 ++++
- binding/python/diffractometer_kappa4C_wrap.h      |   18 ++
- binding/python/diffractometer_kappa_wrap.cpp      |    9 +
- binding/python/diffractometer_kappa_wrap.h        |   18 ++
- binding/python/diffractometer_wrap.cpp            |  309 +++++++++++++++++++++
- binding/python/diffractometer_wrap.h              |   91 ++++++
- include/hkl/diffractometer_eulerian4C.h           |    3 -
- include/hkl/pseudoaxe_kappa4C.h                   |  118 ++++++++
- src/diffractometer_eulerian4C.cpp                 |    3 +
- src/diffractometer_kappa4C.cpp                    |   16 +
- src/pseudoaxe_kappa4C.cpp                         |  209 ++++++++++++++
- test/SConscript                                   |    1 +
- test/pseudoaxe_kappa4C_test.cpp                   |  162 +++++++++++
- test/pseudoaxe_kappa4C_test.h                     |   37 +++
+ binding/python/diffractometer2.py                 |  12 +-
+ binding/python/diffractometer_eulerian4C_wrap.cpp |   3 +-
+ binding/python/diffractometer_eulerian4C_wrap.h   |   1 -
+ binding/python/diffractometer_kappa4C_wrap.cpp    |  52 ++++
+ binding/python/diffractometer_kappa4C_wrap.h      |  18 ++
+ binding/python/diffractometer_kappa_wrap.cpp      |   9 +
+ binding/python/diffractometer_kappa_wrap.h        |  18 ++
+ binding/python/diffractometer_wrap.cpp            | 309 ++++++++++++++++++++++
+ binding/python/diffractometer_wrap.h              |  91 +++++++
+ include/hkl/diffractometer_eulerian4C.h           |   3 -
+ include/hkl/pseudoaxe_kappa4C.h                   | 118 +++++++++
+ src/diffractometer_eulerian4C.cpp                 |   3 +
+ src/diffractometer_kappa4C.cpp                    |  16 ++
+ src/pseudoaxe_kappa4C.cpp                         | 209 +++++++++++++++
+ test/SConscript                                   |   1 +
+ test/pseudoaxe_kappa4C_test.cpp                   | 162 ++++++++++++
+ test/pseudoaxe_kappa4C_test.h                     |  37 +++
  17 files changed, 1051 insertions(+), 11 deletions(-)
 
 commit e7766c9de99e8684dfdc3d5b730a1db3f4ed3b99
@@ -14756,20 +24517,20 @@ Date:   Wed Apr 5 17:19:21 2006 +0200
 
     * add the kappa4C pseudoAxes
 
- binding/python/SConscript                         |    3 +
- binding/python/diffractometer.gazpacho            |   50 ++--
- binding/python/diffractometer2.py                 |   74 +++--
- binding/python/diffractometer_eulerian4C_wrap.cpp |  356 +++------------------
- binding/python/diffractometer_eulerian4C_wrap.h   |   78 +-----
- binding/python/hkl_wrap.cpp                       |  109 ++++---
- include/hkl/diffractometer.h                      |   10 +-
- include/hkl/diffractometer_kappa4C.h              |   92 ++++++
- include/hkl/mode.h                                |  244 ++-------------
- src/SConscript                                    |    1 +
- src/diffractometer_kappa4C.cpp                    |   12 +
- src/diffractometer_kappa6C.cpp                    |   12 +
- src/mode.cpp                                      |   16 +
- src/mode_eulerian4C.cpp                           |  203 ------------
+ binding/python/SConscript                         |   3 +
+ binding/python/diffractometer.gazpacho            |  50 +--
+ binding/python/diffractometer2.py                 |  74 ++---
+ binding/python/diffractometer_eulerian4C_wrap.cpp | 356 +++-------------------
+ binding/python/diffractometer_eulerian4C_wrap.h   |  78 +----
+ binding/python/hkl_wrap.cpp                       | 109 ++++---
+ include/hkl/diffractometer.h                      |  10 +-
+ include/hkl/diffractometer_kappa4C.h              |  92 ++++++
+ include/hkl/mode.h                                | 244 ++-------------
+ src/SConscript                                    |   1 +
+ src/diffractometer_kappa4C.cpp                    |  12 +
+ src/diffractometer_kappa6C.cpp                    |  12 +
+ src/mode.cpp                                      |  16 +
+ src/mode_eulerian4C.cpp                           | 203 ------------
  14 files changed, 338 insertions(+), 922 deletions(-)
 
 commit 4988b2292a9eb0420c85846c927b085d05b040d9
@@ -14778,9 +24539,9 @@ Date:   Wed Mar 29 09:05:39 2006 +0200
 
     * add forgotten files
 
- include/hkl/diffractometer_kappa.h   |   42 ++++++++++++++++++++++++++++++++++
- include/hkl/diffractometer_kappa6C.h |   39 +++++++++++++++++++++++++++++++
- 2 files changed, 81 insertions(+), 0 deletions(-)
+ include/hkl/diffractometer_kappa.h   | 42 ++++++++++++++++++++++++++++++++++++
+ include/hkl/diffractometer_kappa6C.h | 39 +++++++++++++++++++++++++++++++++
+ 2 files changed, 81 insertions(+)
 
 commit e07c6ce897716a702fd52994d95a540067e4c3f8
 Author: picca <picca at grisette.localdomain>
@@ -14791,7 +24552,7 @@ Date:   Mon Mar 27 18:28:55 2006 +0200
  include/hkl/diffractometer.h         | 1590 ++++++++++++++--------------------
  include/hkl/diffractometer_kappa4C.h |   64 +-
  src/SConscript                       |    3 +
- src/diffractometer.cpp               |  359 +--------
+ src/diffractometer.cpp               |  359 +-------
  src/diffractometer_eulerian6C.cpp    |   76 +-
  src/diffractometer_kappa.cpp         |   16 +
  src/diffractometer_kappa4C.cpp       |   27 +-
@@ -14809,15 +24570,15 @@ Date:   Mon Mar 27 15:26:27 2006 +0200
 
     * add the geometry Eulerian 4C and 6C test functions
 
- include/hkl/geometry_eulerian6C.h |   12 +++
- src/geometry_eulerian6C.cpp       |   13 +++-
- test/SConscript                   |    2 +
- test/geometry_eulerian4C_test.cpp |  120 ++++++++++++++++++++++++
- test/geometry_eulerian4C_test.h   |   43 +++++++++
- test/geometry_eulerian6C_test.cpp |  137 ++++++++++++++++++++++++++++
- test/geometry_eulerian6C_test.h   |   43 +++++++++
- test/geometry_test.cpp            |  181 +++++++++----------------------------
- test/geometry_test.h              |   59 ++++--------
+ include/hkl/geometry_eulerian6C.h |  12 +++
+ src/geometry_eulerian6C.cpp       |  13 ++-
+ test/SConscript                   |   2 +
+ test/geometry_eulerian4C_test.cpp | 120 +++++++++++++++++++++++++
+ test/geometry_eulerian4C_test.h   |  43 +++++++++
+ test/geometry_eulerian6C_test.cpp | 137 +++++++++++++++++++++++++++++
+ test/geometry_eulerian6C_test.h   |  43 +++++++++
+ test/geometry_test.cpp            | 181 ++++++++++----------------------------
+ test/geometry_test.h              |  59 +++++--------
  9 files changed, 434 insertions(+), 176 deletions(-)
 
 commit 67443e81bab02d2d92c8d432d6f5d7486e650a9b
@@ -14826,12 +24587,12 @@ Date:   Mon Mar 27 14:35:05 2006 +0200
 
     * add the geometry kappa 4c and 6C test functions.
 
- src/geometry_kappa6C.cpp       |    4 +-
- test/SConscript                |    2 +
- test/geometry_kappa4C_test.cpp |  142 +++++++++++++++++++++++++++++++++++++
- test/geometry_kappa4C_test.h   |   44 ++++++++++++
- test/geometry_kappa6C_test.cpp |  150 ++++++++++++++++++++++++++++++++++++++++
- test/geometry_kappa6C_test.h   |   42 +++++++++++
+ src/geometry_kappa6C.cpp       |   4 +-
+ test/SConscript                |   2 +
+ test/geometry_kappa4C_test.cpp | 142 ++++++++++++++++++++++++++++++++++++++
+ test/geometry_kappa4C_test.h   |  44 ++++++++++++
+ test/geometry_kappa6C_test.cpp | 150 +++++++++++++++++++++++++++++++++++++++++
+ test/geometry_kappa6C_test.h   |  42 ++++++++++++
  6 files changed, 382 insertions(+), 2 deletions(-)
 
 commit b9b1d24672a0a615dc232b179e06010052b78067
@@ -14840,14 +24601,14 @@ Date:   Thu Mar 23 18:09:08 2006 +0100
 
     * add the kappa geometry for the kappa4C and kappa6C
 
- include/hkl/geometry.h         |   78 ++++++++++++++++++++--------------------
- include/hkl/geometry_kappa.h   |   60 ++++++++++++++++++++++++++++++
- include/hkl/geometry_kappa4C.h |   45 ++++++++++++++---------
- include/hkl/geometry_kappa6C.h |   45 +++++++++++++++++++++++
- src/SConscript                 |    3 ++
- src/geometry_kappa.cpp         |   40 ++++++++++++++++++++
- src/geometry_kappa4C.cpp       |   32 +++++++++++------
- src/geometry_kappa6C.cpp       |   38 +++++++++++++++++++
+ include/hkl/geometry.h         | 78 +++++++++++++++++++++---------------------
+ include/hkl/geometry_kappa.h   | 60 ++++++++++++++++++++++++++++++++
+ include/hkl/geometry_kappa4C.h | 45 +++++++++++++++---------
+ include/hkl/geometry_kappa6C.h | 45 ++++++++++++++++++++++++
+ src/SConscript                 |  3 ++
+ src/geometry_kappa.cpp         | 40 ++++++++++++++++++++++
+ src/geometry_kappa4C.cpp       | 32 +++++++++++------
+ src/geometry_kappa6C.cpp       | 38 ++++++++++++++++++++
  8 files changed, 274 insertions(+), 67 deletions(-)
 
 commit f971a98d6e1a88dbaeef3c3abdbe2f496e1f43a6
@@ -14856,9 +24617,9 @@ Date:   Wed Mar 22 17:43:38 2006 +0100
 
     * update the TODO list and the Makefile.vc
 
- TODO                   |    2 +-
- src/Makefile.vc        |   55 +++++++++++++++++++++++++----------------------
- src/diffractometer.cpp |   12 +++++-----
+ TODO                   |  2 +-
+ src/Makefile.vc        | 55 ++++++++++++++++++++++++++------------------------
+ src/diffractometer.cpp | 12 +++++------
  3 files changed, 36 insertions(+), 33 deletions(-)
 
 commit 5f049a439adc84a98879e62715d8da778868747f
@@ -14867,9 +24628,9 @@ Date:   Thu Mar 2 17:59:39 2006 +0100
 
     * clean the bksys files
 
- bksys/bksys.py                |    1 -
- bksys/cppunit.py              |    3 +--
- bksys/win32/detect_cppunit.py |    3 +--
+ bksys/bksys.py                | 1 -
+ bksys/cppunit.py              | 3 +--
+ bksys/win32/detect_cppunit.py | 3 +--
  3 files changed, 2 insertions(+), 5 deletions(-)
 
 commit f855c54d964f184eaf351b86e71faef88cccc941
@@ -14878,8 +24639,8 @@ Date:   Thu Mar 2 14:02:46 2006 +0100
 
     * add the detect_bksys.py file for win32
 
- bksys/win32/detect_bksys.py |   36 ++++++++++++++++++++++++++++++++++++
- 1 files changed, 36 insertions(+), 0 deletions(-)
+ bksys/win32/detect_bksys.py | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
 
 commit 3207b706e76238886ff35b937548c53c124395a7
 Author: picca <picca at grisette.localdomain>
@@ -14887,23 +24648,23 @@ Date:   Thu Mar 2 13:58:28 2006 +0100
 
     * update to compile with MSVC6
 
- SConstruct                         |   12 +-
- bksys/__init__.py                  |  190 +++++++++++-----------
- bksys/bksys.py                     |  302 ++++++++++++++++++------------------
- bksys/win32/detect_cppunit.py      |   15 +-
- bksys/win32/detect_generic.py      |    2 +-
- include/hkl/affinement.h           |   11 +-
- include/hkl/config.h               |    2 +-
- include/hkl/mode.h                 |    2 +-
- include/hkl/mymap.h                |    2 +-
- include/hkl/myvector.h             |    2 +-
- include/hkl/pseudoaxe.h            |    2 +-
- include/hkl/win32/mymap.h          |    2 -
- src/affinement.cpp                 |   82 +++++-----
- src/affinement_simplex.cpp         |   15 ++-
- src/convenience.cpp                |    6 +
- src/mode.cpp                       |    6 +-
- test/pseudoaxe_eulerian4C_test.cpp |    5 +-
+ SConstruct                         |  12 +-
+ bksys/__init__.py                  | 190 +++++++++++------------
+ bksys/bksys.py                     | 302 +++++++++++++++++++------------------
+ bksys/win32/detect_cppunit.py      |  15 +-
+ bksys/win32/detect_generic.py      |   2 +-
+ include/hkl/affinement.h           |  11 +-
+ include/hkl/config.h               |   2 +-
+ include/hkl/mode.h                 |   2 +-
+ include/hkl/mymap.h                |   2 +-
+ include/hkl/myvector.h             |   2 +-
+ include/hkl/pseudoaxe.h            |   2 +-
+ include/hkl/win32/mymap.h          |   2 -
+ src/affinement.cpp                 |  82 +++++-----
+ src/affinement_simplex.cpp         |  15 +-
+ src/convenience.cpp                |   6 +
+ src/mode.cpp                       |   6 +-
+ test/pseudoaxe_eulerian4C_test.cpp |   5 +-
  17 files changed, 331 insertions(+), 327 deletions(-)
 
 commit af8a0bccc926937655e516c176447f50e608fb1c
@@ -14913,8 +24674,8 @@ Date:   Tue Feb 28 17:42:18 2006 +0100
     * modification of the uml diagramm
 
  SConstruct      |   14 +-
- doc/uml/hkl.dia | 1685 +++++++++++++++++++++++++++++++++++++++++++++++--------
- 2 files changed, 1467 insertions(+), 232 deletions(-)
+ doc/uml/hkl.dia | 1835 ++++++++++++++++++++++++++++++++++++++++++++++---------
+ 2 files changed, 1542 insertions(+), 307 deletions(-)
 
 commit e389307513cfc9937b0b1ac4fc0aaf8e1ac54a54
 Author: picca <picca at grisette.localdomain>
@@ -14922,8 +24683,8 @@ Date:   Fri Feb 24 17:25:10 2006 +0100
 
     * update the documentation of quaternion.h
 
- include/hkl/quaternion.h |  287 +++++++++++++++++++++++-----------------------
- 1 files changed, 143 insertions(+), 144 deletions(-)
+ include/hkl/quaternion.h | 287 +++++++++++++++++++++++------------------------
+ 1 file changed, 143 insertions(+), 144 deletions(-)
 
 commit c8fe7b59f732189d362c88200fe68f1dc24b15df
 Author: picca <picca at grisette.localdomain>
@@ -14932,14 +24693,14 @@ Date:   Fri Feb 24 12:13:53 2006 +0100
     * add the psi pseudomotor of the Eulerian4C diffractometer.
 
  TODO                                              |    5 +-
- binding/python/diffractometer.gazpacho            |  142 ++--
+ binding/python/diffractometer.gazpacho            |  142 +--
  binding/python/diffractometer.py                  | 1097 +++++++++++----------
- binding/python/diffractometer2.py                 |  383 +++++---
- binding/python/diffractometer_eulerian4C_wrap.cpp |  284 ++++--
+ binding/python/diffractometer2.py                 |  383 ++++---
+ binding/python/diffractometer_eulerian4C_wrap.cpp |  284 +++---
  binding/python/diffractometer_eulerian4C_wrap.h   |   17 +-
  binding/python/hkl_wrap.cpp                       |   12 +-
  doc/example/psi.cpp                               |    2 +-
- include/hkl/diffractometer.h                      |  218 +++--
+ include/hkl/diffractometer.h                      |  218 ++--
  include/hkl/geometry.h                            |    2 +-
  include/hkl/pseudoaxe.h                           |   29 +-
  include/hkl/pseudoaxe_eulerian4C.h                |    8 +-
@@ -14948,7 +24709,7 @@ Date:   Fri Feb 24 12:13:53 2006 +0100
  src/geometry.cpp                                  |  550 ++++++-----
  src/pseudoaxe.cpp                                 |    1 -
  src/pseudoaxe_eulerian4C.cpp                      |   32 +-
- src/quaternion.cpp                                |  361 ++++----
+ src/quaternion.cpp                                |  361 +++----
  src/svector.cpp                                   |  426 ++++----
  test/geometry_test.cpp                            |   22 +-
  test/pseudoaxe_eulerian4C_test.cpp                |   44 +-
@@ -14965,10 +24726,11 @@ Date:   Fri Feb 10 15:54:52 2006 +0100
     * move the _atan2 and _asin in the hkl::convenience namespace
       and rename them atan2 and asin
 
+ doc/hkl.lyx                        |    0
  include/hkl/convenience.h          |   35 +
  include/hkl/mode.h                 |   20 +-
  include/hkl/pseudoaxe.h            |   45 +-
- include/hkl/pseudoaxe_eulerian4C.h |  192 +++---
+ include/hkl/pseudoaxe_eulerian4C.h |  192 ++---
  include/hkl/quaternion.h           |    4 +-
  src/SConscript                     |    1 +
  src/convenience.cpp                |   49 ++
@@ -14978,10 +24740,10 @@ Date:   Fri Feb 10 15:54:52 2006 +0100
  src/mode_eulerian4C.cpp            |  568 +++++++-------
  src/pseudoaxe.cpp                  |   13 +-
  src/pseudoaxe_eulerian4C.cpp       |  314 ++++----
- src/quaternion.cpp                 |   71 ++-
+ src/quaternion.cpp                 |   71 +-
  test/pseudoaxe_eulerian4C_test.cpp |  129 ++--
  test/pseudoaxe_eulerian4C_test.h   |    9 +-
- 16 files changed, 2096 insertions(+), 1985 deletions(-)
+ 17 files changed, 2096 insertions(+), 1985 deletions(-)
 
 commit 62aa233b89e81ab33c46fe63da40434b13789258
 Author: picca <picca at grisette.localdomain>
@@ -14989,21 +24751,21 @@ Date:   Thu Feb 9 10:41:42 2006 +0100
 
     * now the pseudoAxe::Psi::set_value is working
 
- bksys/linux2/detect_generic.py     |    2 +-
- doc/example/plot.gnuplot           |   48 ++++++++
- doc/example/psi.cpp                |    8 +-
- include/hkl/axe.h                  |  162 ++++++++++++++-----------
- include/hkl/geometry.h             |   10 ++-
- include/hkl/geometry_eulerian4C.h  |   11 ++
- include/hkl/pseudoaxe_eulerian4C.h |   15 +--
- src/axe.cpp                        |   40 +++++--
- src/geometry.cpp                   |   17 +++
- src/geometry_eulerian4C.cpp        |   10 ++
- src/pseudoaxe_eulerian4C.cpp       |  234 ++++++++++++++++++------------------
- test/axe_test.cpp                  |   56 +++++++--
- test/axe_test.h                    |   24 ++--
- test/geometry_test.cpp             |   39 ++++++
- test/geometry_test.h               |    4 +
+ bksys/linux2/detect_generic.py     |   2 +-
+ doc/example/plot.gnuplot           |  48 ++++++++
+ doc/example/psi.cpp                |   8 +-
+ include/hkl/axe.h                  | 162 ++++++++++++++-----------
+ include/hkl/geometry.h             |  10 +-
+ include/hkl/geometry_eulerian4C.h  |  11 ++
+ include/hkl/pseudoaxe_eulerian4C.h |  15 ++-
+ src/axe.cpp                        |  40 +++++--
+ src/geometry.cpp                   |  17 +++
+ src/geometry_eulerian4C.cpp        |  10 ++
+ src/pseudoaxe_eulerian4C.cpp       | 234 ++++++++++++++++++-------------------
+ test/axe_test.cpp                  |  56 +++++++--
+ test/axe_test.h                    |  24 ++--
+ test/geometry_test.cpp             |  39 +++++++
+ test/geometry_test.h               |   4 +
  15 files changed, 444 insertions(+), 236 deletions(-)
 
 commit 632172d34923318c0c1345cbf515e85f7b9d6345
@@ -15012,15 +24774,15 @@ Date:   Fri Feb 3 16:42:55 2006 +0100
 
     * update comments and add the second solution to the psi pseudoAxe
 
- doc/Doxyfile                       |    6 ++--
- doc/example/plot.gnuplot           |   40 ++++++++++++++++++-----
- include/hkl/diffractometer.h       |    4 +-
- include/hkl/fitparameterlist.h     |   26 ++++++++--------
- include/hkl/geometry.h             |    7 ++--
- include/hkl/linux/mymap.h          |    4 +-
- include/hkl/pseudoaxe_eulerian4C.h |    9 +++--
- include/hkl/range.h                |   61 +++++++++++++++++++----------------
- src/pseudoaxe_eulerian4C.cpp       |   36 +++++++++++++--------
+ doc/Doxyfile                       |  6 ++--
+ doc/example/plot.gnuplot           | 40 +++++++++++++++++++------
+ include/hkl/diffractometer.h       |  4 +--
+ include/hkl/fitparameterlist.h     | 26 ++++++++--------
+ include/hkl/geometry.h             |  7 +++--
+ include/hkl/linux/mymap.h          |  4 +--
+ include/hkl/pseudoaxe_eulerian4C.h |  9 +++---
+ include/hkl/range.h                | 61 +++++++++++++++++++++-----------------
+ src/pseudoaxe_eulerian4C.cpp       | 36 ++++++++++++++--------
  9 files changed, 116 insertions(+), 77 deletions(-)
 
 commit fc9a5dd35f73c5b4364b2e9d82322b47e3b09361
@@ -15035,11 +24797,11 @@ Date:   Thu Feb 2 18:14:08 2006 +0100
     	new file: doc/example/psi.cpp
     	modified: include/hkl/diffractometer.h
 
- SConstruct                   |    2 +-
- doc/example/SConscript       |   15 +
- doc/example/plot.gnuplot     |   15 +
- doc/example/psi.cpp          |   50 +++
- include/hkl/diffractometer.h |  854 +++++++++++++++++++++---------------------
+ SConstruct                   |   2 +-
+ doc/example/SConscript       |  15 +
+ doc/example/plot.gnuplot     |  15 +
+ doc/example/psi.cpp          |  50 +++
+ include/hkl/diffractometer.h | 854 +++++++++++++++++++++----------------------
  5 files changed, 508 insertions(+), 428 deletions(-)
 
 commit 3ee6413b092193e97ace00790608b60ed45cca50
@@ -15048,8 +24810,8 @@ Date:   Thu Feb 2 14:30:23 2006 +0100
 
     * modified: bksys/linux2/detect_cppunit.py to fill CXXFLAGS only if needed
 
- bksys/linux2/detect_cppunit.py |   14 +++++++++-----
- 1 files changed, 9 insertions(+), 5 deletions(-)
+ bksys/linux2/detect_cppunit.py | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
 
 commit a221387369dfe8df34030e213d19708b3a7844c3
 Merge: ef99b4b db5768a
@@ -15065,9 +24827,9 @@ Date:   Thu Feb 2 09:48:32 2006 +0000
     * bksys modification to compile only the python binding on linux
     * modification of the diffractometer_Euerlai4C_test to compile with MSVC6
 
- SConstruct                              |   16 ++++++++++++----
- bksys/cppunit.py                        |    6 ++++--
- test/diffractometer_eulerian4C_test.cpp |   30 +++++++++++++++---------------
+ SConstruct                              | 16 ++++++++++++----
+ bksys/cppunit.py                        |  6 ++++--
+ test/diffractometer_eulerian4C_test.cpp | 30 +++++++++++++++---------------
  3 files changed, 31 insertions(+), 21 deletions(-)
 
 commit ef99b4b00c1f3569d33854cf299f2360db8cd5d5
@@ -15076,9 +24838,9 @@ Date:   Wed Feb 1 16:20:21 2006 +0100
 
     * add the clean target to the project.
 
- bksys/bksys.py   |    5 +++++
- bksys/generic.py |    7 +++++++
- 2 files changed, 12 insertions(+), 0 deletions(-)
+ bksys/bksys.py   | 5 +++++
+ bksys/generic.py | 7 +++++++
+ 2 files changed, 12 insertions(+)
 
 commit 5f096ba6ecf0ac3eed7328ddc03da66295f8c723
 Author: picca <picca>
@@ -15086,8 +24848,8 @@ Date:   Wed Feb 1 14:42:17 2006 +0000
 
     * add the affinement dialog to the gtk frontend
 
- binding/python/diffractometer.gazpacho |  842 ++++++++++++++++++++++++++++++--
- binding/python/diffractometer2.py      |   58 +--
+ binding/python/diffractometer.gazpacho | 842 +++++++++++++++++++++++++++++++--
+ binding/python/diffractometer2.py      |  58 +--
  2 files changed, 825 insertions(+), 75 deletions(-)
 
 commit b05984f40c9adb35fbb83667e0f1a06e3926704d
@@ -15096,8 +24858,8 @@ Date:   Wed Feb 1 14:42:08 2006 +0000
 
     * add the new crystal dialog to the frontend
 
- binding/python/diffractometer.gazpacho |  541 +++++++++++++++++++-------------
- binding/python/diffractometer2.py      |    5 +-
+ binding/python/diffractometer.gazpacho | 541 +++++++++++++++++++--------------
+ binding/python/diffractometer2.py      |   5 +-
  2 files changed, 318 insertions(+), 228 deletions(-)
 
 commit 9f690807cedd350093d6e469fc9e70648563337b
@@ -15106,11 +24868,11 @@ Date:   Wed Feb 1 14:41:59 2006 +0000
 
     * update the gtk frontend to works with gazpacho
 
- binding/python/diffractometer.gazpacho            | 1307 ++++-----------------
+ binding/python/diffractometer.gazpacho            | 1383 ++++-----------------
  binding/python/diffractometer.py                  |   15 +-
  binding/python/diffractometer2.py                 |   63 +-
  binding/python/diffractometer_eulerian4C_wrap.cpp |   17 +
- 4 files changed, 291 insertions(+), 1111 deletions(-)
+ 4 files changed, 329 insertions(+), 1149 deletions(-)
 
 commit ff9218190c47e4880ca21fe210d14e686fda3165
 Author: picca <picca>
@@ -15121,10 +24883,10 @@ Date:   Wed Feb 1 14:41:21 2006 +0000
     * add link to the hkl library for the binding.
     * the diffractometer application is working now.
 
- binding/python/diffractometer.py                  |   15 ++++++---------
- binding/python/diffractometer_eulerian4C_wrap.cpp |   17 -----------------
- include/hkl/diffractometer.h                      |    8 +++++++-
- src/diffractometer.cpp                            |    8 +++++++-
+ binding/python/diffractometer.py                  | 15 ++++++---------
+ binding/python/diffractometer_eulerian4C_wrap.cpp | 17 -----------------
+ include/hkl/diffractometer.h                      |  8 +++++++-
+ src/diffractometer.cpp                            |  8 +++++++-
  4 files changed, 20 insertions(+), 28 deletions(-)
 
 commit 228ea237199f7305483a201e54537ec3a88503b2
@@ -15133,8 +24895,8 @@ Date:   Wed Feb 1 15:28:06 2006 +0100
 
     * add the affinement dialog to the gtk frontend
 
- binding/python/diffractometer.gazpacho |  842 ++++++++++++++++++++++++++++++--
- binding/python/diffractometer2.py      |   58 +--
+ binding/python/diffractometer.gazpacho | 842 +++++++++++++++++++++++++++++++--
+ binding/python/diffractometer2.py      |  58 +--
  2 files changed, 825 insertions(+), 75 deletions(-)
 
 commit a3f5e98c1a3467eeac29ec0c5a464807e1db60fe
@@ -15143,8 +24905,8 @@ Date:   Wed Feb 1 14:34:00 2006 +0100
 
     * add the new crystal dialog to the frontend
 
- binding/python/diffractometer.gazpacho |  541 +++++++++++++++++++-------------
- binding/python/diffractometer2.py      |    5 +-
+ binding/python/diffractometer.gazpacho | 541 +++++++++++++++++++--------------
+ binding/python/diffractometer2.py      |   5 +-
  2 files changed, 318 insertions(+), 228 deletions(-)
 
 commit ac297c572a8b4fbf3a774bcc3570e55eeabb281c
@@ -15172,12 +24934,12 @@ Date:   Tue Jan 31 10:00:34 2006 +0100
     * add link to the hkl library for the binding.
     * the diffractometer application is working now.
 
- SConstruct                                        |    5 +-
- binding/python/SConscript                         |   13 +-
- binding/python/diffractometer.py                  |    2 +-
- binding/python/diffractometer_eulerian4C_wrap.cpp |   12 +-
- include/hkl/diffractometer.h                      |  117 +++++-----
- src/diffractometer.cpp                            |  242 ++++++++++++++-------
+ SConstruct                                        |   5 +-
+ binding/python/SConscript                         |  13 +-
+ binding/python/diffractometer.py                  |   2 +-
+ binding/python/diffractometer_eulerian4C_wrap.cpp |  12 +-
+ include/hkl/diffractometer.h                      | 117 +++++------
+ src/diffractometer.cpp                            | 242 +++++++++++++++-------
  6 files changed, 238 insertions(+), 153 deletions(-)
 
 commit 210598b734620fb333f3559b245f1c2daf387a5e
@@ -15188,16 +24950,16 @@ Date:   Mon Jan 30 17:41:32 2006 +0100
     * create a mymap.h and myvector.h deauling with the platform during compilation
       no more need to add include path depending on the platform.
 
- SConstruct                   |    3 +--
- TODO                         |    2 +-
- include/hkl/linux/mymap.h    |    6 +++---
- include/hkl/linux/myvector.h |    6 +++---
- include/hkl/mymap.h          |   12 ++++++++++++
- include/hkl/myvector.h       |   12 ++++++++++++
- include/hkl/win32/mymap.h    |    6 +++---
- include/hkl/win32/myvector.h |    6 +++---
- src/SConscript               |    6 ------
- test/SConscript              |    6 ------
+ SConstruct                   |  3 +--
+ TODO                         |  2 +-
+ include/hkl/linux/mymap.h    |  6 +++---
+ include/hkl/linux/myvector.h |  6 +++---
+ include/hkl/mymap.h          | 12 ++++++++++++
+ include/hkl/myvector.h       | 12 ++++++++++++
+ include/hkl/win32/mymap.h    |  6 +++---
+ include/hkl/win32/myvector.h |  6 +++---
+ src/SConscript               |  6 ------
+ test/SConscript              |  6 ------
  10 files changed, 38 insertions(+), 27 deletions(-)
 
 commit d462c6508b32b517161d93d81dfa8027658fa059
@@ -15206,16 +24968,16 @@ Date:   Mon Jan 30 16:38:17 2006 +0100
 
     * update bksys to compile properly on linux
 
- SConstruct                                        |    4 +-
- binding/python/diffractometer.py                  |    4 +
- binding/python/diffractometer_eulerian4C_wrap.cpp |   26 +++++---
- binding/python/diffractometer_eulerian4C_wrap.h   |    6 +-
- binding/python/hkl_wrap.cpp                       |    2 +-
- binding/python/reflection_wrap.cpp                |   32 ----------
- bksys/boost_python.py                             |   67 ++++++++++++---------
- bksys/generic.py                                  |    3 +-
- include/hkl/mystring.h                            |    6 ++
- src/mystring.cpp                                  |    3 +
+ SConstruct                                        |  4 +-
+ binding/python/diffractometer.py                  |  4 ++
+ binding/python/diffractometer_eulerian4C_wrap.cpp | 26 +++++----
+ binding/python/diffractometer_eulerian4C_wrap.h   |  6 +-
+ binding/python/hkl_wrap.cpp                       |  2 +-
+ binding/python/reflection_wrap.cpp                | 32 -----------
+ bksys/boost_python.py                             | 67 +++++++++++++----------
+ bksys/generic.py                                  |  3 +-
+ include/hkl/mystring.h                            |  6 ++
+ src/mystring.cpp                                  |  3 +
  10 files changed, 76 insertions(+), 77 deletions(-)
 
 commit 38b64182e3a6fbb2c8fc6afd7ba566ae95b89494
@@ -15224,19 +24986,19 @@ Date:   Mon Jan 30 14:56:28 2006 +0100
 
     * update the bksys system to add the boost_python module
 
- SConstruct                                        |    6 +-
- binding/SConscript                                |    2 -
- binding/python/SConscript                         |   27 ++-
- binding/python/diffractometer_eulerian4C_wrap.cpp |    8 +-
- binding/python/diffractometer_eulerian4C_wrap.h   |    1 +
- bksys/boost_python.py                             |  108 +++++++
- bksys/cppunit.py                                  |  183 ++++++------
- bksys/generic.py                                  |  334 +++++++++++----------
- bksys/linux2/detect_boost_python.py               |   17 +
- bksys/linux2/detect_cppunit.py                    |   27 +-
- bksys/linux2/detect_python.py                     |   19 ++
- bksys/python.py                                   |   89 ++++++
- bksys/win32/detect_generic.py                     |    2 +-
+ SConstruct                                        |   6 +-
+ binding/SConscript                                |   2 -
+ binding/python/SConscript                         |  27 +-
+ binding/python/diffractometer_eulerian4C_wrap.cpp |   8 +-
+ binding/python/diffractometer_eulerian4C_wrap.h   |   1 +
+ bksys/boost_python.py                             | 108 +++++++
+ bksys/cppunit.py                                  | 183 ++++++------
+ bksys/generic.py                                  | 334 +++++++++++-----------
+ bksys/linux2/detect_boost_python.py               |  17 ++
+ bksys/linux2/detect_cppunit.py                    |  27 +-
+ bksys/linux2/detect_python.py                     |  19 ++
+ bksys/python.py                                   |  89 ++++++
+ bksys/win32/detect_generic.py                     |   2 +-
  13 files changed, 539 insertions(+), 284 deletions(-)
 
 commit 3c003acf6608233c5ae412d302c9c183bbe50fb9
@@ -15245,8 +25007,8 @@ Date:   Fri Jan 27 16:46:59 2006 +0100
 
     	modified: bksys/linux2/detect_cppunit.py
 
- bksys/linux2/detect_cppunit.py |    3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
+ bksys/linux2/detect_cppunit.py | 3 +++
+ 1 file changed, 3 insertions(+)
 
 commit 71b4d48abde6a2827dd71deccaa6d4b00cc870be
 Author: picca <picca at grisette.localdomain>
@@ -15255,8 +25017,9 @@ Date:   Fri Jan 27 15:28:40 2006 +0100
     	modified: bksys/linux2/detect_generic.py
     	deleted:  toto
 
- bksys/linux2/detect_generic.py |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ bksys/linux2/detect_generic.py | 2 +-
+ toto                           | 0
+ 2 files changed, 1 insertion(+), 1 deletion(-)
 
 commit c5722bcd78b9a8469cbc348e04b8805d4f2267c6
 Author: picca <picca at grisette.localdomain>
@@ -15264,7 +25027,8 @@ Date:   Fri Jan 27 15:18:51 2006 +0100
 
     	new file: toto
 
- 0 files changed, 0 insertions(+), 0 deletions(-)
+ toto | 0
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit 4b15fca5af9c73fcd35453a2600bc3c8b6205a02
 Author: picca <picca at grisette.localdomain>
@@ -15272,8 +25036,8 @@ Date:   Fri Jan 27 15:03:11 2006 +0100
 
     	deleted:  release_notes.txt
 
- release_notes.txt |   16 ----------------
- 1 files changed, 0 insertions(+), 16 deletions(-)
+ release_notes.txt | 16 ----------------
+ 1 file changed, 16 deletions(-)
 
 commit 696d941ed850130adfd23ea0edfc3b9221282203
 Author: picca <picca at grisette.localdomain>
@@ -15281,25 +25045,25 @@ Date:   Fri Jan 27 15:01:40 2006 +0100
 
     	new file: release_notes.txt
 
- release_notes.txt |   16 ++++++++++++++++
- 1 files changed, 16 insertions(+), 0 deletions(-)
+ release_notes.txt | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
 
 commit 2cb7dba40c74462fe57c54a6c0453afb36fdaf90
 Author: picca <picca at grisette.localdomain>
 Date:   Thu Jan 26 18:27:55 2006 +0100
 
- include/hkl/linux/mymap.h    |  530 ++++++++++++++++++++++++++++++++++++++++++
- include/hkl/linux/myvector.h |  498 +++++++++++++++++++++++++++++++++++++++
- include/hkl/win32/mymap.h    |  420 +++++++++++++++++++++++++++++++++
- include/hkl/win32/myvector.h |  458 ++++++++++++++++++++++++++++++++++++
- 4 files changed, 1906 insertions(+), 0 deletions(-)
+ include/hkl/linux/mymap.h    | 530 +++++++++++++++++++++++++++++++++++++++++++
+ include/hkl/linux/myvector.h | 498 ++++++++++++++++++++++++++++++++++++++++
+ include/hkl/win32/mymap.h    | 420 ++++++++++++++++++++++++++++++++++
+ include/hkl/win32/myvector.h | 458 +++++++++++++++++++++++++++++++++++++
+ 4 files changed, 1906 insertions(+)
 
 commit 9b7da4dcbd7de9c7a7088016743da2fd30e37713
 Author: picca <picca at grisette.localdomain>
 Date:   Thu Jan 26 18:26:30 2006 +0100
 
- release_notes.txt |   16 ----------------
- 1 files changed, 0 insertions(+), 16 deletions(-)
+ release_notes.txt | 16 ----------------
+ 1 file changed, 16 deletions(-)
 
 commit a24fd18d4a8bb0398e3d0946a368b7ece9008123
 Author: picca <picca>
@@ -15307,8 +25071,8 @@ Date:   Thu Jan 26 16:29:34 2006 +0000
 
     * rename readme.txt README
 
- README     |   37 +++++++++++++++++++++++++++++++++++++
- readme.txt |   37 -------------------------------------
+ README     | 37 +++++++++++++++++++++++++++++++++++++
+ readme.txt | 37 -------------------------------------
  2 files changed, 37 insertions(+), 37 deletions(-)
 
 commit e5f46b6b1959bdab857b81ecbae3a696073797dc
@@ -15317,8 +25081,8 @@ Date:   Thu Jan 26 15:28:24 2006 +0000
 
     * Add the VERSION file
 
- VERSION |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
+ VERSION | 1 +
+ 1 file changed, 1 insertion(+)
 
 commit c5a779e1e8eb67e45df3b9fced1e5ef5e5069140
 Author: picca <picca>
@@ -15326,32 +25090,32 @@ Date:   Thu Jan 26 14:24:51 2006 +0000
 
     * update documentation
 
- TODO                               |    6 +-
- doc/Doxyfile                       |   10 +-
- include/hkl/affinement.h           |  104 +++++++-------
- include/hkl/axe.h                  |    6 +-
- include/hkl/crystal.h              |   14 ++-
- include/hkl/diffractometer.h       |   52 ++++---
- include/hkl/fitparameter.h         |  102 +++++++-------
- include/hkl/geometry.h             |   61 ++++----
- include/hkl/mode.h                 |   72 ++++++----
- include/hkl/mode_eulerian4C.h      |   54 ++++----
- include/hkl/mode_eulerian6C.h      |  271 +++++++-----------------------------
- include/hkl/mystring.h             |   24 +++-
- include/hkl/object.h               |   69 ++++++----
- include/hkl/objectwithparameters.h |   79 ++++++-----
- include/hkl/pseudoaxe.h            |   13 +-
- include/hkl/pseudoaxe_eulerian4C.h |   55 ++------
- include/hkl/quaternion.h           |  113 ++++++++--------
- include/hkl/range.h                |    2 +-
- include/hkl/reflection.h           |   39 +++---
- include/hkl/value.h                |  110 ++++++++-------
- src/diffractometer.cpp             |    7 +-
- src/fitparameter.cpp               |    4 +-
- src/geometry.cpp                   |    4 +-
- src/mode.cpp                       |    8 +-
- src/pseudoaxe_eulerian4C.cpp       |    4 -
- src/value.cpp                      |    3 +-
+ TODO                               |   6 +-
+ doc/Doxyfile                       |  10 +-
+ include/hkl/affinement.h           | 104 +++++++-------
+ include/hkl/axe.h                  |   6 +-
+ include/hkl/crystal.h              |  14 +-
+ include/hkl/diffractometer.h       |  52 ++++---
+ include/hkl/fitparameter.h         | 102 +++++++-------
+ include/hkl/geometry.h             |  61 ++++-----
+ include/hkl/mode.h                 |  72 ++++++----
+ include/hkl/mode_eulerian4C.h      |  54 ++++----
+ include/hkl/mode_eulerian6C.h      | 271 +++++++------------------------------
+ include/hkl/mystring.h             |  24 +++-
+ include/hkl/object.h               |  69 ++++++----
+ include/hkl/objectwithparameters.h |  79 ++++++-----
+ include/hkl/pseudoaxe.h            |  13 +-
+ include/hkl/pseudoaxe_eulerian4C.h |  55 ++------
+ include/hkl/quaternion.h           | 113 ++++++++--------
+ include/hkl/range.h                |   2 +-
+ include/hkl/reflection.h           |  39 +++---
+ include/hkl/value.h                | 110 +++++++--------
+ src/diffractometer.cpp             |   7 +-
+ src/fitparameter.cpp               |   4 +-
+ src/geometry.cpp                   |   4 +-
+ src/mode.cpp                       |   8 +-
+ src/pseudoaxe_eulerian4C.cpp       |   4 -
+ src/value.cpp                      |   3 +-
  26 files changed, 590 insertions(+), 696 deletions(-)
 
 commit c9124da9d415981c8a7b8daf8d200ea1fedbe970
@@ -15360,9 +25124,9 @@ Date:   Wed Jan 25 13:46:25 2006 +0000
 
     * remove lattice.cpp and vertex.cpp
 
- src/lattice.cpp |  149 -------------------------------------------------------
- src/vertex.cpp  |  132 ------------------------------------------------
- 2 files changed, 0 insertions(+), 281 deletions(-)
+ src/lattice.cpp | 149 --------------------------------------------------------
+ src/vertex.cpp  | 132 -------------------------------------------------
+ 2 files changed, 281 deletions(-)
 
 commit 0d5908c1a2ec450b7c63ef667be6c6900c2ea8e2
 Author: picca <picca>
@@ -15370,8 +25134,8 @@ Date:   Wed Jan 25 13:44:39 2006 +0000
 
     * remove constant.cpp superseded by constant.h
 
- src/constants.cpp |  141 -----------------------------------------------------
- 1 files changed, 0 insertions(+), 141 deletions(-)
+ src/constants.cpp | 141 ------------------------------------------------------
+ 1 file changed, 141 deletions(-)
 
 commit e1f7b6b260c6057beedb7a726a3c7cab51f909d3
 Author: picca <picca>
@@ -15379,8 +25143,8 @@ Date:   Tue Jan 24 16:37:43 2006 +0000
 
     * update scons files to compile with the new includes location
 
- src/SConscript  |    6 +++---
- test/SConscript |    6 +++---
+ src/SConscript  | 6 +++---
+ test/SConscript | 6 +++---
  2 files changed, 6 insertions(+), 6 deletions(-)
 
 commit eacd28be00e69601062067084efac1ff4db0b22c
@@ -15426,7 +25190,7 @@ Date:   Tue Jan 24 16:18:30 2006 +0000
  include/hkl/mode.h                      |  293 +++++++++
  include/hkl/mode_eulerian4C.h           |  132 ++++
  include/hkl/mode_eulerian6C.h           |  410 ++++++++++++
- include/hkl/mode_kappa4C.h              |   69 ++
+ include/hkl/mode_kappa4C.h              |   69 +++
  include/hkl/mystring.h                  |   24 +
  include/hkl/object.h                    |  105 ++++
  include/hkl/objectwithparameters.h      |  107 ++++
@@ -15444,7 +25208,7 @@ Date:   Tue Jan 24 16:18:30 2006 +0000
  include/mode.h                          |  290 ---------
  include/mode_eulerian4C.h               |  132 ----
  include/mode_eulerian6C.h               |  410 ------------
- include/mode_kappa4C.h                  |   69 --
+ include/mode_kappa4C.h                  |   69 ---
  include/mystring.h                      |   24 -
  include/object.h                        |  105 ----
  include/objectwithparameters.h          |  107 ----
@@ -15453,7 +25217,7 @@ Date:   Tue Jan 24 16:18:30 2006 +0000
  include/quaternion.h                    |  152 -----
  include/range.h                         |  136 ----
  include/reflection.h                    |  381 ------------
- include/source.h                        |  276 --------
+ include/source.h                        |  276 ---------
  include/svecmat.h                       |  538 ----------------
  include/value.h                         |  131 ----
  include/vertex.h                        |  150 -----
@@ -15467,9 +25231,9 @@ Date:   Tue Jan 24 14:56:30 2006 +0000
 
     *** empty log message ***
 
- include/linux/mystring.h |   24 ------------------------
- include/mystring.h       |   24 ++++++++++++++++++++++++
- include/win32/mystring.h |   24 ------------------------
+ include/linux/mystring.h | 24 ------------------------
+ include/mystring.h       | 24 ++++++++++++++++++++++++
+ include/win32/mystring.h | 24 ------------------------
  3 files changed, 24 insertions(+), 48 deletions(-)
 
 commit ac74a01e545b7bf065863740a946ebc50bcdae94
@@ -15478,8 +25242,8 @@ Date:   Tue Jan 24 14:54:09 2006 +0000
 
     * now serialization works on win32
 
- include/win32/mymap.h    |   21 +++++++++++++++------
- include/win32/myvector.h |   15 +++++++++++++--
+ include/win32/mymap.h    | 21 +++++++++++++++------
+ include/win32/myvector.h | 15 +++++++++++++--
  2 files changed, 28 insertions(+), 8 deletions(-)
 
 commit b859055bdecca48f19eaf200e42e2c04458349f4
@@ -15488,50 +25252,50 @@ Date:   Tue Jan 24 14:31:23 2006 +0000
 
     * add the MyString class
 
- include/affinement.h                    |    4 +-
- include/axe.h                           |    6 +-
- include/crystal.h                       |    9 +-
- include/crystallist.h                   |    6 +-
- include/diffractometer.h                |  126 +++---
- include/fitparameter.h                  |    6 +-
- include/fitparameterlist.h              |    3 +-
- include/geometry.h                      |   23 +-
- include/linux/mymap.h                   |  706 +++++++++++++++---------------
- include/linux/mystring.h                |   24 +
- include/linux/myvector.h                |  737 ++++++++++++++++---------------
- include/object.h                        |   18 +-
- include/objectwithparameters.h          |   10 +-
- include/pseudoaxe.h                     |    5 +-
- include/range.h                         |    4 +-
- include/reflection.h                    |   15 +-
- include/value.h                         |    6 +-
- include/win32/mymap.h                   |   48 +-
- include/win32/mystring.h                |   24 +
- include/win32/myvector.h                |   35 +-
- src/SConscript                          |    1 +
- src/affinement.cpp                      |    2 +-
- src/axe.cpp                             |    2 +-
- src/crystal.cpp                         |    9 +-
- src/crystallist.cpp                     |    2 +-
- src/diffractometer.cpp                  |  135 +++---
- src/fitparameter.cpp                    |    2 +-
- src/geometry.cpp                        |   49 +--
- src/mystring.cpp                        |   47 ++
- src/object.cpp                          |   18 +-
- src/objectwithparameters.cpp            |    8 +-
- src/range.cpp                           |    2 +-
- src/reflection.cpp                      |   11 +-
- src/value.cpp                           |    2 +-
- test/SConscript                         |    1 +
- test/axe_test.cpp                       |    4 +-
- test/crystal_test.cpp                   |    2 +-
- test/diffractometer_eulerian4C_test.cpp |   30 +-
- test/geometry_test.cpp                  |   10 +-
- test/mystring_test.cpp                  |   29 ++
- test/mystring_test.h                    |   24 +
- test/object_test.cpp                    |    8 +-
- test/objectwithparameters_test.cpp      |    6 +-
- test/reflection_test.cpp                |    2 +-
+ include/affinement.h                    |   4 +-
+ include/axe.h                           |   6 +-
+ include/crystal.h                       |   9 +-
+ include/crystallist.h                   |   6 +-
+ include/diffractometer.h                | 126 +++---
+ include/fitparameter.h                  |   6 +-
+ include/fitparameterlist.h              |   3 +-
+ include/geometry.h                      |  23 +-
+ include/linux/mymap.h                   | 706 +++++++++++++++---------------
+ include/linux/mystring.h                |  24 ++
+ include/linux/myvector.h                | 737 ++++++++++++++++----------------
+ include/object.h                        |  18 +-
+ include/objectwithparameters.h          |  10 +-
+ include/pseudoaxe.h                     |   5 +-
+ include/range.h                         |   4 +-
+ include/reflection.h                    |  15 +-
+ include/value.h                         |   6 +-
+ include/win32/mymap.h                   |  48 +--
+ include/win32/mystring.h                |  24 ++
+ include/win32/myvector.h                |  35 +-
+ src/SConscript                          |   1 +
+ src/affinement.cpp                      |   2 +-
+ src/axe.cpp                             |   2 +-
+ src/crystal.cpp                         |   9 +-
+ src/crystallist.cpp                     |   2 +-
+ src/diffractometer.cpp                  | 135 +++---
+ src/fitparameter.cpp                    |   2 +-
+ src/geometry.cpp                        |  49 +--
+ src/mystring.cpp                        |  47 ++
+ src/object.cpp                          |  18 +-
+ src/objectwithparameters.cpp            |   8 +-
+ src/range.cpp                           |   2 +-
+ src/reflection.cpp                      |  11 +-
+ src/value.cpp                           |   2 +-
+ test/SConscript                         |   1 +
+ test/axe_test.cpp                       |   4 +-
+ test/crystal_test.cpp                   |   2 +-
+ test/diffractometer_eulerian4C_test.cpp |  30 +-
+ test/geometry_test.cpp                  |  10 +-
+ test/mystring_test.cpp                  |  29 ++
+ test/mystring_test.h                    |  24 ++
+ test/object_test.cpp                    |   8 +-
+ test/objectwithparameters_test.cpp      |   6 +-
+ test/reflection_test.cpp                |   2 +-
  44 files changed, 1201 insertions(+), 1020 deletions(-)
 
 commit 0c810e475098dcdc483fa70adf02f24b51966cd0
@@ -15540,9 +25304,9 @@ Date:   Tue Jan 24 09:06:46 2006 +0000
 
     * update the win32 part
 
- include/linux/mymap.h  |   30 --------------------
- include/win32/mymap.h  |   70 +++++++++++++++++++++++++++++++++++++++++-------
- src/diffractometer.cpp |    6 ++--
+ include/linux/mymap.h  | 30 ----------------------
+ include/win32/mymap.h  | 70 ++++++++++++++++++++++++++++++++++++++++++--------
+ src/diffractometer.cpp |  6 ++---
  3 files changed, 63 insertions(+), 43 deletions(-)
 
 commit e6cff6276cd384a0b8d805b19848acbaf2a9ed12
@@ -15552,23 +25316,23 @@ Date:   Mon Jan 23 16:14:55 2006 +0000
     * now diffractometer serialization works!!!
 
  SConstruct                              |    4 +-
- doc/uml/hkl.dia                         | 1972 ++++++++++++++++++++++++++++---
+ doc/uml/hkl.dia                         | 2248 ++++++++++++++++++++++++++-----
  include/affinement.h                    |    4 +-
  include/diffractometer.h                |   14 +-
  include/diffractometer_eulerian4C.h     |    2 +-
- include/linux/mymap.h                   |  213 +++-
+ include/linux/mymap.h                   |  213 ++-
  include/mode.h                          |    7 +-
  include/pseudoaxe.h                     |    4 +-
  include/reflection.h                    |    6 +-
  src/axe.cpp                             |    7 +-
- src/crystal.cpp                         |  104 ++-
- src/diffractometer.cpp                  |  104 ++-
+ src/crystal.cpp                         |  104 +-
+ src/diffractometer.cpp                  |  104 +-
  src/diffractometer_eulerian4C.cpp       |    6 +-
  src/geometry.cpp                        |   59 +-
  src/reflection.cpp                      |   38 +-
  test/SConscript                         |   12 +-
  test/diffractometer_eulerian4C_test.cpp |   49 +
- 17 files changed, 2282 insertions(+), 323 deletions(-)
+ 17 files changed, 2420 insertions(+), 461 deletions(-)
 
 commit 73cac96f3ca8743f640a86b7f467f4bba51e4432
 Author: picca <picca>
@@ -15576,10 +25340,10 @@ Date:   Mon Jan 16 15:41:48 2006 +0000
 
     * bksys update
 
- bksys/linux2/detect_cppunit.py |    3 +-
- bksys/linux2/detect_generic.py |    2 +-
- bksys/win32/detect_cppunit.py  |    7 +++-
- bksys/win32/detect_generic.py  |   56 +++------------------------------------
+ bksys/linux2/detect_cppunit.py |  3 +--
+ bksys/linux2/detect_generic.py |  2 +-
+ bksys/win32/detect_cppunit.py  |  7 ++++--
+ bksys/win32/detect_generic.py  | 56 ++++--------------------------------------
  4 files changed, 12 insertions(+), 56 deletions(-)
 
 commit e9cd3b34472e706a53d68c11a0b1613942f51017
@@ -15588,14 +25352,14 @@ Date:   Mon Jan 16 15:30:09 2006 +0000
 
     * update bksys
 
- SConstruct                     |   15 +-
- bksys/__init__.py              |   56 +++--
- bksys/bksys.py                 |  449 +++++++---------------------------------
- bksys/cppunit.py               |   13 +-
- bksys/generic.py               |   66 ++++---
- bksys/linux2/detect_bksys.py   |   10 +-
- bksys/linux2/detect_cppunit.py |    5 +
- bksys/linux2/detect_generic.py |   57 +-----
+ SConstruct                     |  15 +-
+ bksys/__init__.py              |  56 +++--
+ bksys/bksys.py                 | 449 +++++++----------------------------------
+ bksys/cppunit.py               |  13 +-
+ bksys/generic.py               |  66 +++---
+ bksys/linux2/detect_bksys.py   |  10 +-
+ bksys/linux2/detect_cppunit.py |   5 +
+ bksys/linux2/detect_generic.py |  57 +-----
  8 files changed, 175 insertions(+), 496 deletions(-)
 
 commit 25c7f3a17528e1d2bf7f7409042e0f4cfbf1791a
@@ -15604,9 +25368,9 @@ Date:   Mon Jan 16 09:22:10 2006 +0000
 
     *update bksys
 
- bksys/bksys.py   |    8 ++++----
- bksys/cppunit.py |    8 ++++----
- bksys/generic.py |    6 +++---
+ bksys/bksys.py   | 8 ++++----
+ bksys/cppunit.py | 8 ++++----
+ bksys/generic.py | 6 +++---
  3 files changed, 11 insertions(+), 11 deletions(-)
 
 commit 85cea40d89cdab9c276161334235745365ca7736
@@ -15615,13 +25379,13 @@ Date:   Fri Jan 13 13:47:57 2006 +0000
 
     * start refactoring of bksys
 
- SConstruct                   |   10 +----
- bksys/__init__.py            |   62 +++++++++++++-----------------
- bksys/bksys.py               |   87 +++++++++++++++++++++++++++++++++++-------
- bksys/cppunit.py             |    2 +-
- bksys/generic.py             |    2 +-
- bksys/linux2/detect_bksys.py |   58 ++++++---------------------
- test/SConscript              |    3 +-
+ SConstruct                   | 10 +----
+ bksys/__init__.py            | 62 ++++++++++++++-----------------
+ bksys/bksys.py               | 87 +++++++++++++++++++++++++++++++++++++-------
+ bksys/cppunit.py             |  2 +-
+ bksys/generic.py             |  2 +-
+ bksys/linux2/detect_bksys.py | 58 +++++++----------------------
+ test/SConscript              |  3 +-
  7 files changed, 119 insertions(+), 105 deletions(-)
 
 commit 3182ec44748769270c2562bffd5369902077771c
@@ -15630,9 +25394,9 @@ Date:   Thu Jan 12 13:41:24 2006 +0000
 
     * now it works on win32 and linux
 
- include/win32/mymap.h    |    4 ++--
- test/SConscript          |    2 +-
- test/reflection_test.cpp |    3 ---
+ include/win32/mymap.h    | 4 ++--
+ test/SConscript          | 2 +-
+ test/reflection_test.cpp | 3 ---
  3 files changed, 3 insertions(+), 6 deletions(-)
 
 commit 434377bdb8f9fcf84cc56fdebe3169f10f0f1b4e
@@ -15641,9 +25405,9 @@ Date:   Thu Jan 12 13:06:54 2006 +0000
 
     * modification of MyMap for win32
 
- include/win32/mymap.h    |   19 +++++++++++++++++++
- src/geometry.cpp         |    3 +--
- test/reflection_test.cpp |    3 +++
+ include/win32/mymap.h    | 19 +++++++++++++++++++
+ src/geometry.cpp         |  3 +--
+ test/reflection_test.cpp |  3 +++
  3 files changed, 23 insertions(+), 2 deletions(-)
 
 commit 39c58d7bb71d8f4b0f0f8ba985cfb603974a7f42
@@ -15652,9 +25416,9 @@ Date:   Thu Jan 12 12:43:43 2006 +0000
 
     * work on the persistance
 
- test/SConscript          |    5 +++--
- test/geometry_test.cpp   |    8 ++++----
- test/reflection_test.cpp |    4 ++--
+ test/SConscript          | 5 +++--
+ test/geometry_test.cpp   | 8 ++++----
+ test/reflection_test.cpp | 4 ++--
  3 files changed, 9 insertions(+), 8 deletions(-)
 
 commit bd330b6fa56a742b1f088451884d3e16cc8bfda3
@@ -15663,8 +25427,8 @@ Date:   Thu Jan 12 09:52:13 2006 +0000
 
     * clean the bksys files
 
- bksys/bksys.py |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
+ bksys/bksys.py | 1 -
+ 1 file changed, 1 deletion(-)
 
 commit 8748a79f8e8e387fb7089e51678606a36c207881
 Author: picca <picca>
@@ -15672,13 +25436,13 @@ Date:   Thu Jan 12 09:18:09 2006 +0000
 
     * now bksys works on win32
 
- bksys/bksys.py                |    1 +
- bksys/generic.py              |    2 +-
- bksys/win32/detect_cppunit.py |    2 +
- include/win32/mymap.h         |   57 ++++++++++++++++++++++
- include/win32/myvector.h      |  104 ++++++++++++++++++++++++++++++++++++-----
- src/SConscript                |    2 +-
- test/SConscript               |    2 +-
+ bksys/bksys.py                |   1 +
+ bksys/generic.py              |   2 +-
+ bksys/win32/detect_cppunit.py |   2 +
+ include/win32/mymap.h         |  57 +++++++++++++++++++++++
+ include/win32/myvector.h      | 104 +++++++++++++++++++++++++++++++++++++-----
+ src/SConscript                |   2 +-
+ test/SConscript               |   2 +-
  7 files changed, 155 insertions(+), 15 deletions(-)
 
 commit 88ca1d1cd6240ba801580e29fcd5eddaaf71eb5b
@@ -15687,8 +25451,8 @@ Date:   Wed Jan 11 16:34:08 2006 +0000
 
     *** empty log message ***
 
- bksys/bksys.pyc |  Bin 13026 -> 0 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ bksys/bksys.pyc | Bin 13026 -> 0 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit ee7543951104e6474a233512d90cfbd8002f25d6
 Author: picca <picca>
@@ -15696,9 +25460,9 @@ Date:   Wed Jan 11 16:33:24 2006 +0000
 
     * add ToStream to MyStarMap
 
- bksys/bksys.pyc       |  Bin 11370 -> 13026 bytes
- include/win32/mymap.h |   22 ++++++++++++++++++++++
- 2 files changed, 22 insertions(+), 0 deletions(-)
+ bksys/bksys.pyc       | Bin 11370 -> 13026 bytes
+ include/win32/mymap.h |  22 ++++++++++++++++++++++
+ 2 files changed, 22 insertions(+)
 
 commit efcb9e985aed4f755deef67e835eac65b3ca7b3b
 Author: picca <picca>
@@ -15706,15 +25470,15 @@ Date:   Wed Jan 11 15:30:55 2006 +0000
 
     * update bksys to work on windows
 
- bksys/__init__.py              |   25 +++++++++++++------------
- bksys/bksys.py                 |   15 ++++++++++++---
- bksys/bksys.pyc                |  Bin 12685 -> 11370 bytes
- bksys/cppunit.py               |   25 +++++++++++++++----------
- bksys/generic.py               |   12 +++++++++++-
- bksys/linux2/detect_bksys.py   |   12 ++++++++++++
- bksys/linux2/detect_generic.py |   11 -----------
- bksys/win32/detect_cppunit.py  |    6 ++----
- bksys/win32/detect_generic.py  |   16 +---------------
+ bksys/__init__.py              |  25 +++++++++++++------------
+ bksys/bksys.py                 |  15 ++++++++++++---
+ bksys/bksys.pyc                | Bin 12685 -> 11370 bytes
+ bksys/cppunit.py               |  25 +++++++++++++++----------
+ bksys/generic.py               |  12 +++++++++++-
+ bksys/linux2/detect_bksys.py   |  12 ++++++++++++
+ bksys/linux2/detect_generic.py |  11 -----------
+ bksys/win32/detect_cppunit.py  |   6 ++----
+ bksys/win32/detect_generic.py  |  16 +---------------
  9 files changed, 66 insertions(+), 56 deletions(-)
 
 commit 5ea3753e54c4bc929d56aa43db0edb2bb641ea2a
@@ -15723,10 +25487,10 @@ Date:   Wed Jan 11 13:44:01 2006 +0000
 
     * refactoring of bksys
 
- bksys/linux2/detect_bksys.py   |   54 +++++++++++++++++++++++++++++++
- bksys/linux2/detect_cppunit.py |   18 ++++++++++
- bksys/linux2/detect_generic.py |   69 ++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 141 insertions(+), 0 deletions(-)
+ bksys/linux2/detect_bksys.py   | 54 +++++++++++++++++++++++++++++++++
+ bksys/linux2/detect_cppunit.py | 18 +++++++++++
+ bksys/linux2/detect_generic.py | 69 ++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 141 insertions(+)
 
 commit c7a4a07debfc10328d1a3d336608ac691f1c6d76
 Author: picca <picca>
@@ -15734,10 +25498,10 @@ Date:   Wed Jan 11 13:41:42 2006 +0000
 
     *remove the unix directory
 
- bksys/unix/detect_bksys.py   |   54 ----------------
- bksys/unix/detect_cppunit.py |   23 -------
- bksys/unix/detect_generic.py |  142 ------------------------------------------
- 3 files changed, 0 insertions(+), 219 deletions(-)
+ bksys/unix/detect_bksys.py   |  54 ----------------
+ bksys/unix/detect_cppunit.py |  23 -------
+ bksys/unix/detect_generic.py | 142 -------------------------------------------
+ 3 files changed, 219 deletions(-)
 
 commit 268c92553f8351e391126fb0df0a0d736fcfb083
 Author: picca <picca>
@@ -15763,9 +25527,9 @@ Date:   Fri Jan 6 17:13:24 2006 +0000
 
     *** empty log message ***
 
- bksys/generic.py              |    3 ++-
- bksys/win32/detect_cppunit.py |    3 ++-
- test/SConscript               |    2 +-
+ bksys/generic.py              | 3 ++-
+ bksys/win32/detect_cppunit.py | 3 ++-
+ test/SConscript               | 2 +-
  3 files changed, 5 insertions(+), 3 deletions(-)
 
 commit 2e6e56fdf47dc95f6c2fbb0812115be888d81f5a
@@ -15774,8 +25538,8 @@ Date:   Fri Jan 6 16:28:49 2006 +0000
 
     * bksys modifications
 
- bksys/cppunit.py              |    3 ++-
- bksys/win32/detect_cppunit.py |   26 +++++++-------------------
+ bksys/cppunit.py              |  3 ++-
+ bksys/win32/detect_cppunit.py | 26 +++++++-------------------
  2 files changed, 9 insertions(+), 20 deletions(-)
 
 commit 596f6bfed6e5dd7716aca572bdc98409e52b7b3d
@@ -15793,7 +25557,7 @@ Date:   Fri Jan 6 16:24:29 2006 +0000
  include/config.h                        |    6 +
  include/crystal.h                       |  346 +++++-----
  include/crystallist.h                   |    8 -
- include/diffractometer.h                |  982 ++++++++++++++-------------
+ include/diffractometer.h                |  982 +++++++++++++--------------
  include/linux/mymap.h                   |   28 +
  include/mode.h                          |   13 +-
  include/pseudoaxe.h                     |   14 -
@@ -15801,7 +25565,7 @@ Date:   Fri Jan 6 16:24:29 2006 +0000
  include/reflection.h                    |  225 ++++---
  include/svecmat.h                       |    6 +-
  src/affinement.cpp                      |   23 +
- src/crystal.cpp                         |  964 ++++++++++++++-------------
+ src/crystal.cpp                         |  964 +++++++++++++-------------
  src/crystallist.cpp                     |    1 +
  src/diffractometer.cpp                  | 1114 ++++++++++++++++---------------
  src/pseudoaxe.cpp                       |   12 -
@@ -15831,8 +25595,8 @@ Date:   Fri Jan 6 11:03:33 2006 +0000
 
     *** empty log message ***
 
- bksys/cppunit.py              |   25 ++++++++++++++---------
- bksys/win32/detect_cppunit.py |   42 ++++++++++++++++++++++++++++------------
+ bksys/cppunit.py              | 25 +++++++++++++++----------
+ bksys/win32/detect_cppunit.py | 42 +++++++++++++++++++++++++++++-------------
  2 files changed, 44 insertions(+), 23 deletions(-)
 
 commit 87aa14ce93593e46c96ea7116a5fe41c06954d19
@@ -15841,12 +25605,12 @@ Date:   Fri Jan 6 09:17:49 2006 +0000
 
     * remove the unnecessary bksys files
 
- SConstruct                     |    2 +-
- bksys/compiler.py              |   79 ----
- bksys/lowlevel.py              |  100 -----
- bksys/unix/detect_lowlevel.py  |  848 ----------------------------------------
- bksys/win32/detect_lowlevel.py |   33 --
- 5 files changed, 1 insertions(+), 1061 deletions(-)
+ SConstruct                     |   2 +-
+ bksys/compiler.py              |  79 ----
+ bksys/lowlevel.py              | 100 -----
+ bksys/unix/detect_lowlevel.py  | 848 -----------------------------------------
+ bksys/win32/detect_lowlevel.py |  33 --
+ 5 files changed, 1 insertion(+), 1061 deletions(-)
 
 commit 04b04e48aca1bd6eea2d2b777e70b242fa0bdfc5
 Author: picca <picca>
@@ -15854,10 +25618,10 @@ Date:   Thu Jan 5 16:34:57 2006 +0000
 
     add the necessary files for bksys on win32
 
- SConstruct                    |    2 +-
- bksys/compiler.py             |   79 +++++++++++++++++++++++++++++++++++++++++
- bksys/win32/detect_cppunit.py |   20 ++++++++++
- bksys/win32/detect_generic.py |    3 +-
+ SConstruct                    |  2 +-
+ bksys/compiler.py             | 79 +++++++++++++++++++++++++++++++++++++++++++
+ bksys/win32/detect_cppunit.py | 20 +++++++++++
+ bksys/win32/detect_generic.py |  3 +-
  4 files changed, 102 insertions(+), 2 deletions(-)
 
 commit 072562723169c3795076124582eddf1e1bdadaaf
@@ -15866,9 +25630,9 @@ Date:   Thu Jan 5 15:55:09 2006 +0000
 
     * modification of SCons files for bksys
 
- SConstruct      |   92 ++++++++++++++++++++++++++++--------------------------
- src/SConscript  |   76 ++++++++++++++++++++++----------------------
- test/SConscript |   60 +++++++++++++++---------------------
+ SConstruct      | 92 ++++++++++++++++++++++++++++++---------------------------
+ src/SConscript  | 76 +++++++++++++++++++++++------------------------
+ test/SConscript | 60 ++++++++++++++++---------------------
  3 files changed, 111 insertions(+), 117 deletions(-)
 
 commit b77566c628ed9fb2146f195c0d9ef03ba8901f2b
@@ -15885,7 +25649,7 @@ Date:   Thu Jan 5 15:50:47 2006 +0000
  bksys/unix/detect_lowlevel.py  |  848 +++++++++++++++++++++++++++++
  bksys/win32/detect_generic.py  |  148 +++++
  bksys/win32/detect_lowlevel.py |   33 ++
- 8 files changed, 2561 insertions(+), 0 deletions(-)
+ 8 files changed, 2561 insertions(+)
 
 commit cd83c021cccda61140dd302dc6e48ae9c617ef36
 Author: picca <picca>
@@ -15893,17 +25657,17 @@ Date:   Tue Dec 13 16:58:26 2005 +0000
 
     * now serialization is on the way.
 
- TODO                   |    1 +
- include/linux/mymap.h  |    8 +++-----
- src/fitparameter.cpp   |    6 +++---
- src/geometry.cpp       |    1 +
- src/object.cpp         |   48 +++++++++---------------------------------------
- src/range.cpp          |    4 ++--
- test/SConscript        |   14 ++++++++++----
- test/geometry_test.cpp |    8 +++++---
- test/object_test.cpp   |   19 +++++++++++++------
- test/range_test.cpp    |    2 +-
- test/value_test.cpp    |    1 -
+ TODO                   |  1 +
+ include/linux/mymap.h  |  8 +++-----
+ src/fitparameter.cpp   |  6 +++---
+ src/geometry.cpp       |  1 +
+ src/object.cpp         | 48 +++++++++---------------------------------------
+ src/range.cpp          |  4 ++--
+ test/SConscript        | 14 ++++++++++----
+ test/geometry_test.cpp |  8 +++++---
+ test/object_test.cpp   | 19 +++++++++++++------
+ test/range_test.cpp    |  2 +-
+ test/value_test.cpp    |  1 -
  11 files changed, 48 insertions(+), 64 deletions(-)
 
 commit f9517dabb6210b6e9832bcb4f1f78f2512f4291e
@@ -15912,9 +25676,9 @@ Date:   Tue Dec 13 12:44:24 2005 +0000
 
     *** empty log message ***
 
- include/mymap.h    |  300 -------------------------------
- include/myvector.h |  506 ----------------------------------------------------
- 2 files changed, 0 insertions(+), 806 deletions(-)
+ include/mymap.h    | 300 -------------------------------
+ include/myvector.h | 506 -----------------------------------------------------
+ 2 files changed, 806 deletions(-)
 
 commit f6a5619c7b06a815ee61523e945c62d4c3526277
 Author: picca <picca>
@@ -15922,10 +25686,10 @@ Date:   Tue Dec 13 10:57:25 2005 +0000
 
     *now compile on windows
 
- include/win32/mymap.h    |  123 +++++++++++++++------------------------------
- include/win32/myvector.h |    3 +-
- src/object.cpp           |   10 ++--
- test/object_test.cpp     |    3 +-
+ include/win32/mymap.h    | 123 ++++++++++++++++-------------------------------
+ include/win32/myvector.h |   3 +-
+ src/object.cpp           |  10 ++--
+ test/object_test.cpp     |   3 +-
  4 files changed, 48 insertions(+), 91 deletions(-)
 
 commit 0d4dde6cdcd2538cc1f5e0ce442dcddea9d7f898
@@ -15934,11 +25698,11 @@ Date:   Tue Dec 13 09:57:59 2005 +0000
 
     *** empty log message ***
 
- include/linux/mymap.h    |  269 ++++++++++++++++++++++++++++
- include/linux/myvector.h |  438 ++++++++++++++++++++++++++++++++++++++++++++++
- include/win32/mymap.h    |  306 ++++++++++++++++++++++++++++++++
- include/win32/myvector.h |  367 ++++++++++++++++++++++++++++++++++++++
- 4 files changed, 1380 insertions(+), 0 deletions(-)
+ include/linux/mymap.h    | 269 +++++++++++++++++++++++++++++
+ include/linux/myvector.h | 438 +++++++++++++++++++++++++++++++++++++++++++++++
+ include/win32/mymap.h    | 306 +++++++++++++++++++++++++++++++++
+ include/win32/myvector.h | 367 +++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 1380 insertions(+)
 
 commit b54034f062a45d698a4a864911b9a37189c194c3
 Author: picca <picca>
@@ -15946,11 +25710,11 @@ Date:   Tue Dec 13 09:56:34 2005 +0000
 
     *for test
 
- include/crystallist.h     |   62 +++++++++++++++++++++++++++++++++++++++++++++
- src/crystallist.cpp       |   32 +++++++++++++++++++++++
- test/crystallist_test.cpp |   49 +++++++++++++++++++++++++++++++++++
- test/crystallist_test.h   |   33 ++++++++++++++++++++++++
- 4 files changed, 176 insertions(+), 0 deletions(-)
+ include/crystallist.h     | 62 +++++++++++++++++++++++++++++++++++++++++++++++
+ src/crystallist.cpp       | 32 ++++++++++++++++++++++++
+ test/crystallist_test.cpp | 49 +++++++++++++++++++++++++++++++++++++
+ test/crystallist_test.h   | 33 +++++++++++++++++++++++++
+ 4 files changed, 176 insertions(+)
 
 commit a0ef632df1fdedae8b3998d7a6054de5f1d8b4e4
 Author: picca <picca>
@@ -15958,59 +25722,59 @@ Date:   Tue Dec 13 09:53:53 2005 +0000
 
     * fir windows test compile.
 
- TODO                                    |   28 ++-
- doc/uml/hkl.dia                         |  453 +++++++++++++++++++++++++---
- include/axe.h                           |  162 ++++++-----
- include/constants.h                     |    8 +-
- include/crystal.h                       |    9 +-
- include/diffractometer.h                |   34 ++-
- include/fitparameter.h                  |  201 +++++++------
- include/fitparameterlist.h              |    6 +-
- include/geometry.h                      |   24 ++-
- include/object.h                        |   59 +++--
- include/objectwithparameters.h          |   15 +-
- include/quaternion.h                    |  233 ++++++++-------
- include/range.h                         |  215 +++++++------
- include/source.h                        |  194 +++++++------
- include/svecmat.h                       |   31 ++-
- include/value.h                         |   26 ++-
- src/SConscript                          |    1 +
- src/axe.cpp                             |  133 +++++----
- src/diffractometer.cpp                  |   69 ++++-
- src/fitparameter.cpp                    |   42 ++-
- src/fitparameterlist.cpp                |  142 +++++-----
- src/geometry.cpp                        |   65 ++++
- src/object.cpp                          |  110 ++++++-
- src/objectwithparameters.cpp            |   18 ++
- src/quaternion.cpp                      |   36 ++-
- src/range.cpp                           |   78 +++--
- src/smatrix.cpp                         |  511 ++++++++++++++++---------------
- src/source.cpp                          |  185 +++++++-----
- src/svector.cpp                         |   29 ++-
- src/value.cpp                           |   30 ++-
- test/SConscript                         |    7 +-
- test/axe_test.cpp                       |   31 ++-
- test/axe_test.h                         |   17 +-
- test/diffractometer_eulerian4C_test.cpp |   94 +++++-
- test/diffractometer_eulerian4C_test.h   |    6 +
- test/fitparameter_test.cpp              |   15 +
- test/fitparameter_test.h                |   17 +-
- test/geometry_test.cpp                  |   14 +
- test/geometry_test.h                    |    2 +
- test/object_test.cpp                    |   18 ++
- test/object_test.h                      |    2 +
- test/objectwithparameters_test.cpp      |   23 ++
- test/objectwithparameters_test.h        |    2 +
- test/quaternion_test.cpp                |   23 ++
- test/quaternion_test.h                  |    2 +
- test/range_test.cpp                     |   21 ++
- test/range_test.h                       |   14 +-
- test/source_test.cpp                    |   40 ++-
- test/source_test.h                      |   18 +-
- test/svecmat_test.cpp                   |   93 +++++--
- test/svecmat_test.h                     |    6 +
- test/value_test.cpp                     |   20 ++
- test/value_test.h                       |    3 +
+ TODO                                    |  28 +-
+ doc/uml/hkl.dia                         | 453 +++++++++++++++++++++++++---
+ include/axe.h                           | 162 +++++-----
+ include/constants.h                     |   8 +-
+ include/crystal.h                       |   9 +-
+ include/diffractometer.h                |  34 ++-
+ include/fitparameter.h                  | 201 +++++++------
+ include/fitparameterlist.h              |   6 +-
+ include/geometry.h                      |  24 +-
+ include/object.h                        |  59 ++--
+ include/objectwithparameters.h          |  15 +-
+ include/quaternion.h                    | 233 ++++++++-------
+ include/range.h                         | 215 +++++++-------
+ include/source.h                        | 194 ++++++------
+ include/svecmat.h                       |  31 +-
+ include/value.h                         |  26 +-
+ src/SConscript                          |   1 +
+ src/axe.cpp                             | 133 +++++----
+ src/diffractometer.cpp                  |  69 ++++-
+ src/fitparameter.cpp                    |  42 ++-
+ src/fitparameterlist.cpp                | 142 ++++-----
+ src/geometry.cpp                        |  65 ++++
+ src/object.cpp                          | 110 ++++++-
+ src/objectwithparameters.cpp            |  18 ++
+ src/quaternion.cpp                      |  36 ++-
+ src/range.cpp                           |  78 +++--
+ src/smatrix.cpp                         | 511 +++++++++++++++++---------------
+ src/source.cpp                          | 185 +++++++-----
+ src/svector.cpp                         |  29 +-
+ src/value.cpp                           |  30 +-
+ test/SConscript                         |   7 +-
+ test/axe_test.cpp                       |  31 +-
+ test/axe_test.h                         |  17 +-
+ test/diffractometer_eulerian4C_test.cpp |  94 +++++-
+ test/diffractometer_eulerian4C_test.h   |   6 +
+ test/fitparameter_test.cpp              |  15 +
+ test/fitparameter_test.h                |  17 +-
+ test/geometry_test.cpp                  |  14 +
+ test/geometry_test.h                    |   2 +
+ test/object_test.cpp                    |  18 ++
+ test/object_test.h                      |   2 +
+ test/objectwithparameters_test.cpp      |  23 ++
+ test/objectwithparameters_test.h        |   2 +
+ test/quaternion_test.cpp                |  23 ++
+ test/quaternion_test.h                  |   2 +
+ test/range_test.cpp                     |  21 ++
+ test/range_test.h                       |  14 +-
+ test/source_test.cpp                    |  40 ++-
+ test/source_test.h                      |  18 +-
+ test/svecmat_test.cpp                   |  93 ++++--
+ test/svecmat_test.h                     |   6 +
+ test/value_test.cpp                     |  20 ++
+ test/value_test.h                       |   3 +
  53 files changed, 2462 insertions(+), 1173 deletions(-)
 
 commit 9b45d9a830e2abc8015ed59381443d5b7ca74acf
@@ -16019,8 +25783,8 @@ Date:   Tue Dec 6 09:31:00 2005 +0000
 
     *** empty log message ***
 
- include/crystal.h |    9 ++++++---
- src/crystal.cpp   |   37 +++++++++++++++++++++++++++++--------
+ include/crystal.h |  9 ++++++---
+ src/crystal.cpp   | 37 +++++++++++++++++++++++++++++--------
  2 files changed, 35 insertions(+), 11 deletions(-)
 
 commit 5fe7aa95f39f29078fd3428ce0d8d5300d7b65b1
@@ -16030,20 +25794,20 @@ Date:   Mon Dec 5 10:34:43 2005 +0000
     * When adding a reflection with the same (hkl) than another one, the flag is
       automatically set to false.
 
- include/crystal.h                       |    8 +++-
- include/geometry.h                      |   11 +++--
- include/source.h                        |   13 +++++-
- src/crystal.cpp                         |   34 ++++++++++++++--
- src/geometry.cpp                        |   15 ++++---
- src/quaternion.cpp                      |    3 +-
- src/source.cpp                          |   16 ++++++--
- test/SConscript                         |   13 +++---
- test/affinement_simplex_test.cpp        |   41 +++++++++++--------
- test/crystal_test.cpp                   |   32 ++++++++++++---
- test/diffractometer_eulerian4C_test.cpp |   66 +++++++++++++++++++++++++++++-
- test/diffractometer_eulerian4C_test.h   |    2 +
- test/source_test.cpp                    |    4 +-
- 13 files changed, 199 insertions(+), 59 deletions(-)
+ include/crystal.h                       |  8 +++-
+ include/geometry.h                      | 11 ++++--
+ include/source.h                        | 13 +++++--
+ src/crystal.cpp                         | 34 +++++++++++++++--
+ src/geometry.cpp                        | 15 +++++---
+ src/quaternion.cpp                      |  3 +-
+ src/source.cpp                          | 16 ++++++--
+ test/SConscript                         | 13 +++----
+ test/affinement_simplex_test.cpp        | 41 +++++++++++---------
+ test/crystal_test.cpp                   | 34 +++++++++++++----
+ test/diffractometer_eulerian4C_test.cpp | 66 +++++++++++++++++++++++++++++++--
+ test/diffractometer_eulerian4C_test.h   |  2 +
+ test/source_test.cpp                    |  4 +-
+ 13 files changed, 200 insertions(+), 60 deletions(-)
 
 commit 6f4b68bc0b1d54b7d83f8578cc023a780b5fb2cb
 Author: picca <picca>
@@ -16051,16 +25815,16 @@ Date:   Thu Dec 1 09:41:25 2005 +0000
 
     * modification of the affineCrystal behaviour
 
- SConstruct                         |    3 ++-
- TODO                               |    3 ++-
- include/pseudoaxe_eulerian4C.h     |   30 +++++++++++++++++++++++++++---
- src/affinement.cpp                 |    6 +++---
- src/affinement_simplex.cpp         |   32 ++++++++++++++++----------------
- src/diffractometer.cpp             |   14 +++++++++++++-
- src/pseudoaxe_eulerian4C.cpp       |   34 +++++++++++++++++-----------------
- test/SConscript                    |    1 +
- test/affinement_simplex_test.cpp   |   18 ++++++++++++------
- test/pseudoaxe_eulerian4C_test.cpp |   11 ++++++-----
+ SConstruct                         |  3 ++-
+ TODO                               |  3 ++-
+ include/pseudoaxe_eulerian4C.h     | 30 +++++++++++++++++++++++++++---
+ src/affinement.cpp                 |  6 +++---
+ src/affinement_simplex.cpp         | 32 ++++++++++++++++----------------
+ src/diffractometer.cpp             | 14 +++++++++++++-
+ src/pseudoaxe_eulerian4C.cpp       | 34 +++++++++++++++++-----------------
+ test/SConscript                    |  1 +
+ test/affinement_simplex_test.cpp   | 18 ++++++++++++------
+ test/pseudoaxe_eulerian4C_test.cpp | 11 ++++++-----
  10 files changed, 99 insertions(+), 53 deletions(-)
 
 commit 4c88b1b0777d1901a203fa3ffae70470140b4322
@@ -16069,35 +25833,35 @@ Date:   Fri Nov 25 14:01:46 2005 +0000
 
     * add getCrystalParametersNames
 
- SConstruct                              |    6 +-
- TODO                                    |    3 +-
- binding/python/SConscript               |    2 +-
- doc/uml/hkl.dia                         |  348 ++++++++++---------------------
- include/affinement.h                    |    3 +
- include/diffractometer.h                |  125 ++++++-----
- include/diffractometer_eulerian4C.h     |    1 +
- include/geometry.h                      |  223 +++++++++-----------
- include/geometry_eulerian4C.h           |   21 +--
- include/mode.h                          |   11 +-
- include/objectwithparameters.h          |  132 ++++++------
- include/pseudoaxe.h                     |   20 +-
- include/pseudoaxe_eulerian4C.h          |   16 +-
- src/SConscript                          |    7 +
- src/affinement_simplex.cpp              |    2 -
- src/diffractometer.cpp                  |  116 ++++++-----
- src/diffractometer_eulerian4C.cpp       |   43 +++--
- src/geometry.cpp                        |   79 +++-----
- src/geometry_eulerian4C.cpp             |   11 +-
- src/mode.cpp                            |    4 +-
- src/objectwithparameters.cpp            |   27 ++-
- src/pseudoaxe.cpp                       |   16 +-
- src/pseudoaxe_eulerian4C.cpp            |   68 +++++--
- test/SConscript                         |   17 +-
- test/diffractometer_eulerian4C_test.cpp |   26 ++-
- test/diffractometer_eulerian4C_test.h   |    2 +
- test/libHKL_test.cpp                    |    3 +-
- test/pseudoaxe_eulerian4C_test.cpp      |   26 +--
- test/pseudoaxe_eulerian4C_test.h        |    8 +-
+ SConstruct                              |   6 +-
+ TODO                                    |   3 +-
+ binding/python/SConscript               |   2 +-
+ doc/uml/hkl.dia                         | 348 ++++++++++----------------------
+ include/affinement.h                    |   3 +
+ include/diffractometer.h                | 125 +++++++-----
+ include/diffractometer_eulerian4C.h     |   1 +
+ include/geometry.h                      | 223 +++++++++-----------
+ include/geometry_eulerian4C.h           |  21 +-
+ include/mode.h                          |  11 +-
+ include/objectwithparameters.h          | 132 ++++++------
+ include/pseudoaxe.h                     |  20 +-
+ include/pseudoaxe_eulerian4C.h          |  16 +-
+ src/SConscript                          |   7 +
+ src/affinement_simplex.cpp              |   2 -
+ src/diffractometer.cpp                  | 116 ++++++-----
+ src/diffractometer_eulerian4C.cpp       |  43 ++--
+ src/geometry.cpp                        |  79 +++-----
+ src/geometry_eulerian4C.cpp             |  11 +-
+ src/mode.cpp                            |   4 +-
+ src/objectwithparameters.cpp            |  27 +--
+ src/pseudoaxe.cpp                       |  16 +-
+ src/pseudoaxe_eulerian4C.cpp            |  68 +++++--
+ test/SConscript                         |  17 +-
+ test/diffractometer_eulerian4C_test.cpp |  26 ++-
+ test/diffractometer_eulerian4C_test.h   |   2 +
+ test/libHKL_test.cpp                    |   3 +-
+ test/pseudoaxe_eulerian4C_test.cpp      |  26 +--
+ test/pseudoaxe_eulerian4C_test.h        |   8 +-
  29 files changed, 657 insertions(+), 709 deletions(-)
 
 commit af98251755365205ec2f2ae0f756903542afd0f7
@@ -16106,13 +25870,13 @@ Date:   Wed Nov 16 14:30:07 2005 +0000
 
     * update to compile with MSVC++6
 
- include/affinement.h   |    1 +
- include/fitparameter.h |    8 ++----
- include/myvector.h     |   39 ++++++++++++++++++++++++++-----
- include/pseudoaxe.h    |    5 +--
- include/svecmat.h      |   12 ++++-----
- src/fitparameter.cpp   |   59 ++++++++++++++++++++++--------------------------
- src/svector.cpp        |   34 +++++++++------------------
+ include/affinement.h   |  1 +
+ include/fitparameter.h |  8 +++----
+ include/myvector.h     | 39 ++++++++++++++++++++++++++++-----
+ include/pseudoaxe.h    |  5 ++---
+ include/svecmat.h      | 12 +++++-----
+ src/fitparameter.cpp   | 59 +++++++++++++++++++++++---------------------------
+ src/svector.cpp        | 34 ++++++++++-------------------
  7 files changed, 82 insertions(+), 76 deletions(-)
 
 commit 8df4a173e78fe135272d45f9ff328705a4b6841c
@@ -16121,12 +25885,12 @@ Date:   Wed Nov 16 12:52:38 2005 +0000
 
     * add the pseudoAxe part
 
- doc/uml/hkl.dia                    |  135 +++++++++++++++++++++++++++++++++---
- include/pseudoaxe_eulerian4C.h     |  113 ++++++++++++++++++++++++++++++
- include/svecmat.h                  |   18 ++++-
- src/pseudoaxe_eulerian4C.cpp       |   77 ++++++++++++++++++++
- test/pseudoaxe_eulerian4C_test.cpp |   79 +++++++++++++++++++++
- test/pseudoaxe_eulerian4C_test.h   |   32 +++++++++
+ doc/uml/hkl.dia                    | 135 ++++++++++++++++++++++++++++++++++---
+ include/pseudoaxe_eulerian4C.h     | 113 +++++++++++++++++++++++++++++++
+ include/svecmat.h                  |  18 ++++-
+ src/pseudoaxe_eulerian4C.cpp       |  77 +++++++++++++++++++++
+ test/pseudoaxe_eulerian4C_test.cpp |  79 ++++++++++++++++++++++
+ test/pseudoaxe_eulerian4C_test.h   |  32 +++++++++
  6 files changed, 440 insertions(+), 14 deletions(-)
 
 commit 9563ec09af71a977998e6b74aff1ddf65393ca4b
@@ -16135,20 +25899,20 @@ Date:   Wed Nov 16 12:42:49 2005 +0000
 
     * modified crystal::randomize to deal with different combination of alpha, beta and gamma fit.
 
- SConstruct                              |    2 +-
- TODO                                    |    7 +-
- doc/uml/hkl.dia                         |  158 ++++++-
- include/crystal.h                       |  365 +++++++-------
- include/svecmat.h                       |  555 +++++++++++----------
- src/affinement_simplex.cpp              |   21 +-
- src/crystal.cpp                         |  840 ++++++++++++++++---------------
- src/svector.cpp                         |  320 +++++++-----
- test/affinement_simplex_test.cpp        |   12 +-
- test/affinement_simplex_test.h          |    2 +-
- test/diffractometer_eulerian4C_test.cpp |   36 --
- test/diffractometer_eulerian4C_test.h   |   30 +-
- test/svecmat_test.cpp                   |   10 +
- test/svecmat_test.h                     |   59 ++-
+ SConstruct                              |   2 +-
+ TODO                                    |   7 +-
+ doc/uml/hkl.dia                         | 158 +++++-
+ include/crystal.h                       | 365 +++++++-------
+ include/svecmat.h                       | 555 +++++++++++----------
+ src/affinement_simplex.cpp              |  21 +-
+ src/crystal.cpp                         | 840 +++++++++++++++++---------------
+ src/svector.cpp                         | 320 +++++++-----
+ test/affinement_simplex_test.cpp        |  12 +-
+ test/affinement_simplex_test.h          |   2 +-
+ test/diffractometer_eulerian4C_test.cpp |  36 --
+ test/diffractometer_eulerian4C_test.h   |  30 +-
+ test/svecmat_test.cpp                   |  10 +
+ test/svecmat_test.h                     |  59 ++-
  14 files changed, 1328 insertions(+), 1089 deletions(-)
 
 commit a9aaa0faea4de553a677662b3d958cdfa02dc6d5
@@ -16158,15 +25922,15 @@ Date:   Mon Nov 14 13:34:13 2005 +0000
     * update the Simplex method.
 
  SConstruct                                        |    2 +-
- binding/python/diffractometer.glade               |  242 +++-
+ binding/python/diffractometer.glade               |  242 ++-
  binding/python/diffractometer.py                  |   82 +-
  binding/python/diffractometer_eulerian4C_wrap.cpp |    8 +-
  binding/python/diffractometer_eulerian4C_wrap.h   |    4 +-
  binding/python/hkl_wrap.cpp                       |    4 +-
  doc/Maxima/E4C_bissector.max                      |   12 +-
- doc/uml/hkl.dia                                   | 2212 +++++++++++++--------
+ doc/uml/hkl.dia                                   | 2216 +++++++++++++--------
  include/affinement.h                              |   14 +-
- include/diffractometer.h                          |  937 +++++-----
+ include/diffractometer.h                          |  937 +++++----
  include/geometry.h                                |   65 +-
  include/mode.h                                    |    8 +-
  include/mode_eulerian4C.h                         |   13 +-
@@ -16182,7 +25946,7 @@ Date:   Mon Nov 14 13:34:13 2005 +0000
  src/geometry.cpp                                  |   19 +-
  src/mode_eulerian4C.cpp                           |  413 ++--
  src/mode_eulerian6C.cpp                           |   57 +-
- src/quaternion.cpp                                |  258 ++--
+ src/quaternion.cpp                                |  258 +--
  src/reflection.cpp                                |   41 +-
  test/SConscript                                   |    2 +
  test/affinement_simplex_test.cpp                  |   63 +-
@@ -16197,7 +25961,7 @@ Date:   Mon Nov 14 13:34:13 2005 +0000
  test/quaternion_test.h                            |   66 +-
  test/reflection_test.cpp                          |   41 +-
  test/reflection_test.h                            |    4 -
- 40 files changed, 3111 insertions(+), 2231 deletions(-)
+ 40 files changed, 3113 insertions(+), 2233 deletions(-)
 
 commit 1197a2e955aec19ddadf3857d8f10b7ae7ade257
 Author: picca <picca>
@@ -16205,12 +25969,12 @@ Date:   Fri Oct 28 12:59:26 2005 +0000
 
     *** empty log message ***
 
- doc/uml/hkl.dia               |  550 +++++++++++++++++++++--------------------
- include/geometry_eulerian4C.h |    5 +
- include/pseudoaxe.h           |    6 +
- src/SConscript                |    1 +
- src/geometry.cpp              |    2 +-
- src/geometry_eulerian4C.cpp   |    8 +-
+ doc/uml/hkl.dia               | 550 +++++++++++++++++++++---------------------
+ include/geometry_eulerian4C.h |   5 +
+ include/pseudoaxe.h           |   6 +
+ src/SConscript                |   1 +
+ src/geometry.cpp              |   2 +-
+ src/geometry_eulerian4C.cpp   |   8 +-
  6 files changed, 296 insertions(+), 276 deletions(-)
 
 commit 91ba98316476ad4c6157e0dde624117b06664277
@@ -16220,13 +25984,13 @@ Date:   Thu Oct 27 09:40:42 2005 +0000
     * add the PseudoAxe part to the library.
     * update the uml diagramm
 
- doc/uml/hkl.dia                         |  326 ++++++++++++++++++++++---------
- include/diffractometer.h                |   79 ++++++--
- include/geometry.h                      |   27 ++-
- include/pseudoaxe.h                     |    9 +-
- src/diffractometer.cpp                  |   71 ++++++-
- src/geometry.cpp                        |   12 ++
- test/diffractometer_eulerian4C_test.cpp |   96 +++++-----
+ doc/uml/hkl.dia                         | 326 +++++++++++++++++++++++---------
+ include/diffractometer.h                |  79 ++++++--
+ include/geometry.h                      |  27 ++-
+ include/pseudoaxe.h                     |   9 +-
+ src/diffractometer.cpp                  |  71 ++++++-
+ src/geometry.cpp                        |  12 ++
+ test/diffractometer_eulerian4C_test.cpp |  96 +++++-----
  7 files changed, 447 insertions(+), 173 deletions(-)
 
 commit 8db4880b37fdc8be47360521ce9fadc72704d9fa
@@ -16236,13 +26000,13 @@ Date:   Wed Oct 26 15:54:50 2005 +0000
     * derive Mode from ObjectwithParameters
     * update uml diagram
 
- doc/uml/hkl.dia                    |  124 +++++++++++-------------------------
- include/mode.h                     |   54 +++-------------
- include/objectwithparameters.h     |    2 +-
- src/mode.cpp                       |   43 ------------
- src/mode_eulerian4C.cpp            |   23 ++++---
- src/objectwithparameters.cpp       |    2 +-
- test/objectwithparameters_test.cpp |    2 +-
+ doc/uml/hkl.dia                    | 124 ++++++++++++-------------------------
+ include/mode.h                     |  54 +++-------------
+ include/objectwithparameters.h     |   2 +-
+ src/mode.cpp                       |  43 -------------
+ src/mode_eulerian4C.cpp            |  23 ++++---
+ src/objectwithparameters.cpp       |   2 +-
+ test/objectwithparameters_test.cpp |   2 +-
  7 files changed, 63 insertions(+), 187 deletions(-)
 
 commit 5957a2347551110fad7f9f62ae87dacafbbb2b42
@@ -16251,13 +26015,13 @@ Date:   Wed Oct 26 15:14:20 2005 +0000
 
     * remove AngleConfiguration
 
- include/angleconfiguration.h            |  329 -------------------------------
- include/angleconfiguration_eulerian4C.h |   32 ---
- include/angleconfiguration_eulerian6C.h |   34 ----
- include/angleconfiguration_kappa4C.h    |   30 ---
- test/angleconfiguration_test.cpp        |  113 -----------
- test/angleconfiguration_test.h          |   43 ----
- 6 files changed, 0 insertions(+), 581 deletions(-)
+ include/angleconfiguration.h            | 329 --------------------------------
+ include/angleconfiguration_eulerian4C.h |  32 ----
+ include/angleconfiguration_eulerian6C.h |  34 ----
+ include/angleconfiguration_kappa4C.h    |  30 ---
+ test/angleconfiguration_test.cpp        | 113 -----------
+ test/angleconfiguration_test.h          |  43 -----
+ 6 files changed, 581 deletions(-)
 
 commit 5eedac15f0dfdb35e50e44e9fdcf70af0963ab18
 Author: picca <picca>
@@ -16266,7 +26030,7 @@ Date:   Wed Oct 26 15:11:41 2005 +0000
     * AngleConfiguration -> Geometry
     * add PseudoAxe class
 
- doc/uml/hkl.dia                       |  349 +++++++----
+ doc/uml/hkl.dia                       |  349 ++++++-----
  include/diffractometer.h              |   20 +-
  include/diffractometer_eulerian4C.h   |    2 +-
  include/diffractometer_eulerian6C.h   |    2 +-
@@ -16276,7 +26040,7 @@ Date:   Wed Oct 26 15:11:41 2005 +0000
  include/geometry_kappa4C.h            |   30 +
  include/mode.h                        |   14 +-
  include/mode_eulerian4C.h             |   36 +-
- include/mode_eulerian6C.h             |   78 ++--
+ include/mode_eulerian6C.h             |   78 +--
  include/mode_kappa4C.h                |    7 +-
  include/pseudoaxe.h                   |   78 +++
  include/reflection.h                  |   19 +-
@@ -16292,7 +26056,7 @@ Date:   Wed Oct 26 15:11:41 2005 +0000
  src/geometry_eulerian4C.cpp           |   20 +
  src/geometry_eulerian6C.cpp           |   21 +
  src/geometry_kappa4C.cpp              |   18 +
- src/mode.cpp                          |  136 ++--
+ src/mode.cpp                          |  136 ++---
  src/mode_eulerian4C.cpp               |   62 +-
  src/mode_eulerian6C.cpp               | 1078 ++++++++++++++++-----------------
  src/pseudoaxe.cpp                     |   31 +
@@ -16300,11 +26064,11 @@ Date:   Wed Oct 26 15:11:41 2005 +0000
  test/SConscript                       |    2 +-
  test/affinement_simplex_test.cpp      |   53 +-
  test/affinement_simplex_test.h        |    4 +-
- test/crystal_test.cpp                 |   68 +-
+ test/crystal_test.cpp                 |   68 +--
  test/crystal_test.h                   |    4 +-
  test/geometry_test.cpp                |  111 ++++
  test/geometry_test.h                  |   44 ++
- test/mode_eulerian4C_test.cpp         |  135 ++--
+ test/mode_eulerian4C_test.cpp         |  135 ++---
  test/mode_eulerian4C_test.h           |    4 +-
  test/reflection_test.cpp              |   26 +-
  test/reflection_test.h                |    4 +-
@@ -16316,9 +26080,9 @@ Date:   Wed Oct 26 08:50:38 2005 +0000
 
     * the true add of ObjectWithParameter class test functions
 
- test/objectwithparameters_test.cpp |   41 ++++++++++++++++++++++++++++++++++++
- test/objectwithparameters_test.h   |   26 ++++++++++++++++++++++
- 2 files changed, 67 insertions(+), 0 deletions(-)
+ test/objectwithparameters_test.cpp | 41 ++++++++++++++++++++++++++++++++++++++
+ test/objectwithparameters_test.h   | 26 ++++++++++++++++++++++++
+ 2 files changed, 67 insertions(+)
 
 commit 112a7ceff4cffa2483d8b17bcc227fb61734e6cb
 Author: picca <picca>
@@ -16326,8 +26090,8 @@ Date:   Wed Oct 26 08:48:11 2005 +0000
 
     * add test functions for ObjectWithParameters class
 
- doc/uml/hkl.dia |  142 ++++++++++++++++++++++++++++++++++++++++++++++---------
- test/SConscript |    1 +
+ doc/uml/hkl.dia | 142 +++++++++++++++++++++++++++++++++++++++++++++++---------
+ test/SConscript |   1 +
  2 files changed, 120 insertions(+), 23 deletions(-)
 
 commit 866d6ddfebfefb728c87d2d82774297650d8deeb
@@ -16336,8 +26100,8 @@ Date:   Tue Oct 25 15:58:16 2005 +0000
 
     * update implementation of the Value class
 
- src/value.cpp |   76 +++++++++++++++++++++++++++-----------------------------
- 1 files changed, 37 insertions(+), 39 deletions(-)
+ src/value.cpp | 76 +++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 37 insertions(+), 39 deletions(-)
 
 commit 37cc7afab93647b6d2ec8a3a0409b719c81c7563
 Author: picca <picca>
@@ -16347,15 +26111,15 @@ Date:   Tue Oct 25 15:52:26 2005 +0000
     * documentation of the template MyVector
     * add overload << for the MyVector template class
 
- SConstruct                     |    2 +-
- TODO                           |    2 +
- doc/uml/hkl.dia                |  104 ++++++++++++++++++++++++++++++++-------
- include/myvector.h             |   50 +++++++++++++++++++
- include/objectwithparameters.h |   90 ++++++++++++++++++++++++++++++++++
- include/value.h                |    1 -
- src/SConscript                 |    1 +
- src/objectwithparameters.cpp   |   59 ++++++++++++++++++++++
- src/value.cpp                  |    2 +-
+ SConstruct                     |   2 +-
+ TODO                           |   2 +
+ doc/uml/hkl.dia                | 104 +++++++++++++++++++++++++++++++++--------
+ include/myvector.h             |  50 ++++++++++++++++++++
+ include/objectwithparameters.h |  90 +++++++++++++++++++++++++++++++++++
+ include/value.h                |   1 -
+ src/SConscript                 |   1 +
+ src/objectwithparameters.cpp   |  59 +++++++++++++++++++++++
+ src/value.cpp                  |   2 +-
  9 files changed, 289 insertions(+), 22 deletions(-)
 
 commit 2caa117b43d1fb6628c24e1578648329b8f3b7aa
@@ -16364,13 +26128,13 @@ Date:   Tue Oct 25 14:27:31 2005 +0000
 
     * Object add m_description, accessor and test functions
 
- doc/uml/hkl.dia      |  175 +++++++++++++++++++++++++++++++++++++-------------
- include/crystal.h    |   19 +++--
- include/object.h     |  117 ++++++++++++++++++++-------------
- src/crystal.cpp      |   29 +++++----
- src/object.cpp       |   70 ++++++++++++--------
- test/object_test.cpp |   23 ++++---
- test/object_test.h   |   17 +++--
+ doc/uml/hkl.dia      | 175 +++++++++++++++++++++++++++++++++++++--------------
+ include/crystal.h    |  19 +++---
+ include/object.h     | 117 +++++++++++++++++++++-------------
+ src/crystal.cpp      |  29 +++++----
+ src/object.cpp       |  70 ++++++++++++---------
+ test/object_test.cpp |  23 ++++---
+ test/object_test.h   |  17 ++---
  7 files changed, 294 insertions(+), 156 deletions(-)
 
 commit 6d6df56f4423fca74d5711d1e9fad4e9a3644a4a
@@ -16381,9 +26145,9 @@ Date:   Tue Oct 25 12:29:38 2005 +0000
         for now in a class I am using directly the menbers not the accessors
         is it good I don't know?
 
- doc/uml/hkl.dia      |  Bin 18771 -> 1003104 bytes
- doc/uml/next_hkl.dia |  Bin 20274 -> 997320 bytes
- src/axe.cpp          |    8 ++++----
+ doc/uml/hkl.dia      | Bin 18771 -> 1003104 bytes
+ doc/uml/next_hkl.dia | Bin 20274 -> 997320 bytes
+ src/axe.cpp          |   8 ++++----
  3 files changed, 4 insertions(+), 4 deletions(-)
 
 commit 98d5c66b98482fe8cdcda228f539d5973f7b88de
@@ -16392,8 +26156,8 @@ Date:   Tue Oct 25 11:34:22 2005 +0000
 
     * oops forgot to modify in crystal_test.cpp: #include cristal_test.h
 
- test/crystal_test.cpp |    3 +--
- 1 files changed, 1 insertions(+), 2 deletions(-)
+ test/crystal_test.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
 
 commit fca08247b750483498a65dd99d304648f58dba00
 Author: picca <picca>
@@ -16402,16 +26166,16 @@ Date:   Tue Oct 25 11:32:11 2005 +0000
     * rename cristal.h and cristal.cpp -> crystal.h crystal.cpp
     * same for the cristal_test suite.
 
- include/affinement.h           |    6 +-
- include/diffractometer.h       |    8 +-
- src/crystal.cpp                |    8 +-
- test/SConscript                |    2 +-
- test/affinement_simplex_test.h |    2 +-
- test/cristal_test.cpp          |  390 ----------------------------------------
- test/cristal_test.h            |   63 -------
- test/crystal_test.cpp          |  390 ++++++++++++++++++++++++++++++++++++++++
- test/crystal_test.h            |   63 +++++++
- test/mode_eulerian4C_test.h    |    2 +-
+ include/affinement.h           |   6 +-
+ include/diffractometer.h       |   8 +-
+ src/crystal.cpp                |   8 +-
+ test/SConscript                |   2 +-
+ test/affinement_simplex_test.h |   2 +-
+ test/cristal_test.cpp          | 390 -----------------------------------------
+ test/cristal_test.h            |  63 -------
+ test/crystal_test.cpp          | 390 +++++++++++++++++++++++++++++++++++++++++
+ test/crystal_test.h            |  63 +++++++
+ test/mode_eulerian4C_test.h    |   2 +-
  10 files changed, 471 insertions(+), 463 deletions(-)
 
 commit 255b0219fe4aa165eb0d25dcc08491e6642ef9fa
@@ -16420,8 +26184,8 @@ Date:   Tue Oct 25 11:25:11 2005 +0000
 
     *** empty log message ***
 
- include/cristal.h |  451 -----------------------------------------------------
- 1 files changed, 0 insertions(+), 451 deletions(-)
+ include/cristal.h | 451 ------------------------------------------------------
+ 1 file changed, 451 deletions(-)
 
 commit f21ba9ca3285cf9a6e91ca206714239d5dbb146d
 Author: picca <picca>
@@ -16429,8 +26193,8 @@ Date:   Tue Oct 25 10:07:37 2005 +0000
 
     * rename cristal.h -> crystal.h
 
- include/crystal.h |  454 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 454 insertions(+), 0 deletions(-)
+ include/crystal.h | 454 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 454 insertions(+)
 
 commit 6fad31cc0abca6bbe5bbf2ab4308da18a7c81887
 Author: picca <picca>
@@ -16438,9 +26202,9 @@ Date:   Tue Oct 25 10:05:42 2005 +0000
 
     * cristal.cpp -> crystal.cpp
 
- src/SConscript  |    2 +-
- src/cristal.cpp |  686 ------------------------------------------------------
- src/crystal.cpp |  689 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/SConscript  |   2 +-
+ src/cristal.cpp | 686 -------------------------------------------------------
+ src/crystal.cpp | 689 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 690 insertions(+), 687 deletions(-)
 
 commit 7f933c9e141a92da82b808cd6fc0789239d72313
@@ -16450,18 +26214,18 @@ Date:   Thu Oct 20 12:48:47 2005 +0000
     * right calculation for the number of usable reflections
     close: #976 #977
 
- TODO                             |    3 +-
- include/cristal.h                |   28 ++-
- include/reflection.h             |   20 +-
- src/angleconfiguration.cpp       |   14 +-
- src/cristal.cpp                  |  763 ++++++++++++++++++++------------------
- src/diffractometer.cpp           |   40 ++-
- src/reflection.cpp               |  258 +++++++------
- test/angleconfiguration_test.cpp |    4 +
- test/cristal_test.cpp            |   17 +
- test/cristal_test.h              |    2 +
- test/reflection_test.cpp         |   56 ++--
- test/reflection_test.h           |   20 +-
+ TODO                             |   3 +-
+ include/cristal.h                |  28 +-
+ include/reflection.h             |  20 +-
+ src/angleconfiguration.cpp       |  14 +-
+ src/cristal.cpp                  | 763 ++++++++++++++++++++-------------------
+ src/diffractometer.cpp           |  40 +-
+ src/reflection.cpp               | 258 +++++++------
+ test/angleconfiguration_test.cpp |   4 +
+ test/cristal_test.cpp            |  17 +
+ test/cristal_test.h              |   2 +
+ test/reflection_test.cpp         |  56 +--
+ test/reflection_test.h           |  20 +-
  12 files changed, 682 insertions(+), 543 deletions(-)
 
 commit 64938494797ff3cd54918aa153437f3e6a0fa617
@@ -16470,8 +26234,8 @@ Date:   Tue Oct 11 14:23:47 2005 +0000
 
     *** empty log message ***
 
- SConstruct |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ SConstruct | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit c19565c57dfff97823fa7d2f87fd8d242a787c45
 Author: picca <picca>
@@ -16479,8 +26243,8 @@ Date:   Tue Oct 11 14:14:26 2005 +0000
 
     *** empty log message ***
 
- readme.txt |   33 ++++++++++++++-------------------
- 1 files changed, 14 insertions(+), 19 deletions(-)
+ readme.txt | 33 ++++++++++++++-------------------
+ 1 file changed, 14 insertions(+), 19 deletions(-)
 
 commit 6fbdd9c9d7bbb96ceb53f2f1ffbe5cfcf030027f
 Author: picca <picca>
@@ -16488,11 +26252,11 @@ Date:   Tue Oct 11 14:10:51 2005 +0000
 
     *Modification to take care of the C4786 warning message for the debug version of the library
 
- SConstruct                   |    2 +-
- include/angleconfiguration.h |    7 ++++++-
- include/config.h             |    5 +++++
- include/cristal.h            |    7 ++++++-
- include/diffractometer.h     |    7 ++++++-
+ SConstruct                   | 2 +-
+ include/angleconfiguration.h | 7 ++++++-
+ include/config.h             | 5 +++++
+ include/cristal.h            | 7 ++++++-
+ include/diffractometer.h     | 7 ++++++-
  5 files changed, 24 insertions(+), 4 deletions(-)
 
 commit e7cf53df0b07d6c89d75fc0ff7b2846915fd195b
@@ -16501,8 +26265,8 @@ Date:   Tue Oct 11 13:37:09 2005 +0000
 
     * Add debug and profile option to the SConstruct file
 
- SConstruct      |   31 +++++++++++++++++++++++++------
- test/SConscript |    1 -
+ SConstruct      | 31 +++++++++++++++++++++++++------
+ test/SConscript |  1 -
  2 files changed, 25 insertions(+), 7 deletions(-)
 
 commit 880c2f25b8c7a1c52f56f2d770dadd42bb9b6fc8
@@ -16511,8 +26275,8 @@ Date:   Wed Oct 5 13:00:59 2005 +0000
 
     futur uml digramme
 
- doc/uml/next_hkl.dia |  Bin 0 -> 20274 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/uml/next_hkl.dia | Bin 0 -> 20274 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit 81887f08dab13fe57a4ef7fe658e1d9fb5771188
 Author: picca <picca>
@@ -16605,7 +26369,7 @@ Date:   Wed Oct 5 09:02:33 2005 +0000
  src/constants.h                                   |  170 --
  src/cristal.cpp                                   |  864 ++++--
  src/cristal.h                                     |  253 --
- src/diffractometer.cpp                            | 3225 ++++-----------------
+ src/diffractometer.cpp                            | 3225 ++++----------------
  src/diffractometer.h                              |  770 -----
  src/diffractometer_eulerian4C.cpp                 |   41 +
  src/diffractometer_eulerian6C.cpp                 |  215 ++
@@ -16630,7 +26394,7 @@ Date:   Wed Oct 5 09:02:33 2005 +0000
  src/reflection.cpp                                |  357 ++-
  src/reflection.h                                  |  188 --
  src/smatrix.cpp                                   |  374 ++-
- src/source.cpp                                    |  196 ++-
+ src/source.cpp                                    |  196 +-
  src/source.h                                      |  159 -
  src/svecmat.h                                     |  336 ---
  src/svector.cpp                                   |  343 ++-
@@ -16678,8 +26442,8 @@ Date:   Fri Feb 11 15:52:45 2005 +0000
 
     documentation
 
- src/mode.h |  766 +++++++++++++++++++++++++++++++++++++-----------------------
- 1 files changed, 469 insertions(+), 297 deletions(-)
+ src/mode.h | 766 +++++++++++++++++++++++++++++++++++++------------------------
+ 1 file changed, 469 insertions(+), 297 deletions(-)
 
 commit 6c21981ce6ebdf629a8cae305e445c9377d35827
 Author: picca <picca>
@@ -16687,8 +26451,8 @@ Date:   Fri Feb 11 14:30:17 2005 +0000
 
     documentation
 
- src/diffractometer.h |  850 ++++++++++++++++++++++++++++++++++----------------
- 1 files changed, 573 insertions(+), 277 deletions(-)
+ src/diffractometer.h | 850 ++++++++++++++++++++++++++++++++++-----------------
+ 1 file changed, 573 insertions(+), 277 deletions(-)
 
 commit 62228a6dfb9a0e5cb410a7da8dd8982e17561aff
 Author: picca <picca>
@@ -16696,8 +26460,8 @@ Date:   Thu Feb 10 16:47:04 2005 +0000
 
     documentation update
 
- src/angleconfig.h |  485 +++++++++++++++++++++++++++++------------------------
- 1 files changed, 269 insertions(+), 216 deletions(-)
+ src/angleconfig.h | 485 ++++++++++++++++++++++++++++++------------------------
+ 1 file changed, 269 insertions(+), 216 deletions(-)
 
 commit dfd8f995709112a5af73bc2f88fa53eda64c2e73
 Author: picca <picca>
@@ -16705,8 +26469,8 @@ Date:   Thu Feb 10 16:16:12 2005 +0000
 
     mistake in the comment after #endif
 
- src/constants.h |    7 +++++--
- 1 files changed, 5 insertions(+), 2 deletions(-)
+ src/constants.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
 
 commit 592b14f52e925626aeb398bdf58a7e842a3769e5
 Author: picca <picca>
@@ -16714,8 +26478,8 @@ Date:   Thu Feb 10 14:09:34 2005 +0000
 
     documentation
 
- src/constants.h |  147 +++++++++++++++++++++++++++++++++++--------------------
- 1 files changed, 93 insertions(+), 54 deletions(-)
+ src/constants.h | 147 +++++++++++++++++++++++++++++++++++---------------------
+ 1 file changed, 93 insertions(+), 54 deletions(-)
 
 commit a017ef29c534929359d01d31292eff3cc4f3b913
 Author: picca <picca>
@@ -16723,8 +26487,8 @@ Date:   Thu Feb 10 13:20:07 2005 +0000
 
     documentation
 
- src/cristal.h |  294 ++++++++++++++++++++++++++++++++++-----------------------
- 1 files changed, 176 insertions(+), 118 deletions(-)
+ src/cristal.h | 294 +++++++++++++++++++++++++++++++++++-----------------------
+ 1 file changed, 176 insertions(+), 118 deletions(-)
 
 commit e48580adab165f4bbd14342c7110ab882879a99c
 Author: picca <picca>
@@ -16732,8 +26496,8 @@ Date:   Thu Feb 10 09:19:49 2005 +0000
 
     Rewrite of the documentation
 
- src/HKLException.h |  208 +++++++++++++++++++++++++++++++++++-----------------
- 1 files changed, 139 insertions(+), 69 deletions(-)
+ src/HKLException.h | 208 +++++++++++++++++++++++++++++++++++------------------
+ 1 file changed, 139 insertions(+), 69 deletions(-)
 
 commit 3c1951af5eeb823f6e10f2a62ba13ea045620ab5
 Author: picca <picca>
@@ -16741,8 +26505,8 @@ Date:   Tue Feb 8 17:03:08 2005 +0000
 
     update the documentation
 
- src/reflection.cpp |   32 +++++++++++++++-
- src/reflection.h   |  101 +++++++++++++++++++++++++++++++++++++++++++---------
+ src/reflection.cpp |  32 +++++++++++++++--
+ src/reflection.h   | 101 ++++++++++++++++++++++++++++++++++++++++++++---------
  2 files changed, 114 insertions(+), 19 deletions(-)
 
 commit 9f789cfe23bf64a2223fe0654acfa9e6c62fe33c
@@ -16751,8 +26515,8 @@ Date:   Tue Feb 8 15:52:27 2005 +0000
 
     update for doxygen
 
- src/Makefile |    7 ++++---
- 1 files changed, 4 insertions(+), 3 deletions(-)
+ src/Makefile | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
 
 commit be81041247de60c08c9c88d450e3093a5ced60e3
 Author: picca <picca>
@@ -16760,11 +26524,11 @@ Date:   Tue Feb 8 15:51:05 2005 +0000
 
     update the documenattion
 
- src/reflection.h |   27 ++++--
- src/source.cpp   |   43 ++++++--
- src/source.h     |  131 ++++++++++++++++++------
- src/svecmat.h    |  296 ++++++++++++++++++++++++++++++++++++++++++-----------
- src/svector.cpp  |   14 ++-
+ src/reflection.h |  27 +++--
+ src/source.cpp   |  43 ++++++--
+ src/source.h     | 131 ++++++++++++++++++------
+ src/svecmat.h    | 296 +++++++++++++++++++++++++++++++++++++++++++------------
+ src/svector.cpp  |  14 ++-
  5 files changed, 393 insertions(+), 118 deletions(-)
 
 commit 6959b190c9ce105309724b969ab76347a181ab02
@@ -16773,8 +26537,8 @@ Date:   Thu Jan 27 16:05:46 2005 +0000
 
     modif pour release_0_5_2
 
- doc/projetHKL_reference_manual.pdf |  Bin 351240 -> 466018 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_reference_manual.pdf | Bin 351240 -> 466018 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit fb1c91b1375bf149026bbafa0e69d255fc97c8b8
 Author: delos <delos>
@@ -16782,30 +26546,30 @@ Date:   Thu Jan 27 09:23:53 2005 +0000
 
     Commentaires pour CVS en tete des fichiers
 
- src/HKLException.cpp                  |   45 ++++++++
- src/HKLException.h                    |   45 ++++++++
- src/LibUser.cpp                       |   44 +++++++
- src/angleconfig.h                     |   46 ++++++++-
- src/constants.cpp                     |   47 ++++++++-
- src/constants.h                       |   44 +++++++
- src/cristal.cpp                       |   44 +++++++
- src/cristal.h                         |   44 +++++++
- src/diffractometer.cpp                |   44 +++++++
- src/diffractometer.h                  |   44 +++++++
- src/eulerian_angleConfiguration6C.cpp |   44 +++++++
- src/eulerian_angleconfiguration4C.cpp |   44 +++++++
- src/eulerian_bissectormode4C.cpp      |   60 ++++++++--
- src/eulerian_diffractometer6C.cpp     |   52 ++++++++-
- src/eulerian_mode6C.cpp               |  199 +++++++++++++++++++++++++++++++--
- src/kappa_angleconfiguration4C.cpp    |   44 +++++++
- src/mode.h                            |   49 ++++++++-
- src/reflection.cpp                    |   44 +++++++
- src/reflection.h                      |   44 +++++++
- src/smatrix.cpp                       |   44 +++++++
- src/source.cpp                        |   44 +++++++
- src/source.h                          |   44 +++++++
- src/svecmat.h                         |   44 +++++++
- src/svector.cpp                       |   44 +++++++
+ src/HKLException.cpp                  |  45 ++++++++
+ src/HKLException.h                    |  45 ++++++++
+ src/LibUser.cpp                       |  44 ++++++++
+ src/angleconfig.h                     |  46 +++++++-
+ src/constants.cpp                     |  47 +++++++-
+ src/constants.h                       |  44 ++++++++
+ src/cristal.cpp                       |  44 ++++++++
+ src/cristal.h                         |  44 ++++++++
+ src/diffractometer.cpp                |  44 ++++++++
+ src/diffractometer.h                  |  44 ++++++++
+ src/eulerian_angleConfiguration6C.cpp |  44 ++++++++
+ src/eulerian_angleconfiguration4C.cpp |  44 ++++++++
+ src/eulerian_bissectormode4C.cpp      |  60 ++++++++--
+ src/eulerian_diffractometer6C.cpp     |  52 ++++++++-
+ src/eulerian_mode6C.cpp               | 199 ++++++++++++++++++++++++++++++++--
+ src/kappa_angleconfiguration4C.cpp    |  44 ++++++++
+ src/mode.h                            |  49 ++++++++-
+ src/reflection.cpp                    |  44 ++++++++
+ src/reflection.h                      |  44 ++++++++
+ src/smatrix.cpp                       |  44 ++++++++
+ src/source.cpp                        |  44 ++++++++
+ src/source.h                          |  44 ++++++++
+ src/svecmat.h                         |  44 ++++++++
+ src/svector.cpp                       |  44 ++++++++
  24 files changed, 1218 insertions(+), 29 deletions(-)
 
 commit 145d7d79f2fcd7bcbb6ac4b412120edc27f8a16e
@@ -16814,8 +26578,8 @@ Date:   Wed Jan 26 11:10:41 2005 +0000
 
     modification avant release 5.2
 
- readme.txt        |   15 ++++++++++-----
- release_notes.txt |    4 ++++
+ readme.txt        | 15 ++++++++++-----
+ release_notes.txt |  4 ++++
  2 files changed, 14 insertions(+), 5 deletions(-)
 
 commit 25da915ad165f49c1da49a82dd65b278f2c58384
@@ -16824,8 +26588,8 @@ Date:   Wed Jan 26 10:41:26 2005 +0000
 
     Makefile Linux
 
- src/Makefile |   43 +++++++++++++++++++++++++++++++------------
- 1 files changed, 31 insertions(+), 12 deletions(-)
+ src/Makefile | 43 +++++++++++++++++++++++++++++++------------
+ 1 file changed, 31 insertions(+), 12 deletions(-)
 
 commit fddadbe4c241f9d940138cc16c85873a1295d237
 Author: delos <delos>
@@ -16833,21 +26597,21 @@ Date:   Tue Jan 25 15:08:19 2005 +0000
 
     PREMIERE VERSION PORTABLE LINUX - WINDOWS !!!
 
- src/LibUser.cpp                       |   93 +++++------
- src/diffractometer.cpp                |  310 +++++++++++++++------------------
- src/diffractometer.h                  |   15 +-
- src/eulerian_angleConfiguration6C.cpp |   28 ++--
- src/eulerian_angleconfiguration4C.cpp |   22 ++--
- src/eulerian_bissectormode4C.cpp      |    7 -
- src/eulerian_diffractometer6C.cpp     |  156 ++++++++--------
- src/eulerian_mode6C.cpp               |   22 ++--
- src/kappa_angleconfiguration4C.cpp    |   14 +-
- src/mode.h                            |   25 ++--
- src/reflection.cpp                    |   75 +++-----
- src/smatrix.cpp                       |   22 ++-
- src/source.cpp                        |    8 +-
- src/svecmat.h                         |    5 +-
- src/svector.cpp                       |    6 +-
+ src/LibUser.cpp                       |  93 +++++-----
+ src/diffractometer.cpp                | 310 +++++++++++++++-------------------
+ src/diffractometer.h                  |  15 +-
+ src/eulerian_angleConfiguration6C.cpp |  28 +--
+ src/eulerian_angleconfiguration4C.cpp |  22 +--
+ src/eulerian_bissectormode4C.cpp      |   7 -
+ src/eulerian_diffractometer6C.cpp     | 156 ++++++++---------
+ src/eulerian_mode6C.cpp               |  22 +--
+ src/kappa_angleconfiguration4C.cpp    |  14 +-
+ src/mode.h                            |  25 +--
+ src/reflection.cpp                    |  75 +++-----
+ src/smatrix.cpp                       |  22 ++-
+ src/source.cpp                        |   8 +-
+ src/svecmat.h                         |   5 +-
+ src/svector.cpp                       |   6 +-
  15 files changed, 378 insertions(+), 430 deletions(-)
 
 commit ad59582800ce14740f2b8e8f10d35ec2c23bd865
@@ -16857,7 +26621,7 @@ Date:   Mon Jan 24 16:49:09 2005 +0000
     Ajout de eulerian_diffractometer6C.cpp (sans l'espace)
 
  src/eulerian_diffractometer6C.cpp | 1966 +++++++++++++++++++++++++++++++++++++
- 1 files changed, 1966 insertions(+), 0 deletions(-)
+ 1 file changed, 1966 insertions(+)
 
 commit 15aebc18395aefcdb78377e08c3d836ff14de7d4
 Author: delos <delos>
@@ -16866,7 +26630,7 @@ Date:   Mon Jan 24 16:47:01 2005 +0000
     Suppression de eulerian_ diffractometer6C.cpp (suppression de l'espace)
 
  src/eulerian_ diffractometer6C.cpp | 1966 ------------------------------------
- 1 files changed, 0 insertions(+), 1966 deletions(-)
+ 1 file changed, 1966 deletions(-)
 
 commit 06665e99a36a37ef3609c81c1b97d9a0efc4c5af
 Author: delos <delos>
@@ -16874,8 +26638,8 @@ Date:   Fri Jan 21 16:15:55 2005 +0000
 
     Corrections du mode 3C bras levant, nouvelle m�thode de r�solution
 
- doc/projetHKL_6C.doc |  Bin 112128 -> 118784 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_6C.doc | Bin 112128 -> 118784 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit bc0ebca92da0ea8ddb1e09d5b2d2f2c4d50b2056
 Author: dupuy <dupuy>
@@ -16883,8 +26647,8 @@ Date:   Thu Jan 20 15:37:02 2005 +0000
 
     modif pour release_0_5_1
 
- release_notes.txt |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ release_notes.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit d58a10ccf3e7f7d43d047060a5c2bc1fb1d46b33
 Author: dupuy <dupuy>
@@ -16892,9 +26656,9 @@ Date:   Wed Jan 19 13:36:06 2005 +0000
 
     modif pour compil linux
 
- src/Makefile    |   11 +++-----
- src/cristal.cpp |   74 +++++++++++++++++++++++++++---------------------------
- src/svecmat.h   |    4 +-
+ src/Makefile    | 11 ++++-----
+ src/cristal.cpp | 74 ++++++++++++++++++++++++++++-----------------------------
+ src/svecmat.h   |  4 ++--
  3 files changed, 43 insertions(+), 46 deletions(-)
 
 commit f0ab86c0425fa78e3e9e454dca1a6b106c6e831d
@@ -16903,8 +26667,8 @@ Date:   Wed Jan 19 11:23:24 2005 +0000
 
     marche pas : svector.h
 
- src/Makefile |   93 +++++++--------------------------------------------------
- 1 files changed, 12 insertions(+), 81 deletions(-)
+ src/Makefile | 93 ++++++++----------------------------------------------------
+ 1 file changed, 12 insertions(+), 81 deletions(-)
 
 commit 86ed62a00c213a1241fd44570425bfde9f19cd30
 Author: dupuy <dupuy>
@@ -16912,8 +26676,8 @@ Date:   Wed Jan 19 11:06:42 2005 +0000
 
     plus de repertoire pour les obj
 
- src/Makefile |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ src/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit e38714f2e95bc2c6ef568f1187111123e0ee0d09
 Author: dupuy <dupuy>
@@ -16921,8 +26685,8 @@ Date:   Wed Jan 19 11:03:41 2005 +0000
 
     ajout des dependance
 
- src/Makefile |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 69 insertions(+), 0 deletions(-)
+ src/Makefile | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 69 insertions(+)
 
 commit dcc99560be908024228e7accda6894041fda6344
 Author: dupuy <dupuy>
@@ -16930,8 +26694,8 @@ Date:   Wed Jan 19 10:59:41 2005 +0000
 
     pour la compil avec des makefile sous linux
 
- src/Makefile |  140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 140 insertions(+), 0 deletions(-)
+ src/Makefile | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 140 insertions(+)
 
 commit 4e67d89aa9284b1fad34698d9b59c5bb1a4e6b1d
 Author: dupuy <dupuy>
@@ -16939,8 +26703,8 @@ Date:   Wed Jan 19 10:07:54 2005 +0000
 
     pour la compil avec des makefile
 
- src/README-compil.txt |    6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
+ src/README-compil.txt | 6 ++++++
+ 1 file changed, 6 insertions(+)
 
 commit a38c388a2ba2e7e45c493e2802fcc8da5886778f
 Author: delos <delos>
@@ -16948,15 +26712,15 @@ Date:   Wed Jan 19 09:17:18 2005 +0000
 
     Corrections mineures
 
- doc/projetHKL_4C.doc               |  Bin 268288 -> 268288 bytes
- doc/projetHKL_6C.doc               |  Bin 101888 -> 112128 bytes
- src/diffractometer.h               |   76 ++++++------------
- src/eulerian_ diffractometer6C.cpp |    5 +-
- src/eulerian_bissectormode4C.cpp   |    7 +-
- src/eulerian_mode6C.cpp            |  149 ++++++++++++++++++++++++++++++++++--
- src/mode.h                         |   18 +++--
- src/reflection.h                   |   41 ++++------
- src/svecmat.h                      |   18 ++---
+ doc/projetHKL_4C.doc               | Bin 268288 -> 268288 bytes
+ doc/projetHKL_6C.doc               | Bin 101888 -> 112128 bytes
+ src/diffractometer.h               |  76 +++++++------------
+ src/eulerian_ diffractometer6C.cpp |   5 +-
+ src/eulerian_bissectormode4C.cpp   |   7 +-
+ src/eulerian_mode6C.cpp            | 149 +++++++++++++++++++++++++++++++++++--
+ src/mode.h                         |  18 +++--
+ src/reflection.h                   |  41 ++++------
+ src/svecmat.h                      |  18 ++---
  9 files changed, 211 insertions(+), 103 deletions(-)
 
 commit 0dd1e4dc39a9424362b06a4ec05c91f5bd501c86
@@ -16965,9 +26729,9 @@ Date:   Fri Jan 14 15:05:48 2005 +0000
 
     Ajout du mode omega constant 4C
 
- src/LibUser.cpp                  |    9 +-
- src/eulerian_bissectormode4C.cpp |  240 ++++++++++++++++++++++++++++++++++++--
- src/mode.h                       |   67 +++++++++--
+ src/LibUser.cpp                  |   9 +-
+ src/eulerian_bissectormode4C.cpp | 240 +++++++++++++++++++++++++++++++++++++--
+ src/mode.h                       |  67 +++++++++--
  3 files changed, 293 insertions(+), 23 deletions(-)
 
 commit 8ad996869b1acf91df7098e079f033b3966388cc
@@ -16976,8 +26740,8 @@ Date:   Fri Jan 14 15:05:15 2005 +0000
 
     no message
 
- doc/projetHKL_6C.doc           |  Bin 100864 -> 101888 bytes
- doc/projetHKL_architecture.mdl |  512 ++++++++++++++++++++++++----------------
+ doc/projetHKL_6C.doc           | Bin 100864 -> 101888 bytes
+ doc/projetHKL_architecture.mdl | 512 ++++++++++++++++++++++++-----------------
  2 files changed, 303 insertions(+), 209 deletions(-)
 
 commit 73eda918c4689dd08b17c973ec5e176d53a430ce
@@ -16986,8 +26750,8 @@ Date:   Fri Jan 14 13:15:20 2005 +0000
 
     no message
 
- doc/projetHKL_4C.doc |  Bin 267776 -> 268288 bytes
- doc/projetHKL_6C.doc |  Bin 100864 -> 100864 bytes
+ doc/projetHKL_4C.doc | Bin 267776 -> 268288 bytes
+ doc/projetHKL_6C.doc | Bin 100864 -> 100864 bytes
  2 files changed, 0 insertions(+), 0 deletions(-)
 
 commit f7826ca7e1159a969758f15cc9230f7e414f4cb9
@@ -16996,10 +26760,10 @@ Date:   Fri Jan 14 13:07:55 2005 +0000
 
     Corrections du mode 3C bras levant
 
- src/angleconfig.h                  |  119 ++++++++++++--------
- src/eulerian_ diffractometer6C.cpp |  216 ++++++++++++++++++++++++++++++------
- src/eulerian_mode6C.cpp            |  180 +++++++++++++++---------------
- src/mode.h                         |   65 ++++-------
+ src/angleconfig.h                  | 119 ++++++++++++--------
+ src/eulerian_ diffractometer6C.cpp | 216 +++++++++++++++++++++++++++++++------
+ src/eulerian_mode6C.cpp            | 180 ++++++++++++++++---------------
+ src/mode.h                         |  65 +++++------
  4 files changed, 370 insertions(+), 210 deletions(-)
 
 commit 2f5a4fd1022ea1d2702e7934df4f55e78cbdeadc
@@ -17008,8 +26772,8 @@ Date:   Tue Jan 11 10:17:13 2005 +0000
 
     ajout du logo soleil
 
- doc/projetHKL_4C.doc |  Bin 257536 -> 267776 bytes
- doc/projetHKL_6C.doc |  Bin 91648 -> 100864 bytes
+ doc/projetHKL_4C.doc | Bin 257536 -> 267776 bytes
+ doc/projetHKL_6C.doc | Bin 91648 -> 100864 bytes
  2 files changed, 0 insertions(+), 0 deletions(-)
 
 commit 987e74b2497a84a22a55091c9b76ad446bcecd7c
@@ -17024,8 +26788,8 @@ Date:   Tue Jan 11 09:42:20 2005 +0000
 
     mise � jour pour la release_0_5
 
- readme.txt        |   12 ++++++++++++
- release_notes.txt |    5 +++--
+ readme.txt        | 12 ++++++++++++
+ release_notes.txt |  5 +++--
  2 files changed, 15 insertions(+), 2 deletions(-)
 
 commit 9a7cec8a984cb0afc7abbac4827a53dc569d95cb
@@ -17034,8 +26798,8 @@ Date:   Tue Jan 11 09:32:36 2005 +0000
 
     generation du pdf pour la release_0_5
 
- doc/projetHKL_reference_manual.pdf |  Bin 336602 -> 351240 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_reference_manual.pdf | Bin 336602 -> 351240 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit cccf4f25f2f59700111ce7874af26c304dd795ee
 Author: dupuy <dupuy>
@@ -17043,8 +26807,8 @@ Date:   Tue Jan 11 09:31:28 2005 +0000
 
     correction (mauvais fichier commiter precedemment) : generation du pdf pour la release_0_5
 
- doc/projetHKL_architecture.pdf |  Bin 351240 -> 218839 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_architecture.pdf | Bin 351240 -> 218839 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit 7e4dc80d186efe38bc75489977e31d43fdcf5c35
 Author: dupuy <dupuy>
@@ -17052,8 +26816,8 @@ Date:   Tue Jan 11 09:22:30 2005 +0000
 
     generation du pdf pour la release_0_5
 
- doc/projetHKL_architecture.pdf |  Bin 218839 -> 351240 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_architecture.pdf | Bin 218839 -> 351240 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit 722ed4a653887294c88539f902c4bbb0c50e2a8d
 Author: dupuy <dupuy>
@@ -17061,8 +26825,8 @@ Date:   Tue Jan 11 09:18:30 2005 +0000
 
     generation du latex pour la release_0_5
 
- doc/Doxyfile-to-tex |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ doc/Doxyfile-to-tex | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 commit 81ef03e2f43c0ccb5fadbf70e26b69888a46fc25
 Author: dupuy <dupuy>
@@ -17070,8 +26834,8 @@ Date:   Mon Jan 10 18:19:09 2005 +0000
 
     avant tag pour la release 0.5
 
- release_notes.txt |    7 ++++++-
- 1 files changed, 6 insertions(+), 1 deletions(-)
+ release_notes.txt | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
 
 commit e0620f030fe563b4ef0a19edbb47a84ef5741645
 Author: dupuy <dupuy>
@@ -17079,8 +26843,8 @@ Date:   Mon Jan 10 18:16:03 2005 +0000
 
     nouveau pdf, en une seule page
 
- doc/projetHKL_architecture.pdf |  Bin 406062 -> 218839 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_architecture.pdf | Bin 406062 -> 218839 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit a72746ffbc801e85ef07dc52bb355e15fbfdfb1d
 Author: dupuy <dupuy>
@@ -17088,8 +26852,8 @@ Date:   Mon Jan 10 18:15:29 2005 +0000
 
     mise a jour du repertoire doc (nettoyage)
 
- doc/README.txt |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
+ doc/README.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
 
 commit 88df7f170dc6c0cadc91a1cf7c82f9619a24bf9b
 Author: dupuy <dupuy>
@@ -17097,8 +26861,8 @@ Date:   Mon Jan 10 17:48:01 2005 +0000
 
     mise a jour du repertoire doc (nettoyage)
 
- doc/README.txt |   17 +++++++++++++++--
- 1 files changed, 15 insertions(+), 2 deletions(-)
+ doc/README.txt | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
 
 commit 3eff6090e0f5b4d12af55995cd8e3c97e0ca3aea
 Author: dupuy <dupuy>
@@ -17106,8 +26870,8 @@ Date:   Mon Jan 10 17:40:13 2005 +0000
 
     renommer en projetHKL_6C.doc
 
- doc/projetHKL_6C.doc |  Bin 0 -> 91648 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_6C.doc | Bin 0 -> 91648 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit b0349d9949b58fcf43b8b82065d72aef52bbf2e9
 Author: dupuy <dupuy>
@@ -17115,8 +26879,8 @@ Date:   Mon Jan 10 17:38:11 2005 +0000
 
     renommer en projetHKL_4C.doc
 
- doc/projetHKL_4C.doc |  Bin 0 -> 257536 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_4C.doc | Bin 0 -> 257536 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit 0fa05ebdeac41a16ee2575ae60bb1794409fdd8b
 Author: dupuy <dupuy>
@@ -17124,10 +26888,10 @@ Date:   Mon Jan 10 17:07:52 2005 +0000
 
     remplac� par les fichiers projetHKL_4C.doc et projetHKL_6C.doc
 
- doc/pilotage-diffract.doc |  Bin 347648 -> 0 bytes
- doc/projetHKL_1.doc       |  Bin 257536 -> 0 bytes
- doc/projetHKL_4C.doc      |  Bin 257536 -> 0 bytes
- doc/projetHKL_6C.doc      |  Bin 91648 -> 0 bytes
+ doc/pilotage-diffract.doc | Bin 347648 -> 0 bytes
+ doc/projetHKL_1.doc       | Bin 257536 -> 0 bytes
+ doc/projetHKL_4C.doc      | Bin 257536 -> 0 bytes
+ doc/projetHKL_6C.doc      | Bin 91648 -> 0 bytes
  4 files changed, 0 insertions(+), 0 deletions(-)
 
 commit 705227854f55c44424aade434b46e9c0aac5507e
@@ -17136,12 +26900,12 @@ Date:   Mon Jan 10 15:37:20 2005 +0000
 
     Test en 6C mode 4C horizontal et 4C vertical, implementation du 3C bras levant en cours
 
- doc/projetHKL_1.doc                |  Bin 258048 -> 257536 bytes
- doc/projetHKL_4C.doc               |  Bin 258048 -> 257536 bytes
- doc/projetHKL_6C.doc               |  Bin 90624 -> 91648 bytes
- src/eulerian_ diffractometer6C.cpp |  538 +++++++++++++++++++++++++++++++++++-
- src/eulerian_mode6C.cpp            |  306 ++++++++++++++++++++
- src/mode.h                         |  131 +++++----
+ doc/projetHKL_1.doc                | Bin 258048 -> 257536 bytes
+ doc/projetHKL_4C.doc               | Bin 258048 -> 257536 bytes
+ doc/projetHKL_6C.doc               | Bin 90624 -> 91648 bytes
+ src/eulerian_ diffractometer6C.cpp | 538 ++++++++++++++++++++++++++++++++++++-
+ src/eulerian_mode6C.cpp            | 306 +++++++++++++++++++++
+ src/mode.h                         | 131 +++++----
  6 files changed, 912 insertions(+), 63 deletions(-)
 
 commit 29c19c73cca2a42eca72320efa352e74e3c888a6
@@ -17150,15 +26914,15 @@ Date:   Thu Jan 6 14:46:17 2005 +0000
 
     Corrections du 6-cercles en mode 4C horizontal et vertical
 
- doc/pilotage-diffract.doc             |  Bin 347648 -> 347648 bytes
- doc/projetHKL_1.doc                   |  Bin 258048 -> 258048 bytes
- doc/projetHKL_4C.doc                  |  Bin 258048 -> 258048 bytes
- doc/projetHKL_6C.doc                  |  Bin 87040 -> 90624 bytes
- src/angleconfig.h                     |    8 +-
- src/eulerian_ diffractometer6C.cpp    |  601 ++++++++++++++++++++++++++++++++-
- src/eulerian_angleconfiguration4C.cpp |   31 +-
- src/eulerian_bissectormode4C.cpp      |   45 +--
- src/eulerian_mode6C.cpp               |   62 ++--
+ doc/pilotage-diffract.doc             | Bin 347648 -> 347648 bytes
+ doc/projetHKL_1.doc                   | Bin 258048 -> 258048 bytes
+ doc/projetHKL_4C.doc                  | Bin 258048 -> 258048 bytes
+ doc/projetHKL_6C.doc                  | Bin 87040 -> 90624 bytes
+ src/angleconfig.h                     |   8 +-
+ src/eulerian_ diffractometer6C.cpp    | 601 +++++++++++++++++++++++++++++++++-
+ src/eulerian_angleconfiguration4C.cpp |  31 +-
+ src/eulerian_bissectormode4C.cpp      |  45 +--
+ src/eulerian_mode6C.cpp               |  62 ++--
  9 files changed, 664 insertions(+), 83 deletions(-)
 
 commit d4105a569af4fb2ca7149ebae80e235c3e4d4196
@@ -17167,8 +26931,8 @@ Date:   Tue Jan 4 13:22:24 2005 +0000
 
     regeneration du pdf avec la doc de l'implementation du 6C
 
- doc/projetHKL_reference_manual.pdf |  Bin 154729 -> 336602 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_reference_manual.pdf | Bin 154729 -> 336602 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit e61bdf5708fdcc0551313abfacffcb6f3d074222
 Author: delos <delos>
@@ -17176,19 +26940,19 @@ Date:   Wed Dec 22 15:45:55 2004 +0000
 
     Ajout du 6-cercles avec modes 4C horizontal et vertical
 
- doc/projetHKL_1.doc                   |  Bin 257536 -> 258048 bytes
- doc/projetHKL_4C.doc                  |  Bin 257536 -> 258048 bytes
- doc/projetHKL_6C.doc                  |  Bin 86528 -> 87040 bytes
- doc/projetHKL_architecture.mdl        |  765 +++++++++++++++++++++------------
- src/LibUser.cpp                       |    8 +
- src/angleconfig.h                     |  119 +++++-
- src/diffractometer.cpp                |   12 +-
- src/diffractometer.h                  |  163 ++++++--
- src/eulerian_ diffractometer6C.cpp    |  696 ++++++++++++++++++++++++++++++
- src/eulerian_angleConfiguration6C.cpp |  168 +++++++
- src/eulerian_mode6C.cpp               |  546 +++++++++++++++++++++++
- src/mode.h                            |  124 +++++-
- src/source.h                          |    2 +-
+ doc/projetHKL_1.doc                   | Bin 257536 -> 258048 bytes
+ doc/projetHKL_4C.doc                  | Bin 257536 -> 258048 bytes
+ doc/projetHKL_6C.doc                  | Bin 86528 -> 87040 bytes
+ doc/projetHKL_architecture.mdl        | 765 ++++++++++++++++++++++------------
+ src/LibUser.cpp                       |   8 +
+ src/angleconfig.h                     | 119 +++++-
+ src/diffractometer.cpp                |  12 +-
+ src/diffractometer.h                  | 163 ++++++--
+ src/eulerian_ diffractometer6C.cpp    | 696 +++++++++++++++++++++++++++++++
+ src/eulerian_angleConfiguration6C.cpp | 168 ++++++++
+ src/eulerian_mode6C.cpp               | 546 ++++++++++++++++++++++++
+ src/mode.h                            | 124 +++++-
+ src/source.h                          |   2 +-
  13 files changed, 2267 insertions(+), 336 deletions(-)
 
 commit 952f7c271d694a285b013b929e9aa03414a13df7
@@ -17197,8 +26961,8 @@ Date:   Tue Dec 21 13:22:36 2004 +0000
 
     ajout fichier release_notes.txt
 
- release_notes.txt |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ release_notes.txt | 2 ++
+ 1 file changed, 2 insertions(+)
 
 commit ca0bc8a80325ec8515f96f8885031cb30b7a86a1
 Author: delos <delos>
@@ -17206,9 +26970,9 @@ Date:   Thu Dec 16 14:40:34 2004 +0000
 
     no message
 
- doc/projetHKL_1.doc  |  Bin 254976 -> 257536 bytes
- doc/projetHKL_4C.doc |  Bin 254976 -> 257536 bytes
- doc/projetHKL_6C.doc |  Bin 86528 -> 86528 bytes
+ doc/projetHKL_1.doc  | Bin 254976 -> 257536 bytes
+ doc/projetHKL_4C.doc | Bin 254976 -> 257536 bytes
+ doc/projetHKL_6C.doc | Bin 86528 -> 86528 bytes
  3 files changed, 0 insertions(+), 0 deletions(-)
 
 commit f867d357a6854040abcb3d31e596ca51274c6115
@@ -17217,8 +26981,8 @@ Date:   Wed Dec 15 16:35:44 2004 +0000
 
     6C en 4C + Mathematica 5.1
 
- doc/projetHKL_6C.doc |  Bin 77312 -> 86528 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_6C.doc | Bin 77312 -> 86528 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit df98b020643c56784ea6af86120e55f92855ec29
 Author: delos <delos>
@@ -17226,8 +26990,8 @@ Date:   Wed Dec 15 14:00:08 2004 +0000
 
     Calcul de U en 6 cercles et calcul de qaz
 
- doc/projetHKL_6C.doc |  Bin 64512 -> 77312 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_6C.doc | Bin 64512 -> 77312 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit 4c28fb0face989a32436e22f47e60084f71c6518
 Author: delos <delos>
@@ -17235,8 +26999,8 @@ Date:   Wed Dec 15 10:55:14 2004 +0000
 
     documentation
 
- src/diffractometer.h |   29 +++++++++++++++++++++++++----
- 1 files changed, 25 insertions(+), 4 deletions(-)
+ src/diffractometer.h | 29 +++++++++++++++++++++++++----
+ 1 file changed, 25 insertions(+), 4 deletions(-)
 
 commit 7af7bc15599ed8398bc3b263a1f9e9c675f92997
 Author: delos <delos>
@@ -17244,9 +27008,9 @@ Date:   Wed Dec 15 10:52:53 2004 +0000
 
     Nouvelle doc operationnelle en deux parties (remplace pilotage-diffract.doc)
 
- doc/projetHKL_1.doc  |  Bin 0 -> 254976 bytes
- doc/projetHKL_4C.doc |  Bin 0 -> 254976 bytes
- doc/projetHKL_6C.doc |  Bin 0 -> 64512 bytes
+ doc/projetHKL_1.doc  | Bin 0 -> 254976 bytes
+ doc/projetHKL_4C.doc | Bin 0 -> 254976 bytes
+ doc/projetHKL_6C.doc | Bin 0 -> 64512 bytes
  3 files changed, 0 insertions(+), 0 deletions(-)
 
 commit 5d9f669e9445b633b73a2c2ffa7f373e986d8a12
@@ -17255,9 +27019,9 @@ Date:   Tue Dec 7 14:42:34 2004 +0000
 
     Calcul de (h,k,l) � partir de (om�ga,phi,chi) refonte des signatures de fonctions
 
- src/diffractometer.cpp           |   40 +++++++++++++++++++-------------------
- src/eulerian_bissectormode4C.cpp |    4 +-
- src/mode.h                       |   30 ++++++++++++++--------------
+ src/diffractometer.cpp           | 40 ++++++++++++++++++++--------------------
+ src/eulerian_bissectormode4C.cpp |  4 ++--
+ src/mode.h                       | 30 +++++++++++++++---------------
  3 files changed, 37 insertions(+), 37 deletions(-)
 
 commit 8eb0a271f2f3c4db5f1af5f16ff4c3096a905178
@@ -17266,10 +27030,10 @@ Date:   Tue Dec 7 14:25:16 2004 +0000
 
     Calcul de (h,k,l) � partir de (om�ga,phi,chi)
 
- src/diffractometer.cpp           |  539 +++++++++++++++++++++++++++++++++++++-
- src/diffractometer.h             |   88 +++++--
- src/eulerian_bissectormode4C.cpp |  118 +++++++--
- src/mode.h                       |  107 +++++++-
+ src/diffractometer.cpp           | 539 ++++++++++++++++++++++++++++++++++++++-
+ src/diffractometer.h             |  88 +++++--
+ src/eulerian_bissectormode4C.cpp | 118 +++++++--
+ src/mode.h                       | 107 +++++++-
  4 files changed, 793 insertions(+), 59 deletions(-)
 
 commit 76745d6a6ec606490db301a142a3f3680459edaa
@@ -17278,9 +27042,9 @@ Date:   Thu Dec 2 14:05:16 2004 +0000
 
     plus de doc
 
- src/cristal.h                    |   30 ++++++++++++++++++++++++++++--
- src/eulerian_bissectormode4C.cpp |    6 +++---
- src/source.h                     |    4 ++++
+ src/cristal.h                    | 30 ++++++++++++++++++++++++++++--
+ src/eulerian_bissectormode4C.cpp |  6 +++---
+ src/source.h                     |  4 ++++
  3 files changed, 35 insertions(+), 5 deletions(-)
 
 commit c0c5d4e64c58156e59ea8650696eb7b1bcb5a26f
@@ -17289,10 +27053,10 @@ Date:   Thu Dec 2 10:27:05 2004 +0000
 
     plus de doc
 
- src/cristal.h        |    6 +++---
- src/diffractometer.h |   34 ++++++++++++++++++++++++++++++----
- src/mode.h           |   39 +++++++++++++++++++++++++++++++++++----
- src/source.h         |    7 +++----
+ src/cristal.h        |  6 +++---
+ src/diffractometer.h | 34 ++++++++++++++++++++++++++++++----
+ src/mode.h           | 39 +++++++++++++++++++++++++++++++++++----
+ src/source.h         |  7 +++----
  4 files changed, 71 insertions(+), 15 deletions(-)
 
 commit 35044ce57444ad4c62804e43ae89407f2591a5b2
@@ -17301,8 +27065,8 @@ Date:   Wed Dec 1 16:10:49 2004 +0000
 
     6cercles mode bras levant
 
- doc/pilotage-diffract.doc |  Bin 341504 -> 347648 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/pilotage-diffract.doc | Bin 341504 -> 347648 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit ab75d9305774aaf9fd11545acccaef08c49137a6
 Author: delos <delos>
@@ -17310,9 +27074,9 @@ Date:   Tue Nov 30 15:04:58 2004 +0000
 
     6cercles intro+commentaires
 
- doc/pilotage-diffract.doc |  Bin 337920 -> 341504 bytes
- src/source.h              |    2 +-
- 2 files changed, 1 insertions(+), 1 deletions(-)
+ doc/pilotage-diffract.doc | Bin 337920 -> 341504 bytes
+ src/source.h              |   2 +-
+ 2 files changed, 1 insertion(+), 1 deletion(-)
 
 commit 75f96240b5e7f4fad83e115ea2657988af1cd7a1
 Author: delos <delos>
@@ -17320,8 +27084,8 @@ Date:   Tue Nov 30 11:15:55 2004 +0000
 
     6cercles intro
 
- doc/pilotage-diffract.doc |  Bin 332288 -> 337920 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/pilotage-diffract.doc | Bin 332288 -> 337920 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit cf88b734108d8be840ee769b034ac34023960edf
 Author: delos <delos>
@@ -17329,13 +27093,13 @@ Date:   Fri Nov 26 10:34:01 2004 +0000
 
     Ajout de tests (Rafin) + pb de Q dans (yOz)
 
- doc/pilotage-diffract.doc        |  Bin 328192 -> 332288 bytes
- src/Makefile.vc                  |    3 +-
- src/cristal.h                    |   28 +-
- src/diffractometer.cpp           |  676 +++++++++++++++++++++++++++++++++++++-
- src/diffractometer.h             |   86 ++++--
- src/eulerian_bissectormode4C.cpp |   13 +-
- src/mode.h                       |   47 ++-
+ doc/pilotage-diffract.doc        | Bin 328192 -> 332288 bytes
+ src/Makefile.vc                  |   3 +-
+ src/cristal.h                    |  28 +-
+ src/diffractometer.cpp           | 676 ++++++++++++++++++++++++++++++++++++++-
+ src/diffractometer.h             |  86 +++--
+ src/eulerian_bissectormode4C.cpp |  13 +-
+ src/mode.h                       |  47 ++-
  7 files changed, 787 insertions(+), 66 deletions(-)
 
 commit 3f3058b293a29304d262f7807144910eb3bf3abc
@@ -17344,8 +27108,8 @@ Date:   Wed Nov 24 18:07:04 2004 +0000
 
     added PDF version of class hierarchy
 
- doc/projetHKL_architecture.pdf |  Bin 0 -> 406062 bytes
- 1 files changed, 0 insertions(+), 0 deletions(-)
+ doc/projetHKL_architecture.pdf | Bin 0 -> 406062 bytes
+ 1 file changed, 0 insertions(+), 0 deletions(-)
 
 commit c1bdaae4100cde04e701aa4a2e4ef6a1dec175b6
 Author: dupuy <dupuy>
@@ -17353,8 +27117,8 @@ Date:   Wed Nov 24 13:38:51 2004 +0000
 
     ajout du fichier readme.txt dans le repertoire doc
 
- doc/README.txt |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
+ doc/README.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 commit 93db9afe0d30b9ff86e6b65802491a9252bb42af
 Author: dupuy <dupuy>
@@ -17362,9 +27126,9 @@ Date:   Wed Nov 24 10:45:57 2004 +0000
 
     ajout des fichiers doxyfile-to-tex et HKL-code-doc.pdf utilis� et/ou g�n�r� par doxygen
 
- doc/Doxyfile-to-tex                |  248 ++++++++++++++++++++++++++++++++++++
- doc/projetHKL_reference_manual.pdf |  Bin 0 -> 154729 bytes
- 2 files changed, 248 insertions(+), 0 deletions(-)
+ doc/Doxyfile-to-tex                | 248 +++++++++++++++++++++++++++++++++++++
+ doc/projetHKL_reference_manual.pdf | Bin 0 -> 154729 bytes
+ 2 files changed, 248 insertions(+)
 
 commit 00c7b692b71912a88d2c1bc654a8f8d5d038df70
 Author: buteau <buteau>
@@ -17372,8 +27136,8 @@ Date:   Wed Nov 24 09:27:18 2004 +0000
 
     added target in Makefile.VC for generation of library with standard SOLEIL Makefiles
 
- src/Makefile.vc |    8 ++++++--
- 1 files changed, 6 insertions(+), 2 deletions(-)
+ src/Makefile.vc | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
 
 commit 1a2acf416649773db41080c958349334959f89a5
 Author: buteau <buteau>
@@ -17381,8 +27145,8 @@ Date:   Wed Nov 24 08:05:02 2004 +0000
 
     added Makefile.VC to recompile library with standard SOLEIL Makefiles
 
- src/Makefile.vc |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 files changed, 55 insertions(+), 0 deletions(-)
+ src/Makefile.vc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 55 insertions(+)
 
 commit d9794be2cc988d497924e58b571b3a48f2486fce
 Author: delos <delos>
@@ -17390,8 +27154,8 @@ Date:   Tue Nov 23 13:46:54 2004 +0000
 
     Ajout de documentation dans diffractometer.h .cpp
 
- src/diffractometer.cpp |    8 ++++----
- src/diffractometer.h   |   17 ++++++++++-------
+ src/diffractometer.cpp |  8 ++++----
+ src/diffractometer.h   | 17 ++++++++++-------
  2 files changed, 14 insertions(+), 11 deletions(-)
 
 commit 17356d157b7928925a791d1e6cb13c4fe77f2bf8
@@ -17401,18 +27165,18 @@ Date:   Tue Nov 23 13:23:42 2004 +0000
     Ajout de documentation
     Introduction du 6-cercle dans la doc.
 
- doc/pilotage-diffract.doc |  Bin 297984 -> 328192 bytes
- src/HKLException.h        |   60 +++++++++++++++++-----------------
- src/angleconfig.h         |   71 +++++++++++++++++++++++-----------------
- src/constants.cpp         |   18 +++++++---
- src/constants.h           |   42 ++++++++++++++---------
- src/cristal.cpp           |    2 +
- src/cristal.h             |   80 +++++++++++++++++++++++++++-----------------
- src/diffractometer.h      |   10 ++++--
- src/mode.h                |   46 +++++++++++++-------------
- src/reflection.h          |   36 ++++++++++----------
- src/source.h              |   12 +++---
- src/svecmat.h             |   60 +++++++++++++++++-----------------
+ doc/pilotage-diffract.doc | Bin 297984 -> 328192 bytes
+ src/HKLException.h        |  60 +++++++++++++++++-----------------
+ src/angleconfig.h         |  71 +++++++++++++++++++++++-----------------
+ src/constants.cpp         |  18 +++++++----
+ src/constants.h           |  42 ++++++++++++++----------
+ src/cristal.cpp           |   2 ++
+ src/cristal.h             |  80 ++++++++++++++++++++++++++++------------------
+ src/diffractometer.h      |  10 ++++--
+ src/mode.h                |  46 +++++++++++++-------------
+ src/reflection.h          |  36 ++++++++++-----------
+ src/source.h              |  12 +++----
+ src/svecmat.h             |  60 +++++++++++++++++-----------------
  12 files changed, 243 insertions(+), 194 deletions(-)
 
 commit bef5331a75dbeae8e64f55856b0d5096fab6738a
@@ -17421,9 +27185,10 @@ Date:   Wed Nov 17 15:30:02 2004 +0000
 
     First new project release
 
- src/LibUser.cpp      |  160 ++++++++++++++++++++++++++++++++++++++++++++++++++
- src/test_cristal.cpp |   19 ------
- 2 files changed, 160 insertions(+), 19 deletions(-)
+ src/Exception_hkl.h  |   0
+ src/LibUser.cpp      | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/test_cristal.cpp |  19 ------
+ 3 files changed, 160 insertions(+), 19 deletions(-)
 
 commit 34aadf99f2be0badc07addacb3f7a8d5e8e0187e
 Author: delos <delos>
@@ -17432,8 +27197,8 @@ Date:   Wed Nov 17 15:01:59 2004 +0000
     Architecture de base4
     Modif eulerian bisector mode
 
- src/eulerian_bissectormode4C.cpp |    6 ++++--
- 1 files changed, 4 insertions(+), 2 deletions(-)
+ src/eulerian_bissectormode4C.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
 
 commit a36be9db2cf48dcf8c1f94700bbaf1ead4e2987f
 Author: delos <delos>
@@ -17442,11 +27207,11 @@ Date:   Wed Nov 17 14:27:34 2004 +0000
     Architecture de base4
     Construction de diffractom�tres avec settings diff�r�s
 
- src/cristal.cpp                  |   30 ++
- src/cristal.h                    |    7 +-
- src/diffractometer.cpp           |  657 +++++++++++++++++++++++++++++++++++++-
- src/diffractometer.h             |   62 +++-
- src/eulerian_bissectormode4C.cpp |    8 +-
+ src/cristal.cpp                  |  30 ++
+ src/cristal.h                    |   7 +-
+ src/diffractometer.cpp           | 657 ++++++++++++++++++++++++++++++++++++++-
+ src/diffractometer.h             |  62 +++-
+ src/eulerian_bissectormode4C.cpp |   8 +-
  5 files changed, 735 insertions(+), 29 deletions(-)
 
 commit 3788ff7d571cfdcc30a7f2a01c23d33b9f168030
@@ -17461,18 +27226,18 @@ Date:   Wed Nov 17 10:09:59 2004 +0000
 
     Architecture de base3+constantes
 
- doc/projetHKL_architecture.mdl   |  348 ++++++++++++++++++++++++++++++++------
- src/angleconfig.h                |    2 +-
- src/constants.cpp                |   19 ++
- src/constants.h                  |   76 ++++++++
- src/cristal.cpp                  |   56 +++++--
- src/diffractometer.cpp           |  198 +++++++++++++++-------
- src/diffractometer.h             |   89 +++++-----
- src/eulerian_bissectormode4C.cpp |   43 +++--
- src/main.cpp                     |    5 +-
- src/mode.h                       |   32 ++--
- src/reflection.cpp               |   93 ++++++++++-
- src/reflection.h                 |   56 ++++---
+ doc/projetHKL_architecture.mdl   | 348 ++++++++++++++++++++++++++++++++-------
+ src/angleconfig.h                |   2 +-
+ src/constants.cpp                |  19 +++
+ src/constants.h                  |  76 +++++++++
+ src/cristal.cpp                  |  56 +++++--
+ src/diffractometer.cpp           | 198 +++++++++++++++-------
+ src/diffractometer.h             |  89 +++++-----
+ src/eulerian_bissectormode4C.cpp |  43 +++--
+ src/main.cpp                     |   5 +-
+ src/mode.h                       |  32 ++--
+ src/reflection.cpp               |  93 ++++++++++-
+ src/reflection.h                 |  56 ++++---
  12 files changed, 784 insertions(+), 233 deletions(-)
 
 commit 5fdbdb6a33b117f941446ce191572dde33672886
@@ -17484,21 +27249,22 @@ Date:   Mon Nov 8 16:53:53 2004 +0000
  doc/archi4.mdl                        | 8333 --------------------------------
  doc/archi9.mdl                        | 8369 ---------------------------------
  doc/pilotage-diffract17.doc           |  Bin 262144 -> 0 bytes
+ src/Exception_hkl.h                   |    0
  src/HKLException.cpp                  |  204 +
  src/HKLException.h                    |  193 +
  src/angleconfig.h                     |    1 +
  src/cristal.cpp                       |  132 +
  src/cristal.h                         |   10 +
- src/diffractometer.cpp                |  510 ++-
+ src/diffractometer.cpp                |  510 +-
  src/diffractometer.h                  |    4 +
  src/eulerian_angleconfiguration4C.cpp |   12 +
  src/eulerian_bissectormode4C.cpp      |  114 +-
- src/main.cpp                          |  395 ++-
+ src/main.cpp                          |  395 +-
  src/mode.h                            |   26 +
  src/smatrix.cpp                       |   24 +
  src/source.h                          |    5 +-
  src/svecmat.h                         |    2 +
- 17 files changed, 1600 insertions(+), 16734 deletions(-)
+ 18 files changed, 1600 insertions(+), 16734 deletions(-)
 
 commit a3900e250b93498e3814cddc4271f2382a5e31ff
 Author: delos <delos>
@@ -17506,17 +27272,17 @@ Date:   Tue Nov 2 13:11:27 2004 +0000
 
     Architecture de base2
 
- doc/pilotage-diffract.doc        |  Bin 299520 -> 297984 bytes
- src/cristal.cpp                  |   73 ++++++++++++++++-
- src/cristal.h                    |   42 +++++++---
- src/diffractometer.cpp           |  106 +++++++++++++++++++++-----
- src/diffractometer.h             |   32 ++++++--
- src/eulerian_bissectormode4C.cpp |   66 ++++++++++++++--
- src/main.cpp                     |  157 ++++++++++++++++++++++++++++++--------
- src/mode.h                       |    8 ++
- src/smatrix.cpp                  |    6 +-
- src/svecmat.h                    |    4 +
- src/svector.cpp                  |   17 ++++-
+ doc/pilotage-diffract.doc        | Bin 299520 -> 297984 bytes
+ src/cristal.cpp                  |  73 ++++++++++++++++--
+ src/cristal.h                    |  42 ++++++++---
+ src/diffractometer.cpp           | 106 +++++++++++++++++++++-----
+ src/diffractometer.h             |  32 ++++++--
+ src/eulerian_bissectormode4C.cpp |  66 ++++++++++++++--
+ src/main.cpp                     | 157 +++++++++++++++++++++++++++++++--------
+ src/mode.h                       |   8 ++
+ src/smatrix.cpp                  |   6 +-
+ src/svecmat.h                    |   4 +
+ src/svector.cpp                  |  17 ++++-
  11 files changed, 425 insertions(+), 86 deletions(-)
 
 commit c1bebd3cc88f17ea07caaf19246f463636cc87e4
@@ -17528,7 +27294,7 @@ Date:   Wed Oct 27 10:04:58 2004 +0000
  doc/archi9.mdl                 | 8369 ++++++++++++++++++++++++++++++++++++++++
  doc/pilotage-diffract.doc      |  Bin 0 -> 299520 bytes
  doc/projetHKL_architecture.mdl | 8369 ++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 16738 insertions(+), 0 deletions(-)
+ 3 files changed, 16738 insertions(+)
 
 commit ed4a1031b25909b701420bbd8484ca0f9e31995c
 Author: delos <delos>
@@ -17536,24 +27302,24 @@ Date:   Wed Oct 27 09:58:10 2004 +0000
 
     Architecture de base
 
- src/angleconfig.h                     |  168 ++++++++++++
- src/cristal.cpp                       |   72 +++++
- src/cristal.h                         |   68 +++++
- src/diffractometer.cpp                |  322 +++++++++++++++++++++++
- src/diffractometer.h                  |  171 ++++++++++++
- src/eulerian_angleconfiguration4C.cpp |  110 ++++++++
- src/eulerian_bissectormode4C.cpp      |   77 ++++++
- src/kappa_angleconfiguration4C.cpp    |  107 ++++++++
- src/main.cpp                          |  459 +++++++++++++++++++++++++++++++++
- src/mode.h                            |  118 +++++++++
- src/reflection.cpp                    |   56 ++++
- src/reflection.h                      |   69 +++++
- src/smatrix.cpp                       |  149 +++++++++++
- src/source.cpp                        |   32 +++
- src/source.h                          |   42 +++
- src/svecmat.h                         |  197 ++++++---------
- src/svector.cpp                       |  138 ++++++++++
- src/test_cristal.cpp                  |   19 ++
+ src/angleconfig.h                     | 168 +++++++++++++
+ src/cristal.cpp                       |  72 ++++++
+ src/cristal.h                         |  68 +++++
+ src/diffractometer.cpp                | 322 ++++++++++++++++++++++++
+ src/diffractometer.h                  | 171 +++++++++++++
+ src/eulerian_angleconfiguration4C.cpp | 110 ++++++++
+ src/eulerian_bissectormode4C.cpp      |  77 ++++++
+ src/kappa_angleconfiguration4C.cpp    | 107 ++++++++
+ src/main.cpp                          | 459 ++++++++++++++++++++++++++++++++++
+ src/mode.h                            | 118 +++++++++
+ src/reflection.cpp                    |  56 +++++
+ src/reflection.h                      |  69 +++++
+ src/smatrix.cpp                       | 149 +++++++++++
+ src/source.cpp                        |  32 +++
+ src/source.h                          |  42 ++++
+ src/svecmat.h                         | 197 ++++++---------
+ src/svector.cpp                       | 138 ++++++++++
+ src/test_cristal.cpp                  |  19 ++
  18 files changed, 2253 insertions(+), 121 deletions(-)
 
 commit 6dd18d2a81df01d5433979d7850187599f2c4548
@@ -17565,4 +27331,4 @@ Date:   Thu Oct 14 15:35:59 2004 +0000
  doc/archi4.mdl              | 8333 +++++++++++++++++++++++++++++++++++++++++++
  doc/pilotage-diffract17.doc |  Bin 0 -> 262144 bytes
  src/svecmat.h               |  158 +
- 3 files changed, 8491 insertions(+), 0 deletions(-)
+ 3 files changed, 8491 insertions(+)
diff --git a/Documentation/Makefile.am b/Documentation/Makefile.am
index a516906..fb06e95 100644
--- a/Documentation/Makefile.am
+++ b/Documentation/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS=api
+SUBDIRS=api figures sphinx
 
 info_TEXINFOS = hkl.texi
 
diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in
index 1408ffe..07397c1 100644
--- a/Documentation/Makefile.in
+++ b/Documentation/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,51 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,9 +78,10 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = Documentation
-DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(srcdir)/stamp-vti \
-	$(srcdir)/version.texi
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/mdate-sh $(srcdir)/version.texi \
+	$(srcdir)/stamp-vti $(top_srcdir)/config/texinfo.tex \
+	$(dist_man_MANS)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -48,8 +93,48 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
+AM_V_DVIPS = $(am__v_DVIPS_ at AM_V@)
+am__v_DVIPS_ = $(am__v_DVIPS_ at AM_DEFAULT_V@)
+am__v_DVIPS_0 = @echo "  DVIPS   " $@;
+am__v_DVIPS_1 = 
+AM_V_MAKEINFO = $(am__v_MAKEINFO_ at AM_V@)
+am__v_MAKEINFO_ = $(am__v_MAKEINFO_ at AM_DEFAULT_V@)
+am__v_MAKEINFO_0 = @echo "  MAKEINFO" $@;
+am__v_MAKEINFO_1 = 
+AM_V_INFOHTML = $(am__v_INFOHTML_ at AM_V@)
+am__v_INFOHTML_ = $(am__v_INFOHTML_ at AM_DEFAULT_V@)
+am__v_INFOHTML_0 = @echo "  INFOHTML" $@;
+am__v_INFOHTML_1 = 
+AM_V_TEXI2DVI = $(am__v_TEXI2DVI_ at AM_V@)
+am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_ at AM_DEFAULT_V@)
+am__v_TEXI2DVI_0 = @echo "  TEXI2DVI" $@;
+am__v_TEXI2DVI_1 = 
+AM_V_TEXI2PDF = $(am__v_TEXI2PDF_ at AM_V@)
+am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_ at AM_DEFAULT_V@)
+am__v_TEXI2PDF_0 = @echo "  TEXI2PDF" $@;
+am__v_TEXI2PDF_1 = 
+AM_V_texinfo = $(am__v_texinfo_ at AM_V@)
+am__v_texinfo_ = $(am__v_texinfo_ at AM_DEFAULT_V@)
+am__v_texinfo_0 = -q
+am__v_texinfo_1 = 
+AM_V_texidevnull = $(am__v_texidevnull_ at AM_V@)
+am__v_texidevnull_ = $(am__v_texidevnull_ at AM_DEFAULT_V@)
+am__v_texidevnull_0 = > /dev/null
+am__v_texidevnull_1 = 
 INFO_DEPS = $(srcdir)/hkl.info
 TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex
 am__TEXINFO_TEX_DIR = $(top_srcdir)/config
@@ -63,13 +148,19 @@ TEXI2PDF = $(TEXI2DVI) --pdf --batch
 MAKEINFOHTML = $(MAKEINFO) --html
 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
 DVIPS = dvips
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
@@ -92,14 +183,40 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 man1dir = $(mandir)/man1
 NROFF = nroff
 MANS = $(dist_man_MANS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
 	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
@@ -132,7 +249,9 @@ am__relativize = \
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
+ASY = @ASY@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -149,6 +268,7 @@ CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -157,13 +277,29 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
 GTKMM_CFLAGS = @GTKMM_CFLAGS@
 GTKMM_LIBS = @GTKMM_LIBS@
 HTML_DIR = @HTML_DIR@
@@ -172,6 +308,14 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
@@ -180,7 +324,10 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -203,12 +350,17 @@ RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHTOOL = @SHTOOL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -242,14 +394,15 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+release_info = @release_info@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -258,7 +411,8 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = api
+version_info = @version_info@
+SUBDIRS = api figures sphinx
 info_TEXINFOS = hkl.texi
 dist_man_MANS = ghkl.1
 all: all-recursive
@@ -303,7 +457,7 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 .texi.info:
-	restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+	$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
 	am__cwd=`pwd` && $(am__cd) $(srcdir) && \
 	rm -rf $$backupdir && mkdir $$backupdir && \
 	if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
@@ -325,18 +479,20 @@ clean-libtool:
 	rm -rf $$backupdir; exit $$rc
 
 .texi.dvi:
-	TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-	$(TEXI2DVI) $<
+	$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
+	$<
 
 .texi.pdf:
-	TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
-	$(TEXI2PDF) $<
+	$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
+	$<
 
 .texi.html:
-	rm -rf $(@:.html=.htp)
-	if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+	$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
+	$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
 	 -o $(@:.html=.htp) $<; \
 	then \
 	  rm -rf $@; \
@@ -371,8 +527,8 @@ mostlyclean-vti:
 maintainer-clean-vti:
 	-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
 .dvi.ps:
-	TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-	$(DVIPS) -o $@ $<
+	$(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+	$(DVIPS) $(AM_V_texinfo) -o $@ $<
 
 uninstall-dvi-am:
 	@$(NORMAL_UNINSTALL)
@@ -394,9 +550,7 @@ uninstall-html-am:
 
 uninstall-info-am:
 	@$(PRE_UNINSTALL)
-	@if test -d '$(DESTDIR)$(infodir)' && \
-	    (install-info --version && \
-	     install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+	@if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
 	  list='$(INFO_DEPS)'; \
 	  for file in $$list; do \
 	    relfile=`echo "$$file" | sed 's|^.*/||'`; \
@@ -453,8 +607,7 @@ dist-info: $(INFO_DEPS)
 	done
 
 mostlyclean-aminfo:
-	-rm -rf hkl.aux hkl.cp hkl.cps hkl.fn hkl.fns hkl.ky hkl.kys hkl.log hkl.pg \
-	  hkl.tmp hkl.toc hkl.tp hkl.tps hkl.vr hkl.vrs
+	-rm -rf hkl.t2d hkl.t2p
 
 clean-aminfo:
 	-test -z "hkl.dvi hkl.pdf hkl.ps hkl.html" \
@@ -468,11 +621,18 @@ maintainer-clean-aminfo:
 	done
 install-man1: $(dist_man_MANS)
 	@$(NORMAL_INSTALL)
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	{ for i in $$list; do echo "$$i"; done; \
-	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
+	@list1=''; \
+	list2='$(dist_man_MANS)'; \
+	test -n "$(man1dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.1[a-z]*$$/p'; \
+	fi; \
 	} | while read p; do \
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; echo "$$p"; \
@@ -501,27 +661,28 @@ uninstall-man1:
 	  sed -n '/\.1[a-z]*$$/p'; \
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	test -z "$$files" || { \
-	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -536,57 +697,12 @@ $(RECURSIVE_TARGETS):
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -602,12 +718,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -619,15 +730,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -636,24 +743,26 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
-	@list='$(MANS)'; if test -n "$$list"; then \
-	  list=`for p in $$list; do \
-	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-	  if test -n "$$list" && \
-	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
-	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
-	    exit 1; \
-	  else :; fi; \
-	else :; fi
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -685,13 +794,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -732,10 +838,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -773,8 +884,11 @@ install-dvi: install-dvi-recursive
 
 install-dvi-am: $(DVIS)
 	@$(NORMAL_INSTALL)
-	test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)"
 	@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -789,18 +903,22 @@ install-html: install-html-recursive
 
 install-html-am: $(HTMLS)
 	@$(NORMAL_INSTALL)
-	test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
 	@list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  $(am__strip_dir) \
-	  if test -d "$$d$$p"; then \
+	  d2=$$d$$p; \
+	  if test -d "$$d2"; then \
 	    echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
 	    $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
-	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
-	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
+	    echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
 	  else \
-	    list2="$$list2 $$d$$p"; \
+	    list2="$$list2 $$d2"; \
 	  fi; \
 	done; \
 	test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
@@ -812,9 +930,12 @@ install-info: install-info-recursive
 
 install-info-am: $(INFO_DEPS)
 	@$(NORMAL_INSTALL)
-	test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)"
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
+	fi; \
 	for file in $$list; do \
 	  case $$file in \
 	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
@@ -832,8 +953,7 @@ install-info-am: $(INFO_DEPS)
 	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
 	  $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
 	@$(POST_INSTALL)
-	@if (install-info --version && \
-	     install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+	@if $(am__can_run_installinfo); then \
 	  list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
 	  for file in $$list; do \
 	    relfile=`echo "$$file" | sed 's|^.*/||'`; \
@@ -847,8 +967,11 @@ install-pdf: install-pdf-recursive
 
 install-pdf-am: $(PDFS)
 	@$(NORMAL_INSTALL)
-	test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)"
 	@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -860,8 +983,11 @@ install-ps: install-ps-recursive
 
 install-ps-am: $(PSS)
 	@$(NORMAL_INSTALL)
-	test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)"
 	@list='$(PSS)'; test -n "$(psdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -894,12 +1020,11 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
 
 uninstall-man: uninstall-man1
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
-	install-am install-strip tags-recursive
+.MAKE: $(am__recursive_targets) install-am install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am check check-am clean clean-aminfo clean-generic \
-	clean-libtool ctags ctags-recursive dist-info distclean \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-aminfo clean-generic clean-libtool \
+	cscopelist-am ctags ctags-am dist-info distclean \
 	distclean-generic distclean-libtool distclean-tags distdir dvi \
 	dvi-am html html-am info info-am install install-am \
 	install-data install-data-am install-dvi install-dvi-am \
@@ -910,8 +1035,8 @@ uninstall-man: uninstall-man1
 	installdirs-am maintainer-clean maintainer-clean-aminfo \
 	maintainer-clean-generic maintainer-clean-vti mostlyclean \
 	mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool \
-	mostlyclean-vti pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am uninstall-dvi-am uninstall-html-am \
+	mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-dvi-am uninstall-html-am \
 	uninstall-info-am uninstall-man uninstall-man1 \
 	uninstall-pdf-am uninstall-ps-am
 
diff --git a/Documentation/api/Makefile.am b/Documentation/api/Makefile.am
index 152b833..49d4ecb 100644
--- a/Documentation/api/Makefile.am
+++ b/Documentation/api/Makefile.am
@@ -12,7 +12,7 @@ AUTOMAKE_OPTIONS = 1.6
 DOC_MODULE=hkl
 
 # Uncomment for versioned docs and specify the version of the module, e.g. '2'.
-DOC_MODULE_VERSION=4
+DOC_MODULE_VERSION=5
 
 # The top-level SGML file. You can change this if you want to.
 DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
diff --git a/Documentation/api/Makefile.in b/Documentation/api/Makefile.in
index f6eab23..7d88278 100644
--- a/Documentation/api/Makefile.in
+++ b/Documentation/api/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -21,6 +20,51 @@
 # Everything below here is generic #
 ####################################
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -39,8 +83,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(top_srcdir)/gtk-doc.make
+DIST_COMMON = $(top_srcdir)/gtk-doc.make $(srcdir)/Makefile.in \
+	$(srcdir)/Makefile.am
 subdir = Documentation/api
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
@@ -53,13 +97,33 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
+ASY = @ASY@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -76,6 +140,7 @@ CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -84,13 +149,29 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
 GTKMM_CFLAGS = @GTKMM_CFLAGS@
 GTKMM_LIBS = @GTKMM_LIBS@
 HTML_DIR = @HTML_DIR@
@@ -99,6 +180,14 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
@@ -107,7 +196,10 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -130,12 +222,17 @@ RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHTOOL = @SHTOOL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -169,14 +266,15 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+release_info = @release_info@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -185,6 +283,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+version_info = @version_info@
 
 # We require automake 1.6 at least.
 AUTOMAKE_OPTIONS = 1.6
@@ -198,7 +297,7 @@ AUTOMAKE_OPTIONS = 1.6
 DOC_MODULE = hkl
 
 # Uncomment for versioned docs and specify the version of the module, e.g. '2'.
-DOC_MODULE_VERSION = 4
+DOC_MODULE_VERSION = 5
 
 # The top-level SGML file. You can change this if you want to.
 DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml
@@ -265,10 +364,10 @@ expand_content_files =
 # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
 GTKDOC_CFLAGS = 
 GTKDOC_LIBS = 
- at GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- at GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- at GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
- at GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+ at GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ at GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ at GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+ at GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
 @GTK_DOC_USE_LIBTOOL_FALSE at GTKDOC_RUN = 
 @GTK_DOC_USE_LIBTOOL_TRUE at GTKDOC_RUN = $(LIBTOOL) --mode=execute
 
@@ -279,17 +378,21 @@ GTKDOC_LIBS =
 #
 GPATH = $(srcdir)
 TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE)
+SETUP_FILES = \
+	$(content_files)		\
+	$(DOC_MAIN_SGML_FILE)		\
+	$(DOC_MODULE)-sections.txt	\
+	$(DOC_MODULE)-overrides.txt
+
 
 # This includes the standard gtk-doc make rules, copied by gtkdocize.
 
 # Other files to distribute
 # e.g. EXTRA_DIST += version.xml.in
-EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \
-	$(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
-DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
-	pdf-build.stamp \
-	$(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
-	$(srcdir)/pdf.stamp
+EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES)
+DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \
+	html-build.stamp pdf-build.stamp \
+	sgml.stamp html.stamp pdf.stamp
 
 SCANOBJ_FILES = \
 	$(DOC_MODULE).args 	 \
@@ -332,6 +435,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
 	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
 	esac;
+$(top_srcdir)/gtk-doc.make:
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -347,11 +451,11 @@ mostlyclean-libtool:
 
 clean-libtool:
 	-rm -rf .libs _libs
-tags: TAGS
-TAGS:
+tags TAGS:
+
+ctags CTAGS:
 
-ctags: CTAGS
-CTAGS:
+cscope cscopelist:
 
 
 distdir: $(DISTFILES)
@@ -401,10 +505,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -487,18 +596,18 @@ uninstall-am: uninstall-local
 .MAKE: install-am install-strip
 
 .PHONY: all all-am all-local check check-am clean clean-generic \
-	clean-libtool clean-local dist-hook distclean \
-	distclean-generic distclean-libtool distclean-local distdir \
-	dvi dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-data-local install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic \
+	clean-libtool clean-local cscopelist-am ctags-am dist-hook \
+	distclean distclean-generic distclean-libtool distclean-local \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-data-local \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
 	maintainer-clean-local mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
-	uninstall-local
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-local
 
 
 @ENABLE_GTK_DOC_TRUE at all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
@@ -508,22 +617,44 @@ docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
 
 $(REPORT_FILES): sgml-build.stamp
 
+#### setup ####
+
+setup-build.stamp:
+	- at if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+	    echo '  DOC   Preparing build'; \
+	    files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
+	    if test "x$$files" != "x" ; then \
+	        for file in $$files ; do \
+	            test -f $(abs_srcdir)/$$file && \
+	                cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+	        done; \
+	    fi; \
+	fi
+	@touch setup-build.stamp
+
 #### scan ####
 
 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
-	@echo 'gtk-doc: Scanning header files'
-	@-chmod -R u+w $(srcdir)
-	@_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+	@echo '  DOC   Scanning header files'
+	@_source_dir='' ; \
+	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
-	  done ; \
-	  cd $(srcdir) && \
-	  gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
-	@if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
-	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+	done ; \
+	gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
+	@if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
+	    echo "  DOC   Introspecting gobjects"; \
+	    scanobj_options=""; \
+	    gtkdoc-scangobj 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	    if test "$(?)" = "0"; then \
+	        if test "x$(V)" = "x1"; then \
+	            scanobj_options="--verbose"; \
+	        fi; \
+	    fi; \
+	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+	    gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
 	else \
-	    cd $(srcdir) ; \
 	    for i in $(SCANOBJ_FILES) ; do \
-               test -f $$i || touch $$i ; \
+	        test -f $$i || touch $$i ; \
 	    done \
 	fi
 	@touch scan-build.stamp
@@ -531,30 +662,15 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
 	@true
 
-#### templates ####
-
-tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
-	@echo 'gtk-doc: Rebuilding template files'
-	@-chmod -R u+w $(srcdir)
-	@cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
-	@touch tmpl-build.stamp
-
-tmpl.stamp: tmpl-build.stamp
-	@true
-
-$(srcdir)/tmpl/*.sgml:
-	@true
-
 #### xml ####
 
-sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
-	@echo 'gtk-doc: Building XML'
-	@-chmod -R u+w $(srcdir)
-	@_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
+	@echo '  DOC   Building XML'
+	@_source_dir='' ; \
+	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
-	  done ; \
-	  cd $(srcdir) && \
-	  gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
+	done ; \
+	gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
 	@touch sgml-build.stamp
 
 sgml.stamp: sgml-build.stamp
@@ -563,58 +679,78 @@ sgml.stamp: sgml-build.stamp
 #### html ####
 
 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo 'gtk-doc: Building HTML'
-	@-chmod -R u+w $(srcdir)
-	@rm -rf $(srcdir)/html
-	@mkdir $(srcdir)/html
+	@echo '  DOC   Building HTML'
+	@rm -rf html
+	@mkdir html
 	@mkhtml_options=""; \
+	gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	if test "$(?)" = "0"; then \
+	  if test "x$(V)" = "x1"; then \
+	    mkhtml_options="$$mkhtml_options --verbose"; \
+	  fi; \
+	fi; \
 	gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-path"; \
 	if test "$(?)" = "0"; then \
-	  mkhtml_options=--path="$(srcdir)"; \
+	  mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
 	fi; \
-	cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
-	@test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
-	@echo 'gtk-doc: Fixing cross-references'
-	@cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+	cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+	- at test "x$(HTML_IMAGES)" = "x" || \
+	for file in $(HTML_IMAGES) ; do \
+	  if test -f $(abs_srcdir)/$$file ; then \
+	    cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
+	  fi; \
+	  if test -f $(abs_builddir)/$$file ; then \
+	    cp $(abs_builddir)/$$file $(abs_builddir)/html; \
+	  fi; \
+	done;
+	@echo '  DOC   Fixing cross-references'
+	@gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
 	@touch html-build.stamp
 
 #### pdf ####
 
 pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo 'gtk-doc: Building PDF'
-	@-chmod -R u+w $(srcdir)
-	@rm -rf $(srcdir)/$(DOC_MODULE).pdf
-	@mkpdf_imgdirs=""; \
+	@echo '  DOC   Building PDF'
+	@rm -f $(DOC_MODULE).pdf
+	@mkpdf_options=""; \
+	gtkdoc-mkpdf 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	if test "$(?)" = "0"; then \
+	  if test "x$(V)" = "x1"; then \
+	    mkpdf_options="$$mkpdf_options --verbose"; \
+	  fi; \
+	fi; \
 	if test "x$(HTML_IMAGES)" != "x"; then \
 	  for img in $(HTML_IMAGES); do \
 	    part=`dirname $$img`; \
-	    echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+	    echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
 	    if test $$? != 0; then \
-	      mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+	      mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
 	    fi; \
 	  done; \
 	fi; \
-	cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+	gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
 	@touch pdf-build.stamp
 
 ##############
 
 clean-local:
-	rm -f *~ *.bak
-	rm -rf .libs
+	@rm -f *~ *.bak
+	@rm -rf .libs
 
 distclean-local:
-	cd $(srcdir) && \
-	  rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
-	         $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+	@rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
+	    $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+	@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+	    rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
+	fi
 
 maintainer-clean-local: clean
-	cd $(srcdir) && rm -rf xml html
+	@rm -rf xml html
 
 install-data-local:
-	@installfiles=`echo $(srcdir)/html/*`; \
-	if test "$$installfiles" = '$(srcdir)/html/*'; \
-	then echo '-- Nothing to install' ; \
+	@installfiles=`echo $(builddir)/html/*`; \
+	if test "$$installfiles" = '$(builddir)/html/*'; \
+	then echo 1>&2 'Nothing to install' ; \
 	else \
 	  if test -n "$(DOC_MODULE_VERSION)"; then \
 	    installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
@@ -623,14 +759,12 @@ install-data-local:
 	  fi; \
 	  $(mkinstalldirs) $${installdir} ; \
 	  for i in $$installfiles; do \
-	    echo '-- Installing '$$i ; \
+	    echo ' $(INSTALL_DATA) '$$i ; \
 	    $(INSTALL_DATA) $$i $${installdir}; \
 	  done; \
 	  if test -n "$(DOC_MODULE_VERSION)"; then \
 	    mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
 	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
-	    mv -f $${installdir}/$(DOC_MODULE).devhelp \
-	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
 	  fi; \
 	  $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
 	fi
@@ -652,15 +786,13 @@ uninstall-local:
 @ENABLE_GTK_DOC_FALSE@	@false
 
 dist-hook: dist-check-gtkdoc dist-hook-local
-	mkdir $(distdir)/tmpl
-	mkdir $(distdir)/html
-	-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
-	cp $(srcdir)/html/* $(distdir)/html
-	-cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
-	-cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
-	-cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
-	cd $(distdir) && rm -f $(DISTCLEANFILES)
-	$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+	@mkdir $(distdir)/html
+	@cp ./html/* $(distdir)/html
+	@-cp ./$(DOC_MODULE).pdf $(distdir)/
+	@-cp ./$(DOC_MODULE).types $(distdir)/
+	@-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
+	@cd $(distdir) && rm -f $(DISTCLEANFILES)
+	@$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
 
 .PHONY : dist-hook-local docs
 
diff --git a/Documentation/api/hkl-sections.txt b/Documentation/api/hkl-sections.txt
index c548bf5..dbd7269 100644
--- a/Documentation/api/hkl-sections.txt
+++ b/Documentation/api/hkl-sections.txt
@@ -1,17 +1,17 @@
 <SECTION>
 <FILE>hkl-pseudoaxis-zaxis</FILE>
-hkl_pseudo_axis_engine_zaxis_hkl_new
+hkl_engine_zaxis_hkl_new
 </SECTION>
 
 <SECTION>
 <FILE>hkl-pseudoaxis-common-eulerians</FILE>
-hkl_pseudo_axis_engine_eulerians_new
+hkl_engine_eulerians_new
 </SECTION>
 
 <SECTION>
 <FILE>hkl-pseudoaxis-e6c</FILE>
-hkl_pseudo_axis_engine_e6c_hkl_new
-hkl_pseudo_axis_engine_e6c_psi_new
+hkl_engine_e6c_hkl_new
+hkl_engine_e6c_psi_new
 </SECTION>
 
 <SECTION>
@@ -69,8 +69,8 @@ hkl_quaternion_to_angle_and_axe
 
 <SECTION>
 <FILE>hkl-pseudoaxis-k4cv</FILE>
-hkl_pseudo_axis_engine_k4cv_hkl_new
-hkl_pseudo_axis_engine_k4cv_psi_new
+hkl_engine_k4cv_hkl_new
+hkl_engine_k4cv_psi_new
 </SECTION>
 
 <SECTION>
@@ -111,36 +111,36 @@ hkl_parameter_fprintf
 <SECTION>
 <FILE>hkl-pseudoaxis</FILE>
 HklPseudoAxis
-HklPseudoAxisEngineMode
-HklPseudoAxisEngine
-HklPseudoAxisEngineList
-HklPseudoAxisEngineModeFunc
+HklMode
+HklEngine
+HklEngineList
+HklModeFunc
 HklFunction
 hkl_pseudo_axis_new
 hkl_pseudo_axis_init
 hkl_pseudo_axis_free
 hkl_pseudo_axis_fprintf
-hkl_pseudo_axis_engine_mode_new
-hkl_pseudo_axis_engine_mode_init
-hkl_pseudo_axis_engine_mode_free
-hkl_pseudo_axis_engine_new
-hkl_pseudo_axis_engine_free
-hkl_pseudo_axis_engine_add_mode
-hkl_pseudo_axis_engine_add_geometry
-hkl_pseudo_axis_engine_select_mode
-hkl_pseudo_axis_engine_initialize
-hkl_pseudo_axis_engine_set
-hkl_pseudo_axis_engine_get
-hkl_pseudo_axis_engine_fprintf
-hkl_pseudo_axis_engine_list_new
-hkl_pseudo_axis_engine_list_free
-hkl_pseudo_axis_engine_list_add
-hkl_pseudo_axis_engine_list_get_by_name
-hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name
-hkl_pseudo_axis_engine_list_clear
-hkl_pseudo_axis_engine_list_init
-hkl_pseudo_axis_engine_list_get
-hkl_pseudo_axis_engine_list_fprintf
+hkl_mode_new
+hkl_mode_init
+hkl_mode_free
+hkl_engine_new
+hkl_engine_free
+hkl_engine_add_mode
+hkl_engine_add_geometry
+hkl_engine_select_mode
+hkl_engine_initialize
+hkl_engine_set
+hkl_engine_get
+hkl_engine_fprintf
+hkl_engine_list_new
+hkl_engine_list_free
+hkl_engine_list_add
+hkl_engine_list_get_by_name
+hkl_engine_list_get_pseudo_axis_by_name
+hkl_engine_list_clear
+hkl_engine_list_init
+hkl_engine_list_get
+hkl_engine_list_fprintf
 </SECTION>
 
 <SECTION>
@@ -189,13 +189,13 @@ hkl_geometry_factory_new
 
 <SECTION>
 <FILE>hkl-pseudoaxis-auto</FILE>
-hkl_pseudo_axis_engine_mode_set_real
+hkl_mode_set_real
 </SECTION>
 
 <SECTION>
 <FILE>hkl-pseudoaxis-e4cv</FILE>
-hkl_pseudo_axis_engine_e4cv_hkl_new
-hkl_pseudo_axis_engine_e4cv_psi_new
+hkl_engine_e4cv_hkl_new
+hkl_engine_e4cv_psi_new
 </SECTION>
 
 <SECTION>
@@ -230,8 +230,8 @@ HKL_MALLOC
 
 <SECTION>
 <FILE>hkl-pseudoaxis-k6c</FILE>
-hkl_pseudo_axis_engine_k6c_hkl_new
-hkl_pseudo_axis_engine_k6c_psi_new
+hkl_engine_k6c_hkl_new
+hkl_engine_k6c_psi_new
 </SECTION>
 
 <SECTION>
@@ -259,9 +259,9 @@ double_diffraction_func
 psi_constant_vertical_func
 RUBh_minus_Q
 double_diffraction
-hkl_pseudo_axis_engine_mode_get_hkl_real
-hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real
-hkl_pseudo_axis_engine_hkl_new
+hkl_mode_get_hkl_real
+hkl_mode_init_psi_constant_vertical_real
+hkl_engine_hkl_new
 </SECTION>
 
 <SECTION>
@@ -299,7 +299,7 @@ HKL_LIST_DEL_ITEM_DESTRUCTOR
 
 <SECTION>
 <FILE>hkl-pseudoaxis-common</FILE>
-hkl_pseudo_axis_engine_init_func
+hkl_engine_init_func
 </SECTION>
 
 <SECTION>
@@ -369,20 +369,20 @@ hkl_axis_fprintf
 
 <SECTION>
 <FILE>hkl-pseudoaxis-factory</FILE>
-hkl_pseudo_axis_engine_list_factory
+hkl_engine_list_factory
 </SECTION>
 
 <SECTION>
 <FILE>hkl-pseudoaxis-common-psi</FILE>
-HklPseudoAxisEngineModePsi
-hkl_pseudo_axis_engine_mode_psi_new
-hkl_pseudo_axis_engine_psi_new
+HklModePsi
+hkl_mode_psi_new
+hkl_engine_psi_new
 </SECTION>
 
 <SECTION>
 <FILE>hkl-pseudoaxis-common-q</FILE>
-hkl_pseudo_axis_engine_q_new
-hkl_pseudo_axis_engine_q2_new
+hkl_engine_q_new
+hkl_engine_q2_new
 </SECTION>
 
 <SECTION>
diff --git a/Documentation/api/html/annotation-glossary.html b/Documentation/api/html/annotation-glossary.html
new file mode 100644
index 0000000..1d492aa
--- /dev/null
+++ b/Documentation/api/html/annotation-glossary.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Annotation Glossary</title>
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
+<link rel="home" href="index.html" title="hkl Reference Manual">
+<link rel="up" href="index.html" title="hkl Reference Manual">
+<link rel="prev" href="api-index-full.html" title="API Index">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
+<link rel="stylesheet" href="style.css" type="text/css">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="p" href="api-index-full.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td> </td>
+<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
+<th width="100%" align="center">hkl Reference Manual</th>
+<td> </td>
+</tr>
+<tr><td colspan="5" class="shortcuts">
+<a class="shortcut" href="#glsO">O</a>
+                      | 
+                   <a class="shortcut" href="#glsI">I</a>
+                      | 
+                   <a class="shortcut" href="#glsT">T</a>
+</td></tr>
+</table>
+<div class="glossary">
+<div class="titlepage"><div><div><h1 class="title">
+<a name="annotation-glossary"></a>Annotation Glossary</h1></div></div></div>
+<a name="glsO"></a><h3 class="title">O</h3>
+<dt><span class="glossterm"><a name="annotation-glossterm-out"></a>out</span></dt>
+<dd class="glossdef"><p>Parameter for returning results. Default is <acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>.</p></dd>
+<a name="glsI"></a><h3 class="title">I</h3>
+<dt><span class="glossterm"><a name="annotation-glossterm-in"></a>in</span></dt>
+<dd class="glossdef"><p>Parameter for input. Default is <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>.</p></dd>
+<a name="glsT"></a><h3 class="title">T</h3>
+<dt><span class="glossterm"><a name="annotation-glossterm-transfer%20full"></a>transfer full</span></dt>
+<dd class="glossdef"><p>Free data after the code is done.</p></dd>
+<dt><span class="glossterm"><a name="annotation-glossterm-transfer%20none"></a>transfer none</span></dt>
+<dd class="glossdef"><p>Don't free data after the code is done.</p></dd>
+</div>
+<div class="footer">
+<hr>
+          Generated by GTK-Doc V1.18</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/Documentation/api/html/api-index-full.html b/Documentation/api/html/api-index-full.html
index 9393a05..506e3d1 100644
--- a/Documentation/api/html/api-index-full.html
+++ b/Documentation/api/html/api-index-full.html
@@ -3,11 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>API Index</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="index.html" title="hkl Reference Manual">
 <link rel="prev" href="object-tree.html" title="Object Hierarchy">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<link rel="next" href="annotation-glossary.html" title="Annotation Glossary">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -17,13 +18,11 @@
 <td> </td>
 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 <th width="100%" align="center">hkl Reference Manual</th>
-<td> </td>
+<td><a accesskey="n" href="annotation-glossary.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 </tr>
 <tr><td colspan="5" class="shortcuts">
 <a class="shortcut" href="#idxA">A</a>
                       | 
-                   <a class="shortcut" href="#idxB">B</a>
-                      | 
                    <a class="shortcut" href="#idxD">D</a>
                       | 
                    <a class="shortcut" href="#idxE">E</a>
@@ -50,16 +49,14 @@
                       | 
                    <a class="shortcut" href="#idxS">S</a>
                       | 
-                   <a class="shortcut" href="#idxT">T</a>
-                      | 
                    <a class="shortcut" href="#idxU">U</a>
                       | 
                    <a class="shortcut" href="#idxV">V</a>
 </td></tr>
 </table>
-<div class="index" title="API Index">
-<div class="titlepage"><div><div><h2 class="title">
-<a name="api-index-full"></a>API Index</h2></div></div></div>
+<div class="index">
+<div class="titlepage"><div><div><h1 class="title">
+<a name="api-index-full"></a>API Index</h1></div></div></div>
 <a name="idx"></a><a name="idxA"></a><h3 class="title">A</h3>
 <dt>
 <a class="link" href="hkl-hkl-macros.html#ALLOC-GROW:CAPS" title="ALLOC_GROW()">ALLOC_GROW</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
@@ -74,154 +71,101 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis">HklAxis</a>, struct in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-fprintf" title="hkl_axis_fprintf ()">hkl_axis_fprintf</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-free" title="hkl_axis_free ()">hkl_axis_free</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-changed" title="hkl_axis_get_changed ()">hkl_axis_get_changed</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-max" title="hkl_axis_get_max ()">hkl_axis_get_max</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-name" title="hkl_axis_get_name ()">hkl_axis_get_name</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-quaternion" title="hkl_axis_get_quaternion ()">hkl_axis_get_quaternion</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-range-unit" title="hkl_axis_get_range_unit ()">hkl_axis_get_range_unit</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-value" title="hkl_axis_get_value ()">hkl_axis_get_value</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-value-closest" title="hkl_axis_get_value_closest ()">hkl_axis_get_value_closest</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-value-closest-unit" title="hkl_axis_get_value_closest_unit ()">hkl_axis_get_value_closest_unit</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-get-value-unit" title="hkl_axis_get_value_unit ()">hkl_axis_get_value_unit</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-init" title="hkl_axis_init ()">hkl_axis_init</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-is-valid" title="hkl_axis_is_valid ()">hkl_axis_is_valid</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-axis.html#HklAxis" title="struct HklAxis">HklAxis</a>, struct in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
 </dt>
 <dd></dd>
+<a name="idxD"></a><h3 class="title">D</h3>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-is-value-compatible-with-range" title="hkl_axis_is_value_compatible_with_range ()">hkl_axis_is_value_compatible_with_range</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector">HklDetector</a>, struct in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-new" title="hkl_axis_new ()">hkl_axis_new</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-detector.html#hkl-detector-attach-to-holder" title="hkl_detector_attach_to_holder ()">hkl_detector_attach_to_holder</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-randomize" title="hkl_axis_randomize ()">hkl_axis_randomize</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-detector.html#hkl-detector-compute-kf" title="hkl_detector_compute_kf ()">hkl_detector_compute_kf</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-set-changed" title="hkl_axis_set_changed ()">hkl_axis_set_changed</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-detector.html#hkl-detector-new" title="hkl_detector_new ()">hkl_detector_new</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-set-range" title="hkl_axis_set_range ()">hkl_axis_set_range</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-detector.html#hkl-detector-new-copy" title="hkl_detector_new_copy ()">hkl_detector_new_copy</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
 </dt>
 <dd></dd>
+<a name="idxE"></a><h3 class="title">E</h3>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-set-range-unit" title="hkl_axis_set_range_unit ()">hkl_axis_set_range_unit</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine">HklEngine</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-set-value" title="hkl_axis_set_value ()">hkl_axis_set_value</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList">HklEngineList</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-set-value-smallest-in-range" title="hkl_axis_set_value_smallest_in_range ()">hkl_axis_set_value_smallest_in_range</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-pseudoaxis-e6c.html#hkl-engine-e6c-hkl-new" title="hkl_engine_e6c_hkl_new ()">hkl_engine_e6c_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e6c.html" title="hkl-pseudoaxis-e6c">hkl-pseudoaxis-e6c</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-axis.html#hkl-axis-set-value-unit" title="hkl_axis_set_value_unit ()">hkl_axis_set_value_unit</a>, function in <a class="link" href="hkl-hkl-axis.html" title="hkl-axis">hkl-axis</a>
+<a class="link" href="hkl-hkl-pseudoaxis-e6c.html#hkl-engine-e6c-psi-new" title="hkl_engine_e6c_psi_new ()">hkl_engine_e6c_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e6c.html" title="hkl-pseudoaxis-e6c">hkl-pseudoaxis-e6c</a>
 </dt>
 <dd></dd>
-<a name="idxB"></a><h3 class="title">B</h3>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-BEGIN-DECLS:CAPS" title="HKL_BEGIN_DECLS">HKL_BEGIN_DECLS</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-eulerians.html#hkl-engine-eulerians-new" title="hkl_engine_eulerians_new ()">hkl_engine_eulerians_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians.html" title="hkl-pseudoaxis-common-eulerians">hkl-pseudoaxis-common-eulerians</a>
 </dt>
 <dd></dd>
-<a name="idxD"></a><h3 class="title">D</h3>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-DEGTORAD:CAPS" title="HKL_DEGTORAD">HKL_DEGTORAD</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-engine-hkl-new" title="hkl_engine_hkl_new ()">hkl_engine_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector">HklDetector</a>, struct in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
+<a class="link" href="hkl-hkl-pseudoaxis-k4cv.html#hkl-engine-k4cv-hkl-new" title="hkl_engine_k4cv_hkl_new ()">hkl_engine_k4cv_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k4cv.html" title="hkl-pseudoaxis-k4cv">hkl-pseudoaxis-k4cv</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector.html#hkl-detector-attach-to-holder" title="hkl_detector_attach_to_holder ()">hkl_detector_attach_to_holder</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
+<a class="link" href="hkl-hkl-pseudoaxis-k4cv.html#hkl-engine-k4cv-psi-new" title="hkl_engine_k4cv_psi_new ()">hkl_engine_k4cv_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k4cv.html" title="hkl-pseudoaxis-k4cv">hkl-pseudoaxis-k4cv</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector.html#hkl-detector-compute-kf" title="hkl_detector_compute_kf ()">hkl_detector_compute_kf</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
+<a class="link" href="hkl-hkl-pseudoaxis-k6c.html#hkl-engine-k6c-hkl-new" title="hkl_engine_k6c_hkl_new ()">hkl_engine_k6c_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k6c.html" title="hkl-pseudoaxis-k6c">hkl-pseudoaxis-k6c</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector-factory.html#hkl-detector-factory-new" title="hkl_detector_factory_new ()">hkl_detector_factory_new</a>, function in <a class="link" href="hkl-hkl-detector-factory.html" title="hkl-detector-factory">hkl-detector-factory</a>
+<a class="link" href="hkl-hkl-pseudoaxis-k6c.html#hkl-engine-k6c-psi-new" title="hkl_engine_k6c_psi_new ()">hkl_engine_k6c_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k6c.html" title="hkl-pseudoaxis-k6c">hkl-pseudoaxis-k6c</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector.html#hkl-detector-free" title="hkl_detector_free ()">hkl_detector_free</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
+<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-engine-list-add" title="hkl_engine_list_add ()">hkl_engine_list_add</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector.html#hkl-detector-new" title="hkl_detector_new ()">hkl_detector_new</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
+<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-engine-list-clear" title="hkl_engine_list_clear ()">hkl_engine_list_clear</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-detector.html#hkl-detector-new-copy" title="hkl_detector_new_copy ()">hkl_detector_new_copy</a>, function in <a class="link" href="hkl-hkl-detector.html" title="hkl-detector">hkl-detector</a>
+<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-engine-list-new" title="hkl_engine_list_new ()">hkl_engine_list_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction" title="double_diffraction ()">double_diffraction</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#hkl-engine-psi-new" title="hkl_engine_psi_new ()">hkl_engine_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html" title="hkl-pseudoaxis-common-psi">hkl-pseudoaxis-common-psi</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction-func" title="double_diffraction_func ()">double_diffraction_func</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-q.html#hkl-engine-q2-new" title="hkl_engine_q2_new ()">hkl_engine_q2_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q.html" title="hkl-pseudoaxis-common-q">hkl-pseudoaxis-common-q</a>
 </dt>
 <dd></dd>
-<a name="idxE"></a><h3 class="title">E</h3>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-END-DECLS:CAPS" title="HKL_END_DECLS">HKL_END_DECLS</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-q.html#hkl-engine-q-new" title="hkl_engine_q_new ()">hkl_engine_q_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q.html" title="hkl-pseudoaxis-common-q">hkl-pseudoaxis-common-q</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-EPSILON:CAPS" title="HKL_EPSILON">HKL_EPSILON</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
+<a class="link" href="hkl-hkl-pseudoaxis-zaxis.html#hkl-engine-zaxis-hkl-new" title="hkl_engine_zaxis_hkl_new ()">hkl_engine_zaxis_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-zaxis.html" title="hkl-pseudoaxis-zaxis">hkl-pseudoaxis-zaxis</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-error.html#HklError" title="HklError">HklError</a>, struct in <a class="link" href="hkl-hkl-error.html" title="hkl-error">hkl-error</a>
+<a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError">HklError</a>, struct in <a class="link" href="hkl-hkl-error.html" title="hkl-error">hkl-error</a>
 </dt>
 <dd></dd>
 <dt>
@@ -274,32 +218,20 @@
 <dd></dd>
 <a name="idxF"></a><h3 class="title">F</h3>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-FAIL:CAPS" title="HKL_FAIL">HKL_FAIL</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-FALSE:CAPS" title="HKL_FALSE">HKL_FALSE</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklFunction" title="HklFunction ()">HklFunction</a>, user_function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklFunction" title="struct HklFunction">HklFunction</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
 </dt>
 <dd></dd>
 <a name="idxG"></a><h3 class="title">G</h3>
 <dt>
-<a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry">HklGeometry</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-geometry.html#HklGeometryConfig" title="HklGeometryConfig">HklGeometryConfig</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
+<a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry">HklGeometry</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList">HklGeometryList</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
+<a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList">HklGeometryList</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="HklGeometryListItem">HklGeometryListItem</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
+<a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="struct HklGeometryListItem">HklGeometryListItem</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
 </dt>
 <dd></dd>
 <dt>
@@ -323,22 +255,6 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry-factory.html#hkl-geometry-factory-get-config-from-type" title="hkl_geometry_factory_get_config_from_type ()">hkl_geometry_factory_get_config_from_type</a>, function in <a class="link" href="hkl-hkl-geometry-factory.html" title="hkl-geometry-factory">hkl-geometry-factory</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-geometry-factory.html#hkl-geometry-factory-new" title="hkl_geometry_factory_new ()">hkl_geometry_factory_new</a>, function in <a class="link" href="hkl-hkl-geometry-factory.html" title="hkl-geometry-factory">hkl-geometry-factory</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-geometry.html#hkl-geometry-fprintf" title="hkl_geometry_fprintf ()">hkl_geometry_fprintf</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-geometry.html#hkl-geometry-free" title="hkl_geometry_free ()">hkl_geometry_free</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-get-axis-by-name" title="hkl_geometry_get_axis_by_name ()">hkl_geometry_get_axis_by_name</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
 </dt>
 <dd></dd>
@@ -363,10 +279,6 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-is-empty" title="hkl_geometry_list_is_empty ()">hkl_geometry_list_is_empty</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-item-free" title="hkl_geometry_list_item_free ()">hkl_geometry_list_item_free</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
 </dt>
 <dd></dd>
@@ -375,10 +287,6 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-len" title="hkl_geometry_list_len ()">hkl_geometry_list_len</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-multiply" title="hkl_geometry_list_multiply ()">hkl_geometry_list_multiply</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
 </dt>
 <dd></dd>
@@ -411,10 +319,6 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-geometry.html#hkl-geometry-randomize" title="hkl_geometry_randomize ()">hkl_geometry_randomize</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-set-values-v" title="hkl_geometry_set_values_v ()">hkl_geometry_set_values_v</a>, function in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
 </dt>
 <dd></dd>
@@ -428,7 +332,7 @@
 <dd></dd>
 <a name="idxH"></a><h3 class="title">H</h3>
 <dt>
-<a class="link" href="hkl-hkl-geometry.html#HklHolder" title="HklHolder">HklHolder</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
+<a class="link" href="hkl-hkl-geometry.html#HklHolder" title="struct HklHolder">HklHolder</a>, struct in <a class="link" href="hkl-hkl-geometry.html" title="hkl-geometry">hkl-geometry</a>
 </dt>
 <dd></dd>
 <dt>
@@ -437,11 +341,7 @@
 <dd></dd>
 <a name="idxI"></a><h3 class="title">I</h3>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#INFINITY:CAPS" title="INFINITY">INFINITY</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval">HklInterval</a>, struct in <a class="link" href="hkl-hkl-interval.html" title="hkl-interval">hkl-interval</a>
+<a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval">HklInterval</a>, struct in <a class="link" href="hkl-hkl-interval.html" title="hkl-interval">hkl-interval</a>
 </dt>
 <dd></dd>
 <dt>
@@ -514,7 +414,7 @@
 <dd></dd>
 <a name="idxL"></a><h3 class="title">L</h3>
 <dt>
-<a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice">HklLattice</a>, struct in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
+<a class="link" href="hkl-hkl-lattice.html#HklLattice" title="struct HklLattice">HklLattice</a>, struct in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
 </dt>
 <dd></dd>
 <dt>
@@ -522,104 +422,16 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-lattice.html#hkl-lattice-free" title="hkl_lattice_free ()">hkl_lattice_free</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-lattice.html#hkl-lattice-get-1-B" title="hkl_lattice_get_1_B ()">hkl_lattice_get_1_B</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-lattice.html#hkl-lattice-get-B" title="hkl_lattice_get_B ()">hkl_lattice_get_B</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-lattice.html#hkl-lattice-new" title="hkl_lattice_new ()">hkl_lattice_new</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-lattice.html#hkl-lattice-new-copy" title="hkl_lattice_new_copy ()">hkl_lattice_new_copy</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-lattice.html#hkl-lattice-new-default" title="hkl_lattice_new_default ()">hkl_lattice_new_default</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-randomize" title="hkl_lattice_randomize ()">hkl_lattice_randomize</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
 </dt>
 <dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-lattice.html#hkl-lattice-reciprocal" title="hkl_lattice_reciprocal ()">hkl_lattice_reciprocal</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-lattice.html#hkl-lattice-set" title="hkl_lattice_set ()">hkl_lattice_set</a>, function in <a class="link" href="hkl-hkl-lattice.html" title="hkl-lattice">hkl-lattice</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST:CAPS" title="HKL_LIST()">HKL_LIST</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-ADD-VALUE:CAPS" title="HKL_LIST_ADD_VALUE()">HKL_LIST_ADD_VALUE</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-ALLOC:CAPS" title="HKL_LIST_ALLOC()">HKL_LIST_ALLOC</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-COPY:CAPS" title="HKL_LIST_COPY()">HKL_LIST_COPY</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-DEL:CAPS" title="HKL_LIST_DEL()">HKL_LIST_DEL</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-DEL-DESTRUCTOR:CAPS" title="HKL_LIST_DEL_DESTRUCTOR()">HKL_LIST_DEL_DESTRUCTOR</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-DEL-ITEM-DESTRUCTOR:CAPS" title="HKL_LIST_DEL_ITEM_DESTRUCTOR()">HKL_LIST_DEL_ITEM_DESTRUCTOR</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-FREE:CAPS" title="HKL_LIST_FREE()">HKL_LIST_FREE</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-FREE-DESTRUCTOR:CAPS" title="HKL_LIST_FREE_DESTRUCTOR()">HKL_LIST_FREE_DESTRUCTOR</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-INIT:CAPS" title="HKL_LIST_INIT()">HKL_LIST_INIT</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-LEN:CAPS" title="HKL_LIST_LEN()">HKL_LIST_LEN</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-list.html#HKL-LIST-RESIZE:CAPS" title="HKL_LIST_RESIZE()">HKL_LIST_RESIZE</a>, macro in <a class="link" href="hkl-hkl-list.html" title="hkl-list">hkl-list</a>
-</dt>
-<dd></dd>
 <a name="idxM"></a><h3 class="title">M</h3>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-MAJOR:CAPS" title="HKL_MAJOR">HKL_MAJOR</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-macros.html#HKL-MALLOC:CAPS" title="HKL_MALLOC()">HKL_MALLOC</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix">HklMatrix</a>, struct in <a class="link" href="hkl-hkl-vector.html" title="hkl-vector">hkl-vector</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-matrix.html#hkl-matrix-cmp" title="hkl_matrix_cmp ()">hkl_matrix_cmp</a>, function in <a class="link" href="hkl-hkl-matrix.html" title="hkl-matrix">hkl-matrix</a>
+<a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix">HklMatrix</a>, struct in <a class="link" href="hkl-hkl-vector.html" title="hkl-vector">hkl-vector</a>
 </dt>
 <dd></dd>
 <dt>
@@ -631,10 +443,6 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix.html#hkl-matrix-init" title="hkl_matrix_init ()">hkl_matrix_init</a>, function in <a class="link" href="hkl-hkl-matrix.html" title="hkl-matrix">hkl-matrix</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-init-from-euler" title="hkl_matrix_init_from_euler ()">hkl_matrix_init_from_euler</a>, function in <a class="link" href="hkl-hkl-matrix.html" title="hkl-matrix">hkl-matrix</a>
 </dt>
 <dd></dd>
@@ -651,10 +459,6 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-matrix.html#hkl-matrix-times-matrix" title="hkl_matrix_times_matrix ()">hkl_matrix_times_matrix</a>, function in <a class="link" href="hkl-hkl-matrix.html" title="hkl-matrix">hkl-matrix</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-times-vector" title="hkl_matrix_times_vector ()">hkl_matrix_times_vector</a>, function in <a class="link" href="hkl-hkl-matrix.html" title="hkl-matrix">hkl-matrix</a>
 </dt>
 <dd></dd>
@@ -667,49 +471,37 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-MINOR:CAPS" title="HKL_MINOR">HKL_MINOR</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklMode" title="struct HklMode">HklMode</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#M-PI:CAPS" title="M_PI">M_PI</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#HklModePsi" title="struct HklModePsi">HklModePsi</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html" title="hkl-pseudoaxis-common-psi">hkl-pseudoaxis-common-psi</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#M-PI-2:CAPS" title="M_PI_2">M_PI_2</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-mode-get-hkl-real" title="hkl_mode_get_hkl_real ()">hkl_mode_get_hkl_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
 </dt>
 <dd></dd>
-<a name="idxN"></a><h3 class="title">N</h3>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#NORETURN:CAPS" title="NORETURN">NORETURN</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<a name="idxP"></a><h3 class="title">P</h3>
-<dt>
-<a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter">HklParameter</a>, struct in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-fprintf" title="hkl_parameter_fprintf ()">hkl_parameter_fprintf</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-mode-init-psi-constant-vertical-real" title="hkl_mode_init_psi_constant_vertical_real ()">hkl_mode_init_psi_constant_vertical_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-free" title="hkl_parameter_free ()">hkl_parameter_free</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-get-max" title="hkl_parameter_get_max ()">hkl_parameter_get_max</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
+<a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#hkl-mode-psi-new" title="hkl_mode_psi_new ()">hkl_mode_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html" title="hkl-pseudoaxis-common-psi">hkl-pseudoaxis-common-psi</a>
 </dt>
 <dd></dd>
+<a name="idxN"></a><h3 class="title">N</h3>
 <dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-get-range-unit" title="hkl_parameter_get_range_unit ()">hkl_parameter_get_range_unit</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
+<a class="link" href="hkl-hkl-macros.html#NORETURN:CAPS" title="NORETURN">NORETURN</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
 </dt>
 <dd></dd>
+<a name="idxP"></a><h3 class="title">P</h3>
 <dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-get-value-unit" title="hkl_parameter_get_value_unit ()">hkl_parameter_get_value_unit</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
+<a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter">HklParameter</a>, struct in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-init" title="hkl_parameter_init ()">hkl_parameter_init</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
+<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-fprintf" title="hkl_parameter_fprintf ()">hkl_parameter_fprintf</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
 </dt>
 <dd></dd>
 <dt>
@@ -721,243 +513,11 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-new-copy" title="hkl_parameter_new_copy ()">hkl_parameter_new_copy</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-randomize" title="hkl_parameter_randomize ()">hkl_parameter_randomize</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-set-range" title="hkl_parameter_set_range ()">hkl_parameter_set_range</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-set-range-unit" title="hkl_parameter_set_range_unit ()">hkl_parameter_set_range_unit</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-set-value" title="hkl_parameter_set_value ()">hkl_parameter_set_value</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-parameter.html#hkl-parameter-set-value-unit" title="hkl_parameter_set_value_unit ()">hkl_parameter_set_value_unit</a>, function in <a class="link" href="hkl-hkl-parameter.html" title="hkl-parameter">hkl-parameter</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-PATCH:CAPS" title="HKL_PATCH">HKL_PATCH</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-macros.html#hkl-printbt" title="hkl_printbt ()">hkl_printbt</a>, function in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis">HklPseudoAxis</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine">HklPseudoAxisEngine</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList">HklPseudoAxisEngineList</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode">HklPseudoAxisEngineMode</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()">HklPseudoAxisEngineModeFunc</a>, user_function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#HklPseudoAxisEngineModePsi" title="HklPseudoAxisEngineModePsi">HklPseudoAxisEngineModePsi</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html" title="hkl-pseudoaxis-common-psi">hkl-pseudoaxis-common-psi</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-geometry" title="hkl_pseudo_axis_engine_add_geometry ()">hkl_pseudo_axis_engine_add_geometry</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-mode" title="hkl_pseudo_axis_engine_add_mode ()">hkl_pseudo_axis_engine_add_mode</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-hkl-new" title="hkl_pseudo_axis_engine_e4cv_hkl_new ()">hkl_pseudo_axis_engine_e4cv_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e4cv.html" title="hkl-pseudoaxis-e4cv">hkl-pseudoaxis-e4cv</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-psi-new" title="hkl_pseudo_axis_engine_e4cv_psi_new ()">hkl_pseudo_axis_engine_e4cv_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e4cv.html" title="hkl-pseudoaxis-e4cv">hkl-pseudoaxis-e4cv</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-hkl-new" title="hkl_pseudo_axis_engine_e6c_hkl_new ()">hkl_pseudo_axis_engine_e6c_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e6c.html" title="hkl-pseudoaxis-e6c">hkl-pseudoaxis-e6c</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-psi-new" title="hkl_pseudo_axis_engine_e6c_psi_new ()">hkl_pseudo_axis_engine_e6c_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-e6c.html" title="hkl-pseudoaxis-e6c">hkl-pseudoaxis-e6c</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-eulerians.html#hkl-pseudo-axis-engine-eulerians-new" title="hkl_pseudo_axis_engine_eulerians_new ()">hkl_pseudo_axis_engine_eulerians_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians.html" title="hkl-pseudoaxis-common-eulerians">hkl-pseudoaxis-common-eulerians</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-fprintf" title="hkl_pseudo_axis_engine_fprintf ()">hkl_pseudo_axis_engine_fprintf</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-free" title="hkl_pseudo_axis_engine_free ()">hkl_pseudo_axis_engine_free</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-get" title="hkl_pseudo_axis_engine_get ()">hkl_pseudo_axis_engine_get</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-hkl-new" title="hkl_pseudo_axis_engine_hkl_new ()">hkl_pseudo_axis_engine_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-initialize" title="hkl_pseudo_axis_engine_initialize ()">hkl_pseudo_axis_engine_initialize</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common.html#hkl-pseudo-axis-engine-init-func" title="hkl_pseudo_axis_engine_init_func ()">hkl_pseudo_axis_engine_init_func</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common.html" title="hkl-pseudoaxis-common">hkl-pseudoaxis-common</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-hkl-new" title="hkl_pseudo_axis_engine_k4cv_hkl_new ()">hkl_pseudo_axis_engine_k4cv_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k4cv.html" title="hkl-pseudoaxis-k4cv">hkl-pseudoaxis-k4cv</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-psi-new" title="hkl_pseudo_axis_engine_k4cv_psi_new ()">hkl_pseudo_axis_engine_k4cv_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k4cv.html" title="hkl-pseudoaxis-k4cv">hkl-pseudoaxis-k4cv</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-hkl-new" title="hkl_pseudo_axis_engine_k6c_hkl_new ()">hkl_pseudo_axis_engine_k6c_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k6c.html" title="hkl-pseudoaxis-k6c">hkl-pseudoaxis-k6c</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-psi-new" title="hkl_pseudo_axis_engine_k6c_psi_new ()">hkl_pseudo_axis_engine_k6c_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-k6c.html" title="hkl-pseudoaxis-k6c">hkl-pseudoaxis-k6c</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-add" title="hkl_pseudo_axis_engine_list_add ()">hkl_pseudo_axis_engine_list_add</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-clear" title="hkl_pseudo_axis_engine_list_clear ()">hkl_pseudo_axis_engine_list_clear</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-factory.html#hkl-pseudo-axis-engine-list-factory" title="hkl_pseudo_axis_engine_list_factory ()">hkl_pseudo_axis_engine_list_factory</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-factory.html" title="hkl-pseudoaxis-factory">hkl-pseudoaxis-factory</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-fprintf" title="hkl_pseudo_axis_engine_list_fprintf ()">hkl_pseudo_axis_engine_list_fprintf</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-free" title="hkl_pseudo_axis_engine_list_free ()">hkl_pseudo_axis_engine_list_free</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get" title="hkl_pseudo_axis_engine_list_get ()">hkl_pseudo_axis_engine_list_get</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-by-name" title="hkl_pseudo_axis_engine_list_get_by_name ()">hkl_pseudo_axis_engine_list_get_by_name</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-pseudo-axis-by-name" title="hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name ()">hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-init" title="hkl_pseudo_axis_engine_list_init ()">hkl_pseudo_axis_engine_list_init</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-new" title="hkl_pseudo_axis_engine_list_new ()">hkl_pseudo_axis_engine_list_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-free" title="hkl_pseudo_axis_engine_mode_free ()">hkl_pseudo_axis_engine_mode_free</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-get-hkl-real" title="hkl_pseudo_axis_engine_mode_get_hkl_real ()">hkl_pseudo_axis_engine_mode_get_hkl_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-init" title="hkl_pseudo_axis_engine_mode_init ()">hkl_pseudo_axis_engine_mode_init</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-init-psi-constant-vertical-real" title="hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real ()">hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-new" title="hkl_pseudo_axis_engine_mode_new ()">hkl_pseudo_axis_engine_mode_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-mode-psi-new" title="hkl_pseudo_axis_engine_mode_psi_new ()">hkl_pseudo_axis_engine_mode_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html" title="hkl-pseudoaxis-common-psi">hkl-pseudoaxis-common-psi</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-auto.html#hkl-pseudo-axis-engine-mode-set-real" title="hkl_pseudo_axis_engine_mode_set_real ()">hkl_pseudo_axis_engine_mode_set_real</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-auto.html" title="hkl-pseudoaxis-auto">hkl-pseudoaxis-auto</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-new" title="hkl_pseudo_axis_engine_new ()">hkl_pseudo_axis_engine_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-psi-new" title="hkl_pseudo_axis_engine_psi_new ()">hkl_pseudo_axis_engine_psi_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html" title="hkl-pseudoaxis-common-psi">hkl-pseudoaxis-common-psi</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q2-new" title="hkl_pseudo_axis_engine_q2_new ()">hkl_pseudo_axis_engine_q2_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q.html" title="hkl-pseudoaxis-common-q">hkl-pseudoaxis-common-q</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q-new" title="hkl_pseudo_axis_engine_q_new ()">hkl_pseudo_axis_engine_q_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-q.html" title="hkl-pseudoaxis-common-q">hkl-pseudoaxis-common-q</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-select-mode" title="hkl_pseudo_axis_engine_select_mode ()">hkl_pseudo_axis_engine_select_mode</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-set" title="hkl_pseudo_axis_engine_set ()">hkl_pseudo_axis_engine_set</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-zaxis.html#hkl-pseudo-axis-engine-zaxis-hkl-new" title="hkl_pseudo_axis_engine_zaxis_hkl_new ()">hkl_pseudo_axis_engine_zaxis_hkl_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-zaxis.html" title="hkl-pseudoaxis-zaxis">hkl-pseudoaxis-zaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-fprintf" title="hkl_pseudo_axis_fprintf ()">hkl_pseudo_axis_fprintf</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-free" title="hkl_pseudo_axis_free ()">hkl_pseudo_axis_free</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-init" title="hkl_pseudo_axis_init ()">hkl_pseudo_axis_init</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-new" title="hkl_pseudo_axis_new ()">hkl_pseudo_axis_new</a>, function in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#psi-constant-vertical-func" title="psi_constant_vertical_func ()">psi_constant_vertical_func</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="struct HklPseudoAxis">HklPseudoAxis</a>, struct in <a class="link" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">hkl-pseudoaxis</a>
 </dt>
 <dd></dd>
 <a name="idxQ"></a><h3 class="title">Q</h3>
@@ -1011,48 +571,16 @@
 <dd></dd>
 <a name="idxR"></a><h3 class="title">R</h3>
 <dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-RADTODEG:CAPS" title="HKL_RADTODEG">HKL_RADTODEG</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<dt>
 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q" title="RUBh_minus_Q ()">RUBh_minus_Q</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
 </dt>
 <dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q-func" title="RUBh_minus_Q_func ()">RUBh_minus_Q_func</a>, function in <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">hkl-pseudoaxis-common-hkl</a>
-</dt>
-<dd></dd>
 <a name="idxS"></a><h3 class="title">S</h3>
 <dt>
-<a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample">HklSample</a>, struct in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
+<a class="link" href="hkl-hkl-sample.html#HklSample" title="struct HklSample">HklSample</a>, struct in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList">HklSampleList</a>, struct in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection">HklSampleReflection</a>, struct in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#HklSampleType" title="enum HklSampleType">HklSampleType</a>, enum in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-add-reflection" title="hkl_sample_add_reflection ()">hkl_sample_add_reflection</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-affine" title="hkl_sample_affine ()">hkl_sample_affine</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-compute-UB-busing-levy" title="hkl_sample_compute_UB_busing_levy ()">hkl_sample_compute_UB_busing_levy</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-del-reflection" title="hkl_sample_del_reflection ()">hkl_sample_del_reflection</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
+<a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="struct HklSampleReflection">HklSampleReflection</a>, struct in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1060,107 +588,7 @@
 </dt>
 <dd></dd>
 <dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-free" title="hkl_sample_free ()">hkl_sample_free</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-get-ith-reflection" title="hkl_sample_get_ith_reflection ()">hkl_sample_get_ith_reflection</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-get-reflection-mesured-angle" title="hkl_sample_get_reflection_mesured_angle ()">hkl_sample_get_reflection_mesured_angle</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-get-reflection-theoretical-angle" title="hkl_sample_get_reflection_theoretical_angle ()">hkl_sample_get_reflection_theoretical_angle</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-get-UB" title="hkl_sample_get_UB ()">hkl_sample_get_UB</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-append" title="hkl_sample_list_append ()">hkl_sample_list_append</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-clear" title="hkl_sample_list_clear ()">hkl_sample_list_clear</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-del" title="hkl_sample_list_del ()">hkl_sample_list_del</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-fprintf" title="hkl_sample_list_fprintf ()">hkl_sample_list_fprintf</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-free" title="hkl_sample_list_free ()">hkl_sample_list_free</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-get-by-name" title="hkl_sample_list_get_by_name ()">hkl_sample_list_get_by_name</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-get-idx-from-name" title="hkl_sample_list_get_idx_from_name ()">hkl_sample_list_get_idx_from_name</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-get-ith" title="hkl_sample_list_get_ith ()">hkl_sample_list_get_ith</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-len" title="hkl_sample_list_len ()">hkl_sample_list_len</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-new" title="hkl_sample_list_new ()">hkl_sample_list_new</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-list-select-current" title="hkl_sample_list_select_current ()">hkl_sample_list_select_current</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-new" title="hkl_sample_new ()">hkl_sample_new</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-new-copy" title="hkl_sample_new_copy ()">hkl_sample_new_copy</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-reflection-set-flag" title="hkl_sample_reflection_set_flag ()">hkl_sample_reflection_set_flag</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-reflection-set-geometry" title="hkl_sample_reflection_set_geometry ()">hkl_sample_reflection_set_geometry</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-reflection-set-hkl" title="hkl_sample_reflection_set_hkl ()">hkl_sample_reflection_set_hkl</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-set-lattice" title="hkl_sample_set_lattice ()">hkl_sample_set_lattice</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-set-name" title="hkl_sample_set_name ()">hkl_sample_set_name</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-set-UB" title="hkl_sample_set_UB ()">hkl_sample_set_UB</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-sample.html#hkl-sample-set-U-from-euler" title="hkl_sample_set_U_from_euler ()">hkl_sample_set_U_from_euler</a>, function in <a class="link" href="hkl-hkl-sample.html" title="hkl-sample">hkl-sample</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource">HklSource</a>, struct in <a class="link" href="hkl-hkl-source.html" title="hkl-source">hkl-source</a>
+<a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource">HklSource</a>, struct in <a class="link" href="hkl-hkl-source.html" title="hkl-source">hkl-source</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1187,26 +615,9 @@
 <a class="link" href="hkl-hkl-source.html#hkl-source-init" title="hkl_source_init ()">hkl_source_init</a>, function in <a class="link" href="hkl-hkl-source.html" title="hkl-source">hkl-source</a>
 </dt>
 <dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-SUCCESS:CAPS" title="HKL_SUCCESS">HKL_SUCCESS</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<a name="idxT"></a><h3 class="title">T</h3>
-<dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-TAU:CAPS" title="HKL_TAU">HKL_TAU</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-TINY:CAPS" title="HKL_TINY">HKL_TINY</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-TRUE:CAPS" title="HKL_TRUE">HKL_TRUE</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
 <a name="idxU"></a><h3 class="title">U</h3>
 <dt>
-<a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit">HklUnit</a>, struct in <a class="link" href="hkl-hkl-unit.html" title="hkl-unit">hkl-unit</a>
+<a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit">HklUnit</a>, struct in <a class="link" href="hkl-hkl-unit.html" title="hkl-unit">hkl-unit</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1219,7 +630,7 @@
 <dd></dd>
 <a name="idxV"></a><h3 class="title">V</h3>
 <dt>
-<a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector">HklVector</a>, struct in <a class="link" href="hkl-hkl-vector.html" title="hkl-vector">hkl-vector</a>
+<a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector">HklVector</a>, struct in <a class="link" href="hkl-hkl-vector.html" title="hkl-vector">hkl-vector</a>
 </dt>
 <dd></dd>
 <dt>
@@ -1322,13 +733,9 @@
 <a class="link" href="hkl-hkl-vector.html#hkl-vector-vectorial-product" title="hkl_vector_vectorial_product ()">hkl_vector_vectorial_product</a>, function in <a class="link" href="hkl-hkl-vector.html" title="hkl-vector">hkl-vector</a>
 </dt>
 <dd></dd>
-<dt>
-<a class="link" href="hkl-hkl-macros.html#HKL-VERSION:CAPS" title="HKL_VERSION">HKL_VERSION</a>, macro in <a class="link" href="hkl-hkl-macros.html" title="hkl-macros">hkl-macros</a>
-</dt>
-<dd></dd>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/ch01.html b/Documentation/api/html/ch01.html
index 1c60bdb..f06ba0f 100644
--- a/Documentation/api/html/ch01.html
+++ b/Documentation/api/html/ch01.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>[Insert title here]</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="index.html" title="hkl Reference Manual">
 <link rel="prev" href="index.html" title="hkl Reference Manual">
 <link rel="next" href="hkl-hkl-pseudoaxis-zaxis.html" title="hkl-pseudoaxis-zaxis">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -19,10 +19,10 @@
 <th width="100%" align="center">hkl Reference Manual</th>
 <td><a accesskey="n" href="hkl-hkl-pseudoaxis-zaxis.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 </tr></table>
-<div class="chapter" title="[Insert title here]">
-<div class="titlepage"><div><div><h2 class="title">
-<a name="id2728781"></a>[Insert title here]</h2></div></div></div>
-<div class="toc"><dl>
+<div class="chapter">
+<div class="titlepage"><div><div><h1 class="title">
+<a name="idp2116032"></a>[Insert title here]</h1></div></div></div>
+<div class="toc"><dl class="toc">
 <dt>
 <span class="refentrytitle"><a href="hkl-hkl-pseudoaxis-zaxis.html">hkl-pseudoaxis-zaxis</a></span><span class="refpurpose"></span>
 </dt>
@@ -117,6 +117,6 @@
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-axis.html b/Documentation/api/html/hkl-hkl-axis.html
index d64171f..9855ce5 100644
--- a/Documentation/api/html/hkl-hkl-axis.html
+++ b/Documentation/api/html/hkl-hkl-axis.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-axis</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-sample.html" title="hkl-sample">
 <link rel="next" href="hkl-hkl-pseudoaxis-factory.html" title="hkl-pseudoaxis-factory">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-axis.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-axis">
+<div class="refentry">
 <a name="hkl-hkl-axis"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,589 +35,29 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-axis.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis">HklAxis</a>;
-<a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="returnvalue">HklAxis</span></a> *           <a class="link" href="hkl-hkl-axis.html#hkl-axis-new" title="hkl_axis_new ()">hkl_axis_new</a>                        (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> const *axis_v</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-free" title="hkl_axis_free ()">hkl_axis_free</a>                       (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-init" title="hkl_axis_init ()">hkl_axis_init</a>                       (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *axis</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> const *axis_v</code></em>);
-<span class="returnvalue">char</span> const *        <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-name" title="hkl_axis_get_name ()">hkl_axis_get_name</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-changed" title="hkl_axis_get_changed ()">hkl_axis_get_changed</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-set-changed" title="hkl_axis_set_changed ()">hkl_axis_set_changed</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> changed</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-value" title="hkl_axis_get_value ()">hkl_axis_get_value</a>                  (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-value-unit" title="hkl_axis_get_value_unit ()">hkl_axis_get_value_unit</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-value-closest" title="hkl_axis_get_value_closest ()">hkl_axis_get_value_closest</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *axis</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-value-closest-unit" title="hkl_axis_get_value_closest_unit ()">hkl_axis_get_value_closest_unit</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *axis</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-max" title="hkl_axis_get_max ()">hkl_axis_get_max</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-range-unit" title="hkl_axis_get_range_unit ()">hkl_axis_get_range_unit</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *max</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-set-value" title="hkl_axis_set_value ()">hkl_axis_set_value</a>                  (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-set-value-smallest-in-range" title="hkl_axis_set_value_smallest_in_range ()">hkl_axis_set_value_smallest_in_range</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-set-value-unit" title="hkl_axis_set_value_unit ()">hkl_axis_set_value_unit</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-set-range" title="hkl_axis_set_range ()">hkl_axis_set_range</a>                  (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-set-range-unit" title="hkl_axis_set_range_unit ()">hkl_axis_set_range_unit</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-randomize" title="hkl_axis_randomize ()">hkl_axis_randomize</a>                  (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-get-quaternion" title="hkl_axis_get_quaternion ()">hkl_axis_get_quaternion</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-axis.html#hkl-axis-is-value-compatible-with-range" title="hkl_axis_is_value_compatible_with_range ()">hkl_axis_is_value_compatible_with_range</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-axis.html#hkl-axis-is-valid" title="hkl_axis_is_valid ()">hkl_axis_is_valid</a>                   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-axis.html#hkl-axis-fprintf" title="hkl_axis_fprintf ()">hkl_axis_fprintf</a>                    (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-axis.html#HklAxis" title="struct HklAxis">HklAxis</a>;
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-axis.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-axis.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklAxis">
-<a name="HklAxis"></a><h3>HklAxis</h3>
-<pre class="programlisting">typedef struct {
-	HklParameter parent_instance;
+<div class="refsect2">
+<a name="HklAxis"></a><h3>struct HklAxis</h3>
+<pre class="programlisting">struct HklAxis {
+	HklParameter parameter;
 	HklVector axis_v;
 	HklQuaternion q;
-} HklAxis;
+};
 </pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_new ()">
-<a name="hkl-axis-new"></a><h3>hkl_axis_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="returnvalue">HklAxis</span></a> *           hkl_axis_new                        (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> const *axis_v</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>axis_v</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_free ()">
-<a name="hkl-axis-free"></a><h3>hkl_axis_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_free                       (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_init ()">
-<a name="hkl-axis-init"></a><h3>hkl_axis_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_init                       (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *axis</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> const *axis_v</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>axis</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>axis_v</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_name ()">
-<a name="hkl-axis-get-name"></a><h3>hkl_axis_get_name ()</h3>
-<pre class="programlisting"><span class="returnvalue">char</span> const *        hkl_axis_get_name                   (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_changed ()">
-<a name="hkl-axis-get-changed"></a><h3>hkl_axis_get_changed ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_axis_get_changed                (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_set_changed ()">
-<a name="hkl-axis-set-changed"></a><h3>hkl_axis_set_changed ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_set_changed                (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> changed</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>changed</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_value ()">
-<a name="hkl-axis-get-value"></a><h3>hkl_axis_get_value ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_axis_get_value                  (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_value_unit ()">
-<a name="hkl-axis-get-value-unit"></a><h3>hkl_axis_get_value_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_axis_get_value_unit             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_value_closest ()">
-<a name="hkl-axis-get-value-closest"></a><h3>hkl_axis_get_value_closest ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_axis_get_value_closest          (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *axis</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>axis</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_value_closest_unit ()">
-<a name="hkl-axis-get-value-closest-unit"></a><h3>hkl_axis_get_value_closest_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_axis_get_value_closest_unit     (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *axis</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>axis</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_max ()">
-<a name="hkl-axis-get-max"></a><h3>hkl_axis_get_max ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_axis_get_max                    (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_range_unit ()">
-<a name="hkl-axis-get-range-unit"></a><h3>hkl_axis_get_range_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_get_range_unit             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *max</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_set_value ()">
-<a name="hkl-axis-set-value"></a><h3>hkl_axis_set_value ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_set_value                  (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_set_value_smallest_in_range ()">
-<a name="hkl-axis-set-value-smallest-in-range"></a><h3>hkl_axis_set_value_smallest_in_range ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_set_value_smallest_in_range
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_set_value_unit ()">
-<a name="hkl-axis-set-value-unit"></a><h3>hkl_axis_set_value_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_set_value_unit             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_set_range ()">
-<a name="hkl-axis-set-range"></a><h3>hkl_axis_set_range ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_set_range                  (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_set_range_unit ()">
-<a name="hkl-axis-set-range-unit"></a><h3>hkl_axis_set_range_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_set_range_unit             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_randomize ()">
-<a name="hkl-axis-randomize"></a><h3>hkl_axis_randomize ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_randomize                  (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_get_quaternion ()">
-<a name="hkl-axis-get-quaternion"></a><h3>hkl_axis_get_quaternion ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_get_quaternion             (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_is_value_compatible_with_range ()">
-<a name="hkl-axis-is-value-compatible-with-range"></a><h3>hkl_axis_is_value_compatible_with_range ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_axis_is_value_compatible_with_range
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_is_valid ()">
-<a name="hkl-axis-is-valid"></a><h3>hkl_axis_is_valid ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_axis_is_valid                   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_axis_fprintf ()">
-<a name="hkl-axis-fprintf"></a><h3>hkl_axis_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_axis_fprintf                    (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="type">HklAxis</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-detector-factory.html b/Documentation/api/html/hkl-hkl-detector-factory.html
index 9aa0163..199b6ae 100644
--- a/Documentation/api/html/hkl-hkl-detector-factory.html
+++ b/Documentation/api/html/hkl-hkl-detector-factory.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-detector-factory</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-interval.html" title="hkl-interval">
 <link rel="next" href="hkl-hkl-quaternion.html" title="hkl-quaternion">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-detector-factory.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-detector-factory">
+<div class="refentry">
 <a name="hkl-hkl-detector-factory"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,43 +35,19 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-detector-factory.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       <a class="link" href="hkl-hkl-detector-factory.html#hkl-detector-factory-new" title="hkl_detector_factory_new ()">hkl_detector_factory_new</a>            (<em class="parameter"><code><span class="type">HklDetectorType</span> type</code></em>);
-</pre>
+<pre class="synopsis"></pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-detector-factory.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-detector-factory.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_detector_factory_new ()">
-<a name="hkl-detector-factory-new"></a><h3>hkl_detector_factory_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       hkl_detector_factory_new            (<em class="parameter"><code><span class="type">HklDetectorType</span> type</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-detector.html b/Documentation/api/html/hkl-hkl-detector.html
index a5b8c4c..98714aa 100644
--- a/Documentation/api/html/hkl-hkl-detector.html
+++ b/Documentation/api/html/hkl-hkl-detector.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-detector</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-e6c.html" title="hkl-pseudoaxis-e6c">
 <link rel="next" href="hkl-hkl-interval.html" title="hkl-interval">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-detector.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-detector">
+<div class="refentry">
 <a name="hkl-hkl-detector"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,141 +35,90 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-detector.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector">HklDetector</a>;
-<a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       <a class="link" href="hkl-hkl-detector.html#hkl-detector-new" title="hkl_detector_new ()">hkl_detector_new</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       <a class="link" href="hkl-hkl-detector.html#hkl-detector-new-copy" title="hkl_detector_new_copy ()">hkl_detector_new_copy</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *src</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-detector.html#hkl-detector-free" title="hkl_detector_free ()">hkl_detector_free</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-detector.html#hkl-detector-attach-to-holder" title="hkl_detector_attach_to_holder ()">hkl_detector_attach_to_holder</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklHolder" title="HklHolder"><span class="type">HklHolder</span></a> const *holder</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-detector.html#hkl-detector-compute-kf" title="hkl_detector_compute_kf ()">hkl_detector_compute_kf</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *g</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *kf</code></em>);
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector">HklDetector</a>;
+<a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="returnvalue">HklDetector</span></a> *       <a class="link" href="hkl-hkl-detector.html#hkl-detector-new" title="hkl_detector_new ()">hkl_detector_new</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
+<a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="returnvalue">HklDetector</span></a> *       <a class="link" href="hkl-hkl-detector.html#hkl-detector-new-copy" title="hkl_detector_new_copy ()">hkl_detector_new_copy</a>               ();
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-detector.html#hkl-detector-attach-to-holder" title="hkl_detector_attach_to_holder ()">hkl_detector_attach_to_holder</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> *self</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-detector.html#hkl-detector-compute-kf" title="hkl_detector_compute_kf ()">hkl_detector_compute_kf</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> const *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *g</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-detector.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-detector.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklDetector">
-<a name="HklDetector"></a><h3>HklDetector</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklDetector"></a><h3>struct HklDetector</h3>
+<pre class="programlisting">struct HklDetector {
 	size_t idx;
 	HklHolder const *holder;
-} HklDetector;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_detector_new ()">
+<div class="refsect2">
 <a name="hkl-detector-new"></a><h3>hkl_detector_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       hkl_detector_new                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="returnvalue">HklDetector</span></a> *       hkl_detector_new                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 <p>
+Create a new default <a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_detector_new_copy ()">
+<div class="refsect2">
 <a name="hkl-detector-new-copy"></a><h3>hkl_detector_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="returnvalue">HklDetector</span></a> *       hkl_detector_new_copy               (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *src</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_detector_free ()">
-<a name="hkl-detector-free"></a><h3>hkl_detector_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_detector_free                   (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="returnvalue">HklDetector</span></a> *       hkl_detector_new_copy               ();</pre>
 <p>
+the copy constructor
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
+<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
+<td>the detector to copy</td>
 </tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_detector_attach_to_holder ()">
+<div class="refsect2">
 <a name="hkl-detector-attach-to-holder"></a><h3>hkl_detector_attach_to_holder ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_detector_attach_to_holder       (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklHolder" title="HklHolder"><span class="type">HklHolder</span></a> const *holder</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_detector_attach_to_holder       (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> *self</code></em>);</pre>
 <p>
+attach the <a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> to an <a class="link" href="hkl-hkl-geometry.html#HklHolder" title="struct HklHolder"><span class="type">HklHolder</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>holder</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_detector_compute_kf ()">
+<div class="refsect2">
 <a name="hkl-detector-compute-kf"></a><h3>hkl_detector_compute_kf ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_detector_compute_kf             (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *g</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *kf</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_detector_compute_kf             (<em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> const *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *g</code></em>);</pre>
 <p>
+Compute the kf vector of the <a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
 <td><p><span class="term"><em class="parameter"><code>g</code></em> :</span></p></td>
-<td>
+<td>the diffractometer <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> use to compute kf. <span class="annotation">[<acronym title="Parameter for input. Default is transfer none."><span class="acronym">in</span></acronym>]</span>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>kf</code></em> :</span></p></td>
-<td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> fill with the kf coordinates. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym> caller-allocates]</span>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
+<td>HKL_SUCCESS if everythongs goes fine. HKL_FAIL otherwise.</td>
 </tr>
 </tbody>
 </table></div>
@@ -178,6 +127,6 @@
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-error.html b/Documentation/api/html/hkl-hkl-error.html
index c1c2471..b050205 100644
--- a/Documentation/api/html/hkl-hkl-error.html
+++ b/Documentation/api/html/hkl-hkl-error.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-error</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-k4cv.html" title="hkl-pseudoaxis-k4cv">
 <link rel="next" href="hkl-hkl-parameter.html" title="hkl-parameter">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-error.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-error">
+<div class="refentry">
 <a name="hkl-hkl-error"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,132 +35,131 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-error.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-error.html#HklError" title="HklError">HklError</a>;
-<a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a>*           <a class="link" href="hkl-hkl-error.html#hkl-error-new" title="hkl_error_new ()">hkl_error_new</a>                       (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError">HklError</a>;
+<a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="returnvalue">HklError</span></a> *          <a class="link" href="hkl-hkl-error.html#hkl-error-new" title="hkl_error_new ()">hkl_error_new</a>                       (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code>...</code></em>);
-<a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a>*           <a class="link" href="hkl-hkl-error.html#hkl-error-new-literal" title="hkl_error_new_literal ()">hkl_error_new_literal</a>               (<em class="parameter"><code>const <span class="type">char</span> *message</code></em>);
-<a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a>*           <a class="link" href="hkl-hkl-error.html#hkl-error-new-valist" title="hkl_error_new_valist ()">hkl_error_new_valist</a>                (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
+<a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="returnvalue">HklError</span></a> *          <a class="link" href="hkl-hkl-error.html#hkl-error-new-literal" title="hkl_error_new_literal ()">hkl_error_new_literal</a>               (<em class="parameter"><code>const <span class="type">char</span> *message</code></em>);
+<a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="returnvalue">HklError</span></a> *          <a class="link" href="hkl-hkl-error.html#hkl-error-new-valist" title="hkl_error_new_valist ()">hkl_error_new_valist</a>                (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code><span class="type">va_list</span> args</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-free" title="hkl_error_free ()">hkl_error_free</a>                      (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> *error</code></em>);
-<a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a>*           <a class="link" href="hkl-hkl-error.html#hkl-error-new-copy" title="hkl_error_new_copy ()">hkl_error_new_copy</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> *error</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-set" title="hkl_error_set ()">hkl_error_set</a>                       (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-free" title="hkl_error_free ()">hkl_error_free</a>                      (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> *error</code></em>);
+<a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="returnvalue">HklError</span></a> *          <a class="link" href="hkl-hkl-error.html#hkl-error-new-copy" title="hkl_error_new_copy ()">hkl_error_new_copy</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> *error</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-set" title="hkl_error_set ()">hkl_error_set</a>                       (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **err</code></em>,
                                                          <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-set-literal" title="hkl_error_set_literal ()">hkl_error_set_literal</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-set-literal" title="hkl_error_set_literal ()">hkl_error_set_literal</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **err</code></em>,
                                                          <em class="parameter"><code>const <span class="type">char</span> *message</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-propagate" title="hkl_error_propagate ()">hkl_error_propagate</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **dest</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> *src</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-clear" title="hkl_error_clear ()">hkl_error_clear</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-prefix" title="hkl_error_prefix ()">hkl_error_prefix</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-propagate" title="hkl_error_propagate ()">hkl_error_propagate</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **dest</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> *src</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-clear" title="hkl_error_clear ()">hkl_error_clear</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **err</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-prefix" title="hkl_error_prefix ()">hkl_error_prefix</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **err</code></em>,
                                                          <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-propagate-prefixed" title="hkl_error_propagate_prefixed ()">hkl_error_propagate_prefixed</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **dest</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> *src</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-error.html#hkl-error-propagate-prefixed" title="hkl_error_propagate_prefixed ()">hkl_error_propagate_prefixed</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **dest</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> *src</code></em>,
                                                          <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code>...</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-error.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-error.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklError">
-<a name="HklError"></a><h3>HklError</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklError"></a><h3>struct HklError</h3>
+<pre class="programlisting">struct HklError {
 	char *message;
-} HklError;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_new ()">
+<div class="refsect2">
 <a name="hkl-error-new"></a><h3>hkl_error_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a>*           hkl_error_new                       (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
+<pre class="programlisting"><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="returnvalue">HklError</span></a> *          hkl_error_new                       (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code>...</code></em>);</pre>
 <p>
-Creates a new <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> with the given,
+Creates a new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> with the given,
 and a message formatted with <em class="parameter"><code>format</code></em>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>printf()-style format for error message
-</td>
+<td>printf()-style format for error message</td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>parameters for message format
-</td>
+<td><p><span class="term"><em class="parameter"><code>Varargs</code></em> :</span></p></td>
+<td>parameters for message format</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a>
+<td>a new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_new_literal ()">
+<div class="refsect2">
 <a name="hkl-error-new-literal"></a><h3>hkl_error_new_literal ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a>*           hkl_error_new_literal               (<em class="parameter"><code>const <span class="type">char</span> *message</code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="returnvalue">HklError</span></a> *          hkl_error_new_literal               (<em class="parameter"><code>const <span class="type">char</span> *message</code></em>);</pre>
 <p>
-Creates a new <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a>; unlike <a class="link" href="hkl-hkl-error.html#hkl-error-new" title="hkl_error_new ()"><code class="function">hkl_error_new()</code></a>, <em class="parameter"><code>message</code></em> is
-not a <code class="function">printf()</code>-style format string. Use this function if
-<em class="parameter"><code>message</code></em> contains text you don't have control over,
-that could include <code class="function">printf()</code> escape sequences.
+Creates a new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>; unlike <a class="link" href="hkl-hkl-error.html#hkl-error-new" title="hkl_error_new ()"><code class="function">hkl_error_new()</code></a>, <em class="parameter"><code>message</code></em> is not a
+<code class="function">printf()</code>-style format string. Use this function if <em class="parameter"><code>message</code></em>
+contains text you don't have control over, that could include
+<code class="function">printf()</code> escape sequences.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
-<td>error message
-</td>
+<td>error message</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a>
+<td>a new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_new_valist ()">
+<div class="refsect2">
 <a name="hkl-error-new-valist"></a><h3>hkl_error_new_valist ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a>*           hkl_error_new_valist                (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
+<pre class="programlisting"><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="returnvalue">HklError</span></a> *          hkl_error_new_valist                (<em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
 <p>
-Creates a new <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> with the given message
+Creates a new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> with the given message
 formatted with <em class="parameter"><code>format</code></em>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>printf()-style format for error message
-</td>
+<td>printf()-style format for error message</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td>
 <td>
-<span class="type">va_list</span> of parameters for the message format
-</td>
+<span class="type">va_list</span> of parameters for the message format</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> a new <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a>
-
+<td>a new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>
 </td>
 </tr>
 </tbody>
@@ -168,68 +167,77 @@ formatted with <em class="parameter"><code>format</code></em>.
 <p class="since">Since 2.22</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_free ()">
+<div class="refsect2">
 <a name="hkl-error-free"></a><h3>hkl_error_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_free                      (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> *error</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_free                      (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> *error</code></em>);</pre>
 <p>
-Frees a <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> and associated resources.
+Frees a <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> and associated resources.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody><tr>
 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>a <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a>
+<td>a <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>
 </td>
 </tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_new_copy ()">
+<div class="refsect2">
 <a name="hkl-error-new-copy"></a><h3>hkl_error_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="returnvalue">HklError</span></a>*           hkl_error_new_copy                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> *error</code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="returnvalue">HklError</span></a> *          hkl_error_new_copy                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> *error</code></em>);</pre>
 <p>
+Makes a copy of <em class="parameter"><code>error</code></em>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>
+<td>a <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
+<td>a new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_set ()">
+<div class="refsect2">
 <a name="hkl-error-set"></a><h3>hkl_error_set ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_set                       (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_set                       (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **err</code></em>,
                                                          <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code>...</code></em>);</pre>
 <p>
-Does nothing if <em class="parameter"><code>err</code></em> is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; if <em class="parameter"><code>err</code></em> is non-<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then *<em class="parameter"><code>err</code></em>
-must be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. A new <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> is created and assigned to *<em class="parameter"><code>err</code></em>.
+Does nothing if <em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; if <em class="parameter"><code>err</code></em> is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then *<em class="parameter"><code>err</code></em>
+must be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. A new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> is created and assigned to *<em class="parameter"><code>err</code></em>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
-<td>a return location for a <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
+<td>a return location for a <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>printf()-style format
-</td>
+<td>printf()-style format</td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
+<td><p><span class="term"><em class="parameter"><code>Varargs</code></em> :</span></p></td>
 <td>args for <em class="parameter"><code>format</code></em>
 </td>
 </tr>
@@ -237,140 +245,164 @@ must be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAP
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_set_literal ()">
+<div class="refsect2">
 <a name="hkl-error-set-literal"></a><h3>hkl_error_set_literal ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_set_literal               (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_set_literal               (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **err</code></em>,
                                                          <em class="parameter"><code>const <span class="type">char</span> *message</code></em>);</pre>
 <p>
-Does nothing if <em class="parameter"><code>err</code></em> is <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; if <em class="parameter"><code>err</code></em> is non-<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then *<em class="parameter"><code>err</code></em>
-must be <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. A new <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> is created and assigned to *<em class="parameter"><code>err</code></em>.
-Unlike <code class="function">hkl_set_error()</code>, <em class="parameter"><code>message</code></em> is not a <code class="function">printf()</code>-style format string.
-Use this function if <em class="parameter"><code>message</code></em> contains text you don't have control over,
-that could include <code class="function">printf()</code> escape sequences.
+Does nothing if <em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>; if <em class="parameter"><code>err</code></em> is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then *<em class="parameter"><code>err</code></em>
+must be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. A new <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> is created and assigned to *<em class="parameter"><code>err</code></em>.
+Unlike <code class="function">hkl_set_error()</code>, <em class="parameter"><code>message</code></em> is not a <code class="function">printf()</code>-style format
+string.  Use this function if <em class="parameter"><code>message</code></em> contains text you don't have
+control over, that could include <code class="function">printf()</code> escape sequences.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
-<td>a return location for a <a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
+<td>a return location for a <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
-<td>error message
-</td>
+<td>error message</td>
 </tr>
 </tbody>
 </table></div>
 <p class="since">Since 2.18</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_propagate ()">
+<div class="refsect2">
 <a name="hkl-error-propagate"></a><h3>hkl_error_propagate ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_propagate                 (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **dest</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> *src</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_propagate                 (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **dest</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> *src</code></em>);</pre>
 <p>
+If <em class="parameter"><code>dest</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, free <em class="parameter"><code>src</code></em>; otherwise, moves <em class="parameter"><code>src</code></em> into *<em class="parameter"><code>dest</code></em>.
+The error variable <em class="parameter"><code>dest</code></em> points to must be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
-<td>
-</td>
+<td>error return location</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>
-</td>
+<td>error to move into the return location</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_clear ()">
+<div class="refsect2">
 <a name="hkl-error-clear"></a><h3>hkl_error_clear ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_clear                     (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_clear                     (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **err</code></em>);</pre>
 <p>
+If <em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, does nothing. If <em class="parameter"><code>err</code></em> is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, calls
+<a class="link" href="hkl-hkl-error.html#hkl-error-free" title="hkl_error_free ()"><code class="function">hkl_error_free()</code></a> on *<em class="parameter"><code>err</code></em> and sets *<em class="parameter"><code>err</code></em> to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody><tr>
 <td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
-<td>
-</td>
+<td>a <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> return location</td>
 </tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_prefix ()">
+<div class="refsect2">
 <a name="hkl-error-prefix"></a><h3>hkl_error_prefix ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_prefix                    (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **err</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_prefix                    (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **err</code></em>,
                                                          <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code>...</code></em>);</pre>
 <p>
+Formats a string according to <em class="parameter"><code>format</code></em> and prefix it to an existing
+error message.  If <em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (ie: no error variable) then do
+nothing.
 </p>
-<div class="variablelist"><table border="0">
+<p>
+If *<em class="parameter"><code>err</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> (ie: an error variable is present but there is no
+error condition) then also do nothing.  Whether or not it makes
+sense to take advantage of this feature is up to you.
+</p>
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>err</code></em> :</span></p></td>
-<td>
+<td>a return location for a <a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>
-</td>
+<td>printf()-style format string</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>
+<td>arguments to <em class="parameter"><code>format</code></em>
 </td>
 </tr>
 </tbody>
 </table></div>
+<p class="since">Since 2.16</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_error_propagate_prefixed ()">
+<div class="refsect2">
 <a name="hkl-error-propagate-prefixed"></a><h3>hkl_error_propagate_prefixed ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_propagate_prefixed        (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **dest</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> *src</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_error_propagate_prefixed        (<em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **dest</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> *src</code></em>,
                                                          <em class="parameter"><code>const <span class="type">char</span> *format</code></em>,
                                                          <em class="parameter"><code>...</code></em>);</pre>
 <p>
+If <em class="parameter"><code>dest</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, free <em class="parameter"><code>src</code></em>; otherwise, moves <em class="parameter"><code>src</code></em> into
+*<em class="parameter"><code>dest</code></em>. *<em class="parameter"><code>dest</code></em> must be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.  After the move, add a prefix as with
+<code class="function">hkl_prefix_error()</code>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
-<td>
-</td>
+<td>error return location</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>
-</td>
+<td>error to move into the return location</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
-<td>
-</td>
+<td>printf()-style format string</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>
+<td>arguments to <em class="parameter"><code>format</code></em>
 </td>
 </tr>
 </tbody>
 </table></div>
+<p class="since">Since 2.16</p>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-geometry-factory.html b/Documentation/api/html/hkl-hkl-geometry-factory.html
index b49a103..7e8d51c 100644
--- a/Documentation/api/html/hkl-hkl-geometry-factory.html
+++ b/Documentation/api/html/hkl-hkl-geometry-factory.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-geometry-factory</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-geometry.html" title="hkl-geometry">
 <link rel="next" href="hkl-hkl-pseudoaxis-auto.html" title="hkl-pseudoaxis-auto">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-geometry-factory.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-geometry-factory">
+<div class="refentry">
 <a name="hkl-hkl-geometry-factory"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,75 +35,19 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-geometry-factory.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">const <a class="link" href="hkl-hkl-geometry.html#HklGeometryConfig" title="HklGeometryConfig"><span class="returnvalue">HklGeometryConfig</span></a> * <a class="link" href="hkl-hkl-geometry-factory.html#hkl-geometry-factory-get-config-from-type" title="hkl_geometry_factory_get_config_from_type ()">hkl_geometry_factory_get_config_from_type</a>
-                                                        (<em class="parameter"><code><span class="type">HklGeometryType</span> type</code></em>);
-<a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       <a class="link" href="hkl-hkl-geometry-factory.html#hkl-geometry-factory-new" title="hkl_geometry_factory_new ()">hkl_geometry_factory_new</a>            (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometryConfig" title="HklGeometryConfig"><span class="type">HklGeometryConfig</span></a> *config</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);
-</pre>
+<pre class="synopsis"></pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-geometry-factory.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-geometry-factory.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_geometry_factory_get_config_from_type ()">
-<a name="hkl-geometry-factory-get-config-from-type"></a><h3>hkl_geometry_factory_get_config_from_type ()</h3>
-<pre class="programlisting">const <a class="link" href="hkl-hkl-geometry.html#HklGeometryConfig" title="HklGeometryConfig"><span class="returnvalue">HklGeometryConfig</span></a> * hkl_geometry_factory_get_config_from_type
-                                                        (<em class="parameter"><code><span class="type">HklGeometryType</span> type</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_geometry_factory_new ()">
-<a name="hkl-geometry-factory-new"></a><h3>hkl_geometry_factory_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       hkl_geometry_factory_new            (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometryConfig" title="HklGeometryConfig"><span class="type">HklGeometryConfig</span></a> *config</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>config</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-geometry.html b/Documentation/api/html/hkl-hkl-geometry.html
index e3307fc..e48755c 100644
--- a/Documentation/api/html/hkl-hkl-geometry.html
+++ b/Documentation/api/html/hkl-hkl-geometry.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-geometry</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">
 <link rel="next" href="hkl-hkl-geometry-factory.html" title="hkl-geometry-factory">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-geometry.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-geometry">
+<div class="refentry">
 <a name="hkl-hkl-geometry"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,758 +35,385 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-geometry.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-geometry.html#HklHolder" title="HklHolder">HklHolder</a>;
-                    <a class="link" href="hkl-hkl-geometry.html#HklGeometryConfig" title="HklGeometryConfig">HklGeometryConfig</a>;
-                    <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry">HklGeometry</a>;
-                    <a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList">HklGeometryList</a>;
-                    <a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="HklGeometryListItem">HklGeometryListItem</a>;
-<span class="returnvalue">void</span>                (<a class="link" href="hkl-hkl-geometry.html#HklGeometryListMultiplyFunction" title="HklGeometryListMultiplyFunction ()">*HklGeometryListMultiplyFunction</a>)  (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);
-<a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="returnvalue">HklAxis</span></a> *           <a class="link" href="hkl-hkl-geometry.html#hkl-holder-add-rotation-axis" title="hkl_holder_add_rotation_axis ()">hkl_holder_add_rotation_axis</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklHolder" title="HklHolder"><span class="type">HklHolder</span></a> *self</code></em>,
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-geometry.html#HklHolder" title="struct HklHolder">HklHolder</a>;
+struct              <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry">HklGeometry</a>;
+struct              <a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList">HklGeometryList</a>;
+struct              <a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="struct HklGeometryListItem">HklGeometryListItem</a>;
+<span class="returnvalue">void</span>                (<a class="link" href="hkl-hkl-geometry.html#HklGeometryListMultiplyFunction" title="HklGeometryListMultiplyFunction ()">*HklGeometryListMultiplyFunction</a>)  (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="struct HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *item</code></em>);
+<a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-geometry.html#hkl-holder-add-rotation-axis" title="hkl_holder_add_rotation_axis ()">hkl_holder_add_rotation_axis</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklHolder" title="struct HklHolder"><span class="type">HklHolder</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> x</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> y</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> z</code></em>);
-<a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-new" title="hkl_geometry_new ()">hkl_geometry_new</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-new-copy" title="hkl_geometry_new_copy ()">hkl_geometry_new_copy</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-free" title="hkl_geometry_free ()">hkl_geometry_free</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-init-geometry" title="hkl_geometry_init_geometry ()">hkl_geometry_init_geometry</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> const *src</code></em>);
-<a class="link" href="hkl-hkl-geometry.html#HklHolder" title="HklHolder"><span class="returnvalue">HklHolder</span></a> *         <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-add-holder" title="hkl_geometry_add_holder ()">hkl_geometry_add_holder</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-update" title="hkl_geometry_update ()">hkl_geometry_update</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="returnvalue">HklAxis</span></a> *           <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-get-axis-by-name" title="hkl_geometry_get_axis_by_name ()">hkl_geometry_get_axis_by_name</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-randomize" title="hkl_geometry_randomize ()">hkl_geometry_randomize</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-set-values-v" title="hkl_geometry_set_values_v ()">hkl_geometry_set_values_v</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+<a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-new" title="hkl_geometry_new ()">hkl_geometry_new</a>                    (<em class="parameter"><code>const <span class="type">HklFactory</span> *factory</code></em>);
+<a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-new-copy" title="hkl_geometry_new_copy ()">hkl_geometry_new_copy</a>               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-init-geometry" title="hkl_geometry_init_geometry ()">hkl_geometry_init_geometry</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *src</code></em>);
+<a class="link" href="hkl-hkl-geometry.html#HklHolder" title="struct HklHolder"><span class="returnvalue">HklHolder</span></a> *         <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-add-holder" title="hkl_geometry_add_holder ()">hkl_geometry_add_holder</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-update" title="hkl_geometry_update ()">hkl_geometry_update</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
+<a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-get-axis-by-name" title="hkl_geometry_get_axis_by_name ()">hkl_geometry_get_axis_by_name</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-set-values-v" title="hkl_geometry_set_values_v ()">hkl_geometry_set_values_v</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">size_t</span> len</code></em>,
                                                          <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-distance" title="hkl_geometry_distance ()">hkl_geometry_distance</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geom</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-distance-orthodromic" title="hkl_geometry_distance_orthodromic ()">hkl_geometry_distance_orthodromic</a>   (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geom</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-distance" title="hkl_geometry_distance ()">hkl_geometry_distance</a>               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-distance-orthodromic" title="hkl_geometry_distance_orthodromic ()">hkl_geometry_distance_orthodromic</a>   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
 <span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-closest-from-geometry-with-range" title="hkl_geometry_closest_from_geometry_with_range ()">hkl_geometry_closest_from_geometry_with_range</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-is-valid" title="hkl_geometry_is_valid ()">hkl_geometry_is_valid</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-fprintf" title="hkl_geometry_fprintf ()">hkl_geometry_fprintf</a>                (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> const *self</code></em>);
-<a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *   <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-new" title="hkl_geometry_list_new ()">hkl_geometry_list_new</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-free" title="hkl_geometry_list_free ()">hkl_geometry_list_free</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-add" title="hkl_geometry_list_add ()">hkl_geometry_list_add</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-reset" title="hkl_geometry_list_reset ()">hkl_geometry_list_reset</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-sort" title="hkl_geometry_list_sort ()">hkl_geometry_list_sort</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
+                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-is-valid" title="hkl_geometry_is_valid ()">hkl_geometry_is_valid</a>               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);
+<a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *   <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-new" title="hkl_geometry_list_new ()">hkl_geometry_list_new</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-free" title="hkl_geometry_list_free ()">hkl_geometry_list_free</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-add" title="hkl_geometry_list_add ()">hkl_geometry_list_add</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-reset" title="hkl_geometry_list_reset ()">hkl_geometry_list_reset</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-sort" title="hkl_geometry_list_sort ()">hkl_geometry_list_sort</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-fprintf" title="hkl_geometry_list_fprintf ()">hkl_geometry_list_fprintf</a>           (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-multiply" title="hkl_geometry_list_multiply ()">hkl_geometry_list_multiply</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-multiply" title="hkl_geometry_list_multiply ()">hkl_geometry_list_multiply</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-multiply-from-range" title="hkl_geometry_list_multiply_from_range ()">hkl_geometry_list_multiply_from_range</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-remove-invalid" title="hkl_geometry_list_remove_invalid ()">hkl_geometry_list_remove_invalid</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-len" title="hkl_geometry_list_len ()">hkl_geometry_list_len</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-is-empty" title="hkl_geometry_list_is_empty ()">hkl_geometry_list_is_empty</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> * <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-item-new" title="hkl_geometry_list_item_new ()">hkl_geometry_list_item_new</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-item-free" title="hkl_geometry_list_item_free ()">hkl_geometry_list_item_free</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);
+                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-remove-invalid" title="hkl_geometry_list_remove_invalid ()">hkl_geometry_list_remove_invalid</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);
+<a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="struct HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> * <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-item-new" title="hkl_geometry_list_item_new ()">hkl_geometry_list_item_new</a>        (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-geometry.html#hkl-geometry-list-item-free" title="hkl_geometry_list_item_free ()">hkl_geometry_list_item_free</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="struct HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-geometry.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-geometry.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklHolder">
-<a name="HklHolder"></a><h3>HklHolder</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklHolder"></a><h3>struct HklHolder</h3>
+<pre class="programlisting">struct HklHolder {
+	struct HklHolderConfig *config;
 	HklGeometry *geometry;
-	HKL_LIST(size_t, idx);
 	HklQuaternion q;
-} HklHolder;
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HklGeometryConfig">
-<a name="HklGeometryConfig"></a><h3>HklGeometryConfig</h3>
-<pre class="programlisting">typedef struct {
-	const char *name;
-	HklGeometryType type;
-} HklGeometryConfig;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklGeometry">
-<a name="HklGeometry"></a><h3>HklGeometry</h3>
-<pre class="programlisting">typedef struct {
-	const HklGeometryConfig *config;
+<div class="refsect2">
+<a name="HklGeometry"></a><h3>struct HklGeometry</h3>
+<pre class="programlisting">struct HklGeometry {
+	const HklFactory *factory;
 	HklSource source;
-	HKL_LIST(HklAxis, axes);
-	HKL_LIST(HklHolder, holders);
-} HklGeometry;
+	darray_parameter axes;
+	darray_holder holders;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklGeometryList">
-<a name="HklGeometryList"></a><h3>HklGeometryList</h3>
-<pre class="programlisting">typedef struct {
-	HKL_LIST(HklGeometryListItem *, items);
+<div class="refsect2">
+<a name="HklGeometryList"></a><h3>struct HklGeometryList</h3>
+<pre class="programlisting">struct HklGeometryList {
 	HklGeometryListMultiplyFunction multiply;
-} HklGeometryList;
+	darray_item items;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklGeometryListItem">
-<a name="HklGeometryListItem"></a><h3>HklGeometryListItem</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklGeometryListItem"></a><h3>struct HklGeometryListItem</h3>
+<pre class="programlisting">struct HklGeometryListItem {
 	HklGeometry *geometry;
-} HklGeometryListItem;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklGeometryListMultiplyFunction ()">
+<div class="refsect2">
 <a name="HklGeometryListMultiplyFunction"></a><h3>HklGeometryListMultiplyFunction ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                (*HklGeometryListMultiplyFunction)  (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
+<pre class="programlisting"><span class="returnvalue">void</span>                (*HklGeometryListMultiplyFunction)  (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="struct HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *item</code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_holder_add_rotation_axis ()">
+<div class="refsect2">
 <a name="hkl-holder-add-rotation-axis"></a><h3>hkl_holder_add_rotation_axis ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="returnvalue">HklAxis</span></a> *           hkl_holder_add_rotation_axis        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklHolder" title="HklHolder"><span class="type">HklHolder</span></a> *self</code></em>,
+<pre class="programlisting"><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_holder_add_rotation_axis        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklHolder" title="struct HklHolder"><span class="type">HklHolder</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> x</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> y</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_new ()">
+<div class="refsect2">
 <a name="hkl-geometry-new"></a><h3>hkl_geometry_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       hkl_geometry_new                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       hkl_geometry_new                    (<em class="parameter"><code>const <span class="type">HklFactory</span> *factory</code></em>);</pre>
 <p>
+constructor
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_new_copy ()">
+<div class="refsect2">
 <a name="hkl-geometry-new-copy"></a><h3>hkl_geometry_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       hkl_geometry_new_copy               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> const *self</code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="returnvalue">HklGeometry</span></a> *       hkl_geometry_new_copy               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
 <p>
+copy constructor
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_free ()">
-<a name="hkl-geometry-free"></a><h3>hkl_geometry_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_free                   (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_geometry_init_geometry ()">
+<div class="refsect2">
 <a name="hkl-geometry-init-geometry"></a><h3>hkl_geometry_init_geometry ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_init_geometry          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> const *src</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_init_geometry          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *src</code></em>);</pre>
 <p>
+initilize an HklGeometry
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_add_holder ()">
+<div class="refsect2">
 <a name="hkl-geometry-add-holder"></a><h3>hkl_geometry_add_holder ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklHolder" title="HklHolder"><span class="returnvalue">HklHolder</span></a> *         hkl_geometry_add_holder             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklHolder" title="struct HklHolder"><span class="returnvalue">HklHolder</span></a> *         hkl_geometry_add_holder             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
 <p>
+add an Holder to the <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_update ()">
+<div class="refsect2">
 <a name="hkl-geometry-update"></a><h3>hkl_geometry_update ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_update                 (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_update                 (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
 <p>
+update the geometry internal once an Axis values changed
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_get_axis_by_name ()">
+<div class="refsect2">
 <a name="hkl-geometry-get-axis-by-name"></a><h3>hkl_geometry_get_axis_by_name ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-axis.html#HklAxis" title="HklAxis"><span class="returnvalue">HklAxis</span></a> *           hkl_geometry_get_axis_by_name       (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_geometry_get_axis_by_name       (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <span class="type">char</span> *name</code></em>);</pre>
 <p>
+get an <a class="link" href="hkl-hkl-axis.html#HklAxis" title="struct HklAxis"><span class="type">HklAxis</span></a> using its name
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_geometry_randomize ()">
-<a name="hkl-geometry-randomize"></a><h3>hkl_geometry_randomize ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_randomize              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
+<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
+<td>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
 </td>
 </tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_set_values_v ()">
+<div class="refsect2">
 <a name="hkl-geometry-set-values-v"></a><h3>hkl_geometry_set_values_v ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_set_values_v           (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_set_values_v           (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">size_t</span> len</code></em>,
                                                          <em class="parameter"><code>...</code></em>);</pre>
 <p>
+set the axes values
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
+<col>
+</colgroup>
+<tbody><tr>
 <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
+<td>"...:</td>
+</tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_distance ()">
+<div class="refsect2">
 <a name="hkl-geometry-distance"></a><h3>hkl_geometry_distance ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_geometry_distance               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geom</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_geometry_distance               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
 <p>
+compute the distance between two <span class="type">HklGeometries</span>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
+<td>the this ptr</td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>geom</code></em> :</span></p></td>
-<td>
-</td>
+<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
+<td>the <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> to compare with</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
+<td>the distance between the two geometries</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_distance_orthodromic ()">
+<div class="refsect2">
 <a name="hkl-geometry-distance-orthodromic"></a><h3>hkl_geometry_distance_orthodromic ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_geometry_distance_orthodromic   (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geom</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_geometry_distance_orthodromic   (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
+<td>the this ptr</td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>geom</code></em> :</span></p></td>
-<td>
-</td>
+<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
+<td>the reference <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> to compare with.</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
+<td>the orthodromique distance</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_closest_from_geometry_with_range ()">
+<div class="refsect2">
 <a name="hkl-geometry-closest-from-geometry-with-range"></a><h3>hkl_geometry_closest_from_geometry_with_range ()</h3>
 <pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_closest_from_geometry_with_range
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
+                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
 <p>
+get the closest axes values in the HklInterval compatible with the
+current axes values
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_is_valid ()">
+<div class="refsect2">
 <a name="hkl-geometry-is-valid"></a><h3>hkl_geometry_is_valid ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_is_valid               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> const *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_is_valid               (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *self</code></em>);</pre>
 <p>
+check if all axes of the <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> are valid.
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_fprintf ()">
-<a name="hkl-geometry-fprintf"></a><h3>hkl_geometry_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_fprintf                (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_geometry_list_new ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-new"></a><h3>hkl_geometry_list_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *   hkl_geometry_list_new               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="returnvalue">HklGeometryList</span></a> *   hkl_geometry_list_new               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 <p>
+constructor
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_free ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-free"></a><h3>hkl_geometry_list_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_free              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_free              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
 <p>
+destructor
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_add ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-add"></a><h3>hkl_geometry_list_add ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_add               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_add               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
+<p>
+this method Add a geometry to the geometries
+</p>
 <p>
+This method try to be clever by allocating memory only if the
+current length of the geometries is not large enought. Then it just
+set the geometry axes and copy it to the right geometries. We do
+not gives the x len as it is equal to the self->axes_len.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
+<td>The current <a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
+<td>the <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> to add</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_reset ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-reset"></a><h3>hkl_geometry_list_reset ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_reset             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_reset             (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
 <p>
+reset the HklGeometry, in fact it is a sort of clean method remove
+all the items of the list.
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_sort ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-sort"></a><h3>hkl_geometry_list_sort ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_sort              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_sort              (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *ref</code></em>);</pre>
 <p>
+sort the <a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> compare to the distance of the given
+<a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_fprintf ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-fprintf"></a><h3>hkl_geometry_list_fprintf ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_fprintf           (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> const *self</code></em>);</pre>
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
 <p>
+print to a file the <a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_multiply ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-multiply"></a><h3>hkl_geometry_list_multiply ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_multiply          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_multiply          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
 <p>
+apply the multiply lenthod to the <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_multiply_from_range ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-multiply-from-range"></a><h3>hkl_geometry_list_multiply_from_range ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_multiply_from_range
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_remove_invalid ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-remove-invalid"></a><h3>hkl_geometry_list_remove_invalid ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_remove_invalid    (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_remove_invalid    (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
 <p>
+remove all invalid <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> from the <a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="struct HklGeometryList"><span class="type">HklGeometryList</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_len ()">
-<a name="hkl-geometry-list-len"></a><h3>hkl_geometry_list_len ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_list_len               (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_geometry_list_is_empty ()">
-<a name="hkl-geometry-list-is-empty"></a><h3>hkl_geometry_list_is_empty ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_geometry_list_is_empty          (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryList" title="HklGeometryList"><span class="type">HklGeometryList</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_geometry_list_item_new ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-item-new"></a><h3>hkl_geometry_list_item_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> * hkl_geometry_list_item_new        (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
+<pre class="programlisting"><a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="struct HklGeometryListItem"><span class="returnvalue">HklGeometryListItem</span></a> * hkl_geometry_list_item_new        (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
 <p>
+constructor
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_geometry_list_item_free ()">
+<div class="refsect2">
 <a name="hkl-geometry-list-item-free"></a><h3>hkl_geometry_list_item_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_item_free         (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_geometry_list_item_free         (<em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometryListItem" title="struct HklGeometryListItem"><span class="type">HklGeometryListItem</span></a> *self</code></em>);</pre>
 <p>
+destructor
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-interval.html b/Documentation/api/html/hkl-hkl-interval.html
index 607d091..29b7ea8 100644
--- a/Documentation/api/html/hkl-hkl-interval.html
+++ b/Documentation/api/html/hkl-hkl-interval.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-interval</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-detector.html" title="hkl-detector">
 <link rel="next" href="hkl-hkl-detector-factory.html" title="hkl-detector-factory">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-interval.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-interval">
+<div class="refentry">
 <a name="hkl-hkl-interval"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,395 +35,197 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-interval.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval">HklInterval</a>;
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-interval.html#hkl-interval-cmp" title="hkl_interval_cmp ()">hkl_interval_cmp</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *interval</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-plus-interval" title="hkl_interval_plus_interval ()">hkl_interval_plus_interval</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *interval</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-plus-double" title="hkl_interval_plus_double ()">hkl_interval_plus_double</a>            (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval">HklInterval</a>;
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-interval.html#hkl-interval-cmp" title="hkl_interval_cmp ()">hkl_interval_cmp</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-plus-interval" title="hkl_interval_plus_interval ()">hkl_interval_plus_interval</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-plus-double" title="hkl_interval_plus_double ()">hkl_interval_plus_double</a>            (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-minus-interval" title="hkl_interval_minus_interval ()">hkl_interval_minus_interval</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *interval</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-minus-double" title="hkl_interval_minus_double ()">hkl_interval_minus_double</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-minus-interval" title="hkl_interval_minus_interval ()">hkl_interval_minus_interval</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-minus-double" title="hkl_interval_minus_double ()">hkl_interval_minus_double</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-times-interval" title="hkl_interval_times_interval ()">hkl_interval_times_interval</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *interval</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-times-double" title="hkl_interval_times_double ()">hkl_interval_times_double</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-times-interval" title="hkl_interval_times_interval ()">hkl_interval_times_interval</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-times-double" title="hkl_interval_times_double ()">hkl_interval_times_double</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-divides-double" title="hkl_interval_divides_double ()">hkl_interval_divides_double</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-divides-double" title="hkl_interval_divides_double ()">hkl_interval_divides_double</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-interval.html#hkl-interval-contain-zero" title="hkl_interval_contain_zero ()">hkl_interval_contain_zero</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-cos" title="hkl_interval_cos ()">hkl_interval_cos</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-acos" title="hkl_interval_acos ()">hkl_interval_acos</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-sin" title="hkl_interval_sin ()">hkl_interval_sin</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-asin" title="hkl_interval_asin ()">hkl_interval_asin</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-tan" title="hkl_interval_tan ()">hkl_interval_tan</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-atan" title="hkl_interval_atan ()">hkl_interval_atan</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-interval.html#hkl-interval-length" title="hkl_interval_length ()">hkl_interval_length</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-angle-restrict-symm" title="hkl_interval_angle_restrict_symm ()">hkl_interval_angle_restrict_symm</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-interval.html#hkl-interval-contain-zero" title="hkl_interval_contain_zero ()">hkl_interval_contain_zero</a>           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-cos" title="hkl_interval_cos ()">hkl_interval_cos</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-acos" title="hkl_interval_acos ()">hkl_interval_acos</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-sin" title="hkl_interval_sin ()">hkl_interval_sin</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-asin" title="hkl_interval_asin ()">hkl_interval_asin</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-tan" title="hkl_interval_tan ()">hkl_interval_tan</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-atan" title="hkl_interval_atan ()">hkl_interval_atan</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-interval.html#hkl-interval-length" title="hkl_interval_length ()">hkl_interval_length</a>                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-interval.html#hkl-interval-angle-restrict-symm" title="hkl_interval_angle_restrict_symm ()">hkl_interval_angle_restrict_symm</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-interval.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-interval.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklInterval">
-<a name="HklInterval"></a><h3>HklInterval</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklInterval"></a><h3>struct HklInterval</h3>
+<pre class="programlisting">struct HklInterval {
 	double min;
 	double max;
-} HklInterval;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_cmp ()">
+<div class="refsect2">
 <a name="hkl-interval-cmp"></a><h3>hkl_interval_cmp ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_interval_cmp                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *interval</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_interval_cmp                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
 <p>
+compare two intervals
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_plus_interval ()">
+<div class="refsect2">
 <a name="hkl-interval-plus-interval"></a><h3>hkl_interval_plus_interval ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_plus_interval          (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *interval</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_plus_interval          (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
 <p>
+add two ontervals
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_plus_double ()">
+<div class="refsect2">
 <a name="hkl-interval-plus-double"></a><h3>hkl_interval_plus_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_plus_double            (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_plus_double            (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
 <p>
+add to an interval a double
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_minus_interval ()">
+<div class="refsect2">
 <a name="hkl-interval-minus-interval"></a><h3>hkl_interval_minus_interval ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_minus_interval         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *interval</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_minus_interval         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
 <p>
+substract two <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_minus_double ()">
+<div class="refsect2">
 <a name="hkl-interval-minus-double"></a><h3>hkl_interval_minus_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_minus_double           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_minus_double           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
 <p>
+subst a double to an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_times_interval ()">
+<div class="refsect2">
 <a name="hkl-interval-times-interval"></a><h3>hkl_interval_times_interval ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_times_interval         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *interval</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_times_interval         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *interval</code></em>);</pre>
 <p>
+multiply two <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>interval</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_times_double ()">
+<div class="refsect2">
 <a name="hkl-interval-times-double"></a><h3>hkl_interval_times_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_times_double           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_times_double           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
 <p>
+multiply an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> by a double
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_divides_double ()">
+<div class="refsect2">
 <a name="hkl-interval-divides-double"></a><h3>hkl_interval_divides_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_divides_double         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_divides_double         (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> const d</code></em>);</pre>
 <p>
+divide an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> by a double
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_contain_zero ()">
+<div class="refsect2">
 <a name="hkl-interval-contain-zero"></a><h3>hkl_interval_contain_zero ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_interval_contain_zero           (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_interval_contain_zero           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+check if an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> contain zero
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_cos ()">
+<div class="refsect2">
 <a name="hkl-interval-cos"></a><h3>hkl_interval_cos ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_cos                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_cos                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+compute the cosinus of an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_acos ()">
+<div class="refsect2">
 <a name="hkl-interval-acos"></a><h3>hkl_interval_acos ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_acos                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_acos                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+compute the arc cosinus of an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_sin ()">
+<div class="refsect2">
 <a name="hkl-interval-sin"></a><h3>hkl_interval_sin ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_sin                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_sin                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+compute the sin of an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_asin ()">
+<div class="refsect2">
 <a name="hkl-interval-asin"></a><h3>hkl_interval_asin ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_asin                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_asin                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+compute the arc sinus of an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_tan ()">
+<div class="refsect2">
 <a name="hkl-interval-tan"></a><h3>hkl_interval_tan ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_tan                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_tan                    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+compute the tangente of an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_atan ()">
+<div class="refsect2">
 <a name="hkl-interval-atan"></a><h3>hkl_interval_atan ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_atan                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_atan                   (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+compute the arc tangente of an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_length ()">
+<div class="refsect2">
 <a name="hkl-interval-length"></a><h3>hkl_interval_length ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_interval_length                 (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> const *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_interval_length                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+compute the length of an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_interval_angle_restrict_symm ()">
+<div class="refsect2">
 <a name="hkl-interval-angle-restrict-symm"></a><h3>hkl_interval_angle_restrict_symm ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_angle_restrict_symm    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_interval_angle_restrict_symm    (<em class="parameter"><code><a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> *self</code></em>);</pre>
 <p>
+restrict an <a class="link" href="hkl-hkl-interval.html#HklInterval" title="struct HklInterval"><span class="type">HklInterval</span></a> into -pi, pi
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-lattice.html b/Documentation/api/html/hkl-hkl-lattice.html
index f003eac..eb54d6e 100644
--- a/Documentation/api/html/hkl-hkl-lattice.html
+++ b/Documentation/api/html/hkl-hkl-lattice.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-lattice</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-common-q.html" title="hkl-pseudoaxis-common-q">
 <link rel="next" href="hkl-hkl-vector.html" title="hkl-vector">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-lattice.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-lattice">
+<div class="refentry">
 <a name="hkl-hkl-lattice"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,348 +35,52 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-lattice.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice">HklLattice</a>;
-<a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="returnvalue">HklLattice</span></a> *        <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-new" title="hkl_lattice_new ()">hkl_lattice_new</a>                     (<em class="parameter"><code><span class="type">double</span> a</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> b</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> c</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> alpha</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> beta</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> gamma</code></em>);
-<a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="returnvalue">HklLattice</span></a> *        <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-new-copy" title="hkl_lattice_new_copy ()">hkl_lattice_new_copy</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> const *self</code></em>);
-<a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="returnvalue">HklLattice</span></a> *        <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-new-default" title="hkl_lattice_new_default ()">hkl_lattice_new_default</a>             (<em class="parameter"><code><span class="type">void</span></code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-free" title="hkl_lattice_free ()">hkl_lattice_free</a>                    (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-set" title="hkl_lattice_set ()">hkl_lattice_set</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> a</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> b</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> c</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> alpha</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> beta</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> gamma</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-get-B" title="hkl_lattice_get_B ()">hkl_lattice_get_B</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *B</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-get-1-B" title="hkl_lattice_get_1_B ()">hkl_lattice_get_1_B</a>                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *B</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-reciprocal" title="hkl_lattice_reciprocal ()">hkl_lattice_reciprocal</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *r</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-randomize" title="hkl_lattice_randomize ()">hkl_lattice_randomize</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-lattice.html#HklLattice" title="struct HklLattice">HklLattice</a>;
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-randomize" title="hkl_lattice_randomize ()">hkl_lattice_randomize</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="struct HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-lattice.html#hkl-lattice-fprintf" title="hkl_lattice_fprintf ()">hkl_lattice_fprintf</a>                 (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> const *self</code></em>);
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-lattice.html#HklLattice" title="struct HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-lattice.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-lattice.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklLattice">
-<a name="HklLattice"></a><h3>HklLattice</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklLattice"></a><h3>struct HklLattice</h3>
+<pre class="programlisting">struct HklLattice {
 	HklParameter *a;
 	HklParameter *b;
 	HklParameter *c;
 	HklParameter *alpha;
 	HklParameter *beta;
 	HklParameter *gamma;
-} HklLattice;
+};
 </pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="hkl_lattice_new ()">
-<a name="hkl-lattice-new"></a><h3>hkl_lattice_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="returnvalue">HklLattice</span></a> *        hkl_lattice_new                     (<em class="parameter"><code><span class="type">double</span> a</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> b</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> c</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> alpha</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> beta</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> gamma</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>beta</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>gamma</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_lattice_new_copy ()">
-<a name="hkl-lattice-new-copy"></a><h3>hkl_lattice_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="returnvalue">HklLattice</span></a> *        hkl_lattice_new_copy                (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_lattice_new_default ()">
-<a name="hkl-lattice-new-default"></a><h3>hkl_lattice_new_default ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="returnvalue">HklLattice</span></a> *        hkl_lattice_new_default             (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_lattice_free ()">
-<a name="hkl-lattice-free"></a><h3>hkl_lattice_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_lattice_free                    (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_lattice_set ()">
-<a name="hkl-lattice-set"></a><h3>hkl_lattice_set ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_lattice_set                     (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> a</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> b</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> c</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> alpha</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> beta</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> gamma</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>beta</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>gamma</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_lattice_get_B ()">
-<a name="hkl-lattice-get-B"></a><h3>hkl_lattice_get_B ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_lattice_get_B                   (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *B</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>B</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_lattice_get_1_B ()">
-<a name="hkl-lattice-get-1-B"></a><h3>hkl_lattice_get_1_B ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_lattice_get_1_B                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *B</code></em>);</pre>
-<p>
-Compute the invert of B (needed by the hkl_sample_set_UB method)
-should be optimized
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <em class="parameter"><code>HklLattice</code></em>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>B</code></em> :</span></p></td>
-<td>the <em class="parameter"><code>HklMatrix</code></em> returned
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> HKL_SUCCESS or HKL_FAIL depending of the success of the
-computation.
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_lattice_reciprocal ()">
-<a name="hkl-lattice-reciprocal"></a><h3>hkl_lattice_reciprocal ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_lattice_reciprocal              (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *r</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>r</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_lattice_randomize ()">
+<div class="refsect2">
 <a name="hkl-lattice-randomize"></a><h3>hkl_lattice_randomize ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_lattice_randomize               (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_lattice_randomize               (<em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="struct HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);</pre>
 <p>
+randomize the lattice
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_lattice_fprintf ()">
+<div class="refsect2">
 <a name="hkl-lattice-fprintf"></a><h3>hkl_lattice_fprintf ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_lattice_fprintf                 (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-lattice.html#HklLattice" title="HklLattice"><span class="type">HklLattice</span></a> const *self</code></em>);</pre>
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-lattice.html#HklLattice" title="struct HklLattice"><span class="type">HklLattice</span></a> *self</code></em>);</pre>
 <p>
+print into a file the lattice.
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-list.html b/Documentation/api/html/hkl-hkl-list.html
index eb22562..f325420 100644
--- a/Documentation/api/html/hkl-hkl-list.html
+++ b/Documentation/api/html/hkl-hkl-list.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-list</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-matrix.html" title="hkl-matrix">
 <link rel="next" href="hkl-hkl-pseudoaxis-common.html" title="hkl-pseudoaxis-common">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-list.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-list">
+<div class="refentry">
 <a name="hkl-hkl-list"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,301 +35,19 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-list.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-LEN:CAPS" title="HKL_LIST_LEN()">HKL_LIST_LEN</a>                        (array)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST:CAPS" title="HKL_LIST()">HKL_LIST</a>                            (type,
-                                                         name)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-INIT:CAPS" title="HKL_LIST_INIT()">HKL_LIST_INIT</a>                       (array)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-ALLOC:CAPS" title="HKL_LIST_ALLOC()">HKL_LIST_ALLOC</a>                      (array,
-                                                         len)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-COPY:CAPS" title="HKL_LIST_COPY()">HKL_LIST_COPY</a>                       (dst,
-                                                         src)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-FREE:CAPS" title="HKL_LIST_FREE()">HKL_LIST_FREE</a>                       (array)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-FREE-DESTRUCTOR:CAPS" title="HKL_LIST_FREE_DESTRUCTOR()">HKL_LIST_FREE_DESTRUCTOR</a>            (array,
-                                                         destructor)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-RESIZE:CAPS" title="HKL_LIST_RESIZE()">HKL_LIST_RESIZE</a>                     (array,
-                                                         len)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-ADD-VALUE:CAPS" title="HKL_LIST_ADD_VALUE()">HKL_LIST_ADD_VALUE</a>                  (array,
-                                                         value)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-DEL:CAPS" title="HKL_LIST_DEL()">HKL_LIST_DEL</a>                        (array,
-                                                         idx)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-DEL-DESTRUCTOR:CAPS" title="HKL_LIST_DEL_DESTRUCTOR()">HKL_LIST_DEL_DESTRUCTOR</a>             (array,
-                                                         idx,
-                                                         destructor)
-#define             <a class="link" href="hkl-hkl-list.html#HKL-LIST-DEL-ITEM-DESTRUCTOR:CAPS" title="HKL_LIST_DEL_ITEM_DESTRUCTOR()">HKL_LIST_DEL_ITEM_DESTRUCTOR</a>        (array,
-                                                         item,
-                                                         destructor)
-</pre>
+<pre class="synopsis"></pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-list.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-list.details"></a><h2>Details</h2>
-<div class="refsect2" title="HKL_LIST_LEN()">
-<a name="HKL-LIST-LEN:CAPS"></a><h3>HKL_LIST_LEN()</h3>
-<pre class="programlisting">#define HKL_LIST_LEN(array) array ## _len
-</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST()">
-<a name="HKL-LIST:CAPS"></a><h3>HKL_LIST()</h3>
-<pre class="programlisting">#define HKL_LIST(type, name) type *name; size_t HKL_LIST_LEN(name)
-</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_INIT()">
-<a name="HKL-LIST-INIT:CAPS"></a><h3>HKL_LIST_INIT()</h3>
-<pre class="programlisting">#define HKL_LIST_INIT(array) array = NULL, HKL_LIST_LEN(array) = 0
-</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_ALLOC()">
-<a name="HKL-LIST-ALLOC:CAPS"></a><h3>HKL_LIST_ALLOC()</h3>
-<pre class="programlisting">#define             HKL_LIST_ALLOC(array, len)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_COPY()">
-<a name="HKL-LIST-COPY:CAPS"></a><h3>HKL_LIST_COPY()</h3>
-<pre class="programlisting">#define HKL_LIST_COPY(dst, src) memcpy(dst, src, HKL_LIST_LEN(src) * sizeof(*src))
-</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>dst</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_FREE()">
-<a name="HKL-LIST-FREE:CAPS"></a><h3>HKL_LIST_FREE()</h3>
-<pre class="programlisting">#define HKL_LIST_FREE(array) free(array), HKL_LIST_INIT(array)
-</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_FREE_DESTRUCTOR()">
-<a name="HKL-LIST-FREE-DESTRUCTOR:CAPS"></a><h3>HKL_LIST_FREE_DESTRUCTOR()</h3>
-<pre class="programlisting">#define             HKL_LIST_FREE_DESTRUCTOR(array, destructor)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>destructor</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_RESIZE()">
-<a name="HKL-LIST-RESIZE:CAPS"></a><h3>HKL_LIST_RESIZE()</h3>
-<pre class="programlisting">#define             HKL_LIST_RESIZE(array, len)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_ADD_VALUE()">
-<a name="HKL-LIST-ADD-VALUE:CAPS"></a><h3>HKL_LIST_ADD_VALUE()</h3>
-<pre class="programlisting">#define             HKL_LIST_ADD_VALUE(array, value)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_DEL()">
-<a name="HKL-LIST-DEL:CAPS"></a><h3>HKL_LIST_DEL()</h3>
-<pre class="programlisting">#define             HKL_LIST_DEL(array, idx)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_DEL_DESTRUCTOR()">
-<a name="HKL-LIST-DEL-DESTRUCTOR:CAPS"></a><h3>HKL_LIST_DEL_DESTRUCTOR()</h3>
-<pre class="programlisting">#define             HKL_LIST_DEL_DESTRUCTOR(array, idx, destructor)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>destructor</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HKL_LIST_DEL_ITEM_DESTRUCTOR()">
-<a name="HKL-LIST-DEL-ITEM-DESTRUCTOR:CAPS"></a><h3>HKL_LIST_DEL_ITEM_DESTRUCTOR()</h3>
-<pre class="programlisting">#define             HKL_LIST_DEL_ITEM_DESTRUCTOR(array, item, destructor)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>array</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>item</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>destructor</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-macros.html b/Documentation/api/html/hkl-hkl-macros.html
index 99a0073..781ca52 100644
--- a/Documentation/api/html/hkl-hkl-macros.html
+++ b/Documentation/api/html/hkl-hkl-macros.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-macros</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-e4cv.html" title="hkl-pseudoaxis-e4cv">
 <link rel="next" href="hkl-hkl-pseudoaxis-k6c.html" title="hkl-pseudoaxis-k6c">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-macros.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-macros">
+<div class="refentry">
 <a name="hkl-hkl-macros"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,27 +35,9 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-macros.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">#define             <a class="link" href="hkl-hkl-macros.html#HKL-BEGIN-DECLS:CAPS" title="HKL_BEGIN_DECLS">HKL_BEGIN_DECLS</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-END-DECLS:CAPS" title="HKL_END_DECLS">HKL_END_DECLS</a>
-#define             <a class="link" href="hkl-hkl-macros.html#INFINITY:CAPS" title="INFINITY">INFINITY</a>
-#define             <a class="link" href="hkl-hkl-macros.html#M-PI:CAPS" title="M_PI">M_PI</a>
-#define             <a class="link" href="hkl-hkl-macros.html#M-PI-2:CAPS" title="M_PI_2">M_PI_2</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-MAJOR:CAPS" title="HKL_MAJOR">HKL_MAJOR</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-MINOR:CAPS" title="HKL_MINOR">HKL_MINOR</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-PATCH:CAPS" title="HKL_PATCH">HKL_PATCH</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-VERSION:CAPS" title="HKL_VERSION">HKL_VERSION</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-TRUE:CAPS" title="HKL_TRUE">HKL_TRUE</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-FALSE:CAPS" title="HKL_FALSE">HKL_FALSE</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-SUCCESS:CAPS" title="HKL_SUCCESS">HKL_SUCCESS</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-FAIL:CAPS" title="HKL_FAIL">HKL_FAIL</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-TINY:CAPS" title="HKL_TINY">HKL_TINY</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-EPSILON:CAPS" title="HKL_EPSILON">HKL_EPSILON</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-DEGTORAD:CAPS" title="HKL_DEGTORAD">HKL_DEGTORAD</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-RADTODEG:CAPS" title="HKL_RADTODEG">HKL_RADTODEG</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-TAU:CAPS" title="HKL_TAU">HKL_TAU</a>
-#define             <a class="link" href="hkl-hkl-macros.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS" title="HKL_EULERIAN_KAPPA_SOLUTION">HKL_EULERIAN_KAPPA_SOLUTION</a>
+<pre class="synopsis">#define             <a class="link" href="hkl-hkl-macros.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS" title="HKL_EULERIAN_KAPPA_SOLUTION">HKL_EULERIAN_KAPPA_SOLUTION</a>
 #define             <a class="link" href="hkl-hkl-macros.html#hkl-assert" title="hkl_assert()">hkl_assert</a>                          (x)
 #define             <a class="link" href="hkl-hkl-macros.html#G-GNUC-PRINTF:CAPS" title="G_GNUC_PRINTF()">G_GNUC_PRINTF</a>                       (format_idx,
                                                          arg_idx)
@@ -68,276 +50,58 @@
 #define             <a class="link" href="hkl-hkl-macros.html#HKL-MALLOC:CAPS" title="HKL_MALLOC()">HKL_MALLOC</a>                          (type)
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-macros.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-macros.details"></a><h2>Details</h2>
-<div class="refsect2" title="HKL_BEGIN_DECLS">
-<a name="HKL-BEGIN-DECLS:CAPS"></a><h3>HKL_BEGIN_DECLS</h3>
-<pre class="programlisting">#define             HKL_BEGIN_DECLS</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_END_DECLS">
-<a name="HKL-END-DECLS:CAPS"></a><h3>HKL_END_DECLS</h3>
-<pre class="programlisting">#define             HKL_END_DECLS</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="INFINITY">
-<a name="INFINITY:CAPS"></a><h3>INFINITY</h3>
-<pre class="programlisting"># define INFINITY DBL_MAX
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="M_PI">
-<a name="M-PI:CAPS"></a><h3>M_PI</h3>
-<pre class="programlisting"># define M_PI     3.14159265358979323846264338328
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="M_PI_2">
-<a name="M-PI-2:CAPS"></a><h3>M_PI_2</h3>
-<pre class="programlisting"># define M_PI_2   1.57079632679489661923132169164
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_MAJOR">
-<a name="HKL-MAJOR:CAPS"></a><h3>HKL_MAJOR</h3>
-<pre class="programlisting">#define HKL_MAJOR 2
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_MINOR">
-<a name="HKL-MINOR:CAPS"></a><h3>HKL_MINOR</h3>
-<pre class="programlisting">#define HKL_MINOR 3
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_PATCH">
-<a name="HKL-PATCH:CAPS"></a><h3>HKL_PATCH</h3>
-<pre class="programlisting">#define HKL_PATCH 0
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_VERSION">
-<a name="HKL-VERSION:CAPS"></a><h3>HKL_VERSION</h3>
-<pre class="programlisting">#define HKL_VERSION (HKL_MAJOR * 10000 + HKL_MINOR * 100 + HKL_PATCH)
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_TRUE">
-<a name="HKL-TRUE:CAPS"></a><h3>HKL_TRUE</h3>
-<pre class="programlisting">#define HKL_TRUE 1
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_FALSE">
-<a name="HKL-FALSE:CAPS"></a><h3>HKL_FALSE</h3>
-<pre class="programlisting">#define HKL_FALSE 0
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_SUCCESS">
-<a name="HKL-SUCCESS:CAPS"></a><h3>HKL_SUCCESS</h3>
-<pre class="programlisting">#define HKL_SUCCESS 0
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_FAIL">
-<a name="HKL-FAIL:CAPS"></a><h3>HKL_FAIL</h3>
-<pre class="programlisting">#define HKL_FAIL -1
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_TINY">
-<a name="HKL-TINY:CAPS"></a><h3>HKL_TINY</h3>
-<pre class="programlisting">#define HKL_TINY 1e-7
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_EPSILON">
-<a name="HKL-EPSILON:CAPS"></a><h3>HKL_EPSILON</h3>
-<pre class="programlisting">#define HKL_EPSILON 1e-6
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_DEGTORAD">
-<a name="HKL-DEGTORAD:CAPS"></a><h3>HKL_DEGTORAD</h3>
-<pre class="programlisting">#define HKL_DEGTORAD (M_PI/180.)
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_RADTODEG">
-<a name="HKL-RADTODEG:CAPS"></a><h3>HKL_RADTODEG</h3>
-<pre class="programlisting">#define HKL_RADTODEG (180./M_PI)
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_TAU">
-<a name="HKL-TAU:CAPS"></a><h3>HKL_TAU</h3>
-<pre class="programlisting">#define HKL_TAU (2. * M_PI)
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HKL_EULERIAN_KAPPA_SOLUTION">
+<div class="refsect2">
 <a name="HKL-EULERIAN-KAPPA-SOLUTION:CAPS"></a><h3>HKL_EULERIAN_KAPPA_SOLUTION</h3>
 <pre class="programlisting">#define HKL_EULERIAN_KAPPA_SOLUTION 1
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_assert()">
+<div class="refsect2">
 <a name="hkl-assert"></a><h3>hkl_assert()</h3>
-<pre class="programlisting">#define             hkl_assert(x)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<pre class="programlisting"># define hkl_assert(x) do{ if (!(x)) {hkl_printbt(); assert(x); } } while(0)
+</pre>
 </div>
 <hr>
-<div class="refsect2" title="G_GNUC_PRINTF()">
+<div class="refsect2">
 <a name="G-GNUC-PRINTF:CAPS"></a><h3>G_GNUC_PRINTF()</h3>
 <pre class="programlisting">#define             G_GNUC_PRINTF( format_idx, arg_idx )</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>format_idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>arg_idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="alloc_nr()">
+<div class="refsect2">
 <a name="alloc-nr"></a><h3>alloc_nr()</h3>
 <pre class="programlisting">#define alloc_nr(x) (((x)+16)*3/2)
 </pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="ALLOC_GROW()">
+<div class="refsect2">
 <a name="ALLOC-GROW:CAPS"></a><h3>ALLOC_GROW()</h3>
 <pre class="programlisting">#define             ALLOC_GROW(x, nr, alloc)</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>nr</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>alloc</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="NORETURN">
+<div class="refsect2">
 <a name="NORETURN:CAPS"></a><h3>NORETURN</h3>
 <pre class="programlisting">#define             NORETURN</pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_printbt ()">
+<div class="refsect2">
 <a name="hkl-printbt"></a><h3>hkl_printbt ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_printbt                         (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HKL_MALLOC()">
+<div class="refsect2">
 <a name="HKL-MALLOC:CAPS"></a><h3>HKL_MALLOC()</h3>
-<pre class="programlisting">#define HKL_MALLOC(type) _hkl_malloc(sizeof(type), "Can not allocate memory for a " #type)
+<pre class="programlisting">#define HKL_MALLOC(type) (type *)_hkl_malloc(sizeof(type), "Can not allocate memory for a " #type)
 </pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-matrix.html b/Documentation/api/html/hkl-hkl-matrix.html
index 6bad3bf..ea9a3ce 100644
--- a/Documentation/api/html/hkl-hkl-matrix.html
+++ b/Documentation/api/html/hkl-hkl-matrix.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-matrix</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">
 <link rel="next" href="hkl-hkl-list.html" title="hkl-list">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-matrix.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-matrix">
+<div class="refentry">
 <a name="hkl-hkl-matrix"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,432 +35,297 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-matrix.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix">HklMatrix</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-init" title="hkl_matrix_init ()">hkl_matrix_init</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m11</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m12</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m13</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m21</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m22</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m23</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m31</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m32</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m33</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-init-from-two-vector" title="hkl_matrix_init_from_two_vector ()">hkl_matrix_init_from_two_vector</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v2</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-init-from-euler" title="hkl_matrix_init_from_euler ()">hkl_matrix_init_from_euler</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix">HklMatrix</a>;
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-init-from-two-vector" title="hkl_matrix_init_from_two_vector ()">hkl_matrix_init_from_two_vector</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v1</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v2</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-init-from-euler" title="hkl_matrix_init_from_euler ()">hkl_matrix_init_from_euler</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> euler_x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> euler_y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> euler_z</code></em>);
+                                                         <em class="parameter"><code><span class="type">double</span> euler_y</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-fprintf" title="hkl_matrix_fprintf ()">hkl_matrix_fprintf</a>                  (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-to-euler" title="hkl_matrix_to_euler ()">hkl_matrix_to_euler</a>                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-to-euler" title="hkl_matrix_to_euler ()">hkl_matrix_to_euler</a>                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> *euler_x</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> *euler_y</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> *euler_z</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-cmp" title="hkl_matrix_cmp ()">hkl_matrix_cmp</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-times-matrix" title="hkl_matrix_times_matrix ()">hkl_matrix_times_matrix</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-times-vector" title="hkl_matrix_times_vector ()">hkl_matrix_times_vector</a>             (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-transpose" title="hkl_matrix_transpose ()">hkl_matrix_transpose</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-det" title="hkl_matrix_det ()">hkl_matrix_det</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-solve" title="hkl_matrix_solve ()">hkl_matrix_solve</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *x</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *b</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-is-null" title="hkl_matrix_is_null ()">hkl_matrix_is_null</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-times-vector" title="hkl_matrix_times_vector ()">hkl_matrix_times_vector</a>             (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-transpose" title="hkl_matrix_transpose ()">hkl_matrix_transpose</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-det" title="hkl_matrix_det ()">hkl_matrix_det</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-solve" title="hkl_matrix_solve ()">hkl_matrix_solve</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *x</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *b</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-matrix.html#hkl-matrix-is-null" title="hkl_matrix_is_null ()">hkl_matrix_is_null</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-matrix.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-matrix.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklMatrix">
-<a name="HklMatrix"></a><h3>HklMatrix</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklMatrix"></a><h3>struct HklMatrix</h3>
+<pre class="programlisting">struct HklMatrix {
 	double data[3][3];
-} HklMatrix;
+};
 </pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="hkl_matrix_init ()">
-<a name="hkl-matrix-init"></a><h3>hkl_matrix_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_init                     (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m11</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m12</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m13</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m21</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m22</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m23</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m31</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m32</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> m33</code></em>);</pre>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to initialize
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m11</code></em> :</span></p></td>
-<td>the matrix 11 value
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m12</code></em> :</span></p></td>
-<td>the matrix 12 value
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m13</code></em> :</span></p></td>
-<td>the matrix 13 value
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m21</code></em> :</span></p></td>
-<td>the matrix 21 value
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m22</code></em> :</span></p></td>
-<td>the matrix 22 value
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m23</code></em> :</span></p></td>
-<td>the matrix 23 value
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m31</code></em> :</span></p></td>
-<td>the matrix 31 value
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m32</code></em> :</span></p></td>
-<td>the matrix 32 value
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m33</code></em> :</span></p></td>
-<td>the matrix 33 value
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_init_from_two_vector ()">
+<div class="refsect2">
 <a name="hkl-matrix-init-from-two-vector"></a><h3>hkl_matrix_init_from_two_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_init_from_two_vector     (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v2</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_init_from_two_vector     (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v1</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v2</code></em>);</pre>
 <p>
-Create an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> which represent a direct oriented base of the space
+Create an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> which represent a direct oriented base of the space
 the first row correspond to the |v1|, the second row |v2| and the last one
 is |v1 ^ v2|
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>The <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to initialize
-</td>
+<td>The <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> to initialize</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>v1</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>v2</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_init_from_euler ()">
+<div class="refsect2">
 <a name="hkl-matrix-init-from-euler"></a><h3>hkl_matrix_init_from_euler ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_init_from_euler          (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_init_from_euler          (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> euler_x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> euler_y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> euler_z</code></em>);</pre>
+                                                         <em class="parameter"><code><span class="type">double</span> euler_y</code></em>);</pre>
 <p>
-Create a rotation <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> from three eulerians angles.
+Create a rotation <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> from three eulerians angles.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to initialize
-</td>
+<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> to initialize</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>euler_x</code></em> :</span></p></td>
-<td>the eulerian value along X
-</td>
+<td>the eulerian value along X</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>euler_y</code></em> :</span></p></td>
-<td>the eulerian value along Y
-</td>
+<td>the eulerian value along Y</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>euler_z</code></em> :</span></p></td>
-<td>the eulerian value along Z
-</td>
+<td>the eulerian value along Z</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_fprintf ()">
+<div class="refsect2">
 <a name="hkl-matrix-fprintf"></a><h3>hkl_matrix_fprintf ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_fprintf                  (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
 <p>
-printf an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> into a FILE stream.
+printf an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> into a FILE stream.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
-<td>the FILE stream
-</td>
+<td>the FILE stream</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to print into the file stream
-</td>
+<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> to print into the file stream</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_to_euler ()">
+<div class="refsect2">
 <a name="hkl-matrix-to-euler"></a><h3>hkl_matrix_to_euler ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_to_euler                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_to_euler                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> *euler_x</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> *euler_y</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> *euler_z</code></em>);</pre>
 <p>
-compute the three eulerians values for a given rotation <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
+compute the three eulerians values for a given rotation <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the rotation <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to compute the eulerians angles 
-</td>
+<td>the rotation <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> use to compute the eulerians angles</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>euler_x</code></em> :</span></p></td>
-<td>the eulerian value along X
-</td>
+<td>the eulerian value along X</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>euler_y</code></em> :</span></p></td>
-<td>the eulerian value along Y
-</td>
+<td>the eulerian value along Y</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>euler_z</code></em> :</span></p></td>
-<td>the eulerian value along Z
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_matrix_cmp ()">
-<a name="hkl-matrix-cmp"></a><h3>hkl_matrix_cmp ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_matrix_cmp                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
-<p>
-compare two <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>.
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to compare with
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> return HKL_TRUE if | self - m | > HKL_EPSILON
-</td>
+<td>the eulerian value along Z</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_times_matrix ()">
-<a name="hkl-matrix-times-matrix"></a><h3>hkl_matrix_times_matrix ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_times_matrix             (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
-<p>
-compute the matrix multiplication self = self * m
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to modify
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to multiply by
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_matrix_times_vector ()">
+<div class="refsect2">
 <a name="hkl-matrix-times-vector"></a><h3>hkl_matrix_times_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_times_vector             (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_times_vector             (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
 <p>
-multiply an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> by an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
+multiply an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to multiply the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> use to multiply the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> multiply by the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> multiply by the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_transpose ()">
+<div class="refsect2">
 <a name="hkl-matrix-transpose"></a><h3>hkl_matrix_transpose ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_transpose                (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_matrix_transpose                (<em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
 <p>
-transpose an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
+transpose an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody><tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to transpose
-</td>
+<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> to transpose</td>
 </tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_det ()">
+<div class="refsect2">
 <a name="hkl-matrix-det"></a><h3>hkl_matrix_det ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_matrix_det                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_matrix_det                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
 <p>
-compute the determinant of an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
+compute the determinant of an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> use to compute the determinant
-</td>
+<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> use to compute the determinant</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the determinant of the self <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
-Todo: test
-</td>
+<td>the determinant of the self <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a>
+Todo: test</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_solve ()">
+<div class="refsect2">
 <a name="hkl-matrix-solve"></a><h3>hkl_matrix_solve ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_matrix_solve                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *x</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *b</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_matrix_solve                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *x</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *b</code></em>);</pre>
 <p>
 solve the system self . X = b
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>The <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> of the system
-</td>
+<td>The <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> of the system</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to compute.
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to compute.</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
-<td>the <span class="type">hklVector</span> of the system to solve.
-</td>
+<td>the <span class="type">hklVector</span> of the system to solve.</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> -1 if the système has no solution, 0 otherwise.
-Todo: test
-</td>
+<td>-1 if the système has no solution, 0 otherwise.
+Todo: test</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_matrix_is_null ()">
+<div class="refsect2">
 <a name="hkl-matrix-is-null"></a><h3>hkl_matrix_is_null ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_matrix_is_null                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_matrix_is_null                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *self</code></em>);</pre>
 <p>
-is all <span class="type">hklMatrix</span> elementes bellow <a class="link" href="hkl-hkl-macros.html#HKL-EPSILON:CAPS" title="HKL_EPSILON"><span class="type">HKL_EPSILON</span></a>
+is all <span class="type">hklMatrix</span> elementes bellow <a href="hkl-hkl-macros.html#HKL-EPSILON:CAPS"><span class="type">HKL_EPSILON</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> to test
-</td>
+<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> to test</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> HKL_TRUE if the self <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> is null
-Todo: test
-</td>
+<td>HKL_TRUE if the self <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> is null
+Todo: test</td>
 </tr>
 </tbody>
 </table></div>
@@ -469,6 +334,6 @@ Todo: test
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-parameter.html b/Documentation/api/html/hkl-hkl-parameter.html
index f6d95a6..ede5e61 100644
--- a/Documentation/api/html/hkl-hkl-parameter.html
+++ b/Documentation/api/html/hkl-hkl-parameter.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-parameter</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-error.html" title="hkl-error">
 <link rel="next" href="hkl-hkl-pseudoaxis.html" title="hkl-pseudoaxis">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-parameter.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-parameter">
+<div class="refentry">
 <a name="hkl-hkl-parameter"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,488 +35,77 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-parameter.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter">HklParameter</a>;
-<a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-new" title="hkl_parameter_new ()">hkl_parameter_new</a>                   (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter">HklParameter</a>;
+<a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-new" title="hkl_parameter_new ()">hkl_parameter_new</a>                   (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> min</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> value</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> max</code></em>,
                                                          <em class="parameter"><code><span class="type">int</span> fit</code></em>,
                                                          <em class="parameter"><code><span class="type">int</span> changed</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *unit</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *punit</code></em>);
-<a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-new-copy" title="hkl_parameter_new_copy ()">hkl_parameter_new_copy</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-init" title="hkl_parameter_init ()">hkl_parameter_init</a>                  (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> fit</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> changed</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *unit</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *punit</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-free" title="hkl_parameter_free ()">hkl_parameter_free</a>                  (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-set-value" title="hkl_parameter_set_value ()">hkl_parameter_set_value</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-get-value-unit" title="hkl_parameter_get_value_unit ()">hkl_parameter_get_value_unit</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-set-value-unit" title="hkl_parameter_set_value_unit ()">hkl_parameter_set_value_unit</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-get-max" title="hkl_parameter_get_max ()">hkl_parameter_get_max</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-get-range-unit" title="hkl_parameter_get_range_unit ()">hkl_parameter_get_range_unit</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *max</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-set-range" title="hkl_parameter_set_range ()">hkl_parameter_set_range</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-set-range-unit" title="hkl_parameter_set_range_unit ()">hkl_parameter_set_range_unit</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-randomize" title="hkl_parameter_randomize ()">hkl_parameter_randomize</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-is-valid" title="hkl_parameter_is_valid ()">hkl_parameter_is_valid</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *punit</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-is-valid" title="hkl_parameter_is_valid ()">hkl_parameter_is_valid</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-parameter.html#hkl-parameter-fprintf" title="hkl_parameter_fprintf ()">hkl_parameter_fprintf</a>               (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-parameter.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-parameter.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklParameter">
-<a name="HklParameter"></a><h3>HklParameter</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklParameter"></a><h3>struct HklParameter</h3>
+<pre class="programlisting">struct HklParameter {
 	const char *name;
 	HklInterval range;
-	double value;
-	HklUnit const *unit;
-	HklUnit const *punit;
+	double _value;
+	const HklUnit *unit;
+	const HklUnit *punit;
 	int fit;
 	int changed;
-} HklParameter;
+	const HklParameterOperations *ops;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_parameter_new ()">
+<div class="refsect2">
 <a name="hkl-parameter-new"></a><h3>hkl_parameter_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_parameter_new                   (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
+<pre class="programlisting"><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_parameter_new                   (<em class="parameter"><code>const <span class="type">char</span> *name</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> min</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> value</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> max</code></em>,
                                                          <em class="parameter"><code><span class="type">int</span> fit</code></em>,
                                                          <em class="parameter"><code><span class="type">int</span> changed</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *unit</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *punit</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>fit</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>changed</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>unit</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>punit</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_new_copy ()">
-<a name="hkl-parameter-new-copy"></a><h3>hkl_parameter_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="returnvalue">HklParameter</span></a> *      hkl_parameter_new_copy              (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_init ()">
-<a name="hkl-parameter-init"></a><h3>hkl_parameter_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_parameter_init                  (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> fit</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> changed</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *unit</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *punit</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>fit</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>changed</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>unit</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>punit</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_free ()">
-<a name="hkl-parameter-free"></a><h3>hkl_parameter_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_free                  (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_set_value ()">
-<a name="hkl-parameter-set-value"></a><h3>hkl_parameter_set_value ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_set_value             (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>);</pre>
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *punit</code></em>);</pre>
 <p>
+create a new <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="type">HklParameter</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_get_value_unit ()">
-<a name="hkl-parameter-get-value-unit"></a><h3>hkl_parameter_get_value_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_parameter_get_value_unit        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_set_value_unit ()">
-<a name="hkl-parameter-set-value-unit"></a><h3>hkl_parameter_set_value_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_parameter_set_value_unit        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> value</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_parameter_get_max ()">
-<a name="hkl-parameter-get-max"></a><h3>hkl_parameter_get_max ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_parameter_get_max               (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_get_range_unit ()">
-<a name="hkl-parameter-get-range-unit"></a><h3>hkl_parameter_get_range_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_get_range_unit        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> *max</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_set_range ()">
-<a name="hkl-parameter-set-range"></a><h3>hkl_parameter_set_range ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_set_range             (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_set_range_unit ()">
-<a name="hkl-parameter-set-range-unit"></a><h3>hkl_parameter_set_range_unit ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_set_range_unit        (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> min</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> max</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>min</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>max</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_randomize ()">
-<a name="hkl-parameter-randomize"></a><h3>hkl_parameter_randomize ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_randomize             (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_parameter_is_valid ()">
+<div class="refsect2">
 <a name="hkl-parameter-is-valid"></a><h3>hkl_parameter_is_valid ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_parameter_is_valid              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_parameter_is_valid              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
 <p>
+check if the value of the <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="type">HklParameter</span></a> is in the min,max range
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_parameter_fprintf ()">
+<div class="refsect2">
 <a name="hkl-parameter-fprintf"></a><h3>hkl_parameter_fprintf ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_parameter_fprintf               (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="type">HklParameter</span></a> *self</code></em>);</pre>
 <p>
+print into the <span class="type">FILE</span> f an <a class="link" href="hkl-hkl-parameter.html#HklParameter" title="struct HklParameter"><span class="type">HklParameter</span></a>
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-auto.html b/Documentation/api/html/hkl-hkl-pseudoaxis-auto.html
index f0d2a14..627cd69 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-auto.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-auto.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-auto</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-geometry-factory.html" title="hkl-geometry-factory">
 <link rel="next" href="hkl-hkl-pseudoaxis-e4cv.html" title="hkl-pseudoaxis-e4cv">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-auto.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-auto">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-auto"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,80 +35,19 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-auto.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-auto.html#hkl-pseudo-axis-engine-mode-set-real" title="hkl_pseudo_axis_engine_mode_set_real ()">hkl_pseudo_axis_engine_mode_set_real</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-</pre>
+<pre class="synopsis"></pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-auto.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-auto.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_mode_set_real ()">
-<a name="hkl-pseudo-axis-engine-mode-set-real"></a><h3>hkl_pseudo_axis_engine_mode_set_real ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_mode_set_real
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>detector</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common-eulerians.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common-eulerians.html
index c78f5c8..9a7a872 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common-eulerians.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common-eulerians.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-common-eulerians</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-zaxis.html" title="hkl-pseudoaxis-zaxis">
 <link rel="next" href="hkl-hkl-pseudoaxis-e6c.html" title="hkl-pseudoaxis-e6c">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-common-eulerians.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-common-eulerians">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common-eulerians"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,38 +35,24 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-common-eulerians.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians.html#hkl-pseudo-axis-engine-eulerians-new" title="hkl_pseudo_axis_engine_eulerians_new ()">hkl_pseudo_axis_engine_eulerians_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
+<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-eulerians.html#hkl-engine-eulerians-new" title="hkl_engine_eulerians_new ()">hkl_engine_eulerians_new</a>            (<em class="parameter"><code><span class="type">void</span></code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-eulerians.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-eulerians.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_eulerians_new ()">
-<a name="hkl-pseudo-axis-engine-eulerians-new"></a><h3>hkl_pseudo_axis_engine_eulerians_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_eulerians_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-eulerians-new"></a><h3>hkl_engine_eulerians_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_eulerians_new            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common-hkl.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common-hkl.html
index 0ea052f..437d070 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common-hkl.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common-hkl.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-common-hkl</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-unit.html" title="hkl-unit">
 <link rel="next" href="hkl-hkl-matrix.html" title="hkl-matrix">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-common-hkl.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-common-hkl">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common-hkl"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,341 +35,68 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-common-hkl.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q-func" title="RUBh_minus_Q_func ()">RUBh_minus_Q_func</a>                   (<em class="parameter"><code>const <span class="type">gsl_vector</span> *x</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">gsl_vector</span> *f</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction-func" title="double_diffraction_func ()">double_diffraction_func</a>             (<em class="parameter"><code>const <span class="type">gsl_vector</span> *x</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">gsl_vector</span> *f</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#psi-constant-vertical-func" title="psi_constant_vertical_func ()">psi_constant_vertical_func</a>          (<em class="parameter"><code>const <span class="type">gsl_vector</span> *x</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">gsl_vector</span> *f</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q" title="RUBh_minus_Q ()">RUBh_minus_Q</a>                        (<em class="parameter"><code><span class="type">double</span> const x[]</code></em>,
+<pre class="synopsis"><span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q" title="RUBh_minus_Q ()">RUBh_minus_Q</a>                        (<em class="parameter"><code><span class="type">double</span> const x[]</code></em>,
                                                          <em class="parameter"><code><span class="type">void</span> *params</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> f[]</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction" title="double_diffraction ()">double_diffraction</a>                  (<em class="parameter"><code><span class="type">double</span> const x[]</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> f[]</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-get-hkl-real" title="hkl_pseudo_axis_engine_mode_get_hkl_real ()">hkl_pseudo_axis_engine_mode_get_hkl_real</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-init-psi-constant-vertical-real" title="hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real ()">hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *base</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-hkl-new" title="hkl_pseudo_axis_engine_hkl_new ()">hkl_pseudo_axis_engine_hkl_new</a>    (<em class="parameter"><code><span class="type">void</span></code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-mode-get-hkl-real" title="hkl_mode_get_hkl_real ()">hkl_mode_get_hkl_real</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="struct HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **error</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-mode-init-psi-constant-vertical-real" title="hkl_mode_init_psi_constant_vertical_real ()">hkl_mode_init_psi_constant_vertical_real</a>
+                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *base</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="struct HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **error</code></em>);
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-hkl.html#hkl-engine-hkl-new" title="hkl_engine_hkl_new ()">hkl_engine_hkl_new</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-hkl.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-hkl.details"></a><h2>Details</h2>
-<div class="refsect2" title="RUBh_minus_Q_func ()">
-<a name="RUBh-minus-Q-func"></a><h3>RUBh_minus_Q_func ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 RUBh_minus_Q_func                   (<em class="parameter"><code>const <span class="type">gsl_vector</span> *x</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">gsl_vector</span> *f</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>params</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="double_diffraction_func ()">
-<a name="double-diffraction-func"></a><h3>double_diffraction_func ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 double_diffraction_func             (<em class="parameter"><code>const <span class="type">gsl_vector</span> *x</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">gsl_vector</span> *f</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>params</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="psi_constant_vertical_func ()">
-<a name="psi-constant-vertical-func"></a><h3>psi_constant_vertical_func ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 psi_constant_vertical_func          (<em class="parameter"><code>const <span class="type">gsl_vector</span> *x</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">gsl_vector</span> *f</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>params</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="RUBh_minus_Q ()">
+<div class="refsect2">
 <a name="RUBh-minus-Q"></a><h3>RUBh_minus_Q ()</h3>
 <pre class="programlisting"><span class="returnvalue">int</span>                 RUBh_minus_Q                        (<em class="parameter"><code><span class="type">double</span> const x[]</code></em>,
                                                          <em class="parameter"><code><span class="type">void</span> *params</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> f[]</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>params</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="double_diffraction ()">
-<a name="double-diffraction"></a><h3>double_diffraction ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 double_diffraction                  (<em class="parameter"><code><span class="type">double</span> const x[]</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> f[]</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>params</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-mode-get-hkl-real"></a><h3>hkl_mode_get_hkl_real ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_mode_get_hkl_real               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="struct HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_mode_get_hkl_real ()">
-<a name="hkl-pseudo-axis-engine-mode-get-hkl-real"></a><h3>hkl_pseudo_axis_engine_mode_get_hkl_real ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_mode_get_hkl_real
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>detector</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-mode-init-psi-constant-vertical-real"></a><h3>hkl_mode_init_psi_constant_vertical_real ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_mode_init_psi_constant_vertical_real
+                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklMode" title="struct HklMode"><span class="type">HklMode</span></a> *base</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="struct HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="struct HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="struct HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="struct HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real ()">
-<a name="hkl-pseudo-axis-engine-mode-init-psi-constant-vertical-real"></a><h3>hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *base</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>base</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>detector</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_hkl_new ()">
-<a name="hkl-pseudo-axis-engine-hkl-new"></a><h3>hkl_pseudo_axis_engine_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_hkl_new    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-hkl-new"></a><h3>hkl_engine_hkl_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_hkl_new                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common-psi.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common-psi.html
index 659daee..f9df7f5 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common-psi.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common-psi.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-common-psi</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-factory.html" title="hkl-pseudoaxis-factory">
 <link rel="next" href="hkl-hkl-pseudoaxis-common-q.html" title="hkl-pseudoaxis-common-q">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-common-psi.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-common-psi">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common-psi"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,88 +35,41 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-common-psi.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#HklPseudoAxisEngineModePsi" title="HklPseudoAxisEngineModePsi">HklPseudoAxisEngineModePsi</a>;
-<a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#HklPseudoAxisEngineModePsi" title="HklPseudoAxisEngineModePsi"><span class="returnvalue">HklPseudoAxisEngineModePsi</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-mode-psi-new" title="hkl_pseudo_axis_engine_mode_psi_new ()">hkl_pseudo_axis_engine_mode_psi_new</a>
-                                                        (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> axes_names_len</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *axes_names[]</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-psi-new" title="hkl_pseudo_axis_engine_psi_new ()">hkl_pseudo_axis_engine_psi_new</a>    (<em class="parameter"><code><span class="type">void</span></code></em>);
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#HklModePsi" title="struct HklModePsi">HklModePsi</a>;
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklMode" title="struct HklMode"><span class="returnvalue">HklMode</span></a> *           <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#hkl-mode-psi-new" title="hkl_mode_psi_new ()">hkl_mode_psi_new</a>                    (<em class="parameter"><code>const <span class="type">HklModeAutoInfo</span> *info</code></em>);
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#hkl-engine-psi-new" title="hkl_engine_psi_new ()">hkl_engine_psi_new</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-psi.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-psi.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklPseudoAxisEngineModePsi">
-<a name="HklPseudoAxisEngineModePsi"></a><h3>HklPseudoAxisEngineModePsi</h3>
-<pre class="programlisting">typedef struct {
-	HklPseudoAxisEngineMode parent;
+<div class="refsect2">
+<a name="HklModePsi"></a><h3>struct HklModePsi</h3>
+<pre class="programlisting">struct HklModePsi {
+	HklMode parent;
 	HklVector Q0;
 	HklVector hkl0;
-} HklPseudoAxisEngineModePsi;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_mode_psi_new ()">
-<a name="hkl-pseudo-axis-engine-mode-psi-new"></a><h3>hkl_pseudo_axis_engine_mode_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis-common-psi.html#HklPseudoAxisEngineModePsi" title="HklPseudoAxisEngineModePsi"><span class="returnvalue">HklPseudoAxisEngineModePsi</span></a> * hkl_pseudo_axis_engine_mode_psi_new
-                                                        (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> axes_names_len</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *axes_names[]</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>axes_names_len</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>axes_names</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-mode-psi-new"></a><h3>hkl_mode_psi_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklMode" title="struct HklMode"><span class="returnvalue">HklMode</span></a> *           hkl_mode_psi_new                    (<em class="parameter"><code>const <span class="type">HklModeAutoInfo</span> *info</code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_psi_new ()">
-<a name="hkl-pseudo-axis-engine-psi-new"></a><h3>hkl_pseudo_axis_engine_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_psi_new    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-psi-new"></a><h3>hkl_engine_psi_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_psi_new                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common-q.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common-q.html
index 346bb04..6aecc8d 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common-q.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common-q.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-common-q</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-common-psi.html" title="hkl-pseudoaxis-common-psi">
 <link rel="next" href="hkl-hkl-lattice.html" title="hkl-lattice">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-common-q.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-common-q">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common-q"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,52 +35,30 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-common-q.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q-new" title="hkl_pseudo_axis_engine_q_new ()">hkl_pseudo_axis_engine_q_new</a>      (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q2-new" title="hkl_pseudo_axis_engine_q2_new ()">hkl_pseudo_axis_engine_q2_new</a>     (<em class="parameter"><code><span class="type">void</span></code></em>);
+<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-q.html#hkl-engine-q-new" title="hkl_engine_q_new ()">hkl_engine_q_new</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-common-q.html#hkl-engine-q2-new" title="hkl_engine_q2_new ()">hkl_engine_q2_new</a>                   (<em class="parameter"><code><span class="type">void</span></code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-q.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common-q.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_q_new ()">
-<a name="hkl-pseudo-axis-engine-q-new"></a><h3>hkl_pseudo_axis_engine_q_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_q_new      (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-q-new"></a><h3>hkl_engine_q_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_q_new                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_q2_new ()">
-<a name="hkl-pseudo-axis-engine-q2-new"></a><h3>hkl_pseudo_axis_engine_q2_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_q2_new     (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-q2-new"></a><h3>hkl_engine_q2_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_q2_new                   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-common.html b/Documentation/api/html/hkl-hkl-pseudoaxis-common.html
index 3f3c2b9..27525dd 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-common.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-common.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-common</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-list.html" title="hkl-list">
 <link rel="next" href="hkl-hkl-sample.html" title="hkl-sample">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-common.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-common">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-common"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,71 +35,19 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-common.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis-common.html#hkl-pseudo-axis-engine-init-func" title="hkl_pseudo_axis_engine_init_func ()">hkl_pseudo_axis_engine_init_func</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *sample</code></em>);
-</pre>
+<pre class="synopsis"></pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-common.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_init_func ()">
-<a name="hkl-pseudo-axis-engine-init-func"></a><h3>hkl_pseudo_axis_engine_init_func ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_init_func    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *sample</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>detector</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-e4cv.html b/Documentation/api/html/hkl-hkl-pseudoaxis-e4cv.html
index c7e0c21..61ab979 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-e4cv.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-e4cv.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-e4cv</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-auto.html" title="hkl-pseudoaxis-auto">
 <link rel="next" href="hkl-hkl-macros.html" title="hkl-macros">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-e4cv.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-e4cv">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-e4cv"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,56 +35,19 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-e4cv.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-hkl-new" title="hkl_pseudo_axis_engine_e4cv_hkl_new ()">hkl_pseudo_axis_engine_e4cv_hkl_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-psi-new" title="hkl_pseudo_axis_engine_e4cv_psi_new ()">hkl_pseudo_axis_engine_e4cv_psi_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-</pre>
+<pre class="synopsis"></pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-e4cv.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-e4cv.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_e4cv_hkl_new ()">
-<a name="hkl-pseudo-axis-engine-e4cv-hkl-new"></a><h3>hkl_pseudo_axis_engine_e4cv_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_e4cv_hkl_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_e4cv_psi_new ()">
-<a name="hkl-pseudo-axis-engine-e4cv-psi-new"></a><h3>hkl_pseudo_axis_engine_e4cv_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_e4cv_psi_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-e6c.html b/Documentation/api/html/hkl-hkl-pseudoaxis-e6c.html
index 084aaf2..23b1428 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-e6c.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-e6c.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-e6c</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-common-eulerians.html" title="hkl-pseudoaxis-common-eulerians">
 <link rel="next" href="hkl-hkl-detector.html" title="hkl-detector">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-e6c.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-e6c">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-e6c"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,56 +35,30 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-e6c.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-hkl-new" title="hkl_pseudo_axis_engine_e6c_hkl_new ()">hkl_pseudo_axis_engine_e6c_hkl_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-psi-new" title="hkl_pseudo_axis_engine_e6c_psi_new ()">hkl_pseudo_axis_engine_e6c_psi_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
+<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-e6c.html#hkl-engine-e6c-hkl-new" title="hkl_engine_e6c_hkl_new ()">hkl_engine_e6c_hkl_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-e6c.html#hkl-engine-e6c-psi-new" title="hkl_engine_e6c_psi_new ()">hkl_engine_e6c_psi_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-e6c.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-e6c.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_e6c_hkl_new ()">
-<a name="hkl-pseudo-axis-engine-e6c-hkl-new"></a><h3>hkl_pseudo_axis_engine_e6c_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_e6c_hkl_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-e6c-hkl-new"></a><h3>hkl_engine_e6c_hkl_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_e6c_hkl_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_e6c_psi_new ()">
-<a name="hkl-pseudo-axis-engine-e6c-psi-new"></a><h3>hkl_pseudo_axis_engine_e6c_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_e6c_psi_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-e6c-psi-new"></a><h3>hkl_engine_e6c_psi_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_e6c_psi_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-factory.html b/Documentation/api/html/hkl-hkl-pseudoaxis-factory.html
index 3ee6770..7b1c3df 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-factory.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-factory.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-factory</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-axis.html" title="hkl-axis">
 <link rel="next" href="hkl-hkl-pseudoaxis-common-psi.html" title="hkl-pseudoaxis-common-psi">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-factory.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-factory">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-factory"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,45 +35,19 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-factory.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="returnvalue">HklPseudoAxisEngineList</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-factory.html#hkl-pseudo-axis-engine-list-factory" title="hkl_pseudo_axis_engine_list_factory ()">hkl_pseudo_axis_engine_list_factory</a>
-                                                        (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometryConfig" title="HklGeometryConfig"><span class="type">HklGeometryConfig</span></a> *config</code></em>);
-</pre>
+<pre class="synopsis"></pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-factory.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-factory.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_factory ()">
-<a name="hkl-pseudo-axis-engine-list-factory"></a><h3>hkl_pseudo_axis_engine_list_factory ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="returnvalue">HklPseudoAxisEngineList</span></a> * hkl_pseudo_axis_engine_list_factory
-                                                        (<em class="parameter"><code>const <a class="link" href="hkl-hkl-geometry.html#HklGeometryConfig" title="HklGeometryConfig"><span class="type">HklGeometryConfig</span></a> *config</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>config</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-k4cv.html b/Documentation/api/html/hkl-hkl-pseudoaxis-k4cv.html
index dd2b618..80e1c62 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-k4cv.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-k4cv.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-k4cv</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-quaternion.html" title="hkl-quaternion">
 <link rel="next" href="hkl-hkl-error.html" title="hkl-error">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-k4cv.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-k4cv">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-k4cv"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,56 +35,30 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-k4cv.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-hkl-new" title="hkl_pseudo_axis_engine_k4cv_hkl_new ()">hkl_pseudo_axis_engine_k4cv_hkl_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-psi-new" title="hkl_pseudo_axis_engine_k4cv_psi_new ()">hkl_pseudo_axis_engine_k4cv_psi_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
+<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-k4cv.html#hkl-engine-k4cv-hkl-new" title="hkl_engine_k4cv_hkl_new ()">hkl_engine_k4cv_hkl_new</a>             (<em class="parameter"><code><span class="type">void</span></code></em>);
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-k4cv.html#hkl-engine-k4cv-psi-new" title="hkl_engine_k4cv_psi_new ()">hkl_engine_k4cv_psi_new</a>             (<em class="parameter"><code><span class="type">void</span></code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-k4cv.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-k4cv.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_k4cv_hkl_new ()">
-<a name="hkl-pseudo-axis-engine-k4cv-hkl-new"></a><h3>hkl_pseudo_axis_engine_k4cv_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_k4cv_hkl_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-k4cv-hkl-new"></a><h3>hkl_engine_k4cv_hkl_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_k4cv_hkl_new             (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_k4cv_psi_new ()">
-<a name="hkl-pseudo-axis-engine-k4cv-psi-new"></a><h3>hkl_pseudo_axis_engine_k4cv_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_k4cv_psi_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-k4cv-psi-new"></a><h3>hkl_engine_k4cv_psi_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_k4cv_psi_new             (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-k6c.html b/Documentation/api/html/hkl-hkl-pseudoaxis-k6c.html
index 5fdb2b5..d61b197 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-k6c.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-k6c.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-k6c</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-macros.html" title="hkl-macros">
 <link rel="next" href="hkl-hkl-source.html" title="hkl-source">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-k6c.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-k6c">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-k6c"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,56 +35,30 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-k6c.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-hkl-new" title="hkl_pseudo_axis_engine_k6c_hkl_new ()">hkl_pseudo_axis_engine_k6c_hkl_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-psi-new" title="hkl_pseudo_axis_engine_k6c_psi_new ()">hkl_pseudo_axis_engine_k6c_psi_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
+<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-k6c.html#hkl-engine-k6c-hkl-new" title="hkl_engine_k6c_hkl_new ()">hkl_engine_k6c_hkl_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-k6c.html#hkl-engine-k6c-psi-new" title="hkl_engine_k6c_psi_new ()">hkl_engine_k6c_psi_new</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-k6c.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-k6c.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_k6c_hkl_new ()">
-<a name="hkl-pseudo-axis-engine-k6c-hkl-new"></a><h3>hkl_pseudo_axis_engine_k6c_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_k6c_hkl_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-k6c-hkl-new"></a><h3>hkl_engine_k6c_hkl_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_k6c_hkl_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_k6c_psi_new ()">
-<a name="hkl-pseudo-axis-engine-k6c-psi-new"></a><h3>hkl_pseudo_axis_engine_k6c_psi_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_k6c_psi_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-k6c-psi-new"></a><h3>hkl_engine_k6c_psi_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_k6c_psi_new              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis-zaxis.html b/Documentation/api/html/hkl-hkl-pseudoaxis-zaxis.html
index f848672..8be50b7 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis-zaxis.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis-zaxis.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis-zaxis</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="ch01.html" title="[Insert title here]">
 <link rel="next" href="hkl-hkl-pseudoaxis-common-eulerians.html" title="hkl-pseudoaxis-common-eulerians">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis-zaxis.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis-zaxis">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis-zaxis"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,38 +35,24 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis-zaxis.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis-zaxis.html#hkl-pseudo-axis-engine-zaxis-hkl-new" title="hkl_pseudo_axis_engine_zaxis_hkl_new ()">hkl_pseudo_axis_engine_zaxis_hkl_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
+<pre class="synopsis"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         <a class="link" href="hkl-hkl-pseudoaxis-zaxis.html#hkl-engine-zaxis-hkl-new" title="hkl_engine_zaxis_hkl_new ()">hkl_engine_zaxis_hkl_new</a>            (<em class="parameter"><code><span class="type">void</span></code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-zaxis.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis-zaxis.details"></a><h2>Details</h2>
-<div class="refsect2" title="hkl_pseudo_axis_engine_zaxis_hkl_new ()">
-<a name="hkl-pseudo-axis-engine-zaxis-hkl-new"></a><h3>hkl_pseudo_axis_engine_zaxis_hkl_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_zaxis_hkl_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="hkl-engine-zaxis-hkl-new"></a><h3>hkl_engine_zaxis_hkl_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="returnvalue">HklEngine</span></a> *         hkl_engine_zaxis_hkl_new            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-pseudoaxis.html b/Documentation/api/html/hkl-hkl-pseudoaxis.html
index 3f7bc64..3133a55 100644
--- a/Documentation/api/html/hkl-hkl-pseudoaxis.html
+++ b/Documentation/api/html/hkl-hkl-pseudoaxis.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-pseudoaxis</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-parameter.html" title="hkl-parameter">
 <link rel="next" href="hkl-hkl-geometry.html" title="hkl-geometry">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-pseudoaxis.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-pseudoaxis">
+<div class="refentry">
 <a name="hkl-hkl-pseudoaxis"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,927 +35,139 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-pseudoaxis.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis">HklPseudoAxis</a>;
-                    <a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode">HklPseudoAxisEngineMode</a>;
-                    <a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine">HklPseudoAxisEngine</a>;
-                    <a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList">HklPseudoAxisEngineList</a>;
-<span class="returnvalue">int</span>                 (<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()">*HklPseudoAxisEngineModeFunc</a>)      (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<span class="returnvalue">int</span>                 (<a class="link" href="hkl-hkl-pseudoaxis.html#HklFunction" title="HklFunction ()">*HklFunction</a>)                      (<em class="parameter"><code>const <span class="type">gsl_vector</span> *x</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">gsl_vector</span> *f</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="returnvalue">HklPseudoAxis</span></a> *     <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-new" title="hkl_pseudo_axis_new ()">hkl_pseudo_axis_new</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *parameter</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-init" title="hkl_pseudo_axis_init ()">hkl_pseudo_axis_init</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="type">HklPseudoAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *parameter</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-free" title="hkl_pseudo_axis_free ()">hkl_pseudo_axis_free</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="type">HklPseudoAxis</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-fprintf" title="hkl_pseudo_axis_fprintf ()">hkl_pseudo_axis_fprintf</a>             (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="type">HklPseudoAxis</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="returnvalue">HklPseudoAxisEngineMode</span></a> * <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-new" title="hkl_pseudo_axis_engine_mode_new ()">hkl_pseudo_axis_engine_mode_new</a>
-                                                        (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> initialize</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> get</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> set</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-init" title="hkl_pseudo_axis_engine_mode_init ()">hkl_pseudo_axis_engine_mode_init</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> initialize</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> get</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> set</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n_func</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklFunction" title="HklFunction ()"><span class="type">HklFunction</span></a> functions[]</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n_p</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> parameters[]</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n_axes</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *axes_names[]</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-free" title="hkl_pseudo_axis_engine_mode_free ()">hkl_pseudo_axis_engine_mode_free</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-new" title="hkl_pseudo_axis_engine_new ()">hkl_pseudo_axis_engine_new</a>        (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-free" title="hkl_pseudo_axis_engine_free ()">hkl_pseudo_axis_engine_free</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-mode" title="hkl_pseudo_axis_engine_add_mode ()">hkl_pseudo_axis_engine_add_mode</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *mode</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-geometry" title="hkl_pseudo_axis_engine_add_geometry ()">hkl_pseudo_axis_engine_add_geometry</a> (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const x[]</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-select-mode" title="hkl_pseudo_axis_engine_select_mode ()">hkl_pseudo_axis_engine_select_mode</a>  (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-initialize" title="hkl_pseudo_axis_engine_initialize ()">hkl_pseudo_axis_engine_initialize</a>   (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-set" title="hkl_pseudo_axis_engine_set ()">hkl_pseudo_axis_engine_set</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-get" title="hkl_pseudo_axis_engine_get ()">hkl_pseudo_axis_engine_get</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-fprintf" title="hkl_pseudo_axis_engine_fprintf ()">hkl_pseudo_axis_engine_fprintf</a>      (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> const *self</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="returnvalue">HklPseudoAxisEngineList</span></a> * <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-new" title="hkl_pseudo_axis_engine_list_new ()">hkl_pseudo_axis_engine_list_new</a>
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-free" title="hkl_pseudo_axis_engine_list_free ()">hkl_pseudo_axis_engine_list_free</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-add" title="hkl_pseudo_axis_engine_list_add ()">hkl_pseudo_axis_engine_list_add</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-by-name" title="hkl_pseudo_axis_engine_list_get_by_name ()">hkl_pseudo_axis_engine_list_get_by_name</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);
-<a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="returnvalue">HklPseudoAxis</span></a> *     <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-pseudo-axis-by-name" title="hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name ()">hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-clear" title="hkl_pseudo_axis_engine_list_clear ()">hkl_pseudo_axis_engine_list_clear</a>   (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-init" title="hkl_pseudo_axis_engine_list_init ()">hkl_pseudo_axis_engine_list_init</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get" title="hkl_pseudo_axis_engine_list_get ()">hkl_pseudo_axis_engine_list_get</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-fprintf" title="hkl_pseudo_axis_engine_list_fprintf ()">hkl_pseudo_axis_engine_list_fprintf</a> (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> const *self</code></em>);
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="struct HklPseudoAxis">HklPseudoAxis</a>;
+struct              <a class="link" href="hkl-hkl-pseudoaxis.html#HklMode" title="struct HklMode">HklMode</a>;
+struct              <a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine">HklEngine</a>;
+struct              <a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList">HklEngineList</a>;
+struct              <a class="link" href="hkl-hkl-pseudoaxis.html#HklFunction" title="struct HklFunction">HklFunction</a>;
+<a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList"><span class="returnvalue">HklEngineList</span></a> *     <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-engine-list-new" title="hkl_engine_list_new ()">hkl_engine_list_new</a>                 (<em class="parameter"><code><span class="type">void</span></code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-engine-list-add" title="hkl_engine_list_add ()">hkl_engine_list_add</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-pseudoaxis.html#hkl-engine-list-clear" title="hkl_engine_list_clear ()">hkl_engine_list_clear</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-pseudoaxis.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklPseudoAxis">
-<a name="HklPseudoAxis"></a><h3>HklPseudoAxis</h3>
-<pre class="programlisting">typedef struct {
-	HklParameter parent;
-	HklPseudoAxisEngine *engine;
-} HklPseudoAxis;
+<div class="refsect2">
+<a name="HklPseudoAxis"></a><h3>struct HklPseudoAxis</h3>
+<pre class="programlisting">struct HklPseudoAxis {
+	HklParameter parameter;
+	HklEngine *engine;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklPseudoAxisEngineMode">
-<a name="HklPseudoAxisEngineMode"></a><h3>HklPseudoAxisEngineMode</h3>
-<pre class="programlisting">typedef struct {
-	char const *name;
-	HklPseudoAxisEngineModeFunc initialize;
-	HklPseudoAxisEngineModeFunc get;
-	HklPseudoAxisEngineModeFunc set;
-	HKL_LIST(HklFunction, functions);
-	HKL_LIST(HklParameter, parameters);
-	HKL_LIST(const char*, axes_names);
-	HklGeometry *geometry_init;
-	HklDetector *detector_init;
-	HklSample *sample_init;
-} HklPseudoAxisEngineMode;
+<div class="refsect2">
+<a name="HklMode"></a><h3>struct HklMode</h3>
+<pre class="programlisting">struct HklMode {
+	const HklModeInfo *info;
+	const HklModeOperations *ops;
+	darray_parameter parameters;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklPseudoAxisEngine">
-<a name="HklPseudoAxisEngine"></a><h3>HklPseudoAxisEngine</h3>
-<pre class="programlisting">typedef struct {
-	char const *name;
+<div class="refsect2">
+<a name="HklEngine"></a><h3>struct HklEngine</h3>
+<pre class="programlisting">struct HklEngine {
+	const HklEngineInfo *info;
+	const HklEngineOperations *ops;
 	HklGeometry *geometry;
 	HklDetector *detector;
 	HklSample *sample;
-	HKL_LIST(HklPseudoAxisEngineMode *, modes);
-	HKL_LIST(HklAxis *, axes);
-	HKL_LIST(HklPseudoAxis *, pseudoAxes);
-	HklPseudoAxisEngineMode *mode;
-	HklPseudoAxisEngineList *engines;
-} HklPseudoAxisEngine;
+	HklMode *mode; /* not owned */
+	HklEngineList *engines; /* not owned */
+	darray_parameter pseudo_axes;
+	darray_mode modes;
+	darray_parameter axes;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklPseudoAxisEngineList">
-<a name="HklPseudoAxisEngineList"></a><h3>HklPseudoAxisEngineList</h3>
-<pre class="programlisting">typedef struct {
-	HKL_LIST(HklPseudoAxisEngine *, engines);
+<div class="refsect2">
+<a name="HklEngineList"></a><h3>struct HklEngineList</h3>
+<pre class="programlisting">struct HklEngineList {
+	_darray(HklEngine *);
 	HklGeometryList *geometries;
 	HklGeometry *geometry;
 	HklDetector *detector;
 	HklSample *sample;
-} HklPseudoAxisEngineList;
+};
 </pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HklPseudoAxisEngineModeFunc ()">
-<a name="HklPseudoAxisEngineModeFunc"></a><h3>HklPseudoAxisEngineModeFunc ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 (*HklPseudoAxisEngineModeFunc)      (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>detector</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="HklFunction ()">
-<a name="HklFunction"></a><h3>HklFunction ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 (*HklFunction)                      (<em class="parameter"><code>const <span class="type">gsl_vector</span> *x</code></em>,
-                                                         <em class="parameter"><code><span class="type">void</span> *params</code></em>,
-                                                         <em class="parameter"><code><span class="type">gsl_vector</span> *f</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>params</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_new ()">
-<a name="hkl-pseudo-axis-new"></a><h3>hkl_pseudo_axis_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="returnvalue">HklPseudoAxis</span></a> *     hkl_pseudo_axis_new                 (<em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *parameter</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>parameter</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_init ()">
-<a name="hkl-pseudo-axis-init"></a><h3>hkl_pseudo_axis_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_init                (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="type">HklPseudoAxis</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> const *parameter</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>parameter</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_free ()">
-<a name="hkl-pseudo-axis-free"></a><h3>hkl_pseudo_axis_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_free                (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="type">HklPseudoAxis</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_fprintf ()">
-<a name="hkl-pseudo-axis-fprintf"></a><h3>hkl_pseudo_axis_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_fprintf             (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="type">HklPseudoAxis</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_mode_new ()">
-<a name="hkl-pseudo-axis-engine-mode-new"></a><h3>hkl_pseudo_axis_engine_mode_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="returnvalue">HklPseudoAxisEngineMode</span></a> * hkl_pseudo_axis_engine_mode_new
-                                                        (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> initialize</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> get</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> set</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>initialize</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>get</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>set</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_mode_init ()">
-<a name="hkl-pseudo-axis-engine-mode-init"></a><h3>hkl_pseudo_axis_engine_mode_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_mode_init    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> initialize</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> get</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc" title="HklPseudoAxisEngineModeFunc ()"><span class="type">HklPseudoAxisEngineModeFunc</span></a> set</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n_func</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklFunction" title="HklFunction ()"><span class="type">HklFunction</span></a> functions[]</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n_p</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-parameter.html#HklParameter" title="HklParameter"><span class="type">HklParameter</span></a> parameters[]</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n_axes</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *axes_names[]</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>initialize</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>get</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>set</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>n_func</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>functions</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>n_p</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>parameters</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>n_axes</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>axes_names</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_mode_free ()">
-<a name="hkl-pseudo-axis-engine-mode-free"></a><h3>hkl_pseudo_axis_engine_mode_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_mode_free    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_new ()">
-<a name="hkl-pseudo-axis-engine-new"></a><h3>hkl_pseudo_axis_engine_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_new        (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> n</code></em>,
-                                                         <em class="parameter"><code>...</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_free ()">
-<a name="hkl-pseudo-axis-engine-free"></a><h3>hkl_pseudo_axis_engine_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_free         (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_add_mode ()">
-<a name="hkl-pseudo-axis-engine-add-mode"></a><h3>hkl_pseudo_axis_engine_add_mode ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_add_mode     (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode" title="HklPseudoAxisEngineMode"><span class="type">HklPseudoAxisEngineMode</span></a> *mode</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>mode</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_add_geometry ()">
-<a name="hkl-pseudo-axis-engine-add-geometry"></a><h3>hkl_pseudo_axis_engine_add_geometry ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_add_geometry (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> const x[]</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_select_mode ()">
-<a name="hkl-pseudo-axis-engine-select-mode"></a><h3>hkl_pseudo_axis_engine_select_mode ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_select_mode  (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_initialize ()">
-<a name="hkl-pseudo-axis-engine-initialize"></a><h3>hkl_pseudo_axis_engine_initialize ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_initialize   (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_set ()">
-<a name="hkl-pseudo-axis-engine-set"></a><h3>hkl_pseudo_axis_engine_set ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_set          (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_get ()">
-<a name="hkl-pseudo-axis-engine-get"></a><h3>hkl_pseudo_axis_engine_get ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_get          (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-error.html#HklError" title="HklError"><span class="type">HklError</span></a> **error</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_fprintf ()">
-<a name="hkl-pseudo-axis-engine-fprintf"></a><h3>hkl_pseudo_axis_engine_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_fprintf      (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_new ()">
-<a name="hkl-pseudo-axis-engine-list-new"></a><h3>hkl_pseudo_axis_engine_list_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="returnvalue">HklPseudoAxisEngineList</span></a> * hkl_pseudo_axis_engine_list_new
-                                                        (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
+<div class="refsect2">
+<a name="HklFunction"></a><h3>struct HklFunction</h3>
+<pre class="programlisting">struct HklFunction {
+	const uint size;
+	int (* function) (const gsl_vector *x, void *params, gsl_vector *f);
+};
+</pre>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_free ()">
-<a name="hkl-pseudo-axis-engine-list-free"></a><h3>hkl_pseudo_axis_engine_list_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_list_free    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>);</pre>
+<div class="refsect2">
+<a name="hkl-engine-list-new"></a><h3>hkl_engine_list_new ()</h3>
+<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList"><span class="returnvalue">HklEngineList</span></a> *     hkl_engine_list_new                 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
 <p>
+default constructor
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_add ()">
-<a name="hkl-pseudo-axis-engine-list-add"></a><h3>hkl_pseudo_axis_engine_list_add ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_list_add     (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="type">HklPseudoAxisEngine</span></a> *engine</code></em>);</pre>
+<div class="refsect2">
+<a name="hkl-engine-list-add"></a><h3>hkl_engine_list_add ()</h3>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_engine_list_add                 (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="type">HklEngine</span></a> *engine</code></em>);</pre>
 <p>
+add an <a class="link" href="hkl-hkl-pseudoaxis.html#HklEngine" title="struct HklEngine"><span class="type">HklEngine</span></a> to the <a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList"><span class="type">HklEngineList</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
+<td>the engine list</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>engine</code></em> :</span></p></td>
-<td>
-</td>
+<td>the engine to add</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
+<td>HKL_SUCCESS or HKL_FAIL</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_get_by_name ()">
-<a name="hkl-pseudo-axis-engine-list-get-by-name"></a><h3>hkl_pseudo_axis_engine_list_get_by_name ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine" title="HklPseudoAxisEngine"><span class="returnvalue">HklPseudoAxisEngine</span></a> * hkl_pseudo_axis_engine_list_get_by_name
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);</pre>
+<div class="refsect2">
+<a name="hkl-engine-list-clear"></a><h3>hkl_engine_list_clear ()</h3>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_engine_list_clear               (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklEngineList" title="struct HklEngineList"><span class="type">HklEngineList</span></a> *self</code></em>);</pre>
 <p>
+remove all engine from the engine list
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name ()">
-<a name="hkl-pseudo-axis-engine-list-get-pseudo-axis-by-name"></a><h3>hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxis" title="HklPseudoAxis"><span class="returnvalue">HklPseudoAxis</span></a> *     hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_clear ()">
-<a name="hkl-pseudo-axis-engine-list-clear"></a><h3>hkl_pseudo_axis_engine_list_clear ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_list_clear   (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody><tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
+<td>the engine list to clear</td>
 </tr></tbody>
 </table></div>
 </div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_init ()">
-<a name="hkl-pseudo-axis-engine-list-init"></a><h3>hkl_pseudo_axis_engine_list_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_list_init    (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> *detector</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>detector</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_get ()">
-<a name="hkl-pseudo-axis-engine-list-get"></a><h3>hkl_pseudo_axis_engine_list_get ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_pseudo_axis_engine_list_get     (<em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_pseudo_axis_engine_list_fprintf ()">
-<a name="hkl-pseudo-axis-engine-list-fprintf"></a><h3>hkl_pseudo_axis_engine_list_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_pseudo_axis_engine_list_fprintf (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList" title="HklPseudoAxisEngineList"><span class="type">HklPseudoAxisEngineList</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-quaternion.html b/Documentation/api/html/hkl-hkl-quaternion.html
index 748d6f1..67845a5 100644
--- a/Documentation/api/html/hkl-hkl-quaternion.html
+++ b/Documentation/api/html/hkl-hkl-quaternion.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-quaternion</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-detector-factory.html" title="hkl-detector-factory">
 <link rel="next" href="hkl-hkl-pseudoaxis-k4cv.html" title="hkl-pseudoaxis-k4cv">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-quaternion.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-quaternion">
+<div class="refentry">
 <a name="hkl-hkl-quaternion"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,7 +35,7 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-quaternion.synopsis"></a><h2>Synopsis</h2>
 <pre class="synopsis">                    <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion">HklQuaternion</a>;
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-init" title="hkl_quaternion_init ()">hkl_quaternion_init</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
@@ -44,11 +44,11 @@
                                                          <em class="parameter"><code><span class="type">double</span> c</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> d</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-init-from-vector" title="hkl_quaternion_init_from_vector ()">hkl_quaternion_init_from_vector</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v</code></em>);
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-init-from-angle-and-axe" title="hkl_quaternion_init_from_angle_and_axe ()">hkl_quaternion_init_from_angle_and_axe</a>
                                                         (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> angle</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v</code></em>);
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-fprintf" title="hkl_quaternion_fprintf ()">hkl_quaternion_fprintf</a>              (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
                                                          <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);
 <span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-cmp" title="hkl_quaternion_cmp ()">hkl_quaternion_cmp</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
@@ -60,30 +60,26 @@
 <span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-norm2" title="hkl_quaternion_norm2 ()">hkl_quaternion_norm2</a>                (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-conjugate" title="hkl_quaternion_conjugate ()">hkl_quaternion_conjugate</a>            (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-to-matrix" title="hkl_quaternion_to_matrix ()">hkl_quaternion_to_matrix</a>            (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-quaternion.html#hkl-quaternion-to-angle-and-axe" title="hkl_quaternion_to_angle_and_axe ()">hkl_quaternion_to_angle_and_axe</a>     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> *angle</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v</code></em>);
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-quaternion.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-quaternion.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklQuaternion">
+<div class="refsect2">
 <a name="HklQuaternion"></a><h3>HklQuaternion</h3>
 <pre class="programlisting">typedef struct {
 	double data[4];
 } HklQuaternion;
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_init ()">
+<div class="refsect2">
 <a name="hkl-quaternion-init"></a><h3>hkl_quaternion_init ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_init                 (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> a</code></em>,
@@ -93,126 +89,130 @@
 <p>
 initialize the four elements of an <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to initialize
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to initialize</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
-<td>the 1st element value
-</td>
+<td>the 1st element value</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
-<td>the 2nd element value
-</td>
+<td>the 2nd element value</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
-<td>the 3rd element value
-</td>
+<td>the 3rd element value</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>the 4th element value
-</td>
+<td>the 4th element value</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_init_from_vector ()">
+<div class="refsect2">
 <a name="hkl-quaternion-init-from-vector"></a><h3>hkl_quaternion_init_from_vector ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_init_from_vector     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
 <p>
-initialize an <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> from an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+initialize an <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> from an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to set
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to set</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> used to set the self <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> used to set the self <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_init_from_angle_and_axe ()">
+<div class="refsect2">
 <a name="hkl-quaternion-init-from-angle-and-axe"></a><h3>hkl_quaternion_init_from_angle_and_axe ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_init_from_angle_and_axe
                                                         (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> angle</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
 <p>
 initialize an <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> from a vector and a angle.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to set
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to set</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
-<td>the angles of the rotation
-</td>
+<td>the angles of the rotation</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
-<td>the axe of rotation
-</td>
+<td>the axe of rotation</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_fprintf ()">
+<div class="refsect2">
 <a name="hkl-quaternion-fprintf"></a><h3>hkl_quaternion_fprintf ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_fprintf              (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
                                                          <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
 <p>
 print an <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> into a FILE stream
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
-<td>the file to send the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> into
-</td>
+<td>the file to send the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> into</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to write into the file stream.
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to write into the file stream.</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_cmp ()">
+<div class="refsect2">
 <a name="hkl-quaternion-cmp"></a><h3>hkl_quaternion_cmp ()</h3>
 <pre class="programlisting"><span class="returnvalue">int</span>                 hkl_quaternion_cmp                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
 <p>
 compare two <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
@@ -226,14 +226,14 @@ compare two <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> <a class="link" href="hkl-hkl-macros.html#HKL-TRUE:CAPS" title="HKL_TRUE"><span class="type">HKL_TRUE</span></a> if both are equal, <a class="link" href="hkl-hkl-macros.html#HKL-FAIL:CAPS" title="HKL_FAIL"><span class="type">HKL_FAIL</span></a> otherwise.
-</td>
+<td>
+<a href="hkl-hkl-macros.html#HKL-TRUE:CAPS"><span class="type">HKL_TRUE</span></a> if both are equal, <a href="hkl-hkl-macros.html#HKL-FALSE:CAPS"><span class="type">HKL_FALSE</span></a> otherwise.</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_minus_quaternion ()">
+<div class="refsect2">
 <a name="hkl-quaternion-minus-quaternion"></a><h3>hkl_quaternion_minus_quaternion ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_minus_quaternion     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
@@ -241,90 +241,95 @@ compare two <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="
 substract two <a href="hkl-hkl-vector.html#HklQuaternion"><span class="type">HklQuaternions</span></a>
 Todo: test
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to modify.
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to modify.</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to substract
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to substract</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_times_quaternion ()">
+<div class="refsect2">
 <a name="hkl-quaternion-times-quaternion"></a><h3>hkl_quaternion_times_quaternion ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_times_quaternion     (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *q</code></em>);</pre>
 <p>
 multiply two quaternions
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to modify
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to modify</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to multiply by
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to multiply by</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_norm2 ()">
+<div class="refsect2">
 <a name="hkl-quaternion-norm2"></a><h3>hkl_quaternion_norm2 ()</h3>
 <pre class="programlisting"><span class="returnvalue">double</span>              hkl_quaternion_norm2                (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
 <p>
 compute the norm2 of an <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the quaternion use to compute the norm
-</td>
+<td>the quaternion use to compute the norm</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the self <span class="type">hklquaternion</span> norm
-</td>
+<td>the self <span class="type">hklquaternion</span> norm</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_conjugate ()">
+<div class="refsect2">
 <a name="hkl-quaternion-conjugate"></a><h3>hkl_quaternion_conjugate ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_conjugate            (<em class="parameter"><code><a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>);</pre>
 <p>
 compute the conjugate of a quaternion
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody><tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to conjugate
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> to conjugate</td>
 </tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_to_matrix ()">
+<div class="refsect2">
 <a name="hkl-quaternion-to-matrix"></a><h3>hkl_quaternion_to_matrix ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_to_matrix            (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
 <p>
 Compute the rotation matrix of a Quaternion.
 </p>
@@ -344,49 +349,51 @@ compute the rotation matrix corresponding to the unitary quaternion.
 \f$
 Todo: optimize
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to compute the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to compute the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> return.
-</td>
+<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> return.</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_quaternion_to_angle_and_axe ()">
+<div class="refsect2">
 <a name="hkl-quaternion-to-angle-and-axe"></a><h3>hkl_quaternion_to_angle_and_axe ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_quaternion_to_angle_and_axe     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> *angle</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *v</code></em>);</pre>
 <p>
 compute the axe and angle of the unitary quaternion angle [-pi, pi]
 if q is the (1, 0, 0, 0) quaternion return the (0,0,0) axe and a 0 angle
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>The <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to compute the angle and the roation axis.
-</td>
+<td>The <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to compute the angle and the roation axis.</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
-<td>the returned angle of the rotation.
-</td>
+<td>the returned angle of the rotation.</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
-<td>the returned axis of the rotation.
-</td>
+<td>the returned axis of the rotation.</td>
 </tr>
 </tbody>
 </table></div>
@@ -395,6 +402,6 @@ if q is the (1, 0, 0, 0) quaternion return the (0,0,0) axe and a 0 angle
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-sample.html b/Documentation/api/html/hkl-hkl-sample.html
index b26626e..2019b3b 100644
--- a/Documentation/api/html/hkl-hkl-sample.html
+++ b/Documentation/api/html/hkl-hkl-sample.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-sample</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-common.html" title="hkl-pseudoaxis-common">
 <link rel="next" href="hkl-hkl-axis.html" title="hkl-axis">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-sample.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-sample">
+<div class="refentry">
 <a name="hkl-hkl-sample"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,976 +35,59 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-sample.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample">HklSample</a>;
-                    <a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection">HklSampleReflection</a>;
-                    <a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList">HklSampleList</a>;
-enum                <a class="link" href="hkl-hkl-sample.html#HklSampleType" title="enum HklSampleType">HklSampleType</a>;
-<a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         <a class="link" href="hkl-hkl-sample.html#hkl-sample-new" title="hkl_sample_new ()">hkl_sample_new</a>                      (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleType" title="enum HklSampleType"><span class="type">HklSampleType</span></a> type</code></em>);
-<a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         <a class="link" href="hkl-hkl-sample.html#hkl-sample-new-copy" title="hkl_sample_new_copy ()">hkl_sample_new_copy</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-free" title="hkl_sample_free ()">hkl_sample_free</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-set-name" title="hkl_sample_set_name ()">hkl_sample_set_name</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-sample.html#hkl-sample-set-lattice" title="hkl_sample_set_lattice ()">hkl_sample_set_lattice</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> a</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> b</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> c</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> alpha</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> beta</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> gamma</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-sample.html#hkl-sample-set-U-from-euler" title="hkl_sample_set_U_from_euler ()">hkl_sample_set_U_from_euler</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> z</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-get-UB" title="hkl_sample_get_UB ()">hkl_sample_get_UB</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *UB</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-sample.html#hkl-sample-set-UB" title="hkl_sample_set_UB ()">hkl_sample_set_UB</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *UB</code></em>);
-<a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="returnvalue">HklSampleReflection</span></a> * <a class="link" href="hkl-hkl-sample.html#hkl-sample-add-reflection" title="hkl_sample_add_reflection ()">hkl_sample_add_reflection</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *detector</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> h</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> k</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> l</code></em>);
-<a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="returnvalue">HklSampleReflection</span></a> * <a class="link" href="hkl-hkl-sample.html#hkl-sample-get-ith-reflection" title="hkl_sample_get_ith_reflection ()">hkl_sample_get_ith_reflection</a>     (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-sample.html#hkl-sample-del-reflection" title="hkl_sample_del_reflection ()">hkl_sample_del_reflection</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-sample.html#hkl-sample-compute-UB-busing-levy" title="hkl_sample_compute_UB_busing_levy ()">hkl_sample_compute_UB_busing_levy</a>   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx1</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx2</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-sample.html#hkl-sample-affine" title="hkl_sample_affine ()">hkl_sample_affine</a>                   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-sample.html#hkl-sample-get-reflection-mesured-angle" title="hkl_sample_get_reflection_mesured_angle ()">hkl_sample_get_reflection_mesured_angle</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx1</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx2</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-sample.html#hkl-sample-get-reflection-theoretical-angle" title="hkl_sample_get_reflection_theoretical_angle ()">hkl_sample_get_reflection_theoretical_angle</a>
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx1</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx2</code></em>);
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-sample.html#HklSample" title="struct HklSample">HklSample</a>;
+struct              <a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="struct HklSampleReflection">HklSampleReflection</a>;
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-fprintf" title="hkl_sample_fprintf ()">hkl_sample_fprintf</a>                  (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-reflection-set-hkl" title="hkl_sample_reflection_set_hkl ()">hkl_sample_reflection_set_hkl</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> h</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> k</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> l</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-reflection-set-flag" title="hkl_sample_reflection_set_flag ()">hkl_sample_reflection_set_flag</a>      (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> flag</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-reflection-set-geometry" title="hkl_sample_reflection_set_geometry ()">hkl_sample_reflection_set_geometry</a>  (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);
-<a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="returnvalue">HklSampleList</span></a> *     <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-new" title="hkl_sample_list_new ()">hkl_sample_list_new</a>                 (<em class="parameter"><code><span class="type">void</span></code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-free" title="hkl_sample_list_free ()">hkl_sample_list_free</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>);
-<a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-append" title="hkl_sample_list_append ()">hkl_sample_list_append</a>              (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-clear" title="hkl_sample_list_clear ()">hkl_sample_list_clear</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-del" title="hkl_sample_list_del ()">hkl_sample_list_del</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>);
-<span class="returnvalue">size_t</span>              <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-len" title="hkl_sample_list_len ()">hkl_sample_list_len</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> const *self</code></em>);
-<a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-get-ith" title="hkl_sample_list_get_ith ()">hkl_sample_list_get_ith</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);
-<a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-get-by-name" title="hkl_sample_list_get_by_name ()">hkl_sample_list_get_by_name</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);
-<span class="returnvalue">size_t</span>              <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-get-idx-from-name" title="hkl_sample_list_get_idx_from_name ()">hkl_sample_list_get_idx_from_name</a>   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-select-current" title="hkl_sample_list_select_current ()">hkl_sample_list_select_current</a>      (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-sample.html#hkl-sample-list-fprintf" title="hkl_sample_list_fprintf ()">hkl_sample_list_fprintf</a>             (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> const *self</code></em>);
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-sample.html#HklSample" title="struct HklSample"><span class="type">HklSample</span></a> *self</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-sample.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-sample.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklSample">
-<a name="HklSample"></a><h3>HklSample</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklSample"></a><h3>struct HklSample</h3>
+<pre class="programlisting">struct HklSample {
 	char *name;
-	HklSampleType type;
 	HklLattice *lattice;
 	HklMatrix U;
 	HklMatrix UB;
 	HklParameter *ux;
 	HklParameter *uy;
 	HklParameter *uz;
-	HKL_LIST(HklSampleReflection *, reflections);
-} HklSample;
+	struct list_head reflections;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklSampleReflection">
-<a name="HklSampleReflection"></a><h3>HklSampleReflection</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklSampleReflection"></a><h3>struct HklSampleReflection</h3>
+<pre class="programlisting">struct HklSampleReflection {
 	HklGeometry *geometry;
-	HklDetector detector;
+	HklDetector *detector;
 	HklVector hkl;
 	HklVector _hkl;
 	int flag;
-} HklSampleReflection;
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="HklSampleList">
-<a name="HklSampleList"></a><h3>HklSampleList</h3>
-<pre class="programlisting">typedef struct {
-	HKL_LIST(HklSample *, samples);
-	HklSample *current;
-} HklSampleList;
-</pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="enum HklSampleType">
-<a name="HklSampleType"></a><h3>enum HklSampleType</h3>
-<pre class="programlisting">enum HklSampleType {
-	HKL_SAMPLE_TYPE_MONOCRYSTAL
+	struct list_node list;
 };
 </pre>
-<p>
-</p>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_new ()">
-<a name="hkl-sample-new"></a><h3>hkl_sample_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         hkl_sample_new                      (<em class="parameter"><code><span class="type">char</span> const *name</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleType" title="enum HklSampleType"><span class="type">HklSampleType</span></a> type</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_new_copy ()">
-<a name="hkl-sample-new-copy"></a><h3>hkl_sample_new_copy ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         hkl_sample_new_copy                 (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_free ()">
-<a name="hkl-sample-free"></a><h3>hkl_sample_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_free                     (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_set_name ()">
-<a name="hkl-sample-set-name"></a><h3>hkl_sample_set_name ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_set_name                 (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_set_lattice ()">
-<a name="hkl-sample-set-lattice"></a><h3>hkl_sample_set_lattice ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_sample_set_lattice              (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> a</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> b</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> c</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> alpha</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> beta</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> gamma</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>alpha</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>beta</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>gamma</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_set_U_from_euler ()">
-<a name="hkl-sample-set-U-from-euler"></a><h3>hkl_sample_set_U_from_euler ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_sample_set_U_from_euler         (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> x</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> y</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_get_UB ()">
-<a name="hkl-sample-get-UB"></a><h3>hkl_sample_get_UB ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_get_UB                   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *UB</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>UB</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_set_UB ()">
-<a name="hkl-sample-set-UB"></a><h3>hkl_sample_set_UB ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_sample_set_UB                   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *UB</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>UB</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_add_reflection ()">
-<a name="hkl-sample-add-reflection"></a><h3>hkl_sample_add_reflection ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="returnvalue">HklSampleReflection</span></a> * hkl_sample_add_reflection         (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-detector.html#HklDetector" title="HklDetector"><span class="type">HklDetector</span></a> const *detector</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> h</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> k</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> l</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>detector</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>h</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>k</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>l</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_get_ith_reflection ()">
-<a name="hkl-sample-get-ith-reflection"></a><h3>hkl_sample_get_ith_reflection ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="returnvalue">HklSampleReflection</span></a> * hkl_sample_get_ith_reflection     (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_del_reflection ()">
-<a name="hkl-sample-del-reflection"></a><h3>hkl_sample_del_reflection ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_sample_del_reflection           (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_sample_compute_UB_busing_levy ()">
-<a name="hkl-sample-compute-UB-busing-levy"></a><h3>hkl_sample_compute_UB_busing_levy ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_sample_compute_UB_busing_levy   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx1</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx2</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx1</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx2</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_affine ()">
-<a name="hkl-sample-affine"></a><h3>hkl_sample_affine ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_sample_affine                   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_get_reflection_mesured_angle ()">
-<a name="hkl-sample-get-reflection-mesured-angle"></a><h3>hkl_sample_get_reflection_mesured_angle ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_sample_get_reflection_mesured_angle
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx1</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx2</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx1</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx2</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_get_reflection_theoretical_angle ()">
-<a name="hkl-sample-get-reflection-theoretical-angle"></a><h3>hkl_sample_get_reflection_theoretical_angle ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_sample_get_reflection_theoretical_angle
-                                                        (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx1</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx2</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx1</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx2</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_fprintf ()">
+<div class="refsect2">
 <a name="hkl-sample-fprintf"></a><h3>hkl_sample_fprintf ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_fprintf                  (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_reflection_set_hkl ()">
-<a name="hkl-sample-reflection-set-hkl"></a><h3>hkl_sample_reflection_set_hkl ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_reflection_set_hkl       (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> h</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> k</code></em>,
-                                                         <em class="parameter"><code><span class="type">double</span> l</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>h</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>k</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>l</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_reflection_set_flag ()">
-<a name="hkl-sample-reflection-set-flag"></a><h3>hkl_sample_reflection_set_flag ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_reflection_set_flag      (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">int</span> flag</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>flag</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_reflection_set_geometry ()">
-<a name="hkl-sample-reflection-set-geometry"></a><h3>hkl_sample_reflection_set_geometry ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_reflection_set_geometry  (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleReflection" title="HklSampleReflection"><span class="type">HklSampleReflection</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-geometry.html#HklGeometry" title="HklGeometry"><span class="type">HklGeometry</span></a> *geometry</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>geometry</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_new ()">
-<a name="hkl-sample-list-new"></a><h3>hkl_sample_list_new ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="returnvalue">HklSampleList</span></a> *     hkl_sample_list_new                 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_free ()">
-<a name="hkl-sample-list-free"></a><h3>hkl_sample_list_free ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_list_free                (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_append ()">
-<a name="hkl-sample-list-append"></a><h3>hkl_sample_list_append ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         hkl_sample_list_append              (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>);</pre>
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-sample.html#HklSample" title="struct HklSample"><span class="type">HklSample</span></a> *self</code></em>);</pre>
 <p>
+print to a file a sample
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_clear ()">
-<a name="hkl-sample-list-clear"></a><h3>hkl_sample_list_clear ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_list_clear               (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody><tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_del ()">
-<a name="hkl-sample-list-del"></a><h3>hkl_sample_list_del ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_list_del                 (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="type">HklSample</span></a> *sample</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_len ()">
-<a name="hkl-sample-list-len"></a><h3>hkl_sample_list_len ()</h3>
-<pre class="programlisting"><span class="returnvalue">size_t</span>              hkl_sample_list_len                 (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_get_ith ()">
-<a name="hkl-sample-list-get-ith"></a><h3>hkl_sample_list_get_ith ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         hkl_sample_list_get_ith             (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">size_t</span> idx</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>idx</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_get_by_name ()">
-<a name="hkl-sample-list-get-by-name"></a><h3>hkl_sample_list_get_by_name ()</h3>
-<pre class="programlisting"><a class="link" href="hkl-hkl-sample.html#HklSample" title="HklSample"><span class="returnvalue">HklSample</span></a> *         hkl_sample_list_get_by_name         (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_get_idx_from_name ()">
-<a name="hkl-sample-list-get-idx-from-name"></a><h3>hkl_sample_list_get_idx_from_name ()</h3>
-<pre class="programlisting"><span class="returnvalue">size_t</span>              hkl_sample_list_get_idx_from_name   (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_select_current ()">
-<a name="hkl-sample-list-select-current"></a><h3>hkl_sample_list_select_current ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_sample_list_select_current      (<em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> *self</code></em>,
-                                                         <em class="parameter"><code><span class="type">char</span> const *name</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" title="hkl_sample_list_fprintf ()">
-<a name="hkl-sample-list-fprintf"></a><h3>hkl_sample_list_fprintf ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_sample_list_fprintf             (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-sample.html#HklSampleList" title="HklSampleList"><span class="type">HklSampleList</span></a> const *self</code></em>);</pre>
-<p>
-</p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-source.html b/Documentation/api/html/hkl-hkl-source.html
index c83a52b..8bc43af 100644
--- a/Documentation/api/html/hkl-hkl-source.html
+++ b/Documentation/api/html/hkl-hkl-source.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-source</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-pseudoaxis-k6c.html" title="hkl-pseudoaxis-k6c">
 <link rel="next" href="hkl-hkl-unit.html" title="hkl-unit">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-source.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-source">
+<div class="refentry">
 <a name="hkl-hkl-source"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,195 +35,165 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-source.synopsis"></a><h2>Synopsis</h2>
 <pre class="synopsis">#define             <a class="link" href="hkl-hkl-source.html#HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS" title="HKL_SOURCE_DEFAULT_WAVE_LENGTH">HKL_SOURCE_DEFAULT_WAVE_LENGTH</a>
-                    <a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource">HklSource</a>;
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-source.html#hkl-source-init" title="hkl_source_init ()">hkl_source_init</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> *self</code></em>,
+struct              <a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource">HklSource</a>;
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-source.html#hkl-source-init" title="hkl_source_init ()">hkl_source_init</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> wave_length</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> x</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> y</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> z</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-source.html#hkl-source-cmp" title="hkl_source_cmp ()">hkl_source_cmp</a>                      (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *s</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-source.html#hkl-source-compute-ki" title="hkl_source_compute_ki ()">hkl_source_compute_ki</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *ki</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-source.html#hkl-source-get-wavelength" title="hkl_source_get_wavelength ()">hkl_source_get_wavelength</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *self</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-source.html#hkl-source-cmp" title="hkl_source_cmp ()">hkl_source_cmp</a>                      (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *s</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-source.html#hkl-source-compute-ki" title="hkl_source_compute_ki ()">hkl_source_compute_ki</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ki</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-source.html#hkl-source-get-wavelength" title="hkl_source_get_wavelength ()">hkl_source_get_wavelength</a>           (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-source.html#hkl-source-fprintf" title="hkl_source_fprintf ()">hkl_source_fprintf</a>                  (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *self</code></em>);
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-source.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-source.details"></a><h2>Details</h2>
-<div class="refsect2" title="HKL_SOURCE_DEFAULT_WAVE_LENGTH">
+<div class="refsect2">
 <a name="HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS"></a><h3>HKL_SOURCE_DEFAULT_WAVE_LENGTH</h3>
 <pre class="programlisting">#define HKL_SOURCE_DEFAULT_WAVE_LENGTH (1.54)
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklSource">
-<a name="HklSource"></a><h3>HklSource</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklSource"></a><h3>struct HklSource</h3>
+<pre class="programlisting">struct HklSource {
 	double wave_length;
 	HklVector direction;
-} HklSource;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_source_init ()">
+<div class="refsect2">
 <a name="hkl-source-init"></a><h3>hkl_source_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_source_init                     (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_source_init                     (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> wave_length</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> x</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> y</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
 <p>
+initialize the <a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
+<td>the <span class="type">Hklsource</span> to initialize</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>wave_length</code></em> :</span></p></td>
-<td>
-</td>
+<td>the wave length to set</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>
-</td>
+<td>x coordinates of the ki vector</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
-<td>
-</td>
+<td>y coordinates of the ki vector</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
-<td>
-</td>
+<td>z coordinates of the ki vector</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
+<td>HKL_SUCCESS if everythongs goes fine, HKL_FAIL otherwise</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_source_cmp ()">
+<div class="refsect2">
 <a name="hkl-source-cmp"></a><h3>hkl_source_cmp ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_source_cmp                      (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *s</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_source_cmp                      (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *s</code></em>);</pre>
 <p>
+compare two sources
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
+<td>1st <span class="type">Hklsource</span>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>s</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
+<td>2nd <span class="type">Hklsource</span>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_source_compute_ki ()">
+<div class="refsect2">
 <a name="hkl-source-compute-ki"></a><h3>hkl_source_compute_ki ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_source_compute_ki               (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *ki</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_source_compute_ki               (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>,
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ki</code></em>);</pre>
 <p>
+compute the ki hkl_vector
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
+<col>
+</colgroup>
+<tbody><tr>
 <td><p><span class="term"><em class="parameter"><code>ki</code></em> :</span></p></td>
-<td>
+<td>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym> caller-allocates]</span>
 </td>
-</tr>
-</tbody>
+</tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_source_get_wavelength ()">
+<div class="refsect2">
 <a name="hkl-source-get-wavelength"></a><h3>hkl_source_get_wavelength ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_source_get_wavelength           (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_source_get_wavelength           (<em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);</pre>
 <p>
+get the wave_length
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
+<col>
+</colgroup>
+<tbody><tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
+<td>the wave_length</td>
+</tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_source_fprintf ()">
+<div class="refsect2">
 <a name="hkl-source-fprintf"></a><h3>hkl_source_fprintf ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_source_fprintf                  (<em class="parameter"><code><span class="type">FILE</span> *f</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="HklSource"><span class="type">HklSource</span></a> const *self</code></em>);</pre>
+                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-source.html#HklSource" title="struct HklSource"><span class="type">HklSource</span></a> const *self</code></em>);</pre>
 <p>
+printf the source
 </p>
-<div class="variablelist"><table border="0">
-<col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>f</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
-</table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-unit.html b/Documentation/api/html/hkl-hkl-unit.html
index 61f60ac..669b2b9 100644
--- a/Documentation/api/html/hkl-hkl-unit.html
+++ b/Documentation/api/html/hkl-hkl-unit.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-unit</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-source.html" title="hkl-source">
 <link rel="next" href="hkl-hkl-pseudoaxis-common-hkl.html" title="hkl-pseudoaxis-common-hkl">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-unit.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-unit">
+<div class="refentry">
 <a name="hkl-hkl-unit"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,93 +35,83 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-unit.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit">HklUnit</a>;
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-unit.html#hkl-unit-compatible" title="hkl_unit_compatible ()">hkl_unit_compatible</a>                 (<em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *unit</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-unit.html#hkl-unit-factor" title="hkl_unit_factor ()">hkl_unit_factor</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *unit</code></em>);
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit">HklUnit</a>;
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-unit.html#hkl-unit-compatible" title="hkl_unit_compatible ()">hkl_unit_compatible</a>                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-unit.html#hkl-unit-factor" title="hkl_unit_factor ()">hkl_unit_factor</a>                     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-unit.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-unit.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklUnit">
-<a name="HklUnit"></a><h3>HklUnit</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklUnit"></a><h3>struct HklUnit</h3>
+<pre class="programlisting">struct HklUnit {
 	HklUnitType type;
 	char const *name;
 	char const *repr;
-} HklUnit;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="hkl_unit_compatible ()">
+<div class="refsect2">
 <a name="hkl-unit-compatible"></a><h3>hkl_unit_compatible ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_unit_compatible                 (<em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *unit</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_unit_compatible                 (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);</pre>
 <p>
+check if two units are compatible.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
+<td>the first <em class="parameter"><code>HklUnit</code></em>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>unit</code></em> :</span></p></td>
-<td>
-</td>
+<td>the second <em class="parameter"><code>HklUnit</code></em> to check</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
+<td>HKL_TRUE or HKL_FALSE</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_unit_factor ()">
+<div class="refsect2">
 <a name="hkl-unit-factor"></a><h3>hkl_unit_factor ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_unit_factor                     (<em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *self</code></em>,
-                                                         <em class="parameter"><code><a class="link" href="hkl-hkl-unit.html#HklUnit" title="HklUnit"><span class="type">HklUnit</span></a> const *unit</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_unit_factor                     (<em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-unit.html#HklUnit" title="struct HklUnit"><span class="type">HklUnit</span></a> *unit</code></em>);</pre>
 <p>
+compute the factor to convert from one <em class="parameter"><code>Hklunit</code></em> to another one.
+<em class="parameter"><code>self</code></em> * factor =  <em class="parameter"><code>unit</code></em>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>unit</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
+<col>
+</colgroup>
+<tbody><tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
+<td>the factor of the conversion.</td>
+</tr></tbody>
 </table></div>
 </div>
 </div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl-hkl-vector.html b/Documentation/api/html/hkl-hkl-vector.html
index de52559..ddf6280 100644
--- a/Documentation/api/html/hkl-hkl-vector.html
+++ b/Documentation/api/html/hkl-hkl-vector.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl-vector</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="ch01.html" title="[Insert title here]">
 <link rel="prev" href="hkl-hkl-lattice.html" title="hkl-lattice">
 <link rel="next" href="object-tree.html" title="Object Hierarchy">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -26,7 +26,7 @@
                   <a href="#hkl-hkl-vector.description" class="shortcut">Description</a>
 </td></tr>
 </table>
-<div class="refentry" title="hkl-vector">
+<div class="refentry">
 <a name="hkl-hkl-vector"></a><div class="titlepage"></div>
 <div class="refnamediv"><table width="100%"><tr>
 <td valign="top">
@@ -35,754 +35,779 @@
 </td>
 <td valign="top" align="right"></td>
 </tr></table></div>
-<div class="refsynopsisdiv" title="Synopsis">
+<div class="refsynopsisdiv">
 <a name="hkl-hkl-vector.synopsis"></a><h2>Synopsis</h2>
-<pre class="synopsis">                    <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix">HklMatrix</a>;
+<pre class="synopsis">struct              <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix">HklMatrix</a>;
                     <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion">HklQuaternion</a>;
-                    <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector">HklVector</a>;
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-init" title="hkl_vector_init ()">hkl_vector_init</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+struct              <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector">HklVector</a>;
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-init" title="hkl_vector_init ()">hkl_vector_init</a>                     (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> x</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> y</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> z</code></em>);
 <span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-fprintf" title="hkl_vector_fprintf ()">hkl_vector_fprintf</a>                  (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-cmp" title="hkl_vector_cmp ()">hkl_vector_cmp</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-is-opposite" title="hkl_vector_is_opposite ()">hkl_vector_is_opposite</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-add-vector" title="hkl_vector_add_vector ()">hkl_vector_add_vector</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-minus-vector" title="hkl_vector_minus_vector ()">hkl_vector_minus_vector</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-div-double" title="hkl_vector_div_double ()">hkl_vector_div_double</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-cmp" title="hkl_vector_cmp ()">hkl_vector_cmp</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-is-opposite" title="hkl_vector_is_opposite ()">hkl_vector_is_opposite</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-add-vector" title="hkl_vector_add_vector ()">hkl_vector_add_vector</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-minus-vector" title="hkl_vector_minus_vector ()">hkl_vector_minus_vector</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-div-double" title="hkl_vector_div_double ()">hkl_vector_div_double</a>               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <span class="type">double</span> d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-times-double" title="hkl_vector_times_double ()">hkl_vector_times_double</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-times-double" title="hkl_vector_times_double ()">hkl_vector_times_double</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <span class="type">double</span> d</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-times-vector" title="hkl_vector_times_vector ()">hkl_vector_times_vector</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-times-matrix" title="hkl_vector_times_matrix ()">hkl_vector_times_matrix</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-sum" title="hkl_vector_sum ()">hkl_vector_sum</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-scalar-product" title="hkl_vector_scalar_product ()">hkl_vector_scalar_product</a>           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-vectorial-product" title="hkl_vector_vectorial_product ()">hkl_vector_vectorial_product</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-angle" title="hkl_vector_angle ()">hkl_vector_angle</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-oriented-angle" title="hkl_vector_oriented_angle ()">hkl_vector_oriented_angle</a>           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *ref</code></em>);
-<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-norm2" title="hkl_vector_norm2 ()">hkl_vector_norm2</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-normalize" title="hkl_vector_normalize ()">hkl_vector_normalize</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-is-colinear" title="hkl_vector_is_colinear ()">hkl_vector_is_colinear</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-randomize" title="hkl_vector_randomize ()">hkl_vector_randomize</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-randomize-vector" title="hkl_vector_randomize_vector ()">hkl_vector_randomize_vector</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-randomize-vector-vector" title="hkl_vector_randomize_vector_vector ()">hkl_vector_randomize_vector_vector</a>  (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector2</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-rotated-around-vector" title="hkl_vector_rotated_around_vector ()">hkl_vector_rotated_around_vector</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *axe</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-times-vector" title="hkl_vector_times_vector ()">hkl_vector_times_vector</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-times-matrix" title="hkl_vector_times_matrix ()">hkl_vector_times_matrix</a>             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-sum" title="hkl_vector_sum ()">hkl_vector_sum</a>                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-scalar-product" title="hkl_vector_scalar_product ()">hkl_vector_scalar_product</a>           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-vectorial-product" title="hkl_vector_vectorial_product ()">hkl_vector_vectorial_product</a>        (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-angle" title="hkl_vector_angle ()">hkl_vector_angle</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-oriented-angle" title="hkl_vector_oriented_angle ()">hkl_vector_oriented_angle</a>           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ref</code></em>);
+<span class="returnvalue">double</span>              <a class="link" href="hkl-hkl-vector.html#hkl-vector-norm2" title="hkl_vector_norm2 ()">hkl_vector_norm2</a>                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-normalize" title="hkl_vector_normalize ()">hkl_vector_normalize</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-is-colinear" title="hkl_vector_is_colinear ()">hkl_vector_is_colinear</a>              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-randomize" title="hkl_vector_randomize ()">hkl_vector_randomize</a>                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-randomize-vector" title="hkl_vector_randomize_vector ()">hkl_vector_randomize_vector</a>         (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-randomize-vector-vector" title="hkl_vector_randomize_vector_vector ()">hkl_vector_randomize_vector_vector</a>  (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector1</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector2</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-rotated-around-vector" title="hkl_vector_rotated_around_vector ()">hkl_vector_rotated_around_vector</a>    (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *axe</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> angle</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-rotated-quaternion" title="hkl_vector_rotated_quaternion ()">hkl_vector_rotated_quaternion</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-rotated-quaternion" title="hkl_vector_rotated_quaternion ()">hkl_vector_rotated_quaternion</a>       (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *qr</code></em>);
-<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-is-null" title="hkl_vector_is_null ()">hkl_vector_is_null</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);
-<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-project-on-plan" title="hkl_vector_project_on_plan ()">hkl_vector_project_on_plan</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *plan</code></em>);
+<span class="returnvalue">int</span>                 <a class="link" href="hkl-hkl-vector.html#hkl-vector-is-null" title="hkl_vector_is_null ()">hkl_vector_is_null</a>                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);
+<span class="returnvalue">void</span>                <a class="link" href="hkl-hkl-vector.html#hkl-vector-project-on-plan" title="hkl_vector_project_on_plan ()">hkl_vector_project_on_plan</a>          (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *normal</code></em>);
 </pre>
 </div>
-<div class="refsect1" title="Description">
+<div class="refsect1">
 <a name="hkl-hkl-vector.description"></a><h2>Description</h2>
-<p>
-</p>
 </div>
-<div class="refsect1" title="Details">
+<div class="refsect1">
 <a name="hkl-hkl-vector.details"></a><h2>Details</h2>
-<div class="refsect2" title="HklMatrix">
-<a name="HklMatrix"></a><h3>HklMatrix</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklMatrix"></a><h3>struct HklMatrix</h3>
+<pre class="programlisting">struct HklMatrix {
 	double data[3][3];
-} HklMatrix;
+};
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklQuaternion">
+<div class="refsect2">
 <a name="HklQuaternion"></a><h3>HklQuaternion</h3>
 <pre class="programlisting">typedef struct {
 	double data[4];
 } HklQuaternion;
 </pre>
-<p>
-</p>
 </div>
 <hr>
-<div class="refsect2" title="HklVector">
-<a name="HklVector"></a><h3>HklVector</h3>
-<pre class="programlisting">typedef struct {
+<div class="refsect2">
+<a name="HklVector"></a><h3>struct HklVector</h3>
+<pre class="programlisting">struct HklVector {
 	double data[3];
-} HklVector;
+};
 </pre>
 <p>
+A struct containing a 3D space coordinates.
 </p>
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
+<col align="left" valign="top">
+<col>
+</colgroup>
+<tbody><tr>
+<td><p><span class="term"><span class="type">double</span> <em class="structfield"><code><a name="HklVector.data"></a>data</code></em>[3];</span></p></td>
+<td>contain the vector data. <span class="annotation">[skip]</span>
+</td>
+</tr></tbody>
+</table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_init ()">
+<div class="refsect2">
 <a name="hkl-vector-init"></a><h3>hkl_vector_init ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_init                     (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_init                     (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> x</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> y</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> z</code></em>);</pre>
 <p>
-initialize an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+initialize an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to initialize.
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to initialize.</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
-<td>the first coordinate value
-</td>
+<td>the first coordinate value</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
-<td>the second coordinate value
-</td>
+<td>the second coordinate value</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
-<td>the third coordinate value
-</td>
+<td>the third coordinate value</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_fprintf ()">
+<div class="refsect2">
 <a name="hkl-vector-fprintf"></a><h3>hkl_vector_fprintf ()</h3>
 <pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_fprintf                  (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
 <p>
-print an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> into a stream
+print an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> into a stream
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
-<td>the stream to print into
-</td>
+<td>the stream to print into</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to print.
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to print.</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_cmp ()">
+<div class="refsect2">
 <a name="hkl-vector-cmp"></a><h3>hkl_vector_cmp ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_cmp                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_cmp                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
-compare two <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>. this comparison use HKL_EPSILON
+compare two <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>. this comparison use HKL_EPSILON
 to do the comparison.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first vector
-</td>
+<td>the first vector</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>th vector to compare with
-</td>
+<td>th vector to compare with</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> HKL_FALSE if both are equals, HKL_TRUE otherwise.
-</td>
+<td>HKL_FALSE if both are equals, HKL_TRUE otherwise.</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_is_opposite ()">
+<div class="refsect2">
 <a name="hkl-vector-is-opposite"></a><h3>hkl_vector_is_opposite ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_opposite              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_opposite              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
+Check if two vectors are oposite.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
-<tbody>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
-<td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>
-</td>
-</tr>
-<tr>
+<col>
+</colgroup>
+<tbody><tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td>
-</td>
-</tr>
-</tbody>
+<td>HKL_TRUE is vector are oposite vectors.</td>
+</tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_add_vector ()">
+<div class="refsect2">
 <a name="hkl-vector-add-vector"></a><h3>hkl_vector_add_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_add_vector               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_add_vector               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
-add an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to another one.
+add an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to another one.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the modified <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the modified <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the <span class="type">hklvector</span> to add
-</td>
+<td>the <span class="type">hklvector</span> to add</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_minus_vector ()">
+<div class="refsect2">
 <a name="hkl-vector-minus-vector"></a><h3>hkl_vector_minus_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_minus_vector             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_minus_vector             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
-substract an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to another one.
+substract an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to another one.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the modified <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the modified <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the <span class="type">hklvector</span> to substract
-</td>
+<td>the <span class="type">hklvector</span> to substract</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_div_double ()">
+<div class="refsect2">
 <a name="hkl-vector-div-double"></a><h3>hkl_vector_div_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_div_double               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_div_double               (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <span class="type">double</span> d</code></em>);</pre>
 <p>
-divide an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> by constant.
+divide an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by constant.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to divide.
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to divide.</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>constant use to divide the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>constant use to divide the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_times_double ()">
+<div class="refsect2">
 <a name="hkl-vector-times-double"></a><h3>hkl_vector_times_double ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_double             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_double             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <span class="type">double</span> d</code></em>);</pre>
 <p>
-multiply an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> by a constant value.
+multiply an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by a constant value.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to modify
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to modify</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
-<td>the multiply factor
-</td>
+<td>the multiply factor</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_times_vector ()">
+<div class="refsect2">
 <a name="hkl-vector-times-vector"></a><h3>hkl_vector_times_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_vector             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_vector             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
-multiply an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> by another one. This method multiply
+multiply an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by another one. This method multiply
 coordinate by coordinate.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to modify
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to modify</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> use to modify the first one
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> use to modify the first one</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_times_matrix ()">
+<div class="refsect2">
 <a name="hkl-vector-times-matrix"></a><h3>hkl_vector_times_matrix ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_matrix             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_times_matrix             (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> *m</code></em>);</pre>
 <p>
+multiply an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> by an <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a>.
+compute v'= M . v
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to multiply</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
-<td>
+<td>the <a class="link" href="hkl-hkl-matrix.html#HklMatrix" title="struct HklMatrix"><span class="type">HklMatrix</span></a> use to multiply the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_sum ()">
+<div class="refsect2">
 <a name="hkl-vector-sum"></a><h3>hkl_vector_sum ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_sum                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_sum                      (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
 <p>
-compute the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> sum of all its elements.
+compute the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> sum of all its elements.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to sum.
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to sum.</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the sum of all elements.
-</td>
+<td>the sum of all elements.</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_scalar_product ()">
+<div class="refsect2">
 <a name="hkl-vector-scalar-product"></a><h3>hkl_vector_scalar_product ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_scalar_product           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_scalar_product           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
-compute the scalar product of two <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+compute the scalar product of two <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the scalar product.
-</td>
+<td>the scalar product.</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_vectorial_product ()">
+<div class="refsect2">
 <a name="hkl-vector-vectorial-product"></a><h3>hkl_vector_vectorial_product ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_vectorial_product        (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_vectorial_product        (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
 compute the vectorial product of two vectors
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> (modify)
-</td>
+<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> (modify)</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_angle ()">
+<div class="refsect2">
 <a name="hkl-vector-angle"></a><h3>hkl_vector_angle ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_angle                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_angle                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
-compute the angles beetween two <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+compute the angles beetween two <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the fist <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the fist <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the return value is in beetween [0, pi]
-</td>
+<td>the return value is in beetween [0, pi]</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_oriented_angle ()">
+<div class="refsect2">
 <a name="hkl-vector-oriented-angle"></a><h3>hkl_vector_oriented_angle ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_oriented_angle           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *ref</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_oriented_angle           (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *ref</code></em>);</pre>
 <p>
-compute the angles beetween two <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> and use
-a reference <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to orientate the space. That's
+compute the angles beetween two <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> and use
+a reference <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to orientate the space. That's
 way the return value can be in beetween [-pi, pi].
 the (self, vector, ref) is a right oriented base.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>ref</code></em> :</span></p></td>
-<td>the reference <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the reference <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the angles [-pi, pi]
-</td>
+<td>the angles [-pi, pi]</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_norm2 ()">
+<div class="refsect2">
 <a name="hkl-vector-norm2"></a><h3>hkl_vector_norm2 ()</h3>
-<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_norm2                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">double</span>              hkl_vector_norm2                    (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
 <p>
-compute the norm2 of an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+compute the norm2 of an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <span class="type">hklvector</span> use to compute the norm2
-</td>
+<td>the <span class="type">hklvector</span> use to compute the norm2</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> the sqrt(|v|)
-</td>
+<td>the sqrt(|v|)</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_normalize ()">
+<div class="refsect2">
 <a name="hkl-vector-normalize"></a><h3>hkl_vector_normalize ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_normalize                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_normalize                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
 <p>
 normalize a hkl_vector
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to normalize
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to normalize</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> HKL_TRUE if the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> can be normalized, HKL_FALSE otherwise
-</td>
+<td>HKL_TRUE if the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> can be normalized, HKL_FALSE otherwise</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_is_colinear ()">
+<div class="refsect2">
 <a name="hkl-vector-is-colinear"></a><h3>hkl_vector_is_colinear ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_colinear              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_colinear              (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
-check if two <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> are colinears
+check if two <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> are colinears
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a>
+<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a>
 </td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> HKL_TRUE if both are colinear.
-</td>
+<td>HKL_TRUE if both are colinear.</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_randomize ()">
+<div class="refsect2">
 <a name="hkl-vector-randomize"></a><h3>hkl_vector_randomize ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize                (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
 <p>
 initialize a vector with random values.
 coordinates range [-1, 1]
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody><tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to randomize
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</td>
 </tr></tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_randomize_vector ()">
+<div class="refsect2">
 <a name="hkl-vector-randomize-vector"></a><h3>hkl_vector_randomize_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize_vector         (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize_vector         (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector</code></em>);</pre>
 <p>
-randomize an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> an be sure that it is not equal
-to the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> vector.
+randomize an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> an be sure that it is not equal
+to the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> vector.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to randomize
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> result to avoid
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> result to avoid</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_randomize_vector_vector ()">
+<div class="refsect2">
 <a name="hkl-vector-randomize-vector-vector"></a><h3>hkl_vector_randomize_vector_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize_vector_vector  (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector1</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *vector2</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_randomize_vector_vector  (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector1</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *vector2</code></em>);</pre>
 <p>
-randomize an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> an be sure that it is not equal
-to the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> vector1 and vector2.
+randomize an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> an be sure that it is not equal
+to the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> vector1 and vector2.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to randomize
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to randomize</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector1</code></em> :</span></p></td>
-<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> solution to avoid
-</td>
+<td>the first <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> solution to avoid</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>vector2</code></em> :</span></p></td>
-<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> solution to avoid
-</td>
+<td>the second <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> solution to avoid</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_rotated_around_vector ()">
+<div class="refsect2">
 <a name="hkl-vector-rotated-around-vector"></a><h3>hkl_vector_rotated_around_vector ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_rotated_around_vector    (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *axe</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_rotated_around_vector    (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *axe</code></em>,
                                                          <em class="parameter"><code><span class="type">double</span> angle</code></em>);</pre>
 <p>
 rotate a vector around another one with a given angle.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to rotate
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to rotate</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>axe</code></em> :</span></p></td>
-<td>the axe of rotation
-</td>
+<td>the axe of rotation</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
-<td>the angle of the rotation
-</td>
+<td>the angle of the rotation</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_rotated_quaternion ()">
+<div class="refsect2">
 <a name="hkl-vector-rotated-quaternion"></a><h3>hkl_vector_rotated_quaternion ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_rotated_quaternion       (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_rotated_quaternion       (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
                                                          <em class="parameter"><code>const <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> *qr</code></em>);</pre>
 <p>
-rotate an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> using an <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>.
+rotate an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> using an <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a>.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> to rotate
-</td>
+<td>the <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> to rotate</td>
 </tr>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>qr</code></em> :</span></p></td>
-<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to rotate the vector
-</td>
+<td>the <a class="link" href="hkl-hkl-quaternion.html#HklQuaternion" title="HklQuaternion"><span class="type">HklQuaternion</span></a> use to rotate the vector</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_is_null ()">
+<div class="refsect2">
 <a name="hkl-vector-is-null"></a><h3>hkl_vector_is_null ()</h3>
-<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_null                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">int</span>                 hkl_vector_is_null                  (<em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>);</pre>
 <p>
-check if all the coordinates of an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> are null.
+check if all the coordinates of an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> are null.
 </p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the <span class="type">hklvector</span> to check
-</td>
+<td>the <span class="type">hklvector</span> to check</td>
 </tr>
 <tr>
 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
-<td> HKl_TRUE if all |elements| are below HKL_EPSILON, HKl_FALSE otherwise
-
-Todo: test
-</td>
+<td>HKl_TRUE if all |elements| are below HKL_EPSILON, HKl_FALSE otherwise
+Todo: test</td>
 </tr>
 </tbody>
 </table></div>
 </div>
 <hr>
-<div class="refsect2" title="hkl_vector_project_on_plan ()">
+<div class="refsect2">
 <a name="hkl-vector-project-on-plan"></a><h3>hkl_vector_project_on_plan ()</h3>
-<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_project_on_plan          (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *self</code></em>,
-                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> *plan</code></em>);</pre>
+<pre class="programlisting"><span class="returnvalue">void</span>                hkl_vector_project_on_plan          (<em class="parameter"><code><a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *self</code></em>,
+                                                         <em class="parameter"><code>const <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> *normal</code></em>);</pre>
 <p>
-project an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector"><span class="type">HklVector</span></a> on a plan.
+project an <a class="link" href="hkl-hkl-vector.html#HklVector" title="struct HklVector"><span class="type">HklVector</span></a> on a plan of normal which contain
+the origin [0, 0, 0]
 </p>
-<p>
-<em class="parameter"><code>todo</code></em> test
-</p>
-<div class="variablelist"><table border="0">
+<div class="variablelist"><table border="0" class="variablelist">
+<colgroup>
 <col align="left" valign="top">
+<col>
+</colgroup>
 <tbody>
 <tr>
 <td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td>
-<td>the vector to project (modify)
-</td>
+<td>the vector to project</td>
 </tr>
 <tr>
-<td><p><span class="term"><em class="parameter"><code>plan</code></em> :</span></p></td>
-<td>the normal of the plane.
-</td>
+<td><p><span class="term"><em class="parameter"><code>normal</code></em> :</span></p></td>
+<td>the normal of the plane.</td>
 </tr>
 </tbody>
 </table></div>
@@ -791,6 +816,6 @@ project an <a class="link" href="hkl-hkl-vector.html#HklVector" title="HklVector
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/hkl.devhelp b/Documentation/api/html/hkl.devhelp
deleted file mode 100644
index 89ce632..0000000
--- a/Documentation/api/html/hkl.devhelp
+++ /dev/null
@@ -1,356 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<!DOCTYPE book PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
-<book xmlns="http://www.devhelp.net/book" title="hkl Reference Manual" link="index.html" author="" name="hkl">
-  <chapters>
-    <sub name="[Insert title here]" link="ch01.html">
-      <sub name="hkl-pseudoaxis-zaxis" link="hkl-hkl-pseudoaxis-zaxis.html"/>
-      <sub name="hkl-pseudoaxis-common-eulerians" link="hkl-hkl-pseudoaxis-common-eulerians.html"/>
-      <sub name="hkl-pseudoaxis-e6c" link="hkl-hkl-pseudoaxis-e6c.html"/>
-      <sub name="hkl-detector" link="hkl-hkl-detector.html"/>
-      <sub name="hkl-interval" link="hkl-hkl-interval.html"/>
-      <sub name="hkl-detector-factory" link="hkl-hkl-detector-factory.html"/>
-      <sub name="hkl-quaternion" link="hkl-hkl-quaternion.html"/>
-      <sub name="hkl-pseudoaxis-k4cv" link="hkl-hkl-pseudoaxis-k4cv.html"/>
-      <sub name="hkl-error" link="hkl-hkl-error.html"/>
-      <sub name="hkl-parameter" link="hkl-hkl-parameter.html"/>
-      <sub name="hkl-pseudoaxis" link="hkl-hkl-pseudoaxis.html"/>
-      <sub name="hkl-geometry" link="hkl-hkl-geometry.html"/>
-      <sub name="hkl-geometry-factory" link="hkl-hkl-geometry-factory.html"/>
-      <sub name="hkl-pseudoaxis-auto" link="hkl-hkl-pseudoaxis-auto.html"/>
-      <sub name="hkl-pseudoaxis-e4cv" link="hkl-hkl-pseudoaxis-e4cv.html"/>
-      <sub name="hkl-macros" link="hkl-hkl-macros.html"/>
-      <sub name="hkl-pseudoaxis-k6c" link="hkl-hkl-pseudoaxis-k6c.html"/>
-      <sub name="hkl-source" link="hkl-hkl-source.html"/>
-      <sub name="hkl-unit" link="hkl-hkl-unit.html"/>
-      <sub name="hkl-pseudoaxis-common-hkl" link="hkl-hkl-pseudoaxis-common-hkl.html"/>
-      <sub name="hkl-matrix" link="hkl-hkl-matrix.html"/>
-      <sub name="hkl-list" link="hkl-hkl-list.html"/>
-      <sub name="hkl-pseudoaxis-common" link="hkl-hkl-pseudoaxis-common.html"/>
-      <sub name="hkl-sample" link="hkl-hkl-sample.html"/>
-      <sub name="hkl-axis" link="hkl-hkl-axis.html"/>
-      <sub name="hkl-pseudoaxis-factory" link="hkl-hkl-pseudoaxis-factory.html"/>
-      <sub name="hkl-pseudoaxis-common-psi" link="hkl-hkl-pseudoaxis-common-psi.html"/>
-      <sub name="hkl-pseudoaxis-common-q" link="hkl-hkl-pseudoaxis-common-q.html"/>
-      <sub name="hkl-lattice" link="hkl-hkl-lattice.html"/>
-      <sub name="hkl-vector" link="hkl-hkl-vector.html"/>
-    </sub>
-    <sub name="Object Hierarchy" link="object-tree.html"/>
-    <sub name="API Index" link="api-index-full.html"/>
-  </chapters>
-  <functions>
-    <function name="hkl_pseudo_axis_engine_zaxis_hkl_new ()" link="hkl-hkl-pseudoaxis-zaxis.html#hkl-pseudo-axis-engine-zaxis-hkl-new"/>
-    <function name="hkl_pseudo_axis_engine_eulerians_new ()" link="hkl-hkl-pseudoaxis-common-eulerians.html#hkl-pseudo-axis-engine-eulerians-new"/>
-    <function name="hkl_pseudo_axis_engine_e6c_hkl_new ()" link="hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-hkl-new"/>
-    <function name="hkl_pseudo_axis_engine_e6c_psi_new ()" link="hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-psi-new"/>
-    <function name="HklDetector" link="hkl-hkl-detector.html#HklDetector"/>
-    <function name="hkl_detector_new ()" link="hkl-hkl-detector.html#hkl-detector-new"/>
-    <function name="hkl_detector_new_copy ()" link="hkl-hkl-detector.html#hkl-detector-new-copy"/>
-    <function name="hkl_detector_free ()" link="hkl-hkl-detector.html#hkl-detector-free"/>
-    <function name="hkl_detector_attach_to_holder ()" link="hkl-hkl-detector.html#hkl-detector-attach-to-holder"/>
-    <function name="hkl_detector_compute_kf ()" link="hkl-hkl-detector.html#hkl-detector-compute-kf"/>
-    <function name="HklInterval" link="hkl-hkl-interval.html#HklInterval"/>
-    <function name="hkl_interval_cmp ()" link="hkl-hkl-interval.html#hkl-interval-cmp"/>
-    <function name="hkl_interval_plus_interval ()" link="hkl-hkl-interval.html#hkl-interval-plus-interval"/>
-    <function name="hkl_interval_plus_double ()" link="hkl-hkl-interval.html#hkl-interval-plus-double"/>
-    <function name="hkl_interval_minus_interval ()" link="hkl-hkl-interval.html#hkl-interval-minus-interval"/>
-    <function name="hkl_interval_minus_double ()" link="hkl-hkl-interval.html#hkl-interval-minus-double"/>
-    <function name="hkl_interval_times_interval ()" link="hkl-hkl-interval.html#hkl-interval-times-interval"/>
-    <function name="hkl_interval_times_double ()" link="hkl-hkl-interval.html#hkl-interval-times-double"/>
-    <function name="hkl_interval_divides_double ()" link="hkl-hkl-interval.html#hkl-interval-divides-double"/>
-    <function name="hkl_interval_contain_zero ()" link="hkl-hkl-interval.html#hkl-interval-contain-zero"/>
-    <function name="hkl_interval_cos ()" link="hkl-hkl-interval.html#hkl-interval-cos"/>
-    <function name="hkl_interval_acos ()" link="hkl-hkl-interval.html#hkl-interval-acos"/>
-    <function name="hkl_interval_sin ()" link="hkl-hkl-interval.html#hkl-interval-sin"/>
-    <function name="hkl_interval_asin ()" link="hkl-hkl-interval.html#hkl-interval-asin"/>
-    <function name="hkl_interval_tan ()" link="hkl-hkl-interval.html#hkl-interval-tan"/>
-    <function name="hkl_interval_atan ()" link="hkl-hkl-interval.html#hkl-interval-atan"/>
-    <function name="hkl_interval_length ()" link="hkl-hkl-interval.html#hkl-interval-length"/>
-    <function name="hkl_interval_angle_restrict_symm ()" link="hkl-hkl-interval.html#hkl-interval-angle-restrict-symm"/>
-    <function name="hkl_detector_factory_new ()" link="hkl-hkl-detector-factory.html#hkl-detector-factory-new"/>
-    <function name="HklQuaternion" link="hkl-hkl-quaternion.html#HklQuaternion"/>
-    <function name="hkl_quaternion_init ()" link="hkl-hkl-quaternion.html#hkl-quaternion-init"/>
-    <function name="hkl_quaternion_init_from_vector ()" link="hkl-hkl-quaternion.html#hkl-quaternion-init-from-vector"/>
-    <function name="hkl_quaternion_init_from_angle_and_axe ()" link="hkl-hkl-quaternion.html#hkl-quaternion-init-from-angle-and-axe"/>
-    <function name="hkl_quaternion_fprintf ()" link="hkl-hkl-quaternion.html#hkl-quaternion-fprintf"/>
-    <function name="hkl_quaternion_cmp ()" link="hkl-hkl-quaternion.html#hkl-quaternion-cmp"/>
-    <function name="hkl_quaternion_minus_quaternion ()" link="hkl-hkl-quaternion.html#hkl-quaternion-minus-quaternion"/>
-    <function name="hkl_quaternion_times_quaternion ()" link="hkl-hkl-quaternion.html#hkl-quaternion-times-quaternion"/>
-    <function name="hkl_quaternion_norm2 ()" link="hkl-hkl-quaternion.html#hkl-quaternion-norm2"/>
-    <function name="hkl_quaternion_conjugate ()" link="hkl-hkl-quaternion.html#hkl-quaternion-conjugate"/>
-    <function name="hkl_quaternion_to_matrix ()" link="hkl-hkl-quaternion.html#hkl-quaternion-to-matrix"/>
-    <function name="hkl_quaternion_to_angle_and_axe ()" link="hkl-hkl-quaternion.html#hkl-quaternion-to-angle-and-axe"/>
-    <function name="hkl_pseudo_axis_engine_k4cv_hkl_new ()" link="hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-hkl-new"/>
-    <function name="hkl_pseudo_axis_engine_k4cv_psi_new ()" link="hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-psi-new"/>
-    <function name="HklError" link="hkl-hkl-error.html#HklError"/>
-    <function name="hkl_error_new ()" link="hkl-hkl-error.html#hkl-error-new"/>
-    <function name="hkl_error_new_literal ()" link="hkl-hkl-error.html#hkl-error-new-literal"/>
-    <function name="hkl_error_new_valist ()" link="hkl-hkl-error.html#hkl-error-new-valist"/>
-    <function name="hkl_error_free ()" link="hkl-hkl-error.html#hkl-error-free"/>
-    <function name="hkl_error_new_copy ()" link="hkl-hkl-error.html#hkl-error-new-copy"/>
-    <function name="hkl_error_set ()" link="hkl-hkl-error.html#hkl-error-set"/>
-    <function name="hkl_error_set_literal ()" link="hkl-hkl-error.html#hkl-error-set-literal"/>
-    <function name="hkl_error_propagate ()" link="hkl-hkl-error.html#hkl-error-propagate"/>
-    <function name="hkl_error_clear ()" link="hkl-hkl-error.html#hkl-error-clear"/>
-    <function name="hkl_error_prefix ()" link="hkl-hkl-error.html#hkl-error-prefix"/>
-    <function name="hkl_error_propagate_prefixed ()" link="hkl-hkl-error.html#hkl-error-propagate-prefixed"/>
-    <function name="HklParameter" link="hkl-hkl-parameter.html#HklParameter"/>
-    <function name="hkl_parameter_new ()" link="hkl-hkl-parameter.html#hkl-parameter-new"/>
-    <function name="hkl_parameter_new_copy ()" link="hkl-hkl-parameter.html#hkl-parameter-new-copy"/>
-    <function name="hkl_parameter_init ()" link="hkl-hkl-parameter.html#hkl-parameter-init"/>
-    <function name="hkl_parameter_free ()" link="hkl-hkl-parameter.html#hkl-parameter-free"/>
-    <function name="hkl_parameter_set_value ()" link="hkl-hkl-parameter.html#hkl-parameter-set-value"/>
-    <function name="hkl_parameter_get_value_unit ()" link="hkl-hkl-parameter.html#hkl-parameter-get-value-unit"/>
-    <function name="hkl_parameter_set_value_unit ()" link="hkl-hkl-parameter.html#hkl-parameter-set-value-unit"/>
-    <function name="hkl_parameter_get_max ()" link="hkl-hkl-parameter.html#hkl-parameter-get-max"/>
-    <function name="hkl_parameter_get_range_unit ()" link="hkl-hkl-parameter.html#hkl-parameter-get-range-unit"/>
-    <function name="hkl_parameter_set_range ()" link="hkl-hkl-parameter.html#hkl-parameter-set-range"/>
-    <function name="hkl_parameter_set_range_unit ()" link="hkl-hkl-parameter.html#hkl-parameter-set-range-unit"/>
-    <function name="hkl_parameter_randomize ()" link="hkl-hkl-parameter.html#hkl-parameter-randomize"/>
-    <function name="hkl_parameter_is_valid ()" link="hkl-hkl-parameter.html#hkl-parameter-is-valid"/>
-    <function name="hkl_parameter_fprintf ()" link="hkl-hkl-parameter.html#hkl-parameter-fprintf"/>
-    <function name="HklPseudoAxis" link="hkl-hkl-pseudoaxis.html#HklPseudoAxis"/>
-    <function name="HklPseudoAxisEngineMode" link="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode"/>
-    <function name="HklPseudoAxisEngine" link="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine"/>
-    <function name="HklPseudoAxisEngineList" link="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList"/>
-    <function name="HklPseudoAxisEngineModeFunc ()" link="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc"/>
-    <function name="HklFunction ()" link="hkl-hkl-pseudoaxis.html#HklFunction"/>
-    <function name="hkl_pseudo_axis_new ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-new"/>
-    <function name="hkl_pseudo_axis_init ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-init"/>
-    <function name="hkl_pseudo_axis_free ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-free"/>
-    <function name="hkl_pseudo_axis_fprintf ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-fprintf"/>
-    <function name="hkl_pseudo_axis_engine_mode_new ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-new"/>
-    <function name="hkl_pseudo_axis_engine_mode_init ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-init"/>
-    <function name="hkl_pseudo_axis_engine_mode_free ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-free"/>
-    <function name="hkl_pseudo_axis_engine_new ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-new"/>
-    <function name="hkl_pseudo_axis_engine_free ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-free"/>
-    <function name="hkl_pseudo_axis_engine_add_mode ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-mode"/>
-    <function name="hkl_pseudo_axis_engine_add_geometry ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-geometry"/>
-    <function name="hkl_pseudo_axis_engine_select_mode ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-select-mode"/>
-    <function name="hkl_pseudo_axis_engine_initialize ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-initialize"/>
-    <function name="hkl_pseudo_axis_engine_set ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-set"/>
-    <function name="hkl_pseudo_axis_engine_get ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-get"/>
-    <function name="hkl_pseudo_axis_engine_fprintf ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-fprintf"/>
-    <function name="hkl_pseudo_axis_engine_list_new ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-new"/>
-    <function name="hkl_pseudo_axis_engine_list_free ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-free"/>
-    <function name="hkl_pseudo_axis_engine_list_add ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-add"/>
-    <function name="hkl_pseudo_axis_engine_list_get_by_name ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-by-name"/>
-    <function name="hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-pseudo-axis-by-name"/>
-    <function name="hkl_pseudo_axis_engine_list_clear ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-clear"/>
-    <function name="hkl_pseudo_axis_engine_list_init ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-init"/>
-    <function name="hkl_pseudo_axis_engine_list_get ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get"/>
-    <function name="hkl_pseudo_axis_engine_list_fprintf ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-fprintf"/>
-    <function name="HklHolder" link="hkl-hkl-geometry.html#HklHolder"/>
-    <function name="HklGeometryConfig" link="hkl-hkl-geometry.html#HklGeometryConfig"/>
-    <function name="HklGeometry" link="hkl-hkl-geometry.html#HklGeometry"/>
-    <function name="HklGeometryList" link="hkl-hkl-geometry.html#HklGeometryList"/>
-    <function name="HklGeometryListItem" link="hkl-hkl-geometry.html#HklGeometryListItem"/>
-    <function name="HklGeometryListMultiplyFunction ()" link="hkl-hkl-geometry.html#HklGeometryListMultiplyFunction"/>
-    <function name="hkl_holder_add_rotation_axis ()" link="hkl-hkl-geometry.html#hkl-holder-add-rotation-axis"/>
-    <function name="hkl_geometry_new ()" link="hkl-hkl-geometry.html#hkl-geometry-new"/>
-    <function name="hkl_geometry_new_copy ()" link="hkl-hkl-geometry.html#hkl-geometry-new-copy"/>
-    <function name="hkl_geometry_free ()" link="hkl-hkl-geometry.html#hkl-geometry-free"/>
-    <function name="hkl_geometry_init_geometry ()" link="hkl-hkl-geometry.html#hkl-geometry-init-geometry"/>
-    <function name="hkl_geometry_add_holder ()" link="hkl-hkl-geometry.html#hkl-geometry-add-holder"/>
-    <function name="hkl_geometry_update ()" link="hkl-hkl-geometry.html#hkl-geometry-update"/>
-    <function name="hkl_geometry_get_axis_by_name ()" link="hkl-hkl-geometry.html#hkl-geometry-get-axis-by-name"/>
-    <function name="hkl_geometry_randomize ()" link="hkl-hkl-geometry.html#hkl-geometry-randomize"/>
-    <function name="hkl_geometry_set_values_v ()" link="hkl-hkl-geometry.html#hkl-geometry-set-values-v"/>
-    <function name="hkl_geometry_distance ()" link="hkl-hkl-geometry.html#hkl-geometry-distance"/>
-    <function name="hkl_geometry_distance_orthodromic ()" link="hkl-hkl-geometry.html#hkl-geometry-distance-orthodromic"/>
-    <function name="hkl_geometry_closest_from_geometry_with_range ()" link="hkl-hkl-geometry.html#hkl-geometry-closest-from-geometry-with-range"/>
-    <function name="hkl_geometry_is_valid ()" link="hkl-hkl-geometry.html#hkl-geometry-is-valid"/>
-    <function name="hkl_geometry_fprintf ()" link="hkl-hkl-geometry.html#hkl-geometry-fprintf"/>
-    <function name="hkl_geometry_list_new ()" link="hkl-hkl-geometry.html#hkl-geometry-list-new"/>
-    <function name="hkl_geometry_list_free ()" link="hkl-hkl-geometry.html#hkl-geometry-list-free"/>
-    <function name="hkl_geometry_list_add ()" link="hkl-hkl-geometry.html#hkl-geometry-list-add"/>
-    <function name="hkl_geometry_list_reset ()" link="hkl-hkl-geometry.html#hkl-geometry-list-reset"/>
-    <function name="hkl_geometry_list_sort ()" link="hkl-hkl-geometry.html#hkl-geometry-list-sort"/>
-    <function name="hkl_geometry_list_fprintf ()" link="hkl-hkl-geometry.html#hkl-geometry-list-fprintf"/>
-    <function name="hkl_geometry_list_multiply ()" link="hkl-hkl-geometry.html#hkl-geometry-list-multiply"/>
-    <function name="hkl_geometry_list_multiply_from_range ()" link="hkl-hkl-geometry.html#hkl-geometry-list-multiply-from-range"/>
-    <function name="hkl_geometry_list_remove_invalid ()" link="hkl-hkl-geometry.html#hkl-geometry-list-remove-invalid"/>
-    <function name="hkl_geometry_list_len ()" link="hkl-hkl-geometry.html#hkl-geometry-list-len"/>
-    <function name="hkl_geometry_list_is_empty ()" link="hkl-hkl-geometry.html#hkl-geometry-list-is-empty"/>
-    <function name="hkl_geometry_list_item_new ()" link="hkl-hkl-geometry.html#hkl-geometry-list-item-new"/>
-    <function name="hkl_geometry_list_item_free ()" link="hkl-hkl-geometry.html#hkl-geometry-list-item-free"/>
-    <function name="hkl_geometry_factory_get_config_from_type ()" link="hkl-hkl-geometry-factory.html#hkl-geometry-factory-get-config-from-type"/>
-    <function name="hkl_geometry_factory_new ()" link="hkl-hkl-geometry-factory.html#hkl-geometry-factory-new"/>
-    <function name="hkl_pseudo_axis_engine_mode_set_real ()" link="hkl-hkl-pseudoaxis-auto.html#hkl-pseudo-axis-engine-mode-set-real"/>
-    <function name="hkl_pseudo_axis_engine_e4cv_hkl_new ()" link="hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-hkl-new"/>
-    <function name="hkl_pseudo_axis_engine_e4cv_psi_new ()" link="hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-psi-new"/>
-    <function name="HKL_BEGIN_DECLS" link="hkl-hkl-macros.html#HKL-BEGIN-DECLS:CAPS"/>
-    <function name="HKL_END_DECLS" link="hkl-hkl-macros.html#HKL-END-DECLS:CAPS"/>
-    <function name="INFINITY" link="hkl-hkl-macros.html#INFINITY:CAPS"/>
-    <function name="M_PI" link="hkl-hkl-macros.html#M-PI:CAPS"/>
-    <function name="M_PI_2" link="hkl-hkl-macros.html#M-PI-2:CAPS"/>
-    <function name="HKL_MAJOR" link="hkl-hkl-macros.html#HKL-MAJOR:CAPS"/>
-    <function name="HKL_MINOR" link="hkl-hkl-macros.html#HKL-MINOR:CAPS"/>
-    <function name="HKL_PATCH" link="hkl-hkl-macros.html#HKL-PATCH:CAPS"/>
-    <function name="HKL_VERSION" link="hkl-hkl-macros.html#HKL-VERSION:CAPS"/>
-    <function name="HKL_TRUE" link="hkl-hkl-macros.html#HKL-TRUE:CAPS"/>
-    <function name="HKL_FALSE" link="hkl-hkl-macros.html#HKL-FALSE:CAPS"/>
-    <function name="HKL_SUCCESS" link="hkl-hkl-macros.html#HKL-SUCCESS:CAPS"/>
-    <function name="HKL_FAIL" link="hkl-hkl-macros.html#HKL-FAIL:CAPS"/>
-    <function name="HKL_TINY" link="hkl-hkl-macros.html#HKL-TINY:CAPS"/>
-    <function name="HKL_EPSILON" link="hkl-hkl-macros.html#HKL-EPSILON:CAPS"/>
-    <function name="HKL_DEGTORAD" link="hkl-hkl-macros.html#HKL-DEGTORAD:CAPS"/>
-    <function name="HKL_RADTODEG" link="hkl-hkl-macros.html#HKL-RADTODEG:CAPS"/>
-    <function name="HKL_TAU" link="hkl-hkl-macros.html#HKL-TAU:CAPS"/>
-    <function name="HKL_EULERIAN_KAPPA_SOLUTION" link="hkl-hkl-macros.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS"/>
-    <function name="hkl_assert()" link="hkl-hkl-macros.html#hkl-assert"/>
-    <function name="G_GNUC_PRINTF()" link="hkl-hkl-macros.html#G-GNUC-PRINTF:CAPS"/>
-    <function name="alloc_nr()" link="hkl-hkl-macros.html#alloc-nr"/>
-    <function name="ALLOC_GROW()" link="hkl-hkl-macros.html#ALLOC-GROW:CAPS"/>
-    <function name="NORETURN" link="hkl-hkl-macros.html#NORETURN:CAPS"/>
-    <function name="hkl_printbt ()" link="hkl-hkl-macros.html#hkl-printbt"/>
-    <function name="HKL_MALLOC()" link="hkl-hkl-macros.html#HKL-MALLOC:CAPS"/>
-    <function name="hkl_pseudo_axis_engine_k6c_hkl_new ()" link="hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-hkl-new"/>
-    <function name="hkl_pseudo_axis_engine_k6c_psi_new ()" link="hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-psi-new"/>
-    <function name="HKL_SOURCE_DEFAULT_WAVE_LENGTH" link="hkl-hkl-source.html#HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS"/>
-    <function name="HklSource" link="hkl-hkl-source.html#HklSource"/>
-    <function name="hkl_source_init ()" link="hkl-hkl-source.html#hkl-source-init"/>
-    <function name="hkl_source_cmp ()" link="hkl-hkl-source.html#hkl-source-cmp"/>
-    <function name="hkl_source_compute_ki ()" link="hkl-hkl-source.html#hkl-source-compute-ki"/>
-    <function name="hkl_source_get_wavelength ()" link="hkl-hkl-source.html#hkl-source-get-wavelength"/>
-    <function name="hkl_source_fprintf ()" link="hkl-hkl-source.html#hkl-source-fprintf"/>
-    <function name="HklUnit" link="hkl-hkl-unit.html#HklUnit"/>
-    <function name="hkl_unit_compatible ()" link="hkl-hkl-unit.html#hkl-unit-compatible"/>
-    <function name="hkl_unit_factor ()" link="hkl-hkl-unit.html#hkl-unit-factor"/>
-    <function name="RUBh_minus_Q_func ()" link="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q-func"/>
-    <function name="double_diffraction_func ()" link="hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction-func"/>
-    <function name="psi_constant_vertical_func ()" link="hkl-hkl-pseudoaxis-common-hkl.html#psi-constant-vertical-func"/>
-    <function name="RUBh_minus_Q ()" link="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q"/>
-    <function name="double_diffraction ()" link="hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction"/>
-    <function name="hkl_pseudo_axis_engine_mode_get_hkl_real ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-get-hkl-real"/>
-    <function name="hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-init-psi-constant-vertical-real"/>
-    <function name="hkl_pseudo_axis_engine_hkl_new ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-hkl-new"/>
-    <function name="HklMatrix" link="hkl-hkl-matrix.html#HklMatrix"/>
-    <function name="hkl_matrix_init ()" link="hkl-hkl-matrix.html#hkl-matrix-init"/>
-    <function name="hkl_matrix_init_from_two_vector ()" link="hkl-hkl-matrix.html#hkl-matrix-init-from-two-vector"/>
-    <function name="hkl_matrix_init_from_euler ()" link="hkl-hkl-matrix.html#hkl-matrix-init-from-euler"/>
-    <function name="hkl_matrix_fprintf ()" link="hkl-hkl-matrix.html#hkl-matrix-fprintf"/>
-    <function name="hkl_matrix_to_euler ()" link="hkl-hkl-matrix.html#hkl-matrix-to-euler"/>
-    <function name="hkl_matrix_cmp ()" link="hkl-hkl-matrix.html#hkl-matrix-cmp"/>
-    <function name="hkl_matrix_times_matrix ()" link="hkl-hkl-matrix.html#hkl-matrix-times-matrix"/>
-    <function name="hkl_matrix_times_vector ()" link="hkl-hkl-matrix.html#hkl-matrix-times-vector"/>
-    <function name="hkl_matrix_transpose ()" link="hkl-hkl-matrix.html#hkl-matrix-transpose"/>
-    <function name="hkl_matrix_det ()" link="hkl-hkl-matrix.html#hkl-matrix-det"/>
-    <function name="hkl_matrix_solve ()" link="hkl-hkl-matrix.html#hkl-matrix-solve"/>
-    <function name="hkl_matrix_is_null ()" link="hkl-hkl-matrix.html#hkl-matrix-is-null"/>
-    <function name="HKL_LIST_LEN()" link="hkl-hkl-list.html#HKL-LIST-LEN:CAPS"/>
-    <function name="HKL_LIST()" link="hkl-hkl-list.html#HKL-LIST:CAPS"/>
-    <function name="HKL_LIST_INIT()" link="hkl-hkl-list.html#HKL-LIST-INIT:CAPS"/>
-    <function name="HKL_LIST_ALLOC()" link="hkl-hkl-list.html#HKL-LIST-ALLOC:CAPS"/>
-    <function name="HKL_LIST_COPY()" link="hkl-hkl-list.html#HKL-LIST-COPY:CAPS"/>
-    <function name="HKL_LIST_FREE()" link="hkl-hkl-list.html#HKL-LIST-FREE:CAPS"/>
-    <function name="HKL_LIST_FREE_DESTRUCTOR()" link="hkl-hkl-list.html#HKL-LIST-FREE-DESTRUCTOR:CAPS"/>
-    <function name="HKL_LIST_RESIZE()" link="hkl-hkl-list.html#HKL-LIST-RESIZE:CAPS"/>
-    <function name="HKL_LIST_ADD_VALUE()" link="hkl-hkl-list.html#HKL-LIST-ADD-VALUE:CAPS"/>
-    <function name="HKL_LIST_DEL()" link="hkl-hkl-list.html#HKL-LIST-DEL:CAPS"/>
-    <function name="HKL_LIST_DEL_DESTRUCTOR()" link="hkl-hkl-list.html#HKL-LIST-DEL-DESTRUCTOR:CAPS"/>
-    <function name="HKL_LIST_DEL_ITEM_DESTRUCTOR()" link="hkl-hkl-list.html#HKL-LIST-DEL-ITEM-DESTRUCTOR:CAPS"/>
-    <function name="hkl_pseudo_axis_engine_init_func ()" link="hkl-hkl-pseudoaxis-common.html#hkl-pseudo-axis-engine-init-func"/>
-    <function name="HklSample" link="hkl-hkl-sample.html#HklSample"/>
-    <function name="HklSampleReflection" link="hkl-hkl-sample.html#HklSampleReflection"/>
-    <function name="HklSampleList" link="hkl-hkl-sample.html#HklSampleList"/>
-    <function name="enum HklSampleType" link="hkl-hkl-sample.html#HklSampleType"/>
-    <function name="hkl_sample_new ()" link="hkl-hkl-sample.html#hkl-sample-new"/>
-    <function name="hkl_sample_new_copy ()" link="hkl-hkl-sample.html#hkl-sample-new-copy"/>
-    <function name="hkl_sample_free ()" link="hkl-hkl-sample.html#hkl-sample-free"/>
-    <function name="hkl_sample_set_name ()" link="hkl-hkl-sample.html#hkl-sample-set-name"/>
-    <function name="hkl_sample_set_lattice ()" link="hkl-hkl-sample.html#hkl-sample-set-lattice"/>
-    <function name="hkl_sample_set_U_from_euler ()" link="hkl-hkl-sample.html#hkl-sample-set-U-from-euler"/>
-    <function name="hkl_sample_get_UB ()" link="hkl-hkl-sample.html#hkl-sample-get-UB"/>
-    <function name="hkl_sample_set_UB ()" link="hkl-hkl-sample.html#hkl-sample-set-UB"/>
-    <function name="hkl_sample_add_reflection ()" link="hkl-hkl-sample.html#hkl-sample-add-reflection"/>
-    <function name="hkl_sample_get_ith_reflection ()" link="hkl-hkl-sample.html#hkl-sample-get-ith-reflection"/>
-    <function name="hkl_sample_del_reflection ()" link="hkl-hkl-sample.html#hkl-sample-del-reflection"/>
-    <function name="hkl_sample_compute_UB_busing_levy ()" link="hkl-hkl-sample.html#hkl-sample-compute-UB-busing-levy"/>
-    <function name="hkl_sample_affine ()" link="hkl-hkl-sample.html#hkl-sample-affine"/>
-    <function name="hkl_sample_get_reflection_mesured_angle ()" link="hkl-hkl-sample.html#hkl-sample-get-reflection-mesured-angle"/>
-    <function name="hkl_sample_get_reflection_theoretical_angle ()" link="hkl-hkl-sample.html#hkl-sample-get-reflection-theoretical-angle"/>
-    <function name="hkl_sample_fprintf ()" link="hkl-hkl-sample.html#hkl-sample-fprintf"/>
-    <function name="hkl_sample_reflection_set_hkl ()" link="hkl-hkl-sample.html#hkl-sample-reflection-set-hkl"/>
-    <function name="hkl_sample_reflection_set_flag ()" link="hkl-hkl-sample.html#hkl-sample-reflection-set-flag"/>
-    <function name="hkl_sample_reflection_set_geometry ()" link="hkl-hkl-sample.html#hkl-sample-reflection-set-geometry"/>
-    <function name="hkl_sample_list_new ()" link="hkl-hkl-sample.html#hkl-sample-list-new"/>
-    <function name="hkl_sample_list_free ()" link="hkl-hkl-sample.html#hkl-sample-list-free"/>
-    <function name="hkl_sample_list_append ()" link="hkl-hkl-sample.html#hkl-sample-list-append"/>
-    <function name="hkl_sample_list_clear ()" link="hkl-hkl-sample.html#hkl-sample-list-clear"/>
-    <function name="hkl_sample_list_del ()" link="hkl-hkl-sample.html#hkl-sample-list-del"/>
-    <function name="hkl_sample_list_len ()" link="hkl-hkl-sample.html#hkl-sample-list-len"/>
-    <function name="hkl_sample_list_get_ith ()" link="hkl-hkl-sample.html#hkl-sample-list-get-ith"/>
-    <function name="hkl_sample_list_get_by_name ()" link="hkl-hkl-sample.html#hkl-sample-list-get-by-name"/>
-    <function name="hkl_sample_list_get_idx_from_name ()" link="hkl-hkl-sample.html#hkl-sample-list-get-idx-from-name"/>
-    <function name="hkl_sample_list_select_current ()" link="hkl-hkl-sample.html#hkl-sample-list-select-current"/>
-    <function name="hkl_sample_list_fprintf ()" link="hkl-hkl-sample.html#hkl-sample-list-fprintf"/>
-    <function name="HklAxis" link="hkl-hkl-axis.html#HklAxis"/>
-    <function name="hkl_axis_new ()" link="hkl-hkl-axis.html#hkl-axis-new"/>
-    <function name="hkl_axis_free ()" link="hkl-hkl-axis.html#hkl-axis-free"/>
-    <function name="hkl_axis_init ()" link="hkl-hkl-axis.html#hkl-axis-init"/>
-    <function name="hkl_axis_get_name ()" link="hkl-hkl-axis.html#hkl-axis-get-name"/>
-    <function name="hkl_axis_get_changed ()" link="hkl-hkl-axis.html#hkl-axis-get-changed"/>
-    <function name="hkl_axis_set_changed ()" link="hkl-hkl-axis.html#hkl-axis-set-changed"/>
-    <function name="hkl_axis_get_value ()" link="hkl-hkl-axis.html#hkl-axis-get-value"/>
-    <function name="hkl_axis_get_value_unit ()" link="hkl-hkl-axis.html#hkl-axis-get-value-unit"/>
-    <function name="hkl_axis_get_value_closest ()" link="hkl-hkl-axis.html#hkl-axis-get-value-closest"/>
-    <function name="hkl_axis_get_value_closest_unit ()" link="hkl-hkl-axis.html#hkl-axis-get-value-closest-unit"/>
-    <function name="hkl_axis_get_max ()" link="hkl-hkl-axis.html#hkl-axis-get-max"/>
-    <function name="hkl_axis_get_range_unit ()" link="hkl-hkl-axis.html#hkl-axis-get-range-unit"/>
-    <function name="hkl_axis_set_value ()" link="hkl-hkl-axis.html#hkl-axis-set-value"/>
-    <function name="hkl_axis_set_value_smallest_in_range ()" link="hkl-hkl-axis.html#hkl-axis-set-value-smallest-in-range"/>
-    <function name="hkl_axis_set_value_unit ()" link="hkl-hkl-axis.html#hkl-axis-set-value-unit"/>
-    <function name="hkl_axis_set_range ()" link="hkl-hkl-axis.html#hkl-axis-set-range"/>
-    <function name="hkl_axis_set_range_unit ()" link="hkl-hkl-axis.html#hkl-axis-set-range-unit"/>
-    <function name="hkl_axis_randomize ()" link="hkl-hkl-axis.html#hkl-axis-randomize"/>
-    <function name="hkl_axis_get_quaternion ()" link="hkl-hkl-axis.html#hkl-axis-get-quaternion"/>
-    <function name="hkl_axis_is_value_compatible_with_range ()" link="hkl-hkl-axis.html#hkl-axis-is-value-compatible-with-range"/>
-    <function name="hkl_axis_is_valid ()" link="hkl-hkl-axis.html#hkl-axis-is-valid"/>
-    <function name="hkl_axis_fprintf ()" link="hkl-hkl-axis.html#hkl-axis-fprintf"/>
-    <function name="hkl_pseudo_axis_engine_list_factory ()" link="hkl-hkl-pseudoaxis-factory.html#hkl-pseudo-axis-engine-list-factory"/>
-    <function name="HklPseudoAxisEngineModePsi" link="hkl-hkl-pseudoaxis-common-psi.html#HklPseudoAxisEngineModePsi"/>
-    <function name="hkl_pseudo_axis_engine_mode_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-mode-psi-new"/>
-    <function name="hkl_pseudo_axis_engine_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-psi-new"/>
-    <function name="hkl_pseudo_axis_engine_q_new ()" link="hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q-new"/>
-    <function name="hkl_pseudo_axis_engine_q2_new ()" link="hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q2-new"/>
-    <function name="HklLattice" link="hkl-hkl-lattice.html#HklLattice"/>
-    <function name="hkl_lattice_new ()" link="hkl-hkl-lattice.html#hkl-lattice-new"/>
-    <function name="hkl_lattice_new_copy ()" link="hkl-hkl-lattice.html#hkl-lattice-new-copy"/>
-    <function name="hkl_lattice_new_default ()" link="hkl-hkl-lattice.html#hkl-lattice-new-default"/>
-    <function name="hkl_lattice_free ()" link="hkl-hkl-lattice.html#hkl-lattice-free"/>
-    <function name="hkl_lattice_set ()" link="hkl-hkl-lattice.html#hkl-lattice-set"/>
-    <function name="hkl_lattice_get_B ()" link="hkl-hkl-lattice.html#hkl-lattice-get-B"/>
-    <function name="hkl_lattice_get_1_B ()" link="hkl-hkl-lattice.html#hkl-lattice-get-1-B"/>
-    <function name="hkl_lattice_reciprocal ()" link="hkl-hkl-lattice.html#hkl-lattice-reciprocal"/>
-    <function name="hkl_lattice_randomize ()" link="hkl-hkl-lattice.html#hkl-lattice-randomize"/>
-    <function name="hkl_lattice_fprintf ()" link="hkl-hkl-lattice.html#hkl-lattice-fprintf"/>
-    <function name="HklMatrix" link="hkl-hkl-vector.html#HklMatrix"/>
-    <function name="HklQuaternion" link="hkl-hkl-vector.html#HklQuaternion"/>
-    <function name="HklVector" link="hkl-hkl-vector.html#HklVector"/>
-    <function name="hkl_vector_init ()" link="hkl-hkl-vector.html#hkl-vector-init"/>
-    <function name="hkl_vector_fprintf ()" link="hkl-hkl-vector.html#hkl-vector-fprintf"/>
-    <function name="hkl_vector_cmp ()" link="hkl-hkl-vector.html#hkl-vector-cmp"/>
-    <function name="hkl_vector_is_opposite ()" link="hkl-hkl-vector.html#hkl-vector-is-opposite"/>
-    <function name="hkl_vector_add_vector ()" link="hkl-hkl-vector.html#hkl-vector-add-vector"/>
-    <function name="hkl_vector_minus_vector ()" link="hkl-hkl-vector.html#hkl-vector-minus-vector"/>
-    <function name="hkl_vector_div_double ()" link="hkl-hkl-vector.html#hkl-vector-div-double"/>
-    <function name="hkl_vector_times_double ()" link="hkl-hkl-vector.html#hkl-vector-times-double"/>
-    <function name="hkl_vector_times_vector ()" link="hkl-hkl-vector.html#hkl-vector-times-vector"/>
-    <function name="hkl_vector_times_matrix ()" link="hkl-hkl-vector.html#hkl-vector-times-matrix"/>
-    <function name="hkl_vector_sum ()" link="hkl-hkl-vector.html#hkl-vector-sum"/>
-    <function name="hkl_vector_scalar_product ()" link="hkl-hkl-vector.html#hkl-vector-scalar-product"/>
-    <function name="hkl_vector_vectorial_product ()" link="hkl-hkl-vector.html#hkl-vector-vectorial-product"/>
-    <function name="hkl_vector_angle ()" link="hkl-hkl-vector.html#hkl-vector-angle"/>
-    <function name="hkl_vector_oriented_angle ()" link="hkl-hkl-vector.html#hkl-vector-oriented-angle"/>
-    <function name="hkl_vector_norm2 ()" link="hkl-hkl-vector.html#hkl-vector-norm2"/>
-    <function name="hkl_vector_normalize ()" link="hkl-hkl-vector.html#hkl-vector-normalize"/>
-    <function name="hkl_vector_is_colinear ()" link="hkl-hkl-vector.html#hkl-vector-is-colinear"/>
-    <function name="hkl_vector_randomize ()" link="hkl-hkl-vector.html#hkl-vector-randomize"/>
-    <function name="hkl_vector_randomize_vector ()" link="hkl-hkl-vector.html#hkl-vector-randomize-vector"/>
-    <function name="hkl_vector_randomize_vector_vector ()" link="hkl-hkl-vector.html#hkl-vector-randomize-vector-vector"/>
-    <function name="hkl_vector_rotated_around_vector ()" link="hkl-hkl-vector.html#hkl-vector-rotated-around-vector"/>
-    <function name="hkl_vector_rotated_quaternion ()" link="hkl-hkl-vector.html#hkl-vector-rotated-quaternion"/>
-    <function name="hkl_vector_is_null ()" link="hkl-hkl-vector.html#hkl-vector-is-null"/>
-    <function name="hkl_vector_project_on_plan ()" link="hkl-hkl-vector.html#hkl-vector-project-on-plan"/>
-  </functions>
-</book>
diff --git a/Documentation/api/html/hkl.devhelp2 b/Documentation/api/html/hkl.devhelp2
index ae6844d..837289b 100644
--- a/Documentation/api/html/hkl.devhelp2
+++ b/Documentation/api/html/hkl.devhelp2
@@ -36,19 +36,19 @@
     </sub>
     <sub name="Object Hierarchy" link="object-tree.html"/>
     <sub name="API Index" link="api-index-full.html"/>
+    <sub name="Annotation Glossary" link="annotation-glossary.html"/>
   </chapters>
   <functions>
-    <keyword type="function" name="hkl_pseudo_axis_engine_zaxis_hkl_new ()" link="hkl-hkl-pseudoaxis-zaxis.html#hkl-pseudo-axis-engine-zaxis-hkl-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_eulerians_new ()" link="hkl-hkl-pseudoaxis-common-eulerians.html#hkl-pseudo-axis-engine-eulerians-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_e6c_hkl_new ()" link="hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-hkl-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_e6c_psi_new ()" link="hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-psi-new"/>
-    <keyword type="struct" name="HklDetector" link="hkl-hkl-detector.html#HklDetector"/>
+    <keyword type="function" name="hkl_engine_zaxis_hkl_new ()" link="hkl-hkl-pseudoaxis-zaxis.html#hkl-engine-zaxis-hkl-new"/>
+    <keyword type="function" name="hkl_engine_eulerians_new ()" link="hkl-hkl-pseudoaxis-common-eulerians.html#hkl-engine-eulerians-new"/>
+    <keyword type="function" name="hkl_engine_e6c_hkl_new ()" link="hkl-hkl-pseudoaxis-e6c.html#hkl-engine-e6c-hkl-new"/>
+    <keyword type="function" name="hkl_engine_e6c_psi_new ()" link="hkl-hkl-pseudoaxis-e6c.html#hkl-engine-e6c-psi-new"/>
+    <keyword type="struct" name="struct HklDetector" link="hkl-hkl-detector.html#HklDetector"/>
     <keyword type="function" name="hkl_detector_new ()" link="hkl-hkl-detector.html#hkl-detector-new"/>
     <keyword type="function" name="hkl_detector_new_copy ()" link="hkl-hkl-detector.html#hkl-detector-new-copy"/>
-    <keyword type="function" name="hkl_detector_free ()" link="hkl-hkl-detector.html#hkl-detector-free"/>
     <keyword type="function" name="hkl_detector_attach_to_holder ()" link="hkl-hkl-detector.html#hkl-detector-attach-to-holder"/>
     <keyword type="function" name="hkl_detector_compute_kf ()" link="hkl-hkl-detector.html#hkl-detector-compute-kf"/>
-    <keyword type="struct" name="HklInterval" link="hkl-hkl-interval.html#HklInterval"/>
+    <keyword type="struct" name="struct HklInterval" link="hkl-hkl-interval.html#HklInterval"/>
     <keyword type="function" name="hkl_interval_cmp ()" link="hkl-hkl-interval.html#hkl-interval-cmp"/>
     <keyword type="function" name="hkl_interval_plus_interval ()" link="hkl-hkl-interval.html#hkl-interval-plus-interval"/>
     <keyword type="function" name="hkl_interval_plus_double ()" link="hkl-hkl-interval.html#hkl-interval-plus-double"/>
@@ -66,7 +66,6 @@
     <keyword type="function" name="hkl_interval_atan ()" link="hkl-hkl-interval.html#hkl-interval-atan"/>
     <keyword type="function" name="hkl_interval_length ()" link="hkl-hkl-interval.html#hkl-interval-length"/>
     <keyword type="function" name="hkl_interval_angle_restrict_symm ()" link="hkl-hkl-interval.html#hkl-interval-angle-restrict-symm"/>
-    <keyword type="function" name="hkl_detector_factory_new ()" link="hkl-hkl-detector-factory.html#hkl-detector-factory-new"/>
     <keyword type="struct" name="HklQuaternion" link="hkl-hkl-quaternion.html#HklQuaternion"/>
     <keyword type="function" name="hkl_quaternion_init ()" link="hkl-hkl-quaternion.html#hkl-quaternion-init"/>
     <keyword type="function" name="hkl_quaternion_init_from_vector ()" link="hkl-hkl-quaternion.html#hkl-quaternion-init-from-vector"/>
@@ -79,9 +78,9 @@
     <keyword type="function" name="hkl_quaternion_conjugate ()" link="hkl-hkl-quaternion.html#hkl-quaternion-conjugate"/>
     <keyword type="function" name="hkl_quaternion_to_matrix ()" link="hkl-hkl-quaternion.html#hkl-quaternion-to-matrix"/>
     <keyword type="function" name="hkl_quaternion_to_angle_and_axe ()" link="hkl-hkl-quaternion.html#hkl-quaternion-to-angle-and-axe"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_k4cv_hkl_new ()" link="hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-hkl-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_k4cv_psi_new ()" link="hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-psi-new"/>
-    <keyword type="struct" name="HklError" link="hkl-hkl-error.html#HklError"/>
+    <keyword type="function" name="hkl_engine_k4cv_hkl_new ()" link="hkl-hkl-pseudoaxis-k4cv.html#hkl-engine-k4cv-hkl-new"/>
+    <keyword type="function" name="hkl_engine_k4cv_psi_new ()" link="hkl-hkl-pseudoaxis-k4cv.html#hkl-engine-k4cv-psi-new"/>
+    <keyword type="struct" name="struct HklError" link="hkl-hkl-error.html#HklError"/>
     <keyword type="function" name="hkl_error_new ()" link="hkl-hkl-error.html#hkl-error-new"/>
     <keyword type="function" name="hkl_error_new_literal ()" link="hkl-hkl-error.html#hkl-error-new-literal"/>
     <keyword type="function" name="hkl_error_new_valist ()" link="hkl-hkl-error.html#hkl-error-new-valist" since="2.22"/>
@@ -91,75 +90,37 @@
     <keyword type="function" name="hkl_error_set_literal ()" link="hkl-hkl-error.html#hkl-error-set-literal" since="2.18"/>
     <keyword type="function" name="hkl_error_propagate ()" link="hkl-hkl-error.html#hkl-error-propagate"/>
     <keyword type="function" name="hkl_error_clear ()" link="hkl-hkl-error.html#hkl-error-clear"/>
-    <keyword type="function" name="hkl_error_prefix ()" link="hkl-hkl-error.html#hkl-error-prefix"/>
-    <keyword type="function" name="hkl_error_propagate_prefixed ()" link="hkl-hkl-error.html#hkl-error-propagate-prefixed"/>
-    <keyword type="struct" name="HklParameter" link="hkl-hkl-parameter.html#HklParameter"/>
+    <keyword type="function" name="hkl_error_prefix ()" link="hkl-hkl-error.html#hkl-error-prefix" since="2.16"/>
+    <keyword type="function" name="hkl_error_propagate_prefixed ()" link="hkl-hkl-error.html#hkl-error-propagate-prefixed" since="2.16"/>
+    <keyword type="struct" name="struct HklParameter" link="hkl-hkl-parameter.html#HklParameter"/>
     <keyword type="function" name="hkl_parameter_new ()" link="hkl-hkl-parameter.html#hkl-parameter-new"/>
-    <keyword type="function" name="hkl_parameter_new_copy ()" link="hkl-hkl-parameter.html#hkl-parameter-new-copy"/>
-    <keyword type="function" name="hkl_parameter_init ()" link="hkl-hkl-parameter.html#hkl-parameter-init"/>
-    <keyword type="function" name="hkl_parameter_free ()" link="hkl-hkl-parameter.html#hkl-parameter-free"/>
-    <keyword type="function" name="hkl_parameter_set_value ()" link="hkl-hkl-parameter.html#hkl-parameter-set-value"/>
-    <keyword type="function" name="hkl_parameter_get_value_unit ()" link="hkl-hkl-parameter.html#hkl-parameter-get-value-unit"/>
-    <keyword type="function" name="hkl_parameter_set_value_unit ()" link="hkl-hkl-parameter.html#hkl-parameter-set-value-unit"/>
-    <keyword type="function" name="hkl_parameter_get_max ()" link="hkl-hkl-parameter.html#hkl-parameter-get-max"/>
-    <keyword type="function" name="hkl_parameter_get_range_unit ()" link="hkl-hkl-parameter.html#hkl-parameter-get-range-unit"/>
-    <keyword type="function" name="hkl_parameter_set_range ()" link="hkl-hkl-parameter.html#hkl-parameter-set-range"/>
-    <keyword type="function" name="hkl_parameter_set_range_unit ()" link="hkl-hkl-parameter.html#hkl-parameter-set-range-unit"/>
-    <keyword type="function" name="hkl_parameter_randomize ()" link="hkl-hkl-parameter.html#hkl-parameter-randomize"/>
     <keyword type="function" name="hkl_parameter_is_valid ()" link="hkl-hkl-parameter.html#hkl-parameter-is-valid"/>
     <keyword type="function" name="hkl_parameter_fprintf ()" link="hkl-hkl-parameter.html#hkl-parameter-fprintf"/>
-    <keyword type="struct" name="HklPseudoAxis" link="hkl-hkl-pseudoaxis.html#HklPseudoAxis"/>
-    <keyword type="struct" name="HklPseudoAxisEngineMode" link="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode"/>
-    <keyword type="struct" name="HklPseudoAxisEngine" link="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine"/>
-    <keyword type="struct" name="HklPseudoAxisEngineList" link="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList"/>
-    <keyword type="function" name="HklPseudoAxisEngineModeFunc ()" link="hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc"/>
-    <keyword type="function" name="HklFunction ()" link="hkl-hkl-pseudoaxis.html#HklFunction"/>
-    <keyword type="function" name="hkl_pseudo_axis_new ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_init ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-init"/>
-    <keyword type="function" name="hkl_pseudo_axis_free ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-free"/>
-    <keyword type="function" name="hkl_pseudo_axis_fprintf ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-fprintf"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_mode_new ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_mode_init ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-init"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_mode_free ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-free"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_new ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_free ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-free"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_add_mode ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-mode"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_add_geometry ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-geometry"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_select_mode ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-select-mode"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_initialize ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-initialize"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_set ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-set"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_get ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-get"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_fprintf ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-fprintf"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_new ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_free ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-free"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_add ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-add"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_get_by_name ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-by-name"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-pseudo-axis-by-name"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_clear ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-clear"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_init ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-init"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_get ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_fprintf ()" link="hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-fprintf"/>
-    <keyword type="struct" name="HklHolder" link="hkl-hkl-geometry.html#HklHolder"/>
-    <keyword type="struct" name="HklGeometryConfig" link="hkl-hkl-geometry.html#HklGeometryConfig"/>
-    <keyword type="struct" name="HklGeometry" link="hkl-hkl-geometry.html#HklGeometry"/>
-    <keyword type="struct" name="HklGeometryList" link="hkl-hkl-geometry.html#HklGeometryList"/>
-    <keyword type="struct" name="HklGeometryListItem" link="hkl-hkl-geometry.html#HklGeometryListItem"/>
+    <keyword type="struct" name="struct HklPseudoAxis" link="hkl-hkl-pseudoaxis.html#HklPseudoAxis"/>
+    <keyword type="struct" name="struct HklMode" link="hkl-hkl-pseudoaxis.html#HklMode"/>
+    <keyword type="struct" name="struct HklEngine" link="hkl-hkl-pseudoaxis.html#HklEngine"/>
+    <keyword type="struct" name="struct HklEngineList" link="hkl-hkl-pseudoaxis.html#HklEngineList"/>
+    <keyword type="struct" name="struct HklFunction" link="hkl-hkl-pseudoaxis.html#HklFunction"/>
+    <keyword type="function" name="hkl_engine_list_new ()" link="hkl-hkl-pseudoaxis.html#hkl-engine-list-new"/>
+    <keyword type="function" name="hkl_engine_list_add ()" link="hkl-hkl-pseudoaxis.html#hkl-engine-list-add"/>
+    <keyword type="function" name="hkl_engine_list_clear ()" link="hkl-hkl-pseudoaxis.html#hkl-engine-list-clear"/>
+    <keyword type="struct" name="struct HklHolder" link="hkl-hkl-geometry.html#HklHolder"/>
+    <keyword type="struct" name="struct HklGeometry" link="hkl-hkl-geometry.html#HklGeometry"/>
+    <keyword type="struct" name="struct HklGeometryList" link="hkl-hkl-geometry.html#HklGeometryList"/>
+    <keyword type="struct" name="struct HklGeometryListItem" link="hkl-hkl-geometry.html#HklGeometryListItem"/>
     <keyword type="function" name="HklGeometryListMultiplyFunction ()" link="hkl-hkl-geometry.html#HklGeometryListMultiplyFunction"/>
     <keyword type="function" name="hkl_holder_add_rotation_axis ()" link="hkl-hkl-geometry.html#hkl-holder-add-rotation-axis"/>
     <keyword type="function" name="hkl_geometry_new ()" link="hkl-hkl-geometry.html#hkl-geometry-new"/>
     <keyword type="function" name="hkl_geometry_new_copy ()" link="hkl-hkl-geometry.html#hkl-geometry-new-copy"/>
-    <keyword type="function" name="hkl_geometry_free ()" link="hkl-hkl-geometry.html#hkl-geometry-free"/>
     <keyword type="function" name="hkl_geometry_init_geometry ()" link="hkl-hkl-geometry.html#hkl-geometry-init-geometry"/>
     <keyword type="function" name="hkl_geometry_add_holder ()" link="hkl-hkl-geometry.html#hkl-geometry-add-holder"/>
     <keyword type="function" name="hkl_geometry_update ()" link="hkl-hkl-geometry.html#hkl-geometry-update"/>
     <keyword type="function" name="hkl_geometry_get_axis_by_name ()" link="hkl-hkl-geometry.html#hkl-geometry-get-axis-by-name"/>
-    <keyword type="function" name="hkl_geometry_randomize ()" link="hkl-hkl-geometry.html#hkl-geometry-randomize"/>
     <keyword type="function" name="hkl_geometry_set_values_v ()" link="hkl-hkl-geometry.html#hkl-geometry-set-values-v"/>
     <keyword type="function" name="hkl_geometry_distance ()" link="hkl-hkl-geometry.html#hkl-geometry-distance"/>
     <keyword type="function" name="hkl_geometry_distance_orthodromic ()" link="hkl-hkl-geometry.html#hkl-geometry-distance-orthodromic"/>
     <keyword type="function" name="hkl_geometry_closest_from_geometry_with_range ()" link="hkl-hkl-geometry.html#hkl-geometry-closest-from-geometry-with-range"/>
     <keyword type="function" name="hkl_geometry_is_valid ()" link="hkl-hkl-geometry.html#hkl-geometry-is-valid"/>
-    <keyword type="function" name="hkl_geometry_fprintf ()" link="hkl-hkl-geometry.html#hkl-geometry-fprintf"/>
     <keyword type="function" name="hkl_geometry_list_new ()" link="hkl-hkl-geometry.html#hkl-geometry-list-new"/>
     <keyword type="function" name="hkl_geometry_list_free ()" link="hkl-hkl-geometry.html#hkl-geometry-list-free"/>
     <keyword type="function" name="hkl_geometry_list_add ()" link="hkl-hkl-geometry.html#hkl-geometry-list-add"/>
@@ -169,33 +130,8 @@
     <keyword type="function" name="hkl_geometry_list_multiply ()" link="hkl-hkl-geometry.html#hkl-geometry-list-multiply"/>
     <keyword type="function" name="hkl_geometry_list_multiply_from_range ()" link="hkl-hkl-geometry.html#hkl-geometry-list-multiply-from-range"/>
     <keyword type="function" name="hkl_geometry_list_remove_invalid ()" link="hkl-hkl-geometry.html#hkl-geometry-list-remove-invalid"/>
-    <keyword type="function" name="hkl_geometry_list_len ()" link="hkl-hkl-geometry.html#hkl-geometry-list-len"/>
-    <keyword type="function" name="hkl_geometry_list_is_empty ()" link="hkl-hkl-geometry.html#hkl-geometry-list-is-empty"/>
     <keyword type="function" name="hkl_geometry_list_item_new ()" link="hkl-hkl-geometry.html#hkl-geometry-list-item-new"/>
     <keyword type="function" name="hkl_geometry_list_item_free ()" link="hkl-hkl-geometry.html#hkl-geometry-list-item-free"/>
-    <keyword type="function" name="hkl_geometry_factory_get_config_from_type ()" link="hkl-hkl-geometry-factory.html#hkl-geometry-factory-get-config-from-type"/>
-    <keyword type="function" name="hkl_geometry_factory_new ()" link="hkl-hkl-geometry-factory.html#hkl-geometry-factory-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_mode_set_real ()" link="hkl-hkl-pseudoaxis-auto.html#hkl-pseudo-axis-engine-mode-set-real"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_e4cv_hkl_new ()" link="hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-hkl-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_e4cv_psi_new ()" link="hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-psi-new"/>
-    <keyword type="macro" name="HKL_BEGIN_DECLS" link="hkl-hkl-macros.html#HKL-BEGIN-DECLS:CAPS"/>
-    <keyword type="macro" name="HKL_END_DECLS" link="hkl-hkl-macros.html#HKL-END-DECLS:CAPS"/>
-    <keyword type="macro" name="INFINITY" link="hkl-hkl-macros.html#INFINITY:CAPS"/>
-    <keyword type="macro" name="M_PI" link="hkl-hkl-macros.html#M-PI:CAPS"/>
-    <keyword type="macro" name="M_PI_2" link="hkl-hkl-macros.html#M-PI-2:CAPS"/>
-    <keyword type="macro" name="HKL_MAJOR" link="hkl-hkl-macros.html#HKL-MAJOR:CAPS"/>
-    <keyword type="macro" name="HKL_MINOR" link="hkl-hkl-macros.html#HKL-MINOR:CAPS"/>
-    <keyword type="macro" name="HKL_PATCH" link="hkl-hkl-macros.html#HKL-PATCH:CAPS"/>
-    <keyword type="macro" name="HKL_VERSION" link="hkl-hkl-macros.html#HKL-VERSION:CAPS"/>
-    <keyword type="macro" name="HKL_TRUE" link="hkl-hkl-macros.html#HKL-TRUE:CAPS"/>
-    <keyword type="macro" name="HKL_FALSE" link="hkl-hkl-macros.html#HKL-FALSE:CAPS"/>
-    <keyword type="macro" name="HKL_SUCCESS" link="hkl-hkl-macros.html#HKL-SUCCESS:CAPS"/>
-    <keyword type="macro" name="HKL_FAIL" link="hkl-hkl-macros.html#HKL-FAIL:CAPS"/>
-    <keyword type="macro" name="HKL_TINY" link="hkl-hkl-macros.html#HKL-TINY:CAPS"/>
-    <keyword type="macro" name="HKL_EPSILON" link="hkl-hkl-macros.html#HKL-EPSILON:CAPS"/>
-    <keyword type="macro" name="HKL_DEGTORAD" link="hkl-hkl-macros.html#HKL-DEGTORAD:CAPS"/>
-    <keyword type="macro" name="HKL_RADTODEG" link="hkl-hkl-macros.html#HKL-RADTODEG:CAPS"/>
-    <keyword type="macro" name="HKL_TAU" link="hkl-hkl-macros.html#HKL-TAU:CAPS"/>
     <keyword type="macro" name="HKL_EULERIAN_KAPPA_SOLUTION" link="hkl-hkl-macros.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS"/>
     <keyword type="macro" name="hkl_assert()" link="hkl-hkl-macros.html#hkl-assert"/>
     <keyword type="macro" name="G_GNUC_PRINTF()" link="hkl-hkl-macros.html#G-GNUC-PRINTF:CAPS"/>
@@ -204,129 +140,47 @@
     <keyword type="macro" name="NORETURN" link="hkl-hkl-macros.html#NORETURN:CAPS"/>
     <keyword type="function" name="hkl_printbt ()" link="hkl-hkl-macros.html#hkl-printbt"/>
     <keyword type="macro" name="HKL_MALLOC()" link="hkl-hkl-macros.html#HKL-MALLOC:CAPS"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_k6c_hkl_new ()" link="hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-hkl-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_k6c_psi_new ()" link="hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-psi-new"/>
+    <keyword type="function" name="hkl_engine_k6c_hkl_new ()" link="hkl-hkl-pseudoaxis-k6c.html#hkl-engine-k6c-hkl-new"/>
+    <keyword type="function" name="hkl_engine_k6c_psi_new ()" link="hkl-hkl-pseudoaxis-k6c.html#hkl-engine-k6c-psi-new"/>
     <keyword type="macro" name="HKL_SOURCE_DEFAULT_WAVE_LENGTH" link="hkl-hkl-source.html#HKL-SOURCE-DEFAULT-WAVE-LENGTH:CAPS"/>
-    <keyword type="struct" name="HklSource" link="hkl-hkl-source.html#HklSource"/>
+    <keyword type="struct" name="struct HklSource" link="hkl-hkl-source.html#HklSource"/>
     <keyword type="function" name="hkl_source_init ()" link="hkl-hkl-source.html#hkl-source-init"/>
     <keyword type="function" name="hkl_source_cmp ()" link="hkl-hkl-source.html#hkl-source-cmp"/>
     <keyword type="function" name="hkl_source_compute_ki ()" link="hkl-hkl-source.html#hkl-source-compute-ki"/>
     <keyword type="function" name="hkl_source_get_wavelength ()" link="hkl-hkl-source.html#hkl-source-get-wavelength"/>
     <keyword type="function" name="hkl_source_fprintf ()" link="hkl-hkl-source.html#hkl-source-fprintf"/>
-    <keyword type="struct" name="HklUnit" link="hkl-hkl-unit.html#HklUnit"/>
+    <keyword type="struct" name="struct HklUnit" link="hkl-hkl-unit.html#HklUnit"/>
     <keyword type="function" name="hkl_unit_compatible ()" link="hkl-hkl-unit.html#hkl-unit-compatible"/>
     <keyword type="function" name="hkl_unit_factor ()" link="hkl-hkl-unit.html#hkl-unit-factor"/>
-    <keyword type="function" name="RUBh_minus_Q_func ()" link="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q-func"/>
-    <keyword type="function" name="double_diffraction_func ()" link="hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction-func"/>
-    <keyword type="function" name="psi_constant_vertical_func ()" link="hkl-hkl-pseudoaxis-common-hkl.html#psi-constant-vertical-func"/>
     <keyword type="function" name="RUBh_minus_Q ()" link="hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q"/>
-    <keyword type="function" name="double_diffraction ()" link="hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_mode_get_hkl_real ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-get-hkl-real"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-init-psi-constant-vertical-real"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_hkl_new ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-hkl-new"/>
-    <keyword type="struct" name="HklMatrix" link="hkl-hkl-matrix.html#HklMatrix"/>
-    <keyword type="function" name="hkl_matrix_init ()" link="hkl-hkl-matrix.html#hkl-matrix-init"/>
+    <keyword type="function" name="hkl_mode_get_hkl_real ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-mode-get-hkl-real"/>
+    <keyword type="function" name="hkl_mode_init_psi_constant_vertical_real ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-mode-init-psi-constant-vertical-real"/>
+    <keyword type="function" name="hkl_engine_hkl_new ()" link="hkl-hkl-pseudoaxis-common-hkl.html#hkl-engine-hkl-new"/>
+    <keyword type="struct" name="struct HklMatrix" link="hkl-hkl-matrix.html#HklMatrix"/>
     <keyword type="function" name="hkl_matrix_init_from_two_vector ()" link="hkl-hkl-matrix.html#hkl-matrix-init-from-two-vector"/>
     <keyword type="function" name="hkl_matrix_init_from_euler ()" link="hkl-hkl-matrix.html#hkl-matrix-init-from-euler"/>
     <keyword type="function" name="hkl_matrix_fprintf ()" link="hkl-hkl-matrix.html#hkl-matrix-fprintf"/>
     <keyword type="function" name="hkl_matrix_to_euler ()" link="hkl-hkl-matrix.html#hkl-matrix-to-euler"/>
-    <keyword type="function" name="hkl_matrix_cmp ()" link="hkl-hkl-matrix.html#hkl-matrix-cmp"/>
-    <keyword type="function" name="hkl_matrix_times_matrix ()" link="hkl-hkl-matrix.html#hkl-matrix-times-matrix"/>
     <keyword type="function" name="hkl_matrix_times_vector ()" link="hkl-hkl-matrix.html#hkl-matrix-times-vector"/>
     <keyword type="function" name="hkl_matrix_transpose ()" link="hkl-hkl-matrix.html#hkl-matrix-transpose"/>
     <keyword type="function" name="hkl_matrix_det ()" link="hkl-hkl-matrix.html#hkl-matrix-det"/>
     <keyword type="function" name="hkl_matrix_solve ()" link="hkl-hkl-matrix.html#hkl-matrix-solve"/>
     <keyword type="function" name="hkl_matrix_is_null ()" link="hkl-hkl-matrix.html#hkl-matrix-is-null"/>
-    <keyword type="macro" name="HKL_LIST_LEN()" link="hkl-hkl-list.html#HKL-LIST-LEN:CAPS"/>
-    <keyword type="macro" name="HKL_LIST()" link="hkl-hkl-list.html#HKL-LIST:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_INIT()" link="hkl-hkl-list.html#HKL-LIST-INIT:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_ALLOC()" link="hkl-hkl-list.html#HKL-LIST-ALLOC:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_COPY()" link="hkl-hkl-list.html#HKL-LIST-COPY:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_FREE()" link="hkl-hkl-list.html#HKL-LIST-FREE:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_FREE_DESTRUCTOR()" link="hkl-hkl-list.html#HKL-LIST-FREE-DESTRUCTOR:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_RESIZE()" link="hkl-hkl-list.html#HKL-LIST-RESIZE:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_ADD_VALUE()" link="hkl-hkl-list.html#HKL-LIST-ADD-VALUE:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_DEL()" link="hkl-hkl-list.html#HKL-LIST-DEL:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_DEL_DESTRUCTOR()" link="hkl-hkl-list.html#HKL-LIST-DEL-DESTRUCTOR:CAPS"/>
-    <keyword type="macro" name="HKL_LIST_DEL_ITEM_DESTRUCTOR()" link="hkl-hkl-list.html#HKL-LIST-DEL-ITEM-DESTRUCTOR:CAPS"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_init_func ()" link="hkl-hkl-pseudoaxis-common.html#hkl-pseudo-axis-engine-init-func"/>
-    <keyword type="struct" name="HklSample" link="hkl-hkl-sample.html#HklSample"/>
-    <keyword type="struct" name="HklSampleReflection" link="hkl-hkl-sample.html#HklSampleReflection"/>
-    <keyword type="struct" name="HklSampleList" link="hkl-hkl-sample.html#HklSampleList"/>
-    <keyword type="enum" name="enum HklSampleType" link="hkl-hkl-sample.html#HklSampleType"/>
-    <keyword type="function" name="hkl_sample_new ()" link="hkl-hkl-sample.html#hkl-sample-new"/>
-    <keyword type="function" name="hkl_sample_new_copy ()" link="hkl-hkl-sample.html#hkl-sample-new-copy"/>
-    <keyword type="function" name="hkl_sample_free ()" link="hkl-hkl-sample.html#hkl-sample-free"/>
-    <keyword type="function" name="hkl_sample_set_name ()" link="hkl-hkl-sample.html#hkl-sample-set-name"/>
-    <keyword type="function" name="hkl_sample_set_lattice ()" link="hkl-hkl-sample.html#hkl-sample-set-lattice"/>
-    <keyword type="function" name="hkl_sample_set_U_from_euler ()" link="hkl-hkl-sample.html#hkl-sample-set-U-from-euler"/>
-    <keyword type="function" name="hkl_sample_get_UB ()" link="hkl-hkl-sample.html#hkl-sample-get-UB"/>
-    <keyword type="function" name="hkl_sample_set_UB ()" link="hkl-hkl-sample.html#hkl-sample-set-UB"/>
-    <keyword type="function" name="hkl_sample_add_reflection ()" link="hkl-hkl-sample.html#hkl-sample-add-reflection"/>
-    <keyword type="function" name="hkl_sample_get_ith_reflection ()" link="hkl-hkl-sample.html#hkl-sample-get-ith-reflection"/>
-    <keyword type="function" name="hkl_sample_del_reflection ()" link="hkl-hkl-sample.html#hkl-sample-del-reflection"/>
-    <keyword type="function" name="hkl_sample_compute_UB_busing_levy ()" link="hkl-hkl-sample.html#hkl-sample-compute-UB-busing-levy"/>
-    <keyword type="function" name="hkl_sample_affine ()" link="hkl-hkl-sample.html#hkl-sample-affine"/>
-    <keyword type="function" name="hkl_sample_get_reflection_mesured_angle ()" link="hkl-hkl-sample.html#hkl-sample-get-reflection-mesured-angle"/>
-    <keyword type="function" name="hkl_sample_get_reflection_theoretical_angle ()" link="hkl-hkl-sample.html#hkl-sample-get-reflection-theoretical-angle"/>
+    <keyword type="struct" name="struct HklSample" link="hkl-hkl-sample.html#HklSample"/>
+    <keyword type="struct" name="struct HklSampleReflection" link="hkl-hkl-sample.html#HklSampleReflection"/>
     <keyword type="function" name="hkl_sample_fprintf ()" link="hkl-hkl-sample.html#hkl-sample-fprintf"/>
-    <keyword type="function" name="hkl_sample_reflection_set_hkl ()" link="hkl-hkl-sample.html#hkl-sample-reflection-set-hkl"/>
-    <keyword type="function" name="hkl_sample_reflection_set_flag ()" link="hkl-hkl-sample.html#hkl-sample-reflection-set-flag"/>
-    <keyword type="function" name="hkl_sample_reflection_set_geometry ()" link="hkl-hkl-sample.html#hkl-sample-reflection-set-geometry"/>
-    <keyword type="function" name="hkl_sample_list_new ()" link="hkl-hkl-sample.html#hkl-sample-list-new"/>
-    <keyword type="function" name="hkl_sample_list_free ()" link="hkl-hkl-sample.html#hkl-sample-list-free"/>
-    <keyword type="function" name="hkl_sample_list_append ()" link="hkl-hkl-sample.html#hkl-sample-list-append"/>
-    <keyword type="function" name="hkl_sample_list_clear ()" link="hkl-hkl-sample.html#hkl-sample-list-clear"/>
-    <keyword type="function" name="hkl_sample_list_del ()" link="hkl-hkl-sample.html#hkl-sample-list-del"/>
-    <keyword type="function" name="hkl_sample_list_len ()" link="hkl-hkl-sample.html#hkl-sample-list-len"/>
-    <keyword type="function" name="hkl_sample_list_get_ith ()" link="hkl-hkl-sample.html#hkl-sample-list-get-ith"/>
-    <keyword type="function" name="hkl_sample_list_get_by_name ()" link="hkl-hkl-sample.html#hkl-sample-list-get-by-name"/>
-    <keyword type="function" name="hkl_sample_list_get_idx_from_name ()" link="hkl-hkl-sample.html#hkl-sample-list-get-idx-from-name"/>
-    <keyword type="function" name="hkl_sample_list_select_current ()" link="hkl-hkl-sample.html#hkl-sample-list-select-current"/>
-    <keyword type="function" name="hkl_sample_list_fprintf ()" link="hkl-hkl-sample.html#hkl-sample-list-fprintf"/>
-    <keyword type="struct" name="HklAxis" link="hkl-hkl-axis.html#HklAxis"/>
-    <keyword type="function" name="hkl_axis_new ()" link="hkl-hkl-axis.html#hkl-axis-new"/>
-    <keyword type="function" name="hkl_axis_free ()" link="hkl-hkl-axis.html#hkl-axis-free"/>
-    <keyword type="function" name="hkl_axis_init ()" link="hkl-hkl-axis.html#hkl-axis-init"/>
-    <keyword type="function" name="hkl_axis_get_name ()" link="hkl-hkl-axis.html#hkl-axis-get-name"/>
-    <keyword type="function" name="hkl_axis_get_changed ()" link="hkl-hkl-axis.html#hkl-axis-get-changed"/>
-    <keyword type="function" name="hkl_axis_set_changed ()" link="hkl-hkl-axis.html#hkl-axis-set-changed"/>
-    <keyword type="function" name="hkl_axis_get_value ()" link="hkl-hkl-axis.html#hkl-axis-get-value"/>
-    <keyword type="function" name="hkl_axis_get_value_unit ()" link="hkl-hkl-axis.html#hkl-axis-get-value-unit"/>
-    <keyword type="function" name="hkl_axis_get_value_closest ()" link="hkl-hkl-axis.html#hkl-axis-get-value-closest"/>
-    <keyword type="function" name="hkl_axis_get_value_closest_unit ()" link="hkl-hkl-axis.html#hkl-axis-get-value-closest-unit"/>
-    <keyword type="function" name="hkl_axis_get_max ()" link="hkl-hkl-axis.html#hkl-axis-get-max"/>
-    <keyword type="function" name="hkl_axis_get_range_unit ()" link="hkl-hkl-axis.html#hkl-axis-get-range-unit"/>
-    <keyword type="function" name="hkl_axis_set_value ()" link="hkl-hkl-axis.html#hkl-axis-set-value"/>
-    <keyword type="function" name="hkl_axis_set_value_smallest_in_range ()" link="hkl-hkl-axis.html#hkl-axis-set-value-smallest-in-range"/>
-    <keyword type="function" name="hkl_axis_set_value_unit ()" link="hkl-hkl-axis.html#hkl-axis-set-value-unit"/>
-    <keyword type="function" name="hkl_axis_set_range ()" link="hkl-hkl-axis.html#hkl-axis-set-range"/>
-    <keyword type="function" name="hkl_axis_set_range_unit ()" link="hkl-hkl-axis.html#hkl-axis-set-range-unit"/>
-    <keyword type="function" name="hkl_axis_randomize ()" link="hkl-hkl-axis.html#hkl-axis-randomize"/>
-    <keyword type="function" name="hkl_axis_get_quaternion ()" link="hkl-hkl-axis.html#hkl-axis-get-quaternion"/>
-    <keyword type="function" name="hkl_axis_is_value_compatible_with_range ()" link="hkl-hkl-axis.html#hkl-axis-is-value-compatible-with-range"/>
-    <keyword type="function" name="hkl_axis_is_valid ()" link="hkl-hkl-axis.html#hkl-axis-is-valid"/>
-    <keyword type="function" name="hkl_axis_fprintf ()" link="hkl-hkl-axis.html#hkl-axis-fprintf"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_list_factory ()" link="hkl-hkl-pseudoaxis-factory.html#hkl-pseudo-axis-engine-list-factory"/>
-    <keyword type="struct" name="HklPseudoAxisEngineModePsi" link="hkl-hkl-pseudoaxis-common-psi.html#HklPseudoAxisEngineModePsi"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_mode_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-mode-psi-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-psi-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_q_new ()" link="hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q-new"/>
-    <keyword type="function" name="hkl_pseudo_axis_engine_q2_new ()" link="hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q2-new"/>
-    <keyword type="struct" name="HklLattice" link="hkl-hkl-lattice.html#HklLattice"/>
-    <keyword type="function" name="hkl_lattice_new ()" link="hkl-hkl-lattice.html#hkl-lattice-new"/>
-    <keyword type="function" name="hkl_lattice_new_copy ()" link="hkl-hkl-lattice.html#hkl-lattice-new-copy"/>
-    <keyword type="function" name="hkl_lattice_new_default ()" link="hkl-hkl-lattice.html#hkl-lattice-new-default"/>
-    <keyword type="function" name="hkl_lattice_free ()" link="hkl-hkl-lattice.html#hkl-lattice-free"/>
-    <keyword type="function" name="hkl_lattice_set ()" link="hkl-hkl-lattice.html#hkl-lattice-set"/>
-    <keyword type="function" name="hkl_lattice_get_B ()" link="hkl-hkl-lattice.html#hkl-lattice-get-B"/>
-    <keyword type="function" name="hkl_lattice_get_1_B ()" link="hkl-hkl-lattice.html#hkl-lattice-get-1-B"/>
-    <keyword type="function" name="hkl_lattice_reciprocal ()" link="hkl-hkl-lattice.html#hkl-lattice-reciprocal"/>
+    <keyword type="struct" name="struct HklAxis" link="hkl-hkl-axis.html#HklAxis"/>
+    <keyword type="struct" name="struct HklModePsi" link="hkl-hkl-pseudoaxis-common-psi.html#HklModePsi"/>
+    <keyword type="function" name="hkl_mode_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi.html#hkl-mode-psi-new"/>
+    <keyword type="function" name="hkl_engine_psi_new ()" link="hkl-hkl-pseudoaxis-common-psi.html#hkl-engine-psi-new"/>
+    <keyword type="function" name="hkl_engine_q_new ()" link="hkl-hkl-pseudoaxis-common-q.html#hkl-engine-q-new"/>
+    <keyword type="function" name="hkl_engine_q2_new ()" link="hkl-hkl-pseudoaxis-common-q.html#hkl-engine-q2-new"/>
+    <keyword type="struct" name="struct HklLattice" link="hkl-hkl-lattice.html#HklLattice"/>
     <keyword type="function" name="hkl_lattice_randomize ()" link="hkl-hkl-lattice.html#hkl-lattice-randomize"/>
     <keyword type="function" name="hkl_lattice_fprintf ()" link="hkl-hkl-lattice.html#hkl-lattice-fprintf"/>
-    <keyword type="struct" name="HklMatrix" link="hkl-hkl-vector.html#HklMatrix"/>
+    <keyword type="struct" name="struct HklMatrix" link="hkl-hkl-vector.html#HklMatrix"/>
     <keyword type="struct" name="HklQuaternion" link="hkl-hkl-vector.html#HklQuaternion"/>
-    <keyword type="struct" name="HklVector" link="hkl-hkl-vector.html#HklVector"/>
+    <keyword type="struct" name="struct HklVector" link="hkl-hkl-vector.html#HklVector"/>
     <keyword type="function" name="hkl_vector_init ()" link="hkl-hkl-vector.html#hkl-vector-init"/>
     <keyword type="function" name="hkl_vector_fprintf ()" link="hkl-hkl-vector.html#hkl-vector-fprintf"/>
     <keyword type="function" name="hkl_vector_cmp ()" link="hkl-hkl-vector.html#hkl-vector-cmp"/>
diff --git a/Documentation/api/html/index.html b/Documentation/api/html/index.html
index 2a33fc9..51a7845 100644
--- a/Documentation/api/html/index.html
+++ b/Documentation/api/html/index.html
@@ -3,14 +3,14 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>hkl Reference Manual</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="next" href="ch01.html" title="[Insert title here]">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<div class="book" title="hkl Reference Manual">
+<div class="book">
 <div class="titlepage">
 <div>
 <div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">hkl Reference Manual</p></th></tr></table></div>
@@ -22,7 +22,7 @@
 </div>
 <hr>
 </div>
-<div class="toc"><dl>
+<div class="toc"><dl class="toc">
 <dt><span class="chapter"><a href="ch01.html">[Insert title here]</a></span></dt>
 <dd><dl>
 <dt>
@@ -118,10 +118,11 @@
 </dl></dd>
 <dt><span class="chapter"><a href="object-tree.html">Object Hierarchy</a></span></dt>
 <dt><span class="index"><a href="api-index-full.html">API Index</a></span></dt>
+<dt><span class="glossary"><a href="annotation-glossary.html">Annotation Glossary</a></span></dt>
 </dl></div>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/index.sgml b/Documentation/api/html/index.sgml
index f6aef2d..0745fe4 100644
--- a/Documentation/api/html/index.sgml
+++ b/Documentation/api/html/index.sgml
@@ -3,18 +3,18 @@
 <ANCHOR id="hkl-hkl-pseudoaxis-zaxis.synopsis" href="hkl/hkl-hkl-pseudoaxis-zaxis.html#hkl-hkl-pseudoaxis-zaxis.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-zaxis.description" href="hkl/hkl-hkl-pseudoaxis-zaxis.html#hkl-hkl-pseudoaxis-zaxis.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-zaxis.details" href="hkl/hkl-hkl-pseudoaxis-zaxis.html#hkl-hkl-pseudoaxis-zaxis.details">
-<ANCHOR id="hkl-pseudo-axis-engine-zaxis-hkl-new" href="hkl/hkl-hkl-pseudoaxis-zaxis.html#hkl-pseudo-axis-engine-zaxis-hkl-new">
+<ANCHOR id="hkl-engine-zaxis-hkl-new" href="hkl/hkl-hkl-pseudoaxis-zaxis.html#hkl-engine-zaxis-hkl-new">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians" href="hkl/hkl-hkl-pseudoaxis-common-eulerians.html">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians.synopsis" href="hkl/hkl-hkl-pseudoaxis-common-eulerians.html#hkl-hkl-pseudoaxis-common-eulerians.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians.description" href="hkl/hkl-hkl-pseudoaxis-common-eulerians.html#hkl-hkl-pseudoaxis-common-eulerians.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-eulerians.details" href="hkl/hkl-hkl-pseudoaxis-common-eulerians.html#hkl-hkl-pseudoaxis-common-eulerians.details">
-<ANCHOR id="hkl-pseudo-axis-engine-eulerians-new" href="hkl/hkl-hkl-pseudoaxis-common-eulerians.html#hkl-pseudo-axis-engine-eulerians-new">
+<ANCHOR id="hkl-engine-eulerians-new" href="hkl/hkl-hkl-pseudoaxis-common-eulerians.html#hkl-engine-eulerians-new">
 <ANCHOR id="hkl-hkl-pseudoaxis-e6c" href="hkl/hkl-hkl-pseudoaxis-e6c.html">
 <ANCHOR id="hkl-hkl-pseudoaxis-e6c.synopsis" href="hkl/hkl-hkl-pseudoaxis-e6c.html#hkl-hkl-pseudoaxis-e6c.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-e6c.description" href="hkl/hkl-hkl-pseudoaxis-e6c.html#hkl-hkl-pseudoaxis-e6c.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-e6c.details" href="hkl/hkl-hkl-pseudoaxis-e6c.html#hkl-hkl-pseudoaxis-e6c.details">
-<ANCHOR id="hkl-pseudo-axis-engine-e6c-hkl-new" href="hkl/hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-hkl-new">
-<ANCHOR id="hkl-pseudo-axis-engine-e6c-psi-new" href="hkl/hkl-hkl-pseudoaxis-e6c.html#hkl-pseudo-axis-engine-e6c-psi-new">
+<ANCHOR id="hkl-engine-e6c-hkl-new" href="hkl/hkl-hkl-pseudoaxis-e6c.html#hkl-engine-e6c-hkl-new">
+<ANCHOR id="hkl-engine-e6c-psi-new" href="hkl/hkl-hkl-pseudoaxis-e6c.html#hkl-engine-e6c-psi-new">
 <ANCHOR id="hkl-hkl-detector" href="hkl/hkl-hkl-detector.html">
 <ANCHOR id="hkl-hkl-detector.synopsis" href="hkl/hkl-hkl-detector.html#hkl-hkl-detector.synopsis">
 <ANCHOR id="hkl-hkl-detector.description" href="hkl/hkl-hkl-detector.html#hkl-hkl-detector.description">
@@ -22,7 +22,6 @@
 <ANCHOR id="HklDetector" href="hkl/hkl-hkl-detector.html#HklDetector">
 <ANCHOR id="hkl-detector-new" href="hkl/hkl-hkl-detector.html#hkl-detector-new">
 <ANCHOR id="hkl-detector-new-copy" href="hkl/hkl-hkl-detector.html#hkl-detector-new-copy">
-<ANCHOR id="hkl-detector-free" href="hkl/hkl-hkl-detector.html#hkl-detector-free">
 <ANCHOR id="hkl-detector-attach-to-holder" href="hkl/hkl-hkl-detector.html#hkl-detector-attach-to-holder">
 <ANCHOR id="hkl-detector-compute-kf" href="hkl/hkl-hkl-detector.html#hkl-detector-compute-kf">
 <ANCHOR id="hkl-hkl-interval" href="hkl/hkl-hkl-interval.html">
@@ -51,7 +50,6 @@
 <ANCHOR id="hkl-hkl-detector-factory.synopsis" href="hkl/hkl-hkl-detector-factory.html#hkl-hkl-detector-factory.synopsis">
 <ANCHOR id="hkl-hkl-detector-factory.description" href="hkl/hkl-hkl-detector-factory.html#hkl-hkl-detector-factory.description">
 <ANCHOR id="hkl-hkl-detector-factory.details" href="hkl/hkl-hkl-detector-factory.html#hkl-hkl-detector-factory.details">
-<ANCHOR id="hkl-detector-factory-new" href="hkl/hkl-hkl-detector-factory.html#hkl-detector-factory-new">
 <ANCHOR id="hkl-hkl-quaternion" href="hkl/hkl-hkl-quaternion.html">
 <ANCHOR id="hkl-hkl-quaternion.synopsis" href="hkl/hkl-hkl-quaternion.html#hkl-hkl-quaternion.synopsis">
 <ANCHOR id="hkl-hkl-quaternion.description" href="hkl/hkl-hkl-quaternion.html#hkl-hkl-quaternion.description">
@@ -72,8 +70,8 @@
 <ANCHOR id="hkl-hkl-pseudoaxis-k4cv.synopsis" href="hkl/hkl-hkl-pseudoaxis-k4cv.html#hkl-hkl-pseudoaxis-k4cv.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-k4cv.description" href="hkl/hkl-hkl-pseudoaxis-k4cv.html#hkl-hkl-pseudoaxis-k4cv.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-k4cv.details" href="hkl/hkl-hkl-pseudoaxis-k4cv.html#hkl-hkl-pseudoaxis-k4cv.details">
-<ANCHOR id="hkl-pseudo-axis-engine-k4cv-hkl-new" href="hkl/hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-hkl-new">
-<ANCHOR id="hkl-pseudo-axis-engine-k4cv-psi-new" href="hkl/hkl-hkl-pseudoaxis-k4cv.html#hkl-pseudo-axis-engine-k4cv-psi-new">
+<ANCHOR id="hkl-engine-k4cv-hkl-new" href="hkl/hkl-hkl-pseudoaxis-k4cv.html#hkl-engine-k4cv-hkl-new">
+<ANCHOR id="hkl-engine-k4cv-psi-new" href="hkl/hkl-hkl-pseudoaxis-k4cv.html#hkl-engine-k4cv-psi-new">
 <ANCHOR id="hkl-hkl-error" href="hkl/hkl-hkl-error.html">
 <ANCHOR id="hkl-hkl-error.synopsis" href="hkl/hkl-hkl-error.html#hkl-hkl-error.synopsis">
 <ANCHOR id="hkl-hkl-error.description" href="hkl/hkl-hkl-error.html#hkl-hkl-error.description">
@@ -96,17 +94,6 @@
 <ANCHOR id="hkl-hkl-parameter.details" href="hkl/hkl-hkl-parameter.html#hkl-hkl-parameter.details">
 <ANCHOR id="HklParameter" href="hkl/hkl-hkl-parameter.html#HklParameter">
 <ANCHOR id="hkl-parameter-new" href="hkl/hkl-hkl-parameter.html#hkl-parameter-new">
-<ANCHOR id="hkl-parameter-new-copy" href="hkl/hkl-hkl-parameter.html#hkl-parameter-new-copy">
-<ANCHOR id="hkl-parameter-init" href="hkl/hkl-hkl-parameter.html#hkl-parameter-init">
-<ANCHOR id="hkl-parameter-free" href="hkl/hkl-hkl-parameter.html#hkl-parameter-free">
-<ANCHOR id="hkl-parameter-set-value" href="hkl/hkl-hkl-parameter.html#hkl-parameter-set-value">
-<ANCHOR id="hkl-parameter-get-value-unit" href="hkl/hkl-hkl-parameter.html#hkl-parameter-get-value-unit">
-<ANCHOR id="hkl-parameter-set-value-unit" href="hkl/hkl-hkl-parameter.html#hkl-parameter-set-value-unit">
-<ANCHOR id="hkl-parameter-get-max" href="hkl/hkl-hkl-parameter.html#hkl-parameter-get-max">
-<ANCHOR id="hkl-parameter-get-range-unit" href="hkl/hkl-hkl-parameter.html#hkl-parameter-get-range-unit">
-<ANCHOR id="hkl-parameter-set-range" href="hkl/hkl-hkl-parameter.html#hkl-parameter-set-range">
-<ANCHOR id="hkl-parameter-set-range-unit" href="hkl/hkl-hkl-parameter.html#hkl-parameter-set-range-unit">
-<ANCHOR id="hkl-parameter-randomize" href="hkl/hkl-hkl-parameter.html#hkl-parameter-randomize">
 <ANCHOR id="hkl-parameter-is-valid" href="hkl/hkl-hkl-parameter.html#hkl-parameter-is-valid">
 <ANCHOR id="hkl-parameter-fprintf" href="hkl/hkl-hkl-parameter.html#hkl-parameter-fprintf">
 <ANCHOR id="hkl-hkl-pseudoaxis" href="hkl/hkl-hkl-pseudoaxis.html">
@@ -114,42 +101,18 @@
 <ANCHOR id="hkl-hkl-pseudoaxis.description" href="hkl/hkl-hkl-pseudoaxis.html#hkl-hkl-pseudoaxis.description">
 <ANCHOR id="hkl-hkl-pseudoaxis.details" href="hkl/hkl-hkl-pseudoaxis.html#hkl-hkl-pseudoaxis.details">
 <ANCHOR id="HklPseudoAxis" href="hkl/hkl-hkl-pseudoaxis.html#HklPseudoAxis">
-<ANCHOR id="HklPseudoAxisEngineMode" href="hkl/hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineMode">
-<ANCHOR id="HklPseudoAxisEngine" href="hkl/hkl-hkl-pseudoaxis.html#HklPseudoAxisEngine">
-<ANCHOR id="HklPseudoAxisEngineList" href="hkl/hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineList">
-<ANCHOR id="HklPseudoAxisEngineModeFunc" href="hkl/hkl-hkl-pseudoaxis.html#HklPseudoAxisEngineModeFunc">
+<ANCHOR id="HklMode" href="hkl/hkl-hkl-pseudoaxis.html#HklMode">
+<ANCHOR id="HklEngine" href="hkl/hkl-hkl-pseudoaxis.html#HklEngine">
+<ANCHOR id="HklEngineList" href="hkl/hkl-hkl-pseudoaxis.html#HklEngineList">
 <ANCHOR id="HklFunction" href="hkl/hkl-hkl-pseudoaxis.html#HklFunction">
-<ANCHOR id="hkl-pseudo-axis-new" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-new">
-<ANCHOR id="hkl-pseudo-axis-init" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-init">
-<ANCHOR id="hkl-pseudo-axis-free" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-free">
-<ANCHOR id="hkl-pseudo-axis-fprintf" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-fprintf">
-<ANCHOR id="hkl-pseudo-axis-engine-mode-new" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-new">
-<ANCHOR id="hkl-pseudo-axis-engine-mode-init" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-init">
-<ANCHOR id="hkl-pseudo-axis-engine-mode-free" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-mode-free">
-<ANCHOR id="hkl-pseudo-axis-engine-new" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-new">
-<ANCHOR id="hkl-pseudo-axis-engine-free" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-free">
-<ANCHOR id="hkl-pseudo-axis-engine-add-mode" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-mode">
-<ANCHOR id="hkl-pseudo-axis-engine-add-geometry" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-add-geometry">
-<ANCHOR id="hkl-pseudo-axis-engine-select-mode" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-select-mode">
-<ANCHOR id="hkl-pseudo-axis-engine-initialize" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-initialize">
-<ANCHOR id="hkl-pseudo-axis-engine-set" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-set">
-<ANCHOR id="hkl-pseudo-axis-engine-get" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-get">
-<ANCHOR id="hkl-pseudo-axis-engine-fprintf" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-fprintf">
-<ANCHOR id="hkl-pseudo-axis-engine-list-new" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-new">
-<ANCHOR id="hkl-pseudo-axis-engine-list-free" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-free">
-<ANCHOR id="hkl-pseudo-axis-engine-list-add" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-add">
-<ANCHOR id="hkl-pseudo-axis-engine-list-get-by-name" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-by-name">
-<ANCHOR id="hkl-pseudo-axis-engine-list-get-pseudo-axis-by-name" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get-pseudo-axis-by-name">
-<ANCHOR id="hkl-pseudo-axis-engine-list-clear" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-clear">
-<ANCHOR id="hkl-pseudo-axis-engine-list-init" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-init">
-<ANCHOR id="hkl-pseudo-axis-engine-list-get" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-get">
-<ANCHOR id="hkl-pseudo-axis-engine-list-fprintf" href="hkl/hkl-hkl-pseudoaxis.html#hkl-pseudo-axis-engine-list-fprintf">
+<ANCHOR id="hkl-engine-list-new" href="hkl/hkl-hkl-pseudoaxis.html#hkl-engine-list-new">
+<ANCHOR id="hkl-engine-list-add" href="hkl/hkl-hkl-pseudoaxis.html#hkl-engine-list-add">
+<ANCHOR id="hkl-engine-list-clear" href="hkl/hkl-hkl-pseudoaxis.html#hkl-engine-list-clear">
 <ANCHOR id="hkl-hkl-geometry" href="hkl/hkl-hkl-geometry.html">
 <ANCHOR id="hkl-hkl-geometry.synopsis" href="hkl/hkl-hkl-geometry.html#hkl-hkl-geometry.synopsis">
 <ANCHOR id="hkl-hkl-geometry.description" href="hkl/hkl-hkl-geometry.html#hkl-hkl-geometry.description">
 <ANCHOR id="hkl-hkl-geometry.details" href="hkl/hkl-hkl-geometry.html#hkl-hkl-geometry.details">
 <ANCHOR id="HklHolder" href="hkl/hkl-hkl-geometry.html#HklHolder">
-<ANCHOR id="HklGeometryConfig" href="hkl/hkl-hkl-geometry.html#HklGeometryConfig">
 <ANCHOR id="HklGeometry" href="hkl/hkl-hkl-geometry.html#HklGeometry">
 <ANCHOR id="HklGeometryList" href="hkl/hkl-hkl-geometry.html#HklGeometryList">
 <ANCHOR id="HklGeometryListItem" href="hkl/hkl-hkl-geometry.html#HklGeometryListItem">
@@ -157,18 +120,15 @@
 <ANCHOR id="hkl-holder-add-rotation-axis" href="hkl/hkl-hkl-geometry.html#hkl-holder-add-rotation-axis">
 <ANCHOR id="hkl-geometry-new" href="hkl/hkl-hkl-geometry.html#hkl-geometry-new">
 <ANCHOR id="hkl-geometry-new-copy" href="hkl/hkl-hkl-geometry.html#hkl-geometry-new-copy">
-<ANCHOR id="hkl-geometry-free" href="hkl/hkl-hkl-geometry.html#hkl-geometry-free">
 <ANCHOR id="hkl-geometry-init-geometry" href="hkl/hkl-hkl-geometry.html#hkl-geometry-init-geometry">
 <ANCHOR id="hkl-geometry-add-holder" href="hkl/hkl-hkl-geometry.html#hkl-geometry-add-holder">
 <ANCHOR id="hkl-geometry-update" href="hkl/hkl-hkl-geometry.html#hkl-geometry-update">
 <ANCHOR id="hkl-geometry-get-axis-by-name" href="hkl/hkl-hkl-geometry.html#hkl-geometry-get-axis-by-name">
-<ANCHOR id="hkl-geometry-randomize" href="hkl/hkl-hkl-geometry.html#hkl-geometry-randomize">
 <ANCHOR id="hkl-geometry-set-values-v" href="hkl/hkl-hkl-geometry.html#hkl-geometry-set-values-v">
 <ANCHOR id="hkl-geometry-distance" href="hkl/hkl-hkl-geometry.html#hkl-geometry-distance">
 <ANCHOR id="hkl-geometry-distance-orthodromic" href="hkl/hkl-hkl-geometry.html#hkl-geometry-distance-orthodromic">
 <ANCHOR id="hkl-geometry-closest-from-geometry-with-range" href="hkl/hkl-hkl-geometry.html#hkl-geometry-closest-from-geometry-with-range">
 <ANCHOR id="hkl-geometry-is-valid" href="hkl/hkl-hkl-geometry.html#hkl-geometry-is-valid">
-<ANCHOR id="hkl-geometry-fprintf" href="hkl/hkl-hkl-geometry.html#hkl-geometry-fprintf">
 <ANCHOR id="hkl-geometry-list-new" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-new">
 <ANCHOR id="hkl-geometry-list-free" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-free">
 <ANCHOR id="hkl-geometry-list-add" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-add">
@@ -178,49 +138,24 @@
 <ANCHOR id="hkl-geometry-list-multiply" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-multiply">
 <ANCHOR id="hkl-geometry-list-multiply-from-range" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-multiply-from-range">
 <ANCHOR id="hkl-geometry-list-remove-invalid" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-remove-invalid">
-<ANCHOR id="hkl-geometry-list-len" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-len">
-<ANCHOR id="hkl-geometry-list-is-empty" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-is-empty">
 <ANCHOR id="hkl-geometry-list-item-new" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-item-new">
 <ANCHOR id="hkl-geometry-list-item-free" href="hkl/hkl-hkl-geometry.html#hkl-geometry-list-item-free">
 <ANCHOR id="hkl-hkl-geometry-factory" href="hkl/hkl-hkl-geometry-factory.html">
 <ANCHOR id="hkl-hkl-geometry-factory.synopsis" href="hkl/hkl-hkl-geometry-factory.html#hkl-hkl-geometry-factory.synopsis">
 <ANCHOR id="hkl-hkl-geometry-factory.description" href="hkl/hkl-hkl-geometry-factory.html#hkl-hkl-geometry-factory.description">
 <ANCHOR id="hkl-hkl-geometry-factory.details" href="hkl/hkl-hkl-geometry-factory.html#hkl-hkl-geometry-factory.details">
-<ANCHOR id="hkl-geometry-factory-get-config-from-type" href="hkl/hkl-hkl-geometry-factory.html#hkl-geometry-factory-get-config-from-type">
-<ANCHOR id="hkl-geometry-factory-new" href="hkl/hkl-hkl-geometry-factory.html#hkl-geometry-factory-new">
 <ANCHOR id="hkl-hkl-pseudoaxis-auto" href="hkl/hkl-hkl-pseudoaxis-auto.html">
 <ANCHOR id="hkl-hkl-pseudoaxis-auto.synopsis" href="hkl/hkl-hkl-pseudoaxis-auto.html#hkl-hkl-pseudoaxis-auto.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-auto.description" href="hkl/hkl-hkl-pseudoaxis-auto.html#hkl-hkl-pseudoaxis-auto.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-auto.details" href="hkl/hkl-hkl-pseudoaxis-auto.html#hkl-hkl-pseudoaxis-auto.details">
-<ANCHOR id="hkl-pseudo-axis-engine-mode-set-real" href="hkl/hkl-hkl-pseudoaxis-auto.html#hkl-pseudo-axis-engine-mode-set-real">
 <ANCHOR id="hkl-hkl-pseudoaxis-e4cv" href="hkl/hkl-hkl-pseudoaxis-e4cv.html">
 <ANCHOR id="hkl-hkl-pseudoaxis-e4cv.synopsis" href="hkl/hkl-hkl-pseudoaxis-e4cv.html#hkl-hkl-pseudoaxis-e4cv.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-e4cv.description" href="hkl/hkl-hkl-pseudoaxis-e4cv.html#hkl-hkl-pseudoaxis-e4cv.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-e4cv.details" href="hkl/hkl-hkl-pseudoaxis-e4cv.html#hkl-hkl-pseudoaxis-e4cv.details">
-<ANCHOR id="hkl-pseudo-axis-engine-e4cv-hkl-new" href="hkl/hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-hkl-new">
-<ANCHOR id="hkl-pseudo-axis-engine-e4cv-psi-new" href="hkl/hkl-hkl-pseudoaxis-e4cv.html#hkl-pseudo-axis-engine-e4cv-psi-new">
 <ANCHOR id="hkl-hkl-macros" href="hkl/hkl-hkl-macros.html">
 <ANCHOR id="hkl-hkl-macros.synopsis" href="hkl/hkl-hkl-macros.html#hkl-hkl-macros.synopsis">
 <ANCHOR id="hkl-hkl-macros.description" href="hkl/hkl-hkl-macros.html#hkl-hkl-macros.description">
 <ANCHOR id="hkl-hkl-macros.details" href="hkl/hkl-hkl-macros.html#hkl-hkl-macros.details">
-<ANCHOR id="HKL-BEGIN-DECLS:CAPS" href="hkl/hkl-hkl-macros.html#HKL-BEGIN-DECLS:CAPS">
-<ANCHOR id="HKL-END-DECLS:CAPS" href="hkl/hkl-hkl-macros.html#HKL-END-DECLS:CAPS">
-<ANCHOR id="INFINITY:CAPS" href="hkl/hkl-hkl-macros.html#INFINITY:CAPS">
-<ANCHOR id="M-PI:CAPS" href="hkl/hkl-hkl-macros.html#M-PI:CAPS">
-<ANCHOR id="M-PI-2:CAPS" href="hkl/hkl-hkl-macros.html#M-PI-2:CAPS">
-<ANCHOR id="HKL-MAJOR:CAPS" href="hkl/hkl-hkl-macros.html#HKL-MAJOR:CAPS">
-<ANCHOR id="HKL-MINOR:CAPS" href="hkl/hkl-hkl-macros.html#HKL-MINOR:CAPS">
-<ANCHOR id="HKL-PATCH:CAPS" href="hkl/hkl-hkl-macros.html#HKL-PATCH:CAPS">
-<ANCHOR id="HKL-VERSION:CAPS" href="hkl/hkl-hkl-macros.html#HKL-VERSION:CAPS">
-<ANCHOR id="HKL-TRUE:CAPS" href="hkl/hkl-hkl-macros.html#HKL-TRUE:CAPS">
-<ANCHOR id="HKL-FALSE:CAPS" href="hkl/hkl-hkl-macros.html#HKL-FALSE:CAPS">
-<ANCHOR id="HKL-SUCCESS:CAPS" href="hkl/hkl-hkl-macros.html#HKL-SUCCESS:CAPS">
-<ANCHOR id="HKL-FAIL:CAPS" href="hkl/hkl-hkl-macros.html#HKL-FAIL:CAPS">
-<ANCHOR id="HKL-TINY:CAPS" href="hkl/hkl-hkl-macros.html#HKL-TINY:CAPS">
-<ANCHOR id="HKL-EPSILON:CAPS" href="hkl/hkl-hkl-macros.html#HKL-EPSILON:CAPS">
-<ANCHOR id="HKL-DEGTORAD:CAPS" href="hkl/hkl-hkl-macros.html#HKL-DEGTORAD:CAPS">
-<ANCHOR id="HKL-RADTODEG:CAPS" href="hkl/hkl-hkl-macros.html#HKL-RADTODEG:CAPS">
-<ANCHOR id="HKL-TAU:CAPS" href="hkl/hkl-hkl-macros.html#HKL-TAU:CAPS">
 <ANCHOR id="HKL-EULERIAN-KAPPA-SOLUTION:CAPS" href="hkl/hkl-hkl-macros.html#HKL-EULERIAN-KAPPA-SOLUTION:CAPS">
 <ANCHOR id="hkl-assert" href="hkl/hkl-hkl-macros.html#hkl-assert">
 <ANCHOR id="G-GNUC-PRINTF:CAPS" href="hkl/hkl-hkl-macros.html#G-GNUC-PRINTF:CAPS">
@@ -233,8 +168,8 @@
 <ANCHOR id="hkl-hkl-pseudoaxis-k6c.synopsis" href="hkl/hkl-hkl-pseudoaxis-k6c.html#hkl-hkl-pseudoaxis-k6c.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-k6c.description" href="hkl/hkl-hkl-pseudoaxis-k6c.html#hkl-hkl-pseudoaxis-k6c.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-k6c.details" href="hkl/hkl-hkl-pseudoaxis-k6c.html#hkl-hkl-pseudoaxis-k6c.details">
-<ANCHOR id="hkl-pseudo-axis-engine-k6c-hkl-new" href="hkl/hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-hkl-new">
-<ANCHOR id="hkl-pseudo-axis-engine-k6c-psi-new" href="hkl/hkl-hkl-pseudoaxis-k6c.html#hkl-pseudo-axis-engine-k6c-psi-new">
+<ANCHOR id="hkl-engine-k6c-hkl-new" href="hkl/hkl-hkl-pseudoaxis-k6c.html#hkl-engine-k6c-hkl-new">
+<ANCHOR id="hkl-engine-k6c-psi-new" href="hkl/hkl-hkl-pseudoaxis-k6c.html#hkl-engine-k6c-psi-new">
 <ANCHOR id="hkl-hkl-source" href="hkl/hkl-hkl-source.html">
 <ANCHOR id="hkl-hkl-source.synopsis" href="hkl/hkl-hkl-source.html#hkl-hkl-source.synopsis">
 <ANCHOR id="hkl-hkl-source.description" href="hkl/hkl-hkl-source.html#hkl-hkl-source.description">
@@ -257,26 +192,19 @@
 <ANCHOR id="hkl-hkl-pseudoaxis-common-hkl.synopsis" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-hkl-pseudoaxis-common-hkl.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-hkl.description" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-hkl-pseudoaxis-common-hkl.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-hkl.details" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-hkl-pseudoaxis-common-hkl.details">
-<ANCHOR id="RUBh-minus-Q-func" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q-func">
-<ANCHOR id="double-diffraction-func" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction-func">
-<ANCHOR id="psi-constant-vertical-func" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#psi-constant-vertical-func">
 <ANCHOR id="RUBh-minus-Q" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#RUBh-minus-Q">
-<ANCHOR id="double-diffraction" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#double-diffraction">
-<ANCHOR id="hkl-pseudo-axis-engine-mode-get-hkl-real" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-get-hkl-real">
-<ANCHOR id="hkl-pseudo-axis-engine-mode-init-psi-constant-vertical-real" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-mode-init-psi-constant-vertical-real">
-<ANCHOR id="hkl-pseudo-axis-engine-hkl-new" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-pseudo-axis-engine-hkl-new">
+<ANCHOR id="hkl-mode-get-hkl-real" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-mode-get-hkl-real">
+<ANCHOR id="hkl-mode-init-psi-constant-vertical-real" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-mode-init-psi-constant-vertical-real">
+<ANCHOR id="hkl-engine-hkl-new" href="hkl/hkl-hkl-pseudoaxis-common-hkl.html#hkl-engine-hkl-new">
 <ANCHOR id="hkl-hkl-matrix" href="hkl/hkl-hkl-matrix.html">
 <ANCHOR id="hkl-hkl-matrix.synopsis" href="hkl/hkl-hkl-matrix.html#hkl-hkl-matrix.synopsis">
 <ANCHOR id="hkl-hkl-matrix.description" href="hkl/hkl-hkl-matrix.html#hkl-hkl-matrix.description">
 <ANCHOR id="hkl-hkl-matrix.details" href="hkl/hkl-hkl-matrix.html#hkl-hkl-matrix.details">
 <ANCHOR id="HklMatrix" href="hkl/hkl-hkl-matrix.html#HklMatrix">
-<ANCHOR id="hkl-matrix-init" href="hkl/hkl-hkl-matrix.html#hkl-matrix-init">
 <ANCHOR id="hkl-matrix-init-from-two-vector" href="hkl/hkl-hkl-matrix.html#hkl-matrix-init-from-two-vector">
 <ANCHOR id="hkl-matrix-init-from-euler" href="hkl/hkl-hkl-matrix.html#hkl-matrix-init-from-euler">
 <ANCHOR id="hkl-matrix-fprintf" href="hkl/hkl-hkl-matrix.html#hkl-matrix-fprintf">
 <ANCHOR id="hkl-matrix-to-euler" href="hkl/hkl-hkl-matrix.html#hkl-matrix-to-euler">
-<ANCHOR id="hkl-matrix-cmp" href="hkl/hkl-hkl-matrix.html#hkl-matrix-cmp">
-<ANCHOR id="hkl-matrix-times-matrix" href="hkl/hkl-hkl-matrix.html#hkl-matrix-times-matrix">
 <ANCHOR id="hkl-matrix-times-vector" href="hkl/hkl-hkl-matrix.html#hkl-matrix-times-vector">
 <ANCHOR id="hkl-matrix-transpose" href="hkl/hkl-hkl-matrix.html#hkl-matrix-transpose">
 <ANCHOR id="hkl-matrix-det" href="hkl/hkl-hkl-matrix.html#hkl-matrix-det">
@@ -286,119 +214,44 @@
 <ANCHOR id="hkl-hkl-list.synopsis" href="hkl/hkl-hkl-list.html#hkl-hkl-list.synopsis">
 <ANCHOR id="hkl-hkl-list.description" href="hkl/hkl-hkl-list.html#hkl-hkl-list.description">
 <ANCHOR id="hkl-hkl-list.details" href="hkl/hkl-hkl-list.html#hkl-hkl-list.details">
-<ANCHOR id="HKL-LIST-LEN:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-LEN:CAPS">
-<ANCHOR id="HKL-LIST:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST:CAPS">
-<ANCHOR id="HKL-LIST-INIT:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-INIT:CAPS">
-<ANCHOR id="HKL-LIST-ALLOC:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-ALLOC:CAPS">
-<ANCHOR id="HKL-LIST-COPY:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-COPY:CAPS">
-<ANCHOR id="HKL-LIST-FREE:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-FREE:CAPS">
-<ANCHOR id="HKL-LIST-FREE-DESTRUCTOR:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-FREE-DESTRUCTOR:CAPS">
-<ANCHOR id="HKL-LIST-RESIZE:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-RESIZE:CAPS">
-<ANCHOR id="HKL-LIST-ADD-VALUE:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-ADD-VALUE:CAPS">
-<ANCHOR id="HKL-LIST-DEL:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-DEL:CAPS">
-<ANCHOR id="HKL-LIST-DEL-DESTRUCTOR:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-DEL-DESTRUCTOR:CAPS">
-<ANCHOR id="HKL-LIST-DEL-ITEM-DESTRUCTOR:CAPS" href="hkl/hkl-hkl-list.html#HKL-LIST-DEL-ITEM-DESTRUCTOR:CAPS">
 <ANCHOR id="hkl-hkl-pseudoaxis-common" href="hkl/hkl-hkl-pseudoaxis-common.html">
 <ANCHOR id="hkl-hkl-pseudoaxis-common.synopsis" href="hkl/hkl-hkl-pseudoaxis-common.html#hkl-hkl-pseudoaxis-common.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-common.description" href="hkl/hkl-hkl-pseudoaxis-common.html#hkl-hkl-pseudoaxis-common.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-common.details" href="hkl/hkl-hkl-pseudoaxis-common.html#hkl-hkl-pseudoaxis-common.details">
-<ANCHOR id="hkl-pseudo-axis-engine-init-func" href="hkl/hkl-hkl-pseudoaxis-common.html#hkl-pseudo-axis-engine-init-func">
 <ANCHOR id="hkl-hkl-sample" href="hkl/hkl-hkl-sample.html">
 <ANCHOR id="hkl-hkl-sample.synopsis" href="hkl/hkl-hkl-sample.html#hkl-hkl-sample.synopsis">
 <ANCHOR id="hkl-hkl-sample.description" href="hkl/hkl-hkl-sample.html#hkl-hkl-sample.description">
 <ANCHOR id="hkl-hkl-sample.details" href="hkl/hkl-hkl-sample.html#hkl-hkl-sample.details">
 <ANCHOR id="HklSample" href="hkl/hkl-hkl-sample.html#HklSample">
 <ANCHOR id="HklSampleReflection" href="hkl/hkl-hkl-sample.html#HklSampleReflection">
-<ANCHOR id="HklSampleList" href="hkl/hkl-hkl-sample.html#HklSampleList">
-<ANCHOR id="HklSampleType" href="hkl/hkl-hkl-sample.html#HklSampleType">
-<ANCHOR id="hkl-sample-new" href="hkl/hkl-hkl-sample.html#hkl-sample-new">
-<ANCHOR id="hkl-sample-new-copy" href="hkl/hkl-hkl-sample.html#hkl-sample-new-copy">
-<ANCHOR id="hkl-sample-free" href="hkl/hkl-hkl-sample.html#hkl-sample-free">
-<ANCHOR id="hkl-sample-set-name" href="hkl/hkl-hkl-sample.html#hkl-sample-set-name">
-<ANCHOR id="hkl-sample-set-lattice" href="hkl/hkl-hkl-sample.html#hkl-sample-set-lattice">
-<ANCHOR id="hkl-sample-set-U-from-euler" href="hkl/hkl-hkl-sample.html#hkl-sample-set-U-from-euler">
-<ANCHOR id="hkl-sample-get-UB" href="hkl/hkl-hkl-sample.html#hkl-sample-get-UB">
-<ANCHOR id="hkl-sample-set-UB" href="hkl/hkl-hkl-sample.html#hkl-sample-set-UB">
-<ANCHOR id="hkl-sample-add-reflection" href="hkl/hkl-hkl-sample.html#hkl-sample-add-reflection">
-<ANCHOR id="hkl-sample-get-ith-reflection" href="hkl/hkl-hkl-sample.html#hkl-sample-get-ith-reflection">
-<ANCHOR id="hkl-sample-del-reflection" href="hkl/hkl-hkl-sample.html#hkl-sample-del-reflection">
-<ANCHOR id="hkl-sample-compute-UB-busing-levy" href="hkl/hkl-hkl-sample.html#hkl-sample-compute-UB-busing-levy">
-<ANCHOR id="hkl-sample-affine" href="hkl/hkl-hkl-sample.html#hkl-sample-affine">
-<ANCHOR id="hkl-sample-get-reflection-mesured-angle" href="hkl/hkl-hkl-sample.html#hkl-sample-get-reflection-mesured-angle">
-<ANCHOR id="hkl-sample-get-reflection-theoretical-angle" href="hkl/hkl-hkl-sample.html#hkl-sample-get-reflection-theoretical-angle">
 <ANCHOR id="hkl-sample-fprintf" href="hkl/hkl-hkl-sample.html#hkl-sample-fprintf">
-<ANCHOR id="hkl-sample-reflection-set-hkl" href="hkl/hkl-hkl-sample.html#hkl-sample-reflection-set-hkl">
-<ANCHOR id="hkl-sample-reflection-set-flag" href="hkl/hkl-hkl-sample.html#hkl-sample-reflection-set-flag">
-<ANCHOR id="hkl-sample-reflection-set-geometry" href="hkl/hkl-hkl-sample.html#hkl-sample-reflection-set-geometry">
-<ANCHOR id="hkl-sample-list-new" href="hkl/hkl-hkl-sample.html#hkl-sample-list-new">
-<ANCHOR id="hkl-sample-list-free" href="hkl/hkl-hkl-sample.html#hkl-sample-list-free">
-<ANCHOR id="hkl-sample-list-append" href="hkl/hkl-hkl-sample.html#hkl-sample-list-append">
-<ANCHOR id="hkl-sample-list-clear" href="hkl/hkl-hkl-sample.html#hkl-sample-list-clear">
-<ANCHOR id="hkl-sample-list-del" href="hkl/hkl-hkl-sample.html#hkl-sample-list-del">
-<ANCHOR id="hkl-sample-list-len" href="hkl/hkl-hkl-sample.html#hkl-sample-list-len">
-<ANCHOR id="hkl-sample-list-get-ith" href="hkl/hkl-hkl-sample.html#hkl-sample-list-get-ith">
-<ANCHOR id="hkl-sample-list-get-by-name" href="hkl/hkl-hkl-sample.html#hkl-sample-list-get-by-name">
-<ANCHOR id="hkl-sample-list-get-idx-from-name" href="hkl/hkl-hkl-sample.html#hkl-sample-list-get-idx-from-name">
-<ANCHOR id="hkl-sample-list-select-current" href="hkl/hkl-hkl-sample.html#hkl-sample-list-select-current">
-<ANCHOR id="hkl-sample-list-fprintf" href="hkl/hkl-hkl-sample.html#hkl-sample-list-fprintf">
 <ANCHOR id="hkl-hkl-axis" href="hkl/hkl-hkl-axis.html">
 <ANCHOR id="hkl-hkl-axis.synopsis" href="hkl/hkl-hkl-axis.html#hkl-hkl-axis.synopsis">
 <ANCHOR id="hkl-hkl-axis.description" href="hkl/hkl-hkl-axis.html#hkl-hkl-axis.description">
 <ANCHOR id="hkl-hkl-axis.details" href="hkl/hkl-hkl-axis.html#hkl-hkl-axis.details">
 <ANCHOR id="HklAxis" href="hkl/hkl-hkl-axis.html#HklAxis">
-<ANCHOR id="hkl-axis-new" href="hkl/hkl-hkl-axis.html#hkl-axis-new">
-<ANCHOR id="hkl-axis-free" href="hkl/hkl-hkl-axis.html#hkl-axis-free">
-<ANCHOR id="hkl-axis-init" href="hkl/hkl-hkl-axis.html#hkl-axis-init">
-<ANCHOR id="hkl-axis-get-name" href="hkl/hkl-hkl-axis.html#hkl-axis-get-name">
-<ANCHOR id="hkl-axis-get-changed" href="hkl/hkl-hkl-axis.html#hkl-axis-get-changed">
-<ANCHOR id="hkl-axis-set-changed" href="hkl/hkl-hkl-axis.html#hkl-axis-set-changed">
-<ANCHOR id="hkl-axis-get-value" href="hkl/hkl-hkl-axis.html#hkl-axis-get-value">
-<ANCHOR id="hkl-axis-get-value-unit" href="hkl/hkl-hkl-axis.html#hkl-axis-get-value-unit">
-<ANCHOR id="hkl-axis-get-value-closest" href="hkl/hkl-hkl-axis.html#hkl-axis-get-value-closest">
-<ANCHOR id="hkl-axis-get-value-closest-unit" href="hkl/hkl-hkl-axis.html#hkl-axis-get-value-closest-unit">
-<ANCHOR id="hkl-axis-get-max" href="hkl/hkl-hkl-axis.html#hkl-axis-get-max">
-<ANCHOR id="hkl-axis-get-range-unit" href="hkl/hkl-hkl-axis.html#hkl-axis-get-range-unit">
-<ANCHOR id="hkl-axis-set-value" href="hkl/hkl-hkl-axis.html#hkl-axis-set-value">
-<ANCHOR id="hkl-axis-set-value-smallest-in-range" href="hkl/hkl-hkl-axis.html#hkl-axis-set-value-smallest-in-range">
-<ANCHOR id="hkl-axis-set-value-unit" href="hkl/hkl-hkl-axis.html#hkl-axis-set-value-unit">
-<ANCHOR id="hkl-axis-set-range" href="hkl/hkl-hkl-axis.html#hkl-axis-set-range">
-<ANCHOR id="hkl-axis-set-range-unit" href="hkl/hkl-hkl-axis.html#hkl-axis-set-range-unit">
-<ANCHOR id="hkl-axis-randomize" href="hkl/hkl-hkl-axis.html#hkl-axis-randomize">
-<ANCHOR id="hkl-axis-get-quaternion" href="hkl/hkl-hkl-axis.html#hkl-axis-get-quaternion">
-<ANCHOR id="hkl-axis-is-value-compatible-with-range" href="hkl/hkl-hkl-axis.html#hkl-axis-is-value-compatible-with-range">
-<ANCHOR id="hkl-axis-is-valid" href="hkl/hkl-hkl-axis.html#hkl-axis-is-valid">
-<ANCHOR id="hkl-axis-fprintf" href="hkl/hkl-hkl-axis.html#hkl-axis-fprintf">
 <ANCHOR id="hkl-hkl-pseudoaxis-factory" href="hkl/hkl-hkl-pseudoaxis-factory.html">
 <ANCHOR id="hkl-hkl-pseudoaxis-factory.synopsis" href="hkl/hkl-hkl-pseudoaxis-factory.html#hkl-hkl-pseudoaxis-factory.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-factory.description" href="hkl/hkl-hkl-pseudoaxis-factory.html#hkl-hkl-pseudoaxis-factory.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-factory.details" href="hkl/hkl-hkl-pseudoaxis-factory.html#hkl-hkl-pseudoaxis-factory.details">
-<ANCHOR id="hkl-pseudo-axis-engine-list-factory" href="hkl/hkl-hkl-pseudoaxis-factory.html#hkl-pseudo-axis-engine-list-factory">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-psi" href="hkl/hkl-hkl-pseudoaxis-common-psi.html">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-psi.synopsis" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#hkl-hkl-pseudoaxis-common-psi.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-psi.description" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#hkl-hkl-pseudoaxis-common-psi.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-psi.details" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#hkl-hkl-pseudoaxis-common-psi.details">
-<ANCHOR id="HklPseudoAxisEngineModePsi" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#HklPseudoAxisEngineModePsi">
-<ANCHOR id="hkl-pseudo-axis-engine-mode-psi-new" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-mode-psi-new">
-<ANCHOR id="hkl-pseudo-axis-engine-psi-new" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#hkl-pseudo-axis-engine-psi-new">
+<ANCHOR id="HklModePsi" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#HklModePsi">
+<ANCHOR id="hkl-mode-psi-new" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#hkl-mode-psi-new">
+<ANCHOR id="hkl-engine-psi-new" href="hkl/hkl-hkl-pseudoaxis-common-psi.html#hkl-engine-psi-new">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-q" href="hkl/hkl-hkl-pseudoaxis-common-q.html">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-q.synopsis" href="hkl/hkl-hkl-pseudoaxis-common-q.html#hkl-hkl-pseudoaxis-common-q.synopsis">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-q.description" href="hkl/hkl-hkl-pseudoaxis-common-q.html#hkl-hkl-pseudoaxis-common-q.description">
 <ANCHOR id="hkl-hkl-pseudoaxis-common-q.details" href="hkl/hkl-hkl-pseudoaxis-common-q.html#hkl-hkl-pseudoaxis-common-q.details">
-<ANCHOR id="hkl-pseudo-axis-engine-q-new" href="hkl/hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q-new">
-<ANCHOR id="hkl-pseudo-axis-engine-q2-new" href="hkl/hkl-hkl-pseudoaxis-common-q.html#hkl-pseudo-axis-engine-q2-new">
+<ANCHOR id="hkl-engine-q-new" href="hkl/hkl-hkl-pseudoaxis-common-q.html#hkl-engine-q-new">
+<ANCHOR id="hkl-engine-q2-new" href="hkl/hkl-hkl-pseudoaxis-common-q.html#hkl-engine-q2-new">
 <ANCHOR id="hkl-hkl-lattice" href="hkl/hkl-hkl-lattice.html">
 <ANCHOR id="hkl-hkl-lattice.synopsis" href="hkl/hkl-hkl-lattice.html#hkl-hkl-lattice.synopsis">
 <ANCHOR id="hkl-hkl-lattice.description" href="hkl/hkl-hkl-lattice.html#hkl-hkl-lattice.description">
 <ANCHOR id="hkl-hkl-lattice.details" href="hkl/hkl-hkl-lattice.html#hkl-hkl-lattice.details">
 <ANCHOR id="HklLattice" href="hkl/hkl-hkl-lattice.html#HklLattice">
-<ANCHOR id="hkl-lattice-new" href="hkl/hkl-hkl-lattice.html#hkl-lattice-new">
-<ANCHOR id="hkl-lattice-new-copy" href="hkl/hkl-hkl-lattice.html#hkl-lattice-new-copy">
-<ANCHOR id="hkl-lattice-new-default" href="hkl/hkl-hkl-lattice.html#hkl-lattice-new-default">
-<ANCHOR id="hkl-lattice-free" href="hkl/hkl-hkl-lattice.html#hkl-lattice-free">
-<ANCHOR id="hkl-lattice-set" href="hkl/hkl-hkl-lattice.html#hkl-lattice-set">
-<ANCHOR id="hkl-lattice-get-B" href="hkl/hkl-hkl-lattice.html#hkl-lattice-get-B">
-<ANCHOR id="hkl-lattice-get-1-B" href="hkl/hkl-hkl-lattice.html#hkl-lattice-get-1-B">
-<ANCHOR id="hkl-lattice-reciprocal" href="hkl/hkl-hkl-lattice.html#hkl-lattice-reciprocal">
 <ANCHOR id="hkl-lattice-randomize" href="hkl/hkl-hkl-lattice.html#hkl-lattice-randomize">
 <ANCHOR id="hkl-lattice-fprintf" href="hkl/hkl-hkl-lattice.html#hkl-lattice-fprintf">
 <ANCHOR id="hkl-hkl-vector" href="hkl/hkl-hkl-vector.html">
@@ -433,3 +286,7 @@
 <ANCHOR id="hkl-vector-rotated-quaternion" href="hkl/hkl-hkl-vector.html#hkl-vector-rotated-quaternion">
 <ANCHOR id="hkl-vector-is-null" href="hkl/hkl-hkl-vector.html#hkl-vector-is-null">
 <ANCHOR id="hkl-vector-project-on-plan" href="hkl/hkl-hkl-vector.html#hkl-vector-project-on-plan">
+<ANCHOR id="annotation-glossterm-out" href="hkl/annotation-glossary.html#annotation-glossterm-out">
+<ANCHOR id="annotation-glossterm-in" href="hkl/annotation-glossary.html#annotation-glossterm-in">
+<ANCHOR id="annotation-glossterm-transfer full" href="hkl/annotation-glossary.html#annotation-glossterm-transfer full">
+<ANCHOR id="annotation-glossterm-transfer none" href="hkl/annotation-glossary.html#annotation-glossterm-transfer none">
diff --git a/Documentation/api/html/object-tree.html b/Documentation/api/html/object-tree.html
index 219b3bb..a4e1270 100644
--- a/Documentation/api/html/object-tree.html
+++ b/Documentation/api/html/object-tree.html
@@ -3,12 +3,12 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>Object Hierarchy</title>
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
 <link rel="home" href="index.html" title="hkl Reference Manual">
 <link rel="up" href="index.html" title="hkl Reference Manual">
 <link rel="prev" href="hkl-hkl-vector.html" title="hkl-vector">
 <link rel="next" href="api-index-full.html" title="API Index">
-<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
+<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
 <link rel="stylesheet" href="style.css" type="text/css">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -19,14 +19,14 @@
 <th width="100%" align="center">hkl Reference Manual</th>
 <td><a accesskey="n" href="api-index-full.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 </tr></table>
-<div class="chapter" title="Object Hierarchy">
-<div class="titlepage"><div><div><h2 class="title">
-<a name="object-tree"></a>Object Hierarchy</h2></div></div></div>
+<div class="chapter">
+<div class="titlepage"><div><div><h1 class="title">
+<a name="object-tree"></a>Object Hierarchy</h1></div></div></div>
 <pre class="screen">
 </pre>
 </div>
 <div class="footer">
 <hr>
-          Generated by GTK-Doc V1.15</div>
+          Generated by GTK-Doc V1.18</div>
 </body>
 </html>
\ No newline at end of file
diff --git a/Documentation/api/html/style.css b/Documentation/api/html/style.css
index d544a2c..d6f6c26 100644
--- a/Documentation/api/html/style.css
+++ b/Documentation/api/html/style.css
@@ -32,8 +32,9 @@
   /* this is needed so that the local anchors are displayed below the naviagtion */
   div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name]
   {
+    display: inline-block;
     position: relative;
-    padding-top:4.5em;
+    top:-5em;
   }
   /* this seems to be a bug in the xsl style sheets when generating indexes */
   div.index div.index
diff --git a/Documentation/api/tmpl/hkl-axis.sgml b/Documentation/api/tmpl/hkl-axis.sgml
deleted file mode 100644
index 285aa3e..0000000
--- a/Documentation/api/tmpl/hkl-axis.sgml
+++ /dev/null
@@ -1,233 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-axis
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklAxis ##### -->
-<para>
-
-</para>
-
- at parent_instance: 
- at axis_v: 
- at q: 
-
-<!-- ##### FUNCTION hkl_axis_new ##### -->
-<para>
-
-</para>
-
- at name: 
- at axis_v: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_axis_init ##### -->
-<para>
-
-</para>
-
- at axis: 
- at name: 
- at axis_v: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_name ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_changed ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_set_changed ##### -->
-<para>
-
-</para>
-
- at self: 
- at changed: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_value ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_value_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_value_closest ##### -->
-<para>
-
-</para>
-
- at self: 
- at axis: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_value_closest_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at axis: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_max ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_range_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at min: 
- at max: 
-
-
-<!-- ##### FUNCTION hkl_axis_set_value ##### -->
-<para>
-
-</para>
-
- at self: 
- at value: 
-
-
-<!-- ##### FUNCTION hkl_axis_set_value_smallest_in_range ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_axis_set_value_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at value: 
-
-
-<!-- ##### FUNCTION hkl_axis_set_range ##### -->
-<para>
-
-</para>
-
- at self: 
- at min: 
- at max: 
-
-
-<!-- ##### FUNCTION hkl_axis_set_range_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at min: 
- at max: 
-
-
-<!-- ##### FUNCTION hkl_axis_randomize ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_axis_get_quaternion ##### -->
-<para>
-
-</para>
-
- at self: 
- at q: 
-
-
-<!-- ##### FUNCTION hkl_axis_is_value_compatible_with_range ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_is_valid ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_axis_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
diff --git a/Documentation/api/tmpl/hkl-detector-factory.sgml b/Documentation/api/tmpl/hkl-detector-factory.sgml
deleted file mode 100644
index dcf22ff..0000000
--- a/Documentation/api/tmpl/hkl-detector-factory.sgml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-detector-factory
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_detector_factory_new ##### -->
-<para>
-
-</para>
-
- at type: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-detector.sgml b/Documentation/api/tmpl/hkl-detector.sgml
deleted file mode 100644
index 4330390..0000000
--- a/Documentation/api/tmpl/hkl-detector.sgml
+++ /dev/null
@@ -1,76 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-detector
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklDetector ##### -->
-<para>
-
-</para>
-
- at idx: 
- at holder: 
-
-<!-- ##### FUNCTION hkl_detector_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_detector_new_copy ##### -->
-<para>
-
-</para>
-
- at src: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_detector_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_detector_attach_to_holder ##### -->
-<para>
-
-</para>
-
- at self: 
- at holder: 
-
-
-<!-- ##### FUNCTION hkl_detector_compute_kf ##### -->
-<para>
-
-</para>
-
- at self: 
- at g: 
- at kf: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-error.sgml b/Documentation/api/tmpl/hkl-error.sgml
deleted file mode 100644
index 90bf221..0000000
--- a/Documentation/api/tmpl/hkl-error.sgml
+++ /dev/null
@@ -1,132 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-error
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklError ##### -->
-<para>
-
-</para>
-
- at message: 
-
-<!-- ##### FUNCTION hkl_error_new ##### -->
-<para>
-
-</para>
-
- at format: 
- at Varargs: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_error_new_literal ##### -->
-<para>
-
-</para>
-
- at message: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_error_new_valist ##### -->
-<para>
-
-</para>
-
- at format: 
- at args: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_error_free ##### -->
-<para>
-
-</para>
-
- at error: 
-
-
-<!-- ##### FUNCTION hkl_error_new_copy ##### -->
-<para>
-
-</para>
-
- at error: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_error_set ##### -->
-<para>
-
-</para>
-
- at err: 
- at format: 
- at Varargs: 
-
-
-<!-- ##### FUNCTION hkl_error_set_literal ##### -->
-<para>
-
-</para>
-
- at err: 
- at message: 
-
-
-<!-- ##### FUNCTION hkl_error_propagate ##### -->
-<para>
-
-</para>
-
- at dest: 
- at src: 
-
-
-<!-- ##### FUNCTION hkl_error_clear ##### -->
-<para>
-
-</para>
-
- at err: 
-
-
-<!-- ##### FUNCTION hkl_error_prefix ##### -->
-<para>
-
-</para>
-
- at err: 
- at format: 
- at Varargs: 
-
-
-<!-- ##### FUNCTION hkl_error_propagate_prefixed ##### -->
-<para>
-
-</para>
-
- at dest: 
- at src: 
- at format: 
- at Varargs: 
-
-
diff --git a/Documentation/api/tmpl/hkl-geometry-factory.sgml b/Documentation/api/tmpl/hkl-geometry-factory.sgml
deleted file mode 100644
index a71c2b6..0000000
--- a/Documentation/api/tmpl/hkl-geometry-factory.sgml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-geometry-factory
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_geometry_factory_get_config_from_type ##### -->
-<para>
-
-</para>
-
- at type: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_factory_new ##### -->
-<para>
-
-</para>
-
- at config: 
- at Varargs: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-geometry.sgml b/Documentation/api/tmpl/hkl-geometry.sgml
deleted file mode 100644
index 2383662..0000000
--- a/Documentation/api/tmpl/hkl-geometry.sgml
+++ /dev/null
@@ -1,322 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-geometry
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklHolder ##### -->
-<para>
-
-</para>
-
- at geometry: 
- at q: 
-
-<!-- ##### STRUCT HklGeometryConfig ##### -->
-<para>
-
-</para>
-
- at name: 
- at type: 
-
-<!-- ##### STRUCT HklGeometry ##### -->
-<para>
-
-</para>
-
- at config: 
- at source: 
-
-<!-- ##### STRUCT HklGeometryList ##### -->
-<para>
-
-</para>
-
- at multiply: 
-
-<!-- ##### STRUCT HklGeometryListItem ##### -->
-<para>
-
-</para>
-
- at geometry: 
-
-<!-- ##### USER_FUNCTION HklGeometryListMultiplyFunction ##### -->
-<para>
-
-</para>
-
- at self: 
- at idx: 
-
-
-<!-- ##### FUNCTION hkl_holder_add_rotation_axis ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at x: 
- at y: 
- at z: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_new_copy ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_init_geometry ##### -->
-<para>
-
-</para>
-
- at self: 
- at src: 
-
-
-<!-- ##### FUNCTION hkl_geometry_add_holder ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_update ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_get_axis_by_name ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_randomize ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_set_values_v ##### -->
-<para>
-
-</para>
-
- at self: 
- at len: 
- at Varargs: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_distance ##### -->
-<para>
-
-</para>
-
- at self: 
- at geom: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_distance_orthodromic ##### -->
-<para>
-
-</para>
-
- at self: 
- at geom: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_closest_from_geometry_with_range ##### -->
-<para>
-
-</para>
-
- at self: 
- at ref: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_is_valid ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_fprintf ##### -->
-<para>
-
-</para>
-
- at file: 
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_add ##### -->
-<para>
-
-</para>
-
- at self: 
- at geometry: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_reset ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_sort ##### -->
-<para>
-
-</para>
-
- at self: 
- at ref: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_multiply ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_multiply_from_range ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_remove_invalid ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_len ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_is_empty ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_item_new ##### -->
-<para>
-
-</para>
-
- at geometry: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_geometry_list_item_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
diff --git a/Documentation/api/tmpl/hkl-interval.sgml b/Documentation/api/tmpl/hkl-interval.sgml
deleted file mode 100644
index 48d443d..0000000
--- a/Documentation/api/tmpl/hkl-interval.sgml
+++ /dev/null
@@ -1,177 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-interval
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklInterval ##### -->
-<para>
-
-</para>
-
- at min: 
- at max: 
-
-<!-- ##### FUNCTION hkl_interval_cmp ##### -->
-<para>
-
-</para>
-
- at self: 
- at interval: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_interval_plus_interval ##### -->
-<para>
-
-</para>
-
- at self: 
- at interval: 
-
-
-<!-- ##### FUNCTION hkl_interval_plus_double ##### -->
-<para>
-
-</para>
-
- at self: 
- at d: 
-
-
-<!-- ##### FUNCTION hkl_interval_minus_interval ##### -->
-<para>
-
-</para>
-
- at self: 
- at interval: 
-
-
-<!-- ##### FUNCTION hkl_interval_minus_double ##### -->
-<para>
-
-</para>
-
- at self: 
- at d: 
-
-
-<!-- ##### FUNCTION hkl_interval_times_interval ##### -->
-<para>
-
-</para>
-
- at self: 
- at interval: 
-
-
-<!-- ##### FUNCTION hkl_interval_times_double ##### -->
-<para>
-
-</para>
-
- at self: 
- at d: 
-
-
-<!-- ##### FUNCTION hkl_interval_divides_double ##### -->
-<para>
-
-</para>
-
- at self: 
- at d: 
-
-
-<!-- ##### FUNCTION hkl_interval_contain_zero ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_interval_cos ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_interval_acos ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_interval_sin ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_interval_asin ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_interval_tan ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_interval_atan ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_interval_length ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_interval_angle_restrict_symm ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
diff --git a/Documentation/api/tmpl/hkl-lattice.sgml b/Documentation/api/tmpl/hkl-lattice.sgml
deleted file mode 100644
index 9b5a0da..0000000
--- a/Documentation/api/tmpl/hkl-lattice.sgml
+++ /dev/null
@@ -1,136 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-lattice
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklLattice ##### -->
-<para>
-
-</para>
-
- at a: 
- at b: 
- at c: 
- at alpha: 
- at beta: 
- at gamma: 
-
-<!-- ##### FUNCTION hkl_lattice_new ##### -->
-<para>
-
-</para>
-
- at a: 
- at b: 
- at c: 
- at alpha: 
- at beta: 
- at gamma: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_lattice_new_copy ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_lattice_new_default ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_lattice_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_lattice_set ##### -->
-<para>
-
-</para>
-
- at self: 
- at a: 
- at b: 
- at c: 
- at alpha: 
- at beta: 
- at gamma: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_lattice_get_B ##### -->
-<para>
-
-</para>
-
- at self: 
- at B: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_lattice_get_1_B ##### -->
-<para>
-
-</para>
-
- at self: 
- at B: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_lattice_reciprocal ##### -->
-<para>
-
-</para>
-
- at self: 
- at r: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_lattice_randomize ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_lattice_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
diff --git a/Documentation/api/tmpl/hkl-list.sgml b/Documentation/api/tmpl/hkl-list.sgml
deleted file mode 100644
index a8a26d3..0000000
--- a/Documentation/api/tmpl/hkl-list.sgml
+++ /dev/null
@@ -1,129 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-list
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### MACRO HKL_LIST_LEN ##### -->
-<para>
-
-</para>
-
- at array: 
-
-
-<!-- ##### MACRO HKL_LIST ##### -->
-<para>
-
-</para>
-
- at type: 
- at name: 
-
-
-<!-- ##### MACRO HKL_LIST_INIT ##### -->
-<para>
-
-</para>
-
- at array: 
-
-
-<!-- ##### MACRO HKL_LIST_ALLOC ##### -->
-<para>
-
-</para>
-
- at array: 
- at len: 
-
-
-<!-- ##### MACRO HKL_LIST_COPY ##### -->
-<para>
-
-</para>
-
- at dst: 
- at src: 
-
-
-<!-- ##### MACRO HKL_LIST_FREE ##### -->
-<para>
-
-</para>
-
- at array: 
-
-
-<!-- ##### MACRO HKL_LIST_FREE_DESTRUCTOR ##### -->
-<para>
-
-</para>
-
- at array: 
- at destructor: 
-
-
-<!-- ##### MACRO HKL_LIST_RESIZE ##### -->
-<para>
-
-</para>
-
- at array: 
- at len: 
-
-
-<!-- ##### MACRO HKL_LIST_ADD_VALUE ##### -->
-<para>
-
-</para>
-
- at array: 
- at value: 
-
-
-<!-- ##### MACRO HKL_LIST_DEL ##### -->
-<para>
-
-</para>
-
- at array: 
- at idx: 
-
-
-<!-- ##### MACRO HKL_LIST_DEL_DESTRUCTOR ##### -->
-<para>
-
-</para>
-
- at array: 
- at idx: 
- at destructor: 
-
-
-<!-- ##### MACRO HKL_LIST_DEL_ITEM_DESTRUCTOR ##### -->
-<para>
-
-</para>
-
- at array: 
- at item: 
- at destructor: 
-
-
diff --git a/Documentation/api/tmpl/hkl-macros.sgml b/Documentation/api/tmpl/hkl-macros.sgml
deleted file mode 100644
index bfbe2bb..0000000
--- a/Documentation/api/tmpl/hkl-macros.sgml
+++ /dev/null
@@ -1,213 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-macros
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### MACRO HKL_BEGIN_DECLS ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_END_DECLS ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO INFINITY ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO M_PI ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO M_PI_2 ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_MAJOR ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_MINOR ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_PATCH ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_VERSION ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_TRUE ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_FALSE ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_SUCCESS ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_FAIL ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_TINY ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_EPSILON ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_DEGTORAD ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_RADTODEG ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_TAU ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO HKL_EULERIAN_KAPPA_SOLUTION ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### MACRO hkl_assert ##### -->
-<para>
-
-</para>
-
- at x: 
-
-
-<!-- ##### MACRO G_GNUC_PRINTF ##### -->
-<para>
-
-</para>
-
- at format_idx: 
- at arg_idx: 
-
-
-<!-- ##### MACRO alloc_nr ##### -->
-<para>
-
-</para>
-
- at x: 
-
-
-<!-- ##### MACRO ALLOC_GROW ##### -->
-<para>
-
-</para>
-
- at x: 
- at nr: 
- at alloc: 
-
-
-<!-- ##### MACRO NORETURN ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### FUNCTION hkl_printbt ##### -->
-<para>
-
-</para>
-
- at void: 
-
-
-<!-- ##### MACRO HKL_MALLOC ##### -->
-<para>
-
-</para>
-
- at type: 
-
-
diff --git a/Documentation/api/tmpl/hkl-matrix.sgml b/Documentation/api/tmpl/hkl-matrix.sgml
deleted file mode 100644
index 9f346bc..0000000
--- a/Documentation/api/tmpl/hkl-matrix.sgml
+++ /dev/null
@@ -1,152 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-matrix
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklMatrix ##### -->
-<para>
-
-</para>
-
- at data: 
-
-<!-- ##### FUNCTION hkl_matrix_init ##### -->
-<para>
-
-</para>
-
- at self: 
- at m11: 
- at m12: 
- at m13: 
- at m21: 
- at m22: 
- at m23: 
- at m31: 
- at m32: 
- at m33: 
-
-
-<!-- ##### FUNCTION hkl_matrix_init_from_two_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at v1: 
- at v2: 
-
-
-<!-- ##### FUNCTION hkl_matrix_init_from_euler ##### -->
-<para>
-
-</para>
-
- at self: 
- at euler_x: 
- at euler_y: 
- at euler_z: 
-
-
-<!-- ##### FUNCTION hkl_matrix_fprintf ##### -->
-<para>
-
-</para>
-
- at file: 
- at self: 
-
-
-<!-- ##### FUNCTION hkl_matrix_to_euler ##### -->
-<para>
-
-</para>
-
- at self: 
- at euler_x: 
- at euler_y: 
- at euler_z: 
-
-
-<!-- ##### FUNCTION hkl_matrix_cmp ##### -->
-<para>
-
-</para>
-
- at self: 
- at m: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_matrix_times_matrix ##### -->
-<para>
-
-</para>
-
- at self: 
- at m: 
-
-
-<!-- ##### FUNCTION hkl_matrix_times_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at v: 
-
-
-<!-- ##### FUNCTION hkl_matrix_transpose ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_matrix_det ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_matrix_solve ##### -->
-<para>
-
-</para>
-
- at self: 
- at x: 
- at b: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_matrix_is_null ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-parameter.sgml b/Documentation/api/tmpl/hkl-parameter.sgml
deleted file mode 100644
index d250316..0000000
--- a/Documentation/api/tmpl/hkl-parameter.sgml
+++ /dev/null
@@ -1,178 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-parameter
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklParameter ##### -->
-<para>
-
-</para>
-
- at name: 
- at range: 
- at value: 
- at unit: 
- at punit: 
- at fit: 
- at changed: 
-
-<!-- ##### FUNCTION hkl_parameter_new ##### -->
-<para>
-
-</para>
-
- at name: 
- at min: 
- at value: 
- at max: 
- at fit: 
- at changed: 
- at unit: 
- at punit: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_parameter_new_copy ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_parameter_init ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at min: 
- at value: 
- at max: 
- at fit: 
- at changed: 
- at unit: 
- at punit: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_parameter_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_parameter_set_value ##### -->
-<para>
-
-</para>
-
- at self: 
- at value: 
-
-
-<!-- ##### FUNCTION hkl_parameter_get_value_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_parameter_set_value_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at value: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_parameter_get_max ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_parameter_get_range_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at min: 
- at max: 
-
-
-<!-- ##### FUNCTION hkl_parameter_set_range ##### -->
-<para>
-
-</para>
-
- at self: 
- at min: 
- at max: 
-
-
-<!-- ##### FUNCTION hkl_parameter_set_range_unit ##### -->
-<para>
-
-</para>
-
- at self: 
- at min: 
- at max: 
-
-
-<!-- ##### FUNCTION hkl_parameter_randomize ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_parameter_is_valid ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_parameter_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-auto.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-auto.sgml
deleted file mode 100644
index c5d2fcd..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-auto.sgml
+++ /dev/null
@@ -1,36 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-auto
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_mode_set_real ##### -->
-<para>
-
-</para>
-
- at self: 
- at engine: 
- at geometry: 
- at detector: 
- at sample: 
- at error: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-common-eulerians.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-common-eulerians.sgml
deleted file mode 100644
index 03c0f8c..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-common-eulerians.sgml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-common-eulerians
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_eulerians_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-common-hkl.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-common-hkl.sgml
deleted file mode 100644
index d10639f..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-common-hkl.sgml
+++ /dev/null
@@ -1,114 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-common-hkl
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION RUBh_minus_Q_func ##### -->
-<para>
-
-</para>
-
- at x: 
- at params: 
- at f: 
- at Returns: 
-
-
-<!-- ##### FUNCTION double_diffraction_func ##### -->
-<para>
-
-</para>
-
- at x: 
- at params: 
- at f: 
- at Returns: 
-
-
-<!-- ##### FUNCTION psi_constant_vertical_func ##### -->
-<para>
-
-</para>
-
- at x: 
- at params: 
- at f: 
- at Returns: 
-
-
-<!-- ##### FUNCTION RUBh_minus_Q ##### -->
-<para>
-
-</para>
-
- at x: 
- at params: 
- at f: 
- at Returns: 
-
-
-<!-- ##### FUNCTION double_diffraction ##### -->
-<para>
-
-</para>
-
- at x: 
- at params: 
- at f: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_mode_get_hkl_real ##### -->
-<para>
-
-</para>
-
- at self: 
- at engine: 
- at geometry: 
- at detector: 
- at sample: 
- at error: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real ##### -->
-<para>
-
-</para>
-
- at base: 
- at engine: 
- at geometry: 
- at detector: 
- at sample: 
- at error: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_hkl_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-common-psi.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-common-psi.sgml
deleted file mode 100644
index ec8888e..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-common-psi.sgml
+++ /dev/null
@@ -1,51 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-common-psi
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklPseudoAxisEngineModePsi ##### -->
-<para>
-
-</para>
-
- at parent: 
- at Q0: 
- at hkl0: 
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_mode_psi_new ##### -->
-<para>
-
-</para>
-
- at name: 
- at axes_names_len: 
- at axes_names: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_psi_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-common-q.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-common-q.sgml
deleted file mode 100644
index 52a2d98..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-common-q.sgml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-common-q
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_q_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_q2_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-common.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-common.sgml
deleted file mode 100644
index 2c8eb29..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-common.sgml
+++ /dev/null
@@ -1,35 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-common
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_init_func ##### -->
-<para>
-
-</para>
-
- at self: 
- at engine: 
- at geometry: 
- at detector: 
- at sample: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-e4cv.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-e4cv.sgml
deleted file mode 100644
index df3dab9..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-e4cv.sgml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-e4cv
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_e4cv_hkl_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_e4cv_psi_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-e6c.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-e6c.sgml
deleted file mode 100644
index a7dc6ed..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-e6c.sgml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-e6c
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_e6c_hkl_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_e6c_psi_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-factory.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-factory.sgml
deleted file mode 100644
index dee48d7..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-factory.sgml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-factory
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_factory ##### -->
-<para>
-
-</para>
-
- at config: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-k4cv.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-k4cv.sgml
deleted file mode 100644
index 357ba17..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-k4cv.sgml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-k4cv
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_k4cv_hkl_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_k4cv_psi_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-k6c.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-k6c.sgml
deleted file mode 100644
index 9fde552..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-k6c.sgml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-k6c
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_k6c_hkl_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_k6c_psi_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis-zaxis.sgml b/Documentation/api/tmpl/hkl-pseudoaxis-zaxis.sgml
deleted file mode 100644
index 4c3ce3b..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis-zaxis.sgml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis-zaxis
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_zaxis_hkl_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-pseudoaxis.sgml b/Documentation/api/tmpl/hkl-pseudoaxis.sgml
deleted file mode 100644
index 042ac5d..0000000
--- a/Documentation/api/tmpl/hkl-pseudoaxis.sgml
+++ /dev/null
@@ -1,337 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-pseudoaxis
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklPseudoAxis ##### -->
-<para>
-
-</para>
-
- at parent: 
- at engine: 
-
-<!-- ##### STRUCT HklPseudoAxisEngineMode ##### -->
-<para>
-
-</para>
-
- at name: 
- at initialize: 
- at get: 
- at set: 
- at geometry_init: 
- at detector_init: 
- at sample_init: 
-
-<!-- ##### STRUCT HklPseudoAxisEngine ##### -->
-<para>
-
-</para>
-
- at name: 
- at geometry: 
- at detector: 
- at sample: 
- at mode: 
- at engines: 
-
-<!-- ##### STRUCT HklPseudoAxisEngineList ##### -->
-<para>
-
-</para>
-
- at geometries: 
- at geometry: 
- at detector: 
- at sample: 
-
-<!-- ##### USER_FUNCTION HklPseudoAxisEngineModeFunc ##### -->
-<para>
-
-</para>
-
- at self: 
- at engine: 
- at geometry: 
- at detector: 
- at sample: 
- at error: 
- at Returns: 
-
-
-<!-- ##### USER_FUNCTION HklFunction ##### -->
-<para>
-
-</para>
-
- at x: 
- at params: 
- at f: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_new ##### -->
-<para>
-
-</para>
-
- at parameter: 
- at engine: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_init ##### -->
-<para>
-
-</para>
-
- at self: 
- at parameter: 
- at engine: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_mode_new ##### -->
-<para>
-
-</para>
-
- at name: 
- at initialize: 
- at get: 
- at set: 
- at n: 
- at Varargs: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_mode_init ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at initialize: 
- at get: 
- at set: 
- at n_func: 
- at functions: 
- at n_p: 
- at parameters: 
- at n_axes: 
- at axes_names: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_mode_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_new ##### -->
-<para>
-
-</para>
-
- at name: 
- at n: 
- at Varargs: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_add_mode ##### -->
-<para>
-
-</para>
-
- at self: 
- at mode: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_add_geometry ##### -->
-<para>
-
-</para>
-
- at self: 
- at x: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_select_mode ##### -->
-<para>
-
-</para>
-
- at self: 
- at idx: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_initialize ##### -->
-<para>
-
-</para>
-
- at self: 
- at error: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_set ##### -->
-<para>
-
-</para>
-
- at self: 
- at error: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_get ##### -->
-<para>
-
-</para>
-
- at self: 
- at error: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_add ##### -->
-<para>
-
-</para>
-
- at self: 
- at engine: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_get_by_name ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_clear ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_init ##### -->
-<para>
-
-</para>
-
- at self: 
- at geometry: 
- at detector: 
- at sample: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_get ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_pseudo_axis_engine_list_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
diff --git a/Documentation/api/tmpl/hkl-quaternion.sgml b/Documentation/api/tmpl/hkl-quaternion.sgml
deleted file mode 100644
index 378e70c..0000000
--- a/Documentation/api/tmpl/hkl-quaternion.sgml
+++ /dev/null
@@ -1,133 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-quaternion
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklQuaternion ##### -->
-<para>
-
-</para>
-
- at data: 
-
-<!-- ##### FUNCTION hkl_quaternion_init ##### -->
-<para>
-
-</para>
-
- at self: 
- at a: 
- at b: 
- at c: 
- at d: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_init_from_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at v: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_init_from_angle_and_axe ##### -->
-<para>
-
-</para>
-
- at self: 
- at angle: 
- at v: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_fprintf ##### -->
-<para>
-
-</para>
-
- at file: 
- at self: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_cmp ##### -->
-<para>
-
-</para>
-
- at self: 
- at q: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_minus_quaternion ##### -->
-<para>
-
-</para>
-
- at self: 
- at q: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_times_quaternion ##### -->
-<para>
-
-</para>
-
- at self: 
- at q: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_norm2 ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_conjugate ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_to_matrix ##### -->
-<para>
-
-</para>
-
- at self: 
- at m: 
-
-
-<!-- ##### FUNCTION hkl_quaternion_to_angle_and_axe ##### -->
-<para>
-
-</para>
-
- at self: 
- at angle: 
- at v: 
-
-
diff --git a/Documentation/api/tmpl/hkl-sample.sgml b/Documentation/api/tmpl/hkl-sample.sgml
deleted file mode 100644
index ab8a323..0000000
--- a/Documentation/api/tmpl/hkl-sample.sgml
+++ /dev/null
@@ -1,359 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-sample
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklSample ##### -->
-<para>
-
-</para>
-
- at name: 
- at type: 
- at lattice: 
- at U: 
- at UB: 
- at ux: 
- at uy: 
- at uz: 
-
-<!-- ##### STRUCT HklSampleReflection ##### -->
-<para>
-
-</para>
-
- at geometry: 
- at detector: 
- at hkl: 
- at _hkl: 
- at flag: 
-
-<!-- ##### STRUCT HklSampleList ##### -->
-<para>
-
-</para>
-
- at current: 
-
-<!-- ##### ENUM HklSampleType ##### -->
-<para>
-
-</para>
-
- at HKL_SAMPLE_TYPE_MONOCRYSTAL: 
-
-<!-- ##### FUNCTION hkl_sample_new ##### -->
-<para>
-
-</para>
-
- at name: 
- at type: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_new_copy ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_sample_set_name ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
-
-
-<!-- ##### FUNCTION hkl_sample_set_lattice ##### -->
-<para>
-
-</para>
-
- at self: 
- at a: 
- at b: 
- at c: 
- at alpha: 
- at beta: 
- at gamma: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_set_U_from_euler ##### -->
-<para>
-
-</para>
-
- at self: 
- at x: 
- at y: 
- at z: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_get_UB ##### -->
-<para>
-
-</para>
-
- at self: 
- at UB: 
-
-
-<!-- ##### FUNCTION hkl_sample_set_UB ##### -->
-<para>
-
-</para>
-
- at self: 
- at UB: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_add_reflection ##### -->
-<para>
-
-</para>
-
- at self: 
- at geometry: 
- at detector: 
- at h: 
- at k: 
- at l: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_get_ith_reflection ##### -->
-<para>
-
-</para>
-
- at self: 
- at idx: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_del_reflection ##### -->
-<para>
-
-</para>
-
- at self: 
- at idx: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_compute_UB_busing_levy ##### -->
-<para>
-
-</para>
-
- at self: 
- at idx1: 
- at idx2: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_affine ##### -->
-<para>
-
-</para>
-
- at sample: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_get_reflection_mesured_angle ##### -->
-<para>
-
-</para>
-
- at self: 
- at idx1: 
- at idx2: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_get_reflection_theoretical_angle ##### -->
-<para>
-
-</para>
-
- at self: 
- at idx1: 
- at idx2: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
-<!-- ##### FUNCTION hkl_sample_reflection_set_hkl ##### -->
-<para>
-
-</para>
-
- at self: 
- at h: 
- at k: 
- at l: 
-
-
-<!-- ##### FUNCTION hkl_sample_reflection_set_flag ##### -->
-<para>
-
-</para>
-
- at self: 
- at flag: 
-
-
-<!-- ##### FUNCTION hkl_sample_reflection_set_geometry ##### -->
-<para>
-
-</para>
-
- at self: 
- at geometry: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_new ##### -->
-<para>
-
-</para>
-
- at void: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_free ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_append ##### -->
-<para>
-
-</para>
-
- at self: 
- at sample: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_clear ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_del ##### -->
-<para>
-
-</para>
-
- at self: 
- at sample: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_len ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_get_ith ##### -->
-<para>
-
-</para>
-
- at self: 
- at idx: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_get_by_name ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_get_idx_from_name ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_select_current ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_sample_list_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
diff --git a/Documentation/api/tmpl/hkl-source.sgml b/Documentation/api/tmpl/hkl-source.sgml
deleted file mode 100644
index ea00eb0..0000000
--- a/Documentation/api/tmpl/hkl-source.sgml
+++ /dev/null
@@ -1,87 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-source
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### MACRO HKL_SOURCE_DEFAULT_WAVE_LENGTH ##### -->
-<para>
-
-</para>
-
-
-
-<!-- ##### STRUCT HklSource ##### -->
-<para>
-
-</para>
-
- at wave_length: 
- at direction: 
-
-<!-- ##### FUNCTION hkl_source_init ##### -->
-<para>
-
-</para>
-
- at self: 
- at wave_length: 
- at x: 
- at y: 
- at z: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_source_cmp ##### -->
-<para>
-
-</para>
-
- at self: 
- at s: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_source_compute_ki ##### -->
-<para>
-
-</para>
-
- at self: 
- at ki: 
-
-
-<!-- ##### FUNCTION hkl_source_get_wavelength ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_source_fprintf ##### -->
-<para>
-
-</para>
-
- at f: 
- at self: 
-
-
diff --git a/Documentation/api/tmpl/hkl-unit.sgml b/Documentation/api/tmpl/hkl-unit.sgml
deleted file mode 100644
index efa648e..0000000
--- a/Documentation/api/tmpl/hkl-unit.sgml
+++ /dev/null
@@ -1,51 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-unit
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklUnit ##### -->
-<para>
-
-</para>
-
- at type: 
- at name: 
- at repr: 
-
-<!-- ##### FUNCTION hkl_unit_compatible ##### -->
-<para>
-
-</para>
-
- at self: 
- at unit: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_unit_factor ##### -->
-<para>
-
-</para>
-
- at self: 
- at unit: 
- at Returns: 
-
-
diff --git a/Documentation/api/tmpl/hkl-unused.sgml b/Documentation/api/tmpl/hkl-unused.sgml
deleted file mode 100644
index 73b4c94..0000000
--- a/Documentation/api/tmpl/hkl-unused.sgml
+++ /dev/null
@@ -1,38 +0,0 @@
-<!-- ##### FUNCTION die ##### -->
-<para>
-
-</para>
-
- at err: 
-
-<!-- ##### FUNCTION hkl_geometry_get_axis_idx_by_name ##### -->
-<para>
-
-</para>
-
- at self: 
- at name: 
- at Returns: 
-
-<!-- ##### FUNCTION set_die_routine ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### FUNCTION set_warning_routine ##### -->
-<para>
-
-</para>
-
- at const char *err, va_list params:
-
-
-<!-- ##### FUNCTION warning ##### -->
-<para>
-
-</para>
-
- at err: 
- at Varargs: 
-
diff --git a/Documentation/api/tmpl/hkl-vector.sgml b/Documentation/api/tmpl/hkl-vector.sgml
deleted file mode 100644
index 65512f5..0000000
--- a/Documentation/api/tmpl/hkl-vector.sgml
+++ /dev/null
@@ -1,278 +0,0 @@
-<!-- ##### SECTION Title ##### -->
-hkl-vector
-
-<!-- ##### SECTION Short_Description ##### -->
-
-
-<!-- ##### SECTION Long_Description ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION See_Also ##### -->
-<para>
-
-</para>
-
-<!-- ##### SECTION Stability_Level ##### -->
-
-
-<!-- ##### SECTION Image ##### -->
-
-
-<!-- ##### STRUCT HklMatrix ##### -->
-<para>
-
-</para>
-
- at data: 
-
-<!-- ##### STRUCT HklQuaternion ##### -->
-<para>
-
-</para>
-
- at data: 
-
-<!-- ##### STRUCT HklVector ##### -->
-<para>
-
-</para>
-
- at data: 
-
-<!-- ##### FUNCTION hkl_vector_init ##### -->
-<para>
-
-</para>
-
- at self: 
- at x: 
- at y: 
- at z: 
-
-
-<!-- ##### FUNCTION hkl_vector_fprintf ##### -->
-<para>
-
-</para>
-
- at file: 
- at self: 
-
-
-<!-- ##### FUNCTION hkl_vector_cmp ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_is_opposite ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_add_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
-
-
-<!-- ##### FUNCTION hkl_vector_minus_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
-
-
-<!-- ##### FUNCTION hkl_vector_div_double ##### -->
-<para>
-
-</para>
-
- at self: 
- at d: 
-
-
-<!-- ##### FUNCTION hkl_vector_times_double ##### -->
-<para>
-
-</para>
-
- at self: 
- at d: 
-
-
-<!-- ##### FUNCTION hkl_vector_times_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
-
-
-<!-- ##### FUNCTION hkl_vector_times_matrix ##### -->
-<para>
-
-</para>
-
- at self: 
- at m: 
-
-
-<!-- ##### FUNCTION hkl_vector_sum ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_scalar_product ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_vectorial_product ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
-
-
-<!-- ##### FUNCTION hkl_vector_angle ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_oriented_angle ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
- at ref: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_norm2 ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_normalize ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_is_colinear ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_randomize ##### -->
-<para>
-
-</para>
-
- at self: 
-
-
-<!-- ##### FUNCTION hkl_vector_randomize_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector: 
-
-
-<!-- ##### FUNCTION hkl_vector_randomize_vector_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at vector1: 
- at vector2: 
-
-
-<!-- ##### FUNCTION hkl_vector_rotated_around_vector ##### -->
-<para>
-
-</para>
-
- at self: 
- at axe: 
- at angle: 
-
-
-<!-- ##### FUNCTION hkl_vector_rotated_quaternion ##### -->
-<para>
-
-</para>
-
- at self: 
- at qr: 
-
-
-<!-- ##### FUNCTION hkl_vector_is_null ##### -->
-<para>
-
-</para>
-
- at self: 
- at Returns: 
-
-
-<!-- ##### FUNCTION hkl_vector_project_on_plan ##### -->
-<para>
-
-</para>
-
- at self: 
- at plan: 
-
-
diff --git a/Documentation/figures/3S+1D.asy b/Documentation/figures/3S+1D.asy
new file mode 100644
index 0000000..e044966
--- /dev/null
+++ b/Documentation/figures/3S+1D.asy
@@ -0,0 +1,34 @@
+import diffractometer;
+
+currentprojection=orthographic(-1,1,1);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
+
+void diffractometer(real tth, real omega, real chi, real phi)
+{
+  real hight = 3*10;
+  real detector_arm_support_radius= 2*10;
+  real detector_arm_length = 3*10;
+  real diffractometer_support_radius = 1.5*10;
+
+  // tpp
+  draw(tpp(hight, diffractometer_support_radius), gray);
+
+  // support
+  draw(support_e4cv(hight, detector_arm_support_radius, diffractometer_support_radius), gray);
+
+  // detector part
+  draw(rotate(-tth, Y) * detector_arm(detector_arm_length, detector_arm_support_radius, 1), red);
+
+  // sample part
+  draw(rotate(-omega, Y) * chi_circle(diffractometer_support_radius, 1), cyan);
+  draw(rotate(-omega, Y) * rotate(chi, X) * rotate(-phi, Y) * sample_holder(diffractometer_support_radius, 1), yellow);
+}
+
+diffractometer(0, 0, 0, 0);
diff --git a/Documentation/figures/3S+1D.png b/Documentation/figures/3S+1D.png
new file mode 100644
index 0000000..d2a9c5e
Binary files /dev/null and b/Documentation/figures/3S+1D.png differ
diff --git a/Documentation/figures/4S+2D.asy b/Documentation/figures/4S+2D.asy
new file mode 100644
index 0000000..1d36f20
--- /dev/null
+++ b/Documentation/figures/4S+2D.asy
@@ -0,0 +1,34 @@
+import diffractometer;
+
+currentprojection=orthographic(-1,1,1);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
+
+void diffractometer(real gamma, real delta,
+		    real mu, real omega, real chi, real phi)
+{
+  real hight = 3*10;
+  real detector_arm_support_radius= 2*10;
+  real detector_arm_length = 3*10;
+  real diffractometer_support_radius = 1.5*10;
+
+  // tpp
+  draw(tpp(hight, diffractometer_support_radius), gray);
+
+  // detector part
+  draw(rotate(gamma, Z) * _support(hight, detector_arm_support_radius, 1, 1, true), blue);
+  draw(rotate(gamma, Z) * rotate(-delta, Y) * detector_arm(detector_arm_length, detector_arm_support_radius, 1), red);
+
+  // sample part
+  draw(rotate(mu, Z) * _support(hight-5, diffractometer_support_radius, 1, 1, true), green);
+  draw(rotate(mu, Z) * rotate(-omega, Y) * chi_circle(diffractometer_support_radius, 1), cyan);
+  draw(rotate(mu, Z) * rotate(-omega, Y) * rotate(chi, X) * rotate(-phi, Y) * sample_holder(diffractometer_support_radius, 1), yellow);
+}
+
+diffractometer(0, 0, 0, 0, 0, 0);
diff --git a/Documentation/figures/4S+2D.png b/Documentation/figures/4S+2D.png
new file mode 100644
index 0000000..b00330e
Binary files /dev/null and b/Documentation/figures/4S+2D.png differ
diff --git a/Documentation/figures/4S+2D_reciprocal.asy b/Documentation/figures/4S+2D_reciprocal.asy
new file mode 100644
index 0000000..00b44e8
--- /dev/null
+++ b/Documentation/figures/4S+2D_reciprocal.asy
@@ -0,0 +1,58 @@
+import three;
+
+triple a = (1,0,0);
+triple b = (.31,.95,0);
+triple c = (.4,.5,0.76);
+
+currentprojection=orthographic(2 * (-0.5*X+Y+.5*Z)+ 3*Z + Y, target=3*Z+Y);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-3*X)--(X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-Y)--(Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-2*Z)--(2*Z), gray, Arrow3());
+
+
+// La construction d'Ewald
+void ewald(triple ki, real gamma, real delta, real alpha, real phi)
+{
+  real k = length(ki);
+  triple kf =  rotate(gamma, Z) * rotate(-delta, Y) * ki;
+  triple Q = kf-ki;
+  triple Qyz = Q.y*Y+Q.z*Z;
+  triple Qxy = Q.x*X+Q.y*Y;
+  triple C = -ki;
+  
+  // Vecteurs incident et diffract�
+  draw(Label("$\vec{k_i}$", .5, S), shift(-ki)*(O--ki), blue, Arrow3());
+  draw(Label("$\vec{k_f}$"), shift(-ki)*(O--kf), green, Arrow3());
+  
+  // Vecteur de diffraction
+  draw(Label("$\vec{Q}$", 1), O--Q, red, Arrow3());
+
+  // angle vartheta
+  draw(Label("$\theta$"), arc(O, Qyz, Q), red, Arrow3());
+  
+  // angle vartheta
+  draw(Label("$\vartheta$"), arc(O, Y, Qyz), red, Arrow3());
+  
+  draw(O--Qyz, gray, Arrow3());
+  draw(O--Qxy, gray+dashed);
+  draw(C--Qxy, gray, Arrow3());
+  draw(Label("$2\theta$", align=W), arc(C, C/2, Q), red, Arrow3());
+  draw(Label("$\gamma$", align=SW), arc(C, C/2, Qxy), red, Arrow3());
+  draw(Label("$\delta$"), arc(C, C+(Qxy-C)/2, Q), red, Arrow3());
+
+  // projections
+  draw(Q--Qyz, gray+dashed);
+  draw(Q--Qxy, gray+dashed);
+  
+  // Ewalds sphere
+  surface Ewalds = shift(-ki) * rotate(90, Y) * scale3(k) * unithemisphere;
+  draw(Ewalds, green+opacity(0.3), render(compression=Zero,merge=true));
+  dot(Label("C"), C);
+}
+
+ewald(2*X, -30, 40, 60, -60);
diff --git a/Documentation/figures/4S+2D_reciprocal.png b/Documentation/figures/4S+2D_reciprocal.png
new file mode 100644
index 0000000..c3a7323
Binary files /dev/null and b/Documentation/figures/4S+2D_reciprocal.png differ
diff --git a/Documentation/figures/4S+2D_reciprocal2.asy b/Documentation/figures/4S+2D_reciprocal2.asy
new file mode 100644
index 0000000..a571e51
--- /dev/null
+++ b/Documentation/figures/4S+2D_reciprocal2.asy
@@ -0,0 +1,50 @@
+import three;
+
+triple a = (1,0,0);
+triple b = (.31,.95,0);
+triple c = (.4,.5,0.76);
+
+currentprojection=orthographic(2 * (-0.5*X+Y+.5*Z)+ 3*Z + Y, target=3*Z+Y);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-3*X)--(X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-Y)--(Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-2*Z)--(2*Z), gray, Arrow3());
+
+
+// La construction d'Ewald
+void ewald(triple ki, real gamma, real delta, real alpha, real phi)
+{
+  real k = length(ki);
+  triple kf =  rotate(gamma, Z) * rotate(-delta, Y) * ki;
+  triple Q = kf-ki;
+  triple n = rotate(phi, Y) * rotate(alpha, X) * scale3(length(Q)) * Y;
+  triple nyz = n.y*Y+n.z*Z;
+
+  // Vecteurs incident et diffract�
+  draw(Label("$\vec{k_i}$", .5, S), shift(-ki)*(O--ki), blue, Arrow3());
+  draw(Label("$\vec{k_f}$"), shift(-ki)*(O--kf), green, Arrow3());
+  
+  // Vecteur de diffraction
+  draw(Label("$\vec{Q}$", 1), O--Q, red, Arrow3());
+
+  // angle varphi
+  draw(Label("$\varphi$"), arc(O, (n.y*Y+n.z*Z), n), orange, Arrow3());
+  
+  // angle alpha
+  draw(Label("$\alpha$"), arc(O, Y, (n.y*Y+n.z*Z)), orange, Arrow3());
+  
+  draw(Label("$\vec{n}$", 1), O--n, orange, Arrow3());
+  draw(O--nyz, gray, Arrow3());
+  draw(n--nyz, gray+dashed);
+  
+  // Ewalds sphere
+  surface Ewalds = shift(-ki) * rotate(90, Y) * scale3(k) * unithemisphere;
+  draw(Ewalds, green+opacity(0.3), render(compression=Zero,merge=true));
+  dot(Label("C"), -ki);
+}
+
+ewald(2*X, -30, 40, 60, -60);
diff --git a/Documentation/figures/4S+2D_reciprocal2.png b/Documentation/figures/4S+2D_reciprocal2.png
new file mode 100644
index 0000000..8287a83
Binary files /dev/null and b/Documentation/figures/4S+2D_reciprocal2.png differ
diff --git a/Documentation/figures/4S+2D_reciprocal3.asy b/Documentation/figures/4S+2D_reciprocal3.asy
new file mode 100644
index 0000000..a57525e
--- /dev/null
+++ b/Documentation/figures/4S+2D_reciprocal3.asy
@@ -0,0 +1,48 @@
+import three;
+
+triple a = (1,0,0);
+triple b = (.31,.95,0);
+triple c = (.4,.5,0.76);
+
+currentprojection=orthographic(2 * (-0.5*X+Y+.5*Z)+ 3*Z + Y, target=3*Z+Y);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-3*X)--(X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-Y)--(Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-2*Z)--(2*Z), gray, Arrow3());
+
+
+// La construction d'Ewald
+void ewald(triple ki, real gamma, real delta, real alpha, real phi)
+{
+  real k = length(ki);
+  triple kf =  rotate(gamma, Z) * rotate(-delta, Y) * ki;
+  triple Q = kf-ki;
+  triple n = rotate(phi, Y) * rotate(alpha, X) * scale3(length(Q)) * Y;
+
+  // incomming and outgoing beam
+  draw(Label("$\vec{k_i}$", .5, S), shift(-ki)*(O--ki), blue, Arrow3());
+  draw(Label("$\vec{k_f}$"), shift(-ki)*(O--kf), green, Arrow3());
+  
+  // diffraction vector
+  draw(Label("$\vec{Q}$", 1), O--Q, red, Arrow3());
+
+  // ref vector
+  draw(Label("$\vec{n}$", 1), O--n, orange, Arrow3());
+  
+  // angle tau
+  draw(Label("$\tau$"), arc(O, Q, n), red, ArcArrow3());
+  
+  // angle psi
+  draw(Label("$\psi$", .5, E), circle(Q, .2k, Q), red, ArcArrow3);
+  
+  // Ewalds sphere
+  surface Ewalds = shift(-ki) * rotate(90, Y) * scale3(k) * unithemisphere;
+  draw(Ewalds, green+opacity(0.3), render(compression=Zero,merge=true));
+  dot(Label("C"), -ki);
+}
+
+ewald(2*X, -30, 40, 60, -60);
diff --git a/Documentation/figures/4S+2D_reciprocal3.png b/Documentation/figures/4S+2D_reciprocal3.png
new file mode 100644
index 0000000..e5fa768
Binary files /dev/null and b/Documentation/figures/4S+2D_reciprocal3.png differ
diff --git a/Documentation/figures/4S+2D_reciprocal4.asy b/Documentation/figures/4S+2D_reciprocal4.asy
new file mode 100644
index 0000000..8ee469e
--- /dev/null
+++ b/Documentation/figures/4S+2D_reciprocal4.asy
@@ -0,0 +1,54 @@
+import three;
+
+triple a = (1,0,0);
+triple b = (.31,.95,0);
+triple c = (.4,.5,0.76);
+
+currentprojection=orthographic(2 * (-0.5*X+Y+.5*Z)+ 3*Z + Y, target=3*Z+Y);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-3*X)--(X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-Y)--(Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-2*Z)--(2*Z), gray, Arrow3());
+
+// La construction d'Ewald
+void ewald(triple ki, real gamma, real delta, real alpha, real phi)
+{
+  real k = length(ki);
+  triple kf =  rotate(gamma, Z) * rotate(-delta, Y) * ki;
+  triple Q = kf-ki;
+  triple n = rotate(phi, Y) * rotate(alpha, X) * scale3(length(Q)) * Y;
+  triple np = planeproject(Q, O) * n;
+  triple xp = unit(Q);
+  triple zp = cross(xp, -X);
+  triple yp = length(np) * unit(cross(xp, zp));
+  
+  // incomming and outgoing beam
+  draw(Label("$\vec{k_i}$", .5, S), shift(-ki)*(O--ki), blue, Arrow3());
+  draw(Label("$\vec{k_f}$"), shift(-ki)*(O--kf), green, Arrow3());
+  draw(surface(plane(Q, ki)), blue+opacity(.3));
+  
+  // diffraction vector
+  draw(Label("$\vec{Q}$", 1), O--Q, red, Arrow3());
+  draw(circle(O, length(np), Q), red+dashed);
+
+  // ref vector and its projection
+  draw(Label("$\vec{n}$", 1), O--n, orange, Arrow3());
+  draw(O--np, gray, Arrow3());
+  draw(n--np, gray+dashed);
+
+  // psi angle and its origin
+  draw(O--yp, gray, Arrow3());
+  draw(Label("$\psi$"), arc(O, yp, np), red, ArcArrow3());
+  draw(surface(O--arc(O, yp, np)--cycle), red);
+  
+  // Ewalds sphere
+  surface Ewalds = shift(-ki) * rotate(90, Y) * scale3(k) * unithemisphere;
+  draw(Ewalds, green+opacity(0.3), render(compression=Zero,merge=true));
+  dot(Label("C"), -ki);
+}
+
+ewald(2*X, -30, 40, 60, -60);
diff --git a/Documentation/figures/4S+2D_reciprocal4.png b/Documentation/figures/4S+2D_reciprocal4.png
new file mode 100644
index 0000000..b45c9a4
Binary files /dev/null and b/Documentation/figures/4S+2D_reciprocal4.png differ
diff --git a/Documentation/figures/B_a.asy b/Documentation/figures/B_a.asy
new file mode 100644
index 0000000..6b0f55e
--- /dev/null
+++ b/Documentation/figures/B_a.asy
@@ -0,0 +1,26 @@
+import three;
+
+size(6cm);
+
+triple b1 = (1, 0, 0);
+triple b2 = (.31, .95, 0);
+triple b3 = (.4, .5, 0.76);
+
+triple a1 = cross(b2, b3);
+triple a2 = cross(b3, b1);
+triple a3 = cross(b1, b2);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), O--(2*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), O--(2*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), O--(2*Z), gray, Arrow3());
+
+// reciprocal space
+draw(Label("$\vec{b_1}$", 1), O--b1, blue, Arrow3());
+draw(Label("$\vec{b_2}$", 1), O--b2, red, Arrow3());
+draw(Label("$\vec{b_3}$", 1), O--b3, green, Arrow3());
+
+// real space
+draw(Label("$\vec{a_1}$", 1), O--a1, cyan, Arrow3());
+draw(Label("$\vec{a_2}$", 1), O--a2, magenta, Arrow3());
+draw(Label("$\vec{a_3}$", 1), O--a3, yellow, Arrow3());
diff --git a/Documentation/figures/B_a.png b/Documentation/figures/B_a.png
new file mode 100644
index 0000000..8386225
Binary files /dev/null and b/Documentation/figures/B_a.png differ
diff --git a/Documentation/figures/B_b.asy b/Documentation/figures/B_b.asy
new file mode 100644
index 0000000..1be2509
--- /dev/null
+++ b/Documentation/figures/B_b.asy
@@ -0,0 +1,23 @@
+import three;
+
+size(6cm);
+
+triple b1 = (1, 0, 0);
+triple b2 = (.31, .95, 0);
+triple b3 = (.4, .5, 0.76);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), O--(2*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), O--(2*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), O--(2*Z), gray, Arrow3());
+
+// plan
+draw(plane(2*X, 2*Y));
+draw(plane(2*X, 2*Z));
+draw(plane(2*Y, 2*Z));
+
+// reciprocal space
+draw(Label("$\vec{b_1}$", 1), O--b1, blue, Arrow3());
+draw(Label("$\vec{b_2}$", 1), O--b2, red, Arrow3());
+draw(Label("$\vec{b_3}$", 1), O--b3, green, Arrow3());
+
diff --git a/Documentation/figures/B_b.png b/Documentation/figures/B_b.png
new file mode 100644
index 0000000..9da9b59
Binary files /dev/null and b/Documentation/figures/B_b.png differ
diff --git a/Documentation/figures/B_b3_y.asy b/Documentation/figures/B_b3_y.asy
new file mode 100644
index 0000000..164da95
--- /dev/null
+++ b/Documentation/figures/B_b3_y.asy
@@ -0,0 +1,29 @@
+import three;
+
+currentprojection=orthographic(1,0,0);
+currentlight=White;
+
+size(6cm);
+
+triple b1 = (1, 0, 0);
+triple b2 = (.31, .95, 0);
+triple b3 = (.4, .5, 0.76);
+
+triple a1 = cross(b2, b3);
+triple a2 = cross(b3, b1);
+triple a3 = cross(b1, b2);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1, S), O--(2*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), O--(2*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), O--(2*Z), gray, Arrow3());
+
+// real space
+draw(Label("$\vec{b_1}$", 1, E), O--b1, blue, Arrow3());
+draw(Label("$\vec{b_2}$", 1), O--b2, red, Arrow3());
+draw(Label("$\vec{b_3}$", 1), O--b3, green, Arrow3());
+
+// reciprocal space
+draw(Label("$\vec{a_1}$", 1), O--a1, cyan, Arrow3());
+draw(Label("$\vec{b_2}$", 1), O--a2, magenta, Arrow3());
+draw(Label("$\vec{c_3}$", 1), O--a3, yellow, Arrow3());
diff --git a/Documentation/figures/B_b3_y.png b/Documentation/figures/B_b3_y.png
new file mode 100644
index 0000000..c696fcf
Binary files /dev/null and b/Documentation/figures/B_b3_y.png differ
diff --git a/Documentation/figures/Makefile.am b/Documentation/figures/Makefile.am
new file mode 100644
index 0000000..953158a
--- /dev/null
+++ b/Documentation/figures/Makefile.am
@@ -0,0 +1,49 @@
+.asy.png:
+	@ASY@ -config "" -render=4 -f png -o $@ $<
+
+.asy.pdf:
+	@ASY@ -config "" -render=0 -f pdf -noprc -o $@ $<
+
+dist_noinst_DATA = \
+	3S+1D.png \
+	B_b3_y.png \
+	B_a.png \
+	B_b.png \
+	crystal.png \
+	4S+2D.png \
+	4S+2D_reciprocal.png \
+	4S+2D_reciprocal2.png \
+	4S+2D_reciprocal3.png \
+	4S+2D_reciprocal4.png \
+	k4cv.png \
+	k6c.png \
+	zaxis.png \
+	e2k_1.png \
+	e2k_2.png \
+	e2k_3.png \
+	e2k_4.png \
+	qper_qpar.png
+
+MAINTAINERCLEANFILES = $(dist_noinst_DATA)
+
+EXTRA_DIST = \
+	3S+1D.asy \
+	B_b3_y.asy \
+	B_a.asy \
+	B_b.asy \
+	crystal.asy \
+	4S+2D.asy \
+	4S+2D_reciprocal.asy \
+	4S+2D_reciprocal2.asy \
+	4S+2D_reciprocal3.asy \
+	4S+2D_reciprocal4.asy \
+	k4cv.asy \
+	k6c.asy \
+	diffractometer.asy \
+	zaxis.asy \
+	eulerians.asy \
+	e2k_1.asy \
+	e2k_2.asy \
+	e2k_3.asy \
+	e2k_4.asy \
+	qper_qpar.asy
diff --git a/Documentation/figures/Makefile.in b/Documentation/figures/Makefile.in
new file mode 100644
index 0000000..2565ed5
--- /dev/null
+++ b/Documentation/figures/Makefile.in
@@ -0,0 +1,526 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = Documentation/figures
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(dist_noinst_DATA)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+DATA = $(dist_noinst_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+dist_noinst_DATA = \
+	3S+1D.png \
+	B_b3_y.png \
+	B_a.png \
+	B_b.png \
+	crystal.png \
+	4S+2D.png \
+	4S+2D_reciprocal.png \
+	4S+2D_reciprocal2.png \
+	4S+2D_reciprocal3.png \
+	4S+2D_reciprocal4.png \
+	k4cv.png \
+	k6c.png \
+	zaxis.png \
+	e2k_1.png \
+	e2k_2.png \
+	e2k_3.png \
+	e2k_4.png \
+	qper_qpar.png
+
+MAINTAINERCLEANFILES = $(dist_noinst_DATA)
+EXTRA_DIST = \
+	3S+1D.asy \
+	B_b3_y.asy \
+	B_a.asy \
+	B_b.asy \
+	crystal.asy \
+	4S+2D.asy \
+	4S+2D_reciprocal.asy \
+	4S+2D_reciprocal2.asy \
+	4S+2D_reciprocal3.asy \
+	4S+2D_reciprocal4.asy \
+	k4cv.asy \
+	k6c.asy \
+	diffractometer.asy \
+	zaxis.asy \
+	eulerians.asy \
+	e2k_1.asy \
+	e2k_2.asy \
+	e2k_3.asy \
+	e2k_4.asy \
+	qper_qpar.asy
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .asy .pdf .png
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Documentation/figures/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu Documentation/figures/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.asy.png:
+	@ASY@ -config "" -render=4 -f png -o $@ $<
+
+.asy.pdf:
+	@ASY@ -config "" -render=0 -f pdf -noprc -o $@ $<
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Documentation/figures/crystal.asy b/Documentation/figures/crystal.asy
new file mode 100644
index 0000000..c23b452
--- /dev/null
+++ b/Documentation/figures/crystal.asy
@@ -0,0 +1,52 @@
+import three;
+
+triple a = (1,0,0);
+triple b = (.31,.95,0);
+triple c = (.4,.5,0.76);
+
+surface atome(triple position, real radius)
+{
+  return shift(position) * scale3(radius) * unitsphere;
+}
+
+surface atomes(triple a, triple b, triple c, real radius)
+{
+  surface s;
+  
+  s.append( atome(O, radius) );
+  s.append( atome(a, radius) );
+  s.append( atome(b, radius) );
+  s.append( atome(c, radius) );
+  s.append( atome(a+b, radius) );
+  s.append( atome(a+c, radius) );
+  s.append( atome(b+c, radius) );
+  s.append( atome(a+b+c, radius) );
+
+  return s;
+}
+
+path3[] frames(triple a, triple b, triple c)
+{
+  return O--a--a+b--b--O--c--c+a--c+a+b--c+b--c^^
+    a--a+c^^
+    a+b--a+b+c^^
+    b--b+c;
+}
+
+currentprojection=orthographic(1, 1, .2);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates without x to not be disturbed for the a vector
+draw(Label("$\vec{x}$", 1), O--(2*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), O--(2*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), O--(Z), gray, Arrow3());
+
+draw(atomes(a, b, c, .05), blue);
+draw(frames(a, b, c), gray);
+
+// real space
+draw(Label("$\vec{a}$", 1), O--a, blue, Arrow3());
+draw(Label("$\vec{b}$", 1), O--b, red, Arrow3());
+draw(Label("$\vec{c}$", 1), O--c, green, Arrow3());
diff --git a/Documentation/figures/crystal.png b/Documentation/figures/crystal.png
new file mode 100644
index 0000000..5eacfb1
Binary files /dev/null and b/Documentation/figures/crystal.png differ
diff --git a/Documentation/figures/diffractometer.asy b/Documentation/figures/diffractometer.asy
new file mode 100644
index 0000000..c745256
--- /dev/null
+++ b/Documentation/figures/diffractometer.asy
@@ -0,0 +1,180 @@
+import three;
+import solids;
+
+restricted surface unitsolidcylinder = surface(unitcylinder,
+					       unitdisk,
+					       shift(Z)*unitdisk);
+
+surface torus(real R, real a, real theta1, real theta2)
+{
+  //return surface(revolution(reverse(Circle(R*X,a,Y,32)),Z,90,345));
+
+  triple f(pair t) {
+    return ((R+a*cos(t.y))*cos(t.x),(R+a*cos(t.y))*sin(t.x),a*sin(t.y));
+  }
+
+  surface s = surface(f, (radians(theta1),0), (radians(theta2),2pi), 8, 8, Spline);
+
+  return s;
+}
+
+surface carrow(real radius, real a,
+	       real theta1, real theta2, int direction)
+{
+  surface s;
+  
+  s.append(torus(radius, a, theta1, theta2));
+
+  if (direction < 0)
+    s.append( rotate(theta1, Z) * shift(radius, 0, 0) * rotate(90., X) * scale(2*a, 2*a, 6*a) * unitsolidcone );
+  else
+    s.append( rotate(theta2, Z) * shift(radius, 0, 0) * rotate(-90., X) * scale(2*a, 2*a, 6*a) * unitsolidcone );
+
+  return s;
+}
+
+surface tpp(real height, real radius)
+{
+  // put the centre of the top surface of the cube at the origin
+  surface s=shift(-0.5, -0.5, -1) * unitcube;
+  s = shift(0, 0, -height) * scale(3*radius, 3*radius, radius/5) * s;
+  return s;
+}
+
+surface _support(real hight, real radius, int arrow1, int arrow2, bool draw_cylinder=false)
+{
+  surface s;
+  real alpha = 0.1;
+  real dx = alpha * radius;
+  real dz = radius * sqrt(alpha * (2-alpha));
+
+  // becarefulle reference of the unitsolidcylinder and the unitcube are not
+  // at the same place, so me must take this into account.
+  if(draw_cylinder)
+    s.append( shift(0, 0, -hight) * scale(radius, radius, radius/5) * unitsolidcylinder );
+  s.append( shift(-dz, -radius+dx, -hight) * scale(2*dz, dx, hight) * unitcube );
+  s.append( shift(0, -radius+2*dx, 0) * rotate(90, X) * scale(dz, dz, dx) * unitsolidcylinder );
+
+  if (arrow1 != 0)
+    s.append( shift(0, -radius+1.5*dx, 0) * rotate(90, X) * carrow(1.3 * dz, 0.5, 0., 90., arrow1) );
+
+  if(arrow2 != 0)
+    s.append( shift(0, 0, -hight+radius/5+.5) * carrow(.8*radius, .5, 0, 90, arrow2) );
+
+  return s;
+}
+
+surface detector_arm(real length, real radius, int arrow1)
+{
+  surface s;
+  real alpha = 0.1;
+  real dx = alpha * radius;
+  real dz = radius*sqrt(alpha*(2-alpha));
+
+  s.append( shift(-dz, -radius+dx+.1, -dz) * scale(length+dz, dx, 2*dz) * unitcube );
+  s.append( shift(length, -radius+dx+.2, -dz) * scale(-dx, radius-dx-.2, 2*dz) * unitcube );
+  s.append( shift(length-dx, 0, 0) * rotate(90, Y) * scale(dz, dz, dx) * unitsolidcylinder );
+
+  if(arrow1 != 0)
+    s.append( shift(0, -radius+1.5dx,0) * rotate(90, X) * carrow(1.3 * dz, 0.5, 0., 90., arrow1) );
+
+  return s;
+}
+
+surface sample_holder(real radius, int arrow1)
+{
+  surface s;
+  real alpha = 0.1;
+  real dx = alpha * radius;
+  real dz = radius*sqrt(alpha*(2-alpha));
+
+  s.append( shift(0, -.8*(radius-dx), 0) * rotate(90, X) * scale(dz/2, dz/2, 0.15*(radius-dx)) *unitsolidcylinder );
+  s.append( shift(0, -.8*(radius-dx), 0) * rotate(90, X) * scale(dz, dz, dx) *shift(-.5, -.5, -1) * unitcube );
+
+  if(arrow1 != 0)
+    s.append( shift(0, -.8*(radius-dx)+dx, 0) * rotate(90, X) * carrow(0.15*(radius-dx), .3, 0, 270, arrow1) );
+
+  return s;
+}
+
+/*************/
+/* Eulerians */
+/*************/
+
+surface support_e4cv(real hight, real detector, real sample)
+{
+  surface s;
+  s.append( _support(hight, detector, 0, 0, true) );
+  s.append( _support(hight, sample, 1, 0, false) );
+
+  return s;
+}
+
+surface chi_circle(real radius, int arrow1)
+{
+  surface s;
+  real alpha = 0.1;
+  real dx = alpha * radius;
+  real dz = radius*sqrt(alpha*(2-alpha));
+
+  // create a revolution surface
+  triple p1 = (radius-dx-.1)*Y-(dz/2)*X;
+  triple p2 = p1 + dz*X;
+  triple p3 = p2 - (.1*(radius-dx-.1) * Y);
+  triple p4 = p3 - dz*X;
+  path3 p= p1--p2--p3--p4--cycle;
+
+  s.append( surface(O, p, X) );
+
+  if(arrow1 != 0)
+    s.append( rotate(90, Y) * rotate(-90, Z) * carrow(.7 * (radius-dx-.1), .5, -90, 90, arrow1) );
+
+  return s;
+}
+
+/*********/
+/* Kappa */
+/*********/
+
+surface support_k4cv(real hight, real detector, real sample)
+{
+  surface s;
+  s.append( _support(hight, detector, 0, 0, true) );
+  s.append( _support(hight, sample, 0, 0, false) );
+
+  return s;
+}
+
+surface komega_circle(real radius, int arrow1, real kalpha=50)
+{
+  surface s;
+  real alpha = 0.1;
+  real dx = alpha * radius;
+  real dz = radius*sqrt(alpha*(2-alpha));
+  real hight = radius * sin(radians(kalpha) / 2);
+
+  s.append(shift(-dz, -radius+dx, -hight) * scale(2*dz, dx, 2 * hight) * unitcube);
+  s.append(rotate(kalpha, X) * shift(-dz, -radius+dx, -hight) * scale(2*dz, dx, 2 * hight) * unitcube);
+  
+  if(arrow1 != 0)
+    s.append( shift(0, -radius+1.5dx,0) * rotate(90, X) * carrow(1.3 * dz, 0.5, 0., 90., arrow1) );
+
+  return s;
+}
+
+surface kappa_circle(real radius, int arrow1, real kalpha=50)
+{
+  surface s;
+  real alpha = 0.1;
+  real dx = alpha * radius;
+  real dz = radius*sqrt(alpha*(2-alpha));
+  real hight = (radius-dx) * sin(radians(kalpha) / 2);
+
+  s.append(shift(-dz, -radius+dx+dx, -hight) * scale(2*dz, dx, 2 * hight) * unitcube);
+  s.append(rotate(kalpha, X) * shift(-dz, -radius+dx+dx, -hight) * scale(2*dz, dx, 2 * hight) * unitcube);
+  
+  if(arrow1 != 0)
+    s.append( rotate(kalpha, X) * shift(0, -radius+dx+dx+dx, 0) * rotate(90, X) * carrow(.6*dz, .3, 0, 270, arrow1) );
+ 
+  return s;
+}
diff --git a/Documentation/figures/e2k_1.asy b/Documentation/figures/e2k_1.asy
new file mode 100644
index 0000000..5e2e5a0
--- /dev/null
+++ b/Documentation/figures/e2k_1.asy
@@ -0,0 +1,13 @@
+import eulerians;
+
+currentprojection=orthographic(-1,1,1);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
+
+eulerians(0, 0, 0);
diff --git a/Documentation/figures/e2k_1.png b/Documentation/figures/e2k_1.png
new file mode 100644
index 0000000..e054dee
Binary files /dev/null and b/Documentation/figures/e2k_1.png differ
diff --git a/Documentation/figures/e2k_2.asy b/Documentation/figures/e2k_2.asy
new file mode 100644
index 0000000..358c50d
--- /dev/null
+++ b/Documentation/figures/e2k_2.asy
@@ -0,0 +1,13 @@
+import eulerians;
+
+currentprojection=orthographic(-1,1,1);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
+
+eulerians(0, 0, 0, solution=0);
diff --git a/Documentation/figures/e2k_2.png b/Documentation/figures/e2k_2.png
new file mode 100644
index 0000000..2845306
Binary files /dev/null and b/Documentation/figures/e2k_2.png differ
diff --git a/Documentation/figures/e2k_3.asy b/Documentation/figures/e2k_3.asy
new file mode 100644
index 0000000..754ea60
--- /dev/null
+++ b/Documentation/figures/e2k_3.asy
@@ -0,0 +1,13 @@
+import eulerians;
+
+currentprojection=orthographic(-1,1,1);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
+
+eulerians(0, 90, 0);
diff --git a/Documentation/figures/e2k_3.png b/Documentation/figures/e2k_3.png
new file mode 100644
index 0000000..00cb5af
Binary files /dev/null and b/Documentation/figures/e2k_3.png differ
diff --git a/Documentation/figures/e2k_4.asy b/Documentation/figures/e2k_4.asy
new file mode 100644
index 0000000..38639d8
--- /dev/null
+++ b/Documentation/figures/e2k_4.asy
@@ -0,0 +1,13 @@
+import eulerians;
+
+currentprojection=orthographic(-1,1,1);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
+
+eulerians(0, 90, 0, solution=0);
diff --git a/Documentation/figures/e2k_4.png b/Documentation/figures/e2k_4.png
new file mode 100644
index 0000000..7eed153
Binary files /dev/null and b/Documentation/figures/e2k_4.png differ
diff --git a/Documentation/figures/eulerians.asy b/Documentation/figures/eulerians.asy
new file mode 100644
index 0000000..d26bf5c
--- /dev/null
+++ b/Documentation/figures/eulerians.asy
@@ -0,0 +1,36 @@
+import diffractometer;
+
+void eulerians(real omega, real chi, real phi, real kalpha=50, int solution=1)
+{
+  real hight = 3*10;
+  real detector_arm_support_radius= 2*10;
+  real detector_arm_length = 3*10;
+  real diffractometer_support_radius = 1.5*10;
+  triple KAPPA = -cos(radians(kalpha))*Y - sin(radians(kalpha))*Z;
+  real komega;
+  real kappa;
+  real kphi;
+  real p = degrees(asin(tan(radians(chi/2.))/tan(radians(kalpha))));
+
+  if (solution == 1){
+    komega = omega - p + 90;
+    kappa = degrees(2 * asin(sin(radians(chi/2.))/sin(radians(kalpha))));
+    kphi = phi - p - 90;
+  }else{
+    komega = omega + p - 90;
+    kappa = degrees(-2 * asin(sin(radians(chi/2.))/sin(radians(kalpha))));
+    kphi = phi + p + 90;
+  }
+  
+  // support
+  draw(_support(hight, diffractometer_support_radius, 0, 0, true), blue);
+
+  // eulerian part
+  draw(rotate(-omega, Y) * chi_circle(diffractometer_support_radius, 1), cyan+opacity(.8));
+  //draw(rotate(-omega, Y) * rotate(chi, X) * rotate(-phi, Y) * sample_holder(diffractometer_support_radius, 1), yellow);
+
+  // kappa part
+  draw(rotate(-komega, Y) * komega_circle(diffractometer_support_radius, 1, kalpha=kalpha), green);
+  draw(rotate(-komega, Y) * rotate(kappa, KAPPA) * kappa_circle(diffractometer_support_radius, 1, kalpha=kalpha), cyan);
+  draw(rotate(-komega, Y) * rotate(kappa, KAPPA) * rotate(-kphi, Y) * sample_holder(diffractometer_support_radius, 1), yellow);
+}
diff --git a/Documentation/figures/k4cv.asy b/Documentation/figures/k4cv.asy
new file mode 100644
index 0000000..bebc76d
--- /dev/null
+++ b/Documentation/figures/k4cv.asy
@@ -0,0 +1,36 @@
+import diffractometer;
+
+currentprojection=orthographic(-1,1,1);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
+
+void diffractometer(real tth, real komega, real kappa, real kphi, real kalpha=50)
+{
+  real hight = 3*10;
+  real detector_arm_support_radius= 2*10;
+  real detector_arm_length = 3*10;
+  real diffractometer_support_radius = 1.5*10;
+  triple KAPPA = -cos(radians(kalpha))*Y - sin(radians(kalpha))*Z;
+
+  // tpp
+  draw(tpp(hight, diffractometer_support_radius), gray);
+
+  // support
+  draw(support_k4cv(hight, detector_arm_support_radius, diffractometer_support_radius), gray);
+
+  // detector part
+  draw(rotate(-tth, Y) * detector_arm(detector_arm_length, detector_arm_support_radius, 1), red);
+
+  // sample part
+  draw(rotate(-komega, Y) * komega_circle(diffractometer_support_radius, 1, kalpha=kalpha), magenta);
+  draw(rotate(-komega, Y) * rotate(kappa, KAPPA) * kappa_circle(diffractometer_support_radius, 1, kalpha=kalpha), cyan);
+  draw(rotate(-komega, Y) * rotate(kappa, KAPPA) * rotate(-kphi, Y) * sample_holder(diffractometer_support_radius, 1), yellow);
+}
+
+diffractometer(0, 0, 0, 0, kalpha=50);
diff --git a/Documentation/figures/k4cv.png b/Documentation/figures/k4cv.png
new file mode 100644
index 0000000..e799ce6
Binary files /dev/null and b/Documentation/figures/k4cv.png differ
diff --git a/Documentation/figures/k6c.asy b/Documentation/figures/k6c.asy
new file mode 100644
index 0000000..cf0af82
--- /dev/null
+++ b/Documentation/figures/k6c.asy
@@ -0,0 +1,35 @@
+import diffractometer;
+
+currentprojection=orthographic(-1,1,1);
+currentlight=White;
+
+size(12cm);
+
+// orthonormal coordinates
+draw(Label("$\vec{x}$", 1), (-40*X)--(40*X), gray, Arrow3());
+draw(Label("$\vec{y}$", 1), (-30*Y)--(30*Y), gray, Arrow3());
+draw(Label("$\vec{z}$", 1), (-30*Z)--(30*Z), gray, Arrow3());
+
+void diffractometer(real gamma, real delta, real mu, real komega, real kappa, real kphi, real kalpha=50)
+{
+  real hight = 3*10;
+  real detector_arm_support_radius= 2*10;
+  real detector_arm_length = 3*10;
+  real diffractometer_support_radius = 1.5*10;
+  triple KAPPA = -cos(radians(kalpha))*Y - sin(radians(kalpha))*Z;
+
+  // tpp
+  draw(tpp(hight, diffractometer_support_radius), gray);
+
+  // detector part
+  draw(rotate(gamma, Z) * _support(hight, detector_arm_support_radius, 0, 1, true), blue);
+  draw(rotate(delta, -Y) * detector_arm(detector_arm_length, detector_arm_support_radius, 1), red);
+
+  // sample part
+  draw(rotate(mu, Z) * _support(hight-5, diffractometer_support_radius, 0, 1, true), green);
+  draw(rotate(mu, Z) * rotate(komega, -Y) * komega_circle(diffractometer_support_radius, 1, kalpha=kalpha), magenta);
+  draw(rotate(mu, Z) * rotate(komega, -Y) * rotate(kappa, KAPPA) * kappa_circle(diffractometer_support_radius, 1, kalpha=kalpha), cyan);
+  draw(rotate(mu, Z) * rotate(komega, -Y) * rotate(kappa, KAPPA) * rotate(kphi, -Y) * sample_holder(diffractometer_support_radius, 1), yellow);
+}
+
+diffractometer(0, 0, 0, 0, 0, 0, kalpha=50);
diff --git a/Documentation/figures/k6c.png b/Documentation/figures/k6c.png
new file mode 100644
index 0000000..fceefb5
Binary files /dev/null and b/Documentation/figures/k6c.png differ
diff --git a/Documentation/figures/qper_qpar.asy b/Documentation/figures/qper_qpar.asy
new file mode 100644
index 0000000..ac504a7
--- /dev/null
+++ b/Documentation/figures/qper_qpar.asy
@@ -0,0 +1,66 @@
+import solids;
+
+size(300,0);
+
+real k = 2;
+real delta = 30;
+real gamma = 10;
+real mu = 10;
+
+// points
+triple C = unit((-1, 0, 0)) * k;
+triple O = O;
+triple Q = rotate(-delta, Y) * rotate(gamma, Z) * (-C) + C;
+
+// vectors
+triple ki = -C;
+triple kf = Q - C;
+
+// Planes
+pen bg = gray(0.9) + opacity(0.5);
+
+real r = 1.5;
+pen p = rgb(0,0.7,0);
+draw( Label("$x$",1), O--r*X, p, Arrow3(HookHead3));
+draw( Label("$y$",1), O--r*Y, p, Arrow3(HookHead3));
+draw( Label("$z$",1), O--r*Z, p, Arrow3(HookHead3));
+label("$O$", (0,0,0), W);
+
+// draw the ki vector
+path3 ki_p = shift(C) * (O--ki);
+//draw(Label("$\vec{k_i}$", .5), ki_p, blue, Arrow3);
+
+// kf
+path3 kf_p = shift(C) * (O--kf);
+//draw(Label("$\vec{k_f}$", .5), kf_p, blue, Arrow3);
+
+// Q
+path3 Q_p = O--Q;
+draw(Label("$\vec{Q}$", 1), Q_p, red, Arrow3);
+
+// draw the dots
+dot("$C$", C, p);
+
+// rotation plan define by the rotation axis
+triple n = rotate(mu, Z) * Y;
+draw( Label("$\vec{n}$", 1), O--n, blue, Arrow3(HookHead3));
+
+// project Q on n -> Qper
+triple Qper = planeproject(n, Q) * O;
+draw( Label("$\vec{Q_{per}}$", 1), O--Qper, blue, Arrow3(HookHead3));
+draw(Q--Qper, dashed+red);
+
+// compute Qpar
+triple Qpar = Q - Qper;
+draw( Label("$\vec{Q_{par}}$", 1), O--Qpar, blue, Arrow3(HookHead3));
+draw(Q--Qpar, dashed+red);
+
+// n and x0z plane
+path3 plan = plane(Qpar.z * Z, (Qpar-(Qpar.z * Z)));
+path3 plan_n = scale(4, 4, 1) * scale3(2) * shift(-Qpar / 2.) * plan;
+path3 plan_xOz = scale3(2) * shift(-(C+Qpar.z * Z)/ 2.) * plane(Qpar.z * Z, C);
+
+draw(surface(plan_n), blue+opacity(0.1));
+draw(plan_n, blue);
+draw(surface(plan_xOz), green+opacity(0.1));
+draw(plan_xOz, green);
diff --git a/Documentation/figures/qper_qpar.png b/Documentation/figures/qper_qpar.png
new file mode 100644
index 0000000..2d1458b
Binary files /dev/null and b/Documentation/figures/qper_qpar.png differ
diff --git a/Documentation/figures/zaxis.asy b/Documentation/figures/zaxis.asy
new file mode 100644
index 0000000..2466fa3
--- /dev/null
+++ b/Documentation/figures/zaxis.asy
@@ -0,0 +1,71 @@
+import solids;
+
+size(300,0);
+
+real k = 2;
+real delta = 30;
+real gamma = 10;
+real mu = 10;
+
+// points
+triple C = unit((-1, 0, 0)) * k;
+triple O = O;
+triple P1 = rotate(-delta, Y) * rotate(gamma, Z) * (-C) + C;
+
+// vectors
+triple ki = -C;
+triple kf = P1 - C;
+
+// Planes
+pen bg = gray(0.9) + opacity(0.5);
+
+real r = 1.5;
+pen p = rgb(0,0.7,0);
+draw( Label("$x$",1), O--r*X, p, Arrow3(HookHead3));
+draw( Label("$y$",1), O--r*Y, p, Arrow3(HookHead3));
+draw( Label("$z$",1), O--r*Z, p, Arrow3(HookHead3));
+label("$O$", (0,0,0), W);
+
+// draw the ki vector
+path3 ki_p = shift(C) * (O--ki);
+draw(Label("$\vec{k_i}$", .5), ki_p, red, Arrow3);
+
+// kf
+path3 kf_p = shift(C) * (O--kf);
+draw(Label("$\vec{k_f}$", .5), kf_p, red, Arrow3);
+
+// Q
+path3 Q_p = O--P1;
+draw(Label("$\vec{Q}$", .5), Q_p, red, Arrow3);
+
+// draw the dots
+dot("$C$", C, p);
+dot("$P_1$", P1, blue);
+
+// rotation plan define by the rotation axis
+triple omega = rotate(mu, Z) * -Y;
+draw( Label("$\Omega$", 1), O--omega, blue, Arrow3(HookHead3));
+
+// circle generated by the revolution of P around omega
+triple C1 = planeproject(omega, P1) * O;
+triple C2 = planeproject(omega, P1) * ki;
+dot("$C_1$", C1, blue);
+draw(O--C1, dashed+blue);
+path3 Pcircle = circle(C1, length(P1-C1), omega);
+draw(Pcircle, dashed+blue);
+
+// Ewalds sphere
+surface Ewalds = shift(C) * scale3(k) * unitsphere;
+draw(Ewalds, green+opacity(0.3), render(compression=Zero,merge=true));
+
+// intersection points of this Cricle with the Ewalds sphere
+// and the arc, ATTENTION problem de precision lors du calcul
+// des intersections. Pour l'instant ne pas utiliser delta > 160
+triple P2 = rotate(180, C1, C2) * P1;
+path3 Parc = arc(C1, P1, P2, omega, CW);
+draw(C1--P1, blue);
+dot("$P_2$", P2, blue);
+draw(C1--P2, blue);
+draw(Parc, blue, Arrows3());
+
+
diff --git a/Documentation/figures/zaxis.png b/Documentation/figures/zaxis.png
new file mode 100644
index 0000000..47b6b21
Binary files /dev/null and b/Documentation/figures/zaxis.png differ
diff --git a/Documentation/hkl.info b/Documentation/hkl.info
index 7d471ff..837684a 100644
--- a/Documentation/hkl.info
+++ b/Documentation/hkl.info
@@ -1,10 +1,9 @@
-This is hkl.info, produced by makeinfo version 4.13 from hkl.texi.
+This is hkl.info, produced by makeinfo version 5.1 from hkl.texi.
 
-This manual is for hkl Library (version 4.0.3, 1 May 2010).
+This manual is for hkl Library (version 4.99.99.1610, 14 May 2013).
 
-   Copyright (C) 2003-2010 Synchrotron SOLEIL
-L'Orme des Merisiers Saint-Aubin                        BP 48 91192
-GIF-sur-YVETTE CEDEX
+   Copyright (C) 2003-2010 Synchrotron SOLEIL L'Orme des Merisiers
+Saint-Aubin BP 48 91192 GIF-sur-YVETTE CEDEX
 
      The hkl library is free software: you can redistribute it and/or
      modify it under the terms of the GNU General Public License as
@@ -13,13 +12,12 @@ GIF-sur-YVETTE CEDEX
 
      The hkl library 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
+     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 the hkl library.  If not, see
      <http://www.gnu.org/licenses/>.
-
 INFO-DIR-SECTION Software libraries
 START-INFO-DIR-ENTRY
 * hkl: (hkl).           Library for hkl diffraction computation.
@@ -31,24 +29,27 @@ File: hkl.info,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
 hkl Diffraction Library
 ***********************
 
-This manual is for Hkl Diffraction Library (version 4.0.3, 1 May 2010).
+This manual is for Hkl Diffraction Library (version 4.99.99.1610, 14 May
+2013).
 
 * Menu:
 
-* Introduction::
-* Diffractometer::
-* Developpement::
-* Index::
+* Introduction::                
+* Diffractometer::              
+* Developpement::               
+* Index::                       
 
- --- The Detailed Node Listing ---
+ -- The Detailed Node Listing --
 
 Diffractometer
 
-* Eulerian 4 circles vertical::
-* Eulerian 6 circles::
-* Kappa 4 circles vertical::
-* Kappa 6 circles::
-* Z-axis::
+* Eulerian 4 circles::          
+* Eulerian 6 circles::          
+* Kappa 4 circles vertical::    
+* Kappa 6 circles::             
+* Z-axis::                      
+* SOLEIL SIXS MED2+2::          
+
 
 
 File: hkl.info,  Node: Introduction,  Next: Diffractometer,  Prev: Top,  Up: Top
@@ -57,7 +58,7 @@ File: hkl.info,  Node: Introduction,  Next: Diffractometer,  Prev: Top,  Up: Top
 **************
 
 The purpose of the library is to factories diffraction angles
-computation for different kind of diffractometers geometries. It is
+computation for different kind of diffractometers geometries.  It is
 used at the SOLEIL, Desy and Alba synchrotron with the Tango control
 system to pilot diffractometers.
 
@@ -66,19 +67,14 @@ system to pilot diffractometers.
 
    * mode computation (aka PseudoAxis)
         * for different diffractometer geometries.
-
    * UB matrix computation.
         * busing & Levy with 2 reflections
-
-        * simplex computation with more than 2 reflections using the
-          GSL library.
-
+        * simplex computation with more than 2 reflections using the GSL
+          library.
         * Eulerians angles to pre-orientate your sample.
-
    * Crystal lattice affinement
         * with more than 2 reflections you can select which parameter
           must be fitted.
-
    * Pseudoaxes
         * psi, eulerians, q, ...
 
@@ -88,9 +84,7 @@ system to pilot diffractometers.
 In all this document the next convention will be used to describe the
 diffractometers geometries.
    * right handed convention for all the angles.
-
    * direct space orthogonal base.
-
    * description of the diffractometer geometries is done with all axes
      values set to zero.
 
@@ -102,117 +96,131 @@ File: hkl.info,  Node: Diffractometer,  Next: Developpement,  Prev: Introduction
 
 * Menu:
 
-* Eulerian 4 circles vertical::
-* Eulerian 6 circles::
-* Kappa 4 circles vertical::
-* Kappa 6 circles::
-* Z-axis::
+* Eulerian 4 circles::          
+* Eulerian 6 circles::          
+* Kappa 4 circles vertical::    
+* Kappa 6 circles::             
+* Z-axis::                      
+* SOLEIL SIXS MED2+2::          
 
 
-File: hkl.info,  Node: Eulerian 4 circles vertical,  Next: Eulerian 6 circles,  Prev: Diffractometer,  Up: Diffractometer
+File: hkl.info,  Node: Eulerian 4 circles,  Next: Eulerian 6 circles,  Prev: Diffractometer,  Up: Diffractometer
 
-2.1 Eulerian 4 circles vertical
-===============================
+2.1 Eulerian 4 circles
+======================
 
-2.1.1 Geometry
---------------
+2.1.1 Geometries
+----------------
 
-   * xrays source fix allong the \vecx direction (1, 0, 0)
+2.1.1.1 Vertical
+................
 
+   * xrays source fix allong the \vec{x} direction (1, 0, 0)
    * 3 axes for the sample
-        * `omega' : rotating around the -\vecy direction (0, -1, 0)
+        * 'omega' : rotating around the -\vec{y} direction (0, -1, 0)
+        * 'chi' : rotating around the \vec{x} direction (1, 0, 0)
+        * 'phi' : rotating around the -\vec{y} direction (0, -1, 0)
+   * 1 axis for the detector
+        * 'tth' : rotation around the -\vec{y} direction (0, -1, 0)
 
-        * `chi' : rotating around the \vecx direction (1, 0, 0)
+2.1.1.2 Horizontal
+..................
 
-        * `phi' : rotating around the -\vecy direction (0, -1, 0)
+   * xrays source fix allong the \vec{x} direction (1, 0, 0)
+   * 3 axes for the sample
+        * 'omega' : rotating around the \vec{z} direction (0, 0, 1)
+        * 'chi' : rotating around the \vec{x} direction (1, 0, 0)
+        * 'phi' : rotating around the \vec{z} direction (0, 0, 1)
+   * 1 axis for the detector
+        * 'tth' : rotation around the \vec{z} direction (0, 0, 1)
 
+2.1.1.3 Soleil Mars Beamline
+............................
 
+   * xrays source fix allong the \vec{x} direction (1, 0, 0)
+   * 3 axes for the sample
+        * 'omega' : rotating around the \vec{z} direction (0, -1, 0)
+        * 'chi' : rotating around the \vec{x} direction (-1, 0, 0)
+        * 'phi' : rotating around the \vec{z} direction (0, 0, 1)
    * 1 axis for the detector
-        * `tth' : rotation around the -\vecy direction (0, -1, 0)
+        * 'tth' : rotation around the \vec{z} direction (0, -1, 0)
 
-2.1.2 Pseudo axis `hkl'
+2.1.2 Pseudo axis 'hkl'
 -----------------------
 
-PseudoAxes provided : `h', `k' and `l'
+PseudoAxes provided : 'h', 'k' and 'l'
 
-2.1.2.1 mode `bissector'
+2.1.2.1 mode 'bissector'
 ........................
 
-   * Axes : `omega', `chi', `phi', `tth'
-
+   * Axes : 'omega', 'chi', 'phi', 'tth'
    * Parameters : No parameter
 
-   This mode add the bissector constrain `tth = 2 * omega'. In this
-mode the `chi' circle containt the vector of diffusion \vecQ. So it is
-easy to know the orientation of the hkl plan.
+   This mode add the bissector constrain 'tth = 2 * omega'.  In this
+mode the 'chi' circle containt the vector of diffusion \vec{Q}.  So it
+is easy to know the orientation of the hkl plan.
 
-2.1.2.2 mode `constant_omega'
+2.1.2.2 mode 'constant_omega'
 .............................
 
-   * Axes : `chi', `phi', `tth'
-
+   * Axes : 'chi', 'phi', 'tth'
    * Parameters : No parameter
 
-   This mode do not move the current `omega' axis.
+   This mode do not move the current 'omega' axis.
 
-2.1.2.3 mode `constant_chi'
+2.1.2.3 mode 'constant_chi'
 ...........................
 
-   * Axes :  `omega', `phi', `tth'
-
+   * Axes : 'omega', 'phi', 'tth'
    * Parameters : No parameter
 
-   This mode do not move the current `chi' axis.
+   This mode do not move the current 'chi' axis.
 
-2.1.2.4 mode `constant_phi'
+2.1.2.4 mode 'constant_phi'
 ...........................
 
-   * Axes related : `omega', `chi', `tth'
-
+   * Axes related : 'omega', 'chi', 'tth'
    * Parameters : No parameter
-This mode do not move the current `phi' axis.
+   This mode do not move the current 'phi' axis.
 
-2.1.2.5 mode `double_diffraction'
+2.1.2.5 mode 'double_diffraction'
 .................................
 
-   * Axes : `omega', `chi', `phi', `tth'
+   * Axes : 'omega', 'chi', 'phi', 'tth'
+   * Parameters : 'h2', 'k2', 'l2'
 
-   * Parameters : `h2', `k2', `l2'
+   This mode put a second hkl vector ('h2', 'k2', 'l2') in Bragg
+condition.  This is usefull sometimes when you want to explore two bragg
+peaks without moving your sample.
 
-   This mode put a second hkl vector (`h2', `k2', `l2') in Bragg
-condition.  This is usefull sometimes when you want to explore two
-bragg peaks without moving your sample.
-
-2.1.2.6 mode `psi_constant'
+2.1.2.6 mode 'psi_constant'
 ...........................
 
-   * Axes :  `omega', `chi', `phi', `tth'
-
-   * Parameters : `h2', `k2', `l2', `psi'
+   * Axes : 'omega', 'chi', 'phi', 'tth'
+   * Parameters : 'h2', 'k2', 'l2', 'psi'
 
-   This mode allow to fix the value of the pseudo axis `psi' at a
-constant value when you move around an `h', `k' ,`l' position. The
-(`h2', `k2', `l2') vector is used as a reference for the computation of
-the `psi' pseudo axis value.
+   This mode allow to fix the value of the pseudo axis 'psi' at a
+constant value when you move around an 'h', 'k' ,'l' position.  The
+('h2', 'k2', 'l2') vector is used as a reference for the computation of
+the 'psi' pseudo axis value.
 
-   You can retrive and "freeze" the current value of the `psi' pseudo
-axis value into the `psi' parameter when you initialize the mode. But
-you can also write directly the value of the desired `psi' parameter.
+   You can retrive and "freeze" the current value of the 'psi' pseudo
+axis value into the 'psi' parameter when you initialize the mode.  But
+you can also write directly the value of the desired 'psi' parameter.
 
-2.1.3 PseudoAxis `psi'
+2.1.3 PseudoAxis 'psi'
 ----------------------
 
-PseudoAxis provided : `psi'
+PseudoAxis provided : 'psi'
 
-2.1.3.1 mode `psi'
+2.1.3.1 mode 'psi'
 ..................
 
-   * Axes : `omega', `chi', `phi', `tth'
-
-   * Parameters : `h1', `k1',`l1'
+   * Axes : 'omega', 'chi', 'phi', 'tth'
+   * Parameters : 'h1', 'k1','l1'
 
 
-File: hkl.info,  Node: Eulerian 6 circles,  Next: Kappa 4 circles vertical,  Prev: Eulerian 4 circles vertical,  Up: Diffractometer
+File: hkl.info,  Node: Eulerian 6 circles,  Next: Kappa 4 circles vertical,  Prev: Eulerian 4 circles,  Up: Diffractometer
 
 2.2 Eulerian 6 circles
 ======================
@@ -220,22 +228,15 @@ File: hkl.info,  Node: Eulerian 6 circles,  Next: Kappa 4 circles vertical,  Pre
 2.2.1 Geometry
 --------------
 
-   * xrays source fix allong the \vecx direction (1, 0, 0)
-
+   * xrays source fix allong the \vec{x} direction (1, 0, 0)
    * 4 axes for the sample
-        * `mu' : rotating around the \vecz direction (0, 0, 1)
-
-        * `omega' : rotating around the -\vecy direction (0, -1, 0)
-
-        * `chi' : rotating around the \vecx direction (1, 0, 0)
-
-        * `phi' : rotating around the -\vecy direction (0, -1, 0)
-
-
+        * 'mu' : rotating around the \vec{z} direction (0, 0, 1)
+        * 'omega' : rotating around the -\vec{y} direction (0, -1, 0)
+        * 'chi' : rotating around the \vec{x} direction (1, 0, 0)
+        * 'phi' : rotating around the -\vec{y} direction (0, -1, 0)
    * 2 axes for the detector
-        * `gamma' : rotation around the \vecz direction (0, 0, 1)
-
-        * `delta' : rotation around the -\vecy direction (0, -1, 0)
+        * 'gamma' : rotation around the \vec{z} direction (0, 0, 1)
+        * 'delta' : rotation around the -\vec{y} direction (0, -1, 0)
 
 2.2.2 PseudoAxes
 ----------------
@@ -250,21 +251,16 @@ File: hkl.info,  Node: Kappa 4 circles vertical,  Next: Kappa 6 circles,  Prev:
 --------------
 
 For this geometry there is a special parameters called \alpha which is
-the angle between the kappa rotation axis and the  \vecy direction.
-
-   * xrays source fix allong the \vecx direction (1, 0, 0)
+the angle between the kappa rotation axis and the \vec{y} direction.
 
+   * xrays source fix allong the \vec{x} direction (1, 0, 0)
    * 3 axes for the sample
-        * `komega' : rotating around the -\vecy direction (0, -1, 0)
-
-        * `kappa' : rotating around the \vecx direction (0,
+        * 'komega' : rotating around the -\vec{y} direction (0, -1, 0)
+        * 'kappa' : rotating around the \vec{x} direction (0,
           -\cos\alpha, -\sin\alpha)
-
-        * `kphi' : rotating around the -\vecy direction (0, -1, 0)
-
-
+        * 'kphi' : rotating around the -\vec{y} direction (0, -1, 0)
    * 1 axis for the detector
-        * `tth' : rotation around the -\vecy direction (0, -1, 0)
+        * 'tth' : rotation around the -\vec{y} direction (0, -1, 0)
 
 2.3.2 PseudoAxes
 ----------------
@@ -279,31 +275,24 @@ File: hkl.info,  Node: Kappa 6 circles,  Next: Z-axis,  Prev: Kappa 4 circles ve
 --------------
 
 For this geometry there is a special parameters called \alpha which is
-the angle between the kappa rotation axis and the  \vecy direction.
-
-   * xrays source fix allong the \vecx direction (1, 0, 0)
+the angle between the kappa rotation axis and the \vec{y} direction.
 
+   * xrays source fix allong the \vec{x} direction (1, 0, 0)
    * 4 axes for the sample
-        * `mu' : rotating around the \vecz direction (0, 0, 1)
-
-        * `komega' : rotating around the -\vecy direction (0, -1, 0)
-
-        * `kappa' : rotating around the \vecx direction (0,
+        * 'mu' : rotating around the \vec{z} direction (0, 0, 1)
+        * 'komega' : rotating around the -\vec{y} direction (0, -1, 0)
+        * 'kappa' : rotating around the \vec{x} direction (0,
           -\cos\alpha, -\sin\alpha)
-
-        * `kphi' : rotating around the -\vecy direction (0, -1, 0)
-
-
+        * 'kphi' : rotating around the -\vec{y} direction (0, -1, 0)
    * 2 axes for the detector
-        * `gamma' : rotation around the \vecz direction (0, 0, 1)
-
-        * `delta' : rotation around the -\vecy direction (0, -1, 0)
+        * 'gamma' : rotation around the \vec{z} direction (0, 0, 1)
+        * 'delta' : rotation around the -\vec{y} direction (0, -1, 0)
 
 2.4.2 PseudoAxes
 ----------------
 
 
-File: hkl.info,  Node: Z-axis,  Prev: Kappa 6 circles,  Up: Diffractometer
+File: hkl.info,  Node: Z-axis,  Next: SOLEIL SIXS MED2+2,  Prev: Kappa 6 circles,  Up: Diffractometer
 
 2.5 Z-Axis
 ==========
@@ -311,26 +300,65 @@ File: hkl.info,  Node: Z-axis,  Prev: Kappa 6 circles,  Up: Diffractometer
 2.5.1 Geometry
 --------------
 
-For this geometry the `mu' axis is common to the sample and the
+For this geometry the 'mu' axis is common to the sample and the
 detector.
 
-   * xrays source fix allong the \vecx direction (1, 0, 0)
-
+   * xrays source fix allong the \vec{x} direction (1, 0, 0)
    * 2 axes for the sample
-        * `mu' : rotation around the \vecz direction (0, 0, 1)
+        * 'mu' : rotation around the \vec{z} direction (0, 0, 1)
+        * 'omega' : rotating around the -\vec{y} direction (0, -1, 0)
+   * 3 axis for the detector
+        * 'mu' : rotation around the \vec{z} direction (0, 0, 1)
+        * 'delta' : rotation around the -\vec{y} direction (0, -1, 0)
+        * 'gamma' : rotation around the \vec{z} direction (0, 0, 1)
+
+2.5.2 PseudoAxes
+----------------
+
+PseudoAxes provided : 'h', 'k' and 'l'
+
+2.5.2.1 mode 'zaxis'
+....................
+
+   * Axes : 'omega', 'delta', 'gamma'
+   * Parameters : No parameter
+
+2.5.2.2 mode 'reflectivity'
+...........................
+
+   * Axes : 'mu', 'omega', 'delta', 'gamma'
+   * Parameters : No parameter
 
-        * `omega' : rotating around the -\vecy direction (0, -1, 0)
+   This mode add the reflectivity constraint 'mu = gamma'.  The
+incomming beam angle and the outgoing beam angle are equals.
 
+
+File: hkl.info,  Node: SOLEIL SIXS MED2+2,  Prev: Z-axis,  Up: Diffractometer
+
+2.6 SOLEIL SIXS MED2+2
+======================
+
+2.6.1 Geometry
+--------------
 
+   * xrays source fix allong the \vec{x} direction (1, 0, 0)
+   * 2 axes for the sample
+        * 'mu' : rotation around the \vec{z} direction (0, 0, 1)
+        * 'omega' : rotating around the -\vec{y} direction (0, -1, 0)
    * 3 axis for the detector
-        * `mu' : rotation around the \vecz direction (0, 0, 1)
+        * 'gamma' : rotation around the \vec{z} direction (0, 0, 1)
+        * 'delta' : rotation around the -\vec{y} direction (0, -1, 0)
 
-        * `delta' : rotation around the -\vecy direction (0, -1, 0)
+2.6.2 Pseudo axis 'hkl'
+-----------------------
 
-        * `gamma' : rotation around the \vecz direction (0, 0, 1)
+PseudoAxes provided : 'h', 'k' and 'l'
 
-2.5.2 PseudoAxes
-----------------
+2.6.2.1 mode 'mu_fixed'
+.......................
+
+   * Axes : 'omega', 'gamma', 'delta'
+   * Parameters : No parameter
 
 
 File: hkl.info,  Node: Developpement,  Next: Index,  Prev: Diffractometer,  Up: Top
@@ -341,11 +369,10 @@ File: hkl.info,  Node: Developpement,  Next: Index,  Prev: Diffractometer,  Up:
 3.1 Getting hkl
 ===============
 
-To get hkl, you can download the last stable version from sourceforge
-or if you want the latest development version use git
-(http://git.or.cz/) or msysgit
-(http://code.google.com/p/msysgit/downloads/list) on windows system and
-do
+To get hkl, you can download the last stable version from sourceforge or
+if you want the latest development version use git (http://git.or.cz/)
+or msysgit (http://code.google.com/p/msysgit/downloads/list) on windows
+system and do
      $ git clone git://repo.or.cz/hkl.git
    or
      $ git clone http://repo.or.cz/r/hkl.git (slower)
@@ -363,41 +390,42 @@ Scientific Library 1.12+ (http://www.gnu.org/software/gsl/)
      $ ./waf install (as root)
 
    This command compile the library and the test suit if everythings
-goes fine you must have a `libhkl.so.4.0.3' or `libhkl.lib' depending
-on your platform in the `build/default/src' directory. If your platform
-is not supported yet please contact the <picca at synchrotron-soleil.fr>.
+goes fine you must have a 'libhkl.so.4.99.99.1610' or 'libhkl.lib'
+depending on your platform in the 'build/default/src' directory.  If
+your platform is not supported yet please contact the
+<picca at synchrotron-soleil.fr>.
 
 3.3 Hacking hkl
 ===============
 
 you can send your patch to the <picca at synchrotron-soleil.fr> using git
 
-   The developpement process is like this. suppose you wan to add a new
+   The developpement process is like this.  suppose you wan to add a new
 feature to hkl create first a new branch from the next one
      $ git checkout -b my-next next
    then work...
      $ git commit -a
    more work...
      $ git commit -a
-   now that your great feature is ready for publication, you can send
-by mail your patches process like this:
+   now that your great feature is ready for publication, you can send by
+mail your patches process like this:
      $ git format-patch origin/next
-   and send files `0001_xxx'  and `0002_xxx' created to the author.
+   and send files '0001_xxx' and '0002_xxx' created to the author.
 
 3.3.1 Howto add a diffractometer
 --------------------------------
 
 In this section we will describe all steps needed to add a
-diffractometer. We will use the kappa 4 circles exemple.
+diffractometer.  We will use the kappa 4 circles exemple.
 
 3.3.2 Adding Geometry
 ---------------------
 
 The first thing to do is to add the Geometry of this diffractometer.
-you need to edit the `hkl/hkl-geometry-factory.h' file
+you need to edit the 'hkl/hkl-geometry.h' file
 
-   add a new `HKL_GEOMETRY_KAPPA4C_VERTICAL' const to the
-`_HklGeometryType'
+   add a new 'HKL_GEOMETRY_KAPPA4C_VERTICAL' const to the
+'_HklGeometryType'
 
 enum _HklGeometryType
 {
@@ -405,10 +433,19 @@ enum _HklGeometryType
 	HKL_GEOMETRY_KAPPA4C_VERTICAL
 }
 
+   Then you need to add it to the static hkl_geometry_factory_configs
+constant in the 'hkl/hkl-geometry-factory.h'
+
+static const HklGeometryConfig hkl_geometry_factory_configs[] =
+{
+        ...
+ 	{"K4CV", HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL},
+}
+
    Now you must describe the diffractometer axes and the way they are
-connected all togethers.  This diffractometer have one sample holder
-and one detecter holder and four axes ("komega", "kappa", "kphi" and
-"tth") So you need to add a new init method for this diffractometer.
+connected all togethers.  This diffractometer have one sample holder and
+one detecter holder and four axes ("komega", "kappa", "kphi" and "tth")
+So you need to add a new init method for this diffractometer.
 
 static void hkl_geometry_init_kappa4C_vertical(HklGeometry *self, double alpha)
 {
@@ -431,8 +468,8 @@ self->name = "K4CV";
    This name is used in the Tango diffractometer device to refer this
 diffractometer.
 
-   Then you can create the first holder with it's three axes. The order
-of the axis is from the farest to the closest of the sample. In this
+   Then you can create the first holder with it's three axes.  The order
+of the axis is from the farest to the closest of the sample.  In this
 case, komega -> kappa -> kphi.
 
 h = hkl_geometry_add_holder(self);
@@ -445,7 +482,7 @@ hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
 h = hkl_geometry_add_holder(self);
 hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
 
-   now it is almost finish for the geometry part. you just need to add
+   now it is almost finish for the geometry part.  you just need to add
 it in the factory
 
 Hklgeometry *hkl_geometry_factory_new(HklGeometryType type, ...)
@@ -463,33 +500,33 @@ Hklgeometry *hkl_geometry_factory_new(HklGeometryType type, ...)
 	...
 }
 
-   in this exemple the geometry take one parameter. The fatory can have
+   in this exemple the geometry take one parameter.  The fatory can have
 a variable number of parameters you just need to take care of this with
 the va_arg methods.
 
 3.3.3 Adding PseudoAxis mode
 ----------------------------
 
-Suppose you want to add a new mode to the hkl pseudo axes.  lets call
-it "psi constant vertical" to the eulerian 6 circle geometry.
+Suppose you want to add a new mode to the hkl pseudo axes.  lets call it
+"psi constant vertical" to the eulerian 6 circle geometry.
 
-   The starting point is to look in the `src/hkl-pseudoaxis-factory.c'
+   The starting point is to look in the 'src/hkl-pseudoaxis-factory.c'
 for
 
-HklPseudoAxisEngineList *hkl_pseudo_axis_engine_list_factory(HklGeometryType type)
+HklEngineList *hkl_engine_list_factory(HklGeometryType type)
 
    in that method you can see this in the eulerian 6 circle part
 
 case HKL_GEOMETRY_EULERIAN6C:
-     hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_e6c_hkl_new());
-     hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_e6c_psi_new());
-     hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_q2_new());
+     hkl_engine_list_add(self, hkl_engine_e6c_hkl_new());
+     hkl_engine_list_add(self, hkl_engine_e6c_psi_new());
+     hkl_engine_list_add(self, hkl_engine_q2_new());
      break;
 
    so as you can see there is three pseudo axis engine for this
-geometry. Your mode if for the hkl pseudo axis. so let look in the
-`hkl_pseudo_axis_engine_e6c_hkl_new()' method.  You can find it in the
-`include/hkl/hkl-pseudoaxis-e6c.h' which contain this:
+geometry.  Your mode if for the hkl pseudo axis.  so let look in the
+'hkl_engine_e6c_hkl_new()' method.  You can find it in the
+'include/hkl/hkl-pseudoaxis-e6c.h' which contain this:
 
 #ifndef __HKL_PSEUDOAXIS_E6C_H__
 #define __HKL_PSEUDOAXIS_E6C_H__
@@ -498,98 +535,96 @@ geometry. Your mode if for the hkl pseudo axis. so let look in the
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void);
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_psi_new(void);
+extern HklEngine *hkl_engine_e6c_hkl_new(void);
+extern HklEngine *hkl_engine_e6c_psi_new(void);
 
 HKL_END_DECLS
 
 #endif /* __HKL_PSEUDOAXIS_E6C_H__ */
 
-   strange only 2 methods nothing about
-`hkl_pseudo_axis_engine_q2_new()'. This is because the implementation
-of this method is common to more than one geometry. So you can find it
-in `hkl/hkl-pseudoaxis-common-q.h'
+   strange only 2 methods nothing about 'hkl_engine_q2_new()'.  This is
+because the implementation of this method is common to more than one
+geometry.  So you can find it in 'hkl/hkl-pseudoaxis-common-q.h'
 
-   now you need to change the code of
-`hkl_pseudo_axis_engine_e6c_hkl_new(void)'. Lets look about it in
-`src/hkl-pseudoaxis-e6c-hkl.c'
+   now you need to change the code of 'hkl_engine_e6c_hkl_new(void)'.
+Lets look about it in 'src/hkl-pseudoaxis-e6c-hkl.c'
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void)
+HklEngine *hkl_engine_e6c_hkl_new(void)
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
+	HklEngine *self;
+	HklMode *mode;
 
-	self = hkl_pseudo_axis_engine_hkl_new();
+	self = hkl_engine_hkl_new();
 
 	/* bissector_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"bissector_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_setter_func_bissector_vertical,
+		hkl_mode_get_hkl_real,
+		hkl_engine_setter_func_bissector_vertical,
 		0,
 		4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* constant_omega_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"constant_omega_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* constant_chi_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"constant_chi_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "omega", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* constant_phi_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"constant_phi_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "omega", "chi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* lifting_detector_phi */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"lifting_detector_phi",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "phi", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* lifting_detector_omega */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"lifting_detector_omega",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "omega", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* lifting_detector_mu */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"lifting_detector_mu",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "mu", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* double_diffraction vertical*/
 	HklParameter h2;
@@ -606,36 +641,36 @@ HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void)
 			   HKL_TRUE, HKL_TRUE,
 			   NULL, NULL);
 
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"double_diffraction_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_double_diffraction_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_double_diffraction_real,
 		3, &h2, &k2, &l2,
 		4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* bissector_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"bissector_horizontal",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_setter_func_bissector_horizontal,
+		hkl_mode_get_hkl_real,
+		hkl_engine_setter_func_bissector_horizontal,
 		0,
 		5, "mu", "omega", "chi", "phi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* double_diffraction_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"double_diffraction_horizontal",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_double_diffraction_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_double_diffraction_real,
 		3, &h2, &k2, &l2,
 		4, "mu", "chi", "phi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+	hkl_engine_select_mode(self, 0);
 
 	return self;
 }
@@ -643,77 +678,68 @@ HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void)
    so you "just" need to add a new mode like this
 
 	/* double_diffraction_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"psi_constant_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_psi_constant_vertical,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_psi_constant_vertical,
 		3, &h2, &k2, &l2,
 		4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
-   So the first parameter of the hkl_pseudo_axis_engine_mode_new method
+   So the first parameter of the hkl_mode_new method
    * name is the name of the mode
-
    * then the init functions (usually you need to store the current
-     state of the geometry  to be able to use the pseudo axis). Here no
-     need for this init method so we put `NULL'.
-
+     state of the geometry to be able to use the pseudo axis).  Here no
+     need for this init method so we put 'NULL'.
    * then the get method which compute for a given geometry the pseudo
-     axis value.  the hkl get method
-     `hkl_pseudo_axis_engine_mode_get_hkl_real' is completely generic
-     and do not depend of the geometry. No need to write it.
-
+     axis value.  the hkl get method 'hkl_mode_get_hkl_real' is
+     completely generic and do not depend of the geometry.  No need to
+     write it.
    * then the set method which compute a geometry for the given pseudo
      axis values.  Now you need to work a little bit and write the set
      method.
-
    * the parameters of your mode
-
    * * first the number of parameters : 3
-
    * * then each parameters (pointer on the right parameters) for this
      mode we have 3 parameters h2, k2, l2 which are the coordinates of a
      sample reference direction use to compute the psi value.
-
    * the name of axes used by the set method.
-
    * * first the number of axes used by the set method : 4
-
    * * then all axes names.
 
    In fact the "set" method know nothing about the axes names.  so you
-can use a set method with different kind of geometries.  the
-association is only done during the mode creation.
+can use a set method with different kind of geometries.  the association
+is only done during the mode creation.
 
    At the end you need to add this mode to the pseudo axis engine with
-`hkl_pseudo_axis_engine_add_mode(self, mode)';
+'hkl_engine_add_mode(self, mode)';
 
    that's all.
 
-   Now let see how this "set" method could be written. In our case we
+   Now let see how this "set" method could be written.  In our case we
 want to compute the geometry angles for a given h, k, l pseudo axis
 values keeping the angle between the reference reciprocal space vector
-(h2, k2, l2) and the diffraction plane defined by the incomming beam
-and the outgoing beam.
+(h2, k2, l2) and the diffraction plane defined by the incomming beam and
+the outgoing beam.
 
-static int hkl_pseudo_axis_engine_mode_set_psi_constant_vertical(HklPseudoAxisEngine *engine,
+static int hkl_mode_set_psi_constant_vertical(HklEngine *engine,
 								 HklGeometry *geometry,
 								 HklDetector *detector,
 								 HklSample *sample)
 {
-	hkl_pseudo_axis_engine_prepare_internal(engine, geometry, detector,
+	hkl_engine_prepare_internal(engine, geometry, detector,
 						sample);
 
-	return hkl_pseudo_axis_engine_solve_function(engine, psi_constant_vertical);
+	return hkl_engine_solve_function(engine, psi_constant_vertical);
 }
 
    the prepare internal part is about initializing the solver with the
-given geometry, detector and sample. Then comes the
-hkl_pseudo_axis_engine_solve_function which need the
-psi_constant_vertical function to work. This method use the GSL library
-to find the given function roots (where f(x) = 0).  Lets see how it
-works for the "bissector_horizontal" mode.
+given geometry, detector and sample.  Then comes the
+hkl_engine_solve_function which need the psi_constant_vertical function
+to work.  This method use the GSL library to find the given function
+roots (where f(x) = 0).  Lets see how it works for the
+"bissector_horizontal" mode.
 
 static int bissector_horizontal(const gsl_vector *x, void *params, gsl_vector *f)
 {
@@ -734,13 +760,13 @@ static int bissector_horizontal(const gsl_vector *x, void *params, gsl_vector *f
 }
 
    The bissector_horizotal method is used by the setter method of the
-mode to compute the right set of axes angles corresponding to the
-pseudo axes values you want to reach. This method compute the
-difference between these pseudo axes values and the ones computed from
-the axes angles. It can be decompose in three parts:
+mode to compute the right set of axes angles corresponding to the pseudo
+axes values you want to reach.  This method compute the difference
+between these pseudo axes values and the ones computed from the axes
+angles.  It can be decompose in three parts:
 
    The first three of these equations are given for the function
-`RUBH_minus_Q': they are the  diference between the h,k,l values that
+'RUBH_minus_Q': they are the diference between the h,k,l values that
 want to be set and the h,k,l values computed for a possible combination
 of angles:
 
@@ -749,7 +775,7 @@ of angles:
      f_data[2] = l-l(x)
 
    As the bissector_horizontal mode use 5 axes you need to find 2 other
-equations to be able to solve your mode. The first one is omega = 0 for
+equations to be able to solve your mode.  The first one is omega = 0 for
 an horizontal mode:
 
      f_data[3] = omega
@@ -758,13 +784,13 @@ an horizontal mode:
 
      f_data[4] = gamma - 2 * fmod(mu, M_PI)
 
-   One question could be why this complicate `f4 = gamma - 2 * fmod(mu,
-M_PI)' equation instead of a simpler `f4 = gamma - 2 * mu' ?  this is
+   One question could be why this complicate 'f4 = gamma - 2 * fmod(mu,
+M_PI)' equation instead of a simpler 'f4 = gamma - 2 * mu' ?  this is
 because the bissector_horizontal method is also called by a solution
-multiplicator to gives the user plenty of equivalent solutions. This
-multiplicator do some operations like `omega = pi - omega' or `omega =
-- omega' on the axes.  Then it check that the new angles combination
-gives also f(x) = 0. This is the explaination of this more complicate
+multiplicator to gives the user plenty of equivalent solutions.  This
+multiplicator do some operations like 'omega = pi - omega' or 'omega = -
+omega' on the axes.  Then it check that the new angles combination gives
+also f(x) = 0.  This is the explaination of this more complicate
 equation.
 
    So in our case we need to build something like
@@ -782,12 +808,12 @@ static int psi_constant_vertical(const gsl_vector *x, void *params, gsl_vector *
 	return  GSL_SUCCESS;
 }
 
-   The missing part is about the psi computation. f3 = psi (target) -
+   The missing part is about the psi computation.  f3 = psi (target) -
 psi(x).  Calculation psi is done in the psi pseudo axis common part.
 
      static int psi(const gsl_vector *x, void *params, gsl_vector *f)
 
-   This psi method is the equivalent of psi_constant_vertical. So you
+   This psi method is the equivalent of psi_constant_vertical.  So you
 need to factorize the psi calculation in between psi_constant_vertical
 and psi.
 
@@ -797,20 +823,19 @@ File: hkl.info,  Node: Index,  Prev: Developpement,  Up: Top
 Index
 *****
 
- [index ]
-* Menu:
 
 
 Tag Table:
-Node: Top1084
-Node: Introduction1525
-Node: Diffractometer2710
-Node: Eulerian 4 circles vertical2964
-Node: Eulerian 6 circles5602
-Node: Kappa 4 circles vertical6368
-Node: Kappa 6 circles7175
-Node: Z-axis8085
-Node: Developpement8777
-Node: Index23242
+Node: Top1066
+Node: Introduction1665
+Node: Diffractometer2844
+Node: Eulerian 4 circles3181
+Node: Eulerian 6 circles6705
+Node: Kappa 4 circles vertical7469
+Node: Kappa 6 circles8282
+Node: Z-axis9200
+Node: SOLEIL SIXS MED2+210337
+Node: Developpement11095
+Node: Index24709
 
 End Tag Table
diff --git a/Documentation/hkl.texi b/Documentation/hkl.texi
index da237cd..1b0af7a 100644
--- a/Documentation/hkl.texi
+++ b/Documentation/hkl.texi
@@ -62,11 +62,12 @@ This manual is for Hkl Diffraction Library (version @value{VERSION}, @value{UPDA
 
 Diffractometer
 
-* Eulerian 4 circles vertical::  
+* Eulerian 4 circles::          
 * Eulerian 6 circles::          
 * Kappa 4 circles vertical::    
 * Kappa 6 circles::             
 * Z-axis::                      
+* SOLEIL SIXS MED2+2::          
 
 @end detailmenu
 @end menu
@@ -115,18 +116,20 @@ geometries.
 @chapter Diffractometer
 
 @menu
-* Eulerian 4 circles vertical::  
+* Eulerian 4 circles::          
 * Eulerian 6 circles::          
 * Kappa 4 circles vertical::    
 * Kappa 6 circles::             
 * Z-axis::                      
+* SOLEIL SIXS MED2+2::          
 @end menu
 
- at node Eulerian 4 circles vertical, Eulerian 6 circles, Diffractometer, Diffractometer
- at section Eulerian 4 circles vertical
+ at node Eulerian 4 circles, Eulerian 6 circles, Diffractometer, Diffractometer
+ at section Eulerian 4 circles
 
- at subsection Geometry
+ at subsection Geometries
 
+ at subsubsection Vertical
 @itemize
     @item xrays source fix allong the @math{\vec{x}} direction (1, 0, 0)
     @item 3 axes for the sample
@@ -141,6 +144,38 @@ geometries.
           @end itemize
 @end itemize
 
+ at subsubsection Horizontal
+
+ at itemize
+    @item xrays source fix allong the @math{\vec{x}} direction (1, 0, 0)
+    @item 3 axes for the sample
+          @itemize
+                @item @samp{omega} : rotating around the @math{\vec{z}} direction (0, 0, 1)
+                @item @samp{chi} : rotating around the @math{\vec{x}} direction (1, 0, 0)
+                @item @samp{phi} : rotating around the @math{\vec{z}} direction (0, 0, 1)
+          @end itemize
+    @item 1 axis for the detector
+          @itemize
+                @item @samp{tth} : rotation around the @math{\vec{z}} direction (0, 0, 1)
+          @end itemize
+ at end itemize
+
+ at subsubsection Soleil Mars Beamline
+
+ at itemize
+    @item xrays source fix allong the @math{\vec{x}} direction (1, 0, 0)
+    @item 3 axes for the sample
+          @itemize
+                @item @samp{omega} : rotating around the @math{\vec{z}} direction (0, -1, 0)
+                @item @samp{chi} : rotating around the @math{\vec{x}} direction (-1, 0, 0)
+                @item @samp{phi} : rotating around the @math{\vec{z}} direction (0, 0, 1)
+          @end itemize
+    @item 1 axis for the detector
+          @itemize
+                @item @samp{tth} : rotation around the @math{\vec{z}} direction (0, -1, 0)
+          @end itemize
+ at end itemize
+
 @subsection Pseudo axis @samp{hkl}
 
 PseudoAxes provided : @samp{h}, @samp{k} and @samp{l}
@@ -218,8 +253,7 @@ PseudoAxis provided : @samp{psi}
 @item Parameters : @samp{h1}, @samp{k1}, at samp{l1}
 @end itemize
 
- at node Eulerian 6 circles, Kappa 4 circles vertical, Eulerian 4 circles vertical, Diffractometer
-
+ at node Eulerian 6 circles, Kappa 4 circles vertical, Eulerian 4 circles, Diffractometer
 @section Eulerian 6 circles
 
 @subsection Geometry
@@ -292,7 +326,7 @@ angle between the kappa rotation axis and the  @math{\vec{y}} direction.
 
 @subsection PseudoAxes
 
- at node Z-axis,  , Kappa 6 circles, Diffractometer
+ at node Z-axis, SOLEIL SIXS MED2+2, Kappa 6 circles, Diffractometer
 @section Z-Axis
 
 @subsection Geometry
@@ -316,6 +350,55 @@ For this geometry the @samp{mu} axis is common to the sample and the detector.
 
 @subsection PseudoAxes
 
+PseudoAxes provided : @samp{h}, @samp{k} and @samp{l}
+
+ at subsubsection mode @samp{zaxis}
+
+ at itemize
+ at item Axes : @samp{omega}, @samp{delta}, @samp{gamma}
+ at item Parameters : No parameter
+ at end itemize
+
+ at subsubsection mode @samp{reflectivity}
+
+ at itemize
+ at item Axes : @samp{mu}, @samp{omega}, @samp{delta}, @samp{gamma}
+ at item Parameters : No parameter
+ at end itemize
+
+This mode add the reflectivity constraint @code{mu = gamma}. The
+incomming beam angle and the outgoing beam angle are equals.
+
+ at node SOLEIL SIXS MED2+2,  , Z-axis, Diffractometer
+ at section SOLEIL SIXS MED2+2
+
+ at subsection Geometry
+
+ at itemize
+    @item xrays source fix allong the @math{\vec{x}} direction (1, 0, 0)
+    @item 2 axes for the sample
+          @itemize
+                @item @samp{mu} : rotation around the @math{\vec{z}} direction (0, 0, 1)
+                @item @samp{omega} : rotating around the @math{-\vec{y}} direction (0, -1, 0)
+          @end itemize
+    @item 3 axis for the detector
+          @itemize
+                 @item @samp{gamma} : rotation around the @math{\vec{z}} direction (0, 0, 1)
+                @item @samp{delta} : rotation around the @math{-\vec{y}} direction (0, -1, 0)
+          @end itemize
+ at end itemize
+
+ at subsection Pseudo axis @samp{hkl}
+
+PseudoAxes provided : @samp{h}, @samp{k} and @samp{l}
+
+ at subsubsection mode @samp{mu_fixed}
+
+ at itemize
+ at item Axes : @samp{omega}, @samp{gamma}, @samp{delta}
+ at item Parameters : No parameter
+ at end itemize
+
 @node Developpement, Index, Diffractometer, Top
 @chapter Developpement
 
@@ -386,7 +469,7 @@ will use the kappa 4 circles exemple.
 @subsection Adding Geometry
 
 The first thing to do is to add the Geometry of this diffractometer.  you need
-to edit the @file{hkl/hkl-geometry-factory.h} file
+to edit the @file{hkl/hkl-geometry.h} file
 
 add a new @code{HKL_GEOMETRY_KAPPA4C_VERTICAL} const to the @code{_HklGeometryType}
 
@@ -398,6 +481,17 @@ enum _HklGeometryType
 }
 @end verbatim
 
+Then you need to add it to the static hkl_geometry_factory_configs constant in the
+ at file{hkl/hkl-geometry-factory.h}
+
+ at verbatim
+static const HklGeometryConfig hkl_geometry_factory_configs[] =
+{
+        ...
+ 	{"K4CV", HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL},
+}
+ at end verbatim
+
 Now you must describe the diffractometer axes and the way they are connected
 all togethers.  This diffractometer have one sample holder and one detecter
 holder and four axes ("komega", "kappa", "kphi" and "tth") So you need to add a
@@ -476,21 +570,21 @@ lets call it "psi constant vertical" to the eulerian 6 circle geometry.
 The starting point is to look in the @file{src/hkl-pseudoaxis-factory.c} for
 
 @verbatim
-HklPseudoAxisEngineList *hkl_pseudo_axis_engine_list_factory(HklGeometryType type)
+HklEngineList *hkl_engine_list_factory(HklGeometryType type)
 @end verbatim
 
 in that method you can see this in the eulerian 6 circle part
 
 @verbatim
 case HKL_GEOMETRY_EULERIAN6C:
-     hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_e6c_hkl_new());
-     hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_e6c_psi_new());
-     hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_q2_new());
+     hkl_engine_list_add(self, hkl_engine_e6c_hkl_new());
+     hkl_engine_list_add(self, hkl_engine_e6c_psi_new());
+     hkl_engine_list_add(self, hkl_engine_q2_new());
      break;
 @end verbatim
 
 so as you can see there is three pseudo axis engine for this geometry. Your mode if for
-the hkl pseudo axis. so let look in the @code{hkl_pseudo_axis_engine_e6c_hkl_new()} method.
+the hkl pseudo axis. so let look in the @code{hkl_engine_e6c_hkl_new()} method.
 You can find it in the @file{include/hkl/hkl-pseudoaxis-e6c.h} which contain this:
 
 @verbatim
@@ -501,98 +595,98 @@ You can find it in the @file{include/hkl/hkl-pseudoaxis-e6c.h} which contain thi
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void);
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_psi_new(void);
+extern HklEngine *hkl_engine_e6c_hkl_new(void);
+extern HklEngine *hkl_engine_e6c_psi_new(void);
 
 HKL_END_DECLS
 
 #endif /* __HKL_PSEUDOAXIS_E6C_H__ */
 @end verbatim
 
-strange only 2 methods nothing about @code{hkl_pseudo_axis_engine_q2_new()}. This is because
+strange only 2 methods nothing about @code{hkl_engine_q2_new()}. This is because
 the implementation of this method is common to more than one geometry. So you can find it in
 @file{hkl/hkl-pseudoaxis-common-q.h}
 
-now you need to change the code of @code{hkl_pseudo_axis_engine_e6c_hkl_new(void)}. Lets
+now you need to change the code of @code{hkl_engine_e6c_hkl_new(void)}. Lets
 look about it in @file{src/hkl-pseudoaxis-e6c-hkl.c}
 
 @verbatim
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void)
+HklEngine *hkl_engine_e6c_hkl_new(void)
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
+	HklEngine *self;
+	HklMode *mode;
 
-	self = hkl_pseudo_axis_engine_hkl_new();
+	self = hkl_engine_hkl_new();
 
 	/* bissector_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"bissector_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_setter_func_bissector_vertical,
+		hkl_mode_get_hkl_real,
+		hkl_engine_setter_func_bissector_vertical,
 		0,
 		4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* constant_omega_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"constant_omega_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* constant_chi_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"constant_chi_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "omega", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* constant_phi_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"constant_phi_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "omega", "chi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* lifting_detector_phi */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"lifting_detector_phi",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "phi", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* lifting_detector_omega */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"lifting_detector_omega",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "omega", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* lifting_detector_mu */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"lifting_detector_mu",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_hkl_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
 		0,
 		3, "mu", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* double_diffraction vertical*/
 	HklParameter h2;
@@ -609,36 +703,36 @@ HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void)
 			   HKL_TRUE, HKL_TRUE,
 			   NULL, NULL);
 
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"double_diffraction_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_double_diffraction_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_double_diffraction_real,
 		3, &h2, &k2, &l2,
 		4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* bissector_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"bissector_horizontal",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_setter_func_bissector_horizontal,
+		hkl_mode_get_hkl_real,
+		hkl_engine_setter_func_bissector_horizontal,
 		0,
 		5, "mu", "omega", "chi", "phi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
 	/* double_diffraction_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"double_diffraction_horizontal",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_double_diffraction_real,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_double_diffraction_real,
 		3, &h2, &k2, &l2,
 		4, "mu", "chi", "phi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+	hkl_engine_select_mode(self, 0);
 
 	return self;
 }
@@ -648,24 +742,24 @@ so you "just" need to add a new mode like this
 
 @verbatim
 	/* double_diffraction_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
+	mode = hkl_mode_new(
 		"psi_constant_vertical",
 		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_psi_constant_vertical,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_psi_constant_vertical,
 		3, &h2, &k2, &l2,
 		4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	hkl_engine_add_mode(self, mode);
 @end verbatim
 
-So the first parameter of the hkl_pseudo_axis_engine_mode_new method
+So the first parameter of the hkl_mode_new method
 @itemize
 @item name is the name of the mode
 @item then the init functions (usually you need to store the current state of the geometry
  to be able to use the pseudo axis). Here no need for this init method
 so we put @code{NULL}.
 @item then the get method which compute for a given geometry the pseudo axis value.
-the hkl get method @code{hkl_pseudo_axis_engine_mode_get_hkl_real} is completely generic
+the hkl get method @code{hkl_mode_get_hkl_real} is completely generic
 and do not depend of the geometry. No need to write it.
 @item then the set method which compute a geometry for the given pseudo axis values.
 Now you need to work a little bit and write the set method.
@@ -684,7 +778,7 @@ so you can use a set method with different kind of geometries.
 the association is only done during the mode creation.
 
 At the end you need to add this mode to the pseudo axis engine with
- at code{hkl_pseudo_axis_engine_add_mode(self, mode)};
+ at code{hkl_engine_add_mode(self, mode)};
 
 that's all.
 
@@ -694,20 +788,20 @@ angle between the reference reciprocal space vector (h2, k2, l2) and the
 diffraction plane defined by the incomming beam and the outgoing beam.
 
 @verbatim
-static int hkl_pseudo_axis_engine_mode_set_psi_constant_vertical(HklPseudoAxisEngine *engine,
+static int hkl_mode_set_psi_constant_vertical(HklEngine *engine,
 								 HklGeometry *geometry,
 								 HklDetector *detector,
 								 HklSample *sample)
 {
-	hkl_pseudo_axis_engine_prepare_internal(engine, geometry, detector,
+	hkl_engine_prepare_internal(engine, geometry, detector,
 						sample);
 
-	return hkl_pseudo_axis_engine_solve_function(engine, psi_constant_vertical);
+	return hkl_engine_solve_function(engine, psi_constant_vertical);
 }
 @end verbatim
 
 the prepare internal part is about initializing the solver with the given
-geometry, detector and sample. Then comes the hkl_pseudo_axis_engine_solve_function
+geometry, detector and sample. Then comes the hkl_engine_solve_function
 which need the psi_constant_vertical function to work. This method use the GSL library
 to find the given function roots (where f(x) = 0).
 Lets see how it works for the "bissector_horizontal" mode.
diff --git a/Documentation/sphinx/Makefile.am b/Documentation/sphinx/Makefile.am
new file mode 100644
index 0000000..5134d4a
--- /dev/null
+++ b/Documentation/sphinx/Makefile.am
@@ -0,0 +1,18 @@
+EXTRA_DIST = \
+	source/conf.py.in \
+	source/development.rst \
+	source/diffractometers/e4cv.rst \
+	source/diffractometers/mars.rst \
+	source/diffractometers/k4cv.rst \
+	source/diffractometers/e6c.rst \
+	source/diffractometers/k6c.rst \
+	source/diffractometers/zaxis.rst \
+	source/diffractometers/med2_2.rst \
+	source/index.rst \
+	source/introduction.rst \
+	source/pseudo.rst
+
+-include $(top_srcdir)/sphinx.make
+
+publish: html
+	rsync -avz build/html/ picca at people.debian.org:public_html/hkl
\ No newline at end of file
diff --git a/Documentation/sphinx/Makefile.in b/Documentation/sphinx/Makefile.in
new file mode 100644
index 0000000..1532c6d
--- /dev/null
+++ b/Documentation/sphinx/Makefile.in
@@ -0,0 +1,492 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = Documentation/sphinx
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+EXTRA_DIST = \
+	source/conf.py.in \
+	source/development.rst \
+	source/diffractometers/e4cv.rst \
+	source/diffractometers/mars.rst \
+	source/diffractometers/k4cv.rst \
+	source/diffractometers/e6c.rst \
+	source/diffractometers/k6c.rst \
+	source/diffractometers/zaxis.rst \
+	source/diffractometers/med2_2.rst \
+	source/index.rst \
+	source/introduction.rst \
+	source/pseudo.rst
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Documentation/sphinx/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu Documentation/sphinx/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+
+-include $(top_srcdir)/sphinx.make
+
+publish: html
+	rsync -avz build/html/ picca at people.debian.org:public_html/hkl
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Documentation/sphinx/source/conf.py.in b/Documentation/sphinx/source/conf.py.in
new file mode 100644
index 0000000..d138196
--- /dev/null
+++ b/Documentation/sphinx/source/conf.py.in
@@ -0,0 +1,220 @@
+# -*- coding: utf-8 -*-
+#
+# hkl documentation build configuration file, created by
+# sphinx-quickstart on Sat May 28 14:45:51 2011.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc',
+	      'sphinx.ext.todo',
+	      'sphinx.ext.coverage',
+	      'sphinx.ext.pngmath',
+	      'matplotlib.sphinxext.plot_directive']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'hkl'
+copyright = u'2011-2013, Picca Frédéric-Emmanuel'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '@VERSION@'
+# The full version, including alpha/beta/rc tags.
+release = '@VERSION@'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+#html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'hkldoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'hkl.tex', u'hkl Documentation',
+   u'Picca Frédéric-Emmanuel', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', 'hkl', u'hkl Documentation',
+     [u'Picca Frédéric-Emmanuel'], 1)
+]
diff --git a/Documentation/sphinx/source/development.rst b/Documentation/sphinx/source/development.rst
new file mode 100644
index 0000000..7ecc51c
--- /dev/null
+++ b/Documentation/sphinx/source/development.rst
@@ -0,0 +1,473 @@
+.. _development:
+
+Developpement
+#############
+
+Getting hkl
+***********
+
+To get hkl, you can download the last stable version from sourceforge or if you
+want the latest development version use `git <http://git.or.cz/>`_ or
+`msysgit <http://code.google.com/p/msysgit/downloads/list>`_ on windows system and
+do::
+
+	$ git clone git://repo.or.cz/hkl.git
+
+or::
+
+	$ git clone http://repo.or.cz/r/hkl.git (slower)
+
+then checkout the next branch like this::
+
+	$ cd hkl
+	$ git checkout -b next origin/next
+
+Building hkl
+************
+
+To build hkl you need `Python 2.3+ <http://www.python.org>`_ and the
+`GNU Scientific Library 1.12 <http://www.gnu.org/software/gsl/>`_::
+
+     $ ./configure --disable-ghkl
+     $ make
+     $ sudo make install
+
+you can also build a GUI interfaces which use `gtkmm <http://www.gtkmm.org>`_::
+
+    $ ./configure
+    $ make
+    $ sudo make install
+
+eventually if you want to work also on the documentation you need
+
++ `gtk-doc <http://www.gtk.org/gtk-doc/>`_ for the api
++ `sphinx <http://sphinx.pocoo.org/>`_ for the html and latex doc.
++ `asymptote <http://asymptote.sourceforge.net/>`_ for the figures::
+
+  $ ./configure --enable-gtk-doc
+  $ make
+  $ make html
+
+Hacking hkl
+***********
+
+you can send your patch to `Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>`_ using
+``git``
+
+The developpement process is like this. Suppose you wan to add a new feature to
+hkl create first a new branch from the next one::
+
+    $ git checkout -b my-next next
+
+hack, hack::
+
+     $ git commit -a
+
+more hacks::
+
+     $ git commit -a
+
+now that your new feature is ready for a review, you can send by
+email your work using git format-patch::
+
+     $ git format-patch origin/next
+
+and send generated files `0001_xxx`, `0002_xxx`, ... to the author.
+
+Howto add a diffractometer
+**************************
+
+In this section we will describe all steps requiered to add a new
+diffractometer. We will use the kappa 4 circles exemple.
+
+Adding Geometry
+===============
+
+.. highlight:: c
+   :linenothreshold: 5
+
+The first thing to do is to add the Geometry of this
+diffractometer. You need to edit the `hkl/hkl-geometry-factory.h` file
+
+add a new type ``HKL_GEOMETRY_KAPPA4C_VERTICAL`` into the ``_HklGeometryType`` enum::
+
+    enum _HklGeometryType
+    {
+	...
+	HKL_GEOMETRY_KAPPA4C_VERTICAL
+    }
+
+Now you must describe the diffractometer axes and the way they are
+connected all togethers.  This diffractometer have one sample holder
+and one detecter holder and four axes ("komega", "kappa", "kphi" and
+"tth") So you need to add a new init method for this diffractometer.::
+
+       static void hkl_geometry_init_kappa4C_vertical(HklGeometry *self, double alpha)
+       {
+		HklHolder *h;
+
+		self->name = "K4CV";
+		h = hkl_geometry_add_holder(self);
+		hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
+		hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
+		hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
+
+		h = hkl_geometry_add_holder(self);
+		hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+	}
+
+first we set the diffractometer name by::
+
+      self->name = "K4CV";
+
+This name is used in the Tango diffractometer device to refer to this
+diffractometer.
+
+Then you can create the first holder with it's three axes. The order
+of the axis is from the farest to the closest of the sample. In this
+case, komega -> kappa -> kphi::
+
+      h = hkl_geometry_add_holder(self);
+      hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
+      hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
+      hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
+
+Same thing for the other holder holding the detector::
+
+     h = hkl_geometry_add_holder(self);
+     hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+
+now it is almost finish for the geometry part. you just need to add it
+in the factory::
+
+   Hklgeometry *hkl_geometry_factory_new(HklGeometryType type, ...)
+   {
+	...
+	switch(type){
+		...
+		case HKL_GEOMETRY_KAPPA4C_VERTICAL:
+			va_start(ap, type);
+			alpha = va_arg(ap, double);
+			va_end(ap);
+			hkl_geometry_init_kappa4C_vertical(geom, alpha);
+		break;
+	}
+	...
+   }
+
+in this exemple the geometry take one parameter. The fatory can have a
+variable number of parameters you just need to take care of this with
+the va_arg methods.
+
+Adding PseudoAxis mode
+======================
+
+Suppose you want to add a new mode to the hkl pseudo axes. Lets call
+it ``psi constant vertical`` to the eulerian 6 circle geometry.
+
+The starting point is to look in the file ``src/hkl-pseudoaxis-factory.c`` for::
+
+    HklEngineList *hkl_engine_list_factory(HklGeometryType type)
+
+in that method you can see this in the eulerian 6 circle part::
+
+   case HKL_GEOMETRY_EULERIAN6C:
+	hkl_engine_list_add(self, hkl_engine_e6c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e6c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+   break;
+
+so as you can see there is three pseudo axis engine for this
+geometry. Your mode if for the hkl pseudo axis. so let look in the
+``hkl_engine_e6c_hkl_new()`` method.  You can find it
+in the file ``include/hkl/hkl-pseudoaxis-e6c.h`` which contain this::
+
+   #ifndef __HKL_PSEUDOAXIS_E6C_H__
+   #define __HKL_PSEUDOAXIS_E6C_H__
+
+   #include <hkl/hkl-pseudoaxis-auto.h>
+
+   HKL_BEGIN_DECLS
+
+   extern HklEngine *hkl_engine_e6c_hkl_new(void);
+   extern HklEngine *hkl_engine_e6c_psi_new(void);
+
+   HKL_END_DECLS
+
+   #endif /* __HKL_PSEUDOAXIS_E6C_H__ */
+
+strange only 2 methods nothing about
+``hkl_engine_q2_new()``. This is because the
+implementation of this method is common to more than one geometry. So
+you can find it in the file ``hkl/hkl-pseudoaxis-common-q.h``
+
+now you need to change the code of
+``hkl_engine_e6c_hkl_new(void)``. Lets look about it in
+the file ``src/hkl-pseudoaxis-e6c-hkl.c``::
+
+    HklEngine *hkl_engine_e6c_hkl_new(void)
+    {
+	HklEngine *self;
+	HklMode *mode;
+
+	self = hkl_engine_hkl_new();
+
+	/* bissector_vertical */
+	mode = hkl_mode_new(
+		"bissector_vertical",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_engine_setter_func_bissector_vertical,
+		0,
+		4, "omega", "chi", "phi", "delta");
+	hkl_engine_add_mode(self, mode);
+
+	/* constant_omega_vertical */
+	mode = hkl_mode_new(
+		"constant_omega_vertical",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
+		0,
+		3, "chi", "phi", "delta");
+	hkl_engine_add_mode(self, mode);
+
+	/* constant_chi_vertical */
+	mode = hkl_mode_new(
+		"constant_chi_vertical",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
+		0,
+		3, "omega", "phi", "delta");
+	hkl_engine_add_mode(self, mode);
+
+	/* constant_phi_vertical */
+	mode = hkl_mode_new(
+		"constant_phi_vertical",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
+		0,
+		3, "omega", "chi", "delta");
+	hkl_engine_add_mode(self, mode);
+
+	/* lifting_detector_phi */
+	mode = hkl_mode_new(
+		"lifting_detector_phi",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
+		0,
+		3, "phi", "gamma", "delta");
+	hkl_engine_add_mode(self, mode);
+
+	/* lifting_detector_omega */
+	mode = hkl_mode_new(
+		"lifting_detector_omega",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
+		0,
+		3, "omega", "gamma", "delta");
+	hkl_engine_add_mode(self, mode);
+
+	/* lifting_detector_mu */
+	mode = hkl_mode_new(
+		"lifting_detector_mu",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_hkl_real,
+		0,
+		3, "mu", "gamma", "delta");
+	hkl_engine_add_mode(self, mode);
+
+	/* double_diffraction vertical*/
+	HklParameter h2;
+	HklParameter k2;
+	HklParameter l2;
+
+	hkl_parameter_init(&h2, "h2", -1, 1, 1,
+			   HKL_TRUE, HKL_TRUE,
+			   NULL, NULL);
+	hkl_parameter_init(&k2, "k2", -1, 1, 1,
+			   HKL_TRUE, HKL_TRUE,
+			   NULL, NULL);
+	hkl_parameter_init(&l2, "l2", -1, 1, 1,
+			   HKL_TRUE, HKL_TRUE,
+			   NULL, NULL);
+
+	mode = hkl_mode_new(
+		"double_diffraction_vertical",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_double_diffraction_real,
+		3, &h2, &k2, &l2,
+		4, "omega", "chi", "phi", "delta");
+	hkl_engine_add_mode(self, mode);
+
+	/* bissector_horizontal */
+	mode = hkl_mode_new(
+		"bissector_horizontal",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_engine_setter_func_bissector_horizontal,
+		0,
+		5, "mu", "omega", "chi", "phi", "gamma");
+	hkl_engine_add_mode(self, mode);
+
+	/* double_diffraction_horizontal */
+	mode = hkl_mode_new(
+		"double_diffraction_horizontal",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_double_diffraction_real,
+		3, &h2, &k2, &l2,
+		4, "mu", "chi", "phi", "gamma");
+	hkl_engine_add_mode(self, mode);
+
+	hkl_engine_select_mode(self, 0);
+
+	return self;
+    }
+
+so you "just" need to add a new mode like this::
+
+	/* double_diffraction_horizontal */
+	mode = hkl_mode_new(
+		"psi_constant_vertical",
+		NULL,
+		hkl_mode_get_hkl_real,
+		hkl_mode_set_psi_constant_vertical,
+		3, &h2, &k2, &l2,
+		4, "omega", "chi", "phi", "delta");
+	hkl_engine_add_mode(self, mode);
+
+So the first parameter of the hkl_mode_new method
+
++ name is the name of the mode
++ then the init functions (usually you need to store the current state of the geometry to be able to use the pseudo axis). Here no need for this init method so we put ``NULL``.
+
++ then the get method which compute for a given geometry the pseudo axis value. the hkl get method ``hkl_mode_get_hkl_real`` is completely generic and do not depend of the geometry. No need to write it.
+
++ then the set method which compute a geometry for the given pseudo axis values. Now you need to work a little bit and write the set method.
+
++ the parameters of your mode
+
+  + first the number of parameters : 3
+  + then each parameters (pointer on the right parameters) for this mode we have 3 parameters h2, k2, l2 which are the coordinates of a sample reference direction use to compute the psi value.
+
++ the name of axes used by the set method.
+
+  + first the number of axes used by the set method : 4
+  + then all axes names.
+
+In fact the "set" method know nothing about the axes names, so you can
+use a set method with different kind of geometries. The association is
+only done during the mode creation.
+
+At the end you need to add this mode to the pseudo axis engine with
+``hkl_engine_add_mode(self, mode);``
+
+that's all.
+
+Now let see how this "set" method could be written. In our case we
+want to compute the geometry angles for a given h, k, l pseudo axis
+values keeping the angle between the reference reciprocal space vector
+(h2, k2, l2) and the diffraction plane defined by the incomming beam
+and the outgoing beam::
+
+	    static int hkl_mode_set_psi_constant_vertical(HklEngine *engine,
+									     HklGeometry *geometry,
+								             HklDetector *detector,
+								             HklSample *sample)
+	    {
+		hkl_engine_prepare_internal(engine, geometry, detector,
+							sample);
+
+		return hkl_engine_solve_function(engine, psi_constant_vertical);
+	    }
+
+the prepare internal part is about initializing the solver with the
+given geometry, detector and sample. Then comes the
+hkl_engine_solve_function which need the
+psi_constant_vertical function to work. This method use the GSL
+library to find the given function roots (where f(x) = 0).  Lets see
+how it works for the "bissector_horizontal" mode::
+
+    static int bissector_horizontal(const gsl_vector *x, void *params, gsl_vector *f)
+    {
+	double mu, omega, gamma;
+	double const *x_data = gsl_vector_const_ptr(x, 0);
+	double *f_data = gsl_vector_ptr(f, 0);
+
+	RUBh_minus_Q(x_data, params, f_data);
+
+	mu = x_data[0];
+	omega = x_data[1];
+	gamma = x_data[4];
+
+	f_data[3] = omega;
+	f_data[4] = gamma - 2 * fmod(mu, M_PI);
+
+	return  GSL_SUCCESS;
+    }
+
+The bissector_horizotal method is used by the setter method of the
+mode to compute the right set of axes angles corresponding to the
+pseudo axes values you want to reach. This method compute the
+difference between these pseudo axes values and the ones computed from
+the axes angles. It can be decompose in three parts:
+
+The first three of these equations are given for the function
+``RUBH_minus_Q``: they are the diference between the h,k,l values that
+want to be set and the h,k,l values computed for a possible
+combination of angles::
+
+	    f_data[0] = h-h(x)
+	    f_data[1] = k-k(x)
+	    f_data[2] = l-l(x)
+
+As the bissector_horizontal mode use 5 axes you need to find 2 other
+equations to be able to solve your mode. The first one is :math:`omega
+= 0`} for an horizontal mode::
+
+  f_data[3] = omega
+
+and the last one is for the bissector parameter :math:`gamma=2*mu`::
+
+    f_data[4] = gamma - 2 * fmod(mu, M_PI)
+
+One question could be why this complicate ``f4 = gamma - 2 * fmod(mu,
+M_PI)`` equation instead of a simpler ``f4 = gamma - 2 * mu`` ?  this
+is because the bissector_horizontal method is also called by a
+solution multiplicator to gives the user plenty of equivalent
+solutions. This multiplicator do some operations like ``omega = pi -
+omega`` or ``omega = - omega`` on the axes.  Then it check that the
+new angles combination gives also :math:`f(x) = 0`. This is the
+explaination of this more complicate equation.
+
+So in our case we need to build something like::
+
+   static int psi_constant_vertical(const gsl_vector *x, void *params, gsl_vector *f)
+   {
+	double mu, omega, gamma;
+	double const *x_data = gsl_vector_const_ptr(x, 0);
+	double *f_data = gsl_vector_ptr(f, 0);
+
+	RUBh_minus_Q(x_data, params, f_data);
+
+	f_data[3] = ???;
+
+	return  GSL_SUCCESS;
+    }
+
+The missing part is about the psi computation. ``f3 = psi (target) -
+psi(x)``.  Calculation psi is done in the psi pseudo axis common
+part::
+
+	   static int psi(const gsl_vector *x, void *params, gsl_vector *f)
+
+This psi method is the equivalent of psi_constant_vertical. So you
+need to factorize the psi calculation in between psi_constant_vertical
+and psi.
diff --git a/Documentation/sphinx/source/diffractometers/e4cv.rst b/Documentation/sphinx/source/diffractometers/e4cv.rst
new file mode 100644
index 0000000..2b37288
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/e4cv.rst
@@ -0,0 +1,108 @@
+Eulerian 4 circles
+##################
+
+.. figure:: ../../../figures/3S+1D.png
+   :align: center
+   :width: 8cm
+
+   Schematic view of the diffractometer.
+
+Geometry
+********
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 3 axes for the sample
+
+  + **omega** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **chi** : rotating around the :math:`\vec{x}` direction (1, 0, 0)
+  + **phi** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+
++ 1 axis for the detector
+
+  + **tth** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+Pseudo axes
+***********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **bissector**
+
+  + Axes: **omega**, **chi**, **phi**, **tth**
+  + Parameters : No parameter
+
+  This mode add the bissector constrain ``tth = 2 * omega``. In this
+  mode the **chi** circle containt the vector of diffusion
+  :math:`\vec{Q}`. So it is easy to know the orientation of the hkl
+  plan.
+
++ mode **constant_omega**
+
+  + Axes : **chi**, **phi**, **tth**
+  + Parameters : No parameter
+
+  This mode do not move the current **omega** axis.
+
++ mode **constant_chi**
+
+  + Axes :  **omega**, **phi**, **tth**
+  + Parameters : No parameter
+
+  This mode do not move the current **chi** axis.
+
++ mode **constant_phi**
+
+  + Axes related : **omega**, **chi**, **tth**
+  + Parameters : No parameter
+
+  This mode do not move the current **phi** axis.
+
++ mode **double_diffraction**
+
+  + Axes : **omega**, **chi**, **phi**, **tth**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in
+  Bragg condition.  This is usefull sometimes when you want to explore
+  two bragg peaks without moving your sample.
+
++ mode **psi_constant**
+
+  + Axes :  **omega**, **chi**, **phi**, **tth**
+  + Parameters : **h2**, **k2**, **l2**, **psi**
+
+  This mode allow to fix the value of the pseudo axis **psi** at a
+  constant value when you move around an **h**, **k** , **l**
+  position. The (**h2**, **k2**, **l2**) vector is used as a reference
+  for the computation of the **psi** pseudo axis value.
+
+  You can retrive and ``freeze`` the current value of the **psi**
+  pseudo axis value into the **psi** parameter when you initialize the
+  mode. But you can also write directly the value of the desired
+  **psi** parameter.
+
+psi
+===
+
+PseudoAxis provided : **psi**
+
++ mode **psi**
+
+  + Axes : **omega**, **chi**, **phi**, **tth**
+  + Parameters : **h1**, **k1**, **l1**
+
+q
+=
+
+PseudoAxis provided : **q**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+
++ mode : **q**
+
+  + Axes : **"tth"**
+  + Parameters : no parameter
+
diff --git a/Documentation/sphinx/source/diffractometers/e6c.rst b/Documentation/sphinx/source/diffractometers/e6c.rst
new file mode 100644
index 0000000..1566d29
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/e6c.rst
@@ -0,0 +1,166 @@
+Eulerian 6 circles
+##################
+
+.. figure:: ../../../figures/4S+2D.png
+   :align: center
+   :width: 8cm
+
+   Schematic view of the diffractometer.
+
+Geometry
+********
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 4 axes for the sample
+
+  + **mu** : rotating around the :math:`\vec{z}` direction (0, 0, 1)
+  + **omega** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **chi** : rotating around the :math:`\vec{x}` direction (1, 0, 0)
+  + **phi** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+
++ 2 axes for the detector
+
+  + **gamma** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **delta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+PseudoAxes
+**********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **bissector_vertical**
+
+  + Axes: **omega**, **chi**, **phi**, **delta**
+  + Parameters : No parameter
+
+  This mode add the bissector constrain ``delta = 2 * omega``. In this
+  mode the **chi** circle containt the vector of diffusion
+  :math:`\vec{Q}`. So it is easy to know the orientation of the hkl
+  plan.
+
++ mode **constant_omega_vertical**
+
+  + Axes: **"chi"**, **"phi"**, **"delta"**
+  + Parameters : no parameter
+
+  This mode do not move the **omega** axis.
+
++ mode **constant_chi_vertical**
+
+  + Axes: **"omega"**, **"phi"**, **"delta"**
+  + Parameters : no parameter
+
+  This mode do not move the **chi** axis.
+
++ mode **constant_phi_vertical**
+
+  + Axes : **"omega"**, **"chi"**, **"delta"**
+  + Parameters : no parameter
+
+  This mode do not move the **phi** axis.
+
++ mode : **lifting_detector_phi**
+
+  + Axes : **"phi"**, **"gamma"**, **"delta"**
+  + Parameters : No Parameters
+
++ mode : **lifting_detector_omega**
+
+  + Axes : **"omega"**, **"gamma"**, **"delta"**
+  + Parameters : No Parameters
+
++ mode : **lifting_detector_mu**
+
+  + Axes : **"mu"**, **"gamma"**, **"delta"**
+  + Parameters : No Parameters
+
++ mode : **double_diffraction vertical**
+
+  + Axes : **"omega"**, **"chi"**, **"phi"**, **"delta"**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in Bragg
+  condition.  This is usefull sometimes when you want to explore two
+  bragg peaks without moving your sample.
+
++ mode : **bissector_horizontal**
+
+  + Axes : **"mu"**, **"omega"**, **"chi"**, **"phi"**, **"gamma"**
+  + Parameters : No parameters
+
++ mode : **double_diffraction_horizontal**
+
+  + Axes : **"mu"**, **"omega"**, **"chi"**, **phi**, **"gamma"**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in Bragg
+  condition.  This is usefull sometimes when you want to explore two
+  bragg peaks without moving your sample.
+
++ mode : **psi_constant_vertical**
+
+  + Axes : **"omega"**, **"chi"**, **phi**, **"delta"**
+  + Parameters : **h2**, **k2**, **l2**, **psi**
+
+  This mode allow to fix the value of the pseudo axis **psi** at a
+  constant value when you move around an **h**, **k** , **l**
+  position. The (**h2**, **k2**, **l2**) vector is used as a reference
+  for the computation of the **psi** pseudo axis value.
+
+  You can retrive and ``freeze`` the current value of the **psi**
+  pseudo axis value into the **psi** parameter when you initialize the
+  mode. But you can also write directly the value of the desired
+  **psi** parameter.
+
++ mode : **psi_constant_horizontal**
+
+  + Axes : **"omega"**, **"chi"**, **phi**, **"gamma"**
+  + Parameters : **h2**, **k2**, **l2**, **psi**
+
+  This mode allow to fix the value of the pseudo axis **psi** at a
+  constant value when you move around an **h**, **k** , **l**
+  position. The (**h2**, **k2**, **l2**) vector is used as a reference
+  for the computation of the **psi** pseudo axis value.
+
+  You can retrive and ``freeze`` the current value of the **psi**
+  pseudo axis value into the **psi** parameter when you initialize the
+  mode. But you can also write directly the value of the desired
+  **psi** parameter.
+
++ mode **constant_mu_horizontal**
+
+  + Axes : **"chi"**, **"phi"**, **"gamma"**
+  + Parameters : no parameter
+
+  This mode do not move the **mu** axis.
+
+psi
+===
+
+PseudoAxis provided : **psi**
+
++ mode **psi_vertical**
+
+  + Axes : **komega**, **kappa**, **kphi**, **delta**
+  + Parameters : **h1**, **k1**, **l1**
+
+  The (**h1**, **k1**, **l1**) vector is used as a reference for the
+  computation of the **psi** pseudo axis value.
+
+q2
+==
+
+PseudoAxis provided : **q**, **alpha**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+and **alpha** is the azimuth of :math:`\vec{Q}` in the ``yz``
+plan. The origin of this angles is the :math:`\vec{y}` vector, and the
+positive rotation along :math:`\vec{x}`
+
++ mode : **q2**
+
+  + Axes : **"gamma"**, **"delta"**
+  + Parameters : no parameter
diff --git a/Documentation/sphinx/source/diffractometers/k4cv.rst b/Documentation/sphinx/source/diffractometers/k4cv.rst
new file mode 100644
index 0000000..d64a947
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/k4cv.rst
@@ -0,0 +1,127 @@
+Kappa 4 circles vertical
+########################
+
+.. figure:: ../../../figures/k4cv.png
+   :align: center
+   :width: 8cm
+
+   Schematic view of the diffractometer.
+
+Geometry
+********
+
+For this geometry there is a special parameters called :math:`\alpha` which is the
+angle between the kappa rotation axis and the  :math:`\vec{y}` direction.
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 3 axes for the sample
+
+  + **komega** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **kappa** : rotating around the :math:`\vec{x}` direction (0, :math:`-\cos\alpha`, :math:`-\sin\alpha`)
+  + **kphi** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+
++ 1 axis for the detector
+
+  + **tth** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+PseudoAxes
+**********
+
+eulerians
+=========
+
+PseudoAxes provides : **"omega"**, **"chi"**, **"phi"**
+
++ mode **eulerians**
+
+  + Axes : **komega**, **kappa**, **kphi**
+  + Parameters : **"solution"**
+
+  When you compute the eulerians values from the kappa axes values,
+  there is two possibilities, so the **"solution"** parameter when set
+  0 or 1 allow to switch from one solution to the other.
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **bissector**
+
+  + Axes: **komega**, **kappa**, **kphi**, **tth**
+  + Parameters : No parameter
+
+  This mode add the bissector constrain ``tth = 2 * omega``. In this
+  mode the equivalent eulerian **chi** circle containt the vector of
+  diffusion :math:`\vec{Q}`. So it is easy to know the orientation of
+  the hkl plan.
+
++ mode **constant_omega**
+
+  + Axes : **"komega"**, **"kappa"**, **"kphi"**, **"tth"**
+  + Parameters : **"omega"**
+
+  This mode do not move the equivalent eulerian **omega** axis, fixed
+  by the parameter of the mode.
+
++ mode **constant_chi**
+
+  + Axes : **"komega"**, **"kappa"**, **"kphi"**, **"tth"**
+  + Parameters : **"chi"**
+
+  This mode do not move the equivalent eulerian **chi** axis fixed by
+  the parameter of the mode.
+
++ mode **constant_phi**
+
+  + Axes related : **"komega"**, **"kappa"**, **"kphi"**, **"tth"**
+  + Parameters : **"phi"**
+
+  This mode do not move the equivalent eulerian **phi** axis fixed by
+  the parameter of the mode.
+
++ mode **double_diffraction**
+
+  + Axes : **komega**, **kappa**, **kphi**, **tth**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in Bragg
+  condition.  This is usefull sometimes when you want to explore two
+  bragg peaks without moving your sample.
+
++ mode **psi_constant**
+
+  + Axes :  **komega**, **kappa**, **kphi**, **tth**
+  + Parameters : **h2**, **k2**, **l2**, **psi**
+
+  This mode allow to fix the value of the pseudo axis **psi** at a
+  constant value when you move around an **h**, **k** , **l**
+  position. The (**h2**, **k2**, **l2**) vector is used as a reference
+  for the computation of the **psi** pseudo axis value.
+
+  You can retrive and ``freeze`` the current value of the **psi**
+  pseudo axis value into the **psi** parameter when you initialize the
+  mode. But you can also write directly the value of the desired
+  **psi** parameter.
+
+psi
+===
+
+PseudoAxis provided : **psi**
+
++ mode **psi**
+
+  + Axes : **komega**, **kappa**, **kphi**, **tth**
+  + Parameters : **h1**, **k1**, **l1**
+
+q
+=
+
+PseudoAxis provided : **q**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+
++ mode : **q**
+
+  + Axes : **"tth"**
+  + Parameters : no parameter
diff --git a/Documentation/sphinx/source/diffractometers/k6c.rst b/Documentation/sphinx/source/diffractometers/k6c.rst
new file mode 100644
index 0000000..d5b2e0e
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/k6c.rst
@@ -0,0 +1,185 @@
+Kappa 6 circles
+###############
+
+.. figure:: ../../../figures/k6c.png
+   :align: center
+   :width: 8cm
+
+   Schematic view of the diffractometer.
+
+Geometry
+********
+
+For this geometry there is a special parameters called :math:`\alpha` which is the
+angle between the kappa rotation axis and the  :math:`\vec{y}` direction.
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 4 axes for the sample
+
+  + **mu** : rotating around the :math:`\vec{z}` direction (0, 0, 1)
+  + **komega** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **kappa** : rotating around the :math:`\vec{x}` direction (0, :math:`-\cos\alpha`, :math:`-\sin\alpha`)
+  + **kphi** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+
++ 2 axes for the detector
+
+  + **gamma** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **delta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+PseudoAxes
+**********
+
+eulerians
+=========
+
+PseudoAxes provides : **"omega"**, **"chi"**, **"phi"**
+
++ mode **eulerians**
+
+  + Axes : **komega**, **kappa**, **kphi**
+  + Parameters : **"solution"**
+
+  When you compute the eulerians values from the kappa axes values,
+  there is two possibilities, so the **"solution"** parameter when set
+  0 or 1 allow to switch from one solution to the other.
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **bissector_vertical**
+
+  + Axes: **komega**, **kappa**, **kphi**, **delta**
+  + Parameters : No parameter
+
+  This mode add the bissector constrain ``tth = 2 * omega``. In this
+  mode the equivalent eulerian **chi** circle containt the vector of
+  diffusion :math:`\vec{Q}`. So it is easy to know the orientation of
+  the hkl plan.
+
++ mode **constant_omega_vertical**
+
+  + Axes: **"komega"**, **"kappa"**, **"kphi"**, **"delta"**
+  + Parameters : **omega**
+
+  This mode do not move the equivalent eulerian **omega** axis.
+
++ mode **constant_chi_vertical**
+
+  + Axes: **"komega"**, **"kappa"**, **"kphi"**, **"delta"**
+  + Parameters : **chi**
+
+  This mode do not move the equivalent eulerian **chi** axis.
+
++ mode **constant_phi_vertical**
+
+  + Axes : **"komega"**, **"kappa"**, **"kphi"**, **"delta"**
+  + Parameters : **phi**
+
+  This mode do not move the equivalent eulerian **phi** axis.
+
++ mode : **lifting_detector_kphi**
+
+  + Axes : **"kphi"**, **"gamma"**, **"delta"**
+  + Parameters : No Parameters
+
++ mode : **lifting_detector_mu**
+
+  + Axes : **"mu"**, **"gamma"**, **"delta"**
+  + Parameters : No Parameters
+
++ mode : **double_diffraction vertical**
+
+  + Axes : **"komega"**, **"kappa"**, **"kphi"**, **"delta"**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in
+  Bragg condition.  This is usefull sometimes when you want to explore
+  two bragg peaks without moving your sample.
+
++ mode : **bissector_horizontal**
+
+  + Axes : **"mu"**, **"komega"**, **"kappa"**, **"kphi"**, **"gamma"**
+  + Parameters : No parameters
+
++ mode : **constant_phi_horizontal**
+
+  + Axes : **"mu"**, **"komega"**, **"kappa"**, **"kphi"**, **"gamma"**
+  + Parameters : **phi**
+
++ mode : **horizontal kphi constant**
+
+  + Axes :  **"mu"**, **"komega"**, **"kappa"**, **"gamma"**
+  + Parameters : no parameters
+
++ mode : **double_diffraction_horizontal**
+
+  + Axes : **"mu"**, **"komega"**, **"kappa"**, **kphi**, **"gamma"**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in
+  Bragg condition.  This is usefull sometimes when you want to explore
+  two bragg peaks without moving your sample.
+
++ mode : **psi_constant_vertical**
+
+  + Axes : **"komega"**, **"kappa"**, **kphi**, **"delta"**
+  + Parameters : **h2**, **k2**, **l2**, **psi**
+
+  This mode allow to fix the value of the pseudo axis **psi** at a
+  constant value when you move around an **h**, **k** , **l**
+  position. The (**h2**, **k2**, **l2**) vector is used as a reference
+  for the computation of the **psi** pseudo axis value.
+
+  You can retrive and ``freeze`` the current value of the **psi**
+  pseudo axis value into the **psi** parameter when you initialize the
+  mode. But you can also write directly the value of the desired
+  **psi** parameter.
+
++ mode : **constant_incidence**
+
+  + Axes : **"komega"**, **"kappa"**, **kphi**, **"gamma"**, **"delta"**
+  + Parameters : **x**, **y**, **z**, **incidence**, **azimuth**
+
+  This mode allow to work with a constant incidence of the incoming
+  beam onto the sample surface.
+  To use this mode you need to follow a few steps:
+
+    + align your surface along a direction :math:`\vec{n}` (**x**,
+      **y**, **z**) in the laboratory space, with your diffractometer.
+    + initialize the mode, so it can remember the current diffractometer
+      position for futur computation.
+    + set the desired **incidence**
+    + set the desired **azimuth** of the normal of the surface in the
+      YOZ plane (azimuth = 0 -> :math:`\vec{n}` along :math:`\vec{y}`)
+
+  Now it is possible to do an HKL computation.
+
+psi
+===
+
+PseudoAxis provided : **psi**
+
++ mode **psi_vertical**
+
+  + Axes : **komega**, **kappa**, **kphi**, **delta**
+  + Parameters : **h1**, **k1**, **l1**
+
+  The (**h1**, **k1**, **l1**) vector is used as a reference for the
+  computation of the **psi** pseudo axis value.
+
+q2
+==
+
+PseudoAxis provided : **q**, **alpha**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+and **alpha** is the azimuth of :math:`\vec{Q}` in the ``yz``
+plan. The origin of this angles is the :math:`\vec{y}` vector, and the
+positive rotation along :math:`\vec{x}`
+
++ mode : **q2**
+
+  + Axes : **"gamma"**, **"delta"**
+  + Parameters : no parameter
diff --git a/Documentation/sphinx/source/diffractometers/mars.rst b/Documentation/sphinx/source/diffractometers/mars.rst
new file mode 100644
index 0000000..f1242e8
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/mars.rst
@@ -0,0 +1,101 @@
+SOLEIL MARS
+###########
+
+Geometry
+********
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 3 axes for the sample
+
+  + **omega** : rotating around the :math:`\vec{z}` direction (0, -1, 0)
+  + **chi** : rotating around the :math:`\vec{x}` direction (-1, 0, 0)
+  + **phi** : rotating around the :math:`\vec{z}` direction (0, 0, 1)
+
++ 1 axis for the detector
+
+  + **tth** : rotation around the :math:`\vec{z}` direction (0, -1, 0)
+
+Pseudo axes
+***********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **bissector**
+
+  + Axes: **omega**, **chi**, **phi**, **tth**
+  + Parameters : No parameter
+
+  This mode add the bissector constrain ``tth = 2 * omega``. In this
+  mode the **chi** circle containt the vector of diffusion
+  :math:`\vec{Q}`. So it is easy to know the orientation of the hkl
+  plan.
+
++ mode **constant_omega**
+
+  + Axes : **chi**, **phi**, **tth**
+  + Parameters : No parameter
+
+  This mode do not move the current **omega** axis.
+
++ mode **constant_chi**
+
+  + Axes :  **omega**, **phi**, **tth**
+  + Parameters : No parameter
+
+  This mode do not move the current **chi** axis.
+
++ mode **constant_phi**
+
+  + Axes related : **omega**, **chi**, **tth**
+  + Parameters : No parameter
+
+  This mode do not move the current **phi** axis.
+
++ mode **double_diffraction**
+
+  + Axes : **omega**, **chi**, **phi**, **tth**
+  + Parameters : **h2**, **k2**, **l2**
+
+  This mode put a second hkl vector (**h2**, **k2**, **l2**) in
+  Bragg condition.  This is usefull sometimes when you want to explore
+  two bragg peaks without moving your sample.
+
++ mode **psi_constant**
+
+  + Axes :  **omega**, **chi**, **phi**, **tth**
+  + Parameters : **h2**, **k2**, **l2**, **psi**
+
+  This mode allow to fix the value of the pseudo axis **psi** at a
+  constant value when you move around an **h**, **k** , **l**
+  position. The (**h2**, **k2**, **l2**) vector is used as a reference
+  for the computation of the **psi** pseudo axis value.
+
+  You can retrive and ``freeze`` the current value of the **psi**
+  pseudo axis value into the **psi** parameter when you initialize the
+  mode. But you can also write directly the value of the desired
+  **psi** parameter.
+
+psi
+===
+
+PseudoAxis provided : **psi**
+
++ mode **psi**
+
+  + Axes : **omega**, **chi**, **phi**, **tth**
+  + Parameters : **h1**, **k1**, **l1**
+
+q
+=
+
+PseudoAxis provided : **q**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+
++ mode : **q**
+
+  + Axes : **"tth"**
+  + Parameters : no parameter
diff --git a/Documentation/sphinx/source/diffractometers/med2_2.rst b/Documentation/sphinx/source/diffractometers/med2_2.rst
new file mode 100644
index 0000000..3559c19
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/med2_2.rst
@@ -0,0 +1,54 @@
+SOLEIL SIXS MED2+2
+##################
+
+Geometry
+********
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 3 axes for the sample
+
+  + **beta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **mu** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **omega** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+
++ 3 axis for the detector
+
+  + **beta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **gamma** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **delta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+
+PseudoAxes
+**********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **mu_fixed**
+
+  + Axes : **omega**, **gamma**, **delta**
+  + Parameters : No parameter
+
++ mode **reflectivity**
+
+  + Axes : **mu**, **omega**, **gamma**, **delta**
+  + Parameters : No parameter
+
+  This mode add the reflectivity constraint ``2*mu = gamma``. The
+  incomming beam angle and the outgoing beam angle are equals.
+
+q2
+==
+
+PseudoAxis provided : **q**, **alpha**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+and **alpha** is the azimuth of :math:`\vec{Q}` in the ``yz``
+plan. The origin of this angles is the :math:`\vec{y}` vector, and the
+positive rotation along :math:`\vec{x}`
+
++ mode : **q2**
+
+  + Axes : **"gamma"**, **"delta"**
+  + Parameters : no parameter
diff --git a/Documentation/sphinx/source/diffractometers/zaxis.rst b/Documentation/sphinx/source/diffractometers/zaxis.rst
new file mode 100644
index 0000000..36014fd
--- /dev/null
+++ b/Documentation/sphinx/source/diffractometers/zaxis.rst
@@ -0,0 +1,55 @@
+Z-Axis
+######
+
+Geometry
+********
+
+For this geometry the **mu** axis is common to the sample and the detector.
+
++ xrays source fix allong the :math:`\vec{x}` direction (1, 0, 0)
++ 2 axes for the sample
+
+  + **mu** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **omega** : rotating around the :math:`-\vec{y}` direction (0, -1, 0)
+
++ 3 axis for the detector
+
+  + **mu** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+  + **delta** : rotation around the :math:`-\vec{y}` direction (0, -1, 0)
+  + **gamma** : rotation around the :math:`\vec{z}` direction (0, 0, 1)
+
+PseudoAxes
+**********
+
+hkl
+===
+
+PseudoAxes provided : **h**, **k** and **l**
+
++ mode **zaxis**
+
+  + Axes : **omega**, **delta**, **gamma**
+  + Parameters : No parameter
+
++ mode **reflectivity**
+
+  + Axes : **mu**, **omega**, **delta**, **gamma**
+  + Parameters : No parameter
+
+  This mode add the reflectivity constraint ``mu = gamma``. The
+  incomming beam angle and the outgoing beam angle are equals.
+
+q2
+==
+
+PseudoAxis provided : **q**, **alpha**
+
+where **q** is :math:`|\vec{Q}| = \frac{2 \tau}{\lambda} \sin{\theta}`
+and **alpha** is the azimuth of :math:`\vec{Q}` in the ``yz``
+plan. The origin of this angles is the :math:`\vec{y}` vector, and the
+positive rotation along :math:`\vec{x}`
+
++ mode : **q2**
+
+  + Axes : **"gamma"**, **"delta"**
+  + Parameters : no parameter
diff --git a/Documentation/sphinx/source/index.rst b/Documentation/sphinx/source/index.rst
new file mode 100644
index 0000000..3fd221f
--- /dev/null
+++ b/Documentation/sphinx/source/index.rst
@@ -0,0 +1,37 @@
+.. hkl documentation master file, created by
+   sphinx-quickstart on Sat May 28 14:45:51 2011.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to hkl's |version| documentation!
+=========================================
+
+Contents:
+
+.. toctree::
+   :maxdepth: 1
+   :numbered:
+   :titlesonly:
+
+   introduction
+   diffractometers/e4cv
+   diffractometers/k4cv
+   diffractometers/e6c
+   diffractometers/k6c
+   diffractometers/zaxis
+   diffractometers/med1_2
+   diffractometers/med2_2
+   diffractometers/med2_3
+   diffractometers/mars
+   diffractometers/petra3
+   pseudo
+   bindings/bindings
+   development
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/Documentation/sphinx/source/introduction.rst b/Documentation/sphinx/source/introduction.rst
new file mode 100644
index 0000000..f678762
--- /dev/null
+++ b/Documentation/sphinx/source/introduction.rst
@@ -0,0 +1,818 @@
+.. _introduction:
+
+Introduction
+############
+
+The purpose of the library is to factorise single crystal diffraction
+angles computation for different kind of diffractometer geometries. It
+is used at the SOLEIL, Desy and Alba synchrotron with the Tango
+control system to pilot diffractometers.
+
+Features
+********
+
++ mode computation (aka PseudoAxis)
+
+  + item for different diffractometer geometries.
+
++ UB matrix computation.
+
+  + busing & Levy with 2 reflections
+  + simplex computation with more than 2 reflections using the GSL library.
+  + Eulerians angles to pre-orientate your sample.
+
++ Crystal lattice affinement
+
+  + with more than 2 reflections you can select which parameter must be fitted.
+
++ Pseudoaxes
+
+  + psi, eulerians, q, ...
+
+Conventions
+***********
+
+In all this document the next convention will be used to describe the diffractometers
+geometries.
+
++ right handed convention for all the angles.
++ direct space orthogonal base.
++ description of the diffractometer geometries is done with all axes values set to zero.
+
+
+Diffraction
+###########
+
+the crystal
+***********
+
+A periodic crystal is the association of a pattern and a lattice. The
+pattern is located at each points of the lattice node.  Positions of
+those nodes are given by:
+
+.. math::
+   R_{uvw}=u\cdot\vec{a}+v\cdot\vec{b}+w\cdot\vec{c}
+
+:math:`\vec{a}`, :math:`\vec{b}`, :math:`\vec{c}` are the former
+vector of a base of the space. ``u``, ``v``, ``w`` are integrers. The
+pattern contain atomes associated to each lattice node.  the purpose
+of diffraction is to study the interaction of this crystal
+(pattern+lattice) with X-rays.
+
+.. figure:: ../../figures/crystal.png
+   :align: center
+   :width: 8cm
+
+   Crystal direct lattice.
+
+this lattice is defined by :math:`\vec{a}`, :math:`\vec{b}`,
+:math:`\vec{c}` vectors, and the angles :math:`\alpha`, :math:`\beta`,
+:math:`\gamma`. In general cases this lattice is not othonormal.
+
+Nevertheless to compute the interaction of this real space lattice and
+the X-Rays, it is convenient to define another lattice called
+reciprocal lattice defined like this:
+
+.. math::
+   :nowrap:
+   :label: reciprocal lattice
+
+   \begin{eqnarray*}
+	\vec{a}^{\star} & = & \tau\frac{\vec{b}\wedge\vec{c}}{\vec{a}\cdot(\vec{b}\wedge\vec{c})}\\
+	\vec{b}^{\star} & = & \tau\frac{\vec{c}\wedge\vec{a}}{\vec{b}\cdot(\vec{c}\wedge\vec{a})}\\
+	\vec{c}^{\star} & = & \tau\frac{\vec{a}\wedge\vec{b}}{\vec{c}\cdot(\vec{a}\wedge\vec{b})} 
+   \end{eqnarray*}
+
+:math:`\tau=2\pi` or :math:`\tau=1` depending on the conventions.
+
+It is then possible to define thoses orthogonal properties:
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	\vec{a}^{\star}\cdot\vec{a}=\tau & \vec{b}^{\star}\cdot\vec{a}=0    & \vec{c}^{\star}\cdot\vec{a}=0\\
+	\vec{a}^{\star}\cdot\vec{b}=0    & \vec{b}^{\star}\cdot\vec{b}=\tau & \vec{c}^{\star}\cdot\vec{b}=0\\
+	\vec{a}^{\star}\cdot\vec{c}=0    & \vec{b}^{\star}\cdot\vec{c}=0    & \vec{c}^{\star}\cdot\vec{c}=\tau 
+   \end{eqnarray*}
+
+This reciprocal space lattice allow to write in a simpler form the
+interaction between the crystal and the X-Rays. We often only know
+about :math:`\vec{a}`, :math:`\vec{b}`, :math:`\vec{c}` vectors and
+the angles :math:`\alpha`, :math:`\beta`, :math:`\gamma`. Using the
+previous equations :eq:`reciprocal`, we can compute the reciprocal
+lattice this way:
+
+.. math::
+   :label: reciprocal
+   :nowrap:
+
+   \begin{eqnarray*}
+	a^{\star} & = & \frac{\sin\alpha}{aD}\\
+	b^{\star} & = & \frac{\sin\beta}{bD}\\
+	c^{\star} & = & \frac{\sin\gamma}{cD}
+   \end{eqnarray*}
+
+where
+
+.. math::
+   D=\sqrt{1-\cos^{2}\alpha-\cos^{2}\beta-\cos^{2}\gamma+2\cos\alpha\cos\beta\cos\gamma}
+
+To compute the angles between the reciprocal space vectors, it is once
+again possible to use the previous equations :eq:`reciprocal` to
+obtain the sinus and cosinus of the angles :math:`\alpha^\star`,
+:math:`\beta^\star` et :math:`\gamma^\star`:
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	\cos\alpha^{\star}=\frac{\cos\beta\cos\gamma-\cos\alpha}{\sin\beta\sin\gamma} & \, & \sin\alpha^{\star}=\frac{D}{\sin\beta\sin\gamma} \\
+	\cos\beta^{\star}=\frac{\cos\gamma\cos\alpha-\cos\beta}{\sin\gamma\sin\alpha} & \, & \sin\beta^{\star}=\frac{D}{\sin\gamma\sin\alpha}\\
+	\cos\gamma^{\star}=\frac{\cos\alpha\cos\beta-\cos\gamma}{\sin\alpha\sin\beta} & \, & \sin\gamma^{\star}=\frac{D}{\sin\alpha\sin\beta}
+   \end{eqnarray*}
+
+
+Diffraction
+***********
+
+Let the incomming X-rays beam whose wave vector is :math:`\vec{k_{i}}`,
+:math:`|k_{i}|=\tau/\lambda` where :math:`\lambda` is the wavelength
+of the signal. The :math:`\vec{k_{d}}` vector wavelength of the
+diffracted beam. There is diffusion if the diffusion vector
+:math:`\vec{q}` can be expressed as follows:
+
+.. math::
+   \vec{q}=\vec{k_{d}}-\vec{k_{i}}=h.\vec{a}^{*}+k.\vec{b}^{*}+l.\vec{c}^{*}
+
+where :math:`(h,k,l)\in\mathbb{N}^{3}` and
+:math:`(h,k,l)\neq(0,0,0)`. Thoses indices :math:`(h,k,l)` are named
+Miller indices.
+
+Another way of looking at things has been given by Bragg and that
+famous relationship:
+
+.. math::
+   n\lambda=2d\sin\theta
+
+where :math:`d` is the inter-plan distance and :math:`n \in
+\mathbb{N}`.
+
+The diffusion accure for a unique :math:`\theta` angle.
+Then we got :math:`\vec{q}` perpendicular to the diffraction plan.
+
+The Ewald construction allow to represent this diffraction in the
+reciprocal space.
+
+
+Quaternions
+***********
+
+Properties
+==========
+
+The quaternions will be used to discribe the diffractometers
+geometries.  Thoses quaternions can represent 3D rotations. There is
+different way to describe then like complex numbers.
+
+.. math::
+   q=a+bi+cj+dk
+
+or
+
+.. math::
+   q=[a,\vec{v}]
+
+To compute the quaternion's norm, we can proceed like for complex
+numbers
+
+.. math::
+   \lvert q \rvert = \sqrt{a{{}^2}+b{{}^2}+c{{}^2}+d{{}^2}}
+
+Its conjugate is :
+
+.. math::
+   q^{*}=[a,-\vec{u}]=a-bi-cj-dk
+
+Operations
+==========
+
+The difference with the complexnumber algebre is about
+non-commutativity.
+
+.. math::
+   qp \neq pq
+
+.. math::
+   \bordermatrix{
+	~ & 1 & i  & j  & k \cr
+	1 & 1 & i  & j  & k \cr
+	i & i & -1 & k  & -j \cr
+	j & j & -k & -1 & i \cr
+	k & k & j  & -i & -1
+   }
+
+The product of two quaternions can be express by the Grassman product
+:eq:`Grassman product`. So for two quaternions :math:`p` and
+:math:`q`:
+
+.. math::
+   :nowrap:
+
+   \begin{align*}
+	q &= a+\vec{u} = a+bi+cj+dk\\
+	p &= t+\vec{v} = t+xi+yj+zk
+   \end{align*}
+
+we got
+
+.. math::
+   :label: Grassman product
+
+   pq=at-\vec{u}\cdot\vec{v}+a\vec{v}+t\vec{u}+\vec{v}\times\vec{u}
+
+or equivalent
+
+.. math::
+   pq=(at-bx-cy-dz)+(bt+ax+cz-dy)i+(ct+ay+dx-bz)j+(dt+az+by-cx)k
+
+3D rotations
+============
+
+L'ensemble des quaternions unitaires (leur norme est égale à 1) est le
+groupe qui représente les rotations dans l'espace 3D. Si on a un
+vecteur unitaire :math:`\vec{u}` et un angle de rotation
+:math:`\theta` alors le quaternion
+:math:`[\cos\frac{\theta}{2},\sin\frac{\theta}{2}\vec{u]}` représente
+la rotation de :math:`\theta` autour de l'axe :math:`\vec{u}` dans le
+sens trigonométrique. Nous allons donc utiliser ces quaternions
+unitaires pour représenter les mouvements du diffractomètre.
+
+Alors que dans le plan 2D une simple multiplication entre un nombre
+complex et le nombre :math:`e^{i\theta}` permet de calculer simplement
+la rotation d'angle :math:`\theta` autour de l'origine, dans l'espace
+3D l'expression équivalente est:
+
+.. math::
+   z'=qzq^{-1}
+
+où :math:`q` est le quaternion de norme 1 représentant la rotation dans
+l'espace et :math:`z` le quaternion représentant le vecteur qui subit la
+rotation (sa partie réelle est nulle).
+
+Dans le cas des quaternions de norme 1, il est très facile de calculer
+:math:`q^{-1}`. En effet l'inverse d'une rotation d'angle
+:math:`\theta` est la rotation d'angle :math:`-\theta`. On a donc
+directement:
+
+.. math::
+   q^{-1}=[\cos\frac{-\theta}{2},\sin\frac{-\theta}{2}\vec{u}]=[\cos\frac{\theta}{2},-\sin\frac{\theta}{2}\vec{u}]=q^{*}
+
+Le passage aux matrices de rotation se fait par la formule suivante
+:math:`q\rightarrow M`.
+
+.. math::
+   \begin{bmatrix}
+	a{{}^2}+b{{}^2}-c{{}^2}-d{{}^2} & 2bc-2ad & 2ac+2bd\\
+	2ad+2bc & a{{}^2}-b{{}^2}+c{{}^2}-d{{}^2} & 2cd-2ab\\
+	2bd-2ac & 2ab+2cd & a{{}^2}-b{{}^2}-c{{}^2}+d{{}^2}
+   \end{bmatrix}
+
+La composition de rotation se fait simplement en multipliant les
+quaternions entre eux. Si l'on à :math:`q`
+
+Les Diffractomètres
+###################
+
+Eulérien 3S+1D
+**************
+
+Nous allons nous inspirer du modèle de Busin et Levy pour décrire
+notre diffractomètre. Les sens de rotation sont respectés mais le
+repère directe est choisi de façon à correspondre au repère de
+laboratoire de la ligne CRYSTAL du synchrotron Soleil. Les photons-X
+se propagent suivant le vecteur :math:`\vec{x}` et la direction
+verticale est suivant le vecteur :math:`\vec{z}`. Ce diffractomètre
+est de type verticale (le vecteur de diffusion :math:`\vec{Q}` est
+dans le plan xOz). Les angles permettant de décrire la configuration
+du diffractomètre sont présentés sur la figure~\ref{cap:3S+1D}.
+
+.. figure:: ../../figures/3S+1D.png
+   :align: center
+   :width: 8cm
+
+   Dénomination des angles du diffractomètre 3S+1D Eulérien.\label{cap:3S+1D}
+
+Eulérien 4S+2D
+**************
+
+Nous allons nous inspirer du modèle de You pour notre diffractomètre
+(fig.~\ref{cap:4S+2D}) ici présenté tous les angles mis à zéro.  Les
+rayons-X arrivent suivant le vecteur $\vec{x}$ (le repère est
+différent de celui de You).
+
+.. figure:: ../../figures/4S+2D.png
+   :align: center
+   :width: 8cm
+
+   Dénomination des angles du diffractomètre 4S+2D Eulérien.\label{cap:4S+2D}
+
+
+Le principe des calcules de You est d'exprimer dans le repère du
+laboratoire le vecteur diffusion :math:`\vec{Q}` de deux façons
+différentes. Une première en utilisant les angles du goniomètre 4S
+puis une à partir des angles du détecteur 2D et de la connaissance des
+coordonnées du vecteur incident.  En égalant les deux expressions, il
+obtient un système d'équation à 6 inconnus mais seulement 3
+équations. Pour être à même de résoudre le système il faut fixer des
+contraintes supplémentaire. C'est ce que l'on appel les modes de
+fonctionnement du diffractomètre. Il est commode de définir d'autres
+angles que ceux du diffractomètre relativement à des vecteurs
+caractéristiques tel que le vecteur de diffusion :math:`\vec{Q}` ou un
+vecteur pointant dans une direction particulière du cristal
+:math:`\vec{n}`. Cette direction peut-être soit lié à la
+cristallographie du cristal soit à sa forme (une normale à une
+face). La figure~\ref{cap:Pseudo-Angles-li=0000E9s} représente les
+angles liés au vecteur de diffusion et à ce vecteur de référence. Tout
+d'abord :math:`\theta` (angle entre :math:`\vec{Q}` et le plan
+:math:`yz`) et qui correspond à l'angle de Bragg. :math:`\vartheta`
+qui est l'angle azimutal que fait la projection de :math:`\vec{Q}` sur
+le plan :math:`yz` et la direction :math:`+y`
+(fig~\ref{cap:Pseudo-Angles-li=0000E9s}a).  Il y a ensuite les angles
+:math:`\alpha` et :math:`\varphi` définits comme précédemment mais
+pour le vecteur de référence :math:`\vec{n}`
+(fig~\ref{cap:Pseudo-Angles-li=0000E9s}b).  Et finalement les angles
+$\tau$ (angle entre :math:`\vec{Q}` et :math:`\vec{n}`) et
+:math:`\psi` qui correspond à la rotation de :math:`\vec{n}` autour du
+vecteur de diffusion :math:`\vec{Q}`
+(fig~\ref{cap:Pseudo-Angles-li=0000E9s}c).  L'origine de cet angle
+$\psi$ est prise à zéro lorsque le vecteur :math:`\vec{n}` est dans le
+plan de diffraction (plan contenant :math:`\vec{Q}` et
+:math:`\vec{k_{i}}`) (fig~\ref{cap:Pseudo-Angles-li=0000E9s}d).
+
+.. figure:: ../../figures/4S+2D_reciprocal.png
+   :align: center
+   :width: 7 cm
+
+   Pseudo angles :math:`\theta` et :math:`\vartheta` liés à :math:`\vec{Q}`
+
+.. figure:: ../../figures/4S+2D_reciprocal2.png
+   :align: center
+   :width: 7cm
+
+   Pseudo angles :math:`\alpha` et :math:`\phi` liés à :math:`\vec{n}`
+
+.. figure:: ../../figures/4S+2D_reciprocal3.png
+   :align: center
+   :width: 7cm
+
+   Pseudo angles :math:`\tau` et :math:`\psi` liés à :math:`\vec{n}` relativement à :math:`\vec{Q}` et le plan de diffraction
+
+.. figure:: ../../figures/4S+2D_reciprocal4.png
+   :align: center
+   :width: 7cm
+
+   Pseudo Angles liés au vecteur de diffusion :math:`\vec{Q}` et à :math:`\vec{n}`
+
+Il est alors possible d'exprimer ces pseudos angles en fonction des
+angles physique du diffractomètre.
+
+
+Modes de fonctionnement
+#######################
+
+Equations fondamentales
+***********************
+
+Le problème que nous devons résoudre est de calculer pour une famille
+de plan :math:`(h,k,l)` donné, les angles de rotation du
+diffractomètre qui permettent de le mettre en condition de
+diffraction. Il faut donc exprimer les relations mathématiques qui
+lient les différents angles entre eux lorsque la condition de Bragg
+est vérifiée. L'équation fondamentale est la suivante:
+
+.. math::
+   :nowrap:
+
+   \begin{align*}
+	\left(\prod_{i}S_{i}\right)\cdot U\cdot B\cdot\vec{h} & =\left(\prod_{j}D_{j}-I\right)\cdot\vec{k_{i}}\\
+	R\cdot U\cdot B\cdot\vec{h} & =\vec{Q}
+   \end{align*}
+
+ou :math:`\vec{h}` est le vecteur :math:`(h,k,l)`, :math:`\vec{k_{i}}`
+est le vecteur incident, :math:`S_{i}` les matrices de rotations des
+mouvements liés à l'échantillon, :math:`D_{j}` les matrices de
+rotation des mouvements liés au détecteur, :math:`I` la matrice
+identité, :math:`U` la matrice d'orientation du cristal par rapport au
+repère de l'axe sur lequel ce dernier est monté et :math:`B` la
+matrice de passage d'un repère non orthonormé ( celui du crystal
+réciproque) à un repère orthonormé.
+
+
+Calcule de `B`
+==============
+
+Si l'on connaît les paramètres cristallins du cristal étudié, il est
+très simple de calculer :math:`B`:
+
+.. math::
+   B=
+   \begin{bmatrix}
+	a^{\star} & b^{\star}\cos\gamma^{\star} & c^{\star}\cos\beta^{\star}\\
+	0 & b^{\star}\sin\gamma^{\star} & -c^{\star}\sin\beta^{\star}\cos\alpha\\
+	0 & 0 & 1/c
+   \end{bmatrix}
+
+
+Calcule de `U`
+==============
+
+Il existe plusieurs façons de calculer :math:`U`. Busing et Levy en a
+proposé plusieurs. Nous allons présenter celle qui nécessite la mesure
+de seulement deux réflections ainsi que la connaissance des paramètres
+cristallins. Cette façon de calculer la matrice d'orientation $U$,
+peut être généralisée à n'importe quel diffractomètre pour peu que la
+description des axes de rotation permette d'obtenir la matrice de
+rotation de la machine :math:`R` et le vecteur de diffusion
+:math:`\vec{Q}`.
+
+Il est également possible de calculer :math:`U` sans la connaîssance
+des paramètres cristallins. il faut alors faire un affinement des
+paramètres. Cela revient à minimiser une fonction. Nous allons
+utiliser la méthode du simplex pour trouver ce minimum et donc ajuster
+l'ensemble des paramètres cristallins ainsi que la matrice
+d'orientation.
+
+Algorithme de Busing Levy
+=========================
+
+L'idée est de se placer dans le repère de l'axe sur lequel est monté
+l'échantillon. On mesure deux réflections
+:math:`(\vec{h}_{1},\vec{h}_{2})` ainsi que leurs angles
+associés. Cela nous permet de calculer $R$ et :math:`\vec{Q}` pour
+chacune de ces reflections. nous avons alors ce système:
+
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	U\cdot B\cdot\vec{h}_{1} & = & \tilde{R}_{1}\cdot\vec{Q}_{1}\\
+	U\cdot B\cdot\vec{h}_{2} & = & \tilde{R}_{2}\cdot\vec{Q}_{2}
+   \end{eqnarray*}
+
+De façon à calculer facilement :math:`U`, il est intéressant de
+définir deux trièdres orthonormé :math:`T_{\vec{h}}` et
+:math:`T_{\vec{Q}}` à partir des vecteurs
+:math:`(B\vec{h}_{1},B\vec{h}_{2})` et
+:math:`(\tilde{R}_{1}\vec{Q}_{1},\tilde{R}_{2}\vec{Q}_{2})`. On a
+alors très simplement:
+
+.. math::
+   U\cdot T_{\vec{h}}=T_{\vec{Q}}
+
+Et donc
+
+.. math::
+   U=T_{\vec{Q}}\cdot\tilde{T}_{\vec{h}}
+
+Affinement par la méthode du simplex
+====================================
+
+Dans ce cas nous ne connaissons pas la matrice :math:`B`, il faut donc
+mesurer plus que deux réflections pour ajuster les 9 paramètres. Six
+paramètres pour le crystal et trois pour la matrice d'orientation
+:math:`U`. Les trois paramètres qui permennt de representer :math:`U`
+sont en fait les angles d'euler. il faut donc être en mesure de passer
+d'une représentation eulérien à cette matrice :math::`U` et
+réciproquement.
+
+.. math::
+   U=X\cdot Y\cdot Z
+
+où :math:`X` est la matrice rotation suivant l'axe Ox et le premier
+angle d'Euler, :math:`Y` la matrice de rotation suivant l'axe Oy et le
+deuxième angle d'Euler et :math:`Z` la matrice du troisième angle
+d'Euler pour l'axe Oz.
+
+.. math::
+   :nowrap:
+
+   \begin{tabular}{ccc}
+	$X$ & $Y$ & $Z$\tabularnewline
+	$\begin{bmatrix}
+		1 & 0 & 0\\
+		0 & A & -B\\
+		0 & B & A
+	\end{bmatrix}$
+	&
+	$\begin{bmatrix}
+		C & 0 & D\\
+		0 & 1 & 0\\
+		-D & 0 & C
+	\end{bmatrix}$
+	&
+	$\begin{bmatrix}
+		E & -F & 0\\
+		F & E & 0\\
+		0 & 0 & 1
+	\end{bmatrix}$
+   \end{tabular}
+
+et donc:
+
+.. math::
+   U=
+   \begin{bmatrix}
+	CE & -CF & D\\
+	BDE+AF & -BDF+AE & -BC\\
+	-ADE+BF & ADF+BE & AC
+   \end{bmatrix}
+
+Il est donc facile de passer des angles d'Euler à la matrice
+d'orientation.
+
+Il faut maintenant faire la transformation inverse de la matrice
+:math:`U` vers les angles d'euler.
+
+
+Diffractomètre 4 Cercle (3S+1D) Eulerien
+****************************************
+
+Pour ce diffractomètres, les matrices de rotations des différents axes
+sont les suivantes:
+
+.. math::
+   :nowrap:
+
+   \begin{tabular}{cccc}
+	$\Omega$ & $\chi$ & $\Phi$ & $2\Theta$\tabularnewline
+	$\begin{bmatrix}
+		\cos\omega & 0 & -\sin\omega\\
+		0 & 1 & 0\\
+		\sin\omega & 0 & \cos\omega
+	\end{bmatrix}$
+	&
+	$\begin{bmatrix}
+		1 & 0 & 0\\
+		0 & \cos\chi & -\sin\chi\\
+		0 & \sin\chi & \cos\chi
+	\end{bmatrix}$
+	&
+	$\begin{bmatrix}
+		\cos\phi & 0 & -\sin\phi\\
+		0 & 1 & 0\\
+		\sin\phi & 0 & \cos\phi
+	\end{bmatrix}$
+	&
+	$\begin{bmatrix}
+		\cos2\theta & 0 & -\sin2\theta\\
+		0 & 1 & 0\\
+		\sin2\theta & 0 & \cos2\theta
+	\end{bmatrix}$
+   \end{tabular}
+
+On obtient alors la matrice de rotation de la machine
+
+.. math::
+   R=\Omega\chi\Phi
+
+soit
+
+.. math::
+   R=
+   \begin{bmatrix}
+	\cos\omega\cos\phi-\cos\chi\sin\omega\sin\phi & -\sin\chi\sin\omega & -\cos\omega\sin\phi-\cos\chi\sin\omega\cos\phi\\
+	-\sin\chi\sin\phi & \cos\chi & -\sin\chi\cos\phi\\
+	\sin\omega\cos\phi-\cos\chi\cos\omega\sin\phi & -\sin\chi\cos\omega & -\sin\omega\sin\phi-\cos\chi\cos\omega\cos\phi
+   \end{bmatrix}
+
+De la même façon on peut calculer le vecteur diffusion en fonction des
+angles du détecteur:
+
+.. math::
+   \vec{Q}=\left(2\Theta-I\right)\cdot\vec{k}_{i}
+
+où :math:`I` est la matrice identité. Finalement:
+
+.. math::
+   \vec{Q}=k_{i}\left(\begin{array}{c}
+   \cos2\theta-1\\
+   0\\
+   \sin2\theta
+   \end{array}\right)
+
+L'équation fondamentale nous permet d'écrire:
+
+.. math::
+   U\cdot B\cdot\vec{h}=\tilde{R}\cdot\vec{Q}
+
+Cette équation est de 4 inconnus pour seulement 3 équations. Il faut
+donc imposer des contraintes pour résoudre ce système et ainsi
+d'orienter le diffractomètre. Ces différentes contraintes définissent
+les modes de fonctionnement des diffractomètres. Dans la suite nous
+allons nous efforcer de trouver l'ensemble des solutions possibles
+pour les différents modes et non pas une seule solution. Ceci afin de
+laisser le choix suivant certaines stratégies à l'utilisateur
+d'utiliser telle ou telle solution plutôt qu'une autre.
+
+Mode Bisecteur
+==============
+
+Dans ce mode on choisit d'avoir:
+
+.. math::
+   \omega=\theta
+
+Le système s'écrit alors simplement:
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	h_{\phi} & = & 2k_{i}\sin\theta\cos\chi\sin\phi\\
+	k_{\phi} & = & 2k_{i}\sin\theta\sin\chi\\
+	l_{\phi} & = & 2k_{i}\sin\theta\cos\chi\cos\phi
+   \end{eqnarray*}
+
+On a:
+
+.. math::
+   h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}=4k_{i}\sin^{2}\theta
+
+où :math:`k_{i}=\frac{\tau}{\lambda}`. donc on peut écrire:
+
+.. math::
+   \left|\sin\theta\right|=\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}
+
+il faut donc enviseager les deux possibilité selon que :math:`\theta`
+est positif ou bien négatif.
+
+.. math::
+   \sin\theta<0
+
+On peut alors écrire:
+
+.. math::
+   \sin\chi=-\frac{k_{\phi}}{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}
+
+puis en utilisant le relation bien connue :math:`\cos^{2}+\sin^{2}=1`
+on a:
+
+.. math::
+   \cos^{2}\chi=\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}
+
+Il faut une fois de plus faire un choix selon que :math:`\cos\chi` est
+positif ou négatif.
+
+.. math::
+   \cos\chi<0
+
+.. math::
+   \cos\chi=-\sqrt{\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi+}^{2}l_{\phi}^{2}}}
+
+.. math::
+   \cos\chi>0
+
+.. math::
+   \cos\chi=\sqrt{\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi+}^{2}l_{\phi}^{2}}}
+
+.. math::
+   \sin\theta>0
+
+On peut alors écrire:
+
+.. math::
+   \sin\chi=\frac{k_{\phi}}{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}
+
+puis en utilisant le relation bien connue :math:`\cos^{2}+\sin^{2}=1` on a:
+
+.. math::
+   \cos^{2}\chi=\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}
+
+Il faut une fois de plus faire un choix selon que :math:`\cos\chi` est
+positif ou négatif.
+
+.. math::
+   \cos\chi<0
+
+.. math::
+   \cos\chi=-\sqrt{\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi+}^{2}l_{\phi}^{2}}}
+
+.. math::
+   \cos\chi>0
+
+.. math::
+   \cos\chi=\sqrt{\frac{h_{\phi}^{2}+l_{\phi}^{2}}{h_{\phi}^{2}+k_{\phi+}^{2}l_{\phi}^{2}}}
+
+La résolution du système donne alors 4 quadruplets de solutions:
+
+.. math::
+   :nowrap:
+
+   \begin{tabular}{c|c|c|c}
+	$\omega$ & $\chi$ & $\phi$ & $2\theta$\tabularnewline
+	\hline
+	$-\theta$ & $\arctan2(-k_{\phi},-\sqrt{h_{\phi}^{2}+l_{\phi}^{2}})$ & $\arctan2(h_{\phi},l_{\phi})$ & $2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+	$-\theta$ & $\arctan2(-k_{\phi},\sqrt{h_{\phi}^{2}+l_{\phi}^{2}})$ & $\arctan2(-h_{\phi},-l_{\phi})$ & $2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+	$\theta$ & $\arctan2(k_{\phi},-\sqrt{h_{\phi}^{2}+l_{\phi}^{2}})$ & $\arctan2(-h_{\phi},-l_{\phi})$ & $2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+	$\theta$ & $\arctan2(k_{\phi},\sqrt{h_{\phi}^{2}+l_{\phi}^{2}})$ & $\arctan2(h_{\phi},l_{\phi})$ & $2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+   \end{tabular}
+
+Mode Delta Theta
+================
+
+Ce mode consiste à décaler :math:`\omega` par rapport à :math:`\theta`
+d'une valeur constante :math:`C`:
+
+.. math::
+	\omega=\theta+C
+
+Le système s'écrit alors comme suit:
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	h_{\phi} & = & 2k_{i}\sin\theta\left(\cos C\cos\chi\sin\phi+\sin C\cos\phi\right)\\
+	k_{\phi} & = & 2k_{i}\sin\theta\cos C\sin\chi\\
+	l_{\phi} & = & 2k_{i}\sin\theta\left(\cos C\cos\chi\cos\phi-\sin C\sin\phi\right)
+   \end{eqnarray*}
+
+On a toujours:
+
+.. math::
+	h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}=4k_{i}\sin^{2}\theta
+
+La résolution donne 4 quadruplets de solutions:
+
+.. math::
+	:nowrap:
+
+	\begin{tabular}{ccc}
+		$\omega$ & $\chi$ & $\phi$\tabularnewline
+		\hline
+		$-\theta+C$ & $\arctan2(\frac{-k_{\phi}}{\cos C},-\sqrt{h_{\phi}^{2}-k_{\phi}^{2}\tan^{2}C+l_{\phi}^{2}})$ & $\arctan2(-h_{\phi}\cos C\cos\chi+l_{\phi}\sin C,-l_{\phi}\cos C\cos\chi-h_{\phi}\sin C)$\tabularnewline
+		$-\theta+C$ & $\arctan2(\frac{-k_{\phi}}{\cos C},\sqrt{h_{\phi}^{2}-k_{\phi}^{2}\tan^{2}C+l_{\phi}^{2}})$ & $\arctan2(-h_{\phi}\cos C\cos\chi+l_{\phi}\sin C,-l_{\phi}\cos C\cos\chi-h_{\phi}\sin C)$\tabularnewline
+		$\theta+C$ & $\arctan2(\frac{k_{\phi}}{\cos C},-\sqrt{h_{\phi}^{2}-k_{\phi}^{2}\tan^{2}C+l_{\phi}^{2}})$ & $\arctan2(h_{\phi}\cos C\cos\chi-l_{\phi}\sin C,l_{\phi}\cos C\cos\chi+h_{\phi}\sin C)$\tabularnewline
+		$\theta+C$ & $\arctan2(\frac{k_{\phi}}{\cos C},\sqrt{h_{\phi}^{2}-k_{\phi}^{2}\tan^{2}C+l_{\phi}^{2}})$ & $\arctan2(h_{\phi}\cos C\cos\chi-l_{\phi}\sin C,l_{\phi}\cos C\cos\chi+h_{\phi}\sin C)$\tabularnewline
+	\end{tabular}
+
+.. math::
+   :nowrap:
+
+   \begin{tabular}{c}
+	$2\theta$\tabularnewline
+	\hline
+	$2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+	$2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+	$2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+	$2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+   \end{tabular}
+
+où
+
+Mode omega constant
+===================
+
+Dans ce mode on choisit de garder :math:`\omega` toujours constant:
+
+.. math::
+	\omega=C
+
+Le système s'écrit alors comme suit:
+
+.. math::
+	:nowrap:
+
+	\begin{eqnarray*}
+		h_{\phi} & = & 2k_{i}\sin\theta\left(\cos(C-\theta)\cos\chi\sin\phi+\sin(C-\theta)\cos\phi\right)\\
+		k_{\phi} & = & 2k_{i}\sin\theta\cos(C-\theta)\sin\chi\\
+		l_{\phi} & = & 2k_{i}\sin\theta\left(\cos(C-\theta)\cos\chi\cos\phi-\sin(C-\theta)\sin\phi\right)
+	\end{eqnarray*}
+
+La résolution donne 4 quadruplets de solutions:
+
+.. math::
+	:nowrap:
+
+	\begin{tabular}{ccc}
+		$\omega$ & $\chi$ & $\phi$\tabularnewline
+		\hline
+		$-\theta+C$ & $\arctan2\left(-k_{\phi},-\sqrt{(h_{\phi}^{2}+l_{\phi}^{2})\cos^{2}(C-\theta)-k_{\phi}^{2}\sin^{2}(C-\theta)}\right)$ & $\arctan2(-h_{\phi}\cos C\cos\chi+l_{\phi}\sin C,-l_{\phi}\cos C\cos\chi-h_{\phi}\sin C)$\tabularnewline
+		$-\theta+C$ & $\arctan2\left(-k_{\phi},\sqrt{(h_{\phi}^{2}+l_{\phi}^{2})\cos^{2}(C-\theta)-k_{\phi}^{2}\sin^{2}(C-\theta)}\right)$ & $\arctan2(-h_{\phi}\cos C\cos\chi+l_{\phi}\sin C,-l_{\phi}\cos C\cos\chi-h_{\phi}\sin C)$\tabularnewline
+		$\theta+C$ & $\arctan2\left(k_{\phi},-\sqrt{(h_{\phi}^{2}+l_{\phi}^{2})\cos^{2}(C-\theta)-k_{\phi}^{2}\sin^{2}(C-\theta)}\right)$ & $\arctan2(h_{\phi}\cos C\cos\chi-l_{\phi}\sin C,l_{\phi}\cos C\cos\chi+h_{\phi}\sin C)$\tabularnewline
+		$\theta+C$ & $\arctan2\left(k_{\phi},\sqrt{(h_{\phi}^{2}+l_{\phi}^{2})\cos^{2}(C-\theta)-k_{\phi}^{2}\sin^{2}(C-\theta)}\right)$ & $\arctan2(h_{\phi}\cos C\cos\chi-l_{\phi}\sin C,l_{\phi}\cos C\cos\chi+h_{\phi}\sin C)$\tabularnewline
+	\end{tabular}
+
+.. math::
+	:nowrap:
+
+	\begin{tabular}{c}
+		$2\theta$\tabularnewline
+		\hline
+		$2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+		$2\arcsin-\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+		$2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+		$2\arcsin\frac{\sqrt{h_{\phi}^{2}+k_{\phi}^{2}+l_{\phi}^{2}}}{2k_{i}}$\tabularnewline
+	\end{tabular}
diff --git a/Documentation/sphinx/source/pseudo.rst b/Documentation/sphinx/source/pseudo.rst
new file mode 100644
index 0000000..bba91fb
--- /dev/null
+++ b/Documentation/sphinx/source/pseudo.rst
@@ -0,0 +1,117 @@
+.. _pseudo:
+
+PseudoAxes
+##########
+
+This section describe the calculations done by the library for the
+different kind of pseudo axes.
+
+Eulerians to Kappa angles
+*************************
+
+1st solution
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	\kappa_\omega & = & \omega - p + \frac{\pi}{2} \\
+	\kappa & = & 2 \arcsin\left(\frac{\sin\frac{\chi}{2}}{\sin\alpha}\right) \\
+	\kappa_\phi & = &  \phi - p - \frac{\pi}{2}
+   \end{eqnarray*}
+
+or 2nd one
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	\kappa_\omega & = & \omega - p - \frac{\pi}{2} \\
+	\kappa & = & -2 \arcsin\left(\frac{\sin\frac{\chi}{2}}{\sin\alpha}\right) \\
+	\kappa_\phi & = &  \phi - p + \frac{\pi}{2}
+   \end{eqnarray*}
+
+where
+
+.. math:: 
+   p = \arcsin\left(\frac{\tan\frac{\chi}{2}}{\tan\alpha}\right);
+
+and :math:`\alpha` is the angle of the kappa axis with the :math:`\vec{y}` axis.
+
+Kappa to Eulerians angles
+*************************
+
+1st solution
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	\omega & = & \kappa_\omega + p - \frac{\pi}{2} \\
+	\chi   & = & 2 \arcsin\left(\sin\frac{\kappa}{2} \sin\alpha\right) \\
+	\phi   & = & \kappa_\phi + p + \frac{\pi}{2}
+   \end{eqnarray*}
+
+or 2nd one
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+	\omega & = & \kappa_\omega + p + \frac{\pi}{2} \\
+	\chi   & = & -2 \arcsin\left(\sin\frac{\kappa}{2} \sin\alpha\right) \\
+	\phi   & = & \kappa_\phi + p - \frac{\pi}{2}
+   \end{eqnarray*}
+
+where
+
+.. math::
+   p = \arctan\left(\tan\frac{\kappa}{2} \cos\alpha\right)
+
+
+.. figure:: ../../figures/e2k_1.png
+   :align: center
+   :width: 8cm
+
+   :math:`\omega = 0`,  :math:`\chi = 0`, :math:`\phi = 0`, 1st solution
+
+.. figure:: ../../figures/e2k_2.png
+   :align: center
+   :width: 8cm
+
+   :math:`\omega = 0`, :math:`\chi = 0`, :math:`\phi = 0`, 2nd solution
+
+.. figure:: ../../figures/e2k_3.png
+   :align: center
+   :width: 8cm
+
+   :math:`\omega = 0`, :math:`\chi = 90`, :math:`\phi = 0`, 1st solution
+
+.. figure:: ../../figures/e2k_4.png
+   :align: center
+   :width: 8cm
+
+   :math:`\omega = 0`, :math:`\chi = 90`, :math:`\phi = 0`, 2nd solution
+
+Qper and Qpar
+*************
+
+.. figure:: ../../figures/qper_qpar.png
+   :align: center
+   :width: 12cm
+
+this pseudo axis engine compute the perpendicular
+(:math:`\left|\left|\vec{Q_\text{per}}\right|\right|`) and parallel
+(:math:`\left|\left|\vec{Q_\text{par}}\right|\right|`) contribution of
+:math:`\vec{Q}` relatively to the surface of the sample defined by the
+:math:`\vec{n}` vector.
+
+.. math::
+   :nowrap:
+
+   \begin{eqnarray*}
+   \vec{q} & = & \vec{k_\text{f}} - \vec{k_\text{i}} \\
+   \vec{q} & = & \vec{q_\text{per}} + \vec{q_\text{par}} \\
+   \vec{q_\text{per}} & = & \frac{\vec{q} \cdot \vec{n}}{\left|\left|\vec{n}\right|\right|} \frac{\vec{n}}{\left|\left|\vec{n}\right|\right|}
+   \end{eqnarray*}
+
diff --git a/Documentation/stamp-vti b/Documentation/stamp-vti
index a3942c3..8cdd969 100644
--- a/Documentation/stamp-vti
+++ b/Documentation/stamp-vti
@@ -1,4 +1,4 @@
- at set UPDATED 1 May 2010
- at set UPDATED-MONTH May 2010
- at set EDITION 4.0.3
- at set VERSION 4.0.3
+ at set UPDATED 14 May 2013
+ at set UPDATED-MONTH May 2013
+ at set EDITION 4.99.99.1610
+ at set VERSION 4.99.99.1610
diff --git a/Documentation/version.texi b/Documentation/version.texi
index a3942c3..8cdd969 100644
--- a/Documentation/version.texi
+++ b/Documentation/version.texi
@@ -1,4 +1,4 @@
- at set UPDATED 1 May 2010
- at set UPDATED-MONTH May 2010
- at set EDITION 4.0.3
- at set VERSION 4.0.3
+ at set UPDATED 14 May 2013
+ at set UPDATED-MONTH May 2013
+ at set EDITION 4.99.99.1610
+ at set VERSION 4.99.99.1610
diff --git a/INSTALL b/INSTALL
index 7d1c323..007e939 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
+Inc.
 
    Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -226,6 +226,11 @@ order to use an ANSI C compiler:
 
 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
 
+   HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved.  Use GNU `make'
+instead.
+
    On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
 parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
 a workaround.  If GNU CC is not installed, it is therefore recommended
@@ -304,9 +309,10 @@ causes the specified `gcc' to be used as the C compiler (unless it is
 overridden in the site shell script).
 
 Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug.  Until the bug is fixed you can use this workaround:
+an Autoconf limitation.  Until the limitation is lifted, you can use
+this workaround:
 
-     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+     CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
 
 `configure' Invocation
 ======================
@@ -362,4 +368,3 @@ operates.
 
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
-
diff --git a/Makefile.am b/Makefile.am
index d54b59e..c1b33f5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,21 +1,52 @@
 ## Process this file with automake to produce Makefile.in
 
 ACLOCAL_AMFLAGS = -I m4
-DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
+AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection
 
-SUBDIRS = hkl test Documentation
-
-if GHKL
+SUBDIRS = hkl
+if HKL3D
+SUBDIRS += hkl3d data
+endif
+if GUI
 SUBDIRS += gui
 endif
+SUBDIRS += tests Documentation
 
-EXTRA_DIST = hkl.pc.in
+EXTRA_DIST = hkl.pc.in hkl3d.pc.in
 
-include_HEADERS = hkl.h
+installed_mainheaderdir = $(includedir)/hkl- at VMAJ@
+dist_installed_mainheader_DATA = hkl.h
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = hkl.pc
 
+if HKL3D
+pkgconfig_DATA += hkl3d.pc
+endif
+
+## lcov part
+.PHONY: lcov genlcov lcov-clean
+# use recursive makes in order to ignore errors during check
+lcov:
+	-$(MAKE) $(AM_MAKEFLAGS) -k check
+	$(MAKE) $(AM_MAKEFLAGS) genlcov
+
+# we have to massage the lcov.info file slightly to hide the effect of libtool
+# placing the objects files in the .libs/ directory separate from the *.c
+# we also have to delete tests/.libs/*.gcda
+genlcov:
+	rm -f $(top_builddir)/test/hkl/.libs/*.gcda
+	$(LTP) --directory $(top_builddir) --capture --output-file hkl-lcov.info --test-name hkl-lcov --no-checksum --compat-libtool
+	LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory hkl-lcov --title "hkl Code Coverage" --legend --show-details hkl-lcov.info
+
+lcov-clean:
+	-$(LTP) --directory $(top_builddir) -z
+	-rm -rf hkl-lcov.info hkl-lcov
+	-find -name '*.gcda' -print | xargs rm
+	-find -name '*.gcno' -print | xargs rm
+
+distclean-local: lcov-clean
+
 ## Generate the Changelog file for the distribution.
 dist-hook:
 	@if test -d "$(srcdir)/.git"; \
@@ -29,4 +60,54 @@ dist-hook:
                      echo Failed to generate ChangeLog >&2 ); \
         else \
                 echo A git clone is required to generate a ChangeLog >&2; \
-        fi
\ No newline at end of file
+        fi
+
+## Update the ccan library
+
+CCAN_PUBLIC_MODULES=darray
+CCAN_PRIVATE_MODULES=array_size container_of autodata list
+CCAN_LOCAL_REPO=/tmp/ccan
+CCAN_LOCAL_EXTRACT=/tmp/ccan.tmp
+CCAN_URL=git://git.ozlabs.org/~ccan/ccan
+CCAN_CREATE_TREE=rm -rf $(CCAN_LOCAL_EXTRACT) && $(CCAN_LOCAL_REPO)/tools/create-ccan-tree -b automake $(CCAN_LOCAL_EXTRACT)
+CCAN_DEST=$(top_srcdir)/hkl/
+CCAN_TMP_DEST=/tmp/ccan.next
+ccan-update:
+	@if test -d $(CCAN_LOCAL_REPO); \
+	then \
+		cd $(CCAN_LOCAL_REPO) && git pull; \
+	else \
+		git clone $(CCAN_URL) $(CCAN_LOCAL_REPO); \
+	fi
+
+	@echo Extracting all the modules
+	@$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES) $(CCAN_PRIVATE_MODULES)
+
+	@rm -rf $(CCAN_TMP_DEST) && mkdir -p $(CCAN_TMP_DEST)
+	@rsync -av --exclude=Makefile.am $(CCAN_LOCAL_EXTRACT)/* $(CCAN_TMP_DEST)
+	@find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '*.[ch]' | xargs sed -i -e 's,ccan/,hkl/ccan/,'
+
+	@$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES)
+
+	@echo Generating the Makefile.am
+	@(\
+		echo "AM_CFLAGS=-I\$$(top_srcdir)"; echo;\
+		echo "noinst_LTLIBRARIES=libccan.la";\
+		echo "libccan_la_SOURCES = \\";\
+		(\
+			cd $(CCAN_TMP_DEST)/ccan && find . -maxdepth 2 -name '*.[ch]'\
+				| sed -e 's,^./,\t,;$$!s,$$, \\,'; echo;\
+		);\
+		echo "ccanincludedir=\$$(includedir)/hkl-@""VMAJ@/hkl/ccan";\
+		echo "nobase_ccaninclude_HEADERS= \\";\
+		(\
+			cd $(CCAN_LOCAL_EXTRACT)/ccan && find . -maxdepth 2 -name '*.[h]'\
+				| sed -e 's,^./,\t,;$$!s,$$, \\,';\
+		);\
+	) > $(CCAN_TMP_DEST)/ccan/Makefile.am
+
+	@echo purge the previous ccan directory
+	cd $(CCAN_DEST) && rm -rf licenses && find ccan -mindepth 1 -type d \! -name ".*" | xargs rm -rf
+	rsync -av $(CCAN_TMP_DEST)/* $(top_srcdir)/hkl
+
+
diff --git a/Makefile.in b/Makefile.in
index 8917fa6..debe52c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,8 +14,52 @@
 
 @SET_MAKE@
 
-
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,15 +78,24 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
- at GHKL_TRUE@am__append_1 = gui
+ at HKL3D_TRUE@am__append_1 = hkl3d data
+ at GUI_TRUE@am__append_2 = gui
+ at HKL3D_TRUE@am__append_3 = hkl3d.pc
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) \
 	$(srcdir)/config.h.in $(srcdir)/hkl.pc.in \
-	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
-	TODO config/config.guess config/config.sub config/depcomp \
-	config/install-sh config/ltmain.sh config/mdate-sh \
-	config/missing config/texinfo.tex
+	$(srcdir)/hkl3d.pc.in \
+	$(top_srcdir)/Documentation/sphinx/source/conf.py.in \
+	$(dist_installed_mainheader_DATA) COPYING TODO \
+	config/config.guess config/config.sub config/depcomp \
+	config/install-sh config/mdate-sh config/missing \
+	config/texinfo.tex config/ltmain.sh \
+	$(top_srcdir)/config/config.guess \
+	$(top_srcdir)/config/config.sub \
+	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
+	$(top_srcdir)/config/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -55,17 +107,36 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = hkl.pc
+CONFIG_CLEAN_FILES = hkl.pc hkl3d.pc \
+	Documentation/sphinx/source/conf.py
 CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 SOURCES =
 DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -87,25 +158,55 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkgconfigdir)" \
-	"$(DESTDIR)$(includedir)"
-DATA = $(pkgconfig_DATA)
-HEADERS = $(include_HEADERS)
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(installed_mainheaderdir)" \
+	"$(DESTDIR)$(pkgconfigdir)"
+DATA = $(dist_installed_mainheader_DATA) $(pkgconfig_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir dist dist-all distcheck
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	cscope distdir dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+	$(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = hkl test Documentation gui
+CSCOPE = cscope
+DIST_SUBDIRS = hkl hkl3d data gui tests Documentation
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -133,12 +234,17 @@ am__relativize = \
   reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
+ASY = @ASY@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -155,6 +261,7 @@ CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -163,13 +270,29 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
 GTKMM_CFLAGS = @GTKMM_CFLAGS@
 GTKMM_LIBS = @GTKMM_LIBS@
 HTML_DIR = @HTML_DIR@
@@ -178,6 +301,14 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
@@ -186,7 +317,10 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -209,12 +343,17 @@ RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHTOOL = @SHTOOL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -248,14 +387,15 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+release_info = @release_info@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -264,18 +404,28 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+version_info = @version_info@
 ACLOCAL_AMFLAGS = -I m4
-DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
-SUBDIRS = hkl test Documentation $(am__append_1)
-EXTRA_DIST = hkl.pc.in
-include_HEADERS = hkl.h
+AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection
+SUBDIRS = hkl $(am__append_1) $(am__append_2) tests Documentation
+EXTRA_DIST = hkl.pc.in hkl3d.pc.in
+installed_mainheaderdir = $(includedir)/hkl- at VMAJ@
+dist_installed_mainheader_DATA = hkl.h
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = hkl.pc
+pkgconfig_DATA = hkl.pc $(am__append_3)
+CCAN_PUBLIC_MODULES = darray
+CCAN_PRIVATE_MODULES = array_size container_of autodata list
+CCAN_LOCAL_REPO = /tmp/ccan
+CCAN_LOCAL_EXTRACT = /tmp/ccan.tmp
+CCAN_URL = git://git.ozlabs.org/~ccan/ccan
+CCAN_CREATE_TREE = rm -rf $(CCAN_LOCAL_EXTRACT) && $(CCAN_LOCAL_REPO)/tools/create-ccan-tree -b automake $(CCAN_LOCAL_EXTRACT)
+CCAN_DEST = $(top_srcdir)/hkl/
+CCAN_TMP_DEST = /tmp/ccan.next
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
@@ -311,10 +461,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then \
-	  rm -f stamp-h1; \
-	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
-	else :; fi
+	@if test ! -f $@; then rm -f stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
@@ -328,6 +476,10 @@ distclean-hdr:
 	-rm -f config.h stamp-h1
 hkl.pc: $(top_builddir)/config.status $(srcdir)/hkl.pc.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
+hkl3d.pc: $(top_builddir)/config.status $(srcdir)/hkl3d.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+Documentation/sphinx/source/conf.py: $(top_builddir)/config.status $(top_srcdir)/Documentation/sphinx/source/conf.py.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -337,64 +489,69 @@ clean-libtool:
 
 distclean-libtool:
 	-rm -f libtool config.lt
-install-pkgconfigDATA: $(pkgconfig_DATA)
+install-dist_installed_mainheaderDATA: $(dist_installed_mainheader_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
-	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	@list='$(dist_installed_mainheader_DATA)'; test -n "$(installed_mainheaderdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(installed_mainheaderdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(installed_mainheaderdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
 	done | $(am__base_list) | \
 	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(installed_mainheaderdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(installed_mainheaderdir)" || exit $$?; \
 	done
 
-uninstall-pkgconfigDATA:
+uninstall-dist_installed_mainheaderDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	@list='$(dist_installed_mainheader_DATA)'; test -n "$(installed_mainheaderdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
-install-includeHEADERS: $(include_HEADERS)
+	dir='$(DESTDIR)$(installed_mainheaderdir)'; $(am__uninstall_files_from_dir)
+install-pkgconfigDATA: $(pkgconfig_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
 	done | $(am__base_list) | \
 	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
 	done
 
-uninstall-includeHEADERS:
+uninstall-pkgconfigDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(includedir)" && rm -f $$files
+	dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
 	dot_seen=no; \
 	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
 	  echo "Making $$target in $$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
@@ -409,57 +566,12 @@ $(RECURSIVE_TARGETS):
 	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
 	fi; test -z "$$fail"
 
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
@@ -475,12 +587,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
-	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -492,15 +599,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -509,9 +612,31 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+	-rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
@@ -547,13 +672,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -585,36 +707,36 @@ distdir: $(DISTFILES)
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__post_remove_distdir)
 
-dist-lzma: distdir
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-	$(am__remove_distdir)
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__post_remove_distdir)
 
 dist-xz: distdir
-	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
-	$(am__remove_distdir)
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-shar: distdir
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-zip: distdir
 	-rm -f $(distdir).zip
 	zip -rq $(distdir).zip $(distdir)
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
-dist dist-all: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -625,8 +747,8 @@ distcheck: dist
 	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-	*.tar.lzma*) \
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
 	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
@@ -636,9 +758,9 @@ distcheck: dist
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
-	mkdir $(distdir)/_build
-	mkdir $(distdir)/_inst
+	chmod -R a-w $(distdir)
+	chmod u+w $(distdir)
+	mkdir $(distdir)/_build $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
@@ -646,6 +768,7 @@ distcheck: dist
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -669,13 +792,21 @@ distcheck: dist
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
 	  && cd "$$am__cwd" \
 	  || exit 1
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@$(am__cd) '$(distuninstallcheck_dir)' \
-	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
 	          echo "  (check DESTDIR support)"; \
@@ -693,10 +824,10 @@ distcleancheck: distclean
 	       exit 1; } >&2
 check-am: all-am
 check: check-recursive
-all-am: Makefile $(DATA) $(HEADERS) config.h
+all-am: Makefile $(DATA) config.h
 installdirs: installdirs-recursive
 installdirs-am:
-	for dir in "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
+	for dir in "$(DESTDIR)$(installed_mainheaderdir)" "$(DESTDIR)$(pkgconfigdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
@@ -709,10 +840,15 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -732,7 +868,7 @@ distclean: distclean-recursive
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -f Makefile
 distclean-am: clean-am distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags
+	distclean-libtool distclean-local distclean-tags
 
 dvi: dvi-recursive
 
@@ -746,7 +882,8 @@ info: info-recursive
 
 info-am:
 
-install-data-am: install-includeHEADERS install-pkgconfigDATA
+install-data-am: install-dist_installed_mainheaderDATA \
+	install-pkgconfigDATA
 
 install-dvi: install-dvi-recursive
 
@@ -792,29 +929,53 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-includeHEADERS uninstall-pkgconfigDATA
+uninstall-am: uninstall-dist_installed_mainheaderDATA \
+	uninstall-pkgconfigDATA
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-	ctags-recursive install-am install-strip tags-recursive
+.MAKE: $(am__recursive_targets) all install-am install-strip
 
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-generic \
-	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
-	dist-zip distcheck distclean distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags distcleancheck distdir \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+	am--refresh check check-am clean clean-cscope clean-generic \
+	clean-libtool cscope cscopelist-am ctags ctags-am dist \
+	dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
+	dist-tarZ dist-xz dist-zip distcheck distclean \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-local distclean-tags distcleancheck distdir \
 	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
+	install install-am install-data install-data-am \
+	install-dist_installed_mainheaderDATA install-dvi \
 	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-includeHEADERS install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-pkgconfigDATA install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am \
-	uninstall-includeHEADERS uninstall-pkgconfigDATA
-
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-pkgconfigDATA install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-dist_installed_mainheaderDATA \
+	uninstall-pkgconfigDATA
+
+
+.PHONY: lcov genlcov lcov-clean
+# use recursive makes in order to ignore errors during check
+lcov:
+	-$(MAKE) $(AM_MAKEFLAGS) -k check
+	$(MAKE) $(AM_MAKEFLAGS) genlcov
+
+# we have to massage the lcov.info file slightly to hide the effect of libtool
+# placing the objects files in the .libs/ directory separate from the *.c
+# we also have to delete tests/.libs/*.gcda
+genlcov:
+	rm -f $(top_builddir)/test/hkl/.libs/*.gcda
+	$(LTP) --directory $(top_builddir) --capture --output-file hkl-lcov.info --test-name hkl-lcov --no-checksum --compat-libtool
+	LANG=C $(LTP_GENHTML) --prefix $(top_builddir) --output-directory hkl-lcov --title "hkl Code Coverage" --legend --show-details hkl-lcov.info
+
+lcov-clean:
+	-$(LTP) --directory $(top_builddir) -z
+	-rm -rf hkl-lcov.info hkl-lcov
+	-find -name '*.gcda' -print | xargs rm
+	-find -name '*.gcno' -print | xargs rm
+
+distclean-local: lcov-clean
 
 dist-hook:
 	@if test -d "$(srcdir)/.git"; \
@@ -829,6 +990,43 @@ dist-hook:
         else \
                 echo A git clone is required to generate a ChangeLog >&2; \
         fi
+ccan-update:
+	@if test -d $(CCAN_LOCAL_REPO); \
+	then \
+		cd $(CCAN_LOCAL_REPO) && git pull; \
+	else \
+		git clone $(CCAN_URL) $(CCAN_LOCAL_REPO); \
+	fi
+
+	@echo Extracting all the modules
+	@$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES) $(CCAN_PRIVATE_MODULES)
+
+	@rm -rf $(CCAN_TMP_DEST) && mkdir -p $(CCAN_TMP_DEST)
+	@rsync -av --exclude=Makefile.am $(CCAN_LOCAL_EXTRACT)/* $(CCAN_TMP_DEST)
+	@find $(CCAN_TMP_DEST)/ccan -maxdepth 2 -name '*.[ch]' | xargs sed -i -e 's,ccan/,hkl/ccan/,'
+
+	@$(CCAN_CREATE_TREE) $(CCAN_PUBLIC_MODULES)
+
+	@echo Generating the Makefile.am
+	@(\
+		echo "AM_CFLAGS=-I\$$(top_srcdir)"; echo;\
+		echo "noinst_LTLIBRARIES=libccan.la";\
+		echo "libccan_la_SOURCES = \\";\
+		(\
+			cd $(CCAN_TMP_DEST)/ccan && find . -maxdepth 2 -name '*.[ch]'\
+				| sed -e 's,^./,\t,;$$!s,$$, \\,'; echo;\
+		);\
+		echo "ccanincludedir=\$$(includedir)/hkl-@""VMAJ@/hkl/ccan";\
+		echo "nobase_ccaninclude_HEADERS= \\";\
+		(\
+			cd $(CCAN_LOCAL_EXTRACT)/ccan && find . -maxdepth 2 -name '*.[h]'\
+				| sed -e 's,^./,\t,;$$!s,$$, \\,';\
+		);\
+	) > $(CCAN_TMP_DEST)/ccan/Makefile.am
+
+	@echo purge the previous ccan directory
+	cd $(CCAN_DEST) && rm -rf licenses && find ccan -mindepth 1 -type d \! -name ".*" | xargs rm -rf
+	rsync -av $(CCAN_TMP_DEST)/* $(top_srcdir)/hkl
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/NEWS b/NEWS
index befd729..0e77ccd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,36 @@
+5.0.0	UNRELEASED
+	* general:
+	  - use the c-tap-hardness library for the test suite.
+	  - add the hkl3d library (anti-collision)
+	  - add a 3D view to ghkl
+	    - add the diffabs (SOLEIL) 3D model.
+	  - add a --disable-hkl3d flag to avoid hkl3d library compilation.
+	  - replace the --enable-ghkl with a --disable-gui
+	  - use the gobject-instrospection to provide bindings.
+	    - python binding (tested)
+	    - all other languages (not tested)
+	* new diffractometers
+	  - E4CH (eulerian 4 circles horizontal) geometry.
+	  - MARS beamline (SOLEIL) eulerian 4 circles vertical geometry.
+
+4.0.4	UNRELEASED
+	* add the SOLEIL SIXS MED2+2 diffractometer
+	  - engine: hkl
+	    - mode: reflectivity.
+	  - engine: qper_qpar
+	* add the SOLEIL MARS diffractometer
+	  - engine: qper_qpar
+	* add the PETRA3 P09 EH2 diffractometer
+	  - engine: qper_qpar
+	* modified E6C
+	  - engine: qper_qpar
+	  - add modes : hkl psi_constant_horizontal, constant_mu_horizontal
+	* K6C
+	  - engine hkl:
+	    - add the constant_incidence mode
+	  - engine: qper_qpar
+	* add the sphinx documentation
+
 4.0.3	06-06-2010
 	* remove the usage.c file to avoid a GPL2-GPL3+ incompatibility
 	* update the documentation
diff --git a/README b/README
index af4d54a..153cc0d 100644
--- a/README
+++ b/README
@@ -1,6 +1,10 @@
 To build you need
 
 -PREREQUIRED
-	gsl >= 1.12    (required)			http://www.gnu.org/software/gsl/
-	gtkmm >= 2.18  (required)			http://www.gtkmm.org
-	gtk-doc >= 1.9 (optional)			http://www.gtk.org/gtk-doc/
\ No newline at end of file
+	gsl >= 1.12    (lib -- required)		http://www.gnu.org/software/gsl/
+	gtkmm >= 2.18  (gui -- optional)		http://www.gtkmm.org
+	libg3d	       (gui -- optional)		http://automagically.de/g3dviewer/
+	libyaml	       (gui -- optional)		http://pyyaml.org/wiki/LibYAML
+	gtk-doc >= 1.9 (doc -- optional)		http://www.gtk.org/gtk-doc/
+	povray	       (doc -- optional)		http://www.povray.org/
+	asymptote      (doc -- optional)		http://asymptote.sourceforge.net/
\ No newline at end of file
diff --git a/TODO b/TODO
index 2bea70c..cee2cdc 100644
--- a/TODO
+++ b/TODO
@@ -1,26 +1,45 @@
 Roadmap
 -------
 
-4.0.0
-	* HklPseudoAxisEngine "q" -> "qper" and "qpar"
-	* HklAxis degenerated.
-		an axis is degenerated if its position have no effect
-		on the HklPseudoAxis calculus.
-	* HklAxis method to use min/max to check for the validity
-	* HklGeometryList different method to help select a solution.
-		this select solution can depend on the geometry
-		for example the kappa axis must be in one side of the plane.
-	* add a fit on the Hklaxis offsets.
-	* API to put a detector and a sample on the Geometry.
-	* HklSample add the cell volum computation.
-	* HklPseudoAxisEngine "zone"
-	* HklPseudoAxisEngine "custom"
+* 5.0.0 UNRELEASE
+** TODO [hkl] HklEngine "q" -> "qper" and "qpar"
+** TODO [hkl] HklAxis degenerated.
+   an axis is degenerated if its position have no effect
+   on the HklPseudoAxis calculus. Add a degenerated member to the axis.
+   that way it would be possible to check a posteriori for this degenerescencence.
+** TODO [hkl] HklAxis method to use min/max to check for the validity
+** TODO [hkl] HklGeometryList different method to help select a solution.
+   this select solution can depend on the geometry
+   for example the kappa axis must be in one side of the plane.
+** TODO [hkl] add a fit on the Hklaxis offsets.
+** TODO [hkl] API to put a detector and a sample on the Geometry.
+** TODO [hkl] HklSample add the cell volum computation.
+** TODO [hkl] HklEngine "zone"
+** TODO [hkl] HklEngine "custom"
 		for now this pseudoaxis let you select the axis you
 		want to use for the computation.
-	* create a macro to help compare two real the right way
-	  	 fabs(a-b) < epsilon * max(1, abs(a), abs(b))
-	* ghkl change the color of fitparameter cells if they differ from the current
+** TODO [hkl] create a macro to help compare two real the right way
+   fabs(a-b) < epsilon * max(1, abs(a), abs(b))
+** TODO [hkl] add an hkl_sample_set_lattice_unit()
+** TODO [hkl] use the liboil to speed calculation (in HklVector, HklMatrix and HklQuaternion)
+** TODO [hkl] SOLEIL SIXS
+*** DONE find the right solutions. 				      :zaxis:
+    The cosinus and sinus properties are not enough to find the solution expected by the users.
+    The idea is to use the Ewalds construction to generate a valid solution from the first one
+    obtain numerically. The basic idea is to rotate the hkl vector around the last axis of the
+    sample holder until it intersect again the Ewalds sphere. Then we just need to fit the
+    detector position. This way the solution can be entirely generic (not geometry specific).
+    Nevertheless it is necessary to propose this only for the hkl pseudo axes. I will add this
+    special feature in the Mode. So it will be possible to add thoses special cases easily.
+*** TODO Add the DEP diffractometer geometry
+    This diffractometer is a Newport one based on the kappa 6 circles ones.
+    But instead of a kappa head, they use an Hexapod head.
+    This head can be put horizontally or vertically.
+** TODO [hkl] generalisation of the z-axis hkl solver
+   first we need the degenerated member of the Axis. thaht way it could be possible
+   to find the last non degenerated axis for the detector fit.
+** TODO [hkl] investigate the prigo geometry.
+** TODO [ghkl] change the color of fitparameter cells if they differ from the current
 	  sample values
-	* add an hkl_sample_set_lattice_unit()
-	* use the liboil to speed calculation (in HklVector, HklMatrix and HklQuaternion)
-	* add a .spec file for rpm generation
+** TODO [hkl3d] add a method to find the 3D models in the right directories.
+** TODO [packaging] add a .spec file for rpm generation.
diff --git a/aclocal.m4 b/aclocal.m4
index e70cf65..079d0d4 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.13.3 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -11,13 +11,229 @@
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
-[m4_warning([this file was generated for autoconf 2.65.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# Configure paths for GLIB
+# Owen Taylor     1997-2001
+
+dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
+dnl gthread, or gio is specified in MODULES, pass to pkg-config
+dnl
+AC_DEFUN([AM_PATH_GLIB_2_0],
+[dnl 
+dnl Get the cflags and libraries from pkg-config
+dnl
+AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
+		    , enable_glibtest=yes)
+
+  pkg_config_args=glib-2.0
+  for module in . $4
+  do
+      case "$module" in
+         gmodule) 
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export) 
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject) 
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread) 
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+         gio*) 
+             pkg_config_args="$pkg_config_args $module-2.0"
+         ;;
+      esac
+  done
+
+  PKG_PROG_PKG_CONFIG([0.16])
+
+  no_glib=""
+
+  if test "x$PKG_CONFIG" = x ; then
+    no_glib=yes
+    PKG_CONFIG=no
+  fi
+
+  min_glib_version=ifelse([$1], ,2.0.0,$1)
+  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
+
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+	  enable_glibtest=no
+    fi
+
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+	  :
+    else
+	  no_glib=yes
+    fi
+  fi
+
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+    GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+dnl
+dnl Now check if the installed GLIB is sufficiently new. (Also sanity
+dnl checks the results of pkg-config to some extent)
+dnl
+      rm -f conf.glibtest
+      AC_TRY_RUN([
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int 
+main ()
+{
+  unsigned int major, minor, micro;
+  char *tmp_version;
+
+  fclose (fopen ("conf.glibtest", "w"));
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
+
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    } 
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          AC_TRY_LINK([
+#include <glib.h>
+#include <stdio.h>
+],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+     GLIB_COMPILE_RESOURCES=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GLIB_CFLAGS)
+  AC_SUBST(GLIB_LIBS)
+  AC_SUBST(GLIB_GENMARSHAL)
+  AC_SUBST(GOBJECT_QUERY)
+  AC_SUBST(GLIB_MKENUMS)
+  AC_SUBST(GLIB_COMPILE_RESOURCES)
+  rm -f conf.glibtest
+])
 
 # Configure path for the GNU Scientific Library
 # Christopher R. Gabriel <cgabriel at linux.it>, April 2000
@@ -182,6 +398,103 @@ int main (void)
 
 AU_ALIAS([AM_PATH_GSL], [AX_PATH_GSL])
 
+dnl -*- mode: autoconf -*-
+dnl Copyright 2009 Johan Dahlin
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+# serial 1
+
+m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+[
+    AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+    dnl enable/disable introspection
+    m4_if([$2], [require],
+    [dnl
+        enable_introspection=yes
+    ],[dnl
+        AC_ARG_ENABLE(introspection,
+                  AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
+                                 [Enable introspection for this build]),, 
+                                 [enable_introspection=auto])
+    ])dnl
+
+    AC_MSG_CHECKING([for gobject-introspection])
+
+    dnl presence/version checking
+    AS_CASE([$enable_introspection],
+    [no], [dnl
+        found_introspection="no (disabled, use --enable-introspection to enable)"
+    ],dnl
+    [yes],[dnl
+        PKG_CHECK_EXISTS([gobject-introspection-1.0],,
+                         AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
+        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
+                         found_introspection=yes,
+                         AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
+    ],dnl
+    [auto],[dnl
+        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
+	dnl Canonicalize enable_introspection
+	enable_introspection=$found_introspection
+    ],dnl
+    [dnl	
+        AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
+    ])dnl
+
+    AC_MSG_RESULT([$found_introspection])
+
+    INTROSPECTION_SCANNER=
+    INTROSPECTION_COMPILER=
+    INTROSPECTION_GENERATE=
+    INTROSPECTION_GIRDIR=
+    INTROSPECTION_TYPELIBDIR=
+    if test "x$found_introspection" = "xyes"; then
+       INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+       INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+       INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+       INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+       INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+       INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+       INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+       INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+    fi
+    AC_SUBST(INTROSPECTION_SCANNER)
+    AC_SUBST(INTROSPECTION_COMPILER)
+    AC_SUBST(INTROSPECTION_GENERATE)
+    AC_SUBST(INTROSPECTION_GIRDIR)
+    AC_SUBST(INTROSPECTION_TYPELIBDIR)
+    AC_SUBST(INTROSPECTION_CFLAGS)
+    AC_SUBST(INTROSPECTION_LIBS)
+    AC_SUBST(INTROSPECTION_MAKEFILE)
+
+    AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
+])
+
+
+dnl Usage:
+dnl   GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
+
+AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
+[
+  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
+])
+
+dnl Usage:
+dnl   GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
+
+
+AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
+[
+  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
+])
+
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 # 
@@ -210,7 +523,8 @@ AU_ALIAS([AM_PATH_GSL], [AX_PATH_GSL])
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -256,7 +570,8 @@ m4_define([_PKG_CONFIG],
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
 		     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -304,9 +619,9 @@ if test $pkg_failed = yes; then
    	AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
@@ -319,7 +634,7 @@ $$1_PKG_ERRORS
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-_PKG_TEXT])dnl
+_PKG_TEXT])[]dnl
         ])
 elif test $pkg_failed = untried; then
      	AC_MSG_RESULT([no])
@@ -330,7 +645,7 @@ path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
         ])
 else
 	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
@@ -340,7 +655,7 @@ else
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -352,10 +667,10 @@ fi[]dnl
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.13'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.1], [],
+m4_if([$1], [1.13.3], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -371,22 +686,22 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.13.3])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
@@ -405,7 +720,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 #
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 # are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
 # start a VPATH build or use an absolute $srcdir.
 #
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -431,14 +746,12 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_COND_IF                                            -*- Autoconf -*-
 
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # _AM_COND_IF
 # _AM_COND_ELSE
 # _AM_COND_ENDIF
@@ -448,18 +761,17 @@ m4_define([_AM_COND_IF])
 m4_define([_AM_COND_ELSE])
 m4_define([_AM_COND_ENDIF])
 
-
 # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
 # ---------------------------------------
-# If the shell condition matching COND is true, execute IF-TRUE,
-# otherwise execute IF-FALSE.  Allow automake to learn about conditional
-# instantiating macros (the AC_CONFIG_FOOS).
+# If the shell condition COND is true, execute IF-TRUE, otherwise execute
+# IF-FALSE.  Allow automake to learn about conditional instantiating macros
+# (the AC_CONFIG_FOOS).
 AC_DEFUN([AM_COND_IF],
 [m4_ifndef([_AM_COND_VALUE_$1],
 	   [m4_fatal([$0: no such condition "$1"])])dnl
 _AM_COND_IF([$1])dnl
-if _AM_COND_VALUE_$1; then
-  m4_default([$2], [:])
+if test -z "$$1_TRUE"; then :
+  m4_n([$2])[]dnl
 m4_ifval([$3],
 [_AM_COND_ELSE([$1])dnl
 else
@@ -471,22 +783,19 @@ fi[]dnl
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
-
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -505,16 +814,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 10
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
@@ -524,7 +831,7 @@ fi])])
 # _AM_DEPENDENCIES(NAME)
 # ----------------------
 # See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
 # We try a few techniques and use that to set a single cache variable.
 #
 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -537,12 +844,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
@@ -550,8 +858,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -590,16 +899,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -608,16 +917,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -665,7 +974,7 @@ AM_CONDITIONAL([am__fastdep$1], [
 # AM_SET_DEPDIR
 # -------------
 # Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
 AC_DEFUN([AM_SET_DEPDIR],
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -675,34 +984,39 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 [{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -715,7 +1029,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -727,21 +1041,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`AS_DIRNAME(["$file"])`
@@ -759,7 +1071,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
 # This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
+# is enabled.  FIXME.  This creates each '.P' file that we will
 # need in order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
@@ -769,15 +1081,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 16
-
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
@@ -793,7 +1102,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -822,31 +1131,40 @@ AC_SUBST([CYGPATH_W])
 # Define the identity of the package.
 dnl Distinguish between old-style and new-style calls.
 m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+             [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  AC_SUBST([PACKAGE], [$1])dnl
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
@@ -857,28 +1175,32 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
 			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-		  [_AM_DEPENDENCIES(CC)],
-		  [define([AC_PROG_CC],
-			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+		  [_AM_DEPENDENCIES([CC])],
+		  [m4_define([AC_PROG_CC],
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-		  [_AM_DEPENDENCIES(CXX)],
-		  [define([AC_PROG_CXX],
-			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+		  [_AM_DEPENDENCIES([CXX])],
+		  [m4_define([AC_PROG_CXX],
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-		  [_AM_DEPENDENCIES(OBJC)],
-		  [define([AC_PROG_OBJC],
-			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+		  [_AM_DEPENDENCIES([OBJC])],
+		  [m4_define([AC_PROG_OBJC],
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+		  [_AM_DEPENDENCIES([OBJCXX])],
+		  [m4_define([AC_PROG_OBJCXX],
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
 ])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
 dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
@@ -906,7 +1228,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -925,16 +1247,14 @@ if test x"${install_sh}" != xset; then
     install_sh="\${SHELL} $am_aux_dir/install-sh"
   esac
 fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
 
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # Check whether the underlying file-system supports filenames
 # with a leading dot.  For instance MS-DOS doesn't.
 AC_DEFUN([AM_SET_LEADING_DOT],
@@ -950,14 +1270,12 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
-
 # AM_MAKE_INCLUDE()
 # -----------------
 # Check to see how make treats includes.
@@ -975,7 +1293,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -1002,15 +1320,12 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
-
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
 AC_DEFUN([AM_MISSING_PROG],
@@ -1018,11 +1333,10 @@ AC_DEFUN([AM_MISSING_PROG],
 $1=${$1-"${am_missing_run}$2"}
 AC_SUBST($1)])
 
-
 # AM_MISSING_HAS_RUN
 # ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
@@ -1035,63 +1349,35 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
-
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
 AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -1102,24 +1388,35 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
-
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -1130,32 +1427,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$[2]" = conftest.file
    )
 then
@@ -1165,9 +1470,85 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1175,34 +1556,32 @@ AC_MSG_RESULT(yes)])
 
 # AM_PROG_INSTALL_STRIP
 # ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -1210,24 +1589,22 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
-
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
 #
 # Substitute a variable $(am__tar) that is a command
 # writing to stdout a FORMAT-tarball containing the directory
@@ -1237,75 +1614,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
+#
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
 
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
   rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
diff --git a/config.h.in b/config.h.in
index d2d7ddd..fce111e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,5 +1,17 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Architecture is PowerPC */
+#undef ARCH_PPC
+
+/* Architecture is x86 */
+#undef ARCH_X86
+
+/* Architecture is x86-64 */
+#undef ARCH_X86_64
+
 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
    systems. This function is required for `alloca.c' support on those systems.
    */
@@ -15,6 +27,30 @@
    */
 #undef HAVE_ALLOCA_H
 
+/* "do we have typeof" */
+#undef HAVE_ATTRIBUTE_COLD
+
+/* "do we have typeof" */
+#undef HAVE_ATTRIBUTE_CONST
+
+/* "do we have typeof" */
+#undef HAVE_ATTRIBUTE_NORETURN
+
+/* "do we have typeof" */
+#undef HAVE_ATTRIBUTE_PRINTF
+
+/* "do we have typeof" */
+#undef HAVE_ATTRIBUTE_UNUSED
+
+/* "do we have typeof" */
+#undef HAVE_ATTRIBUTE_USED
+
+/* "do we have typeof" */
+#undef HAVE_BUILTIN_CONSTANT_P
+
+/* "do we have typeof" */
+#undef HAVE_BUILTIN_TYPES_COMPATIBLE_P
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #undef HAVE_DLFCN_H
 
@@ -27,16 +63,28 @@
 /* Define to 1 if you have the `floor' function. */
 #undef HAVE_FLOOR
 
+/* Whether you have gcov */
+#undef HAVE_GCOV
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
    to 0 otherwise. */
 #undef HAVE_MALLOC
 
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
 /* Define to 1 if you have the `memmove' function. */
 #undef HAVE_MEMMOVE
 
@@ -46,22 +94,40 @@
 /* Define to 1 if you have the `memset' function. */
 #undef HAVE_MEMSET
 
+/* Define to 1 if you have the `pow' function. */
+#undef HAVE_POW
+
 /* Define to 1 if your system has a GNU libc compatible `realloc' function,
    and to 0 otherwise. */
 #undef HAVE_REALLOC
 
+/* "do we support section or not" */
+#undef HAVE_SECTION_START_STOP
+
+/* Define to 1 if you have the `select' function. */
+#undef HAVE_SELECT
+
 /* Define to 1 if you have the `sqrt' function. */
 #undef HAVE_SQRT
 
+/* "do we have typeof" */
+#undef HAVE_STATEMENT_EXPR
+
 /* Define to 1 if stdbool.h conforms to C99. */
 #undef HAVE_STDBOOL_H
 
+/* Define to 1 if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
 /* Define to 1 if you have the `strdup' function. */
 #undef HAVE_STRDUP
 
@@ -71,6 +137,9 @@
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
@@ -80,12 +149,21 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* "do we have typeof" */
+#undef HAVE_TYPEOF
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
 /* Define to 1 if you have the `vprintf' function. */
 #undef HAVE_VPRINTF
 
+/* "do we have typeof" */
+#undef HAVE_WARN_UNUSED_RESULT
+
+/* Define to 1 if you have the <yaml.h> header file. */
+#undef HAVE_YAML_H
+
 /* Define to 1 if the system has the type `_Bool'. */
 #undef HAVE__BOOL
 
@@ -114,6 +192,15 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* Platform is Apple */
+#undef PLATFORM_APPLE
+
+/* Platform is Linux */
+#undef PLATFORM_LINUX
+
+/* Platform is Win32 */
+#undef PLATFORM_WIN32
+
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
    automatically deduced at runtime.
@@ -131,6 +218,45 @@
 /* Version number of package */
 #undef VERSION
 
+/* Major version */
+#undef VMAJ
+
+/* Micro version */
+#undef VMIC
+
+/* Minor version */
+#undef VMIN
+
+/* Revison */
+#undef VREV
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+#  undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT32_T
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT64_T
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#undef _UINT8_T
+
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
@@ -140,6 +266,22 @@
 #undef inline
 #endif
 
+/* Define to the type of a signed integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int16_t
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int32_t
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+#undef int64_t
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+   a type exists and the standard includes do not define it. */
+#undef int8_t
+
 /* Define to rpl_malloc if the replacement function should be used. */
 #undef malloc
 
@@ -148,3 +290,19 @@
 
 /* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint16_t
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint32_t
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint64_t
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+   such a type exists and the standard includes do not define it. */
+#undef uint8_t
diff --git a/config/config.guess b/config/config.guess
index c2246a4..120cc0d 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -1,14 +1,12 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-#   Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2009-12-30'
+timestamp='2013-05-16'
 
 # This file 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
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful, but
@@ -17,26 +15,22 @@ timestamp='2009-12-30'
 # 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches at gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 #
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
+# Originally written by Per Bothner.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
+
 
 me=`echo "$0" | sed -e 's,.*/,,'`
 
@@ -56,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
-Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -140,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 	# switched to ELF, *-*-netbsd* would select the old
 	# object file format.  This provides both forward
@@ -181,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		fi
 		;;
 	    *)
-	        os=netbsd
+		os=netbsd
 		;;
 	esac
 	# The OS release
@@ -202,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 	echo "${machine}-${os}${release}"
 	exit ;;
+    *:Bitrig:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
 	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -224,7 +241,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 		;;
 	*5.*)
-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 		;;
 	esac
 	# According to Compaq, /usr/sbin/psrinfo has been available on
@@ -270,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit ;;
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	exitcode=$?
+	trap '' 0
+	exit $exitcode ;;
     Alpha\ *:Windows_NT*:*)
 	# How do we know it's Interix rather than the generic POSIX subsystem?
 	# Should we change UNAME_MACHINE based on the output of uname instead
@@ -296,12 +316,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo s390-ibm-zvmoe
 	exit ;;
     *:OS400:*:*)
-        echo powerpc-ibm-os400
+	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 	echo arm-acorn-riscix${UNAME_RELEASE}
 	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
 	exit ;;
     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -395,23 +415,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
 	echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
+	exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint${UNAME_RELEASE}
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-milan-mint${UNAME_RELEASE}
+	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-hades-mint${UNAME_RELEASE}
+	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
+	echo m68k-unknown-mint${UNAME_RELEASE}
+	exit ;;
     m68k:machten:*:*)
 	echo m68k-apple-machten${UNAME_RELEASE}
 	exit ;;
@@ -481,8 +501,8 @@ EOF
 	echo m88k-motorola-sysv3
 	exit ;;
     AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	# DG/UX returns AViiON for all architectures
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 	then
 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@@ -495,7 +515,7 @@ EOF
 	else
 	    echo i586-dg-dgux${UNAME_RELEASE}
 	fi
- 	exit ;;
+	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 	echo m88k-dolphin-sysv3
 	exit ;;
@@ -552,7 +572,7 @@ EOF
 		echo rs6000-ibm-aix3.2
 	fi
 	exit ;;
-    *:AIX:*:[456])
+    *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
@@ -595,52 +615,52 @@ EOF
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+		    case "${sc_cpu_version}" in
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+		      532)                      # CPU_PA_RISC2_0
+			case "${sc_kernel_bits}" in
+			  32) HP_ARCH="hppa2.0n" ;;
+			  64) HP_ARCH="hppa2.0w" ;;
 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
+			esac ;;
+		    esac
 		fi
 		if [ "${HP_ARCH}" = "" ]; then
 		    eval $set_cc_for_build
-		    sed 's/^              //' << EOF >$dummy.c
+		    sed 's/^		//' << EOF >$dummy.c
 
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
+		#define _HPUX_SOURCE
+		#include <stdlib.h>
+		#include <unistd.h>
 
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
+		int main ()
+		{
+		#if defined(_SC_KERNEL_BITS)
+		    long bits = sysconf(_SC_KERNEL_BITS);
+		#endif
+		    long cpu  = sysconf (_SC_CPU_VERSION);
 
-                  switch (cpu)
-              	{
-              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-              	case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-              	    switch (bits)
-              		{
-              		case 64: puts ("hppa2.0w"); break;
-              		case 32: puts ("hppa2.0n"); break;
-              		default: puts ("hppa2.0"); break;
-              		} break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-              	    puts ("hppa2.0"); break;
-              #endif
-              	default: puts ("hppa1.0"); break;
-              	}
-                  exit (0);
-              }
+		    switch (cpu)
+			{
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+			case CPU_PA_RISC2_0:
+		#if defined(_SC_KERNEL_BITS)
+			    switch (bits)
+				{
+				case 64: puts ("hppa2.0w"); break;
+				case 32: puts ("hppa2.0n"); break;
+				default: puts ("hppa2.0"); break;
+				} break;
+		#else  /* !defined(_SC_KERNEL_BITS) */
+			    puts ("hppa2.0"); break;
+		#endif
+			default: puts ("hppa1.0"); break;
+			}
+		    exit (0);
+		}
 EOF
 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
@@ -731,22 +751,22 @@ EOF
 	exit ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 	echo c1-convex-bsd
-        exit ;;
+	exit ;;
     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 	if getsysinfo -f scalar_acc
 	then echo c32-convex-bsd
 	else echo c2-convex-bsd
 	fi
-        exit ;;
+	exit ;;
     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 	echo c34-convex-bsd
-        exit ;;
+	exit ;;
     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 	echo c38-convex-bsd
-        exit ;;
+	exit ;;
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 	echo c4-convex-bsd
-        exit ;;
+	exit ;;
     CRAY*Y-MP:*:*:*)
 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
@@ -770,14 +790,14 @@ EOF
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
     5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@@ -789,30 +809,35 @@ EOF
 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 	exit ;;
     *:FreeBSD:*:*)
-	case ${UNAME_MACHINE} in
-	    pc98)
-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	case ${UNAME_PROCESSOR} in
 	    amd64)
 		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	    *)
-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 	esac
 	exit ;;
     i*:CYGWIN*:*)
 	echo ${UNAME_MACHINE}-pc-cygwin
 	exit ;;
+    *:MINGW64*:*)
+	echo ${UNAME_MACHINE}-pc-mingw64
+	exit ;;
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit ;;
     i*:windows32*:*)
-    	# uname -m includes "-pc" on this system.
-    	echo ${UNAME_MACHINE}-mingw32
+	# uname -m includes "-pc" on this system.
+	echo ${UNAME_MACHINE}-mingw32
 	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
     *:Interix*:*)
-    	case ${UNAME_MACHINE} in
+	case ${UNAME_MACHINE} in
 	    x86)
 		echo i586-pc-interix${UNAME_RELEASE}
 		exit ;;
@@ -849,15 +874,22 @@ EOF
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
@@ -867,52 +899,56 @@ EOF
 	  EV6)   UNAME_MACHINE=alphaev6 ;;
 	  EV67)  UNAME_MACHINE=alphaev67 ;;
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
+	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	else
-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+		| grep -q __ARM_PCS_VFP
+	    then
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+	    else
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo cris-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo crisv32-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-    	echo frv-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    hexagon:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -931,51 +967,57 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
+    or1k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-unknown-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    tile*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -984,11 +1026,11 @@ EOF
 	echo i386-sequent-sysv4
 	exit ;;
     i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
+	# Unixware is an offshoot of SVR4, but it has its own version
+	# number series starting with 2...
+	# I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
+	# Use sysv4.2uw... so that sysv4* matches it.
 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 	exit ;;
     i*86:OS/2:*:*)
@@ -1020,7 +1062,7 @@ EOF
 	fi
 	exit ;;
     i*86:*:5:[678]*)
-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
 	case `/bin/uname -X | grep "^Machine"` in
 	    *486*)	     UNAME_MACHINE=i486 ;;
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
@@ -1048,13 +1090,13 @@ EOF
 	exit ;;
     pc:*:*:*)
 	# Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i586.
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
+	# the processor, so we play safe by assuming i586.
 	# Note: whatever this is, it MUST be the same as what config.sub
 	# prints for the "djgpp" host, or else GDB configury will decide that
 	# this is a cross-build.
 	echo i586-pc-msdosdjgpp
-        exit ;;
+	exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
 	exit ;;
@@ -1089,8 +1131,8 @@ EOF
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4; exit; } ;;
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
 	OS_REL='.3'
 	test -r /etc/.relid \
@@ -1133,10 +1175,10 @@ EOF
 		echo ns32k-sni-sysv
 	fi
 	exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel at ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+			# says <Richard.M.Bartel at ccMail.Census.GOV>
+	echo i586-unisys-sysv4
+	exit ;;
     *:UNIX_System_V:4*:FTX*)
 	# From Gerald Hewes <hewes at openmarket.com>.
 	# How about differentiating between stratus architectures? -djm
@@ -1162,11 +1204,11 @@ EOF
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-	        echo mips-nec-sysv${UNAME_RELEASE}
+		echo mips-nec-sysv${UNAME_RELEASE}
 	else
-	        echo mips-unknown-sysv${UNAME_RELEASE}
+		echo mips-unknown-sysv${UNAME_RELEASE}
 	fi
-        exit ;;
+	exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
 	echo powerpc-be-beos
 	exit ;;
@@ -1179,6 +1221,9 @@ EOF
     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
 	echo i586-pc-haiku
 	exit ;;
+    x86_64:Haiku:*:*)
+	echo x86_64-unknown-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit ;;
@@ -1205,19 +1250,21 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
+	    fi
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1231,7 +1278,10 @@ EOF
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
+    NEO-?:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
 	echo nse-tandem-nsk${UNAME_RELEASE}
 	exit ;;
     NSR-?:NONSTOP_KERNEL:*:*)
@@ -1276,13 +1326,13 @@ EOF
 	echo pdp10-unknown-its
 	exit ;;
     SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
+	echo mips-sei-seiux${UNAME_RELEASE}
 	exit ;;
     *:DragonFly:*:*)
 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 	exit ;;
     *:*VMS:*:*)
-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
 	case "${UNAME_MACHINE}" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
@@ -1300,11 +1350,11 @@ EOF
     i*86:AROS:*:*)
 	echo ${UNAME_MACHINE}-pc-aros
 	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-unknown-esx
+	exit ;;
 esac
 
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
 eval $set_cc_for_build
 cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
@@ -1322,11 +1372,11 @@ main ()
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-          "4"
+	"4"
 #else
-	  ""
+	""
 #endif
-         ); exit (0);
+	); exit (0);
 #endif
 #endif
 
diff --git a/config/config.sub b/config/config.sub
index c2d1257..8b612ab 100755
--- a/config/config.sub
+++ b/config/config.sub
@@ -1,38 +1,31 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-#   Free Software Foundation, Inc.
+#   Copyright 1992-2013 Free Software Foundation, Inc.
 
-timestamp='2010-01-22'
+timestamp='2013-04-24'
 
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file 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
+# This file 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 3 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.
+# 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., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program.  This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches at gnu.org.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -75,9 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
-Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -124,13 +115,18 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
   *)
     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
     if [ $basic_machine != $1 ]
@@ -153,12 +149,12 @@ case $os in
 	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze)
+	-apple | -axis | -knuth | -cray | -microblaze*)
 		os=
 		basic_machine=$1
 		;;
-        -bluegene*)
-	        os=-cnk
+	-bluegene*)
+		os=-cnk
 		;;
 	-sim | -cisco | -oki | -wec | -winbond)
 		os=
@@ -174,10 +170,10 @@ case $os in
 		os=-chorusos
 		basic_machine=$1
 		;;
- 	-chorusrdb)
- 		os=-chorusrdb
+	-chorusrdb)
+		os=-chorusrdb
 		basic_machine=$1
- 		;;
+		;;
 	-hiux*)
 		os=-hiuxwe2
 		;;
@@ -222,6 +218,12 @@ case $os in
 	-isc*)
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 		;;
+	-lynx*178)
+		os=-lynxos178
+		;;
+	-lynx*5)
+		os=-lynxos5
+		;;
 	-lynx*)
 		os=-lynxos
 		;;
@@ -246,20 +248,27 @@ case $basic_machine in
 	# Some are omitted here because they have special meanings below.
 	1750a | 580 \
 	| a29k \
+	| aarch64 | aarch64_be \
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| arc | arceb \
+	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+	| avr | avr32 \
+	| be32 | be64 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
+	| epiphany \
 	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
+	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
@@ -277,34 +286,45 @@ case $basic_machine in
 	| mipsisa64r2 | mipsisa64r2el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
-	| nios | nios2 \
+	| nds32 | nds32le | nds32be \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| or32 \
+	| open8 \
+	| or1k | or32 \
 	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
-	| rx \
+	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu | strongarm \
-	| tahoe | thumb | tic4x | tic80 | tron \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
-	| v850 | v850e \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
 	| we32k \
-	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-		# Motorola 68HC11/12.
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -314,6 +334,21 @@ case $basic_machine in
 		basic_machine=mt-unknown
 		;;
 
+	strongarm | thumb | xscale)
+		basic_machine=arm-unknown
+		;;
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	xscaleeb)
+		basic_machine=armeb-unknown
+		;;
+
+	xscaleel)
+		basic_machine=armel-unknown
+		;;
+
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
@@ -328,25 +363,30 @@ case $basic_machine in
 	# Recognize the basic CPU types with company name.
 	580-* \
 	| a29k-* \
+	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
+	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+	| microblaze-* | microblazeel-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
@@ -364,30 +404,34 @@ case $basic_machine in
 	| mipsisa64r2-* | mipsisa64r2el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
-	| nios-* | nios2-* \
+	| nds32-* | nds32le-* | nds32be-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
-	| romp-* | rs6000-* | rx-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile-* | tilegx-* \
+	| tile*-* \
 	| tron-* \
 	| ubicom32-* \
-	| v850-* | v850e-* | vax-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
 	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
 	| ymp-* \
 	| z8k-* | z80-*)
@@ -412,7 +456,7 @@ case $basic_machine in
 		basic_machine=a29k-amd
 		os=-udi
 		;;
-    	abacus)
+	abacus)
 		basic_machine=abacus-unknown
 		;;
 	adobe68k)
@@ -482,11 +526,20 @@ case $basic_machine in
 		basic_machine=powerpc-ibm
 		os=-cnk
 		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	c90)
 		basic_machine=c90-cray
 		os=-unicos
 		;;
-        cegcc)
+	cegcc)
 		basic_machine=arm-unknown
 		os=-cegcc
 		;;
@@ -518,7 +571,7 @@ case $basic_machine in
 		basic_machine=craynv-cray
 		os=-unicosmp
 		;;
-	cr16)
+	cr16 | cr16-*)
 		basic_machine=cr16-unknown
 		os=-elf
 		;;
@@ -676,7 +729,6 @@ case $basic_machine in
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 	i*86v32)
 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 		os=-sysv32
@@ -734,9 +786,13 @@ case $basic_machine in
 		basic_machine=ns32k-utek
 		os=-sysv
 		;;
-        microblaze)
+	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
+	mingw64)
+		basic_machine=x86_64-pc
+		os=-mingw64
+		;;
 	mingw32)
 		basic_machine=i386-pc
 		os=-mingw32
@@ -773,10 +829,18 @@ case $basic_machine in
 	ms1-*)
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
+	msys)
+		basic_machine=i386-pc
+		os=-msys
+		;;
 	mvs)
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -841,6 +905,12 @@ case $basic_machine in
 	np1)
 		basic_machine=np1-gould
 		;;
+	neo-tandem)
+		basic_machine=neo-tandem
+		;;
+	nse-tandem)
+		basic_machine=nse-tandem
+		;;
 	nsr-tandem)
 		basic_machine=nsr-tandem
 		;;
@@ -923,9 +993,10 @@ case $basic_machine in
 		;;
 	power)	basic_machine=power-ibm
 		;;
-	ppc)	basic_machine=powerpc-unknown
+	ppc | ppcbe)	basic_machine=powerpc-unknown
 		;;
-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+	ppc-* | ppcbe-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
 	ppcle | powerpclittle | ppc-le | powerpc-little)
 		basic_machine=powerpcle-unknown
@@ -950,7 +1021,11 @@ case $basic_machine in
 		basic_machine=i586-unknown
 		os=-pw32
 		;;
-	rdos)
+	rdos | rdos64)
+		basic_machine=x86_64-pc
+		os=-rdos
+		;;
+	rdos32)
 		basic_machine=i386-pc
 		os=-rdos
 		;;
@@ -1019,6 +1094,9 @@ case $basic_machine in
 		basic_machine=i860-stratus
 		os=-sysv4
 		;;
+	strongarm-* | thumb-*)
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
 	sun2)
 		basic_machine=m68000-sun
 		;;
@@ -1075,25 +1153,8 @@ case $basic_machine in
 		basic_machine=t90-cray
 		os=-unicos
 		;;
-	tic54x | c54x*)
-		basic_machine=tic54x-unknown
-		os=-coff
-		;;
-	tic55x | c55x*)
-		basic_machine=tic55x-unknown
-		os=-coff
-		;;
-	tic6x | c6x*)
-		basic_machine=tic6x-unknown
-		os=-coff
-		;;
-        # This must be matched before tile*.
-        tilegx*)
-		basic_machine=tilegx-unknown
-		os=-linux-gnu
-		;;
 	tile*)
-		basic_machine=tile-unknown
+		basic_machine=$basic_machine-unknown
 		os=-linux-gnu
 		;;
 	tx39)
@@ -1163,6 +1224,9 @@ case $basic_machine in
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
 	ymp)
 		basic_machine=ymp-cray
 		os=-unicos
@@ -1260,11 +1324,11 @@ esac
 if [ x"$os" != x"" ]
 then
 case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
+	# First match some system type aliases
+	# that might get confused with valid system types.
 	# -solaris* is a basic system type, with this one exception.
-        -auroraux)
-	        os=-auroraux
+	-auroraux)
+		os=-auroraux
 		;;
 	-solaris1 | -solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
@@ -1288,20 +1352,21 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
+	      | -bitrig* | -openbsd* | -solidbsd* \
 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1348,7 +1413,7 @@ case $os in
 	-opened*)
 		os=-openedition
 		;;
-        -os400*)
+	-os400*)
 		os=-os400
 		;;
 	-wince*)
@@ -1397,7 +1462,7 @@ case $os in
 	-sinix*)
 		os=-sysv4
 		;;
-        -tpf*)
+	-tpf*)
 		os=-tpf
 		;;
 	-triton*)
@@ -1433,17 +1498,14 @@ case $os in
 	-aros*)
 		os=-aros
 		;;
-	-kaos*)
-		os=-kaos
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
 	-dicos*)
 		os=-dicos
 		;;
-        -nacl*)
-	        ;;
+	-nacl*)
+		;;
 	-none)
 		;;
 	*)
@@ -1466,10 +1528,10 @@ else
 # system, and we'll never get to this point.
 
 case $basic_machine in
-        score-*)
+	score-*)
 		os=-elf
 		;;
-        spu-*)
+	spu-*)
 		os=-elf
 		;;
 	*-acorn)
@@ -1481,8 +1543,20 @@ case $basic_machine in
 	arm*-semi)
 		os=-aout
 		;;
-        c4x-* | tic4x-*)
-        	os=-coff
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	hexagon-*)
+		os=-elf
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
@@ -1502,14 +1576,11 @@ case $basic_machine in
 		;;
 	m68000-sun)
 		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
 		;;
 	m68*-cisco)
 		os=-aout
 		;;
-        mep-*)
+	mep-*)
 		os=-elf
 		;;
 	mips*-cisco)
@@ -1518,6 +1589,9 @@ case $basic_machine in
 	mips*-*)
 		os=-elf
 		;;
+	or1k-*)
+		os=-elf
+		;;
 	or32-*)
 		os=-coff
 		;;
@@ -1536,7 +1610,7 @@ case $basic_machine in
 	*-ibm)
 		os=-aix
 		;;
-    	*-knuth)
+	*-knuth)
 		os=-mmixware
 		;;
 	*-wec)
diff --git a/config/depcomp b/config/depcomp
index df8eea7..4ebd5b3 100755
--- a/config/depcomp
+++ b/config/depcomp
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2013-05-30.07; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 
 # 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
@@ -28,9 +27,9 @@ scriptversion=2009-04-28.21; # UTC
 
 case $1 in
   '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
   -h | --h*)
     cat <<\EOF
 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
@@ -40,11 +39,11 @@ as side-effects.
 
 Environment variables:
   depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
   DEPDIR      directory where to store dependencies.
   depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
+  tmpdepfile  Temporary file to use when outputting dependencies.
   libtool     Whether libtool is used (yes/no).
 
 Report bugs to <bug-automake at gnu.org>.
@@ -57,6 +56,66 @@ EOF
     ;;
 esac
 
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
   echo "depcomp: Variables source, object and depmode must be set" 1>&2
   exit 1
@@ -69,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
 
 rm -f "$tmpdepfile"
 
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
 # Some modes work just like other modes, but use different flags.  We
 # parameterize here, but still list the modes in the big case below,
 # to make depend.m4 easier to write.  Note that we *cannot* use a case
@@ -80,18 +142,32 @@ if test "$depmode" = hp; then
 fi
 
 if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
 fi
 
 cygpath_u="cygpath -u -f -"
 if test "$depmode" = msvcmsys; then
-   # This is just like msvisualcpp but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
-   depmode=msvisualcpp
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
 fi
 
 case "$depmode" in
@@ -114,8 +190,7 @@ gcc3)
   done
   "$@"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -123,13 +198,17 @@ gcc3)
   ;;
 
 gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
 ## There are various ways to get dependency output from gcc.  Here's
 ## why we pick this rather obscure method:
 ## - Don't want to use -MD because we'd like the dependencies to end
 ##   up in a subdir.  Having to rename by hand is ugly.
 ##   (We might end up doing this anyway to support other compilers.)
 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
 ## - Using -M directly means running the compiler twice (even worse
 ##   than renaming).
   if test -z "$gccflag"; then
@@ -137,31 +216,31 @@ gcc)
   fi
   "$@" -Wp,"$gccflag$tmpdepfile"
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
   sed -e 's/^[^:]*: / /' \
       -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
+## This next piece of magic avoids the "deleted header file" problem.
 ## The problem is that when a header file which appears in a .P file
 ## is deleted, the dependency causes make to die (because there is
 ## typically no way to rebuild the header).  We avoid this by adding
 ## dummy dependencies for each header file.  Too bad gcc doesn't do
 ## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
+## Some versions of gcc put a space before the ':'.  On the theory
 ## that the space means something, we add a space to the output as
-## well.
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
 ## Some versions of the HPUX 10.20 sed can't process this invocation
 ## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -179,8 +258,7 @@ sgi)
     "$@" -MDupdate "$tmpdepfile"
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -188,43 +266,41 @@ sgi)
 
   if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
     echo "$object : \\" > "$depfile"
-
     # Clip off the initial element (the dependent).  Don't try to be
     # clever and replace this with sed code, as IRIX sed won't handle
     # lines with more than a fixed number of characters (4096 in
     # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
+    # the IRIX cc adds comments like '#:fec' to the end of the
     # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
     echo >> "$depfile"
-
     # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
   else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile"
   ;;
 
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 aix)
   # The C for AIX Compiler uses -M and outputs the dependencies
   # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.u
     tmpdepfile2=$base.u
@@ -237,9 +313,7 @@ aix)
     "$@" -M
   fi
   stat=$?
-
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
@@ -248,44 +322,100 @@ aix)
   do
     test -f "$tmpdepfile" && break
   done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
   fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
-icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # ICC 7.0 will fill foo.d with something like
-  #    foo.o: sub/foo.c
-  #    foo.o: sub/foo.h
-  # which is wrong.  We want:
-  #    sub/foo.o: sub/foo.c
-  #    sub/foo.o: sub/foo.h
-  #    sub/foo.c:
-  #    sub/foo.h:
-  # ICC 7.1 will output
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
   #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
+  # and will wrap long lines using '\' :
   #    foo.o: sub/foo.c ... \
   #     sub/foo.h ... \
   #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
 
-  "$@" -MD -MF "$tmpdepfile"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
     rm -f "$tmpdepfile"
     exit $stat
   fi
@@ -297,8 +427,8 @@ icc)
   sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
   # Some versions of the HPUX 10.20 sed can't process this invocation
   # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -309,9 +439,8 @@ hp2)
   # 'foo.d', which lands next to the object file, wherever that
   # happens to be.
   # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  set_dir_from  "$object"
+  set_base_from "$object"
   if test "$libtool" = yes; then
     tmpdepfile1=$dir$base.d
     tmpdepfile2=$dir.libs/$base.d
@@ -322,8 +451,7 @@ hp2)
     "$@" +Maked
   fi
   stat=$?
-  if test $stat -eq 0; then :
-  else
+  if test $stat -ne 0; then
      rm -f "$tmpdepfile1" "$tmpdepfile2"
      exit $stat
   fi
@@ -333,77 +461,107 @@ hp2)
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
     sed -ne '2,${
-	       s/^ *//
-	       s/ \\*$//
-	       s/$/:/
-	       p
-	     }' "$tmpdepfile" >> "$depfile"
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
   else
-    echo "#dummy" > "$depfile"
+    make_dummy_depfile
   fi
   rm -f "$tmpdepfile" "$tmpdepfile2"
   ;;
 
 tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
-
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
-
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
 
 #nosideeffect)
   # This comment above is used by automake to tell side-effect
@@ -422,7 +580,7 @@ dashmstdout)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -442,18 +600,18 @@ dashmstdout)
   done
 
   test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
+  # Require at least two characters before searching for ':'
   # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
   rm -f "$depfile"
   cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
@@ -503,12 +661,15 @@ makedepend)
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
   rm -f "$tmpdepfile" "$tmpdepfile".bak
   ;;
 
@@ -525,7 +686,7 @@ cpp)
     shift
   fi
 
-  # Remove `-o $object'.
+  # Remove '-o $object'.
   IFS=" "
   for arg
   do
@@ -544,10 +705,10 @@ cpp)
     esac
   done
 
-  "$@" -E |
-    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
-    sed '$ s: \\$::' > "$tmpdepfile"
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
   cat < "$tmpdepfile" >> "$depfile"
@@ -579,23 +740,23 @@ msvisualcpp)
       shift
       ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-	set fnord "$@"
-	shift
-	shift
-	;;
+        set fnord "$@"
+        shift
+        shift
+        ;;
     *)
-	set fnord "$@" "$arg"
-	shift
-	shift
-	;;
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
     esac
   done
   "$@" -E 2>/dev/null |
   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
   sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
diff --git a/config/install-sh b/config/install-sh
index 6781b98..377bb86 100755
--- a/config/install-sh
+++ b/config/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2011-11-20.07; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,7 +35,7 @@ scriptversion=2009-04-28.21; # UTC
 # FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
@@ -156,6 +156,10 @@ while test $# -ne 0; do
     -s) stripcmd=$stripprog;;
 
     -t) dst_arg=$2
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
 	shift;;
 
     -T) no_target_directory=true;;
@@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     fi
     shift # arg
     dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
   done
 fi
 
@@ -194,13 +202,17 @@ if test $# -eq 0; then
     echo "$0: no input file specified." >&2
     exit 1
   fi
-  # It's OK to call `install-sh -d' without argument.
+  # It's OK to call 'install-sh -d' without argument.
   # This can happen when creating conditional directories.
   exit 0
 fi
 
 if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
 
   # Set umask so as not to create temps with too-generous modes.
   # However, 'strip' requires both read and write access to temps.
@@ -228,9 +240,9 @@ fi
 
 for src
 do
-  # Protect names starting with `-'.
+  # Protect names problematic for 'test' and other utilities.
   case $src in
-    -*) src=./$src;;
+    -* | [=\(\)!]) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
@@ -252,12 +264,7 @@ do
       echo "$0: no destination specified." >&2
       exit 1
     fi
-
     dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
@@ -347,7 +354,7 @@ do
 	      if test -z "$dir_arg" || {
 		   # Check for POSIX incompatibilities with -m.
 		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
+		   # other-writable bit of parent directory when it shouldn't.
 		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
 		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
 		   case $ls_ld_tmpdir in
@@ -385,7 +392,7 @@ do
 
       case $dstdir in
 	/*) prefix='/';;
-	-*) prefix='./';;
+	[-=\(\)!]*) prefix='./';;
 	*)  prefix='';;
       esac
 
@@ -403,7 +410,7 @@ do
 
       for d
       do
-	test -z "$d" && continue
+	test X"$d" = X && continue
 
 	prefix=$prefix$d
 	if test -d "$prefix"; then
diff --git a/config/ltmain.sh b/config/ltmain.sh
old mode 100755
new mode 100644
index d88da2c..499e473
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -1,9 +1,9 @@
-# Generated from ltmain.m4sh.
 
-# ltmain.sh (GNU libtool) 2.2.6b
+# libtool (GNU libtool) 2.4.2
 # Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -32,50 +32,57 @@
 #
 # Provide generalized library-building support services.
 #
-#     --config             show all configuration variables
-#     --debug              enable verbose shell tracing
-# -n, --dry-run            display commands without modifying any files
-#     --features           display basic configuration information and exit
-#     --mode=MODE          use operation mode MODE
-#     --preserve-dup-deps  don't remove duplicate dependency libraries
-#     --quiet, --silent    don't print informational messages
-#     --tag=TAG            use configuration variables from tag TAG
-# -v, --verbose            print informational messages (default)
-#     --version            print version information
-# -h, --help               print short or long help message
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --quiet, --silent    don't print informational messages
+#       --no-quiet, --no-silent
+#                            print informational messages (default)
+#       --no-warn            don't display warning messages
+#       --tag=TAG            use configuration variables from tag TAG
+#   -v, --verbose            print more informational messages than default
+#       --no-verbose         don't print the extra informational messages
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
 #
 # MODE must be one of the following:
 #
-#       clean              remove files from the build directory
-#       compile            compile a source file into a libtool object
-#       execute            automatically set library path, then run a program
-#       finish             complete the installation of libtool libraries
-#       install            install libraries or executables
-#       link               create a library or an executable
-#       uninstall          remove libraries from an installed directory
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
 #
-# MODE-ARGS vary depending on the MODE.
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
 #
 # When reporting a bug, please describe a test case to reproduce it and
 # include the following information:
 #
-#       host-triplet:	$host
-#       shell:		$SHELL
-#       compiler:		$LTCC
-#       compiler flags:		$LTCFLAGS
-#       linker:		$LD (gnu? $with_gnu_ld)
-#       $progname:		(GNU libtool) 2.2.6b Debian-2.2.6b-2
-#       automake:		$automake_version
-#       autoconf:		$autoconf_version
+#         host-triplet:	$host
+#         shell:		$SHELL
+#         compiler:		$LTCC
+#         compiler flags:		$LTCFLAGS
+#         linker:		$LD (gnu? $with_gnu_ld)
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.2
+#         automake:	$automake_version
+#         autoconf:	$autoconf_version
 #
 # Report bugs to <bug-libtool at gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
-PROGRAM=ltmain.sh
+PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.2.6b Debian-2.2.6b-2"
+VERSION="2.4.2 Debian-2.4.2-1.2"
 TIMESTAMP=""
-package_revision=1.3017
+package_revision=1.3337
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -91,10 +98,15 @@ fi
 BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
 # NLS nuisances: We save the old values to restore during execute mode.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
 lt_user_locale=
 lt_safe_locale=
 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
@@ -107,24 +119,28 @@ do
 	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
 	fi"
 done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
 
 $lt_unset CDPATH
 
 
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
 
 
 
 : ${CP="cp -f"}
-: ${ECHO="echo"}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
-: ${LN_S="ln -s"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
-: ${SED="/bin/sed"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 : ${Xsed="$SED -e 1s/^X//"}
 
@@ -144,6 +160,27 @@ IFS=" 	$lt_nl"
 dirname="s,/[^/]*$,,"
 basename="s,^.*/,,"
 
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
 # func_dirname_and_basename file append nondir_replacement
 # perform func_basename and func_dirname in a single function
 # call:
@@ -158,33 +195,183 @@ basename="s,^.*/,,"
 # those functions but instead duplicate the functionality here.
 func_dirname_and_basename ()
 {
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+    # Extract subdirectory from the argument.
+    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+    case ${2} in
+      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+    esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+		s@/\./@/@g
+		t dotsl
+		s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+#             value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
+      fi
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
 }
 
-# Generated shell functions inserted here.
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
+
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
 
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
 
 # The name of this program:
-# In the unlikely event $progname began with a '-', it would play havoc with
-# func_echo (imagine progname=-n), so we prepend ./ in that case:
 func_dirname_and_basename "$progpath"
 progname=$func_basename_result
-case $progname in
-  -*) progname=./$progname ;;
-esac
 
 # Make sure we have an absolute path for reexecution:
 case $progpath in
@@ -196,7 +383,7 @@ case $progpath in
      ;;
   *)
      save_IFS="$IFS"
-     IFS=:
+     IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
        IFS="$save_IFS"
        test -x "$progdir/$progname" && break
@@ -215,6 +402,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
 # Same as above, but do not quote variable references.
 double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
 # Re-`\' parameter expansions in output of double_quote_subst that were
 # `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
 # in input to double_quote_subst, that '$' was protected from expansion.
@@ -243,7 +439,7 @@ opt_warning=:
 # name if it has been set yet.
 func_echo ()
 {
-    $ECHO "$progname${mode+: }$mode: $*"
+    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
 }
 
 # func_verbose arg...
@@ -258,18 +454,25 @@ func_verbose ()
     :
 }
 
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
 # func_error arg...
 # Echo program name prefixed message to standard error.
 func_error ()
 {
-    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
 }
 
 # func_warning arg...
 # Echo program name prefixed warning message to standard error.
 func_warning ()
 {
-    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
 
     # bash bug again:
     :
@@ -326,9 +529,9 @@ func_mkdir_p ()
         case $my_directory_path in */*) ;; *) break ;; esac
 
         # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
       done
-      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
 
       save_mkdir_p_IFS="$IFS"; IFS=':'
       for my_dir in $my_dir_list; do
@@ -378,7 +581,7 @@ func_mktempdir ()
         func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
     fi
 
-    $ECHO "X$my_tmpdir" | $Xsed
+    $ECHO "$my_tmpdir"
 }
 
 
@@ -392,7 +595,7 @@ func_quote_for_eval ()
 {
     case $1 in
       *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
       *)
         func_quote_for_eval_unquoted_result="$1" ;;
     esac
@@ -419,7 +622,7 @@ func_quote_for_expand ()
 {
     case $1 in
       *[\\\`\"]*)
-	my_arg=`$ECHO "X$1" | $Xsed \
+	my_arg=`$ECHO "$1" | $SED \
 	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
         my_arg="$1" ;;
@@ -488,15 +691,39 @@ func_show_eval_locale ()
     fi
 }
 
-
-
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+  case $1 in
+  [0-9]* | *[!a-zA-Z0-9_]*)
+    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+    ;;
+  * )
+    func_tr_sh_result=$1
+    ;;
+  esac
+}
 
 
 # func_version
 # Echo version message to standard output and exit.
 func_version ()
 {
-    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+    $opt_debug
+
+    $SED -n '/(C)/!b go
+	:more
+	/\./!{
+	  N
+	  s/\n# / /
+	  b more
+	}
+	:go
+	/^# '$PROGRAM' (GNU /,/# warranty; / {
         s/^# //
 	s/^# *$//
         s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
@@ -509,22 +736,28 @@ func_version ()
 # Echo short help message to standard output and exit.
 func_usage ()
 {
-    $SED -n '/^# Usage:/,/# -h/ {
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
         s/^# //
 	s/^# *$//
 	s/\$progname/'$progname'/
 	p
     }' < "$progpath"
-    $ECHO
+    echo
     $ECHO "run \`$progname --help | more' for full usage"
     exit $?
 }
 
-# func_help
-# Echo long help message to standard output and exit.
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
 func_help ()
 {
+    $opt_debug
+
     $SED -n '/^# Usage:/,/# Report bugs to/ {
+	:print
         s/^# //
 	s/^# *$//
 	s*\$progname*'$progname'*
@@ -534,11 +767,18 @@ func_help ()
 	s*\$LTCFLAGS*'"$LTCFLAGS"'*
 	s*\$LD*'"$LD"'*
 	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
 	p
-     }' < "$progpath"
-    exit $?
+	d
+     }
+     /^# .* home page:/b print
+     /^# General help using/b print
+     ' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
 }
 
 # func_missing_arg argname
@@ -546,63 +786,106 @@ func_help ()
 # exit_cmd.
 func_missing_arg ()
 {
-    func_error "missing argument for $1"
+    $opt_debug
+
+    func_error "missing argument for $1."
     exit_cmd=exit
 }
 
-exit_cmd=:
 
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
 
+    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+    my_sed_long_arg='1s/^--[^=]*=//'
+
+    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
 
 
 
-# Check that we have a working $ECHO.
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
-  # Yippee, $ECHO works!
-  :
-else
-  # Restart under the correct shell, and then maybe $ECHO will work.
-  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
 
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit $EXIT_SUCCESS
-fi
 
 magic="%%%MAGIC variable%%%"
 magic_exe="%%%MAGIC EXE variable%%%"
 
 # Global variables.
-# $mode is unset
 nonopt=
-execute_dlfiles=
 preserve_args=
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
 extracted_archives=
 extracted_serial=0
 
-opt_dry_run=false
-opt_duplicate_deps=false
-opt_silent=false
-opt_debug=:
-
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.
 exec_cmd=
 
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+    eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+    func_quote_for_eval "${2}"
+    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+    func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
 # func_fatal_configuration arg...
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
@@ -636,16 +919,16 @@ func_config ()
 # Display the features supported by this script.
 func_features ()
 {
-    $ECHO "host: $host"
+    echo "host: $host"
     if test "$build_libtool_libs" = yes; then
-      $ECHO "enable shared libraries"
+      echo "enable shared libraries"
     else
-      $ECHO "disable shared libraries"
+      echo "disable shared libraries"
     fi
     if test "$build_old_libs" = yes; then
-      $ECHO "enable static libraries"
+      echo "enable static libraries"
     else
-      $ECHO "disable static libraries"
+      echo "disable static libraries"
     fi
 
     exit $?
@@ -692,117 +975,209 @@ func_enable_tag ()
   esac
 }
 
-# Parse options once, thoroughly.  This comes as soon as possible in
-# the script to make things like `libtool --version' happen quickly.
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
 {
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+  shift; set dummy --mode clean ${1+"$@"}; shift
+  ;;
+compile|compil|compi|comp|com|co|c)
+  shift; set dummy --mode compile ${1+"$@"}; shift
+  ;;
+execute|execut|execu|exec|exe|ex|e)
+  shift; set dummy --mode execute ${1+"$@"}; shift
+  ;;
+finish|finis|fini|fin|fi|f)
+  shift; set dummy --mode finish ${1+"$@"}; shift
+  ;;
+install|instal|insta|inst|ins|in|i)
+  shift; set dummy --mode install ${1+"$@"}; shift
+  ;;
+link|lin|li|l)
+  shift; set dummy --mode link ${1+"$@"}; shift
+  ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+  shift; set dummy --mode uninstall ${1+"$@"}; shift
+  ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
 
-  # Shorthand for --mode=foo, only valid as the first argument
-  case $1 in
-  clean|clea|cle|cl)
-    shift; set dummy --mode clean ${1+"$@"}; shift
-    ;;
-  compile|compil|compi|comp|com|co|c)
-    shift; set dummy --mode compile ${1+"$@"}; shift
-    ;;
-  execute|execut|execu|exec|exe|ex|e)
-    shift; set dummy --mode execute ${1+"$@"}; shift
-    ;;
-  finish|finis|fini|fin|fi|f)
-    shift; set dummy --mode finish ${1+"$@"}; shift
-    ;;
-  install|instal|insta|inst|ins|in|i)
-    shift; set dummy --mode install ${1+"$@"}; shift
-    ;;
-  link|lin|li|l)
-    shift; set dummy --mode link ${1+"$@"}; shift
-    ;;
-  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-    shift; set dummy --mode uninstall ${1+"$@"}; shift
-    ;;
-  esac
 
-  # Parse non-mode specific arguments:
-  while test "$#" -gt 0; do
+# Parse options once, thoroughly.  This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+  # this just eases exit handling
+  while test $# -gt 0; do
     opt="$1"
     shift
-
     case $opt in
-      --config)		func_config					;;
-
-      --debug)		preserve_args="$preserve_args $opt"
+      --debug|-x)	opt_debug='set -x'
 			func_echo "enabling shell trace mode"
-			opt_debug='set -x'
 			$opt_debug
 			;;
-
-      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			execute_dlfiles="$execute_dlfiles $1"
-			shift
+      --dry-run|--dryrun|-n)
+			opt_dry_run=:
 			;;
-
-      --dry-run | -n)	opt_dry_run=:					;;
-      --features)       func_features					;;
-      --finish)		mode="finish"					;;
-
-      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			case $1 in
-			  # Valid mode arguments:
-			  clean)	;;
-			  compile)	;;
-			  execute)	;;
-			  finish)	;;
-			  install)	;;
-			  link)		;;
-			  relink)	;;
-			  uninstall)	;;
-
-			  # Catch anything else as an error
-			  *) func_error "invalid argument for $opt"
-			     exit_cmd=exit
-			     break
-			     ;;
-		        esac
-
-			mode="$1"
+      --config)
+			opt_config=:
+func_config
+			;;
+      --dlopen|-dlopen)
+			optarg="$1"
+			opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
 			shift
 			;;
-
       --preserve-dup-deps)
-			opt_duplicate_deps=:				;;
-
-      --quiet|--silent)	preserve_args="$preserve_args $opt"
-			opt_silent=:
+			opt_preserve_dup_deps=:
 			;;
-
-      --verbose| -v)	preserve_args="$preserve_args $opt"
+      --features)
+			opt_features=:
+func_features
+			;;
+      --finish)
+			opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+			;;
+      --help)
+			opt_help=:
+			;;
+      --help-all)
+			opt_help_all=:
+opt_help=': help-all'
+			;;
+      --mode)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_mode="$optarg"
+case $optarg in
+  # Valid mode arguments:
+  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+  # Catch anything else as an error
+  *) func_error "invalid argument for $opt"
+     exit_cmd=exit
+     break
+     ;;
+esac
+			shift
+			;;
+      --no-silent|--no-quiet)
 			opt_silent=false
+func_append preserve_args " $opt"
 			;;
-
-      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			preserve_args="$preserve_args $opt $1"
-			func_enable_tag "$1"	# tagname is set here
+      --no-warning|--no-warn)
+			opt_warning=false
+func_append preserve_args " $opt"
+			;;
+      --no-verbose)
+			opt_verbose=false
+func_append preserve_args " $opt"
+			;;
+      --silent|--quiet)
+			opt_silent=:
+func_append preserve_args " $opt"
+        opt_verbose=false
+			;;
+      --verbose|-v)
+			opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+			;;
+      --tag)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
 			shift
 			;;
 
+      -\?|-h)		func_usage				;;
+      --help)		func_help				;;
+      --version)	func_version				;;
+
       # Separate optargs to long options:
-      -dlopen=*|--mode=*|--tag=*)
-			func_opt_split "$opt"
-			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+      --*=*)
+			func_split_long_opt "$opt"
+			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
 			shift
 			;;
 
-      -\?|-h)		func_usage					;;
-      --help)		opt_help=:					;;
-      --version)	func_version					;;
-
-      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
-
-      *)		nonopt="$opt"
-			break
+      # Separate non-argument short options:
+      -\?*|-h*|-n*|-v*)
+			func_split_short_opt "$opt"
+			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+			shift
 			;;
+
+      --)		break					;;
+      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
+      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
     esac
   done
 
+  # Validate options:
+
+  # save first non-option argument
+  if test "$#" -gt 0; then
+    nonopt="$opt"
+    shift
+  fi
+
+  # preserve --debug
+  test "$opt_debug" = : || func_append preserve_args " --debug"
 
   case $host in
     *cygwin* | *mingw* | *pw32* | *cegcc*)
@@ -810,82 +1185,44 @@ func_enable_tag ()
       opt_duplicate_compiler_generated_deps=:
       ;;
     *)
-      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
       ;;
   esac
 
-  # Having warned about all mis-specified options, bail out if
-  # anything was wrong.
-  $exit_cmd $EXIT_FAILURE
-}
+  $opt_help || {
+    # Sanity checks first:
+    func_check_version_match
 
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      else
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
+    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+      func_fatal_configuration "not configured to build any kind of library"
     fi
 
-    exit $EXIT_MISMATCH
-  fi
-}
-
-
-## ----------- ##
-##    Main.    ##
-## ----------- ##
-
-$opt_help || {
-  # Sanity checks first:
-  func_check_version_match
+    # Darwin sucks
+    eval std_shrext=\"$shrext_cmds\"
 
-  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-    func_fatal_configuration "not configured to build any kind of library"
-  fi
+    # Only execute mode is allowed to have -dlopen flags.
+    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+      func_error "unrecognized option \`-dlopen'"
+      $ECHO "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
 
-  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+    # Change the help message to a mode-specific one.
+    generic_help="$help"
+    help="Try \`$progname --help --mode=$opt_mode' for more information."
+  }
 
 
-  # Darwin sucks
-  eval std_shrext=\"$shrext_cmds\"
+  # Bail if the options were screwed
+  $exit_cmd $EXIT_FAILURE
+}
 
 
-  # Only execute mode is allowed to have -dlopen flags.
-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
-    func_error "unrecognized option \`-dlopen'"
-    $ECHO "$help" 1>&2
-    exit $EXIT_FAILURE
-  fi
 
-  # Change the help message to a mode-specific one.
-  generic_help="$help"
-  help="Try \`$progname --help --mode=$mode' for more information."
-}
 
+## ----------- ##
+##    Main.    ##
+## ----------- ##
 
 # func_lalib_p file
 # True iff FILE is a libtool `.la' library or `.lo' object file.
@@ -950,12 +1287,9 @@ func_ltwrapper_executable_p ()
 # temporary ltwrapper_script.
 func_ltwrapper_scriptname ()
 {
-    func_ltwrapper_scriptname_result=""
-    if func_ltwrapper_executable_p "$1"; then
-	func_dirname_and_basename "$1" "" "."
-	func_stripname '' '.exe' "$func_basename_result"
-	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
-    fi
+    func_dirname_and_basename "$1" "" "."
+    func_stripname '' '.exe' "$func_basename_result"
+    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
 }
 
 # func_ltwrapper_p file
@@ -1001,6 +1335,37 @@ func_source ()
 }
 
 
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+  func_resolve_sysroot_result=$1
+  case $func_resolve_sysroot_result in
+  =*)
+    func_stripname '=' '' "$func_resolve_sysroot_result"
+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+    ;;
+  esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+  case "$lt_sysroot:$1" in
+  ?*:"$lt_sysroot"*)
+    func_stripname "$lt_sysroot" '' "$1"
+    func_replace_sysroot_result="=$func_stripname_result"
+    ;;
+  *)
+    # Including no sysroot.
+    func_replace_sysroot_result=$1
+    ;;
+  esac
+}
+
 # func_infer_tag arg
 # Infer tagged configuration to use if any are available and
 # if one wasn't chosen via the "--tag" command line option.
@@ -1013,13 +1378,15 @@ func_infer_tag ()
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
-        func_quote_for_eval "$arg"
-	CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	func_append_quoted CC_quoted "$arg"
       done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
       case $@ in
       # Blanks in the command may have been stripped by the calling shell,
       # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
       # Blanks at the start of $base_compile will cause this to fail
       # if we don't check for them as well.
       *)
@@ -1030,11 +1397,13 @@ func_infer_tag ()
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
-	      func_quote_for_eval "$arg"
-	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	      func_append_quoted CC_quoted "$arg"
 	    done
+	    CC_expanded=`func_echo_all $CC`
+	    CC_quoted_expanded=`func_echo_all $CC_quoted`
 	    case "$@ " in
-	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
 	      # The compiler in the base compile command matches
 	      # the one in the tagged configuration.
 	      # Assume this is the tagged configuration we want.
@@ -1097,6 +1466,486 @@ EOF
     }
 }
 
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+  $opt_debug
+  func_convert_core_file_wine_to_w32_result="$1"
+  if test -n "$1"; then
+    # Unfortunately, winepath does not exit with a non-zero error code, so we
+    # are forced to check the contents of stdout. On the other hand, if the
+    # command is not found, the shell will set an exit code of 127 and print
+    # *an error message* to stdout. So we must check for both error code of
+    # zero AND non-empty stdout, which explains the odd construction:
+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+        $SED -e "$lt_sed_naive_backslashify"`
+    else
+      func_convert_core_file_wine_to_w32_result=
+    fi
+  fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+  $opt_debug
+  # unfortunately, winepath doesn't convert paths, only file names
+  func_convert_core_path_wine_to_w32_result=""
+  if test -n "$1"; then
+    oldIFS=$IFS
+    IFS=:
+    for func_convert_core_path_wine_to_w32_f in $1; do
+      IFS=$oldIFS
+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
+          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+        else
+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+        fi
+      fi
+    done
+    IFS=$oldIFS
+  fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+  $opt_debug
+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+    if test "$?" -ne 0; then
+      # on failure, ensure result is empty
+      func_cygpath_result=
+    fi
+  else
+    func_cygpath_result=
+    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+  fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format.  Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+  $opt_debug
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+  $opt_debug
+  if test -z "$2" && test -n "$1" ; then
+    func_error "Could not determine host file name corresponding to"
+    func_error "  \`$1'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback:
+    func_to_host_file_result="$1"
+  fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+  $opt_debug
+  if test -z "$4" && test -n "$3"; then
+    func_error "Could not determine the host path corresponding to"
+    func_error "  \`$3'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback.  This is a deliberately simplistic "conversion" and
+    # should not be "improved".  See libtool.info.
+    if test "x$1" != "x$2"; then
+      lt_replace_pathsep_chars="s|$1|$2|g"
+      func_to_host_path_result=`echo "$3" |
+        $SED -e "$lt_replace_pathsep_chars"`
+    else
+      func_to_host_path_result="$3"
+    fi
+  fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+  $opt_debug
+  case $4 in
+  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+    ;;
+  esac
+  case $4 in
+  $2 ) func_append func_to_host_path_result "$3"
+    ;;
+  esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+  $opt_debug
+  $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.  If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+  $opt_debug
+  case ,$2, in
+    *,"$to_tool_file_cmd",*)
+      func_to_tool_file_result=$1
+      ;;
+    *)
+      $to_tool_file_cmd "$1"
+      func_to_tool_file_result=$func_to_host_file_result
+      ;;
+  esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+  func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+    # LT_CYGPATH in this case.
+    func_to_host_file_result=`cygpath -m "$1"`
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_file_wine_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+    func_convert_core_file_wine_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format.  If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+#   file name conversion function    : func_convert_file_X_to_Y ()
+#   path conversion function         : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same.  If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+  $opt_debug
+  if test -z "$to_host_path_cmd"; then
+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+  fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+  $opt_debug
+  func_init_to_host_path_cmd
+  $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+  func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from ARG.  MSYS
+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+    # and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
+# a working winepath.  Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from
+    # ARG. msys behavior is inconsistent here, cygpath turns them
+    # into '.;' and ';.', and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
 # func_mode_compile arg...
 func_mode_compile ()
 {
@@ -1137,12 +1986,12 @@ func_mode_compile ()
 	  ;;
 
 	-pie | -fpie | -fPIE)
-          pie_flag="$pie_flag $arg"
+          func_append pie_flag " $arg"
 	  continue
 	  ;;
 
 	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  later="$later $arg"
+	  func_append later " $arg"
 	  continue
 	  ;;
 
@@ -1163,15 +2012,14 @@ func_mode_compile ()
 	  save_ifs="$IFS"; IFS=','
 	  for arg in $args; do
 	    IFS="$save_ifs"
-	    func_quote_for_eval "$arg"
-	    lastarg="$lastarg $func_quote_for_eval_result"
+	    func_append_quoted lastarg "$arg"
 	  done
 	  IFS="$save_ifs"
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
 	  # Add the arguments to base_compile.
-	  base_compile="$base_compile $lastarg"
+	  func_append base_compile " $lastarg"
 	  continue
 	  ;;
 
@@ -1187,8 +2035,7 @@ func_mode_compile ()
       esac    #  case $arg_mode
 
       # Aesthetically quote the previous argument.
-      func_quote_for_eval "$lastarg"
-      base_compile="$base_compile $func_quote_for_eval_result"
+      func_append_quoted base_compile "$lastarg"
     done # for arg
 
     case $arg_mode in
@@ -1213,7 +2060,7 @@ func_mode_compile ()
     *.[cCFSifmso] | \
     *.ada | *.adb | *.ads | *.asm | \
     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
       func_xform "$libobj"
       libobj=$func_xform_result
       ;;
@@ -1288,7 +2135,7 @@ func_mode_compile ()
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
     if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
       lockfile="$output_obj.lock"
     else
       output_obj=
@@ -1319,17 +2166,16 @@ compiler."
 	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
-      removelist="$removelist $output_obj"
+      func_append removelist " $output_obj"
       $ECHO "$srcfile" > "$lockfile"
     fi
 
     $opt_dry_run || $RM $removelist
-    removelist="$removelist $lockfile"
+    func_append removelist " $lockfile"
     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
 
-    if test -n "$fix_srcfile_path"; then
-      eval srcfile=\"$fix_srcfile_path\"
-    fi
+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+    srcfile=$func_to_tool_file_result
     func_quote_for_eval "$srcfile"
     qsrcfile=$func_quote_for_eval_result
 
@@ -1349,7 +2195,7 @@ compiler."
 
       if test -z "$output_obj"; then
 	# Place PIC objects in $objdir
-	command="$command -o $lobj"
+	func_append command " -o $lobj"
       fi
 
       func_show_eval_locale "$command"	\
@@ -1396,11 +2242,11 @@ compiler."
 	command="$base_compile $qsrcfile $pic_flag"
       fi
       if test "$compiler_c_o" = yes; then
-	command="$command -o $obj"
+	func_append command " -o $obj"
       fi
 
       # Suppress compiler output if we already did a PIC compilation.
-      command="$command$suppress_output"
+      func_append command "$suppress_output"
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
@@ -1445,13 +2291,13 @@ compiler."
 }
 
 $opt_help || {
-test "$mode" = compile && func_mode_compile ${1+"$@"}
+  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
 {
     # We need to display help for each of the modes.
-    case $mode in
+    case $opt_mode in
       "")
         # Generic help is extracted from the usage comments
         # at the start of this file.
@@ -1482,10 +2328,11 @@ This mode accepts the following additional options:
 
   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
   -no-suppress      do not suppress compiler output for multiple passes
-  -prefer-pic       try to building PIC objects only
-  -prefer-non-pic   try to building non-PIC objects only
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
   -shared           do not build a \`.o' file suitable for static linking
   -static           only build a \`.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
 
 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
 from the given SOURCEFILE.
@@ -1538,7 +2385,7 @@ either the \`install' or \`cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
-  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
 
 The rest of the components are interpreted as arguments to that command (only
 BSD-compatible install options are recognized)."
@@ -1558,6 +2405,8 @@ The following components of LINK-COMMAND are treated specially:
 
   -all-static       do not do any dynamic linking at all
   -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
@@ -1586,6 +2435,11 @@ The following components of LINK-COMMAND are treated specially:
   -version-info CURRENT[:REVISION[:AGE]]
                     specify library version info [each variable defaults to 0]
   -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
 All other options (arguments beginning with \`-') are ignored.
 
@@ -1619,18 +2473,44 @@ Otherwise, only FILE itself is deleted using RM."
         ;;
 
       *)
-        func_fatal_help "invalid operation mode \`$mode'"
+        func_fatal_help "invalid operation mode \`$opt_mode'"
         ;;
     esac
 
-    $ECHO
+    echo
     $ECHO "Try \`$progname --help' for more information about other modes."
-
-    exit $?
 }
 
-  # Now that we've collected a possible --mode arg, show help if necessary
-  $opt_help && func_mode_help
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test "$opt_help" = :; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	func_mode_help
+      done
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	echo
+	func_mode_help
+      done
+    } |
+    sed '1d
+      /^When reporting/,/^Report/{
+	H
+	d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
 
 
 # func_mode_execute arg...
@@ -1643,13 +2523,16 @@ func_mode_execute ()
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
+    for file in $opt_dlopen; do
       test -f "$file" \
 	|| func_fatal_help "\`$file' is not a file"
 
       dir=
       case $file in
       *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
 	  || func_fatal_help "\`$lib' is not a valid libtool archive"
@@ -1671,7 +2554,7 @@ func_mode_execute ()
 	dir="$func_dirname_result"
 
 	if test -f "$dir/$objdir/$dlname"; then
-	  dir="$dir/$objdir"
+	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
 	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
@@ -1712,7 +2595,7 @@ func_mode_execute ()
     for file
     do
       case $file in
-      -*) ;;
+      -* | *.la | *.lo ) ;;
       *)
 	# Do a test to see if this is really a libtool program.
 	if func_ltwrapper_script_p "$file"; then
@@ -1728,8 +2611,7 @@ func_mode_execute ()
 	;;
       esac
       # Quote arguments (to preserve shell metacharacters).
-      func_quote_for_eval "$file"
-      args="$args $func_quote_for_eval_result"
+      func_append_quoted args "$file"
     done
 
     if test "X$opt_dry_run" = Xfalse; then
@@ -1754,29 +2636,66 @@ func_mode_execute ()
       # Display what would be done.
       if test -n "$shlibpath_var"; then
 	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	$ECHO "export $shlibpath_var"
+	echo "export $shlibpath_var"
       fi
       $ECHO "$cmd$args"
       exit $EXIT_SUCCESS
     fi
 }
 
-test "$mode" = execute && func_mode_execute ${1+"$@"}
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
     $opt_debug
-    libdirs="$nonopt"
+    libs=
+    libdirs=
     admincmds=
 
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for dir
-      do
-	libdirs="$libdirs $dir"
-      done
+    for opt in "$nonopt" ${1+"$@"}
+    do
+      if test -d "$opt"; then
+	func_append libdirs " $opt"
+
+      elif test -f "$opt"; then
+	if func_lalib_unsafe_p "$opt"; then
+	  func_append libs " $opt"
+	else
+	  func_warning "\`$opt' is not a valid libtool archive"
+	fi
+
+      else
+	func_fatal_error "invalid argument \`$opt'"
+      fi
+    done
+
+    if test -n "$libs"; then
+      if test -n "$lt_sysroot"; then
+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+      else
+        sysroot_cmd=
+      fi
+
+      # Remove sysroot references
+      if $opt_dry_run; then
+        for lib in $libs; do
+          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+        done
+      else
+        tmpdir=`func_mktempdir`
+        for lib in $libs; do
+	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	    > $tmpdir/tmp-la
+	  mv -f $tmpdir/tmp-la $lib
+	done
+        ${RM}r "$tmpdir"
+      fi
+    fi
 
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       for libdir in $libdirs; do
 	if test -n "$finish_cmds"; then
 	  # Do each command in the finish commands.
@@ -1786,7 +2705,7 @@ func_mode_finish ()
 	if test -n "$finish_eval"; then
 	  # Do the single finish_eval.
 	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+	  $opt_dry_run || eval "$cmds" || func_append admincmds "
        $cmds"
 	fi
       done
@@ -1795,53 +2714,55 @@ func_mode_finish ()
     # Exit here if they wanted silent mode.
     $opt_silent && exit $EXIT_SUCCESS
 
-    $ECHO "X----------------------------------------------------------------------" | $Xsed
-    $ECHO "Libraries have been installed in:"
-    for libdir in $libdirs; do
-      $ECHO "   $libdir"
-    done
-    $ECHO
-    $ECHO "If you ever happen to want to link against installed libraries"
-    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
-    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
-    $ECHO "flag during linking and do at least one of the following:"
-    if test -n "$shlibpath_var"; then
-      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      $ECHO "     during execution"
-    fi
-    if test -n "$runpath_var"; then
-      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
-      $ECHO "     during linking"
-    fi
-    if test -n "$hardcode_libdir_flag_spec"; then
-      libdir=LIBDIR
-      eval flag=\"$hardcode_libdir_flag_spec\"
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      echo "----------------------------------------------------------------------"
+      echo "Libraries have been installed in:"
+      for libdir in $libdirs; do
+	$ECHO "   $libdir"
+      done
+      echo
+      echo "If you ever happen to want to link against installed libraries"
+      echo "in a given directory, LIBDIR, you must either use libtool, and"
+      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "flag during linking and do at least one of the following:"
+      if test -n "$shlibpath_var"; then
+	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "     during execution"
+      fi
+      if test -n "$runpath_var"; then
+	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "     during linking"
+      fi
+      if test -n "$hardcode_libdir_flag_spec"; then
+	libdir=LIBDIR
+	eval flag=\"$hardcode_libdir_flag_spec\"
 
-      $ECHO "   - use the \`$flag' linker flag"
-    fi
-    if test -n "$admincmds"; then
-      $ECHO "   - have your system administrator run these commands:$admincmds"
-    fi
-    if test -f /etc/ld.so.conf; then
-      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-    fi
-    $ECHO
+	$ECHO "   - use the \`$flag' linker flag"
+      fi
+      if test -n "$admincmds"; then
+	$ECHO "   - have your system administrator run these commands:$admincmds"
+      fi
+      if test -f /etc/ld.so.conf; then
+	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+      fi
+      echo
 
-    $ECHO "See any operating system documentation about shared libraries for"
-    case $host in
-      solaris2.[6789]|solaris2.1[0-9])
-        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-	$ECHO "pages."
-	;;
-      *)
-        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
-        ;;
-    esac
-    $ECHO "X----------------------------------------------------------------------" | $Xsed
+      echo "See any operating system documentation about shared libraries for"
+      case $host in
+	solaris2.[6789]|solaris2.1[0-9])
+	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	  echo "pages."
+	  ;;
+	*)
+	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
+	  ;;
+      esac
+      echo "----------------------------------------------------------------------"
+    fi
     exit $EXIT_SUCCESS
 }
 
-test "$mode" = finish && func_mode_finish ${1+"$@"}
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
@@ -1852,7 +2773,7 @@ func_mode_install ()
     # install_prog (especially on Windows NT).
     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
        # Allow the use of GNU shtool's install command.
-       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+       case $nonopt in *shtool*) :;; *) false;; esac; then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -1866,7 +2787,12 @@ func_mode_install ()
     # The real first argument should be the name of the installation program.
     # Aesthetically quote it.
     func_quote_for_eval "$arg"
-    install_prog="$install_prog$func_quote_for_eval_result"
+    func_append install_prog "$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
 
     # We need to accept at least all the BSD install flags.
     dest=
@@ -1876,10 +2802,12 @@ func_mode_install ()
     install_type=
     isdir=no
     stripme=
+    no_mode=:
     for arg
     do
+      arg2=
       if test -n "$dest"; then
-	files="$files $dest"
+	func_append files " $dest"
 	dest=$arg
 	continue
       fi
@@ -1887,10 +2815,9 @@ func_mode_install ()
       case $arg in
       -d) isdir=yes ;;
       -f)
-	case " $install_prog " in
-	*[\\\ /]cp\ *) ;;
-	*) prev=$arg ;;
-	esac
+	if $install_cp; then :; else
+	  prev=$arg
+	fi
 	;;
       -g | -m | -o)
 	prev=$arg
@@ -1904,6 +2831,10 @@ func_mode_install ()
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
+	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	    arg2=$install_override_mode
+	    no_mode=false
+	  fi
 	  prev=
 	else
 	  dest=$arg
@@ -1914,7 +2845,11 @@ func_mode_install ()
 
       # Aesthetically quote the argument.
       func_quote_for_eval "$arg"
-      install_prog="$install_prog $func_quote_for_eval_result"
+      func_append install_prog " $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+	func_quote_for_eval "$arg2"
+      fi
+      func_append install_shared_prog " $func_quote_for_eval_result"
     done
 
     test -z "$install_prog" && \
@@ -1923,6 +2858,13 @@ func_mode_install ()
     test -n "$prev" && \
       func_fatal_help "the \`$prev' option requires an argument"
 
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+	func_quote_for_eval "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_for_eval_result"
+      fi
+    fi
+
     if test -z "$files"; then
       if test -z "$dest"; then
 	func_fatal_help "no file or destination specified"
@@ -1977,10 +2919,13 @@ func_mode_install ()
       case $file in
       *.$libext)
 	# Do the static libraries later.
-	staticlibs="$staticlibs $file"
+	func_append staticlibs " $file"
 	;;
 
       *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
 	  || func_fatal_help "\`$file' is not a valid libtool archive"
@@ -1994,23 +2939,23 @@ func_mode_install ()
 	if test "X$destdir" = "X$libdir"; then
 	  case "$current_libdirs " in
 	  *" $libdir "*) ;;
-	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  *) func_append current_libdirs " $libdir" ;;
 	  esac
 	else
 	  # Note the libdir as a future libdir.
 	  case "$future_libdirs " in
 	  *" $libdir "*) ;;
-	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  *) func_append future_libdirs " $libdir" ;;
 	  esac
 	fi
 
 	func_dirname "$file" "/" ""
 	dir="$func_dirname_result"
-	dir="$dir$objdir"
+	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
 	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
 
 	  # Don't allow the user to place us outside of our expected
 	  # location b/c this prevents finding dependent libraries that
@@ -2023,9 +2968,9 @@ func_mode_install ()
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
 	  else
-	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
 	  func_warning "relinking \`$file'"
@@ -2043,7 +2988,7 @@ func_mode_install ()
 	  test -n "$relink_command" && srcname="$realname"T
 
 	  # Install the shared library and build the symlinks.
-	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
 	  tstripme="$stripme"
 	  case $host_os in
@@ -2083,7 +3028,7 @@ func_mode_install ()
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
 	;;
 
       *.lo)
@@ -2183,7 +3128,7 @@ func_mode_install ()
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
 	    if test -n "$libdir" && test ! -f "$libfile"; then
 	      func_warning "\`$lib' has not been installed in \`$libdir'"
 	      finalize=no
@@ -2202,7 +3147,7 @@ func_mode_install ()
 		file="$func_basename_result"
 	        outputname="$tmpdir/$file"
 	        # Replace the output file specification.
-	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
 	        $opt_silent || {
 	          func_quote_for_expand "$relink_command"
@@ -2221,7 +3166,7 @@ func_mode_install ()
 	    }
 	  else
 	    # Install the binary that we compiled earlier.
-	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
 	  fi
 	fi
 
@@ -2257,11 +3202,13 @@ func_mode_install ()
 
       # Set up the ranlib parameters.
       oldlib="$destdir/$name"
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
 
       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
 
       if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $oldlib" 'exit $?'
+	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
       fi
 
       # Do each command in the postinstall commands.
@@ -2280,7 +3227,7 @@ func_mode_install ()
     fi
 }
 
-test "$mode" = install && func_mode_install ${1+"$@"}
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -2323,6 +3270,22 @@ func_generate_dlsyms ()
 extern \"C\" {
 #endif
 
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
 /* External symbol declarations for the compiler. */\
 "
 
@@ -2332,10 +3295,11 @@ extern \"C\" {
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
 	  # Add our own program objects to the symbol list.
-	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
-	    func_verbose "extracting global C symbols from \`$progfile'"
-	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
 	  if test -n "$exclude_expsyms"; then
@@ -2371,7 +3335,7 @@ extern \"C\" {
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
-	        *cygwin | *mingw* | *cegcc* )
+	        *cygwin* | *mingw* | *cegcc* )
 	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
 	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
 	          ;;
@@ -2384,10 +3348,52 @@ extern \"C\" {
 	  func_verbose "extracting global C symbols from \`$dlprefile'"
 	  func_basename "$dlprefile"
 	  name="$func_basename_result"
-	  $opt_dry_run || {
-	    eval '$ECHO ": $name " >> "$nlist"'
-	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	  }
+          case $host in
+	    *cygwin* | *mingw* | *cegcc* )
+	      # if an import library, we need to obtain dlname
+	      if func_win32_import_lib_p "$dlprefile"; then
+	        func_tr_sh "$dlprefile"
+	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
+	        dlprefile_dlbasename=""
+	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+	          # Use subshell, to avoid clobbering current variable values
+	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+	          if test -n "$dlprefile_dlname" ; then
+	            func_basename "$dlprefile_dlname"
+	            dlprefile_dlbasename="$func_basename_result"
+	          else
+	            # no lafile. user explicitly requested -dlpreopen <import library>.
+	            $sharedlib_from_linklib_cmd "$dlprefile"
+	            dlprefile_dlbasename=$sharedlib_from_linklib_result
+	          fi
+	        fi
+	        $opt_dry_run || {
+	          if test -n "$dlprefile_dlbasename" ; then
+	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+	          else
+	            func_warning "Could not compute DLL name from $name"
+	            eval '$ECHO ": $name " >> "$nlist"'
+	          fi
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+	        }
+	      else # not an import lib
+	        $opt_dry_run || {
+	          eval '$ECHO ": $name " >> "$nlist"'
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	        }
+	      fi
+	    ;;
+	    *)
+	      $opt_dry_run || {
+	        eval '$ECHO ": $name " >> "$nlist"'
+	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	      }
+	    ;;
+          esac
 	done
 
 	$opt_dry_run || {
@@ -2415,36 +3421,19 @@ extern \"C\" {
 	  if test -f "$nlist"S; then
 	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
 	  else
-	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
 typedef struct {
   const char *name;
   void *address;
 } lt_dlsymlist;
-"
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc* )
-	    $ECHO >> "$output_objdir/$my_dlsyms" "\
-/* DATA imports from DLLs on WIN32 con't be const, because
-   runtime relocations are performed -- see ld's documentation
-   on pseudo-relocs.  */"
-	    lt_dlsym_const= ;;
-	  *osf5*)
-	    echo >> "$output_objdir/$my_dlsyms" "\
-/* This system does not cope well with relocations in const data */"
-	    lt_dlsym_const= ;;
-	  *)
-	    lt_dlsym_const=const ;;
-	  esac
-
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-extern $lt_dlsym_const lt_dlsymlist
+extern LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[];
-$lt_dlsym_const lt_dlsymlist
+LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
 {\
   { \"$my_originator\", (void *) 0 },"
@@ -2457,7 +3446,7 @@ lt_${my_prefix}_LTX_preloaded_symbols[] =
 	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
 	    ;;
 	  esac
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+	  echo >> "$output_objdir/$my_dlsyms" "\
   {0, (void *) 0}
 };
 
@@ -2484,7 +3473,7 @@ static const void *lt_preloaded_setup() {
 	  # linked before any other PIC object.  But we must not use
 	  # pic_flag when linking with -static.  The problem exists in
 	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
 	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
@@ -2500,7 +3489,7 @@ static const void *lt_preloaded_setup() {
 	for arg in $LTCFLAGS; do
 	  case $arg in
 	  -pie | -fpie | -fPIE) ;;
-	  *) symtab_cflags="$symtab_cflags $arg" ;;
+	  *) func_append symtab_cflags " $arg" ;;
 	  esac
 	done
 
@@ -2515,16 +3504,16 @@ static const void *lt_preloaded_setup() {
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
-	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 	  else
-	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 	  fi
 	  ;;
 	*)
-	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 	  ;;
 	esac
 	;;
@@ -2538,8 +3527,8 @@ static const void *lt_preloaded_setup() {
       # really was required.
 
       # Nullify the symbol file.
-      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
     fi
 }
 
@@ -2549,6 +3538,7 @@ static const void *lt_preloaded_setup() {
 # Need a lot of goo to handle *both* DLLs and import libs
 # Has to be a shell function in order to 'eat' the argument
 # that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
   $opt_debug
@@ -2559,9 +3549,11 @@ func_win32_libid ()
     win32_libid_type="x86 archive import"
     ;;
   *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-      win32_nmres=`eval $NM -f posix -A $1 |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      func_to_tool_file "$1" func_convert_file_msys_to_w32
+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
 	$SED -n -e '
 	    1,100{
 		/ I /{
@@ -2590,6 +3582,131 @@ func_win32_libid ()
   $ECHO "$win32_libid_type"
 }
 
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+  $opt_debug
+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+  $opt_debug
+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+    $SED '/^Contents of section '"$match_literal"':/{
+      # Place marker at beginning of archive member dllname section
+      s/.*/====MARK====/
+      p
+      d
+    }
+    # These lines can sometimes be longer than 43 characters, but
+    # are always uninteresting
+    /:[	 ]*file format pe[i]\{,1\}-/d
+    /^In archive [^:]*:/d
+    # Ensure marker is printed
+    /^====MARK====/p
+    # Remove all lines with less than 43 characters
+    /^.\{43\}/!d
+    # From remaining lines, remove first 43 characters
+    s/^.\{43\}//' |
+    $SED -n '
+      # Join marker and all lines until next marker into a single line
+      /^====MARK====/ b para
+      H
+      $ b para
+      b
+      :para
+      x
+      s/\n//g
+      # Remove the marker
+      s/^====MARK====//
+      # Remove trailing dots and whitespace
+      s/[\. \t]*$//
+      # Print
+      /./p' |
+    # we now have a list, one entry per line, of the stringified
+    # contents of the appropriate section of all members of the
+    # archive which possess that section. Heuristic: eliminate
+    # all those which have a first or second character that is
+    # a '.' (that is, objdump's representation of an unprintable
+    # character.) This should work for all archives with less than
+    # 0x302f exports -- but will fail for DLLs whose name actually
+    # begins with a literal '.' or a single character followed by
+    # a '.'.
+    #
+    # Of those that remain, print the first one.
+    $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+  $opt_debug
+  if func_cygming_gnu_implib_p "$1" ; then
+    # binutils import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+  elif func_cygming_ms_implib_p "$1" ; then
+    # ms-generated import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+  else
+    # unknown
+    sharedlib_from_linklib_result=""
+  fi
+}
 
 
 # func_extract_an_archive dir oldlib
@@ -2598,7 +3715,18 @@ func_extract_an_archive ()
     $opt_debug
     f_ex_an_ar_dir="$1"; shift
     f_ex_an_ar_oldlib="$1"
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+		   'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
      :
     else
@@ -2669,7 +3797,7 @@ func_extract_archives ()
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
 	      $LIPO -create -output "$darwin_file" $darwin_files
 	    done # $darwin_filelist
 	    $RM -rf unfat-$$
@@ -2684,25 +3812,30 @@ func_extract_archives ()
         func_extract_an_archive "$my_xdir" "$my_xabs"
 	;;
       esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
     func_extract_archives_result="$my_oldobjs"
 }
 
 
-
-# func_emit_wrapper_part1 [arg=no]
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
 #
-# Emit the first part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part1 ()
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
 {
-	func_emit_wrapper_part1_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_part1_arg1=$1
-	fi
+	func_emit_wrapper_arg1=${1-no}
 
 	$ECHO "\
 #! $SHELL
@@ -2718,7 +3851,6 @@ func_emit_wrapper_part1 ()
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
 sed_quote_subst='$sed_quote_subst'
 
 # Be Bourne compatible
@@ -2749,31 +3881,135 @@ if test \"\$libtool_install_magic\" = \"$magic\"; then
 else
   # When we are sourced in execute mode, \$file and \$ECHO are already set.
   if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    ECHO=\"$qecho\"
-    file=\"\$0\"
-    # Make sure echo works.
-    if test \"X\$1\" = X--no-reexec; then
-      # Discard the --no-reexec flag, and continue.
-      shift
-    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
-      # Yippee, \$ECHO works!
-      :
-    else
-      # Restart under the correct shell, and then maybe \$ECHO will work.
-      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
-    fi
-  fi\
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
 "
-	$ECHO "\
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
 
   # Find the directory that this script lives in.
-  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
 
   # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
   while test -n \"\$file\"; do
-    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
 
     # If there was a directory component, then change thisdir.
     if test \"x\$destdir\" != \"x\$file\"; then
@@ -2783,30 +4019,13 @@ else
       esac
     fi
 
-    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
   done
-"
-}
-# end: func_emit_wrapper_part1
-
-# func_emit_wrapper_part2 [arg=no]
-#
-# Emit the second part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part2 ()
-{
-	func_emit_wrapper_part2_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_part2_arg1=$1
-	fi
-
-	$ECHO "\
 
   # Usually 'no', except on cygwin/mingw when embedded into
   # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
   if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
     # special case for '.'
     if test \"\$thisdir\" = \".\"; then
@@ -2814,7 +4033,7 @@ func_emit_wrapper_part2 ()
     fi
     # remove .libs from thisdir
     case \"\$thisdir\" in
-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
     $objdir )   thisdir=. ;;
     esac
   fi
@@ -2869,6 +4088,18 @@ func_emit_wrapper_part2 ()
 
   if test -f \"\$progdir/\$program\"; then"
 
+	# fixup the dll searchpath if we need to.
+	#
+	# Fix the DLL searchpath if we need to.  Do this before prepending
+	# to shlibpath, because on Windows, both are PATH and uninstalled
+	# libraries must come first.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
 	# Export our shlibpath_var if we have one.
 	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
@@ -2877,253 +4108,28 @@ func_emit_wrapper_part2 ()
 
     # Some systems cannot cope with colon-terminated $shlibpath_var
     # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
 
     export $shlibpath_var
 "
 	fi
 
-	# fixup the dll searchpath if we need to.
-	if test -n "$dllsearchpath"; then
-	  $ECHO "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
 	$ECHO "\
     if test \"\$libtool_execute_magic\" != \"$magic\"; then
       # Run the actual program with our arguments.
-"
-	case $host in
-	# Backslashes separate directories on plain windows
-	*-*-mingw | *-*-os2* | *-cegcc*)
-	  $ECHO "\
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-	  ;;
-
-	*)
-	  $ECHO "\
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-	  ;;
-	esac
-	$ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
+      func_exec_program \${1+\"\$@\"}
     fi
   else
     # The program doesn't exist.
     \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
-    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
   fi
 fi\
 "
 }
-# end: func_emit_wrapper_part2
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-	func_emit_wrapper_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_arg1=$1
-	fi
-
-	# split this up so that func_emit_cwrapperexe_src
-	# can call each part independently.
-	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
-	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
-}
-
-
-# func_to_host_path arg
-#
-# Convert paths to host format when used with build tools.
-# Intended for use with "native" mingw (where libtool itself
-# is running under the msys shell), or in the following cross-
-# build environments:
-#    $build          $host
-#    mingw (msys)    mingw  [e.g. native]
-#    cygwin          mingw
-#    *nix + wine     mingw
-# where wine is equipped with the `winepath' executable.
-# In the native mingw case, the (msys) shell automatically
-# converts paths for any non-msys applications it launches,
-# but that facility isn't available from inside the cwrapper.
-# Similar accommodations are necessary for $host mingw and
-# $build cygwin.  Calling this function does no harm for other
-# $host/$build combinations not listed above.
-#
-# ARG is the path (on $build) that should be converted to
-# the proper representation for $host. The result is stored
-# in $func_to_host_path_result.
-func_to_host_path ()
-{
-  func_to_host_path_result="$1"
-  if test -n "$1" ; then
-    case $host in
-      *mingw* )
-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-        case $build in
-          *mingw* ) # actually, msys
-            # awkward: cmd appends spaces to result
-            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
-              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          *cygwin* )
-            func_to_host_path_tmp1=`cygpath -w "$1"`
-            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          * )
-            # Unfortunately, winepath does not exit with a non-zero
-            # error code, so we are forced to check the contents of
-            # stdout. On the other hand, if the command is not
-            # found, the shell will set an exit code of 127 and print
-            # *an error message* to stdout. So we must check for both
-            # error code of zero AND non-empty stdout, which explains
-            # the odd construction:
-            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
-            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
-              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-                $SED -e "$lt_sed_naive_backslashify"`
-            else
-              # Allow warning below.
-              func_to_host_path_result=""
-            fi
-            ;;
-        esac
-        if test -z "$func_to_host_path_result" ; then
-          func_error "Could not determine host path corresponding to"
-          func_error "  '$1'"
-          func_error "Continuing, but uninstalled executables may not work."
-          # Fallback:
-          func_to_host_path_result="$1"
-        fi
-        ;;
-    esac
-  fi
-}
-# end: func_to_host_path
 
-# func_to_host_pathlist arg
-#
-# Convert pathlists to host format when used with build tools.
-# See func_to_host_path(), above. This function supports the
-# following $build/$host combinations (but does no harm for
-# combinations not listed here):
-#    $build          $host
-#    mingw (msys)    mingw  [e.g. native]
-#    cygwin          mingw
-#    *nix + wine     mingw
-#
-# Path separators are also converted from $build format to
-# $host format. If ARG begins or ends with a path separator
-# character, it is preserved (but converted to $host format)
-# on output.
-#
-# ARG is a pathlist (on $build) that should be converted to
-# the proper representation on $host. The result is stored
-# in $func_to_host_pathlist_result.
-func_to_host_pathlist ()
-{
-  func_to_host_pathlist_result="$1"
-  if test -n "$1" ; then
-    case $host in
-      *mingw* )
-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-        # Remove leading and trailing path separator characters from
-        # ARG. msys behavior is inconsistent here, cygpath turns them
-        # into '.;' and ';.', and winepath ignores them completely.
-        func_to_host_pathlist_tmp2="$1"
-        # Once set for this call, this variable should not be
-        # reassigned. It is used in tha fallback case.
-        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
-          $SED -e 's|^:*||' -e 's|:*$||'`
-        case $build in
-          *mingw* ) # Actually, msys.
-            # Awkward: cmd appends spaces to result.
-            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
-              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          *cygwin* )
-            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
-            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          * )
-            # unfortunately, winepath doesn't convert pathlists
-            func_to_host_pathlist_result=""
-            func_to_host_pathlist_oldIFS=$IFS
-            IFS=:
-            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
-              IFS=$func_to_host_pathlist_oldIFS
-              if test -n "$func_to_host_pathlist_f" ; then
-                func_to_host_path "$func_to_host_pathlist_f"
-                if test -n "$func_to_host_path_result" ; then
-                  if test -z "$func_to_host_pathlist_result" ; then
-                    func_to_host_pathlist_result="$func_to_host_path_result"
-                  else
-                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
-                  fi
-                fi
-              fi
-              IFS=:
-            done
-            IFS=$func_to_host_pathlist_oldIFS
-            ;;
-        esac
-        if test -z "$func_to_host_pathlist_result" ; then
-          func_error "Could not determine the host path(s) corresponding to"
-          func_error "  '$1'"
-          func_error "Continuing, but uninstalled executables may not work."
-          # Fallback. This may break if $1 contains DOS-style drive
-          # specifications. The fix is not to complicate the expression
-          # below, but for the user to provide a working wine installation
-          # with winepath so that path translation in the cross-to-mingw
-          # case works properly.
-          lt_replace_pathsep_nix_to_dos="s|:|;|g"
-          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
-            $SED -e "$lt_replace_pathsep_nix_to_dos"`
-        fi
-        # Now, add the leading and trailing path separators back
-        case "$1" in
-          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
-            ;;
-        esac
-        case "$1" in
-          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
-            ;;
-        esac
-        ;;
-    esac
-  fi
-}
-# end: func_to_host_pathlist
 
 # func_emit_cwrapperexe_src
 # emit the source code for a wrapper executable on stdout
@@ -3141,31 +4147,23 @@ func_emit_cwrapperexe_src ()
 
    This wrapper executable should never be moved out of the build directory.
    If it is, it will not operate correctly.
-
-   Currently, it simply execs the wrapper *script* "$SHELL $output",
-   but could eventually absorb all of the scripts functionality and
-   exec $objdir/$outputname directly.
 */
 EOF
 	    cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #ifdef _MSC_VER
 # include <direct.h>
 # include <process.h>
 # include <io.h>
-# define setmode _setmode
 #else
 # include <unistd.h>
 # include <stdint.h>
 # ifdef __CYGWIN__
 #  include <io.h>
-#  define HAVE_SETENV
-#  ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-#  endif
 # endif
 #endif
 #include <malloc.h>
@@ -3177,6 +4175,44 @@ int setenv (const char *, const char *, int);
 #include <fcntl.h>
 #include <sys/stat.h>
 
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
 #if defined(PATH_MAX)
 # define LT_PATHMAX PATH_MAX
 #elif defined(MAXPATHLEN)
@@ -3192,14 +4228,7 @@ int setenv (const char *, const char *, int);
 # define S_IXGRP 0
 #endif
 
-#ifdef _MSC_VER
-# define S_IXUSR _S_IEXEC
-# define stat _stat
-# ifndef _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#endif
-
+/* path handling portability macros */
 #ifndef DIR_SEPARATOR
 # define DIR_SEPARATOR '/'
 # define PATH_SEPARATOR ':'
@@ -3230,10 +4259,6 @@ int setenv (const char *, const char *, int);
 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
 #endif /* PATH_SEPARATOR_2 */
 
-#ifdef __CYGWIN__
-# define FOPEN_WB "wb"
-#endif
-
 #ifndef FOPEN_WB
 # define FOPEN_WB "w"
 #endif
@@ -3246,22 +4271,13 @@ int setenv (const char *, const char *, int);
   if (stale) { free ((void *) stale); stale = 0; } \
 } while (0)
 
-#undef LTWRAPPER_DEBUGPRINTF
-#if defined DEBUGWRAPPER
-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
-static void
-ltwrapper_debugprintf (const char *fmt, ...)
-{
-    va_list args;
-    va_start (args, fmt);
-    (void) vfprintf (stderr, fmt, args);
-    va_end (args);
-}
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
 #else
-# define LTWRAPPER_DEBUGPRINTF(args)
+static int lt_debug = 0;
 #endif
 
-const char *program_name = NULL;
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
 
 void *xmalloc (size_t num);
 char *xstrdup (const char *string);
@@ -3271,41 +4287,27 @@ char *chase_symlinks (const char *pathspec);
 int make_executable (const char *path);
 int check_executable (const char *path);
 char *strendzap (char *str, const char *pat);
-void lt_fatal (const char *message, ...);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
 void lt_setenv (const char *name, const char *value);
 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_opt_process_env_set (const char *arg);
-void lt_opt_process_env_prepend (const char *arg);
-void lt_opt_process_env_append (const char *arg);
-int lt_split_name_value (const char *arg, char** name, char** value);
 void lt_update_exe_path (const char *name, const char *value);
 void lt_update_lib_path (const char *name, const char *value);
-
-static const char *script_text_part1 =
-EOF
-
-	    func_emit_wrapper_part1 yes |
-	        $SED -e 's/\([\\"]\)/\\\1/g' \
-	             -e 's/^/  "/' -e 's/$/\\n"/'
-	    echo ";"
-	    cat <<EOF
-
-static const char *script_text_part2 =
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
 EOF
-	    func_emit_wrapper_part2 yes |
-	        $SED -e 's/\([\\"]\)/\\\1/g' \
-	             -e 's/^/  "/' -e 's/$/\\n"/'
-	    echo ";"
 
 	    cat <<EOF
-const char * MAGIC_EXE = "$magic_exe";
+volatile const char * MAGIC_EXE = "$magic_exe";
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
 	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-              func_to_host_pathlist "$temp_rpath"
+              func_to_host_path "$temp_rpath"
 	      cat <<EOF
-const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
 EOF
 	    else
 	      cat <<"EOF"
@@ -3314,10 +4316,10 @@ EOF
 	    fi
 
 	    if test -n "$dllsearchpath"; then
-              func_to_host_pathlist "$dllsearchpath:"
+              func_to_host_path "$dllsearchpath:"
 	      cat <<EOF
 const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
 EOF
 	    else
 	      cat <<"EOF"
@@ -3340,24 +4342,10 @@ EOF
 	    cat <<"EOF"
 
 #define LTWRAPPER_OPTION_PREFIX         "--lt-"
-#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
 
-static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-
 static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-
-static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
-static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
-  /* argument is putenv-style "foo=bar", value of foo is set to bar */
-
-static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
-static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
-  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
-
-static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
-static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
-  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
 
 int
 main (int argc, char *argv[])
@@ -3374,10 +4362,13 @@ main (int argc, char *argv[])
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
-  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+  newargz = XMALLOC (char *, argc + 1);
 
-  /* very simple arg parsing; don't want to rely on getopt */
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
   for (i = 1; i < argc; i++)
     {
       if (strcmp (argv[i], dumpscript_opt) == 0)
@@ -3391,25 +4382,57 @@ EOF
 	      esac
 
 	    cat <<"EOF"
-	  printf ("%s", script_text_part1);
-	  printf ("%s", script_text_part2);
+	  lt_dump_script (stdout);
 	  return 0;
 	}
+      if (strcmp (argv[i], debug_opt) == 0)
+	{
+          lt_debug = 1;
+          continue;
+	}
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+		    "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
     }
+  newargz[++newargc] = NULL;
+
+EOF
+	    cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+	    cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
 
-  newargz = XMALLOC (char *, argc + 1);
   tmp_pathspec = find_executable (argv[0]);
   if (tmp_pathspec == NULL)
-    lt_fatal ("Couldn't find %s", argv[0]);
-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
-			  tmp_pathspec));
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+		  tmp_pathspec);
 
   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
-			  actual_cwrapper_path));
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+		  actual_cwrapper_path);
   XFREE (tmp_pathspec);
 
-  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
   strendzap (actual_cwrapper_path, actual_cwrapper_name);
 
   /* wrapper name transforms */
@@ -3427,8 +4450,9 @@ EOF
   target_name = tmp_pathspec;
   tmp_pathspec = 0;
 
-  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
-			  target_name));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(main) libtool target name: %s\n",
+		  target_name);
 EOF
 
 	    cat <<EOF
@@ -3478,80 +4502,19 @@ EOF
 
   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+     because on Windows, both *_VARNAMEs are PATH but uninstalled
+     libraries must come first. */
   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
 
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
-        {
-          if (argv[i][env_set_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_set_opt_len + 1;
-              lt_opt_process_env_set (p);
-            }
-          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_set (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_set_opt);
-          continue;
-        }
-      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
-        {
-          if (argv[i][env_prepend_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_prepend_opt_len + 1;
-              lt_opt_process_env_prepend (p);
-            }
-          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_prepend_opt);
-          continue;
-        }
-      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
-        {
-          if (argv[i][env_append_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_append_opt_len + 1;
-              lt_opt_process_env_append (p);
-            }
-          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_append (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_append_opt);
-          continue;
-        }
-      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal ("Unrecognized option in %s namespace: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+		  nonnull (lt_argv_zero));
   for (i = 0; i < newargc; i++)
     {
-      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+		      i, nonnull (newargz[i]));
     }
 
 EOF
@@ -3560,11 +4523,14 @@ EOF
 	      mingw*)
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
   rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
-      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+      lt_debugprintf (__FILE__, __LINE__,
+		      "(main) failed to launch target \"%s\": %s\n",
+		      lt_argv_zero, nonnull (strerror (errno)));
       return 127;
     }
   return rval;
@@ -3586,7 +4552,7 @@ xmalloc (size_t num)
 {
   void *p = (void *) malloc (num);
   if (!p)
-    lt_fatal ("Memory exhausted");
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
 
   return p;
 }
@@ -3620,8 +4586,8 @@ check_executable (const char *path)
 {
   struct stat st;
 
-  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
   if ((!path) || (!*path))
     return 0;
 
@@ -3638,8 +4604,8 @@ make_executable (const char *path)
   int rval = 0;
   struct stat st;
 
-  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
   if ((!path) || (!*path))
     return 0;
 
@@ -3665,8 +4631,8 @@ find_executable (const char *wrapper)
   int tmp_len;
   char *concat_name;
 
-  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
-			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
 
   if ((wrapper == NULL) || (*wrapper == '\0'))
     return NULL;
@@ -3719,7 +4685,8 @@ find_executable (const char *wrapper)
 		{
 		  /* empty path: current directory */
 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal ("getcwd failed");
+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
 		  tmp_len = strlen (tmp);
 		  concat_name =
 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
@@ -3744,7 +4711,8 @@ find_executable (const char *wrapper)
     }
   /* Relative path | not found in path: prepend cwd */
   if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal ("getcwd failed");
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
   tmp_len = strlen (tmp);
   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
   memcpy (concat_name, tmp, tmp_len);
@@ -3770,8 +4738,9 @@ chase_symlinks (const char *pathspec)
   int has_symlinks = 0;
   while (strlen (tmp_pathspec) && !has_symlinks)
     {
-      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
-			      tmp_pathspec));
+      lt_debugprintf (__FILE__, __LINE__,
+		      "checking path component for symlinks: %s\n",
+		      tmp_pathspec);
       if (lstat (tmp_pathspec, &s) == 0)
 	{
 	  if (S_ISLNK (s.st_mode) != 0)
@@ -3793,8 +4762,9 @@ chase_symlinks (const char *pathspec)
 	}
       else
 	{
-	  char *errstr = strerror (errno);
-	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+	  lt_fatal (__FILE__, __LINE__,
+		    "error accessing file \"%s\": %s",
+		    tmp_pathspec, nonnull (strerror (errno)));
 	}
     }
   XFREE (tmp_pathspec);
@@ -3807,7 +4777,8 @@ chase_symlinks (const char *pathspec)
   tmp_pathspec = realpath (pathspec, buf);
   if (tmp_pathspec == 0)
     {
-      lt_fatal ("Could not follow symlinks for %s", pathspec);
+      lt_fatal (__FILE__, __LINE__,
+		"could not follow symlinks for %s", pathspec);
     }
   return xstrdup (tmp_pathspec);
 #endif
@@ -3833,11 +4804,25 @@ strendzap (char *str, const char *pat)
   return str;
 }
 
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
 static void
-lt_error_core (int exit_status, const char *mode,
+lt_error_core (int exit_status, const char *file,
+	       int line, const char *mode,
 	       const char *message, va_list ap)
 {
-  fprintf (stderr, "%s: %s: ", program_name, mode);
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
   vfprintf (stderr, message, ap);
   fprintf (stderr, ".\n");
 
@@ -3846,20 +4831,32 @@ lt_error_core (int exit_status, const char *mode,
 }
 
 void
-lt_fatal (const char *message, ...)
+lt_fatal (const char *file, int line, const char *message, ...)
 {
   va_list ap;
   va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
   va_end (ap);
 }
 
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
 void
 lt_setenv (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
   {
 #ifdef HAVE_SETENV
     /* always make a copy, for consistency with !HAVE_SETENV */
@@ -3904,95 +4901,12 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
   return new_value;
 }
 
-int
-lt_split_name_value (const char *arg, char** name, char** value)
-{
-  const char *p;
-  int len;
-  if (!arg || !*arg)
-    return 1;
-
-  p = strchr (arg, (int)'=');
-
-  if (!p)
-    return 1;
-
-  *value = xstrdup (++p);
-
-  len = strlen (arg) - strlen (*value);
-  *name = XMALLOC (char, len);
-  strncpy (*name, arg, len-1);
-  (*name)[len - 1] = '\0';
-
-  return 0;
-}
-
-void
-lt_opt_process_env_set (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
-    }
-
-  lt_setenv (name, value);
-  XFREE (name);
-  XFREE (value);
-}
-
-void
-lt_opt_process_env_prepend (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-  char *new_value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
-    }
-
-  new_value = lt_extend_str (getenv (name), value, 0);
-  lt_setenv (name, new_value);
-  XFREE (new_value);
-  XFREE (name);
-  XFREE (value);
-}
-
-void
-lt_opt_process_env_append (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-  char *new_value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
-    }
-
-  new_value = lt_extend_str (getenv (name), value, 1);
-  lt_setenv (name, new_value);
-  XFREE (new_value);
-  XFREE (name);
-  XFREE (value);
-}
-
 void
 lt_update_exe_path (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
 
   if (name && *name && value && *value)
     {
@@ -4011,9 +4925,9 @@ lt_update_exe_path (const char *name, const char *value)
 void
 lt_update_lib_path (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
 
   if (name && *name && value && *value)
     {
@@ -4023,11 +4937,158 @@ lt_update_lib_path (const char *name, const char *value)
     }
 }
 
+EOF
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+	new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+	{
+	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+	  size_t length;
+	  unsigned int backslashes;
+	  const char *s;
+	  char *quoted_string;
+	  char *p;
+
+	  length = 0;
+	  backslashes = 0;
+	  if (quote_around)
+	    length++;
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		length += backslashes + 1;
+	      length++;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    length += backslashes + 1;
+
+	  quoted_string = XMALLOC (char, length + 1);
+
+	  p = quoted_string;
+	  backslashes = 0;
+	  if (quote_around)
+	    *p++ = '"';
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		{
+		  unsigned int j;
+		  for (j = backslashes + 1; j > 0; j--)
+		    *p++ = '\\';
+		}
+	      *p++ = c;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    {
+	      unsigned int j;
+	      for (j = backslashes; j > 0; j--)
+		*p++ = '\\';
+	      *p++ = '"';
+	    }
+	  *p = '\0';
+
+	  new_argv[i] = quoted_string;
+	}
+      else
+	new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+		;;
+	    esac
 
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+	    func_emit_wrapper yes |
+	      $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
 EOF
 }
 # end: func_emit_cwrapperexe_src
 
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $opt_debug
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
 # func_mode_link arg...
 func_mode_link ()
 {
@@ -4072,6 +5133,7 @@ func_mode_link ()
     new_inherited_linker_flags=
 
     avoid_version=no
+    bindir=
     dlfiles=
     dlprefiles=
     dlself=no
@@ -4164,6 +5226,11 @@ func_mode_link ()
 	esac
 
 	case $prev in
+	bindir)
+	  bindir="$arg"
+	  prev=
+	  continue
+	  ;;
 	dlfiles|dlprefiles)
 	  if test "$preload" = no; then
 	    # Add the symbol object into the linking commands.
@@ -4195,9 +5262,9 @@ func_mode_link ()
 	    ;;
 	  *)
 	    if test "$prev" = dlfiles; then
-	      dlfiles="$dlfiles $arg"
+	      func_append dlfiles " $arg"
 	    else
-	      dlprefiles="$dlprefiles $arg"
+	      func_append dlprefiles " $arg"
 	    fi
 	    prev=
 	    continue
@@ -4221,7 +5288,7 @@ func_mode_link ()
 	    *-*-darwin*)
 	      case "$deplibs " in
 		*" $qarg.ltframework "*) ;;
-		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		*) func_append deplibs " $qarg.ltframework" # this is fixed later
 		   ;;
 	      esac
 	      ;;
@@ -4240,7 +5307,7 @@ func_mode_link ()
 	    moreargs=
 	    for fil in `cat "$save_arg"`
 	    do
-#	      moreargs="$moreargs $fil"
+#	      func_append moreargs " $fil"
 	      arg=$fil
 	      # A libtool-controlled object.
 
@@ -4269,7 +5336,7 @@ func_mode_link ()
 
 		  if test "$prev" = dlfiles; then
 		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      dlfiles="$dlfiles $pic_object"
+		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
 		    else
@@ -4281,7 +5348,7 @@ func_mode_link ()
 		  # CHECK ME:  I think I busted this.  -Ossama
 		  if test "$prev" = dlprefiles; then
 		    # Preload the old-style object.
-		    dlprefiles="$dlprefiles $pic_object"
+		    func_append dlprefiles " $pic_object"
 		    prev=
 		  fi
 
@@ -4351,12 +5418,12 @@ func_mode_link ()
 	  if test "$prev" = rpath; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
-	    *) rpath="$rpath $arg" ;;
+	    *) func_append rpath " $arg" ;;
 	    esac
 	  else
 	    case "$xrpath " in
 	    *" $arg "*) ;;
-	    *) xrpath="$xrpath $arg" ;;
+	    *) func_append xrpath " $arg" ;;
 	    esac
 	  fi
 	  prev=
@@ -4368,28 +5435,28 @@ func_mode_link ()
 	  continue
 	  ;;
 	weak)
-	  weak_libs="$weak_libs $arg"
+	  func_append weak_libs " $arg"
 	  prev=
 	  continue
 	  ;;
 	xcclinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $qarg"
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $qarg"
 	  prev=
 	  func_append compile_command " $qarg"
 	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
 	xcompiler)
-	  compiler_flags="$compiler_flags $qarg"
+	  func_append compiler_flags " $qarg"
 	  prev=
 	  func_append compile_command " $qarg"
 	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
 	xlinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $wl$qarg"
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $wl$qarg"
 	  prev=
 	  func_append compile_command " $wl$qarg"
 	  func_append finalize_command " $wl$qarg"
@@ -4425,6 +5492,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -bindir)
+	prev=bindir
+	continue
+	;;
+
       -dlopen)
 	prev=dlfiles
 	continue
@@ -4475,15 +5547,16 @@ func_mode_link ()
 	;;
 
       -L*)
-	func_stripname '-L' '' "$arg"
-	dir=$func_stripname_result
-	if test -z "$dir"; then
+	func_stripname "-L" '' "$arg"
+	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
 	    func_fatal_error "require no space between \`-L' and \`$1'"
 	  else
 	    func_fatal_error "need path for \`-L' option"
 	  fi
 	fi
+	func_resolve_sysroot "$func_stripname_result"
+	dir=$func_resolve_sysroot_result
 	# We need an absolute path.
 	case $dir in
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -4495,24 +5568,30 @@ func_mode_link ()
 	  ;;
 	esac
 	case "$deplibs " in
-	*" -L$dir "*) ;;
+	*" -L$dir "* | *" $arg "*)
+	  # Will only happen for absolute or sysroot arguments
+	  ;;
 	*)
-	  deplibs="$deplibs -L$dir"
-	  lib_search_path="$lib_search_path $dir"
+	  # Preserve sysroot, but never include relative directories
+	  case $dir in
+	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+	    *) func_append deplibs " -L$dir" ;;
+	  esac
+	  func_append lib_search_path " $dir"
 	  ;;
 	esac
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$dir:"*) ;;
 	  ::) dllsearchpath=$dir;;
-	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  *) func_append dllsearchpath ":$dir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
 	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  *) func_append dllsearchpath ":$testbindir";;
 	  esac
 	  ;;
 	esac
@@ -4522,7 +5601,7 @@ func_mode_link ()
       -l*)
 	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
 	    continue
 	    ;;
@@ -4536,7 +5615,7 @@ func_mode_link ()
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
-	    deplibs="$deplibs System.ltframework"
+	    func_append deplibs " System.ltframework"
 	    continue
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
@@ -4556,7 +5635,7 @@ func_mode_link ()
 	   ;;
 	 esac
 	fi
-	deplibs="$deplibs $arg"
+	func_append deplibs " $arg"
 	continue
 	;;
 
@@ -4568,21 +5647,22 @@ func_mode_link ()
       # Tru64 UNIX uses -model [arg] to determine the layout of C++
       # classes, name mangling, and exception handling.
       # Darwin uses the -arch flag to determine output architecture.
-      -model|-arch|-isysroot)
-	compiler_flags="$compiler_flags $arg"
+      -model|-arch|-isysroot|--sysroot)
+	func_append compiler_flags " $arg"
 	func_append compile_command " $arg"
 	func_append finalize_command " $arg"
 	prev=xcompiler
 	continue
 	;;
 
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
-	compiler_flags="$compiler_flags $arg"
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	func_append compiler_flags " $arg"
 	func_append compile_command " $arg"
 	func_append finalize_command " $arg"
 	case "$new_inherited_linker_flags " in
 	    *" $arg "*) ;;
-	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+	    * ) func_append new_inherited_linker_flags " $arg" ;;
 	esac
 	continue
 	;;
@@ -4649,13 +5729,17 @@ func_mode_link ()
 	# We need an absolute path.
 	case $dir in
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	=*)
+	  func_stripname '=' '' "$dir"
+	  dir=$lt_sysroot$func_stripname_result
+	  ;;
 	*)
 	  func_fatal_error "only absolute run-paths are allowed"
 	  ;;
 	esac
 	case "$xrpath " in
 	*" $dir "*) ;;
-	*) xrpath="$xrpath $dir" ;;
+	*) func_append xrpath " $dir" ;;
 	esac
 	continue
 	;;
@@ -4708,8 +5792,8 @@ func_mode_link ()
 	for flag in $args; do
 	  IFS="$save_ifs"
           func_quote_for_eval "$flag"
-	  arg="$arg $wl$func_quote_for_eval_result"
-	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
+	  func_append arg " $func_quote_for_eval_result"
+	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
 	IFS="$save_ifs"
 	func_stripname ' ' '' "$arg"
@@ -4724,9 +5808,9 @@ func_mode_link ()
 	for flag in $args; do
 	  IFS="$save_ifs"
           func_quote_for_eval "$flag"
-	  arg="$arg $wl$func_quote_for_eval_result"
-	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
-	  linker_flags="$linker_flags $func_quote_for_eval_result"
+	  func_append arg " $wl$func_quote_for_eval_result"
+	  func_append compiler_flags " $wl$func_quote_for_eval_result"
+	  func_append linker_flags " $func_quote_for_eval_result"
 	done
 	IFS="$save_ifs"
 	func_stripname ' ' '' "$arg"
@@ -4754,23 +5838,27 @@ func_mode_link ()
 	arg="$func_quote_for_eval_result"
 	;;
 
-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
-      # +DA*, +DD* enable 64-bit mode on the HP compiler
-      # -q* pass through compiler args for the IBM compiler
-      # -m*, -t[45]*, -txscale* pass through architecture-specific
-      # compiler args for GCC
-      # -F/path gives path to uninstalled frameworks, gcc on darwin
-      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
-      # @file GCC response files
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
         func_quote_for_eval "$arg"
 	arg="$func_quote_for_eval_result"
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
-        compiler_flags="$compiler_flags $arg"
+        func_append compiler_flags " $arg"
         continue
         ;;
 
@@ -4782,7 +5870,7 @@ func_mode_link ()
 
       *.$objext)
 	# A standard object.
-	objs="$objs $arg"
+	func_append objs " $arg"
 	;;
 
       *.lo)
@@ -4813,7 +5901,7 @@ func_mode_link ()
 
 	    if test "$prev" = dlfiles; then
 	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		dlfiles="$dlfiles $pic_object"
+		func_append dlfiles " $pic_object"
 		prev=
 		continue
 	      else
@@ -4825,7 +5913,7 @@ func_mode_link ()
 	    # CHECK ME:  I think I busted this.  -Ossama
 	    if test "$prev" = dlprefiles; then
 	      # Preload the old-style object.
-	      dlprefiles="$dlprefiles $pic_object"
+	      func_append dlprefiles " $pic_object"
 	      prev=
 	    fi
 
@@ -4870,24 +5958,25 @@ func_mode_link ()
 
       *.$libext)
 	# An archive.
-	deplibs="$deplibs $arg"
-	old_deplibs="$old_deplibs $arg"
+	func_append deplibs " $arg"
+	func_append old_deplibs " $arg"
 	continue
 	;;
 
       *.la)
 	# A libtool-controlled library.
 
+	func_resolve_sysroot "$arg"
 	if test "$prev" = dlfiles; then
 	  # This library was specified with -dlopen.
-	  dlfiles="$dlfiles $arg"
+	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
 	elif test "$prev" = dlprefiles; then
 	  # The library was specified with -dlpreopen.
-	  dlprefiles="$dlprefiles $arg"
+	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
 	else
-	  deplibs="$deplibs $arg"
+	  func_append deplibs " $func_resolve_sysroot_result"
 	fi
 	continue
 	;;
@@ -4925,7 +6014,7 @@ func_mode_link ()
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
@@ -4934,6 +6023,8 @@ func_mode_link ()
 
     func_dirname "$output" "/" ""
     output_objdir="$func_dirname_result$objdir"
+    func_to_tool_file "$output_objdir/"
+    tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
     func_mkdir_p "$output_objdir"
 
@@ -4954,12 +6045,12 @@ func_mode_link ()
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_duplicate_deps ; then
+      if $opt_preserve_dup_deps ; then
 	case "$libs " in
-	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
       fi
-      libs="$libs $deplib"
+      func_append libs " $deplib"
     done
 
     if test "$linkmode" = lib; then
@@ -4972,9 +6063,9 @@ func_mode_link ()
       if $opt_duplicate_compiler_generated_deps; then
 	for pre_post_dep in $predeps $postdeps; do
 	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
 	  esac
-	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	  func_append pre_post_deps " $pre_post_dep"
 	done
       fi
       pre_post_deps=
@@ -5044,17 +6135,19 @@ func_mode_link ()
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
 	  dependency_libs=
+	  func_resolve_sysroot "$lib"
 	  case $lib in
-	  *.la)	func_source "$lib" ;;
+	  *.la)	func_source "$func_resolve_sysroot_result" ;;
 	  esac
 
 	  # Collect preopened libtool deplibs, except any this library
 	  # has declared as weak libs
 	  for deplib in $dependency_libs; do
-            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+	    func_basename "$deplib"
+            deplib_base=$func_basename_result
 	    case " $weak_libs " in
 	    *" $deplib_base "*) ;;
-	    *) deplibs="$deplibs $deplib" ;;
+	    *) func_append deplibs " $deplib" ;;
 	    esac
 	  done
 	done
@@ -5070,16 +6163,17 @@ func_mode_link ()
 	lib=
 	found=no
 	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
 	  if test "$linkmode,$pass" = "prog,link"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
-	    compiler_flags="$compiler_flags $deplib"
+	    func_append compiler_flags " $deplib"
 	    if test "$linkmode" = lib ; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
 		esac
 	    fi
 	  fi
@@ -5164,7 +6258,7 @@ func_mode_link ()
 	    if test "$linkmode" = lib ; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
 		esac
 	    fi
 	  fi
@@ -5177,7 +6271,8 @@ func_mode_link ()
 	    test "$pass" = conv && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
-	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
 	    if test "$pass" = conv; then
@@ -5191,7 +6286,8 @@ func_mode_link ()
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    fi
 	    func_stripname '-L' '' "$deplib"
-	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
 	    func_warning "\`-L' is ignored for archives/objects"
@@ -5202,17 +6298,21 @@ func_mode_link ()
 	-R*)
 	  if test "$pass" = link; then
 	    func_stripname '-R' '' "$deplib"
-	    dir=$func_stripname_result
+	    func_resolve_sysroot "$func_stripname_result"
+	    dir=$func_resolve_sysroot_result
 	    # Make sure the xrpath contains only unique directories.
 	    case "$xrpath " in
 	    *" $dir "*) ;;
-	    *) xrpath="$xrpath $dir" ;;
+	    *) func_append xrpath " $dir" ;;
 	    esac
 	  fi
 	  deplibs="$deplib $deplibs"
 	  continue
 	  ;;
-	*.la) lib="$deplib" ;;
+	*.la)
+	  func_resolve_sysroot "$deplib"
+	  lib=$func_resolve_sysroot_result
+	  ;;
 	*.$libext)
 	  if test "$pass" = conv; then
 	    deplibs="$deplib $deplibs"
@@ -5230,7 +6330,7 @@ func_mode_link ()
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
 		    valid_a_lib=yes
 		  fi
@@ -5240,15 +6340,15 @@ func_mode_link ()
 		;;
 	      esac
 	      if test "$valid_a_lib" != yes; then
-		$ECHO
+		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
-		$ECHO "*** that it is just a static archive that I should not use here."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because the file extensions .$libext of this argument makes me believe"
+		echo "*** that it is just a static archive that I should not use here."
 	      else
-		$ECHO
+		echo
 		$ECHO "*** Warning: Linking the shared library $output against the"
 		$ECHO "*** static library $deplib is not portable!"
 		deplibs="$deplib $deplibs"
@@ -5275,11 +6375,11 @@ func_mode_link ()
 	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
-	      newdlprefiles="$newdlprefiles $deplib"
+	      func_append newdlprefiles " $deplib"
 	      compile_deplibs="$deplib $compile_deplibs"
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    else
-	      newdlfiles="$newdlfiles $deplib"
+	      func_append newdlfiles " $deplib"
 	    fi
 	  fi
 	  continue
@@ -5321,20 +6421,20 @@ func_mode_link ()
 
 	# Convert "-framework foo" to "foo.ltframework"
 	if test -n "$inherited_linker_flags"; then
-	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
 	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
 	    case " $new_inherited_linker_flags " in
 	      *" $tmp_inherited_linker_flag "*) ;;
-	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
 	    esac
 	  done
 	fi
-	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	if test "$linkmode,$pass" = "lib,link" ||
 	   test "$linkmode,$pass" = "prog,scan" ||
 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
-	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	  test -n "$dlopen" && func_append dlfiles " $dlopen"
+	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
 	if test "$pass" = conv; then
@@ -5345,17 +6445,17 @@ func_mode_link ()
 	      func_fatal_error "cannot find name of link library for \`$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
-	    convenience="$convenience $ladir/$objdir/$old_library"
-	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	    func_append convenience " $ladir/$objdir/$old_library"
+	    func_append old_convenience " $ladir/$objdir/$old_library"
 	    tmp_libs=
 	    for deplib in $dependency_libs; do
 	      deplibs="$deplib $deplibs"
-	      if $opt_duplicate_deps ; then
+	      if $opt_preserve_dup_deps ; then
 		case "$tmp_libs " in
-		*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+		*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 		esac
 	      fi
-	      tmp_libs="$tmp_libs $deplib"
+	      func_append tmp_libs " $deplib"
 	    done
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
 	    func_fatal_error "\`$lib' is not a convenience library"
@@ -5366,9 +6466,15 @@ func_mode_link ()
 
 	# Get the name of the library we link against.
 	linklib=
-	for l in $old_library $library_names; do
-	  linklib="$l"
-	done
+	if test -n "$old_library" &&
+	   { test "$prefer_static_libs" = yes ||
+	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	  linklib=$old_library
+	else
+	  for l in $old_library $library_names; do
+	    linklib="$l"
+	  done
+	fi
 	if test -z "$linklib"; then
 	  func_fatal_error "cannot find name of link library for \`$lib'"
 	fi
@@ -5385,9 +6491,9 @@ func_mode_link ()
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
 	    # bomb out in the load deplibs phase.
-	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	    func_append dlprefiles " $lib $dependency_libs"
 	  else
-	    newdlfiles="$newdlfiles $lib"
+	    func_append newdlfiles " $lib"
 	  fi
 	  continue
 	fi # $pass = dlopen
@@ -5409,14 +6515,14 @@ func_mode_link ()
 
 	# Find the relevant object directory and library name.
 	if test "X$installed" = Xyes; then
-	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 	    func_warning "library \`$lib' was moved."
 	    dir="$ladir"
 	    absdir="$abs_ladir"
 	    libdir="$abs_ladir"
 	  else
-	    dir="$libdir"
-	    absdir="$libdir"
+	    dir="$lt_sysroot$libdir"
+	    absdir="$lt_sysroot$libdir"
 	  fi
 	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
 	else
@@ -5424,12 +6530,12 @@ func_mode_link ()
 	    dir="$ladir"
 	    absdir="$abs_ladir"
 	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
+	    func_append notinst_path " $abs_ladir"
 	  else
 	    dir="$ladir/$objdir"
 	    absdir="$abs_ladir/$objdir"
 	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
+	    func_append notinst_path " $abs_ladir"
 	  fi
 	fi # $installed = yes
 	func_stripname 'lib' '.la' "$laname"
@@ -5440,20 +6546,46 @@ func_mode_link ()
 	  if test -z "$libdir" && test "$linkmode" = prog; then
 	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
 	  fi
-	  # Prefer using a static library (so that no silly _DYNAMIC symbols
-	  # are required to link).
-	  if test -n "$old_library"; then
-	    newdlprefiles="$newdlprefiles $dir/$old_library"
-	    # Keep a list of preopened convenience libraries to check
-	    # that they are being used correctly in the link pass.
-	    test -z "$libdir" && \
-		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
-	  # Otherwise, use the dlname, so that lt_dlopen finds it.
-	  elif test -n "$dlname"; then
-	    newdlprefiles="$newdlprefiles $dir/$dlname"
-	  else
-	    newdlprefiles="$newdlprefiles $dir/$linklib"
-	  fi
+	  case "$host" in
+	    # special handling for platforms with PE-DLLs.
+	    *cygwin* | *mingw* | *cegcc* )
+	      # Linker will automatically link against shared library if both
+	      # static and shared are present.  Therefore, ensure we extract
+	      # symbols from the import library if a shared library is present
+	      # (otherwise, the dlopen module name will be incorrect).  We do
+	      # this by putting the import library name into $newdlprefiles.
+	      # We recover the dlopen module name by 'saving' the la file
+	      # name in a special purpose variable, and (later) extracting the
+	      # dlname from the la file.
+	      if test -n "$dlname"; then
+	        func_tr_sh "$dir/$linklib"
+	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+	        func_append newdlprefiles " $dir/$linklib"
+	      else
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      fi
+	    ;;
+	    * )
+	      # Prefer using a static library (so that no silly _DYNAMIC symbols
+	      # are required to link).
+	      if test -n "$old_library"; then
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      # Otherwise, use the dlname, so that lt_dlopen finds it.
+	      elif test -n "$dlname"; then
+	        func_append newdlprefiles " $dir/$dlname"
+	      else
+	        func_append newdlprefiles " $dir/$linklib"
+	      fi
+	    ;;
+	  esac
 	fi # $pass = dlpreopen
 
 	if test -z "$libdir"; then
@@ -5471,7 +6603,7 @@ func_mode_link ()
 
 
 	if test "$linkmode" = prog && test "$pass" != link; then
-	  newlib_search_path="$newlib_search_path $ladir"
+	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
 	  linkalldeplibs=no
@@ -5484,7 +6616,8 @@ func_mode_link ()
 	  for deplib in $dependency_libs; do
 	    case $deplib in
 	    -L*) func_stripname '-L' '' "$deplib"
-	         newlib_search_path="$newlib_search_path $func_stripname_result"
+	         func_resolve_sysroot "$func_stripname_result"
+	         func_append newlib_search_path " $func_resolve_sysroot_result"
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
@@ -5495,12 +6628,12 @@ func_mode_link ()
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_duplicate_deps ; then
+	    if $opt_preserve_dup_deps ; then
 	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
 	    fi
-	    tmp_libs="$tmp_libs $deplib"
+	    func_append tmp_libs " $deplib"
 	  done # for deplib
 	  continue
 	fi # $linkmode = prog...
@@ -5515,7 +6648,7 @@ func_mode_link ()
 	      # Make sure the rpath contains only unique directories.
 	      case "$temp_rpath:" in
 	      *"$absdir:"*) ;;
-	      *) temp_rpath="$temp_rpath$absdir:" ;;
+	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
 	    fi
 
@@ -5527,7 +6660,7 @@ func_mode_link ()
 	    *)
 	      case "$compile_rpath " in
 	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
+	      *) func_append compile_rpath " $absdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -5536,7 +6669,7 @@ func_mode_link ()
 	    *)
 	      case "$finalize_rpath " in
 	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
+	      *) func_append finalize_rpath " $libdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -5561,12 +6694,12 @@ func_mode_link ()
 	  case $host in
 	  *cygwin* | *mingw* | *cegcc*)
 	      # No point in relinking DLLs because paths are not encoded
-	      notinst_deplibs="$notinst_deplibs $lib"
+	      func_append notinst_deplibs " $lib"
 	      need_relink=no
 	    ;;
 	  *)
 	    if test "$installed" = no; then
-	      notinst_deplibs="$notinst_deplibs $lib"
+	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
 	    ;;
@@ -5583,7 +6716,7 @@ func_mode_link ()
 	    fi
 	  done
 	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
-	    $ECHO
+	    echo
 	    if test "$linkmode" = prog; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
@@ -5601,7 +6734,7 @@ func_mode_link ()
 	    *)
 	      case "$compile_rpath " in
 	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
+	      *) func_append compile_rpath " $absdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -5610,7 +6743,7 @@ func_mode_link ()
 	    *)
 	      case "$finalize_rpath " in
 	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
+	      *) func_append finalize_rpath " $libdir" ;;
 	      esac
 	      ;;
 	    esac
@@ -5664,7 +6797,7 @@ func_mode_link ()
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$linkmode" = prog || test "$mode" != relink; then
+	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
@@ -5686,9 +6819,9 @@ func_mode_link ()
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
 			if test -z "$old_library" ; then
-			  $ECHO
-			  $ECHO "*** And there doesn't seem to be a static archive available"
-			  $ECHO "*** The link will probably fail, sorry"
+			  echo
+			  echo "*** And there doesn't seem to be a static archive available"
+			  echo "*** The link will probably fail, sorry"
 			else
 			  add="$dir/$old_library"
 			fi
@@ -5715,12 +6848,12 @@ func_mode_link ()
 	         test "$hardcode_direct_absolute" = no; then
 		add="$dir/$linklib"
 	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$dir"
+		add_dir="-L$absdir"
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
 		    [\\/]*)
-		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      func_append add_dir " -L$inst_prefix_dir$libdir"
 		      ;;
 		  esac
 		fi
@@ -5742,7 +6875,7 @@ func_mode_link ()
 	    if test -n "$add_shlibpath"; then
 	      case :$compile_shlibpath: in
 	      *":$add_shlibpath:"*) ;;
-	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
 	    if test "$linkmode" = prog; then
@@ -5756,13 +6889,13 @@ func_mode_link ()
 		 test "$hardcode_shlibpath_var" = yes; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
-		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		*) func_append finalize_shlibpath "$libdir:" ;;
 		esac
 	      fi
 	    fi
 	  fi
 
-	  if test "$linkmode" = prog || test "$mode" = relink; then
+	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
@@ -5776,7 +6909,7 @@ func_mode_link ()
 	    elif test "$hardcode_shlibpath_var" = yes; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
-	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
 	      add="-l$name"
 	    elif test "$hardcode_automatic" = yes; then
@@ -5793,7 +6926,7 @@ func_mode_link ()
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
 		  [\\/]*)
-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    func_append add_dir " -L$inst_prefix_dir$libdir"
 		    ;;
 		esac
 	      fi
@@ -5828,21 +6961,21 @@ func_mode_link ()
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
-	    $ECHO
+	    echo
 	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
-	    $ECHO "*** I have the capability to make that library automatically link in when"
-	    $ECHO "*** you link to this library.  But I can only do this if you have a"
-	    $ECHO "*** shared version of the library, which you do not appear to have."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
 	    if test "$module" = yes; then
-	      $ECHO "*** But as you try to build a module library, libtool will still create "
-	      $ECHO "*** a static module, that should work as long as the dlopening application"
-	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      echo "*** But as you try to build a module library, libtool will still create "
+	      echo "*** a static module, that should work as long as the dlopening application"
+	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
-		$ECHO
-		$ECHO "*** However, this would only work if libtool was able to extract symbol"
-		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		$ECHO "*** not find such a program.  So, this module is probably useless."
-		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+		echo
+		echo "*** However, this would only work if libtool was able to extract symbol"
+		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** not find such a program.  So, this module is probably useless."
+		echo "*** \`nm' from GNU binutils and a full rebuild may help."
 	      fi
 	      if test "$build_old_libs" = no; then
 		build_libtool_libs=module
@@ -5870,27 +7003,33 @@ func_mode_link ()
 	           temp_xrpath=$func_stripname_result
 		   case " $xrpath " in
 		   *" $temp_xrpath "*) ;;
-		   *) xrpath="$xrpath $temp_xrpath";;
+		   *) func_append xrpath " $temp_xrpath";;
 		   esac;;
-	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
 	    dependency_libs="$temp_deplibs"
 	  fi
 
-	  newlib_search_path="$newlib_search_path $absdir"
+	  func_append newlib_search_path " $absdir"
 	  # Link against this library
 	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    newdependency_libs="$deplib $newdependency_libs"
-	    if $opt_duplicate_deps ; then
+	    case $deplib in
+              -L*) func_stripname '-L' '' "$deplib"
+                   func_resolve_sysroot "$func_stripname_result";;
+              *) func_resolve_sysroot "$deplib" ;;
+            esac
+	    if $opt_preserve_dup_deps ; then
 	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      *" $func_resolve_sysroot_result "*)
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
 	      esac
 	    fi
-	    tmp_libs="$tmp_libs $deplib"
+	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
 	  if test "$link_all_deplibs" != no; then
@@ -5900,8 +7039,10 @@ func_mode_link ()
 	      case $deplib in
 	      -L*) path="$deplib" ;;
 	      *.la)
+	        func_resolve_sysroot "$deplib"
+	        deplib=$func_resolve_sysroot_result
 	        func_dirname "$deplib" "" "."
-		dir="$func_dirname_result"
+		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
@@ -5928,8 +7069,8 @@ func_mode_link ()
                       if test -z "$darwin_install_name"; then
                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
 		      path=
 		    fi
 		  fi
@@ -5962,7 +7103,7 @@ func_mode_link ()
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
-	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
       dependency_libs="$newdependency_libs"
@@ -5979,7 +7120,7 @@ func_mode_link ()
 	  for dir in $newlib_search_path; do
 	    case "$lib_search_path " in
 	    *" $dir "*) ;;
-	    *) lib_search_path="$lib_search_path $dir" ;;
+	    *) func_append lib_search_path " $dir" ;;
 	    esac
 	  done
 	  newlib_search_path=
@@ -6037,10 +7178,10 @@ func_mode_link ()
 	    -L*)
 	      case " $tmp_libs " in
 	      *" $deplib "*) ;;
-	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      *) func_append tmp_libs " $deplib" ;;
 	      esac
 	      ;;
-	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    *) func_append tmp_libs " $deplib" ;;
 	    esac
 	  done
 	  eval $var=\"$tmp_libs\"
@@ -6056,7 +7197,7 @@ func_mode_link ()
 	  ;;
 	esac
 	if test -n "$i" ; then
-	  tmp_libs="$tmp_libs $i"
+	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
@@ -6097,7 +7238,7 @@ func_mode_link ()
       # Now set the variables for building old libraries.
       build_libtool_libs=no
       oldlibs="$output"
-      objs="$objs$old_deplibs"
+      func_append objs "$old_deplibs"
       ;;
 
     lib)
@@ -6130,10 +7271,10 @@ func_mode_link ()
 	if test "$deplibs_check_method" != pass_all; then
 	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
 	else
-	  $ECHO
+	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
 	  $ECHO "*** objects $objs is not portable!"
-	  libobjs="$libobjs $objs"
+	  func_append libobjs " $objs"
 	fi
       fi
 
@@ -6192,13 +7333,14 @@ func_mode_link ()
 	  # which has an extra 1 added just for fun
 	  #
 	  case $version_type in
+	  # correct linux to gnu/linux during the next big refactor
 	  darwin|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
 	    age="$number_minor"
 	    revision="$number_revision"
 	    ;;
-	  freebsd-aout|freebsd-elf|sunos)
+	  freebsd-aout|freebsd-elf|qnx|sunos)
 	    current="$number_major"
 	    revision="$number_minor"
 	    age="0"
@@ -6311,7 +7453,7 @@ func_mode_link ()
 	  versuffix="$major.$revision"
 	  ;;
 
-	linux)
+	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
 	  versuffix="$major.$age.$revision"
@@ -6334,7 +7476,7 @@ func_mode_link ()
 	  done
 
 	  # Make executables depend on our current version.
-	  verstring="$verstring:${current}.0"
+	  func_append verstring ":${current}.0"
 	  ;;
 
 	qnx)
@@ -6402,10 +7544,10 @@ func_mode_link ()
       fi
 
       func_generate_dlsyms "$libname" "$libname" "yes"
-      libobjs="$libobjs $symfileobj"
+      func_append libobjs " $symfileobj"
       test "X$libobjs" = "X " && libobjs=
 
-      if test "$mode" != relink; then
+      if test "$opt_mode" != relink; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -6421,7 +7563,7 @@ func_mode_link ()
 		   continue
 		 fi
 	       fi
-	       removelist="$removelist $p"
+	       func_append removelist " $p"
 	       ;;
 	    *) ;;
 	  esac
@@ -6432,27 +7574,28 @@ func_mode_link ()
 
       # Now set the variables for building old libraries.
       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
       #for path in $notinst_path; do
-      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
-      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
-      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
       #done
 
       if test -n "$xrpath"; then
 	# If the user specified any rpath flags, then add them.
 	temp_xrpath=
 	for libdir in $xrpath; do
-	  temp_xrpath="$temp_xrpath -R$libdir"
+	  func_replace_sysroot "$libdir"
+	  func_append temp_xrpath " -R$func_replace_sysroot_result"
 	  case "$finalize_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
 	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
@@ -6466,7 +7609,7 @@ func_mode_link ()
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
 	*" $lib "*) ;;
-	*) dlfiles="$dlfiles $lib" ;;
+	*) func_append dlfiles " $lib" ;;
 	esac
       done
 
@@ -6476,19 +7619,19 @@ func_mode_link ()
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
 	*" $lib "*) ;;
-	*) dlprefiles="$dlprefiles $lib" ;;
+	*) func_append dlprefiles " $lib" ;;
 	esac
       done
 
       if test "$build_libtool_libs" = yes; then
 	if test -n "$rpath"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # these systems don't actually have a c library (as such)!
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C library is in the System framework
-	    deplibs="$deplibs System.ltframework"
+	    func_append deplibs " System.ltframework"
 	    ;;
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
@@ -6505,7 +7648,7 @@ func_mode_link ()
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
 	    if test "$build_libtool_need_lc" = "yes"; then
-	      deplibs="$deplibs -lc"
+	      func_append deplibs " -lc"
 	    fi
 	    ;;
 	  esac
@@ -6554,7 +7697,7 @@ EOF
 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
-		    newdeplibs="$newdeplibs $i"
+		    func_append newdeplibs " $i"
 		    i=""
 		    ;;
 		  esac
@@ -6565,21 +7708,21 @@ EOF
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		    newdeplibs="$newdeplibs $i"
+		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
-		    $ECHO
+		    echo
 		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		    $ECHO "*** I have the capability to make that library automatically link in when"
-		    $ECHO "*** you link to this library.  But I can only do this if you have a"
-		    $ECHO "*** shared version of the library, which I believe you do not have"
-		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
-		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which I believe you do not have"
+		    echo "*** because a test_compile did reveal that the linker did not use it for"
+		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
 		  fi
 		fi
 		;;
 	      *)
-		newdeplibs="$newdeplibs $i"
+		func_append newdeplibs " $i"
 		;;
 	      esac
 	    done
@@ -6597,7 +7740,7 @@ EOF
 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
-		      newdeplibs="$newdeplibs $i"
+		      func_append newdeplibs " $i"
 		      i=""
 		      ;;
 		    esac
@@ -6608,29 +7751,29 @@ EOF
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		      newdeplibs="$newdeplibs $i"
+		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
-		      $ECHO
+		      echo
 		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		      $ECHO "*** I have the capability to make that library automatically link in when"
-		      $ECHO "*** you link to this library.  But I can only do this if you have a"
-		      $ECHO "*** shared version of the library, which you do not appear to have"
-		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
-		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+		      echo "*** I have the capability to make that library automatically link in when"
+		      echo "*** you link to this library.  But I can only do this if you have a"
+		      echo "*** shared version of the library, which you do not appear to have"
+		      echo "*** because a test_compile did reveal that the linker did not use this one"
+		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
 		    fi
 		  fi
 		else
 		  droppeddeps=yes
-		  $ECHO
+		  echo
 		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
-		  $ECHO "*** make it link in!  You will probably need to install it or some"
-		  $ECHO "*** library that it depends on before this library will be fully"
-		  $ECHO "*** functional.  Installing it before continuing would be even better."
+		  echo "*** make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
 		fi
 		;;
 	      *)
-		newdeplibs="$newdeplibs $i"
+		func_append newdeplibs " $i"
 		;;
 	      esac
 	    done
@@ -6647,15 +7790,27 @@ EOF
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
+		  func_append newdeplibs " $a_deplib"
 		  a_deplib=""
 		  ;;
 		esac
 	      fi
 	      if test -n "$a_deplib" ; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
+		if test -n "$file_magic_glob"; then
+		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+		else
+		  libnameglob=$libname
+		fi
+		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  if test "$want_nocaseglob" = yes; then
+		    shopt -s nocaseglob
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		    $nocaseglob
+		  else
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		  fi
 		  for potent_lib in $potential_libs; do
 		      # Follow soft links.
 		      if ls -lLd "$potent_lib" 2>/dev/null |
@@ -6672,13 +7827,13 @@ EOF
 			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
 			case $potliblink in
 			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
-			newdeplibs="$newdeplibs $a_deplib"
+			func_append newdeplibs " $a_deplib"
 			a_deplib=""
 			break 2
 		      fi
@@ -6687,12 +7842,12 @@ EOF
 	      fi
 	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
-		$ECHO
+		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because I did check the linker path looking for a file starting"
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
 		if test -z "$potlib" ; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
@@ -6703,7 +7858,7 @@ EOF
 	      ;;
 	    *)
 	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
+	      func_append newdeplibs " $a_deplib"
 	      ;;
 	    esac
 	  done # Gone through all deplibs.
@@ -6719,7 +7874,7 @@ EOF
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
+		  func_append newdeplibs " $a_deplib"
 		  a_deplib=""
 		  ;;
 		esac
@@ -6730,9 +7885,9 @@ EOF
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
 		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      newdeplibs="$newdeplibs $a_deplib"
+		      func_append newdeplibs " $a_deplib"
 		      a_deplib=""
 		      break 2
 		    fi
@@ -6741,12 +7896,12 @@ EOF
 	      fi
 	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
-		$ECHO
+		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because I did check the linker path looking for a file starting"
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
 		if test -z "$potlib" ; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
@@ -6757,32 +7912,32 @@ EOF
 	      ;;
 	    *)
 	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
+	      func_append newdeplibs " $a_deplib"
 	      ;;
 	    esac
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
 	  newdeplibs=""
-	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
-	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
 	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 	    for i in $predeps $postdeps ; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
 	    done
 	  fi
-	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
-	     $GREP . >/dev/null; then
-	    $ECHO
+	  case $tmp_deplibs in
+	  *[!\	\ ]*)
+	    echo
 	    if test "X$deplibs_check_method" = "Xnone"; then
-	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
-	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
 	    fi
-	    $ECHO "*** All declared inter-library dependencies are being dropped."
+	    echo "*** All declared inter-library dependencies are being dropped."
 	    droppeddeps=yes
-	  fi
+	    ;;
+	  esac
 	  ;;
 	esac
 	versuffix=$versuffix_save
@@ -6794,23 +7949,23 @@ EOF
 	case $host in
 	*-*-rhapsody* | *-*-darwin1.[012])
 	  # On Rhapsody replace the C library with the System framework
-	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
 	  ;;
 	esac
 
 	if test "$droppeddeps" = yes; then
 	  if test "$module" = yes; then
-	    $ECHO
-	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
-	    $ECHO "*** a static module, that should work as long as the dlopening"
-	    $ECHO "*** application is linked with the -dlopen flag."
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
 	    if test -z "$global_symbol_pipe"; then
-	      $ECHO
-	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
-	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      $ECHO "*** not find such a program.  So, this module is probably useless."
-	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
 	    fi
 	    if test "$build_old_libs" = no; then
 	      oldlibs="$output_objdir/$libname.$libext"
@@ -6820,16 +7975,16 @@ EOF
 	      build_libtool_libs=no
 	    fi
 	  else
-	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
-	    $ECHO "*** automatically added whenever a program is linked with this library"
-	    $ECHO "*** or is declared to -dlopen it."
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
 
 	    if test "$allow_undefined" = no; then
-	      $ECHO
-	      $ECHO "*** Since this library must not contain undefined symbols,"
-	      $ECHO "*** because either the platform does not support them or"
-	      $ECHO "*** it was explicitly requested with -no-undefined,"
-	      $ECHO "*** libtool will only create a static version of it."
+	      echo
+	      echo "*** Since this library must not contain undefined symbols,"
+	      echo "*** because either the platform does not support them or"
+	      echo "*** it was explicitly requested with -no-undefined,"
+	      echo "*** libtool will only create a static version of it."
 	      if test "$build_old_libs" = no; then
 		oldlibs="$output_objdir/$libname.$libext"
 		build_libtool_libs=module
@@ -6846,9 +8001,9 @@ EOF
       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
       case $host in
 	*-*-darwin*)
-	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	  ;;
       esac
 
@@ -6861,7 +8016,7 @@ EOF
 	*)
 	  case " $deplibs " in
 	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
+	    func_append new_libs " -L$path/$objdir" ;;
 	  esac
 	  ;;
 	esac
@@ -6871,10 +8026,10 @@ EOF
 	-L*)
 	  case " $new_libs " in
 	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
+	  *) func_append new_libs " $deplib" ;;
 	  esac
 	  ;;
-	*) new_libs="$new_libs $deplib" ;;
+	*) func_append new_libs " $deplib" ;;
 	esac
       done
       deplibs="$new_libs"
@@ -6886,15 +8041,22 @@ EOF
 
       # Test again, we may have decided not to build it any more
       if test "$build_libtool_libs" = yes; then
+	# Remove ${wl} instances when linking with ld.
+	# FIXME: should test the right _cmds variable.
+	case $archive_cmds in
+	  *\$LD\ *) wl= ;;
+        esac
 	if test "$hardcode_into_libs" = yes; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
 	  rpath="$finalize_rpath"
-	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
+		func_replace_sysroot "$libdir"
+		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
 		  hardcode_libdirs="$libdir"
 		else
@@ -6903,18 +8065,18 @@ EOF
 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		    ;;
 		  *)
-		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		    ;;
 		  esac
 		fi
 	      else
 		eval flag=\"$hardcode_libdir_flag_spec\"
-		dep_rpath="$dep_rpath $flag"
+		func_append dep_rpath " $flag"
 	      fi
 	    elif test -n "$runpath_var"; then
 	      case "$perm_rpath " in
 	      *" $libdir "*) ;;
-	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      *) func_append perm_rpath " $libdir" ;;
 	      esac
 	    fi
 	  done
@@ -6922,17 +8084,13 @@ EOF
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
 	    libdir="$hardcode_libdirs"
-	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-	    else
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
-	    fi
+	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
 	    # We should set the runpath_var.
 	    rpath=
 	    for dir in $perm_rpath; do
-	      rpath="$rpath$dir:"
+	      func_append rpath "$dir:"
 	    done
 	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
 	  fi
@@ -6940,7 +8098,7 @@ EOF
 	fi
 
 	shlibpath="$finalize_shlibpath"
-	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -6966,18 +8124,18 @@ EOF
 	linknames=
 	for link
 	do
-	  linknames="$linknames $link"
+	  func_append linknames " $link"
 	done
 
 	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	test "X$libobjs" = "X " && libobjs=
 
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
 	  export_symbols="$output_objdir/$libname.uexp"
-	  delfiles="$delfiles $export_symbols"
+	  func_append delfiles " $export_symbols"
 	fi
 
 	orig_export_symbols=
@@ -7008,13 +8166,45 @@ EOF
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
 	    save_ifs="$IFS"; IFS='~'
-	    for cmd in $cmds; do
+	    for cmd1 in $cmds; do
 	      IFS="$save_ifs"
-	      eval cmd=\"$cmd\"
-	      func_len " $cmd"
-	      len=$func_len_result
-	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	      # Take the normal branch if the nm_file_list_spec branch
+	      # doesn't work or if tool conversion is not needed.
+	      case $nm_file_list_spec~$to_tool_file_cmd in
+		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+		  try_normal_branch=yes
+		  eval cmd=\"$cmd1\"
+		  func_len " $cmd"
+		  len=$func_len_result
+		  ;;
+		*)
+		  try_normal_branch=no
+		  ;;
+	      esac
+	      if test "$try_normal_branch" = yes \
+		 && { test "$len" -lt "$max_cmd_len" \
+		      || test "$max_cmd_len" -le -1; }
+	      then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      elif test -n "$nm_file_list_spec"; then
+		func_basename "$output"
+		output_la=$func_basename_result
+		save_libobjs=$libobjs
+		save_output=$output
+		output=${output_objdir}/${output_la}.nm
+		func_to_tool_file "$output"
+		libobjs=$nm_file_list_spec$func_to_tool_file_result
+		func_append delfiles " $output"
+		func_verbose "creating $NM input file list: $output"
+		for obj in $save_libobjs; do
+		  func_to_tool_file "$obj"
+		  $ECHO "$func_to_tool_file_result"
+		done > "$output"
+		eval cmd=\"$cmd1\"
 		func_show_eval "$cmd" 'exit $?'
+		output=$save_output
+		libobjs=$save_libobjs
 		skipped_export=false
 	      else
 		# The command line is too long to execute in one step.
@@ -7036,7 +8226,7 @@ EOF
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  tmp_export_symbols="$export_symbols"
 	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
 	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
@@ -7048,7 +8238,7 @@ EOF
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
 	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 	  export_symbols=$output_objdir/$libname.def
 	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	fi
@@ -7058,7 +8248,7 @@ EOF
 	  case " $convenience " in
 	  *" $test_deplib "*) ;;
 	  *)
-	    tmp_deplibs="$tmp_deplibs $test_deplib"
+	    func_append tmp_deplibs " $test_deplib"
 	    ;;
 	  esac
 	done
@@ -7078,21 +8268,21 @@ EOF
 	    test "X$libobjs" = "X " && libobjs=
 	  else
 	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
+	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
-	    libobjs="$libobjs $func_extract_archives_result"
+	    func_append libobjs " $func_extract_archives_result"
 	    test "X$libobjs" = "X " && libobjs=
 	  fi
 	fi
 
 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
-	  linker_flags="$linker_flags $flag"
+	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test "$mode" = relink; then
+	if test "$opt_mode" = relink; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
@@ -7137,7 +8327,8 @@ EOF
 	    save_libobjs=$libobjs
 	  fi
 	  save_output=$output
-	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+	  func_basename "$output"
+	  output_la=$func_basename_result
 
 	  # Clear the reloadable object creation command queue and
 	  # initialize k to one.
@@ -7150,13 +8341,16 @@ EOF
 	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
 	    output=${output_objdir}/${output_la}.lnkscript
 	    func_verbose "creating GNU ld script: $output"
-	    $ECHO 'INPUT (' > $output
+	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
 	    do
-	      $ECHO "$obj" >> $output
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
 	    done
-	    $ECHO ')' >> $output
-	    delfiles="$delfiles $output"
+	    echo ')' >> $output
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$func_to_tool_file_result
 	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
 	    output=${output_objdir}/${output_la}.lnk
 	    func_verbose "creating linker input file list: $output"
@@ -7170,10 +8364,12 @@ EOF
 	    fi
 	    for obj
 	    do
-	      $ECHO "$obj" >> $output
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
 	    done
-	    delfiles="$delfiles $output"
-	    output=$firstobj\"$file_list_spec$output\"
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
@@ -7197,17 +8393,19 @@ EOF
 		  # command to the queue.
 		  if test "$k" -eq 1 ; then
 		    # The first file doesn't have a previous command to add.
-		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+		    reload_objs=$objlist
+		    eval concat_cmds=\"$reload_cmds\"
 		  else
 		    # All subsequent reloadable object files will link in
 		    # the last one created.
-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+		    reload_objs="$objlist $last_robj"
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
 		  last_robj=$output_objdir/$output_la-${k}.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
 		  output=$output_objdir/$output_la-${k}.$objext
-		  objlist=$obj
+		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
 		  len=$func_arith_result
@@ -7217,11 +8415,12 @@ EOF
 	      # reloadable object file.  All subsequent reloadable object
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+	      reload_objs="$objlist $last_robj"
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
 	      if test -n "$last_robj"; then
 	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
 	      fi
-	      delfiles="$delfiles $output"
+	      func_append delfiles " $output"
 
 	    else
 	      output=
@@ -7255,7 +8454,7 @@ EOF
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test "$mode" = relink; then
+		if test "$opt_mode" = relink; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -7276,7 +8475,7 @@ EOF
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	      tmp_export_symbols="$export_symbols"
 	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
@@ -7288,7 +8487,7 @@ EOF
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
 	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
@@ -7329,10 +8528,10 @@ EOF
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
 	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
-	  libobjs="$libobjs $func_extract_archives_result"
+	  func_append libobjs " $func_extract_archives_result"
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
@@ -7348,7 +8547,7 @@ EOF
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test "$mode" = relink; then
+	    if test "$opt_mode" = relink; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -7360,7 +8559,7 @@ EOF
 	IFS="$save_ifs"
 
 	# Restore the uninstalled library and exit
-	if test "$mode" = relink; then
+	if test "$opt_mode" = relink; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -7441,18 +8640,21 @@ EOF
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
 	else
 	  gentop="$output_objdir/${obj}x"
-	  generated="$generated $gentop"
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
 	fi
       fi
 
+      # If we're not building shared, we need to use non_pic_objs
+      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
       output="$obj"
       func_execute_cmds "$reload_cmds" 'exit $?'
@@ -7512,8 +8714,8 @@ EOF
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
 	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
-	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
 	;;
       esac
 
@@ -7524,14 +8726,14 @@ EOF
 	if test "$tagname" = CXX ; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      compile_command="$compile_command ${wl}-bind_at_load"
-	      finalize_command="$finalize_command ${wl}-bind_at_load"
+	      func_append compile_command " ${wl}-bind_at_load"
+	      func_append finalize_command " ${wl}-bind_at_load"
 	    ;;
 	  esac
 	fi
 	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
-	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	;;
       esac
 
@@ -7545,7 +8747,7 @@ EOF
 	*)
 	  case " $compile_deplibs " in
 	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
+	    func_append new_libs " -L$path/$objdir" ;;
 	  esac
 	  ;;
 	esac
@@ -7555,17 +8757,17 @@ EOF
 	-L*)
 	  case " $new_libs " in
 	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
+	  *) func_append new_libs " $deplib" ;;
 	  esac
 	  ;;
-	*) new_libs="$new_libs $deplib" ;;
+	*) func_append new_libs " $deplib" ;;
 	esac
       done
       compile_deplibs="$new_libs"
 
 
-      compile_command="$compile_command $compile_deplibs"
-      finalize_command="$finalize_command $finalize_deplibs"
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
 
       if test -n "$rpath$xrpath"; then
 	# If the user specified any rpath flags, then add them.
@@ -7573,7 +8775,7 @@ EOF
 	  # This is the magic to use -rpath.
 	  case "$finalize_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
       fi
@@ -7592,18 +8794,18 @@ EOF
 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		;;
 	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		;;
 	      esac
 	    fi
 	  else
 	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
+	    func_append rpath " $flag"
 	  fi
 	elif test -n "$runpath_var"; then
 	  case "$perm_rpath " in
 	  *" $libdir "*) ;;
-	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  *) func_append perm_rpath " $libdir" ;;
 	  esac
 	fi
 	case $host in
@@ -7612,12 +8814,12 @@ EOF
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
-	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  *) func_append dllsearchpath ":$libdir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
 	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  *) func_append dllsearchpath ":$testbindir";;
 	  esac
 	  ;;
 	esac
@@ -7643,18 +8845,18 @@ EOF
 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 		;;
 	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 		;;
 	      esac
 	    fi
 	  else
 	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
+	    func_append rpath " $flag"
 	  fi
 	elif test -n "$runpath_var"; then
 	  case "$finalize_perm_rpath " in
 	  *" $libdir "*) ;;
-	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  *) func_append finalize_perm_rpath " $libdir" ;;
 	  esac
 	fi
       done
@@ -7668,8 +8870,8 @@ EOF
 
       if test -n "$libobjs" && test "$build_old_libs" = yes; then
 	# Transform all the library objects into standard objects.
-	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
       func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
@@ -7681,15 +8883,15 @@ EOF
 
       wrappers_required=yes
       case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
       *cygwin* | *mingw* )
         if test "$build_libtool_libs" != yes; then
           wrappers_required=no
         fi
         ;;
-      *cegcc)
-        # Disable wrappers for cegcc, we are cross compiling anyway.
-        wrappers_required=no
-        ;;
       *)
         if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
           wrappers_required=no
@@ -7698,13 +8900,19 @@ EOF
       esac
       if test "$wrappers_required" = no; then
 	# Replace the output file specification.
-	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	link_command="$compile_command$compile_rpath"
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
 	func_show_eval "$link_command" 'exit_status=$?'
 
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
 	# Delete the generated files.
 	if test -f "$output_objdir/${outputname}S.${objext}"; then
 	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
@@ -7727,7 +8935,7 @@ EOF
 	  # We should set the runpath_var.
 	  rpath=
 	  for dir in $perm_rpath; do
-	    rpath="$rpath$dir:"
+	    func_append rpath "$dir:"
 	  done
 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
 	fi
@@ -7735,7 +8943,7 @@ EOF
 	  # We should set the runpath_var.
 	  rpath=
 	  for dir in $finalize_perm_rpath; do
-	    rpath="$rpath$dir:"
+	    func_append rpath "$dir:"
 	  done
 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
 	fi
@@ -7745,11 +8953,18 @@ EOF
 	# We don't need to create a wrapper script.
 	link_command="$compile_var$compile_command$compile_rpath"
 	# Replace the output file specification.
-	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
 	$opt_dry_run || $RM $output
 	# Link the executable and exit
 	func_show_eval "$link_command" 'exit $?'
+
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
 	exit $EXIT_SUCCESS
       fi
 
@@ -7764,7 +8979,7 @@ EOF
 	if test "$fast_install" != no; then
 	  link_command="$finalize_var$compile_command$finalize_rpath"
 	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
 	  else
 	    # fast_install is set to needless
 	    relink_command=
@@ -7776,13 +8991,19 @@ EOF
       fi
 
       # Replace the output file specification.
-      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
       # Delete the old output files.
       $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
 
       func_show_eval "$link_command" 'exit $?'
 
+      if test -n "$postlink_cmds"; then
+	func_to_tool_file "$output_objdir/$outputname"
+	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
       # Now create the wrapper script.
       func_verbose "creating $output"
 
@@ -7800,18 +9021,7 @@ EOF
 	  fi
 	done
 	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
-      fi
-
-      # Quote $ECHO for shipping.
-      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
-	case $progpath in
-	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
-	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
-	esac
-	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
-      else
-	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
       fi
 
       # Only actually do things if not in dry run mode.
@@ -7891,7 +9101,7 @@ EOF
 	else
 	  oldobjs="$old_deplibs $non_pic_objects"
 	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    oldobjs="$oldobjs $symfileobj"
+	    func_append oldobjs " $symfileobj"
 	  fi
 	fi
 	addlibs="$old_convenience"
@@ -7899,10 +9109,10 @@ EOF
 
       if test -n "$addlibs"; then
 	gentop="$output_objdir/${outputname}x"
-	generated="$generated $gentop"
+	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
-	oldobjs="$oldobjs $func_extract_archives_result"
+	func_append oldobjs " $func_extract_archives_result"
       fi
 
       # Do each command in the archive commands.
@@ -7913,10 +9123,10 @@ EOF
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
 	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
+	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
-	  oldobjs="$oldobjs $func_extract_archives_result"
+	  func_append oldobjs " $func_extract_archives_result"
 	fi
 
 	# POSIX demands no paths to be encoded in archives.  We have
@@ -7932,9 +9142,9 @@ EOF
 	    done | sort | sort -uc >/dev/null 2>&1); then
 	  :
 	else
-	  $ECHO "copying selected object files to avoid basename conflicts..."
+	  echo "copying selected object files to avoid basename conflicts..."
 	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
+	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
 	  oldobjs=
@@ -7958,18 +9168,30 @@ EOF
 		esac
 	      done
 	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      oldobjs="$oldobjs $gentop/$newobj"
+	      func_append oldobjs " $gentop/$newobj"
 	      ;;
-	    *) oldobjs="$oldobjs $obj" ;;
+	    *) func_append oldobjs " $obj" ;;
 	    esac
 	  done
 	fi
+	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+	tool_oldlib=$func_to_tool_file_result
 	eval cmds=\"$old_archive_cmds\"
 
 	func_len " $cmds"
 	len=$func_len_result
 	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 	  cmds=$old_archive_cmds
+	elif test -n "$archiver_list_spec"; then
+	  func_verbose "using command file archive linking..."
+	  for obj in $oldobjs
+	  do
+	    func_to_tool_file "$obj"
+	    $ECHO "$func_to_tool_file_result"
+	  done > $output_objdir/$libname.libcmd
+	  func_to_tool_file "$output_objdir/$libname.libcmd"
+	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+	  cmds=$old_archive_cmds
 	else
 	  # the command line is too long to link in one step, link in parts
 	  func_verbose "using piecewise archive linking..."
@@ -8043,7 +9265,7 @@ EOF
       done
       # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
       if test "$hardcode_automatic" = yes ; then
 	relink_command=
       fi
@@ -8063,12 +9285,23 @@ EOF
 	      *.la)
 		func_basename "$deplib"
 		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		func_resolve_sysroot "$deplib"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
 		  func_fatal_error "\`$deplib' is not a valid libtool archive"
-		newdependency_libs="$newdependency_libs $libdir/$name"
+		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      -L*)
+		func_stripname -L '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -L$func_replace_sysroot_result"
 		;;
-	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      -R*)
+		func_stripname -R '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -R$func_replace_sysroot_result"
+		;;
+	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
 	    dependency_libs="$newdependency_libs"
@@ -8082,9 +9315,9 @@ EOF
 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
 		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlfiles="$newdlfiles $libdir/$name"
+		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
-	      *) newdlfiles="$newdlfiles $lib" ;;
+	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
 	    dlfiles="$newdlfiles"
@@ -8101,7 +9334,7 @@ EOF
 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
 		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlprefiles="$newdlprefiles $libdir/$name"
+		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
@@ -8113,7 +9346,7 @@ EOF
 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
-	      newdlfiles="$newdlfiles $abs"
+	      func_append newdlfiles " $abs"
 	    done
 	    dlfiles="$newdlfiles"
 	    newdlprefiles=
@@ -8122,15 +9355,33 @@ EOF
 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
-	      newdlprefiles="$newdlprefiles $abs"
+	      func_append newdlprefiles " $abs"
 	    done
 	    dlprefiles="$newdlprefiles"
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
+	  # In fact, it would be nice if we could use this code for all target
+	  # systems that can't hard-code library paths into their executables
+	  # and that have no shared library path variable independent of PATH,
+	  # but it turns out we can't easily determine that from inspecting
+	  # libtool variables, so we have to hard-code the OSs to which it
+	  # applies here; at the moment, that means platforms that use the PE
+	  # object format with DLL files.  See the long comment at the top of
+	  # tests/bindir.at for full details.
 	  tdlname=$dlname
 	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+	      # If a -bindir argument was supplied, place the dll there.
+	      if test "x$bindir" != x ;
+	      then
+		func_relative_path "$install_libdir" "$bindir"
+		tdlname=$func_relative_path_result$dlname
+	      else
+		# Otherwise fall back on heuristic.
+		tdlname=../bin/$dlname
+	      fi
+	      ;;
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
@@ -8189,7 +9440,7 @@ relink_command=\"$relink_command\""
     exit $EXIT_SUCCESS
 }
 
-{ test "$mode" = link || test "$mode" = relink; } &&
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
     func_mode_link ${1+"$@"}
 
 
@@ -8209,9 +9460,9 @@ func_mode_uninstall ()
     for arg
     do
       case $arg in
-      -f) RM="$RM $arg"; rmforce=yes ;;
-      -*) RM="$RM $arg" ;;
-      *) files="$files $arg" ;;
+      -f) func_append RM " $arg"; rmforce=yes ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
       esac
     done
 
@@ -8220,24 +9471,23 @@ func_mode_uninstall ()
 
     rmdirs=
 
-    origobjdir="$objdir"
     for file in $files; do
       func_dirname "$file" "" "."
       dir="$func_dirname_result"
       if test "X$dir" = X.; then
-	objdir="$origobjdir"
+	odir="$objdir"
       else
-	objdir="$dir/$origobjdir"
+	odir="$dir/$objdir"
       fi
       func_basename "$file"
       name="$func_basename_result"
-      test "$mode" = uninstall && objdir="$dir"
+      test "$opt_mode" = uninstall && odir="$dir"
 
-      # Remember objdir for removal later, being careful to avoid duplicates
-      if test "$mode" = clean; then
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test "$opt_mode" = clean; then
 	case " $rmdirs " in
-	  *" $objdir "*) ;;
-	  *) rmdirs="$rmdirs $objdir" ;;
+	  *" $odir "*) ;;
+	  *) func_append rmdirs " $odir" ;;
 	esac
       fi
 
@@ -8263,18 +9513,17 @@ func_mode_uninstall ()
 
 	  # Delete the libtool libraries and symlinks.
 	  for n in $library_names; do
-	    rmfiles="$rmfiles $objdir/$n"
+	    func_append rmfiles " $odir/$n"
 	  done
-	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$mode" in
+	  case "$opt_mode" in
 	  clean)
-	    case "  $library_names " in
-	    # "  " in the beginning catches empty $dlname
+	    case " $library_names " in
 	    *" $dlname "*) ;;
-	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
 	    esac
-	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
 	    ;;
 	  uninstall)
 	    if test -n "$library_names"; then
@@ -8302,19 +9551,19 @@ func_mode_uninstall ()
 	  # Add PIC object to the list of files to remove.
 	  if test -n "$pic_object" &&
 	     test "$pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$pic_object"
+	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
 	  if test -n "$non_pic_object" &&
 	     test "$non_pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$non_pic_object"
+	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$mode" = clean ; then
+	if test "$opt_mode" = clean ; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -8324,7 +9573,7 @@ func_mode_uninstall ()
 	    noexename=$func_stripname_result
 	    # $file with .exe has already been added to rmfiles,
 	    # add $file without .exe
-	    rmfiles="$rmfiles $file"
+	    func_append rmfiles " $file"
 	    ;;
 	  esac
 	  # Do a test to see if this is a libtool program.
@@ -8333,7 +9582,7 @@ func_mode_uninstall ()
 	      func_ltwrapper_scriptname "$file"
 	      relink_command=
 	      func_source $func_ltwrapper_scriptname_result
-	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+	      func_append rmfiles " $func_ltwrapper_scriptname_result"
 	    else
 	      relink_command=
 	      func_source $dir/$noexename
@@ -8341,12 +9590,12 @@ func_mode_uninstall ()
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
 	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      rmfiles="$rmfiles $objdir/lt-$name"
+	      func_append rmfiles " $odir/lt-$name"
 	    fi
 	    if test "X$noexename" != "X$name" ; then
-	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	      func_append rmfiles " $odir/lt-${noexename}.c"
 	    fi
 	  fi
 	fi
@@ -8354,7 +9603,6 @@ func_mode_uninstall ()
       esac
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
-    objdir="$origobjdir"
 
     # Try to remove the ${objdir}s in the directories where we deleted files
     for dir in $rmdirs; do
@@ -8366,16 +9614,16 @@ func_mode_uninstall ()
     exit $exit_status
 }
 
-{ test "$mode" = uninstall || test "$mode" = clean; } &&
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
     func_mode_uninstall ${1+"$@"}
 
-test -z "$mode" && {
+test -z "$opt_mode" && {
   help="$generic_help"
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$mode'"
+  func_fatal_help "invalid operation mode \`$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
diff --git a/config/mdate-sh b/config/mdate-sh
index e631b22..b3719cf 100755
--- a/config/mdate-sh
+++ b/config/mdate-sh
@@ -1,10 +1,9 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2010-08-21.06; # UTC
 
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009 Free
-# Software Foundation, Inc.
+# Copyright (C) 1995-2013 Free Software Foundation, Inc.
 # written by Ulrich Drepper <drepper at gnu.ai.mit.edu>, June 1995
 #
 # This program is free software; you can redistribute it and/or modify
@@ -29,16 +28,26 @@ scriptversion=2009-04-28.21; # UTC
 # bugs to <bug-automake at gnu.org> or send patches to
 # <automake-patches at gnu.org>.
 
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+fi
+
 case $1 in
   '')
-     echo "$0: No file.  Try \`$0 --help' for more information." 1>&2
+     echo "$0: No file.  Try '$0 --help' for more information." 1>&2
      exit 1;
      ;;
   -h | --h*)
     cat <<\EOF
 Usage: mdate-sh [--help] [--version] FILE
 
-Pretty-print the modification time of FILE.
+Pretty-print the modification day of FILE, in the format:
+1 January 1970
 
 Report bugs to <bug-automake at gnu.org>.
 EOF
@@ -50,6 +59,13 @@ EOF
     ;;
 esac
 
+error ()
+{
+  echo "$0: $1" >&2
+  exit 1
+}
+
+
 # Prevent date giving response in another language.
 LANG=C
 export LANG
@@ -59,7 +75,7 @@ LC_TIME=C
 export LC_TIME
 
 # GNU ls changes its time format in response to the TIME_STYLE
-# variable.  Since we cannot assume `unset' works, revert this
+# variable.  Since we cannot assume 'unset' works, revert this
 # variable to its documented default.
 if test "${TIME_STYLE+set}" = set; then
   TIME_STYLE=posix-long-iso
@@ -79,14 +95,14 @@ if ls -n /dev/null 1>/dev/null 2>&1; then
   ls_command="$ls_command -n"
 fi
 
-# A `ls -l' line looks as follows on OS/2.
+# A 'ls -l' line looks as follows on OS/2.
 #  drwxrwx---        0 Aug 11  2001 foo
 # This differs from Unix, which adds ownership information.
 #  drwxrwx---   2 root  root      4096 Aug 11  2001 foo
 #
 # To find the date, we split the line on spaces and iterate on words
 # until we find a month.  This cannot work with files whose owner is a
-# user named `Jan', or `Feb', etc.  However, it's unlikely that `/'
+# user named "Jan", or "Feb", etc.  However, it's unlikely that '/'
 # will be owned by a user whose name is a month.  So we first look at
 # the extended ls output of the root directory to decide how many
 # words should be skipped to get the date.
@@ -99,6 +115,7 @@ month=
 command=
 until test $month
 do
+  test $# -gt 0 || error "failed parsing '$ls_command /' output"
   shift
   # Add another shift to the command.
   command="$command shift;"
@@ -118,8 +135,10 @@ do
   esac
 done
 
+test -n "$month" || error "failed parsing '$ls_command /' output"
+
 # Get the extended ls output of the file or directory.
-set dummy x`eval "$ls_command \"\$save_arg1\""`
+set dummy x`eval "$ls_command \"\\\$save_arg1\""`
 
 # Remove all preceding arguments
 eval $command
diff --git a/config/missing b/config/missing
index 28055d2..cdea514 100755
--- a/config/missing
+++ b/config/missing
@@ -1,11 +1,10 @@
 #! /bin/sh
-# Common stub for a few missing GNU programs while installing.
+# Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2012-06-26.16; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # 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
@@ -26,69 +25,40 @@ scriptversion=2009-04-28.21; # UTC
 # the same distribution terms that you use for the rest of that program.
 
 if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
+  echo 1>&2 "Try '$0 --help' for more information"
   exit 1
 fi
 
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
+case $1 in
 
-msg="missing on your system"
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
 
-case $1 in
---run)
-  # Try to run requested program, and just exit if it succeeds.
-  run=
-  shift
-  "$@" && exit 0
-  # Exit code 63 means version mismatch.  This often happens
-  # when the user try to use an ancient version of a tool on
-  # a file that requires a minimum version.  In this case we
-  # we should proceed has if the program had been absent, or
-  # if --run hadn't been passed.
-  if test $? = 63; then
-    run=:
-    msg="probably too old"
-  fi
-  ;;
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
 
   -h|--h|--he|--hel|--help)
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
 
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
 
 Options:
   -h, --help      display this help and exit
   -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
 
 Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
 
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
 
 Send bug reports to <bug-automake at gnu.org>."
     exit $?
@@ -100,272 +70,141 @@ Send bug reports to <bug-automake at gnu.org>."
     ;;
 
   -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
     exit 1
     ;;
 
 esac
 
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
-
-# Now exit if we have it, but it failed.  Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
-    ;;
-
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
-  *)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
-       # $TOOL exists and not knowing $TOOL uses missing.
-       exit 1
-    fi
-    ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case $f in
-      *:*) touch_files="$touch_files "`echo "$f" |
-				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-	   sed 's/\.am$/.in/' |
-	   while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo "#! /bin/sh"
-	echo "# Created by GNU Automake missing as a replacement of"
-	echo "#  $ $@"
-	echo "exit 0"
-	chmod +x $file
-	exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
-         in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-	case $LASTARG in
-	*.y)
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.c
-	    fi
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.h
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f y.tab.h; then
-	echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-	echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
-         in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-	case $LASTARG in
-	*.l)
-	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" lex.yy.c
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f lex.yy.c; then
-	echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-	 you modified a dependency of a manual page.  You may need the
-	 \`Help2man' package in order for those modifications to take
-	 effect.  You can get \`Help2man' from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo ".ab help2man is required to generate this page"
-	exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-	/^@setfilename/{
-	  s/.* \([^ ]*\) *$/\1/
-	  p
-	  q
-	}' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
-
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
-  *)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
-         it often tells you about the needed prerequisites for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
-    exit 1
-    ;;
-esac
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
 
-exit 0
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'automa4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
+    ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/config/test-driver b/config/test-driver
new file mode 100755
index 0000000..32bf39e
--- /dev/null
+++ b/config/test-driver
@@ -0,0 +1,127 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2012-06-27.10; # UTC
+
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# 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, 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, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <<END
+Usage:
+  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+              [--expect-failure={yes|no}] [--color-tests={yes|no}]
+              [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+# TODO: better error handling in option parsing (in particular, ensure
+# TODO: $log_file, $trs_file and $test_name are defined).
+test_name= # Used for reporting.
+log_file=  # Where to save the output of the test script.
+trs_file=  # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+  case $1 in
+  --help) print_usage; exit $?;;
+  --version) echo "test-driver $scriptversion"; exit $?;;
+  --test-name) test_name=$2; shift;;
+  --log-file) log_file=$2; shift;;
+  --trs-file) trs_file=$2; shift;;
+  --color-tests) color_tests=$2; shift;;
+  --expect-failure) expect_failure=$2; shift;;
+  --enable-hard-errors) enable_hard_errors=$2; shift;;
+  --) shift; break;;
+  -*) usage_error "invalid option: '$1'";;
+  esac
+  shift
+done
+
+if test $color_tests = yes; then
+  # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+  red='' # Red.
+  grn='' # Green.
+  lgn='' # Light green.
+  blu='' # Blue.
+  mgn='' # Magenta.
+  std=''     # No color.
+else
+  red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  estatus=1
+fi
+
+case $estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config/texinfo.tex b/config/texinfo.tex
index 9140826..85f184c 100644
--- a/config/texinfo.tex
+++ b/config/texinfo.tex
@@ -3,11 +3,11 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2009-08-14.15}
+\def\texinfoversion{2013-02-01.11}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009 Free Software Foundation, Inc.
+% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
 %
 % This texinfo.tex file is free software: you can redistribute it and/or
 % modify it under the terms of the GNU General Public License as
@@ -24,13 +24,14 @@
 %
 % As a special exception, when this file is read by TeX when processing
 % a Texinfo source document, you may use the result without
-% restriction.  (This has been our intent since Texinfo was invented.)
+% restriction. This Exception is an additional permission under section 7
+% of the GNU General Public License, version 3 ("GPLv3").
 %
 % Please try the latest version of texinfo.tex before submitting bug
 % reports; you can get the latest version from:
-%   http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
-%   ftp://tug.org/tex/texinfo.tex
-%     (and all CTAN mirrors, see http://www.ctan.org).
+%   http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+%   http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+%   http://www.gnu.org/software/texinfo/ (the Texinfo home page)
 % The texinfo.tex in any given distribution could well be out
 % of date, so if that's what you're using, please check.
 %
@@ -65,7 +66,6 @@
 \everyjob{\message{[Texinfo version \texinfoversion]}%
   \catcode`+=\active \catcode`\_=\active}
 
-
 \chardef\other=12
 
 % We never want plain's \outer definition of \+ in Texinfo.
@@ -93,14 +93,13 @@
 \let\ptexnewwrite\newwrite
 \let\ptexnoindent=\noindent
 \let\ptexplus=+
+\let\ptexraggedright=\raggedright
 \let\ptexrbrace=\}
 \let\ptexslash=\/
 \let\ptexstar=\*
 \let\ptext=\t
 \let\ptextop=\top
-{\catcode`\'=\active
-\global\let\ptexquoteright'}% Math-mode def from plain.tex.
-\let\ptexraggedright=\raggedright
+{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
 
 % If this character appears in an error message or help string, it
 % starts a new line in the output.
@@ -118,10 +117,11 @@
 % Set up fixed words for English if not already set.
 \ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
 \ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
+\ifx\putworderror\undefined     \gdef\putworderror{error}\fi
 \ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
 \ifx\putwordin\undefined        \gdef\putwordin{in}\fi
-\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
-\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordIndexIsEmpty\undefined       \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined   \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
 \ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
 \ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
@@ -160,15 +160,18 @@
 \def\spaceisspace{\catcode`\ =\spacecat}
 
 % sometimes characters are active, so we need control sequences.
+\chardef\ampChar   = `\&
 \chardef\colonChar = `\:
 \chardef\commaChar = `\,
 \chardef\dashChar  = `\-
 \chardef\dotChar   = `\.
 \chardef\exclamChar= `\!
+\chardef\hashChar  = `\#
 \chardef\lquoteChar= `\`
 \chardef\questChar = `\?
 \chardef\rquoteChar= `\'
 \chardef\semiChar  = `\;
+\chardef\slashChar = `\/
 \chardef\underChar = `\_
 
 % Ignore a token.
@@ -199,36 +202,7 @@
 % that mark overfull boxes (in case you have decided
 % that the text looks ok even though it passes the margin).
 %
-\def\finalout{\overfullrule=0pt}
-
-% @| inserts a changebar to the left of the current line.  It should
-% surround any changed text.  This approach does *not* work if the
-% change spans more than two lines of output.  To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change).
-%
-\def\|{%
-  % \vadjust can only be used in horizontal mode.
-  \leavevmode
-  %
-  % Append this vertical mode material after the current line in the output.
-  \vadjust{%
-    % We want to insert a rule with the height and depth of the current
-    % leading; that is exactly what \strutbox is supposed to record.
-    \vskip-\baselineskip
-    %
-    % \vadjust-items are inserted at the left edge of the type.  So
-    % the \llap here moves out into the left-hand margin.
-    \llap{%
-      %
-      % For a thicker or thinner bar, change the `1pt'.
-      \vrule height\baselineskip width1pt
-      %
-      % This is the space between the bar and the text.
-      \hskip 12pt
-    }%
-  }%
-}
+\def\finalout{\overfullrule=0pt }
 
 % Sometimes it is convenient to have everything in the transcript file
 % and nothing on the terminal.  We don't just call \tracingall here,
@@ -246,7 +220,7 @@
   \tracingmacros2
   \tracingrestores1
   \showboxbreadth\maxdimen \showboxdepth\maxdimen
-  \ifx\eTeXversion\undefined\else % etex gives us more logging
+  \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
     \tracingscantokens1
     \tracingifs1
     \tracinggroups1
@@ -257,6 +231,13 @@
   \errorcontextlines16
 }%
 
+% @errormsg{MSG}.  Do the index-like expansions on MSG, but if things
+% aren't perfect, it's not the end of the world, being an error message,
+% after all.
+% 
+\def\errormsg{\begingroup \indexnofonts \doerrormsg}
+\def\doerrormsg#1{\errmessage{#1}}
+
 % add check for \lastpenalty to plain's definitions.  If the last thing
 % we did was a \nobreak, we don't want to insert more space.
 %
@@ -267,7 +248,6 @@
 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
   \removelastskip\penalty-200\bigskip\fi\fi}
 
-% For @cropmarks command.
 % Do @cropmarks to get crop marks.
 %
 \newif\ifcropmarks
@@ -577,7 +557,7 @@
 }
 \def\inenvironment#1{%
   \ifx#1\empty
-    out of any environment%
+    outside of any environment%
   \else
     in environment \expandafter\string#1%
   \fi
@@ -589,7 +569,7 @@
 \parseargdef\end{%
   \if 1\csname iscond.#1\endcsname
   \else
-    % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
+    % The general wording of \badenverr may not be ideal.
     \expandafter\checkenv\csname#1\endcsname
     \csname E#1\endcsname
     \endgroup
@@ -599,85 +579,6 @@
 \newhelp\EMsimple{Press RETURN to continue.}
 
 
-%% Simple single-character @ commands
-
-% @@ prints an @
-% Kludge this until the fonts are right (grr).
-\def\@{{\tt\char64}}
-
-% This is turned off because it was never documented
-% and you can use @w{...} around a quote to suppress ligatures.
-%% Define @` and @' to be the same as ` and '
-%% but suppressing ligatures.
-%\def\`{{`}}
-%\def\'{{'}}
-
-% Used to generate quoted braces.
-\def\mylbrace {{\tt\char123}}
-\def\myrbrace {{\tt\char125}}
-\let\{=\mylbrace
-\let\}=\myrbrace
-\begingroup
-  % Definitions to produce \{ and \} commands for indices,
-  % and @{ and @} for the aux/toc files.
-  \catcode`\{ = \other \catcode`\} = \other
-  \catcode`\[ = 1 \catcode`\] = 2
-  \catcode`\! = 0 \catcode`\\ = \other
-  !gdef!lbracecmd[\{]%
-  !gdef!rbracecmd[\}]%
-  !gdef!lbraceatcmd[@{]%
-  !gdef!rbraceatcmd[@}]%
-!endgroup
-
-% @comma{} to avoid , parsing problems.
-\let\comma = ,
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
-\let\, = \c
-\let\dotaccent = \.
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \t
-\let\ubaraccent = \b
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown @ordf @ordm
-% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
-\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
-  \def\temp{#1}%
-  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
-  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
-  \else \errmessage{@dotless can be used only with i or j}%
-  \fi\fi
-}
-
-% The \TeX{} logo, as in plain, but resetting the spacing so that a
-% period following counts as ending a sentence.  (Idea found in latex.)
-%
-\edef\TeX{\TeX \spacefactor=1000 }
-
-% @LaTeX{} logo.  Not quite the same results as the definition in
-% latex.ltx, since we use a different font for the raised A; it's most
-% convenient for us to use an explicitly smaller font, rather than using
-% the \scriptstyle font (since we don't reset \scriptstyle and
-% \scriptscriptstyle).
-%
-\def\LaTeX{%
-  L\kern-.36em
-  {\setbox0=\hbox{T}%
-   \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
-  \kern-.15em
-  \TeX
-}
-
 % Be sure we're in horizontal mode when doing a tie, since we make space
 % equivalent to this in @example-like environments. Otherwise, a space
 % at the beginning of a line will start with \penalty -- and
@@ -694,7 +595,7 @@
 \def\:{\spacefactor=1000 }
 
 % @* forces a line break.
-\def\*{\hfil\break\hbox{}\ignorespaces}
+\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
 
 % @/ allows a line break.
 \let\/=\allowbreak
@@ -719,7 +620,7 @@
   \else\ifx\temp\offword \plainnonfrenchspacing
   \else
     \errhelp = \EMsimple
-    \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
+    \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
   \fi\fi
 }
 
@@ -801,15 +702,6 @@ where each line of input produces a line of output.}
 
 \newdimen\mil  \mil=0.001in
 
-% Old definition--didn't work.
-%\parseargdef\need{\par %
-%% This method tries to make TeX break the page naturally
-%% if the depth of the box does not fit.
-%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
-%\prevdepth=-1000pt
-%}}
-
 \parseargdef\need{%
   % Ensure vertical mode, so we don't make a big box in the middle of a
   % paragraph.
@@ -873,7 +765,7 @@ where each line of input produces a line of output.}
 
 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
 % paragraph.  For more general purposes, use the \margin insertion
-% class.  WHICH is `l' or `r'.
+% class.  WHICH is `l' or `r'.  Not documented, written for gawk manual.
 %
 \newskip\inmarginspacing \inmarginspacing=1cm
 \def\strutdepth{\dp\strutbox}
@@ -920,6 +812,36 @@ where each line of input produces a line of output.}
   \temp
 }
 
+% @| inserts a changebar to the left of the current line.  It should
+% surround any changed text.  This approach does *not* work if the
+% change spans more than two lines of output.  To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).  This command
+% is not documented, not supported, and doesn't work.
+%
+\def\|{%
+  % \vadjust can only be used in horizontal mode.
+  \leavevmode
+  %
+  % Append this vertical mode material after the current line in the output.
+  \vadjust{%
+    % We want to insert a rule with the height and depth of the current
+    % leading; that is exactly what \strutbox is supposed to record.
+    \vskip-\baselineskip
+    %
+    % \vadjust-items are inserted at the left edge of the type.  So
+    % the \llap here moves out into the left-hand margin.
+    \llap{%
+      %
+      % For a thicker or thinner bar, change the `1pt'.
+      \vrule height\baselineskip width1pt
+      %
+      % This is the space between the bar and the text.
+      \hskip 12pt
+    }%
+  }%
+}
+
 % @include FILE -- \input text of FILE.
 %
 \def\include{\parseargusing\filenamecatcodes\includezzz}
@@ -930,6 +852,7 @@ where each line of input produces a line of output.}
     \makevalueexpandable  % we want to expand any @value in FILE.
     \turnoffactive        % and allow special characters in the expansion
     \indexnofonts         % Allow `@@' and other weird things in file names.
+    \wlog{texinfo.tex: doing @include of #1^^J}%
     \edef\temp{\noexpand\input #1 }%
     %
     % This trickery is to read FILE outside of a group, in case it makes
@@ -965,7 +888,7 @@ where each line of input produces a line of output.}
 \def\popthisfilestack{\errthisfilestackempty}
 \def\errthisfilestackempty{\errmessage{Internal error:
   the stack of filenames is empty.}}
-
+%
 \def\thisfile{}
 
 % @center line
@@ -973,36 +896,46 @@ where each line of input produces a line of output.}
 %
 \parseargdef\center{%
   \ifhmode
-    \let\next\centerH
+    \let\centersub\centerH
   \else
-    \let\next\centerV
+    \let\centersub\centerV
   \fi
-  \next{\hfil \ignorespaces#1\unskip \hfil}%
+  \centersub{\hfil \ignorespaces#1\unskip \hfil}%
+  \let\centersub\relax % don't let the definition persist, just in case
 }
-\def\centerH#1{%
-  {%
-    \hfil\break
-    \advance\hsize by -\leftskip
-    \advance\hsize by -\rightskip
-    \line{#1}%
-    \break
-  }%
+\def\centerH#1{{%
+  \hfil\break
+  \advance\hsize by -\leftskip
+  \advance\hsize by -\rightskip
+  \line{#1}%
+  \break
+}}
+%
+\newcount\centerpenalty
+\def\centerV#1{%
+  % The idea here is the same as in \startdefun, \cartouche, etc.: if
+  % @center is the first thing after a section heading, we need to wipe
+  % out the negative parskip inserted by \sectionheading, but still
+  % prevent a page break here.
+  \centerpenalty = \lastpenalty
+  \ifnum\centerpenalty>10000 \vskip\parskip \fi
+  \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
+  \line{\kern\leftskip #1\kern\rightskip}%
 }
-\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
 
 % @sp n   outputs n lines of vertical space
-
+%
 \parseargdef\sp{\vskip #1\baselineskip}
 
 % @comment ...line which is ignored...
 % @c is the same as @comment
 % @ignore ... @end ignore  is another way to write a comment
-
+%
 \def\comment{\begingroup \catcode`\^^M=\other%
 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
 \commentxxx}
 {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
-
+%
 \let\c=\comment
 
 % @paragraphindent NCHARS
@@ -1095,109 +1028,6 @@ where each line of input produces a line of output.}
 }
 
 
-% @asis just yields its argument.  Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math outputs its argument in math mode.
-%
-% One complication: _ usually means subscripts, but it could also mean
-% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
-% _ active, and distinguish by seeing if the current family is \slfam,
-% which is what @var uses.
-{
-  \catcode`\_ = \active
-  \gdef\mathunderscore{%
-    \catcode`\_=\active
-    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
-  }
-}
-% Another complication: we want \\ (and @\) to output a \ character.
-% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
-% this is not advertised and we don't care.  Texinfo does not
-% otherwise define @\.
-%
-% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
-\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
-%
-\def\math{%
-  \tex
-  \mathunderscore
-  \let\\ = \mathbackslash
-  \mathactive
-  % make the texinfo accent commands work in math mode
-  \let\"=\ddot
-  \let\'=\acute
-  \let\==\bar
-  \let\^=\hat
-  \let\`=\grave
-  \let\u=\breve
-  \let\v=\check
-  \let\~=\tilde
-  \let\dotaccent=\dot
-  $\finishmath
-}
-\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
-
-% Some active characters (such as <) are spaced differently in math.
-% We have to reset their definitions in case the @math was an argument
-% to a command which sets the catcodes (such as @item or @section).
-%
-{
-  \catcode`^ = \active
-  \catcode`< = \active
-  \catcode`> = \active
-  \catcode`+ = \active
-  \catcode`' = \active
-  \gdef\mathactive{%
-    \let^ = \ptexhat
-    \let< = \ptexless
-    \let> = \ptexgtr
-    \let+ = \ptexplus
-    \let' = \ptexquoteright
-  }
-}
-
-% Some math mode symbols.
-\def\bullet{$\ptexbullet$}
-\def\geq{\ifmmode \ge\else $\ge$\fi}
-\def\leq{\ifmmode \le\else $\le$\fi}
-\def\minus{\ifmmode -\else $-$\fi}
-
-% @dots{} outputs an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in the cm
-% typewriter fonts as three actual period characters; on the other hand,
-% in other typewriter fonts three periods are wider than 1.5em.  So do
-% whichever is larger.
-%
-\def\dots{%
-  \leavevmode
-  \setbox0=\hbox{...}% get width of three periods
-  \ifdim\wd0 > 1.5em
-    \dimen0 = \wd0
-  \else
-    \dimen0 = 1.5em
-  \fi
-  \hbox to \dimen0{%
-    \hskip 0pt plus.25fil
-    .\hskip 0pt plus1fil
-    .\hskip 0pt plus1fil
-    .\hskip 0pt plus.5fil
-  }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
-  \dots
-  \spacefactor=\endofsentencespacefactor
-}
-
-% @comma{} is so commas can be inserted into text without messing up
-% Texinfo's parsing.
-%
-\let\comma = ,
-
 % @refill is a no-op.
 \let\refill=\relax
 
@@ -1262,9 +1092,8 @@ where each line of input produces a line of output.}
 \newif\ifpdfmakepagedest
 
 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
-% can be set).  So we test for \relax and 0 as well as \undefined,
-% borrowed from ifpdf.sty.
-\ifx\pdfoutput\undefined
+% can be set).  So we test for \relax and 0 as well as being undefined.
+\ifx\pdfoutput\thisisundefined
 \else
   \ifx\pdfoutput\relax
   \else
@@ -1279,50 +1108,24 @@ where each line of input produces a line of output.}
 % for display in the outlines, and in other places.  Thus, we have to
 % double any backslashes.  Otherwise, a name like "\node" will be
 % interpreted as a newline (\n), followed by o, d, e.  Not good.
-% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
-% (and related messages, the final outcome is that it is up to the TeX
-% user to double the backslashes and otherwise make the string valid, so
-% that's what we do).
-
-% double active backslashes.
-%
-{\catcode`\@=0 \catcode`\\=\active
- @gdef at activebackslashdouble{%
-   @catcode`@\=@active
-   @let\=@doublebackslash}
-}
-
-% To handle parens, we must adopt a different approach, since parens are
-% not active characters.  hyperref.dtx (which has the same problem as
-% us) handles it with this amazing macro to replace tokens, with minor
-% changes for Texinfo.  It is included here under the GPL by permission
-% from the author, Heiko Oberdiek.
-%
-% #1 is the tokens to replace.
-% #2 is the replacement.
-% #3 is the control sequence with the string.
-%
-\def\HyPsdSubst#1#2#3{%
-  \def\HyPsdReplace##1#1##2\END{%
-    ##1%
-    \ifx\\##2\\%
-    \else
-      #2%
-      \HyReturnAfterFi{%
-        \HyPsdReplace##2\END
-      }%
-    \fi
-  }%
-  \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
-}
-\long\def\HyReturnAfterFi#1\fi{\fi#1}
-
-% #1 is a control sequence in which to do the replacements.
-\def\backslashparens#1{%
-  \xdef#1{#1}% redefine it as its expansion; the definition is simply
-             % \lastnode when called from \setref -> \pdfmkdest.
-  \HyPsdSubst{(}{\realbackslash(}{#1}%
-  \HyPsdSubst{)}{\realbackslash)}{#1}%
+% 
+% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
+% related messages.  The final outcome is that it is up to the TeX user
+% to double the backslashes and otherwise make the string valid, so
+% that's what we do.  pdftex 1.30.0 (ca.2005) introduced a primitive to
+% do this reliably, so we use it.
+
+% #1 is a control sequence in which to do the replacements,
+% which we \xdef.
+\def\txiescapepdf#1{%
+  \ifx\pdfescapestring\thisisundefined
+    % No primitive available; should we give a warning or log?
+    % Many times it won't matter.
+  \else
+    % The expandable \pdfescapestring primitive escapes parentheses,
+    % backslashes, and other special chars.
+    \xdef#1{\pdfescapestring{#1}}%
+  \fi
 }
 
 \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
@@ -1381,32 +1184,34 @@ output) for that.)}
   %
   % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
   \def\dopdfimage#1#2#3{%
-    \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
-    \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+    \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+    \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
     %
-    % pdftex (and the PDF format) support .png, .jpg, .pdf (among
-    % others).  Let's try in that order.
+    % pdftex (and the PDF format) support .pdf, .png, .jpg (among
+    % others).  Let's try in that order, PDF first since if
+    % someone has a scalable image, presumably better to use that than a
+    % bitmap.
     \let\pdfimgext=\empty
     \begingroup
-      \openin 1 #1.png \ifeof 1
-        \openin 1 #1.jpg \ifeof 1
-          \openin 1 #1.jpeg \ifeof 1
-            \openin 1 #1.JPG \ifeof 1
-              \openin 1 #1.pdf \ifeof 1
-                \openin 1 #1.PDF \ifeof 1
+      \openin 1 #1.pdf \ifeof 1
+        \openin 1 #1.PDF \ifeof 1
+          \openin 1 #1.png \ifeof 1
+            \openin 1 #1.jpg \ifeof 1
+              \openin 1 #1.jpeg \ifeof 1
+                \openin 1 #1.JPG \ifeof 1
                   \errhelp = \nopdfimagehelp
                   \errmessage{Could not find image file #1 for pdf}%
-                \else \gdef\pdfimgext{PDF}%
+                \else \gdef\pdfimgext{JPG}%
                 \fi
-              \else \gdef\pdfimgext{pdf}%
+              \else \gdef\pdfimgext{jpeg}%
               \fi
-            \else \gdef\pdfimgext{JPG}%
+            \else \gdef\pdfimgext{jpg}%
             \fi
-          \else \gdef\pdfimgext{jpeg}%
+          \else \gdef\pdfimgext{png}%
           \fi
-        \else \gdef\pdfimgext{jpg}%
+        \else \gdef\pdfimgext{PDF}%
         \fi
-      \else \gdef\pdfimgext{png}%
+      \else \gdef\pdfimgext{pdf}%
       \fi
       \closein 1
     \endgroup
@@ -1418,8 +1223,8 @@ output) for that.)}
     \else
       \immediate\pdfximage
     \fi
-      \ifdim \wd0 >0pt width \imagewidth \fi
-      \ifdim \wd2 >0pt height \imageheight \fi
+      \ifdim \wd0 >0pt width \pdfimagewidth \fi
+      \ifdim \wd2 >0pt height \pdfimageheight \fi
       \ifnum\pdftexversion<13
          #1.\pdfimgext
        \else
@@ -1434,10 +1239,9 @@ output) for that.)}
     % such as \, aren't expanded when present in a section title.
     \indexnofonts
     \turnoffactive
-    \activebackslashdouble
     \makevalueexpandable
     \def\pdfdestname{#1}%
-    \backslashparens\pdfdestname
+    \txiescapepdf\pdfdestname
     \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
   }}
   %
@@ -1469,29 +1273,24 @@ output) for that.)}
     % page number.  We could generate a destination for the section
     % text in the case where a section has no node, but it doesn't
     % seem worth the trouble, since most documents are normally structured.
-    \def\pdfoutlinedest{#3}%
+    \edef\pdfoutlinedest{#3}%
     \ifx\pdfoutlinedest\empty
       \def\pdfoutlinedest{#4}%
     \else
-      % Doubled backslashes in the name.
-      {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
-       \backslashparens\pdfoutlinedest}%
+      \txiescapepdf\pdfoutlinedest
     \fi
     %
-    % Also double the backslashes in the display string.
-    {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
-     \backslashparens\pdfoutlinetext}%
+    % Also escape PDF chars in the display string.
+    \edef\pdfoutlinetext{#1}%
+    \txiescapepdf\pdfoutlinetext
     %
     \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
   }
   %
   \def\pdfmakeoutlines{%
     \begingroup
-      % Thanh's hack / proper braces in bookmarks
-      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
-      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
-      %
       % Read toc silently, to get counts of subentries for \pdfoutline.
+      \def\partentry##1##2##3##4{}% ignore parts in the outlines
       \def\numchapentry##1##2##3##4{%
 	\def\thischapnum{##2}%
 	\def\thissecnum{0}%
@@ -1545,25 +1344,41 @@ output) for that.)}
       % Latin 2 (0xea) gets translated to a | character.  Info from
       % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
       %
-      % xx to do this right, we have to translate 8-bit characters to
-      % their "best" equivalent, based on the @documentencoding.  Right
-      % now, I guess we'll just let the pdf reader have its way.
+      % TODO this right, we have to translate 8-bit characters to
+      % their "best" equivalent, based on the @documentencoding.  Too
+      % much work for too little return.  Just use the ASCII equivalents
+      % we use for the index sort strings.
+      % 
       \indexnofonts
       \setupdatafile
+      % We can have normal brace characters in the PDF outlines, unlike
+      % Texinfo index files.  So set that up.
+      \def\{{\lbracecharliteral}%
+      \def\}{\rbracecharliteral}%
       \catcode`\\=\active \otherbackslash
       \input \tocreadfilename
     \endgroup
   }
+  {\catcode`[=1 \catcode`]=2
+   \catcode`{=\other \catcode`}=\other
+   \gdef\lbracecharliteral[{]%
+   \gdef\rbracecharliteral[}]%
+  ]
   %
   \def\skipspaces#1{\def\PP{#1}\def\D{|}%
     \ifx\PP\D\let\nextsp\relax
     \else\let\nextsp\skipspaces
-      \ifx\p\space\else\addtokens{\filename}{\PP}%
-        \advance\filenamelength by 1
-      \fi
+      \addtokens{\filename}{\PP}%
+      \advance\filenamelength by 1
     \fi
     \nextsp}
-  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+  \def\getfilename#1{%
+    \filenamelength=0
+    % If we don't expand the argument now, \skipspaces will get
+    % snagged on things like "@value{foo}".
+    \edef\temp{#1}%
+    \expandafter\skipspaces\temp|\relax
+  }
   \ifnum\pdftexversion < 14
     \let \startlink \pdfannotlink
   \else
@@ -1660,9 +1475,6 @@ output) for that.)}
 \def\ttsl{\setfontstyle{ttsl}}
 
 
-% Default leading.
-\newdimen\textleading  \textleading = 13.2pt
-
 % Set the baselineskip to #1, and the lineskip and strut size
 % correspondingly.  There is no deep meaning behind these magic numbers
 % used as factors; they just match (closely enough) what Knuth defined.
@@ -1674,6 +1486,7 @@ output) for that.)}
 % can get a sort of poor man's double spacing by redefining this.
 \def\baselinefactor{1}
 %
+\newdimen\textleading
 \def\setleading#1{%
   \dimen0 = #1\relax
   \normalbaselineskip = \baselinefactor\dimen0
@@ -1695,7 +1508,7 @@ output) for that.)}
 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
 % (\pdffontattr was introduced many years ago, but people still run
 % older pdftex's; it's easy to conditionalize, so we do.)
-\ifpdf \ifx\pdffontattr\undefined \else
+\ifpdf \ifx\pdffontattr\thisisundefined \else
   \begingroup
     \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
     \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
@@ -1946,28 +1759,34 @@ end
 \fi\fi
 
 
-% Set the font macro #1 to the font named #2, adding on the
-% specified font prefix (normally `cm').
+% Set the font macro #1 to the font named \fontprefix#2.
 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
-% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
-% empty to omit).
+% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
+% Example:
+% #1 = \textrm
+% #2 = \rmshape
+% #3 = 10
+% #4 = \mainmagstep
+% #5 = OT1
+%
 \def\setfont#1#2#3#4#5{%
   \font#1=\fontprefix#2#3 scaled #4
   \csname cmap#5\endcsname#1%
 }
 % This is what gets called when #5 of \setfont is empty.
 \let\cmap\gobble
-% emacs-page end of cmaps
+%
+% (end of cmaps)
 
 % Use cm as the default font prefix.
 % To specify the font prefix, you must define \fontprefix
 % before you read in texinfo.tex.
-\ifx\fontprefix\undefined
+\ifx\fontprefix\thisisundefined
 \def\fontprefix{cm}
 \fi
 % Support font families that don't use the same naming scheme as CM.
 \def\rmshape{r}
-\def\rmbshape{bx}               %where the normal face is bold
+\def\rmbshape{bx}               % where the normal face is bold
 \def\bfshape{b}
 \def\bxshape{bx}
 \def\ttshape{tt}
@@ -1982,8 +1801,7 @@ end
 \def\scshape{csc}
 \def\scbshape{csc}
 
-% Definitions for a main text size of 11pt.  This is the default in
-% Texinfo.
+% Definitions for a main text size of 11pt.  (The default in Texinfo.)
 %
 \def\definetextfontsizexi{%
 % Text fonts (11.2pt, magstep1).
@@ -2105,10 +1923,10 @@ end
 \font\reducedsy=cmsy10
 \def\reducedecsize{1000}
 
-% reset the current fonts
-\textfonts
+\textleading = 13.2pt % line spacing for 11pt CM
+\textfonts            % reset the current fonts
 \rm
-} % end of 11pt text font size definitions
+} % end of 11pt text font size definitions, \definetextfontsizexi
 
 
 % Definitions to make the main text be 10pt Computer Modern, with
@@ -2236,25 +2054,24 @@ end
 \font\reducedsy=cmsy9
 \def\reducedecsize{0900}
 
-% reduce space between paragraphs
-\divide\parskip by 2
-
-% reset the current fonts
-\textfonts
+\divide\parskip by 2  % reduce space between paragraphs
+\textleading = 12pt   % line spacing for 10pt CM
+\textfonts            % reset the current fonts
 \rm
-} % end of 10pt text font size definitions
+} % end of 10pt text font size definitions, \definetextfontsizex
 
 
 % We provide the user-level command
 %   @fonttextsize 10
 % (or 11) to redefine the text font size.  pt is assumed.
 %
-\def\xword{10}
 \def\xiword{11}
+\def\xword{10}
+\def\xwordpt{10pt}
 %
 \parseargdef\fonttextsize{%
   \def\textsizearg{#1}%
-  \wlog{doing @fonttextsize \textsizearg}%
+  %\wlog{doing @fonttextsize \textsizearg}%
   %
   % Set \globaldefs so that documents can use this inside @tex, since
   % makeinfo 4.8 does not support it, but we need it nonetheless.
@@ -2308,7 +2125,7 @@ end
   \let\tenttsl=\titlettsl
   \def\curfontsize{title}%
   \def\lsize{chap}\def\lllsize{subsec}%
-  \resetmathfonts \setleading{25pt}}
+  \resetmathfonts \setleading{27pt}}
 \def\titlefont#1{{\titlefonts\rmisbold #1}}
 \def\chapfonts{%
   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
@@ -2436,12 +2253,14 @@ end
 
 % Markup style setup for left and right quotes.
 \defmarkupstylesetup\markupsetuplq{%
-  \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname
+  \expandafter\let\expandafter \temp
+    \csname markupsetuplq\currentmarkupstyle\endcsname
   \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
 }
 
 \defmarkupstylesetup\markupsetuprq{%
-  \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname
+  \expandafter\let\expandafter \temp
+    \csname markupsetuprq\currentmarkupstyle\endcsname
   \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
 }
 
@@ -2454,28 +2273,31 @@ end
 
 \gdef\markupsetcodequoteleft{\let`\codequoteleft}
 \gdef\markupsetcodequoteright{\let'\codequoteright}
-
-\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
 }
 
 \let\markupsetuplqcode \markupsetcodequoteleft
 \let\markupsetuprqcode \markupsetcodequoteright
+%
 \let\markupsetuplqexample \markupsetcodequoteleft
 \let\markupsetuprqexample \markupsetcodequoteright
+%
+\let\markupsetuplqkbd     \markupsetcodequoteleft
+\let\markupsetuprqkbd     \markupsetcodequoteright
+%
+\let\markupsetuplqsamp \markupsetcodequoteleft
+\let\markupsetuprqsamp \markupsetcodequoteright
+%
 \let\markupsetuplqverb \markupsetcodequoteleft
 \let\markupsetuprqverb \markupsetcodequoteright
+%
 \let\markupsetuplqverbatim \markupsetcodequoteleft
 \let\markupsetuprqverbatim \markupsetcodequoteright
 
-\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
-\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
-
-% Allow an option to not replace quotes with a regular directed right
-% quote/apostrophe (char 0x27), but instead use the undirected quote
-% from cmtt (char 0x0d).  The undirected quote is ugly, so don't make it
-% the default, but it works for pasting with more pdf viewers (at least
-% evince), the lilypond developers report.  xpdf does work with the
-% regular 0x27.
+% Allow an option to not use regular directed right quote/apostrophe
+% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
+% The undirected quote is ugly, so don't make it the default, but it
+% works for pasting with more pdf viewers (at least evince), the
+% lilypond developers report.  xpdf does work with the regular 0x27.
 %
 \def\codequoteright{%
   \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
@@ -2499,33 +2321,83 @@ end
   \else \char'22 \fi
 }
 
+% Commands to set the quote options.
+% 
+\parseargdef\codequoteundirected{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxicodequoteundirected\endcsname
+      = t%
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxicodequoteundirected\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
+  \fi\fi
+}
+%
+\parseargdef\codequotebacktick{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxicodequotebacktick\endcsname
+      = t%
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxicodequotebacktick\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
+  \fi\fi
+}
+
 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
 \def\noligaturesquoteleft{\relax\lq}
 
 % Count depth in font-changes, for error checks
 \newcount\fontdepth \fontdepth=0
 
-%% Add scribe-like font environments, plus @l for inline lisp (usually sans
-%% serif) and @ii for TeX italic
+% Font commands.
 
-% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
-% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
-                    \ptexslash\fi\fi\fi}
-\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
-\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
+% #1 is the font command (\sl or \it), #2 is the text to slant.
+% If we are in a monospaced environment, however, 1) always use \ttsl,
+% and 2) do not add an italic correction.
+\def\dosmartslant#1#2{%
+  \ifusingtt 
+    {{\ttsl #2}\let\next=\relax}%
+    {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
+  \next
+}
+\def\smartslanted{\dosmartslant\sl}
+\def\smartitalic{\dosmartslant\it}
 
-% like \smartslanted except unconditionally uses \ttsl.
-% @var is set to this for defun arguments.
-\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
+% Output an italic correction unless \next (presumed to be the following
+% character) is such as not to need one.
+\def\smartitaliccorrection{%
+  \ifx\next,%
+  \else\ifx\next-%
+  \else\ifx\next.%
+  \else\ptexslash
+  \fi\fi\fi
+  \aftersmartic
+}
+
+% Unconditional use \ttsl, and no ic.  @var is set to this for defuns.
+\def\ttslanted#1{{\ttsl #1}}
 
 % @cite is like \smartslanted except unconditionally use \sl.  We never want
 % ttsl for book titles, do we?
-\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
+
+\def\aftersmartic{}
+\def\var#1{%
+  \let\saveaftersmartic = \aftersmartic
+  \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
+  \smartslanted{#1}%
+}
 
 \let\i=\smartitalic
 \let\slanted=\smartslanted
-\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}
 \let\dfn=\smartslanted
 \let\emph=\smartitalic
 
@@ -2575,34 +2447,12 @@ end
 % @samp.
 \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
 
-% definition of @key that produces a lozenge.  Doesn't adjust to text size.
-%\setfont\keyrm\rmshape{8}{1000}{OT1}
-%\font\keysy=cmsy9
-%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
-%  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
-%    \vbox{\hrule\kern-0.4pt
-%     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
-%    \kern-0.4pt\hrule}%
-%  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% @indicateurl is \samp, that is, with quotes.
+\let\indicateurl=\samp
 
-% definition of @key with no lozenge.  If the current font is already
-% monospace, don't change it; that way, we respect @kbdinputstyle.  But
-% if it isn't monospace, then use \tt.
-%
-\def\key#1{{\setupmarkupstyle{key}%
-  \nohyphenation
-  \ifmonospace\else\tt\fi
-  #1}\null}
-
-% ctrl is no longer a Texinfo command.
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-% @file, @option are the same as @samp.
-\let\file=\samp
-\let\option=\samp
-
-% @code is a modification of @t,
-% which makes spaces the same size as normal in the surrounding text.
+% @code (and similar) prints in typewriter, but with spaces the same
+% size as normal in the surrounding text, without hyphenation, etc.
+% This is a subroutine for that.
 \def\tclose#1{%
   {%
     % Change normal interword space to be same as for the current font.
@@ -2621,13 +2471,13 @@ end
     \plainfrenchspacing
     #1%
   }%
-  \null
+  \null % reset spacefactor to 1000
 }
 
 % We *must* turn on hyphenation at `-' and `_' in @code.
 % Otherwise, it is too hard to avoid overfull hboxes
 % in the Emacs manual, the Library manual, etc.
-
+%
 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
 % both hyphenation at - and hyphenation within words.
 % We must therefore turn them both off (\tclose does that)
@@ -2646,14 +2496,16 @@ end
      \let-\codedash
      \let_\codeunder
     \else
-     \let-\realdash
+     \let-\normaldash
      \let_\realunder
     \fi
     \codex
   }
 }
 
-\def\realdash{-}
+\def\codex #1{\tclose{#1}\endgroup}
+
+\def\normaldash{-}
 \def\codedash{-\discretionary{}{}{}}
 \def\codeunder{%
   % this is all so @math{@code{var_name}+1} can work.  In math mode, _
@@ -2666,12 +2518,11 @@ end
              \discretionary{}{}{}}%
             {\_}%
 }
-\def\codex #1{\tclose{#1}\endgroup}
 
 % An additional complication: the above will allow breaks after, e.g.,
-% each of the four underscores in __typeof__.  This is undesirable in
-% some manuals, especially if they don't have long identifiers in
-% general.  @allowcodebreaks provides a way to control this.
+% each of the four underscores in __typeof__.  This is bad.
+% @allowcodebreaks provides a document-level way to turn breaking at -
+% and _ on and off.
 %
 \newif\ifallowcodebreaks  \allowcodebreakstrue
 
@@ -2686,63 +2537,25 @@ end
     \allowcodebreaksfalse
   \else
     \errhelp = \EMsimple
-    \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
+    \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
   \fi\fi
 }
 
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
-
-% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
-%   `example' (@kbd uses ttsl only inside of @example and friends),
-%   or `code' (@kbd uses normal tty font always).
-\parseargdef\kbdinputstyle{%
-  \def\txiarg{#1}%
-  \ifx\txiarg\worddistinct
-    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
-  \else\ifx\txiarg\wordexample
-    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
-  \else\ifx\txiarg\wordcode
-    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
-  \else
-    \errhelp = \EMsimple
-    \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
-  \fi\fi\fi
-}
-\def\worddistinct{distinct}
-\def\wordexample{example}
-\def\wordcode{code}
-
-% Default is `distinct'.
-\kbdinputstyle distinct
-
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
-
-% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
-\let\indicateurl=\code
-\let\env=\code
+% For @command, @env, @file, @option quotes seem unnecessary,
+% so use \code rather than \samp.
 \let\command=\code
-
-% @clicksequence{File @click{} Open ...}
-\def\clicksequence#1{\begingroup #1\endgroup}
-
-% @clickstyle @arrow   (by default)
-\parseargdef\clickstyle{\def\click{#1}}
-\def\click{\arrow}
+\let\env=\code
+\let\file=\code
+\let\option=\code
 
 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
 % second argument specifying the text to display and an optional third
 % arg as text to display instead of (rather than in addition to) the url
-% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
-% a hypertex \special here.
-%
-\def\uref#1{\douref #1,,,\finish}
-\def\douref#1,#2,#3,#4\finish{\begingroup
+% itself.  First (mandatory) arg is the url.
+% (This \urefnobreak definition isn't used now, leaving it for a while
+% for comparison.)
+\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
+\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
   \unsepspaces
   \pdfurl{#1}%
   \setbox0 = \hbox{\ignorespaces #3}%
@@ -2763,6 +2576,103 @@ end
   \endlink
 \endgroup}
 
+% This \urefbreak definition is the active one.
+\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+\let\uref=\urefbreak
+\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
+\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
+  \unsepspaces
+  \pdfurl{#1}%
+  \setbox0 = \hbox{\ignorespaces #3}%
+  \ifdim\wd0 > 0pt
+    \unhbox0 % third arg given, show only that
+  \else
+    \setbox0 = \hbox{\ignorespaces #2}%
+    \ifdim\wd0 > 0pt
+      \ifpdf
+        \unhbox0             % PDF: 2nd arg given, show only it
+      \else
+        \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
+      \fi
+    \else
+      \urefcode{#1}% only url given, so show it
+    \fi
+  \fi
+  \endlink
+\endgroup}
+
+% Allow line breaks around only a few characters (only).
+\def\urefcatcodes{%
+  \catcode\ampChar=\active   \catcode\dotChar=\active
+  \catcode\hashChar=\active  \catcode\questChar=\active
+  \catcode\slashChar=\active
+}
+{
+  \urefcatcodes
+  %
+  \global\def\urefcode{\begingroup
+    \setupmarkupstyle{code}%
+    \urefcatcodes
+    \let&\urefcodeamp
+    \let.\urefcodedot
+    \let#\urefcodehash
+    \let?\urefcodequest
+    \let/\urefcodeslash
+    \codex
+  }
+  %
+  % By default, they are just regular characters.
+  \global\def&{\normalamp}
+  \global\def.{\normaldot}
+  \global\def#{\normalhash}
+  \global\def?{\normalquest}
+  \global\def/{\normalslash}
+}
+
+% we put a little stretch before and after the breakable chars, to help
+% line breaking of long url's.  The unequal skips make look better in
+% cmtt at least, especially for dots.
+\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
+\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
+%
+\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
+\def\urefcodedot{\urefprestretch .\urefpoststretch}
+\def\urefcodehash{\urefprestretch \#\urefpoststretch}
+\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
+{
+  \catcode`\/=\active
+  \global\def\urefcodeslashfinish{%
+    \urefprestretch \slashChar
+    % Allow line break only after the final / in a sequence of
+    % slashes, to avoid line break between the slashes in http://.
+    \ifx\next/\else \urefpoststretch \fi
+  }
+}
+
+% One more complication: by default we'll break after the special
+% characters, but some people like to break before the special chars, so
+% allow that.  Also allow no breaking at all, for manual control.
+% 
+\parseargdef\urefbreakstyle{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\wordnone
+    \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
+  \else\ifx\txiarg\wordbefore
+    \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+  \else\ifx\txiarg\wordafter
+    \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
+  \fi\fi\fi
+}
+\def\wordafter{after}
+\def\wordbefore{before}
+\def\wordnone{none}
+
+\urefbreakstyle after
+
 % @url synonym for @uref, since that's how everyone uses it.
 %
 \let\url=\uref
@@ -2784,6 +2694,67 @@ end
   \let\email=\uref
 \fi
 
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+%   `example' (@kbd uses ttsl only inside of @example and friends),
+%   or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+  \def\txiarg{#1}%
+  \ifx\txiarg\worddistinct
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+  \else\ifx\txiarg\wordexample
+    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+  \else\ifx\txiarg\wordcode
+    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
+  \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct'.
+\kbdinputstyle distinct
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
+
+\def\xkey{\key}
+\def\kbdsub#1#2#3\par{%
+  \def\one{#1}\def\three{#3}\def\threex{??}%
+  \ifx\one\xkey\ifx\threex\three \key{#2}%
+  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+}
+
+% definition of @key that produces a lozenge.  Doesn't adjust to text size.
+%\setfont\keyrm\rmshape{8}{1000}{OT1}
+%\font\keysy=cmsy9
+%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+%  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+%    \vbox{\hrule\kern-0.4pt
+%     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+%    \kern-0.4pt\hrule}%
+%  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+
+% definition of @key with no lozenge.  If the current font is already
+% monospace, don't change it; that way, we respect @kbdinputstyle.  But
+% if it isn't monospace, then use \tt.
+%
+\def\key#1{{\setupmarkupstyle{key}%
+  \nohyphenation
+  \ifmonospace\else\tt\fi
+  #1}\null}
+
+% @clicksequence{File @click{} Open ...}
+\def\clicksequence#1{\begingroup #1\endgroup}
+
+% @clickstyle @arrow   (by default)
+\parseargdef\clickstyle{\def\click{#1}}
+\def\click{\arrow}
+
 % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
 %
@@ -2805,6 +2776,7 @@ end
   \ifx\temp\empty \else
     \space ({\unsepspaces \ignorespaces \temp \unskip})%
   \fi
+  \null % reset \spacefactor=1000
 }
 
 % @abbr for "Comput. J." and the like.
@@ -2817,11 +2789,223 @@ end
   \ifx\temp\empty \else
     \space ({\unsepspaces \ignorespaces \temp \unskip})%
   \fi
+  \null % reset \spacefactor=1000
+}
+
+% @asis just yields its argument.  Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+  \catcode`\_ = \active
+  \gdef\mathunderscore{%
+    \catcode`\_=\active
+    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+  }
+}
+% Another complication: we want \\ (and @\) to output a math (or tt) \.
+% FYI, plain.tex uses \\ as a temporary control sequence (for no
+% particular reason), but this is not advertised and we don't care.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+  \tex
+  \mathunderscore
+  \let\\ = \mathbackslash
+  \mathactive
+  % make the texinfo accent commands work in math mode
+  \let\"=\ddot
+  \let\'=\acute
+  \let\==\bar
+  \let\^=\hat
+  \let\`=\grave
+  \let\u=\breve
+  \let\v=\check
+  \let\~=\tilde
+  \let\dotaccent=\dot
+  $\finishmath
+}
+\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+  \catcode`^ = \active
+  \catcode`< = \active
+  \catcode`> = \active
+  \catcode`+ = \active
+  \catcode`' = \active
+  \gdef\mathactive{%
+    \let^ = \ptexhat
+    \let< = \ptexless
+    \let> = \ptexgtr
+    \let+ = \ptexplus
+    \let' = \ptexquoteright
+  }
+}
+
+% ctrl is no longer a Texinfo command, but leave this definition for fun.
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
+% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
+% except specified as a normal braced arg, so no newlines to worry about.
+% 
+\def\outfmtnametex{tex}
+%
+\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
+\long\def\doinlinefmt#1,#2,\finish{%
+  \def\inlinefmtname{#1}%
+  \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+}
+% For raw, must switch into @tex before parsing the argument, to avoid
+% setting catcodes prematurely.  Doing it this way means that, for
+% example, @inlineraw{html, foo{bar} gets a parse error instead of being
+% ignored.  But this isn't important because if people want a literal
+% *right* brace they would have to use a command anyway, so they may as
+% well use a command to get a left brace too.  We could re-use the
+% delimiter character idea from \verb, but it seems like overkill.
+% 
+\long\def\inlineraw{\tex \doinlineraw}
+\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
+\def\doinlinerawtwo#1,#2,\finish{%
+  \def\inlinerawname{#1}%
+  \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
+  \endgroup % close group opened by \tex.
+}
+
+
+\message{glyphs,}
+% and logos.
+
+% @@ prints an @, as does @atchar{}.
+\def\@{\char64 }
+\let\atchar=\@
+
+% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
+% Unless we're in typewriter, use \ecfont because the CM text fonts do
+% not have braces, and we don't want to switch into math.
+\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
+\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
+\let\{=\mylbrace \let\lbracechar=\{
+\let\}=\myrbrace \let\rbracechar=\}
+\begingroup
+  % Definitions to produce \{ and \} commands for indices,
+  % and @{ and @} for the aux/toc files.
+  \catcode`\{ = \other \catcode`\} = \other
+  \catcode`\[ = 1 \catcode`\] = 2
+  \catcode`\! = 0 \catcode`\\ = \other
+  !gdef!lbracecmd[\{]%
+  !gdef!rbracecmd[\}]%
+  !gdef!lbraceatcmd[@{]%
+  !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \ptexc
+\let\dotaccent = \ptexdot
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \ptext
+\let\ubaraccent = \ptexb
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+  \def\temp{#1}%
+  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
+  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
+  \else \errmessage{@dotless can be used only with i or j}%
+  \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence.  (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo.  Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+  L\kern-.36em
+  {\setbox0=\hbox{T}%
+   \vbox to \ht0{\hbox{%
+     \ifx\textnominalsize\xwordpt
+       % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
+       % Revert to plain's \scriptsize, which is 7pt.
+       \count255=\the\fam $\fam\count255 \scriptstyle A$%
+     \else
+       % For 11pt, we can use our lllsize.
+       \selectfonts\lllsize A%
+     \fi
+     }%
+     \vss
+  }}%
+  \kern-.15em
+  \TeX
+}
+
+% Some math mode symbols.
+\def\bullet{$\ptexbullet$}
+\def\geq{\ifmmode \ge\else $\ge$\fi}
+\def\leq{\ifmmode \le\else $\le$\fi}
+\def\minus{\ifmmode -\else $-$\fi}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em.  So do
+% whichever is larger.
+%
+\def\dots{%
+  \leavevmode
+  \setbox0=\hbox{...}% get width of three periods
+  \ifdim\wd0 > 1.5em
+    \dimen0 = \wd0
+  \else
+    \dimen0 = 1.5em
+  \fi
+  \hbox to \dimen0{%
+    \hskip 0pt plus.25fil
+    .\hskip 0pt plus1fil
+    .\hskip 0pt plus1fil
+    .\hskip 0pt plus.5fil
+  }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+  \dots
+  \spacefactor=\endofsentencespacefactor
 }
 
-
-\message{glyphs,}
-
 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
 %
 % Since these characters are used in examples, they should be an even number of
@@ -2842,7 +3026,7 @@ end
 {\tentt \global\dimen0 = 3em}% Width of the box.
 \dimen2 = .55pt % Thickness of rules
 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
+\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
 %
 \setbox\errorbox=\hbox to \dimen0{\hfil
    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
@@ -2963,12 +3147,17 @@ end
   % hopefully nobody will notice/care.
   \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
   \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
-  \ifx\curfontstyle\bfstylename
-    % bold:
-    \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+  \ifmonospace
+    % typewriter:
+    \font\thisecfont = ectt\ecsize \space at \nominalsize
   \else
-    % regular:
-    \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+    \ifx\curfontstyle\bfstylename
+      % bold:
+      \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+    \else
+      % regular:
+      \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+    \fi
   \fi
   \thisecfont
 }
@@ -2991,7 +3180,7 @@ end
 %  Textures 1.7.7 (preloaded format=plain 93.10.14)  (68K)  16 APR 2004 02:38
 % so we'll define it if necessary.
 %
-\ifx\Orb\undefined
+\ifx\Orb\thisisundefined
 \def\Orb{\mathhexbox20D}
 \fi
 
@@ -3019,8 +3208,9 @@ end
 \newif\ifsetshortcontentsaftertitlepage
  \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
 
-\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
-        \endgroup\page\hbox{}\page}
+\parseargdef\shorttitlepage{%
+  \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+  \endgroup\page\hbox{}\page}
 
 \envdef\titlepage{%
   % Open one extra group, as we want to close it in the middle of \Etitlepage.
@@ -3080,14 +3270,28 @@ end
   \finishedtitlepagetrue
 }
 
-%%% Macros to be used within @titlepage:
+% Settings used for typesetting titles: no hyphenation, no indentation,
+% don't worry much about spacing, ragged right.  This should be used
+% inside a \vbox, and fonts need to be set appropriately first.  Because
+% it is always used for titles, nothing else, we call \rmisbold.  \par
+% should be specified before the end of the \vbox, since a vbox is a group.
+% 
+\def\raggedtitlesettings{%
+  \rmisbold
+  \hyphenpenalty=10000
+  \parindent=0pt
+  \tolerance=5000
+  \ptexraggedright
+}
+
+% Macros to be used within @titlepage:
 
 \let\subtitlerm=\tenrm
 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
 
 \parseargdef\title{%
   \checkenv\titlepage
-  \leftline{\titlefonts\rmisbold #1}
+  \vbox{\titlefonts \raggedtitlesettings #1\par}%
   % print a rule at the page bottom also.
   \finishedtitlepagefalse
   \vskip4pt \hrule height 4pt width \hsize \vskip4pt
@@ -3113,7 +3317,7 @@ end
 }
 
 
-%%% Set up page headings and footings.
+% Set up page headings and footings.
 
 \let\thispage=\folio
 
@@ -3207,10 +3411,14 @@ end
 
 \def\headings #1 {\csname HEADINGS#1\endcsname}
 
-\def\HEADINGSoff{%
-\global\evenheadline={\hfil} \global\evenfootline={\hfil}
-\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
-\HEADINGSoff
+\def\headingsoff{% non-global headings elimination
+  \evenheadline={\hfil}\evenfootline={\hfil}%
+   \oddheadline={\hfil}\oddfootline={\hfil}%
+}
+
+\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
+\HEADINGSoff  % it's the default
+
 % When we turn headings on, set the page number to 1.
 % For double-sided printing, put current file name in lower left corner,
 % chapter name on inside top of right hand pages, document
@@ -3261,7 +3469,7 @@ end
 % This produces Day Month Year style of output.
 % Only define if not already defined, in case a txi-??.tex file has set
 % up a different format (e.g., txi-cs.tex does this).
-\ifx\today\undefined
+\ifx\today\thisisundefined
 \def\today{%
   \number\day\space
   \ifcase\month
@@ -3322,7 +3530,7 @@ end
     \begingroup
       \advance\leftskip by-\tableindent
       \advance\hsize by\tableindent
-      \advance\rightskip by0pt plus1fil
+      \advance\rightskip by0pt plus1fil\relax
       \leavevmode\unhbox0\par
     \endgroup
     %
@@ -3808,18 +4016,18 @@ end
 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
 \global\advance\multitablelinespace by-\ht0
 \fi
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%%        If so, set to same dimension as multitablelinespace.
+% Test to see if parskip is larger than space between lines of
+% table. If not, do nothing.
+%        If so, set to same dimension as multitablelinespace.
 \ifdim\multitableparskip>\multitablelinespace
 \global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
-                                      %% than skip between lines in the table.
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+                                      % than skip between lines in the table.
 \fi%
 \ifdim\multitableparskip=0pt
 \global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
-                                      %% than skip between lines in the table.
+\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
+                                      % than skip between lines in the table.
 \fi}
 
 
@@ -3980,7 +4188,7 @@ end
     % ..., but we might end up with active ones in the argument if
     % we're called from @code, as @code{@value{foo-bar_}}, though.
     % So \let them to their normal equivalents.
-    \let-\realdash \let_\normalunderscore
+    \let-\normaldash \let_\normalunderscore
   }
 }
 
@@ -4020,7 +4228,7 @@ end
 }
 \def\ifsetfail{\doignore{ifset}}
 
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% @ifclear VAR ... @end executes the `...' iff VAR has never been
 % defined with @set, or has been undefined with @clear.
 %
 % The `\else' inside the `\doifset' parameter is a trick to reuse the
@@ -4031,6 +4239,35 @@ end
 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
 \def\ifclearfail{\doignore{ifclear}}
 
+% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
+% without the @) is in fact defined.  We can only feasibly check at the
+% TeX level, so something like `mathcode' is going to considered
+% defined even though it is not a Texinfo command.
+% 
+\makecond{ifcommanddefined}
+\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
+%
+\def\doifcmddefined#1#2{{%
+    \makevalueexpandable
+    \let\next=\empty
+    \expandafter\ifx\csname #2\endcsname\relax
+      #1% If not defined, \let\next as above.
+    \fi
+    \expandafter
+  }\next
+}
+\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
+
+% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
+\makecond{ifcommandnotdefined}
+\def\ifcommandnotdefined{%
+  \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
+\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
+
+% Set the `txicommandconditionals' variable, so documents have a way to
+% test if the @ifcommand...defined conditionals are available.
+\set txicommandconditionals
+
 % @dircategory CATEGORY  -- specify a category of the dir file
 % which this file should belong to.  Ignore this in TeX.
 \let\dircategory=\comment
@@ -4134,11 +4371,14 @@ end
   \def\@{@}% change to @@ when we switch to @ as escape char in index files.
   \def\ {\realbackslash\space }%
   %
-  % Need these in case \tex is in effect and \{ is a \delimiter again.
-  % But can't use \lbracecmd and \rbracecmd because texindex assumes
-  % braces and backslashes are used only as delimiters.
-  \let\{ = \mylbrace
-  \let\} = \myrbrace
+  % Need these unexpandable (because we define \tt as a dummy)
+  % definitions when @{ or @} appear in index entry text.  Also, more
+  % complicated, when \tex is in effect and \{ is a \delimiter again.
+  % We can't use \lbracecmd and \rbracecmd because texindex assumes
+  % braces and backslashes are used only as delimiters.  Perhaps we
+  % should define @lbrace and @rbrace commands a la @comma.
+  \def\{{{\tt\char123}}%
+  \def\}{{\tt\char125}}%
   %
   % I don't entirely understand this, but when an index entry is
   % generated from a macro call, the \endinput which \scanmacro inserts
@@ -4191,7 +4431,7 @@ end
 \def\commondummies{%
   %
   % \definedummyword defines \#1 as \string\#1\space, thus effectively
-  % preventing its expansion.  This is used only for control% words,
+  % preventing its expansion.  This is used only for control words,
   % not control letters, because the \space would be incorrect for
   % control characters, but is needed to separate the control word
   % from whatever follows.
@@ -4210,6 +4450,7 @@ end
   \commondummiesnofonts
   %
   \definedummyletter\_%
+  \definedummyletter\-%
   %
   % Non-English letters.
   \definedummyword\AA
@@ -4246,20 +4487,25 @@ end
   \definedummyword\TeX
   %
   % Assorted special characters.
+  \definedummyword\arrow
   \definedummyword\bullet
   \definedummyword\comma
   \definedummyword\copyright
   \definedummyword\registeredsymbol
   \definedummyword\dots
   \definedummyword\enddots
+  \definedummyword\entrybreak
   \definedummyword\equiv
   \definedummyword\error
   \definedummyword\euro
+  \definedummyword\expansion
+  \definedummyword\geq
   \definedummyword\guillemetleft
   \definedummyword\guillemetright
   \definedummyword\guilsinglleft
   \definedummyword\guilsinglright
-  \definedummyword\expansion
+  \definedummyword\lbracechar
+  \definedummyword\leq
   \definedummyword\minus
   \definedummyword\ogonek
   \definedummyword\pounds
@@ -4271,6 +4517,7 @@ end
   \definedummyword\quoteleft
   \definedummyword\quoteright
   \definedummyword\quotesinglbase
+  \definedummyword\rbracechar
   \definedummyword\result
   \definedummyword\textdegree
   %
@@ -4316,19 +4563,27 @@ end
   \definedummyword\b
   \definedummyword\i
   \definedummyword\r
+  \definedummyword\sansserif
   \definedummyword\sc
+  \definedummyword\slanted
   \definedummyword\t
   %
   % Commands that take arguments.
+  \definedummyword\abbr
   \definedummyword\acronym
+  \definedummyword\anchor
   \definedummyword\cite
   \definedummyword\code
   \definedummyword\command
   \definedummyword\dfn
+  \definedummyword\dmn
   \definedummyword\email
   \definedummyword\emph
   \definedummyword\env
   \definedummyword\file
+  \definedummyword\image
+  \definedummyword\indicateurl
+  \definedummyword\inforef
   \definedummyword\kbd
   \definedummyword\key
   \definedummyword\math
@@ -4356,7 +4611,7 @@ end
   \def\definedummyaccent##1{\let##1\asis}%
   % We can just ignore other control letters.
   \def\definedummyletter##1{\let##1\empty}%
-  % Hopefully, all control words can become @asis.
+  % All control words become @asis by default; overrides below.
   \let\definedummyword\definedummyaccent
   %
   \commondummiesnofonts
@@ -4368,8 +4623,17 @@ end
   %
   \def\ { }%
   \def\@{@}%
-  % how to handle braces?
   \def\_{\normalunderscore}%
+  \def\-{}% @- shouldn't affect sorting
+  %
+  % Unfortunately, texindex is not prepared to handle braces in the
+  % content at all.  So for index sorting, we map @{ and @} to strings
+  % starting with |, since that ASCII character is between ASCII { and }.
+  \def\{{|a}%
+  \def\lbracechar{|a}%
+  %
+  \def\}{|b}%
+  \def\rbracechar{|b}%
   %
   % Non-English letters.
   \def\AA{AA}%
@@ -4397,6 +4661,7 @@ end
   %
   % Assorted special characters.
   % (The following {} will end up in the sort string, but that's ok.)
+  \def\arrow{->}%
   \def\bullet{bullet}%
   \def\comma{,}%
   \def\copyright{copyright}%
@@ -4406,10 +4671,12 @@ end
   \def\error{error}%
   \def\euro{euro}%
   \def\expansion{==>}%
+  \def\geq{>=}%
   \def\guillemetleft{<<}%
   \def\guillemetright{>>}%
   \def\guilsinglleft{<}%
   \def\guilsinglright{>}%
+  \def\leq{<=}%
   \def\minus{-}%
   \def\point{.}%
   \def\pounds{pounds}%
@@ -4424,6 +4691,9 @@ end
   \def\result{=>}%
   \def\textdegree{o}%
   %
+  \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
+  \else \indexlquoteignore \fi
+  %
   % We need to get rid of all macros, leaving only the arguments (if present).
   % Of course this is not nearly correct, but it is the best we can do for now.
   % makeinfo does not expand macros in the argument to @deffn, which ends up
@@ -4437,6 +4707,11 @@ end
   \macrolist
 }
 
+% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
+% ignore left quotes in the sort term.
+{\catcode`\`=\active
+ \gdef\indexlquoteignore{\let`=\empty}}
+
 \let\indexbackslash=0  %overridden during \printindex.
 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
 
@@ -4534,10 +4809,9 @@ end
 %
 % ..., ready, GO:
 %
-\def\safewhatsit#1{%
-\ifhmode
+\def\safewhatsit#1{\ifhmode
   #1%
-\else
+ \else
   % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
   \whatsitskip = \lastskip
   \edef\lastskipmacro{\the\lastskip}%
@@ -4561,7 +4835,6 @@ end
     % to re-insert the same penalty (values >10000 are used for various
     % signals); since we just inserted a non-discardable item, any
     % following glue (such as a \parskip) would be a breakpoint.  For example:
-    %
     %   @deffn deffn-whatever
     %   @vindex index-whatever
     %   Description.
@@ -4574,8 +4847,7 @@ end
     % (the whatsit from the \write), so we must insert a \nobreak.
     \nobreak\vskip\whatsitskip
   \fi
-\fi
-}
+\fi}
 
 % The index entry written in the file actually looks like
 %  \entry {sortstring}{page}{topic}
@@ -4694,7 +4966,6 @@ end
 % But this freezes the catcodes in the argument, and can cause problems to
 % @code, which sets - active.  This problem was fixed by a kludge---
 % ``-'' was active throughout whole index, but this isn't really right.
-%
 % The right solution is to prevent \entry from swallowing the whole text.
 %                                 --kasal, 21nov03
 \def\entry{%
@@ -4731,10 +5002,17 @@ end
     % columns.
     \vskip 0pt plus1pt
     %
+    % When reading the text of entry, convert explicit line breaks
+    % from @* into spaces.  The user might give these in long section
+    % titles, for instance.
+    \def\*{\unskip\space\ignorespaces}%
+    \def\entrybreak{\hfil\break}%
+    %
     % Swallow the left brace of the text (first parameter):
     \afterassignment\doentry
     \let\temp =
 }
+\def\entrybreak{\unskip\space\ignorespaces}%
 \def\doentry{%
     \bgroup % Instead of the swallowed brace.
       \noindent
@@ -4967,7 +5245,22 @@ end
 \message{sectioning,}
 % Chapters, sections, etc.
 
-% \unnumberedno is an oxymoron, of course.  But we count the unnumbered
+% Let's start with @part.
+\outer\parseargdef\part{\partzzz{#1}}
+\def\partzzz#1{%
+  \chapoddpage
+  \null
+  \vskip.3\vsize  % move it down on the page a bit
+  \begingroup
+    \noindent \titlefonts\rmisbold #1\par % the text
+    \let\lastnode=\empty      % no node to associate with
+    \writetocentry{part}{#1}{}% but put it in the toc
+    \headingsoff              % no headline or footline on the part page
+    \chapoddpage
+  \endgroup
+}
+
+% \unnumberedno is an oxymoron.  But we count the unnumbered
 % sections so that we can refer to them unambiguously in the pdf
 % outlines by their "section number".  We avoid collisions with chapter
 % numbers by starting them at 10000.  (If a document ever has 10000
@@ -5046,8 +5339,8 @@ end
 \chardef\maxseclevel = 3
 %
 % A numbered section within an unnumbered changes to unnumbered too.
-% To achive this, remember the "biggest" unnum. sec. we are currently in:
-\chardef\unmlevel = \maxseclevel
+% To achieve this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unnlevel = \maxseclevel
 %
 % Trace whether the current chapter is an appendix or not:
 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
@@ -5072,8 +5365,8 @@ end
   % The heading type:
   \def\headtype{#1}%
   \if \headtype U%
-    \ifnum \absseclevel < \unmlevel
-      \chardef\unmlevel = \absseclevel
+    \ifnum \absseclevel < \unnlevel
+      \chardef\unnlevel = \absseclevel
     \fi
   \else
     % Check for appendix sections:
@@ -5085,10 +5378,10 @@ end
       \fi\fi
     \fi
     % Check for numbered within unnumbered:
-    \ifnum \absseclevel > \unmlevel
+    \ifnum \absseclevel > \unnlevel
       \def\headtype{U}%
     \else
-      \chardef\unmlevel = 3
+      \chardef\unnlevel = 3
     \fi
   \fi
   % Now print the heading:
@@ -5174,7 +5467,8 @@ end
   \global\let\subsubsection = \appendixsubsubsec
 }
 
-\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+% normally unnmhead0 calls unnumberedzzz:
+\outer\parseargdef\unnumbered{\unnmhead0{#1}}
 \def\unnumberedzzz#1{%
   \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
     \global\advance\unnumberedno by 1
@@ -5218,40 +5512,47 @@ end
 \let\top\unnumbered
 
 % Sections.
+% 
 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
 \def\seczzz#1{%
   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
 }
 
-\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
+% normally calls appendixsectionzzz:
+\outer\parseargdef\appendixsection{\apphead1{#1}}
 \def\appendixsectionzzz#1{%
   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
 }
 \let\appendixsec\appendixsection
 
-\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
+% normally calls unnumberedseczzz:
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
 \def\unnumberedseczzz#1{%
   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
   \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
 }
 
 % Subsections.
-\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
+% 
+% normally calls numberedsubseczzz:
+\outer\parseargdef\numberedsubsec{\numhead2{#1}}
 \def\numberedsubseczzz#1{%
   \global\subsubsecno=0  \global\advance\subsecno by 1
   \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
 }
 
-\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
+% normally calls appendixsubseczzz:
+\outer\parseargdef\appendixsubsec{\apphead2{#1}}
 \def\appendixsubseczzz#1{%
   \global\subsubsecno=0  \global\advance\subsecno by 1
   \sectionheading{#1}{subsec}{Yappendix}%
                  {\appendixletter.\the\secno.\the\subsecno}%
 }
 
-\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+% normally calls unnumberedsubseczzz:
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
 \def\unnumberedsubseczzz#1{%
   \global\subsubsecno=0  \global\advance\subsecno by 1
   \sectionheading{#1}{subsec}{Ynothing}%
@@ -5259,21 +5560,25 @@ end
 }
 
 % Subsubsections.
-\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
+% 
+% normally numberedsubsubseczzz:
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
 \def\numberedsubsubseczzz#1{%
   \global\advance\subsubsecno by 1
   \sectionheading{#1}{subsubsec}{Ynumbered}%
                  {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
 }
 
-\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
+% normally appendixsubsubseczzz:
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
 \def\appendixsubsubseczzz#1{%
   \global\advance\subsubsecno by 1
   \sectionheading{#1}{subsubsec}{Yappendix}%
                  {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
 }
 
-\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+% normally unnumberedsubsubseczzz:
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
 \def\unnumberedsubsubseczzz#1{%
   \global\advance\subsubsecno by 1
   \sectionheading{#1}{subsubsec}{Ynothing}%
@@ -5289,14 +5594,6 @@ end
 
 % Define @majorheading, @heading and @subheading
 
-% NOTE on use of \vbox for chapter headings, section headings, and such:
-%       1) We use \vbox rather than the earlier \line to permit
-%          overlong headings to fold.
-%       2) \hyphenpenalty is set to 10000 because hyphenation in a
-%          heading is obnoxious; this forbids it.
-%       3) Likewise, headings look best if no \parindent is used, and
-%          if justification is not attempted.  Hence \raggedright.
-
 \def\majorheading{%
   {\advance\chapheadingskip by 10pt \chapbreak }%
   \parsearg\chapheadingzzz
@@ -5304,10 +5601,8 @@ end
 
 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
 \def\chapheadingzzz#1{%
-  {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                    \parindent=0pt\ptexraggedright
-                    \rmisbold #1\hfill}}%
-  \bigskip \par\penalty 200\relax
+  \vbox{\chapfonts \raggedtitlesettings #1\par}%
+  \nobreak\bigskip \nobreak
   \suppressfirstparagraphindent
 }
 
@@ -5323,14 +5618,13 @@ end
 % (including whitespace, linebreaking, etc. around it),
 % given all the information in convenient, parsed form.
 
-%%% Args are the skip and penalty (usually negative)
+% Args are the skip and penalty (usually negative)
 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
 
-%%% Define plain chapter starts, and page on/off switching for it
 % Parameter controlling skip before chapter headings (if needed)
-
 \newskip\chapheadingskip
 
+% Define plain chapter starts, and page on/off switching for it.
 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
 \def\chappager{\par\vfill\supereject}
 % Because \domark is called before \chapoddpage, the filler page will
@@ -5340,9 +5634,8 @@ end
   \chappager
   \ifodd\pageno \else
     \begingroup
-      \evenheadline={\hfil}\evenfootline={\hfil}%
-      \oddheadline={\hfil}\oddfootline={\hfil}%
-      \hbox to 0pt{}%
+      \headingsoff
+      \null
       \chappager
     \endgroup
   \fi
@@ -5468,8 +5761,7 @@ end
     %
     % Typeset the actual heading.
     \nobreak % Avoid page breaks at the interline glue.
-    \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
-          \hangindent=\wd0 \centerparametersmaybe
+    \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
           \unhbox0 #1\par}%
   }%
   \nobreak\bigskip % no page break after a chapter title
@@ -5491,18 +5783,18 @@ end
 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
 %
 \def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                       \parindent=0pt\ptexraggedright
-                       \rmisbold #1\hfill}}\bigskip \par\nobreak
+  \chapoddpage
+  \vbox{\chapfonts \raggedtitlesettings #1\par}%
+  \nobreak\bigskip\nobreak
 }
 \def\chfopen #1#2{\chapoddpage {\chapfonts
 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
 \par\penalty 5000 %
 }
 \def\centerchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
-                       \parindent=0pt
-                       \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
+  \chapoddpage
+  \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
+  \nobreak\bigskip \nobreak
 }
 \def\CHAPFopen{%
   \global\let\chapmacro=\chfopen
@@ -5534,6 +5826,8 @@ end
 %
 \def\sectionheading#1#2#3#4{%
   {%
+    \checkenv{}% should not be in an environment.
+    %
     % Switch to the right set of fonts.
     \csname #2fonts\endcsname \rmisbold
     %
@@ -5645,15 +5939,15 @@ end
   %
   % We'll almost certainly start a paragraph next, so don't let that
   % glue accumulate.  (Not a breakpoint because it's preceded by a
-  % discardable item.)
+  % discardable item.)  However, when a paragraph is not started next
+  % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
+  % or the negative glue will cause weirdly wrong output, typically
+  % obscuring the section heading with something else.
   \vskip-\parskip
   %
-  % This is purely so the last item on the list is a known \penalty >
-  % 10000.  This is so \startdefun can avoid allowing breakpoints after
-  % section headings.  Otherwise, it would insert a valid breakpoint between:
-  %
-  %   @section sec-whatever
-  %   @deffn def-whatever
+  % This is so the last item on the main vertical list is a known
+  % \penalty > 10000, so \startdefun, etc., can recognize the situation
+  % and do the needful.
   \penalty 10001
 }
 
@@ -5785,6 +6079,7 @@ end
 \def\summarycontents{%
   \startcontents{\putwordShortTOC}%
     %
+    \let\partentry = \shortpartentry
     \let\numchapentry = \shortchapentry
     \let\appentry = \shortchapentry
     \let\unnchapentry = \shortunnchapentry
@@ -5840,6 +6135,19 @@ end
 % The last argument is the page number.
 % The arguments in between are the chapter number, section number, ...
 
+% Parts, in the main contents.  Replace the part number, which doesn't
+% exist, with an empty box.  Let's hope all the numbers have the same width.
+% Also ignore the page number, which is conventionally not printed.
+\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
+\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+%
+% Parts, in the short toc.
+\def\shortpartentry#1#2#3#4{%
+  \penalty-300
+  \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
+  \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
+}
+
 % Chapters, in the main contents.
 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
 %
@@ -5929,9 +6237,9 @@ end
 \message{environments,}
 % @foo ... @end foo.
 
-% @tex ... @end tex    escapes into raw Tex temporarily.
+% @tex ... @end tex    escapes into raw TeX temporarily.
 % One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain tex @ character.
+% But \@ or @@ will get a plain @ character.
 
 \envdef\tex{%
   \setupmarkupstyle{tex}%
@@ -5948,6 +6256,10 @@ end
   \catcode`\'=\other
   \escapechar=`\\
   %
+  % ' is active in math mode (mathcode"8000).  So reset it, and all our
+  % other math active characters (just in case), to plain's definitions.
+  \mathactive
+  %
   \let\b=\ptexb
   \let\bullet=\ptexbullet
   \let\c=\ptexc
@@ -6051,6 +6363,12 @@ end
   \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
   % Flag to tell @lisp, etc., not to narrow margin.
   \let\nonarrowing = t%
+  %
+  % If this cartouche directly follows a sectioning command, we need the
+  % \parskip glue (backspaced over by default) or the cartouche can
+  % collide with the section heading.
+  \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
+  %
   \vbox\bgroup
       \baselineskip=0pt\parskip=0pt\lineskip=0pt
       \carttop
@@ -6064,7 +6382,7 @@ end
 	      \lineskip=\normlskip
 	      \parskip=\normpskip
 	      \vskip -\parskip
-	      \comment % For explanation, see the end of \def\group.
+	      \comment % For explanation, see the end of def\group.
 }
 \def\Ecartouche{%
               \ifhmode\par\fi
@@ -6150,41 +6468,42 @@ end
 }
 
 % We often define two environments, @foo and @smallfoo.
-% Let's do it by one command:
-\def\makedispenv #1#2{
-  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
-  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
+% Let's do it in one command.  #1 is the env name, #2 the definition.
+\def\makedispenvdef#1#2{%
+  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
+  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
   \expandafter\let\csname E#1\endcsname \afterenvbreak
   \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
 }
 
-% Define two synonyms:
-\def\maketwodispenvs #1#2#3{
-  \makedispenv{#1}{#3}
-  \makedispenv{#2}{#3}
+% Define two environment synonyms (#1 and #2) for an environment.
+\def\maketwodispenvdef#1#2#3{%
+  \makedispenvdef{#1}{#3}%
+  \makedispenvdef{#2}{#3}%
 }
-
-% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
+%
+% @lisp: indented, narrowed, typewriter font;
+% @example: same as @lisp.
 %
 % @smallexample and @smalllisp: use smaller fonts.
 % Originally contributed by Pavel at xerox.
 %
-\maketwodispenvs {lisp}{example}{%
+\maketwodispenvdef{lisp}{example}{%
   \nonfillstart
   \tt\setupmarkupstyle{example}%
   \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
-  \gobble       % eat return
+  \gobble % eat return
 }
 % @display/@smalldisplay: same as @lisp except keep current font.
 %
-\makedispenv {display}{%
+\makedispenvdef{display}{%
   \nonfillstart
   \gobble
 }
 
 % @format/@smallformat: same as @display except don't narrow margins.
 %
-\makedispenv{format}{%
+\makedispenvdef{format}{%
   \let\nonarrowing = t%
   \nonfillstart
   \gobble
@@ -6203,7 +6522,7 @@ end
 \envdef\flushright{%
   \let\nonarrowing = t%
   \nonfillstart
-  \advance\leftskip by 0pt plus 1fill
+  \advance\leftskip by 0pt plus 1fill\relax
   \gobble
 }
 \let\Eflushright = \afterenvbreak
@@ -6238,43 +6557,28 @@ end
 % we're doing normal filling.  So, when using \aboveenvbreak and
 % \afterenvbreak, temporarily make \parskip 0.
 %
+\makedispenvdef{quotation}{\quotationstart}
+%
 \def\quotationstart{%
-  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
-  \parindent=0pt
-  %
-  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+  \indentedblockstart % same as \indentedblock, but increase right margin too.
   \ifx\nonarrowing\relax
-    \advance\leftskip by \lispnarrowing
     \advance\rightskip by \lispnarrowing
-    \exdentamount = \lispnarrowing
-  \else
-    \let\nonarrowing = \relax
   \fi
   \parsearg\quotationlabel
 }
 
-\envdef\quotation{%
-  \setnormaldispenv
-  \quotationstart
-}
-
-\envdef\smallquotation{%
-  \setsmalldispenv
-  \quotationstart
-}
-\let\Esmallquotation = \Equotation
-
 % We have retained a nonzero parskip for the environment, since we're
 % doing normal filling.
 %
 \def\Equotation{%
   \par
-  \ifx\quotationauthor\undefined\else
+  \ifx\quotationauthor\thisisundefined\else
     % indent a bit.
     \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
   \fi
   {\parskip=0pt \afterenvbreak}%
 }
+\def\Esmallquotation{\Equotation}
 
 % If we're given an argument, typeset it in bold with a colon after.
 \def\quotationlabel#1{%
@@ -6284,6 +6588,32 @@ end
   \fi
 }
 
+% @indentedblock is like @quotation, but indents only on the left and
+% has no optional argument.
+% 
+\makedispenvdef{indentedblock}{\indentedblockstart}
+%
+\def\indentedblockstart{%
+  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+  \parindent=0pt
+  %
+  % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+  \ifx\nonarrowing\relax
+    \advance\leftskip by \lispnarrowing
+    \exdentamount = \lispnarrowing
+  \else
+    \let\nonarrowing = \relax
+  \fi
+}
+
+% Keep a nonzero parskip for the environment, since we're doing normal filling.
+%
+\def\Eindentedblock{%
+  \par
+  {\parskip=0pt \afterenvbreak}%
+}
+\def\Esmallindentedblock{\Eindentedblock}
+
 
 % LaTeX-like @verbatim... at end verbatim and @verb{<char>...<char>}
 % If we want to allow any <char> as delimiter,
@@ -6331,21 +6661,28 @@ end
 
 % Setup for the @verbatim environment
 %
-% Real tab expansion
+% Real tab expansion.
 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
 %
-\def\starttabbox{\setbox0=\hbox\bgroup}
+% We typeset each line of the verbatim in an \hbox, so we can handle
+% tabs.  The \global is in case the verbatim line starts with an accent,
+% or some other command that starts with a begin-group.  Otherwise, the
+% entire \verbbox would disappear at the corresponding end-group, before
+% it is typeset.  Meanwhile, we can't have nested verbatim commands
+% (can we?), so the \global won't be overwriting itself.
+\newbox\verbbox
+\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
 %
 \begingroup
   \catcode`\^^I=\active
   \gdef\tabexpand{%
     \catcode`\^^I=\active
     \def^^I{\leavevmode\egroup
-      \dimen0=\wd0 % the width so far, or since the previous tab
-      \divide\dimen0 by\tabw
-      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
-      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
-      \wd0=\dimen0 \box0 \starttabbox
+      \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
+      \divide\dimen\verbbox by\tabw
+      \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
+      \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
+      \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
     }%
   }
 \endgroup
@@ -6354,15 +6691,16 @@ end
 \def\setupverbatim{%
   \let\nonarrowing = t%
   \nonfillstart
-  % Easiest (and conventionally used) font for verbatim
-  \tt
-  \def\par{\leavevmode\egroup\box0\endgraf}%
+  \tt % easiest (and conventionally used) font for verbatim
+  % The \leavevmode here is for blank lines.  Otherwise, we would
+  % never \starttabox and the \egroup would end verbatim mode.
+  \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
   \tabexpand
   \setupmarkupstyle{verbatim}%
   % Respect line breaks,
   % print special symbols as themselves, and
-  % make each space count
-  % must do in this order:
+  % make each space count.
+  % Must do in this order:
   \obeylines \uncatcodespecials \sepspaces
   \everypar{\starttabbox}%
 }
@@ -6419,6 +6757,7 @@ end
     \makevalueexpandable
     \setupverbatim
     \indexnofonts       % Allow `@@' and other weird things in file names.
+    \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
     \input #1
     \afterenvbreak
   }%
@@ -6468,7 +6807,7 @@ end
     % commands also insert a nobreak penalty, and we don't want to allow
     % a break between a section heading and a defun.
     %
-    % As a minor refinement, we avoid "club" headers by signalling
+    % As a further refinement, we avoid "club" headers by signalling
     % with penalty of 10003 after the very first @deffn in the
     % sequence (see above), and penalty of 10002 after any following
     % @def command.
@@ -6505,7 +6844,7 @@ end
     #1#2 \endheader
     % common ending:
     \interlinepenalty = 10000
-    \advance\rightskip by 0pt plus 1fil
+    \advance\rightskip by 0pt plus 1fil\relax
     \endgraf
     \nobreak\vskip -\parskip
     \penalty\defunpenalty  % signal to \startdefun and \dodefunx
@@ -6535,13 +6874,36 @@ end
 \def\domakedefun#1#2#3{%
   \envdef#1{%
     \startdefun
+    \doingtypefnfalse    % distinguish typed functions from all else
     \parseargusing\activeparens{\printdefunline#3}%
   }%
   \def#2{\dodefunx#1}%
   \def#3%
 }
 
-%%% Untyped functions:
+\newif\ifdoingtypefn       % doing typed function?
+\newif\ifrettypeownline    % typeset return type on its own line?
+
+% @deftypefnnewline on|off says whether the return type of typed functions
+% are printed on their own line.  This affects @deftypefn, @deftypefun,
+% @deftypeop, and @deftypemethod.
+% 
+\parseargdef\deftypefnnewline{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETtxideftypefnnl\endcsname
+      = \empty
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETtxideftypefnnl\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @txideftypefnnl value `\temp',
+                must be on|off}%
+  \fi\fi
+}
+
+% Untyped functions:
 
 % @deffn category name args
 \makedefun{deffn}{\deffngeneral{}}
@@ -6560,7 +6922,7 @@ end
   \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
 }
 
-%%% Typed functions:
+% Typed functions:
 
 % @deftypefn category type name args
 \makedefun{deftypefn}{\deftypefngeneral{}}
@@ -6575,10 +6937,11 @@ end
 %
 \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
   \dosubind{fn}{\code{#4}}{#1}%
+  \doingtypefntrue
   \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
 }
 
-%%% Typed variables:
+% Typed variables:
 
 % @deftypevr category type var args
 \makedefun{deftypevr}{\deftypecvgeneral{}}
@@ -6596,7 +6959,7 @@ end
   \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
 }
 
-%%% Untyped variables:
+% Untyped variables:
 
 % @defvr category var args
 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
@@ -6607,7 +6970,8 @@ end
 % \defcvof {category of}class var args
 \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
 
-%%% Type:
+% Types:
+
 % @deftp category name args
 \makedefun{deftp}#1 #2 #3\endheader{%
   \doind{tp}{\code{#2}}%
@@ -6635,25 +6999,49 @@ end
 % We are followed by (but not passed) the arguments, if any.
 %
 \def\defname#1#2#3{%
+  \par
   % Get the values of \leftskip and \rightskip as they were outside the @def...
   \advance\leftskip by -\defbodyindent
   %
-  % How we'll format the type name.  Putting it in brackets helps
+  % Determine if we are typesetting the return type of a typed function
+  % on a line by itself.
+  \rettypeownlinefalse
+  \ifdoingtypefn  % doing a typed function specifically?
+    % then check user option for putting return type on its own line:
+    \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
+      \rettypeownlinetrue
+    \fi
+  \fi
+  %
+  % How we'll format the category name.  Putting it in brackets helps
   % distinguish it from the body text that may end up on the next line
   % just below it.
   \def\temp{#1}%
   \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
   %
-  % Figure out line sizes for the paragraph shape.
+  % Figure out line sizes for the paragraph shape.  We'll always have at
+  % least two.
+  \tempnum = 2
+  %
   % The first line needs space for \box0; but if \rightskip is nonzero,
   % we need only space for the part of \box0 which exceeds it:
   \dimen0=\hsize  \advance\dimen0 by -\wd0  \advance\dimen0 by \rightskip
+  %
+  % If doing a return type on its own line, we'll have another line.
+  \ifrettypeownline
+    \advance\tempnum by 1
+    \def\maybeshapeline{0in \hsize}%
+  \else
+    \def\maybeshapeline{}%
+  \fi
+  %
   % The continuations:
   \dimen2=\hsize  \advance\dimen2 by -\defargsindent
-  % (plain.tex says that \dimen1 should be used only as global.)
-  \parshape 2 0in \dimen0 \defargsindent \dimen2
   %
-  % Put the type name to the right margin.
+  % The final paragraph shape:
+  \parshape \tempnum  0in \dimen0  \maybeshapeline  \defargsindent \dimen2
+  %
+  % Put the category name at the right margin.
   \noindent
   \hbox to 0pt{%
     \hfil\box0 \kern-\hsize
@@ -6675,8 +7063,16 @@ end
     % . this still does not fix the ?` and !` ligatures, but so far no
     %   one has made identifiers using them :).
     \df \tt
-    \def\temp{#2}% return value type
-    \ifx\temp\empty\else \tclose{\temp} \fi
+    \def\temp{#2}% text of the return type
+    \ifx\temp\empty\else
+      \tclose{\temp}% typeset the return type
+      \ifrettypeownline
+        % put return type on its own line; prohibit line break following:
+        \hfil\vadjust{\nobreak}\break  
+      \else
+        \space  % type on same line, so just followed by a space
+      \fi
+    \fi           % no return type
     #3% output function name
   }%
   {\rm\enskip}% hskip 0.5 em of \tenrm
@@ -6696,7 +7092,10 @@ end
   \df \sl \hyphenchar\font=0
   %
   % On the other hand, if an argument has two dashes (for instance), we
-  % want a way to get ttsl.  Let's try @var for that.
+  % want a way to get ttsl.  We used to recommend @var for that, so
+  % leave the code in, but it's strange for @var to lead to typewriter.
+  % Nowadays we recommend @code, since the difference between a ttsl hyphen
+  % and a tt hyphen is pretty tiny.  @code also disables ?` !`.
   \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
   #1%
   \sl\hyphenchar\font=45
@@ -6794,7 +7193,7 @@ end
 
 % To do this right we need a feature of e-TeX, \scantokens,
 % which we arrange to emulate with a temporary file in ordinary TeX.
-\ifx\eTeXversion\undefined
+\ifx\eTeXversion\thisisundefined
   \newwrite\macscribble
   \def\scantokens#1{%
     \toks0={#1}%
@@ -6805,25 +7204,30 @@ end
   }
 \fi
 
-\def\scanmacro#1{%
-  \begingroup
-    \newlinechar`\^^M
-    \let\xeatspaces\eatspaces
-    % Undo catcode changes of \startcontents and \doprintindex
-    % When called from @insertcopying or (short)caption, we need active
-    % backslash to get it printed correctly.  Previously, we had
-    % \catcode`\\=\other instead.  We'll see whether a problem appears
-    % with macro expansion.				--kasal, 19aug04
-    \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
-    % ... and \example
-    \spaceisspace
-    %
-    % Append \endinput to make sure that TeX does not see the ending newline.
-    % I've verified that it is necessary both for e-TeX and for ordinary TeX
-    %							--kasal, 29nov03
-    \scantokens{#1\endinput}%
-  \endgroup
-}
+\def\scanmacro#1{\begingroup
+  \newlinechar`\^^M
+  \let\xeatspaces\eatspaces
+  %
+  % Undo catcode changes of \startcontents and \doprintindex
+  % When called from @insertcopying or (short)caption, we need active
+  % backslash to get it printed correctly.  Previously, we had
+  % \catcode`\\=\other instead.  We'll see whether a problem appears
+  % with macro expansion.				--kasal, 19aug04
+  \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+  %
+  % ... and for \example:
+  \spaceisspace
+  %
+  % The \empty here causes a following catcode 5 newline to be eaten as
+  % part of reading whitespace after a control sequence.  It does not
+  % eat a catcode 13 newline.  There's no good way to handle the two
+  % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
+  % would then have different behavior).  See the Macro Details node in
+  % the manual for the workaround we recommend for macros and
+  % line-oriented commands.
+  % 
+  \scantokens{#1\empty}%
+\endgroup}
 
 \def\scanexp#1{%
   \edef\temp{\noexpand\scanmacro{#1}}%
@@ -6877,17 +7281,18 @@ end
 
 % Macro bodies are absorbed as an argument in a context where
 % all characters are catcode 10, 11 or 12, except \ which is active
-% (as in normal texinfo). It is necessary to change the definition of \.
-
+% (as in normal texinfo). It is necessary to change the definition of \
+% to recognize macro arguments; this is the job of \mbodybackslash.
+%
 % Non-ASCII encodings make 8-bit characters active, so un-activate
 % them to avoid their expansion.  Must do this non-globally, to
 % confine the change to the current group.
-
+%
 % It's necessary to have hard CRs when the macro is executed. This is
-% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
 % body, and then making it the \newlinechar in \scanmacro.
-
-\def\scanctxt{%
+%
+\def\scanctxt{% used as subroutine
   \catcode`\"=\other
   \catcode`\+=\other
   \catcode`\<=\other
@@ -6900,13 +7305,13 @@ end
   \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
 }
 
-\def\scanargctxt{%
+\def\scanargctxt{% used for copying and captions, not macros.
   \scanctxt
   \catcode`\\=\other
   \catcode`\^^M=\other
 }
 
-\def\macrobodyctxt{%
+\def\macrobodyctxt{% used for @macro definitions
   \scanctxt
   \catcode`\{=\other
   \catcode`\}=\other
@@ -6914,32 +7319,56 @@ end
   \usembodybackslash
 }
 
-\def\macroargctxt{%
+\def\macroargctxt{% used when scanning invocations
   \scanctxt
-  \catcode`\\=\other
+  \catcode`\\=0
 }
+% why catcode 0 for \ in the above?  To recognize \\ \{ \} as "escapes"
+% for the single characters \ { }.  Thus, we end up with the "commands"
+% that would be written @\ @{ @} in a Texinfo document.
+% 
+% We already have @{ and @}.  For @\, we define it here, and only for
+% this purpose, to produce a typewriter backslash (so, the @\ that we
+% define for @math can't be used with @macro calls):
+%
+\def\\{\normalbackslash}%
+% 
+% We would like to do this for \, too, since that is what makeinfo does.
+% But it is not possible, because Texinfo already has a command @, for a
+% cedilla accent.  Documents must use @comma{} instead.
+%
+% \anythingelse will almost certainly be an error of some kind.
+
 
 % \mbodybackslash is the definition of \ in @macro bodies.
 % It maps \foo\ => \csname macarg.foo\endcsname => #N
 % where N is the macro parameter number.
 % We define \csname macarg.\endcsname to be \realbackslash, so
 % \\ in macro replacement text gets you a backslash.
-
+%
 {\catcode`@=0 @catcode`@\=@active
  @gdef at usembodybackslash{@let\=@mbodybackslash}
  @gdef at mbodybackslash#1\{@csname macarg.#1 at endcsname}
 }
 \expandafter\def\csname macarg.\endcsname{\realbackslash}
 
+\def\margbackslash#1{\char`\#1 }
+
 \def\macro{\recursivefalse\parsearg\macroxxx}
 \def\rmacro{\recursivetrue\parsearg\macroxxx}
 
 \def\macroxxx#1{%
-  \getargs{#1}%           now \macname is the macname and \argl the arglist
+  \getargs{#1}% now \macname is the macname and \argl the arglist
   \ifx\argl\empty       % no arguments
-     \paramno=0%
+     \paramno=0\relax
   \else
      \expandafter\parsemargdef \argl;%
+     \if\paramno>256\relax
+       \ifx\eTeXversion\thisisundefined
+         \errhelp = \EMsimple
+         \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
+       \fi
+     \fi
   \fi
   \if1\csname ismacro.\the\macname\endcsname
      \message{Warning: redefining \the\macname}%
@@ -6986,46 +7415,269 @@ end
 % an opening brace, and that opening brace is not consumed.
 \def\getargs#1{\getargsxxx#1{}}
 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
-\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacname#1 #2\relax{\macname={#1}}
 \def\getmacargs#1{\def\argl{#1}}
 
+% For macro processing make @ a letter so that we can make Texinfo private macro names.
+\edef\texiatcatcode{\the\catcode`\@}
+\catcode `@=11\relax
+
 % Parse the optional {params} list.  Set up \paramno and \paramlist
-% so \defmacro knows what to do.  Define \macarg.blah for each blah
-% in the params list, to be ##N where N is the position in that list.
+% so \defmacro knows what to do.  Define \macarg.BLAH for each BLAH
+% in the params list to some hook where the argument si to be expanded.  If
+% there are less than 10 arguments that hook is to be replaced by ##N where N
+% is the position in that list, that is to say the macro arguments are to be
+% defined `a la TeX in the macro body.  
+%
 % That gets used by \mbodybackslash (above).
-
+%
 % We need to get `macro parameter char #' into several definitions.
-% The technique used is stolen from LaTeX:  let \hash be something
+% The technique used is stolen from LaTeX: let \hash be something
 % unexpandable, insert that wherever you need a #, and then redefine
 % it to # just before using the token list produced.
 %
 % The same technique is used to protect \eatspaces till just before
 % the macro is used.
-
-\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
-        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+%
+% If there are 10 or more arguments, a different technique is used, where the
+% hook remains in the body, and when macro is to be expanded the body is
+% processed again to replace the arguments.
+%
+% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
+% argument N value and then \edef  the body (nothing else will expand because of
+% the catcode regime underwhich the body was input).
+%
+% If you compile with TeX (not eTeX), and you have macros with 10 or more
+% arguments, you need that no macro has more than 256 arguments, otherwise an
+% error is produced.
+\def\parsemargdef#1;{%
+  \paramno=0\def\paramlist{}%
+  \let\hash\relax
+  \let\xeatspaces\relax
+  \parsemargdefxxx#1,;,%
+  % In case that there are 10 or more arguments we parse again the arguments
+  % list to set new definitions for the \macarg.BLAH macros corresponding to
+  % each BLAH argument. It was anyhow needed to parse already once this list
+  % in order to count the arguments, and as macros with at most 9 arguments
+  % are by far more frequent than macro with 10 or more arguments, defining
+  % twice the \macarg.BLAH macros does not cost too much processing power.
+  \ifnum\paramno<10\relax\else
+    \paramno0\relax
+    \parsemmanyargdef@@#1,;,% 10 or more arguments
+  \fi
+}
 \def\parsemargdefxxx#1,{%
   \if#1;\let\next=\relax
   \else \let\next=\parsemargdefxxx
-    \advance\paramno by 1%
+    \advance\paramno by 1
     \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
         {\xeatspaces{\hash\the\paramno}}%
     \edef\paramlist{\paramlist\hash\the\paramno,}%
   \fi\next}
 
+\def\parsemmanyargdef@@#1,{%
+  \if#1;\let\next=\relax
+  \else 
+    \let\next=\parsemmanyargdef@@
+    \edef\tempb{\eatspaces{#1}}%
+    \expandafter\def\expandafter\tempa
+       \expandafter{\csname macarg.\tempb\endcsname}%
+    % Note that we need some extra \noexpand\noexpand, this is because we
+    % don't want \the  to be expanded in the \parsermacbody  as it uses an
+    % \xdef .
+    \expandafter\edef\tempa
+      {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
+    \advance\paramno by 1\relax
+  \fi\next}
+
 % These two commands read recursive and nonrecursive macro bodies.
 % (They're different since rec and nonrec macros end differently.)
+%
 
+\catcode `\@\texiatcatcode
 \long\def\parsemacbody#1 at end macro%
 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
 \long\def\parsermacbody#1 at end rmacro%
 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\catcode `\@=11\relax
+
+\let\endargs@\relax
+\let\nil@\relax
+\def\nilm@{\nil@}%
+\long\def\nillm@{\nil@}%
+
+% This macro is expanded during the Texinfo macro expansion, not during its
+% definition.  It gets all the arguments values and assigns them to macros
+% macarg.ARGNAME
+%
+% #1 is the macro name
+% #2 is the list of argument names
+% #3 is the list of argument values
+\def\getargvals@#1#2#3{%
+  \def\macargdeflist@{}%
+  \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
+  \def\paramlist{#2,\nil@}%
+  \def\macroname{#1}%
+  \begingroup
+  \macroargctxt
+  \def\argvaluelist{#3,\nil@}%
+  \def\@tempa{#3}%
+  \ifx\@tempa\empty
+    \setemptyargvalues@
+  \else
+    \getargvals@@
+  \fi
+}
+
+% 
+\def\getargvals@@{%
+  \ifx\paramlist\nilm@
+      % Some sanity check needed here that \argvaluelist is also empty.
+      \ifx\argvaluelist\nillm@
+      \else
+        \errhelp = \EMsimple
+        \errmessage{Too many arguments in macro `\macroname'!}%
+      \fi
+      \let\next\macargexpandinbody@
+  \else
+    \ifx\argvaluelist\nillm@
+       % No more arguments values passed to macro.  Set remaining named-arg
+       % macros to empty.
+       \let\next\setemptyargvalues@
+    \else
+      % pop current arg name into \@tempb
+      \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
+      \expandafter\@tempa\expandafter{\paramlist}%
+       % pop current argument value into \@tempc
+      \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
+      \expandafter\@tempa\expandafter{\argvaluelist}%
+       % Here \@tempb is the current arg name and \@tempc is the current arg value.
+       % First place the new argument macro definition into \@tempd
+       \expandafter\macname\expandafter{\@tempc}%
+       \expandafter\let\csname macarg.\@tempb\endcsname\relax
+       \expandafter\def\expandafter\@tempe\expandafter{%
+         \csname macarg.\@tempb\endcsname}%
+       \edef\@tempd{\long\def\@tempe{\the\macname}}%
+       \push@\@tempd\macargdeflist@
+       \let\next\getargvals@@
+    \fi
+  \fi
+  \next
+}
+
+\def\push@#1#2{%
+  \expandafter\expandafter\expandafter\def
+  \expandafter\expandafter\expandafter#2%
+  \expandafter\expandafter\expandafter{%
+  \expandafter#1#2}%
+}
+
+% Replace arguments by their values in the macro body, and place the result
+% in macro \@tempa
+\def\macvalstoargs@{%
+  %  To do this we use the property that token registers that are \the'ed
+  % within an \edef  expand only once. So we are going to place all argument
+  % values into respective token registers.
+  %
+  % First we save the token context, and initialize argument numbering.
+  \begingroup
+    \paramno0\relax
+    % Then, for each argument number #N, we place the corresponding argument
+    % value into a new token list register \toks#N
+    \expandafter\putargsintokens@\saveparamlist@,;,%
+    % Then, we expand the body so that argument are replaced by their
+    % values. The trick for values not to be expanded themselves is that they
+    % are within tokens and that tokens expand only once in an \edef .
+    \edef\@tempc{\csname mac.\macroname .body\endcsname}%
+    % Now we restore the token stack pointer to free the token list registers
+    % which we have used, but we make sure that expanded body is saved after
+    % group.
+    \expandafter
+  \endgroup
+  \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
+  }
+
+\def\macargexpandinbody@{% 
+  %% Define the named-macro outside of this group and then close this group. 
+  \expandafter
+  \endgroup
+  \macargdeflist@
+  % First the replace in body the macro arguments by their values, the result
+  % is in \@tempa .
+  \macvalstoargs@
+  % Then we point at the \norecurse or \gobble (for recursive) macro value
+  % with \@tempb .
+  \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
+  % Depending on whether it is recursive or not, we need some tailing
+  % \egroup .
+  \ifx\@tempb\gobble
+     \let\@tempc\relax
+  \else
+     \let\@tempc\egroup
+  \fi
+  % And now we do the real job:
+  \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
+  \@tempd
+}
+
+\def\putargsintokens@#1,{%
+  \if#1;\let\next\relax
+  \else
+    \let\next\putargsintokens@
+    % First we allocate the new token list register, and give it a temporary
+    % alias \@tempb .
+    \toksdef\@tempb\the\paramno
+    % Then we place the argument value into that token list register.
+    \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
+    \expandafter\@tempb\expandafter{\@tempa}%
+    \advance\paramno by 1\relax
+  \fi
+  \next
+}
 
-% This defines the macro itself. There are six cases: recursive and
-% nonrecursive macros of zero, one, and many arguments.
+% Save the token stack pointer into macro #1
+\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
+% Restore the token stack pointer from number in macro #1
+\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
+% newtoks that can be used non \outer .
+\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
+
+% Tailing missing arguments are set to empty
+\def\setemptyargvalues@{%
+  \ifx\paramlist\nilm@
+    \let\next\macargexpandinbody@
+  \else
+    \expandafter\setemptyargvaluesparser@\paramlist\endargs@
+    \let\next\setemptyargvalues@
+  \fi
+  \next
+}
+
+\def\setemptyargvaluesparser@#1,#2\endargs@{%
+  \expandafter\def\expandafter\@tempa\expandafter{%
+    \expandafter\def\csname macarg.#1\endcsname{}}%
+  \push@\@tempa\macargdeflist@
+  \def\paramlist{#2}%
+}
+
+% #1 is the element target macro
+% #2 is the list macro
+% #3,#4\endargs@ is the list value
+\def\pop@#1#2#3,#4\endargs@{%
+   \def#1{#3}%
+   \def#2{#4}%
+}
+\long\def\longpop@#1#2#3,#4\endargs@{%
+   \long\def#1{#3}%
+   \long\def#2{#4}%
+}
+
+% This defines a Texinfo @macro. There are eight cases: recursive and
+% nonrecursive macros of zero, one, up to nine, and many arguments.
 % Much magic with \expandafter here.
 % \xdef is used so that macro definitions will survive the file
 % they're defined in; @include reads the file inside a group.
+%
 \def\defmacro{%
   \let\hash=##% convert placeholders to macro parameter chars
   \ifrecursive
@@ -7040,17 +7692,25 @@ end
          \expandafter\noexpand\csname\the\macname xxx\endcsname}%
       \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
          \egroup\noexpand\scanmacro{\temp}}%
-    \else % many
-      \expandafter\xdef\csname\the\macname\endcsname{%
-         \bgroup\noexpand\macroargctxt
-         \noexpand\csname\the\macname xx\endcsname}%
-      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
-          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
-      \expandafter\expandafter
-      \expandafter\xdef
-      \expandafter\expandafter
-        \csname\the\macname xxx\endcsname
-          \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+    \else
+      \ifnum\paramno<10\relax % at most 9
+        \expandafter\xdef\csname\the\macname\endcsname{%
+           \bgroup\noexpand\macroargctxt
+           \noexpand\csname\the\macname xx\endcsname}%
+        \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+            \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+        \expandafter\expandafter
+        \expandafter\xdef
+        \expandafter\expandafter
+          \csname\the\macname xxx\endcsname
+            \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+      \else % 10 or more
+        \expandafter\xdef\csname\the\macname\endcsname{%
+          \noexpand\getargvals@{\the\macname}{\argl}%
+        }%    
+        \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+        \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
+      \fi
     \fi
   \else
     \ifcase\paramno
@@ -7067,29 +7727,40 @@ end
         \egroup
         \noexpand\norecurse{\the\macname}%
         \noexpand\scanmacro{\temp}\egroup}%
-    \else % many
-      \expandafter\xdef\csname\the\macname\endcsname{%
-         \bgroup\noexpand\macroargctxt
-         \expandafter\noexpand\csname\the\macname xx\endcsname}%
-      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
-          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
-      \expandafter\expandafter
-      \expandafter\xdef
-      \expandafter\expandafter
-      \csname\the\macname xxx\endcsname
-      \paramlist{%
-          \egroup
-          \noexpand\norecurse{\the\macname}%
-          \noexpand\scanmacro{\temp}\egroup}%
+    \else % at most 9
+      \ifnum\paramno<10\relax
+        \expandafter\xdef\csname\the\macname\endcsname{%
+           \bgroup\noexpand\macroargctxt
+           \expandafter\noexpand\csname\the\macname xx\endcsname}%
+        \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+            \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+        \expandafter\expandafter
+        \expandafter\xdef
+        \expandafter\expandafter
+        \csname\the\macname xxx\endcsname
+        \paramlist{%
+            \egroup
+            \noexpand\norecurse{\the\macname}%
+            \noexpand\scanmacro{\temp}\egroup}%
+      \else % 10 or more:
+        \expandafter\xdef\csname\the\macname\endcsname{%
+          \noexpand\getargvals@{\the\macname}{\argl}%
+        }%
+        \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
+        \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
+      \fi
     \fi
   \fi}
 
+\catcode `\@\texiatcatcode\relax
+
 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
 
 % \braceorline decides whether the next nonwhitespace character is a
 % {.  If so it reads up to the closing }, if not, it reads the whole
 % line.  Whatever was read is then fed to the next control sequence
-% as an argument (by \parsebrace or \parsearg)
+% as an argument (by \parsebrace or \parsearg).
+% 
 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
 \def\braceorlinexxx{%
   \ifx\nchar\bgroup\else
@@ -7099,7 +7770,8 @@ end
 
 % @alias.
 % We need some trickery to remove the optional spaces around the equal
-% sign.  Just make them active and then expand them all to nothing.
+% sign.  Make them active and then expand them all to nothing.
+%
 \def\alias{\parseargusing\obeyspaces\aliasxxx}
 \def\aliasxxx #1{\aliasyyy#1\relax}
 \def\aliasyyy #1=#2\relax{%
@@ -7120,7 +7792,8 @@ end
 
 % @inforef is relatively simple.
 \def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+\def\inforefzzz #1,#2,#3,#4**{%
+  \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
   node \samp{\ignorespaces#1{}}}
 
 % @node's only job in TeX is to define \lastnode, which is used in
@@ -7181,11 +7854,32 @@ end
       \toks0 = \expandafter{\lastsection}%
       \immediate \writexrdef{title}{\the\toks0 }%
       \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
-      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
+      \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
     }%
   \fi
 }
 
+% @xrefautosectiontitle on|off says whether @section(ing) names are used
+% automatically in xrefs, if the third arg is not explicitly specified.
+% This was provided as a "secret" @set xref-automatic-section-title
+% variable, now it's official.
+% 
+\parseargdef\xrefautomaticsectiontitle{%
+  \def\temp{#1}%
+  \ifx\temp\onword
+    \expandafter\let\csname SETxref-automatic-section-title\endcsname
+      = \empty
+  \else\ifx\temp\offword
+    \expandafter\let\csname SETxref-automatic-section-title\endcsname
+      = \relax
+  \else
+    \errhelp = \EMsimple
+    \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
+                must be on|off}%
+  \fi\fi
+}
+
+% 

 % @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
 % the node name, #2 the name of the Info cross-reference, #3 the printed
 % node name, #4 the name of the Info file, #5 the name of the printed
@@ -7194,26 +7888,41 @@ end
 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
 \def\ref#1{\xrefX[#1,,,,,,,]}
+%
+\newbox\toprefbox
+\newbox\printedrefnamebox
+\newbox\infofilenamebox
+\newbox\printedmanualbox
+%
 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
   \unsepspaces
-  \def\printedmanual{\ignorespaces #5}%
+  %
+  % Get args without leading/trailing spaces.
   \def\printedrefname{\ignorespaces #3}%
-  \setbox1=\hbox{\printedmanual\unskip}%
-  \setbox0=\hbox{\printedrefname\unskip}%
-  \ifdim \wd0 = 0pt
+  \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
+  %
+  \def\infofilename{\ignorespaces #4}%
+  \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
+  %
+  \def\printedmanual{\ignorespaces #5}%
+  \setbox\printedmanualbox  = \hbox{\printedmanual\unskip}%
+  %
+  % If the printed reference name (arg #3) was not explicitly given in
+  % the @xref, figure out what we want to use.
+  \ifdim \wd\printedrefnamebox = 0pt
     % No printed node name was explicitly given.
-    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
-      % Use the node name inside the square brackets.
+    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
+      % Not auto section-title: use node name inside the square brackets.
       \def\printedrefname{\ignorespaces #1}%
     \else
-      % Use the actual chapter/section title appear inside
-      % the square brackets.  Use the real section title if we have it.
-      \ifdim \wd1 > 0pt
-        % It is in another manual, so we don't have it.
+      % Auto section-title: use chapter/section title inside
+      % the square brackets if we have it.
+      \ifdim \wd\printedmanualbox > 0pt
+        % It is in another manual, so we don't have it; use node name.
         \def\printedrefname{\ignorespaces #1}%
       \else
         \ifhavexrefs
-          % We know the real title if we have the xref values.
+          % We (should) know the real title if we have the xref values.
           \def\printedrefname{\refx{#1-title}{}}%
         \else
           % Otherwise just copy the Info node name.
@@ -7227,13 +7936,20 @@ end
   \ifpdf
     {\indexnofonts
      \turnoffactive
+     \makevalueexpandable
      % This expands tokens, so do it after making catcode changes, so _
-     % etc. don't get their TeX definitions.
+     % etc. don't get their TeX definitions.  This ignores all spaces in
+     % #4, including (wrongly) those in the middle of the filename.
      \getfilename{#4}%
      %
-     % See comments at \activebackslashdouble.
-     {\activebackslashdouble \xdef\pdfxrefdest{#1}%
-      \backslashparens\pdfxrefdest}%
+     % This (wrongly) does not take account of leading or trailing
+     % spaces in #1, which should be ignored.
+     \edef\pdfxrefdest{#1}%
+     \ifx\pdfxrefdest\empty
+       \def\pdfxrefdest{Top}% no empty targets
+     \else
+       \txiescapepdf\pdfxrefdest  % escape PDF special chars
+     \fi
      %
      \leavevmode
      \startlink attr{/Border [0 0 0]}%
@@ -7260,29 +7976,42 @@ end
   \iffloat\Xthisreftitle
     % If the user specified the print name (third arg) to the ref,
     % print it instead of our usual "Figure 1.2".
-    \ifdim\wd0 = 0pt
+    \ifdim\wd\printedrefnamebox = 0pt
       \refx{#1-snt}{}%
     \else
       \printedrefname
     \fi
     %
-    % if the user also gave the printed manual name (fifth arg), append
+    % If the user also gave the printed manual name (fifth arg), append
     % "in MANUALNAME".
-    \ifdim \wd1 > 0pt
+    \ifdim \wd\printedmanualbox > 0pt
       \space \putwordin{} \cite{\printedmanual}%
     \fi
   \else
     % node/anchor (non-float) references.
+    % 
+    % If we use \unhbox to print the node names, TeX does not insert
+    % empty discretionaries after hyphens, which means that it will not
+    % find a line break at a hyphen in a node names.  Since some manuals
+    % are best written with fairly long node names, containing hyphens,
+    % this is a loss.  Therefore, we give the text of the node name
+    % again, so it is as if TeX is seeing it for the first time.
+    % 
+    \ifdim \wd\printedmanualbox > 0pt
+      % Cross-manual reference with a printed manual name.
+      % 
+      \crossmanualxref{\cite{\printedmanual\unskip}}%
+    %
+    \else\ifdim \wd\infofilenamebox > 0pt
+      % Cross-manual reference with only an info filename (arg 4), no
+      % printed manual name (arg 5).  This is essentially the same as
+      % the case above; we output the filename, since we have nothing else.
+      % 
+      \crossmanualxref{\code{\infofilename\unskip}}%
     %
-    % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
-    % insert empty discretionaries after hyphens, which means that it will
-    % not find a line break at a hyphen in a node names.  Since some manuals
-    % are best written with fairly long node names, containing hyphens, this
-    % is a loss.  Therefore, we give the text of the node name again, so it
-    % is as if TeX is seeing it for the first time.
-    \ifdim \wd1 > 0pt
-      \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
     \else
+      % Reference within this manual.
+      %
       % _ (for example) has to be the character _ for the purposes of the
       % control sequence corresponding to the node, but it has to expand
       % into the usual \leavevmode...\vrule stuff for purposes of
@@ -7294,7 +8023,7 @@ end
        \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
        \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
       }%
-      % output the `[mynode]' via a macro so it can be overridden.
+      % output the `[mynode]' via the macro below so it can be overridden.
       \xrefprintnodename\printedrefname
       %
       % But we always want a comma and a space:
@@ -7302,11 +8031,37 @@ end
       %
       % output the `page 3'.
       \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
-    \fi
+    \fi\fi
   \fi
   \endlink
 \endgroup}
 
+% Output a cross-manual xref to #1.  Used just above (twice).
+% 
+% Only include the text "Section ``foo'' in" if the foo is neither
+% missing or Top.  Thus, @xref{,,,foo,The Foo Manual} outputs simply
+% "see The Foo Manual", the idea being to refer to the whole manual.
+% 
+% But, this being TeX, we can't easily compare our node name against the
+% string "Top" while ignoring the possible spaces before and after in
+% the input.  By adding the arbitrary 7sp below, we make it much less
+% likely that a real node name would have the same width as "Top" (e.g.,
+% in a monospaced font).  Hopefully it will never happen in practice.
+% 
+% For the same basic reason, we retypeset the "Top" at every
+% reference, since the current font is indeterminate.
+% 
+\def\crossmanualxref#1{%
+  \setbox\toprefbox = \hbox{Top\kern7sp}%
+  \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
+  \ifdim \wd2 > 7sp  % nonempty?
+    \ifdim \wd2 = \wd\toprefbox \else  % same as Top?
+      \putwordSection{} ``\printedrefname'' \putwordin{}\space
+    \fi
+  \fi
+  #1%
+}
+
 % This macro is called from \xrefX for the `[nodename]' part of xref
 % output.  It's a separate macro only so it can be changed more easily,
 % since square brackets don't work well in some documents.  Particularly
@@ -7357,7 +8112,8 @@ end
     \angleleft un\-de\-fined\angleright
     \iflinks
       \ifhavexrefs
-        \message{\linenumber Undefined cross reference `#1'.}%
+        {\toks0 = {#1}% avoid expansion of possibly-complex value
+         \message{\linenumber Undefined cross reference `\the\toks0'.}}%
       \else
         \ifwarnedxrefs\else
           \global\warnedxrefstrue
@@ -7521,7 +8277,7 @@ end
 % space to prevent strange expansion errors.)
 \def\supereject{\par\penalty -20000\footnoteno =0 }
 
-% @footnotestyle is meaningful for info output only.
+% @footnotestyle is meaningful for Info output only.
 \let\footnotestyle=\comment
 
 {\catcode `\@=11
@@ -7584,6 +8340,8 @@ end
   % expands into a box, it must come within the paragraph, lest it
   % provide a place where TeX can split the footnote.
   \footstrut
+  %
+  % Invoke rest of plain TeX footnote routine.
   \futurelet\next\fo at t
 }
 }%end \catcode `\@=11
@@ -7671,7 +8429,7 @@ end
   it from ftp://tug.org/tex/epsf.tex.}
 %
 \def\image#1{%
-  \ifx\epsfbox\undefined
+  \ifx\epsfbox\thisisundefined
     \ifwarnednoepsf \else
       \errhelp = \noepsfhelp
       \errmessage{epsf.tex not found, images will be ignored}%
@@ -7687,7 +8445,7 @@ end
 % #2 is (optional) width, #3 is (optional) height.
 % #4 is (ignored optional) html alt text.
 % #5 is (ignored optional) extension.
-% #6 is just the usual extra ignored arg for parsing this stuff.
+% #6 is just the usual extra ignored arg for parsing stuff.
 \newif\ifimagevmode
 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
   \catcode`\^^M = 5     % in case we're inside an example
@@ -7695,6 +8453,13 @@ end
   % If the image is by itself, center it.
   \ifvmode
     \imagevmodetrue
+  \else \ifx\centersub\centerV
+    % for @center @image, we need a vbox so we can have our vertical space
+    \imagevmodetrue
+    \vbox\bgroup % vbox has better behavior than vtop herev
+  \fi\fi
+  %
+  \ifimagevmode
     \nobreak\medskip
     % Usually we'll have text after the image which will insert
     % \parskip glue, so insert it here too to equalize the space
@@ -7704,9 +8469,13 @@ end
   \fi
   %
   % Leave vertical mode so that indentation from an enclosing
-  % environment such as @quotation is respected.  On the other hand, if
-  % it's at the top level, we don't want the normal paragraph indentation.
-  \noindent
+  %  environment such as @quotation is respected.
+  % However, if we're at the top level, we don't want the
+  %  normal paragraph indentation.
+  % On the other hand, if we are in the case of @center @image, we don't
+  %  want to start a paragraph, which will create a hsize-width box and
+  %  eradicate the centering.
+  \ifx\centersub\centerV\else \noindent \fi
   %
   % Output the image.
   \ifpdf
@@ -7718,7 +8487,10 @@ end
     \epsfbox{#1.eps}%
   \fi
   %
-  \ifimagevmode \medskip \fi  % space after the standalone image
+  \ifimagevmode
+    \medskip  % space after a standalone image
+  \fi  
+  \ifx\centersub\centerV \egroup \fi
 \endgroup}
 
 
@@ -8136,7 +8908,7 @@ directory should work if nowhere else does.}
 %
 % Latin1 (ISO-8859-1) character definitions.
 \def\latonechardefs{%
-  \gdef^^a0{~}
+  \gdef^^a0{\tie}
   \gdef^^a1{\exclamdown}
   \gdef^^a2{\missingcharmsg{CENT SIGN}}
   \gdef^^a3{{\pounds}}
@@ -8166,7 +8938,7 @@ directory should work if nowhere else does.}
   \gdef^^b9{$^1$}
   \gdef^^ba{\ordm}
   %
-  \gdef^^bb{\guilletright}
+  \gdef^^bb{\guillemetright}
   \gdef^^bc{$1\over4$}
   \gdef^^bd{$1\over2$}
   \gdef^^be{$3\over4$}
@@ -8258,7 +9030,7 @@ directory should work if nowhere else does.}
 
 % Latin2 (ISO-8859-2) character definitions.
 \def\lattwochardefs{%
-  \gdef^^a0{~}
+  \gdef^^a0{\tie}
   \gdef^^a1{\ogonek{A}}
   \gdef^^a2{\u{}}
   \gdef^^a3{\L}
@@ -8339,8 +9111,8 @@ directory should work if nowhere else does.}
   \gdef^^ea{\ogonek{e}}
   \gdef^^eb{\"e}
   \gdef^^ec{\v e}
-  \gdef^^ed{\'\i}
-  \gdef^^ee{\^\i}
+  \gdef^^ed{\'{\dotless{i}}}
+  \gdef^^ee{\^{\dotless{i}}}
   \gdef^^ef{\v d}
   %
   \gdef^^f0{\dh}
@@ -8431,7 +9203,7 @@ directory should work if nowhere else does.}
 
   \gdef\DeclareUnicodeCharacter#1#2{%
     \countUTFz = "#1\relax
-    \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
+    %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
     \begingroup
       \parseXMLCharref
       \def\UTFviiiTwoOctets##1##2{%
@@ -8899,8 +9671,8 @@ directory should work if nowhere else does.}
 % Prevent underfull vbox error messages.
 \vbadness = 10000
 
-% Don't be so finicky about underfull hboxes, either.
-\hbadness = 2000
+% Don't be very finicky about underfull hboxes, either.
+\hbadness = 6666
 
 % Following George Bush, get rid of widows and orphans.
 \widowpenalty=10000
@@ -9107,28 +9879,21 @@ directory should work if nowhere else does.}
 
 \message{and turning on texinfo input format.}
 
+\def^^L{\par} % remove \outer, so ^L can appear in an @comment
+
 % DEL is a comment character, in case @c does not suffice.
 \catcode`\^^? = 14
 
 % Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other
-\catcode`\~=\other
-\catcode`\^=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode`\+=\other
-\catcode`\$=\other
-\def\normaldoublequote{"}
-\def\normaltilde{~}
-\def\normalcaret{^}
-\def\normalunderscore{_}
-\def\normalverticalbar{|}
-\def\normalless{<}
-\def\normalgreater{>}
-\def\normalplus{+}
-\def\normaldollar{$}%$ font-lock fix
+\catcode`\"=\other \def\normaldoublequote{"}
+\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
+\catcode`\+=\other \def\normalplus{+}
+\catcode`\<=\other \def\normalless{<}
+\catcode`\>=\other \def\normalgreater{>}
+\catcode`\^=\other \def\normalcaret{^}
+\catcode`\_=\other \def\normalunderscore{_}
+\catcode`\|=\other \def\normalverticalbar{|}
+\catcode`\~=\other \def\normaltilde{~}
 
 % This macro is used to make a character print one way in \tt
 % (where it can probably be output as-is), and another way in other fonts,
@@ -9206,34 +9971,48 @@ directory should work if nowhere else does.}
 
 % In texinfo, backslash is an active character; it prints the backslash
 % in fixed width font.
-\catcode`\\=\active
- at def@normalbackslash{{@tt at backslashcurfont}}
+\catcode`\\=\active  % @ for escape char from now on.
+
+% The story here is that in math mode, the \char of \backslashcurfont
+% ends up printing the roman \ from the math symbol font (because \char
+% in math mode uses the \mathcode, and plain.tex sets
+% \mathcode`\\="026E).  It seems better for @backslashchar{} to always
+% print a typewriter backslash, hence we use an explicit \mathchar,
+% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
+% ignored family value; char position "5C).  We can't use " for the
+% usual hex value because it has already been made active.
+ at def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
+ at let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
+
 % On startup, @fixbackslash assigns:
 %  @let \ = @normalbackslash
-
 % \rawbackslash defines an active \ to do \backslashcurfont.
 % \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other.
+% catcode other.  We switch back and forth between these.
 @gdef at rawbackslash{@let\=@backslashcurfont}
 @gdef at otherbackslash{@let\=@realbackslash}
 
 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'.
-%
- at def@normalturnoffactive{%
-  @let\=@normalbackslash
-  @let"=@normaldoublequote
-  @let~=@normaltilde
-  @let^=@normalcaret
-  @let_=@normalunderscore
-  @let|=@normalverticalbar
-  @let<=@normalless
-  @let>=@normalgreater
-  @let+=@normalplus
-  @let$=@normaldollar %$ font-lock fix
-  @markupsetuplqdefault
-  @markupsetuprqdefault
-  @unsepspaces
+% the literal character `\'.  Also revert - to its normal character, in
+% case the active - from code has slipped in.
+%
+{@catcode`- = @active
+ @gdef at normalturnoffactive{%
+   @let-=@normaldash
+   @let"=@normaldoublequote
+   @let$=@normaldollar %$ font-lock fix
+   @let+=@normalplus
+   @let<=@normalless
+   @let>=@normalgreater
+   @let\=@normalbackslash
+   @let^=@normalcaret
+   @let_=@normalunderscore
+   @let|=@normalverticalbar
+   @let~=@normaltilde
+   @markupsetuplqdefault
+   @markupsetuprqdefault
+   @unsepspaces
+ }
 }
 
 % Make _ and + \other characters, temporarily.
@@ -9262,10 +10041,19 @@ directory should work if nowhere else does.}
 % Say @foo, not \foo, in error messages.
 @escapechar = `@@
 
+% These (along with & and #) are made active for url-breaking, so need
+% active definitions as the normal characters.
+ at def@normaldot{.}
+ at def@normalquest{?}
+ at def@normalslash{/}
+
 % These look ok in all fonts, so just make them not special.
- at catcode`@& = @other
- at catcode`@# = @other
- at catcode`@% = @other
+% @hashchar{} gets its own user-level command, because of #line.
+ at catcode`@& = @other @def at normalamp{&}
+ at catcode`@# = @other @def at normalhash{#}
+ at catcode`@% = @other @def at normalpercent{%}
+
+ at let @hashchar = @normalhash
 
 @c Finally, make ` and ' active, so that txicodequoteundirected and
 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}.  If we
diff --git a/configure b/configure
index 3f726f6..8c6f63d 100755
--- a/configure
+++ b/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for hkl 4.0.3.
+# Generated by GNU Autoconf 2.69 for hkl 4.99.99.1610.
 #
 # Report bugs to <picca at synchrotron-soleil.fr>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -91,6 +89,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -135,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -168,11 +192,20 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
 test \$(( 1 + 1 )) = 2 || exit 1"
   if (eval "$as_required") 2>/dev/null; then :
   as_have_required=yes
@@ -213,14 +246,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -319,10 +363,18 @@ $as_echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -359,19 +411,19 @@ else
 fi # as_fn_arith
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $1" >&2
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -444,6 +496,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -478,16 +534,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -499,28 +555,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -528,161 +564,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 # Sed expression to map a string onto a valid variable name.
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
-
-
-# Check that we are running under the correct shell.
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-case X$lt_ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
-  ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $ECHO works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<_LT_EOF
-$*
-_LT_EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
-  if test "X${echo_test_string+set}" != Xset; then
-    # find a string as large as possible, as long as the shell can cope with it
-    for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
-      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
-	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
-      then
-        break
-      fi
-    done
-  fi
-
-  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-     test "X$echo_testing_string" = "X$echo_test_string"; then
-    :
-  else
-    # The Solaris, AIX, and Digital Unix default echo programs unquote
-    # backslashes.  This makes it impossible to quote backslashes using
-    #   echo "$something" | sed 's/\\/\\\\/g'
-    #
-    # So, first we look for a working echo in the user's PATH.
-
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for dir in $PATH /usr/ucb; do
-      IFS="$lt_save_ifs"
-      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        ECHO="$dir/echo"
-        break
-      fi
-    done
-    IFS="$lt_save_ifs"
-
-    if test "X$ECHO" = Xecho; then
-      # We didn't find a better echo, so look for alternatives.
-      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        # This shell has a builtin print -r that does the trick.
-        ECHO='print -r'
-      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
-	   test "X$CONFIG_SHELL" != X/bin/ksh; then
-        # If we have ksh, try running configure again with it.
-        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-        export ORIGINAL_CONFIG_SHELL
-        CONFIG_SHELL=/bin/ksh
-        export CONFIG_SHELL
-        exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
-      else
-        # Try using printf.
-        ECHO='printf %s\n'
-        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	  # Cool, printf works
-	  :
-        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	  export CONFIG_SHELL
-	  SHELL="$CONFIG_SHELL"
-	  export SHELL
-	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
-        elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
-        else
-	  # maybe with a smaller string...
-	  prev=:
-
-	  for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
-	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
-	    then
-	      break
-	    fi
-	    prev="$cmd"
-	  done
-
-	  if test "$prev" != 'sed 50q "$0"'; then
-	    echo_test_string=`eval $prev`
-	    export echo_test_string
-	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
-	  else
-	    # Oops.  We lost completely, so just stick with echo.
-	    ECHO=echo
-	  fi
-        fi
-      fi
-    fi
-  fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
-   lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
 
 test -n "$DJDIR" || exec 7<&0 </dev/null
 exec 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
@@ -701,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='hkl'
 PACKAGE_TARNAME='hkl'
-PACKAGE_VERSION='4.0.3'
-PACKAGE_STRING='hkl 4.0.3'
+PACKAGE_VERSION='4.99.99.1610'
+PACKAGE_STRING='hkl 4.99.99.1610'
 PACKAGE_BUGREPORT='picca at synchrotron-soleil.fr'
 PACKAGE_URL=''
 
@@ -746,10 +635,47 @@ ac_includes_default="\
 ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
+GLIB_COMPILE_RESOURCES
+GLIB_MKENUMS
+GOBJECT_QUERY
+GLIB_GENMARSHAL
+GLIB_LIBS
+GLIB_CFLAGS
+GOBJECT_LIBS
+GOBJECT_CFLAGS
+HAVE_INTROSPECTION_FALSE
+HAVE_INTROSPECTION_TRUE
+INTROSPECTION_MAKEFILE
+INTROSPECTION_LIBS
+INTROSPECTION_CFLAGS
+INTROSPECTION_TYPELIBDIR
+INTROSPECTION_GIRDIR
+INTROSPECTION_GENERATE
+INTROSPECTION_COMPILER
+INTROSPECTION_SCANNER
+LTP_GENHTML
+LTP
+SHTOOL
+GTKGLEXTMM_LIBS
+GTKGLEXTMM_CFLAGS
+GLU_LIBS
+GLU_CFLAGS
 GTKMM_LIBS
 GTKMM_CFLAGS
-GHKL_FALSE
-GHKL_TRUE
+GUI_FALSE
+GUI_TRUE
+YAML_LIBS
+YAML_CFLAGS
+G3D_LIBS
+G3D_CFLAGS
+HKL3D_FALSE
+HKL3D_TRUE
+CONDITIONAL_BUILD_DEMOS_FALSE
+CONDITIONAL_BUILD_DEMOS_TRUE
+CONDITIONAL_BUILD_MULTITHREADED_FALSE
+CONDITIONAL_BUILD_MULTITHREADED_TRUE
+opengl_LIBS
+ASY
 GTK_DOC_USE_REBASE_FALSE
 GTK_DOC_USE_REBASE_TRUE
 GTK_DOC_USE_LIBTOOL_FALSE
@@ -760,27 +686,34 @@ GTK_DOC_BUILD_HTML_FALSE
 GTK_DOC_BUILD_HTML_TRUE
 ENABLE_GTK_DOC_FALSE
 ENABLE_GTK_DOC_TRUE
-PKG_CONFIG_LIBDIR
-PKG_CONFIG_PATH
-PKG_CONFIG
+GTKDOC_DEPS_LIBS
+GTKDOC_DEPS_CFLAGS
 HTML_DIR
 GTKDOC_MKPDF
 GTKDOC_REBASE
 GTKDOC_CHECK
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
 LIBOBJS
 ALLOCA
 GSL_LIBS
 GSL_CFLAGS
 GSL_CONFIG
+VMAJ
+release_info
+version_info
 CXXCPP
 OTOOL64
 OTOOL
 LIPO
 NMEDIT
 DSYMUTIL
-lt_ECHO
+MANIFEST_TOOL
 RANLIB
+ac_ct_AR
 AR
+DLLTOOL
 OBJDUMP
 NM
 ac_ct_DUMPBIN
@@ -810,6 +743,7 @@ CC
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -823,6 +757,10 @@ CPPFLAGS
 LDFLAGS
 CXXFLAGS
 CXX
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -887,12 +825,14 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_silent_rules
 enable_dependency_tracking
 enable_shared
 enable_static
 with_pic
 enable_fast_install
 with_gnu_ld
+with_sysroot
 enable_libtool_lock
 with_gsl_prefix
 with_gsl_exec_prefix
@@ -901,7 +841,14 @@ with_html_dir
 enable_gtk_doc
 enable_gtk_doc_html
 enable_gtk_doc_pdf
-enable_ghkl
+enable_multithreaded
+enable_demos
+enable_debug
+enable_hkl3d
+enable_gui
+enable_gcov
+enable_introspection
+enable_glibtest
 '
       ac_precious_vars='build_alias
 host_alias
@@ -919,8 +866,18 @@ CXXCPP
 PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
+GTKDOC_DEPS_CFLAGS
+GTKDOC_DEPS_LIBS
+G3D_CFLAGS
+G3D_LIBS
 GTKMM_CFLAGS
-GTKMM_LIBS'
+GTKMM_LIBS
+GLU_CFLAGS
+GLU_LIBS
+GTKGLEXTMM_CFLAGS
+GTKGLEXTMM_LIBS
+GOBJECT_CFLAGS
+GOBJECT_LIBS'
 
 
 # Initialize some variables set by options.
@@ -983,8 +940,9 @@ do
   fi
 
   case $ac_option in
-  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)	ac_optarg=yes ;;
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -1029,7 +987,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1055,7 +1013,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1259,7 +1217,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1275,7 +1233,7 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1305,8 +1263,8 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) as_fn_error "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information."
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
@@ -1314,7 +1272,7 @@ Try \`$0 --help' for more information."
     # Reject names that are not valid shell variable names.
     case $ac_envvar in #(
       '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
     esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
@@ -1324,7 +1282,7 @@ Try \`$0 --help' for more information."
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1332,13 +1290,13 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error "missing argument to $ac_option"
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
@@ -1361,7 +1319,7 @@ do
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1375,8 +1333,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1391,9 +1347,9 @@ test "$silent" = yes && exec 6>/dev/null
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error "working directory cannot be determined"
+  as_fn_error $? "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error "pwd does not report name of working directory"
+  as_fn_error $? "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
@@ -1432,11 +1388,11 @@ else
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1462,7 +1418,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures hkl 4.0.3 to adapt to many kinds of systems.
+\`configure' configures hkl 4.99.99.1610 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1476,7 +1432,7 @@ Configuration:
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1532,7 +1488,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of hkl 4.0.3:";;
+     short | recursive ) echo "Configuration of hkl 4.99.99.1610:";;
    esac
   cat <<\_ACEOF
 
@@ -1540,8 +1496,12 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
   --enable-shared[=PKGS]  build shared libraries [default=yes]
   --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
@@ -1551,14 +1511,24 @@ Optional Features:
   --enable-gtk-doc        use gtk-doc to build documentation [[default=no]]
   --enable-gtk-doc-html   build documentation in html format [[default=yes]]
   --enable-gtk-doc-pdf    build documentation in pdf format [[default=no]]
-  --enable-ghkl           turn on the ghkl gui [[default=yes]]
+  --enable-multithreaded  build BulletMultiThreaded (default NO)
+  --disable-demos         disable Bullet demos
+  --enable-debug          build with debugging information (default NO)
+  --enable-hkl3d          compile the hkl3d library
+  --disable-gui           do not compile the gui interface
+  --enable-gcov           Enable gcov
+  --enable-introspection=[no/auto/yes]
+                          Enable introspection for this build
+  --disable-glibtest      do not try to compile and run a test GLIB program
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-pic              try to use only PIC/non-PIC objects [default=use
+  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-sysroot=DIR Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).
   --with-gsl-prefix=PFX   Prefix where GSL is installed (optional)
   --with-gsl-exec-prefix=PFX Exec prefix where GSL is installed (optional)
   --with-html-dir=PATH    path to installed docs
@@ -1580,9 +1550,25 @@ Some influential environment variables:
               directories to add to pkg-config's search path
   PKG_CONFIG_LIBDIR
               path overriding pkg-config's built-in search path
+  GTKDOC_DEPS_CFLAGS
+              C compiler flags for GTKDOC_DEPS, overriding pkg-config
+  GTKDOC_DEPS_LIBS
+              linker flags for GTKDOC_DEPS, overriding pkg-config
+  G3D_CFLAGS  C compiler flags for G3D, overriding pkg-config
+  G3D_LIBS    linker flags for G3D, overriding pkg-config
   GTKMM_CFLAGS
               C compiler flags for GTKMM, overriding pkg-config
   GTKMM_LIBS  linker flags for GTKMM, overriding pkg-config
+  GLU_CFLAGS  C compiler flags for GLU, overriding pkg-config
+  GLU_LIBS    linker flags for GLU, overriding pkg-config
+  GTKGLEXTMM_CFLAGS
+              C compiler flags for GTKGLEXTMM, overriding pkg-config
+  GTKGLEXTMM_LIBS
+              linker flags for GTKGLEXTMM, overriding pkg-config
+  GOBJECT_CFLAGS
+              C compiler flags for GOBJECT, overriding pkg-config
+  GOBJECT_LIBS
+              linker flags for GOBJECT, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1650,10 +1636,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-hkl configure 4.0.3
-generated by GNU Autoconf 2.65
+hkl configure 4.99.99.1610
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1697,7 +1683,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_compile
@@ -1735,7 +1721,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1761,7 +1747,7 @@ $as_echo "$ac_try_echo"; } >&5
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } >/dev/null && {
+  test $ac_status = 0; } > conftest.i && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then :
@@ -1772,7 +1758,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1804,7 +1790,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1818,7 +1804,7 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
@@ -1832,7 +1818,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1850,7 +1836,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1891,7 +1877,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1904,7 +1890,7 @@ ac_fn_c_check_func ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1959,7 +1945,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_func
 
@@ -1984,7 +1970,7 @@ $as_echo "$ac_try_echo"; } >&5
     mv -f conftest.er1 conftest.err
   fi
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } >/dev/null && {
+  test $ac_status = 0; } > conftest.i && {
 	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        }; then :
@@ -1995,7 +1981,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_cpp
@@ -2027,7 +2013,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2041,7 +2027,7 @@ fi
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_link
@@ -2055,7 +2041,7 @@ ac_fn_c_check_type ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -2096,7 +2082,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_type
 
@@ -2108,10 +2094,10 @@ $as_echo "$ac_res" >&6; }
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -2147,7 +2133,7 @@ if ac_fn_c_try_cpp "$LINENO"; then :
 else
   ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
 $as_echo "$ac_header_preproc" >&6; }
 
@@ -2170,17 +2156,15 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( cat <<\_ASBOX
-## ------------------------------------------ ##
+( $as_echo "## ------------------------------------------ ##
 ## Report this to picca at synchrotron-soleil.fr ##
-## ------------------------------------------ ##
-_ASBOX
+## ------------------------------------------ ##"
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -2189,15 +2173,145 @@ eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_find_intX_t LINENO BITS VAR
+# -----------------------------------
+# Finds a signed integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_intX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
+$as_echo_n "checking for int$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in int$2_t 'int' 'long int' \
+	 'long long int' 'short int' 'signed char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+	     enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+	        enum { N = $2 / 2 - 1 };
+int
+main ()
+{
+static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+		 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  case $ac_type in #(
+  int$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_intX_t
+
+# ac_fn_c_find_uintX_t LINENO BITS VAR
+# ------------------------------------
+# Finds an unsigned integer type with width BITS, setting cache variable VAR
+# accordingly.
+ac_fn_c_find_uintX_t ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
+$as_echo_n "checking for uint$2_t... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
+     for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
+	 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  case $ac_type in #(
+  uint$2_t) :
+    eval "$3=yes" ;; #(
+  *) :
+    eval "$3=\$ac_type" ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if eval test \"x\$"$3"\" = x"no"; then :
+
+else
+  break
+fi
+     done
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_find_uintX_t
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by hkl $as_me 4.0.3, which was
-generated by GNU Autoconf 2.65.  Invocation command line was
+It was created by hkl $as_me 4.99.99.1610, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2307,11 +2421,9 @@ trap 'exit_status=$?
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -2345,11 +2457,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -2362,11 +2472,9 @@ _ASBOX
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
+      $as_echo "## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
@@ -2380,11 +2488,9 @@ _ASBOX
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -2439,7 +2545,12 @@ _ACEOF
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -2454,7 +2565,11 @@ do
     { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2530,7 +2645,7 @@ if $ac_cache_corrupted; then
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
   { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
 ## -------------------- ##
 ## Main body of script. ##
@@ -2549,16 +2664,22 @@ ac_config_headers="$ac_config_headers config.h"
 
 ac_aux_dir=
 for ac_dir in config "$srcdir"/config; do
-  for ac_t in install-sh install.sh shtool; do
-    if test -f "$ac_dir/$ac_t"; then
-      ac_aux_dir=$ac_dir
-      ac_install_sh="$ac_aux_dir/$ac_t -c"
-      break 2
-    fi
-  done
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -2571,7 +2692,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
-am__api_version='1.11'
+am__api_version='1.13'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -2590,7 +2711,7 @@ am__api_version='1.11'
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2610,7 +2731,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -2668,56 +2789,71 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
 '
 case `pwd` in
   *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error "unsafe absolute working directory name" "$LINENO" 5;;
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      as_fn_error "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
    # Ok.
    :
 else
-   as_fn_error "newly created file is older than distributed files!
+   as_fn_error $? "newly created file is older than distributed files!
 Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -2740,12 +2876,12 @@ if test x"${MISSING+set}" != xset; then
   esac
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
 if test x"${install_sh}" != xset; then
@@ -2757,17 +2893,17 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
 if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
@@ -2779,7 +2915,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2807,7 +2943,7 @@ if test -z "$ac_cv_prog_STRIP"; then
 set dummy strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -2819,7 +2955,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2860,7 +2996,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then :
+  if ${ac_cv_path_mkdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2870,7 +3006,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
 	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
 	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
 	     'mkdir (GNU coreutils) '* | \
 	     'mkdir (coreutils) '* | \
@@ -2899,19 +3035,13 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
 $as_echo "$MKDIR_P" >&6; }
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
@@ -2923,7 +3053,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2951,7 +3081,7 @@ done
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -2959,7 +3089,7 @@ SHELL = /bin/sh
 all:
 	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
 case `${MAKE-make} -f conftest.make 2>/dev/null` in
   *@@@%%%=?*=@@@%%%*)
     eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -2987,13 +3117,52 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
   am__isrc=' -I$(srcdir)'
   # test to see if srcdir already configured
   if test -f $srcdir/config.status; then
-    as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
   fi
 fi
 
@@ -3008,8 +3177,8 @@ fi
 
 
 # Define the identity of the package.
- PACKAGE=hkl
- VERSION=4.0.3
+ PACKAGE='hkl'
+ VERSION='4.99.99.1610'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3037,13 +3206,140 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar plaintar pax cpio none'
+
+# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
+$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
+      if test $am_uid -le $am_max_uid; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+         _am_tools=none
+      fi
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
+$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
+      if test $am_gid -le $am_max_gid; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+        _am_tools=none
+      fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
+$as_echo_n "checking how to create a ustar tar archive... " >&6; }
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        { echo "$as_me:$LINENO: $_am_tar --version" >&5
+   ($_am_tar --version) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } && break
+      done
+      am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x ustar -w "$$tardir"'
+      am__tar_='pax -L -x ustar -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
+      am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
+      am__untar='cpio -i -H ustar -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
+
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_ustar}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+   (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
+   ($am__untar <conftest.tar) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+      { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
+   (cat conftest.dir/file) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
+  rm -rf conftest.dir
+
+  if ${am_cv_prog_tar_ustar+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  am_cv_prog_tar_ustar=$_am_tool
+fi
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
+$as_echo "$am_cv_prog_tar_ustar" >&6; }
 
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
@@ -3067,7 +3363,7 @@ if test -z "$CXX"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then :
+if ${ac_cv_prog_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
@@ -3079,7 +3375,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3111,7 +3407,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CXX"; then
@@ -3123,7 +3419,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3274,9 +3570,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ as_fn_set_status 77
-as_fn_error "C++ compiler cannot create executables
-See \`config.log' for more details." "$LINENO" 5; }; }
+as_fn_error 77 "C++ compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3318,8 +3613,8 @@ done
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3376,9 +3671,9 @@ $as_echo "$ac_try_echo"; } >&5
     else
 	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C++ compiled programs.
+as_fn_error $? "cannot run C++ compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3389,7 +3684,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3429,8 +3724,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3440,7 +3735,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3477,7 +3772,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then :
+if ${ac_cv_prog_cxx_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_cxx_werror_flag=$ac_cxx_werror_flag
@@ -3577,7 +3872,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -3610,6 +3905,7 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -3625,15 +3921,16 @@ depcc="$CXX"  am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then :
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -3667,16 +3964,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -3685,16 +3982,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -3754,7 +4051,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
@@ -3766,7 +4063,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3800,7 +4097,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3812,7 +4109,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3840,7 +4137,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -3852,7 +4149,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3893,7 +4190,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3905,7 +4202,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3933,7 +4230,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -3946,7 +4243,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -3992,7 +4289,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4004,7 +4301,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4036,7 +4333,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4048,7 +4345,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4090,8 +4387,8 @@ fi
 
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "no acceptable C compiler found in \$PATH
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4120,7 +4417,7 @@ done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4157,7 +4454,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -4235,7 +4532,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4244,8 +4541,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4334,15 +4630,16 @@ depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4376,16 +4673,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -4394,16 +4691,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
 	break
       fi
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -4457,35 +4754,212 @@ else
 fi
 
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg (args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg (args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = va_arg (args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+	  || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
 #else
@@ -4499,7 +4973,7 @@ else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -4515,11 +4989,11 @@ else
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
   break
 fi
@@ -4558,7 +5032,7 @@ else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
@@ -4574,18 +5048,18 @@ else
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.i conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then :
 
 else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." "$LINENO" 5; }
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -4610,7 +5084,7 @@ fi
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -4618,7 +5092,7 @@ SHELL = /bin/sh
 all:
 	@echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
 case `${MAKE-make} -f conftest.make 2>/dev/null` in
   *@@@%%%=?*=@@@%%%*)
     eval ac_cv_prog_make_${ac_make}_set=yes;;
@@ -4645,8 +5119,8 @@ esac
 
 
 
-macro_version='2.2.6b'
-macro_revision='1.3017'
+macro_version='2.4.2'
+macro_revision='1.3337'
 
 
 
@@ -4664,27 +5138,27 @@ ltmain="$ac_aux_dir/ltmain.sh"
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -4702,14 +5176,14 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
 fi
 
 fi
@@ -4717,7 +5191,7 @@ fi
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -4733,9 +5207,78 @@ IFS=$ac_save_IFS
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${ac_cv_path_SED+set}" = set; then :
+if ${ac_cv_path_SED+:} false; then :
   $as_echo_n "(cached) " >&6
 else
             ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -4755,7 +5298,7 @@ do
     for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+      as_fn_executable_p "$ac_path_SED" || continue
 # Check for GNU ac_path_SED and select it if it is found.
   # Check for GNU $ac_path_SED
 case `"$ac_path_SED" --version 2>&1` in
@@ -4790,7 +5333,7 @@ esac
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_SED"; then
-    as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
   fi
 else
   ac_cv_path_SED=$SED
@@ -4817,7 +5360,7 @@ Xsed="$SED -e 1s/^X//"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -4831,7 +5374,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -4866,7 +5409,7 @@ esac
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
@@ -4880,7 +5423,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -4897,7 +5440,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -4932,7 +5475,7 @@ esac
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -4947,7 +5490,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
 $as_echo_n "checking for fgrep... " >&6; }
-if test "${ac_cv_path_FGREP+set}" = set; then :
+if ${ac_cv_path_FGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
@@ -4964,7 +5507,7 @@ do
     for ac_prog in fgrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+      as_fn_executable_p "$ac_path_FGREP" || continue
 # Check for GNU ac_path_FGREP and select it if it is found.
   # Check for GNU $ac_path_FGREP
 case `"$ac_path_FGREP" --version 2>&1` in
@@ -4999,7 +5542,7 @@ esac
   done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_FGREP"; then
-    as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_FGREP=$FGREP
@@ -5078,7 +5621,7 @@ else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
 $as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-if test "${lt_cv_path_LD+set}" = set; then :
+if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
@@ -5115,10 +5658,10 @@ else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
-test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+if ${lt_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
@@ -5145,7 +5688,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if test "${lt_cv_path_NM+set}" = set; then :
+if ${lt_cv_path_NM+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
@@ -5198,14 +5741,17 @@ if test "$lt_cv_path_NM" != "no"; then
   NM="$lt_cv_path_NM"
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+if ${ac_cv_prog_DUMPBIN+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$DUMPBIN"; then
@@ -5217,7 +5763,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5243,13 +5789,13 @@ fi
 fi
 if test -z "$DUMPBIN"; then
   ac_ct_DUMPBIN=$DUMPBIN
-  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+  for ac_prog in dumpbin "link -dump"
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_DUMPBIN"; then
@@ -5261,7 +5807,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5298,6 +5844,15 @@ esac
   fi
 fi
 
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
 
   if test "$DUMPBIN" != ":"; then
     NM="$DUMPBIN"
@@ -5312,18 +5867,18 @@ test -z "$NM" && NM=nm
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if test "${lt_cv_nm_interface+set}" = set; then :
+if ${lt_cv_nm_interface+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:5320: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:5323: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:5326: output\"" >&5)
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -5336,7 +5891,7 @@ $as_echo "$lt_cv_nm_interface" >&6; }
 # find the maximum length of command line arguments
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
+if ${lt_cv_sys_max_cmd_len+:} false; then :
   $as_echo_n "(cached) " >&6
 else
     i=0
@@ -5369,6 +5924,11 @@ else
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
   amigaos*)
     # On AmigaOS with pdksh, this test takes hours, literally.
     # So we just punt and use a minimum line length of 8192.
@@ -5394,6 +5954,11 @@ else
     lt_cv_sys_max_cmd_len=196608
     ;;
 
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
   osf*)
     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -5420,7 +5985,8 @@ else
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -5433,8 +5999,8 @@ else
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
-	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
 	      test $i != 17 # 1/2 MB should be enough
       do
         i=`expr $i + 1`
@@ -5476,8 +6042,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
 # Try some XSI features
 xsi_shell=no
 ( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
     && eval 'test $(( 1 + 1 )) -eq 2 \
     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
   && xsi_shell=yes
@@ -5526,9 +6092,83 @@ esac
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
 $as_echo_n "checking for $LD option to reload object files... " >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then :
+if ${lt_cv_ld_reload_flag+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_ld_reload_flag='-r'
@@ -5542,6 +6182,11 @@ case $reload_flag in
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
   darwin*)
     if test "$GCC" = yes; then
       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
@@ -5564,7 +6209,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}objdump; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+if ${ac_cv_prog_OBJDUMP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OBJDUMP"; then
@@ -5576,7 +6221,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5604,7 +6249,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then
 set dummy objdump; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OBJDUMP"; then
@@ -5616,7 +6261,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OBJDUMP="objdump"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5663,7 +6308,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then :
+if ${lt_cv_deplibs_check_method+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_file_magic_cmd='$MAGIC_CMD'
@@ -5705,16 +6350,18 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
     lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
   ;;
 
-cegcc)
+cegcc*)
   # use the weaker test based on 'objdump'. See mingw*.
   lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
@@ -5740,7 +6387,7 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
+haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -5752,11 +6399,11 @@ hpux10.20* | hpux11*)
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
     ;;
   hppa*64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
     ;;
   *)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
     lt_cv_file_magic_test_file=/usr/lib/libc.sl
     ;;
   esac
@@ -5777,8 +6424,8 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -5859,6 +6506,21 @@ esac
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
 $as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -5874,16 +6536,26 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+
+
+
+
+
+
+
+
+
+
 if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then :
+if ${ac_cv_prog_DLLTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -5891,8 +6563,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -5902,10 +6574,10 @@ IFS=$as_save_IFS
 
 fi
 fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -5913,17 +6585,17 @@ fi
 
 
 fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -5931,8 +6603,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AR="ar"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -5942,17 +6614,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -5960,18 +6632,55 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    AR=$ac_ct_AR
+    DLLTOOL=$ac_ct_DLLTOOL
   fi
 else
-  AR="$ac_cv_prog_AR"
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
 fi
 
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
 
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
 
 
 
@@ -5980,23 +6689,194 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
 if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+if ${ac_cv_prog_AR+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6024,7 +6904,7 @@ if test -z "$ac_cv_prog_STRIP"; then
 set dummy strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -6036,7 +6916,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6083,7 +6963,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then :
+if ${ac_cv_prog_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
@@ -6095,7 +6975,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6123,7 +7003,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
 set dummy ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
@@ -6135,7 +7015,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6185,15 +7065,27 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
 
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
 
 
 
@@ -6240,7 +7132,7 @@ compiler=$CC
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
@@ -6301,8 +7193,8 @@ esac
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -6326,6 +7218,7 @@ for ac_symprfx in "" "_"; do
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -6338,6 +7231,7 @@ for ac_symprfx in "" "_"; do
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
   fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -6363,8 +7257,8 @@ _LT_EOF
   test $ac_status = 0; }; then
     # Now try to grab the symbols.
     nlist=conftest.nm
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
-  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && test -s "$nlist"; then
@@ -6379,6 +7273,18 @@ _LT_EOF
       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -6390,7 +7296,7 @@ _LT_EOF
 	  cat <<_LT_EOF >> conftest.$ac_ext
 
 /* The mapping between symbol names and symbols.  */
-const struct {
+LT_DLSYM_CONST struct {
   const char *name;
   void       *address;
 }
@@ -6416,8 +7322,8 @@ static const void *lt_preloaded_setup() {
 _LT_EOF
 	  # Now try linking the two files.
 	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
 	  LIBS="conftstm.$ac_objext"
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -6427,8 +7333,8 @@ _LT_EOF
   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
 	else
 	  echo "cannot find nm_test_func in $nlist" >&5
 	fi
@@ -6465,6 +7371,19 @@ else
 $as_echo "ok" >&6; }
 fi
 
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
 
 
 
@@ -6485,6 +7404,41 @@ fi
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
+else
+  with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
 
 
 # Check whether --enable-libtool-lock was given.
@@ -6518,7 +7472,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6521 "configure"' > conftest.$ac_ext
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -6569,7 +7523,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
 	    ;;
 	  ppc64-*linux*|powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
@@ -6612,7 +7573,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   CFLAGS="$CFLAGS -belf"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then :
+if ${lt_cv_cc_needs_belf+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_ext=c
@@ -6653,7 +7614,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*solaris*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -6664,7 +7625,20 @@ sparc*-*solaris*)
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
       *)
 	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
 	  LD="${LD-ld} -64"
@@ -6680,6 +7654,123 @@ esac
 
 need_locks="$enable_libtool_lock"
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+  fi
+else
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+
+
+
+
+
 
   case $host_os in
     rhapsody* | darwin*)
@@ -6688,7 +7779,7 @@ need_locks="$enable_libtool_lock"
 set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$DSYMUTIL"; then
@@ -6700,7 +7791,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6728,7 +7819,7 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then
 set dummy dsymutil; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_DSYMUTIL"; then
@@ -6740,7 +7831,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6780,7 +7871,7 @@ fi
 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_NMEDIT+set}" = set; then :
+if ${ac_cv_prog_NMEDIT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NMEDIT"; then
@@ -6792,7 +7883,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6820,7 +7911,7 @@ if test -z "$ac_cv_prog_NMEDIT"; then
 set dummy nmedit; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_NMEDIT"; then
@@ -6832,7 +7923,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_NMEDIT="nmedit"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6872,7 +7963,7 @@ fi
 set dummy ${ac_tool_prefix}lipo; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LIPO+set}" = set; then :
+if ${ac_cv_prog_LIPO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$LIPO"; then
@@ -6884,7 +7975,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6912,7 +8003,7 @@ if test -z "$ac_cv_prog_LIPO"; then
 set dummy lipo; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_LIPO"; then
@@ -6924,7 +8015,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_LIPO="lipo"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6964,7 +8055,7 @@ fi
 set dummy ${ac_tool_prefix}otool; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OTOOL+set}" = set; then :
+if ${ac_cv_prog_OTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OTOOL"; then
@@ -6976,7 +8067,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7004,7 +8095,7 @@ if test -z "$ac_cv_prog_OTOOL"; then
 set dummy otool; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OTOOL"; then
@@ -7016,7 +8107,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OTOOL="otool"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7056,7 +8147,7 @@ fi
 set dummy ${ac_tool_prefix}otool64; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OTOOL64+set}" = set; then :
+if ${ac_cv_prog_OTOOL64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OTOOL64"; then
@@ -7068,7 +8159,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7096,7 +8187,7 @@ if test -z "$ac_cv_prog_OTOOL64"; then
 set dummy otool64; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OTOOL64"; then
@@ -7108,7 +8199,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_OTOOL64="otool64"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -7171,7 +8262,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
 $as_echo_n "checking for -single_module linker flag... " >&6; }
-if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
+if ${lt_cv_apple_cc_single_mod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
@@ -7187,7 +8278,13 @@ else
 	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
 	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	# If there is a non-empty error log, and "single_module"
+	# appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+	  cat conftest.err >&5
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&5
@@ -7198,9 +8295,10 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_ld_exported_symbols_list=no
@@ -7230,6 +8328,41 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+	cat conftest.err >&5
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
     case $host_os in
     rhapsody* | darwin1.[012])
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
@@ -7257,7 +8390,7 @@ $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
     else
       _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
     fi
-    if test "$DSYMUTIL" != ":"; then
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -7268,7 +8401,7 @@ $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7385,8 +8518,7 @@ do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
 "
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -7400,7 +8532,7 @@ for ac_header in dlfcn.h
 do :
   ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
 "
-if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_DLFCN_H 1
 _ACEOF
@@ -7411,660 +8543,166 @@ done
 
 
 
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
 
 
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-  test -n "$ac_ct_CXX" && break
-done
+# Set options
 
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
-fi
 
-  fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+        enable_dlopen=no
 
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  ac_compiler_gnu=no
+  enable_shared=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GXX=yes
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  GXX=
+  enable_static=yes
 fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-else
-  CXXFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
 
-else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+	IFS="$lt_save_ifs"
+	if test "X$lt_pkg" = "X$lt_p"; then
+	  pic_mode=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
+  pic_mode=default
 fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-depcc="$CXX"  am_compiler_list=
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
+test -z "$pic_mode" && pic_mode=default
 
-  am_cv_CXX_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
 
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
       ;;
-    none) break ;;
     esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
 else
-  am_cv_CXX_dependencies_compiler_type=none
+  enable_fast_install=yes
 fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
 
 
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
-  if test "${ac_cv_prog_CXXCPP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
 
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
-else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-_lt_caught_CXX_error=yes; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-else
-  _lt_caught_CXX_error=yes
-fi
-
-
-
-
-
-# Set options
-
-
-
-        enable_dlopen=no
-
-
-  enable_win32_dll=no
-
-
-            # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
-  enableval=$enable_shared; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
-  # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
-  withval=$with_pic; pic_mode="$withval"
-else
-  pic_mode=default
-fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
-
-
-
-
-
-
-  # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_fast_install=yes
-fi
 
 
 
 
 
 
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
 
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
 
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
 
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
@@ -8111,7 +8749,7 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
 $as_echo_n "checking for objdir... " >&6; }
-if test "${lt_cv_objdir+set}" = set; then :
+if ${lt_cv_objdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   rm -f .libs 2>/dev/null
@@ -8139,19 +8777,6 @@ _ACEOF
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 case $host_os in
 aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
@@ -8164,23 +8789,6 @@ aix3*)
   ;;
 esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
 # Global variables:
 ofile=libtool
 can_build_shared=yes
@@ -8209,7 +8817,7 @@ for cc_temp in $compiler""; do
     *) break;;
   esac
 done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 
 
 # Only perform the check for file, if the check method requires it
@@ -8219,7 +8827,7 @@ file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $MAGIC_CMD in
@@ -8285,7 +8893,7 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
 $as_echo_n "checking for file... " >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $MAGIC_CMD in
@@ -8418,11 +9026,16 @@ if test -n "$compiler"; then
 lt_prog_compiler_no_builtin_flag=
 
 if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_rtti_exceptions=no
@@ -8438,15 +9051,15 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8441: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8445: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
@@ -8475,8 +9088,6 @@ fi
 lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl='-Wl,'
@@ -8524,6 +9135,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_pic='-fno-common'
       ;;
 
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
     hpux*)
       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
@@ -8566,6 +9183,15 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_pic='-fPIC'
       ;;
     esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
+      ;;
+    esac
   else
     # PORTME Check for flag to pass linker flags through the system compiler.
     case $host_os in
@@ -8607,7 +9233,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -8628,7 +9254,13 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	lt_prog_compiler_pic='--shared'
 	lt_prog_compiler_static='--static'
 	;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl='-Wl,-Wl,,'
+	lt_prog_compiler_pic='-PIC'
+	lt_prog_compiler_static='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
 	lt_prog_compiler_wl='-Wl,'
@@ -8640,25 +9272,40 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
         # All Alpha code is PIC.
         lt_prog_compiler_static='-non_shared'
         ;;
-      xl*)
-	# IBM XL C 8.0/Fortran 10.1 on PPC
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-qpic'
 	lt_prog_compiler_static='-qstaticlink'
 	;;
       *)
 	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Qoption ld '
+	  ;;
 	*Sun\ C*)
 	  # Sun C 5.9
 	  lt_prog_compiler_pic='-KPIC'
 	  lt_prog_compiler_static='-Bstatic'
 	  lt_prog_compiler_wl='-Wl,'
 	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic='-KPIC'
+        *Intel*\ [CF]*Compiler*)
+	  lt_prog_compiler_wl='-Wl,'
+	  lt_prog_compiler_pic='-fPIC'
+	  lt_prog_compiler_static='-static'
+	  ;;
+	*Portland\ Group*)
+	  lt_prog_compiler_wl='-Wl,'
+	  lt_prog_compiler_pic='-fpic'
 	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl=''
 	  ;;
 	esac
 	;;
@@ -8690,7 +9337,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       lt_prog_compiler_pic='-KPIC'
       lt_prog_compiler_static='-Bstatic'
       case $cc_basename in
-      f77* | f90* | f95*)
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
 	lt_prog_compiler_wl='-Qoption ld ';;
       *)
 	lt_prog_compiler_wl='-Wl,';;
@@ -8747,13 +9394,17 @@ case $host_os in
     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
     ;;
 esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-
-
-
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
 
 #
 # Check to make sure the PIC flag actually works.
@@ -8761,7 +9412,7 @@ $as_echo "$lt_prog_compiler_pic" >&6; }
 if test -n "$lt_prog_compiler_pic"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_pic_works=no
@@ -8777,15 +9428,15 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8780: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8784: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_pic_works=yes
@@ -8814,13 +9465,18 @@ fi
 
 
 
+
+
+
+
+
 #
 # Check to make sure the static flag actually works.
 #
 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
+if ${lt_cv_prog_compiler_static_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
@@ -8833,7 +9489,7 @@ else
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&5
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          lt_cv_prog_compiler_static_works=yes
@@ -8863,7 +9519,7 @@ fi
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+if ${lt_cv_prog_compiler_c_o+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o=no
@@ -8882,16 +9538,16 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8885: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8889: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
@@ -8918,7 +9574,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
+if ${lt_cv_prog_compiler_c_o+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o=no
@@ -8937,16 +9593,16 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8940: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8944: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
@@ -9012,7 +9668,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   hardcode_direct=no
   hardcode_direct_absolute=no
   hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
   hardcode_libdir_separator=
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
@@ -9056,13 +9711,39 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   openbsd*)
     with_gnu_ld=no
     ;;
-  linux* | k*bsd*-gnu)
+  linux* | k*bsd*-gnu | gnu*)
     link_all_deplibs=no
     ;;
   esac
 
   ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
   if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
@@ -9096,11 +9777,12 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** Warning: the GNU linker, at least up to release 2.19, is reported
 *** to be unable to reliably create shared libraries on AIX.
 *** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
 
 _LT_EOF
       fi
@@ -9136,10 +9818,12 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -9157,6 +9841,11 @@ _LT_EOF
       fi
       ;;
 
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
     interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
@@ -9182,15 +9871,16 @@ _LT_EOF
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
 	 && test "$tmp_diet" = no
       then
-	tmp_addflag=
+	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -9201,13 +9891,17 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  whole_archive_flag_spec=
 	  tmp_sharedflag='--shared' ;;
-	xl[cC]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
@@ -9223,17 +9917,16 @@ _LT_EOF
         fi
 
 	case $cc_basename in
-	xlf*)
+	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec=
-	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
 	  if test "x$supports_anon_versioning" = xyes; then
 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
 	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -9247,8 +9940,8 @@ _LT_EOF
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -9266,8 +9959,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9313,8 +10006,8 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9354,8 +10047,10 @@ _LT_EOF
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
 	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
@@ -9443,8 +10138,14 @@ _LT_EOF
 	allow_undefined_flag='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 int
 main ()
@@ -9456,25 +10157,32 @@ main ()
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
 
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
 
         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
       else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
@@ -9483,7 +10191,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+	 if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9496,30 +10210,42 @@ main ()
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
 
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
 
 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
 	  no_undefined_flag=' ${wl}-bernotok'
 	  allow_undefined_flag=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec='$convenience'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec='$convenience'
+	  fi
 	  archive_cmds_need_lc=yes
 	  # This is similar to how AIX traditionally builds its shared libraries.
 	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
@@ -9551,20 +10277,64 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
-      hardcode_libdir_flag_spec=' '
-      allow_undefined_flag=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_from_new_cmds='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes=yes
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	always_export_symbols=yes
+	file_list_spec='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+	enable_shared_with_static_runtimes=yes
+	exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds='chmod 644 $oldlib'
+	postlink_cmds='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes=yes
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -9574,7 +10344,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
   hardcode_direct=no
   hardcode_automatic=yes
   hardcode_shlibpath_var=unsupported
-  whole_archive_flag_spec=''
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec=''
+  fi
   link_all_deplibs=yes
   allow_undefined_flag="$_lt_dar_allow_undefined"
   case $cc_basename in
@@ -9582,7 +10357,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
      *) _lt_dar_can_shared=$GCC ;;
   esac
   if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
+    output_verbose_link_cmd=func_echo_all
     archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
     module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
     archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
@@ -9600,10 +10375,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var=no
       ;;
 
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -9616,7 +10387,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
       hardcode_minus_L=yes
@@ -9625,7 +10396,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
     freebsd* | dragonfly*)
-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
       hardcode_shlibpath_var=no
@@ -9633,7 +10404,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     hpux9*)
       if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
@@ -9648,14 +10419,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
       if test "$with_gnu_ld" = no; then
 	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_flag_spec_ld='+b $libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
@@ -9667,16 +10437,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
 	case $host_cpu in
 	hppa*64*)
 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
@@ -9688,7 +10458,46 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
 	  ;;
 	esac
       fi
@@ -9716,26 +10525,39 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     irix5* | irix6* | nonstopux*)
       if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
-        save_LDFLAGS="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-int foo(void) {}
+int foo (void) { return 0; }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        LDFLAGS="$save_LDFLAGS"
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
       archive_cmds_need_lc='no'
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
@@ -9797,17 +10619,17 @@ rm -f core conftest.err conftest.$ac_objext \
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
       old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
       if test "$GCC" = yes; then
 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
       archive_cmds_need_lc='no'
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
@@ -9817,13 +10639,13 @@ rm -f core conftest.err conftest.$ac_objext \
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
       if test "$GCC" = yes; then
 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -9836,9 +10658,9 @@ rm -f core conftest.err conftest.$ac_objext \
       no_undefined_flag=' -z defs'
       if test "$GCC" = yes; then
 	wlarc='${wl}'
-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
@@ -10026,44 +10848,50 @@ x|xyes)
       # to ld, don't add -lc before -lgcc.
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-      if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl
-	pic_flag=$lt_prog_compiler_pic
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag
-        allow_undefined_flag=
-        if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl
+	  pic_flag=$lt_prog_compiler_pic
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag
+	  allow_undefined_flag=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
   (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-        then
-	  archive_cmds_need_lc=no
-        else
-	  archive_cmds_need_lc=yes
-        fi
-        allow_undefined_flag=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
-$as_echo "$archive_cmds_need_lc" >&6; }
+	  then
+	    lt_cv_archive_cmds_need_lc=no
+	  else
+	    lt_cv_archive_cmds_need_lc=yes
+	  fi
+	  allow_undefined_flag=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
       ;;
     esac
   fi
@@ -10221,11 +11049,6 @@ esac
 
 
 
-
-
-
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
@@ -10234,16 +11057,23 @@ if test "$GCC" = yes; then
     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
     *) lt_awk_arg="/^libraries:/" ;;
   esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
   # Ok, now we have the path, separated by spaces, we can step through it
   # and add multilib dir if necessary.
   lt_tmp_lt_search_path_spec=
@@ -10256,7 +11086,7 @@ if test "$GCC" = yes; then
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
-  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
 BEGIN {RS=" "; FS="/|\n";} {
   lt_foo="";
   lt_count=0;
@@ -10276,7 +11106,13 @@ BEGIN {RS=" "; FS="/|\n";} {
   if (lt_foo != "") { lt_freq[lt_foo]++; }
   if (lt_freq[lt_foo] == 1) { print lt_foo; }
 }'`
-  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
@@ -10302,7 +11138,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -10311,7 +11147,7 @@ aix3*)
   ;;
 
 aix[4-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -10364,7 +11200,7 @@ amigaos*)
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
@@ -10376,7 +11212,7 @@ beos*)
   ;;
 
 bsdi[45]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -10395,8 +11231,9 @@ cygwin* | mingw* | pw32* | cegcc*)
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
@@ -10417,36 +11254,83 @@ cygwin* | mingw* | pw32* | cegcc*)
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
     ;;
 
   *)
+    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
     ;;
   esac
-  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -10467,7 +11351,7 @@ darwin* | rhapsody*)
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -10475,10 +11359,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -10486,7 +11366,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -10504,7 +11384,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -10523,13 +11403,16 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
+  dynamic_linker="$host_os runtime_loader"
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -10575,12 +11458,14 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
   postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
   ;;
 
 interix[3-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -10596,7 +11481,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
 	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
+		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
 	fi ;;
@@ -10633,9 +11518,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -10643,12 +11528,17 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
+
   # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
-       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -10661,13 +11551,17 @@ main ()
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  shlibpath_overrides_runpath=yes
+  lt_cv_shlibpath_overrides_runpath=yes
 fi
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
 
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
@@ -10676,7 +11570,7 @@ rm -f core conftest.err conftest.$ac_objext \
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -10720,7 +11614,7 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -10789,7 +11683,7 @@ rdos*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -10814,7 +11708,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -10838,7 +11732,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -10869,7 +11763,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -10879,7 +11773,7 @@ tpf*)
   ;;
 
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -10991,6 +11885,11 @@ fi
 
 
 
+
+
+
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
 hardcode_action=
@@ -11063,7 +11962,7 @@ else
   # if libdl is installed we need to link against it
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+if ${ac_cv_lib_dl_dlopen+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11097,7 +11996,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
 
@@ -11111,12 +12010,12 @@ fi
 
   *)
     ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = x""yes; then :
+if test "x$ac_cv_func_shl_load" = xyes; then :
   lt_cv_dlopen="shl_load"
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
 $as_echo_n "checking for shl_load in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
+if ${ac_cv_lib_dld_shl_load+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11150,16 +12049,16 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
 else
   ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = x""yes; then :
+if test "x$ac_cv_func_dlopen" = xyes; then :
   lt_cv_dlopen="dlopen"
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+if ${ac_cv_lib_dl_dlopen+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11193,12 +12092,12 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
+if ${ac_cv_lib_svld_dlopen+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11232,12 +12131,12 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
 $as_echo_n "checking for dld_link in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
+if ${ac_cv_lib_dld_dld_link+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -11271,7 +12170,7 @@ LIBS=$ac_check_lib_save_LIBS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
 fi
 
@@ -11312,7 +12211,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then :
+if ${lt_cv_dlopen_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   	  if test "$cross_compiling" = yes; then :
@@ -11321,7 +12220,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11324 "configure"
+#line $LINENO "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11362,7 +12261,13 @@ else
 #  endif
 #endif
 
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -11371,7 +12276,11 @@ int main ()
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
       /* dlclose (self); */
     }
   else
@@ -11408,7 +12317,7 @@ $as_echo "$lt_cv_dlopen_self" >&6; }
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then :
+if ${lt_cv_dlopen_self_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   	  if test "$cross_compiling" = yes; then :
@@ -11417,7 +12326,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11420 "configure"
+#line $LINENO "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11458,7 +12367,13 @@ else
 #  endif
 #endif
 
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -11467,7 +12382,11 @@ int main ()
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
       /* dlclose (self); */
     }
   else
@@ -11624,42 +12543,182 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 CC="$lt_save_CC"
 
-
-ac_ext=cpp
+      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if ${ac_cv_prog_CXXCPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
 
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-compiler_needs_object_CXX=no
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_direct_absolute_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-inherit_rpath_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+  _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
 
 # No sense in running all these tests if we already determined that
 # the CXX compiler isn't working.  Some variables (like enable_shared)
@@ -11705,6 +12764,7 @@ $RM -r conftest*
 
   # Allow CC to be a program name with arguments.
   lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
   lt_save_LD=$LD
   lt_save_GCC=$GCC
   GCC=$GXX
@@ -11722,6 +12782,7 @@ $RM -r conftest*
   fi
   test -z "${LDCXX+set}" || LD=$LDCXX
   CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
   compiler=$CC
   compiler_CXX=$CC
   for cc_temp in $compiler""; do
@@ -11732,7 +12793,7 @@ $RM -r conftest*
     *) break;;
   esac
 done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 
 
   if test -n "$compiler"; then
@@ -11795,7 +12856,7 @@ else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
 $as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-if test "${lt_cv_path_LD+set}" = set; then :
+if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
@@ -11832,10 +12893,10 @@ else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
-test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then :
+if ${lt_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
@@ -11861,8 +12922,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
       if test "$with_gnu_ld" = yes; then
-        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
         export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
@@ -11894,7 +12955,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
       # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
     else
       GXX=no
@@ -12004,7 +13065,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
           allow_undefined_flag_CXX='-berok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+          if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -12017,26 +13084,33 @@ main ()
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
 
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
 
           hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         else
           if test "$host_cpu" = ia64; then
 	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
@@ -12045,7 +13119,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
-	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+	    if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -12058,30 +13138,42 @@ main ()
 _ACEOF
 if ac_fn_cxx_try_link "$LINENO"; then :
 
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
 
 	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
 	    no_undefined_flag_CXX=' ${wl}-bernotok'
 	    allow_undefined_flag_CXX=' ${wl}-berok'
-	    # Exported symbols can be pulled into shared objects from archives
-	    whole_archive_flag_spec_CXX='$convenience'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      whole_archive_flag_spec_CXX='$convenience'
+	    fi
 	    archive_cmds_need_lc_CXX=yes
 	    # This is similar to how AIX traditionally builds its shared
 	    # libraries.
@@ -12111,28 +13203,75 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         ;;
 
       cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-        # as there is no search path for DLLs.
-        hardcode_libdir_flag_spec_CXX='-L$libdir'
-        allow_undefined_flag_CXX=unsupported
-        always_export_symbols_CXX=no
-        enable_shared_with_static_runtimes_CXX=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    cp $export_symbols $output_objdir/$soname.def;
-          else
-	    echo EXPORTS > $output_objdir/$soname.def;
-	    cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          ld_shlibs_CXX=no
-        fi
-        ;;
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX=' '
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=yes
+	  file_list_spec_CXX='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=".dll"
+	  # FIXME: Setting linknames here is a bad hack.
+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+	  enable_shared_with_static_runtimes_CXX=yes
+	  # Don't use ranlib
+	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
+	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=no
+	  enable_shared_with_static_runtimes_CXX=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    ld_shlibs_CXX=no
+	  fi
+	  ;;
+	esac
+	;;
       darwin* | rhapsody*)
 
 
@@ -12140,7 +13279,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
   hardcode_direct_CXX=no
   hardcode_automatic_CXX=yes
   hardcode_shlibpath_var_CXX=unsupported
-  whole_archive_flag_spec_CXX=''
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+  else
+    whole_archive_flag_spec_CXX=''
+  fi
   link_all_deplibs_CXX=yes
   allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
   case $cc_basename in
@@ -12148,7 +13292,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
      *) _lt_dar_can_shared=$GCC ;;
   esac
   if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
+    output_verbose_link_cmd=func_echo_all
     archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
     module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
     archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
@@ -12182,7 +13326,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         esac
         ;;
 
-      freebsd[12]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
 	# switch to ELF
         ld_shlibs_CXX=no
@@ -12198,7 +13342,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         ld_shlibs_CXX=yes
         ;;
 
-      gnu*)
+      haiku*)
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        link_all_deplibs_CXX=yes
         ;;
 
       hpux9*)
@@ -12225,11 +13371,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
             if test "$GXX" = yes; then
-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               ld_shlibs_CXX=no
@@ -12290,7 +13436,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
 	    if test "$GXX" = yes; then
@@ -12300,10 +13446,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -12333,7 +13479,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -12344,9 +13490,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           *)
 	    if test "$GXX" = yes; then
 	      if test "$with_gnu_ld" = no; then
-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	      else
-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
 	      fi
 	    fi
 	    link_all_deplibs_CXX=yes
@@ -12357,7 +13503,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
         inherit_rpath_CXX=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -12375,7 +13521,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
 	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
 	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
@@ -12412,26 +13558,26 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
-	    *pgCC\ [1-5]* | *pgcpp\ [1-5]*)
+	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
 	      prelink_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      old_archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
 		$RANLIB $oldlib'
 	      archive_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
-	    *) # Version 6 will use weak symbols
+	    *) # Version 6 and above use weak symbols
 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
@@ -12439,7 +13585,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
 	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
 	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
@@ -12458,9 +13604,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
-	  xl*)
+	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
 	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
@@ -12480,13 +13626,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
 	      hardcode_libdir_flag_spec_CXX='-R$libdir'
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	      compiler_needs_object_CXX=yes
 
 	      # Not sure whether something based on
 	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
 	      # would be better.
-	      output_verbose_link_cmd='echo'
+	      output_verbose_link_cmd='func_echo_all'
 
 	      # Archives containing C++ object files must be created using
 	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -12555,7 +13701,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    export_dynamic_flag_spec_CXX='${wl}-E'
 	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 	  fi
-	  output_verbose_link_cmd=echo
+	  output_verbose_link_cmd=func_echo_all
 	else
 	  ld_shlibs_CXX=no
 	fi
@@ -12590,15 +13736,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    case $host in
 	      osf3*)
 	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
 		;;
 	      *)
 	        allow_undefined_flag_CXX=' -expect_unresolved \*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
 	          $RM $lib.exp'
 	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
 		;;
@@ -12614,17 +13760,17 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
 	      case $host in
 	        osf3*)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	        *)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	      esac
 
@@ -12634,7 +13780,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	      # Commands to make compiler produce verbose output that lists
 	      # what "hidden" libraries, object files and flags are used when
 	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
 	    else
 	      # FIXME: insert proper C++ library support
@@ -12670,7 +13816,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
       solaris*)
         case $cc_basename in
-          CC*)
+          CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
             archive_cmds_need_lc_CXX=yes
 	    no_undefined_flag_CXX=' -zdefs'
@@ -12691,7 +13837,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    esac
 	    link_all_deplibs_CXX=yes
 
-	    output_verbose_link_cmd='echo'
+	    output_verbose_link_cmd='func_echo_all'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -12711,14 +13857,14 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
 	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
 	        # platform.
@@ -12729,7 +13875,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
 	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
@@ -12783,6 +13929,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
           CC*)
 	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+	      '"$old_archive_cmds_CXX"
+	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+	      '"$reload_cmds_CXX"
 	    ;;
 	  *)
 	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
@@ -12844,6 +13994,14 @@ private:
 };
 _LT_EOF
 
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -12857,7 +14015,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case $p in
+    case ${prev}${p} in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
@@ -12866,13 +14024,22 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
           test $p = "-R"; then
 	 prev=$p
 	 continue
-       else
-	 prev=
        fi
 
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
        if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
+	 case ${prev} in
+	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
@@ -12892,8 +14059,10 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
 	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
 	 fi
        fi
+       prev=
        ;;
 
+    *.lto.$objext) ;; # Ignore GCC LTO objects
     *.$objext)
        # This assumes that the test object file only shows up
        # once in the compiler output.
@@ -12929,6 +14098,7 @@ else
 fi
 
 $RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
 
 # PORTME: override above test on systems where it is broken
 case $host_os in
@@ -12964,7 +14134,7 @@ linux*)
 
 solaris*)
   case $cc_basename in
-  CC*)
+  CC* | sunCC*)
     # The more standards-conforming stlport4 library is
     # incompatible with the Cstd library. Avoid specifying
     # it if it's in CXXFLAGS. Ignore libCrun as
@@ -13029,8 +14199,6 @@ fi
 lt_prog_compiler_pic_CXX=
 lt_prog_compiler_static_CXX=
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 
   # C++ specific cases for pic, static, wl, etc.
   if test "$GXX" = yes; then
@@ -13080,6 +14248,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
       # DJGPP does not support shared libraries at all
       lt_prog_compiler_pic_CXX=
       ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_CXX=
+      ;;
     interix[3-9]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
@@ -13129,6 +14302,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	  ;;
 	esac
 	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+	;;
       dgux*)
 	case $cc_basename in
 	  ec++*)
@@ -13185,7 +14363,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -13218,8 +14396,8 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	    lt_prog_compiler_pic_CXX=
 	    lt_prog_compiler_static_CXX='-non_shared'
 	    ;;
-	  xlc* | xlC*)
-	    # IBM XL 8.0 on PPC
+	  xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-qpic'
 	    lt_prog_compiler_static_CXX='-qstaticlink'
@@ -13281,7 +14459,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 	;;
       solaris*)
 	case $cc_basename in
-	  CC*)
+	  CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-Bstatic'
@@ -13346,10 +14524,17 @@ case $host_os in
     lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
     ;;
 esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
-
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
 
 #
 # Check to make sure the PIC flag actually works.
@@ -13357,7 +14542,7 @@ $as_echo "$lt_prog_compiler_pic_CXX" >&6; }
 if test -n "$lt_prog_compiler_pic_CXX"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then :
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_pic_works_CXX=no
@@ -13373,15 +14558,15 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13376: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13380: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_pic_works_CXX=yes
@@ -13407,13 +14592,15 @@ fi
 
 
 
+
+
 #
 # Check to make sure the static flag actually works.
 #
 wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then :
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works_CXX=no
@@ -13426,7 +14613,7 @@ else
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&5
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          lt_cv_prog_compiler_static_works_CXX=yes
@@ -13453,7 +14640,7 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then :
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o_CXX=no
@@ -13472,16 +14659,16 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13475: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13479: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_CXX=yes
@@ -13505,7 +14692,7 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then :
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o_CXX=no
@@ -13524,16 +14711,16 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13527: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13531: \$? = $ac_status" >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_CXX=yes
@@ -13584,30 +14771,40 @@ fi
 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
   export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
   case $host_os in
   aix[4-9]*)
     # If we're using GNU nm, then we don't want the "-C" option.
     # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
       export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
     export_symbols_cmds_CXX="$ltdll_cmds"
-  ;;
+    ;;
   cygwin* | mingw* | cegcc*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  linux* | k*bsd*-gnu)
+    case $cc_basename in
+    cl*)
+      exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+      ;;
+    esac
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
     link_all_deplibs_CXX=no
-  ;;
+    ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
+    ;;
   esac
-  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
 $as_echo "$ld_shlibs_CXX" >&6; }
@@ -13639,44 +14836,50 @@ x|xyes)
       # to ld, don't add -lc before -lgcc.
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-      if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_CXX
-	pic_flag=$lt_prog_compiler_pic_CXX
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
-        allow_undefined_flag_CXX=
-        if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_CXX
+	  pic_flag=$lt_prog_compiler_pic_CXX
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+	  allow_undefined_flag_CXX=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
   (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-        then
-	  archive_cmds_need_lc_CXX=no
-        else
-	  archive_cmds_need_lc_CXX=yes
-        fi
-        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5
-$as_echo "$archive_cmds_need_lc_CXX" >&6; }
+	  then
+	    lt_cv_archive_cmds_need_lc_CXX=no
+	  else
+	    lt_cv_archive_cmds_need_lc_CXX=yes
+	  fi
+	  allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
       ;;
     esac
   fi
@@ -13744,8 +14947,6 @@ esac
 
 
 
-
-
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
@@ -13771,7 +14972,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -13780,7 +14981,7 @@ aix3*)
   ;;
 
 aix[4-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -13833,7 +15034,7 @@ amigaos*)
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
@@ -13845,7 +15046,7 @@ beos*)
   ;;
 
 bsdi[45]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -13864,8 +15065,9 @@ cygwin* | mingw* | pw32* | cegcc*)
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
@@ -13886,36 +15088,82 @@ cygwin* | mingw* | pw32* | cegcc*)
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
     ;;
 
   *)
+    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
     ;;
   esac
-  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -13935,7 +15183,7 @@ darwin* | rhapsody*)
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -13943,10 +15191,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -13954,7 +15198,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[123]*) objformat=aout ;;
+    freebsd[23].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -13972,7 +15216,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[01]* | freebsdelf3.[01]*)
@@ -13991,13 +15235,16 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
+  dynamic_linker="$host_os runtime_loader"
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -14043,12 +15290,14 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
   postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
   ;;
 
 interix[3-9]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -14064,7 +15313,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
 	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
+		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
 	fi ;;
@@ -14096,282 +15345,1623 @@ irix5* | irix6* | nonstopux*)
   hardcode_into_libs=yes
   ;;
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux # correct to gnu/linux during the next big refactor
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink ||
+   test "$inherit_rpath_CXX" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define VMAJ 4
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VMIN 99
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VMIC 99
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VREV 1610
+_ACEOF
+
+version_info="103:99:99"
+release_info=""
+
+
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+VMAJ=4
+
+
+# Checks for libraries.
+
+
+# Check whether --with-gsl-prefix was given.
+if test "${with_gsl_prefix+set}" = set; then :
+  withval=$with_gsl_prefix; gsl_prefix="$withval"
+else
+  gsl_prefix=""
+fi
+
+
+# Check whether --with-gsl-exec-prefix was given.
+if test "${with_gsl_exec_prefix+set}" = set; then :
+  withval=$with_gsl_exec_prefix; gsl_exec_prefix="$withval"
+else
+  gsl_exec_prefix=""
+fi
+
+# Check whether --enable-gsltest was given.
+if test "${enable_gsltest+set}" = set; then :
+  enableval=$enable_gsltest;
+else
+  enable_gsltest=yes
+fi
+
+
+  if test "x${GSL_CONFIG+set}" != xset ; then
+     if test "x$gsl_prefix" != x ; then
+         GSL_CONFIG="$gsl_prefix/bin/gsl-config"
+     fi
+     if test "x$gsl_exec_prefix" != x ; then
+        GSL_CONFIG="$gsl_exec_prefix/bin/gsl-config"
+     fi
+  fi
+
+  # Extract the first word of "gsl-config", so it can be a program name with args.
+set dummy gsl-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GSL_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GSL_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GSL_CONFIG="$GSL_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GSL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_GSL_CONFIG" && ac_cv_path_GSL_CONFIG="no"
+  ;;
+esac
+fi
+GSL_CONFIG=$ac_cv_path_GSL_CONFIG
+if test -n "$GSL_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSL_CONFIG" >&5
+$as_echo "$GSL_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  min_gsl_version=0.2.5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSL - version >= $min_gsl_version" >&5
+$as_echo_n "checking for GSL - version >= $min_gsl_version... " >&6; }
+  no_gsl=""
+  if test "$GSL_CONFIG" = "no" ; then
+    no_gsl=yes
+  else
+    GSL_CFLAGS=`$GSL_CONFIG --cflags`
+    GSL_LIBS=`$GSL_CONFIG --libs`
+
+    gsl_major_version=`$GSL_CONFIG --version | \
+           sed 's/^\([0-9]*\).*/\1/'`
+    if test "x${gsl_major_version}" = "x" ; then
+       gsl_major_version=0
+    fi
+
+    gsl_minor_version=`$GSL_CONFIG --version | \
+           sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\2/'`
+    if test "x${gsl_minor_version}" = "x" ; then
+       gsl_minor_version=0
+    fi
+
+    gsl_micro_version=`$GSL_CONFIG --version | \
+           sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\3/'`
+    if test "x${gsl_micro_version}" = "x" ; then
+       gsl_micro_version=0
+    fi
+
+    if test "x$enable_gsltest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GSL_CFLAGS"
+      LIBS="$LIBS $GSL_LIBS"
+
+      rm -f conf.gsltest
+      if test "$cross_compiling" = yes; then :
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+char* my_strdup (const char *str);
+
+char*
+my_strdup (const char *str)
+{
+  char *new_str;
+
+  if (str)
+    {
+      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+      strcpy (new_str, str);
+    }
+  else
+    new_str = NULL;
+
+  return new_str;
+}
+
+int main (void)
+{
+  int major = 0, minor = 0, micro = 0;
+  int n;
+  char *tmp_version;
+
+  system ("touch conf.gsltest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_gsl_version");
+
+  n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) ;
+
+  if (n != 2 && n != 3) {
+     printf("%s, bad version string\n", "$min_gsl_version");
+     exit(1);
+   }
+
+   if (($gsl_major_version > major) ||
+      (($gsl_major_version == major) && ($gsl_minor_version > minor)) ||
+      (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro)))
+     {
+       exit(0);
+     }
+   else
+     {
+       exit(1);
+     }
+}
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  no_gsl=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gsl" = x ; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+     :
+  else
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+     if test "$GSL_CONFIG" = "no" ; then
+       echo "*** The gsl-config script installed by GSL could not be found"
+       echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GSL_CONFIG environment variable to the"
+       echo "*** full path to gsl-config."
+     else
+       if test -f conf.gsltest ; then
+        :
+       else
+          echo "*** Could not run GSL test program, checking why..."
+          CFLAGS="$CFLAGS $GSL_CFLAGS"
+          LIBS="$LIBS $GSL_LIBS"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+ return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+   echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GSL or finding the wrong"
+          echo "*** version of GSL. If it is not finding GSL, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+else
+   echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GSL was incorrectly installed"
+          echo "*** or that you have moved GSL since it was installed. In the latter case, you"
+          echo "*** may want to edit the gsl-config script: $GSL_CONFIG"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+#     GSL_CFLAGS=""
+#     GSL_LIBS=""
+     :
+  fi
+
+
+  rm -f conf.gsltest
+
+
+# Checks for header files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
+if ${ac_cv_header_stdbool_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
+
+             struct s { _Bool s: 1; _Bool t; } s;
+
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
+
+int
+main ()
+{
+
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdbool_h=yes
+else
+  ac_cv_header_stdbool_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+$as_echo "$ac_cv_header_stdbool_h" >&6; }
+   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+
+if test $ac_cv_header_stdbool_h = yes; then
+
+$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_time=yes
+else
+  ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments.  Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if ${ac_cv_working_alloca_h+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+			  if (p) return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_working_alloca_h=yes
+else
+  ac_cv_working_alloca_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
+
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if ${ac_cv_func_alloca_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  ifdef HAVE_ALLOCA_H
+#   include <alloca.h>
+#  else
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca (size_t);
+#    endif
+#   endif
+#  endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+				    if (p) return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_func_alloca_works=yes
+else
+  ac_cv_func_alloca_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
+
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+
+else
+  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if ${ac_cv_os_cray+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "webecray" >/dev/null 2>&1; then :
+  ac_cv_os_cray=yes
+else
+  ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+    break
+fi
+
+  done
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if ${ac_cv_c_stack_direction+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_c_stack_direction=0
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+find_stack_direction (int *addr, int depth)
+{
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+  return find_stack_direction (0, argc + !argv + 20) < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_c_stack_direction=1
+else
+  ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
+for ac_header in float.h limits.h malloc.h memory.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this sort of thing.  */
+  typedef int charset[2];
+  const charset cs = { 0, 0 };
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ = 0;
+    if (s) return 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
+    int x[] = {25, 17};
+    const int *foo = &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p = 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo = 10;
+    if (!foo) return 0;
+  }
+  return !cs[0] && !zero.x;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_const=yes
+else
+  ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t"
+case $ac_cv_c_int16_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int16_t $ac_cv_c_int16_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t"
+case $ac_cv_c_int32_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int32_t $ac_cv_c_int32_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t"
+case $ac_cv_c_int64_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int64_t $ac_cv_c_int64_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t"
+case $ac_cv_c_int8_t in #(
+  no|yes) ;; #(
+  *)
+
+cat >>confdefs.h <<_ACEOF
+#define int8_t $ac_cv_c_int8_t
+_ACEOF
+;;
+esac
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t"
+case $ac_cv_c_uint16_t in #(
+  no|yes) ;; #(
+  *)
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint16_t $ac_cv_c_uint16_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t"
+case $ac_cv_c_uint32_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT32_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint32_t $ac_cv_c_uint32_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t"
+case $ac_cv_c_uint64_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT64_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint64_t $ac_cv_c_uint64_t
+_ACEOF
+;;
+  esac
+
+ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t"
+case $ac_cv_c_uint8_t in #(
+  no|yes) ;; #(
+  *)
+
+$as_echo "#define _UINT8_T 1" >>confdefs.h
+
+
+cat >>confdefs.h <<_ACEOF
+#define uint8_t $ac_cv_c_uint8_t
+_ACEOF
+;;
+  esac
+
+
+# Checks for library functions.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
+$as_echo_n "checking for error_at_line... " >&6; }
+if ${ac_cv_lib_error_at_line+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <error.h>
+int
+main ()
+{
+error_at_line (0, 0, "", 0, "an error occurred");
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_error_at_line=yes
+else
+  ac_cv_lib_error_at_line=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
+$as_echo "$ac_cv_lib_error_at_line" >&6; }
+if test $ac_cv_lib_error_at_line = no; then
+  case " $LIBOBJS " in
+  *" error.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS error.$ac_objext"
+ ;;
+esac
+
+fi
+
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
-       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_malloc_0_nonnull=no
+else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
 
 int
 main ()
 {
-
+return ! malloc (0);
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  shlibpath_overrides_runpath=yes
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_malloc_0_nonnull=yes
+else
+  ac_cv_func_malloc_0_nonnull=no
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
 
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then :
 
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
 
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
+else
+  $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
 
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
+   case " $LIBOBJS " in
+  *" malloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
 
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
 
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
 
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
+fi
 
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
 
-rdos*)
-  dynamic_linker=no
-  ;;
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
 
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
+fi
 
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
+done
 
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_realloc_0_nonnull=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *realloc ();
+#endif
 
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
+int
+main ()
+{
+return ! realloc (0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_realloc_0_nonnull=yes
+else
+  ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+if test $ac_cv_func_realloc_0_nonnull = yes; then :
 
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
+$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
 
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
+else
+  $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
 
-*)
-  dynamic_linker=no
-  ;;
+   case " $LIBOBJS " in
+  *" realloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
 esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+$as_echo "#define realloc rpl_realloc" >>confdefs.h
+
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+
+for ac_func in vprintf
+do :
+  ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
+if test "x$ac_cv_func_vprintf" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_VPRINTF 1
+_ACEOF
+
+ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
+if test "x$ac_cv_func__doprnt" = xyes; then :
+
+$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
+
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+fi
+done
+
+
+for ac_func in floor getcwd gettimeofday memmove memset pow select sqrt strchr strdup strstr
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
 fi
+done
+
+
 
 
 
@@ -14381,175 +16971,462 @@ fi
 
 
 
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
 
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
 
 
 
+    # Extract the first word of "gtkdoc-check", so it can be a program name with args.
+set dummy gtkdoc-check; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GTKDOC_CHECK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GTKDOC_CHECK in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK
+if test -n "$GTKDOC_CHECK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5
+$as_echo "$GTKDOC_CHECK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+  for ac_prog in gtkdoc-rebase
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GTKDOC_REBASE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GTKDOC_REBASE in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE
+if test -n "$GTKDOC_REBASE"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5
+$as_echo "$GTKDOC_REBASE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+  test -n "$GTKDOC_REBASE" && break
+done
+test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true"
 
+  # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args.
+set dummy gtkdoc-mkpdf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GTKDOC_MKPDF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GTKDOC_MKPDF in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF
+if test -n "$GTKDOC_MKPDF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5
+$as_echo "$GTKDOC_MKPDF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
 
 
+# Check whether --with-html-dir was given.
+if test "${with_html_dir+set}" = set; then :
+  withval=$with_html_dir;
+else
+  with_html_dir='${datadir}/gtk-doc/html'
+fi
 
+  HTML_DIR="$with_html_dir"
 
 
+    # Check whether --enable-gtk-doc was given.
+if test "${enable_gtk_doc+set}" = set; then :
+  enableval=$enable_gtk_doc;
+else
+  enable_gtk_doc=no
+fi
 
 
+  if test x$enable_gtk_doc = xyes; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.9\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.9") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  :
+else
+  as_fn_error $? "You need to have gtk-doc >= 1.9 installed to build $PACKAGE_NAME" "$LINENO" 5
+fi
+        if test "x$PACKAGE_NAME" != "xglib"; then
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" ||
-   test -n "$runpath_var_CXX" ||
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5
+$as_echo_n "checking for GTKDOC_DEPS... " >&6; }
 
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct_CXX" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
+if test -n "$GTKDOC_DEPS_CFLAGS"; then
+    pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
+  pkg_failed=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink ||
-   test "$inherit_rpath_CXX" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
+ else
+    pkg_failed=untried
+fi
+if test -n "$GTKDOC_DEPS_LIBS"; then
+    pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
 
 
 
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>&1`
+        else
+	        GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GTKDOC_DEPS_PKG_ERRORS" >&5
 
+	as_fn_error $? "Package requirements (glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0) were not met:
 
+$GTKDOC_DEPS_PKG_ERRORS
 
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
+Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS
+and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
+Alternatively, you may set the environment variables GTKDOC_DEPS_CFLAGS
+and GTKDOC_DEPS_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS
+	GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
+fi
+    fi
+  fi
 
-        ac_config_commands="$ac_config_commands libtool"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5
+$as_echo_n "checking whether to build gtk-doc documentation... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5
+$as_echo "$enable_gtk_doc" >&6; }
 
+    # Check whether --enable-gtk-doc-html was given.
+if test "${enable_gtk_doc_html+set}" = set; then :
+  enableval=$enable_gtk_doc_html;
+else
+  enable_gtk_doc_html=yes
+fi
 
+    # Check whether --enable-gtk-doc-pdf was given.
+if test "${enable_gtk_doc_pdf+set}" = set; then :
+  enableval=$enable_gtk_doc_pdf;
+else
+  enable_gtk_doc_pdf=no
+fi
 
 
-# Only expand once:
+  if test -z "$GTKDOC_MKPDF"; then
+    enable_gtk_doc_pdf=no
+  fi
 
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+   if test x$enable_gtk_doc = xyes; then
+  ENABLE_GTK_DOC_TRUE=
+  ENABLE_GTK_DOC_FALSE='#'
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+  ENABLE_GTK_DOC_TRUE='#'
+  ENABLE_GTK_DOC_FALSE=
+fi
 
+   if test x$enable_gtk_doc_html = xyes; then
+  GTK_DOC_BUILD_HTML_TRUE=
+  GTK_DOC_BUILD_HTML_FALSE='#'
+else
+  GTK_DOC_BUILD_HTML_TRUE='#'
+  GTK_DOC_BUILD_HTML_FALSE=
 fi
+
+   if test x$enable_gtk_doc_pdf = xyes; then
+  GTK_DOC_BUILD_PDF_TRUE=
+  GTK_DOC_BUILD_PDF_FALSE='#'
+else
+  GTK_DOC_BUILD_PDF_TRUE='#'
+  GTK_DOC_BUILD_PDF_FALSE=
 fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
+
+   if test -n "$LIBTOOL"; then
+  GTK_DOC_USE_LIBTOOL_TRUE=
+  GTK_DOC_USE_LIBTOOL_FALSE='#'
+else
+  GTK_DOC_USE_LIBTOOL_TRUE='#'
+  GTK_DOC_USE_LIBTOOL_FALSE=
+fi
+
+   if test -n "$GTKDOC_REBASE"; then
+  GTK_DOC_USE_REBASE_TRUE=
+  GTK_DOC_USE_REBASE_FALSE='#'
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  GTK_DOC_USE_REBASE_TRUE='#'
+  GTK_DOC_USE_REBASE_FALSE=
 fi
 
 
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
+
+
+# Extract the first word of "asy", so it can be a program name with args.
+set dummy asy; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
+if ${ac_cv_path_ASY+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  case $ASY in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ASY="$ASY" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ASY="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -14557,1047 +17434,1272 @@ done
   done
 IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_ASY" && ac_cv_path_ASY="echo"
+  ;;
+esac
 fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
+ASY=$ac_cv_path_ASY
+if test -n "$ASY"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASY" >&5
+$as_echo "$ASY" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
+
+
+
+
+case "$host" in
+        *-*-mingw*|*-*-cygwin*)
+
+$as_echo "#define PLATFORM_WIN32 1" >>confdefs.h
+
+                opengl_LIBS="-lunsupported_platform"
+                PLATFORM_STRING="Win32"
+                ;;
+        *-*-linux*)
+
+$as_echo "#define PLATFORM_LINUX 1" >>confdefs.h
+
+                opengl_LIBS="-lGL -lGLU"
+                PLATFORM_STRING="Linux"
+                ;;
+        *-*-darwin*)
+
+$as_echo "#define PLATFORM_APPLE 1" >>confdefs.h
+
+                opengl_LIBS="-framework AGL -framework OpenGL -framework GLUT"
+                PLATFORM_STRING="Apple"
+                ;;
+        *)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Please add $host to configure.ac checks!" >&5
+$as_echo "$as_me: WARNING: *** Please add $host to configure.ac checks!" >&2;}
+                ;;
 esac
-    RANLIB=$ac_ct_RANLIB
-  fi
+
+
+case "$host" in
+        i?86-* | k?-* | athlon-* | pentium*-)
+
+$as_echo "#define ARCH_X86 1" >>confdefs.h
+
+                ARCH_SPECIFIC_CFLAGS=""
+                ARCH_STRING="X86"
+                ;;
+        x86_64-*)
+
+$as_echo "#define ARCH_X86_64 1" >>confdefs.h
+
+                ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
+                ARCH_STRING="X86-64"
+                ;;
+        ppc-* | powerpc-*)
+
+$as_echo "#define ARCH_PPC 1" >>confdefs.h
+
+                ARCH_SPECIFIC_CFLAGS=""
+                ARCH_STRING="PowerPC"
+                ;;
+        *)
+                as_fn_error $? "Unknown Architecture" "$LINENO" 5
+                ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  RANLIB="$ac_cv_prog_RANLIB"
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+	       not a universal capable compiler
+	     #endif
+	     typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+	# Check for potential -arch flags.  It is not universal unless
+	# there are at least two -arch flags with different values.
+	ac_arch=
+	ac_prev=
+	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+	 if test -n "$ac_prev"; then
+	   case $ac_word in
+	     i?86 | x86_64 | ppc | ppc64)
+	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+		 ac_arch=$ac_word
+	       else
+		 ac_cv_c_bigendian=universal
+		 break
+	       fi
+	       ;;
+	   esac
+	   ac_prev=
+	 elif test "x$ac_word" = "x-arch"; then
+	   ac_prev=arch
+	 fi
+       done
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+	     #include <sys/param.h>
 
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+		     && LITTLE_ENDIAN)
+	      bogus endian macros
+	     #endif
 
-# Checks for libraries.
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+		#include <sys/param.h>
 
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+		 not big endian
+		#endif
 
-# Check whether --with-gsl-prefix was given.
-if test "${with_gsl_prefix+set}" = set; then :
-  withval=$with_gsl_prefix; gsl_prefix="$withval"
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
 else
-  gsl_prefix=""
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
 
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+	      bogus endian macros
+	     #endif
 
-# Check whether --with-gsl-exec-prefix was given.
-if test "${with_gsl_exec_prefix+set}" = set; then :
-  withval=$with_gsl_exec_prefix; gsl_exec_prefix="$withval"
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+		 not big endian
+		#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_bigendian=yes
 else
-  gsl_exec_prefix=""
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then :
+  # Try to guess by grepping values from an object file.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+short int ascii_mm[] =
+		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+		short int ascii_ii[] =
+		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+		int use_ascii (int i) {
+		  return ascii_mm[i] + ascii_ii[i];
+		}
+		short int ebcdic_ii[] =
+		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+		short int ebcdic_mm[] =
+		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+		int use_ebcdic (int i) {
+		  return ebcdic_mm[i] + ebcdic_ii[i];
+		}
+		extern int foo;
 
-# Check whether --enable-gsltest was given.
-if test "${enable_gsltest+set}" = set; then :
-  enableval=$enable_gsltest;
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+	      ac_cv_c_bigendian=yes
+	    fi
+	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+	      if test "$ac_cv_c_bigendian" = unknown; then
+		ac_cv_c_bigendian=no
+	      else
+		# finding both strings is unlikely to happen, but who knows?
+		ac_cv_c_bigendian=unknown
+	      fi
+	    fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  enable_gsltest=yes
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+	     /* Are we little or big endian?  From Harbison&Steele.  */
+	     union
+	     {
+	       long int l;
+	       char c[sizeof (long int)];
+	     } u;
+	     u.l = 1;
+	     return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_c_bigendian=no
+else
+  ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+   no)
+      ;; #(
+   universal)
 
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
-  if test "x${GSL_CONFIG+set}" != xset ; then
-     if test "x$gsl_prefix" != x ; then
-         GSL_CONFIG="$gsl_prefix/bin/gsl-config"
-     fi
-     if test "x$gsl_exec_prefix" != x ; then
-        GSL_CONFIG="$gsl_exec_prefix/bin/gsl-config"
-     fi
-  fi
+     ;; #(
+   *)
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
 
-  # Extract the first word of "gsl-config", so it can be a program name with args.
-set dummy gsl-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GSL_CONFIG+set}" = set; then :
-  $as_echo_n "(cached) " >&6
+
+#----------------------------------------------------------------------------
+# Package configuration switches.
+#----------------------------------------------------------------------------
+# Check whether --enable-multithreaded was given.
+if test "${enable_multithreaded+set}" = set; then :
+  enableval=$enable_multithreaded; disable_multithreaded=no
 else
-  case $GSL_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GSL_CONFIG="$GSL_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_GSL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+  disable_multithreaded=yes
+fi
 
-  test -z "$ac_cv_path_GSL_CONFIG" && ac_cv_path_GSL_CONFIG="no"
-  ;;
-esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking BulletMultiThreaded" >&5
+$as_echo_n "checking BulletMultiThreaded... " >&6; }
+if test "$disable_multithreaded" = yes; then :
+  build_multithreaded=no
+else
+  build_multithreaded=yes
 fi
-GSL_CONFIG=$ac_cv_path_GSL_CONFIG
-if test -n "$GSL_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GSL_CONFIG" >&5
-$as_echo "$GSL_CONFIG" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $build_multithreaded" >&5
+$as_echo "$build_multithreaded" >&6; }
+ if test "$build_multithreaded" = yes; then
+  CONDITIONAL_BUILD_MULTITHREADED_TRUE=
+  CONDITIONAL_BUILD_MULTITHREADED_FALSE='#'
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  CONDITIONAL_BUILD_MULTITHREADED_TRUE='#'
+  CONDITIONAL_BUILD_MULTITHREADED_FALSE=
 fi
 
 
-  min_gsl_version=0.2.5
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GSL - version >= $min_gsl_version" >&5
-$as_echo_n "checking for GSL - version >= $min_gsl_version... " >&6; }
-  no_gsl=""
-  if test "$GSL_CONFIG" = "no" ; then
-    no_gsl=yes
-  else
-    GSL_CFLAGS=`$GSL_CONFIG --cflags`
-    GSL_LIBS=`$GSL_CONFIG --libs`
+# Check whether --enable-demos was given.
+if test "${enable_demos+set}" = set; then :
+  enableval=$enable_demos;
+else
+  enable_demos=yes
+fi
 
-    gsl_major_version=`$GSL_CONFIG --version | \
-           sed 's/^\([0-9]*\).*/\1/'`
-    if test "x${gsl_major_version}" = "x" ; then
-       gsl_major_version=0
-    fi
+ if false; then
+  CONDITIONAL_BUILD_DEMOS_TRUE=
+  CONDITIONAL_BUILD_DEMOS_FALSE='#'
+else
+  CONDITIONAL_BUILD_DEMOS_TRUE='#'
+  CONDITIONAL_BUILD_DEMOS_FALSE=
+fi
 
-    gsl_minor_version=`$GSL_CONFIG --version | \
-           sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\2/'`
-    if test "x${gsl_minor_version}" = "x" ; then
-       gsl_minor_version=0
-    fi
+if test "x$enable_demos" != xno; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: Building Bullet demos" >&5
+$as_echo "$as_me: Building Bullet demos" >&6;}
+     if true; then
+  CONDITIONAL_BUILD_DEMOS_TRUE=
+  CONDITIONAL_BUILD_DEMOS_FALSE='#'
+else
+  CONDITIONAL_BUILD_DEMOS_TRUE='#'
+  CONDITIONAL_BUILD_DEMOS_FALSE=
+fi
 
-    gsl_micro_version=`$GSL_CONFIG --version | \
-           sed 's/^\([0-9]*\)\.\{0,1\}\([0-9]*\)\.\{0,1\}\([0-9]*\).*/\3/'`
-    if test "x${gsl_micro_version}" = "x" ; then
-       gsl_micro_version=0
-    fi
+fi
 
-    if test "x$enable_gsltest" = "xyes" ; then
-      ac_save_CFLAGS="$CFLAGS"
-      ac_save_LIBS="$LIBS"
-      CFLAGS="$CFLAGS $GSL_CFLAGS"
-      LIBS="$LIBS $GSL_LIBS"
 
-      rm -f conf.gsltest
-      if test "$cross_compiling" = yes; then :
-  echo $ac_n "cross compiling; assumed OK... $ac_c"
+
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug;
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  enable_debug=no
+fi
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
-char* my_strdup (const char *str);
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build mode" >&5
+$as_echo_n "checking build mode... " >&6; }
+if test $enable_debug = yes; then :
+  build_mode=debug
+else
+  build_mode=optimize
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $build_mode" >&5
+$as_echo "$build_mode" >&6; }
 
-char*
-my_strdup (const char *str)
-{
-  char *new_str;
+CFLAGS="$ARCH_SPECIFIC_CFLAGS $CFLAGS"
+CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
 
-  if (str)
-    {
-      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
-      strcpy (new_str, str);
-    }
-  else
-    new_str = NULL;
+### end bullet configure script
 
-  return new_str;
-}
 
-int main (void)
-{
-  int major = 0, minor = 0, micro = 0;
-  int n;
-  char *tmp_version;
+# Check whether --enable-hkl3d was given.
+if test "${enable_hkl3d+set}" = set; then :
+  enableval=$enable_hkl3d;
+else
+  enable_hkl3d=no
+fi
 
-  system ("touch conf.gsltest");
+ if test x$enable_hkl3d != xno; then
+  HKL3D_TRUE=
+  HKL3D_FALSE='#'
+else
+  HKL3D_TRUE='#'
+  HKL3D_FALSE=
+fi
 
-  /* HP/UX 9 (%@#!) writes to sscanf strings */
-  tmp_version = my_strdup("$min_gsl_version");
+if test -z "$HKL3D_TRUE"; then :
 
-  n = sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) ;
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for G3D" >&5
+$as_echo_n "checking for G3D... " >&6; }
 
-  if (n != 2 && n != 3) {
-     printf("%s, bad version string\n", "$min_gsl_version");
-     exit(1);
-   }
+if test -n "$G3D_CFLAGS"; then
+    pkg_cv_G3D_CFLAGS="$G3D_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libg3d >= 0.0.8\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libg3d >= 0.0.8") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_G3D_CFLAGS=`$PKG_CONFIG --cflags "libg3d >= 0.0.8" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$G3D_LIBS"; then
+    pkg_cv_G3D_LIBS="$G3D_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libg3d >= 0.0.8\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libg3d >= 0.0.8") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_G3D_LIBS=`$PKG_CONFIG --libs "libg3d >= 0.0.8" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
 
-   if (($gsl_major_version > major) ||
-      (($gsl_major_version == major) && ($gsl_minor_version > minor)) ||
-      (($gsl_major_version == major) && ($gsl_minor_version == minor) && ($gsl_micro_version >= micro)))
-     {
-       exit(0);
-     }
-   else
-     {
-       exit(1);
-     }
-}
 
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  no_gsl=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+        _pkg_short_errors_supported=no
 fi
+        if test $_pkg_short_errors_supported = yes; then
+	        G3D_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libg3d >= 0.0.8" 2>&1`
+        else
+	        G3D_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libg3d >= 0.0.8" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$G3D_PKG_ERRORS" >&5
 
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_gsl" = x ; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-     :
-  else
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+	as_fn_error $? "Package requirements (libg3d >= 0.0.8) were not met:
+
+$G3D_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables G3D_CFLAGS
+and G3D_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-     if test "$GSL_CONFIG" = "no" ; then
-       echo "*** The gsl-config script installed by GSL could not be found"
-       echo "*** If GSL was installed in PREFIX, make sure PREFIX/bin is in"
-       echo "*** your path, or set the GSL_CONFIG environment variable to the"
-       echo "*** full path to gsl-config."
-     else
-       if test -f conf.gsltest ; then
-        :
-       else
-          echo "*** Could not run GSL test program, checking why..."
-          CFLAGS="$CFLAGS $GSL_CFLAGS"
-          LIBS="$LIBS $GSL_LIBS"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
-#include <stdio.h>
+Alternatively, you may set the environment variables G3D_CFLAGS
+and G3D_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	G3D_CFLAGS=$pkg_cv_G3D_CFLAGS
+	G3D_LIBS=$pkg_cv_G3D_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
+fi
+	   	   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yaml_get_version" >&5
+$as_echo_n "checking for library containing yaml_get_version... " >&6; }
+if ${ac_cv_search_yaml_get_version+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char yaml_get_version ();
 int
 main ()
 {
- return 0;
+return yaml_get_version ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-   echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding GSL or finding the wrong"
-          echo "*** version of GSL. If it is not finding GSL, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system"
-	  echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
-else
-   echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means GSL was incorrectly installed"
-          echo "*** or that you have moved GSL since it was installed. In the latter case, you"
-          echo "*** may want to edit the gsl-config script: $GSL_CONFIG"
+for ac_lib in '' yaml; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_yaml_get_version=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-#     GSL_CFLAGS=""
-#     GSL_LIBS=""
-     :
-  fi
+    conftest$ac_exeext
+  if ${ac_cv_search_yaml_get_version+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_yaml_get_version+:} false; then :
 
+else
+  ac_cv_search_yaml_get_version=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yaml_get_version" >&5
+$as_echo "$ac_cv_search_yaml_get_version" >&6; }
+ac_res=$ac_cv_search_yaml_get_version
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  for ac_header in yaml.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "yaml.h" "ac_cv_header_yaml_h" "$ac_includes_default"
+if test "x$ac_cv_header_yaml_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_YAML_H 1
+_ACEOF
 
-  rm -f conf.gsltest
+else
+  as_fn_error $? "Could not find the yaml headers, please install yaml developement files" "$LINENO" 5
 
+fi
+
+done
 
-# Checks for header files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  as_fn_error $? "Could not find the libyaml runtime, please install yaml" "$LINENO" 5
 
-#include <stdbool.h>
-#ifndef bool
- "error: bool is not defined"
-#endif
-#ifndef false
- "error: false is not defined"
-#endif
-#if false
- "error: false is not 0"
-#endif
-#ifndef true
- "error: true is not defined"
-#endif
-#if true != 1
- "error: true is not 1"
-#endif
-#ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
-#endif
+fi
 
-	struct s { _Bool s: 1; _Bool t; } s;
-
-	char a[true == 1 ? 1 : -1];
-	char b[false == 0 ? 1 : -1];
-	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-	char d[(bool) 0.5 == true ? 1 : -1];
-	bool e = &s;
-	char f[(_Bool) 0.0 == false ? 1 : -1];
-	char g[true];
-	char h[sizeof (_Bool)];
-	char i[sizeof s.t];
-	enum { j = false, k = true, l = false * true, m = true * 256 };
-	/* The following fails for
-	   HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-	_Bool n[m];
-	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-#	if defined __xlc__ || defined __GNUC__
-	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-	    reported by James Lemley on 2005-10-05; see
-	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-	    This test is not quite right, since xlc is allowed to
-	    reject this program, as the initializer for xlcbug is
-	    not one of the forms that C requires support for.
-	    However, doing the test right would require a runtime
-	    test, and that would make cross-compilation harder.
-	    Let us hope that IBM fixes the xlc bug, and also adds
-	    support for this kind of constant expression.  In the
-	    meantime, this test will reject xlc, which is OK, since
-	    our stdbool.h substitute should suffice.  We also test
-	    this with GCC, where it should work, to detect more
-	    quickly whether someone messes up the test in the
-	    future.  */
-	 char digs[] = "0123456789";
-	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-#	endif
-	/* Catch a bug in an HP-UX C compiler.  See
-	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-	 */
-	_Bool q = true;
-	_Bool *pq = &q;
+	   YAML_CFLAGS=""
 
-int
-main ()
-{
+	   YAML_LIBS="-lyaml"
 
-	*pq |= q;
-	*pq |= ! q;
-	/* Refer to every declared value, to avoid compiler optimizations.  */
-	return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-		+ !m + !n + !o + !p + !q + !pq);
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdbool_h=yes
+fi
+
+
+# Check whether --enable-gui was given.
+if test "${enable_gui+set}" = set; then :
+  enableval=$enable_gui;
 else
-  ac_cv_header_stdbool_h=no
+  enable_gui=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ if test x$enable_gui = xyes; then
+  GUI_TRUE=
+  GUI_FALSE='#'
+else
+  GUI_TRUE='#'
+  GUI_FALSE=
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
-ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = x""yes; then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE__BOOL 1
-_ACEOF
+if test -z "$GUI_TRUE"; then :
 
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKMM" >&5
+$as_echo_n "checking for GTKMM... " >&6; }
 
+if test -n "$GTKMM_CFLAGS"; then
+    pkg_cv_GTKMM_CFLAGS="$GTKMM_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 >= 2.18\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 >= 2.18") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTKMM_CFLAGS=`$PKG_CONFIG --cflags "gtkmm-2.4 >= 2.18" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$GTKMM_LIBS"; then
+    pkg_cv_GTKMM_LIBS="$GTKMM_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 >= 2.18\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 >= 2.18") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTKMM_LIBS=`$PKG_CONFIG --libs "gtkmm-2.4 >= 2.18" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
 
-if test $ac_cv_header_stdbool_h = yes; then
-
-$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
-
-fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
 
-int
-main ()
-{
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_stdc=no
+        _pkg_short_errors_supported=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
+        if test $_pkg_short_errors_supported = yes; then
+	        GTKMM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtkmm-2.4 >= 2.18" 2>&1`
+        else
+	        GTKMM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtkmm-2.4 >= 2.18" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GTKMM_PKG_ERRORS" >&5
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
+	as_fn_error $? "Package requirements (gtkmm-2.4 >= 2.18) were not met:
 
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+$GTKMM_PKG_ERRORS
 
-fi
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
+Alternatively, you may set the environment variables GTKMM_CFLAGS
+and GTKMM_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
+Alternatively, you may set the environment variables GTKMM_CFLAGS
+and GTKMM_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+	GTKMM_CFLAGS=$pkg_cv_GTKMM_CFLAGS
+	GTKMM_LIBS=$pkg_cv_GTKMM_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
 fi
+	if test -z "$HKL3D_TRUE"; then :
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLU" >&5
+$as_echo_n "checking for GLU... " >&6; }
 
+if test -n "$GLU_CFLAGS"; then
+    pkg_cv_GLU_CFLAGS="$GLU_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu >= 7.7.1\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "glu >= 7.7.1") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GLU_CFLAGS=`$PKG_CONFIG --cflags "glu >= 7.7.1" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  ac_cv_header_stdc=no
+  pkg_failed=yes
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+ else
+    pkg_failed=untried
 fi
-
+if test -n "$GLU_LIBS"; then
+    pkg_cv_GLU_LIBS="$GLU_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu >= 7.7.1\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "glu >= 7.7.1") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GLU_LIBS=`$PKG_CONFIG --libs "glu >= 7.7.1" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
 fi
+ else
+    pkg_failed=untried
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
 
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
-fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
-$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_time=yes
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  ac_cv_header_time=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        _pkg_short_errors_supported=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
-$as_echo "$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-
-$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+        if test $_pkg_short_errors_supported = yes; then
+	        GLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glu >= 7.7.1" 2>&1`
+        else
+	        GLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glu >= 7.7.1" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GLU_PKG_ERRORS" >&5
 
-fi
+	as_fn_error $? "Package requirements (glu >= 7.7.1) were not met:
 
-for ac_header in float.h stdlib.h string.h sys/time.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-eval as_val=\$$as_ac_Header
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+$GLU_PKG_ERRORS
 
-fi
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
-done
+Alternatively, you may set the environment variables GLU_CFLAGS
+and GLU_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
+Alternatively, you may set the environment variables GLU_CFLAGS
+and GLU_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
-# Checks for typedefs, structures, and compiler characteristics.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then :
-  $as_echo_n "(cached) " >&6
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+	GLU_CFLAGS=$pkg_cv_GLU_CFLAGS
+	GLU_LIBS=$pkg_cv_GLU_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset cs;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *pcpcc;
-  char **ppc;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  pcpcc = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++pcpcc;
-  ppc = (char**) pcpcc;
-  pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
+fi
 
-    *t++ = 0;
-    if (s) return 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-    if (!foo) return 0;
-  }
-  return !cs[0] && !zero.x;
-#endif
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKGLEXTMM" >&5
+$as_echo_n "checking for GTKGLEXTMM... " >&6; }
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_const=yes
+if test -n "$GTKGLEXTMM_CFLAGS"; then
+    pkg_cv_GTKGLEXTMM_CFLAGS="$GTKGLEXTMM_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkglextmm-1.2\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtkglextmm-1.2") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTKGLEXTMM_CFLAGS=`$PKG_CONFIG --cflags "gtkglextmm-1.2" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  ac_cv_c_const=no
+  pkg_failed=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+    pkg_failed=untried
+fi
+if test -n "$GTKGLEXTMM_LIBS"; then
+    pkg_cv_GTKGLEXTMM_LIBS="$GTKGLEXTMM_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkglextmm-1.2\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtkglextmm-1.2") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTKGLEXTMM_LIBS=`$PKG_CONFIG --libs "gtkglextmm-1.2" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
 
-$as_echo "#define const /**/" >>confdefs.h
 
-fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_inline=$ac_kw
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
+        if test $_pkg_short_errors_supported = yes; then
+	        GTKGLEXTMM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtkglextmm-1.2" 2>&1`
+        else
+	        GTKGLEXTMM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtkglextmm-1.2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GTKGLEXTMM_PKG_ERRORS" >&5
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
+	as_fn_error $? "Package requirements (gtkglextmm-1.2) were not met:
 
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
+$GTKGLEXTMM_PKG_ERRORS
 
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GTKGLEXTMM_CFLAGS
+and GTKGLEXTMM_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
+Alternatively, you may set the environment variables GTKGLEXTMM_CFLAGS
+and GTKGLEXTMM_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
 else
+	GTKGLEXTMM_CFLAGS=$pkg_cv_GTKGLEXTMM_CFLAGS
+	GTKGLEXTMM_LIBS=$pkg_cv_GTKGLEXTMM_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
+fi
 
 fi
 
+fi
 
-# Checks for library functions.
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments.  Useless!
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <alloca.h>
-int
-main ()
-{
-char *p = (char *) alloca (2 * sizeof (int));
-			  if (p) return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_working_alloca_h=yes
+
+# Check whether --enable-gcov was given.
+if test "${enable_gcov+set}" = set; then :
+  enableval=$enable_gcov; use_gcov=$enableval
 else
-  ac_cv_working_alloca_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  use_gcov=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
 
-$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
 
-fi
+if test "x$use_gcov" = "xyes"; then
+      if test "$GCC" != "yes"; then
+      as_fn_error $? "GCC is required for --enable-gcov" "$LINENO" 5
+   fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then :
+    # Extract the first word of "shtool", so it can be a program name with args.
+set dummy shtool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_SHTOOL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
-# else
-#  ifdef HAVE_ALLOCA_H
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-#    endif
-#   endif
-#  endif
-# endif
-#endif
-
-int
-main ()
-{
-char *p = (char *) alloca (1);
-				    if (p) return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_alloca_works=yes
+  if test -n "$SHTOOL"; then
+  ac_cv_prog_SHTOOL="$SHTOOL" # Let the user override the test.
 else
-  ac_cv_func_alloca_works=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_SHTOOL="shtool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
-
-if test $ac_cv_func_alloca_works = yes; then
-
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
-
+SHTOOL=$ac_cv_prog_SHTOOL
+if test -n "$SHTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHTOOL" >&5
+$as_echo "$SHTOOL" >&6; }
 else
-  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble.  Some versions do not even contain alloca or
-# contain a buggy version.  If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
 
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
+  case `$SHTOOL path $CC` in
+    *ccache*) gcc_ccache=yes;;
+    *) gcc_ccache=no;;
+  esac
 
+  if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
+    as_fn_error $? "ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1." "$LINENO" 5
+  fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then :
+  ltp_version_list="1.6 1.7 1.8 1.9"
+  # Extract the first word of "lcov", so it can be a program name with args.
+set dummy lcov; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LTP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
+  if test -n "$LTP"; then
+  ac_cv_prog_LTP="$LTP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LTP="lcov"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then :
-  ac_cv_os_cray=yes
+fi
+fi
+LTP=$ac_cv_prog_LTP
+if test -n "$LTP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTP" >&5
+$as_echo "$LTP" >&6; }
 else
-  ac_cv_os_cray=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-rm -f conftest*
+
+
+  # Extract the first word of "genhtml", so it can be a program name with args.
+set dummy genhtml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LTP_GENHTML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LTP_GENHTML"; then
+  ac_cv_prog_LTP_GENHTML="$LTP_GENHTML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LTP_GENHTML="genhtml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
-
-    break
 fi
-
-  done
+LTP_GENHTML=$ac_cv_prog_LTP_GENHTML
+if test -n "$LTP_GENHTML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTP_GENHTML" >&5
+$as_echo "$LTP_GENHTML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then :
+
+
+  if test "$LTP"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ltp version" >&5
+$as_echo_n "checking for ltp version... " >&6; }
+if ${glib_cv_ltp_version+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_c_stack_direction=0
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-find_stack_direction ()
-{
-  static char *addr = 0;
-  auto char dummy;
-  if (addr == 0)
-    {
-      addr = &dummy;
-      return find_stack_direction ();
-    }
-  else
-    return (&dummy > addr) ? 1 : -1;
-}
 
-int
-main ()
-{
-  return find_stack_direction () < 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_stack_direction=1
-else
-  ac_cv_c_stack_direction=-1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+      glib_cv_ltp_version=invalid
+      ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
+      for ltp_check_version in $ltp_version_list; do
+        if test "$ltp_version" = "$ltp_check_version"; then
+          glib_cv_ltp_version="$ltp_check_version (ok)"
+        fi
+      done
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_ltp_version" >&5
+$as_echo "$glib_cv_ltp_version" >&6; }
+  else
+    ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
+    as_fn_error $? "$ltp_msg" "$LINENO" 5
+  fi
 
+  case $glib_cv_ltp_version in
+    ""|invalid)
+      ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
+      as_fn_error $? "$ltp_msg" "$LINENO" 5
+      LTP="exit 0;"
+      ;;
+  esac
 
-fi
+  if test -z "$LTP_GENHTML"; then
+    as_fn_error $? "Could not find genhtml from the LTP package" "$LINENO" 5
+  fi
+
+
+$as_echo "#define HAVE_GCOV 1" >>confdefs.h
+
+
+
+  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
 
-for ac_header in stdlib.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDLIB_H 1
-_ACEOF
 
+    CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  LDFLAGS="$LDFLAGS -lgcov"
 fi
 
-done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
-$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_malloc_0_nonnull=no
+
+
+
+                # Check whether --enable-introspection was given.
+if test "${enable_introspection+set}" = set; then :
+  enableval=$enable_introspection;
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
+  enable_introspection=auto
+fi
 
-int
-main ()
-{
-return ! malloc (0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_malloc_0_nonnull=yes
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5
+$as_echo_n "checking for gobject-introspection... " >&6; }
+
+        case $enable_introspection in #(
+  no) :
+            found_introspection="no (disabled, use --enable-introspection to enable)"
+     ;; #(
+      yes) :
+            if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  :
 else
-  ac_cv_func_malloc_0_nonnull=no
+  as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+        if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  found_introspection=yes
+else
+  as_fn_error $? "You need to have gobject-introspection >= 0.6.7 installed to build hkl" "$LINENO" 5
 fi
-
+     ;; #(
+      auto) :
+            if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 0.6.7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 0.6.7") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  found_introspection=yes
+else
+  found_introspection=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then :
+		enable_introspection=$found_introspection
+     ;; #(
+  *) :
+                as_fn_error $? "invalid argument passed to --enable-introspection, should be one of [no/auto/yes]" "$LINENO" 5
+     ;;
+esac
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_introspection" >&5
+$as_echo "$found_introspection" >&6; }
+
+    INTROSPECTION_SCANNER=
+    INTROSPECTION_COMPILER=
+    INTROSPECTION_GENERATE=
+    INTROSPECTION_GIRDIR=
+    INTROSPECTION_TYPELIBDIR=
+    if test "x$found_introspection" = "xyes"; then
+       INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+       INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+       INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+       INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+       INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+       INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+       INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+       INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+    fi
 
-$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
 
-else
-  $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
 
-   case " $LIBOBJS " in
-  *" malloc.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
- ;;
-esac
 
 
-$as_echo "#define malloc rpl_malloc" >>confdefs.h
 
-fi
 
 
-for ac_header in stdlib.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDLIB_H 1
-_ACEOF
 
+     if test "x$found_introspection" = "xyes"; then
+  HAVE_INTROSPECTION_TRUE=
+  HAVE_INTROSPECTION_FALSE='#'
+else
+  HAVE_INTROSPECTION_TRUE='#'
+  HAVE_INTROSPECTION_FALSE=
 fi
 
-done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
-$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
-if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_realloc_0_nonnull=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *realloc ();
-#endif
 
-int
-main ()
-{
-return ! realloc (0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_realloc_0_nonnull=yes
+
+if test -z "$HAVE_INTROSPECTION_TRUE"; then :
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GOBJECT" >&5
+$as_echo_n "checking for GOBJECT... " >&6; }
+
+if test -n "$GOBJECT_CFLAGS"; then
+    pkg_cv_GOBJECT_CFLAGS="$GOBJECT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GOBJECT_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
-  ac_cv_func_realloc_0_nonnull=no
+  pkg_failed=yes
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+ else
+    pkg_failed=untried
 fi
-
+if test -n "$GOBJECT_LIBS"; then
+    pkg_cv_GOBJECT_LIBS="$GOBJECT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gobject-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GOBJECT_LIBS=`$PKG_CONFIG --libs "gobject-2.0" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
-if test $ac_cv_func_realloc_0_nonnull = yes; then :
 
-$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
 
-else
-  $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
 
-   case " $LIBOBJS " in
-  *" realloc.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
- ;;
-esac
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GOBJECT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gobject-2.0" 2>&1`
+        else
+	        GOBJECT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gobject-2.0" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GOBJECT_PKG_ERRORS" >&5
 
-$as_echo "#define realloc rpl_realloc" >>confdefs.h
+	as_fn_error $? "Package requirements (gobject-2.0) were not met:
 
-fi
+$GOBJECT_PKG_ERRORS
 
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
 
-for ac_func in vprintf
-do :
-  ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
-if test "x$ac_cv_func_vprintf" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_VPRINTF 1
-_ACEOF
+Alternatively, you may set the environment variables GOBJECT_CFLAGS
+and GOBJECT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
 
-ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
-if test "x$ac_cv_func__doprnt" = x""yes; then :
+Alternatively, you may set the environment variables GOBJECT_CFLAGS
+and GOBJECT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
 
-$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	GOBJECT_CFLAGS=$pkg_cv_GOBJECT_CFLAGS
+	GOBJECT_LIBS=$pkg_cv_GOBJECT_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
 fi
-
+	# Check whether --enable-glibtest was given.
+if test "${enable_glibtest+set}" = set; then :
+  enableval=$enable_glibtest;
+else
+  enable_glibtest=yes
 fi
-done
 
 
-for ac_func in floor gettimeofday memmove memset sqrt strdup
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
+  pkg_config_args=glib-2.0
+  for module in .
+  do
+      case "$module" in
+         gmodule)
+             pkg_config_args="$pkg_config_args gmodule-2.0"
+         ;;
+         gmodule-no-export)
+             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+         ;;
+         gobject)
+             pkg_config_args="$pkg_config_args gobject-2.0"
+         ;;
+         gthread)
+             pkg_config_args="$pkg_config_args gthread-2.0"
+         ;;
+         gio*)
+             pkg_config_args="$pkg_config_args $module-2.0"
+         ;;
+      esac
+  done
 
 
-# gtk-doc
 
 
 
@@ -15610,7 +18712,7 @@ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -15624,7 +18726,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -15653,7 +18755,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -15667,7 +18769,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -15705,7 +18807,7 @@ fi
 
 fi
 if test -n "$PKG_CONFIG"; then
-	_pkg_min_version=0.9.0
+	_pkg_min_version=0.16
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
 	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
@@ -15718,348 +18820,253 @@ $as_echo "no" >&6; }
 	fi
 fi
 
+  no_glib=""
 
-    # Extract the first word of "gtkdoc-check", so it can be a program name with args.
-set dummy gtkdoc-check; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GTKDOC_CHECK+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $GTKDOC_CHECK in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+  if test "x$PKG_CONFIG" = x ; then
+    no_glib=yes
+    PKG_CONFIG=no
   fi
-done
-  done
-IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK
-if test -n "$GTKDOC_CHECK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5
-$as_echo "$GTKDOC_CHECK" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+  min_glib_version=2.0.0
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5
+$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; }
 
+  if test x$PKG_CONFIG != xno ; then
+    ## don't try to run the test against uninstalled libtool libs
+    if $PKG_CONFIG --uninstalled $pkg_config_args; then
+	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
+	  enable_glibtest=no
+    fi
 
-  for ac_prog in gtkdoc-rebase
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GTKDOC_REBASE+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $GTKDOC_REBASE in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
+	  :
+    else
+	  no_glib=yes
+    fi
   fi
-done
-  done
-IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE
-if test -n "$GTKDOC_REBASE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5
-$as_echo "$GTKDOC_REBASE" >&6; }
+  if test x"$no_glib" = x ; then
+    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
+    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
+    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+    GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
+
+    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
+           sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+    if test "x$enable_glibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GLIB_CFLAGS"
+      LIBS="$GLIB_LIBS $LIBS"
+      rm -f conf.glibtest
+      if test "$cross_compiling" = yes; then :
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  test -n "$GTKDOC_REBASE" && break
-done
-test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true"
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
 
-  # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args.
-set dummy gtkdoc-mkpdf; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GTKDOC_MKPDF+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $GTKDOC_MKPDF in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+int
+main ()
+{
+  unsigned int major, minor, micro;
+  char *tmp_version;
 
-  ;;
-esac
-fi
-GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF
-if test -n "$GTKDOC_MKPDF"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5
-$as_echo "$GTKDOC_MKPDF" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+  fclose (fopen ("conf.glibtest", "w"));
 
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_glib_version");
+  if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_glib_version");
+     exit(1);
+   }
 
+  if ((glib_major_version != $glib_config_major_version) ||
+      (glib_minor_version != $glib_config_minor_version) ||
+      (glib_micro_version != $glib_config_micro_version))
+    {
+      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
+             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
+             glib_major_version, glib_minor_version, glib_micro_version);
+      printf ("*** was found! If pkg-config was correct, then it is best\n");
+      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
+      printf("*** to point to the correct configuration files\n");
+    }
+  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
+	   (glib_minor_version != GLIB_MINOR_VERSION) ||
+           (glib_micro_version != GLIB_MICRO_VERSION))
+    {
+      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
+	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
+      printf("*** library (version %d.%d.%d)\n",
+	     glib_major_version, glib_minor_version, glib_micro_version);
+    }
+  else
+    {
+      if ((glib_major_version > major) ||
+        ((glib_major_version == major) && (glib_minor_version > minor)) ||
+        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
+      {
+        return 0;
+       }
+     else
+      {
+        printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
+               glib_major_version, glib_minor_version, glib_micro_version);
+        printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
+	       major, minor, micro);
+        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
+        printf("***\n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
+        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
 
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
-# Check whether --with-html-dir was given.
-if test "${with_html_dir+set}" = set; then :
-  withval=$with_html_dir;
 else
-  with_html_dir='${datadir}/gtk-doc/html'
+  no_glib=yes
 fi
-
-  HTML_DIR="$with_html_dir"
-
-
-    # Check whether --enable-gtk-doc was given.
-if test "${enable_gtk_doc+set}" = set; then :
-  enableval=$enable_gtk_doc;
-else
-  enable_gtk_doc=no
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5
+$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; }
+     :
+  else
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+     if test "$PKG_CONFIG" = "no" ; then
+       echo "*** A new enough version of pkg-config was not found."
+       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
+     else
+       if test -f conf.glibtest ; then
+        :
+       else
+          echo "*** Could not run GLIB test program, checking why..."
+          ac_save_CFLAGS="$CFLAGS"
+          ac_save_LIBS="$LIBS"
+          CFLAGS="$CFLAGS $GLIB_CFLAGS"
+          LIBS="$LIBS $GLIB_LIBS"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <glib.h>
+#include <stdio.h>
 
-  if test x$enable_gtk_doc = xyes; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.9\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.9") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  :
+int
+main ()
+{
+ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+   echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
+          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+	  echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 else
-  as_fn_error "You need to have gtk-doc >= 1.9 installed to build $PACKAGE_NAME" "$LINENO" 5
+   echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
+     GLIB_COMPILE_RESOURCES=""
+     :
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5
-$as_echo_n "checking whether to build gtk-doc documentation... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5
-$as_echo "$enable_gtk_doc" >&6; }
 
-    # Check whether --enable-gtk-doc-html was given.
-if test "${enable_gtk_doc_html+set}" = set; then :
-  enableval=$enable_gtk_doc_html;
-else
-  enable_gtk_doc_html=yes
-fi
 
-    # Check whether --enable-gtk-doc-pdf was given.
-if test "${enable_gtk_doc_pdf+set}" = set; then :
-  enableval=$enable_gtk_doc_pdf;
-else
-  enable_gtk_doc_pdf=no
-fi
 
 
-  if test -z "$GTKDOC_MKPDF"; then
-    enable_gtk_doc_pdf=no
-  fi
 
+  rm -f conf.glibtest
 
-   if test x$enable_gtk_doc = xyes; then
-  ENABLE_GTK_DOC_TRUE=
-  ENABLE_GTK_DOC_FALSE='#'
-else
-  ENABLE_GTK_DOC_TRUE='#'
-  ENABLE_GTK_DOC_FALSE=
 fi
 
-   if test x$enable_gtk_doc_html = xyes; then
-  GTK_DOC_BUILD_HTML_TRUE=
-  GTK_DOC_BUILD_HTML_FALSE='#'
-else
-  GTK_DOC_BUILD_HTML_TRUE='#'
-  GTK_DOC_BUILD_HTML_FALSE=
-fi
 
-   if test x$enable_gtk_doc_pdf = xyes; then
-  GTK_DOC_BUILD_PDF_TRUE=
-  GTK_DOC_BUILD_PDF_FALSE='#'
-else
-  GTK_DOC_BUILD_PDF_TRUE='#'
-  GTK_DOC_BUILD_PDF_FALSE=
-fi
 
-   if test -n "$LIBTOOL"; then
-  GTK_DOC_USE_LIBTOOL_TRUE=
-  GTK_DOC_USE_LIBTOOL_FALSE='#'
-else
-  GTK_DOC_USE_LIBTOOL_TRUE='#'
-  GTK_DOC_USE_LIBTOOL_FALSE=
-fi
 
-   if test -n "$GTKDOC_REBASE"; then
-  GTK_DOC_USE_REBASE_TRUE=
-  GTK_DOC_USE_REBASE_FALSE='#'
-else
-  GTK_DOC_USE_REBASE_TRUE='#'
-  GTK_DOC_USE_REBASE_FALSE=
-fi
+$as_echo "#define HAVE_SECTION_START_STOP 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_TYPEOF 1" >>confdefs.h
 
 
+$as_echo "#define HAVE_STATEMENT_EXPR 1" >>confdefs.h
 
-# add an option for the ghkl build
-# Check whether --enable-ghkl was given.
-if test "${enable_ghkl+set}" = set; then :
-  enableval=$enable_ghkl; case "${enableval}" in
-	      yes) ghkl=true ;;
-      	      no)  ghkl=false ;;
-      	      *) as_fn_error "bad value ${enableval} for --enable-ghkl" "$LINENO" 5 ;;
-	esac
-else
-  ghkl=true
-fi
 
- if test x$ghkl = xtrue; then
-  GHKL_TRUE=
-  GHKL_FALSE='#'
-else
-  GHKL_TRUE='#'
-  GHKL_FALSE=
-fi
+$as_echo "#define HAVE_ATTRIBUTE_COLD 1" >>confdefs.h
 
 
-# gtkmm + glademm
-if test x$ghkl = xtrue; then
+$as_echo "#define HAVE_ATTRIBUTE_PRINTF 1" >>confdefs.h
 
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKMM" >&5
-$as_echo_n "checking for GTKMM... " >&6; }
 
-if test -n "$GTKMM_CFLAGS"; then
-    pkg_cv_GTKMM_CFLAGS="$GTKMM_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 >= 2.18\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 >= 2.18") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_GTKMM_CFLAGS=`$PKG_CONFIG --cflags "gtkmm-2.4 >= 2.18" 2>/dev/null`
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$GTKMM_LIBS"; then
-    pkg_cv_GTKMM_LIBS="$GTKMM_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtkmm-2.4 >= 2.18\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "gtkmm-2.4 >= 2.18") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_GTKMM_LIBS=`$PKG_CONFIG --libs "gtkmm-2.4 >= 2.18" 2>/dev/null`
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
+$as_echo "#define HAVE_ATTRIBUTE_CONST 1" >>confdefs.h
 
 
+$as_echo "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h
 
-if test $pkg_failed = yes; then
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
 
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-	        GTKMM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtkmm-2.4 >= 2.18" 2>&1`
-        else
-	        GTKMM_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtkmm-2.4 >= 2.18" 2>&1`
-        fi
-	# Put the nasty error message in config.log where it belongs
-	echo "$GTKMM_PKG_ERRORS" >&5
+$as_echo "#define HAVE_BUILTIN_CONSTANT_P 1" >>confdefs.h
 
-	as_fn_error "Package requirements (gtkmm-2.4 >= 2.18) were not met:
 
-$GTKMM_PKG_ERRORS
+$as_echo "#define HAVE_WARN_UNUSED_RESULT 1" >>confdefs.h
 
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
 
-Alternatively, you may set the environment variables GTKMM_CFLAGS
-and GTKMM_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
-elif test $pkg_failed = untried; then
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
+$as_echo "#define HAVE_ATTRIBUTE_NORETURN 1" >>confdefs.h
 
-Alternatively, you may set the environment variables GTKMM_CFLAGS
-and GTKMM_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details." "$LINENO" 5; }
-else
-	GTKMM_CFLAGS=$pkg_cv_GTKMM_CFLAGS
-	GTKMM_LIBS=$pkg_cv_GTKMM_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+$as_echo "#define HAVE_ATTRIBUTE_USED 1" >>confdefs.h
 
-fi
-fi
 
-ac_config_files="$ac_config_files Makefile hkl/Makefile test/Makefile hkl.pc Documentation/Makefile Documentation/api/Makefile gui/Makefile"
+$as_echo "#define HAVE_BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h
+
+
+ac_config_files="$ac_config_files Makefile hkl/Makefile hkl/ccan/Makefile hkl.pc hkl3d/Makefile hkl3d/bullet/Makefile hkl3d/bullet/src/Makefile hkl3d.pc tests/Makefile tests/bindings/Makefile tests/tap/Makefile Documentation/Makefile Documentation/api/Makefile Documentation/figures/Makefile Documentation/sphinx/Makefile Documentation/sphinx/source/conf.py gui/Makefile gui/hkl3d/Makefile data/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -16126,10 +19133,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -16145,6 +19163,7 @@ DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
@@ -16159,6 +19178,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -16168,47 +19195,64 @@ else
 fi
 
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  as_fn_error "conditional \"AMDEP\" was never defined.
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error "conditional \"am__fastdepCXX\" was never defined.
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error "conditional \"am__fastdepCXX\" was never defined.
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then
-  as_fn_error "conditional \"ENABLE_GTK_DOC\" was never defined.
+  as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then
-  as_fn_error "conditional \"GTK_DOC_BUILD_HTML\" was never defined.
+  as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then
-  as_fn_error "conditional \"GTK_DOC_BUILD_PDF\" was never defined.
+  as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then
-  as_fn_error "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined.
+  as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then
-  as_fn_error "conditional \"GTK_DOC_USE_REBASE\" was never defined.
+  as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+if test -z "${CONDITIONAL_BUILD_MULTITHREADED_TRUE}" && test -z "${CONDITIONAL_BUILD_MULTITHREADED_FALSE}"; then
+  as_fn_error $? "conditional \"CONDITIONAL_BUILD_MULTITHREADED\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CONDITIONAL_BUILD_DEMOS_TRUE}" && test -z "${CONDITIONAL_BUILD_DEMOS_FALSE}"; then
+  as_fn_error $? "conditional \"CONDITIONAL_BUILD_DEMOS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CONDITIONAL_BUILD_DEMOS_TRUE}" && test -z "${CONDITIONAL_BUILD_DEMOS_FALSE}"; then
+  as_fn_error $? "conditional \"CONDITIONAL_BUILD_DEMOS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HKL3D_TRUE}" && test -z "${HKL3D_FALSE}"; then
+  as_fn_error $? "conditional \"HKL3D\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${GHKL_TRUE}" && test -z "${GHKL_FALSE}"; then
-  as_fn_error "conditional \"GHKL\" was never defined.
+if test -z "${GUI_TRUE}" && test -z "${GUI_FALSE}"; then
+  as_fn_error $? "conditional \"GUI\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -16309,6 +19353,7 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -16354,19 +19399,19 @@ export LANGUAGE
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 
-# as_fn_error ERROR [LINENO LOG_FD]
-# ---------------------------------
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with status $?, using 1 if that was 0.
+# script with STATUS, using 1 if that was 0.
 as_fn_error ()
 {
-  as_status=$?; test $as_status -eq 0 && as_status=1
-  if test "$3"; then
-    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $1" >&2
+  $as_echo "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -16504,16 +19549,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -16562,7 +19607,7 @@ $as_echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
 
 } # as_fn_mkdir_p
@@ -16573,28 +19618,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -16615,8 +19648,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by hkl $as_me 4.0.3, which was
-generated by GNU Autoconf 2.65.  Invocation command line was
+This file was extended by hkl $as_me 4.99.99.1610, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -16681,11 +19714,11 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-hkl config.status 4.0.3
-configured by $0, generated by GNU Autoconf 2.65,
+hkl config.status 4.99.99.1610
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -16703,11 +19736,16 @@ ac_need_defaults=:
 while test $# != 0
 do
   case $1 in
-  --*=*)
+  --*=?*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
   *)
     ac_option=$1
     ac_optarg=$2
@@ -16729,6 +19767,7 @@ do
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
     esac
     as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
@@ -16741,7 +19780,7 @@ do
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    as_fn_error "ambiguous option: \`$1'
+    as_fn_error $? "ambiguous option: \`$1'
 Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
@@ -16750,7 +19789,7 @@ Try \`$0 --help' for more information.";;
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) as_fn_error "unrecognized option: \`$1'
+  -*) as_fn_error $? "unrecognized option: \`$1'
 Try \`$0 --help' for more information." ;;
 
   *) as_fn_append ac_config_targets " $1"
@@ -16770,7 +19809,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -16804,184 +19843,208 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
 sed_quote_subst='$sed_quote_subst'
 double_quote_subst='$double_quote_subst'
 delay_variable_subst='$delay_variable_subst'
-macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
-enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
-host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
-host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
-host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
-build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
-build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
-build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
-SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
-Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
-GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
-EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
-FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
-LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
-NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
-LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
-exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
-AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
-STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
-compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
-GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
-objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
-SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
-ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
-need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
-LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
-libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
-fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
-need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
-version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
-striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`'
-predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`'
-postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`'
-predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`'
-postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`'
-LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
 
 LTCC='$LTCC'
 LTCFLAGS='$LTCFLAGS'
 compiler='$compiler_DEFAULT'
 
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
 # Quote evaled strings.
-for var in SED \
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
 GREP \
 EGREP \
 FGREP \
@@ -16994,8 +20057,13 @@ reload_flag \
 OBJDUMP \
 deplibs_check_method \
 file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
 AR \
 AR_FLAGS \
+archiver_list_spec \
 STRIP \
 RANLIB \
 CC \
@@ -17005,14 +20073,14 @@ lt_cv_sys_global_symbol_pipe \
 lt_cv_sys_global_symbol_to_cdecl \
 lt_cv_sys_global_symbol_to_c_name_address \
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-SHELL \
-ECHO \
+nm_file_list_spec \
 lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_wl \
 lt_prog_compiler_pic \
+lt_prog_compiler_wl \
 lt_prog_compiler_static \
 lt_cv_prog_compiler_c_o \
 need_locks \
+MANIFEST_TOOL \
 DSYMUTIL \
 NMEDIT \
 LIPO \
@@ -17026,9 +20094,7 @@ with_gnu_ld \
 allow_undefined_flag \
 no_undefined_flag \
 hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
 hardcode_libdir_separator \
-fix_srcfile_path \
 exclude_expsyms \
 include_expsyms \
 file_list_spec \
@@ -17036,6 +20102,7 @@ variables_saved_for_relink \
 libname_spec \
 library_names_spec \
 soname_spec \
+install_override_mode \
 finish_eval \
 old_striplib \
 striplib \
@@ -17046,10 +20113,11 @@ predeps \
 postdeps \
 compiler_lib_search_path \
 LD_CXX \
+reload_flag_CXX \
 compiler_CXX \
 lt_prog_compiler_no_builtin_flag_CXX \
-lt_prog_compiler_wl_CXX \
 lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
 lt_prog_compiler_static_CXX \
 lt_cv_prog_compiler_c_o_CXX \
 export_dynamic_flag_spec_CXX \
@@ -17059,9 +20127,7 @@ with_gnu_ld_CXX \
 allow_undefined_flag_CXX \
 no_undefined_flag_CXX \
 hardcode_libdir_flag_spec_CXX \
-hardcode_libdir_flag_spec_ld_CXX \
 hardcode_libdir_separator_CXX \
-fix_srcfile_path_CXX \
 exclude_expsyms_CXX \
 include_expsyms_CXX \
 file_list_spec_CXX \
@@ -17071,9 +20137,9 @@ postdep_objects_CXX \
 predeps_CXX \
 postdeps_CXX \
 compiler_lib_search_path_CXX; do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -17095,11 +20161,13 @@ module_cmds \
 module_expsym_cmds \
 export_symbols_cmds \
 prelink_cmds \
+postlink_cmds \
 postinstall_cmds \
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
 sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
 old_archive_cmds_CXX \
 old_archive_from_new_cmds_CXX \
 old_archive_from_expsyms_cmds_CXX \
@@ -17108,10 +20176,11 @@ archive_expsym_cmds_CXX \
 module_cmds_CXX \
 module_expsym_cmds_CXX \
 export_symbols_cmds_CXX \
-prelink_cmds_CXX; do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -17119,12 +20188,6 @@ prelink_cmds_CXX; do
     esac
 done
 
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\$0 --fallback-echo"')  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
-  ;;
-esac
-
 ac_aux_dir='$ac_aux_dir'
 xsi_shell='$xsi_shell'
 lt_shell_append='$lt_shell_append'
@@ -17160,13 +20223,25 @@ do
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "hkl/Makefile") CONFIG_FILES="$CONFIG_FILES hkl/Makefile" ;;
-    "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
+    "hkl/ccan/Makefile") CONFIG_FILES="$CONFIG_FILES hkl/ccan/Makefile" ;;
     "hkl.pc") CONFIG_FILES="$CONFIG_FILES hkl.pc" ;;
+    "hkl3d/Makefile") CONFIG_FILES="$CONFIG_FILES hkl3d/Makefile" ;;
+    "hkl3d/bullet/Makefile") CONFIG_FILES="$CONFIG_FILES hkl3d/bullet/Makefile" ;;
+    "hkl3d/bullet/src/Makefile") CONFIG_FILES="$CONFIG_FILES hkl3d/bullet/src/Makefile" ;;
+    "hkl3d.pc") CONFIG_FILES="$CONFIG_FILES hkl3d.pc" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+    "tests/bindings/Makefile") CONFIG_FILES="$CONFIG_FILES tests/bindings/Makefile" ;;
+    "tests/tap/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tap/Makefile" ;;
     "Documentation/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/Makefile" ;;
     "Documentation/api/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/api/Makefile" ;;
+    "Documentation/figures/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/figures/Makefile" ;;
+    "Documentation/sphinx/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/sphinx/Makefile" ;;
+    "Documentation/sphinx/source/conf.py") CONFIG_FILES="$CONFIG_FILES Documentation/sphinx/source/conf.py" ;;
     "gui/Makefile") CONFIG_FILES="$CONFIG_FILES gui/Makefile" ;;
+    "gui/hkl3d/Makefile") CONFIG_FILES="$CONFIG_FILES gui/hkl3d/Makefile" ;;
+    "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;;
 
-  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -17189,9 +20264,10 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -17199,12 +20275,13 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -17221,12 +20298,12 @@ if test "x$ac_cr" = x; then
 fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\r'
+  ac_cs_awk_cr='\\r'
 else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -17235,18 +20312,18 @@ _ACEOF
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 
   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -17254,7 +20331,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -17302,7 +20379,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -17334,21 +20411,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[	 ]*\):*/\1/
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
 s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
 s/^[^=]*=[	 ]*$//
 }'
 fi
@@ -17360,7 +20445,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -17372,11 +20457,11 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
-    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -17461,7 +20546,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -17474,7 +20559,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -17493,7 +20578,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -17502,7 +20587,7 @@ do
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -17528,8 +20613,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -17665,23 +20750,24 @@ s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
+which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
-  || as_fn_error "could not create $ac_file" "$LINENO" 5
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
@@ -17690,21 +20776,21 @@ which seems to be undefined.  Please make sure it is defined." >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
-      || as_fn_error "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
-	|| as_fn_error "could not create $ac_file" "$LINENO" 5
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error "could not create -" "$LINENO" 5
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
 # Compute "$ac_file"'s index in $config_headers.
 _am_arg="$ac_file"
@@ -17750,7 +20836,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
   case $CONFIG_FILES in
@@ -17763,7 +20849,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -17797,21 +20883,19 @@ $as_echo X"$mf" |
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`$as_dirname -- "$file" ||
@@ -17865,7 +20949,8 @@ $as_echo X"$file" |
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -17913,6 +20998,15 @@ pic_mode=$pic_mode
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
 
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
 # The host system.
 host_alias=$host_alias
 host=$host
@@ -17962,9 +21056,11 @@ SP2NL=$lt_lt_SP2NL
 # turn newlines into spaces.
 NL2SP=$lt_lt_NL2SP
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
 
 # An object symbol dumper.
 OBJDUMP=$lt_OBJDUMP
@@ -17972,13 +21068,30 @@ OBJDUMP=$lt_OBJDUMP
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
 
-# Command to use when deplibs_check_method == "file_magic".
+# Command to use when deplibs_check_method = "file_magic".
 file_magic_cmd=$lt_file_magic_cmd
 
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
 # The archiver.
 AR=$lt_AR
+
+# Flags to create an archive.
 AR_FLAGS=$lt_AR_FLAGS
 
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
 # A symbol stripping program.
 STRIP=$lt_STRIP
 
@@ -17987,6 +21100,9 @@ RANLIB=$lt_RANLIB
 old_postinstall_cmds=$lt_old_postinstall_cmds
 old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
 # A C compiler.
 LTCC=$lt_CC
 
@@ -18005,14 +21121,14 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 # Transform the output of nm in a C name address pair when lib prefix is needed.
 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
 
-# An echo program that does not interpret backslashes.
-ECHO=$lt_ECHO
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
 # Used to examine libraries when file_magic_cmd begins with "file".
 MAGIC_CMD=$MAGIC_CMD
@@ -18020,6 +21136,9 @@ MAGIC_CMD=$MAGIC_CMD
 # Must we lock files when doing compilation?
 need_locks=$lt_need_locks
 
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
 DSYMUTIL=$lt_DSYMUTIL
 
@@ -18076,6 +21195,9 @@ library_names_spec=$lt_library_names_spec
 # The coded name of the library, if different from the real name.
 soname_spec=$lt_soname_spec
 
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
 # Command to use after installation of a shared archive.
 postinstall_cmds=$lt_postinstall_cmds
 
@@ -18115,6 +21237,10 @@ striplib=$lt_striplib
 # The linker used to build libraries.
 LD=$lt_LD
 
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
 # Commands used to build an old-style archive.
 old_archive_cmds=$lt_old_archive_cmds
 
@@ -18127,12 +21253,12 @@ with_gcc=$GCC
 # Compiler flag to turn off builtin functions.
 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
 # Additional compiler flags for building library objects.
 pic_flag=$lt_lt_prog_compiler_pic
 
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
 # Compiler flag to prevent dynamic linking.
 link_static_flag=$lt_lt_prog_compiler_static
 
@@ -18182,10 +21308,6 @@ no_undefined_flag=$lt_no_undefined_flag
 # This must work even if \$libdir does not exist
 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
@@ -18219,9 +21341,6 @@ inherit_rpath=$inherit_rpath
 # Whether libtool must link a program against all its dependency libraries.
 link_all_deplibs=$link_all_deplibs
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
 # Set to "yes" if exported symbols are required.
 always_export_symbols=$always_export_symbols
 
@@ -18237,6 +21356,9 @@ include_expsyms=$lt_include_expsyms
 # Commands necessary for linking programs (against libraries) with templates.
 prelink_cmds=$lt_prelink_cmds
 
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
 # Specify filename containing input files.
 file_list_spec=$lt_file_list_spec
 
@@ -18283,212 +21405,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
   # text mode, it properly converts lines to CR/LF.  This bash problem
   # is reportedly fixed, but why not run on old versions too?
-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  case $xsi_shell in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-  func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-  # positional parameters, so assign one to ordinary parameter first.
-  func_stripname_result=${3}
-  func_stripname_result=${func_stripname_result#"${1}"}
-  func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=${1%%=*}
-  func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  case ${1} in
-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-    *)    func_lo2o_result=${1} ;;
-  esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=$(( $* ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=${#1}
-}
-
-_LT_EOF
-    ;;
-  *) # Bourne compatible functions.
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-  case ${2} in
-    .*) func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
-    *)  func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
-  esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[^=]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
-  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=`expr "$@"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$1+=\$2"
-}
-_LT_EOF
-    ;;
-  *)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$1=\$$1\$2"
-}
-
-_LT_EOF
-    ;;
-  esac
-
-
-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" ||
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  if test x"$xsi_shell" = xyes; then
+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\    # positional parameters, so assign one to ordinary parameter first.\
+\    func_stripname_result=${3}\
+\    func_stripname_result=${func_stripname_result#"${1}"}\
+\    func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\    func_split_long_opt_name=${1%%=*}\
+\    func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\    func_split_short_opt_arg=${1#??}\
+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\    case ${1} in\
+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\      *)    func_lo2o_result=${1} ;;\
+\    esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+    func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+    func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+    func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+    eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\    func_quote_for_eval "${2}"\
+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+   mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
@@ -18500,6 +21579,10 @@ _LT_EOF
 # The linker used to build libraries.
 LD=$lt_LD_CXX
 
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
 # Commands used to build an old-style archive.
 old_archive_cmds=$lt_old_archive_cmds_CXX
 
@@ -18512,12 +21595,12 @@ with_gcc=$GCC_CXX
 # Compiler flag to turn off builtin functions.
 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
 # Additional compiler flags for building library objects.
 pic_flag=$lt_lt_prog_compiler_pic_CXX
 
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
 # Compiler flag to prevent dynamic linking.
 link_static_flag=$lt_lt_prog_compiler_static_CXX
 
@@ -18567,10 +21650,6 @@ no_undefined_flag=$lt_no_undefined_flag_CXX
 # This must work even if \$libdir does not exist
 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
 
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
 
@@ -18604,9 +21683,6 @@ inherit_rpath=$inherit_rpath_CXX
 # Whether libtool must link a program against all its dependency libraries.
 link_all_deplibs=$link_all_deplibs_CXX
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path_CXX
-
 # Set to "yes" if exported symbols are required.
 always_export_symbols=$always_export_symbols_CXX
 
@@ -18622,6 +21698,9 @@ include_expsyms=$lt_include_expsyms_CXX
 # Commands necessary for linking programs (against libraries) with templates.
 prelink_cmds=$lt_prelink_cmds_CXX
 
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
 # Specify filename containing input files.
 file_list_spec=$lt_file_list_spec_CXX
 
@@ -18656,7 +21735,7 @@ _ACEOF
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
@@ -18677,7 +21756,7 @@ if test "$no_create" != yes; then
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit $?
+  $ac_cs_success || as_fn_exit 1
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
diff --git a/configure.ac b/configure.ac
index 1c982dd..55a0660 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,25 +1,58 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_define([v_maj], [4])
+m4_define([v_min], [99])
+m4_define([v_mic], [99])
+m4_define([v_rev], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
+##--   When released, remove the dnl on the below line
+dnl m4_undefine([v_rev])
+##--   When doing snapshots - change soname. remove dnl on below line
+dnl m4_define([relname], [ver-pre-svn-07])
+dnl m4_define([v_rel], [-release relname])
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
+m4_define([lt_cur], m4_eval(v_maj + v_min))
+m4_define([lt_rev], v_mic)
+m4_define([lt_age], v_min)
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 
-AC_PREREQ(2.59)
-AC_INIT([hkl],[4.0.3],[picca at synchrotron-soleil.fr])
+AC_PREREQ([2.69])
+AC_INIT([hkl],[v_ver],[picca at synchrotron-soleil.fr])
 AC_CONFIG_SRCDIR([config.h.in])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR(config)
 
-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+AM_INIT_AUTOMAKE([silent-rules tar-ustar -Wno-portability])
 
 # Checks for programs.
 AC_PROG_CXX
 AC_PROG_AWK
-AC_PROG_CC
+AC_PROG_CC_C99
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
-AC_PROG_LIBTOOL
-AC_PROG_RANLIB
+LT_INIT
+AM_SILENT_RULES
+
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
+m4_ifdef([v_rel], , [m4_define([v_rel], [])])
+AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
+AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
+AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
+AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
+version_info="lt_cur:lt_rev:lt_age"
+release_info="v_rel"
+AC_SUBST(version_info)
+AC_SUBST(release_info)
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+VMAJ=v_maj
+AC_SUBST(VMAJ)
 
 # Checks for libraries.
 AX_PATH_GSL
@@ -28,45 +61,303 @@ AX_PATH_GSL
 AC_HEADER_STDBOOL
 AC_HEADER_STDC
 AC_HEADER_TIME
-AC_CHECK_HEADERS([float.h stdlib.h string.h sys/time.h])
+AC_FUNC_ALLOCA
+AC_CHECK_HEADERS([float.h limits.h malloc.h memory.h stddef.h stdint.h stdlib.h string.h sys/time.h unistd.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_INT64_T
+AC_TYPE_INT8_T
 AC_TYPE_SIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
 
 # Checks for library functions.
-AC_FUNC_ALLOCA
+AC_FUNC_ERROR_AT_LINE
 AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([floor gettimeofday memmove memset sqrt strdup])
-
-# gtk-doc
-GTK_DOC_CHECK(1.9)
-
-# add an option for the ghkl build
-AC_ARG_ENABLE([ghkl],
-	AS_HELP_STRING([--enable-ghkl],
-			[turn on the ghkl gui [[default=yes]]]),
-	[case "${enableval}" in
-	      yes) ghkl=true ;;
-      	      no)  ghkl=false ;;
-      	      *) AC_MSG_ERROR([bad value ${enableval} for --enable-ghkl]) ;;
-	esac],[ghkl=true])
-AM_CONDITIONAL([GHKL], [test x$ghkl = xtrue])
-
-# gtkmm + glademm
-AM_COND_IF([GHKL],
-	[PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.18])])
+AC_CHECK_FUNCS([floor getcwd gettimeofday memmove memset pow select sqrt strchr strdup strstr])
+
+dnl OPTION_DEFAULT_OFF(NAME, HELP-STRING)
+dnl Create a new --with option that defaults to being disabled.
+dnl NAME is the base name of the option.  The shell variable with_NAME
+dnl   will be set to either the user's value (if the option is
+dnl   specified; 'yes' for a plain --with-NAME) or to 'no' (if the
+dnl   option is not specified).  Note that the shell variable name is
+dnl   constructed as autoconf does, by replacing non-alphanumeric
+dnl   characters with "_".
+dnl HELP-STRING is the help text for the option.
+AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
+  AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[],[dnl
+    m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl
+])dnl
+
+dnl ***************
+dnl *** gtk-doc ***
+dnl ***************
+
+GTK_DOC_CHECK([1.9],[--flavour no-tmpl])
+
+dnl ***********
+dnl *** asy ***
+dnl ***********
+
+AC_PATH_PROG([ASY], [asy], [echo])
+
+dnl *********************************************
+dnl *** took from the bullet configure script ***
+dnl *********************************************
+
+AC_CANONICAL_HOST
+case "$host" in
+        *-*-mingw*|*-*-cygwin*)
+                AC_DEFINE(PLATFORM_WIN32, 1, [Platform is Win32])
+                opengl_LIBS="-lunsupported_platform"
+                PLATFORM_STRING="Win32"
+                ;;
+        *-*-linux*)
+                AC_DEFINE(PLATFORM_LINUX, 1, [Platform is Linux])
+                opengl_LIBS="-lGL -lGLU"
+                PLATFORM_STRING="Linux"
+                ;;
+        *-*-darwin*)
+                AC_DEFINE(PLATFORM_APPLE, 1, [Platform is Apple])
+                opengl_LIBS="-framework AGL -framework OpenGL -framework GLUT"
+                PLATFORM_STRING="Apple"
+                ;;
+        *)
+                AC_MSG_WARN([*** Please add $host to configure.ac checks!])
+                ;;
+esac
+AC_SUBST(opengl_LIBS)
+
+case "$host" in
+        i?86-* | k?-* | athlon-* | pentium*-)
+                AC_DEFINE(ARCH_X86, 1, [Architecture is x86])
+                ARCH_SPECIFIC_CFLAGS=""
+                ARCH_STRING="X86"
+                ;;
+        x86_64-*)
+                AC_DEFINE(ARCH_X86_64, 1, [Architecture is x86-64])
+                ARCH_SPECIFIC_CFLAGS="-DUSE_ADDR64"
+                ARCH_STRING="X86-64"
+                ;;
+        ppc-* | powerpc-*)
+                AC_DEFINE(ARCH_PPC, 1, [Architecture is PowerPC])
+                ARCH_SPECIFIC_CFLAGS=""
+                ARCH_STRING="PowerPC"
+                ;;
+        *)
+                AC_MSG_ERROR([Unknown Architecture])
+                ;;
+esac
+AC_C_BIGENDIAN
+
+#----------------------------------------------------------------------------
+# Package configuration switches.
+#----------------------------------------------------------------------------
+AC_ARG_ENABLE([multithreaded],
+	[AS_HELP_STRING([--enable-multithreaded],[build BulletMultiThreaded (default NO)])],
+	[disable_multithreaded=no], [disable_multithreaded=yes])
+AC_MSG_CHECKING([BulletMultiThreaded])
+AS_IF([test "$disable_multithreaded" = yes], [build_multithreaded=no], [build_multithreaded=yes])
+AC_MSG_RESULT([$build_multithreaded])
+AM_CONDITIONAL([CONDITIONAL_BUILD_MULTITHREADED], [test "$build_multithreaded" = yes])
+
+AC_ARG_ENABLE([demos],
+    [AS_HELP_STRING([--disable-demos],
+	    [disable Bullet demos])],
+    [],
+    [enable_demos=yes])
+AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS], [false])
+if test "x$enable_demos" != xno; then
+    AC_MSG_NOTICE([Building Bullet demos])
+    AM_CONDITIONAL([CONDITIONAL_BUILD_DEMOS],[true])
+fi
+
+
+
+AC_ARG_ENABLE([debug],
+    [AS_HELP_STRING([--enable-debug],[build with debugging information (default NO)])],
+    [], [enable_debug=no])
+
+AC_MSG_CHECKING([build mode])
+AS_IF([test $enable_debug = yes], [build_mode=debug], [build_mode=optimize])
+AC_MSG_RESULT([$build_mode])
+
+CFLAGS="$ARCH_SPECIFIC_CFLAGS $CFLAGS"
+CXXFLAGS="$ARCH_SPECIFIC_CFLAGS $CXXFLAGS $CFLAGS"
+
+### end bullet configure script
+
+dnl *******************************
+dnl *** add an option for hkl3d ***
+dnl *******************************
+
+AC_ARG_ENABLE([hkl3d],
+	AS_HELP_STRING([--enable-hkl3d],
+		[compile the hkl3d library]),
+	[],
+	[enable_hkl3d=no])
+AM_CONDITIONAL([HKL3D], [test x$enable_hkl3d != xno])
+AM_COND_IF([HKL3D],
+	   [PKG_CHECK_MODULES([G3D], [libg3d >= 0.0.8])
+	   dnl check for yaml
+	   AC_SEARCH_LIBS([yaml_get_version], [yaml],
+			  [AC_CHECK_HEADERS([yaml.h], [],
+					    [AC_MSG_ERROR([Could not find the yaml headers, please install yaml developement files])]
+			  )],
+			  [AC_MSG_ERROR([Could not find the libyaml runtime, please install yaml])]
+           )
+	   YAML_CFLAGS=""
+	   AC_SUBST(YAML_CFLAGS)
+	   YAML_LIBS="-lyaml"
+	   AC_SUBST(YAML_LIBS)
+])
+
+dnl ****************************************
+dnl *** add an option for the ghkl build ***
+dnl ****************************************
+
+AC_ARG_ENABLE([gui],
+	AS_HELP_STRING([--disable-gui],
+		[do not compile the gui interface]),
+	[],
+	[enable_gui=yes])
+AM_CONDITIONAL([GUI], [test x$enable_gui = xyes])
+AM_COND_IF([GUI],
+	[PKG_CHECK_MODULES([GTKMM], [gtkmm-2.4 >= 2.18])
+	AM_COND_IF([HKL3D],
+		   [PKG_CHECK_MODULES([GLU], [glu >= 7.7.1])
+		    PKG_CHECK_MODULES([GTKGLEXTMM], [gtkglextmm-1.2])
+	])
+])
+
+dnl ************************************
+dnl *** Enable lcov coverage reports ***
+dnl ************************************
+
+AC_ARG_ENABLE(gcov,
+	AS_HELP_STRING([--enable-gcov],
+		[Enable gcov]),
+	[use_gcov=$enableval],
+	[use_gcov=no])
+
+if test "x$use_gcov" = "xyes"; then
+   dnl we need gcc:
+   if test "$GCC" != "yes"; then
+      AC_MSG_ERROR([GCC is required for --enable-gcov])
+   fi
+
+  dnl Check if ccache is being used
+  AC_CHECK_PROG(SHTOOL, shtool, shtool)
+  case `$SHTOOL path $CC` in
+    *ccache*[)] gcc_ccache=yes;;
+    *[)] gcc_ccache=no;;
+  esac
+
+  if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
+    AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
+  fi
+
+  ltp_version_list="1.6 1.7 1.8 1.9"
+  AC_CHECK_PROG(LTP, lcov, lcov)
+  AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
+
+  if test "$LTP"; then
+    AC_CACHE_CHECK([for ltp version], glib_cv_ltp_version, [
+      glib_cv_ltp_version=invalid
+      ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
+      for ltp_check_version in $ltp_version_list; do
+        if test "$ltp_version" = "$ltp_check_version"; then
+          glib_cv_ltp_version="$ltp_check_version (ok)"
+        fi
+      done
+    ])
+  else
+    ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
+    AC_MSG_ERROR([$ltp_msg])
+  fi
+
+  case $glib_cv_ltp_version in
+    ""|invalid[)]
+      ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
+      AC_MSG_ERROR([$ltp_msg])
+      LTP="exit 0;"
+      ;;
+  esac
+
+  if test -z "$LTP_GENHTML"; then
+    AC_MSG_ERROR([Could not find genhtml from the LTP package])
+  fi
+
+  AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
+
+  dnl Remove all optimization flags from CFLAGS
+  changequote({,})
+  CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9]*//g'`
+  changequote([,])
+
+  dnl Add the special gcc flags
+  CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
+  LDFLAGS="$LDFLAGS -lgcov"
+fi
+
+dnl *********************
+dnl *** introspection ***
+dnl *********************
+
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
+
+AM_COND_IF([HAVE_INTROSPECTION],
+	[PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])
+	AM_PATH_GLIB_2_0])
+
+
+dnl ************
+dnl *** ccan ***
+dnl ************
+
+AC_DEFINE([HAVE_SECTION_START_STOP], [1], ["do we support section or not"])
+AC_DEFINE([HAVE_TYPEOF], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_STATEMENT_EXPR], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_ATTRIBUTE_COLD], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_ATTRIBUTE_PRINTF], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_ATTRIBUTE_CONST], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_ATTRIBUTE_UNUSED], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_BUILTIN_CONSTANT_P], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_WARN_UNUSED_RESULT], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_ATTRIBUTE_NORETURN], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_ATTRIBUTE_USED], [1], ["do we have typeof"])
+AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P], [1], ["do we have typeof"])
 
 AC_CONFIG_FILES([Makefile
 		 hkl/Makefile
-		 test/Makefile
+		 hkl/ccan/Makefile
 		 hkl.pc
+		 hkl3d/Makefile
+		 hkl3d/bullet/Makefile
+		 hkl3d/bullet/src/Makefile
+		 hkl3d.pc
+		 tests/Makefile
+		 tests/bindings/Makefile
+		 tests/tap/Makefile
 		 Documentation/Makefile
 		 Documentation/api/Makefile
+		 Documentation/figures/Makefile
+		 Documentation/sphinx/Makefile
+		 Documentation/sphinx/source/conf.py
 		 gui/Makefile
+		 gui/hkl3d/Makefile
+		 data/Makefile
 ])
 
 AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..a2bf627
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,4 @@
+EXTRA_DIST=diffabs.dae diffabs.yaml
+
+hkl3ddir = $(pkgdatadir)/hkl3d
+hkl3d_DATA = diffabs.dae diffabs.yaml
\ No newline at end of file
diff --git a/data/Makefile.in b/data/Makefile.in
new file mode 100644
index 0000000..f764d83
--- /dev/null
+++ b/data/Makefile.in
@@ -0,0 +1,530 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = data
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(hkl3ddir)"
+DATA = $(hkl3d_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+EXTRA_DIST = diffabs.dae diffabs.yaml
+hkl3ddir = $(pkgdatadir)/hkl3d
+hkl3d_DATA = diffabs.dae diffabs.yaml
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu data/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-hkl3dDATA: $(hkl3d_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(hkl3d_DATA)'; test -n "$(hkl3ddir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(hkl3ddir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(hkl3ddir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(hkl3ddir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(hkl3ddir)" || exit $$?; \
+	done
+
+uninstall-hkl3dDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(hkl3d_DATA)'; test -n "$(hkl3ddir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(hkl3ddir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(hkl3ddir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-hkl3dDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-hkl3dDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-hkl3dDATA \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags-am uninstall uninstall-am uninstall-hkl3dDATA
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/data/diffabs.dae b/data/diffabs.dae
new file mode 100644
index 0000000..f8f55b2
--- /dev/null
+++ b/data/diffabs.dae
@@ -0,0 +1,701 @@
+<?xml version="1.0" encoding="utf-8"?>
+<COLLADA version="1.4.0" xmlns="http://www.collada.org/2005/11/COLLADASchema">
+	<asset>
+		<contributor>
+			<author>Illusoft Collada 1.4.0 plugin for Blender - http://colladablender.illusoft.com</author>
+			<authoring_tool>Blender v:249 - Illusoft Collada Exporter v:0.3.162</authoring_tool>
+			<comments></comments>
+			<copyright></copyright>
+			<source_data>file:///home/picca/Diffractometers/Diffabs/test.blend</source_data>
+		</contributor>
+		<created>2010-08-23T17:37:20.704353</created>
+		<modified>2010-08-23T17:37:20.704396</modified>
+		<unit meter="0.01" name="centimeter"/>
+		<up_axis>Z_UP</up_axis>
+	</asset>
+	<library_cameras>
+		<camera id="Camera-Camera" name="Camera-Camera">
+			<optics>
+				<technique_common>
+					<perspective>
+						<yfov>49.13434</yfov>
+						<znear>0.1</znear>
+						<zfar>100.0</zfar>
+					</perspective>
+				</technique_common>
+			</optics>
+		</camera>
+	</library_cameras>
+	<library_effects>
+		<effect id="Material_003-fx" name="Material_003-fx">
+			<profile_COMMON>
+				<technique sid="blender">
+					<phong>
+						<emission>
+							<color>0.00000 0.00000 0.00000 1</color>
+						</emission>
+						<ambient>
+							<color>0.50000 0.50000 0.02401 1</color>
+						</ambient>
+						<diffuse>
+							<color>1.00000 1.00000 0.04802 1</color>
+						</diffuse>
+						<specular>
+							<color>0.50000 0.50000 0.50000 1</color>
+						</specular>
+						<shininess>
+							<float>12.5</float>
+						</shininess>
+						<reflective>
+							<color>1.00000 1.00000 1.00000 1</color>
+						</reflective>
+						<reflectivity>
+							<float>0.0</float>
+						</reflectivity>
+						<transparent>
+							<color>1 1 1 1</color>
+						</transparent>
+						<transparency>
+							<float>0.0</float>
+						</transparency>
+					</phong>
+				</technique>
+			</profile_COMMON>
+		</effect>
+		<effect id="Material_002-fx" name="Material_002-fx">
+			<profile_COMMON>
+				<technique sid="blender">
+					<phong>
+						<emission>
+							<color>0.00000 0.00000 0.00000 1</color>
+						</emission>
+						<ambient>
+							<color>0.00000 0.50000 0.00000 1</color>
+						</ambient>
+						<diffuse>
+							<color>0.00000 1.00000 0.00000 1</color>
+						</diffuse>
+						<specular>
+							<color>0.50000 0.50000 0.50000 1</color>
+						</specular>
+						<shininess>
+							<float>12.5</float>
+						</shininess>
+						<reflective>
+							<color>1.00000 1.00000 1.00000 1</color>
+						</reflective>
+						<reflectivity>
+							<float>0.0</float>
+						</reflectivity>
+						<transparent>
+							<color>1 1 1 1</color>
+						</transparent>
+						<transparency>
+							<float>0.0</float>
+						</transparency>
+					</phong>
+				</technique>
+			</profile_COMMON>
+		</effect>
+		<effect id="Material_001-fx" name="Material_001-fx">
+			<profile_COMMON>
+				<technique sid="blender">
+					<phong>
+						<emission>
+							<color>0.00000 0.00000 0.00000 1</color>
+						</emission>
+						<ambient>
+							<color>0.49094 0.16324 0.00000 1</color>
+						</ambient>
+						<diffuse>
+							<color>0.98189 0.32649 0.00000 1</color>
+						</diffuse>
+						<specular>
+							<color>0.50000 0.50000 0.50000 1</color>
+						</specular>
+						<shininess>
+							<float>12.5</float>
+						</shininess>
+						<reflective>
+							<color>1.00000 1.00000 1.00000 1</color>
+						</reflective>
+						<reflectivity>
+							<float>0.0</float>
+						</reflectivity>
+						<transparent>
+							<color>1 1 1 1</color>
+						</transparent>
+						<transparency>
+							<float>0.0</float>
+						</transparency>
+					</phong>
+				</technique>
+			</profile_COMMON>
+		</effect>
+		<effect id="Material-fx" name="Material-fx">
+			<profile_COMMON>
+				<technique sid="blender">
+					<phong>
+						<emission>
+							<color>0.00000 0.00000 0.00000 1</color>
+						</emission>
+						<ambient>
+							<color>0.13870 0.30519 0.42096 1</color>
+						</ambient>
+						<diffuse>
+							<color>0.27740 0.61038 0.84193 1</color>
+						</diffuse>
+						<specular>
+							<color>0.50000 0.50000 0.50000 1</color>
+						</specular>
+						<shininess>
+							<float>12.5</float>
+						</shininess>
+						<reflective>
+							<color>1.00000 1.00000 1.00000 1</color>
+						</reflective>
+						<reflectivity>
+							<float>0.0</float>
+						</reflectivity>
+						<transparent>
+							<color>1 1 1 1</color>
+						</transparent>
+						<transparency>
+							<float>0.0</float>
+						</transparency>
+					</phong>
+				</technique>
+			</profile_COMMON>
+		</effect>
+		<effect id="Material_004-fx" name="Material_004-fx">
+			<profile_COMMON>
+				<technique sid="blender">
+					<phong>
+						<emission>
+							<color>0.00000 0.00000 0.00000 1</color>
+						</emission>
+						<ambient>
+							<color>0.46232 0.15131 0.42289 1</color>
+						</ambient>
+						<diffuse>
+							<color>0.92463 0.30262 0.84578 1</color>
+						</diffuse>
+						<specular>
+							<color>0.50000 0.50000 0.50000 1</color>
+						</specular>
+						<shininess>
+							<float>12.5</float>
+						</shininess>
+						<reflective>
+							<color>1.00000 1.00000 1.00000 1</color>
+						</reflective>
+						<reflectivity>
+							<float>0.0</float>
+						</reflectivity>
+						<transparent>
+							<color>1 1 1 1</color>
+						</transparent>
+						<transparency>
+							<float>0.0</float>
+						</transparency>
+					</phong>
+				</technique>
+			</profile_COMMON>
+		</effect>
+		<effect id="Material_006-fx" name="Material_006-fx">
+			<profile_COMMON>
+				<technique sid="blender">
+					<phong>
+						<emission>
+							<color>0.00000 0.00000 0.00000 1</color>
+						</emission>
+						<ambient>
+							<color>0.00000 0.22623 0.50000 1</color>
+						</ambient>
+						<diffuse>
+							<color>0.00000 0.45247 1.00000 1</color>
+						</diffuse>
+						<specular>
+							<color>0.50000 0.50000 0.50000 1</color>
+						</specular>
+						<shininess>
+							<float>12.5</float>
+						</shininess>
+						<reflective>
+							<color>1.00000 1.00000 1.00000 1</color>
+						</reflective>
+						<reflectivity>
+							<float>0.0</float>
+						</reflectivity>
+						<transparent>
+							<color>1 1 1 1</color>
+						</transparent>
+						<transparency>
+							<float>0.0</float>
+						</transparency>
+					</phong>
+				</technique>
+			</profile_COMMON>
+		</effect>
+		<effect id="Material_005-fx" name="Material_005-fx">
+			<profile_COMMON>
+				<technique sid="blender">
+					<phong>
+						<emission>
+							<color>0.00000 0.00000 0.00000 1</color>
+						</emission>
+						<ambient>
+							<color>0.50000 0.48837 0.40500 1</color>
+						</ambient>
+						<diffuse>
+							<color>1.00000 0.97675 0.81000 1</color>
+						</diffuse>
+						<specular>
+							<color>0.50000 0.50000 0.50000 1</color>
+						</specular>
+						<shininess>
+							<float>12.5</float>
+						</shininess>
+						<reflective>
+							<color>1.00000 1.00000 1.00000 1</color>
+						</reflective>
+						<reflectivity>
+							<float>0.0</float>
+						</reflectivity>
+						<transparent>
+							<color>1 1 1 1</color>
+						</transparent>
+						<transparency>
+							<float>0.0</float>
+						</transparency>
+					</phong>
+				</technique>
+			</profile_COMMON>
+		</effect>
+	</library_effects>
+	<library_lights>
+		<light id="Spot" name="Spot">
+			<technique_common>
+				<point>
+					<color>1.00000 1.00000 1.00000</color>
+					<constant_attenuation>1.0</constant_attenuation>
+					<linear_attenuation>0.0</linear_attenuation>
+					<quadratic_attenuation>0.0</quadratic_attenuation>
+				</point>
+			</technique_common>
+		</light>
+	</library_lights>
+	<library_materials>
+		<material id="Material_003" name="Material_003">
+			<instance_effect url="#Material_003-fx"/>
+		</material>
+		<material id="Material_002" name="Material_002">
+			<instance_effect url="#Material_002-fx"/>
+		</material>
+		<material id="Material_001" name="Material_001">
+			<instance_effect url="#Material_001-fx"/>
+		</material>
+		<material id="Material" name="Material">
+			<instance_effect url="#Material-fx"/>
+		</material>
+		<material id="Material_004" name="Material_004">
+			<instance_effect url="#Material_004-fx"/>
+		</material>
+		<material id="Material_006" name="Material_006">
+			<instance_effect url="#Material_006-fx"/>
+		</material>
+		<material id="Material_005" name="Material_005">
+			<instance_effect url="#Material_005-fx"/>
+		</material>
+	</library_materials>
+	<library_geometries>
+		<geometry id="kphi_001" name="kphi_001">
+			<mesh>
+				<source id="kphi_001-Position">
+					<float_array count="2703" id="kphi_001-Position-array">-0.12774 -0.01927 -0.43605 -0.12774 -0.01927 -0.42805 -0.12211 0.04514 -0.43605 -0.12306 -0.03833 -0.43605 -0.12306 -0.03833 -0.42805 -0.12211 0.04514 -0.42805 -0.08354 0.05276 -0.42805 -0.11555 -0.05647 -0.43605 -0.11555 -0.05647 -0.42805 -0.11185 0.06728 -0.43605 -0.11185 0.06728 -0.42805 -0.09126 0.03703 -0.42805 -0.10539 -0.07326 -0.43605 -0.10539 -0.07326 -0.42805 -0.10211 -0.00693 -0.43980 -0.10211 -0.00693 -0.43605 -0.102 [...]
+					<technique_common>
+						<accessor count="901" source="#kphi_001-Position-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<source id="kphi_001-Normals">
+					<float_array count="4740" id="kphi_001-Normals-array">0.00000 0.00000 -1.00000 0.00000 -0.00000 -1.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 -1.00000 0.00000 0.00000 -1.00000 0.00000 -0.00000 -1.00000 -0.00000 0.00000 -1.00000 -0.00000 0.00000 -1.00000 -0.00000 -0.00000 -1.00000 -0.00000 0.00000 -1.00000 -0.00000 -0.00000 -1.00000 -0.00000 0.00000 -1.00000 0.00000 -0.00000 -1.00000 0.00000 -0.00000 -1.00000 0.00000 -0.00000 -1.00000 0.00000 -0.00000 -1.00000 0.00000 -0.00000 -1 [...]
+					<technique_common>
+						<accessor count="1580" source="#kphi_001-Normals-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<vertices id="kphi_001-Vertex">
+					<input semantic="POSITION" source="#kphi_001-Position"/>
+				</vertices>
+				<triangles count="1533" material="Material_003">
+					<input offset="0" semantic="VERTEX" source="#kphi_001-Vertex"/>
+					<input offset="1" semantic="NORMAL" source="#kphi_001-Normals"/>
+					<p>87 0 72 0 66 0 179 1 164 1 176 1 176 2 164 2 158 2 158 3 164 3 149 3 158 4 149 4 134 4 72 5 51 5 66 5 67 6 70 6 81 6 67 7 81 7 83 7 83 8 81 8 90 8 83 9 90 9 98 9 98 10 90 10 105 10 98 11 105 11 114 11 210 12 190 12 227 12 227 13 190 13 203 13 227 14 203 14 241 14 241 15 203 15 213 15 241 16 213 16 255 16 255 17 213 17 225 17 51 18 72 18 33 18 33 19 72 19 61 19 33 20 61 20 21 20 21 21 61 21 53 21 21 22 53 22 43 22 176 23 193 23 179 23 179 24 193 24 209 24 179 25 209 25 188 25 188  [...]
+				</triangles>
+				<lines count="2">
+					<input offset="0" semantic="VERTEX" source="#kphi_001-Vertex"/>
+					<p>259 260 197 212</p>
+				</lines>
+			</mesh>
+		</geometry>
+		<geometry id="kappa_001" name="kappa_001">
+			<mesh>
+				<source id="kappa_001-Position">
+					<float_array count="1242" id="kappa_001-Position-array">-0.29000 -0.39309 -0.17954 -0.29000 -0.39046 -0.18573 -0.29000 -0.38795 -0.17523 -0.29000 -0.38168 -0.17836 -0.28126 -0.37423 -0.17212 -0.27997 -0.39640 -0.19072 -0.27765 -0.41043 -0.15888 -0.27765 -0.40529 -0.15457 -0.27168 -0.41681 -0.15126 -0.27168 -0.41167 -0.14695 -0.25695 -0.43257 -0.13249 -0.25695 -0.42743 -0.12817 -0.24909 -0.43895 -0.12488 -0.24909 -0.43381 -0.12057 -0.24124 -0.34067 -0.14396 -0.23831 -0.42111 -0.21145 [...]
+					<technique_common>
+						<accessor count="414" source="#kappa_001-Position-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<source id="kappa_001-Normals">
+					<float_array count="2394" id="kappa_001-Normals-array">-1.00000 0.00000 -0.00000 -1.00000 -0.00000 0.00000 1.00000 -0.00000 0.00000 1.00000 -0.00000 0.00000 -0.00000 0.76602 0.64281 0.00000 0.76602 0.64281 -0.00000 0.76602 0.64282 0.00000 0.76602 0.64282 -0.00000 0.76603 0.64281 0.00000 0.76603 0.64281 -0.00000 0.76609 0.64273 0.00000 0.76609 0.64273 -0.00000 0.76601 0.64283 0.00000 0.76601 0.64283 -0.00000 0.76600 0.64284 0.00000 0.76600 0.64284 -0.00000 -0.76604 -0.64279 -0.00000  [...]
+					<technique_common>
+						<accessor count="798" source="#kappa_001-Normals-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<vertices id="kappa_001-Vertex">
+					<input semantic="POSITION" source="#kappa_001-Position"/>
+				</vertices>
+				<triangles count="798" material="Material_002">
+					<input offset="0" semantic="VERTEX" source="#kappa_001-Vertex"/>
+					<input offset="1" semantic="NORMAL" source="#kappa_001-Normals"/>
+					<p>3 0 0 0 2 0 0 1 3 1 1 1 159 2 158 2 157 2 157 3 158 3 156 3 104 4 59 4 62 4 104 5 62 5 101 5 101 6 62 6 63 6 101 7 63 7 100 7 100 8 63 8 68 8 100 9 68 9 96 9 96 10 68 10 73 10 96 11 73 11 92 11 92 12 73 12 76 12 92 13 76 13 88 13 88 14 76 14 80 14 88 15 80 15 84 15 20 16 15 16 16 16 106 17 99 17 91 17 129 18 143 18 142 18 56 19 71 19 64 19 64 20 71 20 72 20 72 21 71 21 79 21 79 22 71 22 91 22 79 23 91 23 85 23 91 24 99 24 93 24 91 25 93 25 85 25 20 26 16 26 26 26 26 27 16 27 31 2 [...]
+				</triangles>
+				<lines count="3">
+					<input offset="0" semantic="VERTEX" source="#kappa_001-Vertex"/>
+					<p>45 171 33 171 322 366</p>
+				</lines>
+			</mesh>
+		</geometry>
+		<geometry id="komega_001" name="komega_001">
+			<mesh>
+				<source id="komega_001-Position">
+					<float_array count="1749" id="komega_001-Position-array">-0.30000 0.24700 -0.55802 -0.30000 0.24700 -0.39016 -0.30000 0.26107 -0.39921 -0.30000 0.27013 -0.55164 -0.30000 0.29749 -0.42394 -0.30000 0.29938 -0.54297 -0.30000 0.32036 -0.53675 -0.30000 0.33364 -0.45002 -0.30000 0.37027 -0.47783 -0.30000 0.37027 -0.52080 -0.28007 0.24700 -0.37493 -0.25000 0.24700 -0.47100 -0.26141 0.24700 -0.57035 -0.25966 0.39970 -0.52080 -0.25966 0.39970 -0.47783 -0.24833 0.24700 -0.57426 -0.24597 0.247 [...]
+					<technique_common>
+						<accessor count="583" source="#komega_001-Position-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<source id="komega_001-Normals">
+					<float_array count="3447" id="komega_001-Normals-array">0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 -1.00000 -0.00000 0.00000 -1.00000 -0.23094 0.31664 -0.92000 -0.25115 0.29865 - [...]
+					<technique_common>
+						<accessor count="1149" source="#komega_001-Normals-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<vertices id="komega_001-Vertex">
+					<input semantic="POSITION" source="#komega_001-Position"/>
+				</vertices>
+				<triangles count="1150" material="Material_001">
+					<input offset="0" semantic="VERTEX" source="#komega_001-Vertex"/>
+					<input offset="1" semantic="NORMAL" source="#komega_001-Normals"/>
+					<p>16 0 80 0 18 0 18 1 80 1 76 1 18 2 76 2 22 2 22 3 76 3 72 3 22 4 72 4 27 4 27 5 72 5 67 5 27 6 67 6 30 6 30 7 67 7 64 7 30 8 64 8 38 8 38 9 64 9 57 9 38 10 57 10 42 10 42 11 57 11 53 11 42 12 53 12 46 12 46 13 53 13 49 13 61 14 65 14 59 14 59 15 65 15 66 15 13 16 23 16 9 16 9 17 23 17 21 17 9 18 21 18 6 18 6 19 21 19 17 19 6 20 17 20 5 20 5 21 17 21 15 21 5 22 15 22 3 22 3 23 15 23 12 23 12 24 0 24 3 24 24 25 36 25 19 25 36 26 35 26 29 26 19 27 36 27 29 27 19 28 29 28 13 28 13 29 [...]
+				</triangles>
+			</mesh>
+		</geometry>
+		<geometry id="mu_001" name="mu_001">
+			<mesh>
+				<source id="mu_001-Position">
+					<float_array count="9498" id="mu_001-Position-array">-0.07000 -0.02637 -0.06691 -0.07000 -0.02637 0.03309 -0.07000 -0.02437 -0.06691 -0.07000 -0.02437 0.03309 -0.05200 -0.02437 -0.06691 -0.05200 -0.02437 0.03309 -0.05000 -0.08967 0.20809 -0.05000 -0.05967 0.26005 -0.05000 -0.04637 0.03509 -0.05000 -0.04637 0.18309 -0.05000 -0.02237 -0.06691 -0.05000 -0.02237 0.03309 -0.05000 -0.02237 0.03509 -0.05000 0.01363 -0.06691 -0.05000 0.01363 0.21773 0.05000 -0.05967 0.26005 0.05000 0.01363  [...]
+					<technique_common>
+						<accessor count="3166" source="#mu_001-Position-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<source id="mu_001-Normals">
+					<float_array count="15423" id="mu_001-Normals-array">1.00000 -0.00000 0.00000 -1.00000 -0.00000 0.00000 0.00000 0.98122 -0.19290 0.00000 0.92913 -0.36975 0.00000 0.84534 -0.53422 0.00000 0.73261 -0.68065 0.00000 0.59558 -0.80330 0.00000 0.43725 -0.89934 0.00000 -0.43727 0.89933 0.00000 -0.59537 0.80345 0.00000 -0.73260 0.68066 0.00000 -0.84536 0.53420 0.00000 -0.92912 0.36977 0.00000 -0.98122 0.19290 0.00000 -0.99996 0.00901 0.00000 -0.98468 -0.17435 0.00000 -0.93574 -0.35270 0.0000 [...]
+					<technique_common>
+						<accessor count="5141" source="#mu_001-Normals-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<vertices id="mu_001-Vertex">
+					<input semantic="POSITION" source="#mu_001-Position"/>
+				</vertices>
+				<triangles count="5783" material="Material">
+					<input offset="0" semantic="VERTEX" source="#mu_001-Vertex"/>
+					<input offset="1" semantic="NORMAL" source="#mu_001-Normals"/>
+					<p>22 0 16 0 23 0 12 1 14 1 11 1 128 2 130 2 164 2 164 2 162 2 128 2 126 3 128 3 162 3 162 3 160 3 126 3 124 4 126 4 160 4 160 4 158 4 124 4 122 5 124 5 158 5 158 5 156 5 122 5 120 6 122 6 156 6 156 6 154 6 120 6 118 7 120 7 154 7 154 7 152 7 118 7 109 8 143 8 145 8 145 8 111 8 109 8 107 9 141 9 143 9 143 9 109 9 107 9 105 10 139 10 141 10 141 10 107 10 105 10 103 11 137 11 139 11 139 11 105 11 103 11 101 12 135 12 137 12 137 12 103 12 101 12 99 13 133 13 135 13 135 13 101 13 99 13  [...]
+				</triangles>
+				<lines count="3">
+					<input offset="0" semantic="VERTEX" source="#mu_001-Vertex"/>
+					<p>1031 1090 1667 1714 2677 2734</p>
+				</lines>
+			</mesh>
+		</geometry>
+		<geometry id="gamma_001" name="gamma_001">
+			<mesh>
+				<source id="gamma_001-Position">
+					<float_array count="1200" id="gamma_001-Position-array">0.13057 -0.65381 -0.25425 0.13057 -0.65381 -0.23425 0.13057 -0.61381 -0.25425 0.13057 -0.61381 -0.23425 0.19257 -0.65381 -0.25425 0.19257 -0.65381 -0.23425 0.19257 -0.61381 -0.25425 0.19257 -0.61381 -0.23425 0.57254 -0.61381 -0.23425 0.57254 -0.61381 -0.25425 0.57254 -0.65381 -0.23425 0.57254 -0.65381 -0.25425 0.51054 -0.61381 -0.23425 0.51054 -0.61381 -0.25425 0.51054 -0.65381 -0.23425 0.51054 -0.65381 -0.25425 0.17261 -0.3987 [...]
+					<technique_common>
+						<accessor count="400" source="#gamma_001-Position-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<source id="gamma_001-Normals">
+					<float_array count="2109" id="gamma_001-Normals-array">0.70708 0.00000 0.70708 0.57735 -0.57735 0.57735 0.57735 -0.57735 -0.57735 0.57735 -0.57735 -0.57735 0.70708 0.00000 -0.70708 0.70708 0.00000 0.70708 0.70708 0.00000 0.70708 0.57735 -0.57735 0.57735 0.57735 -0.57735 -0.57735 0.57735 -0.57735 -0.57735 0.70708 0.00000 -0.70708 0.70708 0.00000 0.70708 0.57735 -0.57735 0.57735 0.57735 -0.57735 0.57735 0.57735 -0.57735 -0.57735 0.57735 -0.57735 -0.57735 0.57735 -0.57735 -0.57735 0.57 [...]
+					<technique_common>
+						<accessor count="703" source="#gamma_001-Normals-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<vertices id="gamma_001-Vertex">
+					<input semantic="POSITION" source="#gamma_001-Position"/>
+				</vertices>
+				<triangles count="734" material="Material_004">
+					<input offset="0" semantic="VERTEX" source="#gamma_001-Vertex"/>
+					<input offset="1" semantic="NORMAL" source="#gamma_001-Normals"/>
+					<p>4 0 6 1 7 2 7 3 5 4 4 5 0 6 2 7 3 8 3 9 1 10 0 11 2 12 6 13 7 14 7 15 3 16 2 17 1 18 3 19 7 20 7 21 5 22 1 23 0 24 4 25 6 26 6 27 2 28 0 29 15 30 11 31 9 32 9 33 13 34 15 35 14 36 12 37 8 38 8 39 10 40 14 41 13 42 9 43 8 44 8 45 12 46 13 47 15 48 13 49 12 50 12 51 14 52 15 53 11 54 9 55 8 56 8 57 10 58 11 59 23 60 19 61 17 62 17 63 21 64 23 65 22 66 20 67 16 68 16 69 18 70 22 71 21 72 17 73 16 74 16 75 20 76 21 77 23 78 21 79 20 80 20 81 22 82 23 83 19 84 17 85 16 86 16 87 18 88  [...]
+				</triangles>
+			</mesh>
+		</geometry>
+		<geometry id="delta_001" name="delta_001">
+			<mesh>
+				<source id="delta_001-Position">
+					<float_array count="9129" id="delta_001-Position-array">-0.64043 0.29019 0.37675 -0.64043 0.29019 0.40475 -0.64043 0.29851 0.37675 -0.64043 0.30169 0.38225 -0.64043 0.30169 0.38725 -0.64043 0.45819 0.37710 -0.64043 0.46169 0.38316 -0.64043 0.46169 0.38775 -0.64043 0.46398 0.37375 -0.64043 0.47919 0.37375 -0.64043 0.47919 0.40475 -0.48043 0.29019 0.37675 -0.48043 0.29019 0.40475 -0.48043 0.29851 0.37675 -0.48043 0.30169 0.38225 -0.48043 0.30169 0.38725 -0.48043 0.45819 0.37710 -0.480 [...]
+					<technique_common>
+						<accessor count="3043" source="#delta_001-Position-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<source id="delta_001-Normals">
+					<float_array count="9378" id="delta_001-Normals-array">1.00000 -0.00000 -0.00000 1.00000 -0.00000 0.00000 1.00000 0.00000 -0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 -1.00000 -0.00000 -0.00000 -1.00000 0.00000 -0.00000 -1.00000 0.00000 -0.00000 -1.00000 0.00000 0.00000 -1.00000 0.00000 -0.00000 -1.00000 0.00000 0.00000 -1.00000 -0.00000 -0.00000 0.00000 0.00000 -1.00000 -0.00000 0.00000 -1.00000 -0.00000 -0.00000 -1.00000  [...]
+					<technique_common>
+						<accessor count="3126" source="#delta_001-Normals-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<vertices id="delta_001-Vertex">
+					<input semantic="POSITION" source="#delta_001-Position"/>
+				</vertices>
+				<triangles count="3911" material="Material_006">
+					<input offset="0" semantic="VERTEX" source="#delta_001-Vertex"/>
+					<input offset="1" semantic="NORMAL" source="#delta_001-Normals"/>
+					<p>15 0 12 0 14 0 14 1 12 1 11 1 14 2 11 2 13 2 16 3 19 3 17 3 17 4 19 4 20 4 17 5 20 5 18 5 18 6 20 6 21 6 8 7 5 7 9 7 9 8 5 8 6 8 9 9 6 9 10 9 10 10 6 10 7 10 2 11 0 11 3 11 3 12 0 12 1 12 3 13 1 13 4 13 9 14 20 14 8 14 8 15 20 15 19 15 0 16 2 16 11 16 11 17 2 17 13 17 5 18 8 18 16 18 16 19 8 19 19 19 4 20 7 20 18 20 18 20 15 20 4 20 1 21 12 21 21 21 21 21 10 21 1 21 1 22 10 22 7 22 7 22 4 22 1 22 12 23 15 23 18 23 18 23 21 23 12 23 9 24 10 24 21 24 21 24 20 24 9 24 0 25 11 25 12  [...]
+				</triangles>
+				<lines count="250">
+					<input offset="0" semantic="VERTEX" source="#delta_001-Vertex"/>
+					<p>466 467 466 468 467 469 468 470 469 471 470 472 471 473 472 474 473 475 474 476 475 477 476 478 477 479 478 480 479 481 480 482 481 483 482 484 483 485 484 486 485 487 486 488 487 489 488 490 489 491 490 492 491 493 492 494 493 495 494 496 495 497 496 498 497 499 465 499 498 500 499 501 500 502 501 503 502 504 503 505 504 506 505 506 507 508 507 509 508 510 509 511 510 512 511 513 512 514 513 515 514 548 514 516 515 517 516 518 517 519 518 520 519 521 520 522 521 523 522 524 523  [...]
+				</lines>
+			</mesh>
+		</geometry>
+		<geometry id="base_001" name="base_001">
+			<mesh>
+				<source id="base_001-Position">
+					<float_array count="15243" id="base_001-Position-array">0.57000 -0.45940 0.86790 0.57000 -0.45940 0.77090 0.57000 -0.53540 0.86790 0.57000 -0.53540 0.77090 0.56700 -0.45640 0.86790 0.56700 -0.45640 0.77090 0.56700 -0.53840 0.86790 0.56700 -0.53840 0.77090 0.52200 -0.45640 0.86790 0.52200 -0.53840 0.86790 0.52110 -0.45640 0.77080 0.52110 -0.53840 0.77080 0.52100 -0.45640 0.76490 0.52100 -0.53840 0.76490 0.51750 -0.45640 0.76490 0.51750 -0.45640 0.73290 0.51750 -0.53840 0.76490 0.5175 [...]
+					<technique_common>
+						<accessor count="5081" source="#base_001-Position-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<source id="base_001-Normals">
+					<float_array count="25662" id="base_001-Normals-array">0.00000 -1.00000 -0.00000 0.00000 -1.00000 0.00000 0.00000 1.00000 -0.00000 0.00000 1.00000 0.00000 0.99986 0.00000 0.01695 0.99986 0.00000 0.01695 0.00000 -0.00000 1.00000 0.00000 -0.00000 1.00000 -0.99986 0.00000 0.01694 -0.99986 0.00000 0.01694 -0.00000 0.00000 1.00000 -0.00000 0.00000 1.00000 -0.57735 -0.57735 0.57735 0.57735 -0.57735 0.57735 0.57735 0.57735 0.57735 0.57735 0.57735 0.57735 -0.40825 0.81649 0.40825 -0.57735 - [...]
+					<technique_common>
+						<accessor count="8554" source="#base_001-Normals-array" stride="3">
+							<param type="float" name="X"></param>
+							<param type="float" name="Y"></param>
+							<param type="float" name="Z"></param>
+						</accessor>
+					</technique_common>
+				</source>
+				<vertices id="base_001-Vertex">
+					<input semantic="POSITION" source="#base_001-Position"/>
+				</vertices>
+				<triangles count="9473" material="Material_005">
+					<input offset="0" semantic="VERTEX" source="#base_001-Vertex"/>
+					<input offset="1" semantic="NORMAL" source="#base_001-Normals"/>
+					<p>12 0 10 0 14 0 26 1 27 1 22 1 28 2 24 2 29 2 11 3 13 3 16 3 28 4 29 4 26 4 26 5 29 5 27 5 27 6 29 6 22 6 22 7 29 7 24 7 10 8 12 8 11 8 11 9 12 9 13 9 13 10 12 10 16 10 16 11 12 11 14 11 15 12 23 13 25 14 25 15 17 16 15 17 14 18 15 18 17 18 17 18 16 18 14 18 2 19 6 20 7 21 2 22 7 23 3 24 0 25 2 26 3 27 3 28 1 29 0 30 0 31 1 32 5 33 5 34 4 35 0 36 4 37 5 38 10 39 10 40 8 41 4 42 3 43 7 44 11 45 1 46 10 47 5 48 10 49 1 50 3 51 10 52 3 53 11 54 8 55 18 56 19 57 19 58 34 59 8 60 0 61  [...]
+				</triangles>
+				<lines count="58">
+					<input offset="0" semantic="VERTEX" source="#base_001-Vertex"/>
+					<p>113 133 114 134 131 133 132 134 139 145 140 146 157 159 158 160 131 161 132 162 139 143 140 144 139 141 140 142 259 261 260 262 257 261 258 262 239 269 240 270 241 243 242 244 255 261 256 262 267 269 268 270 267 271 268 272 342 343 343 345 344 345 339 343 362 368 364 366 370 371 373 375 368 393 370 394 369 395 367 396 418 420 447 461 451 462 455 463 459 464 461 466 462 467 463 468 503 504 504 523 504 720 720 721 790 792 844 845 1287 1290 1291 1293 2380 2384 2384 2387</p>
+				</lines>
+			</mesh>
+		</geometry>
+	</library_geometries>
+	<library_visual_scenes>
+		<visual_scene id="Scene" name="Scene">
+			<node layer="L2" id="Lamp" name="Lamp">
+				<matrix>
+					-0.36256 -0.79184 0.49146 4.048 
+					0.93136 -0.32674 0.16064 -2.75925 
+					0.03337 0.51597 0.85596 2.36461 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_light url="#Spot"/>
+			</node>
+			<node layer="L2" id="Camera" name="Camera">
+				<matrix>
+					0.68588 -0.31737 0.65486 3.91539 
+					0.72763 0.31247 -0.61067 -4.15057 
+					-0.01082 0.89534 0.44525 2.00697 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_camera url="#Camera-Camera"/>
+			</node>
+			<node layer="L2" id="kphi" name="kphi">
+				<matrix>
+					1.0 0.0 0.0 0.0 
+					0.0 -0.0 -1.0 0.0 
+					0.0 1.0 -0.0 0.0 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_geometry url="#kphi_001">
+					<bind_material>
+						<technique_common>
+							<instance_material symbol="Material_003" target="#Material_003">
+								<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
+							</instance_material>
+						</technique_common>
+					</bind_material>
+				</instance_geometry>
+			</node>
+			<node layer="L2" id="kappa" name="kappa">
+				<matrix>
+					1.0 0.0 0.0 0.0 
+					0.0 -0.0 -1.0 0.0 
+					0.0 1.0 -0.0 0.0 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_geometry url="#kappa_001">
+					<bind_material>
+						<technique_common>
+							<instance_material symbol="Material_002" target="#Material_002">
+								<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
+							</instance_material>
+						</technique_common>
+					</bind_material>
+				</instance_geometry>
+			</node>
+			<node layer="L2" id="komega" name="komega">
+				<matrix>
+					1.0 0.0 0.0 0.0 
+					0.0 -0.0 -1.0 0.0 
+					0.0 1.0 -0.0 0.0 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_geometry url="#komega_001">
+					<bind_material>
+						<technique_common>
+							<instance_material symbol="Material_001" target="#Material_001">
+								<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
+							</instance_material>
+						</technique_common>
+					</bind_material>
+				</instance_geometry>
+			</node>
+			<node layer="L2" id="mu" name="mu">
+				<matrix>
+					1.0 0.0 0.0 0.0 
+					0.0 -0.0 -1.0 0.45925 
+					0.0 1.0 -0.0 -0.49463 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_geometry url="#mu_001">
+					<bind_material>
+						<technique_common>
+							<instance_material symbol="Material" target="#Material">
+								<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
+							</instance_material>
+						</technique_common>
+					</bind_material>
+				</instance_geometry>
+			</node>
+			<node layer="L2" id="gamma" name="gamma">
+				<matrix>
+					1.0 0.0 0.0 -0.35157 
+					0.0 -0.0 -1.0 0.68875 
+					0.0 1.0 -0.0 -0.39119 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_geometry url="#gamma_001">
+					<bind_material>
+						<technique_common>
+							<instance_material symbol="Material_004" target="#Material_004">
+								<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
+							</instance_material>
+						</technique_common>
+					</bind_material>
+				</instance_geometry>
+			</node>
+			<node layer="L2" id="delta" name="delta">
+				<matrix>
+					1.0 0.0 0.0 -0.35157 
+					0.0 -0.0 -1.0 0.68875 
+					0.0 1.0 -0.0 -0.39119 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_geometry url="#delta_001">
+					<bind_material>
+						<technique_common>
+							<instance_material symbol="Material_006" target="#Material_006">
+								<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
+							</instance_material>
+						</technique_common>
+					</bind_material>
+				</instance_geometry>
+			</node>
+			<node layer="L2" id="base" name="base">
+				<matrix>
+					1.0 0.0 0.0 0.0 
+					0.0 -0.0 -1.0 0.20709 
+					0.0 1.0 -0.0 -0.66585 
+					0.0 0.0 0.0 1.0 
+				</matrix>
+				<instance_geometry url="#base_001">
+					<bind_material>
+						<technique_common>
+							<instance_material symbol="Material_005" target="#Material_005">
+								<bind_vertex_input input_semantic="TEXCOORD" input_set="1" semantic="CHANNEL1"/>
+							</instance_material>
+						</technique_common>
+					</bind_material>
+				</instance_geometry>
+			</node>
+		</visual_scene>
+	</library_visual_scenes>
+	<scene>
+		<instance_visual_scene url="#Scene"/>
+	</scene>
+</COLLADA>
\ No newline at end of file
diff --git a/data/diffabs.yaml b/data/diffabs.yaml
new file mode 100644
index 0000000..85d7874
--- /dev/null
+++ b/data/diffabs.yaml
@@ -0,0 +1,46 @@
+--- !<Mon%20Aug%2023%2014:52:20%202010%0A>
+- FileName: diffabs.dae
+  Objects:
+  - Id: 2
+    Name: kphi
+    Transformation: [1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000,
+      0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+      1.000000]
+    Hide: no
+  - Id: 3
+    Name: kappa
+    Transformation: [1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000,
+      0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+      1.000000]
+    Hide: no
+  - Id: 4
+    Name: komega
+    Transformation: [1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000,
+      0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+      1.000000]
+    Hide: no
+  - Id: 5
+    Name: mu
+    Transformation: [1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000,
+      0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+      1.000000]
+    Hide: no
+  - Id: 6
+    Name: gamma
+    Transformation: [1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000,
+      0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+      1.000000]
+    Hide: no
+  - Id: 7
+    Name: delta
+    Transformation: [1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000,
+      0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+      1.000000]
+    Hide: no
+  - Id: 8
+    Name: base
+    Transformation: [1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000,
+      0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,
+      1.000000]
+    Hide: no
+...
diff --git a/gtk-doc.make b/gtk-doc.make
index 57fab98..9841de4 100644
--- a/gtk-doc.make
+++ b/gtk-doc.make
@@ -5,12 +5,12 @@
 ####################################
 
 if GTK_DOC_USE_LIBTOOL
-GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
 GTKDOC_RUN = $(LIBTOOL) --mode=execute
 else
-GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
 GTKDOC_RUN =
 endif
 
@@ -23,17 +23,19 @@ GPATH = $(srcdir)
 
 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
 
-EXTRA_DIST = 				\
+SETUP_FILES = \
 	$(content_files)		\
-	$(HTML_IMAGES)			\
 	$(DOC_MAIN_SGML_FILE)		\
 	$(DOC_MODULE)-sections.txt	\
 	$(DOC_MODULE)-overrides.txt
 
-DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
-	pdf-build.stamp \
-	$(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
-	$(srcdir)/pdf.stamp
+EXTRA_DIST = 				\
+	$(HTML_IMAGES)			\
+	$(SETUP_FILES)
+
+DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \
+	html-build.stamp pdf-build.stamp \
+	sgml.stamp html.stamp pdf.stamp
 
 SCANOBJ_FILES = 		 \
 	$(DOC_MODULE).args 	 \
@@ -70,22 +72,45 @@ docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
 
 $(REPORT_FILES): sgml-build.stamp
 
+#### setup ####
+
+setup-build.stamp:
+	- at if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+	    echo '  DOC   Preparing build'; \
+	    files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
+	    if test "x$$files" != "x" ; then \
+	        for file in $$files ; do \
+	            test -f $(abs_srcdir)/$$file && \
+	                cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+	        done; \
+	    fi; \
+	fi
+	@touch setup-build.stamp
+
+
 #### scan ####
 
 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
-	@echo 'gtk-doc: Scanning header files'
-	@-chmod -R u+w $(srcdir)
-	@_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+	@echo '  DOC   Scanning header files'
+	@_source_dir='' ; \
+	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
-	  done ; \
-	  cd $(srcdir) && \
-	  gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
-	@if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
-	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+	done ; \
+	gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
+	@if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
+	    echo "  DOC   Introspecting gobjects"; \
+	    scanobj_options=""; \
+	    gtkdoc-scangobj 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	    if test "$(?)" = "0"; then \
+	        if test "x$(V)" = "x1"; then \
+	            scanobj_options="--verbose"; \
+	        fi; \
+	    fi; \
+	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+	    gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
 	else \
-	    cd $(srcdir) ; \
 	    for i in $(SCANOBJ_FILES) ; do \
-               test -f $$i || touch $$i ; \
+	        test -f $$i || touch $$i ; \
 	    done \
 	fi
 	@touch scan-build.stamp
@@ -93,30 +118,15 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
 	@true
 
-#### templates ####
-
-tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
-	@echo 'gtk-doc: Rebuilding template files'
-	@-chmod -R u+w $(srcdir)
-	@cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
-	@touch tmpl-build.stamp
-
-tmpl.stamp: tmpl-build.stamp
-	@true
-
-$(srcdir)/tmpl/*.sgml:
-	@true
-
 #### xml ####
 
-sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
-	@echo 'gtk-doc: Building XML'
-	@-chmod -R u+w $(srcdir)
-	@_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
+	@echo '  DOC   Building XML'
+	@_source_dir='' ; \
+	for i in $(DOC_SOURCE_DIR) ; do \
 	    _source_dir="$${_source_dir} --source-dir=$$i" ; \
-	  done ; \
-	  cd $(srcdir) && \
-	  gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
+	done ; \
+	gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
 	@touch sgml-build.stamp
 
 sgml.stamp: sgml-build.stamp
@@ -125,58 +135,78 @@ sgml.stamp: sgml-build.stamp
 #### html ####
 
 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo 'gtk-doc: Building HTML'
-	@-chmod -R u+w $(srcdir)
-	@rm -rf $(srcdir)/html
-	@mkdir $(srcdir)/html
+	@echo '  DOC   Building HTML'
+	@rm -rf html
+	@mkdir html
 	@mkhtml_options=""; \
+	gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	if test "$(?)" = "0"; then \
+	  if test "x$(V)" = "x1"; then \
+	    mkhtml_options="$$mkhtml_options --verbose"; \
+	  fi; \
+	fi; \
 	gtkdoc-mkhtml 2>&1 --help | grep  >/dev/null "\-\-path"; \
 	if test "$(?)" = "0"; then \
-	  mkhtml_options=--path="$(srcdir)"; \
+	  mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
 	fi; \
-	cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
-	@test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
-	@echo 'gtk-doc: Fixing cross-references'
-	@cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+	cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+	- at test "x$(HTML_IMAGES)" = "x" || \
+	for file in $(HTML_IMAGES) ; do \
+	  if test -f $(abs_srcdir)/$$file ; then \
+	    cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
+	  fi; \
+	  if test -f $(abs_builddir)/$$file ; then \
+	    cp $(abs_builddir)/$$file $(abs_builddir)/html; \
+	  fi; \
+	done;
+	@echo '  DOC   Fixing cross-references'
+	@gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
 	@touch html-build.stamp
 
 #### pdf ####
 
 pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
-	@echo 'gtk-doc: Building PDF'
-	@-chmod -R u+w $(srcdir)
-	@rm -rf $(srcdir)/$(DOC_MODULE).pdf
-	@mkpdf_imgdirs=""; \
+	@echo '  DOC   Building PDF'
+	@rm -f $(DOC_MODULE).pdf
+	@mkpdf_options=""; \
+	gtkdoc-mkpdf 2>&1 --help | grep  >/dev/null "\-\-verbose"; \
+	if test "$(?)" = "0"; then \
+	  if test "x$(V)" = "x1"; then \
+	    mkpdf_options="$$mkpdf_options --verbose"; \
+	  fi; \
+	fi; \
 	if test "x$(HTML_IMAGES)" != "x"; then \
 	  for img in $(HTML_IMAGES); do \
 	    part=`dirname $$img`; \
-	    echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+	    echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
 	    if test $$? != 0; then \
-	      mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+	      mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
 	    fi; \
 	  done; \
 	fi; \
-	cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+	gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
 	@touch pdf-build.stamp
 
 ##############
 
 clean-local:
-	rm -f *~ *.bak
-	rm -rf .libs
+	@rm -f *~ *.bak
+	@rm -rf .libs
 
 distclean-local:
-	cd $(srcdir) && \
-	  rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
-	         $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+	@rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
+	    $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+	@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+	    rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
+	fi
 
 maintainer-clean-local: clean
-	cd $(srcdir) && rm -rf xml html
+	@rm -rf xml html
 
 install-data-local:
-	@installfiles=`echo $(srcdir)/html/*`; \
-	if test "$$installfiles" = '$(srcdir)/html/*'; \
-	then echo '-- Nothing to install' ; \
+	@installfiles=`echo $(builddir)/html/*`; \
+	if test "$$installfiles" = '$(builddir)/html/*'; \
+	then echo 1>&2 'Nothing to install' ; \
 	else \
 	  if test -n "$(DOC_MODULE_VERSION)"; then \
 	    installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
@@ -185,14 +215,12 @@ install-data-local:
 	  fi; \
 	  $(mkinstalldirs) $${installdir} ; \
 	  for i in $$installfiles; do \
-	    echo '-- Installing '$$i ; \
+	    echo ' $(INSTALL_DATA) '$$i ; \
 	    $(INSTALL_DATA) $$i $${installdir}; \
 	  done; \
 	  if test -n "$(DOC_MODULE_VERSION)"; then \
 	    mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
 	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
-	    mv -f $${installdir}/$(DOC_MODULE).devhelp \
-	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
 	  fi; \
 	  $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
 	fi
@@ -217,14 +245,12 @@ dist-check-gtkdoc:
 endif
 
 dist-hook: dist-check-gtkdoc dist-hook-local
-	mkdir $(distdir)/tmpl
-	mkdir $(distdir)/html
-	-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
-	cp $(srcdir)/html/* $(distdir)/html
-	-cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
-	-cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
-	-cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
-	cd $(distdir) && rm -f $(DISTCLEANFILES)
-	$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+	@mkdir $(distdir)/html
+	@cp ./html/* $(distdir)/html
+	@-cp ./$(DOC_MODULE).pdf $(distdir)/
+	@-cp ./$(DOC_MODULE).types $(distdir)/
+	@-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
+	@cd $(distdir) && rm -f $(DISTCLEANFILES)
+	@$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
 
 .PHONY : dist-hook-local docs
diff --git a/gui/Makefile.am b/gui/Makefile.am
index be4343d..6d25388 100644
--- a/gui/Makefile.am
+++ b/gui/Makefile.am
@@ -1,3 +1,7 @@
+if HKL3D
+SUBDIRS = hkl3d
+endif
+
 bin_PROGRAMS = ghkl
 
 AM_CXXFLAGS = \
@@ -5,22 +9,48 @@ AM_CXXFLAGS = \
 	-I$(top_srcdir)/hkl \
 	-DPKGDATA=\""$(pkgdatadir)"\" \
 	$(GSL_CFLAGS) \
-	$(GTKMM_CFLAGS)
+	$(GTKMM_CFLAGS) \
+	-fpermissive
 
 AM_LDFLAGS = \
-	$(top_builddir)/hkl/libhkl.la \
 	$(GSL_LIBS) \
 	$(GTKMM_LIBS)
 
+ghkl_LDADD = \
+	$(top_builddir)/hkl/libhkl.la
+
 ghkl_SOURCES = \
-	ghkl.h \
-	ghkl.cpp \
-	ghkl-callbacks.cpp \
-	pseudoaxesframe.h \
-	pseudoaxesframe.cpp \
-	modelcolumns.h \
+	hkl-gui.h \
+	hkl-gui.cpp \
+	hkl-gui-callbacks.cpp \
+	hkl-gui-pseudoaxes.h \
+	hkl-gui-pseudoaxes.cpp \
+	hkl-gui-modelcolumns.h \
 	main.cpp
 
+if HKL3D
+AM_CXXFLAGS += \
+	-I$(top_srcdir)/hkl3d \
+	-I$(top_srcdir)/hkl3d/bullet/src \
+	-I$(top_srcdir)/gui/hkl3d \
+	-I$(top_srcdir)/gui/OpenGL \
+	-DHKL3D \
+	$(GTKGLEXTMM_CFLAGS)
+
+AM_LDFLAGS += \
+	$(GTKGLEXTMM_LIBS)
+
+ghkl_LDADD += \
+	$(top_builddir)/hkl3d/libhkl3d.la \
+	$(top_builddir)/gui/hkl3d/libhkl3d-gui.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletdynamics.la
+
+ghkl_SOURCES += \
+	hkl-gui-3d.h \
+	hkl-gui-3d.cpp
+
+endif
+
 dist_pkgdata_DATA = ghkl.ui pseudo.ui
 
 appldir = ${datadir}/applications
@@ -31,4 +61,4 @@ check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
 check-syntax:
 	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
 
-.PHONY: check-syntax
\ No newline at end of file
+.PHONY: check-syntax
diff --git a/gui/Makefile.in b/gui/Makefile.in
index 3b25751..8f5e216 100644
--- a/gui/Makefile.in
+++ b/gui/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -17,6 +16,51 @@
 
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -36,9 +80,30 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = ghkl$(EXEEXT)
+ at HKL3D_TRUE@am__append_1 = \
+ at HKL3D_TRUE@	-I$(top_srcdir)/hkl3d \
+ at HKL3D_TRUE@	-I$(top_srcdir)/hkl3d/bullet/src \
+ at HKL3D_TRUE@	-I$(top_srcdir)/gui/hkl3d \
+ at HKL3D_TRUE@	-I$(top_srcdir)/gui/OpenGL \
+ at HKL3D_TRUE@	-DHKL3D \
+ at HKL3D_TRUE@	$(GTKGLEXTMM_CFLAGS)
+
+ at HKL3D_TRUE@am__append_2 = \
+ at HKL3D_TRUE@	$(GTKGLEXTMM_LIBS)
+
+ at HKL3D_TRUE@am__append_3 = \
+ at HKL3D_TRUE@	$(top_builddir)/hkl3d/libhkl3d.la \
+ at HKL3D_TRUE@	$(top_builddir)/gui/hkl3d/libhkl3d-gui.la \
+ at HKL3D_TRUE@	$(top_builddir)/hkl3d/bullet/src/libbulletdynamics.la
+
+ at HKL3D_TRUE@am__append_4 = \
+ at HKL3D_TRUE@	hkl-gui-3d.h \
+ at HKL3D_TRUE@	hkl-gui-3d.cpp
+
 subdir = gui
-DIST_COMMON = $(dist_appl_DATA) $(dist_pkgdata_DATA) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/depcomp $(dist_appl_DATA) \
+	$(dist_pkgdata_DATA)
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -53,34 +118,85 @@ CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appldir)" \
 	"$(DESTDIR)$(pkgdatadir)"
 PROGRAMS = $(bin_PROGRAMS)
-am_ghkl_OBJECTS = ghkl.$(OBJEXT) ghkl-callbacks.$(OBJEXT) \
-	pseudoaxesframe.$(OBJEXT) main.$(OBJEXT)
+am__ghkl_SOURCES_DIST = hkl-gui.h hkl-gui.cpp hkl-gui-callbacks.cpp \
+	hkl-gui-pseudoaxes.h hkl-gui-pseudoaxes.cpp \
+	hkl-gui-modelcolumns.h main.cpp hkl-gui-3d.h hkl-gui-3d.cpp
+ at HKL3D_TRUE@am__objects_1 = hkl-gui-3d.$(OBJEXT)
+am_ghkl_OBJECTS = hkl-gui.$(OBJEXT) hkl-gui-callbacks.$(OBJEXT) \
+	hkl-gui-pseudoaxes.$(OBJEXT) main.$(OBJEXT) $(am__objects_1)
 ghkl_OBJECTS = $(am_ghkl_OBJECTS)
-ghkl_LDADD = $(LDADD)
+ghkl_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la $(am__append_3)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_ at AM_V@)
+am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
 CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(ghkl_SOURCES)
-DIST_SOURCES = $(ghkl_SOURCES)
+DIST_SOURCES = $(am__ghkl_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -102,14 +218,73 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 DATA = $(dist_appl_DATA) $(dist_pkgdata_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+DIST_SUBDIRS = hkl3d
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
+ASY = @ASY@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -126,6 +301,7 @@ CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -134,13 +310,29 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
 GTKMM_CFLAGS = @GTKMM_CFLAGS@
 GTKMM_LIBS = @GTKMM_LIBS@
 HTML_DIR = @HTML_DIR@
@@ -149,6 +341,14 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
@@ -157,7 +357,10 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -180,12 +383,17 @@ RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHTOOL = @SHTOOL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -219,14 +427,15 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+release_info = @release_info@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -235,31 +444,20 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_CXXFLAGS = \
-	-I$(top_srcdir) \
-	-I$(top_srcdir)/hkl \
-	-DPKGDATA=\""$(pkgdatadir)"\" \
-	$(GSL_CFLAGS) \
-	$(GTKMM_CFLAGS)
-
-AM_LDFLAGS = \
-	$(top_builddir)/hkl/libhkl.la \
-	$(GSL_LIBS) \
-	$(GTKMM_LIBS)
-
-ghkl_SOURCES = \
-	ghkl.h \
-	ghkl.cpp \
-	ghkl-callbacks.cpp \
-	pseudoaxesframe.h \
-	pseudoaxesframe.cpp \
-	modelcolumns.h \
-	main.cpp
-
+version_info = @version_info@
+ at HKL3D_TRUE@SUBDIRS = hkl3d
+AM_CXXFLAGS = -I$(top_srcdir) -I$(top_srcdir)/hkl \
+	-DPKGDATA=\""$(pkgdatadir)"\" $(GSL_CFLAGS) $(GTKMM_CFLAGS) \
+	-fpermissive $(am__append_1)
+AM_LDFLAGS = $(GSL_LIBS) $(GTKMM_LIBS) $(am__append_2)
+ghkl_LDADD = $(top_builddir)/hkl/libhkl.la $(am__append_3)
+ghkl_SOURCES = hkl-gui.h hkl-gui.cpp hkl-gui-callbacks.cpp \
+	hkl-gui-pseudoaxes.h hkl-gui-pseudoaxes.cpp \
+	hkl-gui-modelcolumns.h main.cpp $(am__append_4)
 dist_pkgdata_DATA = ghkl.ui pseudo.ui
 appldir = ${datadir}/applications
 dist_appl_DATA = ghkl.desktop
-all: all-am
+all: all-recursive
 
 .SUFFIXES:
 .SUFFIXES: .cpp .lo .o .obj
@@ -295,14 +493,19 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p || test -f $$p1; \
-	  then echo "$$p"; echo "$$p"; else :; fi; \
+	while read p p1; do if test -f $$p \
+	 || test -f $$p1 \
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
 	done | \
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	sed -e 'p;s,.*/,,;n;h' \
+	    -e 's|.*|.|' \
 	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
 	sed 'N;N;N;s,\n, ,g' | \
 	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -323,7 +526,8 @@ uninstall-binPROGRAMS:
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
 	files=`for p in $$list; do echo "$$p"; done | \
 	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' `; \
+	      -e 's/$$/$(EXEEXT)/' \
+	`; \
 	test -n "$$list" || exit 0; \
 	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
 	cd "$(DESTDIR)$(bindir)" && rm -f $$files
@@ -336,9 +540,10 @@ clean-binPROGRAMS:
 	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
 	echo " rm -f" $$list; \
 	rm -f $$list
-ghkl$(EXEEXT): $(ghkl_OBJECTS) $(ghkl_DEPENDENCIES) 
+
+ghkl$(EXEEXT): $(ghkl_OBJECTS) $(ghkl_DEPENDENCIES) $(EXTRA_ghkl_DEPENDENCIES) 
 	@rm -f ghkl$(EXEEXT)
-	$(CXXLINK) $(ghkl_OBJECTS) $(ghkl_LDADD) $(LIBS)
+	$(AM_V_CXXLD)$(CXXLINK) $(ghkl_OBJECTS) $(ghkl_LDADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -346,31 +551,32 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ghkl-callbacks.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ghkl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui-3d.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui-callbacks.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui-pseudoaxes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-gui.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pseudoaxesframe.Po at am__quote@
 
 .cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
 
 .cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 .cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -379,8 +585,11 @@ clean-libtool:
 	-rm -rf .libs _libs
 install-dist_applDATA: $(dist_appl_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(appldir)" || $(MKDIR_P) "$(DESTDIR)$(appldir)"
 	@list='$(dist_appl_DATA)'; test -n "$(appldir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(appldir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(appldir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -394,13 +603,14 @@ uninstall-dist_applDATA:
 	@$(NORMAL_UNINSTALL)
 	@list='$(dist_appl_DATA)'; test -n "$(appldir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(appldir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(appldir)" && rm -f $$files
+	dir='$(DESTDIR)$(appldir)'; $(am__uninstall_files_from_dir)
 install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
 	@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -414,30 +624,64 @@ uninstall-dist_pkgdataDATA:
 	@$(NORMAL_UNINSTALL)
 	@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pkgdatadir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pkgdatadir)" && rm -f $$files
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+	dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -449,15 +693,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -466,6 +706,21 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -500,27 +755,58 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	  fi; \
 	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
 check-am: all-am
-check: check-am
+check: check-recursive
 all-am: Makefile $(PROGRAMS) $(DATA)
-installdirs:
+installdirs: installdirs-recursive
+installdirs-am:
 	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appldir)" "$(DESTDIR)$(pkgdatadir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
 
 install-am: all-am
 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-am
+installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -532,81 +818,82 @@ distclean-generic:
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
+clean: clean-recursive
 
 clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
 
-distclean: distclean-am
+distclean: distclean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
 
-dvi: dvi-am
+dvi: dvi-recursive
 
 dvi-am:
 
-html: html-am
+html: html-recursive
 
 html-am:
 
-info: info-am
+info: info-recursive
 
 info-am:
 
 install-data-am: install-dist_applDATA install-dist_pkgdataDATA
 
-install-dvi: install-dvi-am
+install-dvi: install-dvi-recursive
 
 install-dvi-am:
 
 install-exec-am: install-binPROGRAMS
 
-install-html: install-html-am
+install-html: install-html-recursive
 
 install-html-am:
 
-install-info: install-info-am
+install-info: install-info-recursive
 
 install-info-am:
 
 install-man:
 
-install-pdf: install-pdf-am
+install-pdf: install-pdf-recursive
 
 install-pdf-am:
 
-install-ps: install-ps-am
+install-ps: install-ps-recursive
 
 install-ps-am:
 
 installcheck-am:
 
-maintainer-clean: maintainer-clean-am
+maintainer-clean: maintainer-clean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
-mostlyclean: mostlyclean-am
+mostlyclean: mostlyclean-recursive
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
 	mostlyclean-libtool
 
-pdf: pdf-am
+pdf: pdf-recursive
 
 pdf-am:
 
-ps: ps-am
+ps: ps-recursive
 
 ps-am:
 
 uninstall-am: uninstall-binPROGRAMS uninstall-dist_applDATA \
 	uninstall-dist_pkgdataDATA
 
-.MAKE: install-am install-strip
+.MAKE: $(am__recursive_targets) install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-libtool ctags distclean distclean-compile \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-binPROGRAMS clean-generic clean-libtool \
+	cscopelist-am ctags ctags-am distclean distclean-compile \
 	distclean-generic distclean-libtool distclean-tags distdir dvi \
 	dvi-am html html-am info info-am install install-am \
 	install-binPROGRAMS install-data install-data-am \
@@ -615,10 +902,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_applDATA \
 	install-html-am install-info install-info-am install-man \
 	install-pdf install-pdf-am install-ps install-ps-am \
 	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags uninstall uninstall-am \
-	uninstall-binPROGRAMS uninstall-dist_applDATA \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-binPROGRAMS uninstall-dist_applDATA \
 	uninstall-dist_pkgdataDATA
 
 
diff --git a/gui/ghkl.ui b/gui/ghkl.ui
index d642917..5c572fb 100644
--- a/gui/ghkl.ui
+++ b/gui/ghkl.ui
@@ -500,6 +500,27 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <child>
+                  <object class="GtkVBox" id="vbox2">
+                    <property name="visible">True</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label11">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">pseudo axes</property>
+                  </object>
+                  <packing>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
+                <child>
                   <object class="GtkVBox" id="vbox_crystals">
                     <property name="visible">True</property>
                     <property name="border_width">6</property>
@@ -1651,7 +1672,7 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkCheckButton" id="checkbutton_Ux">
+                                  <object class="GtkCheckButton" id="checkbutton_ux">
                                     <property name="label" translatable="yes">Ux</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
@@ -1667,7 +1688,7 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkCheckButton" id="checkbutton_Uy">
+                                  <object class="GtkCheckButton" id="checkbutton_uy">
                                     <property name="label" translatable="yes">Uy</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
@@ -1683,7 +1704,7 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkCheckButton" id="checkbutton_Uz">
+                                  <object class="GtkCheckButton" id="checkbutton_uz">
                                     <property name="label" translatable="yes">Uz</property>
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
@@ -1991,30 +2012,9 @@
                   </packing>
                 </child>
                 <child type="tab">
-                  <object class="GtkLabel" id="label11">
-                    <property name="visible">True</property>
-                    <property name="label" translatable="yes">crystals</property>
-                  </object>
-                  <packing>
-                    <property name="tab_fill">False</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkVBox" id="vbox2">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <child>
-                      <placeholder/>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child type="tab">
                   <object class="GtkLabel" id="label10">
                     <property name="visible">True</property>
-                    <property name="label" translatable="yes">pseudo axes</property>
+                    <property name="label" translatable="yes">crystals</property>
                   </object>
                   <packing>
                     <property name="position">1</property>
@@ -2089,6 +2089,28 @@
                     <property name="tab_fill">False</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkVBox" id="vbox7">
+                    <property name="visible">True</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+                <child type="tab">
+                  <object class="GtkLabel" id="label15">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">3D</property>
+                  </object>
+                  <packing>
+                    <property name="position">3</property>
+                    <property name="tab_fill">False</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="resize">True</property>
diff --git a/gui/hkl-gui-3d.cpp b/gui/hkl-gui-3d.cpp
new file mode 100644
index 0000000..9d52d4e
--- /dev/null
+++ b/gui/hkl-gui-3d.cpp
@@ -0,0 +1,244 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *	    Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ */
+#include "hkl-gui-3d.h"
+
+Hkl3DFrame::Hkl3DFrame(const char *filename, HklGeometry *geometry)
+{
+	Gtk::CellRenderer * renderer;
+
+	//Get Glade UI:
+	_refGlade = Gtk::Builder::create();
+	try{
+		_refGlade->add_from_file("3d.ui");
+	}catch(...){
+		std::string filename = Glib::build_filename(PKGDATA, "3d.ui");
+		if(!_refGlade->add_from_file(filename))
+			exit(1);
+	}
+
+	// widgets
+	_refGlade->get_widget("frame1", _frame1);
+	_refGlade->get_widget("vbox1", _vbox1);
+	_refGlade->get_widget("treeview1", _treeview1);
+	_refGlade->get_widget("toolbutton1", _toolbutton1);
+	_refGlade->get_widget("toolbutton2", _toolbutton2);
+	_refGlade->get_widget("filechooserdialog1", _filechooserdialog1);
+	_refGlade->get_widget("button1", _button1);
+	_refGlade->get_widget("button2", _button2);
+
+	// objects
+	_treestore1 = Glib::RefPtr<Gtk::TreeStore>::cast_dynamic(
+		_refGlade->get_object("treestore1"));
+
+	if(filename && geometry){
+		Gtk::CellRenderer * renderer;
+
+		_hkl3d = hkl3d_new(filename, geometry);
+		_Scene = new Hkl3dGui::Scene(_hkl3d, false, false, false);
+
+		this->update_hkl3d_objects_TreeStore();
+		this->_vbox1->pack_start(*_Scene);
+		this->_vbox1->show_all();
+
+		// connect signals
+
+		renderer = _treeview1->get_column_cell_renderer(1); // 1 is the index of the value column
+		dynamic_cast<Gtk::CellRendererToggle *>(renderer)->signal_toggled().connect(
+			sigc::mem_fun(*this, &Hkl3DFrame::on_cell_treeview1_toggled));
+
+		_treeview1->signal_cursor_changed().connect(
+			sigc::mem_fun(*this, &Hkl3DFrame::on_treeview1_cursor_changed));
+
+		_toolbutton1->signal_clicked().connect(
+			sigc::mem_fun(*this, &Hkl3DFrame::on_toolbutton1_clicked));
+		_toolbutton2->signal_clicked().connect(
+			sigc::mem_fun(*this, &Hkl3DFrame::on_toolbutton2_clicked));
+		_button1->signal_clicked().connect(
+			sigc::mem_fun(*this, &Hkl3DFrame::on_button1_clicked));
+		_button2->signal_clicked().connect(
+			sigc::mem_fun(*this, &Hkl3DFrame::on_button2_clicked));
+	}
+}
+
+Hkl3DFrame::~Hkl3DFrame(void)
+{
+	if(_hkl3d)
+		delete _hkl3d;
+	if(_Scene)
+		delete _Scene;
+}
+
+void Hkl3DFrame::is_colliding(void)
+{
+	if(_hkl3d)
+		hkl3d_is_colliding(_hkl3d);
+}
+
+void Hkl3DFrame::invalidate(void)
+{
+	if(_Scene)
+		_Scene->invalidate();
+}
+
+void Hkl3DFrame::update_hkl3d_objects_TreeStore(void)
+{
+	size_t i;
+	size_t j;
+
+	if(!_hkl3d)
+		return;
+
+	_treestore1->clear();
+	for(i=0; i<_hkl3d->config->len; ++i){
+		Gtk::TreeRow row = *(_treestore1->append());
+		row[_hkl3d_objects_columns.name] = _hkl3d->config->models[i]->filename;
+		row[_hkl3d_objects_columns.model] = _hkl3d->config->models[i];
+		row[_hkl3d_objects_columns.object] = NULL;
+		for(j=0; j<_hkl3d->config->models[i]->len; ++j){
+			Gtk::TreeRow crow = *(_treestore1->append(row.children()));
+
+			crow[_hkl3d_objects_columns.name] = _hkl3d->config->models[i]->objects[j]->axis_name;
+			crow[_hkl3d_objects_columns.hide] = _hkl3d->config->models[i]->objects[j]->hide;
+			crow[_hkl3d_objects_columns.model] = _hkl3d->config->models[i] ;
+			crow[_hkl3d_objects_columns.object] = _hkl3d->config->models[i]->objects[j];
+		}
+	}
+}
+
+/************/
+/* Callback */
+/************/
+
+void Hkl3DFrame::on_cell_treeview1_toggled(Glib::ustring const & spath)
+{
+	bool hide;
+	Hkl3DModel *model;
+	Hkl3DObject *object;
+
+	Gtk::TreePath path(spath);
+	Gtk::TreeModel::iterator iter = _treestore1->get_iter(path);
+	Gtk::TreeStore::Row row = *(iter);
+
+	hide = !row[_hkl3d_objects_columns.hide];
+	object = row[_hkl3d_objects_columns.object];
+	if(object){
+		hkl3d_hide_object(_hkl3d, object, hide);
+		row[_hkl3d_objects_columns.hide] = hide;
+		this->is_colliding();
+		this->invalidate();
+	}else{
+		model = row[_hkl3d_objects_columns.model];
+		if(model){
+			size_t i = 0;
+
+			row[_hkl3d_objects_columns.hide] = hide;
+			/* set all the children rows */
+			iter = row.children().begin();
+			Gtk::TreeModel::iterator end = row.children().end();
+			while(iter != end){
+				row = *(iter++);
+				hkl3d_hide_object(_hkl3d, model->objects[i++], hide);
+				row[_hkl3d_objects_columns.hide] = hide;
+			}
+			//_hkl3d->save_config(_hkl3d->filename);
+			this->is_colliding();
+			this->invalidate();
+		}
+	}
+}
+
+void Hkl3DFrame::on_treeview1_cursor_changed(void)
+{
+	Hkl3DObject *object;
+	int i;
+	int j;
+
+	Gtk::TreeModel::Path path;
+	Gtk::TreeViewColumn * column;
+	_treeview1->get_cursor(path, column);
+	Gtk::TreeModel::iterator iter = _treestore1->get_iter(path);
+	Gtk::ListStore::Row row = *(iter);
+
+	/* need to unselect of objects of all 3d models */
+	for(i=0; i<_hkl3d->config->len; ++i)
+		for(j=0; j<_hkl3d->config->models[i]->len; ++j)
+			_hkl3d->config->models[i]->objects[j]->selected = false;
+
+	/* now select the right object */
+	object = row[_hkl3d_objects_columns.object];
+	if(object)
+		object->selected = true;
+
+	this->invalidate();
+}
+
+void Hkl3DFrame::on_toolbutton1_clicked(void)
+{
+	_filechooserdialog1->show();
+}
+
+/* remove a object from the model */
+void Hkl3DFrame::on_toolbutton2_clicked(void)
+{
+	Hkl3DObject *object;
+	int i;
+	int j;
+
+	Gtk::TreeModel::Path path;
+	Gtk::TreeViewColumn * column;
+	_treeview1->get_cursor(path, column);
+	Gtk::TreeModel::iterator iter = _treestore1->get_iter(path);
+	Gtk::ListStore::Row row = *(iter);
+
+	object = row[_hkl3d_objects_columns.object];
+	if(object){
+		hkl3d_remove_object(_hkl3d, object);
+		this->update_hkl3d_objects_TreeStore();
+		this->invalidate();
+	}
+}
+
+void Hkl3DFrame::on_button1_clicked(void)
+{
+	size_t i;
+	std::string directory;
+
+	Glib::SListHandle<Glib::ustring> const & filenames = _filechooserdialog1->get_filenames();
+	directory = _filechooserdialog1->get_current_folder();
+	Glib::SListHandle<Glib::ustring>::const_iterator iter = filenames.begin();
+	Glib::SListHandle<Glib::ustring>::const_iterator const & end = filenames.end();
+	while(iter != end){
+		hkl3d_add_model_from_file(_hkl3d, (*iter).c_str(), directory.c_str());
+		hkl3d_connect_all_axes(_hkl3d);
+		++iter;
+	}
+
+	this->update_hkl3d_objects_TreeStore();
+	//_hkl3d->save_config(_hkl3d->filename);
+	_filechooserdialog1->hide();
+}
+
+void Hkl3DFrame::on_button2_clicked(void)
+{
+	_filechooserdialog1->hide();
+}
diff --git a/gui/hkl-gui-3d.h b/gui/hkl-gui-3d.h
new file mode 100644
index 0000000..f14fbb5
--- /dev/null
+++ b/gui/hkl-gui-3d.h
@@ -0,0 +1,91 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#ifndef __HKL_GUI_3D_H__
+#define __HKL_GUI_3D_H__
+
+#include <gtkmm.h>
+
+#include "hkl3d.h"
+#include "hkl3d-gui-scene.h"
+
+class Hkl3DObjectsModelColumns : public Gtk::TreeModel::ColumnRecord
+{
+public:
+	Gtk::TreeModelColumn<Glib::ustring> name;
+	Gtk::TreeModelColumn<bool> hide;
+	Gtk::TreeModelColumn<Hkl3DModel *> model;
+	Gtk::TreeModelColumn<Hkl3DObject *> object;
+
+	Hkl3DObjectsModelColumns()
+		{
+			this->add(name);
+			this->add(hide);
+			this->add(model);
+			this->add(object);
+		}
+};
+
+class Hkl3DFrame
+{
+public:
+	Hkl3DFrame(const char *filename, HklGeometry *geometry);
+	virtual ~Hkl3DFrame(void);
+
+	Gtk::Frame &frame(void) {return *_frame1;}
+	void is_colliding(void);
+	void invalidate(void);
+
+// callback
+protected:
+	void on_cell_treeview1_toggled(Glib::ustring const & path);
+	void on_treeview1_cursor_changed(void);
+	void on_toolbutton1_clicked(void);
+	void on_toolbutton2_clicked(void);
+	void on_button1_clicked(void);
+	void on_button2_clicked(void);
+
+// non callback
+protected:
+	void update_hkl3d_objects_TreeStore(void);
+
+// members
+protected:
+	Hkl3D *_hkl3d;
+	Hkl3dGui::Scene *_Scene;
+
+	/* widgets */
+	Gtk::Frame *_frame1;
+	Gtk::VBox *_vbox1;
+	Gtk::TreeView *_treeview1;
+	Gtk::ToolButton *_toolbutton1;
+	Gtk::ToolButton *_toolbutton2;
+	Gtk::FileChooserDialog *_filechooserdialog1;
+	Gtk::Button *_button1;
+	Gtk::Button *_button2;
+
+	/* objects */
+	Glib::RefPtr<Gtk::TreeStore> _treestore1; /* use to fill the hkl3d objects properties */
+	Hkl3DObjectsModelColumns _hkl3d_objects_columns;
+	Glib::RefPtr<Gtk::Builder> _refGlade;
+};
+
+#endif // __HKL_GUI_3D_H__
diff --git a/gui/ghkl-callbacks.cpp b/gui/hkl-gui-callbacks.cpp
similarity index 59%
rename from gui/ghkl-callbacks.cpp
rename to gui/hkl-gui-callbacks.cpp
index 04f712f..a6ecde5 100644
--- a/gui/ghkl-callbacks.cpp
+++ b/gui/hkl-gui-callbacks.cpp
@@ -13,14 +13,15 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
 
-#include "ghkl.h"
+#include "hkl-gui.h"
+#include "hkl.h"
 
 void HKLWindow::on_treeView_pseudoAxes_cursor_changed(void)
 {
@@ -30,8 +31,8 @@ void HKLWindow::on_treeView_pseudoAxes_cursor_changed(void)
 	Gtk::TreeViewColumn * column;
 	_TreeView_pseudoAxes->get_cursor(path, column);
 	Gtk::ListStore::Row row = *(_pseudoAxeModel->get_iter(path));
-	HklPseudoAxis *pseudoAxis = row[_pseudoAxeModelColumns.pseudoAxis];
-	_TreeView_pseudoAxes_parameters->set_model(_mapPseudoAxeParameterModel[pseudoAxis]);
+	HklParameter *parameter = row[_pseudoAxeModelColumns.parameter];
+	_TreeView_pseudoAxes_parameters->set_model(_mapPseudoAxeParameterModel[parameter]);
 }
 
 void HKLWindow::on_treeViewCrystals_cursor_changed(void)
@@ -45,8 +46,8 @@ void HKLWindow::on_treeViewCrystals_cursor_changed(void)
 	Gtk::ListStore::Row row = *(iter);
 
 	Glib::ustring name = row[_crystalModelColumns.name];
-	hkl_sample_list_select_current(_samples, name.c_str());
-	hkl_pseudo_axis_engine_list_init(_engines, _geometry, _detector, _samples->current);
+	_sample = _samples[name];
+	hkl_engine_list_init(_engines, _geometry, _detector, _sample);
 	_treeViewReflections->set_model(_mapReflectionModel[name]);
 	this->updateLattice();
 	this->updateLatticeParameters();
@@ -170,7 +171,8 @@ void HKLWindow::on_spinbutton_lambda_value_changed(void)
 	LOG;
 
 	if(_geometry){
-		_geometry->source.wave_length = _spinbutton_lambda->get_value();
+		hkl_geometry_wavelength_set(this->_geometry,
+					    _spinbutton_lambda->get_value());
 		this->updatePseudoAxes();
 		this->updatePseudoAxesFrames();
 	}
@@ -186,44 +188,72 @@ void HKLWindow::on_button2_clicked(void)
 {
 	LOG;
 
-	HklSample *sample;
-
-	sample = _samples->current;
-	if(sample){
-		hkl_sample_set_lattice(sample,
-				       _spinbutton_a->get_value(),
-				       _spinbutton_b->get_value(),
-				       _spinbutton_c->get_value(),
-				       _spinbutton_alpha->get_value() * HKL_DEGTORAD,
-				       _spinbutton_beta->get_value() * HKL_DEGTORAD,
-				       _spinbutton_gamma->get_value() * HKL_DEGTORAD);
-
-		hkl_sample_set_U_from_euler(sample,
-					    _spinbutton_ux->get_value() * HKL_DEGTORAD,
-					    _spinbutton_uy->get_value() * HKL_DEGTORAD,
-					    _spinbutton_uz->get_value() * HKL_DEGTORAD);
-
-		// set min/max
-		hkl_parameter_set_range_unit(sample->lattice->a,
-					     _spinbutton_a_min->get_value(),
-					     _spinbutton_a_max->get_value());
-		hkl_parameter_set_range_unit(sample->lattice->b,
-					     _spinbutton_b_min->get_value(),
-					     _spinbutton_b_max->get_value());
-		hkl_parameter_set_range_unit(sample->lattice->c,
-					     _spinbutton_c_min->get_value(),
-					     _spinbutton_c_max->get_value());
-		hkl_parameter_set_range_unit(sample->lattice->alpha,
-					     _spinbutton_alpha_min->get_value(),
-					     _spinbutton_alpha_max->get_value());
-		hkl_parameter_set_range_unit(sample->lattice->beta,
-					     _spinbutton_beta_min->get_value(),
-					     _spinbutton_beta_max->get_value());
-		hkl_parameter_set_range_unit(sample->lattice->gamma,
-					     _spinbutton_gamma_min->get_value(),
-					     _spinbutton_gamma_max->get_value());
-
-		this->updateCrystalModel(sample);
+	if(_sample){
+		HklMatrix *U;
+		HklParameter *parameter;
+		HklLattice *lattice;
+
+		lattice = hkl_lattice_new(_spinbutton_a->get_value(),
+					  _spinbutton_b->get_value(),
+					  _spinbutton_c->get_value(),
+					  _spinbutton_alpha->get_value() * HKL_DEGTORAD,
+					  _spinbutton_beta->get_value() * HKL_DEGTORAD,
+					  _spinbutton_gamma->get_value() * HKL_DEGTORAD);
+
+		/* set min/max a */
+		parameter = hkl_parameter_new_copy(hkl_lattice_a_get(lattice));
+		hkl_parameter_min_max_unit_set(parameter,
+					       _spinbutton_a_min->get_value(),
+					       _spinbutton_a_max->get_value());
+		hkl_lattice_a_set(lattice, parameter);
+		hkl_parameter_free(parameter);
+
+		/* set min/max b */
+		parameter = hkl_parameter_new_copy(hkl_lattice_b_get(lattice));
+		hkl_parameter_min_max_unit_set(parameter,
+					       _spinbutton_b_min->get_value(),
+					       _spinbutton_b_max->get_value());
+		hkl_lattice_b_set(lattice, parameter);
+		hkl_parameter_free(parameter);
+
+		parameter = hkl_parameter_new_copy(hkl_lattice_c_get(lattice));
+		hkl_parameter_min_max_unit_set(parameter,
+					       _spinbutton_c_min->get_value(),
+					       _spinbutton_c_max->get_value());
+		hkl_lattice_c_set(lattice, parameter);
+		hkl_parameter_free(parameter);
+
+		parameter = hkl_parameter_new_copy(hkl_lattice_alpha_get(lattice));
+		hkl_parameter_min_max_unit_set(parameter,
+					       _spinbutton_alpha_min->get_value(),
+					       _spinbutton_alpha_max->get_value());
+		hkl_lattice_alpha_set(lattice, parameter);
+		hkl_parameter_free(parameter);
+
+		parameter = hkl_parameter_new_copy(hkl_lattice_beta_get(lattice));
+		hkl_parameter_min_max_unit_set(parameter,
+					       _spinbutton_beta_min->get_value(),
+					       _spinbutton_beta_max->get_value());
+		hkl_lattice_beta_set(lattice, parameter);
+		hkl_parameter_free(parameter);
+
+		parameter = hkl_parameter_new_copy(hkl_lattice_gamma_get(lattice));
+		hkl_parameter_min_max_unit_set(parameter,
+					       _spinbutton_gamma_min->get_value(),
+					       _spinbutton_gamma_max->get_value());
+		hkl_lattice_gamma_set(lattice, parameter);
+		hkl_parameter_free(parameter);
+
+
+		hkl_sample_lattice_set(_sample, lattice);
+		U = hkl_matrix_new_euler(_spinbutton_ux->get_value() * HKL_DEGTORAD,
+					 _spinbutton_uy->get_value() * HKL_DEGTORAD,
+					 _spinbutton_uz->get_value() * HKL_DEGTORAD);
+		hkl_sample_U_set(_sample, U);
+		hkl_matrix_free(U);
+		hkl_lattice_free(lattice);
+
+		this->updateCrystalModel(_sample);
 		this->updateReciprocalLattice();
 		this->updateUB();
 		this->updatePseudoAxes();
@@ -231,86 +261,43 @@ void HKLWindow::on_button2_clicked(void)
 	}
 }
 
-void HKLWindow::on_checkbutton_a_toggled(void)
-{
-	LOG;
-
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->lattice->a->fit = _checkbutton_a->get_active();
-}
-
-void HKLWindow::on_checkbutton_b_toggled(void)
-{
-	LOG;
-
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->lattice->b->fit = _checkbutton_b->get_active();
-}
-
-void HKLWindow::on_checkbutton_c_toggled(void)
-{
-	LOG;
-
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->lattice->c->fit = _checkbutton_c->get_active();
-}
-
-void HKLWindow::on_checkbutton_alpha_toggled(void)
-{
-	LOG;
-
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->lattice->alpha->fit = _checkbutton_alpha->get_active();
-}
-
-void HKLWindow::on_checkbutton_beta_toggled(void)
-{
-	LOG;
-
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->lattice->beta->fit = _checkbutton_beta->get_active();
-}
-
-void HKLWindow::on_checkbutton_gamma_toggled(void)
-{
-	LOG;
-
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->lattice->gamma->fit = _checkbutton_gamma->get_active();
-}
-
-void HKLWindow::on_checkbutton_Ux_toggled(void)
-{
-	LOG;
-
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->ux->fit = _checkbutton_Ux->get_active();
-}
-
-void HKLWindow::on_checkbutton_Uy_toggled(void)
-{
-	LOG;
-
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->uy->fit = _checkbutton_Uy->get_active();
-}
+#define ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(p, sample)		\
+	void HKLWindow::on_checkbutton_##p##_toggled(void)		\
+	{								\
+		LOG;							\
+		if(_sample){						\
+			HklLattice *lattice = hkl_lattice_new_copy(hkl_sample_lattice_get((sample))); \
+			HklParameter *parameter = hkl_parameter_new_copy(hkl_lattice_##p##_get(lattice)); \
+			hkl_parameter_fit_set(parameter, _checkbutton_##p->get_active()); \
+			hkl_lattice_##p##_set(lattice, parameter);	\
+			hkl_sample_lattice_set((sample), lattice);	\
+			hkl_parameter_free(parameter);			\
+			hkl_lattice_free(lattice);			\
+		}							\
+	}
 
-void HKLWindow::on_checkbutton_Uz_toggled(void)
-{
-	LOG;
+ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(a, _sample);
+ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(b, _sample);
+ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(c, _sample);
+ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(alpha, _sample);
+ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(beta, _sample);
+ON_CHECKBUTTON_LATTICE_PARAMETER_TOGGLE(gamma, _sample);
+
+#define ON_CHECKBUTTON_UXUYUZ_TOGGLED(p, sample)			\
+	void HKLWindow::on_checkbutton_##p##_toggled(void)			\
+	{								\
+		LOG;							\
+		if(_sample){						\
+			HklParameter *parameter = hkl_parameter_new_copy(hkl_sample_##p##_get((sample))); \
+			hkl_parameter_fit_set(parameter, _checkbutton_##p->get_active()); \
+			hkl_sample_##p##_set(sample, parameter);	\
+			hkl_parameter_free(parameter);			\
+		}							\
+	}
 
-	HklSample *sample = _samples->current;
-	if(sample)
-		sample->uz->fit = _checkbutton_Uz->get_active();
-}
+ON_CHECKBUTTON_UXUYUZ_TOGGLED(ux, _sample)
+ON_CHECKBUTTON_UXUYUZ_TOGGLED(uy, _sample)
+ON_CHECKBUTTON_UXUYUZ_TOGGLED(uz, _sample)
 
 void HKLWindow::on_cell_TreeView_axes_read_edited(Glib::ustring const & spath,
 						  Glib::ustring const & newText)
@@ -321,17 +308,23 @@ void HKLWindow::on_cell_TreeView_axes_read_edited(Glib::ustring const & spath,
 	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_axes->get_model();
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
-
-	Glib::ustring name = row[_axeModelColumns.name];
+	HklParameter *axis = row[_axeModelColumns.axis];
 	double value;
+
 	sscanf(newText.c_str(), "%lf", &value);
-	HklAxis *axis = hkl_geometry_get_axis_by_name(_geometry, name.c_str());
-	hkl_axis_set_value_unit(axis, value);
-	hkl_geometry_update(_geometry);
+	hkl_parameter_value_unit_set(axis, value, NULL);
+	hkl_geometry_axis_set(this->_geometry, axis);
 
 	row[_axeModelColumns.read] = value;
 	this->updatePseudoAxes();
 	this->updatePseudoAxesFrames();
+
+#ifdef HKL3D
+	if(_Scene){
+		_Scene->is_colliding();
+		_Scene->invalidate();
+	}
+#endif
 }
 
 void HKLWindow::on_cell_TreeView_axes_write_edited(Glib::ustring const & spath,
@@ -344,16 +337,22 @@ void HKLWindow::on_cell_TreeView_axes_write_edited(Glib::ustring const & spath,
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
 
-	Glib::ustring name = row[_axeModelColumns.name];
+	HklParameter *axis = row[_axeModelColumns.axis];
 	double value;
 	sscanf(newText.c_str(), "%lf", &value);
-	HklAxis *axis = hkl_geometry_get_axis_by_name(_geometry, name.c_str());
-	hkl_axis_set_value_unit(axis, value);
-	hkl_geometry_update(_geometry);
+	hkl_parameter_value_unit_set(axis, value, NULL);
+	hkl_geometry_axis_set(this->_geometry, axis);
 
 	row[_axeModelColumns.write] = value;
 	this->updatePseudoAxes();
 	this->updatePseudoAxesFrames();
+
+#ifdef HKL3D
+	if(_Scene){
+		_Scene->is_colliding();
+		_Scene->invalidate();
+	}
+#endif
 }
 
 void HKLWindow::on_cell_TreeView_axes_min_edited(Glib::ustring const & spath,
@@ -365,18 +364,17 @@ void HKLWindow::on_cell_TreeView_axes_min_edited(Glib::ustring const & spath,
 	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_axes->get_model();
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
+	HklParameter *axis = row[_axeModelColumns.axis];
 
 	double shit;
 	double max;
 	double value;
-	HklAxis *axis;
 
-	Glib::ustring name = row[_axeModelColumns.name];
 	sscanf(newText.c_str(), "%lf", &value);
 
-	axis = hkl_geometry_get_axis_by_name(_geometry, name.c_str());
-	hkl_parameter_get_range_unit((HklParameter *)axis, &shit, &max);
-	hkl_parameter_set_range_unit((HklParameter *)axis, value, max);
+	hkl_parameter_min_max_unit_get(axis, &shit, &max);
+	hkl_parameter_min_max_unit_set(axis, value, max);
+	hkl_geometry_axis_set(this->_geometry, axis);
 
 	row[_axeModelColumns.min] = value;
 	this->updatePseudoAxes();
@@ -391,17 +389,16 @@ void HKLWindow::on_cell_TreeView_axes_max_edited(Glib::ustring const & spath,
 	Glib::RefPtr<Gtk::TreeModel> listStore = _TreeView_axes->get_model();
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
+	HklParameter *axis = row[_axeModelColumns.axis];
 
 	double min, shit;
 	double value;
-	HklAxis *axis;
 
-	Glib::ustring name = row[_axeModelColumns.name];
 	sscanf(newText.c_str(), "%lf", &value);
 
-	axis = hkl_geometry_get_axis_by_name(_geometry, name.c_str());
-	hkl_parameter_get_range_unit((HklParameter *)axis, &min, &shit);
-	hkl_parameter_set_range_unit((HklParameter *)axis, min, value);
+	hkl_parameter_min_max_unit_get(axis, &min, &shit);
+	hkl_parameter_min_max_unit_set(axis, min, value);
+	hkl_geometry_axis_set(this->_geometry, axis);
 
 	row[_axeModelColumns.max] = value;
 	this->updatePseudoAxes();
@@ -414,8 +411,8 @@ void HKLWindow::on_cell_TreeView_pseudoAxes_write_edited(Glib::ustring const & s
 	LOG;
 
 	double value;
-	HklPseudoAxis *pseudoAxis;
-	HklError *error;
+	HklParameter *parameter;
+	HklEngine *engine;
 	int res;
 
 	Gtk::TreePath path(spath);
@@ -423,43 +420,30 @@ void HKLWindow::on_cell_TreeView_pseudoAxes_write_edited(Glib::ustring const & s
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
 
-	pseudoAxis = row[_pseudoAxeModelColumns.pseudoAxis];
-	Glib::ustring name = row[_pseudoAxeModelColumns.name];
+	parameter = row[_pseudoAxeModelColumns.parameter];
+	engine = row[_pseudoAxeModelColumns.engine];
 	sscanf(newText.c_str(), "%lf", &value);
 
-	hkl_parameter_set_value_unit((HklParameter *)pseudoAxis, value);
-	error = NULL;
-	if(hkl_pseudo_axis_engine_set(pseudoAxis->engine, &error) == HKL_SUCCESS){
-		hkl_geometry_init_geometry(_geometry,
-					   _engines->geometries->items[0]->geometry);
-		hkl_pseudo_axis_engine_list_get(_engines);
-		row[_pseudoAxeModelColumns.write] = value;
-		this->updateAxes();
-		this->updatePseudoAxes();
-		this->updatePseudoAxesFrames();
-		this->updateSolutions();
-	}
-}
-
-void HKLWindow::on_cell_TreeView_pseudoAxes_is_initialized_toggled(Glib::ustring const & spath)
-{
-	LOG;
-
-	Gtk::TreePath path(spath);
-	Gtk::TreeModel::iterator iter = _pseudoAxeModel->get_iter(path);
-	Gtk::ListStore::Row row = *(iter);
-	HklPseudoAxis *pseudoAxis = row[_pseudoAxeModelColumns.pseudoAxis];
-	bool old_flag = row[_pseudoAxeModelColumns.is_initialized];
-	if (!old_flag){
-		int res;
+	if(hkl_parameter_value_unit_set(parameter, value, NULL))
+		if(hkl_engine_set(engine, NULL)){
+			hkl_engine_list_select_solution(this->_engines, 0);
 
-		res = hkl_pseudo_axis_engine_initialize(pseudoAxis->engine, NULL);
-		if(res == HKL_SUCCESS)
+			row[_pseudoAxeModelColumns.write] = value;
+			this->updateAxes();
 			this->updatePseudoAxes();
-	}
+			this->updatePseudoAxesFrames();
+			this->updateSolutions();
+
+#ifdef HKL3D
+			if(_Scene){
+				_Scene->is_colliding();
+				_Scene->invalidate();
+			}
+#endif
+		}
 }
 
-//PseuodAxes Parameters
+//PseudoAxes Parameters
 void HKLWindow::on_cell_TreeView_pseudoAxes_parameters_value_edited(Glib::ustring const & spath,
 								    Glib::ustring const & newText)
 {
@@ -474,27 +458,32 @@ void HKLWindow::on_cell_TreeView_pseudoAxes_parameters_value_edited(Glib::ustrin
 	sscanf(newText.c_str(), "%lf", &value);
 
 	parameter = row[_parameterModelColumns.parameter];
-	hkl_parameter_set_value_unit(parameter, value);
+	/* TODO error check */
+	hkl_parameter_value_unit_set(parameter, value, NULL);
 
 	row[_parameterModelColumns.value] = value;
 	this->updatePseudoAxes();
 	this->update_pseudoAxes_parameters();
 }
+
 void HKLWindow::on_cell_TreeView_crystals_name_edited(Glib::ustring const & spath,
 						      Glib::ustring const & newText)
 {
 	LOG;
 
-	HklSample *sample;
-
 	Gtk::TreePath path(spath);
 	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewCrystals->get_model();
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
 	Glib::ustring name = row[_crystalModelColumns.name];
-	sample = hkl_sample_list_get_by_name(_samples, name.c_str());
-	if(sample){
-		hkl_sample_set_name(sample, newText.c_str());
+	std::map<std::string, HklSample *>::iterator it = _samples.find(name);
+	if (it != _samples.end()){
+		HklSample *sample = it->second;
+
+		hkl_sample_name_set(sample, newText.c_str());
+		_samples.erase(it);
+		_samples.insert(std::pair<std::string, HklSample *>(hkl_sample_name_get(sample),
+								    sample));
 
 		this-> updateTreeViewCrystals();
 	}
@@ -505,33 +494,27 @@ void HKLWindow::on_cell_TreeView_reflections_h_edited(Glib::ustring const & spat
 {
 	LOG;
 
-	HklSample *sample;
-
 	Gtk::TreePath path(spath);
 	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewReflections->get_model();
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
 
-	sample = _samples->current;
-	if(sample){
-		int index;
+	if(_sample){
 		double h;
 		double k;
 		double l;
 		HklSampleReflection *reflection;
 
-		index = row[_reflectionModelColumns.index];
-		reflection = sample->reflections[index];
+		reflection = row[_reflectionModelColumns.reflection];
 
+		hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
 		sscanf(newText.c_str(), "%lf", &h);
-		k = reflection->hkl.data[1];
-		l = reflection->hkl.data[2];
+		hkl_sample_reflection_hkl_set(reflection, h, k, l);
+		row[_reflectionModelColumns.h] = h;
 
-		hkl_sample_reflection_set_hkl(reflection, h, k, l);
+		row[_reflectionModelColumns.flag] = hkl_sample_reflection_flag_get(reflection);
 
-		row[_reflectionModelColumns.h] = h;
-		row[_reflectionModelColumns.flag] = reflection->flag;
-		this->updateCrystalModel(sample);
+		this->updateCrystalModel(_sample);
 	}
 }
 
@@ -540,33 +523,27 @@ void HKLWindow::on_cell_TreeView_reflections_k_edited(Glib::ustring const & spat
 {
 	LOG;
 
-	HklSample *sample;
-
 	Gtk::TreePath path(spath);
 	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewReflections->get_model();
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
 
-	sample = _samples->current;
-	if(sample){
-		int index;
+	if(_sample){
 		double h;
 		double k;
 		double l;
 		HklSampleReflection *reflection;
 
 
-		index = row[_reflectionModelColumns.index];
-		reflection = sample->reflections[index];
+		reflection = row[_reflectionModelColumns.reflection];
 
-		h = reflection->hkl.data[0];
+		hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
 		sscanf(newText.c_str(), "%lf", &k);
-		l = reflection->hkl.data[2];
-
-		hkl_sample_reflection_set_hkl(reflection, h, k, l);
+		hkl_sample_reflection_hkl_set(reflection, h, k, l);
 		row[_reflectionModelColumns.k] = k;
-		row[_reflectionModelColumns.flag] = reflection->flag;
-		this->updateCrystalModel(sample);
+
+		row[_reflectionModelColumns.flag] = hkl_sample_reflection_flag_get(reflection);
+		this->updateCrystalModel(_sample);
 	}
 }
 
@@ -575,31 +552,27 @@ void HKLWindow::on_cell_TreeView_reflections_l_edited(Glib::ustring const & spat
 {
 	LOG;
 
-	HklSample *sample;
-
 	Gtk::TreePath path(spath);
 	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewReflections->get_model();
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
 
-	sample = _samples->current;
-	if(sample){
-		int index;
+	if(_sample){
 		double h;
 		double k;
 		double l;
 		HklSampleReflection *reflection;
 
-		index = row[_reflectionModelColumns.index];
-		reflection = sample->reflections[index];
+		reflection = row[_reflectionModelColumns.reflection];
 
-		h = reflection->hkl.data[0];
-		k = reflection->hkl.data[1];
+		hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
 		sscanf(newText.c_str(), "%lf", &l);
-		hkl_sample_reflection_set_hkl(reflection, h, k, l);
+		hkl_sample_reflection_hkl_set(reflection, h, k, l);
 		row[_reflectionModelColumns.l] = l;
-		row[_reflectionModelColumns.flag] = reflection->flag;
-		this->updateCrystalModel(sample);
+
+		row[_reflectionModelColumns.flag] = hkl_sample_reflection_flag_get(reflection);
+
+		this->updateCrystalModel(_sample);
 	}
 }
 
@@ -607,23 +580,18 @@ void HKLWindow::on_cell_TreeView_reflections_flag_toggled(Glib::ustring const &
 {
 	LOG;
 
-	HklSample *sample;
-
 	Gtk::TreePath path(spath);
 	Glib::RefPtr<Gtk::TreeModel> listStore = _treeViewReflections->get_model();
 	Gtk::TreeModel::iterator iter = listStore->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
 
-	sample = _samples->current;
-	if(sample){
-		int index;
+	if(_sample){
 		int flag;
 		HklSampleReflection *reflection;
 
-		index = row[_reflectionModelColumns.index];
-		reflection = sample->reflections[index];
-		flag = !reflection->flag;
-		hkl_sample_reflection_set_flag(reflection, flag);
+		reflection = row[_reflectionModelColumns.reflection];
+		flag = !hkl_sample_reflection_flag_get(reflection);
+		hkl_sample_reflection_flag_set(reflection, flag);
 		row[_reflectionModelColumns.flag] = flag;
 	}
 }
@@ -632,17 +600,17 @@ void HKLWindow::on_toolbutton_add_reflection_clicked(void)
 {
 	LOG;
 
-	HklSample *sample;
-
-	sample=_samples->current;
-	if(sample){
-		double h;
-		double k;
-		double l;
+	if(_sample){
+		HklSampleReflection *reflection;
+		double h = 0;
+		double k = 0;
+		double l = 0;
 
-		hkl_sample_add_reflection(sample, _geometry, _detector, h, k, l);
+		reflection = hkl_sample_reflection_new(_geometry, _detector, h, k, l);
+		hkl_sample_add_reflection(_sample, reflection);
 
-		this->updateReflections(sample, _mapReflectionModel[sample->name]);
+		this->updateReflections(_sample,
+					_mapReflectionModel[hkl_sample_name_get(_sample)]);
 	}
 }
 
@@ -650,25 +618,28 @@ void HKLWindow::on_toolbutton_goto_reflection_clicked(void)
 {
 	LOG;
 
-	HklSample *sample;
-
-	sample = _samples->current;
-	if(sample){
+	if(_sample){
 		Glib::RefPtr<Gtk::TreeSelection> selection = _treeViewReflections->get_selection();
 		unsigned int nb_rows = selection->count_selected_rows();
 		if (nb_rows == 1){
 			Gtk::TreeSelection::ListHandle_Path list_path = selection->get_selected_rows();
 			Gtk::TreePath path = *(list_path.begin());
-			Glib::RefPtr<Gtk::ListStore> liststore = _mapReflectionModel[sample->name];
+			Glib::RefPtr<Gtk::ListStore> liststore = _mapReflectionModel[hkl_sample_name_get(_sample)];
 			Gtk::ListStore::Row row = *(liststore->get_iter(path));
-			unsigned int index = row[_reflectionModelColumns.index];
+			HklSampleReflection *reflection = row[_reflectionModelColumns.reflection];
 
-			hkl_geometry_init_geometry(_geometry,
-						   sample->reflections[index]->geometry);
+			hkl_geometry_set(this->_geometry,
+					 hkl_sample_reflection_geometry_get(reflection));
 
 			this->updateSource();
 			this->updateAxes();
 			this->updatePseudoAxes();
+#ifdef HKL3D
+			if(_Scene){
+				_Scene->is_colliding();
+				_Scene->invalidate();
+			}
+#endif
 		}else{
 			if (nb_rows)
 				_statusBar->push("Please select only one reflection.");
@@ -682,43 +653,46 @@ void HKLWindow::on_toolbutton_del_reflection_clicked(void)
 {
 	LOG;
 
-	HklSample * sample;
-
-	sample = _samples->current;
-	if(sample){
+	if(_sample){
 		Glib::RefPtr<Gtk::TreeSelection> selection = _treeViewReflections->get_selection();
 		unsigned int nb_rows = selection->count_selected_rows();
 		if (nb_rows){
 			Gtk::TreeSelection::ListHandle_Path list = selection->get_selected_rows();
 			Gtk::TreeSelection::ListHandle_Path::iterator iter = list.begin();
 			Gtk::TreeSelection::ListHandle_Path::iterator last = list.end();
-			Glib::RefPtr<Gtk::ListStore> liststore = _mapReflectionModel[sample->name];
+			Glib::RefPtr<Gtk::ListStore> liststore = _mapReflectionModel[hkl_sample_name_get(_sample)];
 			// fill indexes with the reflections index
-			std::vector<unsigned int> indexes;
+			std::vector<HklSampleReflection *> to_delete;
 			while(iter != last){
 				Gtk::ListStore::Row row = *(liststore->get_iter(*iter));
-				indexes.push_back(row[_reflectionModelColumns.index]);
+				to_delete.push_back(row[_reflectionModelColumns.reflection]);
 				++iter;
 			}
 			std::ostringstream os;
 			os << "Are you sure you want to delete reflections :";
-			for(unsigned int i=0; i< indexes.size();i++)
-				os << " " << indexes[i];
+			for(unsigned int i=0; i< to_delete.size();i++){
+				double h, k, l;
+
+				hkl_sample_reflection_hkl_get(to_delete[i], &h, &k, &l);
+				os << " "
+				   << " h: " << h
+				   << " k: " << k
+				   << " l: " << l;
+			}
 
 			_message = new Gtk::MessageDialog("", false,
-							   Gtk::MESSAGE_WARNING,
-							   Gtk::BUTTONS_YES_NO);
+							  Gtk::MESSAGE_WARNING,
+							  Gtk::BUTTONS_YES_NO);
 			_message->set_message(os.str());
 			_message->show();
 			int respons = _message->run();
 			switch (respons){
 			case Gtk::RESPONSE_YES:
-				for(unsigned int i=0;i<indexes.size();i++){
-					// compute the correct index of the reflection
-					unsigned int index = indexes[i] - i;
-					hkl_sample_del_reflection(sample, index);
+				for(unsigned int i=0;i<to_delete.size();i++){
+					hkl_sample_del_reflection(_sample,
+								  to_delete[i]);
 				}
-				this->updateReflections(sample, liststore);
+				this->updateReflections(_sample, liststore);
 				break;
 			}
 			delete _message;
@@ -730,27 +704,25 @@ void HKLWindow::on_toolbutton_setUB_clicked(void)
 {
 	LOG;
 
-	HklSample *sample = _samples->current;
-	if(sample){
-		HklMatrix UB;
+	if(_sample){
+		HklMatrix *UB = hkl_matrix_new_full(
+			_spinbutton_U11->get_value(),
+			_spinbutton_U12->get_value(),
+			_spinbutton_U13->get_value(),
+			_spinbutton_U21->get_value(),
+			_spinbutton_U22->get_value(),
+			_spinbutton_U23->get_value(),
+			_spinbutton_U31->get_value(),
+			_spinbutton_U32->get_value(),
+			_spinbutton_U33->get_value());
 
-		UB.data[0][0] = _spinbutton_U11->get_value();
-		UB.data[0][1] = _spinbutton_U12->get_value();
-		UB.data[0][2] = _spinbutton_U13->get_value();
-		UB.data[1][0] = _spinbutton_U21->get_value();
-		UB.data[1][1] = _spinbutton_U22->get_value();
-		UB.data[1][2] = _spinbutton_U23->get_value();
-		UB.data[2][0] = _spinbutton_U31->get_value();
-		UB.data[2][1] = _spinbutton_U32->get_value();
-		UB.data[2][2] = _spinbutton_U33->get_value();
-
-		hkl_sample_set_UB(sample, &UB);
-		hkl_sample_fprintf(stdout, sample);
+		hkl_sample_UB_set(_sample, UB);
+		hkl_matrix_free(UB);
 
 		this->updateLattice();
 		this->updateLatticeParameters();
 		this->updateReciprocalLattice();
-		this->updateCrystalModel(_samples->current);
+		this->updateCrystalModel(_sample);
 		this->updateUB();
 		this->updateUxUyUz();
 		this->updatePseudoAxes();
@@ -762,9 +734,11 @@ void HKLWindow::on_toolbutton_computeUB_clicked(void)
 {
 	LOG;
 
-	HklSample *sample = _samples->current;
-	if(sample){
-		hkl_sample_compute_UB_busing_levy(sample, 0, 1);
+	if(_sample){
+		const HklSampleReflection *r1 = hkl_sample_first_reflection_get(_sample);
+		const HklSampleReflection *r2 = hkl_sample_next_reflection_get(_sample, r1);
+
+		hkl_sample_compute_UB_busing_levy(_sample, r1, r2);
 		this->updateUB();
 		this->updateUxUyUz();
 		this->updatePseudoAxes();
@@ -776,10 +750,10 @@ void HKLWindow::on_toolbutton_add_crystal_clicked(void)
 {
 	LOG;
 
-	HklSample *sample = hkl_sample_new("new_sample", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	if(sample){
-		hkl_sample_list_append(_samples, sample);
-		hkl_sample_list_select_current(_samples, "new_sample");
+	_sample = hkl_sample_new("new_sample");
+	if(_sample){
+		_samples.insert(std::pair<std::string, HklSample *>(hkl_sample_name_get(_sample),
+								    _sample));
 		this->updateTreeViewCrystals();
 
 		// activate for edition the name of the new crystal
@@ -797,17 +771,18 @@ void HKLWindow::on_toolbutton_copy_crystal_clicked(void)
 
 	Glib::ustring name;
 	Glib::ustring newname;
-	HklSample *old_sample = _samples->current;
+	HklSample *old_sample = _sample;
 	HklSample *sample;
 	if(!old_sample){
 		_statusBar->push("Please select a crystal to copy.");
 		return;
 	}
 
-	sample = hkl_sample_new_copy(_samples->current);
-	hkl_sample_set_name(sample, "copy");
-	hkl_sample_list_append(_samples, sample);
-	hkl_sample_list_select_current(_samples, "copy");
+	sample = hkl_sample_new_copy(_sample);
+	hkl_sample_name_set(sample, "copy");
+	_samples.insert(std::pair<std::string, HklSample *>(hkl_sample_name_get(sample),
+							    sample));
+	_sample = sample;
 	this->updateTreeViewCrystals();
 
 	// activate for edition the name of the new crystal
@@ -822,10 +797,8 @@ void HKLWindow::on_toolbutton_del_crystal_clicked(void)
 {
 	LOG;
 
-	if(_samples->current){
-		hkl_sample_list_del(_samples, _samples->current);
-		this->updateTreeViewCrystals();
-	}
+	_samples.erase(_samples.find(hkl_sample_name_get(_sample)));
+	this->updateTreeViewCrystals();
 }
 
 void HKLWindow::on_toolbutton_affiner_clicked(void)
@@ -834,11 +807,10 @@ void HKLWindow::on_toolbutton_affiner_clicked(void)
 
 	Glib::ustring name;
 	Glib::ustring method;
-	HklSample *sample = _samples->current;
-	if(sample)
-		hkl_sample_affine(sample);
+	if(_sample)
+		hkl_sample_affine(_sample);
 
-	this->updateCrystalModel(_samples->current);
+	this->updateCrystalModel(_sample);
 	this->updateLattice();
 	this->updateReciprocalLattice();
 	this->updateUB();
@@ -885,29 +857,25 @@ void HKLWindow::on_treeview1_cursor_changed(void)
 {
 	LOG;
 
-	size_t index;
-
 	Gtk::TreeModel::Path path;
 	Gtk::TreeViewColumn * column;
 	_treeview1->get_cursor(path, column);
 	Gtk::TreeModel::iterator iter = _solutionModel->get_iter(path);
 	Gtk::ListStore::Row row = *(iter);
+	const HklGeometryListItem *item = row[_solutionModelColumns->item];
 
-	index = row[_solutionModelColumns->index];
-
-	hkl_geometry_init_geometry(_geometry,
-				   _engines->geometries->items[index]->geometry);
-	hkl_pseudo_axis_engine_list_get(_engines);
+	const HklGeometry *geometry = hkl_geometry_list_item_geometry_get(item);
+	hkl_engine_list_geometry_set(this->_engines, geometry);
 
-	/*
-	this->updateLattice();
-	this->updateLatticeParameters();
-	this->updateReciprocalLattice();
-	this->updateUB();
-	*/
 	this->updateAxes();
 	this->updatePseudoAxes();
 	this->updatePseudoAxesFrames();
+#ifdef HKL3D
+	if(_Scene){
+		_Scene->is_colliding();
+		_Scene->invalidate();
+	}
+#endif
 }
 
 void HKLWindow::on_pseudoAxesFrame_changed(void)
@@ -938,19 +906,19 @@ void HKLWindow::on_combobox1_changed(void)
 {
 	LOG;
 
-	const HklGeometryConfig *config;
 	size_t idx = _combobox1->get_active_row_number();
+	unsigned int n;
+	HklFactory **factories;
 
-	config = &hkl_geometry_factory_configs[idx];
+	factories = hkl_factory_get_all(&n);
 	if(_geometry)
 		hkl_geometry_free(_geometry);
-	_geometry = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
+	_geometry = hkl_factory_create_new_geometry(factories[idx]);
 
 	if(_engines)
-		hkl_pseudo_axis_engine_list_free(_engines);
-
-	_engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(_engines, _geometry, _detector, _samples->current);
+		hkl_engine_list_free(_engines);
+	_engines = hkl_factory_create_new_engine_list(factories[idx]);
+	hkl_engine_list_init(_engines, _geometry, _detector, _sample);
 
 	this->set_up_pseudo_axes_frames();
 	this->set_up_TreeView_axes();
@@ -959,4 +927,7 @@ void HKLWindow::on_combobox1_changed(void)
 
 	_solutionModelColumns = 0;
 	this->set_up_TreeView_treeview1();
+#ifdef HKL3D
+	this->set_up_3D();
+#endif
 }
diff --git a/gui/modelcolumns.h b/gui/hkl-gui-modelcolumns.h
similarity index 70%
rename from gui/modelcolumns.h
rename to gui/hkl-gui-modelcolumns.h
index c64db87..11b97ff 100644
--- a/gui/modelcolumns.h
+++ b/gui/hkl-gui-modelcolumns.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,25 +23,27 @@
 #define GTKMM_MODEL_COLUMNS_H
 
 #include <gtkmm/treemodelcolumn.h>
-#include "hkl/hkl-geometry.h"
+#include "hkl.h"
 
 class ReflectionModelColumns : public Gtk::TreeModel::ColumnRecord
 {
 public:
 	Gtk::TreeModelColumn<unsigned int> index;
+	Gtk::TreeModelColumn<HklSampleReflection *> reflection;
 	Gtk::TreeModelColumn<double> h;
 	Gtk::TreeModelColumn<double> k;
 	Gtk::TreeModelColumn<double> l;
 	Gtk::TreeModelColumn<bool> flag;
 
 	ReflectionModelColumns()
-	{
-		this->add(index);
-		this->add(h);
-		this->add(k);
-		this->add(l);
-		this->add(flag);
-	}
+		{
+			this->add(index);
+			this->add(reflection);
+			this->add(h);
+			this->add(k);
+			this->add(l);
+			this->add(flag);
+		}
 };
 
 class CrystalModelColumns : public Gtk::TreeModel::ColumnRecord
@@ -56,21 +58,21 @@ public:
 	Gtk::TreeModelColumn<double> gamma;
 
 	CrystalModelColumns()
-	{
-		this->add(name);
-		this->add(a);
-		this->add(b);
-		this->add(c);
-		this->add(alpha);
-		this->add(beta);
-		this->add(gamma);
-	}
+		{
+			this->add(name);
+			this->add(a);
+			this->add(b);
+			this->add(c);
+			this->add(alpha);
+			this->add(beta);
+			this->add(gamma);
+		}
 };
 
 class AxeModelColumns : public Gtk::TreeModel::ColumnRecord
 {
 public:
-	Gtk::TreeModelColumn<HklAxis *> axis;
+	Gtk::TreeModelColumn<HklParameter *> axis;
 	Gtk::TreeModelColumn<Glib::ustring> name;
 	Gtk::TreeModelColumn<double> read;
 	Gtk::TreeModelColumn<double> write;
@@ -78,37 +80,37 @@ public:
 	Gtk::TreeModelColumn<double> max;
 
 	AxeModelColumns()
-	{
-		add(axis);
-		add(name);
-		add(read);
-		add(write);
-		add(min);
-		add(max);
-	}
+		{
+			add(axis);
+			add(name);
+			add(read);
+			add(write);
+			add(min);
+			add(max);
+		}
 };
 
 class PseudoAxeModelColumns : public Gtk::TreeModel::ColumnRecord
 {
 public:
-	Gtk::TreeModelColumn<HklPseudoAxis *> pseudoAxis;
+	Gtk::TreeModelColumn<HklParameter *> parameter;
 	Gtk::TreeModelColumn<Glib::ustring> name;
 	Gtk::TreeModelColumn<double> read;
 	Gtk::TreeModelColumn<double> write;
 	Gtk::TreeModelColumn<double> min;
 	Gtk::TreeModelColumn<double> max;
-	Gtk::TreeModelColumn<bool> is_initialized;
+	Gtk::TreeModelColumn<HklEngine *> engine;
 
 	PseudoAxeModelColumns()
-	{
-		this->add(pseudoAxis);
-		this->add(name);
-		this->add(read);
-		this->add(write);
-		this->add(min);
-		this->add(max);
-		this->add(is_initialized);
-	}
+		{
+			this->add(parameter);
+			this->add(name);
+			this->add(read);
+			this->add(write);
+			this->add(min);
+			this->add(max);
+			this->add(engine);
+		}
 };
 
 class ParameterModelColumns : public Gtk::TreeModel::ColumnRecord
@@ -119,30 +121,34 @@ public:
 	Gtk::TreeModelColumn<double> value;
 
 	ParameterModelColumns()
-	{
-		this->add(parameter);
-		this->add(name);
-		this->add(value);
-	}
+		{
+			this->add(parameter);
+			this->add(name);
+			this->add(value);
+		}
 };
 
 class SolutionModelColumns : public Gtk::TreeModel::ColumnRecord
 {
 public:
 	Gtk::TreeModelColumn<gint> index;
+	Gtk::TreeModelColumn<const HklGeometryListItem *> item;
 	std::vector<Gtk::TreeModelColumn<gdouble> > axes;
 
 	SolutionModelColumns(HklGeometry *geometry)
-	{
-		size_t i;
-
-		this->add(this->index);
-
-		for(i=0; i<HKL_LIST_LEN(geometry->axes); ++i){
-			this->axes.push_back(Gtk::TreeModelColumn<gdouble>());
-			this->add(this->axes[i]);
+		{
+			const darray_parameter *axes;
+			HklParameter **axis;
+
+			this->add(this->index);
+			this->add(this->item);
+
+			axes = hkl_geometry_axes_get(geometry);
+			darray_foreach(axis, *axes){
+				this->axes.push_back(Gtk::TreeModelColumn<gdouble>());
+				this->add(this->axes.back());
+			}
 		}
-	}
 };
 
 class DiffractometerModelColumns : public Gtk::TreeModel::ColumnRecord
@@ -152,10 +158,10 @@ public:
 	Gtk::TreeModelColumn<gint> type;
 
 	DiffractometerModelColumns(void)
-	{
-		this->add(name);
-		this->add(type);
-	}
+		{
+			this->add(name);
+			this->add(type);
+		}
 };
 
 #endif // GTKMM_MODEL_COLUMNS_H
diff --git a/gui/pseudoaxesframe.cpp b/gui/hkl-gui-pseudoaxes.cpp
similarity index 62%
rename from gui/pseudoaxesframe.cpp
rename to gui/hkl-gui-pseudoaxes.cpp
index 9605bc5..946afc3 100644
--- a/gui/pseudoaxesframe.cpp
+++ b/gui/hkl-gui-pseudoaxes.cpp
@@ -13,15 +13,15 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include "pseudoaxesframe.h"
+#include "hkl-gui-pseudoaxes.h"
 
-PseudoAxesFrame::PseudoAxesFrame(HklPseudoAxisEngine *engine)
+PseudoAxesFrame::PseudoAxesFrame(HklEngine *engine)
 {
 	Gtk::CellRenderer * renderer;
 
@@ -43,6 +43,7 @@ PseudoAxesFrame::PseudoAxesFrame(HklPseudoAxisEngine *engine)
 	_refGlade->get_widget("combobox1", _combobox1);
 	_refGlade->get_widget("expander1", _expander1);
 	_refGlade->get_widget("treeview1", _treeview1);
+	_refGlade->get_widget("treeview2", _treeview2);
 	_refGlade->get_widget("button1", _button1);
 	_refGlade->get_widget("button2", _button2);
 
@@ -55,7 +56,7 @@ PseudoAxesFrame::PseudoAxesFrame(HklPseudoAxisEngine *engine)
 		_refGlade->get_object("liststore3"));
 
 	// title
-	_label2->set_label(_engine->name);
+	_label2->set_label(hkl_engine_name(engine));
 
 	// update all the liststore
 	this->updatePseudoAxis();
@@ -76,6 +77,11 @@ PseudoAxesFrame::PseudoAxesFrame(HklPseudoAxisEngine *engine)
 	_button2->signal_clicked ().connect (
 		sigc::mem_fun (*this, &PseudoAxesFrame::on_button2_clicked) );
 
+	renderer = _treeview2->get_column_cell_renderer(1); // 1 is the index of the value column
+	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
+		sigc::mem_fun(*this, &PseudoAxesFrame::on_cell_treeview2_mode_parameter_value_edited));
+
+
 }
 
 PseudoAxesFrame::~PseudoAxesFrame(void)
@@ -97,18 +103,18 @@ void PseudoAxesFrame::update(void)
 
 void PseudoAxesFrame::on_combobox1_changed(void)
 {
-	size_t idx = _combobox1->get_active_row_number();
-	if(idx < HKL_LIST_LEN(_engine->modes)){
-		hkl_pseudo_axis_engine_select_mode(_engine, idx);
-		this->updateModeParameters();
-	}
+	Gtk::TreeModel::iterator iter = _combobox1->get_active();
+	Gtk::ListStore::Row row = *(iter);
+	hkl_engine_select_mode(_engine, row[_mode_columns.mode]);
+	this->updateModeParameters();
+	this->_signal_changed();
 }
 
 void PseudoAxesFrame::on_cell_TreeView_pseudoAxis_value_edited(Glib::ustring const & spath,
 							       Glib::ustring const & newText)
 {
 	double value;
-	HklPseudoAxis *pseudo;
+	HklParameter *parameter;
 
 	Gtk::TreePath path(spath);
 	Gtk::TreeModel::iterator iter = _pseudoAxis_ListStore->get_iter(path);
@@ -116,32 +122,51 @@ void PseudoAxesFrame::on_cell_TreeView_pseudoAxis_value_edited(Glib::ustring con
 
 	sscanf(newText.c_str(), "%lf", &value);
 
-	pseudo = row[_pseudoAxis_columns.pseudo];
-	if(pseudo){
+	parameter = row[_pseudoAxis_columns.parameter];
+	if(parameter){
 		Gtk::CellRenderer *renderer;
 
 		renderer = _treeview1->get_column_cell_renderer(1); // 1 is the index of the value column
 		renderer->property_cell_background().set_value("red");
-		hkl_parameter_set_value_unit((HklParameter *)pseudo, value);
+		/* TODO check the error and change the meaning once
+		   the set method will do the computation */
+		hkl_parameter_value_unit_set(parameter, value, NULL);
 		row[_pseudoAxis_columns.value] = value;
 	}
 }
 
 void PseudoAxesFrame::on_button1_clicked(void)
 {
-	if(hkl_pseudo_axis_engine_set(_engine, NULL) == HKL_SUCCESS){
-		hkl_geometry_init_geometry(_engine->engines->geometry,
-					   _engine->engines->geometries->items[0]->geometry);
+	if(hkl_engine_set(_engine, NULL)){
+		HklEngineList *engines = hkl_engine_engines(this->_engine);
+		hkl_engine_list_select_solution(engines, 0);
 		this->_signal_changed();
 	}
 }
 
 void PseudoAxesFrame::on_button2_clicked(void)
 {
-	fprintf(stdout, "coucou\n");
-	if(hkl_pseudo_axis_engine_initialize(_engine, NULL) == HKL_SUCCESS){
+	if(hkl_engine_initialize(_engine, NULL))
 		this->updateModeParameters(); //some initialize function modify the parameters
-		hkl_pseudo_axis_engine_fprintf(stdout, _engine);
+}
+
+void PseudoAxesFrame::on_cell_treeview2_mode_parameter_value_edited(Glib::ustring const & spath,
+								    Glib::ustring const & newText)
+{
+	double value;
+	HklParameter *parameter;
+
+	Gtk::TreePath path(spath);
+	Gtk::TreeModel::iterator iter = _mode_parameter_ListStore->get_iter(path);
+	Gtk::ListStore::Row row = *(iter);
+
+	sscanf(newText.c_str(), "%lf", &value);
+
+	parameter = row[_mode_parameter_columns.parameter];
+	if(parameter){
+		/* TODO check the error */
+		hkl_parameter_value_unit_set(parameter, value, NULL);
+		row[_mode_parameter_columns.value] = value;
 	}
 }
 
@@ -151,40 +176,47 @@ void PseudoAxesFrame::on_button2_clicked(void)
 
 void PseudoAxesFrame::updatePseudoAxis(void)
 {
-	size_t i;
+	HklParameter **parameter;
+	darray_parameter *pseudo_axes = (darray_parameter *)hkl_engine_pseudo_axes(this->_engine);
 
 	_pseudoAxis_ListStore->clear();
-	for(i=0; i<HKL_LIST_LEN(_engine->pseudoAxes); ++i){
+	darray_foreach(parameter, *pseudo_axes){
 		Gtk::TreeRow row = *(_pseudoAxis_ListStore->append());
-		row[_pseudoAxis_columns.name] = ((HklParameter *)_engine->pseudoAxes[i])->name;
-		row[_pseudoAxis_columns.value] = hkl_parameter_get_value_unit((HklParameter *)_engine->pseudoAxes[i]);
-		row[_pseudoAxis_columns.pseudo] = _engine->pseudoAxes[i];
+		row[_pseudoAxis_columns.name] = hkl_parameter_name_get(*parameter);
+		row[_pseudoAxis_columns.value] = hkl_parameter_value_unit_get(*parameter);
+		row[_pseudoAxis_columns.parameter] = *parameter;
 	}
 }
 
 void PseudoAxesFrame::updateMode(void)
 {
-	size_t i;
+	HklMode **mode;
+	darray_mode *modes = hkl_engine_modes(this->_engine);
 
 	_mode_ListStore->clear();
-	for(i=0; i<HKL_LIST_LEN(_engine->modes); ++i){
+	darray_foreach(mode, *modes){
 		Gtk::TreeRow row = *(_mode_ListStore->append());
-		row[_mode_columns.name] = _engine->modes[i]->name;
+		row[_mode_columns.name] = hkl_mode_name(*mode);
+		row[_mode_columns.mode] = *mode;
 	}
 }
 
 void PseudoAxesFrame::updateModeParameters(void)
 {
-	size_t i;
+	HklMode *mode = hkl_engine_mode(this->_engine);
+
+	if(mode){
+		darray_parameter *parameters = hkl_mode_parameters(mode);
+
+		if(darray_size(*parameters)){
+			HklParameter **parameter;
 
-	if(_engine->mode){
-		size_t len = HKL_LIST_LEN(_engine->mode->parameters);
-		if(len){
 			_mode_parameter_ListStore->clear();
-			for(i=0; i<len; ++i){
+			darray_foreach(parameter, *parameters){
 				Gtk::TreeRow row = *(_mode_parameter_ListStore->append());
-				row[_pseudoAxis_columns.name] = _engine->mode->parameters[i].name;
-				row[_pseudoAxis_columns.value] = hkl_parameter_get_value_unit(&_engine->mode->parameters[i]);
+				row[_mode_parameter_columns.name] = hkl_parameter_name_get(*parameter);
+				row[_mode_parameter_columns.value] = hkl_parameter_value_unit_get(*parameter);
+				row[_mode_parameter_columns.parameter] = *parameter;
 			}
 			_expander1->set_expanded(1);
 			_expander1->show();
diff --git a/gui/pseudoaxesframe.h b/gui/hkl-gui-pseudoaxes.h
similarity index 75%
rename from gui/pseudoaxesframe.h
rename to gui/hkl-gui-pseudoaxes.h
index 6a4da6a..963dfb2 100644
--- a/gui/pseudoaxesframe.h
+++ b/gui/hkl-gui-pseudoaxes.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -29,11 +29,13 @@ class ModeModelColumns : public Gtk::TreeModel::ColumnRecord
 {
 public:
 	Gtk::TreeModelColumn<Glib::ustring> name;
+	Gtk::TreeModelColumn<HklMode *> mode;
 
 	ModeModelColumns()
-	{
-		this->add(name);
-	}
+		{
+			this->add(name);
+			this->add(mode);
+		}
 };
 
 class PseudoAxisModelColumns : public Gtk::TreeModel::ColumnRecord
@@ -41,20 +43,35 @@ class PseudoAxisModelColumns : public Gtk::TreeModel::ColumnRecord
 public:
 	Gtk::TreeModelColumn<Glib::ustring> name;
 	Gtk::TreeModelColumn<double> value;
-	Gtk::TreeModelColumn<HklPseudoAxis *> pseudo;
+	Gtk::TreeModelColumn<HklParameter *> parameter;
 
 	PseudoAxisModelColumns()
-	{
-		this->add(name);
-		this->add(value);
-		this->add(pseudo);
-	}
+		{
+			this->add(name);
+			this->add(value);
+			this->add(parameter);
+		}
+};
+
+class ModeParameterModelColumns : public Gtk::TreeModel::ColumnRecord
+{
+public:
+	Gtk::TreeModelColumn<Glib::ustring> name;
+	Gtk::TreeModelColumn<double> value;
+	Gtk::TreeModelColumn<HklParameter *> parameter;
+
+	ModeParameterModelColumns()
+		{
+			this->add(name);
+			this->add(value);
+			this->add(parameter);
+		}
 };
 
 class PseudoAxesFrame
 {
 public:
-	PseudoAxesFrame(HklPseudoAxisEngine *engine);
+	PseudoAxesFrame(HklEngine *engine);
 	Gtk::Frame &frame(void) {return *_frame1;}
 	virtual ~PseudoAxesFrame(void);
 
@@ -69,6 +86,8 @@ protected:
 	void on_combobox1_changed(void);
 	virtual void on_cell_TreeView_pseudoAxis_value_edited(Glib::ustring const &,
 							      Glib::ustring const &);
+	virtual void on_cell_treeview2_mode_parameter_value_edited(Glib::ustring const &,
+								   Glib::ustring const &);
 	void on_button1_clicked(void);
 	void on_button2_clicked(void);
 
@@ -82,7 +101,7 @@ protected:
 
 // members
 protected:
-	HklPseudoAxisEngine *_engine;
+	HklEngine *_engine;
 
 	// widget
 	Glib::RefPtr<Gtk::Builder> _refGlade;
@@ -91,6 +110,7 @@ protected:
 	Gtk::ComboBox *_combobox1;
 	Gtk::Expander *_expander1;
 	Gtk::TreeView *_treeview1;
+	Gtk::TreeView *_treeview2;
 	Gtk::Button *_button1;
 	Gtk::Button *_button2;
 
@@ -100,6 +120,7 @@ protected:
 	Glib::RefPtr<Gtk::ListStore> _mode_parameter_ListStore;
 	ModeModelColumns _mode_columns;
 	PseudoAxisModelColumns _pseudoAxis_columns;
+	ModeParameterModelColumns _mode_parameter_columns;
 };
 
 #endif // __PSEUDO_AXES_FRAME_H__
diff --git a/gui/ghkl.cpp b/gui/hkl-gui.cpp
similarity index 68%
rename from gui/ghkl.cpp
rename to gui/hkl-gui.cpp
index a1109db..eb1c650 100644
--- a/gui/ghkl.cpp
+++ b/gui/hkl-gui.cpp
@@ -13,37 +13,39 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
 
-#include "ghkl.h"
+#include "hkl-gui.h"
 
 HKLWindow::HKLWindow(void)
 {
 	LOG;
 
 	size_t i;
-	HklSample *sample;
 
 	_geometry = NULL;
 	_engines = NULL;
 
 	_detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-        _detector->idx = 1;
-	
-	_samples = hkl_sample_list_new();
+	hkl_detector_idx_set(_detector, 1);
+
 	// add a default crystal
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	hkl_sample_list_append(_samples, sample);
-	hkl_sample_list_select_current(_samples, "test");
+	_sample = hkl_sample_new("test");
+	_samples.insert(std::pair<std::string, HklSample *>(hkl_sample_name_get(_sample),
+							    _sample));
 
 	// create the reciprocal lattice
 	_reciprocal = hkl_lattice_new_default();
 
+#ifdef HKL3D
+	_Scene = NULL;
+#endif
+
 	// Sets the border width of the window.
 	this->set_border_width(10);
 
@@ -75,10 +77,14 @@ HKLWindow::~HKLWindow()
 
 	hkl_geometry_free(_geometry);
 	hkl_detector_free(_detector);
-	hkl_pseudo_axis_engine_list_free(_engines);
-	hkl_sample_list_free(_samples);
+	hkl_engine_list_free(_engines);
 	hkl_lattice_free(_reciprocal);
 
+	//clear all the samples of the map
+	std::map<std::string, HklSample *>::iterator it;
+	for (it=_samples.begin(); it!=_samples.end(); ++it)
+		hkl_sample_free(it->second);
+
 	if(_diffractometerModelColumns)
 		delete _diffractometerModelColumns;
 
@@ -88,8 +94,6 @@ HKLWindow::~HKLWindow()
 
 void HKLWindow::get_widgets_and_objects_from_ui(void)
 {
-	LOG;
-
 	//Get Glade UI:
 	_refGlade = Gtk::Builder::create();
 	try{
@@ -158,9 +162,9 @@ void HKLWindow::get_widgets_and_objects_from_ui(void)
 	_refGlade->get_widget("checkbutton_alpha", _checkbutton_alpha);
 	_refGlade->get_widget("checkbutton_beta", _checkbutton_beta);
 	_refGlade->get_widget("checkbutton_gamma", _checkbutton_gamma);
-	_refGlade->get_widget("checkbutton_Ux", _checkbutton_Ux);
-	_refGlade->get_widget("checkbutton_Uy", _checkbutton_Uy);
-	_refGlade->get_widget("checkbutton_Uz", _checkbutton_Uz);
+	_refGlade->get_widget("checkbutton_ux", _checkbutton_ux);
+	_refGlade->get_widget("checkbutton_uy", _checkbutton_uy);
+	_refGlade->get_widget("checkbutton_uz", _checkbutton_uz);
 	_refGlade->get_widget("treeview_reflections", _treeViewReflections);
 	_refGlade->get_widget("treeview_crystals", _treeViewCrystals);
 	_refGlade->get_widget("treeview_axes", _TreeView_axes);
@@ -178,6 +182,7 @@ void HKLWindow::get_widgets_and_objects_from_ui(void)
 	_refGlade->get_widget("toolbutton_affiner", _toolbutton_affiner);
 	_refGlade->get_widget("statusbar", _statusBar);
 	_refGlade->get_widget("menuitem5", _menuitem5);
+	_refGlade->get_widget("vbox7", _vbox7);
 	_refGlade->get_widget("imagemenuitem5", _imagemenuitem5);
 
 	// dialog1
@@ -250,12 +255,12 @@ void HKLWindow::connect_all_signals(void)
 		mem_fun(*this, &HKLWindow::on_checkbutton_beta_toggled));
 	_checkbutton_gamma->signal_toggled().connect(
 		mem_fun(*this, &HKLWindow::on_checkbutton_gamma_toggled));
-	_checkbutton_Ux->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_Ux_toggled));
-	_checkbutton_Uy->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_Uy_toggled));
-	_checkbutton_Uz->signal_toggled().connect(
-		mem_fun(*this, &HKLWindow::on_checkbutton_Uz_toggled));
+	_checkbutton_ux->signal_toggled().connect(
+		mem_fun(*this, &HKLWindow::on_checkbutton_ux_toggled));
+	_checkbutton_uy->signal_toggled().connect(
+		mem_fun(*this, &HKLWindow::on_checkbutton_uy_toggled));
+	_checkbutton_uz->signal_toggled().connect(
+		mem_fun(*this, &HKLWindow::on_checkbutton_uz_toggled));
 
 	_treeViewReflections->signal_key_press_event().connect(
 		mem_fun(*this, &HKLWindow::on_treeViewReflections_key_press_event));
@@ -302,7 +307,10 @@ void HKLWindow::set_up_pseudo_axes_frames(void)
 	LOG;
 
 	size_t i;
+	HklEngine **engine;
 	Gtk::VBox *vbox2 = NULL;
+	PseudoAxesFrame *pseudo;
+	darray_engine *engines = hkl_engine_list_engines(this->_engines);
 
 	_refGlade->get_widget("vbox2", vbox2);
 
@@ -313,10 +321,8 @@ void HKLWindow::set_up_pseudo_axes_frames(void)
 	}
 	_pseudoAxesFrames.clear();
 
-	for(i=0; i<HKL_LIST_LEN(_engines->engines); ++i){
-		PseudoAxesFrame *pseudo;
-
-		pseudo = new PseudoAxesFrame (_engines->engines[i]);
+	darray_foreach(engine, *engines){
+		pseudo = new PseudoAxesFrame (*engine);
 		_pseudoAxesFrames.push_back (pseudo);
 		vbox2->add (pseudo->frame());
 		pseudo->signal_changed ().connect (
@@ -327,18 +333,20 @@ void HKLWindow::set_up_pseudo_axes_frames(void)
 
 void HKLWindow::set_up_diffractometer_model(void)
 {
-	size_t i;
+	unsigned int i;
+	unsigned int n;
+	HklFactory **factories;
 
 	if(_diffractometerModelColumns)
 		delete _diffractometerModelColumns;
 	_diffractometerModelColumns = new DiffractometerModelColumns();
 
-	i = 0;
-	while(hkl_geometry_factory_configs[i].name){
+	factories = hkl_factory_get_all(&n);
+	for (i=0; i<n; ++i){
 		Gtk::ListStore::Row row;
 
 		row = *(_diffractometerModel->append());
-		row[_diffractometerModelColumns->name] = hkl_geometry_factory_configs[i++].name;
+		row[_diffractometerModelColumns->name] = hkl_factory_name(factories[i]);
 	}
 }
 
@@ -359,36 +367,38 @@ void HKLWindow::set_up_TreeView_axes(void)
 	index = _TreeView_axes->append_column("name", _axeModelColumns.name);
 
 	index = _TreeView_axes->append_column_numeric_editable("read",
-								_axeModelColumns.read, "%lf");
+							       _axeModelColumns.read, "%lf");
 	renderer = _TreeView_axes->get_column_cell_renderer(index-1);
 	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
 		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_axes_read_edited));
-  
+
 	index = _TreeView_axes->append_column_numeric_editable("write",
-								_axeModelColumns.write, "%lf");
+							       _axeModelColumns.write, "%lf");
 	renderer = _TreeView_axes->get_column_cell_renderer(index-1);
 	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
 		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_axes_write_edited));
-  
+
 	index = _TreeView_axes->append_column_numeric_editable("min",
-								_axeModelColumns.min, "%lf");
+							       _axeModelColumns.min, "%lf");
 	renderer = _TreeView_axes->get_column_cell_renderer(index-1);
 	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
 		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_axes_min_edited));
-  
+
 	index = _TreeView_axes->append_column_numeric_editable("max",
-								_axeModelColumns.max, "%lf");
+							       _axeModelColumns.max, "%lf");
 	renderer = _TreeView_axes->get_column_cell_renderer(index-1);
 	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
 		sigc::mem_fun(*this, &HKLWindow::on_cell_TreeView_axes_max_edited));
 
 	//Fill the models from the diffractometerAxes
-	for(i=0; i<HKL_LIST_LEN(_geometry->axes); ++i){
-		HklAxis *axis = &_geometry->axes[i];
+	const darray_parameter *axes;
+	HklParameter **axis;
 
+	axes = hkl_geometry_axes_get(this->_geometry);
+	darray_foreach(axis, *axes){
 		Gtk::ListStore::Row row = *(_axeModel->append());
-		row[_axeModelColumns.axis] = axis;
-		row[_axeModelColumns.name] = ((HklParameter *)axis)->name;
+		row[_axeModelColumns.axis] = *axis;
+		row[_axeModelColumns.name] = hkl_parameter_name_get(*axis);
 	}
 
 	//Set the model for the TreeView
@@ -400,11 +410,11 @@ void HKLWindow::set_up_TreeView_pseudoAxes(void)
 {
 	LOG;
 
-	size_t i;
-	size_t j;
-	size_t k;
 	int index;
 	Gtk::CellRenderer * renderer;
+	HklEngine **engine;
+	HklParameter **pseudo_axis;
+	darray_engine *engines = hkl_engine_list_engines(this->_engines);
 
 	/* add the columns */
 	_TreeView_pseudoAxes->remove_all_columns();
@@ -412,53 +422,48 @@ void HKLWindow::set_up_TreeView_pseudoAxes(void)
 	_TreeView_pseudoAxes->append_column("name", _pseudoAxeModelColumns.name);
 
 	_TreeView_pseudoAxes->append_column_numeric("read", _pseudoAxeModelColumns.read, "%lf");
-  
+
 	index = _TreeView_pseudoAxes->append_column_numeric_editable("write", _pseudoAxeModelColumns.write, "%lf");
 	renderer = _TreeView_pseudoAxes->get_column_cell_renderer(index-1);
 	dynamic_cast<Gtk::CellRendererText *>(renderer)->signal_edited().connect(
 		sigc::mem_fun(*this,
 			      &HKLWindow::on_cell_TreeView_pseudoAxes_write_edited));
-  
+
 	_TreeView_pseudoAxes->append_column_numeric("min", _pseudoAxeModelColumns.min, "%lf");
-  
+
 	_TreeView_pseudoAxes->append_column_numeric("max", _pseudoAxeModelColumns.max, "%lf");
 
-	index = _TreeView_pseudoAxes->append_column_editable(
-		"initialized",
-		_pseudoAxeModelColumns.is_initialized);
-	renderer = _TreeView_pseudoAxes->get_column_cell_renderer(index-1);
-	dynamic_cast<Gtk::CellRendererToggle *>(renderer)->signal_toggled().connect(
-		sigc::mem_fun(*this,
-			      &HKLWindow::on_cell_TreeView_pseudoAxes_is_initialized_toggled));
-  
 	//Create the Model
 	_pseudoAxeModel = Gtk::ListStore::create(_pseudoAxeModelColumns);
 
 	//Fill the models from the diffractometer pseudoAxes
-	for(i=0; i<HKL_LIST_LEN(_engines->engines); ++i){
-		HklPseudoAxisEngine *engine = _engines->engines[i];
+	darray_foreach(engine, *engines){
+		darray_parameter *pseudo_axes = (darray_parameter *)hkl_engine_pseudo_axes(*engine);
+		HklMode *mode = hkl_engine_mode(*engine);
+		darray_parameter *parameters = hkl_mode_parameters(mode);
 
-		for(j=0; j<HKL_LIST_LEN(engine->pseudoAxes); ++j){
-			HklPseudoAxis *pseudoAxis = engine->pseudoAxes[j];
+		darray_foreach(pseudo_axis, *pseudo_axes){
 			Gtk::ListStore::Row row = *(_pseudoAxeModel->append());
-			row[_pseudoAxeModelColumns.pseudoAxis] = pseudoAxis;
-			row[_pseudoAxeModelColumns.name] = ((HklParameter *)pseudoAxis)->name;
+			row[_pseudoAxeModelColumns.engine] = *engine;
+			row[_pseudoAxeModelColumns.parameter] = *pseudo_axis;
+			row[_pseudoAxeModelColumns.name] = hkl_parameter_name_get(*pseudo_axis);
 
-			if(HKL_LIST_LEN(engine->mode->parameters)){
+			if(darray_size(*parameters)){
 				Glib::RefPtr<Gtk::ListStore> model = Gtk::ListStore::create(_parameterModelColumns);
-				for(k=0; k<HKL_LIST_LEN(engine->mode->parameters); ++k){
-					HklParameter *parameter = &engine->mode->parameters[k];
+				HklParameter **parameter;
 
+				darray_foreach(parameter, *parameters){
 					Glib::RefPtr<Gtk::ListStore> model = Gtk::ListStore::create(_parameterModelColumns);
 					row = *(model->append());
-					row[_parameterModelColumns.parameter] = parameter;
-					row[_parameterModelColumns.name] = parameter->name;
-					row[_parameterModelColumns.value] = hkl_parameter_get_value_unit(parameter);
+					row[_parameterModelColumns.parameter] = *parameter;
+					row[_parameterModelColumns.name] = hkl_parameter_name_get(*parameter);
+					row[_parameterModelColumns.value] = hkl_parameter_value_unit_get(*parameter);
 				}
-				_mapPseudoAxeParameterModel.insert(std::pair<HklPseudoAxis *,  Glib::RefPtr<Gtk::ListStore> >(pseudoAxis, model));
+				_mapPseudoAxeParameterModel.insert(std::pair<HklParameter *, Glib::RefPtr<Gtk::ListStore> >(*pseudo_axis, model));
 			}
 		}
 	}
+
 	//Set the model for the TreeView
 	_TreeView_pseudoAxes->set_model(_pseudoAxeModel);
 	this->updatePseudoAxes();
@@ -491,11 +496,9 @@ void HKLWindow::set_up_TreeView_treeview1(void)
 {
 	LOG;
 
-	size_t i;
-	size_t j;
-	size_t k;
-	int index;
-	Gtk::CellRenderer * renderer;
+	int i=0;
+	const darray_parameter *axes;
+	HklParameter **axis;
 
 	//Create the Columns
 	if(_solutionModelColumns)
@@ -504,9 +507,10 @@ void HKLWindow::set_up_TreeView_treeview1(void)
 
 	/* add the columns */
 	_treeview1->remove_all_columns();
-	for(i=0; i<HKL_LIST_LEN(_geometry->axes); ++i)
-		_treeview1->append_column_numeric(((HklParameter *)&_geometry->axes[i])->name,
-						  _solutionModelColumns->axes[i],
+	axes = hkl_geometry_axes_get(this->_geometry);
+	darray_foreach(axis, *axes)
+		_treeview1->append_column_numeric(hkl_parameter_name_get(*axis),
+						  _solutionModelColumns->axes[i++],
 						  "%lf");
 
 	//Create the model from the columns
@@ -579,13 +583,41 @@ void HKLWindow::set_up_TreeView_crystals(void)
 	_treeViewCrystals->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);
 }
 
+#ifdef HKL3D
+
+void HKLWindow::set_up_3D(void)
+{
+	LOG;
+	const char *model;
+
+	if(_Scene)
+		delete _Scene;
+
+	// for now the connection with the model is done in the part of the code
+	// It should be store in the config part of the geometry ?
+	const char *name = hkl_geometry_name_get(this->_geometry);
+	if (!strcmp("K6C", name))
+		model = "../data/diffabs.yaml";
+	else if(!strcmp("K4CV", name))
+		model = "../data/cristal4C.yaml";
+
+	if(model){
+		_Scene = new Hkl3DFrame(model, _geometry);
+		this->_vbox7->pack_start(_Scene->frame());
+		this->_vbox7->show_all();
+	}else
+		_Scene = NULL;
+}
+
+#endif
+
 void HKLWindow::updateSource(void)
 {
 	LOG;
 
 	if(_geometry){
-		double lambda = hkl_source_get_wavelength(&_geometry->source);
-		_spinbutton_lambda->set_value(lambda);
+		double wavelength = hkl_geometry_wavelength_get(this->_geometry);
+		_spinbutton_lambda->set_value(wavelength);
 	}
 }
 
@@ -600,13 +632,13 @@ void HKLWindow::updateAxes(void)
 	while(iter != end){
 		double min;
 		double max;
-		HklAxis * axis;
+		HklParameter * axis;
 
 		Gtk::TreeRow row = *iter;
 		axis = row[_axeModelColumns.axis];
-		row[_axeModelColumns.read] = hkl_axis_get_value_unit(axis);
-		row[_axeModelColumns.write] = hkl_axis_get_value_unit(axis);
-		hkl_parameter_get_range_unit((HklParameter *)axis, &min, &max);
+		row[_axeModelColumns.read] = hkl_parameter_value_unit_get(axis);
+		row[_axeModelColumns.write] = hkl_parameter_value_unit_get(axis);
+		hkl_parameter_min_max_unit_get(axis, &min, &max);
 		row[_axeModelColumns.min] = min;
 		row[_axeModelColumns.max] = max;
 		++iter;
@@ -618,7 +650,7 @@ void HKLWindow::updatePseudoAxes(void)
 	LOG;
 
 	// first compute all the pseudoAxes values
-	hkl_pseudo_axis_engine_list_get(_engines);
+	hkl_engine_list_get(_engines);
 
 	// update the model
 	Gtk::TreeModel::Children rows = _pseudoAxeModel->children();
@@ -628,18 +660,15 @@ void HKLWindow::updatePseudoAxes(void)
 		double min;
 		double max;
 		HklParameter *parameter;
-		HklPseudoAxis *pseudoAxis;
 
 		Gtk::TreeRow row = *iter;
-		pseudoAxis = row[_pseudoAxeModelColumns.pseudoAxis];
-		parameter = (HklParameter *)pseudoAxis;
-		row[_pseudoAxeModelColumns.read] = hkl_parameter_get_value_unit(parameter);
-		row[_pseudoAxeModelColumns.write] = hkl_parameter_get_value_unit(parameter);
-		hkl_parameter_get_range_unit(parameter, &min, &max);
+		parameter = row[_pseudoAxeModelColumns.parameter];
+		row[_pseudoAxeModelColumns.read] = hkl_parameter_value_unit_get(parameter);
+		row[_pseudoAxeModelColumns.write] = hkl_parameter_value_unit_get(parameter);
+		hkl_parameter_min_max_unit_get(parameter, &min, &max);
 		row[_pseudoAxeModelColumns.min] = min;
 		row[_pseudoAxeModelColumns.max] = max;
 
-		row[_pseudoAxeModelColumns.is_initialized] = true;
 		++iter;
 	}
 }
@@ -648,8 +677,8 @@ void HKLWindow::update_pseudoAxes_parameters(void)
 {
 	LOG;
 
-	std::map<HklPseudoAxis *, Glib::RefPtr<Gtk::ListStore> >::iterator iter = _mapPseudoAxeParameterModel.begin();
-	std::map<HklPseudoAxis *, Glib::RefPtr<Gtk::ListStore> >::iterator end = _mapPseudoAxeParameterModel.end();
+	std::map<HklParameter *, Glib::RefPtr<Gtk::ListStore> >::iterator iter = _mapPseudoAxeParameterModel.begin();
+	std::map<HklParameter *, Glib::RefPtr<Gtk::ListStore> >::iterator end = _mapPseudoAxeParameterModel.end();
 	while(iter != end){
 		Gtk::TreeModel::Children rows = iter->second->children();
 		Gtk::TreeModel::Children::iterator iter_row = rows.begin();
@@ -657,8 +686,8 @@ void HKLWindow::update_pseudoAxes_parameters(void)
 		while(iter_row != end_row){
 			Gtk::TreeRow row = *iter_row;
 			HklParameter *parameter = row[_parameterModelColumns.parameter];
-			row[_parameterModelColumns.name] = parameter->name;
-			row[_parameterModelColumns.value] = hkl_parameter_get_value_unit(parameter);
+			row[_parameterModelColumns.name] = hkl_parameter_name_get(parameter);
+			row[_parameterModelColumns.value] = hkl_parameter_value_unit_get(parameter);
 			++iter_row;
 		}
 		++iter;
@@ -669,14 +698,14 @@ void HKLWindow::updateLattice(void)
 {
 	LOG;
 
-	HklSample *sample = _samples->current;
-	if(sample){
-		double a = hkl_parameter_get_value_unit(sample->lattice->a);
-		double b = hkl_parameter_get_value_unit(sample->lattice->b);
-		double c = hkl_parameter_get_value_unit(sample->lattice->c);
-		double alpha = hkl_parameter_get_value_unit(sample->lattice->alpha);
-		double beta = hkl_parameter_get_value_unit(sample->lattice->beta);
-		double gamma = hkl_parameter_get_value_unit(sample->lattice->gamma);
+	if(_sample){
+		const HklLattice *lattice = hkl_sample_lattice_get(_sample);
+		double a = hkl_parameter_value_unit_get(hkl_lattice_a_get(lattice));
+		double b = hkl_parameter_value_unit_get(hkl_lattice_b_get(lattice));
+		double c = hkl_parameter_value_unit_get(hkl_lattice_c_get(lattice));
+		double alpha = hkl_parameter_value_unit_get(hkl_lattice_alpha_get(lattice));
+		double beta = hkl_parameter_value_unit_get(hkl_lattice_beta_get(lattice));
+		double gamma = hkl_parameter_value_unit_get(hkl_lattice_gamma_get(lattice));
 
 		_spinbutton_a->set_value(a);
 		_spinbutton_b->set_value(b);
@@ -691,49 +720,54 @@ void HKLWindow::updateLatticeParameters(void)
 {
 	LOG;
 
-	HklSample *sample = _samples->current;
-	if(sample){
+	if(_sample){
 		double min;
 		double max;
 		bool to_fit;
-		HklParameter *parameter;
-
+		const HklLattice *lattice = hkl_sample_lattice_get(_sample);
+		const HklParameter *parameter;
 
-		parameter = sample->lattice->a;
-		hkl_parameter_get_range_unit(parameter, &min, &max);
+		parameter = hkl_lattice_a_get(lattice);
+		hkl_parameter_min_max_unit_get(parameter, &min, &max);
+		to_fit = hkl_parameter_fit_get(parameter);
 		_spinbutton_a_min->set_value(min);
 		_spinbutton_a_max->set_value(max);
-		_checkbutton_a->set_active(parameter->fit);
+		_checkbutton_a->set_active(to_fit);
 
-		parameter = sample->lattice->b;
-		hkl_parameter_get_range_unit(parameter, &min, &max);
+		parameter = hkl_lattice_b_get(lattice);
+		hkl_parameter_min_max_unit_get(parameter, &min, &max);
+		to_fit = hkl_parameter_fit_get(parameter);
 		_spinbutton_b_min->set_value(min);
 		_spinbutton_b_max->set_value(max);
-		_checkbutton_b->set_active(parameter->fit);
+		_checkbutton_b->set_active(to_fit);
 
-		parameter = sample->lattice->c;
-		hkl_parameter_get_range_unit(parameter, &min, &max);
+		parameter = hkl_lattice_c_get(lattice);
+		hkl_parameter_min_max_unit_get(parameter, &min, &max);
+		to_fit = hkl_parameter_fit_get(parameter);
 		_spinbutton_c_min->set_value(min);
 		_spinbutton_c_max->set_value(max);
-		_checkbutton_c->set_active(parameter->fit);
+		_checkbutton_c->set_active(to_fit);
 
-		parameter = sample->lattice->alpha;
-		hkl_parameter_get_range_unit(parameter, &min, &max);
+		parameter = hkl_lattice_alpha_get(lattice);
+		hkl_parameter_min_max_unit_get(parameter, &min, &max);
+		to_fit = hkl_parameter_fit_get(parameter);
 		_spinbutton_alpha_min->set_value(min);
 		_spinbutton_alpha_max->set_value(max);
-		_checkbutton_alpha->set_active(parameter->fit);
+		_checkbutton_alpha->set_active(to_fit);
 
-		parameter = sample->lattice->beta;
-		hkl_parameter_get_range_unit(parameter, &min, &max);
+		parameter = hkl_lattice_beta_get(lattice);
+		hkl_parameter_min_max_unit_get(parameter, &min, &max);
+		to_fit = hkl_parameter_fit_get(parameter);
 		_spinbutton_beta_min->set_value(min);
 		_spinbutton_beta_max->set_value(max);
-		_checkbutton_beta->set_active(parameter->fit);
+		_checkbutton_beta->set_active(to_fit);
 
-		parameter = sample->lattice->gamma;
-		hkl_parameter_get_range_unit(parameter, &min, &max);
+		parameter = hkl_lattice_gamma_get(lattice);
+		hkl_parameter_min_max_unit_get(parameter, &min, &max);
+		to_fit = hkl_parameter_fit_get(parameter);
 		_spinbutton_gamma_min->set_value(min);
 		_spinbutton_gamma_max->set_value(max);
-		_checkbutton_gamma->set_active(parameter->fit);
+		_checkbutton_gamma->set_active(to_fit);
 	}
 }
 
@@ -741,16 +775,28 @@ void HKLWindow::updateReciprocalLattice(void)
 {
 	LOG;
 
-	HklSample *sample = _samples->current;
-	if(sample){
-		hkl_lattice_reciprocal(sample->lattice, _reciprocal);
-
-		_spinbutton_a_star->set_value(hkl_parameter_get_value_unit(_reciprocal->a));
-		_spinbutton_b_star->set_value(hkl_parameter_get_value_unit(_reciprocal->b));
-		_spinbutton_c_star->set_value(hkl_parameter_get_value_unit(_reciprocal->c));
-		_spinbutton_alpha_star->set_value(hkl_parameter_get_value_unit(_reciprocal->alpha));
-		_spinbutton_beta_star->set_value(hkl_parameter_get_value_unit(_reciprocal->beta));
-		_spinbutton_gamma_star->set_value(hkl_parameter_get_value_unit(_reciprocal->gamma));
+	if(_sample){
+		hkl_lattice_reciprocal(hkl_sample_lattice_get(_sample),
+				       _reciprocal);
+
+		_spinbutton_a_star->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_lattice_a_get(_reciprocal)));
+		_spinbutton_b_star->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_lattice_b_get(_reciprocal)));
+		_spinbutton_c_star->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_lattice_c_get(_reciprocal)));
+		_spinbutton_alpha_star->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_lattice_alpha_get(_reciprocal)));
+		_spinbutton_beta_star->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_lattice_beta_get(_reciprocal)));
+		_spinbutton_gamma_star->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_lattice_gamma_get(_reciprocal)));
 	}
 }
 
@@ -758,30 +804,29 @@ void HKLWindow::updateUB(void)
 {
 	LOG;
 
-	HklSample *sample = _samples->current;
-	if(sample){
+	if(_sample){
 		static const char *format = "%f";
 		char tmp[100];
-		HklMatrix UB;
+		const HklMatrix *UB;
 
-		hkl_sample_get_UB(sample, &UB);
-		sprintf(tmp, format, UB.data[0][0]);
+		UB = hkl_sample_UB_get(_sample);
+		sprintf(tmp, format, hkl_matrix_get(UB, 0, 0));
 		_label_UB11->set_text(tmp);
-		sprintf(tmp, format, UB.data[0][1]);
+		sprintf(tmp, format, hkl_matrix_get(UB, 0, 1));
 		_label_UB12->set_text(tmp);
-		sprintf(tmp, format, UB.data[0][2]);
+		sprintf(tmp, format, hkl_matrix_get(UB, 0, 2));
 		_label_UB13->set_text(tmp);
-		sprintf(tmp, format, UB.data[1][0]);
+		sprintf(tmp, format, hkl_matrix_get(UB, 1, 0));
 		_label_UB21->set_text(tmp);
-		sprintf(tmp, format, UB.data[1][1]);
+		sprintf(tmp, format, hkl_matrix_get(UB, 1, 1));
 		_label_UB22->set_text(tmp);
-		sprintf(tmp, format, UB.data[1][2]);
+		sprintf(tmp, format, hkl_matrix_get(UB, 1, 2));
 		_label_UB23->set_text(tmp);
-		sprintf(tmp, format, UB.data[2][0]);
+		sprintf(tmp, format, hkl_matrix_get(UB, 2, 0));
 		_label_UB31->set_text(tmp);
-		sprintf(tmp, format, UB.data[2][1]);
+		sprintf(tmp, format, hkl_matrix_get(UB, 2, 1));
 		_label_UB32->set_text(tmp);
-		sprintf(tmp, format, UB.data[2][2]);
+		sprintf(tmp, format, hkl_matrix_get(UB, 2, 2));
 		_label_UB33->set_text(tmp);
 	}
 }
@@ -790,14 +835,25 @@ void HKLWindow::updateUxUyUz(void)
 {
 	LOG;
 
-	HklSample *sample = _samples->current;
-	if(sample){
-		_spinbutton_ux->set_value(hkl_parameter_get_value_unit(sample->ux));
-		_spinbutton_uy->set_value(hkl_parameter_get_value_unit(sample->uy));
-		_spinbutton_uz->set_value(hkl_parameter_get_value_unit(sample->uz));
-		_checkbutton_Ux->set_active(sample->ux->fit);
-		_checkbutton_Uy->set_active(sample->uy->fit);
-		_checkbutton_Uz->set_active(sample->uz->fit);
+	if(_sample){
+		_spinbutton_ux->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_sample_ux_get(_sample)));
+		_spinbutton_uy->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_sample_uy_get(_sample)));
+		_spinbutton_uz->set_value(
+			hkl_parameter_value_unit_get(
+				hkl_sample_uz_get(_sample)));
+		_checkbutton_ux->set_active(
+			hkl_parameter_fit_get(
+				hkl_sample_ux_get(_sample)));
+		_checkbutton_uy->set_active(
+			hkl_parameter_fit_get(
+				hkl_sample_uy_get(_sample)));
+		_checkbutton_uz->set_active(
+			hkl_parameter_fit_get(
+				hkl_sample_uz_get(_sample)));
 	}
 }
 
@@ -821,31 +877,34 @@ void HKLWindow::updateTreeViewCrystals(void)
 	// erase all reflections.
 	_mapReflectionModel.clear();
 
-	if(_samples->current){
+	if(_sample){
 		is_current_crystal_set = true;
-		current_crystal_name = _samples->current->name;
+		current_crystal_name = hkl_sample_name_get(_sample);
 	}
 
 	//Fill the models from the crystalList
-	for(i=0; i<HKL_LIST_LEN(_samples->samples); ++i){
-		HklLattice *lattice;
-
-		sample = _samples->samples[i];
-		lattice = sample->lattice;
+	std::map<std::string, HklSample *>::iterator it;
+	for(it=_samples.begin(); it!=_samples.end(); ++it){
+		const HklLattice *lattice;
+		const char *name;
+
+		sample = it->second;
+		lattice = hkl_sample_lattice_get(sample);
+		name = hkl_sample_name_get(sample);
 		iter_row = *(_crystalModel->append());
-		if (is_current_crystal_set && current_crystal_name == sample->name)
+		if (is_current_crystal_set && current_crystal_name == name)
 			iter_current = iter_row;
 		row = *(iter_row);
-		row[_crystalModelColumns.name] = sample->name;
-		row[_crystalModelColumns.a] = hkl_parameter_get_value_unit(lattice->a);
-		row[_crystalModelColumns.b] = hkl_parameter_get_value_unit(lattice->b);
-		row[_crystalModelColumns.c] = hkl_parameter_get_value_unit(lattice->c);
-		row[_crystalModelColumns.alpha] = hkl_parameter_get_value_unit(lattice->alpha);
-		row[_crystalModelColumns.beta] = hkl_parameter_get_value_unit(lattice->beta);
-		row[_crystalModelColumns.gamma] = hkl_parameter_get_value_unit(lattice->gamma);
+		row[_crystalModelColumns.name] = name;
+		row[_crystalModelColumns.a] = hkl_parameter_value_unit_get(hkl_lattice_a_get(lattice));
+		row[_crystalModelColumns.b] = hkl_parameter_value_unit_get(hkl_lattice_b_get(lattice));
+		row[_crystalModelColumns.c] = hkl_parameter_value_unit_get(hkl_lattice_c_get(lattice));
+		row[_crystalModelColumns.alpha] = hkl_parameter_value_unit_get(hkl_lattice_alpha_get(lattice));
+		row[_crystalModelColumns.beta] = hkl_parameter_value_unit_get(hkl_lattice_beta_get(lattice));
+		row[_crystalModelColumns.gamma] = hkl_parameter_value_unit_get(hkl_lattice_gamma_get(lattice));
 
 		Glib::RefPtr<Gtk::ListStore> listStore = Gtk::ListStore::create(_reflectionModelColumns);
-		_mapReflectionModel[sample->name] = listStore;
+		_mapReflectionModel[name] = listStore;
 		this->updateReflections(sample, listStore);
 	}
 
@@ -864,19 +923,24 @@ void HKLWindow::updateReflections(const HklSample *sample,
 {
 	LOG;
 
-	size_t i;
+	size_t i = 0;
 
 	listStore->clear();
 	Gtk::ListStore::Row row;
-	for(i=0; i<HKL_LIST_LEN(sample->reflections); ++i){
-		HklSampleReflection *reflection = sample->reflections[i];
+	HklSampleReflection *reflection = hkl_sample_first_reflection_get(sample);
+	while(reflection){
+		double h, k, l;
+
+		hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
 
 		row = *(listStore->append());
-		row[_reflectionModelColumns.index] = i;
-		row[_reflectionModelColumns.h] = reflection->hkl.data[0];
-		row[_reflectionModelColumns.k] = reflection->hkl.data[1];
-		row[_reflectionModelColumns.l] = reflection->hkl.data[2];
-		row[_reflectionModelColumns.flag] = reflection->flag;
+		row[_reflectionModelColumns.index] = i++;
+		row[_reflectionModelColumns.reflection] = reflection;
+		row[_reflectionModelColumns.h] = h;
+		row[_reflectionModelColumns.k] = k;
+		row[_reflectionModelColumns.l] = l;
+		row[_reflectionModelColumns.flag] = hkl_sample_reflection_flag_get(reflection);
+		reflection = hkl_sample_next_reflection_get(sample, reflection);
 	}
 }
 
@@ -884,7 +948,7 @@ void HKLWindow::updateStatusBar(const HklError *error)
 {
 	LOG;
 
-	_statusBar->push(error->message);
+	_statusBar->push(hkl_error_message_get(error));
 }
 
 void HKLWindow::updateCrystalModel(HklSample * sample)
@@ -896,14 +960,20 @@ void HKLWindow::updateCrystalModel(HklSample * sample)
 	Gtk::TreeModel::Children::iterator end = children.end();
 	while (iter != end){
 		Gtk::TreeModel::Row const & row = *iter;
-		if (row[_crystalModelColumns.name] == sample->name){
-			HklLattice *lattice = sample->lattice;
-			row[_crystalModelColumns.a] = hkl_parameter_get_value_unit(lattice->a);
-			row[_crystalModelColumns.b] = hkl_parameter_get_value_unit(lattice->b);
-			row[_crystalModelColumns.c] = hkl_parameter_get_value_unit(lattice->c);
-			row[_crystalModelColumns.alpha] = hkl_parameter_get_value_unit(lattice->alpha);
-			row[_crystalModelColumns.beta] = hkl_parameter_get_value_unit(lattice->beta);
-			row[_crystalModelColumns.gamma] = hkl_parameter_get_value_unit(lattice->gamma);
+		if (row[_crystalModelColumns.name] == hkl_sample_name_get(sample)){
+			const HklLattice *lattice = hkl_sample_lattice_get(sample);
+			row[_crystalModelColumns.a] = hkl_parameter_value_unit_get(
+				hkl_lattice_a_get(lattice));
+			row[_crystalModelColumns.b] = hkl_parameter_value_unit_get(
+				hkl_lattice_b_get(lattice));
+			row[_crystalModelColumns.c] = hkl_parameter_value_unit_get(
+				hkl_lattice_c_get(lattice));
+			row[_crystalModelColumns.alpha] = hkl_parameter_value_unit_get(
+				hkl_lattice_alpha_get(lattice));
+			row[_crystalModelColumns.beta] = hkl_parameter_value_unit_get(
+				hkl_lattice_beta_get(lattice));
+			row[_crystalModelColumns.gamma] = hkl_parameter_value_unit_get(
+				hkl_lattice_gamma_get(lattice));
 			iter = end;
 		}
 		else
@@ -925,20 +995,26 @@ void HKLWindow::updateSolutions(void)
 {
 	LOG;
 
-	size_t i;
+	size_t i = 0;
+	const HklGeometryList *geometries = hkl_engine_list_geometries(this->_engines);
+	HklGeometryListItem **item;
 
 	_solutionModel->clear();
 	Gtk::ListStore::Row row;
-	for(i=0; i<hkl_geometry_list_len(_engines->geometries); ++i){
-		size_t j;
-		HklGeometry *geometry;
-
-		geometry = _engines->geometries->items[i]->geometry;
+	const darray_item *items = hkl_geometry_list_items_get(geometries);
+	darray_foreach(item, *items){
+		HklParameter **axis;
+		int j = 0;
 
 		row = *(_solutionModel->append());
-		row[_solutionModelColumns->index] = i;
-		for(j=0; j<HKL_LIST_LEN(geometry->axes); ++j)
-			row[_solutionModelColumns->axes[j]] = 
-				hkl_parameter_get_value_unit((HklParameter *)&geometry->axes[j]);
+		row[_solutionModelColumns->index] = i++;
+		row[_solutionModelColumns->item] = *item;
+
+		const HklGeometry *geometry = hkl_geometry_list_item_geometry_get(*item);
+		const darray_parameter *axes = hkl_geometry_axes_get(geometry);
+		darray_foreach(axis, *axes){
+			row[_solutionModelColumns->axes[j++]] =		\
+				hkl_parameter_value_unit_get(*axis);
+		}
 	}
 }
diff --git a/gui/ghkl.h b/gui/hkl-gui.h
similarity index 93%
rename from gui/ghkl.h
rename to gui/hkl-gui.h
index 6841804..d71c2db 100644
--- a/gui/ghkl.h
+++ b/gui/hkl-gui.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,12 +23,19 @@
 #define __GHKL_H__
 
 #include <map>
+#include <string>
+
 #include <iostream>
 
 #include <gtkmm.h>
 
-#include "pseudoaxesframe.h"
-#include "modelcolumns.h"
+#include "hkl-gui-pseudoaxes.h"
+#include "hkl-gui-modelcolumns.h"
+#include "hkl.h"
+
+#ifdef HKL3D
+# include "hkl-gui-3d.h"
+#endif
 
 #define LOG std::cout << __func__ << std::endl;
 
@@ -67,9 +74,9 @@ protected:
 	virtual void on_checkbutton_alpha_toggled(void);
 	virtual void on_checkbutton_beta_toggled(void);
 	virtual void on_checkbutton_gamma_toggled(void);
-	virtual void on_checkbutton_Ux_toggled(void);
-	virtual void on_checkbutton_Uy_toggled(void);
-	virtual void on_checkbutton_Uz_toggled(void);
+	virtual void on_checkbutton_ux_toggled(void);
+	virtual void on_checkbutton_uy_toggled(void);
+	virtual void on_checkbutton_uz_toggled(void);
 
 	virtual void on_cell_TreeView_axes_read_edited(Glib::ustring const &,
 						       Glib::ustring const &);
@@ -81,7 +88,6 @@ protected:
 						      Glib::ustring const &);
 	virtual void on_cell_TreeView_pseudoAxes_write_edited(Glib::ustring const &,
 							      Glib::ustring const &);
-	virtual void on_cell_TreeView_pseudoAxes_is_initialized_toggled(Glib::ustring const &);
 	virtual void on_cell_TreeView_pseudoAxes_parameters_value_edited(Glib::ustring const &,
 									 Glib::ustring const &);
 	virtual void on_cell_TreeView_crystals_name_edited(Glib::ustring const &,
@@ -122,6 +128,7 @@ protected:
 	void set_up_TreeView_treeview1(void);
 	void set_up_TreeView_reflections(void);
 	void set_up_TreeView_crystals(void);
+	void set_up_3D(void);
 	void updateSource(void);
 	void updateAxes(void);
 	void updatePseudoAxes(void);
@@ -200,9 +207,9 @@ private:
 	Gtk::CheckButton *_checkbutton_alpha;
 	Gtk::CheckButton *_checkbutton_beta;
 	Gtk::CheckButton *_checkbutton_gamma;
-	Gtk::CheckButton *_checkbutton_Ux;
-	Gtk::CheckButton *_checkbutton_Uy;
-	Gtk::CheckButton *_checkbutton_Uz;
+	Gtk::CheckButton *_checkbutton_ux;
+	Gtk::CheckButton *_checkbutton_uy;
+	Gtk::CheckButton *_checkbutton_uz;
 	Gtk::TreeView *_treeViewReflections;
 	Gtk::TreeView *_treeViewCrystals;
 	Gtk::TreeView *_TreeView_axes;
@@ -220,6 +227,7 @@ private:
 	Gtk::ToolButton *_toolbutton_affiner;
 	Gtk::Statusbar *_statusBar;
 	Gtk::ImageMenuItem *_menuitem5; // menu preferences
+	Gtk::VBox *_vbox7; // for the 3D
 	Gtk::ImageMenuItem *_imagemenuitem5; //quit
 
 	// dialog1 preferences
@@ -229,9 +237,10 @@ private:
 
 	HklGeometry *_geometry;
 	HklDetector *_detector;
-	HklSampleList *_samples;
+	HklSample *_sample;
+	std::map<std::string, HklSample *> _samples;	
 	HklLattice *_reciprocal;
-	HklPseudoAxisEngineList *_engines;
+	HklEngineList *_engines;
 
 	unsigned int _nb_axes;
 	unsigned int _nb_sampleAxes;
@@ -255,7 +264,7 @@ private:
 	Glib::RefPtr<Gtk::ListStore> _pseudoAxeModel;
 
 	ParameterModelColumns _parameterModelColumns;
-	std::map<HklPseudoAxis *, Glib::RefPtr<Gtk::ListStore> > _mapPseudoAxeParameterModel;
+	std::map<HklParameter *, Glib::RefPtr<Gtk::ListStore> > _mapPseudoAxeParameterModel;
 
 	SolutionModelColumns *_solutionModelColumns;
 	Glib::RefPtr<Gtk::ListStore> _solutionModel;
@@ -266,6 +275,10 @@ private:
 	Gtk::MessageDialog *_message;
 
 	std::vector<PseudoAxesFrame *> _pseudoAxesFrames;
+
+#ifdef HKL3D
+	Hkl3DFrame *_Scene;
+#endif
 };
 
 #endif // __GHKL_H__
diff --git a/gui/hkl3d/GL_ShapeDrawer.cpp b/gui/hkl3d/GL_ShapeDrawer.cpp
new file mode 100644
index 0000000..1a0170d
--- /dev/null
+++ b/gui/hkl3d/GL_ShapeDrawer.cpp
@@ -0,0 +1,805 @@
+/*
+  Bullet Continuous Collision Detection and Physics Library
+  Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+  This software is provided 'as-is', without any express or implied warranty.
+  In no event will the authors be held liable for any damages arising from the use of this software.
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it freely,
+  subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+/*
+ * This file is part of the hkl3d library.
+ * inspired from logo-model.c of the GtkGLExt logo models.
+ * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#include <stdio.h> //printf debugging
+#include <map>
+
+#include "GL_ShapeDrawer.h"
+#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "BulletCollision/CollisionShapes/btConeShape.h"
+#include "BulletCollision/CollisionShapes/btCylinderShape.h"
+#include "BulletCollision/CollisionShapes/btTetrahedronShape.h"
+#include "BulletCollision/CollisionShapes/btCompoundShape.h"
+#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
+#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btUniformScalingShape.h"
+#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
+#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
+
+
+///
+#include "BulletCollision/CollisionShapes/btShapeHull.h"
+#include "LinearMath/btTransformUtil.h"
+#include "LinearMath/btIDebugDraw.h"
+
+//#define USE_DISPLAY_LISTS 1
+#ifdef USE_DISPLAY_LISTS
+
+using namespace std;
+
+//Set for storing Display list per trimesh
+struct TRIMESH_KEY
+{
+	btCollisionShape* m_shape;
+	GLuint m_dlist;//OpenGL display list
+};
+
+typedef map<unsigned long,TRIMESH_KEY> TRIMESH_KEY_MAP;
+
+typedef pair<unsigned long,TRIMESH_KEY> TRIMESH_KEY_PAIR;
+
+TRIMESH_KEY_MAP g_display_lists;
+
+class GlDisplaylistDrawcallback : public btTriangleCallback
+{
+public:
+
+	virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex)
+		{
+
+			btVector3 diff1 = triangle[1] - triangle[0];
+			btVector3 diff2 = triangle[2] - triangle[0];
+			btVector3 normal = diff1.cross(diff2);
+
+			normal.normalize();
+
+			glBegin(GL_TRIANGLES);
+			glColor3f(1, 1, 1);
+			glNormal3d(normal.getX(),normal.getY(),normal.getZ());
+			glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
+
+			//glColor3f(0, 1, 0);
+			glNormal3d(normal.getX(),normal.getY(),normal.getZ());
+			glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
+
+			//glColor3f(0, 1, 0);
+			glNormal3d(normal.getX(),normal.getY(),normal.getZ());
+			glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
+			glEnd();
+		}
+};
+
+GLuint  OGL_get_displaylist_for_shape(btCollisionShape * shape)
+{
+	TRIMESH_KEY_MAP::iterator map_iter;
+
+	unsigned long key = (unsigned long)shape;
+	map_iter = g_display_lists.find(key);
+	if(map_iter!=g_display_lists.end())
+		return map_iter->second.m_dlist;
+
+	return 0;
+}
+
+void OGL_displaylist_clean(void)
+{
+	TRIMESH_KEY_MAP::iterator map_iter,map_itend;
+
+	map_iter = g_display_lists.begin();
+
+	while(map_iter!=map_itend){
+		glDeleteLists(map_iter->second.m_dlist,1);
+		map_iter++;
+	}
+
+	g_display_lists.clear();
+}
+
+
+void OGL_displaylist_register_shape(btCollisionShape *shape)
+{
+	btVector3 aabbMax(btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT));
+	btVector3 aabbMin(-btScalar(BT_LARGE_FLOAT), -btScalar(BT_LARGE_FLOAT), -btScalar(BT_LARGE_FLOAT));
+	GlDisplaylistDrawcallback drawCallback;
+	TRIMESH_KEY dlist;
+
+	dlist.m_dlist = glGenLists(1);
+	dlist.m_shape = shape;
+
+	unsigned long key = (unsigned long)shape;
+
+	g_display_lists.insert(TRIMESH_KEY_PAIR(key,dlist));
+
+	glNewList(dlist.m_dlist,GL_COMPILE);
+
+	glCullFace(GL_BACK);
+
+	if (shape->isConcave()){
+		btConcaveShape* concaveMesh = (btConcaveShape*) shape;
+		concaveMesh->processAllTriangles(&drawCallback,aabbMin,aabbMax);
+	}
+
+	glEndList();
+}
+#endif //USE_DISPLAY_LISTS
+
+void GL_ShapeDrawer::drawCoordSystem(void)  {
+	glBegin(GL_LINES);
+	glColor3f(1, 0, 0);
+	glVertex3d(0, 0, 0);
+	glVertex3d(1, 0, 0);
+	glColor3f(0, 1, 0);
+	glVertex3d(0, 0, 0);
+	glVertex3d(0, 1, 0);
+	glColor3f(0, 0, 1);
+	glVertex3d(0, 0, 0);
+	glVertex3d(0, 0, 1);
+	glEnd();
+}
+
+class GlDrawcallback : public btTriangleCallback
+{
+
+public:
+
+	bool m_wireframe;
+
+	GlDrawcallback()
+		:m_wireframe(false)
+		{
+		}
+
+	virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
+		{
+
+			(void)triangleIndex;
+			(void)partId;
+
+			if (m_wireframe){
+				glBegin(GL_LINES);
+				glColor3f(1, 0, 0);
+				glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
+				glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
+				glColor3f(0, 1, 0);
+				glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
+				glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
+				glColor3f(0, 0, 1);
+				glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
+				glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
+				glEnd();
+			}else{
+				glBegin(GL_TRIANGLES);
+
+				glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
+				glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
+				glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
+
+				glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
+				glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
+				glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
+				glEnd();
+			}
+		}
+};
+
+class TriangleGlDrawcallback : public btInternalTriangleIndexCallback
+{
+public:
+	virtual void internalProcessTriangleIndex(btVector3 *triangle, int partId, int triangleIndex)
+		{
+			(void)triangleIndex;
+			(void)partId;
+
+			glBegin(GL_TRIANGLES);//LINES);
+			glColor3f(1, 0, 0);
+			glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
+			glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
+			glColor3f(0, 1, 0);
+			glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
+			glVertex3d(triangle[1].getX(), triangle[1].getY(), triangle[1].getZ());
+			glColor3f(0, 0, 1);
+			glVertex3d(triangle[2].getX(), triangle[2].getY(), triangle[2].getZ());
+			glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
+			glEnd();
+		}
+};
+
+
+void GL_ShapeDrawer::drawSphere(btScalar radius, int lats, int longs)
+{
+	int i, j;
+	for(i=0;i<=lats;i++){
+		btScalar lat0 = SIMD_PI * (-btScalar(0.5) + (btScalar) (i - 1) / lats);
+		btScalar z0  = radius*sin(lat0);
+		btScalar zr0 =  radius*cos(lat0);
+
+		btScalar lat1 = SIMD_PI * (-btScalar(0.5) + (btScalar) i / lats);
+		btScalar z1 = radius*sin(lat1);
+		btScalar zr1 = radius*cos(lat1);
+
+		glBegin(GL_QUAD_STRIP);
+		for(j=0;j<=longs;j++) {
+			btScalar lng = 2 * SIMD_PI * (btScalar) (j - 1) / longs;
+			btScalar x = cos(lng);
+			btScalar y = sin(lng);
+			glNormal3f(x * zr1, y * zr1, z1);
+			glVertex3f(x * zr1, y * zr1, z1);
+			glNormal3f(x * zr0, y * zr0, z0);
+			glVertex3f(x * zr0, y * zr0, z0);
+		}
+		glEnd();
+	}
+}
+
+GL_ShapeDrawer::ShapeCache* GL_ShapeDrawer::cache(btConvexShape *shape)
+{
+	ShapeCache *sc = (ShapeCache*)shape->getUserPointer();
+	if(!sc){
+		sc = new(btAlignedAlloc(sizeof(ShapeCache),16)) ShapeCache(shape);
+		sc->m_shapehull.buildHull(shape->getMargin());
+		m_shapecaches.push_back(sc);
+		shape->setUserPointer(sc);
+		/* Build edges	*/
+		const int ni = sc->m_shapehull.numIndices();
+		const int nv = sc->m_shapehull.numVertices();
+		const unsigned int *pi = sc->m_shapehull.getIndexPointer();
+		const btVector3 *pv = sc->m_shapehull.getVertexPointer();
+		btAlignedObjectArray<ShapeCache::Edge*>	edges;
+		sc->m_edges.reserve(ni);
+		edges.resize(nv*nv,0);
+		for(int i=0;i<ni;i+=3){
+			const unsigned int *ti = pi+i;
+			const btVector3 nrm = btCross(pv[ti[1]]-pv[ti[0]],pv[ti[2]]-pv[ti[0]]).normalized();
+			for(int j=2,k=0;k<3;j=k++){
+				const unsigned int a=ti[j];
+				const unsigned int b=ti[k];
+				ShapeCache::Edge*& e=edges[btMin(a,b)*nv+btMax(a,b)];
+				if(!e){
+					sc->m_edges.push_back(ShapeCache::Edge());
+					e=&sc->m_edges[sc->m_edges.size()-1];
+					e->n[0]=nrm;e->n[1]=-nrm;
+					e->v[0]=a;e->v[1]=b;
+				}else{
+					e->n[1]=nrm;
+				}
+			}
+		}
+	}
+	return(sc);
+}
+
+void renderSquareA(float x, float y, float z)
+{
+	glBegin(GL_LINE_LOOP);
+	glVertex3f(x, y, z);
+	glVertex3f(x + 10.f, y, z);
+	glVertex3f(x + 10.f, y + 10.f, z);
+	glVertex3f(x, y + 10.f, z);
+	glEnd();
+}
+
+inline void glDrawVector(const btVector3& v) { glVertex3d(v[0], v[1], v[2]); }
+
+
+void GL_ShapeDrawer::drawOpenGL(btScalar *m, const btCollisionShape *shape,
+				const btVector3 & color,int debugMode,
+				const btVector3 & worldBoundsMin, const btVector3 & worldBoundsMax)
+{
+
+	if (shape->getShapeType() == CUSTOM_CONVEX_SHAPE_TYPE){
+		btVector3 org(m[12], m[13], m[14]);
+		btVector3 dx(m[0], m[1], m[2]);
+		btVector3 dy(m[4], m[5], m[6]);
+		const btBoxShape* boxShape = static_cast<const btBoxShape*>(shape);
+		btVector3 halfExtent = boxShape->getHalfExtentsWithMargin();
+		dx *= halfExtent[0];
+		dy *= halfExtent[1];
+		glColor3f(1,1,1);
+		glDisable(GL_LIGHTING);
+		glLineWidth(2);
+
+		glBegin(GL_LINE_LOOP);
+		glDrawVector(org - dx - dy);
+		glDrawVector(org - dx + dy);
+		glDrawVector(org + dx + dy);
+		glDrawVector(org + dx - dy);
+		glEnd();
+		return;
+	}else if((shape->getShapeType() == BOX_SHAPE_PROXYTYPE) && (debugMode & btIDebugDraw::DBG_FastWireframe)){
+		btVector3 org(m[12], m[13], m[14]);
+		btVector3 dx(m[0], m[1], m[2]);
+		btVector3 dy(m[4], m[5], m[6]);
+		btVector3 dz(m[8], m[9], m[10]);
+		const btBoxShape* boxShape = static_cast<const btBoxShape*>(shape);
+		btVector3 halfExtent = boxShape->getHalfExtentsWithMargin();
+		dx *= halfExtent[0];
+		dy *= halfExtent[1];
+		dz *= halfExtent[2];
+		glBegin(GL_LINE_LOOP);
+		glDrawVector(org - dx - dy - dz);
+		glDrawVector(org + dx - dy - dz);
+		glDrawVector(org + dx + dy - dz);
+		glDrawVector(org - dx + dy - dz);
+		glDrawVector(org - dx + dy + dz);
+		glDrawVector(org + dx + dy + dz);
+		glDrawVector(org + dx - dy + dz);
+		glDrawVector(org - dx - dy + dz);
+		glEnd();
+		glBegin(GL_LINES);
+		glDrawVector(org + dx - dy - dz);
+		glDrawVector(org + dx - dy + dz);
+		glDrawVector(org + dx + dy - dz);
+		glDrawVector(org + dx + dy + dz);
+		glDrawVector(org - dx - dy - dz);
+		glDrawVector(org - dx + dy - dz);
+		glDrawVector(org - dx - dy + dz);
+		glDrawVector(org - dx + dy + dz);
+		glEnd();
+		return;
+	}
+
+	glPushMatrix();
+	btglMultMatrix(m);
+
+	if (shape->getShapeType() == UNIFORM_SCALING_SHAPE_PROXYTYPE){
+		const btUniformScalingShape* scalingShape = static_cast<const btUniformScalingShape*>(shape);
+		const btConvexShape* convexShape = scalingShape->getChildShape();
+		float	scalingFactor = (float)scalingShape->getUniformScalingFactor();
+		{
+			btScalar tmpScaling[4][4]={{scalingFactor,0,0,0},
+						   {0,scalingFactor,0,0},
+						   {0,0,scalingFactor,0},
+						   {0,0,0,1}};
+
+			drawOpenGL( (btScalar*)tmpScaling,convexShape,color,debugMode,worldBoundsMin,worldBoundsMax);
+		}
+		glPopMatrix();
+		return;
+	}
+
+	if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE){
+		const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(shape);
+		for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--){
+			btTransform childTrans = compoundShape->getChildTransform(i);
+			const btCollisionShape* colShape = compoundShape->getChildShape(i);
+			btScalar childMat[16];
+			childTrans.getOpenGLMatrix(childMat);
+			drawOpenGL(childMat,colShape,color,debugMode,worldBoundsMin,worldBoundsMax);
+		}
+
+	}else{
+		if(m_textureenabled&&(!m_textureinitialized)){
+			GLubyte *image = new GLubyte[256*256*3];
+			for(int y=0;y<256;++y){
+				const int t = y>>4;
+				GLubyte *pi = image+y*256*3;
+				for(int x=0;x<256;++x){
+					const int s = x>>4;
+					const GLubyte b = 180;
+					GLubyte c = b+((s+t&1)&1)*(255-b);
+					pi[0] = pi[1] = pi[2] = c;
+					pi += 3;
+				}
+			}
+
+			glGenTextures(1,(GLuint*)&m_texturehandle);
+			glBindTexture(GL_TEXTURE_2D,m_texturehandle);
+			glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
+			glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
+			glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);
+			glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
+			glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
+			gluBuild2DMipmaps(GL_TEXTURE_2D,3,256,256,GL_RGB,GL_UNSIGNED_BYTE,image);
+			delete[] image;
+
+
+		}
+
+		glMatrixMode(GL_TEXTURE);
+		glLoadIdentity();
+		glScalef(0.025f,0.025f,0.025f);
+		glMatrixMode(GL_MODELVIEW);
+
+		static const GLfloat planex[]={1,0,0,0};
+		//	static const GLfloat	planey[]={0,1,0,0};
+		static const GLfloat planez[]={0,0,1,0};
+		glTexGenfv(GL_S,GL_OBJECT_PLANE,planex);
+		glTexGenfv(GL_T,GL_OBJECT_PLANE,planez);
+		glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
+		glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_OBJECT_LINEAR);
+		glEnable(GL_TEXTURE_GEN_S);
+		glEnable(GL_TEXTURE_GEN_T);
+		glEnable(GL_TEXTURE_GEN_R);
+		m_textureinitialized=true;
+
+		glEnable(GL_COLOR_MATERIAL);
+		if(m_textureenabled){
+			glEnable(GL_TEXTURE_2D);
+			glBindTexture(GL_TEXTURE_2D,m_texturehandle);
+		}else{
+			glDisable(GL_TEXTURE_2D);
+		}
+
+		glColor3f(color.x(),color.y(), color.z());
+
+		bool useWireframeFallback = true;
+
+		if (!(debugMode & btIDebugDraw::DBG_DrawWireframe)){
+			///you can comment out any of the specific cases, and use the default
+
+			///the benefit of 'default' is that it approximates the actual collision shape including collision margin
+			//int shapetype=m_textureenabled?MAX_BROADPHASE_COLLISION_TYPES:shape->getShapeType();
+			int shapetype=shape->getShapeType();
+			switch (shapetype){
+
+			case SPHERE_SHAPE_PROXYTYPE:
+			{
+				const btSphereShape* sphereShape = static_cast<const btSphereShape*>(shape);
+				float radius = sphereShape->getMargin();//radius doesn't include the margin, so draw with margin
+				drawSphere(radius,10,10);
+				useWireframeFallback = false;
+				break;
+			}
+
+			case BOX_SHAPE_PROXYTYPE:
+			{
+				const btBoxShape* boxShape = static_cast<const btBoxShape*>(shape);
+				btVector3 halfExtent = boxShape->getHalfExtentsWithMargin();
+
+				static int indices[36] = {
+					0,1,2,
+					3,2,1,
+					4,0,6,
+					6,0,2,
+					5,1,4,
+					4,1,0,
+					7,3,1,
+					7,1,5,
+					5,4,7,
+					7,4,6,
+					7,2,3,
+					7,6,2};
+
+				btVector3 vertices[8]={
+					btVector3(halfExtent[0],halfExtent[1],halfExtent[2]),
+					btVector3(-halfExtent[0],halfExtent[1],halfExtent[2]),
+					btVector3(halfExtent[0],-halfExtent[1],halfExtent[2]),
+					btVector3(-halfExtent[0],-halfExtent[1],halfExtent[2]),
+					btVector3(halfExtent[0],halfExtent[1],-halfExtent[2]),
+					btVector3(-halfExtent[0],halfExtent[1],-halfExtent[2]),
+					btVector3(halfExtent[0],-halfExtent[1],-halfExtent[2]),
+					btVector3(-halfExtent[0],-halfExtent[1],-halfExtent[2])};
+#if 1
+				glBegin (GL_TRIANGLES);
+				int si=36;
+				for (int i=0;i<si;i+=3){
+					const btVector3& v1 = vertices[indices[i]];;
+					const btVector3& v2 = vertices[indices[i+1]];
+					const btVector3& v3 = vertices[indices[i+2]];
+					btVector3 normal = (v3-v1).cross(v2-v1);
+					normal.normalize ();
+					glNormal3f(normal.getX(),normal.getY(),normal.getZ());
+					glVertex3f (v1.x(), v1.y(), v1.z());
+					glVertex3f (v2.x(), v2.y(), v2.z());
+					glVertex3f (v3.x(), v3.y(), v3.z());
+
+				}
+				glEnd();
+#endif
+
+				useWireframeFallback = false;
+				break;
+			}
+
+
+
+#if 0
+
+			case CONE_SHAPE_PROXYTYPE:
+			{
+				const btConeShape* coneShape = static_cast<const btConeShape*>(shape);
+				int upIndex = coneShape->getConeUpIndex();
+				float radius = coneShape->getRadius();//+coneShape->getMargin();
+				float height = coneShape->getHeight();//+coneShape->getMargin();
+				switch (upIndex)
+				{
+				case 0:
+					glRotatef(90.0, 0.0, 1.0, 0.0);
+					break;
+				case 1:
+					glRotatef(-90.0, 1.0, 0.0, 0.0);
+					break;
+				case 2:
+					break;
+				default:
+				{
+				}
+				};
+
+				glTranslatef(0.0, 0.0, -0.5*height);
+				glutSolidCone(radius,height,10,10);
+				useWireframeFallback = false;
+				break;
+
+			}
+#endif
+
+			case STATIC_PLANE_PROXYTYPE:
+			{
+				const btStaticPlaneShape* staticPlaneShape = static_cast<const btStaticPlaneShape*>(shape);
+				btScalar planeConst = staticPlaneShape->getPlaneConstant();
+				const btVector3& planeNormal = staticPlaneShape->getPlaneNormal();
+				btVector3 planeOrigin = planeNormal * planeConst;
+				btVector3 vec0,vec1;
+				btPlaneSpace1(planeNormal,vec0,vec1);
+				btScalar vecLen = 100.f;
+				btVector3 pt0 = planeOrigin + vec0*vecLen;
+				btVector3 pt1 = planeOrigin - vec0*vecLen;
+				btVector3 pt2 = planeOrigin + vec1*vecLen;
+				btVector3 pt3 = planeOrigin - vec1*vecLen;
+				glBegin(GL_LINES);
+				glVertex3f(pt0.getX(),pt0.getY(),pt0.getZ());
+				glVertex3f(pt1.getX(),pt1.getY(),pt1.getZ());
+				glVertex3f(pt2.getX(),pt2.getY(),pt2.getZ());
+				glVertex3f(pt3.getX(),pt3.getY(),pt3.getZ());
+				glEnd();
+
+
+				break;
+
+			}
+
+			case MULTI_SPHERE_SHAPE_PROXYTYPE:
+			{
+				const btMultiSphereShape* multiSphereShape = static_cast<const btMultiSphereShape*>(shape);
+
+				btTransform childTransform;
+				childTransform.setIdentity();
+
+
+				for (int i = multiSphereShape->getSphereCount()-1; i>=0;i--){
+					btSphereShape sc(multiSphereShape->getSphereRadius(i));
+					childTransform.setOrigin(multiSphereShape->getSpherePosition(i));
+					btScalar childMat[16];
+					childTransform.getOpenGLMatrix(childMat);
+					drawOpenGL(childMat,&sc,color,debugMode,worldBoundsMin,worldBoundsMax);
+				}
+
+				break;
+			}
+
+			default:
+			{
+				if (shape->isConvex()){
+					ShapeCache *sc = cache((btConvexShape*)shape);
+#if 0
+					btConvexShape *convexShape = (btConvexShape*)shape;
+					if (!shape->getUserPointer()){
+						//create a hull approximation
+						void *mem = btAlignedAlloc(sizeof(btShapeHull),16);
+						btShapeHull *hull = new(mem) btShapeHull(convexShape);
+
+						///cleanup memory
+						m_shapeHulls.push_back(hull);
+
+						btScalar margin = shape->getMargin();
+						hull->buildHull(margin);
+						convexShape->setUserPointer(hull);
+					}
+#endif
+					{
+						btShapeHull* hull = &sc->m_shapehull;
+
+						if (hull->numTriangles () > 0){
+							int index = 0;
+							const unsigned int* idx = hull->getIndexPointer();
+							const btVector3* vtx = hull->getVertexPointer();
+
+							glBegin (GL_TRIANGLES);
+
+							for (int i = 0; i < hull->numTriangles (); i++){
+								int i1 = index++;
+								int i2 = index++;
+								int i3 = index++;
+								btAssert(i1 < hull->numIndices () &&
+									 i2 < hull->numIndices () &&
+									 i3 < hull->numIndices ());
+
+								int index1 = idx[i1];
+								int index2 = idx[i2];
+								int index3 = idx[i3];
+								btAssert(index1 < hull->numVertices () &&
+									 index2 < hull->numVertices () &&
+									 index3 < hull->numVertices ());
+
+								btVector3 v1 = vtx[index1];
+								btVector3 v2 = vtx[index2];
+								btVector3 v3 = vtx[index3];
+								btVector3 normal = (v3-v1).cross(v2-v1);
+								normal.normalize ();
+								glNormal3f(normal.getX(),normal.getY(),normal.getZ());
+								glVertex3f (v1.x(), v1.y(), v1.z());
+								glVertex3f (v2.x(), v2.y(), v2.z());
+								glVertex3f (v3.x(), v3.y(), v3.z());
+
+							}
+							glEnd ();
+
+						}
+					}
+				}
+			}
+			}
+
+		}
+
+		glNormal3f(0,1,0);
+
+		/// for polyhedral shapes
+		if (debugMode==btIDebugDraw::DBG_DrawFeaturesText && (shape->isPolyhedral())){
+			btPolyhedralConvexShape *polyshape = (btPolyhedralConvexShape*) shape;
+			{
+
+				glColor3f(1.f, 1.f, 1.f);
+				int i;
+				for (i=0;i<polyshape->getNumVertices();i++){
+					btVector3 vtx;
+					polyshape->getVertex(i,vtx);
+					char buf[12];
+					sprintf(buf," %d",i);
+				}
+
+				for (i=0;i<polyshape->getNumPlanes();i++){
+					btVector3 normal;
+					btVector3 vtx;
+					polyshape->getPlane(normal,vtx,i);
+				}
+			}
+		}
+
+
+#ifdef USE_DISPLAY_LISTS
+
+		if (shape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE||shape->getShapeType() == GIMPACT_SHAPE_PROXYTYPE){
+			GLuint dlist =   OGL_get_displaylist_for_shape((btCollisionShape * )shape);
+			if (dlist){
+				glCallList(dlist);
+			}else{
+#else
+				if (shape->isConcave() && !shape->isInfinite()){
+					btConcaveShape* concaveMesh = (btConcaveShape*) shape;
+
+					GlDrawcallback drawCallback;
+					drawCallback.m_wireframe = (debugMode & btIDebugDraw::DBG_DrawWireframe)!=0;
+
+					concaveMesh->processAllTriangles(&drawCallback,worldBoundsMin,worldBoundsMax);
+				}
+#endif
+
+#ifdef USE_DISPLAY_LISTS
+			}
+		}
+#endif
+	}
+	glPopMatrix();
+}
+
+//
+void GL_ShapeDrawer::drawShadow(btScalar *m, const btVector3 & extrusion, const btCollisionShape *shape,
+				const btVector3 & worldBoundsMin, const btVector3 & worldBoundsMax)
+{
+	glPushMatrix();
+	btglMultMatrix(m);
+	if(shape->getShapeType() == UNIFORM_SCALING_SHAPE_PROXYTYPE){
+		const btUniformScalingShape *scalingShape = static_cast<const btUniformScalingShape*>(shape);
+		const btConvexShape *convexShape = scalingShape->getChildShape();
+		float scalingFactor = (float)scalingShape->getUniformScalingFactor();
+		btScalar tmpScaling[4][4]={{scalingFactor,0,0,0},
+					   {0,scalingFactor,0,0},
+					   {0,0,scalingFactor,0},
+					   {0,0,0,1}};
+		drawShadow((btScalar*)tmpScaling,extrusion,convexShape,worldBoundsMin,worldBoundsMax);
+		glPopMatrix();
+		return;
+	}else if(shape->getShapeType()==COMPOUND_SHAPE_PROXYTYPE){
+		const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(shape);
+		for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--){
+			btTransform childTrans = compoundShape->getChildTransform(i);
+			const btCollisionShape* colShape = compoundShape->getChildShape(i);
+			btScalar childMat[16];
+			childTrans.getOpenGLMatrix(childMat);
+			drawShadow(childMat,extrusion*childTrans.getBasis(),colShape,worldBoundsMin,worldBoundsMax);
+		}
+	}else{
+		//	bool useWireframeFallback = true;
+		if (shape->isConvex()){
+			ShapeCache *sc = cache((btConvexShape*)shape);
+			btShapeHull *hull = &sc->m_shapehull;
+			glBegin(GL_QUADS);
+			for(int i=0;i<sc->m_edges.size();++i){
+				const btScalar d = btDot(sc->m_edges[i].n[0],extrusion);
+				if((d*btDot(sc->m_edges[i].n[1],extrusion))<0){
+					const int q = d<0?1:0;
+					const btVector3 & a = hull->getVertexPointer()[sc->m_edges[i].v[q]];
+					const btVector3 & b = hull->getVertexPointer()[sc->m_edges[i].v[1-q]];
+					glVertex3f(a[0],a[1],a[2]);
+					glVertex3f(b[0],b[1],b[2]);
+					glVertex3f(b[0]+extrusion[0],b[1]+extrusion[1],b[2]+extrusion[2]);
+					glVertex3f(a[0]+extrusion[0],a[1]+extrusion[1],a[2]+extrusion[2]);
+				}
+			}
+			glEnd();
+		}
+
+	}
+
+	if (shape->isConcave()){
+		btConcaveShape *concaveMesh = (btConcaveShape*) shape;
+
+		GlDrawcallback drawCallback;
+		drawCallback.m_wireframe = false;
+
+		concaveMesh->processAllTriangles(&drawCallback,worldBoundsMin,worldBoundsMax);
+
+	}
+	glPopMatrix();
+}
+
+//
+GL_ShapeDrawer::GL_ShapeDrawer()
+{
+	m_texturehandle = 0;
+	m_textureenabled = false;
+	m_textureinitialized = false;
+}
+
+GL_ShapeDrawer::~GL_ShapeDrawer()
+{
+	int i;
+	for (i=0;i<m_shapecaches.size();i++){
+		m_shapecaches[i]->~ShapeCache();
+		btAlignedFree(m_shapecaches[i]);
+	}
+	m_shapecaches.clear();
+	if(m_textureinitialized)
+		glDeleteTextures(1,(const GLuint*) &m_texturehandle);
+}
diff --git a/gui/hkl3d/GL_ShapeDrawer.h b/gui/hkl3d/GL_ShapeDrawer.h
new file mode 100644
index 0000000..9473949
--- /dev/null
+++ b/gui/hkl3d/GL_ShapeDrawer.h
@@ -0,0 +1,111 @@
+/*
+  Bullet Continuous Collision Detection and Physics Library
+  Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+  This software is provided 'as-is', without any express or implied warranty.
+  In no event will the authors be held liable for any damages arising from the use of this software.
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it freely,
+  subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+/*
+ * This file is part of the hkl3d library.
+ * inspired from logo-model.c of the GtkGLExt logo models.
+ * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#ifndef GL_SHAPE_DRAWER_H
+#define GL_SHAPE_DRAWER_H
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+/* forward declaration */
+class btCollisionShape;
+class btShapeHull;
+
+#include "LinearMath/btAlignedObjectArray.h"
+#include "LinearMath/btVector3.h"
+#include "BulletCollision/CollisionShapes/btShapeHull.h"
+
+#if defined(BT_USE_DOUBLE_PRECISION)
+#define btglLoadMatrix glLoadMatrixd
+#define btglMultMatrix glMultMatrixd
+#define btglColor3 glColor3d
+#define btglVertex3 glVertex3d
+#else
+#define btglLoadMatrix glLoadMatrixf
+#define btglMultMatrix glMultMatrixf
+#define btglColor3 glColor3f
+#define btglVertex3 glVertex3d
+#endif
+
+/// OpenGL shape drawing
+class GL_ShapeDrawer
+{
+protected:
+	struct ShapeCache
+	{
+		struct Edge
+		{
+			btVector3 n[2];
+			int v[2];
+		};
+	ShapeCache(btConvexShape* s) : m_shapehull(s) {}
+		btShapeHull m_shapehull;
+		btAlignedObjectArray<Edge> m_edges;
+	};
+	//clean-up memory of dynamically created shape hulls
+	btAlignedObjectArray<ShapeCache*> m_shapecaches;
+	unsigned int m_texturehandle;
+	bool m_textureenabled;
+	bool m_textureinitialized;
+
+	ShapeCache *cache(btConvexShape*);
+
+public:
+	GL_ShapeDrawer(void);
+	virtual ~GL_ShapeDrawer(void);
+
+	///drawOpenGL might allocate temporary memoty, stores pointer in shape userpointer
+	virtual void drawOpenGL(btScalar *m, const btCollisionShape *shape,
+				const btVector3 & color, int debugMode,
+				const btVector3 & worldBoundsMin, const btVector3 & worldBoundsMax);
+	virtual void drawShadow(btScalar *m, const btVector3 & extrusion, const btCollisionShape *shape,
+				const btVector3 & worldBoundsMin, const btVector3 & worldBoundsMax);
+
+	bool enableTexture(bool enable) {bool p=m_textureenabled;m_textureenabled=enable; return(p); }
+	bool hasTextureEnabled(void) const {return m_textureenabled;}
+
+	static void drawCylinder(float radius, float halfHeight, int upAxis);
+	void drawSphere(btScalar r, int lats, int longs);
+	static void drawCoordSystem(void);
+};
+
+void OGL_displaylist_register_shape(btCollisionShape *shape);
+void OGL_displaylist_clean(void);
+
+#endif //GL_SHAPE_DRAWER_H
diff --git a/gui/hkl3d/Makefile.am b/gui/hkl3d/Makefile.am
new file mode 100644
index 0000000..b24db3e
--- /dev/null
+++ b/gui/hkl3d/Makefile.am
@@ -0,0 +1,47 @@
+AM_CXXFLAGS = \
+	-fpermissive \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/hkl \
+	-I$(top_srcdir)/hkl3d \
+	-I$(top_srcdir)/hkl3d/bullet/src \
+	-DPKGDATA=\""$(pkgdatadir)"\" \
+	$(G3D_CFLAGS) \
+	$(GTKGLEXTMM_CFLAGS) \
+	-DG_DISABLE_DEPRECATED \
+	-DGDK_DISABLE_DEPRECATED \
+	-DGDK_PIXBUF_DISABLE_DEPRECATED	\
+	-DGTK_DISABLE_DEPRECATED
+
+AM_CFLAGS = $(AM_CXXFLAGS)
+
+AM_LDFLAGS = \
+	$(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/hkl3d/libhkl3d.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletdynamics.la \
+	$(G3D_LIBS) \
+	$(GLU_LIBS) \
+	$(GTKGLEXTMM_LIBS)
+
+noinst_LTLIBRARIES = libhkl3d-gui.la
+libhkl3d_gui_la_SOURCES = \
+	texture.h \
+	texture.c \
+	hkl3d-gui-gl.h \
+	hkl3d-gui-gl.c \
+	hkl3d-gui-view.h \
+	hkl3d-gui-view.cpp \
+	hkl3d-gui-model.h \
+	hkl3d-gui-model.cpp \
+	hkl3d-gui-scene.h \
+	hkl3d-gui-scene.cpp \
+	trackball.h \
+	trackball.c \
+	GL_ShapeDrawer.h \
+	GL_ShapeDrawer.cpp
+
+# Support for GNU Flymake, in Emacs.
+check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
+check-syntax:
+	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
+
+.PHONY: check-syntax
diff --git a/gui/hkl3d/Makefile.in b/gui/hkl3d/Makefile.in
new file mode 100644
index 0000000..d87b214
--- /dev/null
+++ b/gui/hkl3d/Makefile.in
@@ -0,0 +1,714 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = gui/hkl3d
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libhkl3d_gui_la_LIBADD =
+am_libhkl3d_gui_la_OBJECTS = texture.lo hkl3d-gui-gl.lo \
+	hkl3d-gui-view.lo hkl3d-gui-model.lo hkl3d-gui-scene.lo \
+	trackball.lo GL_ShapeDrawer.lo
+libhkl3d_gui_la_OBJECTS = $(am_libhkl3d_gui_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_ at AM_V@)
+am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
+SOURCES = $(libhkl3d_gui_la_SOURCES)
+DIST_SOURCES = $(libhkl3d_gui_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+AM_CXXFLAGS = \
+	-fpermissive \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/hkl \
+	-I$(top_srcdir)/hkl3d \
+	-I$(top_srcdir)/hkl3d/bullet/src \
+	-DPKGDATA=\""$(pkgdatadir)"\" \
+	$(G3D_CFLAGS) \
+	$(GTKGLEXTMM_CFLAGS) \
+	-DG_DISABLE_DEPRECATED \
+	-DGDK_DISABLE_DEPRECATED \
+	-DGDK_PIXBUF_DISABLE_DEPRECATED	\
+	-DGTK_DISABLE_DEPRECATED
+
+AM_CFLAGS = $(AM_CXXFLAGS)
+AM_LDFLAGS = \
+	$(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/hkl3d/libhkl3d.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletdynamics.la \
+	$(G3D_LIBS) \
+	$(GLU_LIBS) \
+	$(GTKGLEXTMM_LIBS)
+
+noinst_LTLIBRARIES = libhkl3d-gui.la
+libhkl3d_gui_la_SOURCES = \
+	texture.h \
+	texture.c \
+	hkl3d-gui-gl.h \
+	hkl3d-gui-gl.c \
+	hkl3d-gui-view.h \
+	hkl3d-gui-view.cpp \
+	hkl3d-gui-model.h \
+	hkl3d-gui-model.cpp \
+	hkl3d-gui-scene.h \
+	hkl3d-gui-scene.cpp \
+	trackball.h \
+	trackball.c \
+	GL_ShapeDrawer.h \
+	GL_ShapeDrawer.cpp
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/hkl3d/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu gui/hkl3d/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libhkl3d-gui.la: $(libhkl3d_gui_la_OBJECTS) $(libhkl3d_gui_la_DEPENDENCIES) $(EXTRA_libhkl3d_gui_la_DEPENDENCIES) 
+	$(AM_V_CXXLD)$(CXXLINK)  $(libhkl3d_gui_la_OBJECTS) $(libhkl3d_gui_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/GL_ShapeDrawer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-gui-gl.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-gui-model.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-gui-scene.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-gui-view.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/texture.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/trackball.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am
+
+
+# Support for GNU Flymake, in Emacs.
+check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
+check-syntax:
+	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
+
+.PHONY: check-syntax
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gui/hkl3d/hkl3d-gui-gl.c b/gui/hkl3d/hkl3d-gui-gl.c
new file mode 100644
index 0000000..92137a2
--- /dev/null
+++ b/gui/hkl3d/hkl3d-gui-gl.c
@@ -0,0 +1,812 @@
+/* $Id: gl.c 127 2009-09-05 19:45:12Z mmmaddd $ */
+
+/*
+	G3DViewer - 3D object viewer
+
+	Copyright (C) 2005, 2006  Markus Dahms <mad at automagically.de>
+
+    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
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include <glib.h>
+
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+#include <g3d/types.h>
+#include <g3d/quat.h>
+#include <g3d/matrix.h>
+#include <g3d/vector.h>
+#include <g3d/face.h>
+
+#include "hkl3d-gui-gl.h"
+
+struct _G3DGLRenderState {
+	gint32 gl_dlist, gl_dlist_shadow;
+	G3DMaterial *prev_material;
+	guint32 prev_texid;
+};
+
+#if DEBUG > 0
+#define TIMING
+#endif
+
+#ifdef TIMING
+static GTimer *timer = NULL;
+#endif
+
+static void gl_init(void)
+{
+	GLenum error;
+
+#if DEBUG > 1
+	g_printerr("init OpenGL\n");
+#endif
+
+
+	GLfloat light0_pos[4] = { -50.0, 50.0, 0.0, 0.0 };
+	GLfloat light0_col[4] = { 0.6, 0.6, 0.6, 1.0 };
+	GLfloat light1_pos[4] = {  50.0, 50.0, 0.0, 0.0 };
+	GLfloat light1_col[4] = { 0.4, 0.4, 0.4, 1.0 };
+	GLfloat ambient_lc[4] = { 0.35, 0.35, 0.35, 1.0 };
+
+	/* transparency and blending */
+#if 0
+	glAlphaFunc(GL_GREATER, 0.1);
+#endif
+	glEnable(GL_ALPHA_TEST);
+
+	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+	glEnable(GL_BLEND);
+
+	glDepthFunc(GL_LEQUAL);
+	glDepthMask(GL_TRUE);
+	glEnable(GL_DEPTH_TEST);
+
+
+#if 0
+	glEnable(GL_LINE_SMOOTH);
+	glEnable(GL_POLYGON_SMOOTH);
+#endif
+
+#if 0
+	glDisable(GL_DITHER);
+#endif
+	glShadeModel(GL_SMOOTH);
+
+	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
+	glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
+	glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
+
+	glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient_lc);
+	glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
+#ifdef GL_LIGHT_MODEL_COLOR_CONTROL
+	glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
+#endif
+	glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
+
+	glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);
+	glLightfv(GL_LIGHT0, GL_DIFFUSE,  light0_col);
+	glLightfv(GL_LIGHT1, GL_POSITION, light1_pos);
+	glLightfv(GL_LIGHT1, GL_DIFFUSE,  light1_col);
+	glLightfv(GL_LIGHT1, GL_SPECULAR,  light1_col);
+	glEnable(GL_LIGHT0);
+	glEnable(GL_LIGHT1);
+	glEnable(GL_LIGHTING);
+
+
+	/* colors and materials */
+	glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
+	glEnable(GL_COLOR_MATERIAL);
+
+
+	/* texture stuff */
+	glEnable(GL_TEXTURE_2D);
+
+
+#ifdef TIMING
+	timer = g_timer_new();
+#endif
+}
+
+void gl_set_twoside(gboolean twoside)
+{
+	glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, twoside ? 1 : 0);
+	glColorMaterial(
+		twoside ? GL_FRONT_AND_BACK : GL_FRONT,
+		GL_AMBIENT_AND_DIFFUSE);
+}
+
+void gl_set_textures(gboolean textures)
+{
+	if(textures)
+		glEnable(GL_TEXTURE_2D);
+	else
+	{
+		glBindTexture(GL_TEXTURE_2D, 0);
+		glDisable(GL_TEXTURE_2D);
+	}
+}
+
+/* GHFunc */
+void gl_load_texture(gpointer key, gpointer value, gpointer data)
+{
+	G3DImage *image = (G3DImage *)value;
+	gint32 env;
+	GLenum error;
+
+
+#if 0
+	/* predefined - update object->_tex_images else... */
+	glGenTextures(1, &(image->tex_id));
+#endif
+
+#if DEBUG > 0
+	g_print("gl: loading texture '%s' (%dx%dx%d) - id %d\n",
+		image->name ? image->name : "(null)",
+		image->width, image->height, image->depth,
+		image->tex_id);
+#endif
+
+	glBindTexture(GL_TEXTURE_2D, image->tex_id);
+	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
+		GL_LINEAR_MIPMAP_NEAREST);
+
+
+	switch(image->tex_env)
+	{
+		case G3D_TEXENV_BLEND: env = GL_BLEND; break;
+		case G3D_TEXENV_MODULATE: env = GL_MODULATE; break;
+		case G3D_TEXENV_DECAL: env = GL_DECAL; break;
+		case G3D_TEXENV_REPLACE: env = GL_REPLACE; break;
+		default: env = GL_MODULATE; break;
+	}
+	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, env);
+	gluBuild2DMipmaps(
+		GL_TEXTURE_2D,
+		GL_RGBA,
+		image->width,
+		image->height,
+		GL_RGBA,
+		GL_UNSIGNED_BYTE,
+		image->pixeldata);
+}
+
+static inline void gl_update_material(G3DGLRenderOptions *options,
+	G3DMaterial *material)
+{
+	GLenum facetype;
+	GLfloat normspec[4] = { 0.0, 0.0, 0.0, 1.0 };
+
+	g_return_if_fail(material != NULL);
+
+	if(options->glflags & G3D_FLAG_GL_ALLTWOSIDE)
+		facetype = GL_FRONT_AND_BACK;
+	else
+		facetype = GL_FRONT;
+
+	if(options->glflags & G3D_FLAG_GL_COLORS)
+		glColor4f(
+			material->r,
+			material->g,
+			material->b,
+			material->a);
+	else
+		glColor4f(0.7, 0.7, 0.7, 1.0);
+
+	return;
+
+	if(options->glflags & G3D_FLAG_GL_SPECULAR)
+		glMaterialfv(facetype, GL_SPECULAR, material->specular);
+	else
+		glMaterialfv(facetype, GL_SPECULAR, normspec);
+
+	if(options->glflags & G3D_FLAG_GL_SHININESS)
+		glMaterialf(facetype, GL_SHININESS, material->shininess * 10);
+	else
+		glMaterialf(facetype, GL_SHININESS, 0.0);
+}
+
+static inline void gl_draw_face(G3DGLRenderOptions *options,
+	G3DObject *object, gint32 i, gfloat min_a, gfloat max_a,
+	gboolean *dont_render, gboolean *init, gboolean is_shadow)
+{
+	gint32 j;
+
+	if(*init)
+	{
+		options->state->prev_material = NULL;
+		options->state->prev_texid = 0;
+		*init = FALSE;
+	}
+
+	/* material check */
+	if(!is_shadow && (options->state->prev_material != object->_materials[i]))
+	{
+		if((object->_materials[i]->a < min_a) ||
+			(object->_materials[i]->a >= max_a))
+		{
+			*dont_render = TRUE;
+			return;
+		}
+
+		*dont_render = FALSE;
+
+		glEnd();
+		gl_update_material(options, object->_materials[i]);
+		glBegin(GL_TRIANGLES);
+		options->state->prev_material = object->_materials[i];
+
+		options->state->prev_texid = 0;
+	}
+
+	if(*dont_render) return;
+
+	/* texture stuff */
+	if(!is_shadow && (options->glflags & G3D_FLAG_GL_TEXTURES) &&
+		(object->_flags[i] & G3D_FLAG_FAC_TEXMAP))
+	{
+		/* if texture has changed update to new texture */
+		if(object->_tex_images[i] != options->state->prev_texid) {
+			options->state->prev_texid = object->_tex_images[i];
+			glEnd();
+			glBindTexture(GL_TEXTURE_2D, options->state->prev_texid);
+			glBegin(GL_TRIANGLES);
+#if DEBUG > 5
+			g_print("gl: binding to texture id %d\n", prev_texid);
+#endif
+		}
+	}
+
+	/* draw triangles */
+	for(j = 0; j < 3; j ++)
+	{
+		if(!is_shadow && (options->glflags & G3D_FLAG_GL_TEXTURES) &&
+			(object->_flags[i] & G3D_FLAG_FAC_TEXMAP))
+		{
+			glTexCoord2f(
+				object->_tex_coords[(i * 3 + j) * 2 + 0],
+				object->_tex_coords[(i * 3 + j) * 2 + 1]);
+#if DEBUG > 5
+			g_print("gl: setting texture coords: %f, %f\n",
+				object->_tex_coords[(i * 3 + j) * 2 + 0],
+				object->_tex_coords[(i * 3 + j) * 2 + 1]);
+#endif
+		}
+
+		glNormal3f(
+			object->_normals[(i*3+j)*3+0],
+			object->_normals[(i*3+j)*3+1],
+			object->_normals[(i*3+j)*3+2]);
+		glVertex3f(
+			object->vertex_data[object->_indices[i*3+j]*3+0],
+			object->vertex_data[object->_indices[i*3+j]*3+1],
+			object->vertex_data[object->_indices[i*3+j]*3+2]);
+
+	} /* 1 .. 3 */
+}
+
+static inline void gl_may_end(gint32 ftype)
+{
+	if(ftype != -1)
+		glEnd();
+}
+
+static inline void gl_may_begin(gint32 ftype)
+{
+	if(ftype != -1)
+		glBegin(ftype);
+}
+
+static inline void gl_draw_face_list(G3DGLRenderOptions *options,
+	G3DObject *object, gfloat min_a, gfloat max_a,
+	gboolean *init, gboolean is_shadow)
+{
+	GSList *fitem;
+	G3DFace *face;
+	G3DVector nx, ny, nz;
+	gint32 prev_ftype = -1;
+	gint32 index, j, ftype;
+
+	if(*init) {
+		options->state->prev_material = NULL;
+		options->state->prev_texid = 0;
+		*init = FALSE;
+	}
+
+	for(fitem = object->faces; fitem != NULL; fitem = fitem->next) {
+		face = fitem->data;
+		if(!is_shadow && (options->state->prev_material != face->material)) {
+			if((face->material->a < min_a) || (face->material->a >= max_a)) {
+				return;
+			}
+
+			gl_may_end(prev_ftype);
+			gl_update_material(options, face->material);
+			gl_may_begin(prev_ftype);
+
+			options->state->prev_material = face->material;
+
+			options->state->prev_texid = 0;
+		}
+
+		/* texture stuff */
+		if(!is_shadow && (options->glflags & G3D_FLAG_GL_TEXTURES) &&
+			(face->flags & G3D_FLAG_FAC_TEXMAP)) {
+			/* if texture has changed update to new texture */
+			if(face->tex_image) {
+				if(face->tex_image->tex_id != options->state->prev_texid) {
+					options->state->prev_texid = face->tex_image->tex_id;
+
+					gl_may_end(prev_ftype);
+					glBindTexture(GL_TEXTURE_2D, options->state->prev_texid);
+					gl_may_begin(prev_ftype);
+#if DEBUG > 5
+					g_print("gl: binding to texture id %d\n", prev_texid);
+#endif
+				}
+			}
+		} /* texture stuff */
+
+		switch(face->vertex_count) {
+			case 3: ftype = GL_TRIANGLES; break;
+			case 4: ftype = GL_QUADS; break;
+			case 2: ftype = GL_LINES; break;
+			default: ftype = GL_POLYGON;
+#if DEBUG > 0
+				g_debug("face vertex count: %d", face->vertex_count);
+#endif
+				break;
+		}
+		if(ftype != prev_ftype) {
+			gl_may_end(prev_ftype);
+			glBegin(ftype);
+			prev_ftype = ftype;
+		}
+
+		if(!(face->flags & G3D_FLAG_FAC_NORMALS)) {
+			face->normals = g_new0(G3DVector, face->vertex_count * 3);
+
+			g3d_face_get_normal(face, object, &nx, &ny, &nz);
+			g3d_vector_unify(&nx, &ny, &nz);
+
+			for(j = 0; j < face->vertex_count; j ++) {
+				face->normals[j * 3 + 0] = nx;
+				face->normals[j * 3 + 1] = ny;
+				face->normals[j * 3 + 2] = nz;
+			}
+			face->flags |= G3D_FLAG_FAC_NORMALS;
+		}
+
+		for(j = 0; j < face->vertex_count; j ++) {
+			index = face->vertex_indices[j];
+
+			if(!is_shadow && (options->glflags & G3D_FLAG_GL_TEXTURES) &&
+				(face->flags & G3D_FLAG_FAC_TEXMAP))
+			{
+				glTexCoord2f(
+					face->tex_vertex_data[j * 2 + 0],
+					face->tex_vertex_data[j * 2 + 1]);
+			}
+
+			glNormal3f(
+				face->normals[j * 3 + 0],
+				face->normals[j * 3 + 1],
+				face->normals[j * 3 + 2]);
+
+			glVertex3f(
+				object->vertex_data[index * 3 + 0],
+				object->vertex_data[index * 3 + 1],
+				object->vertex_data[index * 3 + 2]);
+		}
+
+	} /* face loop */
+
+	gl_may_end(prev_ftype);
+}
+
+
+static inline void gl_draw_objects(G3DGLRenderOptions *options,
+	GSList *objects, gfloat min_a, gfloat max_a, gboolean is_shadow)
+{
+	GSList *olist;
+	int i;
+	G3DObject *object;
+	gboolean dont_render;
+	gboolean init = TRUE;
+
+	olist = objects;
+	while(olist != NULL)
+	{
+		object = (G3DObject *)olist->data;
+		olist = olist->next;
+
+		dont_render = FALSE;
+
+		/* don't render invisible objects */
+		if(object->hide) continue;
+
+		g_return_if_fail(object != NULL);
+#if DEBUG > 3
+		g_printerr("name: %s {", object->name);
+#endif
+
+#if DEBUG > 2
+		g_printerr("new object\n");
+#endif
+
+		glPushMatrix();
+
+		if(object->transformation)
+		{
+			glMultMatrixf(object->transformation->matrix);
+		}
+
+#define EXPERIMENTAL
+#ifdef EXPERIMENTAL
+		gl_draw_face_list(options, object, min_a, max_a, &init, is_shadow);
+#else
+		glBegin(GL_TRIANGLES);
+
+		for(i = 0; i < object->_num_faces; i ++)
+		{
+			gl_draw_face(options, object, i, min_a, max_a,
+				&dont_render, &init, is_shadow);
+		} /* all faces */
+
+		glEnd();
+#endif
+
+		if(!is_shadow && (options->glflags & G3D_FLAG_GL_POINTS)) {
+			glColor4f(0.2, 0.2, 0.2, 1.0);
+			glBegin(GL_POINTS);
+			for(i = 0; i < object->vertex_count; i ++) {
+				glVertex3f(
+					object->vertex_data[i * 3 + 0],
+					object->vertex_data[i * 3 + 1],
+					object->vertex_data[i * 3 + 2]);
+			}
+			glEnd();
+		}
+
+		/* handle sub-objects */
+		gl_draw_objects(options, object->objects, min_a, max_a, is_shadow);
+
+		glPopMatrix();
+
+	} /* while olist != NULL */
+}
+
+static inline void matrix_g3d_to_gl(G3DMatrix *g3dm, GLfloat glm[4][4])
+{
+	guint32 i, j;
+
+	for(i = 0; i < 4; i ++)
+		for(j = 0; j < 4; j ++)
+			glm[i][j] = g3dm[i * 4 + j];
+}
+
+static inline void gl_setup_view(G3DGLRenderOptions *options)
+{
+	GLfloat m[4][4];
+	G3DMatrix *g3dm;
+	G3DFloat w, h;
+
+	glMatrixMode(GL_PROJECTION);
+	glLoadIdentity();
+	if(options->glflags & G3D_FLAG_GL_ISOMETRIC) {
+		w = 0.5 * options->zoom;
+		h = w / options->aspect;
+		glOrtho(-w / 2.0, w / 2.0, -h / 2.0, h / 2.0, 1, 100);
+	} else {
+		gluPerspective(options->zoom, options->aspect, 1, 100);
+	}
+	/* translation of view */
+	glTranslatef(options->offx, options->offy, 0.0);
+
+	glMatrixMode(GL_MODELVIEW);
+
+	glClearColor(
+		options->bgcolor[0],
+		options->bgcolor[1],
+		options->bgcolor[2],
+		options->bgcolor[3]);
+	glClearDepth(1.0);
+	glClearIndex(0.3);
+	glClear(
+		GL_COLOR_BUFFER_BIT |
+		GL_DEPTH_BUFFER_BIT |
+		GL_ACCUM_BUFFER_BIT |
+		GL_STENCIL_BUFFER_BIT);
+
+	glLoadIdentity();
+	glTranslatef(0, 0, -30);
+	g3dm = g3d_matrix_new();
+	g3d_quat_to_matrix(options->quat, g3dm);
+	matrix_g3d_to_gl(g3dm, m);
+
+	g3d_matrix_free(g3dm);
+	glMultMatrixf(&m[0][0]);
+}
+
+static void gl_setup_shadow_matrix(G3DGLRenderOptions *options,
+	G3DVector *l, G3DVector *p, G3DVector *n)
+{
+	G3DDouble c, d;
+	G3DMatrix *m = options->shadow_matrix;
+
+	d = n[0] * l[0] + n[1] * l[1] + n[2] * l[2];
+	c = p[0] * n[0] + p[1] * n[1] + p[2] * n[2] - d;
+
+	m[0 * 4 + 0] = l[0] * n[0] + c;
+	m[1 * 4 + 0] = l[0] * n[1];
+	m[2 * 4 + 0] = l[0] * n[2];
+	m[3 * 4 + 0] = - l[0] * c - l[0] * d;
+
+	m[0 * 4 + 1] = l[1] * n[0];
+	m[1 * 4 + 1] = l[1] * n[1] + c;
+	m[2 * 4 + 1] = l[1] * n[2];
+	m[3 * 4 + 1] = - l[1] * c - l[1] * d;
+
+	m[0 * 4 + 2] = l[2] * n[0];
+	m[1 * 4 + 2] = l[2] * n[1];
+	m[2 * 4 + 2] = l[2] * n[2] + c;
+	m[3 * 4 + 2] = - l[2] * c - l[2] * d;
+
+	m[0 * 4 + 3] = n[0];
+	m[1 * 4 + 3] = n[1];
+	m[2 * 4 + 3] = n[2];
+	m[3 * 4 + 3] = -d;
+}
+
+void gl_draw_coord_system(G3DGLRenderOptions *options)
+{
+	if(options->glflags & G3D_FLAG_GL_COORD_AXES) {
+		/* x: red */
+		glColor3f(1.0, 0.0, 0.0);
+		glBegin(GL_LINES);
+		glVertex3f(0.0, 0.0, 0.0);
+		glVertex3f(10.0, 0.0, 0.0);
+		glEnd();
+		/* y: green */
+		glColor3f(0.0, 1.0, 0.0);
+		glBegin(GL_LINES);
+		glVertex3f(0.0, 0.0, 0.0);
+		glVertex3f(0.0, 10.0, 0.0);
+		glEnd();
+		/* z: blue */
+		glColor3f(0.0, 0.0, 1.0);
+		glBegin(GL_LINES);
+		glVertex3f(0.0, 0.0, 0.0);
+		glVertex3f(0.0, 0.0, 10.0);
+		glEnd();
+	}
+}
+
+static G3DFloat gl_min_y(GSList *objects)
+{
+	G3DFloat min_y = 10.0, tmp_y;
+	GSList *oitem;
+	G3DObject *object;
+	gint32 i;
+
+	for(oitem = objects; oitem != NULL; oitem = oitem->next) {
+		object = oitem->data;
+		for(i = 0; i < object->vertex_count; i ++)
+			if(object->vertex_data[i * 3 + 1] < min_y)
+				min_y = object->vertex_data[i * 3 + 1];
+		tmp_y = gl_min_y(object->objects);
+		if(tmp_y < min_y)
+			min_y = tmp_y;
+	}
+	return min_y;
+}
+
+static void gl_draw_plane(G3DGLRenderOptions *options)
+{
+	glBegin(GL_QUADS);
+	glNormal3f(0.0, -1.0, 0.0);
+#define PLANE_MAX 12
+	glVertex3f(-PLANE_MAX, options->min_y - 0.001,  PLANE_MAX);
+	glVertex3f( PLANE_MAX, options->min_y - 0.001,  PLANE_MAX);
+	glVertex3f( PLANE_MAX, options->min_y - 0.001, -PLANE_MAX);
+	glVertex3f(-PLANE_MAX, options->min_y - 0.001, -PLANE_MAX);
+#undef PLANE_MAX
+	glEnd();
+}
+
+static void gl_setup_floor_stencil(G3DGLRenderOptions *options)
+{
+	glClear(GL_STENCIL_BUFFER_BIT);
+	glDepthMask(GL_FALSE);
+	glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+
+	glEnable(GL_STENCIL_TEST);
+	glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
+	glStencilFunc(GL_ALWAYS, 1, 0xffffffff);
+
+	gl_draw_plane(options);
+
+	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+	glDepthMask(GL_TRUE);
+
+	glStencilFunc(GL_EQUAL, 1, 0xffffffff);
+	glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+}
+
+static void gl_setup_shadow_stencil(G3DGLRenderOptions *options)
+{
+	glClear(GL_STENCIL_BUFFER_BIT);
+	glDepthMask(GL_FALSE);
+	glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+
+	glEnable(GL_STENCIL_TEST);
+	glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
+	glStencilFunc(GL_ALWAYS, 1, 0xffffffff);
+
+	glCallList(options->state->gl_dlist_shadow);
+
+	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+	glDepthMask(GL_TRUE);
+
+	glStencilFunc(GL_EQUAL, 1, 0xffffffff);
+	glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+}
+
+void gl_draw(G3DGLRenderOptions *options, G3DModel *model)
+{
+	GLenum error;
+	gfloat f;
+#ifdef TIMING
+	gboolean ignore_timing = FALSE;
+	gulong msec, add;
+	gdouble sec;
+#endif
+	G3DVector light[3] = { 100.0, 500.0, 20.0 };
+	G3DVector plane[3] = { 0.0, -20.0, 0.0 };
+	G3DVector normal[3] = { 0.0, -1.0, 0.0 };
+
+
+	if(!options->initialized)
+	{
+		gl_init();
+		options->initialized = TRUE;
+#ifdef TIMING
+		ignore_timing = TRUE;
+#endif
+	}
+
+	/* prepare viewport */
+	//gl_setup_view(options);
+
+	/* reset texture */
+	glBindTexture (GL_TEXTURE_2D, 0);
+
+	if(model == NULL)
+		return;
+
+#ifdef TIMING
+	g_timer_start(timer);
+#endif
+
+	if(options->updated) {
+		options->updated = FALSE;
+#ifdef TIMING
+		ignore_timing = TRUE;
+#endif
+#if DEBUG > 2
+		g_printerr("[gl] creating new display list\n");
+#endif
+		options->min_y = gl_min_y(model->objects);
+
+		/* update render state */
+		if(options->state) {
+			glDeleteLists(options->state->gl_dlist, 1);
+			glDeleteLists(options->state->gl_dlist_shadow, 1);
+			g_free(options->state);
+		}
+		options->state = g_new0(G3DGLRenderState, 1);
+
+		/* create and execute display list */
+		options->state->gl_dlist = glGenLists(1);
+		options->state->gl_dlist_shadow = glGenLists(1);
+
+		glNewList(options->state->gl_dlist, GL_COMPILE);
+		/* draw all objects */
+		for(f = 1.0; f >= 0.0; f -= 0.2)
+			gl_draw_objects(options, model->objects, f, f + 0.2, FALSE);
+		glEndList();
+
+		if(options->glflags & G3D_FLAG_GL_SHADOW) {
+			glNewList(options->state->gl_dlist_shadow, GL_COMPILE);
+			gl_draw_objects(options, model->objects, 0.0, 1.0, TRUE);
+			glEndList();
+		}
+
+	}
+
+	g_return_if_fail(options->state != NULL);
+
+	gl_draw_coord_system(options);
+
+	if(options->glflags & G3D_FLAG_GL_SHADOW) {
+		plane[1] = options->min_y;
+
+		/* reflection */
+		glPushMatrix();
+		gl_setup_floor_stencil(options);
+		glTranslatef(0.0, (options->min_y * 2), 0.0);
+		glScalef(1.0, -1.0, 1.0);
+		glCallList(options->state->gl_dlist);
+		glPopMatrix();
+
+		/* plane */
+		glDisable(GL_LIGHTING);
+		glBindTexture (GL_TEXTURE_2D, 0);
+		glColor4f(0.5, 0.5, 0.5, 0.7);
+		gl_draw_plane(options);
+		glEnable(GL_LIGHTING);
+		/* shadow */
+		glPushMatrix();
+		gl_setup_shadow_matrix(options, light, plane, normal);
+		glBindTexture (GL_TEXTURE_2D, 0);
+		glDisable(GL_LIGHTING);
+		glDisable(GL_DEPTH_TEST);
+		glMultMatrixf(options->shadow_matrix);
+		gl_setup_shadow_stencil(options);
+		glPopMatrix();
+		glPushMatrix();
+		glTranslatef(0.0, 0.001, 0.0);
+		glColor4f(0.3, 0.3, 0.3, 0.7);
+		gl_draw_plane(options);
+		glEnable(GL_DEPTH_TEST);
+		glEnable(GL_LIGHTING);
+		glPopMatrix();
+
+		glDisable(GL_STENCIL_TEST);
+	}
+
+	/* execute display list */
+	glCallList(options->state->gl_dlist);
+
+
+/* get time to draw one frame to compare algorithms */
+#ifdef TIMING
+	g_timer_stop(timer);
+
+	if(!ignore_timing) {
+		if(options->avg_msec == 0) {
+			sec = g_timer_elapsed(timer, &msec);
+			options->avg_msec = (gulong)sec * 1000000 + msec;
+		} else {
+			sec = g_timer_elapsed(timer, &msec);
+			add = (gulong)sec * 1000000 + msec;
+			options->avg_msec = (options->avg_msec + add) / 2;
+		}
+	}
+#endif
+
+#if DEBUG > 3
+	g_printerr("gl.c: drawn...\n");
+#endif
+}
diff --git a/gui/hkl3d/hkl3d-gui-gl.h b/gui/hkl3d/hkl3d-gui-gl.h
new file mode 100644
index 0000000..19c16fa
--- /dev/null
+++ b/gui/hkl3d/hkl3d-gui-gl.h
@@ -0,0 +1,64 @@
+/* $Id: gl.h 108 2009-01-08 16:38:36Z mmmaddd $ */
+
+/*
+	G3DViewer - 3D object viewer
+
+	Copyright (C) 2005, 2006  Markus Dahms <mad at automagically.de>
+
+    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
+*/
+
+#ifndef _GL_H
+#define _GL_H
+
+#include <g3d/types.h>
+
+#define G3D_FLAG_GL_SPECULAR        (1L << 0)
+#define G3D_FLAG_GL_SHININESS       (1L << 1)
+#define G3D_FLAG_GL_ALLTWOSIDE      (1L << 2)
+#define G3D_FLAG_GL_TEXTURES        (1L << 3)
+#define G3D_FLAG_GL_COLORS          (1L << 4)
+#define G3D_FLAG_GL_POINTS          (1L << 5)
+#define G3D_FLAG_GL_COORD_AXES      (1L << 6)
+#define G3D_FLAG_GL_SHADOW          (1L << 7)
+#define G3D_FLAG_GL_ISOMETRIC       (1L << 8)
+
+typedef struct _G3DGLRenderState G3DGLRenderState;
+
+typedef struct {
+	/* to be set by caller */
+	gfloat zoom;
+	gfloat aspect;
+	gfloat bgcolor[4];
+	gfloat quat[4];
+	G3DMatrix shadow_matrix[16];
+	G3DFloat min_y;
+	guint32 norm_count;
+	gfloat offx;
+	gfloat offy;
+	gint32 glflags;
+	gboolean updated;
+	gboolean initialized;
+	/* can be read by caller */
+	guint32 avg_msec;
+	/* to be used by caller only */
+	G3DGLRenderState *state;
+} G3DGLRenderOptions;
+
+void gl_set_twoside(gboolean twoside);
+void gl_set_textures(gboolean textures);
+void gl_load_texture(gpointer key, gpointer value, gpointer data);
+void gl_draw(G3DGLRenderOptions *options, G3DModel *model);
+#endif
diff --git a/gui/hkl3d/hkl3d-gui-model.cpp b/gui/hkl3d/hkl3d-gui-model.cpp
new file mode 100644
index 0000000..b240f6b
--- /dev/null
+++ b/gui/hkl3d/hkl3d-gui-model.cpp
@@ -0,0 +1,407 @@
+/*
+ * This file is part of the hkl3d library.
+ * inspired from logo-model.c of the GtkGLExt logo models.
+ * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl3d-gui-model.h"
+#include "btBulletCollisionCommon.h"
+
+// Trackball utilities.
+
+namespace Trackball {
+	extern "C" {
+#include "trackball.h"
+	}
+}
+namespace GLDRAW {
+	extern "C" {
+#include "hkl3d-gui-gl.h"
+	}
+}
+namespace Hkl3dGui
+{
+	DrawingTools::DrawingTools(Hkl3D *hkl3d)
+		: _hkl3d(hkl3d)
+	{
+		m_shapeDrawer.enableTexture(true);
+	}
+
+	DrawingTools::~DrawingTools(void)
+	{
+	}
+
+	void DrawingTools::draw_line(const btVector3 & from, const btVector3 & to,
+				     const btVector3 & fromColor, const btVector3 & toColor)
+	{
+		glBegin(GL_LINES);
+		glColor3f(fromColor.getX(), fromColor.getY(), fromColor.getZ());
+		glVertex3d(from.getX(), from.getY(), from.getZ());
+		glColor3f(toColor.getX(), toColor.getY(), toColor.getZ());
+		glVertex3d(to.getX(), to.getY(), to.getZ());
+		glEnd();
+	}
+
+	void DrawingTools::draw_line(const btVector3 & from, const btVector3 & to, const btVector3 & color)
+	{
+		draw_line(from, to, color, color);
+	}
+
+	void DrawingTools::draw_Aabb(const btVector3 & from, const btVector3 & to, const btVector3 & color)
+        {
+                btVector3 halfExtents = (to-from)* 0.5f;
+                btVector3 center = (to+from) *0.5f;
+                int i,j;
+
+                btVector3 edgecoord(1.f,1.f,1.f), pa, pb;
+                for (i=0;i<4;i++){
+                        for (j=0;j<3;j++){
+                                pa = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
+					       edgecoord[2]*halfExtents[2]);
+                                pa += center;
+
+                                int othercoord = j%3;
+                                edgecoord[othercoord] *= -1.f;
+                                pb = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
+					       edgecoord[2]*halfExtents[2]);
+                                pb += center;
+
+                                this->draw_line(pa, pb, color);
+                        }
+                        edgecoord = btVector3(-1.f,-1.f,-1.f);
+                        if (i<3)
+                                edgecoord[i] *= -1.f;
+                }
+        }
+
+	void DrawingTools::draw_AAbbBoxes(void)
+	{
+		int i;
+		int j;
+		glDisable(GL_LIGHTING);
+		for(i=0; i<_hkl3d->config->len; i++)
+			for(j=0; j<_hkl3d->config->models[i]->len; j++){
+				if(!_hkl3d->config->models[i]->objects[j]->hide){
+					Hkl3DObject *object = _hkl3d->config->models[i]->objects[j];
+					btVector3 aabbMin, aabbMax;
+
+					object->btShape->getAabb(object->btObject->getWorldTransform(),
+								 aabbMin, aabbMax);
+					this->draw_Aabb(aabbMin, aabbMax, btVector3(1,0,0));
+				}
+			}
+
+		glFlush();
+	}
+
+	void DrawingTools::draw_collisions(void)
+	{
+		int i;
+		int numManifolds;
+		bool isColliding;
+		btScalar m[16];
+		btVector3 worldBoundsMin;
+		btVector3 worldBoundsMax;
+
+		glDisable(GL_LIGHTING);
+		// get the world bounding box from bullet
+		hkl3d_get_bounding_boxes(_hkl3d, &worldBoundsMin, &worldBoundsMax);
+		///one way to draw all the contact points is iterating over contact manifolds / points:
+		numManifolds = hkl3d_get_nb_manifolds(_hkl3d);
+		for (i=0; i<numManifolds; i++){
+			int numContacts;
+			int j;
+
+			// now draw the manifolds / points
+			numContacts = hkl3d_get_nb_contacts(_hkl3d, i);
+			for (j=0; j<numContacts; j++){
+				double xa, ya, za;
+				double xb, yb, zb;
+
+				hkl3d_get_collision_coordinates(_hkl3d, i, j,
+								&xa, &ya, &za, &xb, &yb, &zb);
+
+				glDisable(GL_DEPTH_TEST);
+				glBegin(GL_LINES);
+				glColor4f(0, 0, 0, 1);
+				glVertex3d(xa, ya, za);
+				glVertex3d(xb, yb, zb);
+				glEnd();
+				glColor4f(1, 0, 0, 1);
+				glPushMatrix();
+				glTranslatef (xb, yb, zb);
+				glScaled(0.05,0.05,0.05);
+				m_shapeDrawer.drawSphere(1, 10, 10);
+				glPopMatrix();
+				glColor4f(1, 1, 0, 1);
+				glPushMatrix();
+				glTranslatef (xa, ya, za);
+				glScaled(0.05,0.05,0.05);
+				m_shapeDrawer.drawSphere(1, 10, 10);
+				glPopMatrix();
+				glEnable(GL_DEPTH_TEST);
+			}
+		}
+		glFlush();
+	}
+
+	void DrawingTools::draw_bullet(void)
+	{
+		int i;
+		int j;
+		btScalar m[16];
+		btVector3 worldBoundsMin;
+		btVector3 worldBoundsMax;
+		btVector3 aabbMin,aabbMax;
+
+		GL_ShapeDrawer::drawCoordSystem();
+
+		/* get the bounding box from bullet */
+		hkl3d_get_bounding_boxes(_hkl3d, &worldBoundsMin, &worldBoundsMax);
+
+		/* draw all visible objects */
+		for(i=0; i<_hkl3d->config->len; i++){
+			for(j=0; j<_hkl3d->config->models[i]->len; j++){
+				Hkl3DObject *object;
+
+				object = _hkl3d->config->models[i]->objects[j];
+				if(!object->hide){
+					btCollisionObject *btObject;
+
+					btObject = object->btObject;
+					btObject->getWorldTransform().getOpenGLMatrix( m );
+					m_shapeDrawer.drawOpenGL(m,
+								 btObject->getCollisionShape(),
+								 *object->color,
+								 0, /* debug mode */
+								 worldBoundsMin,
+								 worldBoundsMax);
+				}
+			}
+		}
+		glFlush();
+	}
+
+	void DrawingTools::draw_g3dmodel(void)
+	{
+		int i;
+		int j;
+
+		/* set the alpha canal to 0.5 if there is a collision */
+		for(i=0; i<_hkl3d->config->len; i++)
+			for(j=0; j<_hkl3d->config->models[i]->len; j++){
+				GSList *faces;
+				G3DFace *face;
+				G3DMaterial *material;
+				double alpha;
+
+				if(_hkl3d->config->models[i]->objects[j]->is_colliding)
+					alpha = 0.5;
+				else
+					alpha = 1;
+
+				faces = _hkl3d->config->models[i]->objects[j]->g3d->faces;
+				while(faces){
+					face = (G3DFace *)(faces->data);
+					face->material->a = alpha;
+					faces = g_slist_next(faces);
+				}
+			}
+
+		/* draw the G3DObjects */
+		GLDRAW::G3DGLRenderOptions *options =  g_new0(GLDRAW::G3DGLRenderOptions, 1);
+		options->glflags = G3D_FLAG_GL_SPECULAR
+			| G3D_FLAG_GL_SHININESS
+			| G3D_FLAG_GL_TEXTURES
+			| G3D_FLAG_GL_COLORS;
+		options->updated = true;
+		options->initialized = false;
+		GL_ShapeDrawer::drawCoordSystem();
+		GLDRAW::gl_draw(options, _hkl3d->model);
+		glFlush();
+	}
+
+	static void draw_g3dObject(G3DObject *object)
+	{
+		GSList *faces;
+		G3DFace *face;
+		float *vertex;
+
+		faces = object->faces;
+		vertex = object->vertex_data;
+
+		glPushMatrix();
+
+		/* apply the transformation of the object */
+		if(object->transformation)
+			glMultMatrixf(object->transformation->matrix);
+
+		/* draw all faces with the current stencil */
+		while(faces){
+			G3DFace * face;
+
+			face = (G3DFace*)faces->data;
+			glBegin(GL_TRIANGLES);
+			glVertex3d(vertex[3*(face->vertex_indices[0])],
+				   vertex[3*(face->vertex_indices[0])+1],
+				   vertex[3*(face->vertex_indices[0])+2]);
+			glVertex3d(vertex[3*(face->vertex_indices[1])],
+				   vertex[3*(face->vertex_indices[1])+1],
+				   vertex[3*(face->vertex_indices[1])+2]);
+			glVertex3d(vertex[3*(face->vertex_indices[2])],
+				   vertex[3*(face->vertex_indices[2])+1],
+				   vertex[3*(face->vertex_indices[2])+2]);
+			glEnd();
+			faces = g_slist_next(faces);
+		}
+
+		glPopMatrix();
+	}
+
+	void DrawingTools::draw_selected(void)
+	{
+		int i;
+		int j;
+
+		for(i=0; i<_hkl3d->config->len; i++)
+			for(j=0; j<_hkl3d->config->models[i]->len; j++){
+				if(_hkl3d->config->models[i]->objects[j]->selected
+				   && !_hkl3d->config->models[i]->objects[j]->hide){
+					// Push the GL attribute bits so that we don't wreck any settings
+					glDisable(GL_LIGHTING);
+					glPushAttrib( GL_ALL_ATTRIB_BITS );
+
+					// Enable polygon offsets, and offset filled polygons forward by 2.5
+					glEnable( GL_POLYGON_OFFSET_FILL );
+					glPolygonOffset( -2.5, -2.5);
+
+					// Set the render mode to be line rendering with a thick line width
+					glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
+					glLineWidth( 3.f );
+					// Set the colour to be pink
+					glColor3f( 1.f, .0f, 1.f );
+					// Render the object
+					draw_g3dObject(_hkl3d->config->models[i]->objects[j]->g3d);
+					// Set the polygon mode to be filled triangles
+					glLineWidth( 1.f );
+					glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
+					// Set the colour to the background
+					glCullFace(GL_FRONT);
+					glColor3f( 0.0f, 0.0f, 0.0f );
+					// Render the object
+					draw_g3dObject(_hkl3d->config->models[i]->objects[j]->g3d);
+
+					// Pop the state changes off the attribute
+					// to set things back how they were
+					glPopAttrib();
+				}
+			}
+		glFlush();
+	}
+
+	ModelDraw::ModelDraw(Hkl3D *hkl3d,
+			     bool enableBulletDraw, bool enableWireframe,
+			     bool enableAAbbBoxDraw, bool enableOrtho)
+		: _hkl3d(hkl3d),
+		  model(new DrawingTools(hkl3d)),
+		  bullet(enableBulletDraw),
+		  wireframe(enableWireframe),
+		  aabb(enableAAbbBoxDraw),
+		  ortho(enableOrtho)
+	{
+		this->reset_anim();
+	}
+
+	ModelDraw::~ModelDraw(void)
+	{
+		delete this->model;
+	}
+
+	void ModelDraw::init_gl(DrawingTools* model)
+	{
+		glNewList(MODEL, GL_COMPILE);
+		this->model->draw_g3dmodel();
+		glEndList();
+		glNewList(BULLET, GL_COMPILE);
+		this->model->draw_bullet();
+		glEndList();
+		glNewList(COLLISION, GL_COMPILE);
+		this->model->draw_collisions();
+		glEndList();
+		glNewList(AABBBOX, GL_COMPILE);
+		this->model->draw_AAbbBoxes();
+		glEndList();
+		glNewList(HIGHLIGHT, GL_COMPILE);
+		this->model->draw_selected();
+		glEndList();
+	}
+
+	void ModelDraw::draw(void)
+	{
+		float m[4][4];
+
+		// Init GL context.
+		init_gl(model);
+
+		// Draw  model.
+		glPushMatrix();
+		glTranslatef(m_Pos[0], m_Pos[1], m_Pos[2]);
+
+		Trackball::build_rotmatrix(m, m_Quat);
+		glMultMatrixf(&m[0][0]);
+		glRotatef(0.0, 0.0, 0.0, 1.0);
+
+		// WireFrame
+		if(this->wireframe){
+			glPolygonMode(GL_FRONT, GL_LINE);
+			glPolygonMode(GL_BACK, GL_LINE);
+		}else{
+			glPolygonMode(GL_FRONT, GL_FILL);
+			glPolygonMode(GL_BACK, GL_FILL);
+		}
+		// AABB Box
+		if(this->aabb)
+			glCallList(AABBBOX);
+
+		// Bullet and G3DModel
+		if(this->bullet)
+			glCallList(BULLET);
+		else
+			glCallList(MODEL);
+		glCallList(COLLISION);
+		glCallList(HIGHLIGHT);
+		glPopMatrix();
+	}
+
+	void ModelDraw::reset_anim(void)
+	{
+		m_Pos[0] = 0.0;
+		m_Pos[1] = 0.0;
+		m_Pos[2] = 0.0;
+
+		m_Quat[0] = 0.0;
+		m_Quat[1] = 0.0;
+		m_Quat[2] = 0.0;
+		m_Quat[3] = 1.0;
+	}
+
+} // namespace Hkl3dGui
diff --git a/gui/hkl3d/hkl3d-gui-model.h b/gui/hkl3d/hkl3d-gui-model.h
new file mode 100644
index 0000000..41c916b
--- /dev/null
+++ b/gui/hkl3d/hkl3d-gui-model.h
@@ -0,0 +1,121 @@
+/*
+ * This file is part of the hkl3d library.
+ * inspired from logo-model.c of the GtkGLExt logo models.
+ * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#ifndef __HKL3D_GUI_MODEL_H__
+#define __HKL3D_GUI_MODEL_H__
+
+#include <gtkmm.h>
+#include <gtkglmm.h>
+
+#include "hkl3d.h"
+#include "GL_ShapeDrawer.h"
+
+namespace Hkl3dGui
+{
+	/* LogoModel class */
+	class DrawingTools
+	{
+	public:
+		DrawingTools(Hkl3D *hkl3d);
+		virtual ~DrawingTools(void);
+		void draw_collisions(void);
+		void draw_g3dmodel(void);
+		void draw_bullet(void);
+		void draw_AAbbBoxes(void);
+		void draw_selected(void);
+
+	private:
+		void draw_Aabb(const btVector3 & from, const btVector3 & to, const btVector3 & color);
+		void draw_line(const btVector3 & from, const btVector3 & to,
+			       const btVector3 & fromColor, const btVector3 & toColor);
+		void draw_line(const btVector3 & from,const btVector3 & to,const btVector3 & color);
+
+	private:
+		Hkl3D *_hkl3d;
+		GL_ShapeDrawer m_shapeDrawer;
+	};
+
+	/* ModelDraw class */
+	class ModelDraw
+	{
+		friend class Scene;
+		friend class DrawingTools;
+
+	public:
+		enum DisplayList {
+			MODEL = 1,
+			BULLET,
+			COLLISION,
+			AABBBOX,
+			HIGHLIGHT
+		};
+
+	public:
+
+		explicit ModelDraw(Hkl3D *hkl3d,
+				   bool enableBulletdraw=false, bool enableWireframe=false,
+				   bool enableAAbbBoxDraw=false, bool enableOrthoView=false);
+		virtual ~ModelDraw(void);
+
+		void draw(void);
+
+		void reset_anim(void);
+
+		void set_pos(float x, float y, float z)
+		{
+			m_Pos[0] = x;
+			m_Pos[1] = y;
+			m_Pos[2] = z;
+		}
+
+		void set_quat(float q0, float q1, float q2, float q3)
+		{
+			m_Quat[0] = q0;
+			m_Quat[1] = q1;
+			m_Quat[2] = q2;
+			m_Quat[3] = q3;
+		}
+
+	public:
+		bool wireframe;
+		bool bullet;
+		bool aabb;
+		bool ortho;
+
+	private:
+		void init_gl(DrawingTools* model);
+
+
+	private:
+		Hkl3D *_hkl3d;
+		DrawingTools *model;
+		float m_Pos[3];
+		float m_Quat[4];
+	};
+
+} // namespace Hkl3dGui
+
+#endif // __HKL3D_GUI_MODEL_H__
diff --git a/gui/hkl3d/hkl3d-gui-scene.cpp b/gui/hkl3d/hkl3d-gui-scene.cpp
new file mode 100644
index 0000000..bb030a3
--- /dev/null
+++ b/gui/hkl3d/hkl3d-gui-scene.cpp
@@ -0,0 +1,432 @@
+/*
+ * This file is part of the hkl3d library.
+ * inspired from logo-model.c of the GtkGLExt logo models.
+ * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#include <iostream>
+
+#include "hkl3d-gui-scene.h"
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// OpenGL frame buffer configuration utilities.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+struct GLConfigUtil
+{
+	static void print_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig,
+				    const char* attrib_str,
+				    int attrib,
+				    bool is_boolean);
+
+	static void examine_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig);
+};
+
+//
+// Print a configuration attribute.
+//
+void GLConfigUtil::print_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig,
+                                   const char* attrib_str,
+                                   int attrib,
+                                   bool is_boolean)
+{
+	int value;
+
+	if (glconfig->get_attrib(attrib, value)){
+		std::cout << attrib_str << " = ";
+		if (is_boolean)
+			std::cout << (value == true ? "true" : "false") << std::endl;
+		else
+			std::cout << value << std::endl;
+	}else{
+		std::cout << "*** Cannot get "
+			  << attrib_str
+			  << " attribute value\n";
+	}
+}
+
+//
+// Print configuration attributes.
+//
+void GLConfigUtil::examine_gl_attrib(const Glib::RefPtr<const Gdk::GL::Config>& glconfig)
+{
+	std::cout << "\nOpenGL visual configurations :\n\n";
+
+	std::cout << "glconfig->is_rgba() = "
+		  << (glconfig->is_rgba() ? "true" : "false")
+		  << std::endl;
+	std::cout << "glconfig->is_double_buffered() = "
+		  << (glconfig->is_double_buffered() ? "true" : "false")
+		  << std::endl;
+	std::cout << "glconfig->is_stereo() = "
+		  << (glconfig->is_stereo() ? "true" : "false")
+		  << std::endl;
+	std::cout << "glconfig->has_alpha() = "
+		  << (glconfig->has_alpha() ? "true" : "false")
+		  << std::endl;
+	std::cout << "glconfig->has_depth_buffer() = "
+		  << (glconfig->has_depth_buffer() ? "true" : "false")
+		  << std::endl;
+	std::cout << "glconfig->has_stencil_buffer() = "
+		  << (glconfig->has_stencil_buffer() ? "true" : "false")
+		  << std::endl;
+	std::cout << "glconfig->has_accum_buffer() = "
+		  << (glconfig->has_accum_buffer() ? "true" : "false")
+		  << std::endl;
+
+	std::cout << std::endl;
+
+	print_gl_attrib(glconfig, "Gdk::GL::USE_GL",           Gdk::GL::USE_GL,           true);
+	print_gl_attrib(glconfig, "Gdk::GL::BUFFER_SIZE",      Gdk::GL::BUFFER_SIZE,      false);
+	print_gl_attrib(glconfig, "Gdk::GL::LEVEL",            Gdk::GL::LEVEL,            false);
+	print_gl_attrib(glconfig, "Gdk::GL::RGBA",             Gdk::GL::RGBA,             true);
+	print_gl_attrib(glconfig, "Gdk::GL::DOUBLEBUFFER",     Gdk::GL::DOUBLEBUFFER,     true);
+	print_gl_attrib(glconfig, "Gdk::GL::STEREO",           Gdk::GL::STEREO,           true);
+	print_gl_attrib(glconfig, "Gdk::GL::AUX_BUFFERS",      Gdk::GL::AUX_BUFFERS,      false);
+	print_gl_attrib(glconfig, "Gdk::GL::RED_SIZE",         Gdk::GL::RED_SIZE,         false);
+	print_gl_attrib(glconfig, "Gdk::GL::GREEN_SIZE",       Gdk::GL::GREEN_SIZE,       false);
+	print_gl_attrib(glconfig, "Gdk::GL::BLUE_SIZE",        Gdk::GL::BLUE_SIZE,        false);
+	print_gl_attrib(glconfig, "Gdk::GL::ALPHA_SIZE",       Gdk::GL::ALPHA_SIZE,       false);
+	print_gl_attrib(glconfig, "Gdk::GL::DEPTH_SIZE",       Gdk::GL::DEPTH_SIZE,       false);
+	print_gl_attrib(glconfig, "Gdk::GL::STENCIL_SIZE",     Gdk::GL::STENCIL_SIZE,     false);
+	print_gl_attrib(glconfig, "Gdk::GL::ACCUM_RED_SIZE",   Gdk::GL::ACCUM_RED_SIZE,   false);
+	print_gl_attrib(glconfig, "Gdk::GL::ACCUM_GREEN_SIZE", Gdk::GL::ACCUM_GREEN_SIZE, false);
+	print_gl_attrib(glconfig, "Gdk::GL::ACCUM_BLUE_SIZE",  Gdk::GL::ACCUM_BLUE_SIZE,  false);
+	print_gl_attrib(glconfig, "Gdk::GL::ACCUM_ALPHA_SIZE", Gdk::GL::ACCUM_ALPHA_SIZE, false);
+
+	std::cout << std::endl;
+}
+
+namespace  Hkl3dGui
+{
+	//
+	// Scene class implementation.
+	//
+	const unsigned int Scene::TIMEOUT_INTERVAL = 100000000;
+
+	const float Scene::CLEAR_COLOR[4] = { 0.9, 0.8, 0.6, 1.0 };
+	const float Scene::CLEAR_DEPTH    = 1.0;
+
+	const float Scene::LIGHT0_POSITION[4] = { 0.0, 0.0, 30.0, 0.0 };
+	const float Scene::LIGHT0_DIFFUSE[4]  = { 1.0, 1.0, 1.0, 1.0 };
+	const float Scene::LIGHT0_SPECULAR[4] = { 1.0, 1.0, 1.0, 1.0 };
+
+	Scene::Scene(Hkl3D *hkl3d, bool enableBulletDraw, bool enableWireframe, bool enableAAbbBoxDraw, bool enableOrthoView)
+		: m_Menu(0), m_Model(hkl3d, enableBulletDraw, enableWireframe, enableAAbbBoxDraw, enableOrthoView)
+	{
+		//
+		// Configure OpenGL-capable visual.
+		//
+		Glib::RefPtr<Gdk::GL::Config> glconfig;
+
+		// Try double-buffered visual
+		glconfig = Gdk::GL::Config::create(Gdk::GL::MODE_RGB    |
+						   Gdk::GL::MODE_DEPTH  |
+						   Gdk::GL::MODE_DOUBLE);
+		if (!glconfig) {
+			std::cerr << "*** Cannot find the double-buffered visual.\n"
+				  << "*** Trying single-buffered visual.\n";
+
+			// Try single-buffered visual
+			glconfig = Gdk::GL::Config::create(Gdk::GL::MODE_RGB   |
+							   Gdk::GL::MODE_DEPTH);
+			if (!glconfig) {
+				std::cerr << "*** Cannot find any OpenGL-capable visual.\n";
+				std::exit(1);
+			}
+		}
+
+		// print frame buffer attributes.
+		GLConfigUtil::examine_gl_attrib(glconfig);
+
+		//
+		// Set OpenGL-capability to the widget.
+		//
+		this->set_gl_capability(glconfig);
+
+		//
+		// Add events.
+		//
+		this->add_events(Gdk::BUTTON1_MOTION_MASK    |
+				 Gdk::BUTTON2_MOTION_MASK    |
+				 Gdk::BUTTON_PRESS_MASK      |
+				 Gdk::VISIBILITY_NOTIFY_MASK);
+
+		// View transformation signals.
+		signal_button_press_event().connect(
+			sigc::bind(sigc::mem_fun(m_View, &View::on_button_press_event), this));
+		signal_motion_notify_event().connect(
+			sigc::bind(sigc::mem_fun(m_View, &View::on_motion_notify_event), this));
+		signal_scroll_event().connect(
+			sigc::bind(sigc::mem_fun(m_View, &View::zoom_scroll), this));
+
+		//
+		// Popup menu.
+		//
+		m_Menu = this->create_popup_menu();
+	}
+
+	Scene::~Scene(void)
+	{
+	}
+
+	void Scene::on_realize(void)
+	{
+		// We need to call the base on_realize()
+		Gtk::DrawingArea::on_realize();
+
+		//
+		// Get GL::Drawable.
+		//
+		Glib::RefPtr<Gdk::GL::Drawable> gldrawable = this->get_gl_drawable();
+
+		//
+		// GL calls.
+		//
+		// *** OpenGL BEGIN ***
+		if (!gldrawable->gl_begin(this->get_gl_context()))
+			return;
+
+		glClearColor(CLEAR_COLOR[0], CLEAR_COLOR[1], CLEAR_COLOR[2], CLEAR_COLOR[3]);
+		glClearDepth(CLEAR_DEPTH);
+
+		glLightfv(GL_LIGHT0, GL_POSITION, LIGHT0_POSITION);
+		glLightfv(GL_LIGHT0, GL_DIFFUSE,  LIGHT0_DIFFUSE);
+		glLightfv(GL_LIGHT0, GL_SPECULAR, LIGHT0_SPECULAR);
+
+		glEnable(GL_LIGHTING);
+		glEnable(GL_LIGHT0);
+
+		glEnable(GL_DEPTH_TEST);
+
+		glShadeModel(GL_SMOOTH);
+
+		gldrawable->gl_end();
+		// *** OpenGL END ***
+	}
+
+	bool Scene::on_configure_event(GdkEventConfigure* event)
+	{
+		//
+		// Get GL::Drawable.
+		//
+		Glib::RefPtr<Gdk::GL::Drawable> gldrawable = this->get_gl_drawable();
+
+		//
+		// GL calls.
+		//
+		// *** OpenGL BEGIN ***
+		if (!gldrawable->gl_begin(this->get_gl_context()))
+			return false;
+
+		m_View.frustum(this->get_width(), this->get_height());
+
+		gldrawable->gl_end();
+		// *** OpenGL END ***
+
+		return true;
+	}
+
+	bool Scene::on_expose_event(GdkEventExpose* event)
+	{
+		//
+		// Get GL::Drawable.
+		//
+		Glib::RefPtr<Gdk::GL::Drawable> gldrawable = get_gl_drawable();
+
+		//
+		// GL calls.
+		//
+		// *** OpenGL BEGIN ***
+		if (!gldrawable->gl_begin(get_gl_context()))
+			return false;
+
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+		glLoadIdentity();
+
+		// View transformation.
+		m_View.xform();
+
+		// model.
+		m_Model.draw();
+
+		// Swap buffers.
+		if (gldrawable->is_double_buffered())
+			gldrawable->swap_buffers();
+		else
+			glFlush();
+
+		gldrawable->gl_end();
+		// *** OpenGL END ***
+
+		return true;
+	}
+
+	bool Scene::on_button_press_event(GdkEventButton* event)
+	{
+		if (event->button == 3) {
+			m_Menu->popup(event->button, event->time);
+			return true;
+		}
+
+		// don't block
+		return false;
+	}
+
+	bool Scene::on_map_event(GdkEventAny* event)
+	{
+		if (m_Model.bullet)
+			this->timeout_add();
+
+		return true;
+	}
+
+	bool Scene::on_unmap_event(GdkEventAny* event)
+	{
+		this->timeout_remove();
+
+		return true;
+	}
+
+	bool Scene::on_visibility_notify_event(GdkEventVisibility* event)
+	{
+		if (m_Model.bullet) {
+			if (event->state == GDK_VISIBILITY_FULLY_OBSCURED)
+
+				this->timeout_add();
+		}
+
+		return true;
+	}
+
+	bool Scene::on_timeout(void)
+	{
+		// Invalidate whole window.
+		this->invalidate();
+		// Update window synchronously (fast).
+		this->update();
+
+		return true;
+	}
+
+	void Scene::timeout_add(void)
+	{
+		if (!m_ConnectionTimeout.connected())
+			m_ConnectionTimeout = Glib::signal_timeout().connect(
+				sigc::mem_fun(*this, &Scene::on_timeout), TIMEOUT_INTERVAL);
+	}
+
+	void Scene::timeout_remove(void)
+	{
+		if (m_ConnectionTimeout.connected())
+			m_ConnectionTimeout.disconnect();
+	}
+
+	void Scene::bulletDraw(void)
+	{
+		if (m_Model.bullet) {
+			m_Model.bullet = false;
+			this->timeout_remove();
+		}else{
+			m_Model.bullet = true;
+			this->timeout_add();
+		}
+	}
+
+	void Scene::wireframe_view(void)
+	{
+		m_Model.wireframe = !m_Model.wireframe;
+	}
+
+	void Scene::orthoView(void)
+	{
+		if (m_Model.ortho){
+			m_View.frustum(this->get_width(), this->get_height());
+			m_Model.ortho = false;
+		}else{
+			m_View.ortho(this->get_width(), this->get_height());
+			m_Model.ortho = true;
+		}
+	}
+
+	void Scene::AAbbBoxDraw(void)
+	{
+		if (m_Model.aabb) {
+			m_Model.aabb = false;
+			if (m_Model.bullet)
+				this->timeout_add();
+			else
+				this->timeout_remove();
+		}else{
+			m_Model.aabb = true;
+			this->timeout_add();
+		}
+	}
+
+	void Scene::init_anim(void)
+	{
+		m_View.reset();
+		m_Model.reset_anim();
+
+		this->invalidate();
+	}
+
+	Gtk::Menu* Scene::create_popup_menu(void)
+	{
+		Gtk::Menu* menu = Gtk::manage(new Gtk::Menu());
+
+		Gtk::Menu::MenuList& menu_list = menu->items();
+
+		// Enable/Disable Bullet Draw
+		menu_list.push_back(
+			Gtk::Menu_Helpers::MenuElem("Enable/Disable Bullet Draw",
+						    sigc::mem_fun(*this, &Scene::bulletDraw)));
+		// Wireframe
+		menu_list.push_back(
+			Gtk::Menu_Helpers::MenuElem("Wireframe",
+						    sigc::mem_fun(*this, &Scene::wireframe_view)));
+		// Ortho view
+		menu_list.push_back(
+			Gtk::Menu_Helpers::MenuElem("Enable/Disable Ortho View",
+						    sigc::mem_fun(*this, &Scene::orthoView)));
+		// AAbbBox
+		menu_list.push_back(
+			Gtk::Menu_Helpers::MenuElem("Render AABB box",
+						    sigc::mem_fun(*this, &Scene::AAbbBoxDraw)));
+		// Init orientation
+		menu_list.push_back(
+			Gtk::Menu_Helpers::MenuElem("Initialize",
+						    sigc::mem_fun(*this, &Scene::init_anim)));
+
+		// Quit
+		menu_list.push_back(
+			Gtk::Menu_Helpers::MenuElem("Quit",
+						    sigc::ptr_fun(&Gtk::Main::quit)));
+
+		return menu;
+	}
+
+} // namespace  Hkl3dGui
diff --git a/gui/hkl3d/hkl3d-gui-scene.h b/gui/hkl3d/hkl3d-gui-scene.h
new file mode 100644
index 0000000..0af4c6d
--- /dev/null
+++ b/gui/hkl3d/hkl3d-gui-scene.h
@@ -0,0 +1,120 @@
+/*
+ * This file is part of the hkl3d library.
+ * inspired from logo-model.c of the GtkGLExt logo models.
+ * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#ifndef __HKL3D_GUI_SCENE_H__
+#define __HKL3D_GUI_SCENE_H__
+
+#include <gtkmm.h>
+#include <gtkglmm.h>
+
+#include "hkl3d-gui-view.h"
+#include "hkl3d-gui-model.h"
+
+namespace Hkl3dGui
+{
+	class Scene : public Gtk::GL::DrawingArea
+	{
+	public:
+		static const unsigned int TIMEOUT_INTERVAL;
+
+		// OpenGL scene related constants:
+		static const float CLEAR_COLOR[4];
+		static const float CLEAR_DEPTH;
+
+		static const float LIGHT0_POSITION[4];
+		static const float LIGHT0_DIFFUSE[4];
+		static const float LIGHT0_SPECULAR[4];
+
+	public:
+		explicit Scene(Hkl3D *hkl3d,
+			       bool enableBulletDraw=false, bool enableWireframe=false,
+			       bool enableAAbbBoxDraw=false, bool enableOrthoView=false);
+		virtual ~Scene(void);
+
+	protected:
+		// signal handlers:
+		virtual void on_realize(void);
+		virtual bool on_configure_event(GdkEventConfigure* event);
+		virtual bool on_expose_event(GdkEventExpose* event);
+		virtual bool on_button_press_event(GdkEventButton* event);
+		virtual bool on_map_event(GdkEventAny* event);
+		virtual bool on_unmap_event(GdkEventAny* event);
+		virtual bool on_visibility_notify_event(GdkEventVisibility* event);
+		virtual bool on_timeout(void);
+
+	public:
+		// Invalidate whole window.
+		void invalidate(void)
+		{
+			this->get_window()->invalidate_rect(get_allocation(), false);
+		}
+
+		// Update window synchronously (fast).
+		void update(void)
+		{
+			this->get_window()->process_updates(false);
+		}
+
+	protected:
+		// timeout signal connection:
+		sigc::connection m_ConnectionTimeout;
+
+		void timeout_add(void);
+		void timeout_remove(void);
+
+	public:
+		// OpenGL scene related methods:
+		bool BulletDraw_is_enabled(void) const
+		{
+			return m_Model.bullet;
+		}
+		bool wireframe_is_enabled(void) const
+		{
+			return m_Model.wireframe;
+		}
+		bool aabbBoxDraw_is_enabled(void) const
+		{
+			return m_Model.aabb;
+		}
+		void orthoView(void);
+		void bulletDraw(void);
+		void wireframe_view(void);
+		void AAbbBoxDraw(void);
+		void init_anim(void);
+
+	protected:
+		Gtk::Menu* create_popup_menu(void);
+
+		// Popup menu:
+		Gtk::Menu* m_Menu;
+
+		// OpenGL scene related objects:
+		View m_View;
+		ModelDraw m_Model;
+	};
+}//namespace  Hkl3dGui
+
+#endif //__HKL3D_GUI_SCENE_H__
diff --git a/gui/hkl3d/hkl3d-gui-view.cpp b/gui/hkl3d/hkl3d-gui-view.cpp
new file mode 100644
index 0000000..eb90965
--- /dev/null
+++ b/gui/hkl3d/hkl3d-gui-view.cpp
@@ -0,0 +1,222 @@
+/*
+ * This file is part of the hkl3d library.
+ * inspired from logo-model.c of the GtkGLExt logo models.
+ * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#include "hkl3d-gui-view.h"
+#include "hkl3d-gui-scene.h"
+
+//
+// Trackball utilities.
+//
+namespace Trackball {
+	extern "C" {
+#include "trackball.h"
+	}
+}
+
+#define DIG_2_RAD (G_PI / 180.0)
+#define RAD_2_DIG (180.0 / G_PI)
+
+namespace  Hkl3dGui
+{
+	//
+	// View class implementation.
+	//
+	const float View::NEAR_CLIP   = 2.0;
+	const float View::FAR_CLIP    = 60.0;
+
+	const float View::INIT_POS_X  = 0.0;
+	const float View::INIT_POS_Y  = 0.0;
+	const float View::INIT_POS_Z  = -30.0;
+
+	const float View::INIT_AXIS_X = 0.0;
+	const float View::INIT_AXIS_Y = 0.0;
+	const float View::INIT_AXIS_Z = 0.0;
+	const float View::INIT_ANGLE  = 0.0;
+
+	const float View::INIT_SCALE  = 7.0;
+
+	const float View::SCALE_MAX   = 50.0;
+	const float View::SCALE_MIN   = 1.0;
+
+	View::View(void)
+		: m_Scale(INIT_SCALE), m_BeginX(0.0), m_BeginY(0.0)
+	{
+		this->reset();
+	}
+
+	View::~View(void)
+	{
+	}
+
+	void View::frustum(int w, int h)
+	{
+		glViewport(0, 0, w, h);
+
+		glMatrixMode(GL_PROJECTION);
+		glLoadIdentity();
+
+		if (w > h) {
+			float aspect = static_cast<float>(w) / static_cast<float>(h);
+			glFrustum(-aspect, aspect, -1.0, 1.0, NEAR_CLIP, FAR_CLIP);
+		}else{
+			float aspect = static_cast<float>(h) / static_cast<float>(w);
+			glFrustum(-1.0, 1.0, -aspect, aspect, NEAR_CLIP, FAR_CLIP);
+		}
+
+		glMatrixMode(GL_MODELVIEW);
+	}
+	void View::ortho(int w, int h)
+	{
+		glMatrixMode(GL_PROJECTION);
+		glLoadIdentity();
+
+		glOrtho(-w/40, w/40 , -h/40 , h/40 , -1, 100);
+
+		glMatrixMode(GL_MODELVIEW);
+	}
+	void View::xform(void)
+	{
+		glTranslatef(m_Pos[0], m_Pos[1], m_Pos[2]);
+
+		glScalef(m_Scale, m_Scale, m_Scale);
+
+		float m[4][4];
+		Trackball::build_rotmatrix(m, m_Quat);
+		glMultMatrixf(&m[0][0]);
+
+	}
+
+	void View::reset(void)
+	{
+		m_Pos[0] = INIT_POS_X;
+		m_Pos[1] = INIT_POS_Y;
+		m_Pos[2] = INIT_POS_Z;
+
+		float sine = sin(0.5 * INIT_ANGLE * DIG_2_RAD);
+		m_Quat[0] = INIT_AXIS_X * sine;
+		m_Quat[1] = INIT_AXIS_Y * sine;
+		m_Quat[2] = INIT_AXIS_Z * sine;
+		m_Quat[3] = cos(0.5 * INIT_ANGLE * DIG_2_RAD);
+
+		m_Scale = INIT_SCALE;
+	}
+
+	bool View::on_button_press_event(GdkEventButton* event,
+					 Scene* scene)
+	{
+		m_BeginX = event->x;
+		m_BeginY = event->y;
+
+		// don't block
+		return false;
+	}
+	bool View::zoom_scroll(GdkEventScroll *event,Scene* scene)
+	{
+		float x = event->x;
+		float y = event->y;
+		float w = scene->get_width();
+		float h = scene->get_height();
+		bool redraw = false;
+
+		if (scene == 0)
+			return false;
+
+
+		if(event->direction == GDK_SCROLL_DOWN)
+			m_Scale +=1;
+		else
+			m_Scale -=1;
+
+		if (m_Scale > SCALE_MAX)
+			m_Scale = SCALE_MAX;
+		else if (m_Scale < SCALE_MIN)
+			m_Scale = SCALE_MIN;
+		redraw = true;
+
+		if (redraw && !scene->BulletDraw_is_enabled())
+			scene->invalidate();
+
+
+		return false;
+	}
+	bool View::on_motion_notify_event(GdkEventMotion* event,
+					  Scene* scene)
+	{
+		if (scene == 0)
+			return false;
+
+		float w = scene->get_width();
+		float h = scene->get_height();
+		float x = event->x;
+		float y = event->y;
+		float d_quat[4];
+		bool redraw = false;
+
+		// Translation && Rotation.
+		if (event->state & GDK_BUTTON1_MASK) {
+			if(event->state & GDK_SHIFT_MASK)
+			{
+				/* shift pressed, translate view */
+				m_Pos[0]+=
+					(gdouble)(x - m_BeginX ) /
+					(gdouble)(m_Scale * 10);
+				m_Pos[1]-=
+					(gdouble)(y - m_BeginY) /
+					(gdouble)(m_Scale * 10);
+				redraw = true;
+			}
+			else{
+				Trackball::trackball(d_quat,
+						     (2.0 * m_BeginX - w) / w,
+						     (h - 2.0 * m_BeginY) / h,
+						     (2.0 * x - w) / w,
+						     (h - 2.0 * y) / h);
+				Trackball::add_quats(d_quat, m_Quat, m_Quat);
+				redraw = true;
+			}
+
+		}
+
+		// Scaling.
+		if (event->state & GDK_BUTTON2_MASK) {
+			m_Scale = m_Scale * (1.0 + (y - m_BeginY) / h);
+			if (m_Scale > SCALE_MAX)
+				m_Scale = SCALE_MAX;
+			else if (m_Scale < SCALE_MIN)
+				m_Scale = SCALE_MIN;
+			redraw = true;
+		}
+
+		m_BeginX = x;
+		m_BeginY = y;
+
+		if (redraw && !scene->BulletDraw_is_enabled())
+			scene->invalidate();
+
+		// don't block
+		return false;
+	}
+} //namespace  Hkl3dGui
diff --git a/gui/hkl3d/hkl3d-gui-view.h b/gui/hkl3d/hkl3d-gui-view.h
new file mode 100644
index 0000000..7d8415e
--- /dev/null
+++ b/gui/hkl3d/hkl3d-gui-view.h
@@ -0,0 +1,109 @@
+/*
+ * This file is part of the hkl3d library.
+ * inspired from logo-model.c of the GtkGLExt logo models.
+ * written by Naofumi Yasufuku  <naofumi at users.sourceforge.net>
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ *          Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#ifndef __HKL3D_GUI_VIEW_H__
+#define __HKL3D_GUI_VIEW_H__
+
+#include <gtkmm.h>
+#include <gtkglmm.h>
+
+//#include "GlutDemoApplication.h"
+//#include "hkl3d.h"
+
+namespace  Hkl3dGui
+{
+	class Scene;
+
+	class View : public sigc::trackable
+	{
+		friend class Scene;
+
+	public:
+		static const float NEAR_CLIP;
+		static const float FAR_CLIP;
+
+		static const float INIT_POS_X;
+		static const float INIT_POS_Y;
+		static const float INIT_POS_Z;
+
+		static const float INIT_AXIS_X;
+		static const float INIT_AXIS_Y;
+		static const float INIT_AXIS_Z;
+		static const float INIT_ANGLE;
+
+		static const float INIT_SCALE;
+
+		static const float SCALE_MAX;
+		static const float SCALE_MIN;
+
+	public:
+		View(void);
+		virtual ~View(void);
+
+	public:
+		void frustum(int w, int h);
+		void ortho(int w, int h);
+		void xform(void);
+
+		void reset(void);
+
+		void set_pos(float x, float y, float z)
+		{
+			m_Pos[0] = x;
+			m_Pos[1] = y;
+			m_Pos[2] = z;
+		}
+
+		void set_quat(float q0, float q1, float q2, float q3)
+		{
+			m_Quat[0] = q0;
+			m_Quat[1] = q1;
+			m_Quat[2] = q2;
+			m_Quat[3] = q3;
+		}
+
+		void set_scale(float scale)
+		{
+			m_Scale = scale;
+		}
+
+	protected:
+		// Signal handlers:
+		virtual bool zoom_scroll(GdkEventScroll *event ,Scene* scene);
+		virtual bool on_button_press_event(GdkEventButton* event, Scene* scene);
+		virtual bool on_motion_notify_event(GdkEventMotion* event, Scene* scene);
+
+	private:
+		float m_Pos[3];
+		float m_Quat[4];
+		float m_Scale;
+
+		float m_BeginX;
+		float m_BeginY;
+	};
+} // namespace  Hkl3dGui
+
+#endif // __HKL3D_GUI_VIEW_H__
diff --git a/gui/hkl3d/texture.c b/gui/hkl3d/texture.c
new file mode 100644
index 0000000..0dfb83a
--- /dev/null
+++ b/gui/hkl3d/texture.c
@@ -0,0 +1,42 @@
+/* $Id: texture.c 42 2006-05-22 13:31:45Z mmmaddd $ */
+
+/*
+	G3DViewer - 3D object viewer
+
+	Copyright (C) 2005, 2006  Markus Dahms <mad at automagically.de>
+
+    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
+*/
+
+#ifdef HAVE_CONFIG_H
+#	include <config.h>
+#endif
+
+#include <stdlib.h>
+
+#include <g3d/g3d.h>
+
+#include "hkl3d-gui-gl.h"
+
+int texture_load_all_textures(G3DModel *model)
+{
+	if(model == NULL) return EXIT_FAILURE;
+
+	if(model->tex_images != NULL)
+		g_hash_table_foreach(model->tex_images,
+			gl_load_texture, NULL);
+
+	return EXIT_SUCCESS;
+}
diff --git a/gui/hkl3d/texture.h b/gui/hkl3d/texture.h
new file mode 100644
index 0000000..327fed8
--- /dev/null
+++ b/gui/hkl3d/texture.h
@@ -0,0 +1,30 @@
+/* $Id: texture.h 84 2008-04-04 19:39:21Z mmmaddd $ */
+
+/*
+	G3DViewer - 3D object viewer
+
+	Copyright (C) 2005, 2006  Markus Dahms <mad at automagically.de>
+
+    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
+*/
+
+#ifndef _TEXTURE_H
+#define _TEXTURE_H
+
+#include <g3d/g3d.h>
+
+int texture_load_all_textures(G3DModel *model);
+
+#endif
diff --git a/gui/hkl3d/trackball.c b/gui/hkl3d/trackball.c
new file mode 100644
index 0000000..c984dd1
--- /dev/null
+++ b/gui/hkl3d/trackball.c
@@ -0,0 +1,323 @@
+/*
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+/*
+ * Trackball code:
+ *
+ * Implementation of a virtual trackball.
+ * Implemented by Gavin Bell, lots of ideas from Thant Tessman and
+ *   the August '88 issue of Siggraph's "Computer Graphics," pp. 121-129.
+ *
+ * Vector manip code:
+ *
+ * Original code from:
+ * David M. Ciemiewicz, Mark Grossman, Henry Moreton, and Paul Haeberli
+ *
+ * Much mucking with by:
+ * Gavin Bell
+ */
+#include <math.h>
+#include "trackball.h"
+
+/*
+ * This size should really be based on the distance from the center of
+ * rotation to the point on the object underneath the mouse.  That
+ * point would then track the mouse as closely as possible.  This is a
+ * simple example, though, so that is left as an Exercise for the
+ * Programmer.
+ */
+#define TRACKBALLSIZE  (0.8)
+
+/*
+ * Local function prototypes (not defined in trackball.h)
+ */
+static float tb_project_to_sphere(float, float, float);
+static void normalize_quat(float [4]);
+
+void
+vzero(float *v)
+{
+    v[0] = 0.0;
+    v[1] = 0.0;
+    v[2] = 0.0;
+}
+
+void
+vset(float *v, float x, float y, float z)
+{
+    v[0] = x;
+    v[1] = y;
+    v[2] = z;
+}
+
+void
+vsub(const float *src1, const float *src2, float *dst)
+{
+    dst[0] = src1[0] - src2[0];
+    dst[1] = src1[1] - src2[1];
+    dst[2] = src1[2] - src2[2];
+}
+
+void
+vcopy(const float *v1, float *v2)
+{
+    register int i;
+    for (i = 0 ; i < 3 ; i++)
+        v2[i] = v1[i];
+}
+
+void
+vcross(const float *v1, const float *v2, float *cross)
+{
+    float temp[3];
+
+    temp[0] = (v1[1] * v2[2]) - (v1[2] * v2[1]);
+    temp[1] = (v1[2] * v2[0]) - (v1[0] * v2[2]);
+    temp[2] = (v1[0] * v2[1]) - (v1[1] * v2[0]);
+    vcopy(temp, cross);
+}
+
+float
+vlength(const float *v)
+{
+    return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
+}
+
+void
+vscale(float *v, float div)
+{
+    v[0] *= div;
+    v[1] *= div;
+    v[2] *= div;
+}
+
+void
+vnormal(float *v)
+{
+    vscale(v,1.0/vlength(v));
+}
+
+float
+vdot(const float *v1, const float *v2)
+{
+    return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
+}
+
+void
+vadd(const float *src1, const float *src2, float *dst)
+{
+    dst[0] = src1[0] + src2[0];
+    dst[1] = src1[1] + src2[1];
+    dst[2] = src1[2] + src2[2];
+}
+
+/*
+ * Ok, simulate a track-ball.  Project the points onto the virtual
+ * trackball, then figure out the axis of rotation, which is the cross
+ * product of P1 P2 and O P1 (O is the center of the ball, 0,0,0)
+ * Note:  This is a deformed trackball-- is a trackball in the center,
+ * but is deformed into a hyperbolic sheet of rotation away from the
+ * center.  This particular function was chosen after trying out
+ * several variations.
+ *
+ * It is assumed that the arguments to this routine are in the range
+ * (-1.0 ... 1.0)
+ */
+void
+trackball(float q[4], float p1x, float p1y, float p2x, float p2y)
+{
+    float a[3]; /* Axis of rotation */
+    float phi;  /* how much to rotate about axis */
+    float p1[3], p2[3], d[3];
+    float t;
+
+    if (p1x == p2x && p1y == p2y) {
+        /* Zero rotation */
+        vzero(q);
+        q[3] = 1.0;
+        return;
+    }
+
+    /*
+     * First, figure out z-coordinates for projection of P1 and P2 to
+     * deformed sphere
+     */
+    vset(p1,p1x,p1y,tb_project_to_sphere(TRACKBALLSIZE,p1x,p1y));
+    vset(p2,p2x,p2y,tb_project_to_sphere(TRACKBALLSIZE,p2x,p2y));
+
+    /*
+     *  Now, we want the cross product of P1 and P2
+     */
+    vcross(p2,p1,a);
+
+    /*
+     *  Figure out how much to rotate around that axis.
+     */
+    vsub(p1,p2,d);
+    t = vlength(d) / (2.0*TRACKBALLSIZE);
+
+    /*
+     * Avoid problems with out-of-control values...
+     */
+    if (t > 1.0) t = 1.0;
+    if (t < -1.0) t = -1.0;
+    phi = 2.0 * asin(t);
+
+    axis_to_quat(a,phi,q);
+}
+
+/*
+ *  Given an axis and angle, compute quaternion.
+ */
+void
+axis_to_quat(float a[3], float phi, float q[4])
+{
+    vnormal(a);
+    vcopy(a,q);
+    vscale(q,sin(phi/2.0));
+    q[3] = cos(phi/2.0);
+}
+
+/*
+ * Project an x,y pair onto a sphere of radius r OR a hyperbolic sheet
+ * if we are away from the center of the sphere.
+ */
+static float
+tb_project_to_sphere(float r, float x, float y)
+{
+    float d, t, z;
+
+    d = sqrt(x*x + y*y);
+    if (d < r * 0.70710678118654752440) {    /* Inside sphere */
+        z = sqrt(r*r - d*d);
+    } else {           /* On hyperbola */
+        t = r / 1.41421356237309504880;
+        z = t*t / d;
+    }
+    return z;
+}
+
+/*
+ * Given two rotations, e1 and e2, expressed as quaternion rotations,
+ * figure out the equivalent single rotation and stuff it into dest.
+ *
+ * This routine also normalizes the result every RENORMCOUNT times it is
+ * called, to keep error from creeping in.
+ *
+ * NOTE: This routine is written so that q1 or q2 may be the same
+ * as dest (or each other).
+ */
+
+#define RENORMCOUNT 97
+
+void
+add_quats(float q1[4], float q2[4], float dest[4])
+{
+    static int count=0;
+    float t1[4], t2[4], t3[4];
+    float tf[4];
+
+    vcopy(q1,t1);
+    vscale(t1,q2[3]);
+
+    vcopy(q2,t2);
+    vscale(t2,q1[3]);
+
+    vcross(q2,q1,t3);
+    vadd(t1,t2,tf);
+    vadd(t3,tf,tf);
+    tf[3] = q1[3] * q2[3] - vdot(q1,q2);
+
+    dest[0] = tf[0];
+    dest[1] = tf[1];
+    dest[2] = tf[2];
+    dest[3] = tf[3];
+
+    if (++count > RENORMCOUNT) {
+        count = 0;
+        normalize_quat(dest);
+    }
+}
+
+/*
+ * Quaternions always obey:  a^2 + b^2 + c^2 + d^2 = 1.0
+ * If they don't add up to 1.0, dividing by their magnitued will
+ * renormalize them.
+ *
+ * Note: See the following for more information on quaternions:
+ *
+ * - Shoemake, K., Animating rotation with quaternion curves, Computer
+ *   Graphics 19, No 3 (Proc. SIGGRAPH'85), 245-254, 1985.
+ * - Pletinckx, D., Quaternion calculus as a basic tool in computer
+ *   graphics, The Visual Computer 5, 2-13, 1989.
+ */
+static void
+normalize_quat(float q[4])
+{
+    int i;
+    float mag;
+
+    mag = (q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);
+    for (i = 0; i < 4; i++) q[i] /= mag;
+}
+
+/*
+ * Build a rotation matrix, given a quaternion rotation.
+ *
+ */
+void
+build_rotmatrix(float m[4][4], float q[4])
+{
+    m[0][0] = 1.0 - 2.0 * (q[1] * q[1] + q[2] * q[2]);
+    m[0][1] = 2.0 * (q[0] * q[1] - q[2] * q[3]);
+    m[0][2] = 2.0 * (q[2] * q[0] + q[1] * q[3]);
+    m[0][3] = 0.0;
+
+    m[1][0] = 2.0 * (q[0] * q[1] + q[2] * q[3]);
+    m[1][1]= 1.0 - 2.0 * (q[2] * q[2] + q[0] * q[0]);
+    m[1][2] = 2.0 * (q[1] * q[2] - q[0] * q[3]);
+    m[1][3] = 0.0;
+
+    m[2][0] = 2.0 * (q[2] * q[0] - q[1] * q[3]);
+    m[2][1] = 2.0 * (q[1] * q[2] + q[0] * q[3]);
+    m[2][2] = 1.0 - 2.0 * (q[1] * q[1] + q[0] * q[0]);
+    m[2][3] = 0.0;
+
+    m[3][0] = 0.0;
+    m[3][1] = 0.0;
+    m[3][2] = 0.0;
+    m[3][3] = 1.0;
+}
diff --git a/gui/hkl3d/trackball.h b/gui/hkl3d/trackball.h
new file mode 100644
index 0000000..b9d9494
--- /dev/null
+++ b/gui/hkl3d/trackball.h
@@ -0,0 +1,77 @@
+/*
+ * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
+/*
+ * trackball.h
+ * A virtual trackball implementation
+ * Written by Gavin Bell for Silicon Graphics, November 1988.
+ */
+
+/*
+ * Pass the x and y coordinates of the last and current positions of
+ * the mouse, scaled so they are from (-1.0 ... 1.0).
+ *
+ * The resulting rotation is returned as a quaternion rotation in the
+ * first paramater.
+ */
+void
+trackball(float q[4], float p1x, float p1y, float p2x, float p2y);
+
+/*
+ * Given two quaternions, add them together to get a third quaternion.
+ * Adding quaternions to get a compound rotation is analagous to adding
+ * translations to get a compound translation.  When incrementally
+ * adding rotations, the first argument here should be the new
+ * rotation, the second and third the total rotation (which will be
+ * over-written with the resulting new total rotation).
+ */
+void
+add_quats(float *q1, float *q2, float *dest);
+
+/*
+ * A useful function, builds a rotation matrix in Matrix based on
+ * given quaternion.
+ */
+void
+build_rotmatrix(float m[4][4], float q[4]);
+
+/*
+ * This function computes a quaternion based on an axis (defined by
+ * the given vector) and an angle about which to rotate.  The angle is
+ * expressed in radians.  The result is put into the third argument.
+ */
+void
+axis_to_quat(float a[3], float phi, float q[4]);
diff --git a/gui/main.cpp b/gui/main.cpp
index 413b44d..54a3909 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -21,11 +21,14 @@
  */
 #include <gtkmm/main.h>
 
-#include "ghkl.h"
+#include "hkl-gui.h"
 
 int main(int argc, char *argv[])
 {
 	Gtk::Main kit(argc, argv);
+#ifdef HKL3D
+	Gtk::GL::init(argc, argv);
+#endif
 	HKLWindow window;
 	kit.run();
 
diff --git a/gui/pseudo.ui b/gui/pseudo.ui
index 7ce8feb..fcaba79 100644
--- a/gui/pseudo.ui
+++ b/gui/pseudo.ui
@@ -1,43 +1,48 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <requires lib="gtk+" version="2.16"/>
-  <!-- interface-naming-policy project-wide -->
-  <object class="GtkListStore" id="liststore3">
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkListStore" id="liststore1">
     <columns>
       <!-- column-name name -->
       <column type="gchararray"/>
-      <!-- column-name value -->
-      <column type="gdouble"/>
+      <!-- column-name mode -->
+      <column type="gpointer"/>
     </columns>
   </object>
-  <object class="GtkListStore" id="liststore1">
+  <object class="GtkListStore" id="liststore2">
     <columns>
       <!-- column-name name -->
       <column type="gchararray"/>
+      <!-- column-name value -->
+      <column type="gdouble"/>
+      <!-- column-name pseudo -->
+      <column type="gpointer"/>
     </columns>
   </object>
-  <object class="GtkListStore" id="liststore2">
+  <object class="GtkListStore" id="liststore3">
     <columns>
       <!-- column-name name -->
       <column type="gchararray"/>
       <!-- column-name value -->
       <column type="gdouble"/>
-      <!-- column-name pseudo -->
+      <!-- column-name parameter -->
       <column type="gpointer"/>
     </columns>
   </object>
   <object class="GtkFrame" id="frame1">
     <property name="visible">True</property>
+    <property name="can_focus">False</property>
     <property name="label_xalign">0</property>
     <property name="shadow_type">none</property>
     <child>
       <object class="GtkAlignment" id="alignment1">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="left_padding">12</property>
         <child>
           <object class="GtkVBox" id="vbox1">
             <property name="visible">True</property>
-            <property name="orientation">vertical</property>
+            <property name="can_focus">False</property>
             <child>
               <object class="GtkTreeView" id="treeview1">
                 <property name="visible">True</property>
@@ -47,6 +52,9 @@
                 <property name="search_column">0</property>
                 <property name="enable_grid_lines">both</property>
                 <property name="enable_tree_lines">True</property>
+                <child internal-child="selection">
+                  <object class="GtkTreeSelection" id="treeview-selection1"/>
+                </child>
                 <child>
                   <object class="GtkTreeViewColumn" id="treeviewcolumn1">
                     <property name="title">pseudo axis</property>
@@ -73,16 +81,20 @@
                 </child>
               </object>
               <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
                 <property name="position">0</property>
               </packing>
             </child>
             <child>
               <object class="GtkHBox" id="hbox1">
                 <property name="visible">True</property>
+                <property name="can_focus">False</property>
                 <property name="spacing">3</property>
                 <child>
                   <object class="GtkLabel" id="label1">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label" translatable="yes">mode</property>
                   </object>
                   <packing>
@@ -94,6 +106,7 @@
                 <child>
                   <object class="GtkComboBox" id="combobox1">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="model">liststore1</property>
                     <property name="add_tearoffs">True</property>
                     <child>
@@ -104,15 +117,19 @@
                     </child>
                   </object>
                   <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkButton" id="button1">
                     <property name="label">gtk-jump-to</property>
+                    <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
+                    <property name="use_action_appearance">False</property>
                     <property name="use_stock">True</property>
                   </object>
                   <packing>
@@ -124,9 +141,11 @@
                 <child>
                   <object class="GtkButton" id="button2">
                     <property name="label" translatable="yes">Initializer</property>
+                    <property name="use_action_appearance">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">True</property>
+                    <property name="use_action_appearance">False</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -154,6 +173,9 @@
                     <property name="headers_clickable">False</property>
                     <property name="rules_hint">True</property>
                     <property name="search_column">0</property>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection" id="treeview-selection2"/>
+                    </child>
                     <child>
                       <object class="GtkTreeViewColumn" id="treeviewcolumn3">
                         <property name="title">parameter</property>
@@ -183,11 +205,14 @@
                 <child type="label">
                   <object class="GtkLabel" id="label3">
                     <property name="visible">True</property>
+                    <property name="can_focus">False</property>
                     <property name="label" translatable="yes">parameters</property>
                   </object>
                 </child>
               </object>
               <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
                 <property name="position">2</property>
               </packing>
             </child>
@@ -198,6 +223,7 @@
     <child type="label">
       <object class="GtkLabel" id="label2">
         <property name="visible">True</property>
+        <property name="can_focus">False</property>
         <property name="label" translatable="yes">frame1</property>
         <attributes>
           <attribute name="weight" value="bold"/>
diff --git a/hkl.h b/hkl.h
index dab39f7..e523ac6 100644
--- a/hkl.h
+++ b/hkl.h
@@ -1,7 +1,483 @@
-#include <hkl/hkl-error.h>
-#include <hkl/hkl-detector-factory.h>
-#include <hkl/hkl-pseudoaxis-factory.h>
-#include <hkl/hkl-pseudoaxis-e4cv.h>
-#include <hkl/hkl-pseudoaxis-e6c.h>
-#include <hkl/hkl-pseudoaxis-k4cv.h>
-#include <hkl/hkl-pseudoaxis-k6c.h>
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#ifndef __HKL_H__
+#define __HKL_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <gsl/gsl_math.h>
+
+#include <hkl/ccan/darray/darray.h>
+
+/* Guard C code in headers, while including them from C++ */
+#ifdef __cplusplus
+# define HKL_BEGIN_DECLS  extern "C" {
+# define HKL_END_DECLS    }
+#else
+# define HKL_BEGIN_DECLS
+# define HKL_END_DECLS
+#endif
+
+/* deprecated */
+#if    __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+# define HKL_DEPRECATED __attribute__((__deprecated__))
+#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
+# define HKL_DEPRECATED __declspec(deprecated)
+#else
+# define HKL_DEPRECATED
+#endif
+
+#if    __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+# define HKL_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
+#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
+# define HKL_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
+#else
+# define HKL_DEPRECATED_FOR(f) HKL_DEPRECATED
+#endif
+
+#define HKL_TRUE 1
+#define HKL_FALSE 0
+
+#define HKL_TINY 1e-7
+#define HKL_EPSILON 1e-6
+#define HKL_DEGTORAD (M_PI/180.)
+#define HKL_RADTODEG (180./M_PI)
+
+/* tau = 2pi or 1 */
+#define HKL_TAU (2. * M_PI)
+/* #define HKL_TAU 1 */
+
+#ifdef HKLAPI
+# undef HKLEAPI
+#endif
+
+#ifdef __GNUC__
+# if __GNUC__ >= 4
+#  define HKLAPI __attribute__ ((visibility("default")))
+# else
+#  define HKLAPI
+# endif
+#else
+/**
+ * @def HKLEAPI
+ * @brief Used to export functions(by changing visibility).
+ */
+# define HKLAPI
+#endif
+
+#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
+# define HKL_ARG_NONNULL(...) __attribute__ ((__nonnull__(__VA_ARGS__)))
+#else
+# define HKL_ARG_NONNULL(...)
+#endif
+
+#define _darray(type) type *item; size_t size; size_t alloc
+
+HKL_BEGIN_DECLS
+
+/**********/
+/* Matrix */
+/**********/
+
+typedef struct _HklMatrix HklMatrix;
+
+HKLAPI HklMatrix *hkl_matrix_new(void);
+
+HKLAPI HklMatrix *hkl_matrix_new_full(double m11, double m12, double m13,
+				      double m21, double m22, double m23,
+				      double m31, double m32, double m33);
+
+HKLAPI HklMatrix *hkl_matrix_new_euler(double euler_x, double euler_y, double euler_z);
+
+HKLAPI double hkl_matrix_get(const HklMatrix *self, unsigned int i, unsigned int j) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_matrix_free(HklMatrix *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_matrix_init(HklMatrix *self,
+			    double m11, double m12, double m13,
+			    double m21, double m22, double m23,
+			    double m31, double m32, double m33) HKL_ARG_NONNULL(1);
+
+HKLAPI int hkl_matrix_cmp(const HklMatrix *self, const HklMatrix *m) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI void hkl_matrix_times_matrix(HklMatrix *self, const HklMatrix *m) HKL_ARG_NONNULL(1, 2);
+
+/*********/
+/* Error */
+/*********/
+
+typedef struct _HklError HklError;
+
+HKLAPI const char *hkl_error_message_get(const HklError *self) HKL_ARG_NONNULL(1);
+
+/*************/
+/* Parameter */
+/*************/
+
+typedef struct _HklParameter HklParameter;
+typedef struct _HklParameterList HklParameterList;
+typedef HklParameterList darray_parameter;
+
+/* HklParameter */
+
+HKLAPI HklParameter *hkl_parameter_new_copy(const HklParameter *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_parameter_free(HklParameter *self) HKL_ARG_NONNULL(1);
+
+HKLAPI const char *hkl_parameter_name_get(const HklParameter *self) HKL_ARG_NONNULL(1);
+
+HKLAPI double hkl_parameter_value_get(const HklParameter *self) HKL_ARG_NONNULL(1);
+
+HKLAPI int hkl_parameter_value_set(HklParameter *self, double value,
+				   HklError **error) HKL_ARG_NONNULL(1);
+
+HKLAPI double hkl_parameter_value_unit_get(const HklParameter *self) HKL_ARG_NONNULL(1);
+
+HKLAPI int hkl_parameter_value_unit_set(HklParameter *self, double value,
+					HklError **error) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_parameter_min_max_get(const HklParameter *self, double *min, double *max) HKL_ARG_NONNULL(1, 2, 3);
+
+HKLAPI void hkl_parameter_min_max_set(HklParameter *self, double min, double max) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_parameter_min_max_unit_get(const HklParameter *self, double *min, double *max) HKL_ARG_NONNULL(1, 2, 3);
+
+HKLAPI void hkl_parameter_min_max_unit_set(HklParameter *self, double min, double max) HKL_ARG_NONNULL(1);
+
+HKLAPI int hkl_parameter_fit_get(const HklParameter *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_parameter_fit_set(HklParameter *self, int fit) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_parameter_randomize(HklParameter *self) HKL_ARG_NONNULL(1);
+
+/* HklParameterList */
+
+struct _HklParameterList {
+	_darray(HklParameter *);
+};
+
+HKLAPI unsigned int hkl_parameter_list_values_set(HklParameterList *self,
+						  double values[], unsigned int len,
+						  HklError **error) HKL_ARG_NONNULL(1);
+
+HKLAPI double *hkl_parameter_list_values_unit_get(const HklParameterList *self,
+						  unsigned int *len) HKL_ARG_NONNULL(1, 2);
+
+/* only use in the test method for now */
+HKLAPI void hkl_parameter_list_randomize(HklParameterList *self) HKL_ARG_NONNULL(1);
+
+/************/
+/* Detector */
+/************/
+
+typedef struct _HklDetector HklDetector;
+typedef enum _HklDetectorType
+{
+	HKL_DETECTOR_TYPE_0D
+} HklDetectorType;
+
+HKLAPI void hkl_detector_free(HklDetector *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_detector_idx_set(HklDetector *self, int idx) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_detector_fprintf(FILE *f, const HklDetector *self) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI HklDetector *hkl_detector_factory_new(HklDetectorType type);
+
+/************/
+/* Geometry */
+/************/
+
+typedef struct _HklGeometry HklGeometry;
+typedef struct _HklGeometryList HklGeometryList;
+typedef struct _HklGeometryListItem HklGeometryListItem;
+
+typedef darray(HklGeometryListItem *) darray_item;
+
+/* HklGeometry */
+
+HKLAPI void hkl_geometry_free(HklGeometry *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_geometry_set(HklGeometry *self, const HklGeometry *src) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const darray_parameter *hkl_geometry_axes_get(const HklGeometry *self) HKL_ARG_NONNULL(1);
+
+HKLAPI const HklParameter *hkl_geometry_axis_get(const HklGeometry *self, const char *name) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI void hkl_geometry_axis_set(HklGeometry *self, const HklParameter *axis) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const char *hkl_geometry_name_get(const HklGeometry *self) HKL_ARG_NONNULL(1);
+
+HKLAPI double hkl_geometry_wavelength_get(const HklGeometry *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_geometry_wavelength_set(HklGeometry *self, double wavelength) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_geometry_randomize(HklGeometry *self) HKL_ARG_NONNULL(1);
+
+HKLAPI int hkl_geometry_set_values_unit_v(HklGeometry *self, ...) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_geometry_fprintf(FILE *file, const HklGeometry *self) HKL_ARG_NONNULL(1, 2);
+
+/* HklGeometryList */
+
+HKLAPI const darray_item *hkl_geometry_list_items_get(const HklGeometryList *self) HKL_ARG_NONNULL(1);
+
+/* HklGeometryListItem */
+
+HKLAPI const HklGeometry *hkl_geometry_list_item_geometry_get(const HklGeometryListItem *self) HKL_ARG_NONNULL(1);
+
+/**********/
+/* Sample */
+/**********/
+
+typedef struct _HklLattice HklLattice;
+typedef struct _HklSample HklSample;
+typedef struct _HklSampleReflection HklSampleReflection;
+
+/* Lattice */
+
+HKLAPI HklLattice *hkl_lattice_new(double a, double b, double c,
+				   double alpha, double beta, double gamma);
+
+HKLAPI HklLattice *hkl_lattice_new_copy(const HklLattice *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklLattice *hkl_lattice_new_default(void);
+
+HKLAPI void hkl_lattice_free(HklLattice *self) HKL_ARG_NONNULL(1);
+
+HKLAPI const HklParameter *hkl_lattice_a_get(const HklLattice *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_lattice_a_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklParameter *hkl_lattice_b_get(const HklLattice *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_lattice_b_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklParameter *hkl_lattice_c_get(const HklLattice *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_lattice_c_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklParameter *hkl_lattice_alpha_get(const HklLattice *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_lattice_alpha_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklParameter *hkl_lattice_beta_get(const HklLattice *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_lattice_beta_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklParameter *hkl_lattice_gamma_get(const HklLattice *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_lattice_gamma_set(HklLattice *self, const HklParameter *parameter) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI int hkl_lattice_set(HklLattice *self,
+			   double a, double b, double c,
+			   double alpha, double beta, double gamma) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_lattice_get(const HklLattice *self,
+			    double *a, double *b, double *c,
+			    double *alpha, double *beta, double *gamma) HKL_ARG_NONNULL(1, 2, 3, 4, 5, 6, 7);
+
+HKLAPI int hkl_lattice_get_B(const HklLattice *self, HklMatrix *B) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI int hkl_lattice_get_1_B(const HklLattice *self, HklMatrix *B) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI int hkl_lattice_reciprocal(const HklLattice *self, HklLattice *reciprocal) HKL_ARG_NONNULL(1, 2);
+
+/* HklSample */
+
+HKLAPI HklSample *hkl_sample_new(const char *name) HKL_ARG_NONNULL(1);
+
+HKLAPI HklSample *hkl_sample_new_copy(const HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_free(HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI const char *hkl_sample_name_get(const HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_name_set(HklSample *self, const char *name) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklLattice *hkl_sample_lattice_get(HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_lattice_set(HklSample *self, const HklLattice *lattice) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklParameter *hkl_sample_ux_get(const HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_ux_set(HklSample *self, const HklParameter *ux) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklParameter *hkl_sample_uy_get(const HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_uy_set(HklSample *self, const HklParameter *uy) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklParameter *hkl_sample_uz_get(const HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_uz_set(HklSample *self, const HklParameter *uz) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklMatrix *hkl_sample_U_get(const HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_U_set(HklSample *self, const HklMatrix *U) HKL_ARG_NONNULL(1);
+
+HKLAPI const HklMatrix *hkl_sample_UB_get(const HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI double hkl_sample_UB_set(HklSample *self, const HklMatrix *UB) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI HklSampleReflection *hkl_sample_first_reflection_get(const HklSample *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklSampleReflection *hkl_sample_next_reflection_get(const HklSample *self,
+							   const HklSampleReflection *reflection) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI void hkl_sample_del_reflection(HklSample *self,
+				      HklSampleReflection *reflection) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI void hkl_sample_add_reflection(HklSample *self,
+				      HklSampleReflection *reflection) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI int hkl_sample_compute_UB_busing_levy(HklSample *self,
+					     const HklSampleReflection *r1,
+					     const HklSampleReflection *r2) HKL_ARG_NONNULL(1, 2, 3);
+
+HKLAPI double hkl_sample_get_reflection_mesured_angle(const HklSample *self,
+						      const HklSampleReflection *r1,
+						      const HklSampleReflection *r2) HKL_ARG_NONNULL(1, 2, 3);
+
+HKLAPI double hkl_sample_get_reflection_theoretical_angle(const HklSample *self,
+							  const HklSampleReflection *r1,
+							  const HklSampleReflection *r2) HKL_ARG_NONNULL(1, 2, 3);
+
+HKLAPI double hkl_sample_affine(HklSample *self) HKL_ARG_NONNULL(1);
+
+/* hklSampleReflection */
+
+HKLAPI HklSampleReflection *hkl_sample_reflection_new(const HklGeometry *geometry,
+						      const HklDetector *detector,
+						      double h, double k, double l) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI void hkl_sample_reflection_hkl_get(const HklSampleReflection *self,
+					  double *h, double *k, double *l) HKL_ARG_NONNULL(1, 2, 3, 4);
+
+HKLAPI void hkl_sample_reflection_hkl_set(HklSampleReflection *self,
+					  double h, double k, double l) HKL_ARG_NONNULL(1);
+
+HKLAPI int hkl_sample_reflection_flag_get(const HklSampleReflection *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_reflection_flag_set(HklSampleReflection *self, int flag) HKL_ARG_NONNULL(1);
+
+HKLAPI const HklGeometry *hkl_sample_reflection_geometry_get(HklSampleReflection *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_sample_reflection_geometry_set(HklSampleReflection *self,
+					       const HklGeometry *geometry) HKL_ARG_NONNULL(1, 2);
+
+/**************/
+/* PseudoAxis */
+/**************/
+
+typedef struct _HklPseudoAxis HklPseudoAxis;
+typedef struct _HklMode HklMode;
+typedef struct _HklEngine HklEngine;
+typedef struct _HklEngineList HklEngineList;
+
+typedef darray(HklMode *) darray_mode;
+typedef darray(HklEngine *) darray_engine;
+
+/* HklMode */
+
+HKLAPI const char * hkl_mode_name(const HklMode *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklParameterList *hkl_mode_parameters(HklMode *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_mode_fprintf(FILE *f, const HklMode *self) HKL_ARG_NONNULL(1, 2);
+
+/* HklEngine */
+
+HKLAPI const char *hkl_engine_name(const HklEngine *self) HKL_ARG_NONNULL(1);
+
+HKLAPI unsigned int hkl_engine_len(const HklEngine *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklParameterList *hkl_engine_pseudo_axes(HklEngine *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklMode *hkl_engine_mode(HklEngine *self) HKL_ARG_NONNULL(1);
+
+HKLAPI darray_mode *hkl_engine_modes(HklEngine *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklEngineList *hkl_engine_engines(HklEngine *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_engine_select_mode(HklEngine *self,
+				   HklMode *mode) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI void hkl_engine_select_mode_by_name(HklEngine *self,
+					   const char *name) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI int hkl_engine_initialize(HklEngine *self, HklError **error) HKL_ARG_NONNULL(1);
+
+HKLAPI int hkl_engine_set(HklEngine *self, HklError **error) HKL_ARG_NONNULL(1);
+
+HKLAPI int hkl_engine_get(HklEngine *self, HklError **error) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_engine_fprintf(FILE *f, const HklEngine *self) HKL_ARG_NONNULL(1, 2);
+
+/* HklEngineList */
+
+HKLAPI void hkl_engine_list_free(HklEngineList *self) HKL_ARG_NONNULL(1);
+
+HKLAPI darray_engine *hkl_engine_list_engines(HklEngineList *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_engine_list_geometry_set(HklEngineList *self, const HklGeometry *geometry) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI const HklGeometryList *hkl_engine_list_geometries(const HklEngineList *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklGeometry *hkl_engine_list_get_geometry(HklEngineList *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_engine_list_select_solution(HklEngineList *self, unsigned int idx) HKL_ARG_NONNULL(1);
+
+HKLAPI HklEngine *hkl_engine_list_get_by_name(HklEngineList *self,
+					      const char *name) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI HklParameter *hkl_engine_list_get_pseudo_axis_by_name(const HklEngineList *self,
+							     const char *name) HKL_ARG_NONNULL(1, 2);
+
+HKLAPI void hkl_engine_list_init(HklEngineList *self,
+				 HklGeometry *geometry,
+				 HklDetector *detector,
+				 HklSample *sample) HKL_ARG_NONNULL(1, 2, 3, 4);
+
+HKLAPI int hkl_engine_list_get(HklEngineList *self) HKL_ARG_NONNULL(1);
+
+HKLAPI void hkl_engine_list_fprintf(FILE *f,
+				    const HklEngineList *self) HKL_ARG_NONNULL(1, 2);
+
+/***********/
+/* Factory */
+/***********/
+
+typedef struct _HklFactory HklFactory;
+
+HKLAPI HklFactory **hkl_factory_get_all(unsigned int *n) HKL_ARG_NONNULL(1);
+
+HKLAPI HklFactory *hkl_factory_get_by_name(const char *name) HKL_ARG_NONNULL(1);
+
+HKLAPI const char *hkl_factory_name(const HklFactory *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklGeometry *hkl_factory_create_new_geometry(const HklFactory *self) HKL_ARG_NONNULL(1);
+
+HKLAPI HklEngineList *hkl_factory_create_new_engine_list(const HklFactory *self) HKL_ARG_NONNULL(1);
+
+HKL_END_DECLS
+
+#endif
diff --git a/hkl.pc.in b/hkl.pc.in
index 89c654f..c2c73ae 100644
--- a/hkl.pc.in
+++ b/hkl.pc.in
@@ -10,4 +10,4 @@ URL: http://repo.or.cz/w/hkl.git
 Requires: gsl
 Libs: -L${libdir} -lhkl
 Libs.private: -lm
-Cflags: -I${includedir}
+Cflags: -I${includedir}/hkl- at VMAJ@
diff --git a/hkl/Makefile.am b/hkl/Makefile.am
index 0d3e628..095b060 100644
--- a/hkl/Makefile.am
+++ b/hkl/Makefile.am
@@ -1,21 +1,20 @@
 ## Process this file with automake to produce Makefile.in
+SUBDIRS = ccan
 
-AM_LDFLAGS = -no-undefined -version-info 4:0:0
+AM_LDFLAGS = -no-undefined -version-info 5:0:0
 AM_LDFLAGS += $(GSL_LIBS)
-AM_CFLAGS = -Wmissing-declarations -std=c89 -ansi -pedantic \
-	-I$(top_srcdir) \
+AM_CFLAGS = -I$(top_srcdir) \
+	-I$(top_builddir) \
 	$(GSL_CFLAGS)
+	-fvisibility=hiden
 
-lib_LTLIBRARIES = \
-	libhkl.la
-
-libhkl_la_SOURCES = \
+hkl_c_sources = \
 	hkl-error.c \
 	hkl-axis.c \
 	hkl-detector.c \
 	hkl-detector-factory.c \
+	hkl-factory.c \
 	hkl-geometry.c \
-	hkl-geometry-factory.c \
 	hkl-interval.c \
 	hkl-lattice.c \
 	hkl-macros.c \
@@ -23,61 +22,151 @@ libhkl_la_SOURCES = \
 	hkl-parameter.c \
 	hkl-pseudoaxis.c \
 	hkl-pseudoaxis-auto.c \
-	hkl-pseudoaxis-common.c \
 	hkl-pseudoaxis-common-eulerians.c \
 	hkl-pseudoaxis-common-hkl.c \
 	hkl-pseudoaxis-common-psi.c \
 	hkl-pseudoaxis-common-q.c \
-	hkl-pseudoaxis-e4cv-hkl.c \
-	hkl-pseudoaxis-e4cv-psi.c \
+	hkl-pseudoaxis-e4c-hkl.c \
+	hkl-pseudoaxis-e4c-psi.c \
 	hkl-pseudoaxis-e6c-hkl.c \
 	hkl-pseudoaxis-e6c-psi.c \
-	hkl-pseudoaxis-factory.c \
 	hkl-pseudoaxis-k4cv-hkl.c \
 	hkl-pseudoaxis-k4cv-psi.c \
 	hkl-pseudoaxis-k6c-hkl.c \
 	hkl-pseudoaxis-k6c-psi.c \
 	hkl-pseudoaxis-zaxis-hkl.c \
+	hkl-pseudoaxis-soleil-sixs-med.c \
+	hkl-pseudoaxis-petra3-hkl.c \
 	hkl-quaternion.c \
 	hkl-sample.c \
 	hkl-source.c \
 	hkl-unit.c \
 	hkl-vector.c
 
-hklincludedir=$(includedir)/hkl
-hklinclude_HEADERS = \
-	hkl-axis.h \
-	hkl-detector.h \
-	hkl-detector-factory.h \
-	hkl-error.h \
-	hkl-geometry.h \
-	hkl-geometry-factory.h \
-	hkl-interval.h \
-	hkl-parameter.h \
-	hkl-lattice.h \
-	hkl-list.h \
-	hkl-macros.h \
-	hkl-matrix.h \
-	hkl-pseudoaxis.h \
-	hkl-pseudoaxis-auto.h \
-	hkl-pseudoaxis-common.h \
-	hkl-pseudoaxis-common-eulerians.h \
-	hkl-pseudoaxis-common-hkl.h \
-	hkl-pseudoaxis-common-psi.h \
-	hkl-pseudoaxis-common-q.h \
-	hkl-pseudoaxis-e4cv.h \
-	hkl-pseudoaxis-e6c.h \
-	hkl-pseudoaxis-factory.h  \
-	hkl-pseudoaxis-k4cv.h \
-	hkl-pseudoaxis-k6c.h \
-	hkl-pseudoaxis-zaxis.h \
-	hkl-quaternion.h \
-	hkl-sample.h \
-	hkl-source.h \
-	hkl-unit.h \
-	hkl-vector.h
+hkl_public_h_sources = ../hkl.h
+
+hkl_private_h_sources = \
+	hkl-axis-private.h \
+	hkl-detector-private.h \
+	hkl-error-private.h \
+	hkl-factory-private.h \
+	hkl-geometry-private.h \
+	hkl-interval-private.h \
+	hkl-lattice-private.h \
+	hkl-macros-private.h \
+	hkl-matrix-private.h \
+	hkl-parameter-private.h \
+	hkl-pseudoaxis-private.h \
+	hkl-pseudoaxis-auto-private.h \
+	hkl-pseudoaxis-common-eulerians-private.h \
+	hkl-pseudoaxis-common-hkl-private.h \
+	hkl-pseudoaxis-common-q-private.h \
+	hkl-pseudoaxis-common-psi-private.h \
+	hkl-pseudoaxis-e4c-private.h \
+	hkl-pseudoaxis-e6c-private.h \
+	hkl-pseudoaxis-k4cv-private.h \
+	hkl-pseudoaxis-k6c-private.h \
+	hkl-pseudoaxis-zaxis-private.h \
+	hkl-pseudoaxis-soleil-sixs-med-private.h \
+	hkl-pseudoaxis-petra3-private.h \
+	hkl-quaternion-private.h \
+	hkl-sample-private.h \
+	hkl-source-private.h \
+	hkl-unit-private.h \
+	hkl-vector-private.h
+
+lib_LTLIBRARIES = libhkl.la
+libhkl_la_SOURCES = $(hkl_c_sources) $(hkl_private_h_sources)
+libhkl_la_LIBADD = ccan/libccan.la
+
+# introspection
+
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+INTROSPECTION_SCANNER_ARGS = \
+	--add-include-path=$(srcdir) \
+	--add-include-path=. \
+	--warn-all
+INTROSPECTION_COMPILER_ARGS = \
+	--includedir=$(srcdir) \
+	--includedir=.
+
+if HAVE_INTROSPECTION
+
+libhkl_la_SOURCES += \
+	hkl-types.c \
+	hkl-types.h \
+	hkl-type-builtins.c \
+	hkl-type-builtins.h \
+	hkl-binding.c \
+	hkl-binding-private.h
+
+introspection_files = \
+	../hkl.h \
+	hkl-binding-private.h \
+	hkl-types.h \
+	hkl-error.c \
+	hkl-matrix.c \
+	hkl-parameter.c \
+	hkl-axis.c \
+	hkl-geometry.c \
+	hkl-detector.c \
+	hkl-detector-factory.c \
+	hkl-lattice.c \
+	hkl-sample.c \
+	hkl-pseudoaxis.c \
+	hkl-factory.c \
+	hkl-binding.c \
+	hkl-types.c \
+	hkl-type-builtins.c \
+	hkl-type-builtins.h
+
+AM_LDFLAGS += $(GOBJECT_LIBS)
+AM_CFLAGS += $(GOBJECT_CFLAGS)
+
+hkl-type-builtins.h: stamp-hkl-type-builtins.h
+	@true
+stamp-hkl-type-builtins.h: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.h.template
+	( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.h.template \
+		$(hkl_public_h_sources) ) >> xgen-gtbh \
+	&& (cmp -s xgen-gtbh hkl-type-builtins.h || cp xgen-gtbh hkl-type-builtins.h ) \
+	&& rm -f xgen-gtbh \
+	&& echo timestamp > $(@F)
+hkl-type-builtins.c: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.c.template
+	( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.c.template \
+		$(hkl_public_h_sources) ) > xgen-gtbc \
+	&& cp xgen-gtbc hkl-type-builtins.c  \
+	&& rm -f xgen-gtbc
+
+Hkl- at VMAJ@.0.gir: $(INTROSPECTION_SCANNER) libhkl.la Makefile
+
+Hkl_ at VMAJ@_0_gir_NAMESPACE = Hkl
+Hkl_ at VMAJ@_0_gir_VERSION = @VMAJ at .0
+Hkl_ at VMAJ@_0_gir_LIBS = libhkl.la
+Hkl_ at VMAJ@_0_gir_FILES =  $(introspection_files)
+Hkl_ at VMAJ@_0_gir_PACKAGES = gobject-2.0
+Hkl_ at VMAJ@_0_gir_CFLAGS = $(INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS)
+Hkl_ at VMAJ@_0_gir_EXPORT_PACKAGES = hkl- at VMAJ@.0
+Hkl_ at VMAJ@_0_gir_SCANNERFLAGS = --warn-all --c-include='hkl.h'
+
+INTROSPECTION_GIRS += Hkl- at VMAJ@.0.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibsdir = $(libdir)/girepository-1.0
+typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+EXTRA_DIST = \
+	hkl-type-builtins.h.template \
+	hkl-type-builtins.c.template
+
+CLEANFILES = $(gir_DATA) $(typelibs_DATA) stamp-hkl-type-builtins.h hkl-type-builtins.h hkl-type-builtins.c
+
+endif
 
 # Support for GNU Flymake, in Emacs.
+
 check-syntax: AM_CFLAGS += -fsyntax-only -pipe
 check-syntax:
 	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
diff --git a/hkl/Makefile.in b/hkl/Makefile.in
index 7358d40..48622c6 100644
--- a/hkl/Makefile.in
+++ b/hkl/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -17,6 +16,51 @@
 
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,9 +79,20 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
+ at HAVE_INTROSPECTION_TRUE@am__append_1 = \
+ at HAVE_INTROSPECTION_TRUE@	hkl-types.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-types.h \
+ at HAVE_INTROSPECTION_TRUE@	hkl-type-builtins.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-type-builtins.h \
+ at HAVE_INTROSPECTION_TRUE@	hkl-binding.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-binding-private.h
+
+ at HAVE_INTROSPECTION_TRUE@am__append_2 = $(GOBJECT_LIBS)
+ at HAVE_INTROSPECTION_TRUE@am__append_3 = $(GOBJECT_CFLAGS)
+ at HAVE_INTROSPECTION_TRUE@am__append_4 = Hkl- at VMAJ@.0.gir
 subdir = hkl
-DIST_COMMON = $(hklinclude_HEADERS) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -70,47 +125,182 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hklincludedir)"
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \
+	"$(DESTDIR)$(typelibsdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libhkl_la_LIBADD =
-am_libhkl_la_OBJECTS = hkl-error.lo hkl-axis.lo hkl-detector.lo \
-	hkl-detector-factory.lo hkl-geometry.lo \
-	hkl-geometry-factory.lo hkl-interval.lo hkl-lattice.lo \
-	hkl-macros.lo hkl-matrix.lo hkl-parameter.lo hkl-pseudoaxis.lo \
-	hkl-pseudoaxis-auto.lo hkl-pseudoaxis-common.lo \
+libhkl_la_DEPENDENCIES = ccan/libccan.la
+am__libhkl_la_SOURCES_DIST = hkl-error.c hkl-axis.c hkl-detector.c \
+	hkl-detector-factory.c hkl-factory.c hkl-geometry.c \
+	hkl-interval.c hkl-lattice.c hkl-macros.c hkl-matrix.c \
+	hkl-parameter.c hkl-pseudoaxis.c hkl-pseudoaxis-auto.c \
+	hkl-pseudoaxis-common-eulerians.c hkl-pseudoaxis-common-hkl.c \
+	hkl-pseudoaxis-common-psi.c hkl-pseudoaxis-common-q.c \
+	hkl-pseudoaxis-e4c-hkl.c hkl-pseudoaxis-e4c-psi.c \
+	hkl-pseudoaxis-e6c-hkl.c hkl-pseudoaxis-e6c-psi.c \
+	hkl-pseudoaxis-k4cv-hkl.c hkl-pseudoaxis-k4cv-psi.c \
+	hkl-pseudoaxis-k6c-hkl.c hkl-pseudoaxis-k6c-psi.c \
+	hkl-pseudoaxis-zaxis-hkl.c hkl-pseudoaxis-soleil-sixs-med.c \
+	hkl-pseudoaxis-petra3-hkl.c hkl-quaternion.c hkl-sample.c \
+	hkl-source.c hkl-unit.c hkl-vector.c hkl-axis-private.h \
+	hkl-detector-private.h hkl-error-private.h \
+	hkl-factory-private.h hkl-geometry-private.h \
+	hkl-interval-private.h hkl-lattice-private.h \
+	hkl-macros-private.h hkl-matrix-private.h \
+	hkl-parameter-private.h hkl-pseudoaxis-private.h \
+	hkl-pseudoaxis-auto-private.h \
+	hkl-pseudoaxis-common-eulerians-private.h \
+	hkl-pseudoaxis-common-hkl-private.h \
+	hkl-pseudoaxis-common-q-private.h \
+	hkl-pseudoaxis-common-psi-private.h \
+	hkl-pseudoaxis-e4c-private.h hkl-pseudoaxis-e6c-private.h \
+	hkl-pseudoaxis-k4cv-private.h hkl-pseudoaxis-k6c-private.h \
+	hkl-pseudoaxis-zaxis-private.h \
+	hkl-pseudoaxis-soleil-sixs-med-private.h \
+	hkl-pseudoaxis-petra3-private.h hkl-quaternion-private.h \
+	hkl-sample-private.h hkl-source-private.h hkl-unit-private.h \
+	hkl-vector-private.h hkl-types.c hkl-types.h \
+	hkl-type-builtins.c hkl-type-builtins.h hkl-binding.c \
+	hkl-binding-private.h
+am__objects_1 = hkl-error.lo hkl-axis.lo hkl-detector.lo \
+	hkl-detector-factory.lo hkl-factory.lo hkl-geometry.lo \
+	hkl-interval.lo hkl-lattice.lo hkl-macros.lo hkl-matrix.lo \
+	hkl-parameter.lo hkl-pseudoaxis.lo hkl-pseudoaxis-auto.lo \
 	hkl-pseudoaxis-common-eulerians.lo \
 	hkl-pseudoaxis-common-hkl.lo hkl-pseudoaxis-common-psi.lo \
-	hkl-pseudoaxis-common-q.lo hkl-pseudoaxis-e4cv-hkl.lo \
-	hkl-pseudoaxis-e4cv-psi.lo hkl-pseudoaxis-e6c-hkl.lo \
-	hkl-pseudoaxis-e6c-psi.lo hkl-pseudoaxis-factory.lo \
-	hkl-pseudoaxis-k4cv-hkl.lo hkl-pseudoaxis-k4cv-psi.lo \
-	hkl-pseudoaxis-k6c-hkl.lo hkl-pseudoaxis-k6c-psi.lo \
-	hkl-pseudoaxis-zaxis-hkl.lo hkl-quaternion.lo hkl-sample.lo \
-	hkl-source.lo hkl-unit.lo hkl-vector.lo
+	hkl-pseudoaxis-common-q.lo hkl-pseudoaxis-e4c-hkl.lo \
+	hkl-pseudoaxis-e4c-psi.lo hkl-pseudoaxis-e6c-hkl.lo \
+	hkl-pseudoaxis-e6c-psi.lo hkl-pseudoaxis-k4cv-hkl.lo \
+	hkl-pseudoaxis-k4cv-psi.lo hkl-pseudoaxis-k6c-hkl.lo \
+	hkl-pseudoaxis-k6c-psi.lo hkl-pseudoaxis-zaxis-hkl.lo \
+	hkl-pseudoaxis-soleil-sixs-med.lo hkl-pseudoaxis-petra3-hkl.lo \
+	hkl-quaternion.lo hkl-sample.lo hkl-source.lo hkl-unit.lo \
+	hkl-vector.lo
+am__objects_2 =
+ at HAVE_INTROSPECTION_TRUE@am__objects_3 = hkl-types.lo \
+ at HAVE_INTROSPECTION_TRUE@	hkl-type-builtins.lo hkl-binding.lo
+am_libhkl_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
+	$(am__objects_3)
 libhkl_la_OBJECTS = $(am_libhkl_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(libhkl_la_SOURCES)
-DIST_SOURCES = $(libhkl_la_SOURCES)
-HEADERS = $(hklinclude_HEADERS)
+DIST_SOURCES = $(am__libhkl_la_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+DATA = $(gir_DATA) $(typelibs_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
+ASY = @ASY@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -127,6 +317,7 @@ CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -135,13 +326,29 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
 GTKMM_CFLAGS = @GTKMM_CFLAGS@
 GTKMM_LIBS = @GTKMM_LIBS@
 HTML_DIR = @HTML_DIR@
@@ -150,6 +357,14 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
@@ -158,7 +373,10 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -181,12 +399,17 @@ RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHTOOL = @SHTOOL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -220,14 +443,15 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+release_info = @release_info@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -236,21 +460,19 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AM_LDFLAGS = -no-undefined -version-info 4:0:0 $(GSL_LIBS)
-AM_CFLAGS = -Wmissing-declarations -std=c89 -ansi -pedantic \
-	-I$(top_srcdir) \
-	$(GSL_CFLAGS)
-
-lib_LTLIBRARIES = \
-	libhkl.la
-
-libhkl_la_SOURCES = \
+version_info = @version_info@
+SUBDIRS = ccan
+AM_LDFLAGS = -no-undefined -version-info 5:0:0 $(GSL_LIBS) \
+	$(am__append_2)
+AM_CFLAGS = -I$(top_srcdir) -I$(top_builddir) $(GSL_CFLAGS) \
+	$(am__append_3)
+hkl_c_sources = \
 	hkl-error.c \
 	hkl-axis.c \
 	hkl-detector.c \
 	hkl-detector-factory.c \
+	hkl-factory.c \
 	hkl-geometry.c \
-	hkl-geometry-factory.c \
 	hkl-interval.c \
 	hkl-lattice.c \
 	hkl-macros.c \
@@ -258,61 +480,110 @@ libhkl_la_SOURCES = \
 	hkl-parameter.c \
 	hkl-pseudoaxis.c \
 	hkl-pseudoaxis-auto.c \
-	hkl-pseudoaxis-common.c \
 	hkl-pseudoaxis-common-eulerians.c \
 	hkl-pseudoaxis-common-hkl.c \
 	hkl-pseudoaxis-common-psi.c \
 	hkl-pseudoaxis-common-q.c \
-	hkl-pseudoaxis-e4cv-hkl.c \
-	hkl-pseudoaxis-e4cv-psi.c \
+	hkl-pseudoaxis-e4c-hkl.c \
+	hkl-pseudoaxis-e4c-psi.c \
 	hkl-pseudoaxis-e6c-hkl.c \
 	hkl-pseudoaxis-e6c-psi.c \
-	hkl-pseudoaxis-factory.c \
 	hkl-pseudoaxis-k4cv-hkl.c \
 	hkl-pseudoaxis-k4cv-psi.c \
 	hkl-pseudoaxis-k6c-hkl.c \
 	hkl-pseudoaxis-k6c-psi.c \
 	hkl-pseudoaxis-zaxis-hkl.c \
+	hkl-pseudoaxis-soleil-sixs-med.c \
+	hkl-pseudoaxis-petra3-hkl.c \
 	hkl-quaternion.c \
 	hkl-sample.c \
 	hkl-source.c \
 	hkl-unit.c \
 	hkl-vector.c
 
-hklincludedir = $(includedir)/hkl
-hklinclude_HEADERS = \
-	hkl-axis.h \
-	hkl-detector.h \
-	hkl-detector-factory.h \
-	hkl-error.h \
-	hkl-geometry.h \
-	hkl-geometry-factory.h \
-	hkl-interval.h \
-	hkl-parameter.h \
-	hkl-lattice.h \
-	hkl-list.h \
-	hkl-macros.h \
-	hkl-matrix.h \
-	hkl-pseudoaxis.h \
-	hkl-pseudoaxis-auto.h \
-	hkl-pseudoaxis-common.h \
-	hkl-pseudoaxis-common-eulerians.h \
-	hkl-pseudoaxis-common-hkl.h \
-	hkl-pseudoaxis-common-psi.h \
-	hkl-pseudoaxis-common-q.h \
-	hkl-pseudoaxis-e4cv.h \
-	hkl-pseudoaxis-e6c.h \
-	hkl-pseudoaxis-factory.h  \
-	hkl-pseudoaxis-k4cv.h \
-	hkl-pseudoaxis-k6c.h \
-	hkl-pseudoaxis-zaxis.h \
-	hkl-quaternion.h \
-	hkl-sample.h \
-	hkl-source.h \
-	hkl-unit.h \
-	hkl-vector.h
-
-all: all-am
+hkl_public_h_sources = ../hkl.h
+hkl_private_h_sources = \
+	hkl-axis-private.h \
+	hkl-detector-private.h \
+	hkl-error-private.h \
+	hkl-factory-private.h \
+	hkl-geometry-private.h \
+	hkl-interval-private.h \
+	hkl-lattice-private.h \
+	hkl-macros-private.h \
+	hkl-matrix-private.h \
+	hkl-parameter-private.h \
+	hkl-pseudoaxis-private.h \
+	hkl-pseudoaxis-auto-private.h \
+	hkl-pseudoaxis-common-eulerians-private.h \
+	hkl-pseudoaxis-common-hkl-private.h \
+	hkl-pseudoaxis-common-q-private.h \
+	hkl-pseudoaxis-common-psi-private.h \
+	hkl-pseudoaxis-e4c-private.h \
+	hkl-pseudoaxis-e6c-private.h \
+	hkl-pseudoaxis-k4cv-private.h \
+	hkl-pseudoaxis-k6c-private.h \
+	hkl-pseudoaxis-zaxis-private.h \
+	hkl-pseudoaxis-soleil-sixs-med-private.h \
+	hkl-pseudoaxis-petra3-private.h \
+	hkl-quaternion-private.h \
+	hkl-sample-private.h \
+	hkl-source-private.h \
+	hkl-unit-private.h \
+	hkl-vector-private.h
+
+lib_LTLIBRARIES = libhkl.la
+libhkl_la_SOURCES = $(hkl_c_sources) $(hkl_private_h_sources) \
+	$(am__append_1)
+libhkl_la_LIBADD = ccan/libccan.la
+INTROSPECTION_GIRS = $(am__append_4)
+INTROSPECTION_SCANNER_ARGS = \
+	--add-include-path=$(srcdir) \
+	--add-include-path=. \
+	--warn-all
+
+INTROSPECTION_COMPILER_ARGS = \
+	--includedir=$(srcdir) \
+	--includedir=.
+
+ at HAVE_INTROSPECTION_TRUE@introspection_files = \
+ at HAVE_INTROSPECTION_TRUE@	../hkl.h \
+ at HAVE_INTROSPECTION_TRUE@	hkl-binding-private.h \
+ at HAVE_INTROSPECTION_TRUE@	hkl-types.h \
+ at HAVE_INTROSPECTION_TRUE@	hkl-error.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-matrix.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-parameter.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-axis.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-geometry.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-detector.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-detector-factory.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-lattice.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-sample.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-pseudoaxis.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-factory.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-binding.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-types.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-type-builtins.c \
+ at HAVE_INTROSPECTION_TRUE@	hkl-type-builtins.h
+
+ at HAVE_INTROSPECTION_TRUE@Hkl_ at VMAJ@_0_gir_NAMESPACE = Hkl
+ at HAVE_INTROSPECTION_TRUE@Hkl_ at VMAJ@_0_gir_VERSION = @VMAJ at .0
+ at HAVE_INTROSPECTION_TRUE@Hkl_ at VMAJ@_0_gir_LIBS = libhkl.la
+ at HAVE_INTROSPECTION_TRUE@Hkl_ at VMAJ@_0_gir_FILES = $(introspection_files)
+ at HAVE_INTROSPECTION_TRUE@Hkl_ at VMAJ@_0_gir_PACKAGES = gobject-2.0
+ at HAVE_INTROSPECTION_TRUE@Hkl_ at VMAJ@_0_gir_CFLAGS = $(INCLUDES) $(AM_CPPFLAGS) $(AM_CFLAGS)
+ at HAVE_INTROSPECTION_TRUE@Hkl_ at VMAJ@_0_gir_EXPORT_PACKAGES = hkl- at VMAJ@.0
+ at HAVE_INTROSPECTION_TRUE@Hkl_ at VMAJ@_0_gir_SCANNERFLAGS = --warn-all --c-include='hkl.h'
+ at HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0
+ at HAVE_INTROSPECTION_TRUE@gir_DATA = $(INTROSPECTION_GIRS)
+ at HAVE_INTROSPECTION_TRUE@typelibsdir = $(libdir)/girepository-1.0
+ at HAVE_INTROSPECTION_TRUE@typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+ at HAVE_INTROSPECTION_TRUE@EXTRA_DIST = \
+ at HAVE_INTROSPECTION_TRUE@	hkl-type-builtins.h.template \
+ at HAVE_INTROSPECTION_TRUE@	hkl-type-builtins.c.template
+
+ at HAVE_INTROSPECTION_TRUE@CLEANFILES = $(gir_DATA) $(typelibs_DATA) stamp-hkl-type-builtins.h hkl-type-builtins.h hkl-type-builtins.c
+all: all-recursive
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
@@ -346,9 +617,9 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -356,6 +627,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
 	}
@@ -371,14 +644,17 @@ uninstall-libLTLIBRARIES:
 
 clean-libLTLIBRARIES:
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
-libhkl.la: $(libhkl_la_OBJECTS) $(libhkl_la_DEPENDENCIES) 
-	$(LINK) -rpath $(libdir) $(libhkl_la_OBJECTS) $(libhkl_la_LIBADD) $(LIBS)
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libhkl.la: $(libhkl_la_OBJECTS) $(libhkl_la_DEPENDENCIES) $(EXTRA_libhkl_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libhkl_la_OBJECTS) $(libhkl_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -387,10 +663,11 @@ distclean-compile:
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-axis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-binding.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-detector-factory.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-detector.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-error.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-geometry-factory.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-factory.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-geometry.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-interval.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-lattice.Plo at am__quote@
@@ -402,91 +679,151 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-common-hkl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-common-psi.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-common-q.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-common.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e4cv-hkl.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e4cv-psi.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e4c-hkl.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e4c-psi.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e6c-hkl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e6c-psi.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-factory.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k4cv-hkl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k4cv-psi.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k6c-hkl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k6c-psi.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-petra3-hkl.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-soleil-sixs-med.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-zaxis-hkl.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-quaternion.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-sample.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-source.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-type-builtins.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-types.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-unit.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-vector.Plo at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
 	-rm -f *.lo
 
 clean-libtool:
 	-rm -rf .libs _libs
-install-hklincludeHEADERS: $(hklinclude_HEADERS)
+install-girDATA: $(gir_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(gir_DATA)'; test -n "$(girdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(girdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(girdir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(girdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(girdir)" || exit $$?; \
+	done
+
+uninstall-girDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(gir_DATA)'; test -n "$(girdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(girdir)'; $(am__uninstall_files_from_dir)
+install-typelibsDATA: $(typelibs_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(hklincludedir)" || $(MKDIR_P) "$(DESTDIR)$(hklincludedir)"
-	@list='$(hklinclude_HEADERS)'; test -n "$(hklincludedir)" || list=; \
+	@list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(typelibsdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(typelibsdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
 	done | $(am__base_list) | \
 	while read files; do \
-	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(hklincludedir)'"; \
-	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(hklincludedir)" || exit $$?; \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(typelibsdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(typelibsdir)" || exit $$?; \
 	done
 
-uninstall-hklincludeHEADERS:
+uninstall-typelibsDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(hklinclude_HEADERS)'; test -n "$(hklincludedir)" || list=; \
+	@list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(hklincludedir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(hklincludedir)" && rm -f $$files
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+	dir='$(DESTDIR)$(typelibsdir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -498,15 +835,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -515,6 +848,21 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -549,30 +897,62 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	  fi; \
 	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
 check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-installdirs:
-	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(hklincludedir)"; do \
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(typelibsdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
 
 install-am: all-am
 	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 
-installcheck: installcheck-am
+installcheck: installcheck-recursive
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -581,97 +961,121 @@ distclean-generic:
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
+clean: clean-recursive
 
 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
 	mostlyclean-am
 
-distclean: distclean-am
+distclean: distclean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-tags
 
-dvi: dvi-am
+dvi: dvi-recursive
 
 dvi-am:
 
-html: html-am
+html: html-recursive
 
 html-am:
 
-info: info-am
+info: info-recursive
 
 info-am:
 
-install-data-am: install-hklincludeHEADERS
+install-data-am: install-girDATA install-typelibsDATA
 
-install-dvi: install-dvi-am
+install-dvi: install-dvi-recursive
 
 install-dvi-am:
 
 install-exec-am: install-libLTLIBRARIES
 
-install-html: install-html-am
+install-html: install-html-recursive
 
 install-html-am:
 
-install-info: install-info-am
+install-info: install-info-recursive
 
 install-info-am:
 
 install-man:
 
-install-pdf: install-pdf-am
+install-pdf: install-pdf-recursive
 
 install-pdf-am:
 
-install-ps: install-ps-am
+install-ps: install-ps-recursive
 
 install-ps-am:
 
 installcheck-am:
 
-maintainer-clean: maintainer-clean-am
+maintainer-clean: maintainer-clean-recursive
 	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
-mostlyclean: mostlyclean-am
+mostlyclean: mostlyclean-recursive
 
 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
 	mostlyclean-libtool
 
-pdf: pdf-am
+pdf: pdf-recursive
 
 pdf-am:
 
-ps: ps-am
+ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-hklincludeHEADERS uninstall-libLTLIBRARIES
+uninstall-am: uninstall-girDATA uninstall-libLTLIBRARIES \
+	uninstall-typelibsDATA
 
-.MAKE: install-am install-strip
+.MAKE: $(am__recursive_targets) install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool ctags distclean \
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libLTLIBRARIES \
+	clean-libtool cscopelist-am ctags ctags-am distclean \
 	distclean-compile distclean-generic distclean-libtool \
 	distclean-tags distdir dvi dvi-am html html-am info info-am \
 	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am \
-	install-hklincludeHEADERS install-html install-html-am \
-	install-info install-info-am install-libLTLIBRARIES \
-	install-man install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-hklincludeHEADERS \
-	uninstall-libLTLIBRARIES
-
+	install-dvi-am install-exec install-exec-am install-girDATA \
+	install-html install-html-am install-info install-info-am \
+	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip install-typelibsDATA \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-girDATA uninstall-libLTLIBRARIES \
+	uninstall-typelibsDATA
+
+	-fvisibility=hiden
+
+# introspection
+
+-include $(INTROSPECTION_MAKEFILE)
+
+ at HAVE_INTROSPECTION_TRUE@hkl-type-builtins.h: stamp-hkl-type-builtins.h
+ at HAVE_INTROSPECTION_TRUE@	@true
+ at HAVE_INTROSPECTION_TRUE@stamp-hkl-type-builtins.h: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.h.template
+ at HAVE_INTROSPECTION_TRUE@	( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.h.template \
+ at HAVE_INTROSPECTION_TRUE@		$(hkl_public_h_sources) ) >> xgen-gtbh \
+ at HAVE_INTROSPECTION_TRUE@	&& (cmp -s xgen-gtbh hkl-type-builtins.h || cp xgen-gtbh hkl-type-builtins.h ) \
+ at HAVE_INTROSPECTION_TRUE@	&& rm -f xgen-gtbh \
+ at HAVE_INTROSPECTION_TRUE@	&& echo timestamp > $(@F)
+ at HAVE_INTROSPECTION_TRUE@hkl-type-builtins.c: $(hkl_public_h_sources) $(srcdir)/hkl-type-builtins.c.template
+ at HAVE_INTROSPECTION_TRUE@	( cd $(srcdir) && $(GLIB_MKENUMS) --template hkl-type-builtins.c.template \
+ at HAVE_INTROSPECTION_TRUE@		$(hkl_public_h_sources) ) > xgen-gtbc \
+ at HAVE_INTROSPECTION_TRUE@	&& cp xgen-gtbc hkl-type-builtins.c  \
+ at HAVE_INTROSPECTION_TRUE@	&& rm -f xgen-gtbc
+
+ at HAVE_INTROSPECTION_TRUE@Hkl- at VMAJ@.0.gir: $(INTROSPECTION_SCANNER) libhkl.la Makefile
 
 # Support for GNU Flymake, in Emacs.
+
 check-syntax: AM_CFLAGS += -fsyntax-only -pipe
 check-syntax:
 	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
diff --git a/hkl/ccan/Makefile.am b/hkl/ccan/Makefile.am
new file mode 100644
index 0000000..4725b8f
--- /dev/null
+++ b/hkl/ccan/Makefile.am
@@ -0,0 +1,22 @@
+AM_CFLAGS=-I$(top_srcdir)
+
+noinst_LTLIBRARIES=libccan.la
+libccan_la_SOURCES = \
+	list/list.h \
+	list/list.c \
+	noerr/noerr.c \
+	noerr/noerr.h \
+	ptr_valid/ptr_valid.c \
+	ptr_valid/ptr_valid.h \
+	check_type/check_type.h \
+	compiler/compiler.h \
+	autodata/autodata.c \
+	autodata/autodata.h \
+	container_of/container_of.h \
+	array_size/array_size.h \
+	darray/darray.h \
+	build_assert/build_assert.h
+
+ccanincludedir=$(includedir)/hkl- at VMAJ@/hkl/ccan
+nobase_ccaninclude_HEADERS= \
+	darray/darray.h
diff --git a/hkl/ccan/Makefile.in b/hkl/ccan/Makefile.in
new file mode 100644
index 0000000..414f1af
--- /dev/null
+++ b/hkl/ccan/Makefile.in
@@ -0,0 +1,731 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = hkl/ccan
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/depcomp $(nobase_ccaninclude_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libccan_la_LIBADD =
+am_libccan_la_OBJECTS = list.lo noerr.lo ptr_valid.lo autodata.lo
+libccan_la_OBJECTS = $(am_libccan_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(libccan_la_SOURCES)
+DIST_SOURCES = $(libccan_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(ccanincludedir)"
+HEADERS = $(nobase_ccaninclude_HEADERS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+AM_CFLAGS = -I$(top_srcdir)
+noinst_LTLIBRARIES = libccan.la
+libccan_la_SOURCES = \
+	list/list.h \
+	list/list.c \
+	noerr/noerr.c \
+	noerr/noerr.h \
+	ptr_valid/ptr_valid.c \
+	ptr_valid/ptr_valid.h \
+	check_type/check_type.h \
+	compiler/compiler.h \
+	autodata/autodata.c \
+	autodata/autodata.h \
+	container_of/container_of.h \
+	array_size/array_size.h \
+	darray/darray.h \
+	build_assert/build_assert.h
+
+ccanincludedir = $(includedir)/hkl- at VMAJ@/hkl/ccan
+nobase_ccaninclude_HEADERS = \
+	darray/darray.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu hkl/ccan/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu hkl/ccan/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libccan.la: $(libccan_la_OBJECTS) $(libccan_la_DEPENDENCIES) $(EXTRA_libccan_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(LINK)  $(libccan_la_OBJECTS) $(libccan_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/autodata.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/list.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/noerr.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ptr_valid.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+list.lo: list/list.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT list.lo -MD -MP -MF $(DEPDIR)/list.Tpo -c -o list.lo `test -f 'list/list.c' || echo '$(srcdir)/'`list/list.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/list.Tpo $(DEPDIR)/list.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='list/list.c' object='list.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o list.lo `test -f 'list/list.c' || echo '$(srcdir)/'`list/list.c
+
+noerr.lo: noerr/noerr.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT noerr.lo -MD -MP -MF $(DEPDIR)/noerr.Tpo -c -o noerr.lo `test -f 'noerr/noerr.c' || echo '$(srcdir)/'`noerr/noerr.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/noerr.Tpo $(DEPDIR)/noerr.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='noerr/noerr.c' object='noerr.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o noerr.lo `test -f 'noerr/noerr.c' || echo '$(srcdir)/'`noerr/noerr.c
+
+ptr_valid.lo: ptr_valid/ptr_valid.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ptr_valid.lo -MD -MP -MF $(DEPDIR)/ptr_valid.Tpo -c -o ptr_valid.lo `test -f 'ptr_valid/ptr_valid.c' || echo '$(srcdir)/'`ptr_valid/ptr_valid.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/ptr_valid.Tpo $(DEPDIR)/ptr_valid.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='ptr_valid/ptr_valid.c' object='ptr_valid.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ptr_valid.lo `test -f 'ptr_valid/ptr_valid.c' || echo '$(srcdir)/'`ptr_valid/ptr_valid.c
+
+autodata.lo: autodata/autodata.c
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT autodata.lo -MD -MP -MF $(DEPDIR)/autodata.Tpo -c -o autodata.lo `test -f 'autodata/autodata.c' || echo '$(srcdir)/'`autodata/autodata.c
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/autodata.Tpo $(DEPDIR)/autodata.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='autodata/autodata.c' object='autodata.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o autodata.lo `test -f 'autodata/autodata.c' || echo '$(srcdir)/'`autodata/autodata.c
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-nobase_ccanincludeHEADERS: $(nobase_ccaninclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(nobase_ccaninclude_HEADERS)'; test -n "$(ccanincludedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(ccanincludedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(ccanincludedir)" || exit 1; \
+	fi; \
+	$(am__nobase_list) | while read dir files; do \
+	  xfiles=; for file in $$files; do \
+	    if test -f "$$file"; then xfiles="$$xfiles $$file"; \
+	    else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
+	  test -z "$$xfiles" || { \
+	    test "x$$dir" = x. || { \
+	      echo " $(MKDIR_P) '$(DESTDIR)$(ccanincludedir)/$$dir'"; \
+	      $(MKDIR_P) "$(DESTDIR)$(ccanincludedir)/$$dir"; }; \
+	    echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(ccanincludedir)/$$dir'"; \
+	    $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(ccanincludedir)/$$dir" || exit $$?; }; \
+	done
+
+uninstall-nobase_ccanincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nobase_ccaninclude_HEADERS)'; test -n "$(ccanincludedir)" || list=; \
+	$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
+	dir='$(DESTDIR)$(ccanincludedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(ccanincludedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-nobase_ccanincludeHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-nobase_ccanincludeHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-nobase_ccanincludeHEADERS \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-nobase_ccanincludeHEADERS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/hkl/ccan/array_size/array_size.h b/hkl/ccan/array_size/array_size.h
new file mode 100644
index 0000000..495b1eb
--- /dev/null
+++ b/hkl/ccan/array_size/array_size.h
@@ -0,0 +1,26 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#ifndef CCAN_ARRAY_SIZE_H
+#define CCAN_ARRAY_SIZE_H
+#include "config.h"
+#include <hkl/ccan/build_assert/build_assert.h>
+
+/**
+ * ARRAY_SIZE - get the number of elements in a visible array
+ * @arr: the array whose size you want.
+ *
+ * This does not work on pointers, or arrays declared as [], or
+ * function parameters.  With correct compiler support, such usage
+ * will cause a build error (see build_assert).
+ */
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + _array_size_chk(arr))
+
+#if HAVE_BUILTIN_TYPES_COMPATIBLE_P && HAVE_TYPEOF
+/* Two gcc extensions.
+ * &a[0] degrades to a pointer: a different type from an array */
+#define _array_size_chk(arr)						\
+	BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(typeof(arr),	\
+							typeof(&(arr)[0])))
+#else
+#define _array_size_chk(arr) 0
+#endif
+#endif /* CCAN_ALIGNOF_H */
diff --git a/hkl/ccan/autodata/autodata.c b/hkl/ccan/autodata/autodata.c
new file mode 100644
index 0000000..53ef62d
--- /dev/null
+++ b/hkl/ccan/autodata/autodata.c
@@ -0,0 +1,80 @@
+// Licensed under BSD-MIT: See LICENSE.
+#include "autodata.h"
+#include <stdint.h>
+#include <unistd.h>
+#include <string.h>
+
+#if HAVE_SECTION_START_STOP
+void *autodata_get_section(void *start, void *stop, size_t *nump)
+{
+	*nump = (void **)(stop) - (void **)(start);
+	return start;
+}
+
+void autodata_free(void *table)
+{
+}
+#else
+#include <hkl/ccan/ptr_valid/ptr_valid.h>
+
+void *autodata_make_table(const void *example, const char *name, size_t *nump)
+{
+	const char *start, *end, *tag;
+	struct ptr_valid_batch batch;
+	const void *const magic = (void *)AUTODATA_MAGIC;
+	void **table = NULL;
+	char first_magic;
+
+	if (!ptr_valid_batch_start(&batch))
+		return NULL;
+
+	/* Get range to search. */
+	for (start = (char *)((intptr_t)example & ~(getpagesize() - 1));
+	     ptr_valid_batch(&batch, start-getpagesize(), 1, sizeof(void *),
+			     false);
+	     start -= getpagesize());
+
+	for (end = (char *)((intptr_t)example & ~(getpagesize() - 1));
+	     ptr_valid_batch(&batch, end, 1, sizeof(void *), false);
+	     end += getpagesize());
+
+	*nump = 0;
+	first_magic = *(char *)&magic;
+	for (tag = memchr(start, first_magic, end - start);
+	     tag;
+	     tag = memchr(tag+1, first_magic, end - (tag + 1))) {
+		void *adata[4];
+
+		/* We can read 4 void *'s here? */
+		if (tag + sizeof(adata) > end)
+			continue;
+
+		memcpy(adata, tag, sizeof(adata));
+
+		/* False match? */
+		if (adata[0] != (void *)AUTODATA_MAGIC || adata[1] != tag)
+			continue;
+
+		/* OK, check name. */
+		if (!ptr_valid_batch_string(&batch, adata[3])
+		    || strcmp(name, adata[3]) != 0)
+			continue;
+
+		if (!ptr_valid_batch_read(&batch, (char *)adata[2]))
+			continue;
+
+		table = realloc(table, sizeof(void *) * (*nump + 1));
+		if (!table)
+			break;
+		table[*nump] = adata[2];
+		(*nump)++;
+	}
+	ptr_valid_batch_end(&batch);
+	return table;
+}
+
+void autodata_free(void *table)
+{
+	free(table);
+}
+#endif
diff --git a/hkl/ccan/autodata/autodata.h b/hkl/ccan/autodata/autodata.h
new file mode 100644
index 0000000..b8a5273
--- /dev/null
+++ b/hkl/ccan/autodata/autodata.h
@@ -0,0 +1,108 @@
+// Licensed under BSD-MIT: See LICENSE.
+#ifndef CCAN_AUTODATA_H
+#define CCAN_AUTODATA_H
+#include "config.h"
+#include <hkl/ccan/compiler/compiler.h>
+#include <stdlib.h>
+
+#if HAVE_SECTION_START_STOP
+
+/**
+ * AUTODATA_TYPE - declare the type for a given autodata name.
+ * @name: the name for this set of autodata
+ * @type: the type this autodata points to
+ *
+ * This macro is usually placed in a header: it must preceed any
+ * autodata functions in the file.
+ *
+ * Example:
+ *	#include <hkl/ccan/autodata/autodata.h>
+ *
+ *	// My set of char pointers.
+ *	AUTODATA_TYPE(names, char);
+ */
+#define AUTODATA_TYPE(name, type)					\
+	typedef type autodata_##name##_;				\
+	extern type *__start_xautodata_##name[], *__stop_xautodata_##name[]
+
+/**
+ * AUTODATA - add a pointer to this autodata set
+ * @name: the name of the set of autodata
+ * @ptr: the compile-time-known pointer
+ *
+ * This embeds @ptr into the binary, with the tag corresponding to
+ * @name (which must look like a valid identifier, no punctuation!).
+ * The type of @ptr must match that given by AUTODATA_TYPE.  It is
+ * usually a file-level declaration.
+ *
+ * Example:
+ *	// Put two char pointers into the names AUTODATA set.
+ *	AUTODATA(names, "Arabella");
+ *	AUTODATA(names, "Alex");
+ */
+#define AUTODATA(name, ptr) \
+	static const autodata_##name##_ *NEEDED		\
+	__attribute__((section("xautodata_" #name)))	\
+	AUTODATA_VAR_(name, __LINE__) = (ptr);
+
+/**
+ * autodata_get - get an autodata set
+ * @name: the name of the set of autodata
+ * @nump: the number of items in the set.
+ *
+ * This extract the embedded pointers matching @name.  It may fail
+ * if malloc() fails, or if there is no AUTODATA at all.
+ *
+ * The return will be a pointer to an array of @type pointers (from
+ * AUTODATA_TYPE).
+ *
+ * Example:
+ *	static void print_embedded_names(void)
+ *	{
+ *		unsigned int i, num;
+ *		char **n = autodata_get(names, &num);
+ *
+ *		for (i = 0; i < num; i++)
+ *			printf("%s\n", n[i]);
+ *	}
+ */
+#define autodata_get(name, nump)					\
+	((autodata_##name##_ **)					\
+	 autodata_get_section(__start_xautodata_##name,			\
+			      __stop_xautodata_##name, (nump)))
+#endif /* HAVE_SECTION_START_STOP */
+
+/**
+ * autodata_free - free the table returned by autodata_get()
+ * @p: the table.
+ */
+void autodata_free(void *p);
+
+/* Internal functions. */
+#define AUTODATA_VAR__(name, line) autodata_##name##_##line
+#define AUTODATA_VAR_(name, line) AUTODATA_VAR__(name, line)
+
+#if HAVE_SECTION_START_STOP
+void *autodata_get_section(void *start, void *stop, size_t *nump);
+#else
+#define AUTODATA_TYPE(name, type)					\
+	typedef type autodata_##name##_;				\
+	static const void *autodata_##name##_ex = &autodata_##name##_ex
+
+#define AUTODATA_MAGIC ((long)0xFEEDA10DA7AF00D5ULL)
+#define AUTODATA(name, ptr)						\
+	static const autodata_##name##_ *NEEDED				\
+	AUTODATA_VAR_(name, __LINE__)[4] =				\
+	{ (void *)AUTODATA_MAGIC,					\
+	  (void *)&AUTODATA_VAR_(name, __LINE__),			\
+	  (ptr),							\
+	  (void *)#name }
+
+#define autodata_get(name, nump)					\
+	((autodata_##name##_ **)					\
+	 autodata_make_table(&autodata_##name##_ex, #name, (nump)))
+
+void *autodata_make_table(const void *example, const char *name, size_t *nump);
+#endif
+
+#endif /* CCAN_AUTODATA_H */
diff --git a/hkl/ccan/build_assert/build_assert.h b/hkl/ccan/build_assert/build_assert.h
new file mode 100644
index 0000000..b9ecd84
--- /dev/null
+++ b/hkl/ccan/build_assert/build_assert.h
@@ -0,0 +1,40 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#ifndef CCAN_BUILD_ASSERT_H
+#define CCAN_BUILD_ASSERT_H
+
+/**
+ * BUILD_ASSERT - assert a build-time dependency.
+ * @cond: the compile-time condition which must be true.
+ *
+ * Your compile will fail if the condition isn't true, or can't be evaluated
+ * by the compiler.  This can only be used within a function.
+ *
+ * Example:
+ *	#include <stddef.h>
+ *	...
+ *	static char *foo_to_char(struct foo *foo)
+ *	{
+ *		// This code needs string to be at start of foo.
+ *		BUILD_ASSERT(offsetof(struct foo, string) == 0);
+ *		return (char *)foo;
+ *	}
+ */
+#define BUILD_ASSERT(cond) \
+	do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
+
+/**
+ * BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
+ * @cond: the compile-time condition which must be true.
+ *
+ * Your compile will fail if the condition isn't true, or can't be evaluated
+ * by the compiler.  This can be used in an expression: its value is "0".
+ *
+ * Example:
+ *	#define foo_to_char(foo)					\
+ *		 ((char *)(foo)						\
+ *		  + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
+ */
+#define BUILD_ASSERT_OR_ZERO(cond) \
+	(sizeof(char [1 - 2*!(cond)]) - 1)
+
+#endif /* CCAN_BUILD_ASSERT_H */
diff --git a/hkl/ccan/check_type/check_type.h b/hkl/ccan/check_type/check_type.h
new file mode 100644
index 0000000..9e89299
--- /dev/null
+++ b/hkl/ccan/check_type/check_type.h
@@ -0,0 +1,64 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#ifndef CCAN_CHECK_TYPE_H
+#define CCAN_CHECK_TYPE_H
+#include "config.h"
+
+/**
+ * check_type - issue a warning or build failure if type is not correct.
+ * @expr: the expression whose type we should check (not evaluated).
+ * @type: the exact type we expect the expression to be.
+ *
+ * This macro is usually used within other macros to try to ensure that a macro
+ * argument is of the expected type.  No type promotion of the expression is
+ * done: an unsigned int is not the same as an int!
+ *
+ * check_type() always evaluates to 0.
+ *
+ * If your compiler does not support typeof, then the best we can do is fail
+ * to compile if the sizes of the types are unequal (a less complete check).
+ *
+ * Example:
+ *	// They should always pass a 64-bit value to _set_some_value!
+ *	#define set_some_value(expr)			\
+ *		_set_some_value((check_type((expr), uint64_t), (expr)))
+ */
+
+/**
+ * check_types_match - issue a warning or build failure if types are not same.
+ * @expr1: the first expression (not evaluated).
+ * @expr2: the second expression (not evaluated).
+ *
+ * This macro is usually used within other macros to try to ensure that
+ * arguments are of identical types.  No type promotion of the expressions is
+ * done: an unsigned int is not the same as an int!
+ *
+ * check_types_match() always evaluates to 0.
+ *
+ * If your compiler does not support typeof, then the best we can do is fail
+ * to compile if the sizes of the types are unequal (a less complete check).
+ *
+ * Example:
+ *	// Do subtraction to get to enclosing type, but make sure that
+ *	// pointer is of correct type for that member.
+ *	#define container_of(mbr_ptr, encl_type, mbr)			\
+ *		(check_types_match((mbr_ptr), &((encl_type *)0)->mbr),	\
+ *		 ((encl_type *)						\
+ *		  ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr))))
+ */
+#if HAVE_TYPEOF
+#define check_type(expr, type)			\
+	((typeof(expr) *)0 != (type *)0)
+
+#define check_types_match(expr1, expr2)		\
+	((typeof(expr1) *)0 != (typeof(expr2) *)0)
+#else
+#include <hkl/ccan/build_assert/build_assert.h>
+/* Without typeof, we can only test the sizes. */
+#define check_type(expr, type)					\
+	BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
+
+#define check_types_match(expr1, expr2)				\
+	BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
+#endif /* HAVE_TYPEOF */
+
+#endif /* CCAN_CHECK_TYPE_H */
diff --git a/hkl/ccan/compiler/compiler.h b/hkl/ccan/compiler/compiler.h
new file mode 100644
index 0000000..651b47c
--- /dev/null
+++ b/hkl/ccan/compiler/compiler.h
@@ -0,0 +1,217 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#ifndef CCAN_COMPILER_H
+#define CCAN_COMPILER_H
+#include "config.h"
+
+#ifndef COLD
+#if HAVE_ATTRIBUTE_COLD
+/**
+ * COLD - a function is unlikely to be called.
+ *
+ * Used to mark an unlikely code path and optimize appropriately.
+ * It is usually used on logging or error routines.
+ *
+ * Example:
+ * static void COLD moan(const char *reason)
+ * {
+ *	fprintf(stderr, "Error: %s (%s)\n", reason, strerror(errno));
+ * }
+ */
+#define COLD __attribute__((cold))
+#else
+#define COLD
+#endif
+#endif
+
+#ifndef NORETURN
+#if HAVE_ATTRIBUTE_NORETURN
+/**
+ * NORETURN - a function does not return
+ *
+ * Used to mark a function which exits; useful for suppressing warnings.
+ *
+ * Example:
+ * static void NORETURN fail(const char *reason)
+ * {
+ *	fprintf(stderr, "Error: %s (%s)\n", reason, strerror(errno));
+ *	exit(1);
+ * }
+ */
+#define NORETURN __attribute__((noreturn))
+#else
+#define NORETURN
+#endif
+#endif
+
+#ifndef PRINTF_FMT
+#if HAVE_ATTRIBUTE_PRINTF
+/**
+ * PRINTF_FMT - a function takes printf-style arguments
+ * @nfmt: the 1-based number of the function's format argument.
+ * @narg: the 1-based number of the function's first variable argument.
+ *
+ * This allows the compiler to check your parameters as it does for printf().
+ *
+ * Example:
+ * void PRINTF_FMT(2,3) my_printf(const char *prefix, const char *fmt, ...);
+ */
+#define PRINTF_FMT(nfmt, narg) \
+	__attribute__((format(__printf__, nfmt, narg)))
+#else
+#define PRINTF_FMT(nfmt, narg)
+#endif
+#endif
+
+#ifndef CONST_FUNCTION
+#if HAVE_ATTRIBUTE_CONST
+/**
+ * CONST_FUNCTION - a function's return depends only on its argument
+ *
+ * This allows the compiler to assume that the function will return the exact
+ * same value for the exact same arguments.  This implies that the function
+ * must not use global variables, or dereference pointer arguments.
+ */
+#define CONST_FUNCTION __attribute__((const))
+#else
+#define CONST_FUNCTION
+#endif
+#endif
+
+#if HAVE_ATTRIBUTE_UNUSED
+#ifndef UNNEEDED
+/**
+ * UNNEEDED - a variable/function may not be needed
+ *
+ * This suppresses warnings about unused variables or functions, but tells
+ * the compiler that if it is unused it need not emit it into the source code.
+ *
+ * Example:
+ * // With some preprocessor options, this is unnecessary.
+ * static UNNEEDED int counter;
+ *
+ * // With some preprocessor options, this is unnecessary.
+ * static UNNEEDED void add_to_counter(int add)
+ * {
+ *	counter += add;
+ * }
+ */
+#define UNNEEDED __attribute__((unused))
+#endif
+
+#ifndef NEEDED
+#if HAVE_ATTRIBUTE_USED
+/**
+ * NEEDED - a variable/function is needed
+ *
+ * This suppresses warnings about unused variables or functions, but tells
+ * the compiler that it must exist even if it (seems) unused.
+ *
+ * Example:
+ *	// Even if this is unused, these are vital for debugging.
+ *	static NEEDED int counter;
+ *	static NEEDED void dump_counter(void)
+ *	{
+ *		printf("Counter is %i\n", counter);
+ *	}
+ */
+#define NEEDED __attribute__((used))
+#else
+/* Before used, unused functions and vars were always emitted. */
+#define NEEDED __attribute__((unused))
+#endif
+#endif
+
+#ifndef UNUSED
+/**
+ * UNUSED - a parameter is unused
+ *
+ * Some compilers (eg. gcc with -W or -Wunused) warn about unused
+ * function parameters.  This suppresses such warnings and indicates
+ * to the reader that it's deliberate.
+ *
+ * Example:
+ *	// This is used as a callback, so needs to have this prototype.
+ *	static int some_callback(void *unused UNUSED)
+ *	{
+ *		return 0;
+ *	}
+ */
+#define UNUSED __attribute__((unused))
+#endif
+#else
+#ifndef UNNEEDED
+#define UNNEEDED
+#endif
+#ifndef NEEDED
+#define NEEDED
+#endif
+#ifndef UNUSED
+#define UNUSED
+#endif
+#endif
+
+#ifndef IS_COMPILE_CONSTANT
+#if HAVE_BUILTIN_CONSTANT_P
+/**
+ * IS_COMPILE_CONSTANT - does the compiler know the value of this expression?
+ * @expr: the expression to evaluate
+ *
+ * When an expression manipulation is complicated, it is usually better to
+ * implement it in a function.  However, if the expression being manipulated is
+ * known at compile time, it is better to have the compiler see the entire
+ * expression so it can simply substitute the result.
+ *
+ * This can be done using the IS_COMPILE_CONSTANT() macro.
+ *
+ * Example:
+ *	enum greek { ALPHA, BETA, GAMMA, DELTA, EPSILON };
+ *
+ *	// Out-of-line version.
+ *	const char *greek_name(enum greek greek);
+ *
+ *	// Inline version.
+ *	static inline const char *_greek_name(enum greek greek)
+ *	{
+ *		switch (greek) {
+ *		case ALPHA: return "alpha";
+ *		case BETA: return "beta";
+ *		case GAMMA: return "gamma";
+ *		case DELTA: return "delta";
+ *		case EPSILON: return "epsilon";
+ *		default: return "**INVALID**";
+ *		}
+ *	}
+ *
+ *	// Use inline if compiler knows answer.  Otherwise call function
+ *	// to avoid copies of the same code everywhere.
+ *	#define greek_name(g)						\
+ *		 (IS_COMPILE_CONSTANT(greek) ? _greek_name(g) : greek_name(g))
+ */
+#define IS_COMPILE_CONSTANT(expr) __builtin_constant_p(expr)
+#else
+/* If we don't know, assume it's not. */
+#define IS_COMPILE_CONSTANT(expr) 0
+#endif
+#endif
+
+#ifndef WARN_UNUSED_RESULT
+#if HAVE_WARN_UNUSED_RESULT
+/**
+ * WARN_UNUSED_RESULT - warn if a function return value is unused.
+ *
+ * Used to mark a function where it is extremely unlikely that the caller
+ * can ignore the result, eg realloc().
+ *
+ * Example:
+ * // buf param may be freed by this; need return value!
+ * static char *WARN_UNUSED_RESULT enlarge(char *buf, unsigned *size)
+ * {
+ *	return realloc(buf, (*size) *= 2);
+ * }
+ */
+#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#else
+#define WARN_UNUSED_RESULT
+#endif
+#endif
+#endif /* CCAN_COMPILER_H */
diff --git a/hkl/ccan/container_of/container_of.h b/hkl/ccan/container_of/container_of.h
new file mode 100644
index 0000000..8ccf836
--- /dev/null
+++ b/hkl/ccan/container_of/container_of.h
@@ -0,0 +1,109 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#ifndef CCAN_CONTAINER_OF_H
+#define CCAN_CONTAINER_OF_H
+#include <stddef.h>
+
+#include "config.h"
+#include <hkl/ccan/check_type/check_type.h>
+
+/**
+ * container_of - get pointer to enclosing structure
+ * @member_ptr: pointer to the structure member
+ * @containing_type: the type this member is within
+ * @member: the name of this member within the structure.
+ *
+ * Given a pointer to a member of a structure, this macro does pointer
+ * subtraction to return the pointer to the enclosing type.
+ *
+ * Example:
+ *	struct foo {
+ *		int fielda, fieldb;
+ *		// ...
+ *	};
+ *	struct info {
+ *		int some_other_field;
+ *		struct foo my_foo;
+ *	};
+ *
+ *	static struct info *foo_to_info(struct foo *foo)
+ *	{
+ *		return container_of(foo, struct info, my_foo);
+ *	}
+ */
+#define container_of(member_ptr, containing_type, member)		\
+	 ((containing_type *)						\
+	  ((char *)(member_ptr)						\
+	   - container_off(containing_type, member))			\
+	  + check_types_match(*(member_ptr), ((containing_type *)0)->member))
+
+/**
+ * container_off - get offset to enclosing structure
+ * @containing_type: the type this member is within
+ * @member: the name of this member within the structure.
+ *
+ * Given a pointer to a member of a structure, this macro does
+ * typechecking and figures out the offset to the enclosing type.
+ *
+ * Example:
+ *	struct foo {
+ *		int fielda, fieldb;
+ *		// ...
+ *	};
+ *	struct info {
+ *		int some_other_field;
+ *		struct foo my_foo;
+ *	};
+ *
+ *	static struct info *foo_to_info(struct foo *foo)
+ *	{
+ *		size_t off = container_off(struct info, my_foo);
+ *		return (void *)((char *)foo - off);
+ *	}
+ */
+#define container_off(containing_type, member)	\
+	offsetof(containing_type, member)
+
+/**
+ * container_of_var - get pointer to enclosing structure using a variable
+ * @member_ptr: pointer to the structure member
+ * @container_var: a pointer of same type as this member's container
+ * @member: the name of this member within the structure.
+ *
+ * Given a pointer to a member of a structure, this macro does pointer
+ * subtraction to return the pointer to the enclosing type.
+ *
+ * Example:
+ *	static struct info *foo_to_i(struct foo *foo)
+ *	{
+ *		struct info *i = container_of_var(foo, i, my_foo);
+ *		return i;
+ *	}
+ */
+#if HAVE_TYPEOF
+#define container_of_var(member_ptr, container_var, member) \
+	container_of(member_ptr, typeof(*container_var), member)
+#else
+#define container_of_var(member_ptr, container_var, member)	\
+	((void *)((char *)(member_ptr)	-			\
+		  container_off_var(container_var, member)))
+#endif
+
+/**
+ * container_off_var - get offset of a field in enclosing structure
+ * @container_var: a pointer to a container structure
+ * @member: the name of a member within the structure.
+ *
+ * Given (any) pointer to a structure and a its member name, this
+ * macro does pointer subtraction to return offset of member in a
+ * structure memory layout.
+ *
+ */
+#if HAVE_TYPEOF
+#define container_off_var(var, member)		\
+	container_off(typeof(*var), member)
+#else
+#define container_off_var(var, member)			\
+	((char *)&(var)->member - (char *)(var))
+#endif
+
+#endif /* CCAN_CONTAINER_OF_H */
diff --git a/hkl/ccan/darray/darray.h b/hkl/ccan/darray/darray.h
new file mode 100644
index 0000000..b7e08db
--- /dev/null
+++ b/hkl/ccan/darray/darray.h
@@ -0,0 +1,348 @@
+/*
+ * Copyright (C) 2011 Joseph Adams <joeyadams3.14159 at gmail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef CCAN_DARRAY_H
+#define CCAN_DARRAY_H
+
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+
+/*
+ * SYNOPSIS
+ *
+ * Life cycle of a darray (dynamically-allocated array):
+ *
+ *     darray(int) a = darray_new();
+ *     darray_free(a);
+ *
+ *     struct {darray(int) a;} foo;
+ *     darray_init(foo.a);
+ *     darray_free(foo.a);
+ *
+ * Typedefs for darrays of common types:
+ *
+ *     darray_char, darray_schar, darray_uchar
+ *     darray_short, darray_int, darray_long
+ *     darray_ushort, darray_uint, darray_ulong
+ *
+ * Access:
+ *
+ *     T      darray_item(darray(T) arr, size_t index);
+ *     size_t darray_size(darray(T) arr);
+ *     size_t darray_alloc(darray(T) arr);
+ *     bool   darray_empty(darray(T) arr);
+ *
+ * Insertion (single item):
+ *
+ *     void   darray_append(darray(T) arr, T item);
+ *     void   darray_prepend(darray(T) arr, T item);
+ *     void   darray_push(darray(T) arr, T item); // same as darray_append
+ *
+ * Insertion (multiple items):
+ *
+ *     void   darray_append_items(darray(T) arr, T *items, size_t count);
+ *     void   darray_prepend_items(darray(T) arr, T *items, size_t count);
+ *
+ *     void   darray_appends(darray(T) arr, [T item, [...]]);
+ *     void   darray_prepends(darray(T) arr, [T item, [...]]);
+ *
+ *     // Same functionality as above, but does not require typeof.
+ *     void   darray_appends_t(darray(T) arr, #T, [T item, [...]]);
+ *     void   darray_prepends_t(darray(T) arr, #T, [T item, [...]]);
+ *
+ * Removal:
+ *
+ *     T      darray_pop(darray(T) arr | darray_size(arr) != 0);
+ *     T*     darray_pop_check(darray(T*) arr);
+ *
+ * Replacement:
+ *
+ *     void   darray_from_items(darray(T) arr, T *items, size_t count);
+ *     void   darray_from_c(darray(T) arr, T c_array[N]);
+ *
+ * String buffer:
+ *
+ *     void   darray_append_string(darray(char) arr, const char *str);
+ *     void   darray_append_lit(darray(char) arr, char stringLiteral[N+1]);
+ *
+ *     void   darray_prepend_string(darray(char) arr, const char *str);
+ *     void   darray_prepend_lit(darray(char) arr, char stringLiteral[N+1]);
+ *
+ *     void   darray_from_string(darray(T) arr, const char *str);
+ *     void   darray_from_lit(darray(char) arr, char stringLiteral[N+1]);
+ *
+ * Size management:
+ *
+ *     void   darray_resize(darray(T) arr, size_t newSize);
+ *     void   darray_resize0(darray(T) arr, size_t newSize);
+ *
+ *     void   darray_realloc(darray(T) arr, size_t newAlloc);
+ *     void   darray_growalloc(darray(T) arr, size_t newAlloc);
+ *
+ *     void   darray_make_room(darray(T) arr, size_t room);
+ *
+ * Traversal:
+ *
+ *     darray_foreach(T *&i, darray(T) arr) {...}
+ *     darray_foreach_reverse(T *&i, darray(T) arr) {...}
+ *
+ * Except for darray_foreach and darray_foreach_reverse,
+ * all macros evaluate their non-darray arguments only once.
+ */
+
+/*** Life cycle ***/
+
+#define darray(type) struct {type *item; size_t size; size_t alloc;}
+
+#define darray_new() {0,0,0}
+#define darray_init(arr) do {(arr).item=0; (arr).size=0; (arr).alloc=0;} while(0)
+#define darray_free(arr) do {free((arr).item);} while(0)
+
+
+/*
+ * Typedefs for darrays of common types.  These are useful
+ * when you want to pass a pointer to an darray(T) around.
+ *
+ * The following will produce an incompatible pointer warning:
+ *
+ *     void foo(darray(int) *arr);
+ *     darray(int) arr = darray_new();
+ *     foo(&arr);
+ *
+ * The workaround:
+ *
+ *     void foo(darray_int *arr);
+ *     darray_int arr = darray_new();
+ *     foo(&arr);
+ */
+
+typedef darray(char)           darray_char;
+typedef darray(signed char)    darray_schar;
+typedef darray(unsigned char)  darray_uchar;
+
+typedef darray(short)          darray_short;
+typedef darray(int)            darray_int;
+typedef darray(long)           darray_long;
+
+typedef darray(unsigned short) darray_ushort;
+typedef darray(unsigned int)   darray_uint;
+typedef darray(unsigned long)  darray_ulong;
+
+
+/*** Access ***/
+
+#define darray_item(arr, i) ((arr).item[i])
+#define darray_size(arr)    ((arr).size)
+#define darray_alloc(arr)   ((arr).alloc)
+#define darray_empty(arr)   ((arr).size == 0)
+
+
+/*** Insertion (single item) ***/
+
+#define darray_append(arr, ...) do { \
+		darray_resize(arr, (arr).size+1); \
+		(arr).item[(arr).size-1] = (__VA_ARGS__); \
+	} while(0)
+#define darray_prepend(arr, ...) do { \
+		darray_resize(arr, (arr).size+1); \
+		memmove((arr).item+1, (arr).item, ((arr).size-1)*sizeof(*(arr).item)); \
+		(arr).item[0] = (__VA_ARGS__); \
+	} while(0)
+#define darray_push(arr, ...) darray_append(arr, __VA_ARGS__)
+
+
+/*** Insertion (multiple items) ***/
+
+#define darray_append_items(arr, items, count) do { \
+		size_t __count = (count), __oldSize = (arr).size; \
+		darray_resize(arr, __oldSize + __count); \
+		memcpy((arr).item + __oldSize, items, __count * sizeof(*(arr).item)); \
+	} while(0)
+
+#define darray_prepend_items(arr, items, count) do { \
+		size_t __count = (count), __oldSize = (arr).size; \
+		darray_resize(arr, __count + __oldSize); \
+		memmove((arr).item + __count, (arr).item, __oldSize * sizeof(*(arr).item)); \
+		memcpy((arr).item, items, __count * sizeof(*(arr).item)); \
+	} while(0)
+
+#define darray_append_items_nullterminate(arr, items, count) do { \
+		size_t __count = (count), __oldSize = (arr).size; \
+		darray_resize(arr, __oldSize + __count + 1); \
+		memcpy((arr).item + __oldSize, items, __count * sizeof(*(arr).item)); \
+		(arr).item[--(arr).size] = 0; \
+	} while(0)
+
+#define darray_prepend_items_nullterminate(arr, items, count) do { \
+		size_t __count = (count), __oldSize = (arr).size; \
+		darray_resize(arr, __count + __oldSize + 1); \
+		memmove((arr).item + __count, (arr).item, __oldSize * sizeof(*(arr).item)); \
+		memcpy((arr).item, items, __count * sizeof(*(arr).item)); \
+		(arr).item[--(arr).size] = 0; \
+	} while(0)
+
+#if HAVE_TYPEOF
+#define darray_appends(arr, ...) darray_appends_t(arr, typeof((*(arr).item)), __VA_ARGS__)
+#define darray_prepends(arr, ...) darray_prepends_t(arr, typeof((*(arr).item)), __VA_ARGS__)
+#endif
+
+#define darray_appends_t(arr, type, ...) do { \
+		type __src[] = {__VA_ARGS__}; \
+		darray_append_items(arr, __src, sizeof(__src)/sizeof(*__src)); \
+	} while(0)
+#define darray_prepends_t(arr, type, ...) do { \
+		type __src[] = {__VA_ARGS__}; \
+		darray_prepend_items(arr, __src, sizeof(__src)/sizeof(*__src)); \
+	} while(0)
+
+
+/*** Removal ***/
+
+/* Warning: Do not call darray_pop on an empty darray. */
+#define darray_pop(arr) ((arr).item[--(arr).size])
+#define darray_pop_check(arr) ((arr).size ? darray_pop(arr) : NULL)
+
+
+/*** Replacement ***/
+
+#define darray_from_items(arr, items, count) do {size_t __count = (count); darray_resize(arr, __count); memcpy((arr).item, items, __count*sizeof(*(arr).item));} while(0)
+#define darray_from_c(arr, c_array) darray_from_items(arr, c_array, sizeof(c_array)/sizeof(*(c_array)))
+
+
+/*** String buffer ***/
+
+#define darray_append_string(arr, str) do {const char *__str = (str); darray_append_items(arr, __str, strlen(__str)+1); (arr).size--;} while(0)
+#define darray_append_lit(arr, stringLiteral) do {darray_append_items(arr, stringLiteral, sizeof(stringLiteral)); (arr).size--;} while(0)
+
+#define darray_prepend_string(arr, str) do { \
+		const char *__str = (str); \
+		darray_prepend_items_nullterminate(arr, __str, strlen(__str)); \
+	} while(0)
+#define darray_prepend_lit(arr, stringLiteral) \
+	darray_prepend_items_nullterminate(arr, stringLiteral, sizeof(stringLiteral) - 1)
+
+#define darray_from_string(arr, str) do {const char *__str = (str); darray_from_items(arr, __str, strlen(__str)+1); (arr).size--;} while(0)
+#define darray_from_lit(arr, stringLiteral) do {darray_from_items(arr, stringLiteral, sizeof(stringLiteral)); (arr).size--;} while(0)
+
+
+/*** Size management ***/
+
+#define darray_resize(arr, newSize) darray_growalloc(arr, (arr).size = (newSize))
+#define darray_resize0(arr, newSize) do { \
+		size_t __oldSize = (arr).size, __newSize = (newSize); \
+		(arr).size = __newSize; \
+		if (__newSize > __oldSize) { \
+			darray_growalloc(arr, __newSize); \
+			memset(&(arr).item[__oldSize], 0, (__newSize - __oldSize) * sizeof(*(arr).item)); \
+		} \
+	} while(0)
+
+#define darray_realloc(arr, newAlloc) do { \
+		(arr).item = realloc((arr).item, ((arr).alloc = (newAlloc)) * sizeof(*(arr).item)); \
+	} while(0)
+#define darray_growalloc(arr, need) do { \
+		size_t __need = (need); \
+		if (__need > (arr).alloc) \
+			darray_realloc(arr, darray_next_alloc((arr).alloc, __need)); \
+	} while(0)
+
+#if HAVE_STATEMENT_EXPR==1
+#define darray_make_room(arr, room) ({size_t newAlloc = (arr).size+(room); if ((arr).alloc<newAlloc) darray_realloc(arr, newAlloc); (arr).item+(arr).size; })
+#endif
+
+static inline size_t darray_next_alloc(size_t alloc, size_t need)
+{
+	if (alloc == 0)
+		alloc = 1;
+	while (alloc < need)
+		alloc *= 2;
+	return alloc;
+}
+
+
+/*** Traversal ***/
+
+/*
+ * darray_foreach(T *&i, darray(T) arr) {...}
+ *
+ * Traverse a darray.  `i` must be declared in advance as a pointer to an item.
+ */
+#define darray_foreach(i, arr) \
+	for ((i) = &(arr).item[0]; (i) < &(arr).item[(arr).size]; (i)++)
+
+/*
+ * darray_foreach_reverse(T *&i, darray(T) arr) {...}
+ *
+ * Like darray_foreach, but traverse in reverse order.
+ */
+#define darray_foreach_reverse(i, arr) \
+	for ((i) = &(arr).item[(arr).size]; (i)-- > &(arr).item[0]; )
+
+
+#endif /* CCAN_DARRAY_H */
+
+/*
+
+darray_growalloc(arr, newAlloc) sees if the darray can currently hold newAlloc items;
+	if not, it increases the alloc to satisfy this requirement, allocating slack
+	space to avoid having to reallocate for every size increment.
+
+darray_from_string(arr, str) copies a string to an darray_char.
+
+darray_push(arr, item) pushes an item to the end of the darray.
+darray_pop(arr) pops it back out.  Be sure there is at least one item in the darray before calling.
+darray_pop_check(arr) does the same as darray_pop, but returns NULL if there are no more items left in the darray.
+
+darray_make_room(arr, room) ensures there's 'room' elements of space after the end of the darray, and it returns a pointer to this space.
+Currently requires HAVE_STATEMENT_EXPR, but I plan to remove this dependency by creating an inline function.
+
+The following require HAVE_TYPEOF==1 :
+
+darray_appends(arr, item0, item1...) appends a collection of comma-delimited items to the darray.
+darray_prepends(arr, item0, item1...) prepends a collection of comma-delimited items to the darray.\
+
+
+Examples:
+
+	darray(int)  arr;
+	int        *i;
+	
+	darray_appends(arr, 0,1,2,3,4);
+	darray_appends(arr, -5,-4,-3,-2,-1);
+	darray_foreach(i, arr)
+		printf("%d ", *i);
+	printf("\n");
+	
+	darray_free(arr);
+	
+
+	typedef struct {int n,d;} Fraction;
+	darray(Fraction) fractions;
+	Fraction        *i;
+	
+	darray_appends(fractions, {3,4}, {3,5}, {2,1});
+	darray_foreach(i, fractions)
+		printf("%d/%d\n", i->n, i->d);
+	
+	darray_free(fractions);
+*/
diff --git a/hkl/ccan/list/list.c b/hkl/ccan/list/list.c
new file mode 100644
index 0000000..2717fa3
--- /dev/null
+++ b/hkl/ccan/list/list.c
@@ -0,0 +1,43 @@
+/* Licensed under BSD-MIT - see LICENSE file for details */
+#include <stdio.h>
+#include <stdlib.h>
+#include "list.h"
+
+static void *corrupt(const char *abortstr,
+		     const struct list_node *head,
+		     const struct list_node *node,
+		     unsigned int count)
+{
+	if (abortstr) {
+		fprintf(stderr,
+			"%s: prev corrupt in node %p (%u) of %p\n",
+			abortstr, node, count, head);
+		abort();
+	}
+	return NULL;
+}
+
+struct list_node *list_check_node(const struct list_node *node,
+				  const char *abortstr)
+{
+	const struct list_node *p, *n;
+	int count = 0;
+
+	for (p = node, n = node->next; n != node; p = n, n = n->next) {
+		count++;
+		if (n->prev != p)
+			return corrupt(abortstr, node, n, count);
+	}
+	/* Check prev on head node. */
+	if (node->prev != p)
+		return corrupt(abortstr, node, node, 0);
+
+	return (struct list_node *)node;
+}
+
+struct list_head *list_check(const struct list_head *h, const char *abortstr)
+{
+	if (!list_check_node(&h->n, abortstr))
+		return NULL;
+	return (struct list_head *)h;
+}
diff --git a/hkl/ccan/list/list.h b/hkl/ccan/list/list.h
new file mode 100644
index 0000000..ece2d22
--- /dev/null
+++ b/hkl/ccan/list/list.h
@@ -0,0 +1,563 @@
+/* Licensed under BSD-MIT - see LICENSE file for details */
+#ifndef CCAN_LIST_H
+#define CCAN_LIST_H
+#include <stdbool.h>
+#include <assert.h>
+#include <hkl/ccan/container_of/container_of.h>
+#include <hkl/ccan/check_type/check_type.h>
+
+/**
+ * struct list_node - an entry in a doubly-linked list
+ * @next: next entry (self if empty)
+ * @prev: previous entry (self if empty)
+ *
+ * This is used as an entry in a linked list.
+ * Example:
+ *	struct child {
+ *		const char *name;
+ *		// Linked list of all us children.
+ *		struct list_node list;
+ *	};
+ */
+struct list_node
+{
+	struct list_node *next, *prev;
+};
+
+/**
+ * struct list_head - the head of a doubly-linked list
+ * @h: the list_head (containing next and prev pointers)
+ *
+ * This is used as the head of a linked list.
+ * Example:
+ *	struct parent {
+ *		const char *name;
+ *		struct list_head children;
+ *		unsigned int num_children;
+ *	};
+ */
+struct list_head
+{
+	struct list_node n;
+};
+
+/**
+ * list_check - check head of a list for consistency
+ * @h: the list_head
+ * @abortstr: the location to print on aborting, or NULL.
+ *
+ * Because list_nodes have redundant information, consistency checking between
+ * the back and forward links can be done.  This is useful as a debugging check.
+ * If @abortstr is non-NULL, that will be printed in a diagnostic if the list
+ * is inconsistent, and the function will abort.
+ *
+ * Returns the list head if the list is consistent, NULL if not (it
+ * can never return NULL if @abortstr is set).
+ *
+ * See also: list_check_node()
+ *
+ * Example:
+ *	static void dump_parent(struct parent *p)
+ *	{
+ *		struct child *c;
+ *
+ *		printf("%s (%u children):\n", p->name, p->num_children);
+ *		list_check(&p->children, "bad child list");
+ *		list_for_each(&p->children, c, list)
+ *			printf(" -> %s\n", c->name);
+ *	}
+ */
+struct list_head *list_check(const struct list_head *h, const char *abortstr);
+
+/**
+ * list_check_node - check node of a list for consistency
+ * @n: the list_node
+ * @abortstr: the location to print on aborting, or NULL.
+ *
+ * Check consistency of the list node is in (it must be in one).
+ *
+ * See also: list_check()
+ *
+ * Example:
+ *	static void dump_child(const struct child *c)
+ *	{
+ *		list_check_node(&c->list, "bad child list");
+ *		printf("%s\n", c->name);
+ *	}
+ */
+struct list_node *list_check_node(const struct list_node *n,
+				  const char *abortstr);
+
+#ifdef CCAN_LIST_DEBUG
+#define list_debug(h) list_check((h), __func__)
+#define list_debug_node(n) list_check_node((n), __func__)
+#else
+#define list_debug(h) (h)
+#define list_debug_node(n) (n)
+#endif
+
+/**
+ * LIST_HEAD_INIT - initializer for an empty list_head
+ * @name: the name of the list.
+ *
+ * Explicit initializer for an empty list.
+ *
+ * See also:
+ *	LIST_HEAD, list_head_init()
+ *
+ * Example:
+ *	static struct list_head my_list = LIST_HEAD_INIT(my_list);
+ */
+#define LIST_HEAD_INIT(name) { { &name.n, &name.n } }
+
+/**
+ * LIST_HEAD - define and initialize an empty list_head
+ * @name: the name of the list.
+ *
+ * The LIST_HEAD macro defines a list_head and initializes it to an empty
+ * list.  It can be prepended by "static" to define a static list_head.
+ *
+ * See also:
+ *	LIST_HEAD_INIT, list_head_init()
+ *
+ * Example:
+ *	static LIST_HEAD(my_global_list);
+ */
+#define LIST_HEAD(name) \
+	struct list_head name = LIST_HEAD_INIT(name)
+
+/**
+ * list_head_init - initialize a list_head
+ * @h: the list_head to set to the empty list
+ *
+ * Example:
+ *	...
+ *	struct parent *parent = malloc(sizeof(*parent));
+ *
+ *	list_head_init(&parent->children);
+ *	parent->num_children = 0;
+ */
+static inline void list_head_init(struct list_head *h)
+{
+	h->n.next = h->n.prev = &h->n;
+}
+
+/**
+ * list_add - add an entry at the start of a linked list.
+ * @h: the list_head to add the node to
+ * @n: the list_node to add to the list.
+ *
+ * The list_node does not need to be initialized; it will be overwritten.
+ * Example:
+ *	struct child *child = malloc(sizeof(*child));
+ *
+ *	child->name = "marvin";
+ *	list_add(&parent->children, &child->list);
+ *	parent->num_children++;
+ */
+static inline void list_add(struct list_head *h, struct list_node *n)
+{
+	n->next = h->n.next;
+	n->prev = &h->n;
+	h->n.next->prev = n;
+	h->n.next = n;
+	(void)list_debug(h);
+}
+
+/**
+ * list_add_tail - add an entry at the end of a linked list.
+ * @h: the list_head to add the node to
+ * @n: the list_node to add to the list.
+ *
+ * The list_node does not need to be initialized; it will be overwritten.
+ * Example:
+ *	list_add_tail(&parent->children, &child->list);
+ *	parent->num_children++;
+ */
+static inline void list_add_tail(struct list_head *h, struct list_node *n)
+{
+	n->next = &h->n;
+	n->prev = h->n.prev;
+	h->n.prev->next = n;
+	h->n.prev = n;
+	(void)list_debug(h);
+}
+
+/**
+ * list_empty - is a list empty?
+ * @h: the list_head
+ *
+ * If the list is empty, returns true.
+ *
+ * Example:
+ *	assert(list_empty(&parent->children) == (parent->num_children == 0));
+ */
+static inline bool list_empty(const struct list_head *h)
+{
+	(void)list_debug(h);
+	return h->n.next == &h->n;
+}
+
+/**
+ * list_del - delete an entry from an (unknown) linked list.
+ * @n: the list_node to delete from the list.
+ *
+ * Note that this leaves @n in an undefined state; it can be added to
+ * another list, but not deleted again.
+ *
+ * See also:
+ *	list_del_from()
+ *
+ * Example:
+ *	list_del(&child->list);
+ *	parent->num_children--;
+ */
+static inline void list_del(struct list_node *n)
+{
+	(void)list_debug_node(n);
+	n->next->prev = n->prev;
+	n->prev->next = n->next;
+#ifdef CCAN_LIST_DEBUG
+	/* Catch use-after-del. */
+	n->next = n->prev = NULL;
+#endif
+}
+
+/**
+ * list_del_from - delete an entry from a known linked list.
+ * @h: the list_head the node is in.
+ * @n: the list_node to delete from the list.
+ *
+ * This explicitly indicates which list a node is expected to be in,
+ * which is better documentation and can catch more bugs.
+ *
+ * See also: list_del()
+ *
+ * Example:
+ *	list_del_from(&parent->children, &child->list);
+ *	parent->num_children--;
+ */
+static inline void list_del_from(struct list_head *h, struct list_node *n)
+{
+#ifdef CCAN_LIST_DEBUG
+	{
+		/* Thorough check: make sure it was in list! */
+		struct list_node *i;
+		for (i = h->n.next; i != n; i = i->next)
+			assert(i != &h->n);
+	}
+#endif /* CCAN_LIST_DEBUG */
+
+	/* Quick test that catches a surprising number of bugs. */
+	assert(!list_empty(h));
+	list_del(n);
+}
+
+/**
+ * list_entry - convert a list_node back into the structure containing it.
+ * @n: the list_node
+ * @type: the type of the entry
+ * @member: the list_node member of the type
+ *
+ * Example:
+ *	// First list entry is children.next; convert back to child.
+ *	child = list_entry(parent->children.n.next, struct child, list);
+ *
+ * See Also:
+ *	list_top(), list_for_each()
+ */
+#define list_entry(n, type, member) container_of(n, type, member)
+
+/**
+ * list_top - get the first entry in a list
+ * @h: the list_head
+ * @type: the type of the entry
+ * @member: the list_node member of the type
+ *
+ * If the list is empty, returns NULL.
+ *
+ * Example:
+ *	struct child *first;
+ *	first = list_top(&parent->children, struct child, list);
+ *	if (!first)
+ *		printf("Empty list!\n");
+ */
+#define list_top(h, type, member)					\
+	((type *)list_top_((h), list_off_(type, member)))
+
+static inline const void *list_top_(const struct list_head *h, size_t off)
+{
+	if (list_empty(h))
+		return NULL;
+	return (const char *)h->n.next - off;
+}
+
+/**
+ * list_pop - remove the first entry in a list
+ * @h: the list_head
+ * @type: the type of the entry
+ * @member: the list_node member of the type
+ *
+ * If the list is empty, returns NULL.
+ *
+ * Example:
+ *	struct child *one;
+ *	one = list_pop(&parent->children, struct child, list);
+ *	if (!one)
+ *		printf("Empty list!\n");
+ */
+#define list_pop(h, type, member)					\
+	((type *)list_pop_((h), list_off_(type, member)))
+
+static inline const void *list_pop_(const struct list_head *h, size_t off)
+{
+	struct list_node *n;
+
+	if (list_empty(h))
+		return NULL;
+	n = h->n.next;
+	list_del(n);
+	return (const char *)n - off;
+}
+
+/**
+ * list_tail - get the last entry in a list
+ * @h: the list_head
+ * @type: the type of the entry
+ * @member: the list_node member of the type
+ *
+ * If the list is empty, returns NULL.
+ *
+ * Example:
+ *	struct child *last;
+ *	last = list_tail(&parent->children, struct child, list);
+ *	if (!last)
+ *		printf("Empty list!\n");
+ */
+#define list_tail(h, type, member) \
+	((type *)list_tail_((h), list_off_(type, member)))
+
+static inline const void *list_tail_(const struct list_head *h, size_t off)
+{
+	if (list_empty(h))
+		return NULL;
+	return (const char *)h->n.prev - off;
+}
+
+/**
+ * list_for_each - iterate through a list.
+ * @h: the list_head (warning: evaluated multiple times!)
+ * @i: the structure containing the list_node
+ * @member: the list_node member of the structure
+ *
+ * This is a convenient wrapper to iterate @i over the entire list.  It's
+ * a for loop, so you can break and continue as normal.
+ *
+ * Example:
+ *	list_for_each(&parent->children, child, list)
+ *		printf("Name: %s\n", child->name);
+ */
+#define list_for_each(h, i, member)					\
+	list_for_each_off(h, i, list_off_var_(i, member))
+
+/**
+ * list_for_each_rev - iterate through a list backwards.
+ * @h: the list_head
+ * @i: the structure containing the list_node
+ * @member: the list_node member of the structure
+ *
+ * This is a convenient wrapper to iterate @i over the entire list.  It's
+ * a for loop, so you can break and continue as normal.
+ *
+ * Example:
+ *	list_for_each_rev(&parent->children, child, list)
+ *		printf("Name: %s\n", child->name);
+ */
+#define list_for_each_rev(h, i, member)					\
+	for (i = container_of_var(list_debug(h)->n.prev, i, member);	\
+	     &i->member != &(h)->n;					\
+	     i = container_of_var(i->member.prev, i, member))
+
+/**
+ * list_for_each_safe - iterate through a list, maybe during deletion
+ * @h: the list_head
+ * @i: the structure containing the list_node
+ * @nxt: the structure containing the list_node
+ * @member: the list_node member of the structure
+ *
+ * This is a convenient wrapper to iterate @i over the entire list.  It's
+ * a for loop, so you can break and continue as normal.  The extra variable
+ * @nxt is used to hold the next element, so you can delete @i from the list.
+ *
+ * Example:
+ *	struct child *next;
+ *	list_for_each_safe(&parent->children, child, next, list) {
+ *		list_del(&child->list);
+ *		parent->num_children--;
+ *	}
+ */
+#define list_for_each_safe(h, i, nxt, member)				\
+	list_for_each_safe_off(h, i, nxt, list_off_var_(i, member))
+
+/**
+ * list_append_list - empty one list onto the end of another.
+ * @to: the list to append into
+ * @from: the list to empty.
+ *
+ * This takes the entire contents of @from and moves it to the end of
+ * @to.  After this @from will be empty.
+ *
+ * Example:
+ *	struct list_head adopter;
+ *
+ *	list_append_list(&adopter, &parent->children);
+ *	assert(list_empty(&parent->children));
+ *	parent->num_children = 0;
+ */
+static inline void list_append_list(struct list_head *to,
+				    struct list_head *from)
+{
+	struct list_node *from_tail = list_debug(from)->n.prev;
+	struct list_node *to_tail = list_debug(to)->n.prev;
+
+	/* Sew in head and entire list. */
+	to->n.prev = from_tail;
+	from_tail->next = &to->n;
+	to_tail->next = &from->n;
+	from->n.prev = to_tail;
+
+	/* Now remove head. */
+	list_del(&from->n);
+	list_head_init(from);
+}
+
+/**
+ * list_prepend_list - empty one list into the start of another.
+ * @to: the list to prepend into
+ * @from: the list to empty.
+ *
+ * This takes the entire contents of @from and moves it to the start
+ * of @to.  After this @from will be empty.
+ *
+ * Example:
+ *	list_prepend_list(&adopter, &parent->children);
+ *	assert(list_empty(&parent->children));
+ *	parent->num_children = 0;
+ */
+static inline void list_prepend_list(struct list_head *to,
+				     struct list_head *from)
+{
+	struct list_node *from_tail = list_debug(from)->n.prev;
+	struct list_node *to_head = list_debug(to)->n.next;
+
+	/* Sew in head and entire list. */
+	to->n.next = &from->n;
+	from->n.prev = &to->n;
+	to_head->prev = from_tail;
+	from_tail->next = to_head;
+
+	/* Now remove head. */
+	list_del(&from->n);
+	list_head_init(from);
+}
+
+/**
+ * list_for_each_off - iterate through a list of memory regions.
+ * @h: the list_head
+ * @i: the pointer to a memory region wich contains list node data.
+ * @off: offset(relative to @i) at which list node data resides.
+ *
+ * This is a low-level wrapper to iterate @i over the entire list, used to
+ * implement all oher, more high-level, for-each constructs. It's a for loop,
+ * so you can break and continue as normal.
+ *
+ * WARNING! Being the low-level macro that it is, this wrapper doesn't know
+ * nor care about the type of @i. The only assumtion made is that @i points
+ * to a chunk of memory that at some @offset, relative to @i, contains a
+ * properly filled `struct node_list' which in turn contains pointers to
+ * memory chunks and it's turtles all the way down. Whith all that in mind
+ * remember that given the wrong pointer/offset couple this macro will
+ * happilly churn all you memory untill SEGFAULT stops it, in other words
+ * caveat emptor.
+ *
+ * It is worth mentioning that one of legitimate use-cases for that wrapper
+ * is operation on opaque types with known offset for `struct list_node'
+ * member(preferably 0), because it allows you not to disclose the type of
+ * @i.
+ *
+ * Example:
+ *	list_for_each_off(&parent->children, child,
+ *				offsetof(struct child, list))
+ *		printf("Name: %s\n", child->name);
+ */
+#define list_for_each_off(h, i, off)                                    \
+  for (i = list_node_to_off_(list_debug(h)->n.next, (off));             \
+       list_node_from_off_((void *)i, (off)) != &(h)->n;                \
+       i = list_node_to_off_(list_node_from_off_((void *)i, (off))->next, \
+                             (off)))
+
+/**
+ * list_for_each_safe_off - iterate through a list of memory regions, maybe
+ * during deletion
+ * @h: the list_head
+ * @i: the pointer to a memory region wich contains list node data.
+ * @nxt: the structure containing the list_node
+ * @off: offset(relative to @i) at which list node data resides.
+ *
+ * For details see `list_for_each_off' and `list_for_each_safe'
+ * descriptions.
+ *
+ * Example:
+ *	list_for_each_safe_off(&parent->children, child,
+ *		next, offsetof(struct child, list))
+ *		printf("Name: %s\n", child->name);
+ */
+#define list_for_each_safe_off(h, i, nxt, off)                          \
+  for (i = list_node_to_off_(list_debug(h)->n.next, (off)),             \
+         nxt = list_node_to_off_(list_node_from_off_(i, (off))->next,   \
+                                 (off));                                \
+       list_node_from_off_(i, (off)) != &(h)->n;                        \
+       i = nxt,                                                         \
+         nxt = list_node_to_off_(list_node_from_off_(i, (off))->next,   \
+                                 (off)))
+
+
+/* Other -off variants. */
+#define list_entry_off(n, type, off)		\
+	((type *)list_node_from_off_((n), (off)))
+
+#define list_head_off(h, type, off)		\
+	((type *)list_head_off((h), (off)))
+
+#define list_tail_off(h, type, off)		\
+	((type *)list_tail_((h), (off)))
+
+#define list_add_off(h, n, off)                 \
+	list_add((h), list_node_from_off_((n), (off)))
+
+#define list_del_off(n, off)                    \
+	list_del(list_node_from_off_((n), (off)))
+
+#define list_del_from_off(h, n, off)			\
+	list_del_from(h, list_node_from_off_((n), (off)))
+
+/* Offset helper functions so we only single-evaluate. */
+static inline void *list_node_to_off_(struct list_node *node, size_t off)
+{
+	return (void *)((char *)node - off);
+}
+static inline struct list_node *list_node_from_off_(void *ptr, size_t off)
+{
+	return (struct list_node *)((char *)ptr + off);
+}
+
+/* Get the offset of the member, but make sure it's a list_node. */
+#define list_off_(type, member)					\
+	(container_off(type, member) +				\
+	 check_type(((type *)0)->member, struct list_node))
+
+#define list_off_var_(var, member)			\
+	(container_off_var(var, member) +		\
+	 check_type(var->member, struct list_node))
+
+#endif /* CCAN_LIST_H */
diff --git a/hkl/ccan/noerr/noerr.c b/hkl/ccan/noerr/noerr.c
new file mode 100644
index 0000000..4368a5e
--- /dev/null
+++ b/hkl/ccan/noerr/noerr.c
@@ -0,0 +1,43 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#include "noerr.h"
+#include <unistd.h>
+#include <errno.h>
+
+int close_noerr(int fd)
+{
+	int saved_errno = errno, ret;
+
+	if (close(fd) != 0)
+		ret = errno;
+	else
+		ret = 0;
+
+	errno = saved_errno;
+	return ret;
+}
+
+int fclose_noerr(FILE *fp)
+{
+	int saved_errno = errno, ret;
+
+	if (fclose(fp) != 0)
+		ret = errno;
+	else
+		ret = 0;
+
+	errno = saved_errno;
+	return ret;
+}
+
+int unlink_noerr(const char *pathname)
+{
+	int saved_errno = errno, ret;
+
+	if (unlink(pathname) != 0)
+		ret = errno;
+	else
+		ret = 0;
+
+	errno = saved_errno;
+	return ret;
+}
diff --git a/hkl/ccan/noerr/noerr.h b/hkl/ccan/noerr/noerr.h
new file mode 100644
index 0000000..99b0f69
--- /dev/null
+++ b/hkl/ccan/noerr/noerr.h
@@ -0,0 +1,33 @@
+/* CC0 (Public domain) - see LICENSE file for details */
+#ifndef NOERR_H
+#define NOERR_H
+#include <stdio.h>
+
+/**
+ * close_noerr - close without stomping errno.
+ * @fd: the file descriptor to close.
+ *
+ * errno is saved and restored across the call to close: if an error occurs,
+ * the resulting (non-zero) errno is returned.
+ */
+int close_noerr(int fd);
+
+/**
+ * fclose_noerr - close without stomping errno.
+ * @fp: the FILE pointer.
+ *
+ * errno is saved and restored across the call to fclose: if an error occurs,
+ * the resulting (non-zero) errno is returned.
+ */
+int fclose_noerr(FILE *fp);
+
+/**
+ * unlink_noerr - unlink a file without stomping errno.
+ * @pathname: the path to unlink.
+ *
+ * errno is saved and restored across the call to unlink: if an error occurs,
+ * the resulting (non-zero) errno is returned.
+ */
+int unlink_noerr(const char *pathname);
+
+#endif /* NOERR_H */
diff --git a/hkl/ccan/ptr_valid/ptr_valid.c b/hkl/ccan/ptr_valid/ptr_valid.c
new file mode 100644
index 0000000..98c7dd7
--- /dev/null
+++ b/hkl/ccan/ptr_valid/ptr_valid.c
@@ -0,0 +1,339 @@
+// Licensed under BSD-MIT: See LICENSE.
+#include "ptr_valid.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <hkl/ccan/noerr/noerr.h>
+#include <unistd.h>
+#include <errno.h>
+#include <assert.h>
+#include <string.h>
+
+#if HAVE_PROC_SELF_MAPS
+static char *grab(const char *filename)
+{
+	int ret, fd;
+	size_t max = 16384, s = 0;
+	char *buffer;
+
+	fd = open(filename, O_RDONLY);
+	if (fd < 0)
+		return NULL;
+
+	buffer = malloc(max+1);
+	if (!buffer)
+		goto close;
+
+	while ((ret = read(fd, buffer + s, max - s)) > 0) {
+		s += ret;
+		if (s == max) {
+			buffer = realloc(buffer, max*2+1);
+			if (!buffer)
+				goto close;
+			max *= 2;
+		}
+	}
+	if (ret < 0)
+		goto free;
+
+	close(fd);
+	buffer[s] = '\0';
+	return buffer;
+
+free:
+	free(buffer);
+close:
+	close_noerr(fd);
+	return NULL;
+}
+
+static char *skip_line(char *p)
+{
+	char *nl = strchr(p, '\n');
+	if (!nl)
+		return NULL;
+	return nl + 1;
+}
+
+static struct ptr_valid_map *add_map(struct ptr_valid_map *map,
+				     unsigned int *num,
+				     unsigned int *max,
+				     unsigned long start, unsigned long end, bool is_write)
+{
+	if (*num == *max) {
+		*max *= 2;
+		map = realloc(map, sizeof(*map) * *max);
+		if (!map)
+			return NULL;
+	}
+	map[*num].start = (void *)start;
+	map[*num].end = (void *)end;
+	map[*num].is_write = is_write;
+	(*num)++;
+	return map;
+}
+
+static struct ptr_valid_map *get_proc_maps(unsigned int *num)
+{
+	char *buf, *p;
+	struct ptr_valid_map *map;
+	unsigned int max = 16;
+
+	buf = grab("/proc/self/maps");
+	if (!buf) {
+		*num = 0;
+		return NULL;
+	}
+
+	map = malloc(sizeof(*map) * max);
+	if (!map)
+		goto free_buf;
+
+	*num = 0;
+	for (p = buf; p && *p; p = skip_line(p)) {
+		unsigned long start, end;
+		char *endp;
+
+		/* Expect '<start-in-hex>-<end-in-hex> rw... */
+		start = strtoul(p, &endp, 16);
+		if (*endp != '-')
+			goto malformed;
+		end = strtoul(endp+1, &endp, 16);
+		if (*endp != ' ')
+			goto malformed;
+
+		endp++;
+		if (endp[0] != 'r' && endp[0] != '-')
+			goto malformed;
+		if (endp[1] != 'w' && endp[1] != '-')
+			goto malformed;
+
+		/* We only add readable mappings. */
+		if (endp[0] == 'r') {
+			map = add_map(map, num, &max, start, end,
+				      endp[1] == 'w');
+			if (!map)
+				goto free_buf;
+		}
+	}
+
+	free(buf);
+	return map;
+
+
+malformed:
+	free(map);
+free_buf:
+	free(buf);
+	*num = 0;
+	return NULL;
+}
+#else
+static struct ptr_valid_map *get_proc_maps(unsigned int *num)
+{
+	*num = 0;
+	return NULL;
+}
+#endif
+
+static bool check_with_maps(struct ptr_valid_batch *batch,
+			    const char *p, size_t size, bool is_write)
+{
+	unsigned int i;
+
+	for (i = 0; i < batch->num_maps; i++) {
+		if (p >= batch->maps[i].start && p < batch->maps[i].end) {
+			/* Overlap into other maps?  Recurse with remainder. */
+			if (p + size > batch->maps[i].end) {
+				size_t len = p + size - batch->maps[i].end;
+				if (!check_with_maps(batch, batch->maps[i].end,
+						     len, is_write))
+					return false;
+			}
+			return !is_write || batch->maps[i].is_write;
+		}
+	}
+	return false;
+}
+
+static void finish_child(struct ptr_valid_batch *batch)
+{
+	close(batch->to_child);
+	close(batch->from_child);
+	waitpid(batch->child_pid, NULL, 0);
+	batch->child_pid = 0;
+}
+
+static bool child_alive(struct ptr_valid_batch *batch)
+{
+	return batch->child_pid != 0;
+}
+
+static void run_child(int infd, int outfd)
+{
+	volatile char *p;
+
+	/* This is how we expect to exit. */
+	while (read(infd, &p, sizeof(p)) == sizeof(p)) {
+		size_t i, size;
+		bool is_write;
+		char ret = 0;
+
+		/* This is weird. */
+		if (read(infd, &size, sizeof(size)) != sizeof(size))
+			exit(1);
+		if (read(infd, &is_write, sizeof(is_write)) != sizeof(is_write))
+			exit(2);
+
+		for (i = 0; i < size; i++) {
+			ret = p[i];
+			if (is_write)
+				p[i] = ret;
+		}
+
+		/* If we're still here, the answer is "yes". */
+		if (write(outfd, &ret, 1) != 1)
+			exit(3);
+	}
+	exit(0);
+}
+
+static bool create_child(struct ptr_valid_batch *batch)
+{
+	int outpipe[2], inpipe[2];
+
+	if (pipe(outpipe) != 0)
+		return false;
+	if (pipe(inpipe) != 0)
+		goto close_outpipe;
+
+	fflush(stdout);
+	batch->child_pid = fork();
+	if (batch->child_pid == 0) {
+		close(outpipe[1]);
+		close(inpipe[0]);
+		run_child(outpipe[0], inpipe[1]);
+	}
+
+	if (batch->child_pid == -1)
+		goto cleanup_pid;
+
+	close(outpipe[0]);
+	close(inpipe[1]);
+
+	batch->to_child = outpipe[1];
+	batch->from_child = inpipe[0];
+	return true;
+
+cleanup_pid:
+	batch->child_pid = 0;
+	close_noerr(inpipe[0]);
+	close_noerr(inpipe[1]);
+close_outpipe:
+	close_noerr(outpipe[0]);
+	close_noerr(outpipe[1]);
+	return false;
+}
+
+static bool check_with_child(struct ptr_valid_batch *batch,
+			     const void *p, size_t size, bool is_write)
+{
+	char ret;
+
+	if (!child_alive(batch)) {
+		if (!create_child(batch))
+			return false;
+	}
+
+	write(batch->to_child, &p, sizeof(p));
+	write(batch->to_child, &size, sizeof(size));
+	write(batch->to_child, &is_write, sizeof(is_write));
+
+	if (read(batch->from_child, &ret, sizeof(ret)) != sizeof(ret)) {
+		finish_child(batch);
+		errno = EFAULT;
+		return false;
+	}
+	return true;
+}
+
+/* msync seems most well-defined test, but page could be mapped with
+ * no permissions, and can't distiguish readonly from writable. */
+bool ptr_valid_batch(struct ptr_valid_batch *batch,
+		     const void *p, size_t alignment, size_t size, bool write)
+{
+	char *start, *end;
+	bool ret;
+
+	if ((intptr_t)p & (alignment - 1))
+		return false;
+
+	start = (void *)((intptr_t)p & ~(getpagesize() - 1));
+	end = (void *)(((intptr_t)p + size - 1) & ~(getpagesize() - 1));
+
+	/* We cache single page hits. */
+	if (start == end) {
+		if (batch->last && batch->last == start)
+			return batch->last_ok;
+	}
+
+	if (batch->num_maps)
+		ret = check_with_maps(batch, p, size, write);
+	else
+		ret = check_with_child(batch, p, size, write);
+
+	if (start == end) {
+		batch->last = start;
+		batch->last_ok = ret;
+	}
+
+	return ret;
+}
+
+bool ptr_valid_batch_string(struct ptr_valid_batch *batch, const char *p)
+{
+	while (ptr_valid_batch(batch, p, 1, 1, false)) {
+		if (*p == '\0')
+			return true;
+		p++;
+	}
+	return false;
+}
+
+bool ptr_valid(const void *p, size_t alignment, size_t size, bool write)
+{
+	bool ret;
+	struct ptr_valid_batch batch;
+	if (!ptr_valid_batch_start(&batch))
+		return false;
+	ret = ptr_valid_batch(&batch, p, alignment, size, write);
+	ptr_valid_batch_end(&batch);
+	return ret;
+}
+
+bool ptr_valid_string(const char *p)
+{
+	bool ret;
+	struct ptr_valid_batch batch;
+	if (!ptr_valid_batch_start(&batch))
+		return false;
+	ret = ptr_valid_batch_string(&batch, p);
+	ptr_valid_batch_end(&batch);
+	return ret;
+}
+
+bool ptr_valid_batch_start(struct ptr_valid_batch *batch)
+{
+	batch->child_pid = 0;
+	batch->maps = get_proc_maps(&batch->num_maps);
+	batch->last = NULL;
+	return true;
+}
+
+void ptr_valid_batch_end(struct ptr_valid_batch *batch)
+{
+	if (child_alive(batch))
+		finish_child(batch);
+	free(batch->maps);
+}
diff --git a/hkl/ccan/ptr_valid/ptr_valid.h b/hkl/ccan/ptr_valid/ptr_valid.h
new file mode 100644
index 0000000..3871cad
--- /dev/null
+++ b/hkl/ccan/ptr_valid/ptr_valid.h
@@ -0,0 +1,229 @@
+// Licensed under BSD-MIT: See LICENSE.
+#ifndef CCAN_PTR_VALID_H
+#define CCAN_PTR_VALID_H
+#include "config.h"
+#include <stdbool.h>
+#include <stdlib.h>
+
+/**
+ * ptr_valid_read - can I safely read from a pointer?
+ * @p: the proposed pointer.
+ *
+ * This function verifies that the pointer @p is safe to dereference for
+ * reading.  It is very slow, particularly if the answer is "no".
+ *
+ * Sets errno to EFAULT on failure.
+ *
+ * See Also:
+ *	ptr_valid_batch_read()
+ */
+#define ptr_valid_read(p)						\
+	ptr_valid_r((p), PTR_VALID_ALIGNOF(*(p)), sizeof(*(p)))
+
+/**
+ * ptr_valid_write - can I safely write to a pointer?
+ * @p: the proposed pointer.
+ *
+ * This function verifies that the pointer @p is safe to dereference
+ * for writing (and reading).  It is very slow, particularly if the
+ * answer is "no".
+ *
+ * Sets errno to EFAULT on failure.
+ *
+ * See Also:
+ *	ptr_valid_batch_write()
+ */
+#define ptr_valid_write(p)						\
+	ptr_valid_w((p), PTR_VALID_ALIGNOF(*(p)), sizeof(*(p)))
+
+/**
+ * ptr_valid_string - can I safely read a string?
+ * @p: the proposed string.
+ *
+ * This function verifies that the pointer @p is safe to dereference
+ * up to a nul character.  It is very slow, particularly if the answer
+ * is "no".
+ *
+ * Sets errno to EFAULT on failure.
+ *
+ * See Also:
+ *	ptr_valid_batch_string()
+ */
+bool ptr_valid_string(const char *p);
+
+/**
+ * ptr_valid - generic pointer check function
+ * @p: the proposed pointer.
+ * @align: the alignment requirements of the pointer.
+ * @size: the size of the region @p should point to
+ * @write: true if @p should be writable as well as readable.
+ *
+ * This function verifies that the pointer @p is safe to dereference.
+ * It is very slow, particularly if the answer is "no".
+ *
+ * Sets errno to EFAULT on failure.
+ *
+ * See Also:
+ *	ptr_valid_batch()
+ */
+bool ptr_valid(const void *p, size_t align, size_t size, bool write);
+
+/**
+ * struct ptr_valid_batch - pointer to store state for batch ptr ops
+ *
+ * Treat as private.
+ */
+struct ptr_valid_batch {
+	unsigned int num_maps;
+	struct ptr_valid_map *maps;
+	int child_pid;
+	int to_child, from_child;
+	void *last;
+	bool last_ok;
+};
+
+/**
+ * ptr_valid_batch_start - prepare for a batch of ptr_valid checks.
+ * @batch: an uninitialized ptr_valid_batch structure.
+ *
+ * This initializes @batch; this same @batch pointer can be reused
+ * until the memory map changes (eg. via mmap(), munmap() or even
+ * malloc() and free()).
+ *
+ * This is useful to check many pointers, because otherwise it can be
+ * extremely slow.
+ *
+ * Example:
+ * struct linked {
+ *	struct linked *next;
+ *	const char *str;
+ * };
+ *
+ * static bool check_linked_carefully(struct linked *head)
+ * {
+ *	struct ptr_valid_batch batch;
+ *	struct linked *old = head;
+ *	bool half = true;
+ *
+ *	// If this fails, we can't check.  Assume OK.
+ *	if (!ptr_valid_batch_start(&batch))
+ *		return true;
+ *
+ *	while (head) {
+ *		if (!ptr_valid_batch_read(&batch, head))
+ *			goto fail;
+ *		if (!ptr_valid_batch_string(&batch, head->str))
+ *			goto fail;
+ *		// Loop detection; move old at half speed of head.
+ *		if (half)
+ *			old = old->next;
+ *		half = !half;
+ *		if (head == old) {
+ *			errno = ELOOP;
+ *			goto fail;
+ *		}
+ *	}
+ *	ptr_valid_batch_end(&batch);
+ *	return true;
+ *
+ * fail:
+ *	ptr_valid_batch_end(&batch);
+ *	return false;
+ * }
+ *
+ * See Also:
+ *	ptr_valid_batch_stop()
+ */
+bool ptr_valid_batch_start(struct ptr_valid_batch *batch);
+
+/**
+ * ptr_valid_batch_read - can I safely read from a pointer?
+ * @batch: the batch initialized by ptr_valid_batch_start().
+ * @p: the proposed pointer.
+ *
+ * Batched version of ptr_valid_read().
+ */
+#define ptr_valid_batch_read(batch, p)					\
+	ptr_valid_batch_r((batch),					\
+			  (p), PTR_VALID_ALIGNOF(*(p)), sizeof(*(p)))
+
+/**
+ * ptr_valid_batch_write - can I safely write to a pointer?
+ * @batch: the batch initialized by ptr_valid_batch_start().
+ * @p: the proposed pointer.
+ *
+ * Batched version of ptr_valid_write().
+ */
+#define ptr_valid_batch_write(batch, p)					\
+	ptr_valid_batch_w((batch),					\
+			  (p), PTR_VALID_ALIGNOF(*(p)), sizeof(*(p)))
+
+/**
+ * ptr_valid_batch_string - can I safely read a string?
+ * @batch: the batch initialized by ptr_valid_batch_start().
+ * @p: the proposed string.
+ *
+ * Batched version of ptr_valid_string().
+ */
+bool ptr_valid_batch_string(struct ptr_valid_batch *batch, const char *p);
+
+/**
+ * ptr_valid_batch - generic batched pointer check function
+ * @batch: the batch initialized by ptr_valid_batch_start().
+ * @p: the proposed pointer.
+ * @align: the alignment requirements of the pointer.
+ * @size: the size of the region @p should point to
+ * @write: true if @p should be writable as well as readable.
+ *
+ * Batched version of ptr_valid().
+ */
+bool ptr_valid_batch(struct ptr_valid_batch *batch,
+		     const void *p, size_t alignment, size_t size, bool write);
+
+/**
+ * ptr_valid_batch_end - end a batch of ptr_valid checks.
+ * @batch: a ptr_valid_batch structure.
+ *
+ * This is used after all checks are complete.
+ *
+ * See Also:
+ *	ptr_valid_batch_start()
+ */
+void ptr_valid_batch_end(struct ptr_valid_batch *batch);
+
+
+/* These wrappers get constness correct. */
+static inline bool ptr_valid_r(const void *p, size_t align, size_t size)
+{
+	return ptr_valid(p, align, size, false);
+}
+
+static inline bool ptr_valid_w(void *p, size_t align, size_t size)
+{
+	return ptr_valid(p, align, size, true);
+}
+
+static inline bool ptr_valid_batch_r(struct ptr_valid_batch *batch,
+				     const void *p, size_t align, size_t size)
+{
+	return ptr_valid_batch(batch, p, align, size, false);
+}
+
+static inline bool ptr_valid_batch_w(struct ptr_valid_batch *batch,
+				     void *p, size_t align, size_t size)
+{
+	return ptr_valid_batch(batch, p, align, size, true);
+}
+
+struct ptr_valid_map {
+	const char *start, *end;
+	bool is_write;
+};
+
+#if HAVE_ALIGNOF
+#define PTR_VALID_ALIGNOF(var) __alignof__(var)
+#else
+/* Can't check this... */
+#define PTR_VALID_ALIGNOF(var) 1
+#endif
+#endif /* CCAN_PTR_VALID_H */
diff --git a/hkl/hkl-detector-factory.h b/hkl/hkl-axis-private.h
similarity index 66%
copy from hkl/hkl-detector-factory.h
copy to hkl/hkl-axis-private.h
index d3b38a3..8cb8413 100644
--- a/hkl/hkl-detector-factory.h
+++ b/hkl/hkl-axis-private.h
@@ -13,29 +13,32 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_DETECTOR_FACTORY_H__
-#define __HKL_DETECTOR_FACTORY_H__
+#ifndef __HKL_AXIS_PRIVATE_H__
+#define __HKL_AXIS_PRIVATE_H__
 
-#include <hkl/hkl-detector.h>
+#include "hkl.h"
+#include "hkl-vector-private.h"
+#include "hkl-quaternion-private.h"
+#include "hkl-parameter-private.h"
 
 HKL_BEGIN_DECLS
 
-enum _HklDetectorType
-{
-	HKL_DETECTOR_TYPE_0D
-};
-
-typedef enum _HklDetectorType HklDetectorType;
+typedef struct _HklAxis HklAxis;
 
+struct _HklAxis {
+	HklParameter parameter;
+	HklVector axis_v;
+	HklQuaternion q;
+};
 
-extern HklDetector *hkl_detector_factory_new(HklDetectorType type);
+extern HklParameter *hkl_parameter_new_axis(char const *name, HklVector const *axis_v);
 
 HKL_END_DECLS
 
-#endif /* __HKL_DETECTOR_FACTORY_H__ */
+#endif /* __HKL_AXIS_PRIVATE_H__ */
diff --git a/hkl/hkl-axis.c b/hkl/hkl-axis.c
index 7cadbcf..52382cd 100644
--- a/hkl/hkl-axis.c
+++ b/hkl/hkl-axis.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,136 +25,133 @@
 #include <gsl/gsl_math.h>
 #include <gsl/gsl_sf_trig.h>
 
-#include <hkl/hkl-axis.h>
-#include <hkl/hkl-quaternion.h>
+#include "hkl/ccan/container_of/container_of.h"
+#include "hkl-axis-private.h"
+#include "hkl-parameter-private.h"
 
 /***********/
 /* HklAxis */
 /***********/
-static void hkl_axis_update(HklAxis *self)
-{
-	hkl_quaternion_init_from_angle_and_axe(&self->q,
-					       ((HklParameter *)self)->value, &self->axis_v);
-}
 
-/*
- * given a current position of angle a min and max interval find the closest
- * equivalent angle + n delta_angle in a given direction.
- * CAUSION angle MUST be in [min, max] otherwise...
- */
-static void find_angle(double current, double *angle, double *distance,
-		       double min, double max, double delta_angle)
+static inline HklParameter *hkl_axis_copy_real(const HklParameter *base)
 {
-	double new_angle = *angle;
-	double new_distance;
+	HklAxis *self = container_of(base, HklAxis, parameter);
+	HklAxis *dup;
 
-	while(new_angle >= min && new_angle <= max) {
-		new_distance = fabs(new_angle - current);
-		if (new_distance <= *distance) {
-			*angle = new_angle;
-			*distance = new_distance;
-		}
-		new_angle += delta_angle;
-	}
+	dup = HKL_MALLOC(HklAxis);
+
+	*dup = *self;
+
+	return &dup->parameter;
 }
 
 
-/*
- * check if the angle or its equivalent is in between [min, max]
- */
-int hkl_axis_is_value_compatible_with_range(HklAxis const *self)
+static inline void hkl_axis_free_real(HklParameter *self)
 {
-	double value;
-	int res = HKL_FALSE;
-	HklInterval range;
+	free(container_of(self, HklAxis, parameter));
+}
 
-	value = ((HklParameter *)self)->value;
-	range = ((HklParameter *)self)->range;
+static inline void hkl_axis_update(HklAxis *self)
+{
+	hkl_quaternion_init_from_angle_and_axe(&self->q,
+					       self->parameter._value,
+					       &self->axis_v);
+}
 
-	if(hkl_interval_length(&range) > 2*M_PI)
-		res = HKL_TRUE;
-	else{
-		hkl_interval_angle_restrict_symm(&range);
-		value = gsl_sf_angle_restrict_symm(value);
+static inline void hkl_axis_init_copy_real(HklParameter *self, const HklParameter *src)
+{
+	HklAxis *axis_self = container_of(self, HklAxis, parameter);
+	HklAxis *axis_src = container_of(src, HklAxis, parameter);
 
-		if(range.min <= range.max){
-			if(range.min <= value && range.max >= value)
-				res = HKL_TRUE;
-		}else{
-			if(value <= range.max || value >= range.min)
-				res = HKL_TRUE;
-		}
-	}
-	return res;
+	*axis_self = *axis_src;
+	self->changed = HKL_TRUE;
 }
 
-HklAxis *hkl_axis_new(char const *name, HklVector const *axis_v)
+static inline unsigned int hkl_axis_set_value_real(
+	HklParameter *self, double value,
+	HklError **error)
 {
-	HklAxis *self = NULL;
+	HklAxis *axis = container_of(self, HklAxis, parameter);
 
-	self = HKL_MALLOC(HklAxis);
+	if(!hkl_parameter_value_set_real(self, value, error))
+		return HKL_FALSE;
 
-	hkl_axis_init(self, name, axis_v);
+	hkl_axis_update(axis);
 
-	return self;
+	return HKL_TRUE;
 }
 
-void hkl_axis_free(HklAxis *self)
+static inline unsigned int hkl_axis_set_value_unit_real(
+	HklParameter *self, double value,
+	HklError **error)
 {
-	if(self)
-		free(self);
-}
+	HklAxis *axis = container_of(self, HklAxis, parameter);
 
-void hkl_axis_init(HklAxis *self, char const * name, HklVector const *axis_v)
-{
-	static HklQuaternion q0 = {{1, 0, 0, 0}};
+	if(!hkl_parameter_value_unit_set_real(self, value, error))
+		return HKL_FALSE;
 
-	/* base initializer */
-	hkl_parameter_init((HklParameter *)self, name, -M_PI, 0, M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+	hkl_axis_update(axis);
 
-	self->axis_v = *axis_v;
-	self->q = q0;
+	return HKL_TRUE;
 }
 
-char const *hkl_axis_get_name(HklAxis const *self)
+static inline void hkl_axis_set_value_smallest_in_range_real(HklParameter *self)
 {
-	return ((HklParameter *)self)->name;
-}
+	double value, min;
 
-int hkl_axis_get_changed(HklAxis const *self)
-{
-	return ((HklParameter *)self)->changed;
-}
+	value = self->_value;
+	min = self->range.min;
 
-void hkl_axis_set_changed(HklAxis *self, int changed)
-{
-	((HklParameter *)self)->changed = changed;
+	if(value < min)
+		hkl_axis_set_value_real(self,
+					value + 2*M_PI*ceil((min - value)/(2*M_PI)),
+					NULL);
+	else
+		hkl_axis_set_value_real(self,
+					value - 2*M_PI*floor((value - min)/(2*M_PI)),
+					NULL);
 }
 
-double hkl_axis_get_value(HklAxis const *self)
+static inline void hkl_axis_randomize_real(HklParameter *self)
 {
-	return ((HklParameter *)self)->value;
+	hkl_parameter_randomize_real(self);
+	hkl_axis_update(container_of(self, HklAxis, parameter));
 }
 
-double hkl_axis_get_value_unit(HklAxis const *self)
+/*
+ * given a current position of angle a min and max interval find the closest
+ * equivalent angle + n delta_angle in a given direction.
+ * CAUSION angle MUST be in [min, max] otherwise...
+ */
+static void find_angle(double current, double *angle, double *distance,
+		       double min, double max, double delta_angle)
 {
-	return hkl_parameter_get_value_unit((HklParameter *)self);
+	double new_angle = *angle;
+	double new_distance;
+
+	while(new_angle >= min && new_angle <= max) {
+		new_distance = fabs(new_angle - current);
+		if (new_distance <= *distance) {
+			*angle = new_angle;
+			*distance = new_distance;
+		}
+		new_angle += delta_angle;
+	}
 }
 
-double hkl_axis_get_value_closest(HklAxis const *self, HklAxis const *axis)
+static inline double hkl_axis_get_value_closest_real(const HklParameter *self,
+						     const HklParameter *ref)
 {
-	double angle = ((HklParameter *)self)->value;
+	double angle = self->_value;
 
-	if(hkl_axis_is_value_compatible_with_range(self)){
-		if(hkl_interval_length(&((HklParameter *)self)->range) >= 2*M_PI){
+	if(hkl_parameter_is_valid(self)){
+		if(hkl_interval_length(&self->range) >= 2*M_PI){
 			int k;
-			double current = ((HklParameter *)axis)->value;
+			double current = ref->_value;
 			double distance = fabs(current - angle);
 			double delta = 2. * M_PI;
-			double min = ((HklParameter *)self)->range.min;
-			double max = ((HklParameter *)self)->range.max;
+			double min = self->range.min;
+			double max = self->range.max;
 
 			/* three cases */
 			if (angle > max) {
@@ -170,83 +167,78 @@ double hkl_axis_get_value_closest(HklAxis const *self, HklAxis const *axis)
 				find_angle(current, &angle, &distance, min, max, delta);
 			}
 		}
-		
+
 	}else
 		angle = GSL_NAN;
 	return angle;
 }
 
-double hkl_axis_get_value_closest_unit(HklAxis const *self, HklAxis const *axis)
-{
-	double factor = hkl_unit_factor(((HklParameter *)self)->unit, ((HklParameter *)self)->punit);
-	return factor * hkl_axis_get_value_closest(self, axis);
-}
-
-double hkl_axis_get_max(HklAxis const *self)
+/*
+ * check if the angle or its equivalent is in between [min, max]
+ */
+static inline int hkl_axis_is_valid_real(const HklParameter *self)
 {
-	return hkl_parameter_get_max((HklParameter *)self);
-}
+	double value = self->_value;
+	int res = HKL_FALSE;
+	HklInterval range = self->range;
 
-void hkl_axis_get_range_unit(HklAxis const *self, double *min, double *max)
-{
-	hkl_parameter_get_range_unit((HklParameter *)self, min, max);
-}
+	if(hkl_interval_length(&range) > 2*M_PI)
+		res = HKL_TRUE;
+	else{
+		hkl_interval_angle_restrict_symm(&range);
+		value = gsl_sf_angle_restrict_symm(value);
 
-void hkl_axis_set_value(HklAxis *self, double value)
-{
-	hkl_parameter_set_value((HklParameter *)self, value);
-	hkl_axis_update(self);
+		if(range.min <= range.max){
+			if(range.min <= value && range.max >= value)
+				res = HKL_TRUE;
+		}else{
+			if(value <= range.max || value >= range.min)
+				res = HKL_TRUE;
+		}
+	}
+	return res;
 }
 
-void hkl_axis_set_value_smallest_in_range(HklAxis *self)
+static inline void hkl_axis_fprintf_real(FILE *f, const HklParameter *self)
 {
-	double value, min;
-
-	value = ((HklParameter *)self)->value;
-	min = ((HklParameter *)self)->range.min;
-
-	if(value < min)
-		hkl_axis_set_value(self, value + 2*M_PI*ceil((min - value)/(2*M_PI)));
-	else
-		hkl_axis_set_value(self, value - 2*M_PI*floor((value - min)/(2*M_PI)));
-}
+	HklAxis *axis = container_of(self, HklAxis, parameter);
 
-void hkl_axis_set_value_unit(HklAxis *self, double value)
-{
-	hkl_parameter_set_value_unit((HklParameter *)self, value);
-	hkl_axis_update(self);
+	hkl_parameter_fprintf_real(f, self);
+	hkl_vector_fprintf(f, &axis->axis_v);
+	hkl_quaternion_fprintf(f, &axis->q);
 }
 
-void hkl_axis_set_range(HklAxis *self, double min, double max)
-{
-	hkl_parameter_set_range((HklParameter *)self, min, max);
-}
+static HklParameterOperations hkl_parameter_operations_axis = {
+	HKL_PARAMETER_OPERATIONS_DEFAULTS,
+	.copy = hkl_axis_copy_real,
+	.free = hkl_axis_free_real,
+	.init_copy = hkl_axis_init_copy_real,
+	.get_value_closest = hkl_axis_get_value_closest_real,
+	.set_value = hkl_axis_set_value_real,
+	.set_value_unit = hkl_axis_set_value_unit_real,
+	.set_value_smallest_in_range = hkl_axis_set_value_smallest_in_range_real,
+	.randomize = hkl_axis_randomize_real,
+	.is_valid = hkl_axis_is_valid_real,
+	.fprintf = hkl_axis_fprintf_real
+};
 
-void hkl_axis_set_range_unit(HklAxis *self, double min, double max)
+HklParameter *hkl_parameter_new_axis(char const *name, HklVector const *axis_v)
 {
-	hkl_parameter_set_range_unit((HklParameter *)self, min, max);
-}
+	HklAxis *self = NULL;
+	static HklAxis axis0 = {
+		.parameter = {
+			HKL_PARAMETER_DEFAULTS_ANGLE,
+			.ops = &hkl_parameter_operations_axis,
+		},
+		.q = {{1, 0, 0, 0}},
+	};
 
-void hkl_axis_randomize(HklAxis *self)
-{
-	hkl_parameter_randomize((HklParameter *)self);
-	hkl_axis_update(self);
-}
+	self = HKL_MALLOC(HklAxis);
 
-void hkl_axis_get_quaternion(HklAxis const *self, HklQuaternion *q)
-{
-	hkl_quaternion_init_from_angle_and_axe(q,
-					       ((HklParameter *)self)->value, &self->axis_v);
-}
 
-int hkl_axis_is_valid(const HklAxis *self)
-{
-	return hkl_parameter_is_valid((HklParameter *)self);
-}
+	*self = axis0;
+	self->parameter.name = name;
+	self->axis_v = *axis_v;
 
-void hkl_axis_fprintf(FILE *f, HklAxis *self)
-{
-	hkl_parameter_fprintf(f, (HklParameter *)self);
-	hkl_vector_fprintf(f, &self->axis_v);
-	hkl_quaternion_fprintf(f, &self->q);
+	return &self->parameter;
 }
diff --git a/hkl/hkl-axis.h b/hkl/hkl-axis.h
deleted file mode 100644
index 43dc127..0000000
--- a/hkl/hkl-axis.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_AXIS_H__
-#define __HKL_AXIS_H__
-
-#include <hkl/hkl-macros.h>
-#include <hkl/hkl-interval.h>
-#include <hkl/hkl-vector.h>
-#include <hkl/hkl-quaternion.h>
-#include <hkl/hkl-parameter.h>
-
-HKL_BEGIN_DECLS
-
-typedef struct _HklAxis HklAxis;
-
-struct _HklAxis {
-	HklParameter parent_instance;
-	HklVector axis_v;
-	HklQuaternion q;
-};
-
-/***********/
-/* HklAxis */
-/***********/
-
-extern HklAxis *hkl_axis_new(char const *name, HklVector const *axis_v);
-
-extern void hkl_axis_free(HklAxis *self);
-
-extern void hkl_axis_init(HklAxis *axis, char const * name, HklVector const *axis_v);
-
-extern char const *hkl_axis_get_name(HklAxis const *self);
-
-extern int hkl_axis_get_changed(HklAxis const *self);
-
-extern void hkl_axis_set_changed(HklAxis *self, int changed);
-
-extern double hkl_axis_get_value(HklAxis const *self);
-
-extern double hkl_axis_get_value_unit(HklAxis const *self);
-
-extern double hkl_axis_get_value_closest(HklAxis const *self, HklAxis const *axis);
-
-extern double hkl_axis_get_value_closest_unit(HklAxis const *self, HklAxis const *axis);
-
-extern double hkl_axis_get_max(HklAxis const *self);
-
-extern void hkl_axis_get_range_unit(HklAxis const *self, double *min, double *max);
-
-extern void hkl_axis_set_value(HklAxis *self, double value);
-
-extern void hkl_axis_set_value_smallest_in_range(HklAxis *self);
-
-extern void hkl_axis_set_value_unit(HklAxis *self, double value);
-
-extern void hkl_axis_set_range(HklAxis *self, double min, double max);
-
-extern void hkl_axis_set_range_unit(HklAxis *self, double min, double max);
-
-extern void hkl_axis_randomize(HklAxis *self);
-
-/** 
- * @brief get the quaternion of an axis.
- * 
- * @param axis 
- * @param q 
- *
- * inline to speed computation.
- */
-extern void hkl_axis_get_quaternion(HklAxis const *self, HklQuaternion *q);
-
-extern int hkl_axis_is_value_compatible_with_range(HklAxis const *self);
-
-extern int hkl_axis_is_valid(const HklAxis *self);
-
-extern void hkl_axis_fprintf(FILE *f, HklAxis *self);
-
-HKL_END_DECLS
-
-#endif /* __HKL_AXIS_H__ */
diff --git a/hkl/hkl-binding-private.h b/hkl/hkl-binding-private.h
new file mode 100644
index 0000000..f16d2ad
--- /dev/null
+++ b/hkl/hkl-binding-private.h
@@ -0,0 +1,98 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2012-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#ifndef __HKL_BINDING_PRIVATE_H__
+#define __HKL_BINDING_PRIVATE_H__
+
+#include <glib.h>
+
+#include "hkl.h"
+
+HKL_BEGIN_DECLS
+
+/**************/
+/* HklFactory */
+/**************/
+
+HKLAPI GHashTable *hkl_factories(void);
+
+/********************/
+/* HklParameterList */
+/********************/
+
+HKLAPI GSList* hkl_parameter_list_parameters(HklParameterList *self);
+
+HKLAPI gboolean hkl_parameter_list_values_unit_set_binding(HklParameterList *self,
+							   double *values, uint len,
+							   GError **error);
+/***************/
+/* HklGeometry */
+/***************/
+
+HKLAPI GSList* hkl_geometry_axes(HklGeometry *self);
+
+HKLAPI double* hkl_geometry_get_axes_values_unit(const HklGeometry *self, unsigned int *len);
+
+HKLAPI void hkl_geometry_set_axes_values_unit(HklGeometry *self, double *values, unsigned int len);
+
+/*******************/
+/* HklGeometryList */
+/*******************/
+
+HKLAPI GSList* hkl_geometry_list_items(HklGeometryList *self);
+
+/***********************/
+/* HklGeometryListItem */
+/***********************/
+
+HKLAPI const HklGeometry *hkl_geometry_list_item_geometry(const HklGeometryListItem *self);
+
+/***********************/
+/* HklEngine */
+/***********************/
+
+HKLAPI GSList* hkl_engine_modes_as_gslist(HklEngine *self);
+
+HKLAPI gboolean hkl_engine_set_values_unit(
+	HklEngine *self,
+	double values[], unsigned int len,
+	GError **error);
+
+/***************************/
+/* HklPSeudoAxisEngineList */
+/***************************/
+
+HKLAPI GSList* hkl_engine_list_engines_as_gslist(HklEngineList *self);
+
+/*************/
+/* HklSample */
+/*************/
+
+HKLAPI const GSList *hkl_sample_reflections_get(const HklSample *self);
+
+HKLAPI HklSampleReflection *hkl_sample_add_reflection_binding(HklSample *self,
+							      const HklGeometry *geometry,
+							      const HklDetector *detector,
+							      double h, double k, double l);
+
+HKL_END_DECLS
+
+#endif /* __HKL_BINDING_PRIVATE_H__ */
diff --git a/hkl/hkl-binding.c b/hkl/hkl-binding.c
new file mode 100644
index 0000000..ae6ec15
--- /dev/null
+++ b/hkl/hkl-binding.c
@@ -0,0 +1,409 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2012-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#include <glib.h>
+#include <string.h>
+
+#include "hkl/ccan/array_size/array_size.h"
+#include "hkl-axis-private.h"
+#include "hkl-binding-private.h"
+#include "hkl-error-private.h"
+#include "hkl-factory-private.h"
+#include "hkl-pseudoaxis-private.h"
+#include "hkl-sample-private.h"
+
+
+/**************/
+/* HklFactory */
+/**************/
+
+/**
+ * hkl_factories:
+ *
+ * return all the Hkl factories objects as a dictionnary
+ *
+ * Returns: (element-type utf8 Hkl.Factory) (transfer container):
+ **/
+GHashTable *hkl_factories(void)
+{
+	GHashTable *table = NULL;
+	unsigned int i;
+	unsigned int n;
+	HklFactory **factories;
+
+	table = g_hash_table_new(g_str_hash, g_str_equal);
+	factories = autodata_get(factories, &n);
+	for(i=0; i<n; ++i){
+		g_hash_table_insert(table,
+				    hkl_factory_name(factories[i]),
+				    factories[i]);
+	}
+
+	return table;
+}
+
+/********************/
+/* HklParameterList */
+/********************/
+
+#define HKL_PARAMETER_LIST_ERROR hkl_parameter_list_error_quark ()
+
+GQuark hkl_parameter_list_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-parameter-list-error-quark");
+}
+
+typedef enum {
+	HKL_PARAMETER_LIST_ERROR_VALUES_SET /* can not set the parameter list values */
+} HklParameterListError;
+
+/**
+ * hkl_parameter_list_values_unit_set_binding:
+ * @self: the this ptr
+ * @values: (array length=len): the values to set
+ * @len: the length of the values
+ * @error: error set if something goes wrong
+ *
+ * set the parameter list with the given values
+ *
+ * Rename to: hkl_parameter_list_values_unit_set
+ *
+ * Return value: true if succeed or false otherwise
+ **/
+gboolean hkl_parameter_list_values_unit_set_binding(HklParameterList *self,
+						    double values[], uint len,
+						    GError **error)
+{
+	HklError *err = NULL;
+
+	g_return_val_if_fail(error == NULL ||*error == NULL, FALSE);
+
+	if(!hkl_parameter_list_values_unit_set(self,
+					       values, len, &err)){
+		g_assert(&err == NULL || err != NULL);
+
+		g_set_error(error,
+			    HKL_PARAMETER_LIST_ERROR,
+			    HKL_PARAMETER_LIST_ERROR_VALUES_SET,
+			    strdup(err->message));
+
+		hkl_error_clear(&err);
+
+		return FALSE;
+	}
+	return TRUE;
+}
+
+/**
+ * hkl_parameter_list_parameters:
+ * @self: the this ptr
+ *
+ * Return value: (element-type HklParameter) (transfer container): list of parameters
+ *               free the list with g_slist_free when done.
+ **/
+GSList* hkl_parameter_list_parameters(HklParameterList *self)
+{
+	GSList *list = NULL;
+	HklParameter **parameter;
+
+	darray_foreach(parameter, *self){
+		list = g_slist_append(list, *parameter);
+	}
+
+	return list;
+}
+
+/************/
+/* Geometry */
+/************/
+
+/**
+ * hkl_geometry_axes:
+ * @self: the this ptr
+ *
+ * Returns: (element-type HklParameter) (transfer container): list of HklParameter,
+ *          free the list with g_slist_free when done.
+ **/
+GSList *hkl_geometry_axes(HklGeometry *self)
+{
+	GSList *list = NULL;
+	HklParameter **axis;
+
+	darray_foreach(axis, self->axes){
+		list = g_slist_append(list, *axis);
+	}
+
+	return list;
+}
+
+
+/**
+ * hkl_geometry_get_axes_values_unit:
+ * @self: the this ptr
+ * @len: (out caller-allocates): the length of the returned array
+ *
+ * Return value: (array length=len) (transfer container): list of axes values,
+ *          free the list with free when done.
+ **/
+double *hkl_geometry_get_axes_values_unit(const HklGeometry *self, guint *len)
+{
+	double *values;
+	uint i = 0;
+	HklParameter **axis;
+
+	if(!self || !len || darray_size(self->axes) == 0)
+		return NULL;
+
+	*len = darray_size(self->axes);
+	values = malloc(darray_size(self->axes) * sizeof(*values));
+
+	darray_foreach(axis, self->axes){
+		values[i++] = hkl_parameter_value_unit_get(*axis);
+	}
+
+	return values;
+}
+
+/**
+ * hkl_geometry_set_axes_values_unit:
+ * @self: the this ptr
+ * @values: (array length=len): the values to set.
+ * @len: the length of the values array.
+ **/
+void hkl_geometry_set_axes_values_unit(HklGeometry *self, double *values, unsigned int len)
+{
+	uint i = 0;
+	HklParameter **axis;
+
+	if (!self || !values || len != darray_size(self->axes))
+		return;
+
+	darray_foreach(axis, self->axes){
+		hkl_parameter_value_unit_set(*axis,
+					     values[i++],
+					     NULL);
+	}
+
+	hkl_geometry_update(self);
+}
+
+/*******************/
+/* HklGeometryList */
+/*******************/
+
+/**
+ * hkl_geometry_list_items:
+ * @self: the #HklGeometryList
+ *
+ * Return value: (element-type HklGeometryListItem) (transfer container): list of items,
+ *               free the list with g_slist_free when done.
+ **/
+GSList* hkl_geometry_list_items(HklGeometryList *self)
+{
+	GSList *list = NULL;
+	HklGeometryListItem **item;
+
+	darray_foreach(item, self->items){
+		list = g_slist_append(list, *item);
+	}
+
+	return list;
+}
+
+/***********************/
+/* HklGeometryListItem */
+/***********************/
+
+/**
+ * hkl_geometry_list_item_geometry:
+ * @self: the this ptr
+ *
+ * Return value: The geometry contain inside the HklGeometryListItem
+ **/
+const HklGeometry *hkl_geometry_list_item_geometry(const HklGeometryListItem *self)
+{
+	return hkl_geometry_list_item_geometry_get(self);
+}
+
+/*************/
+/* HklEngine */
+/*************/
+
+#define HKL_ENGINE_ERROR hkl_engine_error_quark ()
+
+GQuark hkl_engine_error_quark (void)
+{
+	return g_quark_from_static_string ("hkl-pseudo-axis-engine-error-quark");
+}
+
+typedef enum {
+	HKL_ENGINE_ERROR_SET /* can not set the pseudo axis engine */
+} HklEngineError;
+
+
+/**
+ * hkl_engine_modes_as_gslist:
+ * @self: the this ptr
+ *
+ * Return value: (element-type HklMode) (transfer container): list of mdoe,
+ *               free the list with g_slist_free when done.
+ *
+ * Rename to: hkl_engine_modes
+ **/
+GSList* hkl_engine_modes_as_gslist(HklEngine *self)
+{
+	GSList *list = NULL;
+	HklMode **mode;
+
+	darray_foreach(mode, self->modes){
+		list = g_slist_append(list, *mode);
+	}
+
+	return list;
+}
+
+/**
+ * hkl_engine_set_values_unit:
+ * @self: the this ptr
+ * @values: (array length=len): the values to set
+ * @len: the len of the values array
+ * @error: return location of a GError or NULL
+ *
+ * compute the #HklGeometry angles for this #HklEngine
+ *
+ * Return value: TRUE on success or FALSE if an error occurred
+ **/
+gboolean hkl_engine_set_values_unit(HklEngine *self,
+				    double values[], unsigned int len,
+				    GError **error)
+{
+	HklParameter *parameter;
+	uint i = 0;
+	HklError *err = NULL;
+
+	g_return_val_if_fail(error == NULL ||*error == NULL, FALSE);
+
+	if(len != self->info->n_pseudo_axes)
+		return FALSE;
+
+	if(!hkl_parameter_list_values_unit_set(&self->pseudo_axes,
+					       values, len, &err)){
+		g_assert(&err == NULL || err != NULL);
+
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_SET,
+			    strdup(err->message));
+
+		hkl_error_clear(&err);
+
+		return FALSE;
+	}
+
+	if(!hkl_engine_set(self, &err)){
+		g_assert(&err == NULL || err != NULL);
+
+		g_set_error(error,
+			    HKL_ENGINE_ERROR,
+			    HKL_ENGINE_ERROR_SET,
+			    strdup(err->message));
+
+		hkl_error_clear(&err);
+
+		return FALSE;
+	}
+	g_assert(error != NULL ||*error != NULL);
+
+	return TRUE;
+}
+
+/**
+ * hkl_engine_list_engines_as_gslist:
+ * @self: the this ptr
+ *
+ * Return value: (element-type HklEngine) (transfer container): list of engines,
+ *               free the list with g_slist_free when done.
+ *
+ * Rename to: hkl_engine_list_engines
+ **/
+GSList* hkl_engine_list_engines_as_gslist(HklEngineList *self)
+{
+	GSList *list = NULL;
+	HklEngine **engine;
+
+	darray_foreach(engine, *self){
+		list = g_slist_append(list, *engine);
+	}
+
+	return list;
+}
+
+/*************/
+/* HklSample */
+/*************/
+
+/**
+ * hkl_sample_reflections_get:
+ * @self: the this ptr
+ *
+ * Return value: (element-type HklSampleReflection) (transfer container): list of reflecions,
+ *               free the list with g_slist_free when done.
+ */
+const GSList *hkl_sample_reflections_get(const HklSample *self)
+{
+	GSList *list = NULL;
+	HklSampleReflection *reflection;
+
+	list_for_each(&self->reflections, reflection, list){
+		list = g_slist_append(list, reflection);
+	}
+
+	return list;
+}
+
+/**
+ * hkl_sample_add_reflection_binding:
+ * @self: the this ptr
+ * @geometry: the geometry of the HklSampleReflection
+ * @detector: the detector of the HklSampleReflection
+ * @h: the h coordinate
+ * @k: the k coordinate
+ * @l: the l coordinate
+ *
+ * Return value: (element-type HklEngine) (transfer container): list of engines,
+ *               free the list with g_slist_free when done.
+ *
+ * Rename to: hkl_sample_add_reflection
+ **/
+HklSampleReflection *hkl_sample_add_reflection_binding(HklSample *self,
+						       const HklGeometry *geometry,
+						       const HklDetector *detector,
+						       double h, double k, double l)
+{
+	HklSampleReflection *reflection;
+
+	reflection = hkl_sample_reflection_new(geometry, detector, h, k, l);
+	hkl_sample_add_reflection(self, reflection);
+
+	return reflection;
+}
+
diff --git a/hkl/hkl-detector-factory.c b/hkl/hkl-detector-factory.c
index 4319356..2db1bca 100644
--- a/hkl/hkl-detector-factory.c
+++ b/hkl/hkl-detector-factory.c
@@ -13,24 +13,32 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
 
-#include <hkl/hkl-detector-factory.h>
-
+#include "hkl.h"
+#include "hkl-detector-private.h"
 
+/**
+ * hkl_detector_factory_new:
+ * @type:
+ *
+ * Detector factory
+ *
+ * Returns:
+ **/
 HklDetector *hkl_detector_factory_new(HklDetectorType type)
 {
 	HklDetector *detector = NULL;
 
 	switch(type) {
-		case HKL_DETECTOR_TYPE_0D:
-			detector = hkl_detector_new();
-			break;
+	case HKL_DETECTOR_TYPE_0D:
+		detector = hkl_detector_new();
+		break;
 	}
 
 	return detector;
diff --git a/hkl/hkl-detector.h b/hkl/hkl-detector-private.h
similarity index 75%
copy from hkl/hkl-detector.h
copy to hkl/hkl-detector-private.h
index c596094..0627315 100644
--- a/hkl/hkl-detector.h
+++ b/hkl/hkl-detector-private.h
@@ -13,21 +13,19 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_DETECTOR_H__
-#define __HKL_DETECTOR_H__
+#ifndef __HKL_DETECTOR_PRIVATE_H__
+#define __HKL_DETECTOR_PRIVATE_H__
 
-#include <hkl/hkl-geometry.h>
+#include "hkl-geometry-private.h"
 
 HKL_BEGIN_DECLS
 
-typedef struct _HklDetector HklDetector;
-
 struct _HklDetector
 {
 	size_t idx;
@@ -36,15 +34,14 @@ struct _HklDetector
 
 extern HklDetector *hkl_detector_new(void);
 
-extern HklDetector *hkl_detector_new_copy(HklDetector const *src);
-
-extern void hkl_detector_free(HklDetector *self);
+extern HklDetector *hkl_detector_new_copy(HklDetector const *src) HKL_ARG_NONNULL(1);
 
-extern void hkl_detector_attach_to_holder(HklDetector *self, HklHolder const *holder);
+extern void hkl_detector_attach_to_holder(HklDetector *self,
+					  HklHolder const *holder) HKL_ARG_NONNULL(1, 2);
 
 extern int hkl_detector_compute_kf(HklDetector const *self, HklGeometry *g,
-				   HklVector *kf);
+				   HklVector *kf) HKL_ARG_NONNULL(1, 2, 3);
 
 HKL_END_DECLS
 
-#endif /* __HKL_DETECTOR_H__ */
+#endif /* __HKL_DETECTOR_PRIVATE_H__ */
diff --git a/hkl/hkl-detector.c b/hkl/hkl-detector.c
index 73ec60b..9ca9f58 100644
--- a/hkl/hkl-detector.c
+++ b/hkl/hkl-detector.c
@@ -13,15 +13,23 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
 #include <math.h>
-#include <hkl/hkl-detector.h>
 
+#include "hkl-detector-private.h"
+
+/**
+ * hkl_detector_new: (skip)
+ *
+ * Create a new default #HklDetector
+ *
+ * Returns:
+ **/
 HklDetector *hkl_detector_new(void)
 {
 	HklDetector *self = NULL;
@@ -34,32 +42,70 @@ HklDetector *hkl_detector_new(void)
 	return self;
 }
 
-HklDetector *hkl_detector_new_copy(HklDetector const *src)
+/**
+ * hkl_detector_new_copy: (skip)
+ * @src: the detector to copy
+ *
+ * the copy constructor
+ *
+ * Returns:
+ **/
+HklDetector *hkl_detector_new_copy(const HklDetector *src)
 {
 	HklDetector *self;
 
 	self = HKL_MALLOC(HklDetector);
 
-	self->idx = src->idx;
-	self->holder = src->holder;
+	*self = *src;
 
 	return self;
 }
 
+/**
+ * hkl_detector_free: (skip)
+ * @self:
+ *
+ * destructor
+ **/
 void hkl_detector_free(HklDetector *self)
 {
-	if(self)
-		free(self);
+	free(self);
 }
 
-void hkl_detector_attach_to_holder(HklDetector *self, HklHolder const *holder)
+/**
+ * hkl_detector_idx_set:
+ * @self: the this ptr
+ * @idx: the index of the holder
+ *
+ * Attach a detector to a given holder
+ **/
+void hkl_detector_idx_set(HklDetector *self, int idx)
 {
-	if(!self || !holder)
-		return;
+	self->idx = idx;
+}
 
+/**
+ * hkl_detector_attach_to_holder: (skip)
+ * @self:
+ * @holder:
+ *
+ * attach the #HklDetector to an #HklHolder
+ **/
+void hkl_detector_attach_to_holder(HklDetector *self, HklHolder const *holder)
+{
 	self->holder = holder;
 }
 
+/**
+ * hkl_detector_compute_kf: (skip)
+ * @self:
+ * @g: (in): the diffractometer #HklGeometry use to compute kf.
+ * @kf: (out caller-allocates): the #HklVector fill with the kf coordinates.
+ *
+ * Compute the kf vector of the #HklDetector
+ *
+ * Returns: HKL_SUCCESS if everythongs goes fine. HKL_FAIL otherwise.
+ **/
 int hkl_detector_compute_kf(HklDetector const *self, HklGeometry *g,
 			    HklVector *kf)
 {
@@ -67,11 +113,24 @@ int hkl_detector_compute_kf(HklDetector const *self, HklGeometry *g,
 
 	hkl_geometry_update(g);
 
-	holder = &g->holders[self->idx];
+	holder = darray_item(g->holders, self->idx);
 	if (holder) {
 		hkl_vector_init(kf, HKL_TAU / g->source.wave_length, 0, 0);
 		hkl_vector_rotated_quaternion(kf, &holder->q);
-		return HKL_SUCCESS;
+		return HKL_TRUE;
 	} else
-		return HKL_FAIL;
+		return HKL_FALSE;
+}
+
+/**
+ * hkl_detector_fprintf: (skip)
+ * @f:
+ * @self:
+ *
+ * print to a FILE the detector members
+ **/
+void hkl_detector_fprintf(FILE *f, const HklDetector *self)
+{
+	fprintf(f, "detector->idx: %d\n", self->idx);
+	fprintf(f, "detector->holder: %p\n", self->holder);
 }
diff --git a/hkl/hkl-error.h b/hkl/hkl-error-private.h
similarity index 93%
rename from hkl/hkl-error.h
rename to hkl/hkl-error-private.h
index 3b7527b..bf668f2 100644
--- a/hkl/hkl-error.h
+++ b/hkl/hkl-error-private.h
@@ -18,21 +18,21 @@
  *   Boston, MA 02111-1307, USA.
  */
 
-/* 
+/*
  * modified by Picca Frédéric-emmanuel <picca at synchrotron-soleil.fr>
  * for the hkl project
  */
-#ifndef __HKL_ERROR_H__
-#define __HKL_ERROR_H__
+#ifndef __HKL_ERROR_PRIVATE_H__
+#define __HKL_ERROR_PRIVATE_H__
 
 #include <stdarg.h>
-#include <hkl/hkl-macros.h>
 
-HKL_BEGIN_DECLS
+#include "hkl.h"
+#include "hkl-macros-private.h"
 
-typedef struct _HklError HklError;
+HKL_BEGIN_DECLS
 
-struct _HklError
+struct _HklError /*<skip>*/
 {
 	char *message;
 };
diff --git a/hkl/hkl-error.c b/hkl/hkl-error.c
index 78ea45e..d72b801 100644
--- a/hkl/hkl-error.c
+++ b/hkl/hkl-error.c
@@ -29,10 +29,10 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <hkl/hkl-error.h>
+#include "hkl-error-private.h"
 
 /**
- * hkl_error_new_valist:
+ * hkl_error_new_valist: (skip)
  * @format: printf()-style format for error message
  * @args: #va_list of parameters for the message format
  *
@@ -55,7 +55,7 @@ HklError* hkl_error_new_valist (const char *format, va_list args)
 }
 
 /**
- * hkl_error_new:
+ * hkl_error_new: (skip)
  * @format: printf()-style format for error message
  * @Varargs: parameters for message format
  *
@@ -80,13 +80,13 @@ HklError* hkl_error_new (const char *format, ...)
 }
 
 /**
- * hkl_error_new_literal:
+ * hkl_error_new_literal: (skip)
  * @message: error message
  *
- * Creates a new #HklError; unlike hkl_error_new(), @message is
- * not a printf()-style format string. Use this function if
- * @message contains text you don't have control over,
- * that could include printf() escape sequences.
+ * Creates a new #HklError; unlike hkl_error_new(), @message is not a
+ * printf()-style format string. Use this function if @message
+ * contains text you don't have control over, that could include
+ * printf() escape sequences.
  *
  * Return value: a new #HklError
  **/
@@ -105,7 +105,7 @@ HklError* hkl_error_new_literal (const char *message)
 }
 
 /**
- * hkl_error_free:
+ * hkl_error_free: (skip)
  * @error: a #HklError
  *
  * Frees a #HklError and associated resources.
@@ -120,7 +120,7 @@ void hkl_error_free (HklError *error)
 }
 
 /**
- * hkl_error_copy:
+ * hkl_error_new_copy: (skip)
  * @error: a #HklError
  *
  * Makes a copy of @error.
@@ -130,7 +130,7 @@ void hkl_error_free (HklError *error)
 HklError* hkl_error_new_copy (const HklError *error)
 {
 	HklError *copy;
- 
+
 	if(!error)
 		return NULL;
 
@@ -149,7 +149,7 @@ HklError* hkl_error_new_copy (const HklError *error)
 	"The overwriting error message was: %s"
 
 /**
- * hkl_error_set:
+ * hkl_error_set: (skip)
  * @err: a return location for a #HklError, or %NULL
  * @format: printf()-style format
  * @Varargs: args for @format
@@ -172,19 +172,19 @@ void hkl_error_set (HklError **err, const char  *format, ...)
 	if (*err == NULL)
 		*err = new;
 	else
-		fprintf (stderr, ERROR_OVERWRITTEN_WARNING, new->message); 
+		fprintf (stderr, ERROR_OVERWRITTEN_WARNING, new->message);
 }
 
 /**
- * hkl_error_set_literal:
+ * hkl_error_set_literal: (skip)
  * @err: a return location for a #HklError, or %NULL
  * @message: error message
  *
  * Does nothing if @err is %NULL; if @err is non-%NULL, then *@err
  * must be %NULL. A new #HklError is created and assigned to *@err.
- * Unlike hkl_set_error(), @message is not a printf()-style format string.
- * Use this function if @message contains text you don't have control over,
- * that could include printf() escape sequences.
+ * Unlike hkl_set_error(), @message is not a printf()-style format
+ * string.  Use this function if @message contains text you don't have
+ * control over, that could include printf() escape sequences.
  *
  * Since: 2.18
  */
@@ -199,11 +199,11 @@ void hkl_error_set_literal (HklError **err, const char *message)
 	if (*err == NULL)
 		*err = new;
 	else
-		fprintf (stderr, ERROR_OVERWRITTEN_WARNING, new->message); 
+		fprintf (stderr, ERROR_OVERWRITTEN_WARNING, new->message);
 }
 
 /**
- * hkl_propagate_error:
+ * hkl_error_propagate: (skip)
  * @dest: error return location
  * @src: error to move into the return location
  *
@@ -214,7 +214,7 @@ void hkl_error_propagate (HklError **dest, HklError  *src)
 {
 	if(!src)
 		return;
- 
+
 	if (dest == NULL){
 		if (src)
 			hkl_error_free (src);
@@ -228,11 +228,11 @@ void hkl_error_propagate (HklError **dest, HklError  *src)
 }
 
 /**
- * hkl_clear_error:
+ * hkl_error_clear: (skip)
  * @err: a #HklError return location
  *
- * If @err is %NULL, does nothing. If @err is non-%NULL,
- * calls hkl_error_free() on *@err and sets *@err to %NULL.
+ * If @err is %NULL, does nothing. If @err is non-%NULL, calls
+ * hkl_error_free() on *@err and sets *@err to %NULL.
  */
 void hkl_error_clear (HklError **err)
 {
@@ -246,9 +246,9 @@ static void hkl_error_add_prefix (char **string, const char *format, va_list ap)
 {
 	char *oldstring;
 	char *prefix;
-	int len;
-	int len_prefix;
-	int len_oldstring;
+	size_t len;
+	size_t len_prefix;
+	size_t len_oldstring;
 
 	len_prefix = vasprintf (&prefix, format, ap);
 	oldstring = *string;
@@ -256,28 +256,30 @@ static void hkl_error_add_prefix (char **string, const char *format, va_list ap)
 
 	len = len_prefix + len_oldstring;
 	*string = malloc (len *sizeof (char) + 1);
+#if _MSC_VER
+	strncpy_s (*string, len_prefix + 1, prefix, len_prefix);
+	strncat_s (*string, len + 1, oldstring, len_oldstring);
+#else
 	*string = strncpy (*string, prefix, len_prefix + 1);
 	*string = strncat (*string, oldstring, len_oldstring);
+#endif
 	free (oldstring);
 	free (prefix);
 }
 
 /**
- * hkl_prefix_error:
+ * hkl_error_prefix: (skip)
  * @err: a return location for a #HklError, or %NULL
  * @format: printf()-style format string
  * @...: arguments to @format
  *
- * Formats a string according to @format and
- * prefix it to an existing error message.  If
- * @err is %NULL (ie: no error variable) then do
+ * Formats a string according to @format and prefix it to an existing
+ * error message.  If @err is %NULL (ie: no error variable) then do
  * nothing.
  *
- * If *@err is %NULL (ie: an error variable is
- * present but there is no error condition) then
- * also do nothing.  Whether or not it makes
- * sense to take advantage of this feature is up
- * to you.
+ * If *@err is %NULL (ie: an error variable is present but there is no
+ * error condition) then also do nothing.  Whether or not it makes
+ * sense to take advantage of this feature is up to you.
  *
  * Since: 2.16
  */
@@ -293,15 +295,14 @@ void hkl_error_prefix (HklError **err, const char *format, ...)
 }
 
 /**
- * hkl_propagate_prefixed_error:
+ * hkl_error_propagate_prefixed: (skip)
  * @dest: error return location
  * @src: error to move into the return location
  * @format: printf()-style format string
  * @...: arguments to @format
  *
- * If @dest is %NULL, free @src; otherwise,
- * moves @src into *@dest. *@dest must be %NULL.
- * After the move, add a prefix as with
+ * If @dest is %NULL, free @src; otherwise, moves @src into
+ * *@dest. *@dest must be %NULL.  After the move, add a prefix as with
  * hkl_prefix_error().
  *
  * Since: 2.16
@@ -318,3 +319,14 @@ void hkl_error_propagate_prefixed (HklError **dest, HklError *src, const char *f
 		va_end (ap);
 	}
 }
+
+/**
+ * hkl_error_message_get:
+ * @self: the this ptr
+ *
+ * Returns: the message of the HklError
+ **/
+const char *hkl_error_message_get(const HklError *self)
+{
+	return self->message;
+}
diff --git a/hkl/hkl-pseudoaxis-zaxis.h b/hkl/hkl-factory-private.h
similarity index 77%
copy from hkl/hkl-pseudoaxis-zaxis.h
copy to hkl/hkl-factory-private.h
index b97bca0..1dc61ea 100644
--- a/hkl/hkl-pseudoaxis-zaxis.h
+++ b/hkl/hkl-factory-private.h
@@ -13,21 +13,22 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_PSEUDOAXIS_ZAXIS_H__
-#define __HKL_PSEUDOAXIS_ZAXIS_H__
+#ifndef __HKL_FACTORY_PRIVATE_H__
+#define __HKL_FACTORY_PRIVATE_H__
 
-#include <hkl/hkl-pseudoaxis-auto.h>
+#include "hkl.h"
+#include "hkl/ccan/autodata/autodata.h"
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_zaxis_hkl_new(void);
+AUTODATA_TYPE(factories, HklFactory);
 
 HKL_END_DECLS
 
-#endif /* __HKL_PSEUDOAXIS_ZAXIS_H__ */
+#endif /* __HKL_FACTORY_H__ */
diff --git a/hkl/hkl-factory.c b/hkl/hkl-factory.c
new file mode 100644
index 0000000..905fdb3
--- /dev/null
+++ b/hkl/hkl-factory.c
@@ -0,0 +1,737 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+
+#include <stdarg.h>
+#include <gsl/gsl_sf.h>
+
+#include "hkl.h"
+#include "hkl-axis-private.h"
+#include "hkl-factory-private.h"
+#include "hkl-pseudoaxis-private.h"
+#include "hkl-pseudoaxis-common-eulerians-private.h"
+#include "hkl-pseudoaxis-common-q-private.h"
+#include "hkl-pseudoaxis-e4c-private.h"
+#include "hkl-pseudoaxis-k4cv-private.h"
+#include "hkl-pseudoaxis-e6c-private.h"
+#include "hkl-pseudoaxis-k6c-private.h"
+#include "hkl-pseudoaxis-zaxis-private.h"
+#include "hkl-pseudoaxis-soleil-sixs-med-private.h"
+#include "hkl-pseudoaxis-petra3-private.h"
+
+
+typedef HklGeometry* (* HklFactoryGeometryFunction) (const HklFactory *factory);
+typedef HklEngineList* (* HklFactoryEngineListFunction) (const HklFactory *factory);
+
+struct _HklFactory
+{
+	const char *name;
+	const char *description;
+	HklFactoryGeometryFunction create_new_geometry;
+	HklFactoryEngineListFunction create_new_engine_list;
+};
+
+HklFactory **hkl_factory_get_all(unsigned int *n)
+{
+	return autodata_get(factories, n);
+}
+
+HklFactory *hkl_factory_get_by_name(const char *name)
+{
+	unsigned int i, n;
+	HklFactory **factories;
+
+	factories = autodata_get(factories, &n);
+	for(i=0;i<n; ++i)
+		if (!strcmp(name, factories[i]->name))
+			return factories[i];
+
+	return NULL;
+}
+
+const char *hkl_factory_name(const HklFactory *self)
+{
+	return self->name;
+}
+
+HklGeometry *hkl_factory_create_new_geometry(const HklFactory *self)
+{
+	return self->create_new_geometry(self);
+}
+
+HklEngineList *hkl_factory_create_new_engine_list(const HklFactory *self)
+{
+	return self->create_new_engine_list(self);
+}
+
+#define REGISTER_DIFFRACTOMETER(name_, real_name_, description_)	\
+	static HklFactory name_ = {.name = real_name_,			\
+				   .description = description_,		\
+				   .create_new_geometry = &hkl_geometry_new_ ## name_, \
+				   .create_new_engine_list = &hkl_engine_list_new_ ## name_ \
+	};								\
+	AUTODATA(factories, &name_)
+
+static void kappa_2_kappap(double komega, double kappa, double kphi, double alpha,
+			   double *komegap, double *kappap, double *kphip)
+{
+	double p;
+	double omega;
+	double phi;
+
+	p = atan(tan(kappa/2.) * cos(alpha));
+	omega = komega + p - M_PI_2;
+	phi = kphi + p + M_PI_2;
+
+	*komegap = gsl_sf_angle_restrict_symm(2*omega - komega);
+	*kappap = -kappa;
+	*kphip = gsl_sf_angle_restrict_symm(2*phi - kphi);
+
+}
+
+static void hkl_geometry_list_multiply_k4c_real(HklGeometryList *self,
+						HklGeometryListItem *item)
+{
+	HklGeometry *geometry;
+	HklGeometry *copy;
+	double komega, komegap;
+	double kappa, kappap;
+	double kphi, kphip;
+
+	geometry = item->geometry;
+	komega = hkl_parameter_value_get(darray_item(geometry->axes, 0));
+	kappa = hkl_parameter_value_get(darray_item(geometry->axes, 1));
+	kphi = hkl_parameter_value_get(darray_item(geometry->axes, 2));
+
+	kappa_2_kappap(komega, kappa, kphi, 50 * HKL_DEGTORAD, &komegap, &kappap, &kphip);
+
+	copy = hkl_geometry_new_copy(geometry);
+	/* TODO parameter list for the geometry */
+	hkl_parameter_value_set(darray_item(copy->axes, 0), komegap, NULL);
+	hkl_parameter_value_set(darray_item(copy->axes, 1), kappap, NULL);
+	hkl_parameter_value_set(darray_item(copy->axes, 2), kphip, NULL);
+
+	hkl_geometry_update(copy);
+	hkl_geometry_list_add(self, copy);
+	hkl_geometry_free(copy);
+}
+
+static void hkl_geometry_list_multiply_k6c_real(HklGeometryList *self,
+						HklGeometryListItem *item)
+{
+	HklGeometry *geometry;
+	HklGeometry *copy;
+	double komega, komegap;
+	double kappa, kappap;
+	double kphi, kphip;
+
+	geometry = item->geometry;
+	komega = hkl_parameter_value_get(darray_item(geometry->axes, 1));
+	kappa = hkl_parameter_value_get(darray_item(geometry->axes, 2));
+	kphi = hkl_parameter_value_get(darray_item(geometry->axes, 3));
+
+	kappa_2_kappap(komega, kappa, kphi, 50 * HKL_DEGTORAD, &komegap, &kappap, &kphip);
+
+	copy = hkl_geometry_new_copy(geometry);
+	/* TODO parameter list for the geometry */
+	hkl_parameter_value_set(darray_item(copy->axes, 1), komegap, NULL);
+	hkl_parameter_value_set(darray_item(copy->axes, 2), kappap, NULL);
+	hkl_parameter_value_set(darray_item(copy->axes, 3), kphip, NULL);
+
+	hkl_geometry_update(copy);
+	hkl_geometry_list_add(self, copy);
+	hkl_geometry_free(copy);
+}
+
+
+/********/
+/* TwoC */
+/********/
+
+#define HKL_GEOMETRY_TWOC_DESCRIPTION					\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 1 axes for the sample\n"					\
+	"\n"								\
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_twoC(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_twoC(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(twoC, "TwoC", HKL_GEOMETRY_TWOC_DESCRIPTION);
+
+/********/
+/* E4CV */
+/********/
+#define HKL_GEOMETRY_EULERIAN4C_VERTICAL_DESCRIPTION					\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n"	\
+	"  + **phi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_eulerian4C_vertical(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_eulerian4C_vertical(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(eulerian4C_vertical, "E4CV", HKL_GEOMETRY_EULERIAN4C_VERTICAL_DESCRIPTION);
+
+/********/
+/* K4CV */
+/********/
+
+#define HKL_GEOMETRY_KAPPA4C_VERTICAL_DESCRIPTION			\
+	"For this geometry there is a special parameters called :math:`\\alpha` which is the\n" \
+	"angle between the kappa rotation axis and the  :math:`\\vec{y}` direction.\n" \
+	"\n"								\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **komega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **kappa** : rotating around the :math:`\\vec{x}` direction (0, :math:`-\\cos\\alpha`, :math:`-\\sin\\alpha`)\n"	\
+	"  + **kphi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`-\\\vec{y}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_kappa4C_vertical(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	double alpha = 50 * HKL_DEGTORAD;
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
+	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_kappa4C_vertical(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	self->geometries->multiply = hkl_geometry_list_multiply_k4c_real;
+	hkl_engine_list_add(self, hkl_engine_k4cv_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_eulerians_new());
+	hkl_engine_list_add(self, hkl_engine_k4cv_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(kappa4C_vertical, "K4CV", HKL_GEOMETRY_KAPPA4C_VERTICAL_DESCRIPTION);
+
+/*******/
+/* E6C */
+/*******/
+
+#define HKL_GEOMETRY_EULERIAN6C_DESCRIPTION				\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 4 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 2 axes for the detector\n"					\
+	"\n"								\
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_eulerian6C(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_eulerian6C(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e6c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e6c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(eulerian6C, "E6C", HKL_GEOMETRY_EULERIAN6C_DESCRIPTION);
+
+/*******/
+/* K6C */
+/*******/
+
+#define HKL_GEOMETRY_KAPPA6C_DESCRIPTION				\
+	"For this geometry there is a special parameters called :math:`\\alpha` which is the\n" \
+	"angle between the kappa rotation axis and the  :math:`\\vec{y}` direction.\n" \
+	"\n"								\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 4 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **komega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **kappa** : rotating around the :math:`\\vec{x}` direction (0, :math:`-\\cos\\alpha`, :math:`-\\sin\\alpha`)\n" \
+	"  + **kphi** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 2 axes for the detector\n"					\
+	"\n"								\
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_kappa6C(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	double alpha = 50 * HKL_DEGTORAD;
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
+	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_kappa6C(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	self->geometries->multiply = hkl_geometry_list_multiply_k6c_real;
+	hkl_engine_list_add(self, hkl_engine_k6c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_eulerians_new());
+	hkl_engine_list_add(self, hkl_engine_k6c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(kappa6C, "K6C", HKL_GEOMETRY_KAPPA6C_DESCRIPTION);
+
+/*********/
+/* ZAXIS */
+/*********/
+
+#define HKL_GEOMETRY_TYPE_ZAXIS_DESCRIPTION				\
+	"For this geometry the **mu** axis is common to the sample and the detector.\n" \
+	"\n"								\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 2 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 3 axis for the detector\n"					\
+	"\n"								\
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n"
+
+static HklGeometry *hkl_geometry_new_zaxis(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_zaxis(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_zaxis_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(zaxis, "ZAXIS", HKL_GEOMETRY_TYPE_ZAXIS_DESCRIPTION);
+
+/***********************/
+/* SOLEIL SIXS MED 2+2 */
+/***********************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 3 axis for the detector\n"					\
+	"\n"								\
+	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_soleil_sixs_med_2_2(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_sixs_med_2_2(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_2_2_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_sixs_med_2_2,"SOLEIL SIXS MED2+2", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2_DESCRIPTION);
+
+/***************/
+/* SOLEIL MARS */
+/***************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_MARS_DESCRIPTION			\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **omega** : rotating around the :math:`\\vec{z}` direction (0, -1, 0)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (-1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`\\vec{z}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_soleil_mars(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "chi", -1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_mars(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_mars, "SOLEIL MARS", HKL_GEOMETRY_TYPE_SOLEIL_MARS_DESCRIPTION);
+
+/***********************/
+/* SOLEIL SIXS MED 1+2 */
+/***********************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 2 axes for the sample\n"					\
+	"\n"								\
+	"  + **pitch** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"\n"								\
+	"+ 3 axis for the detector\n"					\
+	"\n"								\
+	"  + **pitch** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_soleil_sixs_med_1_2(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "pitch", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "pitch", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_sixs_med_1_2(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_1_2_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_sixs_med_1_2, "SOLEIL SIXS MED1+2", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2_DESCRIPTION);
+
+/******************/
+/* PETRA3 P09 EH2 */
+/******************/
+
+#define HKL_GEOMETRY_TYPE_PETRA3_P09_EH2_DESCRIPTION			\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 4 axes for the sample\n"					\
+	"\n"								\
+	"  + **mu** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **omega** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"\n"								\
+	"+ 3 axis for the detector\n"					\
+	"\n"								\
+	"  + **mu** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **delta** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **gamma** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
+
+static HklGeometry *hkl_geometry_new_petra3_p09_eh2(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "omega", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "mu", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "delta", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, -1, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_petra3_p09_eh2(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_petra3_p09_eh2_hkl_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(petra3_p09_eh2, "PETRA3 P09 EH2", HKL_GEOMETRY_TYPE_PETRA3_P09_EH2_DESCRIPTION);
+
+/***********************/
+/* SOLEIL SIXS MED 2+3 */
+/***********************/
+
+#define HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **mu** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **omega** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"\n"								\
+	"+ 4 axis for the detector\n"					\
+	"\n"								\
+	"  + **beta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **gamma** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **delta** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
+	"  + **eta_a** : rotation around the :math:`-\\vec{x}` direction (-1, 0, 0)\n"
+
+static HklGeometry *hkl_geometry_new_soleil_sixs_med_2_3(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "beta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
+	hkl_holder_add_rotation_axis(h, "eta_a", -1, 0, 0);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_soleil_sixs_med_2_3(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	self->geometries->multiply = hkl_geometry_list_multiply_soleil_sixs_med_2_3;
+	hkl_engine_list_add(self, hkl_engine_soleil_sixs_med_2_3_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_q2_new());
+	hkl_engine_list_add(self, hkl_engine_qper_qpar_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(soleil_sixs_med_2_3, "SOLEIL SIXS MED2+3", HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3_DESCRIPTION);
+
+/********/
+/* E4CH */
+/********/
+
+#define HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL_DESCRIPTION		\
+	"+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"+ 3 axes for the sample\n"					\
+	"\n"								\
+	"  + **omega** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"  + **chi** : rotating around the :math:`\\vec{x}` direction (1, 0, 0)\n" \
+	"  + **phi** : rotating around the :math:`\\vec{z}` direction (0, 0, 1)\n" \
+	"\n"								\
+	"+ 1 axis for the detector\n"					\
+	"\n"								\
+	"  + **tth** : rotation around the :math:`\\vec{z}` direction (0, 0, 1)\n"
+
+static HklGeometry *hkl_geometry_new_eulerian4C_horizontal(const HklFactory *factory)
+{
+	HklGeometry *self = hkl_geometry_new(factory);
+	HklHolder *h;
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "omega", 0, 0, 1);
+	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
+	hkl_holder_add_rotation_axis(h, "phi", 0, 0, 1);
+
+	h = hkl_geometry_add_holder(self);
+	hkl_holder_add_rotation_axis(h, "tth", 0, 0, 1);
+
+	return self;
+}
+
+static HklEngineList *hkl_engine_list_new_eulerian4C_horizontal(const HklFactory *factory)
+{
+	HklEngineList *self = hkl_engine_list_new();
+
+	hkl_engine_list_add(self, hkl_engine_e4c_hkl_new());
+	hkl_engine_list_add(self, hkl_engine_e4c_psi_new());
+	hkl_engine_list_add(self, hkl_engine_q_new());
+
+	return self;
+}
+
+REGISTER_DIFFRACTOMETER(eulerian4C_horizontal, "E4CH", HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL_DESCRIPTION);
diff --git a/hkl/hkl-geometry-factory.c b/hkl/hkl-geometry-factory.c
deleted file mode 100644
index c893fed..0000000
--- a/hkl/hkl-geometry-factory.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#include <stdarg.h>
-
-#include <hkl/hkl-geometry-factory.h>
-
-static void hkl_geometry_init_twoC_vertical(HklGeometry *self,
-					    const HklGeometryConfig *config)
-{
-	HklHolder *h;
-
-	self->config = config;
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
-}
-
-static void hkl_geometry_init_eulerian4C_vertical(HklGeometry *self,
-						  const HklGeometryConfig *config)
-{
-	HklHolder *h;
-
-	self->config = config;
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
-	hkl_holder_add_rotation_axis(h, "phi", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
-}
-
-static void hkl_geometry_init_kappa4C_vertical(HklGeometry *self,
-					       const HklGeometryConfig *config, double alpha)
-{
-	HklHolder *h;
-
-	self->config = config;
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
-	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "tth", 0, -1, 0);
-}
-
-static void hkl_geometry_init_eulerian6C(HklGeometry *self,
-					 const HklGeometryConfig *config)
-{
-	HklHolder *h;
-
-	self->config = config;
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "chi", 1, 0, 0);
-	hkl_holder_add_rotation_axis(h, "phi", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-}
-
-static void hkl_geometry_init_kappa6C(HklGeometry *self,
-				      const  HklGeometryConfig *config, double alpha)
-{
-	HklHolder *h;
-
-	self->config = config;
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "komega", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "kappa", 0, -cos(alpha), -sin(alpha));
-	hkl_holder_add_rotation_axis(h, "kphi", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-}
-
-static void hkl_geometry_init_zaxis(HklGeometry *self,
-				    const HklGeometryConfig *config)
-{
- 	HklHolder *h;
-
-	self->config = config;
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "omega", 0, -1, 0);
-
-	h = hkl_geometry_add_holder(self);
-	hkl_holder_add_rotation_axis(h, "mu", 0, 0, 1);
-	hkl_holder_add_rotation_axis(h, "delta", 0, -1, 0);
-	hkl_holder_add_rotation_axis(h, "gamma", 0, 0, 1); 
-}
-
-const HklGeometryConfig *hkl_geometry_factory_get_config_from_type(HklGeometryType type)
-{
-	const HklGeometryConfig *config;
-
-	config = hkl_geometry_factory_configs;
-	while(config)
-		if(config->type == type)
-			return config;
-		else
-			config++;
-	return NULL;
-}
-
-
-HklGeometry *hkl_geometry_factory_new(const HklGeometryConfig *config, ...)
-{
-	HklGeometry *geom;
-	double alpha;
-	va_list ap;
-
-	geom = hkl_geometry_new();
-	switch(config->type) {
-		case HKL_GEOMETRY_TYPE_TWOC_VERTICAL:
-			hkl_geometry_init_twoC_vertical(geom, config);
-			break;
-		case HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL:
-			hkl_geometry_init_eulerian4C_vertical(geom, config);
-			break;
-		case HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL:
-			va_start(ap, config);
-			alpha = va_arg(ap, double);
-			va_end(ap);
-			hkl_geometry_init_kappa4C_vertical(geom, config, alpha);
-			break;
-		case HKL_GEOMETRY_TYPE_EULERIAN6C:
-			hkl_geometry_init_eulerian6C(geom, config);
-			break;
-		case HKL_GEOMETRY_TYPE_KAPPA6C:
-			va_start(ap, config);
-			alpha = va_arg(ap, double);
-			va_end(ap);
-			hkl_geometry_init_kappa6C(geom, config, alpha);
-			break;
-		case HKL_GEOMETRY_TYPE_ZAXIS:
-			hkl_geometry_init_zaxis(geom, config);
-			break;
-	}
-
-	return geom;
-}
diff --git a/hkl/hkl-geometry-factory.h b/hkl/hkl-geometry-factory.h
deleted file mode 100644
index 1bb4690..0000000
--- a/hkl/hkl-geometry-factory.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_GEOMETRY_FACTORY_H__
-#define __HKL_GEOMETRY_FACTORY_H__
-
-#include <hkl/hkl-geometry.h>
-
-HKL_BEGIN_DECLS
-
-static const HklGeometryConfig hkl_geometry_factory_configs[] =
-{
-	{"TwoC", HKL_GEOMETRY_TYPE_TWOC_VERTICAL},
-	{"E4CV", HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL},
- 	{"K4CV", HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL},
-	{"E6C", HKL_GEOMETRY_TYPE_EULERIAN6C},
-	{"K6C", HKL_GEOMETRY_TYPE_KAPPA6C},
-	{"ZAXIS", HKL_GEOMETRY_TYPE_ZAXIS,},
-	{NULL}
-};
-
-extern const HklGeometryConfig *hkl_geometry_factory_get_config_from_type(HklGeometryType type);
-
-extern HklGeometry *hkl_geometry_factory_new(const HklGeometryConfig *config, ...);
-
-HKL_END_DECLS
-
-#endif /* __HKL_GEOMETRY_FACTORY_H__ */
diff --git a/hkl/hkl-geometry.h b/hkl/hkl-geometry-private.h
similarity index 55%
rename from hkl/hkl-geometry.h
rename to hkl/hkl-geometry-private.h
index 1b8fd7d..cf1edc9 100644
--- a/hkl/hkl-geometry.h
+++ b/hkl/hkl-geometry-private.h
@@ -13,65 +13,52 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_GEOMETRY_H__
-#define __HKL_GEOMETRY_H__
+#ifndef __HKL_GEOMETRY_PRIVATE_H__
+#define __HKL_GEOMETRY_PRIVATE_H__
 
-#include <hkl/hkl-source.h>
-#include <hkl/hkl-list.h>
-#include <hkl/hkl-quaternion.h>
-#include <hkl/hkl-axis.h>
+#include "hkl.h"
+#include "hkl-parameter-private.h"
+#include "hkl-quaternion-private.h"
+#include "hkl-source-private.h"
 
 HKL_BEGIN_DECLS
 
 typedef struct _HklHolder HklHolder;
-typedef struct _HklGeometryConfig HklGeometryConfig;
-typedef struct _HklGeometry HklGeometry;
-typedef struct _HklGeometryList HklGeometryList;
-typedef struct _HklGeometryListItem HklGeometryListItem;
 typedef void (* HklGeometryListMultiplyFunction) (HklGeometryList *self,
-						  size_t idx);
-enum _HklGeometryType
-{
-	HKL_GEOMETRY_TYPE_TWOC_VERTICAL,
-	HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL,
-	HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL,
-	HKL_GEOMETRY_TYPE_EULERIAN6C,
-	HKL_GEOMETRY_TYPE_KAPPA6C,
-	HKL_GEOMETRY_TYPE_ZAXIS
-};
+						  HklGeometryListItem *item);
 
-typedef enum _HklGeometryType HklGeometryType;
+typedef darray(HklHolder *) darray_holder;
 
+struct HklHolderConfig {
+	int gc;
+	size_t *idx;
+	size_t len;
+};
 
 struct _HklHolder {
+	struct HklHolderConfig *config;
 	HklGeometry *geometry;
-	HKL_LIST(size_t, idx);
 	HklQuaternion q;
 };
 
-struct _HklGeometryConfig {
-	const char *name;
-	HklGeometryType type;
-};
-
 struct _HklGeometry
 {
-	const HklGeometryConfig *config;
+	const HklFactory *factory;
 	HklSource source;
-	HKL_LIST(HklAxis, axes);
-	HKL_LIST(HklHolder, holders);
+	darray_parameter axes;
+	darray_holder holders;
 };
 
 struct _HklGeometryList
 {
-	HKL_LIST(HklGeometryListItem *, items);
 	HklGeometryListMultiplyFunction multiply;
+	darray_item items;
 };
 
 struct _HklGeometryListItem
@@ -83,42 +70,43 @@ struct _HklGeometryListItem
 /* HklHolder */
 /*************/
 
-extern HklAxis *hkl_holder_add_rotation_axis(HklHolder *self,
-					     char const *name, double x, double y, double z);
+extern HklParameter *hkl_holder_add_rotation_axis(HklHolder *self,
+						  char const *name, double x, double y, double z);
 
 /***************/
 /* HklGeometry */
 /***************/
 
-extern HklGeometry *hkl_geometry_new(void);
-extern HklGeometry *hkl_geometry_new_copy(HklGeometry const *self);
+extern HklGeometry *hkl_geometry_new(const HklFactory *factory);
 
-extern void hkl_geometry_free(HklGeometry *self);
+extern HklGeometry *hkl_geometry_new_copy(const HklGeometry *self);
 
 extern void hkl_geometry_init_geometry(HklGeometry *self,
-				       HklGeometry const *src);
+				       const HklGeometry *src);
 
 extern HklHolder *hkl_geometry_add_holder(HklGeometry *self);
 
 extern void hkl_geometry_update(HklGeometry *self);
 
-extern HklAxis *hkl_geometry_get_axis_by_name(HklGeometry *self,
-					      char const *name);
+extern int hkl_geometry_get_axis_idx_by_name(const HklGeometry *self,
+					     const char *name);
 
-extern void hkl_geometry_randomize(HklGeometry *self);
+extern HklParameter *hkl_geometry_get_axis_by_name(HklGeometry *self,
+						   const char *name);
 
 extern int hkl_geometry_set_values_v(HklGeometry *self,
 				     size_t len, ...);
 
-extern double hkl_geometry_distance(HklGeometry *self, HklGeometry *geom);
+extern double hkl_geometry_distance(const HklGeometry *self,
+				    const HklGeometry *ref);
 
-extern double hkl_geometry_distance_orthodromic(HklGeometry *self, HklGeometry *geom);
+extern double hkl_geometry_distance_orthodromic(const HklGeometry *self,
+						const HklGeometry *ref);
 
-extern int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self, HklGeometry *ref);
+extern int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self,
+							 const HklGeometry *ref);
 
-extern int hkl_geometry_is_valid(HklGeometry const *self);
-
-extern void hkl_geometry_fprintf(FILE *file, HklGeometry const *self);
+extern int hkl_geometry_is_valid(const HklGeometry *self);
 
 /*******************/
 /* HklGeometryList */
@@ -126,6 +114,8 @@ extern void hkl_geometry_fprintf(FILE *file, HklGeometry const *self);
 
 extern HklGeometryList *hkl_geometry_list_new(void);
 
+extern HklGeometryList *hkl_geometry_list_new_copy(const HklGeometryList *self);
+
 extern void hkl_geometry_list_free(HklGeometryList *self);
 
 extern void hkl_geometry_list_add(HklGeometryList *self, HklGeometry *geometry);
@@ -134,7 +124,7 @@ extern void hkl_geometry_list_reset(HklGeometryList *self);
 
 extern void hkl_geometry_list_sort(HklGeometryList *self, HklGeometry *ref);
 
-extern void hkl_geometry_list_fprintf(FILE *f, HklGeometryList const *self);
+extern void hkl_geometry_list_fprintf(FILE *f, const HklGeometryList *self);
 
 extern void hkl_geometry_list_multiply(HklGeometryList *self);
 
@@ -142,18 +132,16 @@ extern void hkl_geometry_list_multiply_from_range(HklGeometryList *self);
 
 extern void hkl_geometry_list_remove_invalid(HklGeometryList *self);
 
-extern int hkl_geometry_list_len(HklGeometryList *self);
-
-extern int hkl_geometry_list_is_empty(HklGeometryList *self);
-
 /***********************/
 /* HklGeometryListItem */
 /***********************/
 
-extern HklGeometryListItem *hkl_geometry_list_item_new(HklGeometry *geometry);
+extern HklGeometryListItem *hkl_geometry_list_item_new(const HklGeometry *geometry);
+
+extern HklGeometryListItem *hkl_geometry_list_item_new_copy(const HklGeometryListItem *self);
 
 extern void hkl_geometry_list_item_free(HklGeometryListItem *self);
 
 HKL_END_DECLS
 
-#endif /* __HKL_GEOMETRY_H__ */
+#endif /* __HKL_GEOMETRY_PRIVATE_H__ */
diff --git a/hkl/hkl-geometry.c b/hkl/hkl-geometry.c
index 7f78af6..186dce9 100644
--- a/hkl/hkl-geometry.c
+++ b/hkl/hkl-geometry.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,12 +22,16 @@
 #include <math.h>
 #include <string.h>
 #include <stdarg.h>
-#include <alloca.h>
+#ifndef _MSC_VER
+# include <alloca.h>
+#endif
 
 #include <gsl/gsl_math.h>
 #include <gsl/gsl_sf_trig.h>
 
-#include <hkl/hkl-geometry.h>
+#include "hkl/ccan/container_of/container_of.h"
+#include "hkl-axis-private.h"
+#include "hkl-geometry-private.h"
 
 /*
  * Try to add a axis to the axes list,
@@ -35,90 +39,125 @@
  * else create a new on and add it to the list.
  * die if try to add an axis with the same name but a different axis_v
  */
-static size_t hkl_geometry_add_rotation(HklGeometry *geometry,
-					char const *name, HklVector const *axis_v)
+static size_t hkl_geometry_add_rotation(HklGeometry *self,
+					const char *name, const HklVector *axis_v)
 {
-	size_t i, len;
-	HklAxis axis;
+	uint i = 0;
+	HklParameter **parameter;
 
 	/* check if an axis with the same name is on the axis list */
-	for(i=0; i<HKL_LIST_LEN(geometry->axes); ++i){
-		HklAxis *axis;
-
-		axis = &geometry->axes[i];
-		if(!strcmp(hkl_axis_get_name(axis), name)){
-			if (hkl_vector_cmp(&axis->axis_v, axis_v)){
+	darray_foreach(parameter, self->axes){
+		HklAxis *axis = container_of(*parameter, HklAxis, parameter);
+		if(!strcmp((*parameter)->name, name)){
+			if (hkl_vector_cmp(&axis->axis_v,
+					   axis_v)){
 				fprintf(stderr, "can not add two axis with the same name \"%s\" but different axes <%f, %f, %f> != <%f, %f, %f> into an HklAxes.",
-				    name,
-				    axis->axis_v.data[0], axis->axis_v.data[1], axis->axis_v.data[2],
-				    axis_v->data[0], axis_v->data[1], axis_v->data[2]);
+					name,
+					axis->axis_v.data[0], axis->axis_v.data[1], axis->axis_v.data[2],
+					axis_v->data[0], axis_v->data[1], axis_v->data[2]);
 				exit(128);
 			}else{
 				return i;
 			}
 		}
+		++i;
 	}
 
 	/* no so create and add it to the list */
-	len = HKL_LIST_LEN(geometry->axes);
-	hkl_axis_init(&axis, name, axis_v);
-	HKL_LIST_ADD_VALUE(geometry->axes, axis);
+	darray_append(self->axes, hkl_parameter_new_axis(name, axis_v));
 
-	return len;
+	return darray_size(self->axes) - 1;
+}
+
+/*******************/
+/* HklHolderConfig */
+/*******************/
+
+static struct HklHolderConfig *hkl_holder_config_new(void)
+{
+	struct HklHolderConfig *self;
+
+	self = HKL_MALLOC(struct HklHolderConfig);
+
+	self->gc = 1;
+	self->idx = NULL;
+	self->len = 0;
+
+	return self;
+}
+
+static struct HklHolderConfig *hkl_holder_config_ref(struct HklHolderConfig *self)
+{
+	if(!self)
+		return NULL;
+
+	self->gc++;
+
+	return self;
+}
+
+static void hkl_holder_config_unref(struct HklHolderConfig *self)
+{
+	if(!self)
+		return;
+
+	if(--self->gc)
+		return;
+
+	free(self->idx);
+	free(self);
 }
 
 /*************/
 /* HklHolder */
 /*************/
 
-static void hkl_holder_init(HklHolder *self, HklGeometry *geometry)
+static HklHolder *hkl_holder_new(HklGeometry *geometry)
 {
-	static HklQuaternion q0 = {{0, 0, 0, 0}};
+	static HklQuaternion q0 = {{1, 0, 0, 0}};
+	HklHolder *self = HKL_MALLOC(HklHolder);
+
+	self->config = hkl_holder_config_new();
 	self->geometry = geometry;
-	HKL_LIST_INIT(self->idx);
 	self->q = q0;
+
+	return self;
 }
 
-static int hkl_holder_init_copy(HklHolder *self, HklGeometry *geometry,
-		HklHolder const *holder)
+static HklHolder *hkl_holder_new_copy(HklHolder *src, HklGeometry *geometry)
 {
-	/* check axes compatibility */
-	if (HKL_LIST_LEN(geometry->axes) != HKL_LIST_LEN(holder->geometry->axes))
-		return HKL_FAIL;
+	HklHolder *self = HKL_MALLOC(HklHolder);
 
+	self->config = hkl_holder_config_ref(src->config);
 	self->geometry = geometry;
+	self->q = src->q;
 
-	HKL_LIST_ALLOC(self->idx, HKL_LIST_LEN(holder->idx));
-	HKL_LIST_COPY(self->idx, holder->idx);
-
-	self->q = holder->q;
-
-	return HKL_SUCCESS;
+	return self;
 }
 
-static void hkl_holder_release_memory(HklHolder *self)
+static void hkl_holder_free(HklHolder *self)
 {
-	HKL_LIST_FREE(self->idx);
+	hkl_holder_config_unref(self->config);
+	free(self);
 }
 
 static void hkl_holder_update(HklHolder *self)
 {
 	static HklQuaternion q0 = {{1, 0, 0, 0}};
 	size_t i;
-	HklAxis *axes;
-	size_t *idx;
 
 	self->q = q0;
-	axes = self->geometry->axes;
-	idx = self->idx;
-	for(i=0; i<HKL_LIST_LEN(self->idx); ++i)
-		hkl_quaternion_times_quaternion(&self->q, &axes[idx[i]].q);
+	for(i=0; i<self->config->len; ++i)
+		hkl_quaternion_times_quaternion(&self->q,
+						&container_of(darray_item(self->geometry->axes,
+									  self->config->idx[i]),
+							      HklAxis, parameter)->q);
 }
 
-HklAxis *hkl_holder_add_rotation_axis(HklHolder * self,
-				      char const * name, double x, double y, double z)
+HklParameter *hkl_holder_add_rotation_axis(HklHolder *self,
+					   const char *name, double x, double y, double z)
 {
-	HklAxis *axis = NULL;
+	HklParameter *axis = NULL;
 	size_t i, idx;
 	HklVector axis_v;
 
@@ -129,198 +168,394 @@ HklAxis *hkl_holder_add_rotation_axis(HklHolder * self,
 	idx = hkl_geometry_add_rotation(self->geometry, name, &axis_v);
 
 	/* check that the axis is not already in the holder */
-	for(i=0; i<HKL_LIST_LEN(self->idx); i++)
-		if (idx == self->idx[i])
+	for(i=0; i<self->config->len; i++)
+		if (idx == self->config->idx[i])
 			return NULL;
 
-	axis = &self->geometry->axes[idx];
-	HKL_LIST_ADD_VALUE(self->idx, idx);
+	axis = darray_item(self->geometry->axes, idx);
+	self->config->idx = realloc(self->config->idx, sizeof(*self->config->idx) * (self->config->len + 1));
+	self->config->idx[self->config->len++] = idx;
 
 	return axis;
 }
 
-
 /***************/
 /* HklGeometry */
 /***************/
 
-HklGeometry *hkl_geometry_new(void)
+/**
+ * hkl_geometry_new: (skip)
+ *
+ * constructor
+ *
+ * Returns:
+ **/
+HklGeometry *hkl_geometry_new(const HklFactory *factory)
 {
 	HklGeometry *g = NULL;
 
 	g = HKL_MALLOC(HklGeometry);
 
-	g->config = NULL;
+	g->factory = factory;
 	hkl_source_init(&g->source, 1.54, 1, 0, 0);
-	HKL_LIST_INIT(g->axes);
-	HKL_LIST_INIT(g->holders);
+	darray_init(g->axes);
+	darray_init(g->holders);
 
 	return g;
 }
 
-HklGeometry *hkl_geometry_new_copy(HklGeometry const *src)
+/**
+ * hkl_geometry_new_copy: (skip)
+ * @self:
+ *
+ * copy constructor
+ *
+ * Returns:
+ **/
+HklGeometry *hkl_geometry_new_copy(const HklGeometry *src)
 {
 	HklGeometry *self = NULL;
-	unsigned int i;
-	size_t len;
+	HklParameter **axis;
+	HklHolder **holder;
+
+	if(!src)
+		return self;
 
 	self = HKL_MALLOC(HklGeometry);
 
-	self->config = src->config;
+	self->factory = src->factory;
 	self->source = src->source;
 
 	/* copy the axes */
-	HKL_LIST_ALLOC(self->axes, HKL_LIST_LEN(src->axes));
-	HKL_LIST_COPY(self->axes, src->axes);
+	darray_init(self->axes);
+	darray_foreach(axis, src->axes){
+		darray_append(self->axes, hkl_parameter_new_copy(*axis));
+	}
 
 	/* copy the holders */
-	len = HKL_LIST_LEN(src->holders);
-	HKL_LIST_ALLOC(self->holders, len);
-	for(i=0; i<len; ++i)
-		hkl_holder_init_copy(&self->holders[i], self,
-				     &src->holders[i]);
+	darray_init(self->holders);
+	darray_foreach(holder, src->holders){
+		darray_append(self->holders,
+			      hkl_holder_new_copy(*holder, self));
+	}
 
 	return self;
 }
 
+/**
+ * hkl_geometry_free: (skip)
+ * @self:
+ *
+ * destructor
+ **/
 void hkl_geometry_free(HklGeometry *self)
 {
-	size_t i;
-	size_t len;
+	HklParameter **axis;
+	HklHolder **holder;
 
-	HKL_LIST_FREE(self->axes);
+	darray_foreach(axis, self->axes){
+		hkl_parameter_free(*axis);
+	}
+	darray_free(self->axes);
 
-	len = HKL_LIST_LEN(self->holders);
-	if(len) {
-		for(i=0; i<len; ++i)
-			hkl_holder_release_memory(&self->holders[i]);
-		HKL_LIST_FREE(self->holders);
+	darray_foreach(holder, self->holders){
+		hkl_holder_free(*holder);
 	}
+	darray_free(self->holders);
 
 	free(self);
 }
 
-void hkl_geometry_init_geometry(HklGeometry *self, HklGeometry const *src)
+void hkl_geometry_set(HklGeometry *self, const HklGeometry *src)
 {
 	size_t i;
 
-	if(!self || !src
-	   || self->config->type != src->config->type)
+	if(self->factory != src->factory)
 		return;
 
+	self->factory = src->factory;
 	self->source = src->source;
 
 	/* copy the axes configuration and mark it as dirty */
-	HKL_LIST_COPY(self->axes, src->axes);
-	for(i=0; i<HKL_LIST_LEN(src->holders); ++i)
-		self->holders[i].q = src->holders[i].q;
+	for(i=0; i<darray_size(self->axes); ++i)
+		hkl_parameter_init_copy(darray_item(self->axes, i),
+					darray_item(src->axes, i));
+
+	for(i=0; i<darray_size(src->holders); ++i)
+		darray_item(self->holders, i)->q = darray_item(src->holders, i)->q;
 }
 
-HklHolder *hkl_geometry_add_holder(HklGeometry *self)
+const darray_parameter *hkl_geometry_axes_get(const HklGeometry *self)
+{
+	return &self->axes;
+}
+
+/**
+ * hkl_geometry_axis_get: (skip)
+ * @self: the this ptr
+ * @name: the name of the axis your are requesting
+ *
+ * Return value: (allow-none): the parameter corresponding to the axis name.
+ **/
+const HklParameter *hkl_geometry_axis_get(const HklGeometry *self,
+					  const char *name)
 {
-	HklHolder *holder;
-	size_t len;
+	HklParameter **axis;
 
-	len = HKL_LIST_LEN(self->holders);
-	HKL_LIST_RESIZE(self->holders, len + 1);
-	holder = &self->holders[len];
-	hkl_holder_init(holder, self);
+	darray_foreach(axis, self->axes){
+		if (!strcmp((*axis)->name, name))
+			return *axis;
+	}
+	return NULL;
+}
+
+void hkl_geometry_axis_set(HklGeometry *self, const HklParameter *axis)
+{
+	HklParameter **_axis;
+
+	darray_foreach(_axis, self->axes){
+		if (*_axis == axis)
+			break;
+		if (!strcmp(axis->name, (*_axis)->name))
+			hkl_parameter_init_copy(*_axis, axis);
+	}
+	hkl_geometry_update(self);
+}
+
+double hkl_geometry_wavelength_get(const HklGeometry *self)
+{
+	return self->source.wave_length;
+}
+
+void hkl_geometry_wavelength_set(HklGeometry *self, double wavelength)
+{
+	self->source.wave_length = wavelength;
+}
+
+/**
+ * hkl_geometry_init_geometry: (skip)
+ * @self:
+ * @src:
+ *
+ * initilize an HklGeometry
+ **/
+void hkl_geometry_init_geometry(HklGeometry *self, const HklGeometry *src)
+{
+	hkl_geometry_set(self, src);
+}
+
+/**
+ * hkl_geometry_add_holder: (skip)
+ * @self:
+ *
+ * add an Holder to the #HklGeometry
+ *
+ * Returns:
+ **/
+HklHolder *hkl_geometry_add_holder(HklGeometry *self)
+{
+	HklHolder *holder = hkl_holder_new(self);
+	darray_append(self->holders, holder);
 
 	return holder;
 }
 
+/**
+ * hkl_geometry_update: (skip)
+ * @self:
+ *
+ * update the geometry internal once an Axis values changed
+ **/
 void hkl_geometry_update(HklGeometry *self)
 {
-	size_t i, len;
+	HklParameter **axis;
+	size_t i;
 	int ko = 0;
 
-	len = HKL_LIST_LEN(self->axes);
-	for(i=0; i<len; ++i)
-		if (hkl_axis_get_changed(&self->axes[i]) == HKL_TRUE) {
+	darray_foreach(axis, self->axes){
+		if ((*axis)->changed) {
 			ko = 1;
 			break;
 		}
+	}
 
 	if (ko) {
-		for(i=0; i<HKL_LIST_LEN(self->holders); i++)
-			hkl_holder_update(&self->holders[i]);
+		HklHolder **holder;
+
+		darray_foreach(holder, self->holders){
+			hkl_holder_update(*holder);
+		}
 
-		for(i=0; i<len; i++)
-			hkl_axis_set_changed(&self->axes[i], HKL_FALSE);
+		darray_foreach(axis, self->axes){
+			(*axis)->changed = HKL_FALSE;
+		}
 	}
 }
 
-HklAxis *hkl_geometry_get_axis_by_name(HklGeometry *self, char const *name)
+const char *hkl_geometry_name_get(const HklGeometry *self)
 {
-	size_t i;
-	HklAxis *axis;
-	for(i=0; i<HKL_LIST_LEN(self->axes); ++i) {
-		axis = &self->axes[i];
-		if (!strcmp(hkl_axis_get_name(axis), name))
-			return axis;
+	return hkl_factory_name(self->factory);
+}
+
+/**
+ * hkl_geometry_get_axis_idx_by_name: (skip)
+ * @self:
+ * @name:
+ *
+ * get the index of the axes named @name in the geometry
+ *
+ * Returns: -1 if the axis was not found
+ **/
+int hkl_geometry_get_axis_idx_by_name(const HklGeometry *self, const char *name)
+{
+	uint i = 0;
+	HklParameter **axis;
+
+	if (!self || !name)
+		return -1;
+
+	darray_foreach(axis, self->axes){
+		if (!strcmp((*axis)->name, name))
+			return i;
+		++i;
+	}
+
+	return -1;
+}
+
+/**
+ * hkl_geometry_get_axis_by_name:
+ * @self:
+ * @name:
+ *
+ * get an #HklAxis using its name
+ *
+ * Returns: (transfer none):
+ **/
+HklParameter *hkl_geometry_get_axis_by_name(HklGeometry *self, const char *name)
+{
+	HklParameter **axis;
+
+	darray_foreach(axis, self->axes){
+		if (!strcmp((*axis)->name, name))
+			return (*axis);
 	}
 	return NULL;
 }
 
+/**
+ * hkl_geometry_randomize: (skip)
+ * @self:
+ *
+ * randomize the #HklGeometry
+ **/
 void hkl_geometry_randomize(HklGeometry *self)
 {
-	size_t i;
+	HklParameter **axis;
 
-	for(i=0; i<HKL_LIST_LEN(self->axes); ++i)
-		hkl_axis_randomize(&self->axes[i]);
+	darray_foreach(axis, self->axes){
+		hkl_parameter_randomize(*axis);
+	}
 	hkl_geometry_update(self);
 }
 
+/**
+ * hkl_geometry_set_values_v: (skip)
+ * @self:
+ * @len:
+ * "...:
+ *
+ * set the axes values
+ *
+ * Returns:
+ **/
 int hkl_geometry_set_values_v(HklGeometry *self, size_t len, ...)
 {
 	va_list ap;
-	size_t i;
+	HklParameter **axis;
 
-	if (!self || len != HKL_LIST_LEN(self->axes))
-		return HKL_FAIL;
+	if (!self || darray_size(self->axes) != len)
+		return HKL_FALSE;
 
 	va_start(ap, len);
-	for(i=0; i<len; ++i)
-		hkl_axis_set_value(&self->axes[i], va_arg(ap, double));
+	darray_foreach(axis, self->axes){
+		hkl_parameter_value_set(*axis,
+					va_arg(ap, double), NULL);
+	}
+	va_end(ap);
+
+	hkl_geometry_update(self);
 
+	return HKL_TRUE;
+}
+
+int hkl_geometry_set_values_unit_v(HklGeometry *self, ...)
+{
+	va_list ap;
+	HklParameter **axis;
+
+	va_start(ap, self);
+	darray_foreach(axis, self->axes){
+		hkl_parameter_value_unit_set(*axis,
+					     va_arg(ap, double), NULL);
+	}
 	va_end(ap);
+
 	hkl_geometry_update(self);
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
-double hkl_geometry_distance(HklGeometry *self, HklGeometry *geom)
+/**
+ * hkl_geometry_distance:
+ * @self: the this ptr
+ * @ref: the #HklGeometry to compare with
+ *
+ * compute the distance between two #HklGeometries
+ *
+ * Returns: the distance between the two geometries
+ **/
+double hkl_geometry_distance(const HklGeometry *self,
+			     const HklGeometry *ref)
 {
 	size_t i;
 	double value1, value2;
 	double distance = 0.;
 
-	if (!self || !geom)
+	if (!self || !ref)
 		return 0.;
 
-	for(i=0; i<HKL_LIST_LEN(self->axes); ++i){
-		value1 = hkl_axis_get_value(&self->axes[i]);
-		value2 = hkl_axis_get_value(&geom->axes[i]);
+	for(i=0; i<darray_size(self->axes); ++i){
+		value1 = darray_item(self->axes, i)->_value;
+		value2 = darray_item(ref->axes, i)->_value;
 		distance += fabs(value2 - value1);
 	}
 
 	return distance;
 }
 
-double hkl_geometry_distance_orthodromic(HklGeometry *self, HklGeometry *geom)
+/**
+ * hkl_geometry_distance_orthodromic: (skip)
+ * @self: the this ptr
+ * @ref: the reference #HklGeometry to compare with.
+ *
+ * Returns: the orthodromique distance
+ **/
+double hkl_geometry_distance_orthodromic(const HklGeometry *self,
+					 const HklGeometry *ref)
 {
 	size_t i;
 	double value1, value2;
 	double distance = 0.;
 
-	if (!self || !geom)
+	if (!self || !ref)
 		return 0.;
 
-	for(i=0; i<HKL_LIST_LEN(self->axes); ++i){
+	for(i=0; i<darray_size(self->axes); ++i){
 		double d;
 
-		value1 = hkl_axis_get_value(&self->axes[i]);
-		value2 = hkl_axis_get_value(&geom->axes[i]);
+		value1 = darray_item(self->axes, i)->_value;
+		value2 = darray_item(ref->axes, i)->_value;
 		d = fabs(gsl_sf_angle_restrict_symm(value2) - gsl_sf_angle_restrict_symm(value1));
 		/* as M_PI and -M_PI are included in the GSL restriction */
 		if (d > M_PI)
@@ -331,28 +566,47 @@ double hkl_geometry_distance_orthodromic(HklGeometry *self, HklGeometry *geom)
 	return distance;
 }
 
+/**
+ * hkl_geometry_is_valid: (skip)
+ * @self:
+ *
+ * check if all axes of the #HklGeometry are valid.
+ *
+ * Returns:
+ **/
 int hkl_geometry_is_valid(const HklGeometry *self)
 {
-	size_t i;
-	size_t len;
+	HklParameter **axis;
 
-	len = HKL_LIST_LEN(self->axes);
-	for(i=0; i<len; ++i)
-		if(hkl_axis_is_valid(&self->axes[i]) == HKL_FALSE)
+	darray_foreach(axis, self->axes){
+		if(!hkl_parameter_is_valid(*axis))
 			return HKL_FALSE;
+	}
 
 	return HKL_TRUE;
 }
 
-int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self, HklGeometry *ref)
+/**
+ * hkl_geometry_closest_from_geometry_with_range: (skip)
+ * @self:
+ * @ref:
+ *
+ * get the closest axes values in the HklInterval compatible with the
+ * current axes values
+ *
+ * Returns:
+ **/
+int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self,
+						  const HklGeometry *ref)
 {
 	size_t i;
-	size_t len = HKL_LIST_LEN(self->axes);
+	uint len = darray_size(self->axes);
 	double *values = alloca(len * sizeof(*values));
 	int ko = HKL_FALSE;
 
 	for(i=0;i<len;++i){
-		values[i] = hkl_axis_get_value_closest(&self->axes[i], &ref->axes[i]);
+		values[i] = hkl_parameter_value_get_closest(darray_item(self->axes, i),
+							    darray_item(ref->axes, i));
 		if(gsl_isnan(values[i])){
 			ko = HKL_TRUE;
 			break;
@@ -360,20 +614,28 @@ int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self, HklGeometry
 	}
 	if(!ko){
 		for(i=0;i<len;++i)
-			hkl_axis_set_value(&self->axes[i], values[i]);
+			hkl_parameter_value_set(darray_item(self->axes, i),
+						values[i], NULL);
 		hkl_geometry_update(self);
 	}
 	return ko;
 }
 
-void hkl_geometry_fprintf(FILE *file, HklGeometry const *self)
+/**
+ * hkl_geometry_fprintf: (skip)
+ * @file:
+ * @self:
+ *
+ * print into a file the #HklGeometry
+ **/
+void hkl_geometry_fprintf(FILE *file, const HklGeometry *self)
 {
-	size_t i;
+	uint i;
 
-	for(i=0; i<HKL_LIST_LEN(self->axes); ++i){
+	for(i=0; i<darray_size(self->axes); ++i){
 		if(i)
 			fprintf(file, "\n");
-		hkl_parameter_fprintf(file, (HklParameter *)(&self->axes[i]));
+		hkl_parameter_fprintf(file, darray_item(self->axes, i));
 	}
 }
 
@@ -381,127 +643,204 @@ void hkl_geometry_fprintf(FILE *file, HklGeometry const *self)
 /* HklGeometryList */
 /*******************/
 
+/**
+ * hkl_geometry_list_new: (skip)
+ *
+ * constructor
+ *
+ * Returns:
+ **/
 HklGeometryList *hkl_geometry_list_new(void)
 {
 	HklGeometryList *self;
 
 	self = HKL_MALLOC(HklGeometryList);
 
-	HKL_LIST_INIT(self->items);
+	darray_init(self->items);
 	self->multiply = NULL;
 
 	return self;
 }
 
+/**
+ * hkl_geometry_list_new_copy: (skip)
+ * @self:
+ *
+ * copy constructor
+ *
+ * Returns:
+ **/
+HklGeometryList *hkl_geometry_list_new_copy(const HklGeometryList *self)
+{
+	HklGeometryList *dup;
+	HklGeometryListItem **item;
+
+	if (!self)
+		return NULL;
+
+	dup = HKL_MALLOC(HklGeometryList);
+
+	darray_init(dup->items);
+	/* now copy the item arrays */
+	darray_foreach(item , self->items){
+		darray_append(dup->items, hkl_geometry_list_item_new_copy(*item));
+	}
+	dup->multiply = self->multiply;
+
+	return dup;
+}
+
+/**
+ * hkl_geometry_list_free: (skip)
+ * @self:
+ *
+ * destructor
+ **/
 void hkl_geometry_list_free(HklGeometryList *self)
 {
-	HKL_LIST_FREE_DESTRUCTOR(self->items, hkl_geometry_list_item_free);
+	hkl_geometry_list_reset(self);
 	free(self);
 }
 
 /**
- * @brief this method Add a geometry to the geometries
+ * hkl_geometry_list_add: (skip)
+ * @self: The current #HklGeometryList
+ * @geometry: the #HklGeometry to add
  *
- * @param self The current PseudoAxeEngine
- * @param x A vector of double with the axes values to put in the geometry.
+ * this method Add a geometry to the geometries
  *
- * This method try to be clever by allocating memory only if the current
- * length of the geometries is not large enought. Then it just set the
- * geometry axes and copy it to the right geometries. We do not gives the
- * x len as it is equal to the self->axes_len.
- */
+ * This method try to be clever by allocating memory only if the
+ * current length of the geometries is not large enought. Then it just
+ * set the geometry axes and copy it to the right geometries. We do
+ * not gives the x len as it is equal to the self->axes_len.
+ **/
 void hkl_geometry_list_add(HklGeometryList *self, HklGeometry *geometry)
 {
-	size_t i;
-	int ko;
+	HklGeometryListItem **item;
 
 	/* now check if the geometry is already in the geometry list */
-	ko = HKL_FALSE;
-	for(i=0; i<HKL_LIST_LEN(self->items); ++i)
+	darray_foreach(item, self->items){
 		if (hkl_geometry_distance_orthodromic(geometry,
-						      self->items[i]->geometry) < HKL_EPSILON)
-			ko = HKL_TRUE;
+						      (*item)->geometry) < HKL_EPSILON)
+			return;
+	}
 
-	if(ko == HKL_FALSE)
-		HKL_LIST_ADD_VALUE(self->items, hkl_geometry_list_item_new(geometry));
+	darray_append(self->items, hkl_geometry_list_item_new(geometry));
+}
+
+const darray_item *hkl_geometry_list_items_get(const HklGeometryList *self)
+{
+	return &self->items;
 }
 
+/**
+ * hkl_geometry_list_reset: (skip)
+ * @self:
+ *
+ * reset the HklGeometry, in fact it is a sort of clean method remove
+ * all the items of the list.
+ **/
 void hkl_geometry_list_reset(HklGeometryList *self)
 {
-	HKL_LIST_FREE_DESTRUCTOR(self->items, hkl_geometry_list_item_free);
+	HklGeometryListItem **item;
+
+	darray_foreach(item, self->items)
+		hkl_geometry_list_item_free(*item);
+
+	darray_free(self->items);
+	darray_init(self->items);
 }
 
+/**
+ * hkl_geometry_list_sort: (skip)
+ * @self:
+ * @ref:
+ *
+ * sort the #HklGeometryList compare to the distance of the given
+ * #HklGeometry
+ **/
 void hkl_geometry_list_sort(HklGeometryList *self, HklGeometry *ref)
 {
-	size_t len = HKL_LIST_LEN(self->items);
-	double *distances = alloca(len * sizeof(*distances));
-	size_t *idx = alloca(len * sizeof(*idx));
-	size_t i, x;
+	double *distances = alloca(darray_size(self->items) * sizeof(*distances));
+	size_t *idx = alloca(darray_size(self->items) * sizeof(*idx));
+	HklGeometryListItem **items = alloca(darray_size(self->items) * sizeof(*items));
+	HklGeometryListItem **item;
+	int i = 0;
+	size_t x;
 	int j, p;
-	HklGeometryListItem **items;
+
+	memcpy(items, &darray_item(self->items, 0), darray_size(self->items) * sizeof(*items));
 
 	/* compute the distances once for all */
-	for(i=0; i<len; ++i){
-		distances[i] = hkl_geometry_distance(ref, self->items[i]->geometry);
+	darray_foreach(item, self->items){
+		distances[i] = hkl_geometry_distance(ref, (*item)->geometry);
 		idx[i] = i;
+		i++;
 	}
 
 	/* insertion sorting */
-	for(i=1; i<len; ++i){
+	for(i=1; i<darray_size(self->items); ++i){
 		x = idx[i];
 		/* find the smallest idx p lower than i with distance[idx[p]] >= distance[x] */
 		for(p = 0; distances[idx[p]] < distances[x] && fabs(distances[idx[p]] - distances[x]) > HKL_EPSILON; p++);
- 
-		/* move evythings in between p and i */
+
+		/* move everythings in between p and i */
 		for(j=i-1; j>=p; j--)
 			idx[j+1] = idx[j];
 
 		idx[p] = x; /* insert the saved idx */
 	}
 
-	/* reorder the geometries. */
-	items = malloc(len * sizeof(HklGeometryListItem *));
-	for(i=0; i<len; ++i)
-		items[i] = self->items[idx[i]];
-	free(self->items);
-	self->items = items;
+	for(i=0; i<darray_size(self->items); ++i){
+		darray_item(self->items, i) = items[idx[i]];
+	}
 }
 
-void hkl_geometry_list_fprintf(FILE *f, HklGeometryList const *self)
+/**
+ * hkl_geometry_list_fprintf: (skip)
+ * @f:
+ * @self:
+ *
+ * print to a file the #HklGeometryList
+ **/
+void hkl_geometry_list_fprintf(FILE *f, const HklGeometryList *self)
 {
-	HklParameter *parameter;
 	HklGeometry *g;
+	uint i = 0;
 	double value;
-	size_t len, axes_len;
-	size_t i, j;
+
+	if(!self)
+		return;
 
 	fprintf(f, "multiply method: %p \n", self->multiply);
-	len = HKL_LIST_LEN(self->items);
-	if(len){
-		axes_len = HKL_LIST_LEN(self->items[0]->geometry->axes);
-		g = self->items[0]->geometry;
+	if(darray_size(self->items)){
+		HklGeometryListItem **item;
+		HklParameter **axis;
+
 		fprintf(f, "    ");
-		for(i=0; i<axes_len; ++i)
-			fprintf(f, "%19s", hkl_axis_get_name(&g->axes[i]));
+		darray_foreach(axis, darray_item(self->items, 0)->geometry->axes){
+			fprintf(f, "%19s", (*axis)->name);
+		}
 
 		/* geometries */
-		for(i=0; i<len; ++i) {
-			fprintf(f, "\n%d :", i);
-			for(j=0; j<axes_len; ++j) {
-				parameter = (HklParameter *)(&self->items[i]->geometry->axes[j]);
-				value = hkl_parameter_get_value_unit(parameter);
-				if (parameter->punit)
-					fprintf(f, " % 18.15f %s", value, parameter->punit->repr);
+		darray_foreach(item, self->items){
+			fprintf(f, "\n%d :", i++);
+			darray_foreach(axis, (*item)->geometry->axes){
+				value = hkl_parameter_value_unit_get(*axis);
+				if ((*axis)->punit)
+					fprintf(f, " % 18.15f %s", value, (*axis)->punit->repr);
 				else
 					fprintf(f, " % 18.15f", value);
 
 			}
 			fprintf(f, "\n   ");
-			for(j=0; j<axes_len; ++j) {
-				parameter = (HklParameter *)(&self->items[i]->geometry->axes[j]);
-				value = gsl_sf_angle_restrict_symm(parameter->value) * hkl_unit_factor(parameter->unit, parameter->punit);
-				if (parameter->punit)
-					fprintf(f, " % 18.15f %s", value, parameter->punit->repr);
+			darray_foreach(axis, (*item)->geometry->axes){
+				value = hkl_parameter_value_get(*axis);
+				value = gsl_sf_angle_restrict_symm(value);
+				value *= hkl_unit_factor((*axis)->unit,
+							 (*axis)->punit);
+				if ((*axis)->punit)
+					fprintf(f, " % 18.15f %s", value, (*axis)->punit->repr);
 				else
 					fprintf(f, " % 18.15f", value);
 			}
@@ -510,78 +849,95 @@ void hkl_geometry_list_fprintf(FILE *f, HklGeometryList const *self)
 	}
 }
 
+/**
+ * hkl_geometry_list_multiply: (skip)
+ * @self:
+ *
+ * apply the multiply lenthod to the #HklGeometry
+ **/
 void hkl_geometry_list_multiply(HklGeometryList *self)
 {
-	size_t i;
-	size_t len;
+	uint i;
+	uint len = darray_size(self->items);
 
 	if(!self || !self->multiply)
 		return;
 
-	len = HKL_LIST_LEN(self->items);
+	/*
+	 * warning this method change the self->len so we need to save it
+	 * before using the recursive perm_r calls
+	 */
 	for(i=0; i<len; ++i)
-		self->multiply(self, i);
+		self->multiply(self, darray_item(self->items, i));
 }
 
-static void perm_r(HklGeometryList *self, HklGeometry *ref, HklGeometry *geometry,
-		   int perm[], size_t axis_idx)
+static void perm_r(HklGeometryList *self, const HklGeometry *ref,
+		   const HklGeometry *geometry, const int perm[],
+		   const unsigned int axis_idx)
 {
-	size_t len;
-
-	len = HKL_LIST_LEN(geometry->axes);
-
-	if (axis_idx == len){
-		if(hkl_geometry_distance(ref, geometry) > HKL_EPSILON)
-			HKL_LIST_ADD_VALUE(self->items, hkl_geometry_list_item_new(geometry));
+	if (axis_idx == darray_size(geometry->axes)){
+		if(hkl_geometry_distance(geometry, ref) > HKL_EPSILON)
+			darray_append(self->items, hkl_geometry_list_item_new(geometry));
 	}else{
-		if(perm[axis_idx] == HKL_TRUE){
-			HklAxis *axis;
-			double max;
+		if(perm[axis_idx]){
+			HklParameter *axis = darray_item(geometry->axes, axis_idx);
+			const double max = axis->range.max;;
+			const double value0 = axis->_value;
 			double value;
-			double value0;
 
-			axis = &geometry->axes[axis_idx];
-			max = hkl_axis_get_max(axis);
-			value = hkl_axis_get_value(axis);
-			value0 = value;
+			value = value0;
 			do{
 				/* fprintf(stdout, "\n%d %s, %f", axis_idx, hkl_axis_get_name(axis), value * HKL_RADTODEG); */
 				perm_r(self, ref, geometry, perm, axis_idx + 1);
 				value +=  2*M_PI;
-				if(value <= (max + HKL_EPSILON))
-					hkl_axis_set_value(axis, value);
+				if(value <= (max + HKL_EPSILON)){
+					/* optimisation here: */
+					/* instead of using set_value
+					 * we directly write the
+					 * HklParameter value, BEWARE
+					 * that it require that
+					 * HklParameter is a rotation
+					 * (for now it is always
+					 * true */
+					axis->_value = value;
+				}
 			}while(value <= (max + HKL_EPSILON));
-			hkl_axis_set_value(axis, value0);
+			/* restore the initial value */
+			axis->_value = value0;
 		} else
 			perm_r(self, ref, geometry, perm, axis_idx + 1);
-	}	
+	}
 }
 
 void hkl_geometry_list_multiply_from_range(HklGeometryList *self)
 {
-	size_t i, j;
-	size_t len;
+	uint i = 0;
+	uint len = darray_size(self->items);
+	size_t j = 0;
+
 	if(!self)
 		return;
 
-	len = HKL_LIST_LEN(self->items);
+	/*
+	 * warning this method change the self->len so we need to save it
+	 * before using the recursive perm_r calls
+	 */
 	for(i=0; i<len; ++i){
 		HklGeometry *geometry;
-		HklGeometry *ref;
+		HklParameter **axis;
+		const HklGeometry *ref = darray_item(self->items, i)->geometry;
 		int *perm;
 
-		ref = self->items[i]->geometry;
 		geometry = hkl_geometry_new_copy(ref);
-		perm = alloca(HKL_LIST_LEN(geometry->axes) * sizeof(*perm));
+		perm = alloca(darray_size(geometry->axes) * sizeof(*perm));
 
 		/* find axes to permute and the first solution of thoses axes */
-		for(j=0; j<HKL_LIST_LEN(geometry->axes); ++j){
-			HklAxis *axis = &geometry->axes[j];
-			perm[j] = hkl_axis_is_value_compatible_with_range(axis);
+		darray_foreach(axis, geometry->axes){
+			perm[j] = hkl_parameter_is_valid(*axis);
 			/* fprintf(stdout, "%d %d\n", j, perm[j]); */
-			if (perm[j] == HKL_TRUE)
-				hkl_axis_set_value_smallest_in_range(axis);
-				
+			if (perm[j])
+				hkl_parameter_value_set_smallest_in_range(*axis);
+			++j;
 		}
 		/*
 		 * fprintf(stdout, "FIRST SOLUTION\n");
@@ -593,35 +949,44 @@ void hkl_geometry_list_multiply_from_range(HklGeometryList *self)
 	}
 }
 
+/**
+ * hkl_geometry_list_remove_invalid: (skip)
+ * @self:
+ *
+ * remove all invalid #HklGeometry from the #HklGeometryList
+ **/
 void hkl_geometry_list_remove_invalid(HklGeometryList *self)
 {
-	size_t i;
-	
+	uint len = darray_size(self->items);
+	HklGeometryListItem **items = alloca(len * sizeof(*items));
+	uint i = 0;
+
 	if(!self)
 		return;
-	
-	for(i=0; i<HKL_LIST_LEN(self->items); ++i)
-		if(!hkl_geometry_is_valid(self->items[i]->geometry)){
-			HKL_LIST_DEL_DESTRUCTOR(self->items, i, hkl_geometry_list_item_free);
-			--i;
-		}
-}
-
-int hkl_geometry_list_len(HklGeometryList *self)
-{
-	return HKL_LIST_LEN(self->items);
-}
 
-int hkl_geometry_list_is_empty(HklGeometryList *self)
-{
-	return HKL_LIST_LEN(self->items) == 0;
+	memcpy(items, &darray_item(self->items, 0), len * sizeof(*items));
+	darray_size(self->items) = 0;
+	for(i=0; i<len; ++i){
+		if(!hkl_geometry_is_valid(items[i]->geometry))
+			hkl_geometry_list_item_free(items[i]);
+		else
+			darray_append(self->items, items[i]);
+	}
 }
 
 /***********************/
 /* HklGeometryListItem */
 /***********************/
 
-HklGeometryListItem *hkl_geometry_list_item_new(HklGeometry *geometry)
+/**
+ * hkl_geometry_list_item_new: (skip)
+ * @geometry:
+ *
+ * constructor
+ *
+ * Returns:
+ **/
+HklGeometryListItem *hkl_geometry_list_item_new(const HklGeometry *geometry)
 {
 	HklGeometryListItem *self;
 
@@ -635,7 +1000,34 @@ HklGeometryListItem *hkl_geometry_list_item_new(HklGeometry *geometry)
 	return self;
 }
 
+/**
+ * hkl_geometry_list_item_new_copy: (skip)
+ * @self:
+ *
+ * copy constructor
+ *
+ * Returns:
+ **/
+HklGeometryListItem *hkl_geometry_list_item_new_copy(const HklGeometryListItem *self)
+{
+	HklGeometryListItem *dup;
 
+	if(!self)
+		return NULL;
+
+	dup = HKL_MALLOC(HklGeometryListItem);
+
+	dup->geometry = hkl_geometry_new_copy(self->geometry);
+
+	return dup;
+}
+
+/**
+ * hkl_geometry_list_item_free: (skip)
+ * @self:
+ *
+ * destructor
+ **/
 void hkl_geometry_list_item_free(HklGeometryListItem *self)
 {
 	if(!self)
@@ -644,3 +1036,14 @@ void hkl_geometry_list_item_free(HklGeometryListItem *self)
 	hkl_geometry_free(self->geometry);
 	free(self);
 }
+
+/**
+ * hkl_geometry_list_item_geometry_get: (skip)
+ * @self: the this ptr
+ *
+ * Return value: The geometry contain inside the HklGeometryListItem
+ **/
+const HklGeometry *hkl_geometry_list_item_geometry_get(const HklGeometryListItem *self)
+{
+	return self->geometry;
+}
diff --git a/hkl/hkl-interval.h b/hkl/hkl-interval-private.h
similarity index 70%
rename from hkl/hkl-interval.h
rename to hkl/hkl-interval-private.h
index f502593..75f9552 100644
--- a/hkl/hkl-interval.h
+++ b/hkl/hkl-interval-private.h
@@ -13,16 +13,16 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef _HKL_INTERVAL_H
-#define _HKL_INTERVAL_H
+#ifndef _HKL_INTERVAL_PRIVATE_H
+#define _HKL_INTERVAL_PRIVATE_H
 
-#include <hkl/hkl-macros.h>
+#include "hkl.h"
 
 HKL_BEGIN_DECLS
 
@@ -34,23 +34,27 @@ struct _HklInterval
 	double max;
 };
 
-extern int hkl_interval_cmp(HklInterval const *self, HklInterval const *interval);
+extern HklInterval* hkl_interval_dup(const HklInterval *self);
 
-extern void hkl_interval_plus_interval(HklInterval *self, HklInterval const *interval);
+extern void hkl_interval_free(HklInterval *self);
+
+extern int hkl_interval_cmp(const HklInterval *self, const HklInterval *interval);
+
+extern void hkl_interval_plus_interval(HklInterval *self, const HklInterval *interval);
 
 extern void hkl_interval_plus_double(HklInterval *self, double const d);
 
-extern void hkl_interval_minus_interval(HklInterval *self, HklInterval const *interval);
+extern void hkl_interval_minus_interval(HklInterval *self, const HklInterval *interval);
 
 extern void hkl_interval_minus_double(HklInterval *self, double const d);
 
-extern void hkl_interval_times_interval(HklInterval *self, HklInterval const *interval);
+extern void hkl_interval_times_interval(HklInterval *self, const HklInterval *interval);
 
 extern void hkl_interval_times_double(HklInterval *self, double const d);
 
 extern void hkl_interval_divides_double(HklInterval *self, double const d);
 
-extern int hkl_interval_contain_zero(HklInterval const *self);
+extern int hkl_interval_contain_zero(const HklInterval *self);
 
 extern void hkl_interval_cos(HklInterval *self);
 
@@ -64,7 +68,7 @@ extern void hkl_interval_tan(HklInterval *self);
 
 extern void hkl_interval_atan(HklInterval *self);
 
-extern double hkl_interval_length(HklInterval const *self);
+extern double hkl_interval_length(const HklInterval *self);
 
 extern void hkl_interval_angle_restrict_symm(HklInterval *self);
 
diff --git a/hkl/hkl-interval.c b/hkl/hkl-interval.c
index e794f5e..231de19 100644
--- a/hkl/hkl-interval.c
+++ b/hkl/hkl-interval.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,22 +23,75 @@
 #include <math.h>
 #include <gsl/gsl_sf_trig.h>
 
-#include "hkl/hkl-interval.h"
+#include "hkl-interval-private.h"
+#include "hkl-macros-private.h"
 
-/** compare two intervals */
-int hkl_interval_cmp(HklInterval const *self, HklInterval const *interval)
+/**
+ * hkl_interval_dup: (skip)
+ * @self:
+ *
+ * copy an #HklInterval
+ *
+ * Returns:
+ **/
+HklInterval *hkl_interval_dup(const HklInterval *self)
+{
+	if(!self)
+		return NULL;
+
+	HklInterval *dup = HKL_MALLOC(HklInterval);
+
+	*dup = *self;
+
+	return dup;
+}
+
+/**
+ * hkl_interval_free: (skip)
+ * @self:
+ *
+ * delete an #HklInterval
+ **/
+void hkl_interval_free(HklInterval *self)
+{
+	if(self)
+		free(self);
+}
+
+/**
+ * hkl_interval_cmp: (skip)
+ * @self:
+ * @interval:
+ *
+ * compare two intervals
+ *
+ * Returns:
+ **/
+int hkl_interval_cmp(const HklInterval *self, const HklInterval *interval)
 {
 	return self->min == interval->min && self->max == interval->max;
 }
 
-/** add two intervals */
-void hkl_interval_plus_interval(HklInterval *self, HklInterval const *interval)
+/**
+ * hkl_interval_plus_interval: (skip)
+ * @self:
+ * @interval:
+ *
+ * add two ontervals
+ **/
+void hkl_interval_plus_interval(HklInterval *self, const HklInterval *interval)
 {
 	self->min += interval->min;
 	self->max += interval->max;
 }
 
-/** add to an interval a double */
+/**
+ * hkl_interval_plus_double: (skip)
+ * @self:
+ * @d:
+ *
+ * add to an interval a double
+ **/
 void hkl_interval_plus_double(HklInterval *self, double const d)
 {
 	self->min += d;
@@ -46,20 +99,41 @@ void hkl_interval_plus_double(HklInterval *self, double const d)
 }
 
 
-void hkl_interval_minus_interval(HklInterval *self, HklInterval const *interval)
+/**
+ * hkl_interval_minus_interval: (skip)
+ * @self:
+ * @interval:
+ *
+ * substract two #HklInterval
+ **/
+void hkl_interval_minus_interval(HklInterval *self, const HklInterval *interval)
 {
 	self->min -= interval->max;
 	self->max -= interval->min;
 }
 
 
+/**
+ * hkl_interval_minus_double: (skip)
+ * @self:
+ * @d:
+ *
+ * subst a double to an #HklInterval
+ **/
 void hkl_interval_minus_double(HklInterval *self, double const d)
 {
 	self->min -= d;
 	self->max -= d;
 }
 
-void hkl_interval_times_interval(HklInterval *self, HklInterval const *interval)
+/**
+ * hkl_interval_times_interval: (skip)
+ * @self:
+ * @interval:
+ *
+ * multiply two #HklInterval
+ **/
+void hkl_interval_times_interval(HklInterval *self, const HklInterval *interval)
 {
 	double min;
 	double max;
@@ -88,6 +162,13 @@ void hkl_interval_times_interval(HklInterval *self, HklInterval const *interval)
 	self->max = max;
 }
 
+/**
+ * hkl_interval_times_double: (skip)
+ * @self:
+ * @d:
+ *
+ * multiply an #HklInterval by a double
+ **/
 void hkl_interval_times_double(HklInterval *self, double const d)
 {
 	double min;
@@ -103,6 +184,13 @@ void hkl_interval_times_double(HklInterval *self, double const d)
 	self->max = max;
 }
 
+/**
+ * hkl_interval_divides_double: (skip)
+ * @self:
+ * @d:
+ *
+ * divide an #HklInterval by a double
+ **/
 void hkl_interval_divides_double(HklInterval *self, double const d)
 {
 	double min = self->min / d;
@@ -116,6 +204,14 @@ void hkl_interval_divides_double(HklInterval *self, double const d)
 	self->max = max;
 }
 
+/**
+ * hkl_interval_contain_zero: (skip)
+ * @self:
+ *
+ * check if an #HklInterval contain zero
+ *
+ * Returns:
+ **/
 int hkl_interval_contain_zero(HklInterval const *self)
 {
 	if (self->min <= 0 && self->max >= 0)
@@ -124,6 +220,12 @@ int hkl_interval_contain_zero(HklInterval const *self)
 		return HKL_FALSE;
 }
 
+/**
+ * hkl_interval_cos: (skip)
+ * @self:
+ *
+ * compute the cosinus of an #HklInterval
+ **/
 void hkl_interval_cos(HklInterval *self)
 {
 	double min = 0;
@@ -266,6 +368,12 @@ void hkl_interval_cos(HklInterval *self)
 	self->max = max;
 }
 
+/**
+ * hkl_interval_acos: (skip)
+ * @self:
+ *
+ * compute the arc cosinus of an #HklInterval
+ **/
 void hkl_interval_acos(HklInterval *self)
 {
 	double tmp;
@@ -276,6 +384,12 @@ void hkl_interval_acos(HklInterval *self)
 }
 
 
+/**
+ * hkl_interval_sin: (skip)
+ * @self:
+ *
+ * compute the sin of an #HklInterval
+ **/
 void hkl_interval_sin(HklInterval *self)
 {
 	double min = 0;
@@ -426,12 +540,24 @@ void hkl_interval_sin(HklInterval *self)
 	self->max = max;
 }
 
+/**
+ * hkl_interval_asin: (skip)
+ * @self:
+ *
+ * compute the arc sinus of an #HklInterval
+ **/
 void hkl_interval_asin(HklInterval *self)
 {
 	self->min = asin(self->min);
 	self->max = asin(self->max);
 }
 
+/**
+ * hkl_interval_tan: (skip)
+ * @self:
+ *
+ * compute the tangente of an #HklInterval
+ **/
 void hkl_interval_tan(HklInterval *self)
 {
 	int quadrant_down = (int)floor(self->min / M_PI_2);
@@ -449,17 +575,37 @@ void hkl_interval_tan(HklInterval *self)
 	}
 }
 
+/**
+ * hkl_interval_atan: (skip)
+ * @self:
+ *
+ * compute the arc tangente of an #HklInterval
+ **/
 void hkl_interval_atan(HklInterval *self)
 {
 	self->min = atan(self->min);
 	self->max = atan(self->max);
 }
 
-double hkl_interval_length(HklInterval const *self)
+/**
+ * hkl_interval_length: (skip)
+ * @self:
+ *
+ * compute the length of an #HklInterval
+ *
+ * Returns:
+ **/
+double hkl_interval_length(const HklInterval *self)
 {
 	return self->max - self->min;
 }
 
+/**
+ * hkl_interval_angle_restrict_symm: (skip)
+ * @self:
+ *
+ * restrict an #HklInterval into -pi, pi
+ **/
 void hkl_interval_angle_restrict_symm(HklInterval *self)
 {
 	gsl_sf_angle_restrict_symm_e(&self->min);
diff --git a/hkl/hkl-detector-factory.h b/hkl/hkl-lattice-private.h
similarity index 63%
rename from hkl/hkl-detector-factory.h
rename to hkl/hkl-lattice-private.h
index d3b38a3..ff76acc 100644
--- a/hkl/hkl-detector-factory.h
+++ b/hkl/hkl-lattice-private.h
@@ -13,29 +13,37 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_DETECTOR_FACTORY_H__
-#define __HKL_DETECTOR_FACTORY_H__
+#ifndef __HKL_LATTICE_PRIVATE_H__
+#define __HKL_LATTICE_PRIVATE_H__
 
-#include <hkl/hkl-detector.h>
+#include <stdio.h>
+
+#include "hkl.h"
 
 HKL_BEGIN_DECLS
 
-enum _HklDetectorType
+struct _HklLattice
 {
-	HKL_DETECTOR_TYPE_0D
+	HklParameter *a;
+	HklParameter *b;
+	HklParameter *c;
+	HklParameter *alpha;
+	HklParameter *beta;
+	HklParameter *gamma;
 };
 
-typedef enum _HklDetectorType HklDetectorType;
+extern void hkl_lattice_lattice_set(HklLattice *self, const HklLattice *lattice);
 
+extern void hkl_lattice_randomize(HklLattice *self);
 
-extern HklDetector *hkl_detector_factory_new(HklDetectorType type);
+extern void hkl_lattice_fprintf(FILE *f, const HklLattice *self);
 
 HKL_END_DECLS
 
-#endif /* __HKL_DETECTOR_FACTORY_H__ */
+#endif /* __HKL_LATTICE_PRIVATE_H__ */
diff --git a/hkl/hkl-lattice.c b/hkl/hkl-lattice.c
index 44ce6a7..b03d3ac 100644
--- a/hkl/hkl-lattice.c
+++ b/hkl/hkl-lattice.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,8 +22,10 @@
 #include <stdlib.h>
 #include <math.h>
 
-#include "hkl/hkl-lattice.h"
-#include "hkl/hkl-unit.h"
+#include "hkl-lattice-private.h"
+#include "hkl-parameter-private.h"
+#include "hkl-matrix-private.h"
+#include "hkl-unit-private.h"
 
 /* private */
 
@@ -34,18 +36,31 @@ static int check_lattice_param(double a, double b, double c,
 		- cos(gamma)*cos(gamma) + 2. * cos(alpha)*cos(beta)*cos(gamma);
 
 	if (D < 0.)
-		return HKL_FAIL;
+		return HKL_FALSE;
 	else
-		return HKL_SUCCESS;
+		return HKL_TRUE;
 }
 
 /* public */
 
+/**
+ * hkl_lattice_new:
+ * @a: the length of the a parameter
+ * @b: the length of the b parameter
+ * @c: the length of the c parameter
+ * @alpha: the angle between b and c (radian)
+ * @beta: the angle between a and c (radian)
+ * @gamma: the angle between a and b (radian)
+ *
+ * constructor
+ *
+ * Returns: a new HklLattice
+ **/
 HklLattice *hkl_lattice_new(double a, double b, double c,
 			    double alpha, double beta, double gamma)
 {
 	HklLattice *self = NULL;
-	if(!check_lattice_param(a, b, c, alpha, beta, gamma)) {
+	if(check_lattice_param(a, b, c, alpha, beta, gamma)) {
 		self = HKL_MALLOC(HklLattice);
 
 		self->a = hkl_parameter_new("a", 0, a, a+10,
@@ -74,15 +89,23 @@ HklLattice *hkl_lattice_new(double a, double b, double c,
 						&hkl_unit_angle_deg);
 	}
 
-	return self;	
+	return self;
 }
 
-HklLattice *hkl_lattice_new_copy(HklLattice const *self)
+/**
+ * hkl_lattice_new_copy: (skip)
+ * @self:
+ *
+ * copy constructor
+ *
+ * Returns:
+ **/
+HklLattice *hkl_lattice_new_copy(const HklLattice *self)
 {
 	HklLattice *copy = NULL;
 
 	copy = HKL_MALLOC(HklLattice);
-	
+
 	copy->a = hkl_parameter_new_copy(self->a);
 	copy->b = hkl_parameter_new_copy(self->b);
 	copy->c = hkl_parameter_new_copy(self->c);
@@ -90,15 +113,28 @@ HklLattice *hkl_lattice_new_copy(HklLattice const *self)
 	copy->beta = hkl_parameter_new_copy(self->beta);
 	copy->gamma = hkl_parameter_new_copy(self->gamma);
 
-	return copy;	
+	return copy;
 }
 
+/**
+ * hkl_lattice_new_default: (skip)
+ *
+ * default constructor
+ *
+ * Returns:
+ **/
 HklLattice* hkl_lattice_new_default(void)
 {
 	return hkl_lattice_new(1.54, 1.54, 1.54,
 			       90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
 }
 
+/**
+ * hkl_lattice_free: (skip)
+ * @self:
+ *
+ * destructor
+ **/
 void hkl_lattice_free(HklLattice *self)
 {
 	hkl_parameter_free(self->a);
@@ -110,28 +146,204 @@ void hkl_lattice_free(HklLattice *self)
 	free(self);
 }
 
+/**
+ * hkl_lattice_a_get: (skip)
+ * @self: the this ptr
+ **/
+const HklParameter *hkl_lattice_a_get(const HklLattice *self)
+{
+	return self->a;
+}
+
+/**
+ * hkl_lattice_a_set: (skip)
+ * @self: the this ptr
+ * @parameter: the parameter to set
+ **/
+void hkl_lattice_a_set(HklLattice *self, const HklParameter *parameter)
+{
+	hkl_parameter_init_copy(self->a, parameter);
+}
+
+/**
+ * hkl_lattice_b_get: (skip)
+ * @self: the this ptr
+ **/
+const HklParameter *hkl_lattice_b_get(const HklLattice *self)
+{
+	return self->b;
+}
+
+/**
+ * hkl_lattice_b_set: (skip)
+ * @self: the this ptr
+ * @parameter: the parameter to set
+ **/
+void hkl_lattice_b_set(HklLattice *self, const HklParameter *parameter)
+{
+	hkl_parameter_init_copy(self->b, parameter);
+}
+
+/**
+ * hkl_lattice_c_get: (skip)
+ * @self: the this ptr
+ **/
+const HklParameter *hkl_lattice_c_get(const HklLattice *self)
+{
+	return self->c;
+}
+
+/**
+ * hkl_lattice_c_set: (skip)
+ * @self: the this ptr
+ * @parameter: the parameter to set
+ **/
+void hkl_lattice_c_set(HklLattice *self, const HklParameter *parameter)
+{
+	hkl_parameter_init_copy(self->c, parameter);
+}
+
+/**
+ * hkl_lattice_alpha_get: (skip)
+ * @self: the this ptr
+ **/
+const HklParameter *hkl_lattice_alpha_get(const HklLattice *self)
+{
+	return self->alpha;
+}
+
+/**
+ * hkl_lattice_alpha_set: (skip)
+ * @self: the this ptr
+ * @parameter: the parameter to set
+ **/
+void hkl_lattice_alpha_set(HklLattice *self, const HklParameter *parameter)
+{
+	hkl_parameter_init_copy(self->alpha, parameter);
+}
+
+/**
+ * hkl_lattice_beta_get: (skip)
+ * @self: the this ptr
+ **/
+const HklParameter *hkl_lattice_beta_get(const HklLattice *self)
+{
+	return self->beta;
+}
+
+/**
+ * hkl_lattice_beta_set: (skip)
+ * @self: the this ptr
+ * @parameter: the parameter to set
+ **/
+void hkl_lattice_beta_set(HklLattice *self, const HklParameter *parameter)
+{
+	hkl_parameter_init_copy(self->beta, parameter);
+}
+
+/**
+ * hkl_lattice_gamma_get: (skip)
+ * @self: the this ptr
+ **/
+const HklParameter *hkl_lattice_gamma_get(const HklLattice *self)
+{
+	return self->gamma;
+}
+
+/**
+ * hkl_lattice_gamma_set: (skip)
+ * @self: the this ptr
+ * @parameter: the parameter to set
+ **/
+void hkl_lattice_gamma_set(HklLattice *self, const HklParameter *parameter)
+{
+	hkl_parameter_init_copy(self->gamma, parameter);
+}
+
+/**
+ * hkl_lattice_lattice_set: (skip)
+ * @self: the this ptr
+ * @lattice: the lattice to set from.
+ **/
+void hkl_lattice_lattice_set(HklLattice *self, const HklLattice *lattice)
+{
+	if (self == lattice)
+		return;
+
+	hkl_parameter_init_copy(self->a, lattice->a);
+	hkl_parameter_init_copy(self->b, lattice->b);
+	hkl_parameter_init_copy(self->c, lattice->c);
+	hkl_parameter_init_copy(self->alpha, lattice->alpha);
+	hkl_parameter_init_copy(self->beta, lattice->beta);
+	hkl_parameter_init_copy(self->gamma, lattice->gamma);
+}
+
+/**
+ * hkl_lattice_set:
+ * @self:
+ * @a:
+ * @b:
+ * @c:
+ * @alpha:
+ * @beta:
+ * @gamma:
+ *
+ * set the lattice parameters
+ *
+ * Returns:
+ **/
 int hkl_lattice_set(HklLattice *self,
 		    double a, double b, double c,
 		    double alpha, double beta, double gamma)
 {
-	int res = HKL_FAIL;
-
-	if(!check_lattice_param(a, b, c, alpha, beta, gamma)) {
-		self->a->value = a;
-		self->b->value = b;
-		self->c->value = c;
-		self->alpha->value = alpha;
-		self->beta->value = beta;
-		self->gamma->value = gamma;
-		res = HKL_SUCCESS; 
-	}
-	return res;
+	if(!check_lattice_param(a, b, c, alpha, beta, gamma))
+		return HKL_FALSE;
+
+	hkl_parameter_value_set(self->a, a, NULL);
+	hkl_parameter_value_set(self->b, b, NULL);
+	hkl_parameter_value_set(self->c, c, NULL);
+	hkl_parameter_value_set(self->alpha, alpha, NULL);
+	hkl_parameter_value_set(self->beta, beta, NULL);
+	hkl_parameter_value_set(self->gamma, gamma, NULL);
+
+	return HKL_TRUE;
 }
 
-/* 
- * Get the B matrix from the l parameters 
- */
-int hkl_lattice_get_B(HklLattice const *self, HklMatrix *B)
+/**
+ * hkl_lattice_get:
+ * @self:
+ * @a: (out caller-allocates):
+ * @b: (out caller-allocates):
+ * @c: (out caller-allocates):
+ * @alpha: (out caller-allocates):
+ * @beta: (out caller-allocates):
+ * @gamma: (out caller-allocates):
+ *
+ * get the lattice parameters
+ * Return value: all the parameters
+ **/
+void hkl_lattice_get(const HklLattice *self,
+		     double *a, double *b, double *c,
+		     double *alpha, double *beta, double *gamma)
+{
+	*a = hkl_parameter_value_get(self->a);
+	*b = hkl_parameter_value_get(self->b);
+	*c = hkl_parameter_value_get(self->c);
+	*alpha = hkl_parameter_value_get(self->alpha);
+	*beta = hkl_parameter_value_get(self->beta);
+	*gamma = hkl_parameter_value_get(self->gamma);
+}
+
+/**
+ * hkl_lattice_get_B: (skip)
+ * @self:
+ * @B: (out): where to store the B matrix
+ *
+ * Get the B matrix from the lattice parameters
+ *
+ * Returns:
+ **/
+int hkl_lattice_get_B(const HklLattice *self, HklMatrix *B)
 {
 	double D;
 	double c_alpha, s_alpha;
@@ -139,26 +351,26 @@ int hkl_lattice_get_B(HklLattice const *self, HklMatrix *B)
 	double c_gamma, s_gamma;
 	double b11, b22, tmp;
 
-	c_alpha = cos(self->alpha->value);
-	c_beta = cos(self->beta->value);
-	c_gamma = cos(self->gamma->value);
+	c_alpha = cos(hkl_parameter_value_get(self->alpha));
+	c_beta = cos(hkl_parameter_value_get(self->beta));
+	c_gamma = cos(hkl_parameter_value_get(self->gamma));
 	D = 1 - c_alpha*c_alpha - c_beta*c_beta - c_gamma*c_gamma
 		+ 2*c_alpha*c_beta*c_gamma;
 
 	if (D > 0.)
 		D = sqrt(D);
 	else
-		return HKL_FAIL;
+		return HKL_FALSE;
 
-	s_alpha = sin(self->alpha->value);
-	s_beta  = sin(self->beta->value);
-	s_gamma = sin(self->gamma->value);
+	s_alpha = sin(hkl_parameter_value_get(self->alpha));
+	s_beta  = sin(hkl_parameter_value_get(self->beta));
+	s_gamma = sin(hkl_parameter_value_get(self->gamma));
 
-	b11 = HKL_TAU / (self->b->value * s_alpha);
-	b22 = HKL_TAU / self->c->value;
+	b11 = HKL_TAU / (hkl_parameter_value_get(self->b) * s_alpha);
+	b22 = HKL_TAU / hkl_parameter_value_get(self->c);
 	tmp = b22 / s_alpha;
 
-	B->data[0][0] = HKL_TAU * s_alpha / (self->a->value * D);
+	B->data[0][0] = HKL_TAU * s_alpha / (hkl_parameter_value_get(self->a) * D);
 	B->data[0][1] = b11 / D * (c_alpha*c_beta - c_gamma);
 	B->data[0][2] = tmp / D * (c_gamma*c_alpha - c_beta);
 
@@ -170,18 +382,18 @@ int hkl_lattice_get_B(HklLattice const *self, HklMatrix *B)
 	B->data[2][1] = 0;
 	B->data[2][2] = b22;
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
 /**
- * hkl_lattice_get_1_B:
+ * hkl_lattice_get_1_B: (skip)
  * @self: the @HklLattice
- * @B: the @HklMatrix returned
+ * @B: (out): where to store the 1/B matrix
  *
- * Compute the invert of B (needed by the hkl_sample_set_UB method)
+ * Compute the invert of B (needed by the hkl_sample_UB_set method)
  * should be optimized
  *
- * Returns: HKL_SUCCESS or HKL_FAIL depending of the success of the
+ * Returns: HKL_TRUE or HKL_FALSE depending of the success of the
  * computation.
  **/
 int hkl_lattice_get_1_B(const HklLattice *self, HklMatrix *B)
@@ -195,7 +407,7 @@ int hkl_lattice_get_1_B(const HklLattice *self, HklMatrix *B)
 	double f;
 
 	if(!self || !B)
-		return HKL_FAIL;
+		return HKL_FALSE;
 
 	/*
 	 * first compute the B matrix
@@ -227,10 +439,20 @@ int hkl_lattice_get_1_B(const HklLattice *self, HklMatrix *B)
 	B->data[2][1] = 0;
 	B->data[2][2] = 1 / f;
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
-int hkl_lattice_reciprocal(HklLattice const *self, HklLattice *reciprocal)
+/**
+ * hkl_lattice_reciprocal:
+ * @self: the this ptr
+ * @reciprocal: the lattice where the result will be computed
+ *
+ * compute the reciprocal #HklLattice and put the result id the
+ * provided @reciprocal parameter
+ *
+ * Returns: 0 or 1 if it succeed.
+ **/
+int hkl_lattice_reciprocal(const HklLattice *self, HklLattice *reciprocal)
 {
 	double c_alpha, c_beta, c_gamma;
 	double s_alpha, s_beta, s_gamma;
@@ -239,20 +461,20 @@ int hkl_lattice_reciprocal(HklLattice const *self, HklLattice *reciprocal)
 	double s_beta_s_gamma, s_gamma_s_alpha, s_alpha_s_beta;
 	double D;
 
-	c_alpha = cos(self->alpha->value);
-	c_beta  = cos(self->beta->value);
-	c_gamma = cos(self->gamma->value);
+	c_alpha = cos(hkl_parameter_value_get(self->alpha));
+	c_beta  = cos(hkl_parameter_value_get(self->beta));
+	c_gamma = cos(hkl_parameter_value_get(self->gamma));
 	D = 1 - c_alpha*c_alpha - c_beta*c_beta - c_gamma*c_gamma
 		+ 2*c_alpha*c_beta*c_gamma;
 
 	if (D > 0.)
 		D = sqrt(D);
 	else
-		return HKL_FAIL;
+		return HKL_FALSE;
 
-	s_alpha = sin(self->alpha->value);
-	s_beta  = sin(self->beta->value);
-	s_gamma = sin(self->gamma->value);
+	s_alpha = sin(hkl_parameter_value_get(self->alpha));
+	s_beta  = sin(hkl_parameter_value_get(self->beta));
+	s_gamma = sin(hkl_parameter_value_get(self->gamma));
 
 	s_beta_s_gamma  = s_beta  * s_gamma;
 	s_gamma_s_alpha = s_gamma * s_alpha;
@@ -265,16 +487,23 @@ int hkl_lattice_reciprocal(HklLattice const *self, HklLattice *reciprocal)
 	s_beta2 = D / s_gamma_s_alpha;
 	s_beta3 = D / s_alpha_s_beta;
 
-	reciprocal->a->value = HKL_TAU * s_alpha / (self->a->value * D);
-	reciprocal->b->value = HKL_TAU * s_beta  / (self->b->value * D);
-	reciprocal->c->value = HKL_TAU * s_gamma / (self->c->value * D);
-	reciprocal->alpha->value = atan2(s_beta1, c_beta1);
-	reciprocal->beta->value  = atan2(s_beta2, c_beta2);
-	reciprocal->gamma->value = atan2(s_beta3, c_beta3);
+	hkl_lattice_set(reciprocal,
+			HKL_TAU * s_alpha / (hkl_parameter_value_get(self->a) * D),
+			HKL_TAU * s_beta  / (hkl_parameter_value_get(self->b) * D),
+			HKL_TAU * s_gamma / (hkl_parameter_value_get(self->c) * D),
+			atan2(s_beta1, c_beta1),
+			atan2(s_beta2, c_beta2),
+			atan2(s_beta3, c_beta3));
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
+/**
+ * hkl_lattice_randomize: (skip)
+ * @self:
+ *
+ * randomize the lattice
+ **/
 void hkl_lattice_randomize(HklLattice *self)
 {
 	static HklVector vector_x = {{1, 0, 0}};
@@ -301,44 +530,50 @@ void hkl_lattice_randomize(HklLattice *self)
 
 			/* randomize b */
 			hkl_vector_randomize_vector(&axe, &a);
-			hkl_vector_rotated_around_vector(&b, &axe, self->gamma->value);
+			hkl_vector_rotated_around_vector(&b, &axe,
+							 hkl_parameter_value_get(self->gamma));
 
 			/* randomize c */
 			hkl_vector_randomize_vector(&axe, &a);
-			hkl_vector_rotated_around_vector(&c, &axe, self->beta->value);
+			hkl_vector_rotated_around_vector(&c, &axe,
+							 hkl_parameter_value_get(self->beta));
 
 			/* compute the alpha angle. */
-			self->alpha->value = hkl_vector_angle(&b, &c);
+			hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c), NULL);
 		} else if (self->beta->fit) {
 			/* beta */
 			a = b = vector_x;
 
 			/* randomize b */
 			hkl_vector_randomize_vector(&axe, &a);
-			hkl_vector_rotated_around_vector(&b, &axe, self->gamma->value);
+			hkl_vector_rotated_around_vector(&b, &axe,
+							 hkl_parameter_value_get(self->gamma));
 
 			/* randomize c */
 			c = b;
 			hkl_vector_randomize_vector(&axe, &b);
-			hkl_vector_rotated_around_vector(&c, &axe, self->alpha->value);
+			hkl_vector_rotated_around_vector(&c, &axe,
+							 hkl_parameter_value_get(self->alpha));
 
 			/* compute beta */
-			self->beta->value = hkl_vector_angle(&a, &c);
+			hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c), NULL);
 		} else {
 			/* gamma */
 			a = c = vector_x;
 
 			/* randomize c */
 			hkl_vector_randomize_vector(&axe, &a);
-			hkl_vector_rotated_around_vector(&c, &axe, self->beta->value);
+			hkl_vector_rotated_around_vector(&c, &axe,
+							 hkl_parameter_value_get(self->beta));
 
 			/* randomize b */
 			b = c;
 			hkl_vector_randomize_vector(&axe, &c);
-			hkl_vector_rotated_around_vector(&b, &axe, self->alpha->value);
+			hkl_vector_rotated_around_vector(&b, &axe,
+							 hkl_parameter_value_get(self->alpha));
 
 			/* compute gamma */
-			self->gamma->value = hkl_vector_angle(&a, &b);
+			hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b), NULL);
 		}
 		break;
 	case 2:
@@ -349,26 +584,28 @@ void hkl_lattice_randomize(HklLattice *self)
 
 				/* randomize b */
 				hkl_vector_randomize_vector(&axe, &a);
-				hkl_vector_rotated_around_vector(&b, &axe, self->gamma->value);
+				hkl_vector_rotated_around_vector(&b, &axe,
+								 hkl_parameter_value_get(self->gamma));
 
 				/* randomize c */
 				hkl_vector_randomize_vector_vector(&c, &a, &b);
 
-				self->alpha->value = hkl_vector_angle(&b, &c);
-				self->beta->value = hkl_vector_angle(&a, &c);
+				hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c), NULL);
+				hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c), NULL);
 			} else {
 				/* alpha + gamma */
 				a = c = vector_x;
 
 				/* randomize c */
 				hkl_vector_randomize_vector(&axe, &a);
-				hkl_vector_rotated_around_vector(&c, &axe, self->beta->value);
+				hkl_vector_rotated_around_vector(&c, &axe,
+								 hkl_parameter_value_get(self->beta));
 
 				/* randomize c */
 				hkl_vector_randomize_vector_vector(&b, &a, &c);
 
-				self->alpha->value = hkl_vector_angle(&b, &c);
-				self->gamma->value = hkl_vector_angle(&a, &b);
+				hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c), NULL);
+				hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b), NULL);
 			}
 		} else {
 			/* beta + gamma */
@@ -376,13 +613,14 @@ void hkl_lattice_randomize(HklLattice *self)
 
 			/* randomize c */
 			hkl_vector_randomize_vector(&axe, &b);
-			hkl_vector_rotated_around_vector(&c, &axe, self->alpha->value);
+			hkl_vector_rotated_around_vector(&c, &axe,
+							 hkl_parameter_value_get(self->alpha));
 
 			/* randomize c */
 			hkl_vector_randomize_vector_vector(&a, &b, &c);
 
-			self->beta->value = hkl_vector_angle(&a, &c);
-			self->gamma->value = hkl_vector_angle(&a, &b);
+			hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c), NULL);
+			hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b), NULL);
 		}
 		break;
 	case 3:
@@ -390,13 +628,20 @@ void hkl_lattice_randomize(HklLattice *self)
 		hkl_vector_randomize_vector(&b, &a);
 		hkl_vector_randomize_vector_vector(&c, &b, &a);
 
-		self->alpha->value = hkl_vector_angle(&b, &c);
-		self->beta->value = hkl_vector_angle(&a, &c);
-		self->gamma->value = hkl_vector_angle(&a, &b);
+		hkl_parameter_value_set(self->alpha, hkl_vector_angle(&b, &c), NULL);
+		hkl_parameter_value_set(self->beta, hkl_vector_angle(&a, &c), NULL);
+		hkl_parameter_value_set(self->gamma, hkl_vector_angle(&a, &b), NULL);
 		break;
 	}
 }
 
+/**
+ * hkl_lattice_fprintf: (skip)
+ * @f:
+ * @self:
+ *
+ * print into a file the lattice.
+ **/
 void hkl_lattice_fprintf(FILE *f, HklLattice const *self)
 {
 	fprintf(f, "\n");
diff --git a/hkl/hkl-lattice.h b/hkl/hkl-lattice.h
deleted file mode 100644
index 40219c9..0000000
--- a/hkl/hkl-lattice.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_LATTICE_H__
-#define __HKL_LATTICE_H__
-
-#include <hkl/hkl-parameter.h>
-#include <hkl/hkl-matrix.h>
-
-HKL_BEGIN_DECLS
-
-typedef struct _HklLattice HklLattice;
-
-struct _HklLattice
-{
-	HklParameter *a;
-	HklParameter *b;
-	HklParameter *c;
-	HklParameter *alpha;
-	HklParameter *beta;
-	HklParameter *gamma;
-};
-
-extern HklLattice *hkl_lattice_new(double a, double b, double c,
-				   double alpha, double beta, double gamma);
-extern HklLattice *hkl_lattice_new_copy(HklLattice const *self);
-extern HklLattice *hkl_lattice_new_default(void);
-
-extern void hkl_lattice_free(HklLattice *self);
-
-extern int hkl_lattice_set(HklLattice *self,
-			   double a, double b, double c,
-			   double alpha, double beta, double gamma);
-
-extern int hkl_lattice_get_B(HklLattice const *self, HklMatrix *B);
-
-extern int hkl_lattice_get_1_B(const HklLattice *self, HklMatrix *B);
-
-extern int hkl_lattice_reciprocal(HklLattice const *self, HklLattice *r);
-
-extern void hkl_lattice_randomize(HklLattice *self);
-
-extern void hkl_lattice_fprintf(FILE *f, HklLattice const *self);
-
-HKL_END_DECLS
-
-#endif /* __HKL_LATTICE_H__ */
diff --git a/hkl/hkl-list.h b/hkl/hkl-list.h
deleted file mode 100644
index 597230e..0000000
--- a/hkl/hkl-list.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_LIST_H__
-#define __HKL_LIST_H__
-
-#include <stdlib.h>
-#include <hkl/hkl-macros.h>
-
-HKL_BEGIN_DECLS
-
-#define HKL_LIST_LEN(array) array ## _len
-
-#define HKL_LIST(type, name) type *name; size_t HKL_LIST_LEN(name)
-
-#define HKL_LIST_INIT(array) array = NULL, HKL_LIST_LEN(array) = 0
-
-#define HKL_LIST_ALLOC(array, len) do{			\
-		array = malloc((len) * sizeof(*array));	\
-		HKL_LIST_LEN(array) = (len);		\
-	}while(0)
-
-#define HKL_LIST_COPY(dst, src) memcpy(dst, src, HKL_LIST_LEN(src) * sizeof(*src))
-
-#define HKL_LIST_FREE(array) free(array), HKL_LIST_INIT(array)
-
-#define HKL_LIST_FREE_DESTRUCTOR(array, destructor) do{		\
-		if(HKL_LIST_LEN(array)){			\
-			size_t i;				\
-			for(i=0; i<HKL_LIST_LEN(array); ++i)	\
-				destructor(array[i]);		\
-		}						\
-		HKL_LIST_FREE(array);				\
-	}while(0)
-
-#define HKL_LIST_RESIZE(array, len) do{				\
-		array = realloc(array, (len) * sizeof(*array));	\
-		HKL_LIST_LEN(array) = (len);			\
-	}while(0)
-
-#define HKL_LIST_ADD_VALUE(array, value) do{				\
-		size_t len = HKL_LIST_LEN(array);			\
-		HKL_LIST_RESIZE(array, len + 1);			\
-		array[len] = value;					\
-	}while(0)
-
-#define HKL_LIST_DEL(array, idx) do{					\
-		HKL_LIST_LEN(array) = HKL_LIST_LEN(array) - 1;		\
-		if (idx < HKL_LIST_LEN(array))				\
-			memmove(&array[idx], &array[idx] + 1, sizeof(*array) * (HKL_LIST_LEN(array) - idx)); \
-	}while(0)
-
-#define HKL_LIST_DEL_DESTRUCTOR(array, idx, destructor) do{ \
-		destructor(array[idx]); \
-		HKL_LIST_DEL(array, idx); \
-	}while(0)
-
-
-#define HKL_LIST_DEL_ITEM_DESTRUCTOR(array, item, destructor) do{	\
-		size_t i;						\
-		for(i=0; i<HKL_LIST_LEN(array); ++i)			\
-			if(array[i] == item){				\
-				destructor(array[i]);			\
-				HKL_LIST_DEL(array, i);			\
-			}						\
-	}while(0)
-
-HKL_END_DECLS
-
-#endif
diff --git a/hkl/hkl-macros.h b/hkl/hkl-macros-private.h
similarity index 53%
rename from hkl/hkl-macros.h
rename to hkl/hkl-macros-private.h
index 120cc36..1924a92 100644
--- a/hkl/hkl-macros.h
+++ b/hkl/hkl-macros-private.h
@@ -13,72 +13,32 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_MACROS_H__
-#define __HKL_MACROS_H__
+#ifndef __HKL_MACROS_PRIVATE_H__
+#define __HKL_MACROS_PRIVATE_H__
 
-#include <stdlib.h>
-#include <gsl/gsl_math.h>
-
-/* Guard C code in headers, while including them from C++ */
-#ifdef __cplusplus
-# define HKL_BEGIN_DECLS  extern "C" {
-# define HKL_END_DECLS    }
-#else
-# define HKL_BEGIN_DECLS
-# define HKL_END_DECLS
-#endif
-
-/* add the win32 portability part */
-#if _MSC_VER && _MSC_VER <= 1200
-# include <float.h>
-# define INFINITY DBL_MAX
-# define M_PI     3.14159265358979323846264338328
-# define M_PI_2   1.57079632679489661923132169164
-#endif
-
-/* common part */
-#define HKL_MAJOR 2
-#define HKL_MINOR 3
-#define HKL_PATCH 0
-
-#define HKL_VERSION (HKL_MAJOR * 10000 + HKL_MINOR * 100 + HKL_PATCH)
-
-#define HKL_TRUE 1
-#define HKL_FALSE 0
-
-#define HKL_SUCCESS 0
-#define HKL_FAIL -1
-
-#define HKL_TINY 1e-7
-#define HKL_EPSILON 1e-6
-#define HKL_DEGTORAD (M_PI/180.)
-#define HKL_RADTODEG (180./M_PI)
-
-/* tau = 2pi or 1 */
-#define HKL_TAU (2. * M_PI)
-/* #define HKL_TAU 1 */
+#include "hkl.h"
 
 /* specific part for the eulerian -> kappa conversion */
 #define HKL_EULERIAN_KAPPA_SOLUTION 1
 
 /* the assert method */
-#ifndef NDEBUG
+#if !defined(NDEBUG) && !_MSC_VER
 # include <execinfo.h>
-# include <assert.h> 
+# include <assert.h>
 # define hkl_assert(x) do{ if (!(x)) {hkl_printbt(); assert(x); } } while(0)
 #else
 # define hkl_assert(x)
 #endif
 
 /* use for the printf format methods took from glib */
-#define G_GNUC_PRINTF( format_idx, arg_idx )    \
-  __attribute__((__format__ (__printf__, format_idx, arg_idx)))
+#define G_GNUC_PRINTF( format_idx, arg_idx )				\
+	__attribute__((__format__ (__printf__, format_idx, arg_idx)))
 
 /* use for the hkl_list */
 #define alloc_nr(x) (((x)+16)*3/2)
@@ -90,26 +50,30 @@
  *
  * DO NOT USE any expression with side-effect for 'x' or 'alloc'.
  */
-#define ALLOC_GROW(x, nr, alloc) \
-	do { \
-		if ((nr) > alloc) { \
-			if (alloc_nr(alloc) < (nr)) \
-				alloc = (nr); \
-			else \
-				alloc = alloc_nr(alloc); \
+#define ALLOC_GROW(x, nr, alloc)				\
+	do {							\
+		if ((nr) > alloc) {				\
+			if (alloc_nr(alloc) < (nr))		\
+				alloc = (nr);			\
+			else					\
+				alloc = alloc_nr(alloc);	\
 			x = realloc((x), alloc * sizeof(*(x))); \
-		} \
+		}						\
 	} while(0)
 
-#ifdef __GNUC__
-# define NORETURN __attribute__((__noreturn__))
-#else
-# define NORETURN
-# ifndef __attribute__
-#  define __attribute__(x)
+#ifndef NORETURN
+# ifdef __GNUC__
+#  define NORETURN __attribute__((__noreturn__))
+# else
+#  define NORETURN
+#  ifndef __attribute__
+#   define __attribute__(x)
+#  endif
 # endif
 #endif
 
+#define hkl_return_val_if_fail(expr, val) if (expr) { } else return val
+
 HKL_BEGIN_DECLS
 
 extern void hkl_printbt(void);
@@ -119,6 +83,6 @@ void *_hkl_malloc(int size, const char *error);
 HKL_END_DECLS
 
 /* malloc method */
-#define HKL_MALLOC(type) _hkl_malloc(sizeof(type), "Can not allocate memory for a " #type)
+#define HKL_MALLOC(type) (type *)_hkl_malloc(sizeof(type), "Can not allocate memory for a " #type)
 
 #endif
diff --git a/hkl/hkl-macros.c b/hkl/hkl-macros.c
index 20bd0c7..3b647f4 100644
--- a/hkl/hkl-macros.c
+++ b/hkl/hkl-macros.c
@@ -13,16 +13,18 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-
 #include <stdio.h>
-#include <hkl/hkl-macros.h>
 
+#include "hkl.h"
+#include "hkl-macros-private.h"
+
+#ifndef _MSC_VER
 void hkl_printbt(void)
 {
 	void *array[20];
@@ -39,6 +41,20 @@ void hkl_printbt(void)
 
 	free(strings);
 }
+#else
+int vasprintf(char **strp, const char *fmt, va_list ap)
+{
+	int len;
+	char *buffer;
+
+	len = vsnprintf(*strp, 0, fmt, ap);
+	buffer = malloc(len);
+	vsnprintf(buffer, len-1, fmt, ap);
+	*strp = buffer;
+
+	return len;
+}
+#endif
 
 __inline__ void *_hkl_malloc(int size, const char *error)
 {
@@ -50,5 +66,5 @@ __inline__ void *_hkl_malloc(int size, const char *error)
 		exit(128);
 	}
 
-	return tmp; 
+	return tmp;
 }
diff --git a/hkl/hkl-matrix.h b/hkl/hkl-matrix-private.h
similarity index 76%
rename from hkl/hkl-matrix.h
rename to hkl/hkl-matrix-private.h
index f962d5c..4594663 100644
--- a/hkl/hkl-matrix.h
+++ b/hkl/hkl-matrix-private.h
@@ -13,19 +13,19 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_MATRIX_H__
-#define __HKL_MATRIX_H__
+#ifndef __HKL_MATRIX_PRIVATE_H__
+#define __HKL_MATRIX_PRIVATE_H__
 
 #include <stdio.h>
-#include <hkl/hkl-macros.h>
-#include <hkl/hkl-vector.h>
 
+#include "hkl.h"
+#include "hkl-vector-private.h"
 
 HKL_BEGIN_DECLS
 
@@ -34,26 +34,21 @@ struct _HklMatrix
 	double data[3][3];
 };
 
-extern void hkl_matrix_init(HklMatrix *self,
-			    double m11, double m12, double m13,
-			    double m21, double m22, double m23,
-			    double m31, double m32, double m33);
+extern HklMatrix *hkl_matrix_dup(const HklMatrix* self);
+
+extern void hkl_matrix_init_from_euler(HklMatrix *self,
+				       double euler_x, double euler_y, double euler_z) HKL_ARG_NONNULL(1);
+
+extern void hkl_matrix_matrix_set(HklMatrix *self, const HklMatrix *m) HKL_ARG_NONNULL(1, 2);
 
 extern void hkl_matrix_init_from_two_vector(HklMatrix *self,
 					    const HklVector *v1, const HklVector *v2);
 
-extern void hkl_matrix_init_from_euler(HklMatrix *self,
-				       double euler_x, double euler_y, double euler_z);
-
 extern void hkl_matrix_fprintf(FILE *file, const HklMatrix *self);
 
 extern void hkl_matrix_to_euler(const HklMatrix *self,
 				double *euler_x, double *euler_y, double *euler_z);
 
-extern int hkl_matrix_cmp(const HklMatrix *self, const HklMatrix *m);
-
-extern void hkl_matrix_times_matrix(HklMatrix *self, const HklMatrix *m);
-
 extern void hkl_matrix_times_vector(const HklMatrix *self, HklVector *v);
 
 extern void hkl_matrix_transpose(HklMatrix *self);
diff --git a/hkl/hkl-matrix.c b/hkl/hkl-matrix.c
index cb8983f..094d904 100644
--- a/hkl/hkl-matrix.c
+++ b/hkl/hkl-matrix.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -21,10 +21,94 @@
  */
 #include <stdlib.h>
 #include <math.h>
+#include <string.h>
 
-#include <hkl/hkl-macros.h>
-#include <hkl/hkl-matrix.h>
-#include <hkl/hkl-vector.h>
+#include "hkl-macros-private.h"
+#include "hkl-matrix-private.h"
+#include "hkl-vector-private.h"
+
+/**
+ * hkl_matrix_new: (skip)
+ * 
+ * Returns: a new uninitialized HklMatrix
+ */
+HklMatrix *hkl_matrix_new()
+{
+	return HKL_MALLOC(HklMatrix);
+}
+
+/**
+ * hkl_matrix_new_full: (skip)
+ * @m11: the matrix 11 value
+ * @m12: the matrix 12 value
+ * @m13: the matrix 13 value
+ * @m21: the matrix 21 value
+ * @m22: the matrix 22 value
+ * @m23: the matrix 23 value
+ * @m31: the matrix 31 value
+ * @m32: the matrix 32 value
+ * @m33: the matrix 33 value
+ *
+ * @todo test
+ * Returns: a new HklMAtrix
+ **/
+HklMatrix *hkl_matrix_new_full(double m11, double m12, double m13,
+			       double m21, double m22, double m23,
+			       double m31, double m32, double m33)
+{
+	HklMatrix *self = hkl_matrix_new();
+	hkl_matrix_init(self,
+			m11, m12, m13,
+			m21, m22, m23,
+			m31, m32, m33);
+
+	return self;
+}
+
+/**
+ * hkl_matrix_new_euler:
+ * @euler_x: the eulerian value along X
+ * @euler_y: the eulerian value along Y
+ * @euler_z: the eulerian value along Z
+ *
+ * Returns: Create a rotation #HklMatrix from three eulerians angles.
+ **/
+HklMatrix *hkl_matrix_new_euler(double euler_x, double euler_y, double euler_z)
+{
+	HklMatrix *self = hkl_matrix_new();
+	hkl_matrix_init_from_euler(self, euler_x, euler_y, euler_z);
+
+	return self;
+}
+
+/**
+ * hkl_matrix_dup: (skip)
+ * @self:
+ *
+ *
+ *
+ * Returns:
+ **/
+HklMatrix *hkl_matrix_dup(const HklMatrix* self)
+{
+	HklMatrix *dup;
+
+	dup = HKL_MALLOC(HklMatrix);
+	memcpy(dup, self, sizeof(*self));
+
+	return dup;
+}
+
+/**
+ * hkl_matrix_free: (skip)
+ * @self:
+ *
+ *
+ **/
+void hkl_matrix_free(HklMatrix *self)
+{
+	free(self);
+}
 
 /**
  * hkl_matrix_init:
@@ -39,7 +123,7 @@
  * @m32: the matrix 32 value
  * @m33: the matrix 33 value
  *
- * 
+ *
  **/
 void hkl_matrix_init(HklMatrix *self,
 		     double m11, double m12, double m13,
@@ -54,6 +138,35 @@ void hkl_matrix_init(HklMatrix *self,
 }
 
 /**
+ * hkl_matrix_matrix_set: (skip)
+ * @self: the this ptr
+ * @m: the matrix to set
+ *
+ * @todo test
+ **/
+void hkl_matrix_matrix_set(HklMatrix *self, const HklMatrix *m)
+{
+	if (self == m)
+		return;
+
+	memcpy(self->data, m->data, sizeof(double) * 9);
+}
+
+/**
+ * hkl_matrix_get:
+ * @self: the this ptr
+ * @i: the i coordinate
+ * @j: the j coordinate
+ *
+ * @todo test
+ * Return value: the Mij value
+ **/
+double hkl_matrix_get(const HklMatrix *self, unsigned int i, unsigned int j)
+{
+	return self->data[i][j];
+}
+
+/**
  * hkl_matrix_fprintf:
  * @file: the FILE stream
  * @self: the #HklMatrix to print into the file stream
@@ -136,7 +249,7 @@ void hkl_matrix_init_from_euler(HklMatrix *self,
 
 /**
  * hkl_matrix_to_euler:
- * @self: the rotation #HklMatrix use to compute the eulerians angles 
+ * @self: the rotation #HklMatrix use to compute the eulerians angles
  * @euler_x: the eulerian value along X
  * @euler_y: the eulerian value along Y
  * @euler_z: the eulerian value along Z
diff --git a/hkl/hkl-parameter-private.h b/hkl/hkl-parameter-private.h
new file mode 100644
index 0000000..44d8b20
--- /dev/null
+++ b/hkl/hkl-parameter-private.h
@@ -0,0 +1,214 @@
+
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#ifndef __HKL_PARAMETER_PRIVATE_H__
+#define __HKL_PARAMETER_PRIVATE_H__
+
+#include <stdio.h>
+
+#include "hkl.h"
+#include "hkl-interval-private.h"
+#include "hkl-macros-private.h"
+#include "hkl-unit-private.h"
+
+HKL_BEGIN_DECLS
+
+typedef struct _HklParameterOperations HklParameterOperations;
+
+struct _HklParameter {
+	const char *name;
+	HklInterval range;
+	double _value;
+	const HklUnit *unit;
+	const HklUnit *punit;
+	int fit;
+	int changed;
+	const HklParameterOperations *ops;
+};
+
+#define HKL_PARAMETER_DEFAULTS .name="dummy", .range={.min=0, .max=0}, ._value=0, .unit=NULL, .punit=NULL, .fit=HKL_TRUE, .changed=HKL_TRUE, .ops = &hkl_parameter_operations_defaults
+
+#define HKL_PARAMETER_DEFAULTS_ANGLE HKL_PARAMETER_DEFAULTS, .range={.min=-M_PI, .max=M_PI}, .unit = &hkl_unit_angle_rad, .punit = &hkl_unit_angle_deg
+
+
+/****************/
+/* HklParameter */
+/****************/
+
+struct _HklParameterOperations {
+	HklParameter * (*copy)(const HklParameter *self);
+	void           (*free)(HklParameter *self);
+	void           (*init_copy)(HklParameter *self, const HklParameter *src);
+	double         (*get_value_closest)(const HklParameter *self,
+				    const HklParameter *other);
+	unsigned int   (*set_value)(HklParameter *self, double value,
+				  HklError **error);
+	unsigned int   (*set_value_unit)(HklParameter *self, double value,
+				       HklError **error);
+	void           (*set_value_smallest_in_range)(HklParameter *self);
+	void           (*randomize)(HklParameter *self);
+	int            (*is_valid)(const HklParameter *self);
+	void           (*fprintf)(FILE *f, const HklParameter *self);
+};
+
+#define HKL_PARAMETER_OPERATIONS_DEFAULTS				\
+	.copy = hkl_parameter_copy_real,				\
+		.free = hkl_parameter_free_real,			\
+		.init_copy = hkl_parameter_init_copy_real,		\
+		.get_value_closest = hkl_parameter_value_get_closest_real, \
+		.set_value = hkl_parameter_value_set_real,		\
+		.set_value_unit = hkl_parameter_value_unit_set_real,	\
+		.set_value_smallest_in_range = hkl_parameter_value_set_smallest_in_range_real, \
+		.randomize = hkl_parameter_randomize_real,		\
+		.is_valid = hkl_parameter_is_valid_real,		\
+		.fprintf = hkl_parameter_fprintf_real
+
+static inline HklParameter *hkl_parameter_copy_real(const HklParameter *self)
+{
+	HklParameter *dup = HKL_MALLOC(HklParameter);
+
+	*dup = *self;
+
+	return dup;
+}
+
+static inline void hkl_parameter_free_real(HklParameter *self)
+{
+	free(self);
+}
+
+static inline void hkl_parameter_init_copy_real(HklParameter *self, const HklParameter *src)
+{
+	*self = *src;
+	self->changed = HKL_TRUE;
+}
+
+static inline double hkl_parameter_value_get_closest_real(const HklParameter *self,
+							  const HklParameter *ref)
+{
+	return self->_value;
+}
+
+static inline unsigned int hkl_parameter_value_set_real(
+	HklParameter *self, double value,
+	HklError **error)
+{
+	self->_value = value;
+	self->changed = HKL_TRUE;
+
+	return HKL_TRUE;
+}
+
+static inline unsigned int hkl_parameter_value_unit_set_real(
+	HklParameter *self, double value,
+	HklError **error)
+{
+	double factor = hkl_unit_factor(self->unit, self->punit);
+
+	return hkl_parameter_value_set_real(self, value / factor, error);
+}
+
+static inline void hkl_parameter_value_set_smallest_in_range_real(HklParameter *self)
+{
+	/* DOES NOTHING for a standard parameter */
+}
+
+static inline void hkl_parameter_randomize_real(HklParameter *self)
+{
+	if (self->fit) {
+		double alea = (double)rand() / (RAND_MAX + 1.);
+		self->_value = self->range.min
+			+ (self->range.max - self->range.min) * alea;
+		self->changed = HKL_TRUE;
+	}
+}
+
+static inline int hkl_parameter_is_valid_real(const HklParameter *self)
+{
+	if(self->_value < (self->range.min - HKL_EPSILON)
+	   || self->_value > (self->range.max + HKL_EPSILON))
+		return HKL_FALSE;
+	else
+		return HKL_TRUE;
+}
+
+static inline void hkl_parameter_fprintf_real(FILE *f, const HklParameter *self)
+{
+	double factor = hkl_unit_factor(self->unit, self->punit);
+	if (self->punit)
+		fprintf(f, "\"%s\" : %.7f %s [%.7f : %.7f] (%d)",
+			self->name,
+			self->_value * factor,
+			self->punit->repr,
+			self->range.min * factor,
+			self->range.max * factor,
+			self->fit);
+	else
+		fprintf(f, "\"%s\" : %.7f [%.7f : %.7f] (%d)",
+			self->name,
+			self->_value * factor,
+			self->range.min * factor,
+			self->range.max * factor,
+			self->fit);
+}
+
+static HklParameterOperations hkl_parameter_operations_defaults = {
+	HKL_PARAMETER_OPERATIONS_DEFAULTS,
+};
+
+
+extern HklParameter *hkl_parameter_new(const char *name,
+				       double min, double value, double max,
+				       int fit, int changed,
+				       const HklUnit *unit,
+				       const HklUnit *punit);
+
+extern void hkl_parameter_init_copy(HklParameter *self, const HklParameter *src);
+
+extern double hkl_parameter_value_get_closest(const HklParameter *self,
+					      const HklParameter *ref);
+
+extern void hkl_parameter_value_set_smallest_in_range(HklParameter *self);
+
+extern int hkl_parameter_is_valid(const HklParameter *self);
+
+extern void hkl_parameter_fprintf(FILE *f, HklParameter *self);
+
+/********************/
+/* HklParameterList */
+/********************/
+
+extern void hkl_parameter_list_values_get(const HklParameterList *self,
+					  double values[], unsigned int *len);
+
+extern unsigned int hkl_parameter_list_values_unit_set(HklParameterList *self,
+						       double values[],
+						       unsigned int len,
+						       HklError **error);
+
+extern void hkl_parameter_list_free(HklParameterList *self);
+
+extern void hkl_parameter_list_fprintf(FILE *f, const HklParameterList *self);
+
+HKL_END_DECLS
+
+#endif /* __HKL_PARAMETER_PRIVATE_H__ */
diff --git a/hkl/hkl-parameter.c b/hkl/hkl-parameter.c
index 1d776c7..7c57b72 100644
--- a/hkl/hkl-parameter.c
+++ b/hkl/hkl-parameter.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,43 +22,16 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <hkl/hkl-parameter.h>
+#include "hkl-parameter-private.h"
 
-HklParameter *hkl_parameter_new(char const *name,
-				double min, double value, double max,
-				int fit, int changed,
-				HklUnit const *unit, HklUnit const *punit)
-{
-	HklParameter *parameter;
-
-	parameter = HKL_MALLOC(HklParameter);
-
-	if (hkl_parameter_init(parameter,
-			       name, min, value, max,
-			       fit, changed,
-			       unit, punit)) {
-		free(parameter);
-		parameter = NULL;
-	}
-
-	return parameter;
-}
+/****************/
+/* HklParameter */
+/****************/
 
-HklParameter *hkl_parameter_new_copy(HklParameter const *self)
-{
-	HklParameter *parameter = NULL;
-
-	parameter = HKL_MALLOC(HklParameter);
-
-	*parameter = *self;
-
-	return parameter;
-}
-
-int hkl_parameter_init(HklParameter *self, char const *name,
-		       double min, double value, double max,
-		       int fit, int changed,
-		       HklUnit const *unit, HklUnit const *punit)
+static int hkl_parameter_init(HklParameter *self, const char *name,
+			      double min, double value, double max,
+			      int fit, int changed,
+			      const HklUnit *unit, const HklUnit *punit)
 {
 	if (min <= value
 	    && value <= max
@@ -67,55 +40,198 @@ int hkl_parameter_init(HklParameter *self, char const *name,
 		self->name = name;
 		self->range.min = min;
 		self->range.max = max;
-		self->value = value;
+		self->_value = value;
 		self->unit = unit;
 		self->punit = punit;
 		self->fit = fit;
 		self->changed = changed;
+		self->ops = &hkl_parameter_operations_defaults;
 	} else
-		return HKL_FAIL;
+		return HKL_FALSE;
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
+}
+
+/**
+ * hkl_parameter_new: (skip)
+ * @name:
+ * @min:
+ * @value:
+ * @max:
+ * @fit:
+ * @changed:
+ * @unit:
+ * @punit:
+ *
+ * create a new #HklParameter
+ *
+ * Returns:
+ **/
+HklParameter *hkl_parameter_new(const char *name,
+				double min, double value, double max,
+				int fit, int changed,
+				const HklUnit *unit, const HklUnit *punit)
+{
+	HklParameter *self;
+
+	self = HKL_MALLOC(HklParameter);
+
+	if (!hkl_parameter_init(self,
+				name, min, value, max,
+				fit, changed,
+				unit, punit)) {
+		free(self);
+		self = NULL;
+	}
+
+	return self;
+}
+
+/**
+ * hkl_parameter_new_copy: (skip)
+ * @self:
+ *
+ * copy an #HklParameter
+ *
+ * Returns:
+ **/
+HklParameter *hkl_parameter_new_copy(const HklParameter *self)
+{
+	return self->ops->copy(self);
 }
 
+/**
+ * hkl_parameter_free: (skip)
+ * @self:
+ *
+ * delete an #HklParameter
+ **/
 void hkl_parameter_free(HklParameter *self)
 {
-	free(self);
+	self->ops->free(self);
 }
 
-void hkl_parameter_set_value(HklParameter *self, double value)
+/**
+ * hkl_parameter_init_copy: (skip)
+ * @self: the this ptr
+ * @src: the parameter to copy from
+ **/
+void hkl_parameter_init_copy(HklParameter *self, const HklParameter *src)
 {
-	self->value = value;
-	self->changed = HKL_TRUE;
+	self->ops->init_copy(self, src);
 }
 
-/* TODO test */
-double hkl_parameter_get_value_unit(HklParameter const *self)
+const char *hkl_parameter_name_get(const HklParameter *self)
 {
-	double factor = hkl_unit_factor(self->unit, self->punit);
+	return self->name;
+}
 
-	return self->value * factor;
+/**
+ * hkl_parameter_value_get:
+ * @self: the this ptr
+ *
+ * Returns: the value of the #HklParameter
+ **/
+inline double hkl_parameter_value_get(const HklParameter *self)
+{
+	return self->_value;
 }
 
-/* TODO test */
-int hkl_parameter_set_value_unit(HklParameter *self, double value)
+/**
+ * hkl_parameter_value_unit_get:
+ * @self: the this ptr
+ *
+ * Returns: the value of the #HklParameter expressed in the user unit
+ **/
+inline double hkl_parameter_value_unit_get(const HklParameter *self)
 {
 	double factor = hkl_unit_factor(self->unit, self->punit);
 
-	self->value = value / factor;
-	self->changed = HKL_TRUE;
+	return self->_value * factor;
+}
+
 
-	return HKL_SUCCESS;
+/**
+ * hkl_parameter_value_get_closest:
+ * @self: the this ptr
+ * @ref: the reference #HklParameter
+ *
+ *
+ *
+ * Returns: the closest value of the ref #HklParameter from the
+ *          current self #HklParameter
+ **/
+inline double hkl_parameter_value_get_closest(const HklParameter *self,
+					      const HklParameter *ref)
+{
+	return self->ops->get_value_closest(self, ref);
 }
 
-double hkl_parameter_get_max(HklParameter const *self)
+/**
+ * hkl_parameter_value_set: (skip)
+ * @self: this ptr
+ * @value: the value to set
+ * @error: the error set if something goes wrong
+ *
+ * set the value of an #HklParameter
+ *
+ * Return value: true if succeed or false otherwise
+ **/
+inline int hkl_parameter_value_set(HklParameter *self, double value,
+				    HklError **error)
+{
+	return self->ops->set_value(self, value, error);
+}
+
+/**
+ * hkl_parameter_value_unit_set:
+ * @self: the this ptr
+ * @value: the value to set
+ * @error: (allow-none): the error set if something goes wrong
+ *
+ * set the value of the parameter express in the punit #HklUnit
+ * @todo test
+ *
+ * Return value: true if succeed or false otherwise
+ **/
+inline int hkl_parameter_value_unit_set(HklParameter *self, double value,
+					 HklError **error)
+{
+	return self->ops->set_value_unit(self, value, error);
+}
+
+/**
+ * hkl_parameter_value_set_smallest_in_range: (skip)
+ * @self: the this ptr
+ **/
+inline void hkl_parameter_value_set_smallest_in_range(HklParameter *self)
 {
-	return self->range.max;
+	self->ops->set_value_smallest_in_range(self);
 }
 
+/**
+ * hkl_parameter_min_max_get: (skip)
+ * @self:
+ *
+ * get the max value of the #HklParameter
+ *
+ **/
+void hkl_parameter_min_max_get(const HklParameter *self, double *min, double *max)
+{
+	*min = self->range.min;
+	*max = self->range.max;
+}
 
-/* TODO test */
-void hkl_parameter_get_range_unit(HklParameter const *self, double *min, double *max)
+/**
+ * hkl_parameter_min_max_unit_get: (skip)
+ * @self:
+ * @min:
+ * @max:
+ *
+ * get the #HklParameter range, min, max
+ * @todo test
+ **/
+void hkl_parameter_min_max_unit_get(const HklParameter *self, double *min, double *max)
 {
 	double factor = hkl_unit_factor(self->unit, self->punit);
 
@@ -123,47 +239,100 @@ void hkl_parameter_get_range_unit(HklParameter const *self, double *min, double
 	*max = factor * self->range.max;
 }
 
-/* TODO test */
-void hkl_parameter_set_range(HklParameter *self, double min, double max)
+/**
+ * hkl_parameter_min_max_set: (skip)
+ * @self:
+ * @min:
+ * @max:
+ *
+ * set the #HklParameter range.
+ * @todo test
+ **/
+void hkl_parameter_min_max_set(HklParameter *self, double min, double max)
 {
 	self->range.min = min;
 	self->range.max = max;
 }
 
-/* TODO test */
-void hkl_parameter_set_range_unit(HklParameter *self, double min, double max)
+/**
+ * hkl_parameter_min_max_unit_set:
+ * @self: the this ptr
+ * @min: the minimum value to set
+ * @max: the maximum value to set
+ *
+ * set the #HklParameter range express in the punit #HklUnit
+ * @todo test
+ **/
+void hkl_parameter_min_max_unit_set(HklParameter *self, double min, double max)
 {
 	double factor = hkl_unit_factor(self->unit, self->punit);
 	self->range.min = min / factor;
 	self->range.max = max / factor;
 }
 
+/**
+ * hkl_parameter_fit_get:
+ * @self: the this ptr
+ *
+ * Retuen value: the #HklParameter fit value, True is the parameter can be fitted, not otherwise
+ * @todo test
+ **/
+int hkl_parameter_fit_get(const HklParameter *self)
+{
+	return self->fit;
+}
+
+/**
+ * hkl_parameter_fit_set:
+ * @self: the this ptr
+ * @fit: the fit value to set
+ *
+ * set the #HklParameter fit value, True is the parameter can be fitted, not otherwise
+ * @todo test
+ **/
+void hkl_parameter_fit_set(HklParameter *self, int fit)
+{
+	self->fit = fit;
+}
+
+/**
+ * hkl_parameter_randomize: (skip)
+ * @self:
+ *
+ * randomize the #HklParameter value into the min,max range
+ **/
 void hkl_parameter_randomize(HklParameter *self)
 {
-	if (self->fit) {
-		double alea = (double)rand() / (RAND_MAX + 1.);
-		self->value = self->range.min
-			+ (self->range.max - self->range.min) * alea;
-		self->changed = HKL_TRUE;
-	}
+	self->ops->randomize(self);
 }
 
-int hkl_parameter_is_valid(HklParameter const *self)
+/**
+ * hkl_parameter_is_valid: (skip)
+ * @self:
+ *
+ * check if the value of the #HklParameter is in the min,max range
+ *
+ * Returns:
+ **/
+int hkl_parameter_is_valid(const HklParameter *self)
 {
-	if(self->value < (self->range.min - HKL_EPSILON)
-	   || self->value > (self->range.max + HKL_EPSILON))
-		return HKL_FALSE;
-	else
-		return HKL_TRUE;
+	return self->ops->is_valid(self);
 }
 
+/**
+ * hkl_parameter_fprintf: (skip)
+ * @f:
+ * @self:
+ *
+ * print into the #FILE f an #HklParameter
+ **/
 void hkl_parameter_fprintf(FILE *f, HklParameter *self)
 {
 	double factor = hkl_unit_factor(self->unit, self->punit);
 	if (self->punit)
 		fprintf(f, "\"%s\" : %.7f %s [%.7f : %.7f] (%d)",
 			self->name,
-			self->value * factor,
+			self->_value * factor,
 			self->punit->repr,
 			self->range.min * factor,
 			self->range.max * factor,
@@ -171,8 +340,133 @@ void hkl_parameter_fprintf(FILE *f, HklParameter *self)
 	else
 		fprintf(f, "\"%s\" : %.7f [%.7f : %.7f] (%d)",
 			self->name,
-			self->value * factor,
+			self->_value * factor,
 			self->range.min * factor,
 			self->range.max * factor,
 			self->fit);
 }
+
+/********************/
+/* HklParameterList */
+/********************/
+
+/**
+ * hkl_parameter_list_values_get: (skip)
+ * @self: the this ptr
+ * @values: (array length=len): list of the paremetersc values.
+ * @len: (out caller-allocates): the len of the returned list.
+ *
+ * get a list of all the #HklParameter values
+ **/
+void hkl_parameter_list_values_get(const HklParameterList *self,
+				   double values[], unsigned int *len)
+{
+	for(unsigned int i; i<darray_size(*self); ++i)
+		values[i] = darray_item(*self, i)->_value;
+
+	*len = darray_size(*self);
+}
+
+/**
+ * hkl_parameter_list_values_set:
+ * @self: the this ptr
+ * @values: (array length=len): the values to set
+ * @len: the length of the values
+ * @error: error set if something goes wrong
+ *
+ * set the parameter list with the given values
+ *
+ * Return value: true if succeed or false otherwise
+ **/
+unsigned int hkl_parameter_list_values_set(HklParameterList *self,
+					   double values[], unsigned int len,
+					   HklError **error)
+{
+	unsigned int n = len < darray_size(*self) ? len : darray_size(*self);
+
+	for(unsigned int i=0; i<n; ++i)
+		if(!hkl_parameter_value_set(darray_item(*self, i),
+					    values[i], error))
+			return HKL_FALSE;
+
+	return HKL_TRUE;
+}
+
+/**
+ * hkl_parameter_list_values_unit_get:
+ * @self: the this ptr
+ * @len: (out caller-allocates): the length of the returned array
+ *
+ * Return value: (array length=len) (transfer full): list of pseudo axes values with unit
+ *               free the array with free when done
+ **/
+double *hkl_parameter_list_values_unit_get(const HklParameterList *self,
+					   unsigned int *len)
+{
+	const unsigned int _len =  darray_size(*self);
+	double *values = (double *)malloc(sizeof(*values) * _len);
+
+	for(unsigned int i=0; i<_len; ++i)
+		values[i] = hkl_parameter_value_unit_get(darray_item(*self, i));
+	*len = _len;
+
+	return values;
+}
+
+/**
+ * hkl_parameter_list_values_unit_set: (skip)
+ * @self: the this ptr
+ * @values: (array length=len): the values to set
+ * @len: the length of the values
+ * @error: error set if something goes wrong
+ *
+ * set the parameter list with the given values
+ *
+ * Return value: true if succeed or false otherwise
+ **/
+unsigned int hkl_parameter_list_values_unit_set(HklParameterList *self,
+						double values[], unsigned int len,
+						HklError **error)
+{
+	for(unsigned int i=0; i<darray_size(*self); ++i)
+		if(!hkl_parameter_value_unit_set(
+			   darray_item(*self, i), values[i], error))
+			return HKL_FALSE;
+
+	return HKL_TRUE;
+}
+
+void hkl_parameter_list_free(HklParameterList *self)
+{
+	HklParameter **parameter;
+
+	darray_foreach(parameter, *self){
+		hkl_parameter_free(*parameter);
+	}
+	darray_free(*self);
+}
+
+void hkl_parameter_list_fprintf(FILE *f, const HklParameterList *self)
+{
+	HklParameter **parameter;
+
+	darray_foreach(parameter, *self){
+		fprintf(f, "\n     ");
+		hkl_parameter_fprintf(f, *parameter);
+	}
+}
+
+/**
+ * hkl_parameter_list_randomize: (skip)
+ * @self: the this ptr
+ *
+ * randomize all parameters of the list
+ **/
+void hkl_parameter_list_randomize(HklParameterList *self)
+{
+	HklParameter **parameter;
+
+	darray_foreach(parameter, *self){
+		hkl_parameter_randomize(*parameter);
+	}
+}
diff --git a/hkl/hkl-parameter.h b/hkl/hkl-parameter.h
deleted file mode 100644
index c206164..0000000
--- a/hkl/hkl-parameter.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PARAMETER_H__
-#define __HKL_PARAMETER_H__
-
-#include <stdio.h>
-#include <hkl/hkl-interval.h>
-#include <hkl/hkl-unit.h>
-
-HKL_BEGIN_DECLS
-
-typedef struct _HklParameter HklParameter;
-
-struct _HklParameter {
-	const char *name;
-	HklInterval range;
-	double value;
-	HklUnit const *unit;
-	HklUnit const *punit;
-	int fit;
-	int changed;
-};
-
-extern HklParameter *hkl_parameter_new(char const *name,
-				       double min, double value, double max,
-				       int fit, int changed,
-				       HklUnit const *unit,
-				       HklUnit const *punit);
-
-extern HklParameter *hkl_parameter_new_copy(HklParameter const *self);
-
-extern int hkl_parameter_init(HklParameter *self, char const *name,
-			      double min, double value, double max,
-			      int fit, int changed,
-			      HklUnit const *unit, HklUnit const *punit);
-
-extern void hkl_parameter_free(HklParameter *self);
-
-extern void hkl_parameter_set_value(HklParameter *self, double value);
-
-extern double hkl_parameter_get_value_unit(HklParameter const *self);
-
-extern int hkl_parameter_set_value_unit(HklParameter *self, double value);
-
-extern double hkl_parameter_get_max(HklParameter const *self);
-
-extern void hkl_parameter_get_range_unit(HklParameter const *self, double *min, double *max);
-
-extern void hkl_parameter_set_range(HklParameter *self, double min, double max);
-
-extern void hkl_parameter_set_range_unit(HklParameter *self, double min, double max);
-
-extern void hkl_parameter_randomize(HklParameter *self);
-
-extern int hkl_parameter_is_valid(const HklParameter *self);
-
-extern void hkl_parameter_fprintf(FILE *f, HklParameter *self);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PARAMETER_H__ */
diff --git a/hkl/hkl-pseudoaxis-auto-private.h b/hkl/hkl-pseudoaxis-auto-private.h
new file mode 100644
index 0000000..a070ab7
--- /dev/null
+++ b/hkl/hkl-pseudoaxis-auto-private.h
@@ -0,0 +1,152 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#ifndef __HKL_PSEUDOAXIS_AUTO_H__
+#define __HKL_PSEUDOAXIS_AUTO_H__
+
+#include <gsl/gsl_vector.h>
+
+#include "hkl/ccan/container_of/container_of.h"
+#include "hkl-detector-private.h"
+#include "hkl-error-private.h"
+#include "hkl-pseudoaxis-private.h"
+
+HKL_BEGIN_DECLS
+
+typedef struct _HklFunction HklFunction;
+typedef struct _HklModeAutoInfo HklModeAutoInfo;
+typedef struct _HklModeAutoWithInit HklModeAutoWithInit;
+
+struct _HklFunction
+{
+	const uint size;
+	int (* function) (const gsl_vector *x, void *params, gsl_vector *f);
+};
+
+struct _HklModeAutoInfo {
+	const HklModeInfo mode;
+	const HklFunction **functions;
+	const uint n_functions;
+};
+
+#define HKL_MODE_OPERATIONS_AUTO_DEFAULTS	\
+	HKL_MODE_OPERATIONS_DEFAULTS,		\
+		.set = hkl_mode_auto_set_real
+
+#define CHECK_NAN(x, len) do{				\
+		for(uint i=0; i<len; ++i)		\
+			if(gsl_isnan(x[i]))		\
+				return GSL_ENOMEM;	\
+	}while(0)
+
+#define INFO_AUTO(name, axes, fn) .mode={INFO(name, axes),}, .functions=fn, .n_functions=ARRAY_SIZE(fn)
+#define INFO_AUTO_WITH_PARAMS(name, axes, fn, parameters) .mode={INFO_WITH_PARAMS(name, axes, parameters)}, .functions=fn, .n_functions=ARRAY_SIZE(fn)
+
+/***************/
+/* HklModeAuto */
+/***************/
+
+extern HklMode *hkl_mode_auto_new(
+	const HklModeAutoInfo *info,
+	const HklModeOperations *ops);
+
+void hkl_mode_auto_init(HklMode *self,
+			const HklModeAutoInfo *info,
+			const HklModeOperations *ops);
+
+extern int hkl_mode_auto_set_real(HklMode *self,
+				  HklEngine *engine,
+				  HklGeometry *geometry,
+				  HklDetector *detector,
+				  HklSample *sample,
+				  HklError **error);
+
+/***********************/
+/* HklModeAutoWithInit */
+/***********************/
+
+struct _HklModeAutoWithInit {
+	HklMode mode;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+};
+
+#define HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS		\
+	HKL_MODE_OPERATIONS_AUTO_DEFAULTS,			\
+		.free = hkl_mode_auto_with_init_free_real,	\
+		.init = hkl_mode_auto_with_init_init_real
+
+static void hkl_mode_auto_with_init_free_real(HklMode *mode)
+{
+	HklModeAutoWithInit *self = container_of(mode, HklModeAutoWithInit, mode);
+
+	if(self->geometry)
+		hkl_geometry_free(self->geometry);
+	if(self->detector)
+		hkl_detector_free(self->detector);
+	if(self->sample)
+		hkl_sample_free(self->sample);
+
+	hkl_mode_free_real(mode);
+}
+
+static int hkl_mode_auto_with_init_init_real(HklMode *mode,
+					     HklEngine *engine,
+					     HklGeometry *geometry,
+					     HklDetector *detector,
+					     HklSample *sample,
+					     HklError **error)
+{
+	HklModeAutoWithInit *self = container_of(mode, HklModeAutoWithInit, mode);
+
+	hkl_return_val_if_fail(error == NULL || *error == NULL, HKL_FALSE);
+
+	if (!hkl_mode_init_real(mode, engine, geometry, detector, sample, error)){
+		hkl_error_set(error, "internal error");
+	}
+	hkl_assert(error == NULL || *error == NULL);
+
+	if(geometry){
+		if(self->geometry)
+			hkl_geometry_free(self->geometry);
+		self->geometry = hkl_geometry_new_copy(geometry);
+	}
+	if(detector){
+		if(self->detector)
+			hkl_detector_free(self->detector);
+		self->detector = hkl_detector_new_copy(detector);
+	}
+	if(sample){
+		if(self->sample)
+			hkl_sample_free(self->sample);
+		self->sample = hkl_sample_new_copy(sample);
+	}
+
+	return HKL_TRUE;
+}
+
+extern HklMode *hkl_mode_auto_with_init_new(const HklModeAutoInfo *info,
+					    const HklModeOperations *ops);
+
+HKL_END_DECLS
+
+#endif /* __HKL_PSEUDOAXIS_AUTO_H__ */
diff --git a/hkl/hkl-pseudoaxis-auto.c b/hkl/hkl-pseudoaxis-auto.c
index b5986f0..908d557 100644
--- a/hkl/hkl-pseudoaxis-auto.c
+++ b/hkl/hkl-pseudoaxis-auto.c
@@ -13,16 +13,21 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
 #include <string.h>
-#include <alloca.h>
+#ifndef _MSC_VER
+# include <alloca.h>
+#endif
 #include <gsl/gsl_sf_trig.h>
-#include <hkl/hkl-pseudoaxis-auto.h>
+#include <gsl/gsl_multiroots.h>
+
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-error-private.h"
 
 /* #define DEBUG */
 
@@ -30,9 +35,9 @@
 /* methods use to solve numerical pseudoAxes */
 /*********************************************/
 
-/** 
+/**
  * @brief This private method find the degenerated axes.
- * 
+ *
  * @param func the gsl_multiroopt_function to test
  * @param x the starting point
  * @param f the result of the function evaluation.
@@ -43,7 +48,7 @@
  * Once we know this the axis is mark as degenerated and we do not need to
  * change is sector.
  */
-static void find_degenerated_axes(HklPseudoAxisEngine *self,
+static void find_degenerated_axes(HklEngine *self,
 				  gsl_multiroot_function *func,
 				  gsl_vector const *x, gsl_vector const *f,
 				  int degenerated[])
@@ -77,38 +82,41 @@ static void find_degenerated_axes(HklPseudoAxisEngine *self,
 	gsl_matrix_free(J);
 }
 
-/** 
+/**
  * @brief this private method try to find the first solution
- * 
+ *
  * @param self the current HklPseudoAxeEngine.
  * @param f The function to use for the computation.
- * 
+ *
  * If a solution was found it also check for degenerated axes.
  * A degenerated axes is an Axes with no effect on the function.
  * @see find_degenerated
- * @return HKL_SUCCESS (0) or HKL_FAIL (-1). 
+ * @return HKL_TRUE or HKL_FALSE.
  */
-static int find_first_geometry(HklPseudoAxisEngine *self,
+static int find_first_geometry(HklEngine *self,
 			       gsl_multiroot_function *f,
 			       int degenerated[])
 {
 	gsl_multiroot_fsolver_type const *T;
 	gsl_multiroot_fsolver *s;
 	gsl_vector *x;
-	size_t len = HKL_LIST_LEN(self->axes);
+	size_t len = self->mode->info->n_axes;
 	double *x_data;
 	double *x_data0 = alloca(len * sizeof(*x_data0));
 	size_t iter = 0;
 	int status;
-	int res = HKL_FAIL;
+	int res = HKL_FALSE;
 	size_t i;
+	HklParameter **axis;
 
 	/* get the starting point from the geometry */
 	/* must be put in the auto_set method */
 	x = gsl_vector_alloc(len);
 	x_data = (double *)x->data;
-	for(i=0; i<len; ++i)
-		x_data[i] = hkl_axis_get_value(self->axes[i]);
+	i = 0;
+	darray_foreach(axis, self->axes){
+		x_data[i++] = (*axis)->_value;
+	}
 
 	/* keep a copy of the first axes positions to deal with degenerated axes */
 	memcpy(x_data0, x_data, len * sizeof(double));
@@ -122,7 +130,7 @@ static int find_first_geometry(HklPseudoAxisEngine *self,
 	do {
 		++iter;
 		status = gsl_multiroot_fsolver_iterate(s);
-		if (status || iter % 1000 == 0) {
+		if (status || iter % 300 == 0) {
 			/* Restart from another point. */
 			for(i=0; i<len; ++i)
 				x_data[i] = (double)rand() / RAND_MAX * 180. / M_PI;
@@ -130,7 +138,7 @@ static int find_first_geometry(HklPseudoAxisEngine *self,
 			gsl_multiroot_fsolver_iterate(s);
 		}
 		status = gsl_multiroot_test_residual (s->f, HKL_EPSILON);
-	} while (status == GSL_CONTINUE && iter < 1000);
+	} while (status == GSL_CONTINUE && iter < 2000);
 
 #ifdef DEBUG
 	fprintf(stdout, "\nstatus : %d iter : %d", status, iter);
@@ -139,29 +147,32 @@ static int find_first_geometry(HklPseudoAxisEngine *self,
 	fprintf(stdout, "\n");
 #endif
 
-	if (status != GSL_CONTINUE) {		
+	if (status != GSL_CONTINUE) {
 		find_degenerated_axes(self, f, s->x, s->f, degenerated);
-		
+
 #ifdef DEBUG
 		/* print the test header */
 		fprintf(stdout, "\n");
 		for(i=0; i<len; ++i)
 			fprintf(stdout, "\t f(%d)", i);
-		for(i=0; i<len; ++i)
-			fprintf(stdout, "\t \"%s\"", ((HklParameter *)self->axes[i])->name);
+		darray_foreach(axis, self->axes){
+			fprintf(stdout, "\t \"%s\"", (*axis)->name);
+		}
 #endif
 		/* set the geometry from the gsl_vector */
 		/* in a futur version the geometry must contain a gsl_vector */
 		/* to avoid this. */
 		x_data = (double *)s->x->data;
-		for(i=0; i<len; ++i)
-			if (degenerated[i])
-				hkl_axis_set_value(self->axes[i], x_data0[i]);
-			else
-				hkl_axis_set_value(self->axes[i], x_data[i]);
+		i = 0;
+		darray_foreach(axis, self->axes){
+			hkl_parameter_value_set(*axis,
+						degenerated[i] ? x_data0[i] : x_data[i],
+						NULL);
+			++i;
+		}
 
 		hkl_geometry_update(self->geometry);
-		res = HKL_SUCCESS;
+		res = HKL_TRUE;
 	}
 
 	/* release memory */
@@ -171,9 +182,9 @@ static int find_first_geometry(HklPseudoAxisEngine *self,
 	return res;
 }
 
-/** 
+/**
  * @brief This private method change the sector of angles.
- * 
+ *
  * @param x The vector of changed angles.
  * @param x0 The vector of angles to change.
  * @param sector the sector vector operation.
@@ -207,9 +218,9 @@ static void change_sector(double x[], double const x0[],
 	}
 }
 
-/** 
+/**
  * @brief Test if an angle combination is compatible with q function.
- * 
+ *
  * @param x The vector of angles to test.
  * @param function The gsl_multiroot_function used for the test.
  * @param f a gsl_vector use to compute the result (optimization)
@@ -218,7 +229,7 @@ static int test_sector(gsl_vector const *x,
 		       gsl_multiroot_function *function,
 		       gsl_vector *f)
 {
-	int res = HKL_SUCCESS;
+	int res = HKL_TRUE;
 	size_t i;
 	double *f_data = f->data;
 
@@ -226,7 +237,7 @@ static int test_sector(gsl_vector const *x,
 
 	for(i=0; i<f->size; ++i)
 		if (fabs(f_data[i]) > HKL_EPSILON){
-			res = HKL_FAIL;
+			res = HKL_FALSE;
 			break;
 		}
 
@@ -240,7 +251,7 @@ static int test_sector(gsl_vector const *x,
 	for(i=0; i<f->size; ++i)
 		fprintf(stdout, "\t%f", gsl_sf_angle_restrict_symm(x->data[i]) * HKL_RADTODEG);
 
-	if(res == HKL_FAIL)
+	if(res == HKL_FALSE)
 		fprintf(stdout, "\t FAIL");
 	else
 		fprintf(stdout, "\t SUCCESS");
@@ -249,9 +260,9 @@ static int test_sector(gsl_vector const *x,
 	return res;
 }
 
-/** 
+/**
  * @brief compute the permutation and test its validity.
- * 
+ *
  * @param axes_len number of axes
  * @param op_len number of operation per axes. (4 for now)
  * @param p The vector containing the current permutation.
@@ -259,74 +270,73 @@ static int test_sector(gsl_vector const *x,
  * @param op the current operation to set.
  * @param f The function for the validity test.
  * @param x0 The starting point of all geometry permutations.
- * @param _x a gsl_vector use to compute the sectors (optimization) 
- * @param _f a gsl_vector use during the sector test (optimization) 
+ * @param _x a gsl_vector use to compute the sectors (optimization)
+ * @param _f a gsl_vector use during the sector test (optimization)
  */
-static void perm_r(size_t axes_len, int op_len[], int p[], int axes_idx,
+static void perm_r(size_t axes_len, size_t op_len[], int p[], size_t axes_idx,
 		   int op, gsl_multiroot_function *f, double x0[],
 		   gsl_vector *_x, gsl_vector *_f)
 {
-	int i;
+	size_t i;
 
 	p[axes_idx++] = op;
 	if (axes_idx == axes_len) {
 		double *x_data = _x->data;
 		change_sector(x_data, x0, p, axes_len);
-		if (HKL_SUCCESS == test_sector(_x, f, _f))
-			hkl_pseudo_axis_engine_add_geometry(f->params, x_data);
+		if (test_sector(_x, f, _f))
+			hkl_engine_add_geometry(f->params, x_data);
 	} else
 		for (i=0; i<op_len[axes_idx]; ++i)
 			perm_r(axes_len, op_len, p, axes_idx, i, f, x0, _x, _f);
 }
 
-/** 
+/**
  * @brief Find all numerical solutions of a mode.
- * 
- * @param self the current HklPseudoAxisEngine
+ *
+ * @param self the current HklEngine
  * @param function The mode function
- * 
- * @return HKL_SUCCESS (0) or HKL_FAIL (-1)
+ *
+ * @return HKL_TRUE or HKL_FALSE
  *
  * This method find a first solution with a numerical method from the
  * GSL library (the multi root solver hybrid). Then it multiplicates the
  * solutions from this starting point using cosinus/sinus properties.
  * It addes all valid solutions to the self->geometries.
  */
-static int solve_function(HklPseudoAxisEngine *self,
-			  HklFunction function)
+static int solve_function(HklEngine *self,
+			  const HklFunction *function)
 {
 
 	size_t i;
-	size_t len = HKL_LIST_LEN(self->axes);
-	int *p = alloca(len * sizeof(*p));
-	double *x0 = alloca(len * sizeof(*x0));
-	int *degenerated = alloca(len * sizeof(*degenerated));
-	int *op_len = alloca(len * sizeof(*op_len));
+	int p[function->size];
+	double x0[function->size];
+	int degenerated[function->size];
+	size_t op_len[function->size];
 	int res;
-	gsl_vector *_x; /* use to compute sectors in perm_r (avoid copy) */ 
-	gsl_vector *_f; /* use to test sectors in perm_r (avoid copy) */ 
+	gsl_vector *_x; /* use to compute sectors in perm_r (avoid copy) */
+	gsl_vector *_f; /* use to test sectors in perm_r (avoid copy) */
 	gsl_multiroot_function f;
+	HklParameter **axis;
+
+	_x = gsl_vector_alloc(function->size);
+	_f = gsl_vector_alloc(function->size);
 
-	_x = gsl_vector_alloc(len);
-	_f = gsl_vector_alloc(len);
-	
-	f.f = function;
-	f.n = len;
+	f.f = function->function;
+	f.n = function->size;
 	f.params = self;
 
 	res = find_first_geometry(self, &f, degenerated);
-	if (!res) {
+	if (res) {
 		memset(p, 0, sizeof(p));
 		/* use first solution as starting point for permutations */
-		for(i=0; i<len; ++i){
-			x0[i] = hkl_axis_get_value(self->axes[i]);
-			if (degenerated[i])
-				op_len[i] = 1;
-			else
-				op_len[i] = 4;
+		i = 0;
+		darray_foreach(axis, self->axes){
+			x0[i] = (*axis)->_value;
+			op_len[i] = degenerated[i] ? 1 : 4;
+			++i;
 		}
 		for (i=0; i<op_len[0]; ++i)
-			perm_r(len, op_len, p, 0, i, &f, x0, _x, _f);
+			perm_r(function->size, op_len, p, 0, i, &f, x0, _x, _f);
 	}
 
 	gsl_vector_free(_f);
@@ -334,25 +344,74 @@ static int solve_function(HklPseudoAxisEngine *self,
 	return res;
 }
 
-int hkl_pseudo_axis_engine_mode_set_real(HklPseudoAxisEngineMode *self,
-					 HklPseudoAxisEngine *engine,
-					 HklGeometry *geometry,
-					 HklDetector *detector,
-					 HklSample *sample,
-					 HklError **error)
+/* check that the number of axis of the mode is the right number of variables expected by mode functions */
+static inline void check_validity(const HklModeAutoInfo *info)
+{
+	for(uint i=0; i<info->n_functions; ++i)
+		hkl_assert(info->functions[i]->size == info->mode.n_axes);
+}
+
+HklMode *hkl_mode_auto_new(const HklModeAutoInfo *info,
+			   const HklModeOperations *ops)
+{
+	check_validity(info);
+
+	return hkl_mode_new(&info->mode, ops);
+
+}
+
+void hkl_mode_auto_init(HklMode *self,
+			const HklModeAutoInfo *info,
+			const HklModeOperations *ops)
+{
+	check_validity(info);
+
+	hkl_mode_init(self, &info->mode, ops);
+
+}
+
+int hkl_mode_auto_set_real(HklMode *self,
+			   HklEngine *engine,
+			   HklGeometry *geometry,
+			   HklDetector *detector,
+			   HklSample *sample,
+			   HklError **error)
 {
 	size_t i;
-	int res = HKL_FAIL;
+	int ok = HKL_FALSE;
+	HklModeAutoInfo *info = container_of(self->info, HklModeAutoInfo, mode);
 
-	if(!self || !engine || !geometry || !detector || !sample)
-		return res;
+	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
 
-	for(i=0;i<HKL_LIST_LEN(self->functions);++i)
-		res &= solve_function(engine, self->functions[i]);
+	if(!self || !engine || !geometry || !detector || !sample){
+		hkl_error_set(error, "Internal error");
+		return HKL_FALSE;
+	}
+
+	for(i=0;i<info->n_functions;++i)
+		ok |= solve_function(engine, info->functions[i]);
+
+	if(!ok){
+		hkl_error_set(error, "none of the functions were solved !!!");
+		return HKL_FALSE;
+	}
 
 #ifdef DEBUG
-	hkl_pseudo_axis_engine_fprintf(stdout, engine);
+	hkl_engine_fprintf(stdout, engine);
 #endif
 
-	return res;
+	return HKL_TRUE;
+}
+
+HklMode *hkl_mode_auto_with_init_new(const HklModeAutoInfo *info,
+				     const HklModeOperations *ops)
+{
+	HklModeAutoWithInit *self = HKL_MALLOC(HklModeAutoWithInit);
+
+	hkl_mode_auto_init(&self->mode, info, ops);
+	self->geometry = NULL;
+	self->detector = NULL;
+	self->sample = NULL;
+
+	return &self->mode;
 }
diff --git a/hkl/hkl-pseudoaxis-auto.h b/hkl/hkl-pseudoaxis-auto.h
deleted file mode 100644
index 6df0b88..0000000
--- a/hkl/hkl-pseudoaxis-auto.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_AUTO_H__
-#define __HKL_PSEUDOAXIS_AUTO_H__
-
-#include <hkl/hkl-pseudoaxis.h>
-
-HKL_BEGIN_DECLS
-
-extern int hkl_pseudo_axis_engine_mode_set_real(HklPseudoAxisEngineMode *self,
-						HklPseudoAxisEngine *engine,
-						HklGeometry *geometry,
-						HklDetector *detector,
-						HklSample *sample,
-						HklError **error);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_AUTO_H__ */
diff --git a/hkl/hkl-pseudoaxis-common-eulerians.h b/hkl/hkl-pseudoaxis-common-eulerians-private.h
similarity index 79%
rename from hkl/hkl-pseudoaxis-common-eulerians.h
rename to hkl/hkl-pseudoaxis-common-eulerians-private.h
index f428025..cbaf52e 100644
--- a/hkl/hkl-pseudoaxis-common-eulerians.h
+++ b/hkl/hkl-pseudoaxis-common-eulerians-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,11 +22,21 @@
 #ifndef __HKL_PSEUDOAXIS_COMMON_EULERIANS_H__
 #define __HKL_PSEUDOAXIS_COMMON_EULERIANS_H__
 
-#include <hkl/hkl-pseudoaxis.h>
+#include "hkl.h"
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_eulerians_new(void);
+typedef struct _HklEngineEulerians HklEngineEulerians;
+
+struct _HklEngineEulerians
+{
+	HklParameter *omega;
+	HklParameter *chi;
+	HklParameter *phi;
+	HklEngine engine;
+};
+
+extern HklEngine *hkl_engine_eulerians_new(void);
 
 HKL_END_DECLS
 
diff --git a/hkl/hkl-pseudoaxis-common-eulerians.c b/hkl/hkl-pseudoaxis-common-eulerians.c
index 0801245..81c7b4f 100644
--- a/hkl/hkl-pseudoaxis-common-eulerians.c
+++ b/hkl/hkl-pseudoaxis-common-eulerians.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -21,37 +21,46 @@
  *          Jens Krüger <Jens.Krueger at frm2.tum.de>
  */
 #include <gsl/gsl_sf_trig.h>
-#include <hkl/hkl-pseudoaxis-auto.h>
-#include <hkl/hkl-pseudoaxis-common-eulerians.h>
+#include "hkl/ccan/array_size/array_size.h"
 
-static int kappa_to_eulerian(double komega, double kappa, double kphi,
+#include "hkl-error-private.h"
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-eulerians-private.h"
+
+static int kappa_to_eulerian(const double angles[],
 			     double *omega, double *chi, double *phi,
 			     double alpha, int solution)
 {
-	double Kappa = gsl_sf_angle_restrict_symm(kappa);
-	double p = atan(tan(Kappa/2.) * cos(alpha));
-	
+	const double komega = angles[0];
+	const double kappa = gsl_sf_angle_restrict_symm(angles[1]);
+	const double kphi = angles[2];
+	const double p = atan(tan(kappa/2.) * cos(alpha));
+
 	if (solution){
 		*omega = komega + p - M_PI_2;
-		*chi = 2 * asin(sin(Kappa/2.) * sin(alpha));
+		*chi = 2 * asin(sin(kappa/2.) * sin(alpha));
 		*phi = kphi + p + M_PI_2;
 	}else{
 		*omega = komega + p + M_PI_2;
-		*chi = -2 * asin(sin(Kappa/2.) * sin(alpha));
+		*chi = -2 * asin(sin(kappa/2.) * sin(alpha));
 		*phi = kphi + p - M_PI_2;
 	}
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
-static int eulerian_to_kappa(double omega, double chi, double phi,
-			     double *komega, double *kappa, double *kphi,
+static int eulerian_to_kappa(const double omega, const double chi, const double phi,
+			     double angles[],
 			     double alpha, double solution)
 {
-	int status = HKL_SUCCESS;
+	int status = HKL_TRUE;
+	double *komega = &angles[0];
+	double *kappa = &angles[1];
+	double *kphi = &angles[2];
 
 	if (fabs(chi) <= alpha * 2){
-		double p = asin(tan(chi/2.)/tan(alpha));
+		const double p = asin(tan(chi/2.)/tan(alpha));
 
 		if (solution){
 			*komega = omega - p + M_PI_2;
@@ -63,101 +72,144 @@ static int eulerian_to_kappa(double omega, double chi, double phi,
 			*kphi = phi + p + M_PI_2;
 		}
 	}else
-		status = HKL_FAIL;
+		status = HKL_FALSE;
 
 	return status;
 }
 
-static int hkl_pseudo_axis_engine_mode_get_eulerians_real(HklPseudoAxisEngineMode *self,
-							  HklPseudoAxisEngine *engine,
-							  HklGeometry *geometry,
-							  HklDetector *detector,
-							  HklSample *sample,
-							  HklError **error)
+/***************************/
+/* HklMode */
+/***************************/
+
+static int hkl_mode_get_eulerians_real(HklMode *self,
+				       HklEngine *engine,
+				       HklGeometry *geometry,
+				       HklDetector *detector,
+				       HklSample *sample,
+				       HklError **error)
 {
-	double komega, kappa, kphi;
-	int solution;
+	HklEngineEulerians *eulerians;
+	const double angles[] = {
+		hkl_parameter_value_get(
+			hkl_geometry_get_axis_by_name(geometry, "komega")),
+		hkl_parameter_value_get(
+			hkl_geometry_get_axis_by_name(geometry, "kappa")),
+		hkl_parameter_value_get(
+			hkl_geometry_get_axis_by_name(geometry, "kphi")),
+	};
+	double values[3];
+	double solution;
+	HklParameter *parameter;
 
 	hkl_geometry_update(geometry);
 
-	solution = self->parameters[0].value;
+	solution = darray_item(self->parameters, 0)->_value;
 
-	komega = ((HklParameter *)hkl_geometry_get_axis_by_name(geometry, "komega"))->value;
-	kappa = ((HklParameter *)hkl_geometry_get_axis_by_name(geometry, "kappa"))->value;
-	kphi = ((HklParameter *)hkl_geometry_get_axis_by_name(geometry, "kphi"))->value;
+	eulerians = container_of(engine, HklEngineEulerians, engine);
+	kappa_to_eulerian(angles,
+			  &eulerians->omega->_value,
+			  &eulerians->chi->_value,
+			  &eulerians->phi->_value,
+			  50 * HKL_DEGTORAD, solution);
 
-	return kappa_to_eulerian(komega, kappa, kphi,
-				 &((HklParameter *)engine->pseudoAxes[0])->value,
-				 &((HklParameter *)engine->pseudoAxes[1])->value,
-				 &((HklParameter *)engine->pseudoAxes[2])->value,
-				 50 * HKL_DEGTORAD, solution);
+	return HKL_TRUE;
 }
 
-static int hkl_pseudo_axis_engine_mode_set_eulerians_real(HklPseudoAxisEngineMode *self,
-							  HklPseudoAxisEngine *engine,
-							  HklGeometry *geometry,
-							  HklDetector *detector,
-							  HklSample *sample,
-							  HklError **error)
+static int hkl_mode_set_eulerians_real(HklMode *self,
+				       HklEngine *engine,
+				       HklGeometry *geometry,
+				       HklDetector *detector,
+				       HklSample *sample,
+				       HklError **error)
 {
-	int status = HKL_SUCCESS;
-	int solution;
-
+	double solution;
+	uint n_values = engine->info->n_pseudo_axes;
+	HklEngineEulerians *engine_eulerians;
 	double angles[3];
 
-	solution = self->parameters[0].value;
+	solution = darray_item(self->parameters, 0)->_value;
+	engine_eulerians = container_of(engine, HklEngineEulerians, engine);
+	if(!eulerian_to_kappa(engine_eulerians->omega->_value,
+			      engine_eulerians->chi->_value,
+			      engine_eulerians->phi->_value,
+			      angles, 50 * HKL_DEGTORAD, solution)){
+		hkl_error_set(error, "unreachable solution : 0° < chi < 50°");
+		return HKL_FALSE;
+	}else
+		hkl_engine_add_geometry(engine, angles);
+
+	return HKL_TRUE;
+}
 
-	status |= eulerian_to_kappa(((HklParameter *)engine->pseudoAxes[0])->value,
-				    ((HklParameter *)engine->pseudoAxes[1])->value,
-				    ((HklParameter *)engine->pseudoAxes[2])->value,
-				    &angles[0], &angles[1], &angles[2],
-				    50 * HKL_DEGTORAD, solution);
 
-	if (status == HKL_SUCCESS)
-		hkl_pseudo_axis_engine_add_geometry(engine, angles);
+static HklMode *mode_eulerians()
+{
+	HklMode *mode;
+	static const char *axes[] = {"komega", "kappa", "kphi"};
+	static const HklParameter parameters[] = {
+		{ HKL_PARAMETER_DEFAULTS, .name = "solution", .range = {.max = 1}, ._value = 1,},
+	};
+	static const HklModeInfo info = {
+		INFO_WITH_PARAMS("eulerians", axes, parameters),
+	};
+	static const HklModeOperations operations = {
+		HKL_MODE_OPERATIONS_DEFAULTS,
+		.get = hkl_mode_get_eulerians_real,
+		.set = hkl_mode_set_eulerians_real,
+	};
+
+	return hkl_mode_new(&info, &operations);
+};
+
+/***********************/
+/* HklEngine */
+/***********************/
+
+static void hkl_engine_eulerians_free_real(HklEngine *base)
+{
+	HklEngineEulerians *self;
 
-	return status;
+	self = container_of(base, HklEngineEulerians, engine);
+	hkl_engine_release(&self->engine);
+	free(self);
 }
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_eulerians_new(void)
+HklEngine *hkl_engine_eulerians_new(void)
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
-	HklParameter parameter = {"solution", {0, 1}, 1., 0};
-
-	self = hkl_pseudo_axis_engine_new("eulerians", 3, "omega", "chi", "phi");
-
-	/* omega */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[0],
-			   "omega",
-			   -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-	/* chi */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[1],
-			   "chi",
-			   -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-	/* phi */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[2],
-			   "phi",
-			   -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	/* eulerians */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"eulerians",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_eulerians_real,
-		hkl_pseudo_axis_engine_mode_set_eulerians_real,
-		0,
-		(size_t)1, parameter,
-		(size_t)3, "komega", "kappa", "kphi");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	hkl_pseudo_axis_engine_select_mode(self, 0);
-
-	return self;
+	HklEngineEulerians *self;
+	HklMode *mode;
+	static const HklPseudoAxis omega = {
+		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "omega"}
+	};
+	static const HklPseudoAxis chi = {
+		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "chi"}
+	};
+	static const HklPseudoAxis phi = {
+		.parameter = {HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi"}
+	};
+	static const HklPseudoAxis *pseudo_axes[] = {&omega, &chi, &phi};
+	static HklEngineInfo info = {
+		.name = "eulerians",
+		.pseudo_axes = pseudo_axes,
+		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+	};
+	static HklEngineOperations operations = {
+		HKL_ENGINE_OPERATIONS_DEFAULTS,
+		.free=hkl_engine_eulerians_free_real,
+	};
+
+	self = HKL_MALLOC(HklEngineEulerians);
+	hkl_engine_init(&self->engine, &info, &operations);
+
+	/* add the pseudo axes with the new API */
+	self->omega = register_pseudo_axis(&self->engine, &omega.parameter);
+	self->chi = register_pseudo_axis(&self->engine, &chi.parameter);
+	self->phi = register_pseudo_axis(&self->engine, &phi.parameter);
+
+	/* eulerians [default] */
+	mode = mode_eulerians();
+	hkl_engine_add_mode(&self->engine, mode);
+	hkl_engine_select_mode(&self->engine, mode);
+
+	return &self->engine;
 }
diff --git a/hkl/hkl-pseudoaxis-common-hkl-private.h b/hkl/hkl-pseudoaxis-common-hkl-private.h
new file mode 100644
index 0000000..6f93b40
--- /dev/null
+++ b/hkl/hkl-pseudoaxis-common-hkl-private.h
@@ -0,0 +1,114 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
+ */
+#include <gsl/gsl_vector.h>
+#include "hkl-pseudoaxis-auto-private.h"
+
+typedef struct _HklEngineHkl HklEngineHkl;
+struct _HklEngineHkl {
+	HklEngine engine;
+	HklParameter *h;
+	HklParameter *k;
+	HklParameter *l;
+};
+
+extern int _RUBh_minus_Q_func(const gsl_vector *x, void *params, gsl_vector *f);
+extern int _double_diffraction_func(const gsl_vector *x, void *params, gsl_vector *f);
+extern int _psi_constant_vertical_func(const gsl_vector *x, void *params, gsl_vector *f);
+
+extern int RUBh_minus_Q(double const x[], void *params, double f[]);
+extern int _double_diffraction(double const x[], void *params, double f[]);
+
+/**
+ * @brief Standard getter for the hkl pseudoAxis.
+ *
+ * @param self
+ * @param geometry
+ * @param detector
+ * @param sample
+ *
+ * @return the status of the getter method.
+ *
+ * This method can be used with all geometries of diffractometers
+ * in getter/setter.
+ */
+extern int hkl_mode_get_hkl_real(HklMode *self,
+				 HklEngine *engine,
+				 HklGeometry *geometry,
+				 HklDetector *detector,
+				 HklSample *sample,
+				 HklError **error);
+
+extern int hkl_mode_set_hkl_real(HklMode *self,
+				 HklEngine *engine,
+				 HklGeometry *geometry,
+				 HklDetector *detector,
+				 HklSample *sample,
+				 HklError **error);
+
+extern int hkl_mode_init_psi_constant_vertical_real(HklMode *base,
+						    HklEngine *engine,
+						    HklGeometry *geometry,
+						    HklDetector *detector,
+						    HklSample *sample,
+						    HklError **error);
+
+extern HklEngine *hkl_engine_hkl_new(void);
+
+#define HKL_MODE_OPERATIONS_HKL_DEFAULTS	\
+	HKL_MODE_OPERATIONS_AUTO_DEFAULTS,	\
+		.get = hkl_mode_get_hkl_real
+
+static const HklModeOperations hkl_mode_operations = {
+	HKL_MODE_OPERATIONS_HKL_DEFAULTS,
+};
+
+static const HklModeOperations hkl_full_mode_operations = {
+	HKL_MODE_OPERATIONS_HKL_DEFAULTS,
+	.set = hkl_mode_set_hkl_real,
+};
+
+static const HklModeOperations psi_constant_vertical_mode_operations = {
+	HKL_MODE_OPERATIONS_HKL_DEFAULTS,
+	.init = hkl_mode_init_psi_constant_vertical_real,
+};
+
+static const HklModeOperations constant_incidence_mode_operations = {
+	HKL_MODE_OPERATIONS_AUTO_WITH_INIT_DEFAULTS,
+	.get = hkl_mode_get_hkl_real,
+	.set = hkl_mode_set_hkl_real
+};
+
+static const HklFunction RUBh_minus_Q_func = {
+	.function = _RUBh_minus_Q_func,
+	.size = 3,
+};
+
+static const HklFunction double_diffraction_func = {
+	.function = _double_diffraction_func,
+	.size = 4,
+};
+
+static const HklFunction psi_constant_vertical_func = {
+	.function = _psi_constant_vertical_func,
+	.size = 4,
+};
diff --git a/hkl/hkl-pseudoaxis-common-hkl.c b/hkl/hkl-pseudoaxis-common-hkl.c
index 63b5b60..d706c01 100644
--- a/hkl/hkl-pseudoaxis-common-hkl.c
+++ b/hkl/hkl-pseudoaxis-common-hkl.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,49 +22,268 @@
  */
 #include <string.h>
 #include <gsl/gsl_sf_trig.h>
-#include <hkl/hkl-pseudoaxis.h>
-#include <hkl/hkl-pseudoaxis-common.h>
-#include <hkl/hkl-pseudoaxis-common-hkl.h>
-#include <hkl/hkl-pseudoaxis-auto.h>
-/***************************************/
-/* common methode use by getter/setter */
-/***************************************/
+#include <gsl/gsl_multiroots.h>
+#include "hkl/ccan/array_size/array_size.h"
+
+#include "hkl-axis-private.h"
+#include "hkl-error-private.h"
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-hkl-private.h"
+#include "hkl-sample-private.h"
+
+/* #define DEBUG */
 
-int RUBh_minus_Q_func(const gsl_vector *x, void *params, gsl_vector *f)
+/*******************************************/
+/* common methode use by hkl getter/setter */
+/*******************************************/
+
+typedef struct _HklDetectorFit HklDetectorFit;
+
+struct _HklDetectorFit
+{
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklVector *kf0;
+	HklParameter **axes;
+	size_t len;
+};
+
+/* this method is used to fit only the detector position */
+/* usable with only 1 or 2 axes */
+static int fit_detector_function(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
+	size_t i;
+	HklDetectorFit *fitp = params;
+	HklVector kf;
+
+	/* update the workspace from x; */
+	for(i=0; i<fitp->len; ++i)
+		hkl_parameter_value_set(fitp->axes[i],
+					x->data[i], NULL);
+
+	hkl_geometry_update(fitp->geometry);
+
+	hkl_detector_compute_kf(fitp->detector, fitp->geometry, &kf);
+
+	f->data[0] = fabs(fitp->kf0->data[0] - kf.data[0])
+		+ fabs(fitp->kf0->data[1] - kf.data[1])
+		+ fabs(fitp->kf0->data[2] - kf.data[2]);
+	if (fitp->len > 1)
+		f->data[1] = fabs(fitp->kf0->data[1] - kf.data[1]);
+
+#if 0
+	fprintf(stdout, "\nkf0 [%f, %f, %f], kf [%f, %f, %f]",
+		fitp->kf0->data[0], fitp->kf0->data[1], fitp->kf0->data[2],
+		kf.data[0], kf.data[1], kf.data[2]);
+	fprintf(stdout, " x : [");
+	for(i=0; i<fitp->len; ++i)
+		fprintf(stdout, " %.7f", x_data[i]);
+	fprintf(stdout, "] |  f : [");
+	for(i=0; i<fitp->len; ++i)
+		fprintf(stdout, " %.7f", f_data[i]);
+	fprintf(stdout, "]\n");
+#endif
+	return GSL_SUCCESS;
+}
 
-	RUBh_minus_Q(x_data, params, f_data);
+
+static int fit_detector_position(HklMode *mode, HklGeometry *geometry,
+				 HklDetector *detector, HklVector *kf)
+{
+	size_t i;
+	HklDetectorFit params;
+	gsl_multiroot_fsolver_type const *T;
+	gsl_multiroot_fsolver *s;
+	gsl_multiroot_function f;
+	gsl_vector *x;
+	int status;
+	int res = HKL_FALSE;
+	int iter;
+	HklHolder *sample_holder = darray_item(geometry->holders, 0);
+	HklHolder *detector_holder = darray_item(geometry->holders, 1);
+
+	/* fit the detector part to find the position of the detector for a given kf */
+	/* FIXME for now the sample and detector holder are respectively the first and the second one */
+	/* we need to find the right axes to use for the fit */
+	/* BECARFULL the sample part must not move during this fit. So exclude an axis */
+	/* if it is also part of the sample holder. */
+	/* For now compare the holder axes with the axes of the mode to generate the right gsl multiroot solver */
+	params.geometry = geometry;
+	params.detector = detector;
+	params.kf0 = kf;
+	params.axes = malloc(sizeof(*params.axes) * detector_holder->config->len);
+	params.len = 0;
+	/* for each axis of the mode */
+	for(i=0; i<mode->info->n_axes; ++i){
+		size_t k;
+		size_t tmp;
+
+		tmp = hkl_geometry_get_axis_idx_by_name(params.geometry, mode->info->axes[i]);
+		/* check that this axis is in the detector's holder */
+		for(k=0; k<detector_holder->config->len; ++k)
+			if(tmp == detector_holder->config->idx[k]){
+				size_t j;
+				int ko = 0;
+
+				/* and not in the sample's holder */
+				for(j=0; j<sample_holder->config->len; ++j){
+					if (tmp == sample_holder->config->idx[j]){
+						ko = 1;
+						break;
+					}
+				}
+				if(!ko)
+					params.axes[params.len++] = darray_item(params.geometry->axes, tmp);
+			}
+	}
+
+	/* if no detector axis found ???? abort */
+	/* maybe put this at the begining of the method */
+	if (params.len > 0){
+		/* now solve the system */
+		/* Initialize method  */
+		T = gsl_multiroot_fsolver_hybrid;
+		s = gsl_multiroot_fsolver_alloc (T, params.len);
+		x = gsl_vector_alloc(params.len);
+
+		/* initialize x with the right values */
+		for(i=0; i<params.len; ++i)
+			x->data[i] = hkl_parameter_value_get(params.axes[i]);
+
+		f.f = fit_detector_function;
+		f.n = params.len;
+		f.params = ¶ms;
+		gsl_multiroot_fsolver_set (s, &f, x);
+
+		/* iterate to find the solution */
+		iter = 0;
+		do {
+			++iter;
+			status = gsl_multiroot_fsolver_iterate(s);
+			if (status || iter % 100 == 0) {
+				/* Restart from another point. */
+				for(i=0; i<params.len; ++i)
+					x->data[i] = (double)rand() / RAND_MAX * 180. / M_PI;
+				gsl_multiroot_fsolver_set(s, &f, x);
+				gsl_multiroot_fsolver_iterate(s);
+			}
+			status = gsl_multiroot_test_residual (s->f, HKL_EPSILON);
+		} while (status == GSL_CONTINUE && iter < 1000);
+
+#ifdef DEBUG
+		fprintf(stdout, "\n  fitting the detector position using thoses axes :");
+		for(i=0; i<params.len; ++i)
+			fprintf(stdout, " \"%s\"", ((HklParameter *)params.axes[i])->name);
+		fprintf(stdout, " status : %d iter : %d", status, iter);
+		fprintf(stdout, " x: [");
+		for(i=0; i<params.len; ++i)
+			fprintf(stdout, " %.7f", s->x->data[i]);
+		fprintf(stdout, "] f: [");
+		for(i=0; i<params.len; ++i)
+			fprintf(stdout, " %.7f", s->f->data[i]);
+		fprintf(stdout, "]\n");
+		hkl_geometry_fprintf(stdout, params.geometry);
+#endif
+		if(status != GSL_CONTINUE){
+			res = HKL_TRUE;
+			/* put the axes in the -pi, pi range. */
+			for(i=0; i<params.len; ++i){
+				double value;
+
+				value = hkl_parameter_value_get(params.axes[i]);
+				/* TODO one day deal with the error for real */
+				hkl_parameter_value_set(params.axes[i],
+							gsl_sf_angle_restrict_pos(value),
+							NULL);
+			}
+		}
+		/* release memory */
+		gsl_vector_free(x);
+		gsl_multiroot_fsolver_free(s);
+	}
+	free(params.axes);
+
+	return res;
+}
+
+/* get the highest index of the axis in a holder */
+/* BEWARE, NOT the axis index in the geometry->axes */
+/* which is part of the axes_names of the mode */
+/* return -1 if there is no axes of the mode in the sample part of the geometry */
+static int get_last_axis_idx(HklGeometry *geometry, int holder_idx, char const **axes_names, int len)
+{
+	int last = -1;
+	int i;
+	HklHolder *holder;
+
+	holder = darray_item(geometry->holders, holder_idx);
+	for(i=0; i<len; ++i){
+		size_t j;
+		size_t idx;
+
+		/* FIXME for now the sample holder is the first one */
+		idx = hkl_geometry_get_axis_idx_by_name(geometry, axes_names[i]);
+		for(j=0; j<holder->config->len; ++j)
+			if(idx == holder->config->idx[j]){
+				last = last > (int)j ? last : (int)j;
+				break;
+			}
+	}
+	return last;
+}
+
+/**
+ * RUBh_minus_Q_func: (skip)
+ * @x:
+ * @params:
+ * @f:
+ *
+ * Only usefull if you need to create a new hkl mode.
+ *
+ * Returns:
+ **/
+int _RUBh_minus_Q_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
 
 	return  GSL_SUCCESS;
 }
 
+/**
+ * RUBh_minus_Q: (skip)
+ * @x:
+ * @params:
+ * @f:
+ *
+ *
+ *
+ * Returns:
+ **/
 int RUBh_minus_Q(double const x[], void *params, double f[])
 {
-	HklVector Hkl;
+	HklEngine *engine = params;
+	HklEngineHkl *engine_hkl = container_of(engine, HklEngineHkl, engine);
+	HklVector Hkl = {
+		.data = {
+			engine_hkl->h->_value,
+			engine_hkl->k->_value,
+			engine_hkl->l->_value,
+		},
+	};
 	HklVector ki, dQ;
-	HklPseudoAxisEngine *engine;
-	HklHolder *holder;
-	size_t i;
-
-	engine = params;
+	HklHolder *sample_holder;
 
 	/* update the workspace from x; */
-	for(i=0; i<HKL_LIST_LEN(engine->axes); ++i)
-		hkl_axis_set_value(engine->axes[i], x[i]);
-	hkl_geometry_update(engine->geometry);
-
-	hkl_vector_init(&Hkl,
-			((HklParameter *)engine->pseudoAxes[0])->value,
-			((HklParameter *)engine->pseudoAxes[1])->value,
-			((HklParameter *)engine->pseudoAxes[2])->value);
+	set_geometry_axes(engine, x);
 
 	/* R * UB * h = Q */
 	/* for now the 0 holder is the sample holder. */
-	holder = &engine->geometry->holders[0];
+	sample_holder = darray_item(engine->geometry->holders, 0);
 	hkl_matrix_times_vector(&engine->sample->UB, &Hkl);
-	hkl_vector_rotated_quaternion(&Hkl, &holder->q);
+	hkl_vector_rotated_quaternion(&Hkl, &sample_holder->q);
 
 	/* kf - ki = Q */
 	hkl_source_compute_ki(&engine->geometry->source, &ki);
@@ -80,26 +299,25 @@ int RUBh_minus_Q(double const x[], void *params, double f[])
 	return GSL_SUCCESS;
 }
 
-int hkl_pseudo_axis_engine_mode_get_hkl_real(HklPseudoAxisEngineMode *self,
-					     HklPseudoAxisEngine *engine,
-					     HklGeometry *geometry,
-					     HklDetector *detector,
-					     HklSample *sample,
-					     HklError **error)
+int hkl_mode_get_hkl_real(HklMode *self,
+			  HklEngine *engine,
+			  HklGeometry *geometry,
+			  HklDetector *detector,
+			  HklSample *sample,
+			  HklError **error)
 {
-	HklHolder *holder;
+	HklHolder *sample_holder;
 	HklMatrix RUB;
 	HklVector hkl, ki, Q;
-	double min, max;
-	size_t i;
+	HklEngineHkl *engine_hkl = container_of(engine, HklEngineHkl, engine);
 
 	/* update the geometry internals */
 	hkl_geometry_update(geometry);
 
 	/* R * UB */
 	/* for now the 0 holder is the sample holder. */
-	holder = &geometry->holders[0];
-	hkl_quaternion_to_matrix(&holder->q, &RUB);
+	sample_holder = darray_item(geometry->holders, 0);
+	hkl_quaternion_to_matrix(&sample_holder->q, &RUB);
 	hkl_matrix_times_matrix(&RUB, &sample->UB);
 
 	/* kf - ki = Q */
@@ -109,64 +327,173 @@ int hkl_pseudo_axis_engine_mode_get_hkl_real(HklPseudoAxisEngineMode *self,
 
 	hkl_matrix_solve(&RUB, &hkl, &Q);
 
-	/* compute the min and max */
-	min = -1;
-	max = 1;
-
-	/* update the pseudoAxes config part */
-	for(i=0;i<HKL_LIST_LEN(engine->pseudoAxes);++i){
-		HklParameter *parameter = (HklParameter *)(engine->pseudoAxes[i]);
-		parameter->value = hkl.data[i];
-		parameter->range.min = min;
-		parameter->range.max = max;
-	}
+	engine_hkl->h->_value = hkl.data[0];
+	engine_hkl->k->_value = hkl.data[1];
+	engine_hkl->l->_value = hkl.data[2];
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
-/***************************************/
-/* the double diffraction get set part */
-/***************************************/
-
-int double_diffraction_func(gsl_vector const *x, void *params, gsl_vector *f)
+int hkl_mode_set_hkl_real(HklMode *self,
+			  HklEngine *engine,
+			  HklGeometry *geometry,
+			  HklDetector *detector,
+			  HklSample *sample,
+			  HklError **error)
 {
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
+	int last_axis;
 
-	double_diffraction(x_data, params, f_data);
+	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
 
-	return  GSL_SUCCESS;
+	if(!hkl_mode_auto_set_real(self, engine,
+				   geometry, detector, sample,
+				   error)){
+		hkl_assert(error == NULL || *error != NULL);
+		//fprintf(stdout, "message :%s\n", (*error)->message);
+		return HKL_FALSE;
+	}
+	hkl_assert(error == NULL || *error == NULL);
+
+	/* check that the mode allow to move a sample axis */
+	/* FIXME for now the sample holder is the first one */
+	last_axis = get_last_axis_idx(geometry, 0, self->info->axes, self->info->n_axes);
+	if(last_axis >= 0){
+		uint i;
+		uint len = darray_size(engine->engines->geometries->items);
+
+		/* For each solution already found we will generate another one */
+		/* using the Ewalds construction by rotating Q around the last sample */
+		/* axis of the mode until it intersect again the Ewald sphere. */
+		/* FIXME do not work if ki is colinear with the axis. */
+
+		/* for this we needs : */
+		/* - the coordinates of the end of the Q vector (q) */
+		/* - the last sample axis orientation of the mode (axis_v) */
+		/* - the coordinates of the center of the ewalds sphere (c) */
+		/* - the coordinates of the center of rotation of the sample (o = 0, 0, 0) */
+
+		/* then we can : */
+		/* - project the origin in plane of normal axis_v containing q (o') */
+		/* - project the center of the ewalds sphere into the same plan (c') */
+		/* - rotate q around this (o', c') line of 180° to find the (q2) solution */
+		/* - compute the (kf2) corresponding to this q2 solution */
+		/* at the end we just need to solve numerically the position of the detector */
+
+		/* we will add solution to the geometries so save its length before */
+		for(i=0; i<len; ++i){
+			int j;
+			HklGeometry *geom;
+			HklVector ki;
+			HklVector kf;
+			HklVector kf2;
+			HklVector q;
+			HklVector axis_v;
+			HklQuaternion qr;
+			HklAxis *axis;
+			HklVector cp = {0};
+			HklVector op = {0};
+			double angle;
+
+			geom = hkl_geometry_new_copy(darray_item(engine->engines->geometries->items, i)->geometry);
+
+			/* get the Q vector kf - ki */
+			hkl_detector_compute_kf(detector, geom, &q);
+			hkl_source_compute_ki(&geom->source, &ki);
+			hkl_vector_minus_vector(&q, &ki);
+
+			/* compute the current orientation of the last axis */
+			axis = container_of(darray_item(geom->axes,
+							darray_item(geom->holders, 0)->config->idx[last_axis]),
+					    HklAxis, parameter);
+			axis_v = axis->axis_v;
+			hkl_quaternion_init(&qr, 1, 0, 0, 0);
+			for(j=0; j<last_axis; ++j)
+				hkl_quaternion_times_quaternion(
+					&qr,
+					&container_of(darray_item(geom->axes,
+								  darray_item(geom->holders, 0)->config->idx[j]),
+						      HklAxis, parameter)->q);
+			hkl_vector_rotated_quaternion(&axis_v, &qr);
+
+			/* - project the center of the ewalds sphere into the same plan (c') */
+			hkl_vector_minus_vector(&cp, &ki);
+			hkl_vector_project_on_plan_with_point(&cp, &axis_v, &q);
+			hkl_vector_project_on_plan_with_point(&op, &axis_v, &q);
+
+			/* - rotate q around this (o', c') line of 180° to find the (q2) solution */
+			kf2 = q;
+			hkl_vector_rotated_around_line(&kf2, M_PI, &cp, &op);
+			angle = hkl_vector_oriented_angle_points(&q, &op, &kf2, &axis_v);
+			/* TODO parameter list for geometry */
+			if(!hkl_parameter_value_set(&axis->parameter,
+						    hkl_parameter_value_get(&axis->parameter) + angle,
+						    error))
+				return HKL_FALSE;
+			hkl_geometry_update(geom);
+#ifdef DEBUG
+			fprintf(stdout, "\n- try to add a solution by rotating Q <%f, %f, %f> around the \"%s\" axis <%f, %f, %f> of %f radian",
+				q.data[0], q.data[1], q.data[2],
+				((HklParameter *)axis)->name,
+				axis_v.data[0], axis_v.data[1], axis_v.data[2],
+				angle);
+			fprintf(stdout, "\n   op: <%f, %f, %f>", op.data[0], op.data[1], op.data[2]);
+			fprintf(stdout, "\n   q2: <%f, %f, %f>", kf2.data[0], kf2.data[1], kf2.data[2]);
+#endif
+			hkl_vector_add_vector(&kf2, &ki);
+			/* at the end we just need to solve numerically the position of the detector */
+			if(fit_detector_position(self, geom, detector, &kf2))
+				hkl_geometry_list_add(engine->engines->geometries, geom);
+
+			hkl_geometry_free(geom);
+		}
+	}
+	return HKL_TRUE;
 }
 
-int double_diffraction(double const x[], void *params, double f[])
+/***************************************/
+/* the double diffraction get set part */
+/***************************************/
+
+/**
+ * double_diffraction: (skip)
+ * @x:
+ * @params:
+ * @f:
+ *
+ *
+ *
+ * Returns:
+ **/
+int _double_diffraction(double const x[], void *params, double f[])
 {
-	HklPseudoAxisEngine *engine = params;
-	HklVector hkl, kf2;
+	HklEngine *engine = params;
+	HklEngineHkl *engine_hkl = container_of(engine, HklEngineHkl, engine);
+	HklVector hkl = {
+		.data = {
+			engine_hkl->h->_value,
+			engine_hkl->k->_value,
+			engine_hkl->l->_value,
+		},
+	};
+	HklVector kf2;
 	HklVector ki;
 	HklVector dQ;
-	size_t i;
-	HklHolder *holder;
+	HklHolder *sample_holder;
 
 	/* update the workspace from x; */
-	for(i=0; i<HKL_LIST_LEN(engine->axes); ++i)
-		hkl_axis_set_value(engine->axes[i], x[i]);
-	hkl_geometry_update(engine->geometry);
-
-	hkl_vector_init(&hkl,
-			((HklParameter *)engine->pseudoAxes[0])->value,
-			((HklParameter *)engine->pseudoAxes[1])->value,
-			((HklParameter *)engine->pseudoAxes[2])->value);
+	set_geometry_axes(engine, x);
 
+	/* get the second hkl from the mode parameters */
 	hkl_vector_init(&kf2,
-			engine->mode->parameters[0].value,
-			engine->mode->parameters[1].value,
-			engine->mode->parameters[2].value);
+			darray_item(engine->mode->parameters, 0)->_value,
+			darray_item(engine->mode->parameters, 1)->_value,
+			darray_item(engine->mode->parameters, 2)->_value);
 
 	/* R * UB * hkl = Q */
 	/* for now the 0 holder is the sample holder. */
-	holder = &engine->geometry->holders[0];
+	sample_holder = darray_item(engine->geometry->holders, 0);
 	hkl_matrix_times_vector(&engine->sample->UB, &hkl);
-	hkl_vector_rotated_quaternion(&hkl, &holder->q);
+	hkl_vector_rotated_quaternion(&hkl, &sample_holder->q);
 
 	/* kf - ki = Q */
 	hkl_source_compute_ki(&engine->geometry->source, &ki);
@@ -176,7 +503,7 @@ int double_diffraction(double const x[], void *params, double f[])
 
 	/* R * UB * hlk2 = Q2 */
 	hkl_matrix_times_vector(&engine->sample->UB, &kf2);
-	hkl_vector_rotated_quaternion(&kf2, &holder->q);
+	hkl_vector_rotated_quaternion(&kf2, &sample_holder->q);
 	hkl_vector_add_vector(&kf2, &ki);
 
 	f[0] = dQ.data[0];
@@ -187,30 +514,51 @@ int double_diffraction(double const x[], void *params, double f[])
 	return GSL_SUCCESS;
 }
 
+/**
+ * double_diffraction_func: (skip)
+ * @x:
+ * @params:
+ * @f:
+ *
+ *
+ *
+ * Returns:
+ **/
+int _double_diffraction_func(gsl_vector const *x, void *params, gsl_vector *f)
+{
+	CHECK_NAN(x->data, x->size);
+
+	_double_diffraction(x->data, params, f->data);
+
+	return  GSL_SUCCESS;
+}
+
+
 /******************************************/
 /* the psi_constant_vertical get set part */
 /******************************************/
 
-int psi_constant_vertical_func(gsl_vector const *x, void *params, gsl_vector *f)
+/**
+ * psi_constant_vertical_func: (skip)
+ * @x:
+ * @params:
+ * @f:
+ *
+ *
+ *
+ * Returns:
+ **/
+int _psi_constant_vertical_func(gsl_vector const *x, void *params, gsl_vector *f)
 {
-       
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
+	HklVector ki, kf, Q;
+	HklEngine *engine = params;
 
-	HklVector hkl;
-	HklVector ki, kf, Q, n;
-	HklPseudoAxisEngine *engine;
-	size_t i;
+	CHECK_NAN(x->data, x->size);
 
-	RUBh_minus_Q(x_data, params, f_data);
-	engine = params;
+	RUBh_minus_Q(x->data, params, f->data);
 
 	/* update the workspace from x; */
-	for(i=0; i<HKL_LIST_LEN(engine->axes); ++i)
-		hkl_axis_set_value(engine->axes[i], x_data[i]);
-	hkl_geometry_update(engine->geometry);
-
-	hkl_vector_init(&hkl, 1, 0, 0);
+	set_geometry_axes(engine, x->data);
 
 	/* kf - ki = Q */
 	hkl_source_compute_ki(&engine->geometry->source, &ki);
@@ -218,55 +566,75 @@ int psi_constant_vertical_func(gsl_vector const *x, void *params, gsl_vector *f)
 	Q = kf;
 	hkl_vector_minus_vector(&Q, &ki);
 
-	hkl_vector_normalize(&Q);
-	n = kf;
-	hkl_vector_vectorial_product(&n, &ki);
-	hkl_vector_vectorial_product(&n, &Q);
+	f->data[3] = darray_item(engine->mode->parameters, 3)->_value;
+
+	/* if |Q| > epsilon ok */
+	if(hkl_vector_normalize(&Q)){
+		HklVector hkl;
+		HklVector n;
 
-	
-	hkl_vector_times_matrix(&hkl, &engine->sample->UB);
-	hkl_vector_rotated_quaternion(&hkl, &engine->geometry->holders[0].q);
+		/* compute n the intersection of the plan P(kf, ki) and PQ (normal Q) */
+		n = kf;
+		hkl_vector_vectorial_product(&n, &ki);
+		hkl_vector_vectorial_product(&n, &Q);
 
-	/* project hkl on the plan of normal Q */
-	hkl_vector_project_on_plan(&hkl, &Q);
+		/* compute the hkl ref position in the laboratory */
+		/* referentiel. The geometry was already updated. */
+		/* FIXME for now the 0 holder is the sample holder. */
+		hkl.data[0] = darray_item(engine->mode->parameters, 0)->_value;
+		hkl.data[1] = darray_item(engine->mode->parameters, 1)->_value;
+		hkl.data[2] = darray_item(engine->mode->parameters, 2)->_value;
+		hkl_matrix_times_vector(&engine->sample->UB, &hkl);
+		hkl_vector_rotated_quaternion(&hkl,
+					      &darray_item(engine->geometry->holders, 0)->q);
 
-	f_data[3] =  engine->mode->parameters[3].value - hkl_vector_oriented_angle(&n, &hkl, &Q);
+		/* project hkl on the plan of normal Q */
+		hkl_vector_project_on_plan(&hkl, &Q);
+#if DEBUG
+		fprintf(stdout, "\n");
+		hkl_geometry_fprintf(stdout, engine->geometry);
+		fprintf(stdout, "\n");
+		fprintf(stdout, "%s n : <%f, %f, %f> hkl : <%f, %f, %f> Q : <%f, %f, %f> angle : %f\n",
+			__func__,
+			n.data[0], n.data[1], n.data[2],
+			hkl.data[0], hkl.data[1], hkl.data[2],
+			Q.data[0], Q.data[1], Q.data[2],
+			hkl_vector_oriented_angle(&n, &hkl, &Q) * HKL_RADTODEG);
+#endif
+		if(hkl_vector_norm2(&hkl) > HKL_EPSILON)
+			f->data[3] -=  hkl_vector_oriented_angle(&n, &hkl, &Q);
+	}
 
 	return  GSL_SUCCESS;
 }
 
-int hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real(HklPseudoAxisEngineMode *self,
-								HklPseudoAxisEngine *engine,
-								HklGeometry *geometry,
-								HklDetector *detector,
-								HklSample *sample,
-								HklError **error)
+int hkl_mode_init_psi_constant_vertical_real(HklMode *self,
+					     HklEngine *engine,
+					     HklGeometry *geometry,
+					     HklDetector *detector,
+					     HklSample *sample,
+					     HklError **error)
 {
 	HklVector hkl;
 	HklVector ki, kf, Q, n;
-	int status = HKL_SUCCESS;
 
-	if (!self || !engine || !engine->mode || !geometry || !detector || !sample){
-		status = HKL_FAIL;
-		return status;
+	if (!self || !engine || !engine->mode || !geometry || !detector || !sample
+	    || !hkl_mode_init_real(self, engine, geometry, detector, sample, error)){
+		hkl_error_set(error, "internal error");
+		return HKL_FALSE;
 	}
 
-	status = hkl_pseudo_axis_engine_init_func(self, engine, geometry, detector, sample);
-	if(status == HKL_FAIL)
-		return status;
-
-	/* Compute the constant psi value (to be kept) */
-	hkl_vector_init(&hkl, 1, 0, 0);
-
 	/* kf - ki = Q */
 	hkl_source_compute_ki(&geometry->source, &ki);
 	hkl_detector_compute_kf(detector, geometry, &kf);
 	Q = kf;
 	hkl_vector_minus_vector(&Q, &ki);
 
-	if (hkl_vector_is_null(&Q))
-		status = HKL_FAIL;
-	else{
+	if (hkl_vector_is_null(&Q)){
+		hkl_error_set(error, "can not initialize the \"%s\" mode with a null hkl (kf == ki)"
+			      "\nplease select a non-null hkl", engine->mode->info->name);
+		return HKL_FALSE;
+	}else{
 		/* needed for a problem of precision */
 		hkl_vector_normalize(&Q);
 
@@ -278,52 +646,76 @@ int hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real(HklPseudoAxisEng
 		/* compute hkl in the laboratory referentiel */
 		/* the geometry was already updated in the detector compute kf */
 		/* for now the 0 holder is the sample holder */
-		hkl.data[0] = self->parameters[0].value;
-		hkl.data[1] = self->parameters[1].value;
-		hkl.data[2] = self->parameters[2].value;
-		hkl_vector_times_matrix(&hkl, &sample->UB);
-		hkl_vector_rotated_quaternion(&hkl, &geometry->holders[0].q);
-	
+		hkl.data[0] = darray_item(self->parameters, 0)->_value;
+		hkl.data[1] = darray_item(self->parameters, 1)->_value;
+		hkl.data[2] = darray_item(self->parameters, 2)->_value;
+		hkl_matrix_times_vector(&sample->UB, &hkl);
+		hkl_vector_rotated_quaternion(&hkl,
+					      &darray_item(geometry->holders, 0)->q);
+
 		/* project hkl on the plan of normal Q */
 		hkl_vector_project_on_plan(&hkl, &Q);
 
-		if (hkl_vector_is_null(&hkl))
-			status = HKL_FAIL;
-		else
+		if (hkl_vector_is_null(&hkl)){
+			hkl_error_set(error, "can not initialize the \"%s\" mode"
+				      "\nwhen Q and the <h2, k2, l2> ref vector are colinear."
+				      "\nplease change one or both of them", engine->mode->info->name);
+			return HKL_FALSE;
+		}else{
 			/* compute the angle beetween hkl and n and
 			 * store in in the fourth parameter */
-			hkl_parameter_set_value(&self->parameters[3],
-						hkl_vector_oriented_angle(&n, &hkl, &Q));
+			if (!hkl_parameter_value_set(
+				    darray_item(self->parameters, 3),
+				    hkl_vector_oriented_angle(&n, &hkl, &Q),
+				    error))
+				return HKL_FALSE;
+		}
 	}
 
-	return status;
+	return HKL_TRUE;
 }
 
+/***********************/
+/* HklEngine */
+/***********************/
+
+static void hkl_engine_hkl_free_real(HklEngine *base)
+{
+	HklEngineHkl *self=container_of(base, HklEngineHkl, engine);
+	hkl_engine_release(&self->engine);
+	free(self);
+}
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_hkl_new(void)
+HklEngine *hkl_engine_hkl_new(void)
 {
-	HklPseudoAxisEngine *self;
-
-	self = hkl_pseudo_axis_engine_new("hkl", 3, "h", "k", "l");
-
-	/* h */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[0],
-			   "h",
-			   -1, 0., 1,
-			   HKL_TRUE, HKL_TRUE,
-			   NULL, NULL);
-	/* k */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[1],
-			   "k",
-			   -1, 0., 1,
-			   HKL_TRUE, HKL_TRUE,
-			   NULL, NULL);
-	/* l */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[2],
-			   "l",
-			   -1, 0., 1,
-			   HKL_TRUE, HKL_TRUE,
-			   NULL, NULL);
-
-	return self;
+	HklEngineHkl *self;
+	static const HklPseudoAxis h = {
+		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "h", .range={.min=-1, .max=1}}
+	};
+	static const HklPseudoAxis k = {
+		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "k", .range={.min=-1, .max=1}}
+	};
+	static const HklPseudoAxis l = {
+		.parameter = { HKL_PARAMETER_DEFAULTS, .name = "l", .range={.min=-1, .max=1}}
+	};
+	static const HklPseudoAxis *pseudo_axes[] = {&h, &k, &l};
+	static HklEngineInfo info = {
+		.name = "hkl",
+		.pseudo_axes = pseudo_axes,
+		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+	};
+	static HklEngineOperations operations = {
+		HKL_ENGINE_OPERATIONS_DEFAULTS,
+		.free=hkl_engine_hkl_free_real,
+	};
+
+	self = HKL_MALLOC(HklEngineHkl);
+
+	hkl_engine_init(&self->engine, &info, &operations);
+
+	self->h = register_pseudo_axis(&self->engine, &h.parameter);
+	self->k = register_pseudo_axis(&self->engine, &k.parameter);
+	self->l = register_pseudo_axis(&self->engine, &l.parameter);
+
+	return &self->engine;
 }
diff --git a/hkl/hkl-pseudoaxis-common-hkl.h b/hkl/hkl-pseudoaxis-common-hkl.h
deleted file mode 100644
index 9e7915a..0000000
--- a/hkl/hkl-pseudoaxis-common-hkl.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
- */
-#include <hkl/hkl-pseudoaxis.h>
-
-extern int RUBh_minus_Q_func(const gsl_vector *x, void *params, gsl_vector *f);
-extern int double_diffraction_func(const gsl_vector *x, void *params, gsl_vector *f);
-extern int psi_constant_vertical_func(const gsl_vector *x, void *params, gsl_vector *f);
-
-extern int RUBh_minus_Q(double const x[], void *params, double f[]);
-extern int double_diffraction(double const x[], void *params, double f[]);
-
-/**
- * @brief Standard getter for the hkl pseudoAxis.
- * 
- * @param self 
- * @param geometry 
- * @param detector 
- * @param sample 
- * 
- * @return the status of the getter method.
- *
- * This method can be used with all geometries of diffractometers
- * in getter/setter.
- */
-extern int hkl_pseudo_axis_engine_mode_get_hkl_real(HklPseudoAxisEngineMode *self,
-						    HklPseudoAxisEngine *engine,
-						    HklGeometry *geometry,
-						    HklDetector *detector,
-						    HklSample *sample,
-						    HklError **error);
-
-extern int hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real(HklPseudoAxisEngineMode *base,
-								       HklPseudoAxisEngine *engine,
-								       HklGeometry *geometry,
-								       HklDetector *detector,
-								       HklSample *sample,
-								       HklError **error);
-
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_hkl_new(void);
diff --git a/hkl/hkl-pseudoaxis-common-psi.h b/hkl/hkl-pseudoaxis-common-psi-private.h
similarity index 60%
rename from hkl/hkl-pseudoaxis-common-psi.h
rename to hkl/hkl-pseudoaxis-common-psi-private.h
index 92e6a23..15fcccf 100644
--- a/hkl/hkl-pseudoaxis-common-psi.h
+++ b/hkl/hkl-pseudoaxis-common-psi-private.h
@@ -13,38 +13,51 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_PSEUDOAXIS_COMMON_PSI_H__
-#define __HKL_PSEUDOAXIS_COMMON_PSI_H__
+#ifndef __HKL_PSEUDOAXIS_COMMON_PSI_PRIVATE_H__
+#define __HKL_PSEUDOAXIS_COMMON_PSI_PRIVATE_H__
 
 #include <gsl/gsl_math.h>
 #include <gsl/gsl_vector.h>
 #include <gsl/gsl_sf_trig.h>
 
-#include <hkl/hkl-pseudoaxis.h>
+#include "hkl-pseudoaxis-auto-private.h"
 
 HKL_BEGIN_DECLS
 
-typedef struct _HklPseudoAxisEngineModePsi HklPseudoAxisEngineModePsi;
+typedef struct _HklModePsi HklModePsi;
+typedef struct _HklEnginePsi HklEnginePsi;
 
-struct _HklPseudoAxisEngineModePsi
+struct _HklModePsi
 {
-	HklPseudoAxisEngineMode parent;
+	HklMode parent;
 	HklVector Q0;
 	HklVector hkl0;
 };
 
-extern HklPseudoAxisEngineModePsi *hkl_pseudo_axis_engine_mode_psi_new(char const *name,
-								       size_t axes_names_len,
-								       char const *axes_names[]);
+struct _HklEnginePsi
+{
+	HklEngine engine;
+	HklParameter *psi;
+};
+
+extern HklMode *hkl_mode_psi_new(
+	const HklModeAutoInfo *info);
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_psi_new(void);
+extern HklEngine *hkl_engine_psi_new(void);
+
+extern int _psi_func(const gsl_vector *x, void *params, gsl_vector *f);
+
+static const HklFunction psi_func = {
+	.function = _psi_func,
+	.size = 4,
+};
 
 HKL_END_DECLS
 
-#endif /* __HKL_PSEUDOAXIS_COMMON_PSI_H__ */
+#endif /* __HKL_PSEUDOAXIS_COMMON_PSI_PRIVATE_H__ */
diff --git a/hkl/hkl-pseudoaxis-common-psi.c b/hkl/hkl-pseudoaxis-common-psi.c
index f7f9dfa..8e88958 100644
--- a/hkl/hkl-pseudoaxis-common-psi.c
+++ b/hkl/hkl-pseudoaxis-common-psi.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,35 +23,33 @@
 #include <gsl/gsl_vector.h>
 #include <gsl/gsl_sf_trig.h>
 
-#include <hkl/hkl-pseudoaxis.h>
-#include <hkl/hkl-pseudoaxis-common.h>
-#include <hkl/hkl-pseudoaxis-auto.h>
-#include <hkl/hkl-pseudoaxis-common-psi.h>
+#include "hkl/ccan/array_size/array_size.h"
 
-static int psi_func(const gsl_vector *x, void *params, gsl_vector *f)
+#include "hkl-error-private.h"
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-psi-private.h"
+#include "hkl-sample-private.h"
+
+/***********************/
+/* numerical functions */
+/***********************/
+
+int _psi_func(const gsl_vector *x, void *params, gsl_vector *f)
 {
 
 	HklVector dhkl0, hkl1;
 	HklVector ki, kf, Q, n;
 	HklMatrix RUB;
-	HklPseudoAxisEngine *engine;
-	HklPseudoAxisEngineModePsi *modepsi;
-	HklPseudoAxis *psi;
-	HklHolder *holder;
-	size_t i;
-	size_t len;
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
-
-	engine = params;
-	modepsi = (HklPseudoAxisEngineModePsi *)engine->mode;
-	psi = engine->pseudoAxes[0];
+	HklEngine *engine = params;
+	HklEnginePsi *psi_engine = container_of(engine, HklEnginePsi, engine);
+	HklModePsi *modepsi = container_of(engine->mode, HklModePsi, parent);
+	HklHolder *sample_holder;
+
+	CHECK_NAN(x->data, x->size);
 
 	/* update the workspace from x; */
-	len = HKL_LIST_LEN(engine->axes);
-	for(i=0; i<len; ++i)
-		hkl_axis_set_value(engine->axes[i], x_data[i]);
-	hkl_geometry_update(engine->geometry);
+	set_geometry_axes(engine, x->data);
 
 	/* kf - ki = Q */
 	hkl_source_compute_ki(&engine->geometry->source, &ki);
@@ -59,15 +57,17 @@ static int psi_func(const gsl_vector *x, void *params, gsl_vector *f)
 	Q = kf;
 	hkl_vector_minus_vector(&Q, &ki);
 	if (hkl_vector_is_null(&Q)){
-		f_data[0] = 1;
-		f_data[1] = 1;
-		f_data[2] = 1;
-		f_data[3] = 1;
+		f->data[0] = 1;
+		f->data[1] = 1;
+		f->data[2] = 1;
+		f->data[3] = 1;
 	}else{
+		uint len;
+
 		/* R * UB */
 		/* for now the 0 holder is the sample holder. */
-		holder = &engine->geometry->holders[0];
-		hkl_quaternion_to_matrix(&holder->q, &RUB);
+		sample_holder = darray_item(engine->geometry->holders, 0);
+		hkl_quaternion_to_matrix(&sample_holder->q, &RUB);
 		hkl_matrix_times_matrix(&RUB, &engine->sample->UB);
 
 		/* compute dhkl0 */
@@ -75,10 +75,10 @@ static int psi_func(const gsl_vector *x, void *params, gsl_vector *f)
 		hkl_vector_minus_vector(&dhkl0, &modepsi->hkl0);
 
 		/* compute the intersection of the plan P(kf, ki) and PQ (normal Q) */
-		/* 
+		/*
 		 * now that dhkl0 have been computed we can use a
 		 * normalized Q to compute n and psi
-		 */ 
+		 */
 		hkl_vector_normalize(&Q);
 		n = kf;
 		hkl_vector_vectorial_product(&n, &ki);
@@ -86,77 +86,79 @@ static int psi_func(const gsl_vector *x, void *params, gsl_vector *f)
 
 		/* compute hkl1 in the laboratory referentiel */
 		/* for now the 0 holder is the sample holder. */
-		hkl1.data[0] = engine->mode->parameters[0].value;
-		hkl1.data[1] = engine->mode->parameters[1].value;
-		hkl1.data[2] = engine->mode->parameters[2].value;
-		hkl_vector_times_matrix(&hkl1, &engine->sample->UB);
-		hkl_vector_rotated_quaternion(&hkl1, &engine->geometry->holders[0].q);
-	
+		hkl_parameter_list_values_get(&engine->mode->parameters, hkl1.data, &len);
+		hkl_matrix_times_vector(&engine->sample->UB, &hkl1);
+		hkl_vector_rotated_quaternion(&hkl1, &sample_holder->q);
+
 		/* project hkl1 on the plan of normal Q */
 		hkl_vector_project_on_plan(&hkl1, &Q);
 		if (hkl_vector_is_null(&hkl1)){
 			/* hkl1 colinear with Q */
-			f_data[0] = dhkl0.data[0];
-			f_data[1] = dhkl0.data[1];
-			f_data[2] = dhkl0.data[2];
-			f_data[3] = 1;
+			f->data[0] = dhkl0.data[0];
+			f->data[1] = dhkl0.data[1];
+			f->data[2] = dhkl0.data[2];
+			f->data[3] = 1;
 		}else{
-			f_data[0] = dhkl0.data[0];
-			f_data[1] = dhkl0.data[1];
-			f_data[2] = dhkl0.data[2];
-			f_data[3] = psi->parent.value - hkl_vector_oriented_angle(&n, &hkl1, &Q);
+			f->data[0] = dhkl0.data[0];
+			f->data[1] = dhkl0.data[1];
+			f->data[2] = dhkl0.data[2];
+			f->data[3] = psi_engine->psi->_value - hkl_vector_oriented_angle(&n, &hkl1, &Q);
 		}
 	}
 	return GSL_SUCCESS;
 }
 
-static int hkl_pseudo_axis_engine_mode_init_psi_real(HklPseudoAxisEngineMode *base,
-						     HklPseudoAxisEngine *engine,
-						     HklGeometry *geometry,
-						     HklDetector *detector,
-						     HklSample *sample,
-						     HklError **error)
+static int hkl_mode_init_psi_real(HklMode *base,
+				  HklEngine *engine,
+				  HklGeometry *geometry,
+				  HklDetector *detector,
+				  HklSample *sample,
+				  HklError **error)
 {
-	int status = HKL_SUCCESS;
 	HklVector ki;
 	HklMatrix RUB;
-	HklPseudoAxisEngineModePsi *self = (HklPseudoAxisEngineModePsi *)base;
-	HklHolder *holder;
-	
-	status = hkl_pseudo_axis_engine_init_func(base, engine, geometry, detector, sample);
-	if (status == HKL_FAIL)
-		return status;
+	HklModePsi *self = container_of(base, HklModePsi, parent);
+	HklHolder *sample_holder;
+
+	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
+
+	if (!hkl_mode_init_real(base, engine, geometry, detector, sample, error)){
+		hkl_error_set(error, "internal error");
+		return HKL_FALSE;
+	}
+	hkl_assert(error == NULL || *error == NULL);
 
 	/* update the geometry internals */
 	hkl_geometry_update(geometry);
 
 	/* R * UB */
 	/* for now the 0 holder is the sample holder. */
-	holder = &geometry->holders[0];
-	hkl_quaternion_to_matrix(&holder->q, &RUB);
+	sample_holder = darray_item(geometry->holders, 0);
+	hkl_quaternion_to_matrix(&sample_holder->q, &RUB);
 	hkl_matrix_times_matrix(&RUB, &sample->UB);
 
 	/* kf - ki = Q0 */
 	hkl_source_compute_ki(&geometry->source, &ki);
 	hkl_detector_compute_kf(detector, geometry, &self->Q0);
 	hkl_vector_minus_vector(&self->Q0, &ki);
-	if (hkl_vector_is_null(&self->Q0))
-		status = HKL_FAIL;
-	else
+	if (hkl_vector_is_null(&self->Q0)){
+		hkl_error_set(error, "can not initialize the \"%s\" engine when hkl is null",
+			      engine->info->name);
+		return HKL_FALSE;
+	}else
 		/* compute hkl0 */
 		hkl_matrix_solve(&RUB, &self->hkl0, &self->Q0);
 
-	return status;
+	return HKL_TRUE;
 }
 
-static int hkl_pseudo_axis_engine_mode_get_psi_real(HklPseudoAxisEngineMode *base,
-						    HklPseudoAxisEngine *engine,
-						    HklGeometry *geometry,
-						    HklDetector *detector,
-						    HklSample *sample,
-						    HklError **error)
+static int hkl_mode_get_psi_real(HklMode *base,
+				 HklEngine *engine,
+				 HklGeometry *geometry,
+				 HklDetector *detector,
+				 HklSample *sample,
+				 HklError **error)
 {
-	int status = HKL_SUCCESS;
 	HklVector ki;
 	HklVector kf;
 	HklVector Q;
@@ -164,8 +166,8 @@ static int hkl_pseudo_axis_engine_mode_get_psi_real(HklPseudoAxisEngineMode *bas
 	HklVector n;
 
 	if (!base || !engine || !engine->mode || !geometry || !detector || !sample){
-		status = HKL_FAIL;
-		return status;
+		hkl_error_set(error, "internal error");
+		return HKL_FALSE;
 	}
 
 	/* get kf, ki and Q */
@@ -173,9 +175,12 @@ static int hkl_pseudo_axis_engine_mode_get_psi_real(HklPseudoAxisEngineMode *bas
 	hkl_detector_compute_kf(detector, geometry, &kf);
 	Q = kf;
 	hkl_vector_minus_vector(&Q, &ki);
-	if (hkl_vector_is_null(&Q))
-		status = HKL_FAIL;
-	else{
+	if (hkl_vector_is_null(&Q)){
+		hkl_error_set(error, "can not compute psi when hkl is null (kf == ki)");
+		return HKL_FALSE;
+	}else{
+		uint shit;
+
 		/* needed for a problem of precision */
 		hkl_vector_normalize(&Q);
 
@@ -187,87 +192,84 @@ static int hkl_pseudo_axis_engine_mode_get_psi_real(HklPseudoAxisEngineMode *bas
 		/* compute hkl1 in the laboratory referentiel */
 		/* the geometry was already updated in the detector compute kf */
 		/* for now the 0 holder is the sample holder. */
-		hkl1.data[0] = base->parameters[0].value;
-		hkl1.data[1] = base->parameters[1].value;
-		hkl1.data[2] = base->parameters[2].value;
-		hkl_vector_times_matrix(&hkl1, &sample->UB);
-		hkl_vector_rotated_quaternion(&hkl1, &geometry->holders[0].q);
-	
+		hkl_parameter_list_values_get(&base->parameters, hkl1.data, &shit);
+		hkl_matrix_times_vector(&sample->UB, &hkl1);
+		hkl_vector_rotated_quaternion(&hkl1, &darray_item(geometry->holders, 0)->q);
+
 		/* project hkl1 on the plan of normal Q */
 		hkl_vector_project_on_plan(&hkl1, &Q);
-	
-		if (hkl_vector_is_null(&hkl1))
-			status = HKL_FAIL;
-		else
+
+		if (hkl_vector_is_null(&hkl1)){
+			hkl_error_set(error, "can not compute psi when Q and the ref vector are colinear");
+			return HKL_FALSE;
+		}else{
+			HklEnginePsi *psi_engine = container_of(engine, HklEnginePsi, engine);
+
 			/* compute the angle beetween hkl1 and n */
-			((HklParameter *)engine->pseudoAxes[0])->value = hkl_vector_oriented_angle(&n, &hkl1, &Q);
+			psi_engine->psi->_value = hkl_vector_oriented_angle(&n, &hkl1, &Q);
+		}
 	}
 
-	return status;
+	return HKL_TRUE;
 }
 
-HklPseudoAxisEngineModePsi *hkl_pseudo_axis_engine_mode_psi_new(char const *name,
-								size_t axes_names_len,
-								char const *axes_names[])
+HklMode *hkl_mode_psi_new(const HklModeAutoInfo *info)
 {
-	HklPseudoAxisEngineModePsi *self;
-	HklParameter parameters[3];
-	HklFunction functions[] = {psi_func};
-
-	if (axes_names_len != 4){
-		fprintf(stderr, "This generic HklPseudoAxisEngineModePsi need exactly 4 axes");
+	static const HklModeOperations operations = {
+		HKL_MODE_OPERATIONS_AUTO_DEFAULTS,
+		.init = hkl_mode_init_psi_real,
+		.get = hkl_mode_get_psi_real,
+	};
+	HklModePsi *self;
+
+	if (info->mode.n_axes != 4){
+		fprintf(stderr, "This generic HklModePsi need exactly 4 axes");
 		exit(128);
 	}
 
-	self = HKL_MALLOC(HklPseudoAxisEngineModePsi);
-
-	/* h1  */
-	hkl_parameter_init(&parameters[0],
-			   "h1",
-			   -1, 1, 1,
-			   HKL_TRUE, HKL_FALSE,
-			   NULL, NULL);
-
-	/* k1 */
-	hkl_parameter_init(&parameters[1],
-			   "k1",
-			   -1, 0, 1,
-			   HKL_TRUE, HKL_FALSE,
-			   NULL, NULL);
-
-	/* l1 */
-	hkl_parameter_init(&parameters[2],
-			   "l1",
-			   -1, 0, 1,
-			   HKL_TRUE, HKL_FALSE,
-			   NULL, NULL);
+	self = HKL_MALLOC(HklModePsi);
 
 	/* the base constructor; */
-	hkl_pseudo_axis_engine_mode_init(&self->parent,
-					 name,
-					 hkl_pseudo_axis_engine_mode_init_psi_real,
-					 hkl_pseudo_axis_engine_mode_get_psi_real,
-					 hkl_pseudo_axis_engine_mode_set_real,
-					 1, functions,
-					 3, parameters,
-					 axes_names_len, axes_names);
+	hkl_mode_auto_init(&self->parent,
+			   info,
+			   &operations);
 
-
-	return self;
+	return &self->parent;
 }
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_psi_new(void)
-{
-	HklPseudoAxisEngine *self;
-
-	self = hkl_pseudo_axis_engine_new("psi", 1, "psi");
+/***********************/
+/* HklEngine */
+/***********************/
 
-	/* psi */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[0],
-			   "psi",
-			   -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+static void hkl_engine_psi_free_real(HklEngine *base)
+{
+	HklEnginePsi *self=container_of(base, HklEnginePsi, engine);
+	hkl_engine_release(&self->engine);
+	free(self);
+}
 
-	return self;
+HklEngine *hkl_engine_psi_new(void)
+{
+	HklEnginePsi *self;
+	static const HklPseudoAxis psi = {
+		.parameter = { HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"}
+	};
+	static const HklPseudoAxis *pseudo_axes[] = {&psi};
+	static const HklEngineInfo info = {
+		.name = "psi",
+		.pseudo_axes = pseudo_axes,
+		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+	};
+	static const HklEngineOperations operations = {
+		HKL_ENGINE_OPERATIONS_DEFAULTS,
+		.free=hkl_engine_psi_free_real,
+	};
+
+	self = HKL_MALLOC(HklEnginePsi);
+
+	hkl_engine_init(&self->engine, &info, &operations);
+
+	self->psi = register_pseudo_axis(&self->engine, &psi.parameter);
+
+	return &self->engine;
 }
diff --git a/hkl/hkl-pseudoaxis-common.h b/hkl/hkl-pseudoaxis-common-q-private.h
similarity index 68%
rename from hkl/hkl-pseudoaxis-common.h
rename to hkl/hkl-pseudoaxis-common-q-private.h
index 8ee0fd5..af7356d 100644
--- a/hkl/hkl-pseudoaxis-common.h
+++ b/hkl/hkl-pseudoaxis-common-q-private.h
@@ -13,26 +13,27 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_PSEUDOAXIS_COMMON_H__
-#define __HKL_PSEUDOAXIS_COMMON_H__
+#ifndef __HKL_PSEUDOAXIS_COMMON_Q_PRIVATE_H__
+#define __HKL_PSEUDOAXIS_COMMON_Q_PRIVATE_H__
 
-#include <hkl/hkl-pseudoaxis.h>
+#include "hkl.h"
 
 HKL_BEGIN_DECLS
 
-extern int hkl_pseudo_axis_engine_init_func(HklPseudoAxisEngineMode *self,
-					    HklPseudoAxisEngine *engine,
-					    HklGeometry *geometry,
-					    HklDetector const *detector,
-					    HklSample const *sample);
+typedef struct _HklEngineQ HklEngineQ;
+typedef struct _HklEngineQ2 HklEngineQ2;
+typedef struct _HklEngineQperQpar HklEngineQperQpar;
 
+extern HklEngine *hkl_engine_q_new(void);
+extern HklEngine *hkl_engine_q2_new(void);
+extern HklEngine *hkl_engine_qper_qpar_new(void);
 
 HKL_END_DECLS
 
-#endif /* __HKL_PSEUDOAXIS_COMMON_H__ */
+#endif
diff --git a/hkl/hkl-pseudoaxis-common-q.c b/hkl/hkl-pseudoaxis-common-q.c
index eb15131..d1e5190 100644
--- a/hkl/hkl-pseudoaxis-common-q.c
+++ b/hkl/hkl-pseudoaxis-common-q.c
@@ -13,233 +13,429 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  *          Jens Krüger <Jens.Krueger at frm2.tum.de>
  */
+#include <gsl/gsl_sf_trig.h>
+
 #include <string.h>
-#include <hkl/hkl-pseudoaxis.h>
-#include <hkl/hkl-pseudoaxis-common.h>
-#include <hkl/hkl-pseudoaxis-common-q.h>
-#include <hkl/hkl-pseudoaxis-auto.h>
+#include "hkl/ccan/array_size/array_size.h"
 #include <gsl/gsl_sf_trig.h>
 
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-q-private.h"
+
 /*****/
 /* q */
 /*****/
 
-static int q(const gsl_vector *x, void *params, gsl_vector *f)
+struct _HklEngineQ
+{
+	HklEngine engine;
+	HklParameter *q;
+};
+
+static int _q_func(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	size_t i;
 	double q;
-	double q0;
+	HklEngine *engine = params;
+	const HklEngineQ *engine_q = container_of(engine, HklEngineQ, engine);
 	double tth;
-	double const *x_data;
-	double *f_data;
-	HklPseudoAxisEngine *engine;
 
-	x_data = gsl_vector_const_ptr(x, 0);
-	f_data = gsl_vector_ptr(f, 0);
-	engine = params;
+	CHECK_NAN(x->data, x->size);
 
 	/* update the workspace from x */
-	for(i=0; i<HKL_LIST_LEN(engine->axes); ++i)
-		hkl_axis_set_value(engine->axes[i], x_data[i]);
-	hkl_geometry_update(engine->geometry);
+	set_geometry_axes(engine, x->data);
 
-	q0 = ((HklParameter *)engine->pseudoAxes[0])->value;
-
-	tth = gsl_sf_angle_restrict_symm(x_data[0]);
+	tth = gsl_sf_angle_restrict_symm(x->data[0]);
 	q = 2 * HKL_TAU / hkl_source_get_wavelength(&engine->geometry->source) * sin(tth/2.);
 
-	f_data[0] = q0 - q;
+	f->data[0] = engine_q->q->_value - q;
 
 	return  GSL_SUCCESS;
 }
 
-static int hkl_pseudo_axis_engine_mode_get_q_real(HklPseudoAxisEngineMode *self,
-						  HklPseudoAxisEngine *engine,
-						  HklGeometry *geometry,
-						  HklDetector *detector,
-						  HklSample *sample,
-						  HklError **error)
+static const HklFunction q_func = {
+	.function = _q_func,
+	.size = 1,
+};
+
+static int get_q_real(HklMode *self,
+		      HklEngine *base,
+		      HklGeometry *geometry,
+		      HklDetector *detector,
+		      HklSample *sample,
+		      HklError **error)
 {
 	double wavelength;
 	double theta;
-	double q;
-	HklInterval range = {0};
 	HklVector ki, kf;
-	HklParameter *parameter;
+	HklEngineQ *engine = container_of(base, HklEngineQ, engine);
 
 	wavelength = hkl_source_get_wavelength(&geometry->source);
 	hkl_source_compute_ki(&geometry->source, &ki);
 	hkl_detector_compute_kf(detector, geometry, &kf);
 	theta = hkl_vector_angle(&ki, &kf) / 2.;
-	
-	hkl_vector_vectorial_product(&ki, &kf);
-	if(ki.data[1] > 0)
-		theta = -theta;
 
-	q = 2 * HKL_TAU / wavelength * sin(theta);
+	/* we decide of the sign of theta depending on the orientation
+	 * of kf in the direct-space */
+	if(kf.data[1] < 0 || kf.data[2] < 0)
+		theta = -theta;
 
 	/* update q */
-	parameter = (HklParameter *)(engine->pseudoAxes[0]);
-	hkl_parameter_set_value(parameter, q);
-	hkl_parameter_set_range(parameter, range.min, range.max);
+	engine->q->_value = 2 * HKL_TAU / wavelength * sin(theta);
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_q_new(void)
-{
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
-
-	self = hkl_pseudo_axis_engine_new("q", 1, "q");
-
-	/* q */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[0],
-			   "q",
-			   -1, 0., 1,
-			   HKL_TRUE, HKL_TRUE,
-			   NULL, NULL);
-	/* q */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"q",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_q_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, q,
-		(size_t)0,
-		(size_t)1, "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+/* not declared in the constructor as it is used also in the q2 pseudo
+ * axis engine */
+static const HklPseudoAxis q = {
+	.parameter = {HKL_PARAMETER_DEFAULTS, .name="q", .range={.max=1}},
+};
 
+static HklMode *mode_q(void)
+{
+	static const char *axes[] = {"tth"};
+	static const HklFunction *functions[] = {&q_func};
+	static HklModeAutoInfo info = {
+		INFO_AUTO("q", axes, functions),
+	};
+	static const HklModeOperations operations = {
+		HKL_MODE_OPERATIONS_AUTO_DEFAULTS,
+		.get = get_q_real,
+	};
+
+	return hkl_mode_auto_new(&info, &operations);
+}
 
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+static void hkl_engine_q_free_real(HklEngine *base)
+{
+	HklEngineQ *self=container_of(base, HklEngineQ, engine);
+	hkl_engine_release(&self->engine);
+	free(self);
+}
 
-	return self;
+HklEngine *hkl_engine_q_new(void)
+{
+	HklEngineQ *self;
+	HklMode *mode;
+	static const HklPseudoAxis *pseudo_axes[] = {&q};
+	static const HklEngineInfo info = {
+		.name = "q",
+		.pseudo_axes = pseudo_axes,
+		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+	};
+	static const HklEngineOperations operations = {
+		HKL_ENGINE_OPERATIONS_DEFAULTS,
+		.free=hkl_engine_q_free_real,
+	};
+
+	self = HKL_MALLOC(HklEngineQ);
+
+	hkl_engine_init(&self->engine, &info, &operations);
+	self->q = register_pseudo_axis(&self->engine, &q.parameter);
+
+	/* q [default] */
+	mode = mode_q();
+	hkl_engine_add_mode(&self->engine, mode);
+	hkl_engine_select_mode(&self->engine, mode);
+
+	return &self->engine;
 }
 
 /******/
 /* q2 */
 /******/
 
-static int q2(const gsl_vector *x, void *params, gsl_vector *f)
+struct _HklEngineQ2
+{
+	HklEngine engine;
+	HklParameter *q;
+	HklParameter *alpha;
+};
+
+static void _q2(HklGeometry *geometry, HklDetector *detector,
+		double *q, double *alpha)
 {
-	size_t i;
-	double q0, q;
-	double alpha0, alpha;
 	double wavelength, theta;
-	double const *x_data;
-	double *f_data;
-	HklPseudoAxisEngine *engine;
 	HklVector kf, ki;
-	HklVector X = {{1, 0, 0}};
+	static HklVector x = {
+		.data = {1, 0, 0},
+	};
 
-	x_data = gsl_vector_const_ptr(x, 0);
-	f_data = gsl_vector_ptr(f, 0);
-	engine = params;
+	wavelength = hkl_source_get_wavelength(&geometry->source);
+	hkl_source_compute_ki(&geometry->source, &ki);
+	hkl_detector_compute_kf(detector, geometry, &kf);
+	theta = hkl_vector_angle(&ki, &kf) / 2.;
 
-	/* update the workspace from x */
-	for(i=0; i<HKL_LIST_LEN(engine->axes); ++i)
-		hkl_axis_set_value(engine->axes[i], x_data[i]);
-	hkl_geometry_update(engine->geometry);
+	*q = 2 * HKL_TAU / wavelength * sin(theta);
 
-	q0 = ((HklParameter *)engine->pseudoAxes[0])->value;
-	alpha0 = ((HklParameter *)engine->pseudoAxes[1])->value;
+	/* project kf on the x plan to compute alpha */
+	hkl_vector_project_on_plan(&kf, &x);
 
-	wavelength = hkl_source_get_wavelength(&engine->geometry->source);
-	hkl_source_compute_ki(&engine->geometry->source, &ki);
-	hkl_detector_compute_kf(engine->detector, engine->geometry, &kf);
-	theta = hkl_vector_angle(&ki, &kf) / 2.;
-	
-	q = 2 * HKL_TAU / wavelength * sin(theta);
+	*alpha = atan2(kf.data[2], kf.data[1]);
 
-	/* project kf on the x plan to compute alpha */
-	hkl_vector_project_on_plan(&kf, &X);
-	alpha = atan2(kf.data[2], kf.data[1]);
+}
+
+static int _q2_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	HklEngine *engine = params;
+	const HklEngineQ2 *engine_q2 = container_of(engine, HklEngineQ2, engine);
+	double q;
+	double alpha;
+
+	CHECK_NAN(x->data, x->size);
+
+	/* update the workspace from x */
+	set_geometry_axes(engine, x->data);
+
+	_q2(engine->geometry, engine->detector, &q, &alpha);
 
-	f_data[0] = q0 - q;
-	f_data[1] = alpha0 - alpha;
+	f->data[0] = engine_q2->q->_value - q;
+	f->data[1] = engine_q2->alpha->_value - alpha;
 
 	return  GSL_SUCCESS;
 }
 
+static const HklFunction q2_func = {
+	.function = _q2_func,
+	.size = 2,
+};
+
+static int get_q2_real(HklMode *self,
+		       HklEngine *engine,
+		       HklGeometry *geometry,
+		       HklDetector *detector,
+		       HklSample *sample,
+		       HklError **error)
+{
+	HklEngineQ2 *engine_q2 = container_of(engine, HklEngineQ2, engine);
+
+	_q2(geometry, detector, &engine_q2->q->_value, &engine_q2->alpha->_value);
 
-static int hkl_pseudo_axis_engine_mode_get_q2_real(HklPseudoAxisEngineMode *self,
-						   HklPseudoAxisEngine *engine,
-						   HklGeometry *geometry,
-						   HklDetector *detector,
-						   HklSample *sample,
-						   HklError **error)
+	return HKL_TRUE;
+}
+
+static HklMode *mode_q2(void)
 {
-	double wavelength;
-	double theta;
-	double q, alpha;
-	HklVector x = {{1, 0, 0}};
-	HklVector ki, kf;
-	HklParameter *parameter;
+	static const char* axes[] = {"gamma", "delta"};
+	static const HklFunction *functions[] = {&q2_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO("q2", axes, functions),
+	};
+	static const HklModeOperations operations = {
+		HKL_MODE_OPERATIONS_AUTO_DEFAULTS,
+		.get = get_q2_real,
+	};
+
+	return hkl_mode_auto_new(&info, &operations);
+}
 
-	wavelength = hkl_source_get_wavelength(&geometry->source);
-	hkl_source_compute_ki(&geometry->source, &ki);
-	hkl_detector_compute_kf(detector, geometry, &kf);
-	theta = hkl_vector_angle(&ki, &kf) / 2.;
-	
-	q = 2 * HKL_TAU / wavelength * sin(theta);
+static const HklPseudoAxis alpha = {
+	.parameter = {HKL_PARAMETER_DEFAULTS_ANGLE, .name="alpha"},
+};
 
-	/* project kf on the x plan to compute alpha */
-	hkl_vector_project_on_plan(&kf, &x);
-	alpha = atan2(kf.data[2], kf.data[1]);
+static void hkl_engine_q2_free_real(HklEngine *base)
+{
+	HklEngineQ2 *self = container_of(base, HklEngineQ2, engine);
+	hkl_engine_release(&self->engine);
+	free(self);
+}
 
-	/* update q */
-	parameter = (HklParameter *)(engine->pseudoAxes[0]);
-	hkl_parameter_set_value(parameter, q);
+HklEngine *hkl_engine_q2_new(void)
+{
+	HklEngineQ2 *self;
+	HklMode *mode;
+	static const HklPseudoAxis *pseudo_axes[] = {&q, &alpha};
+	static const HklEngineInfo info = {
+		.name = "q2",
+		.pseudo_axes = pseudo_axes,
+		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+	};
+	static const HklEngineOperations operations = {
+		HKL_ENGINE_OPERATIONS_DEFAULTS,
+		.free=hkl_engine_q2_free_real,
+	};
+
+	self = HKL_MALLOC(HklEngineQ2);
+
+	hkl_engine_init(&self->engine, &info, &operations);
+	self->q = register_pseudo_axis(&self->engine, &q.parameter);
+	self->alpha = register_pseudo_axis(&self->engine, &alpha.parameter);
+
+	/* q2 [default] */
+	mode = mode_q2();
+	hkl_engine_add_mode(&self->engine, mode);
+	hkl_engine_select_mode(&self->engine, mode);
+
+	return &self->engine;
+}
 
-	/* update alpha */
-	parameter = (HklParameter *)(engine->pseudoAxes[1]);
-	hkl_parameter_set_value(parameter, alpha);
-	hkl_parameter_set_range(parameter, -M_PI, M_PI);
+/************/
+/* QperQpar */
+/************/
 
-	return HKL_SUCCESS;
+struct _HklEngineQperQpar
+{
+	HklEngine engine;
+	HklParameter *qper;
+	HklParameter *qpar;
+};
+
+static void _qper_qpar(HklEngine *engine,
+		       HklGeometry *geometry, HklDetector *detector,
+		       double *qper, double *qpar)
+{
+	HklVector ki;
+	HklVector q;
+	HklVector n = {
+		.data = {
+			darray_item(engine->mode->parameters, 0)->_value,
+			darray_item(engine->mode->parameters, 1)->_value,
+			darray_item(engine->mode->parameters, 2)->_value,
+		},
+	};
+	HklVector npar;
+	HklVector qper_v;
+	HklVector qpar_v;
+	double norm;
+
+	/* compute q = kf - ki */
+	hkl_source_compute_ki(&geometry->source, &ki);
+	hkl_detector_compute_kf(detector, geometry, &q);
+	hkl_vector_minus_vector(&q, &ki);
+
+	/* compute the real orientation of the surface n */
+	hkl_vector_rotated_quaternion(&n, &darray_item(geometry->holders, 0)->q);
+	hkl_vector_normalize(&n);
+
+	/* compute the npar used to define the sign of qpar */
+	npar = ki;
+	hkl_vector_vectorial_product(&npar, &n);
+
+	/* qper */
+	qper_v = n;
+	norm = hkl_vector_scalar_product(&q, &n);
+	hkl_vector_times_double(&qper_v, norm);
+	*qper = hkl_vector_norm2(&qper_v);
+	if (signbit(norm))
+		*qper *= -1;
+
+	/* qpar */
+	qpar_v = q;
+	norm = hkl_vector_scalar_product(&q, &npar);
+	hkl_vector_minus_vector(&qpar_v, &qper_v);
+	*qpar = hkl_vector_norm2(&qpar_v);
+	if (signbit(norm))
+		*qpar *= -1;
 }
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_q2_new(void)
+static int _qper_qpar_func(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
+	HklEngine *engine = params;
+	const HklEngineQperQpar *engine_qper_qpar = container_of(engine, HklEngineQperQpar, engine);
+	double qper;
+	double qpar;
+
+	CHECK_NAN(x->data, x->size);
+
+	/* update the workspace from x */
+	set_geometry_axes(engine, x->data);
+
+	_qper_qpar(engine, engine->geometry, engine->detector,
+		   &qper, &qpar);
+
+	f->data[0] = engine_qper_qpar->qper->_value - qper;
+	f->data[1] = engine_qper_qpar->qpar->_value - qpar;
 
-	self = hkl_pseudo_axis_engine_new("q2", 2, "q", "alpha");
+	return  GSL_SUCCESS;
+}
 
-	/* q */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[0],
-			   "q",
-			   0., 0., 1,
-			   HKL_TRUE, HKL_TRUE,
-			   NULL, NULL);
+static const HklFunction qper_qpar_func = {
+	.function = _qper_qpar_func,
+	.size = 2,
+};
+
+static int get_qper_qpar_real(HklMode *self,
+			      HklEngine *engine,
+			      HklGeometry *geometry,
+			      HklDetector *detector,
+			      HklSample *sample,
+			      HklError **error)
+{
+	HklEngineQperQpar *engine_qper_qpar = container_of(engine, HklEngineQperQpar, engine);
 
-	/* alpha */
-	hkl_parameter_init((HklParameter *)self->pseudoAxes[1],
-			   "alpha",
-			   -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+	_qper_qpar(engine, geometry, detector,
+		   &engine_qper_qpar->qper->_value,
+		   &engine_qper_qpar->qpar->_value);
 
-	/* q */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"q2",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_q2_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, q2,
-		(size_t)0,
-		(size_t)2, "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
+	return HKL_TRUE;
+}
 
+static HklMode *mode_qper_qpar(void)
+{
+	static const char* axes[] = {"gamma", "delta"};
+	static const HklFunction *functions[] = {&qper_qpar_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "x", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS, .name = "y", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "z", .range = {.min=-1, .max=1}, ._value = 0,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS("qper_qpar", axes, functions, parameters),
+	};
+	static const HklModeOperations operations = {
+		HKL_MODE_OPERATIONS_AUTO_DEFAULTS,
+		.get = get_qper_qpar_real,
+	};
+
+	return hkl_mode_auto_new(&info, &operations);
+}
 
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+static void hkl_engine_qper_qpar_free_real(HklEngine *base)
+{
+	HklEngineQperQpar *self = container_of(base, HklEngineQperQpar, engine);
+	hkl_engine_release(&self->engine);
+	free(self);
+}
 
-	return self;
+HklEngine *hkl_engine_qper_qpar_new(void)
+{
+	static const HklPseudoAxis qper = {
+		.parameter = {HKL_PARAMETER_DEFAULTS, .name="qper", .range={.min=-1, .max=1}},
+	};
+	static const HklPseudoAxis qpar = {
+		.parameter = {HKL_PARAMETER_DEFAULTS, .name="qpar", .range={.min=-1, .max=1}},
+	};
+	static const HklPseudoAxis *pseudo_axes[] = {&qper, &qpar};
+	static const HklEngineInfo info = {
+		.name = "qper_qpar",
+		.pseudo_axes = pseudo_axes,
+		.n_pseudo_axes = ARRAY_SIZE(pseudo_axes),
+	};
+	static const HklEngineOperations operations = {
+		HKL_ENGINE_OPERATIONS_DEFAULTS,
+		.free = hkl_engine_qper_qpar_free_real,
+	};
+	HklEngineQperQpar *self;
+	HklMode *mode;
+
+	self = HKL_MALLOC(HklEngineQperQpar);
+
+	hkl_engine_init(&self->engine, &info, &operations);
+	self->qper = register_pseudo_axis(&self->engine, &qper.parameter);
+	self->qpar = register_pseudo_axis(&self->engine, &qpar.parameter);
+
+	/* qper_qpar [default] */
+	mode = mode_qper_qpar();
+	hkl_engine_add_mode(&self->engine, mode);
+	hkl_engine_select_mode(&self->engine, mode);
+
+	return &self->engine;
 }
diff --git a/hkl/hkl-pseudoaxis-common.c b/hkl/hkl-pseudoaxis-common.c
deleted file mode 100644
index 3affc19..0000000
--- a/hkl/hkl-pseudoaxis-common.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl/hkl-pseudoaxis-common.h>
-
-int hkl_pseudo_axis_engine_init_func(HklPseudoAxisEngineMode *mode,
-				     HklPseudoAxisEngine *self,
-				     HklGeometry *geometry,
-				     HklDetector const *detector,
-				     HklSample const *sample)
-{
-	if (!self || !mode || !geometry || !detector || !sample)
-		return HKL_FAIL;
-
-	/* update the geometry internals */
-	hkl_geometry_update(geometry);
-
-	if(mode->geometry_init)
-		hkl_geometry_free(mode->geometry_init);
-	mode->geometry_init = hkl_geometry_new_copy(geometry);
-	
-	if(mode->detector_init)
-		hkl_detector_free(mode->detector_init);
-	mode->detector_init = hkl_detector_new_copy(detector);
-
-	if(mode->sample_init)
-		hkl_sample_free(mode->sample_init);
-	mode->sample_init = hkl_sample_new_copy(sample);
-
-	return HKL_SUCCESS;
-}
diff --git a/hkl/hkl-pseudoaxis-e4c-hkl.c b/hkl/hkl-pseudoaxis-e4c-hkl.c
new file mode 100644
index 0000000..5780fcf
--- /dev/null
+++ b/hkl/hkl-pseudoaxis-e4c-hkl.c
@@ -0,0 +1,166 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
+ *          Jens Krüger <Jens.Krueger at frm2.tum.de>
+ */
+#include <gsl/gsl_math.h>
+#include <gsl/gsl_vector.h>
+
+#include "hkl/ccan/array_size/array_size.h"
+
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-hkl-private.h"
+
+/***********************/
+/* numerical functions */
+/***********************/
+
+static int _bissector_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double omega = x->data[0];
+	const double tth = x->data[3];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = tth - 2 * fmod(omega,M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_func = {
+	.function = _bissector_func,
+	.size = 4,
+};
+
+/*********/
+/* modes */
+/*********/
+
+static HklMode *bissector(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&bissector_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *constant_omega(void)
+{
+	static const char* axes[] = {"chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *constant_chi(void)
+{
+	static const char* axes[] = {"omega", "phi", "tth"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *constant_phi(void)
+{
+	static const char* axes[] = {"omega", "chi", "tth"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *double_diffraction(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions,
+				      parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *psi_constant(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions,
+				      parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations);
+}
+
+/***********************/
+/* pseudo axes engines */
+/***********************/
+
+HklEngine *hkl_engine_e4c_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega());
+	hkl_engine_add_mode(self, constant_chi());
+	hkl_engine_add_mode(self, constant_phi());
+	hkl_engine_add_mode(self, double_diffraction());
+	hkl_engine_add_mode(self, psi_constant());
+
+	return self;
+}
diff --git a/hkl/hkl-pseudoaxis-zaxis.h b/hkl/hkl-pseudoaxis-e4c-private.h
similarity index 76%
copy from hkl/hkl-pseudoaxis-zaxis.h
copy to hkl/hkl-pseudoaxis-e4c-private.h
index b97bca0..8577c0f 100644
--- a/hkl/hkl-pseudoaxis-zaxis.h
+++ b/hkl/hkl-pseudoaxis-e4c-private.h
@@ -13,21 +13,22 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_PSEUDOAXIS_ZAXIS_H__
-#define __HKL_PSEUDOAXIS_ZAXIS_H__
+#ifndef __HKL_PSEUDOAXIS_E4C_H__
+#define __HKL_PSEUDOAXIS_E4C_H__
 
-#include <hkl/hkl-pseudoaxis-auto.h>
+#include <hkl/hkl-pseudoaxis-auto-private.h>
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_zaxis_hkl_new(void);
+extern HklEngine *hkl_engine_e4c_hkl_new(void);
+extern HklEngine *hkl_engine_e4c_psi_new(void);
 
 HKL_END_DECLS
 
-#endif /* __HKL_PSEUDOAXIS_ZAXIS_H__ */
+#endif /* __HKL_PSEUDOAXIS_E4C_H__ */
diff --git a/hkl/hkl-pseudoaxis-e4c-psi.c b/hkl/hkl-pseudoaxis-e4c-psi.c
new file mode 100644
index 0000000..fddab8e
--- /dev/null
+++ b/hkl/hkl-pseudoaxis-e4c-psi.c
@@ -0,0 +1,57 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl/ccan/array_size/array_size.h"
+
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-e4c-private.h"
+#include "hkl-pseudoaxis-common-psi-private.h"
+
+static HklMode *psi(void)
+{
+	static const char *axes[] = {"omega", "chi", "phi", "tth"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+HklEngine *hkl_engine_e4c_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_psi_new();
+
+	default_mode = psi();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	return self;
+}
diff --git a/hkl/hkl-pseudoaxis-e4cv-hkl.c b/hkl/hkl-pseudoaxis-e4cv-hkl.c
deleted file mode 100644
index 695f3ef..0000000
--- a/hkl/hkl-pseudoaxis-e4cv-hkl.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- *          Maria-Teresa Nunez-Pardo-de-Verra <tnunez at mail.desy.de>
- *          Jens Krüger <Jens.Krueger at frm2.tum.de>
- */
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-
-#include <hkl/hkl-pseudoaxis-e4cv.h>
-#include <hkl/hkl-pseudoaxis-common-hkl.h>
-
-/*******/
-/* hkl */
-/*******/
-
-static int bissector_func(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double omega, tth;
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
-
-	RUBh_minus_Q(x_data, params, f_data);
-
-	omega = x_data[0];
-	tth = x_data[3];
-
-	f_data[3] = tth - 2 * fmod(omega,M_PI);
-
-	return  GSL_SUCCESS;
-}
-
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_e4cv_hkl_new(void)
-{
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
-	HklParameter h2;
-	HklParameter k2;
-	HklParameter l2;
-	HklParameter psi;
-
-	self = hkl_pseudo_axis_engine_hkl_new();
-
-	/* hkl get/set bissector */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"bissector",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, bissector_func,
-		(size_t)0,
-		(size_t)4, "omega", "chi", "phi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_omega */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_omega",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "chi", "phi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_chi */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_chi",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "omega", "phi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_phi */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_phi",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "omega", "chi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* double_diffraction */
-	hkl_parameter_init(&h2, "h2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"double_diffraction",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, double_diffraction_func,
-		(size_t)3, h2, k2, l2,
-		(size_t)4, "omega", "chi", "phi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* psi_constant */
-	hkl_parameter_init(&h2, "h2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1, 0, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1, 0, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&psi, "psi", -M_PI, 0, M_PI, HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"psi_constant",
-		hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, psi_constant_vertical_func,
-		(size_t)4, h2, k2, l2, psi,
-		(size_t)4, "omega", "chi", "phi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	hkl_pseudo_axis_engine_select_mode(self, 0);
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-e4cv-psi.c b/hkl/hkl-pseudoaxis-e4cv-psi.c
deleted file mode 100644
index ebe120f..0000000
--- a/hkl/hkl-pseudoaxis-e4cv-psi.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl/hkl-pseudoaxis-e4cv.h>
-#include <hkl/hkl-pseudoaxis-common-psi.h>
-
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_e4cv_psi_new(void)
-{
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineModePsi *mode;
-	char const *axes_names_psi[] = {"omega", "chi", "phi", "tth"};
-
-	self = hkl_pseudo_axis_engine_psi_new();
-
-	/* psi get/set */
-	mode = hkl_pseudo_axis_engine_mode_psi_new("psi", 4, axes_names_psi);
-	hkl_pseudo_axis_engine_add_mode(self, (HklPseudoAxisEngineMode *)mode);
-
-	hkl_pseudo_axis_engine_select_mode(self, 0);
-
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-e4cv.h b/hkl/hkl-pseudoaxis-e4cv.h
deleted file mode 100644
index eb0fb34..0000000
--- a/hkl/hkl-pseudoaxis-e4cv.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_E4CV_H__
-#define __HKL_PSEUDOAXIS_E4CV_H__
-
-#include <hkl/hkl-pseudoaxis-auto.h>
-
-HKL_BEGIN_DECLS
-
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_e4cv_hkl_new(void);
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_e4cv_psi_new(void);
-
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_E4CV_H__ */
diff --git a/hkl/hkl-pseudoaxis-e6c-hkl.c b/hkl/hkl-pseudoaxis-e6c-hkl.c
index 33816d0..214da40 100644
--- a/hkl/hkl-pseudoaxis-e6c-hkl.c
+++ b/hkl/hkl-pseudoaxis-e6c-hkl.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -24,195 +24,263 @@
 #include <gsl/gsl_math.h>
 #include <gsl/gsl_vector.h>
 
-#include <hkl/hkl-pseudoaxis-e6c.h>
-#include <hkl/hkl-pseudoaxis-common-hkl.h>
+#include "hkl/ccan/array_size/array_size.h"
+
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-hkl-private.h"
 
 /***********************/
 /* numerical functions */
 /***********************/
 
-static int bissector_horizontal(const gsl_vector *x, void *params, gsl_vector *f)
+static int _bissector_horizontal_func(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double mu, omega, gamma;
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
+	const double mu = x->data[0];
+	const double omega = x->data[1];
+	const double gamma = x->data[4];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = gamma - 2 * fmod(mu, M_PI);
+
+	return  GSL_SUCCESS;
+}
 
-	RUBh_minus_Q(x_data, params, f_data);
+static const HklFunction bissector_horizontal_func = {
+	.function = _bissector_horizontal_func,
+	.size = 5,
+};
+
+static int _bissector_vertical_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double omega = x->data[0];
+	const double tth = x->data[3];
 
-	mu = x_data[0];
-	omega = x_data[1];
-	gamma = x_data[4];
+	CHECK_NAN(x->data, x->size);
 
-	f_data[3] = fmod(omega, M_PI);
-	f_data[4] = gamma - 2 * fmod(mu, M_PI);
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = tth - 2 * fmod(omega,M_PI);
 
 	return  GSL_SUCCESS;
 }
 
-static int bissector_vertical(const gsl_vector *x, void *params, gsl_vector *f)
+static const HklFunction bissector_vertical_func = {
+	.function = _bissector_vertical_func,
+	.size = 4,
+};
+
+/*********/
+/* modes */
+/*********/
+
+static HklMode *bissector_vertical(void)
 {
-	double omega, tth;
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
+	static const char* axes[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&bissector_vertical_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
 
-	RUBh_minus_Q(x_data, params, f_data);
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	omega = x_data[0];
-	tth = x_data[3];
+static HklMode *constant_omega_vertical(void)
+{
+	static const char* axes[] = {"chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
 
-	f_data[3] = tth - 2 * fmod(omega,M_PI);
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	return  GSL_SUCCESS;
+static HklMode *constant_chi_vertical(void)
+{
+	static const char* axes[] = {"omega", "phi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *constant_phi_vertical(void)
+{
+	static const char* axes[] = {"omega", "chi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *lifting_detector_phi(void)
+{
+	static const char* axes[] = {"phi", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *lifting_detector_omega(void)
+{
+	static const char* axes[] = {"omega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *lifting_detector_mu(void)
+{
+	static const char* axes[] = {"mu", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *double_diffraction_vertical(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *bissector_horizontal(void)
+{
+	static const char* axes[] = {"mu", "omega", "chi", "phi", "gamma"};
+	static const HklFunction *functions[] = {&bissector_horizontal_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *double_diffraction_horizontal(void)
+{
+	static const char* axes[] = {"mu", "chi", "phi", "gamma"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *psi_constant_vertical(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations);
+}
+
+static HklMode *psi_constant_horizontal(void)
+{
+	static const char* axes[] = {"omega", "chi", "phi", "gamma"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations);
+}
+
+static HklMode *constant_mu_horizontal(void)
+{
+	static const char* axes[] = {"chi", "phi", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
 }
 
 /***********************/
 /* E6C PseudoAxeEngine */
 /***********************/
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void)
-{
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
-	HklParameter h2;
-	HklParameter k2;
-	HklParameter l2;
-	HklParameter psi;
-
-	self = hkl_pseudo_axis_engine_hkl_new();
-
-	/* bissector_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"bissector_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, bissector_vertical,
-		(size_t)0,
-		(size_t)4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_omega_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_omega_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_chi_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_chi_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "omega", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_phi_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_phi_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "omega", "chi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* lifting_detector_phi */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"lifting_detector_phi",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "phi", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* lifting_detector_omega */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"lifting_detector_omega",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "omega", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* lifting_detector_mu */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"lifting_detector_mu",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "mu", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* double_diffraction vertical*/
-	hkl_parameter_init(&h2, "h2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"double_diffraction_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, double_diffraction_func,
-		(size_t)3, h2, k2, l2,
-		(size_t)4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* bissector_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"bissector_horizontal",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, bissector_horizontal,
-		(size_t)0,
-		(size_t)5, "mu", "omega", "chi", "phi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* double_diffraction_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"double_diffraction_horizontal",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, double_diffraction_func,
-		(size_t)3, h2, k2, l2,
-		(size_t)4, "mu", "chi", "phi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* psi_constant_vertical */
-	hkl_parameter_init(&h2, "h2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1, 0, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1, 0, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&psi, "psi", -M_PI, 0, M_PI, HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"psi_constant_vertical",
-		hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, psi_constant_vertical_func,
-		(size_t)4, h2, k2, l2, psi,
-		(size_t)4, "omega", "chi", "phi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+HklEngine *hkl_engine_e6c_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega_vertical());
+	hkl_engine_add_mode(self, constant_chi_vertical());
+	hkl_engine_add_mode(self, constant_phi_vertical());
+	hkl_engine_add_mode(self, lifting_detector_phi());
+	hkl_engine_add_mode(self, lifting_detector_omega());
+	hkl_engine_add_mode(self, lifting_detector_mu());
+	hkl_engine_add_mode(self, double_diffraction_vertical());
+	hkl_engine_add_mode(self, bissector_horizontal());
+	hkl_engine_add_mode(self, double_diffraction_horizontal());
+	hkl_engine_add_mode(self, psi_constant_vertical());
+	hkl_engine_add_mode(self, psi_constant_horizontal());
+	hkl_engine_add_mode(self, constant_mu_horizontal());
 
 	return self;
 }
diff --git a/hkl/hkl-pseudoaxis-e6c.h b/hkl/hkl-pseudoaxis-e6c-private.h
similarity index 82%
rename from hkl/hkl-pseudoaxis-e6c.h
rename to hkl/hkl-pseudoaxis-e6c-private.h
index 30ef072..880e048 100644
--- a/hkl/hkl-pseudoaxis-e6c.h
+++ b/hkl/hkl-pseudoaxis-e6c-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,12 +22,12 @@
 #ifndef __HKL_PSEUDOAXIS_E6C_H__
 #define __HKL_PSEUDOAXIS_E6C_H__
 
-#include <hkl/hkl-pseudoaxis-auto.h>
+#include "hkl-pseudoaxis-auto-private.h"
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_hkl_new(void);
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_psi_new(void);
+extern HklEngine *hkl_engine_e6c_hkl_new(void);
+extern HklEngine *hkl_engine_e6c_psi_new(void);
 
 HKL_END_DECLS
 
diff --git a/hkl/hkl-pseudoaxis-e6c-psi.c b/hkl/hkl-pseudoaxis-e6c-psi.c
index 7e04f9a..3898810 100644
--- a/hkl/hkl-pseudoaxis-e6c-psi.c
+++ b/hkl/hkl-pseudoaxis-e6c-psi.c
@@ -13,28 +13,52 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <hkl/hkl-pseudoaxis-e6c.h>
-#include <hkl/hkl-pseudoaxis-common-psi.h>
+#include "hkl/ccan/array_size/array_size.h"
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_e6c_psi_new(void)
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-psi-private.h"
+
+/********/
+/* mode */
+/********/
+
+static HklMode* psi_vertical()
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineModePsi *mode;
-	char const *axes_names_psi[] = {"omega", "chi", "phi", "delta"};
+	static const char *axes[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
 
-	self = hkl_pseudo_axis_engine_psi_new();
+HklEngine *hkl_engine_e6c_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
 
-	/* psi get/set */
-	mode = hkl_pseudo_axis_engine_mode_psi_new("psi_vertical", 4, axes_names_psi);
-	hkl_pseudo_axis_engine_add_mode(self, (HklPseudoAxisEngineMode *)mode);
+	self = hkl_engine_psi_new();
 
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+	default_mode = psi_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
 
 	return self;
 }
diff --git a/hkl/hkl-pseudoaxis-factory.c b/hkl/hkl-pseudoaxis-factory.c
deleted file mode 100644
index 19aa011..0000000
--- a/hkl/hkl-pseudoaxis-factory.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-
-#include <gsl/gsl_sf.h>
-
-#include <hkl/hkl-pseudoaxis-factory.h>
-#include <hkl/hkl-pseudoaxis-common-eulerians.h>
-#include <hkl/hkl-pseudoaxis-common-q.h>
-#include <hkl/hkl-pseudoaxis-e4cv.h>
-#include <hkl/hkl-pseudoaxis-k4cv.h>
-#include <hkl/hkl-pseudoaxis-e6c.h>
-#include <hkl/hkl-pseudoaxis-k6c.h>
-#include <hkl/hkl-pseudoaxis-zaxis.h>
-
-static void kappa_2_kappap(double komega, double kappa, double kphi, double alpha,
-			   double *komegap, double *kappap, double *kphip)
-{
-	double p;
-	double omega;
-	double phi;
-
-	p = atan(tan(kappa/2.) * cos(alpha));
-	omega = komega + p - M_PI_2;
-	phi = kphi + p + M_PI_2;
-
-	*komegap = gsl_sf_angle_restrict_symm(2*omega - komega);
-	*kappap = -kappa;
-	*kphip = gsl_sf_angle_restrict_symm(2*phi - kphi);
-
-}
-
-static void hkl_geometry_list_multiply_k4c_real(HklGeometryList *self, size_t idx)
-{
-	HklGeometry *geometry;
-	HklGeometry *copy;
-	double komega, komegap;
-	double kappa, kappap;
-	double kphi, kphip;
-
-	geometry = self->items[idx]->geometry;
-	komega = hkl_axis_get_value(&geometry->axes[0]);
-	kappa = hkl_axis_get_value(&geometry->axes[1]);
-	kphi = hkl_axis_get_value(&geometry->axes[2]);
-
-	kappa_2_kappap(komega, kappa, kphi, 50 * HKL_DEGTORAD, &komegap, &kappap, &kphip);
-
-	copy = hkl_geometry_new_copy(geometry);
-	hkl_axis_set_value(&copy->axes[0], komegap);
-	hkl_axis_set_value(&copy->axes[1], kappap);
-	hkl_axis_set_value(&copy->axes[2], kphip);
-
-	hkl_geometry_update(copy);
-	hkl_geometry_list_add(self, copy);
-	hkl_geometry_free(copy);
-}
-
-static void hkl_geometry_list_multiply_k6c_real(HklGeometryList *self, size_t idx)
-{
-	HklGeometry *geometry;
-	HklGeometry *copy;
-	double komega, komegap;
-	double kappa, kappap;
-	double kphi, kphip;
-
-	geometry = self->items[idx]->geometry;
-	komega = hkl_axis_get_value(&geometry->axes[1]);
-	kappa = hkl_axis_get_value(&geometry->axes[2]);
-	kphi = hkl_axis_get_value(&geometry->axes[3]);
-
-	kappa_2_kappap(komega, kappa, kphi, 50 * HKL_DEGTORAD, &komegap, &kappap, &kphip);
-
-	copy = hkl_geometry_new_copy(geometry);
-	hkl_axis_set_value(&copy->axes[1], komegap);
-	hkl_axis_set_value(&copy->axes[2], kappap);
-	hkl_axis_set_value(&copy->axes[3], kphip);
-
-	hkl_geometry_update(copy);
-	hkl_geometry_list_add(self, copy);
-	hkl_geometry_free(copy);
-}
-
-HklPseudoAxisEngineList *hkl_pseudo_axis_engine_list_factory(const HklGeometryConfig *config)
-{
-	HklPseudoAxisEngineList *self = NULL;
-
-	self = hkl_pseudo_axis_engine_list_new();
-
-	switch(config->type){
-	case HKL_GEOMETRY_TYPE_TWOC_VERTICAL:
-		break;
-	case HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL:
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_e4cv_hkl_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_e4cv_psi_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_q_new());
-		break;
-	case HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL:
-		self->geometries->multiply = hkl_geometry_list_multiply_k4c_real;
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_k4cv_hkl_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_eulerians_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_k4cv_psi_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_q_new());
-		break;
-	case HKL_GEOMETRY_TYPE_EULERIAN6C:
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_e6c_hkl_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_e6c_psi_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_q2_new());
-		break;
-	case HKL_GEOMETRY_TYPE_KAPPA6C:
-		self->geometries->multiply = hkl_geometry_list_multiply_k6c_real;
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_k6c_hkl_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_eulerians_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_k6c_psi_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_q2_new());
-		break;
-	case HKL_GEOMETRY_TYPE_ZAXIS:
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_zaxis_hkl_new());
-		hkl_pseudo_axis_engine_list_add(self, hkl_pseudo_axis_engine_q2_new());
-		break;
-	}
-	return self;
-}
diff --git a/hkl/hkl-pseudoaxis-k4cv-hkl.c b/hkl/hkl-pseudoaxis-k4cv-hkl.c
index 827a0a6..b344010 100644
--- a/hkl/hkl-pseudoaxis-k4cv-hkl.c
+++ b/hkl/hkl-pseudoaxis-k4cv-hkl.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -24,316 +24,330 @@
 #include <gsl/gsl_math.h>
 #include <gsl/gsl_vector.h>
 
-#include <hkl/hkl-pseudoaxis-k4cv.h>
-#include <hkl/hkl-pseudoaxis-common-hkl.h>
+#include "hkl/ccan/array_size/array_size.h"
+
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-hkl-private.h"
 
 /***********************/
 /* numerical functions */
 /***********************/
 
-static int bissector_f1(const gsl_vector *x, void *params, gsl_vector *f)
+static int _bissector_f1(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double komega, tth, kappa, omega;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
-
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
-
-	RUBh_minus_Q(x_data, params, f_data);
+	const double komega = x->data[0];
+	const double kappa = x->data[1];
+	const double tth = x->data[3];
+	double omega;
 
-	komega = x_data[0];
-	kappa = x_data[1];
-	tth = x_data[3];
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
 
-	f_data[3] = fmod(tth - 2 * fmod(omega, M_PI), 2*M_PI);
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(tth - 2 * fmod(omega, M_PI), 2*M_PI);
 
 	return  GSL_SUCCESS;
 }
 
-static int bissector_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double komega, tth, kappa, omega;
-	size_t i;
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
-
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static const HklFunction bissector_f1 = {
+	.function = _bissector_f1,
+	.size = 4,
+};
 
-	RUBh_minus_Q(x_data, params, f_data);
+static int _bissector_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[0];
+	const double kappa = x->data[1];
+	const double tth = x->data[3];
+	double omega;
 
-	komega = x_data[0];
-	kappa = x_data[1];
-	tth = x_data[3];
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
 
-	f_data[3] = fmod(tth - 2 * fmod(omega, M_PI), 2*M_PI);
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(tth - 2 * fmod(omega, M_PI), 2*M_PI);
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_omega_f1(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double komega, kappa, omega;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+static const HklFunction bissector_f2 = {
+	.function = _bissector_f2,
+	.size = 4,
+};
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static int _constant_omega_f1(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	double const komega = x->data[0];
+	double const kappa = x->data[1];
+	double omega;
+	HklEngine *engine = params;
+	double omega0;
+	uint shit;
 
-	RUBh_minus_Q(x_data, params, f_data);
+	hkl_parameter_list_values_get(&engine->mode->parameters, &omega0, &shit);
 
-	komega = x_data[0];
-	kappa = x_data[1];
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
 
-	f_data[3] = p0 - omega;
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = omega0 - omega;
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_omega_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double komega, kappa, omega;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+static const HklFunction constant_omega_f1 = {
+	.function = _constant_omega_f1,
+	.size = 4,
+};
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static int _constant_omega_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[0];
+	const double kappa = x->data[1];
+	double omega;
+	HklEngine *engine = params;
+	double omega0;
+	uint shit;
 
-	RUBh_minus_Q(x_data, params, f_data);
+	hkl_parameter_list_values_get(&engine->mode->parameters, &omega0, &shit);
 
-	komega = x_data[0];
-	kappa = x_data[1];
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
 
-	f_data[3] = p0 - omega;
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = omega0 - omega;
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_chi_f1(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double kappa, chi;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+static const HklFunction constant_omega_f2 = {
+	.function = _constant_omega_f2,
+	.size = 4,
+};
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static int _constant_chi_f1(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double kappa = x->data[1];
+	double chi;
+	HklEngine *engine = params;
+	double chi0;
+	uint shit;
 
-	RUBh_minus_Q(x_data, params, f_data);
+	hkl_parameter_list_values_get(&engine->mode->parameters, &chi0, &shit);
 
-	kappa = x_data[1];
+	CHECK_NAN(x->data, x->size);
 
 	chi = 2 * asin(sin(kappa/2.) * sin(50 * HKL_DEGTORAD));
 
-	f_data[3] = p0 - chi;
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = chi0 - chi;
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_chi_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double kappa, chi;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+static const HklFunction constant_chi_f1 = {
+	.function = _constant_chi_f1,
+	.size = 4,
+};
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static int _constant_chi_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double kappa = x->data[1];
+	double chi;
+	HklEngine *engine = params;
+	double chi0;
+	uint shit;
 
-	RUBh_minus_Q(x_data, params, f_data);
+	hkl_parameter_list_values_get(&engine->mode->parameters, &chi0, &shit);
 
-	kappa = x_data[1];
+	CHECK_NAN(x->data, x->size);
 
 	chi = -2 * asin(sin(kappa/2.) * sin(50 * HKL_DEGTORAD));
 
-	f_data[3] = p0 - chi;
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = chi0 - chi;
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_phi_f1(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double kappa, kphi, phi;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+static const HklFunction constant_chi_f2 = {
+	.function = _constant_chi_f2,
+	.size = 4,
+};
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static int _constant_phi_f1(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double kappa = x->data[1];
+	const double kphi = x->data[2];
+	double phi;
+	HklEngine *engine = params;
+	double phi0;
+	uint shit;
 
-	RUBh_minus_Q(x_data, params, f_data);
+	hkl_parameter_list_values_get(&engine->mode->parameters, &phi0, &shit);
 
-	kappa = x_data[1];
-	kphi = x_data[2];
+	CHECK_NAN(x->data, x->size);
 
 	phi = kphi + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
 
-	f_data[3] = p0 - phi;
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = phi0 - phi;
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_phi_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double kappa, kphi, phi;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+static const HklFunction constant_phi_f1 = {
+	.function = _constant_phi_f1,
+	.size = 4,
+};
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static int _constant_phi_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double kappa = x->data[1];
+	const double kphi = x->data[2];
+	double phi;
+	HklEngine *engine = params;
+	double phi0;
+	uint shit;
 
-	RUBh_minus_Q(x_data, params, f_data);
+	hkl_parameter_list_values_get(&engine->mode->parameters, &phi0, &shit);
 
-	kappa = x_data[1];
-	kphi = x_data[2];
+	CHECK_NAN(x->data, x->size);
 
 	phi = kphi + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
 
-	f_data[3] = p0 - phi;
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = phi0 - phi;
 
 	return  GSL_SUCCESS;
 }
 
-/************************/
-/* K4CV PseudoAxeEngine */
-/************************/
+static const HklFunction constant_phi_f2 = {
+	.function = _constant_phi_f2,
+	.size = 4,
+};
+
+/********/
+/* mode */
+/********/
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_k4cv_hkl_new(void)
+static HklMode *bissector(void)
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
-	HklParameter parameter;
-	HklParameter h2;
-	HklParameter k2;
-	HklParameter l2;
-	HklParameter psi;
-
-	self = hkl_pseudo_axis_engine_hkl_new();
-
-	/* hkl get/set bissector */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"bissector",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		2, bissector_f1, bissector_f2,
-		(size_t)0,
-		(size_t)4, "komega", "kappa", "kphi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_omega */
-	hkl_parameter_init(&parameter, "omega", -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_omega",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		2, constant_omega_f1, constant_omega_f2,
-		(size_t)1, parameter,
-		(size_t)4, "komega", "kappa", "kphi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_chi */
-	hkl_parameter_init(&parameter, "chi", -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_chi",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		2, constant_chi_f1, constant_chi_f2,
-		(size_t)1, parameter,
-		(size_t)4, "komega", "kappa", "kphi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_phi */
-	hkl_parameter_init(&parameter, "phi", -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_phi",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		2, constant_phi_f1, constant_phi_f2,
-		(size_t)1, parameter,
-		(size_t)4, "komega", "kappa", "kphi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* double_diffraction */
-	hkl_parameter_init(&h2, "h2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"double_diffraction",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, double_diffraction_func,
-		(size_t)3, h2, k2, l2,
-		(size_t)4, "komega", "kappa", "kphi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-
-
-	/* psi_constant */
-	hkl_parameter_init(&h2, "h2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1, 0, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1, 0, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&psi, "psi", -M_PI, 0, M_PI, HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"psi_constant",
-		hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, psi_constant_vertical_func,
-		(size_t)4, h2, k2, l2, psi, 
-		(size_t)4, "komega", "kappa", "kphi", "tth");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&bissector_f1, &bissector_f2};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *constant_omega(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&constant_omega_f1, &constant_omega_f2};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "omega"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *constant_chi(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&constant_chi_f1, &constant_chi_f2};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "chi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *constant_phi(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&constant_phi_f1, &constant_phi_f2};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *double_diffraction(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
+
+static HklMode *psi_constant(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
+
+HklEngine *hkl_engine_k4cv_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega());
+	hkl_engine_add_mode(self, constant_chi());
+	hkl_engine_add_mode(self, constant_phi());
+	hkl_engine_add_mode(self, double_diffraction());
+	hkl_engine_add_mode(self, psi_constant());
 
 	return self;
 }
diff --git a/hkl/hkl-pseudoaxis-k4cv.h b/hkl/hkl-pseudoaxis-k4cv-private.h
similarity index 82%
rename from hkl/hkl-pseudoaxis-k4cv.h
rename to hkl/hkl-pseudoaxis-k4cv-private.h
index 91c41ad..d5e5750 100644
--- a/hkl/hkl-pseudoaxis-k4cv.h
+++ b/hkl/hkl-pseudoaxis-k4cv-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,12 +22,12 @@
 #ifndef __HKL_PSEUDOAXIS_K4CV_H__
 #define __HKL_PSEUDOAXIS_K4CV_H__
 
-#include <hkl/hkl-pseudoaxis-auto.h>
+#include <hkl/hkl-pseudoaxis-auto-private.h>
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_k4cv_hkl_new(void);
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_k4cv_psi_new(void);
+extern HklEngine *hkl_engine_k4cv_hkl_new(void);
+extern HklEngine *hkl_engine_k4cv_psi_new(void);
 
 HKL_END_DECLS
 
diff --git a/hkl/hkl-pseudoaxis-k4cv-psi.c b/hkl/hkl-pseudoaxis-k4cv-psi.c
index 3754d58..d2958bc 100644
--- a/hkl/hkl-pseudoaxis-k4cv-psi.c
+++ b/hkl/hkl-pseudoaxis-k4cv-psi.c
@@ -13,28 +13,52 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <hkl/hkl-pseudoaxis-k4cv.h>
-#include <hkl/hkl-pseudoaxis-common-psi.h>
+#include "hkl/ccan/array_size/array_size.h"
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_k4cv_psi_new(void)
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-psi-private.h"
+
+/********/
+/* mode */
+/********/
+
+static HklMode *psi()
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineModePsi *mode;
-	char const *axes_names_psi[] = {"komega", "kappa", "kphi", "tth"};
+	static const char *axes[] = {"komega", "kappa", "kphi", "tth"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
 
-	self = hkl_pseudo_axis_engine_psi_new();
+HklEngine *hkl_engine_k4cv_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
 
-	/* psi get/set */
-	mode = hkl_pseudo_axis_engine_mode_psi_new("psi", 4, axes_names_psi);
-	hkl_pseudo_axis_engine_add_mode(self, (HklPseudoAxisEngineMode *)mode);
+	self = hkl_engine_psi_new();
 
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+	default_mode = psi();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
 
 	return self;
 }
diff --git a/hkl/hkl-pseudoaxis-k6c-hkl.c b/hkl/hkl-pseudoaxis-k6c-hkl.c
index bf47838..b095450 100644
--- a/hkl/hkl-pseudoaxis-k6c-hkl.c
+++ b/hkl/hkl-pseudoaxis-k6c-hkl.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -25,478 +25,573 @@
 #include <gsl/gsl_vector.h>
 #include <gsl/gsl_sf.h>
 
-#include <hkl/hkl-pseudoaxis-k6c.h>
-#include <hkl/hkl-pseudoaxis-common-hkl.h>
+#include "hkl/ccan/array_size/array_size.h"
+
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-hkl-private.h"
 
 /***********************/
 /* numerical functions */
 /***********************/
 
-static int bissector_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
+static int _bissector_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double gamma, mu, komega, kappa, omega;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
-
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
-
-	RUBh_minus_Q(x_data, params, f_data);
+	const double mu = x->data[0];
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	const double gamma = x->data[4];
+	double omega;
 
-	mu = x_data[0];
-	komega = x_data[1];
-	kappa = x_data[2];
-	gamma = x_data[4];
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
 
-	f_data[3] = fmod(omega, M_PI);
-	f_data[4] = fmod(gamma - 2 * fmod(mu, M_PI), 2*M_PI);
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = fmod(gamma - 2 * fmod(mu, M_PI), 2*M_PI);
 
 	return  GSL_SUCCESS;
 }
 
-static int bissector_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double gamma, mu, komega, kappa, omega;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
-
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static const HklFunction bissector_h_f1 = {
+	.function = _bissector_h_f1,
+	.size = 5,
+};
 
-	RUBh_minus_Q(x_data, params, f_data);
+static int _bissector_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	const double gamma = x->data[4];
+	double omega;
 
-	mu = x_data[0];
-	komega = x_data[1];
-	kappa = x_data[2];
-	gamma = x_data[4];
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
 
-	f_data[3] = fmod(omega, M_PI);
-	f_data[4] = fmod(gamma - 2 * fmod(mu, M_PI), 2*M_PI);
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = fmod(gamma - 2 * fmod(mu, M_PI), 2*M_PI);
 
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_kphi_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double komega, kappa, omega;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
-
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static const HklFunction bissector_h_f2 = {
+	.function = _bissector_h_f2,
+	.size = 5,
+};
 
-	RUBh_minus_Q(x_data, params, f_data);
+static int _constant_kphi_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	double omega;
 
-	komega = x_data[1];
-	kappa = x_data[2];
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
 
-	f_data[3] = fmod(omega, M_PI);
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_kphi_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double komega, kappa, omega;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
-
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static const HklFunction constant_kphi_h_f1 = {
+	.function = _constant_kphi_h_f1,
+	.size = 4,
+};
 
-	RUBh_minus_Q(x_data, params, f_data);
+static int _constant_kphi_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	double omega;
 
-	komega = x_data[1];
-	kappa = x_data[2];
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
 
-	f_data[3] = fmod(omega, M_PI);
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_phi_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
+static const HklFunction constant_kphi_h_f2 = {
+	.function = _constant_kphi_h_f2,
+	.size = 4,
+};
+
+static int _constant_phi_h_f1(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double komega, kappa, kphi;
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	const double kphi = x->data[3];
 	double omega, phi, p;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
-
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
-
-	RUBh_minus_Q(x_data, params, f_data);
 
-	komega = x_data[1];
-	kappa = x_data[2];
-	kphi = x_data[3];
+	CHECK_NAN(x->data, x->size);
 
 	p = atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD));
-
 	omega = komega + p - M_PI_2;
 	phi = kphi + p + M_PI_2;
 
-	f_data[3] = fmod(omega, M_PI);
-	f_data[4] = phi;
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = phi;
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_phi_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
+static const HklFunction constant_phi_h_f1 = {
+	.function = _constant_phi_h_f1,
+	.size = 5,
+};
+
+static int _constant_phi_h_f2(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double komega, kappa, kphi;
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	const double kphi = x->data[3];
 	double omega, phi, p;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
-
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
 
-	RUBh_minus_Q(x_data, params, f_data);
-
-	komega = x_data[1];
-	kappa = x_data[2];
-	kphi = x_data[3];
+	CHECK_NAN(x->data, x->size);
 
 	p = atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD));
-
 	omega = komega + p + M_PI_2;
 	phi = kphi + p - M_PI_2;
 
-	f_data[3] = fmod(omega, M_PI);
-	f_data[4] = phi;
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(omega, M_PI);
+	f->data[4] = phi;
 
 	return  GSL_SUCCESS;
 }
 
-static int bissector_v(const gsl_vector *x, void *params, gsl_vector *f)
+static const HklFunction constant_phi_h_f2 = {
+	.function = _constant_phi_h_f2,
+	.size = 5,
+};
+
+static int _bissector_v(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double komega, kappa, delta, omega;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+	const double komega = x->data[0];
+	const double kappa = x->data[1];
+	const double delta = x->data[3];
+	double omega;
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+	CHECK_NAN(x->data, x->size);
 
-	RUBh_minus_Q(x_data, params, f_data);
+	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
 
-	komega = x_data[0];
-	kappa = x_data[1];
-	delta = x_data[3];
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = fmod(delta - 2 * fmod(omega, M_PI), 2*M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_v = {
+	.function = _bissector_v,
+	.size = 4,
+};
+
+static int _constant_omega_v(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[0];
+	const double kappa = x->data[1];
+	double omega;
+	HklEngine *engine = params;
+	double omega0;
+	uint shit;
+
+	hkl_parameter_list_values_get(&engine->mode->parameters, &omega0, &shit);
+
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
 
-	f_data[3] = fmod(delta - 2 * fmod(omega, M_PI), 2*M_PI);
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = omega0 - omega;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_omega_v = {
+	.function = _constant_omega_v,
+	.size = 4,
+};
+
+static int _constant_chi_v(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double kappa = x->data[1];
+	double chi;
+	HklEngine *engine = params;
+	double chi0;
+	uint shit;
+
+	hkl_parameter_list_values_get(&engine->mode->parameters, &chi0, &shit);
+
+	CHECK_NAN(x->data, x->size);
+
+	chi = 2 * asin(sin(kappa/2.) * sin(50 * HKL_DEGTORAD));
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = chi0 - chi;
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_omega_v(const gsl_vector *x, void *params, gsl_vector *f)
+static const HklFunction constant_chi_v = {
+	.function = _constant_chi_v,
+	.size = 4,
+};
+
+static int _constant_phi_v(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double komega, kappa, omega;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+	const double kappa = x->data[1];
+	const double kphi = x->data[2];
+	double phi;
+	HklEngine *engine = params;
+	double phi0;
+	uint shit;
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+	hkl_parameter_list_values_get(&engine->mode->parameters, &phi0, &shit);
 
-	RUBh_minus_Q(x_data, params, f_data);
+	CHECK_NAN(x->data, x->size);
 
-	komega = x_data[0];
-	kappa = x_data[1];
+	phi = kphi + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = phi0 - phi;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction constant_phi_v = {
+	.function = _constant_phi_v,
+	.size = 4,
+};
+
+static int _double_diffraction_h(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double komega = x->data[1];
+	const double kappa = x->data[2];
+	double omega;
+
+	CHECK_NAN(x->data, x->size);
 
 	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
 
-	f_data[3] = p0 - omega;
+	_double_diffraction(x->data, params, f->data);
+	f->data[4] = fmod(omega, M_PI);
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_chi_v(const gsl_vector *x, void *params, gsl_vector *f)
+static const HklFunction double_diffraction_h = {
+	.function = _double_diffraction_h,
+	.size = 5,
+};
+
+static int _constant_incidence_func(const gsl_vector *x, void *params, gsl_vector *f)
 {
-	double kappa, chi;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+	static const HklVector Y = {
+		.data = {0, 1, 0},
+	};
+	double incidence;
+	double azimuth;
+	HklEngine *engine = params;
+	HklModeAutoWithInit *mode = container_of(engine->mode, HklModeAutoWithInit, mode);
+	double parameters[5];
+	uint shit;
+	HklVector n;
+	double incidence0;
+	double azimuth0;
+	HklVector ki;
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+	CHECK_NAN(x->data, x->size);
 
-	RUBh_minus_Q(x_data, params, f_data);
+	RUBh_minus_Q(x->data, params, f->data);
 
-	kappa = x_data[1];
+	/* get the mode parameters */
+	hkl_parameter_list_values_get(&engine->mode->parameters,
+				      parameters, &shit);
+	n.data[0] = parameters[0];
+	n.data[1] = parameters[1];
+	n.data[2] = parameters[2];
+	incidence0 = parameters[3];
+	azimuth0 = parameters[4];
 
-	chi = 2 * asin(sin(kappa/2.) * sin(50 * HKL_DEGTORAD));
+	/* compute the two angles */
+
+
+	/* first check that the mode was already initialized if not
+	 * the surface is oriented along the nx, ny, nz axis for all
+	 * diffractometer angles equal to zero */
+	if(mode->geometry){
+		HklQuaternion q0 = darray_item(mode->geometry->holders, 0)->q;
+
+		hkl_quaternion_conjugate(&q0);
+		hkl_vector_rotated_quaternion(&n, &q0);
+	}
 
-	f_data[3] = p0 - chi;
+	hkl_vector_rotated_quaternion(&n, &darray_item(engine->geometry->holders, 0)->q);
+
+	hkl_source_compute_ki(&engine->geometry->source, &ki);
+	incidence = M_PI_2 - hkl_vector_angle(&n, &ki);
+
+	hkl_vector_project_on_plan(&n, &ki);
+	azimuth = hkl_vector_angle(&n, &Y);
+
+	f->data[3] = incidence0 - incidence;
+	f->data[4] = azimuth0 - azimuth;
 
 	return  GSL_SUCCESS;
 }
 
-static int constant_phi_v(const gsl_vector *x, void *params, gsl_vector *f)
+static const HklFunction constant_incidence_func = {
+	.function = _constant_incidence_func,
+	.size = 5,
+};
+
+/********/
+/* mode */
+/********/
+
+static HklMode *bissector_vertical(void)
 {
-	double kappa, kphi, phi;
-	size_t i;
-	HklPseudoAxisEngine *engine = params;
-	double p0 = engine->mode->parameters[0].value;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&bissector_v};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static HklMode *constant_omega_vertical(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&constant_omega_v};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "omega"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	RUBh_minus_Q(x_data, params, f_data);
+static HklMode *constant_chi_vertical(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&constant_chi_v};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "chi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	kappa = x_data[1];
-	kphi = x_data[2];
+static HklMode *constant_phi_vertical(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&constant_phi_v};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	phi = kphi + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) + M_PI_2;
+static HklMode *lifting_detector_kphi(void)
+{
+	static const char* axes[] = {"kphi", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	f_data[3] = p0 - phi;
+static HklMode *lifting_detector_komega(void)
+{
+	static const char* axes[] = {"komega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	return  GSL_SUCCESS;
+static HklMode *lifting_detector_mu(void)
+{
+	static const char* axes[] = {"mu", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
 }
 
-static int double_diffraction_h(const gsl_vector *x, void *params, gsl_vector *f)
+static HklMode *double_diffraction_vertical(void)
 {
-	double komega, kappa, omega;
-	size_t i;
-	double const *x_data = x->data;
-	double *f_data = f->data;
+	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&double_diffraction_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	for(i=0; i<x->size;++i)
-		if (gsl_isnan(x_data[i]))
-			return GSL_ENOMEM;
+static HklMode *bissector_horizontal(void)
+{
+	static const char* axes[] = {"mu", "komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&bissector_h_f1, &bissector_h_f2};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	double_diffraction(x_data, params, f_data);
+static HklMode *constant_phi_horizontal(void)
+{
+	static const char* axes[] = {"mu", "komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&constant_phi_h_f1, &constant_phi_h_f2};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "phi",},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	komega = x_data[1];
-	kappa = x_data[2];
+static HklMode *constant_kphi_horizontal(void)
+{
+	static const char* axes[] = {"mu", "komega", "kappa", "gamma"};
+	static const HklFunction *functions[] = {&constant_kphi_h_f1, &constant_kphi_h_f2};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	omega = komega + atan(tan(kappa/2.)*cos(50 * HKL_DEGTORAD)) - M_PI_2;
+static HklMode *double_diffraction_horizontal(void)
+{
+	static const char* axes[] = {"mu", "komega", "kappa", "kphi", "gamma"};
+	static const HklFunction *functions[] = {&double_diffraction_h};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_mode_operations);
+}
 
-	f_data[4] = fmod(omega, M_PI);
+static HklMode *psi_constant_vertical(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&psi_constant_vertical_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h2", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k2", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l2", .range = {.min=-1, .max=1}, ._value = 0,},
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "psi"},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &psi_constant_vertical_mode_operations);
+}
 
-	return  GSL_SUCCESS;
+static HklMode *constant_incidence(void)
+{
+	static const char* axes[] = {"komega", "kappa", "kphi", "gamma", "delta"};
+	static const HklFunction *functions[] = {&constant_incidence_func};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "x", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "y", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "z", .range = {.min=-1, .max=1}, ._value = 1,},
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "incidence"},
+		{HKL_PARAMETER_DEFAULTS_ANGLE, .name = "aximuth", ._value = M_PI_2,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_auto_with_init_new(&info,
+					   &constant_incidence_mode_operations);
 }
 
-/************************/
-/* K6CV PseudoAxeEngine */
-/************************/
+/**********************/
+/* pseudo axis engine */
+/**********************/
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_k6c_hkl_new(void)
+HklEngine *hkl_engine_k6c_hkl_new(void)
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
-	HklParameter parameter;
-	HklParameter h2;
-	HklParameter k2;
-	HklParameter l2;
-	HklParameter psi;
-
-	self = hkl_pseudo_axis_engine_hkl_new();
-
-	/* bissector_vertical */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"bissector_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, bissector_v,
-		(size_t)0,
-		(size_t)4, "komega", "kappa", "kphi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_omega_vertical */
-	hkl_parameter_init(&parameter, "omega", -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_omega_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, constant_omega_v,
-		(size_t)1, parameter,
-		(size_t)4, "komega", "kappa", "kphi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_chi_vertical */
-	hkl_parameter_init(&parameter, "chi", -M_PI, 30. * HKL_DEGTORAD, M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_chi_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, constant_chi_v,
-		(size_t)1, parameter,
-		(size_t)4, "komega", "kappa", "kphi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_phi_vertical */
-	hkl_parameter_init(&parameter, "phi", -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_phi_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, constant_phi_v,
-		(size_t)1, parameter,
-		(size_t)4, "komega", "kappa", "kphi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* lifting_detector_kphi */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"lifting_detector_kphi",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "kphi", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* lifting_detector_komega */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"lifting_detector_komega",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "komega", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* lifting_detector_mu */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"lifting_detector_mu",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "mu", "gamma", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* double_diffraction vertical*/
-	hkl_parameter_init(&h2, "h2", -1., 1., 1., HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1., 1., 1., HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1., 1., 1., HKL_TRUE, HKL_TRUE, NULL, NULL);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"double_diffraction_vertical",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, double_diffraction_func,
-		(size_t)3, h2, k2, l2,
-		(size_t)4, "komega", "kappa", "kphi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* bissector_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"bissector_horizontal",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		2, bissector_h_f1, bissector_h_f2,
-		(size_t)0,
-		(size_t)5, "mu", "komega", "kappa", "kphi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* constant_phi_horizontal */
-	hkl_parameter_init(&parameter, "phi", -M_PI, 0., M_PI,
-			   HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_phi_horizontal",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		2, constant_phi_h_f1,constant_phi_h_f2,
-		(size_t)1, parameter,
-		(size_t)5, "mu", "komega", "kappa", "kphi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* horizontal kphi constant */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"constant_kphi_horizontal",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		2, constant_kphi_h_f1, constant_kphi_h_f2,
-		(size_t)0,
-		(size_t)4, "mu", "komega", "kappa", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* double_diffraction_horizontal */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"double_diffraction_horizontal",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, double_diffraction_h,
-		(size_t)3, h2, k2, l2,
-		(size_t)5, "mu", "komega", "kappa", "kphi", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* psi_constant_vertical */
-	hkl_parameter_init(&h2, "h2", -1, 1, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&k2, "k2", -1, 0, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&l2, "l2", -1, 0, 1, HKL_TRUE, HKL_TRUE, NULL, NULL);
-	hkl_parameter_init(&psi, "psi", -M_PI, 0, M_PI, HKL_TRUE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"psi_constant_vertical",
-		hkl_pseudo_axis_engine_mode_init_psi_constant_vertical_real,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, psi_constant_vertical_func,
-		(size_t)4, h2, k2, l2, psi, 
-		(size_t)4, "komega", "kappa", "kphi", "delta");
-	hkl_pseudo_axis_engine_add_mode(self, mode);	
-
-
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = bissector_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	hkl_engine_add_mode(self, constant_omega_vertical());
+	hkl_engine_add_mode(self, constant_chi_vertical());
+	hkl_engine_add_mode(self, constant_phi_vertical());
+	hkl_engine_add_mode(self, lifting_detector_kphi());
+	hkl_engine_add_mode(self, lifting_detector_komega());
+	hkl_engine_add_mode(self, lifting_detector_mu());
+	hkl_engine_add_mode(self, double_diffraction_vertical());
+	hkl_engine_add_mode(self, bissector_horizontal());
+	hkl_engine_add_mode(self, constant_phi_horizontal());
+	hkl_engine_add_mode(self, constant_kphi_horizontal());
+	hkl_engine_add_mode(self, double_diffraction_horizontal());
+	hkl_engine_add_mode(self, psi_constant_vertical());
+	hkl_engine_add_mode(self, constant_incidence());
 
 	return self;
 }
diff --git a/hkl/hkl-pseudoaxis-k6c.h b/hkl/hkl-pseudoaxis-k6c-private.h
similarity index 82%
rename from hkl/hkl-pseudoaxis-k6c.h
rename to hkl/hkl-pseudoaxis-k6c-private.h
index 5eb13b6..fafa31d 100644
--- a/hkl/hkl-pseudoaxis-k6c.h
+++ b/hkl/hkl-pseudoaxis-k6c-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,12 +22,12 @@
 #ifndef __HKL_PSEUDOAXIS_K6C_H__
 #define __HKL_PSEUDOAXIS_K6C_H__
 
-#include <hkl/hkl-pseudoaxis-auto.h>
+#include "hkl-pseudoaxis-auto-private.h"
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_k6c_hkl_new(void);
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_k6c_psi_new(void);
+extern HklEngine *hkl_engine_k6c_hkl_new(void);
+extern HklEngine *hkl_engine_k6c_psi_new(void);
 
 HKL_END_DECLS
 
diff --git a/hkl/hkl-pseudoaxis-k6c-psi.c b/hkl/hkl-pseudoaxis-k6c-psi.c
index 28929cd..d5914b7 100644
--- a/hkl/hkl-pseudoaxis-k6c-psi.c
+++ b/hkl/hkl-pseudoaxis-k6c-psi.c
@@ -13,28 +13,44 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <hkl/hkl-pseudoaxis-k6c.h>
-#include <hkl/hkl-pseudoaxis-common-psi.h>
+#include "hkl/ccan/array_size/array_size.h"
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_k6c_psi_new(void)
+#include "hkl-parameter-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-psi-private.h"
+
+static HklMode *psi_vertical()
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineModePsi *mode;
-	char const *axes_names_psi[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklFunction *functions[] = {&psi_func};
+	static const char *axes[] = {"komega", "kappa", "kphi", "delta"};
+	static const HklParameter parameters[] = {
+		{HKL_PARAMETER_DEFAULTS, .name = "h1", .range = {.min=-1, .max=1}, ._value=1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "k1", .range = {.min=-1, .max=1}, ._value=1,},
+		{HKL_PARAMETER_DEFAULTS, .name = "l1", .range = {.min=-1, .max=1}, ._value=1,},
+	};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO_WITH_PARAMS(__func__, axes, functions, parameters),
+	};
+
+	return hkl_mode_psi_new(&info);
+}
 
-	self = hkl_pseudo_axis_engine_psi_new();
+HklEngine *hkl_engine_k6c_psi_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
 
-	/* psi get/set */
-	mode = hkl_pseudo_axis_engine_mode_psi_new("psi_vertical", 4, axes_names_psi);
-	hkl_pseudo_axis_engine_add_mode(self, (HklPseudoAxisEngineMode *)mode);
+	self = hkl_engine_psi_new();
 
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+	default_mode = psi_vertical();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
 
 	return self;
 }
diff --git a/hkl/hkl-pseudoaxis-petra3-hkl.c b/hkl/hkl-pseudoaxis-petra3-hkl.c
new file mode 100644
index 0000000..be48244
--- /dev/null
+++ b/hkl/hkl-pseudoaxis-petra3-hkl.c
@@ -0,0 +1,181 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <gsl/gsl_math.h>
+#include <gsl/gsl_vector.h>
+
+#include "hkl/ccan/array_size/array_size.h"
+
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-hkl-private.h"
+
+/***********************/
+/* numerical functions */
+/***********************/
+
+static int _reflectivity(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double gamma = x->data[3];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = mu - gamma;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction reflectivity = {
+	.function = _reflectivity,
+	.size = 4,
+};
+
+static int _bissector_horizontal(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double omega = x->data[0];
+	const double delta = x->data[3];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = delta - 2 * fmod(omega, M_PI);
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction bissector_horizontal = {
+	.function = _bissector_horizontal,
+	.size = 4,
+};
+
+/********/
+/* mode */
+/********/
+
+static HklMode *zaxis_alpha_fixed()
+{
+	static const char *axes[] = {"omega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO("zaxis + alpha-fixed", axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+static HklMode *zaxis_beta_fixed()
+{
+	static const char *axes[] = {"mu", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO("zaxis + beta-fixed", axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+static HklMode *zaxis_alpha_eq_beta()
+{
+	static const char *axes[] = {"mu", "omega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&reflectivity};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO("zaxis + alpha=beta", axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+static HklMode *fourc_bissector_horizontal()
+{
+	static const char *axes[] = {"omega", "chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&bissector_horizontal};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO("4-circles bissecting horizontal", axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+static HklMode *fourc_constant_omega_horizontal()
+{
+	static const char *axes[] = {"chi", "phi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO("4-circles constant omega horizontal", axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+static HklMode *fourc_constant_chi_horizontal()
+{
+	static const char *axes[] = {"omega", "phi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO("4-circles constant chi horizontal", axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+static HklMode *fourc_constant_phi_horizontal()
+{
+	static const char *axes[] = {"omega", "chi", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO("4-circles constant phi horizontal", axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
+
+HklEngine *hkl_engine_petra3_p09_eh2_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = zaxis_alpha_fixed();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	hkl_engine_add_mode(self, zaxis_beta_fixed());
+	hkl_engine_add_mode(self, zaxis_alpha_eq_beta());
+	hkl_engine_add_mode(self, fourc_bissector_horizontal());
+	hkl_engine_add_mode(self, fourc_constant_omega_horizontal());
+	hkl_engine_add_mode(self, fourc_constant_chi_horizontal());
+	hkl_engine_add_mode(self, fourc_constant_phi_horizontal());
+
+	return self;
+}
diff --git a/hkl/hkl-pseudoaxis-common-q.h b/hkl/hkl-pseudoaxis-petra3-private.h
similarity index 75%
rename from hkl/hkl-pseudoaxis-common-q.h
rename to hkl/hkl-pseudoaxis-petra3-private.h
index dd94e4b..678f8d6 100644
--- a/hkl/hkl-pseudoaxis-common-q.h
+++ b/hkl/hkl-pseudoaxis-petra3-private.h
@@ -13,18 +13,21 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2011-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_PSEUDOAXIS_COMMON_Q_H__
-#define __HKL_PSEUDOAXIS_COMMON_Q_H__
+#ifndef __HKL_PSEUDOAXIS_PETRA3_H__
+#define __HKL_PSEUDOAXIS_PETRA3_H__
 
-#include <hkl/hkl-pseudoaxis.h>
+#include "hkl-pseudoaxis-auto-private.h"
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_q_new(void);
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_q2_new(void);
+HKL_BEGIN_DECLS
 
-#endif
+extern HklEngine *hkl_engine_petra3_p09_eh2_hkl_new(void);
+
+HKL_END_DECLS
+
+#endif /* __HKL_PSEUDOAXIS_PETRA3_H__ */
diff --git a/hkl/hkl-pseudoaxis-private.h b/hkl/hkl-pseudoaxis-private.h
new file mode 100644
index 0000000..892322b
--- /dev/null
+++ b/hkl/hkl-pseudoaxis-private.h
@@ -0,0 +1,348 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#ifndef __HKL_PSEUDOAXIS_PRIVATE_H__
+#define __HKL_PSEUDOAXIS_PRIVATE_H__
+
+#include <string.h>
+#include <gsl/gsl_vector.h>
+#include <gsl/gsl_sf_trig.h>
+
+#include "hkl.h"
+#include "hkl-geometry-private.h"
+#include "hkl-parameter-private.h"
+
+HKL_BEGIN_DECLS
+
+typedef struct _HklModeOperations HklModeOperations;
+typedef struct _HklModeInfo HklModeInfo;
+typedef struct _HklEngineInfo HklEngineInfo;
+typedef struct _HklEngineOperations HklEngineOperations;
+
+struct _HklModeInfo {
+	const char *name;
+	const char **axes;
+	uint n_axes;
+	const HklParameter *parameters;
+	uint n_parameters;
+};
+
+struct _HklMode
+{
+	const HklModeInfo *info;
+	const HklModeOperations *ops;
+	darray_parameter parameters;
+};
+
+struct _HklEngineInfo {
+	const char *name;
+	const HklPseudoAxis **pseudo_axes;
+	uint n_pseudo_axes;
+};
+
+struct _HklEngine
+{
+	const HklEngineInfo *info;
+	const HklEngineOperations *ops;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+	HklMode *mode; /* not owned */
+	HklEngineList *engines; /* not owned */
+	darray_parameter pseudo_axes;
+	darray_mode modes;
+	darray_parameter axes;
+};
+
+struct _HklEngineList
+{
+	_darray(HklEngine *);
+	HklGeometryList *geometries;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+};
+
+#define INFO(n, ax) .name = n, .axes=ax, .n_axes=ARRAY_SIZE(ax)
+#define INFO_WITH_PARAMS(name, axes, parameters) INFO(name, axes), .parameters=parameters, .n_parameters=ARRAY_SIZE(parameters)
+
+static inline void set_geometry_axes(HklEngine *engine, const double values[])
+{
+	HklParameter **axis;
+	uint i = 0;
+
+	darray_foreach(axis, engine->axes){
+		hkl_parameter_value_set(*axis, values[i++], NULL);
+	}
+	hkl_geometry_update(engine->geometry);
+}
+
+/*****************/
+/* HklPseudoAxis */
+/*****************/
+
+struct _HklPseudoAxis
+{
+	HklParameter parameter;
+	HklEngine *engine;
+};
+
+extern HklParameter *hkl_parameter_new_pseudo_axis(
+	const HklParameter *parameter,
+	HklEngine *engine);
+
+/***********/
+/* HklMode */
+/***********/
+
+struct _HklModeOperations
+{
+	void (* free)(HklMode *self);
+	int (* init)(HklMode *self,
+		     HklEngine *engine,
+		     HklGeometry *geometry,
+		     HklDetector *detector,
+		     HklSample *sample,
+		     HklError **error);
+	int (* get)(HklMode *self,
+		    HklEngine *engine,
+		    HklGeometry *geometry,
+		    HklDetector *detector,
+		    HklSample *sample,
+		    HklError **error);
+	int (* set)(HklMode *self,
+		    HklEngine *engine,
+		    HklGeometry *geometry,
+		    HklDetector *detector,
+		    HklSample *sample,
+		    HklError **error);
+};
+
+#define HKL_MODE_OPERATIONS_DEFAULTS		\
+	.free=hkl_mode_free_real,		\
+		.init=hkl_mode_init_real,	\
+		.get=hkl_mode_get_real,		\
+		.set=hkl_mode_set_real
+
+static inline void hkl_mode_free_real(HklMode *self)
+{
+	hkl_parameter_list_free(&self->parameters);
+
+	free(self);
+}
+
+static int hkl_mode_init_real(HklMode *mode,
+			      HklEngine *self,
+			      HklGeometry *geometry,
+			      HklDetector *detector,
+			      HklSample *sample,
+			      HklError **error)
+{
+	if (!self || !mode || !geometry || !detector || !sample)
+		return HKL_FALSE;
+
+	/* update the geometry internals */
+	hkl_geometry_update(geometry);
+
+	return HKL_TRUE;
+}
+
+static int hkl_mode_get_real(HklMode *self,
+			     HklEngine *engine,
+			     HklGeometry *geometry,
+			     HklDetector *detector,
+			     HklSample *sample,
+			     HklError **error)
+{
+	return HKL_TRUE;
+}
+
+static int hkl_mode_set_real(HklMode *self,
+			     HklEngine *engine,
+			     HklGeometry *geometry,
+			     HklDetector *detector,
+			     HklSample *sample,
+			     HklError **error)
+{
+	return HKL_TRUE;
+}
+
+static inline int hkl_mode_init(
+	HklMode *self,
+	const HklModeInfo *info,
+	const HklModeOperations *ops)
+{
+	size_t i;
+
+	/* ensure part */
+	if (!self)
+		return HKL_FALSE;
+
+	self->info = info;
+	self->ops = ops;
+
+	/* parameters */
+	darray_init(self->parameters);
+	for(i=0; i<self->info->n_parameters; ++i){
+		darray_append(self->parameters,
+			      hkl_parameter_new_copy(&self->info->parameters[i]));
+	}
+
+	return HKL_TRUE;
+}
+
+static inline HklMode *hkl_mode_new(
+	const HklModeInfo *info,
+	const HklModeOperations *op)
+{
+	HklMode *self = NULL;
+
+
+	self = HKL_MALLOC(HklMode);
+
+	hkl_mode_init(self, info, op);
+
+	return self;
+}
+
+/**
+ * hkl_mode_free: (skip)
+ * @self:
+ *
+ * delete an HklMode
+ **/
+static inline void hkl_mode_free(HklMode *self)
+{
+	self->ops->free(self);
+}
+
+/*************/
+/* HklEngine */
+/*************/
+
+static void hkl_engine_release(HklEngine *self)
+{
+	HklMode **mode;
+
+	if(self->geometry)
+		hkl_geometry_free(self->geometry);
+
+	if(self->detector)
+		hkl_detector_free(self->detector);
+
+	if(self->sample)
+		hkl_sample_free(self->sample);
+
+	/* release the mode added */
+	darray_foreach(mode, self->modes){
+		hkl_mode_free(*mode);
+	}
+	darray_free(self->modes);
+
+	darray_free(self->axes);
+
+	/* release the HklPseudoAxe memory */
+	hkl_parameter_list_free(&self->pseudo_axes);
+}
+
+struct _HklEngineOperations
+{
+	void (*free)(HklEngine *self);
+};
+
+#define HKL_ENGINE_OPERATIONS_DEFAULTS		\
+	.free=hkl_engine_free_real
+
+static inline void hkl_engine_free_real(HklEngine *self)
+{
+}
+
+static void hkl_engine_free(HklEngine *self)
+{
+	self->ops->free(self);
+}
+
+extern void hkl_engine_init(HklEngine *engine,
+			    const HklEngineInfo *info,
+			    const HklEngineOperations *ops);
+
+
+extern void unregister_pseudo_axis(HklParameter *pseudo_axis);
+
+extern HklParameter *register_pseudo_axis(HklEngine *self,
+					  const HklParameter *parameter);
+
+/**
+ * hkl_engine_add_mode: (skip)
+ * @self:
+ * @mode: the mode to add
+ *
+ * add an HklMode to the self HklEngine
+ **/
+static inline void hkl_engine_add_mode(HklEngine *self,
+				       HklMode *mode)
+{
+	darray_append(self->modes, mode);
+}
+
+/**
+ * hkl_engine_add_geometry: (skip)
+ * @self: the current PseudoAxeEngine
+ * @x: x A vector of double with the axes values to put in the geometry.
+ *
+ * This method try to be clever by allocating memory only if the
+ * current length of the geometries is not large enought. Then it just
+ * set the geometry axes and copy it to the right geometries. We do
+ * not gives the x len as it is equal to the self->axes_len.
+ *
+ **/
+static inline void hkl_engine_add_geometry(HklEngine *self,
+					   double const x[])
+{
+	HklParameter **axis;
+	uint i = 0;
+
+	/* copy the axes configuration into the engine->geometry */
+	darray_foreach(axis, self->axes){
+		hkl_parameter_value_set(*axis,
+					gsl_sf_angle_restrict_symm(x[i++]),
+					NULL);
+	}
+
+	hkl_geometry_list_add(self->engines->geometries, self->geometry);
+}
+
+/*****************/
+/* HklEngineList */
+/*****************/
+
+extern HklEngineList *hkl_engine_list_new(void);
+
+extern const HklEngineList *hkl_engine_list_new_copy(const HklEngineList *self);
+
+extern int hkl_engine_list_add(HklEngineList *self,
+			       HklEngine *engine);
+
+extern void hkl_engine_list_clear(HklEngineList *self);
+
+HKL_END_DECLS
+
+#endif /* __HKL_PSEUDOAXIS_PRIVATE_H__ */
diff --git a/hkl/hkl-pseudoaxis-factory.h b/hkl/hkl-pseudoaxis-soleil-sixs-med-private.h
similarity index 55%
copy from hkl/hkl-pseudoaxis-factory.h
copy to hkl/hkl-pseudoaxis-soleil-sixs-med-private.h
index 39b7188..14b4b54 100644
--- a/hkl/hkl-pseudoaxis-factory.h
+++ b/hkl/hkl-pseudoaxis-soleil-sixs-med-private.h
@@ -13,23 +13,26 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ * Copyright (C) 2011-2013 Synchrotron SOLEIL
+ *                    L'Orme des Merisiers Saint-Aubin
+ *                    BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_PSEUDOAXIS_FACTORY_H__
-#define __HKL_PSEUDOAXIS_FACTORY_H__
+#ifndef __HKL_PSEUDOAXIS_SOLEIL_SIXS_MED_H__
+#define __HKL_PSEUDOAXIS_SOLEIL_SIXS_MED_H__
 
-#include <hkl/hkl-geometry-factory.h>
-#include <hkl/hkl-pseudoaxis.h>
+#include "hkl-pseudoaxis-auto-private.h"
 
 HKL_BEGIN_DECLS
 
+extern HklEngine *hkl_engine_soleil_sixs_med_2_2_hkl_new(void);
+extern HklEngine *hkl_engine_soleil_sixs_med_1_2_hkl_new(void);
+extern HklEngine *hkl_engine_soleil_sixs_med_2_3_hkl_new(void);
 
-extern HklPseudoAxisEngineList *hkl_pseudo_axis_engine_list_factory(const HklGeometryConfig *config);
+extern void hkl_geometry_list_multiply_soleil_sixs_med_2_3(HklGeometryList *self,
+							   HklGeometryListItem *item);
 
 HKL_END_DECLS
 
-#endif /* __HKL_PSEUDOAXIS_FACTORY_H__ */
+#endif /* __HKL_PSEUDOAXIS_SOLEIL_SIXS_MED_H__ */
diff --git a/hkl/hkl-pseudoaxis-soleil-sixs-med.c b/hkl/hkl-pseudoaxis-soleil-sixs-med.c
new file mode 100644
index 0000000..3b4d54b
--- /dev/null
+++ b/hkl/hkl-pseudoaxis-soleil-sixs-med.c
@@ -0,0 +1,285 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2011-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl/ccan/array_size/array_size.h"
+#include <gsl/gsl_multiroots.h>
+#include <gsl/gsl_sf_trig.h>
+
+#include "hkl-axis-private.h"
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-hkl-private.h"
+
+/***********************/
+/* numerical functions */
+/***********************/
+
+static int _reflectivity_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double gamma = x->data[2];
+
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = gamma - 2 * mu;
+
+	return  GSL_SUCCESS;
+}
+
+static const HklFunction reflectivity_func = {
+	.function = _reflectivity_func,
+	.size = 4,
+};
+
+/***********/
+/* HklMode */
+/***********/
+
+static HklMode* mu_fixed()
+{
+	static const char* axes[] = {"omega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+static HklMode* reflectivity()
+{
+	static const char* axes[] = {"mu", "omega", "gamma", "delta"};
+	static const HklFunction *functions[] = {&reflectivity_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+/*********************/
+/* MED 2+2 HklEngine */
+/*********************/
+
+HklEngine *hkl_engine_soleil_sixs_med_2_2_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = mu_fixed();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	hkl_engine_add_mode(self, reflectivity());
+
+	return self;
+}
+
+/*********************/
+/* MED 1+2 HklEngine */
+/*********************/
+
+static HklMode* pitch_fixed()
+{
+	static const char* axes[] = {"mu", "gamma", "delta"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+HklEngine *hkl_engine_soleil_sixs_med_1_2_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = pitch_fixed();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	return self;
+}
+
+/*********************/
+/* MED 2+3 HklEngine */
+/*********************/
+
+typedef struct _HklSlitsFit HklSlitsFit;
+struct _HklSlitsFit
+{
+	HklGeometry *geometry;
+	HklVector surface;
+	unsigned int slits_id;
+	unsigned int len;
+	HklParameter *axis;
+};
+
+static int slits_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	double const *x_data = gsl_vector_const_ptr(x, 0);
+	double *f_data = gsl_vector_ptr(f, 0);
+	HklVector n_slits = {{0, 0, 1}};
+	HklSlitsFit *parameters = params;
+
+	hkl_parameter_value_set(parameters->axis, x_data[0], NULL);
+	hkl_geometry_update(parameters->geometry);
+
+	/* compute the orientation of the slits */
+	hkl_vector_rotated_quaternion(&n_slits,
+				      &darray_item(parameters->geometry->holders, 1)->q);
+
+	/* both directions must be perpendicular */
+	f_data[0] = hkl_vector_scalar_product(&parameters->surface, &n_slits);
+
+	return  GSL_SUCCESS;
+}
+
+static int fit_slits_orientation(HklSlitsFit *params)
+{
+	size_t i;
+	gsl_multiroot_fsolver_type const *T;
+	gsl_multiroot_fsolver *s;
+	gsl_multiroot_function f;
+	gsl_vector *x;
+	double *x_data;
+	int status;
+	int res = HKL_FALSE;
+	int iter;
+
+	/* now solve the system */
+	/* Initialize method  */
+	T = gsl_multiroot_fsolver_hybrid;
+	s = gsl_multiroot_fsolver_alloc (T, params->len);
+	x = gsl_vector_alloc(params->len);
+	x_data = gsl_vector_ptr(x, 0);
+
+	/* initialize x with the right values */
+	x_data[0] = params->axis->_value;
+
+	f.f = slits_func;
+	f.n = params->len;
+	f.params = params;
+	gsl_multiroot_fsolver_set (s, &f, x);
+
+	/* iterate to find the solution */
+	iter = 0;
+	do {
+		++iter;
+		status = gsl_multiroot_fsolver_iterate(s);
+		if (status || iter % 100 == 0) {
+			/* Restart from another point. */
+			for(i=0; i<params->len; ++i)
+				x_data[i] = (double)rand() / RAND_MAX * 180. / M_PI;
+			gsl_multiroot_fsolver_set(s, &f, x);
+			gsl_multiroot_fsolver_iterate(s);
+		}
+		status = gsl_multiroot_test_residual (s->f, HKL_EPSILON);
+	} while (status == GSL_CONTINUE && iter < 1000);
+
+#ifdef DEBUG
+	fprintf(stdout, "\n  fitting the detector position using thoses axes :");
+	for(i=0; i<params.len; ++i)
+		fprintf(stdout, " \"%s\"", ((HklParameter *)params.axes[i])->name);
+	fprintf(stdout, " status : %d iter : %d", status, iter);
+	fprintf(stdout, " x: [");
+	for(i=0; i<params.len; ++i)
+		fprintf(stdout, " %.7f", s->x->data[i]);
+	fprintf(stdout, "] f: [");
+	for(i=0; i<params.len; ++i)
+		fprintf(stdout, " %.7f", s->f->data[i]);
+	fprintf(stdout, "]\n");
+	hkl_geometry_fprintf(stdout, params.geometry);
+#endif
+	if(status != GSL_CONTINUE){
+		res = HKL_TRUE;
+		/* put the axes in the -pi, pi range. */
+		gsl_sf_angle_restrict_pos_e(&params->axis->_value);
+	}
+	/* release memory */
+	gsl_vector_free(x);
+	gsl_multiroot_fsolver_free(s);
+
+	return res;
+}
+
+void hkl_geometry_list_multiply_soleil_sixs_med_2_3(HklGeometryList *self,
+						    HklGeometryListItem *item)
+{
+	unsigned int i;
+	unsigned int len;
+	HklSlitsFit params;
+	HklGeometry *geometry;
+	double slits_position;
+	HklHolder *sample_holder;
+	HklHolder *detector_holder;
+
+	/* For each solution already found we will generate another one */
+	/* we will set the right slit orientation for a given detector arm position */
+	geometry = item->geometry;
+	sample_holder = darray_item(geometry->holders, 0);
+	detector_holder = darray_item(geometry->holders, 1);
+
+	/* get the index of the axis corresponding to the slits */
+	/* for now the last holder is the detector one */
+	params.slits_id = detector_holder->config->idx[detector_holder->config->len-1];
+	params.len = 1; /* only one axis to fit */
+	params.geometry = geometry;
+	params.axis = darray_item(params.geometry->axes, params.slits_id);
+
+	/* compute the surface orientation fixed during the fit */
+	/* use the last sample axis as sample surface normal */
+	params.surface = container_of(darray_item(geometry->axes,
+						  sample_holder->config->idx[sample_holder->config->len - 1]),
+				      HklAxis, parameter)->axis_v;
+	hkl_vector_rotated_quaternion(&params.surface,
+				      &sample_holder->q);
+
+
+	/* we just need to fit the slits orientation */
+	/* save it's value before */
+	slits_position = hkl_parameter_value_get(params.axis);
+	if (fit_slits_orientation(&params) != HKL_TRUE)
+		hkl_parameter_value_set(params.axis, slits_position, NULL);
+}
+
+
+HklEngine *hkl_engine_soleil_sixs_med_2_3_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = mu_fixed();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	return self;
+}
diff --git a/hkl/hkl-pseudoaxis-zaxis-hkl.c b/hkl/hkl-pseudoaxis-zaxis-hkl.c
index 1423d80..48279f4 100644
--- a/hkl/hkl-pseudoaxis-zaxis-hkl.c
+++ b/hkl/hkl-pseudoaxis-zaxis-hkl.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,59 +22,79 @@
 #include <gsl/gsl_math.h>
 #include <gsl/gsl_vector.h>
 
-#include <hkl/hkl-pseudoaxis-zaxis.h>
-#include <hkl/hkl-pseudoaxis-common-hkl.h>
+#include "hkl/ccan/array_size/array_size.h"
 
-static int reflectivity(const gsl_vector *x, void *params, gsl_vector *f)
-{
-	double mu, gamma;
-	double const *x_data = gsl_vector_const_ptr(x, 0);
-	double *f_data = gsl_vector_ptr(f, 0);
+#include "hkl-pseudoaxis-auto-private.h"
+#include "hkl-pseudoaxis-common-hkl-private.h"
+
+/* #define DEBUG */
 
-	RUBh_minus_Q(x_data, params, f_data);
+/***********************/
+/* numerical functions */
+/***********************/
 
-	mu = x_data[0];
-	gamma = x_data[3];
+static int _reflectivity_func(const gsl_vector *x, void *params, gsl_vector *f)
+{
+	const double mu = x->data[0];
+	const double gamma = x->data[3];
 
-	f_data[3] = mu - gamma;
+	CHECK_NAN(x->data, x->size);
+
+	RUBh_minus_Q(x->data, params, f->data);
+	f->data[3] = mu - gamma;
 
 	return  GSL_SUCCESS;
 }
 
-/*************************/
-/* ZAXIS PseudoAxeEngine */
-/*************************/
+static const HklFunction reflectivity_func = {
+	.function = _reflectivity_func,
+	.size = 4,
+};
+
+/********/
+/* mode */
+/********/
+
+static HklMode* zaxis()
+{
+	static const char* axes[] = {"omega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&RUBh_minus_Q_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_zaxis_hkl_new(void)
+static HklMode* reflectivity()
 {
-	HklPseudoAxisEngine *self;
-	HklPseudoAxisEngineMode *mode;
-
-	self = hkl_pseudo_axis_engine_hkl_new();
-
-	/* zaxis */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"zaxis",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, RUBh_minus_Q_func,
-		(size_t)0,
-		(size_t)3, "omega", "delta", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	/* reflectivity */
-	mode = hkl_pseudo_axis_engine_mode_new(
-		"reflectivity",
-		NULL,
-		hkl_pseudo_axis_engine_mode_get_hkl_real,
-		hkl_pseudo_axis_engine_mode_set_real,
-		1, reflectivity,
-		(size_t)0,
-		(size_t)4, "mu", "omega", "delta", "gamma");
-	hkl_pseudo_axis_engine_add_mode(self, mode);
-
-	hkl_pseudo_axis_engine_select_mode(self, 0);
+	static const char* axes[] = {"mu", "omega", "delta", "gamma"};
+	static const HklFunction *functions[] = {&reflectivity_func};
+	static const HklModeAutoInfo info = {
+		INFO_AUTO(__func__, axes, functions),
+	};
+
+	return hkl_mode_auto_new(&info,
+				 &hkl_full_mode_operations);
+}
+
+/**********************/
+/* pseudo axis engine */
+/**********************/
+
+HklEngine *hkl_engine_zaxis_hkl_new(void)
+{
+	HklEngine *self;
+	HklMode *default_mode;
+
+	self = hkl_engine_hkl_new();
+
+	default_mode = zaxis();
+	hkl_engine_add_mode(self, default_mode);
+	hkl_engine_select_mode(self, default_mode);
+
+	hkl_engine_add_mode(self, reflectivity());
 
 	return self;
 }
diff --git a/hkl/hkl-pseudoaxis-zaxis.h b/hkl/hkl-pseudoaxis-zaxis-private.h
similarity index 87%
rename from hkl/hkl-pseudoaxis-zaxis.h
rename to hkl/hkl-pseudoaxis-zaxis-private.h
index b97bca0..f6046c6 100644
--- a/hkl/hkl-pseudoaxis-zaxis.h
+++ b/hkl/hkl-pseudoaxis-zaxis-private.h
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,11 +22,11 @@
 #ifndef __HKL_PSEUDOAXIS_ZAXIS_H__
 #define __HKL_PSEUDOAXIS_ZAXIS_H__
 
-#include <hkl/hkl-pseudoaxis-auto.h>
+#include "hkl-pseudoaxis-auto-private.h"
 
 HKL_BEGIN_DECLS
 
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_zaxis_hkl_new(void);
+extern HklEngine *hkl_engine_zaxis_hkl_new(void);
 
 HKL_END_DECLS
 
diff --git a/hkl/hkl-pseudoaxis.c b/hkl/hkl-pseudoaxis.c
index ebe58e2..849fea5 100644
--- a/hkl/hkl-pseudoaxis.c
+++ b/hkl/hkl-pseudoaxis.c
@@ -1,4 +1,5 @@
-/* This file is part of the hkl library.
+/*
+ * This file is part of the hkl library.
  *
  * The hkl library is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -13,335 +14,168 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
 #include <string.h>
-#include <alloca.h>
+#ifndef _MSC_VER
+# include <alloca.h>
+#endif
 #include <gsl/gsl_sf_trig.h>
-#include <hkl/hkl-pseudoaxis.h>
+
+#include "hkl/ccan/container_of/container_of.h"
+#include "hkl-detector-private.h"
+#include "hkl-pseudoaxis-private.h"
+#include "hkl-error-private.h"
 
 /*****************/
 /* HklPseudoAxis */
 /*****************/
 
-HklPseudoAxis *hkl_pseudo_axis_new(HklParameter const *parameter,
-				   HklPseudoAxisEngine *engine)
+static inline HklParameter *hkl_pseudo_axis_copy_real(const HklParameter *base)
 {
-	HklPseudoAxis *self;
+	HklPseudoAxis *self = container_of(base, HklPseudoAxis, parameter);
+	HklPseudoAxis *dup = HKL_MALLOC(HklPseudoAxis);
 
-	self = HKL_MALLOC(HklPseudoAxis);
+	*dup = *self;
 
-	hkl_pseudo_axis_init(self, parameter, engine);
-
-	return self;
+	return &dup->parameter;
 }
 
-void hkl_pseudo_axis_init(HklPseudoAxis *self,
-			  HklParameter const *parameter,
-			  HklPseudoAxisEngine *engine)
+static inline void hkl_pseudo_axis_free_real(HklParameter *self)
 {
-	self->parent = *parameter;
-	self->engine = engine;
-}
+	HklPseudoAxis *pseudo_axis = container_of(self, HklPseudoAxis, parameter);
 
-void hkl_pseudo_axis_free(HklPseudoAxis *self)
-{
-	if(self)
-		free(self);
+	free(pseudo_axis);
 }
 
-void hkl_pseudo_axis_fprintf(FILE *f, HklPseudoAxis *self)
+static inline void hkl_pseudo_axis_fprintf_real(FILE *f, const HklParameter *self)
 {
-	hkl_parameter_fprintf(f, &self->parent);
-	fprintf(f, " %p", self->engine);
+	HklPseudoAxis *pseudo_axis = container_of(self, HklPseudoAxis, parameter);
+
+	hkl_parameter_fprintf_real(f, self);
+	fprintf(f, " %p", pseudo_axis->engine);
 }
 
-/*****************************/
-/* HklPseudoAxisEngineMode */
-/*****************************/
+static HklParameterOperations hkl_parameter_operations_pseudo_axis = {
+	HKL_PARAMETER_OPERATIONS_DEFAULTS,
+	.copy = hkl_pseudo_axis_copy_real,
+	.free = hkl_pseudo_axis_free_real,
+	.fprintf = hkl_pseudo_axis_fprintf_real,
+};
 
-/**
- * @brief this method create an HklPseudoAxisEngineMode
- * @param name The name of this HklPseudoAxisEngineMode.
- * @param get The get method.
- * @param set the set method.
- * @param n the number of parameters.
- * @param ... rest of the parameters.
- *
- * This method create an HklPseudoAxisEngineMode structure
- * to be used in a HklPseudoAxisEngine.
- * The variable number of parameters contain in fact n
- * pointers on the parameters the an interger giving the
- * number of related axes and finally the name of thoses
- * related axes.
- *
- * mode = hkl_pseudo_axis_engine_mode_new(
- *	"constant_omega",
- *	hkl_pseudo_axis_engine_getter_func_hkl,
- *	hkl_pseudo_axis_engine_setter_func_constant_omega,
- *	1, &parameter,
- *	4, "komega", "kappa", "kphi", "tth");
- */
-HklPseudoAxisEngineMode *hkl_pseudo_axis_engine_mode_new(
-	char const *name,
-	HklPseudoAxisEngineModeFunc initialize,
-	HklPseudoAxisEngineModeFunc get,
-	HklPseudoAxisEngineModeFunc set,
-	size_t n, ...)
-{
-	HklPseudoAxisEngineMode *self = NULL;
-	va_list ap;
-	size_t i;
-	size_t n_p;
-	size_t n_a;
-	HklFunction *functions;
-	HklParameter *parameters;
-	const char **axes;
-
-	/* extract the variable part of the method */
-
-	va_start(ap, n);
-
-	/* functions */
-	functions = alloca(n * sizeof(*functions));
-	for(i=0; i<n; ++i)
-		functions[i] = va_arg(ap, HklFunction);
-
-	/* parameters */
-	n_p = va_arg(ap, size_t);
-	parameters = alloca(n_p * sizeof(*parameters));
-	for(i=0; i<n_p; ++i)
-		parameters[i] = va_arg(ap, HklParameter);
-
-	/* axes */
-	n_a = va_arg(ap, size_t);
-	axes = alloca(n_a * sizeof(*axes));
-	for(i=0; i<n_a; ++i)
-		axes[i] = va_arg(ap, char const *);
-	va_end(ap);
-
-	self = HKL_MALLOC(HklPseudoAxisEngineMode);
-
-	hkl_pseudo_axis_engine_mode_init(self, name, initialize, get, set,
-					 n, functions,
-					 n_p, parameters,
-					 n_a, axes);
+HklParameter *hkl_parameter_new_pseudo_axis(
+	const HklParameter *parameter,
+	HklEngine *engine)
+{
+	HklPseudoAxis *self;
 
+	self = HKL_MALLOC(HklPseudoAxis);
 
-	return self;
-}
+	self->parameter = *parameter;
+	self->parameter.ops = &hkl_parameter_operations_pseudo_axis;
+	self->engine = engine;
 
-/**
- * @brief this method initialize an HklPseudoAxisEngineMode
- * @param name The name of this HklPseudoAxisEngineMode.
- * @param init the init method.
- * @param get The get method.
- * @param set the set method.
- * @param parameters_names_len the number of parameters.
- * @param parameters_name an array with the parameters names.
- * @param axes_names_len the length of the axes names.
- * @param axes_names an array with tha axes names.
- *
- * This method create an HklPseudoAxisEngineMode structure
- * to be used in a HklPseudoAxisEngine.
- * The variable number of parameters contain in fact n
- * pointers on the parameters the an interger giving the
- * number of related axes and finally the name of thoses
- * related axes.
- *
- * mode = hkl_pseudo_axis_engine_mode_new(
- *	"constant_omega",
- *	hkl_pseudo_axis_engine_getter_func_hkl,
- *	hkl_pseudo_axis_engine_setter_func_constant_omega,
- *	1, &parameter,
- *	4, "komega", "kappa", "kphi", "tth");
- */
-int hkl_pseudo_axis_engine_mode_init(
-	HklPseudoAxisEngineMode *self,
-	char const *name,
-	HklPseudoAxisEngineModeFunc initialize,
-	HklPseudoAxisEngineModeFunc get,
-	HklPseudoAxisEngineModeFunc set,
-	size_t functions_len, HklFunction functions[],
-	size_t parameters_len, HklParameter parameters[],
-	size_t axes_names_len, char const *axes_names[])
-{
-	size_t i;
-
-	/* ensure part */
-	if (!self)
-		return HKL_FAIL;
-
-	self->name = name;
-	self->initialize = initialize;
-	self->get = get;
-	self->set = set;
-
-	/* functions */
-	HKL_LIST_RESIZE(self->functions, functions_len);
-	for(i=0; i<functions_len; ++i)
-		self->functions[i] = functions[i];
-
-	/* parameters */
-	HKL_LIST_RESIZE(self->parameters, parameters_len);
-	for(i=0; i<parameters_len; ++i)
-		self->parameters[i] = parameters[i];
-
-	/* axes */
-	HKL_LIST_RESIZE(self->axes_names, axes_names_len);
-	for(i=0; i<axes_names_len; ++i)
-		self->axes_names[i] = axes_names[i];
-
-	/* init part */
-	self->geometry_init = NULL;
-	self->detector_init = NULL;
-	self->sample_init = NULL;
-
-	return HKL_SUCCESS;
+	return &self->parameter;
 }
 
+/***********/
+/* HklMode */
+/***********/
+
 /**
- * @brief release the memory of an HklPseudoAxisEngineMode
- */
-void hkl_pseudo_axis_engine_mode_free(HklPseudoAxisEngineMode *self)
+ * hkl_mode_name:
+ * @self: the this ptr
+ *
+ * Return value: the name of the HklMode
+ **/
+const char *hkl_mode_name(const HklMode *self)
 {
-	HKL_LIST_FREE(self->functions);
-	HKL_LIST_FREE(self->parameters);
-	HKL_LIST_FREE(self->axes_names);
-
-	if(self->geometry_init){
-		hkl_geometry_free(self->geometry_init);
-		self->geometry_init = NULL;
-	}
-	if(self->detector_init){
-		hkl_detector_free(self->detector_init);
-		self->detector_init = NULL;
-	}
-	if(self->sample_init){
-		hkl_sample_free(self->sample_init);
-		self->sample_init = NULL;
-	}
-	free(self);
+	return self->info->name;
 }
 
-/***********************/
-/* HklPseudoAxisEngine */
-/***********************/
-
 /**
- * @brief create a new HklPseudoAxisEngine
- * @param name The name of this engine
- * @param n the number of HklPseudoAxis of the engine
- * @param ... the names of thoses pseudo-axes.
+ * hkl_mode_parameters:
+ * @self: the this ptr
  *
- * self = hkl_pseudo_axis_engine_new("hkl", 3, "h", "k", "l");
- */
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_new(char const *name,
-						size_t n, ...)
+ * Return value: (transfer none): the parameters of the HklMode
+ **/
+HklParameterList *hkl_mode_parameters(HklMode *self)
 {
-	va_list ap;
-	size_t i;
-
-	HklPseudoAxisEngine *self = NULL;
-
-	self = HKL_MALLOC(HklPseudoAxisEngine);
-
-	self->name = name;
-
-	/* create the pseudoAxes */
-	HKL_LIST_ALLOC(self->pseudoAxes, n);
-	va_start(ap, n);
-	for(i=0; i<n; ++i){
-		HklParameter parameter;
-
-		hkl_parameter_init(&parameter, va_arg(ap, const char*),
-				   -RAND_MAX, 0., RAND_MAX,
-				   HKL_FALSE, HKL_TRUE,
-				   NULL, NULL);
-		self->pseudoAxes[i] = hkl_pseudo_axis_new(&parameter, self);
-	}
-	va_end(ap);
-
-	return self;
+	return &self->parameters;
 }
 
 /**
- * @brief Release the memory of an HklPseudoAxisEngine
- */
-void hkl_pseudo_axis_engine_free(HklPseudoAxisEngine *self)
+ * hkl_mode_fprintf: (skip)
+ * @f:
+ * @self:
+ *
+ * print to a FILE the HklPSeudoAxisEngineMode members
+ **/
+void hkl_mode_fprintf(FILE *f, const HklMode *self)
 {
-	if (self->geometry)
-		hkl_geometry_free(self->geometry);
-
-	if(self->detector)
-		hkl_detector_free(self->detector);
-
-	if(self->sample)
-		hkl_sample_free(self->sample);
-
-	/* release the axes memory */
-	HKL_LIST_FREE(self->axes);
-
-	/* release the mode added */
-	HKL_LIST_FREE_DESTRUCTOR(self->modes, hkl_pseudo_axis_engine_mode_free);
+	unsigned int i;
+
+	fprintf(f, "mode: \"%s\"\n", self->info->name);
+	fprintf(f, "initialize: %p\n", self->ops->init);
+	fprintf(f, "get: %p\n", self->ops->get);
+	fprintf(f, "set: %p\n", self->ops->set);
+	hkl_parameter_list_fprintf(f, &self->parameters);
+	if(self->info->axes){
+		fprintf(f, "axes names:");
+		for(i=0; i<self->info->n_axes; ++i)
+			fprintf(f, " %s", self->info->axes[i]);
+		fprintf(f, "\n");
+	}
+}
 
-	/* release the HklPseudoAxe memory */
-	HKL_LIST_FREE_DESTRUCTOR(self->pseudoAxes, hkl_pseudo_axis_free);
+/*************/
+/* HklEngine */
+/*************/
 
-	free(self);
+void hkl_engine_init(HklEngine *self,
+		     const HklEngineInfo *info,
+		     const HklEngineOperations *ops)
+{
+	self->info = info;
+	self->ops = ops;
+	darray_init(self->modes);
+	darray_init(self->pseudo_axes);
+	self->geometry = NULL;
+	self->detector = NULL;
+	self->sample = NULL;
 }
 
-/**
- * @brief add an HklPseudoAxisEngineMode to an engine.
- * @param self the engine
- * @param mode the getter and setter to add.
- */
-void hkl_pseudo_axis_engine_add_mode(HklPseudoAxisEngine *self,
-					HklPseudoAxisEngineMode *mode)
+void unregister_pseudo_axis(HklParameter *pseudo_axis)
 {
-	HKL_LIST_ADD_VALUE(self->modes, mode);
+	hkl_parameter_free(pseudo_axis);
 }
 
-/**
- * @brief this method Add a geometry to the geometries
- *
- * @param self The current PseudoAxeEngine
- * @param x A vector of double with the axes values to put in the geometry.
- *
- * This method try to be clever by allocating memory only if the current
- * length of the geometries is not large enought. Then it just set the
- * geometry axes and copy it to the right geometries. We do not gives the
- * x len as it is equal to the self->axes_len.
- */
-void hkl_pseudo_axis_engine_add_geometry(HklPseudoAxisEngine *self,
-					 double const x[])
+HklParameter *register_pseudo_axis(HklEngine *self,
+				   const HklParameter *conf)
 {
-	size_t i;
+	HklParameter *parameter;
 
-	/* copy the axes configuration into the engine->geometry */
-	for(i=0; i<HKL_LIST_LEN(self->axes); ++i)
-		hkl_axis_set_value(self->axes[i], gsl_sf_angle_restrict_symm(x[i]));
+	parameter = hkl_parameter_new_pseudo_axis(conf, self);
+	darray_append(self->pseudo_axes, parameter);
 
-	hkl_geometry_list_add(self->engines->geometries, self->geometry);
+	return parameter;
 }
 
-static void hkl_pseudo_axis_engine_prepare_internal(HklPseudoAxisEngine *self)
+static void hkl_engine_prepare_internal(HklEngine *self)
 {
-	size_t i;
-	size_t len;
+	uint i;
 
 	if(!self || !self->engines)
 		return;
 
 	/* set */
 	if(self->geometry)
-		hkl_geometry_init_geometry(self->geometry, self->engines->geometry);
-	else
-		self->geometry = hkl_geometry_new_copy(self->engines->geometry);
+		hkl_geometry_free(self->geometry);
+	self->geometry = hkl_geometry_new_copy(self->engines->geometry);
 
 	if(self->detector)
 		hkl_detector_free(self->detector);
@@ -353,158 +187,278 @@ static void hkl_pseudo_axis_engine_prepare_internal(HklPseudoAxisEngine *self)
 
 	/* fill the axes member from the function */
 	if(self->mode){
-		len = HKL_LIST_LEN(self->mode->axes_names);
-		HKL_LIST_RESIZE(self->axes, len);
-		for(i=0; i<len; ++i)
-			self->axes[i] = hkl_geometry_get_axis_by_name(self->geometry,
-								      self->mode->axes_names[i]);
+		darray_free(self->axes);
+		darray_init(self->axes);
+		for(i=0; i<self->mode->info->n_axes; ++i){
+			HklParameter *axis;
+
+			axis = hkl_geometry_get_axis_by_name(self->geometry,
+							     self->mode->info->axes[i]);
+
+			darray_append(self->axes, axis);
+		}
 	}
 
 	/* reset the geometries len */
 	hkl_geometry_list_reset(self->engines->geometries);
 }
 
-/*
- * This method also populate the self->axes from the mode->axes_names.
- * this is to speed the computation of the numerical axes. this method is
- * usually only use with numerical pseudoAxes.
- */
-void hkl_pseudo_axis_engine_select_mode(HklPseudoAxisEngine *self,
-					size_t idx)
+/**
+ * hkl_engine_name:
+ * @self: the this ptr
+ *
+ * Return value: the name of the HklEngine
+ **/
+const char *hkl_engine_name(const HklEngine *self)
 {
-	if(!self || idx > HKL_LIST_LEN(self->modes))
-		return;
+	return self->info->name;
+}
 
-	self->mode = self->modes[idx];
-	hkl_pseudo_axis_engine_prepare_internal(self);
+/**
+ * hkl_engine_len: (skip)
+ * @self: the this ptr
+ *
+ * Return value: the len of the pseudo axes of the HklEngine
+ **/
+unsigned int hkl_engine_len(const HklEngine *self)
+{
+	return self->info->n_pseudo_axes;
 }
 
-int hkl_pseudo_axis_engine_initialize(HklPseudoAxisEngine *self, HklError **error)
+/**
+ * hkl_engine_pseudo_axes:
+ * @self: the this ptr
+ *
+ * Return value: (transfer none): the pseudo_axes managed by this HklEngine
+ **/
+HklParameterList *hkl_engine_pseudo_axes(HklEngine *self)
 {
-	int res = HKL_FAIL;
+	return &self->pseudo_axes;
+}
 
-	if(!self || !self->geometry || !self->detector || !self->sample)
-		return res;
+/**
+ * hkl_engine_mode:
+ * @self: the this ptr
+ *
+ * Return value: (transfer none): the current mode of the HklEngine
+ **/
+HklMode *hkl_engine_mode(HklEngine *self)
+{
+	return self->mode;
+}
 
-	if (self->mode && self->mode->initialize){
-		HklError *tmp_error;
+/**
+ * hkl_engine_modes: (skip)
+ * @self: the this ptr
+ *
+ * Return value: (transfer none): the current mode of the HklEngine
+ **/
+darray_mode *hkl_engine_modes(HklEngine *self)
+{
+	return &self->modes;
+}
 
-		tmp_error = NULL;
-		res = self->mode->initialize(self->mode,
-					     self,
-					     self->engines->geometry,
-					     self->engines->detector,
-					     self->engines->sample,
-					     &tmp_error);
-		if(tmp_error != NULL)
-			hkl_error_propagate(error, tmp_error);
-	}
+/**
+ * hkl_engine_engines:
+ * @self: the this ptr
+ *
+ * Return value: (transfer none): the HklEngineList which contain this HklEngine
+ **/
+HklEngineList *hkl_engine_engines(HklEngine *self)
+{
+	return self->engines;
+}
 
-	return res;
+/**
+ * hkl_engine_select_mode:
+ * @self: the HklEngine
+ * @mode: the #HklPseudoAxisMode to select
+ *
+ * This method also populate the self->axes from the mode->axes_names.
+ * this is to speed the computation of the numerical axes.
+ **/
+void hkl_engine_select_mode(HklEngine *self,
+			    HklMode *mode)
+{
+	self->mode = mode;
+	hkl_engine_prepare_internal(self);
 }
 
-int hkl_pseudo_axis_engine_set(HklPseudoAxisEngine *self, HklError **error)
+void hkl_engine_select_mode_by_name(HklEngine *self,
+				    const char *name)
 {
-	int res = HKL_FAIL;
+	HklMode **mode;
 
-	if(!self || !self->geometry || !self->detector || !self->sample)
-		return res;
+	darray_foreach(mode, self->modes){
+		if(!strcmp((*mode)->info->name, name))
+			hkl_engine_select_mode(self, (*mode));
+	}
+}
 
-	hkl_pseudo_axis_engine_prepare_internal(self);
+/**
+ * hkl_engine_initialize: (skip)
+ * @self: the HklEngine
+ * @error: (allow-none): NULL or an HklError to check for error's during the initialization
+ *
+ * initialize the HklEngine
+ *
+ * Returns:
+ **/
+int hkl_engine_initialize(HklEngine *self, HklError **error)
+{
+	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
 
-	if (self->mode && self->mode->set){
-		HklError *tmp_error;
+	if(!self->geometry || !self->detector || !self->sample
+	   || !self->mode) {
+		hkl_error_set(error, "Internal error");
+		return HKL_FALSE;
+	}
 
-		tmp_error = NULL;
-		res = self->mode->set(self->mode, self,
-				      self->geometry,
-				      self->detector,
-				      self->sample,
-				      &tmp_error);
-		if(tmp_error != NULL)
-			hkl_error_propagate(error, tmp_error);
+	/* a NULL initialize method is valid */
+	if(self->mode->ops->init
+	   && !self->mode->ops->init(self->mode,
+				     self,
+				     self->engines->geometry,
+				     self->engines->detector,
+				     self->engines->sample,
+				     error)){
+		hkl_assert(error == NULL || *error != NULL);
+		return HKL_FALSE;
 	}
 
+	hkl_assert(error == NULL || *error == NULL);
+
+	return HKL_TRUE;
+}
+
+/**
+ * hkl_engine_set: (skip)
+ * @self: the HklEngine
+ * @error: (allow-none): NULL or an HklError
+ *
+ * use the HklPseudoaxisEngine values to compute the real axes values.
+ *
+ * Returns:
+ **/
+int hkl_engine_set(HklEngine *self, HklError **error)
+{
+	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
+
+	if(!self->geometry || !self->detector || !self->sample
+	   || !self->mode || !self->mode->ops->set){
+		hkl_error_set(error, "Internal error");
+		return HKL_FALSE;
+	}
+
+	hkl_engine_prepare_internal(self);
+
+	if (!self->mode->ops->set(self->mode, self,
+				  self->geometry,
+				  self->detector,
+				  self->sample,
+				  error)){
+		hkl_assert(error == NULL || *error != NULL);
+		return HKL_FALSE;
+	}
+	hkl_assert(error == NULL || *error == NULL);
+
 	hkl_geometry_list_multiply(self->engines->geometries);
 	hkl_geometry_list_multiply_from_range(self->engines->geometries);
 	hkl_geometry_list_remove_invalid(self->engines->geometries);
 	hkl_geometry_list_sort(self->engines->geometries, self->engines->geometry);
 
-	if(hkl_geometry_list_is_empty(self->engines->geometries))
-		res = HKL_FAIL;
+	if(darray_empty(self->engines->geometries->items)){
+		hkl_error_set(error, "no remaining solutions");
+		return HKL_FALSE;
+	}
 
-	return res;
+	return HKL_TRUE;
 }
 
-int hkl_pseudo_axis_engine_get(HklPseudoAxisEngine *self, HklError **error)
+/**
+ * hkl_engine_get: (skip)
+ * @self: The HklEngine
+ * @error: (allow-none): NULL or an HklError
+ *
+ * get the values of the pseudo-axes from the real-axes values
+ *
+ * Returns:
+ **/
+int hkl_engine_get(HklEngine *self, HklError **error)
 {
-	int res = HKL_FAIL;
+	hkl_return_val_if_fail (error == NULL || *error == NULL, HKL_FALSE);
 
-	if(!self 
-	   || !self->engines
-	   || !self->engines->geometry
-	   || !self->engines->detector
-	   || !self->engines->sample)
-		return res;
-
-	if (self->mode && self->mode->get){
-		HklError *tmp_error;
+	if(!self->engines || !self->engines->geometry || !self->engines->detector
+	   || !self->engines->sample || !self->mode || !self->mode->ops->get){
+		hkl_error_set(error, "Internal error");
+		return HKL_FALSE;
+	}
 
-		tmp_error = NULL;
-		res = self->mode->get(self->mode, 
-				      self,
-				      self->engines->geometry,
-				      self->engines->detector,
-				      self->engines->sample,
-				      &tmp_error);
-		if(tmp_error != NULL)
-			hkl_error_propagate(error, tmp_error);
+	if (!self->mode->ops->get(self->mode,
+				  self,
+				  self->engines->geometry,
+				  self->engines->detector,
+				  self->engines->sample,
+				  error)){
+		hkl_assert(error == NULL || *error != NULL);
+		return HKL_FALSE;
 	}
+	hkl_assert(error == NULL || *error == NULL);
 
-	return res;
+	return HKL_TRUE;
 }
 
-void hkl_pseudo_axis_engine_fprintf(FILE *f, HklPseudoAxisEngine const *self)
+/**
+ * hkl_engine_fprintf: (skip)
+ * @f: the FILE
+ * @self: the HklEngine
+ *
+ * print to a FILE the HklEngine
+ **/
+void hkl_engine_fprintf(FILE *f, const HklEngine *self)
 {
-	size_t i;
-
-	fprintf(f, "\nPseudoAxesEngine : \"%s\"", self->name);
+	fprintf(f, "\nPseudoAxesEngine : \"%s\"", self->info->name);
 
 	/* mode */
 	if (self->mode) {
-		fprintf(f, " %s", self->mode->name);
-
-		for(i=0; i<HKL_LIST_LEN(self->mode->parameters); ++i){
+		fprintf(f, " %s", self->mode->info->name);
+		for(uint i=0; i<darray_size(self->mode->parameters); ++i){
 			fprintf(f, "\n     ");
-			hkl_parameter_fprintf(f, &self->mode->parameters[i]);
+			hkl_parameter_fprintf(
+				f,
+				darray_item(self->mode->parameters, i));
 		}
 		fprintf(f, "\n");
 	}
 
 	/* the pseudoAxes part */
-	for(i=0; i<HKL_LIST_LEN(self->pseudoAxes); ++i) {
-		fprintf(f, "\n     ");
-		hkl_pseudo_axis_fprintf(f, self->pseudoAxes[i]);
-	}
+	hkl_parameter_list_fprintf(f, &self->pseudo_axes);
 
-	if(!hkl_geometry_list_is_empty(self->engines->geometries)){
+	if(darray_empty(self->engines->geometries->items)){
 		fprintf(f, "\n   ");
 		hkl_geometry_list_fprintf(f, self->engines->geometries);
 	}
 	fprintf(f, "\n");
 }
 
-/***************************/
-/* HklPseudoAxisEngineList */
-/***************************/
+/*****************/
+/* HklEngineList */
+/*****************/
 
-HklPseudoAxisEngineList *hkl_pseudo_axis_engine_list_new(void)
+/**
+ * hkl_engine_list_new: (skip)
+ *
+ * default constructor
+ *
+ * Returns:
+ **/
+HklEngineList *hkl_engine_list_new(void)
 {
-	HklPseudoAxisEngineList *self = NULL;
+	HklEngineList *self = NULL;
 
-	self = HKL_MALLOC(HklPseudoAxisEngineList);
+	self = HKL_MALLOC(HklEngineList);
 
-	HKL_LIST_INIT(self->engines);
+	darray_init(*self);
 
 	self->geometries = hkl_geometry_list_new();
 
@@ -515,100 +469,233 @@ HklPseudoAxisEngineList *hkl_pseudo_axis_engine_list_new(void)
 	return self;
 }
 
-void hkl_pseudo_axis_engine_list_free(HklPseudoAxisEngineList *self)
+/**
+ * hkl_engine_list_new_copy: (skip)
+ * @self:
+ *
+ * dummy copy constructor for the binding
+ *
+ * Returns: (transfer none): NULL all the time the structure is non-copyable
+ **/
+const HklEngineList *hkl_engine_list_new_copy(const HklEngineList *self)
+{
+	return NULL;
+}
+
+/**
+ * hkl_engine_list_free: (skip)
+ * @self: the #HklEngineList to destroy
+ *
+ * destructor
+ **/
+void hkl_engine_list_free(HklEngineList *self)
 {
-	hkl_pseudo_axis_engine_list_clear(self);
+	hkl_engine_list_clear(self);
 	hkl_geometry_list_free(self->geometries);
 	free(self);
 }
 
-int hkl_pseudo_axis_engine_list_add(HklPseudoAxisEngineList *self,
-				    HklPseudoAxisEngine *engine)
+/**
+ * hkl_engine_list_add: (skip)
+ * @self: the engine list
+ * @engine: the engine to add
+ *
+ * add an #HklEngine to the #HklEngineList
+ *
+ * Returns: HKL_SUCCESS or HKL_FAIL
+ **/
+int hkl_engine_list_add(HklEngineList *self,
+			HklEngine *engine)
 {
 	if (!engine)
-		return HKL_FAIL;
+		return HKL_FALSE;
 
 	/* set the engines to access the Geometries list. */
 	engine->engines = self;
 
-	HKL_LIST_ADD_VALUE(self->engines, engine);
+	darray_append(*self, engine);
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
-HklPseudoAxisEngine *hkl_pseudo_axis_engine_list_get_by_name(HklPseudoAxisEngineList *self,
-							     char const *name)
+/**
+ * hkl_engine_list_engines: (skip)
+ * @self: the this ptr
+ *
+ * Return: a pointer on the engine array
+ **/
+darray_engine *hkl_engine_list_engines(HklEngineList *self)
 {
-	size_t i;
+	return (darray_engine *)self;
+}
 
-	for(i=0; i<HKL_LIST_LEN(self->engines); ++i)
-		if (!strcmp(self->engines[i]->name, name))
-			return self->engines[i];
+/**
+ * hkl_engine_list_geometries:
+ * @self: the this ptr
+ *
+ * Return: a pointer on the engine array
+ **/
+const HklGeometryList *hkl_engine_list_geometries(const HklEngineList *self)
+{
+	return self->geometries;
+}
 
-	return NULL;
+/**
+ * hkl_engine_list_get_geometry: (skip)
+ * @self: the this ptr
+ *
+ * Return: a pointer on the geometry member
+ **/
+HklGeometry *hkl_engine_list_get_geometry(HklEngineList *self)
+{
+	return self->geometry;
 }
 
-/* TODO test */
-HklPseudoAxis *hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name(HklPseudoAxisEngineList *self,
-								   char const *name)
+void hkl_engine_list_geometry_set(HklEngineList *self, const HklGeometry *geometry)
 {
-	size_t i, j;
-	HklPseudoAxis *pseudo = NULL;
+	hkl_geometry_set(self->geometry, geometry);
+	hkl_engine_list_get(self);
+}
 
-	for(i=0; i<HKL_LIST_LEN(self->engines); ++i){
-		HklPseudoAxisEngine *engine;
+/**
+ * hkl_engine_list_select_solution:
+ * @self: the this ptr
+ * @idx: the index of the solution to select
+ *
+ * this method set the geometry member with the ith selected solution.
+ * if the index is out of range (idx > number of solution) the method
+ * do nothing.
+ **/
+void hkl_engine_list_select_solution(HklEngineList *self, unsigned int idx)
+{
+	hkl_geometry_init_geometry(self->geometry,
+				   darray_item(self->geometries->items, idx)->geometry);
+}
+
+/**
+ * hkl_engine_list_get_by_name:
+ * @self: the this ptr
+ * @name: the name of the requested #HklPseudoAxisEngin
+ *
+ * get the #HklEngine by its name from the list.
+ *
+ * Returns: (transfer none) (allow-none): the requested engine
+ **/
+HklEngine *hkl_engine_list_get_by_name(HklEngineList *self,
+				       const char *name)
+{
+	HklEngine **engine;
 
-		engine = self->engines[i];
-		for(j=0; j<HKL_LIST_LEN(engine->pseudoAxes); ++j){
-			HklParameter *parameter;
+	darray_foreach(engine, *self){
+		if (!strcmp((*engine)->info->name, name))
+			return *engine;
+	}
 
-			parameter = (HklParameter *)engine->pseudoAxes[j];
-			if (!strcmp(parameter->name, name))
-				return engine->pseudoAxes[j];
+	return NULL;
+}
+
+/**
+ * hkl_engine_list_get_pseudo_axis_by_name:
+ * @self: the engine list
+ * @name: the name of the requested #HklPseudoAxis
+ *
+ * Todo: test
+ *
+ * Returns: (transfer none) (allow-none): the requested #HklPseudoAxis
+ **/
+HklParameter *hkl_engine_list_get_pseudo_axis_by_name(
+	const HklEngineList *self, const char *name)
+{
+	HklEngine **engine;
+	HklParameter **parameter;
+
+	darray_foreach(engine, *self){
+		darray_foreach(parameter, (*engine)->pseudo_axes){
+			if (!strcmp((*parameter)->name, name))
+				return *parameter;
 		}
 	}
-	return pseudo;
+
+	return NULL;
 }
 
-void hkl_pseudo_axis_engine_list_clear(HklPseudoAxisEngineList *self)
+/**
+ * hkl_engine_list_clear: (skip)
+ * @self: the engine list to clear
+ *
+ * remove all engine from the engine list
+ **/
+void hkl_engine_list_clear(HklEngineList *self)
 {
-	HKL_LIST_FREE_DESTRUCTOR(self->engines, hkl_pseudo_axis_engine_free);
+	HklEngine **engine;
+
+	darray_foreach(engine, *self){
+		hkl_engine_free(*engine);
+	}
+	darray_free(*self);
 }
 
-void hkl_pseudo_axis_engine_list_init(HklPseudoAxisEngineList *self,
-				      HklGeometry *geometry,
-				      HklDetector *detector,
-				      HklSample *sample)
+/**
+ * hkl_engine_list_init:
+ * @self: the engine list
+ * @geometry: the associated #HklGeometry
+ * @detector: the associated #HklDetector
+ * @sample: the associated #HklSample
+ *
+ * before using an engine list you must associate all engines to a
+ * Geometry, a detector and a sample.
+ **/
+void hkl_engine_list_init(HklEngineList *self,
+			  HklGeometry *geometry,
+			  HklDetector *detector,
+			  HklSample *sample)
 {
-	size_t i;
+	HklEngine **engine;
 
 	self->geometry = geometry;
 	self->detector = detector;
 	self->sample = sample;
 
-	for(i=0; i<HKL_LIST_LEN(self->engines); ++i)
-		hkl_pseudo_axis_engine_prepare_internal(self->engines[i]);
+	darray_foreach(engine, *self){
+		hkl_engine_prepare_internal(*engine);
+	}
 }
 
-int hkl_pseudo_axis_engine_list_get(HklPseudoAxisEngineList *self)
+/**
+ * hkl_engine_list_get:
+ * @self: the list of #HklEngine
+ *
+ * apply the get method to all the #HklEngine of the list
+ * after this it is possible to retrive all the #HklPseudoAxis values.
+ *
+ * Returns: HKL_SUCCESS or HKL_FAIL if one of the #HklEngine
+ * get method failed.
+ **/
+int hkl_engine_list_get(HklEngineList *self)
 {
-	size_t i;
-	int res = HKL_SUCCESS;
+	HklEngine **engine;
+	int res = HKL_TRUE;
 
-	if (!self)
-		return res;
-
-	for(i=0; i<HKL_LIST_LEN(self->engines); ++i)
-		if (!hkl_pseudo_axis_engine_get(self->engines[i], NULL))
-			res = HKL_FAIL;
+	darray_foreach(engine, *self){
+		res &= hkl_engine_get(*engine, NULL);
+	}
 
 	return res;
 }
 
-void hkl_pseudo_axis_engine_list_fprintf(FILE *f,
-					 HklPseudoAxisEngineList const *self)
+/**
+ * hkl_engine_list_fprintf: (skip)
+ * @f: the File
+ * @self: the list
+ *
+ * print to a FILE the #HklEngineList
+ **/
+void hkl_engine_list_fprintf(FILE *f,
+			     const HklEngineList *self)
 {
-	size_t i;
-	for(i=0; i<HKL_LIST_LEN(self->engines); ++i)
-		hkl_pseudo_axis_engine_fprintf(f, self->engines[i]);
+	HklEngine **engine;
+
+	darray_foreach(engine, *self){
+		hkl_engine_fprintf(f, *engine);
+	}
 }
diff --git a/hkl/hkl-pseudoaxis.h b/hkl/hkl-pseudoaxis.h
deleted file mode 100644
index a84c6f1..0000000
--- a/hkl/hkl-pseudoaxis.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_PSEUDOAXIS_H__
-#define __HKL_PSEUDOAXIS_H__
-
-#include <stdarg.h>
-#include <gsl/gsl_multiroots.h>
-
-#include <hkl/hkl-detector.h>
-#include <hkl/hkl-sample.h>
-#include <hkl/hkl-error.h>
-
-HKL_BEGIN_DECLS
-
-typedef struct _HklPseudoAxis HklPseudoAxis;
-typedef struct _HklPseudoAxisEngineMode HklPseudoAxisEngineMode;
-typedef struct _HklPseudoAxisEngine HklPseudoAxisEngine;
-typedef struct _HklPseudoAxisEngineList HklPseudoAxisEngineList;
-
-typedef int (* HklPseudoAxisEngineModeFunc) (HklPseudoAxisEngineMode *self,
-					     HklPseudoAxisEngine *engine,
-					     HklGeometry *geometry,
-					     HklDetector *detector,
-					     HklSample *sample,
-					     HklError **error);
-
-typedef int (* HklFunction) (const gsl_vector *x, void *params, gsl_vector *f);
-
-struct _HklPseudoAxis
-{
-	HklParameter parent;
-	HklPseudoAxisEngine *engine;
-};
-
-struct _HklPseudoAxisEngineMode
-{
-	char const *name;
-	HklPseudoAxisEngineModeFunc initialize;
-	HklPseudoAxisEngineModeFunc get;
-	HklPseudoAxisEngineModeFunc set;
-	HKL_LIST(HklFunction, functions);
-	HKL_LIST(HklParameter, parameters);
-	HKL_LIST(const char*, axes_names);
-	HklGeometry *geometry_init;
-	HklDetector *detector_init;
-	HklSample *sample_init;
-};
-
-struct _HklPseudoAxisEngine
-{
-	char const *name;
-	HklGeometry *geometry;
-	HklDetector *detector;
-	HklSample *sample;
-	HKL_LIST(HklPseudoAxisEngineMode *, modes);
-	HKL_LIST(HklAxis *, axes);
-	HKL_LIST(HklPseudoAxis *, pseudoAxes);
-	HklPseudoAxisEngineMode *mode;
-	HklPseudoAxisEngineList *engines;
-};
-
-struct _HklPseudoAxisEngineList
-{
-	HKL_LIST(HklPseudoAxisEngine *, engines);
-	HklGeometryList *geometries;
-	HklGeometry *geometry;
-	HklDetector *detector;
-	HklSample *sample;
-};
-
-/*****************/
-/* HklPseudoAxis */
-/*****************/
-
-extern HklPseudoAxis *hkl_pseudo_axis_new(HklParameter const *parameter,
-					  HklPseudoAxisEngine *engine);
-
-extern void hkl_pseudo_axis_init(HklPseudoAxis *self,
-				 HklParameter const *parameter,
-				 HklPseudoAxisEngine *engine);
-
-extern void hkl_pseudo_axis_free(HklPseudoAxis *self);
-
-extern void hkl_pseudo_axis_fprintf(FILE *f, HklPseudoAxis *self);
-
-/*****************************/
-/* HklPseudoAxisEngineMode */
-/*****************************/
-
-extern HklPseudoAxisEngineMode *hkl_pseudo_axis_engine_mode_new(
-	char const *name,
-	HklPseudoAxisEngineModeFunc initialize,
-	HklPseudoAxisEngineModeFunc get,
-	HklPseudoAxisEngineModeFunc set,
-	size_t n, ...);
-
-extern int hkl_pseudo_axis_engine_mode_init(
-	HklPseudoAxisEngineMode *self,
-	char const *name,
-	HklPseudoAxisEngineModeFunc initialize,
-	HklPseudoAxisEngineModeFunc get,
-	HklPseudoAxisEngineModeFunc set,
-	size_t n_func, HklFunction functions[],
-	size_t n_p, HklParameter parameters[],
-	size_t n_axes, char const *axes_names[]);
-
-extern void hkl_pseudo_axis_engine_mode_free(HklPseudoAxisEngineMode *self);
-
-/***********************/
-/* HklPseudoAxisEngine */
-/***********************/
-
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_new(char const *name,
-						       size_t n, ...);
-
-extern void hkl_pseudo_axis_engine_free(HklPseudoAxisEngine *self);
-
-extern void hkl_pseudo_axis_engine_add_mode(HklPseudoAxisEngine *self,
-					    HklPseudoAxisEngineMode *mode);
-
-extern void hkl_pseudo_axis_engine_add_geometry(HklPseudoAxisEngine *self,
-						double const x[]);
-
-extern void hkl_pseudo_axis_engine_select_mode(HklPseudoAxisEngine *self,
-					       size_t idx);
-
-extern int hkl_pseudo_axis_engine_initialize(HklPseudoAxisEngine *self, HklError **error);
-
-extern int hkl_pseudo_axis_engine_set(HklPseudoAxisEngine *self, HklError **error);
-
-extern int hkl_pseudo_axis_engine_get(HklPseudoAxisEngine *self, HklError **error);
-
-extern void hkl_pseudo_axis_engine_fprintf(FILE *f, HklPseudoAxisEngine const *self);
-
-/***************************/
-/* HklPseudoAxisEngineList */
-/***************************/
-
-extern HklPseudoAxisEngineList *hkl_pseudo_axis_engine_list_new(void);
-
-extern void hkl_pseudo_axis_engine_list_free(HklPseudoAxisEngineList *self);
-
-extern int hkl_pseudo_axis_engine_list_add(HklPseudoAxisEngineList *self,
-					   HklPseudoAxisEngine *engine);
-
-extern HklPseudoAxisEngine *hkl_pseudo_axis_engine_list_get_by_name(HklPseudoAxisEngineList *self,
-								    char const *name);
-
-extern HklPseudoAxis *hkl_pseudo_axis_engine_list_get_pseudo_axis_by_name(HklPseudoAxisEngineList *self,
-									  char const *name);
-
-extern void hkl_pseudo_axis_engine_list_clear(HklPseudoAxisEngineList *self);
-
-extern void hkl_pseudo_axis_engine_list_init(HklPseudoAxisEngineList *self,
-					     HklGeometry *geometry,
-					     HklDetector *detector,
-					     HklSample *sample);
-
-extern int hkl_pseudo_axis_engine_list_get(HklPseudoAxisEngineList *self);
-
-extern void hkl_pseudo_axis_engine_list_fprintf(FILE *f,
-						HklPseudoAxisEngineList const *self);
-HKL_END_DECLS
-
-#endif /* __HKL_PSEUDOAXIS_H__ */
diff --git a/hkl/hkl-quaternion.h b/hkl/hkl-quaternion-private.h
similarity index 87%
rename from hkl/hkl-quaternion.h
rename to hkl/hkl-quaternion-private.h
index f984d99..863b15f 100644
--- a/hkl/hkl-quaternion.h
+++ b/hkl/hkl-quaternion-private.h
@@ -13,20 +13,20 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_QUATERNION_H__
-#define __HKL_QUATERNION_H__
+#ifndef __HKL_QUATERNION_PRIVATE_H__
+#define __HKL_QUATERNION_PRIVATE_H__
 
 #include <stdio.h>
 #include <math.h>
-#include <hkl/hkl-macros.h>
-#include <hkl/hkl-vector.h>
-#include <hkl/hkl-matrix.h>
+
+#include "hkl.h"
+#include "hkl-vector-private.h"
 
 HKL_BEGIN_DECLS
 
@@ -35,6 +35,10 @@ struct _HklQuaternion
 	double data[4];
 };
 
+extern HklQuaternion *hkl_quaternion_dup(const HklQuaternion* self);
+
+extern void hkl_quaternion_free(HklQuaternion *self);
+
 extern void hkl_quaternion_init(HklQuaternion *self,
 				double a, double b, double c, double d);
 
diff --git a/hkl/hkl-quaternion.c b/hkl/hkl-quaternion.c
index 4df844b..a26636d 100644
--- a/hkl/hkl-quaternion.c
+++ b/hkl/hkl-quaternion.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,12 +23,44 @@
 #include <math.h>
 #include <string.h>
 
-#include <hkl/hkl-macros.h>
-#include <hkl/hkl-vector.h>
-#include <hkl/hkl-matrix.h>
-#include <hkl/hkl-quaternion.h>
+#include "hkl.h"
+#include "hkl-vector-private.h"
+#include "hkl-macros-private.h"
+#include "hkl-matrix-private.h"
+#include "hkl-quaternion-private.h"
 
 /* public */
+/**
+ * hkl_quaternion_dup: (skip)
+ * @self:
+ *
+ *
+ *
+ * Returns:
+ **/
+HklQuaternion *hkl_quaternion_dup(const HklQuaternion* self)
+{
+	HklQuaternion *dup;
+
+	dup = HKL_MALLOC(HklQuaternion);
+	memcpy(dup, self, sizeof(*self));
+
+	return dup;
+}
+
+/**
+ * hkl_quaternion_free: (skip)
+ * @self:
+ *
+ *
+ **/
+void hkl_quaternion_free(HklQuaternion *self)
+{
+	if(!self)
+		return;
+
+	free(self);
+}
 
 /**
  * hkl_quaternion_init:
@@ -111,7 +143,7 @@ void hkl_quaternion_init_from_angle_and_axe(HklQuaternion *self,
  *
  * compare two #HklQuaternion.
  *
- * Returns: #HKL_TRUE if both are equal, #HKL_FAIL otherwise.
+ * Returns: #HKL_TRUE if both are equal, #HKL_FALSE otherwise.
  **/
 int hkl_quaternion_cmp(HklQuaternion const *self, HklQuaternion const *q)
 {
@@ -224,7 +256,7 @@ void hkl_quaternion_to_matrix(const HklQuaternion *self, HklMatrix *m)
 
 	/* check that parameters are ok. */
 	hkl_assert(fabs(hkl_quaternion_norm2(self) - 1) < HKL_EPSILON);
-	
+
 	Q = self->data;
 
 	m->data[0][0] = Q[0]*Q[0] + Q[1]*Q[1] - Q[2]*Q[2] - Q[3]*Q[3];
diff --git a/hkl/hkl-detector.h b/hkl/hkl-sample-private.h
similarity index 52%
rename from hkl/hkl-detector.h
rename to hkl/hkl-sample-private.h
index c596094..be748b7 100644
--- a/hkl/hkl-detector.h
+++ b/hkl/hkl-sample-private.h
@@ -13,38 +13,56 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_DETECTOR_H__
-#define __HKL_DETECTOR_H__
+#ifndef __HKL_SAMPLE_PRIVATE_H__
+#define __HKL_SAMPLE_PRIVATE_H__
 
-#include <hkl/hkl-geometry.h>
+#include "ccan/list/list.h"
+#include "hkl.h"
+#include "hkl-matrix-private.h"
 
 HKL_BEGIN_DECLS
 
-typedef struct _HklDetector HklDetector;
+/*************/
+/* HklSample */
+/*************/
 
-struct _HklDetector
-{
-	size_t idx;
-	HklHolder const *holder;
+struct _HklSample {
+	char *name;
+	HklLattice *lattice;
+	HklMatrix U;
+	HklMatrix UB;
+	HklParameter *ux;
+	HklParameter *uy;
+	HklParameter *uz;
+	struct list_head reflections;
 };
 
-extern HklDetector *hkl_detector_new(void);
+extern void hkl_sample_fprintf(FILE *f, const HklSample *self);
 
-extern HklDetector *hkl_detector_new_copy(HklDetector const *src);
 
-extern void hkl_detector_free(HklDetector *self);
+/***********************/
+/* hklSampleReflection */
+/***********************/
 
-extern void hkl_detector_attach_to_holder(HklDetector *self, HklHolder const *holder);
+struct _HklSampleReflection {
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklVector hkl;
+	HklVector _hkl;
+	int flag;
+	struct list_node list;
+};
+
+extern HklSampleReflection *hkl_sample_reflection_new_copy(const HklSampleReflection *self);
 
-extern int hkl_detector_compute_kf(HklDetector const *self, HklGeometry *g,
-				   HklVector *kf);
+extern void hkl_sample_reflection_free(HklSampleReflection *self);
 
 HKL_END_DECLS
 
-#endif /* __HKL_DETECTOR_H__ */
+#endif
diff --git a/hkl/hkl-sample.c b/hkl/hkl-sample.c
index 85da3fa..e1742ec 100644
--- a/hkl/hkl-sample.c
+++ b/hkl/hkl-sample.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -23,11 +23,16 @@
 /* for strdup */
 #define _XOPEN_SOURCE 500
 #include <string.h>
-
 #include <gsl/gsl_multimin.h>
 
-#include <hkl/hkl-sample.h>
-#include <hkl/hkl-matrix.h>
+#include "hkl.h"
+
+#include "hkl-axis-private.h"
+#include "hkl-detector-private.h"
+#include "hkl-lattice-private.h"
+#include "hkl-parameter-private.h"
+#include "hkl-geometry-private.h"
+#include "hkl-sample-private.h"
 
 /* private */
 
@@ -43,60 +48,15 @@ static void hkl_sample_reflection_update(HklSampleReflection *self)
 	/* first Q from angles */
 	hkl_source_compute_ki(&self->geometry->source, &ki);
 	self->_hkl = ki;
-	hkl_vector_rotated_quaternion(&self->_hkl, &self->geometry->holders[self->detector.idx].q);
+	hkl_vector_rotated_quaternion(&self->_hkl,
+				      &darray_item(self->geometry->holders, self->detector->idx)->q);
 	hkl_vector_minus_vector(&self->_hkl, &ki);
 
-	q = self->geometry->holders[0].q;
+	q = darray_item(self->geometry->holders, 0)->q;
 	hkl_quaternion_conjugate(&q);
 	hkl_vector_rotated_quaternion(&self->_hkl, &q);
 }
 
-static HklSampleReflection *hkl_sample_reflection_new(HklGeometry *geometry,
-						      HklDetector const *detector,
-						      double h, double k, double l)
-{
-	HklSampleReflection *self;
-
-	if (!geometry || !detector)
-		return NULL;
-
-	self = HKL_MALLOC(HklSampleReflection);
-
-	hkl_geometry_update(geometry);
-
-	self->geometry = hkl_geometry_new_copy(geometry);
-	self->detector = *detector;
-	self->hkl.data[0] = h;
-	self->hkl.data[1] = k;
-	self->hkl.data[2] = l;
-	self->flag = HKL_TRUE;
-
-	hkl_sample_reflection_update(self);
-
-	return self;
-}
-
-static HklSampleReflection *hkl_sample_reflection_new_copy(HklSampleReflection const *src)
-{
-	HklSampleReflection *self = NULL;
-
-	self = HKL_MALLOC(HklSampleReflection);
-
-	self->geometry = hkl_geometry_new_copy(src->geometry);
-	self->detector = src->detector;
-	self->hkl = src->hkl;
-	self->_hkl = src->_hkl;
-	self->flag = src->flag;
-
-	return self;
-}
-
-static void hkl_sample_reflection_free(HklSampleReflection *self)
-{
-	hkl_geometry_free(self->geometry);
-	free(self);
-}
-
 static void hkl_sample_compute_UxUyUz(HklSample *self)
 {
 	double ux;
@@ -104,35 +64,35 @@ static void hkl_sample_compute_UxUyUz(HklSample *self)
 	double uz;
 
 	hkl_matrix_to_euler(&self->U, &ux, &uy, &uz);
-	hkl_parameter_set_value(self->ux, ux);
-	hkl_parameter_set_value(self->uy, uy);
-	hkl_parameter_set_value(self->uz, uz);
+	hkl_parameter_value_set(self->ux, ux, NULL);
+	hkl_parameter_value_set(self->uy, uy, NULL);
+	hkl_parameter_value_set(self->uz, uz, NULL);
 }
 
 static int hkl_sample_compute_UB(HklSample *self)
 {
 	HklMatrix B;
 
-	if (hkl_lattice_get_B(self->lattice, &B))
-		return HKL_FAIL;
+	if (!hkl_lattice_get_B(self->lattice, &B))
+		return HKL_FALSE;
 
 	self->UB = self->U;
 	hkl_matrix_times_matrix(&self->UB, &B);
 
-	return HKL_SUCCESS;
+	return HKL_TRUE;
 }
 
 /*
  * this structure is used by the minimization gsl algorithm.
  * in the set_UB method
- */ 
+ */
 struct set_UB_t
 {
 	HklSample *sample;
 	const HklMatrix *UB;
 };
 
-static double set_UB_fitness(gsl_vector const *x, void *params)
+static double set_UB_fitness(const gsl_vector *x, void *params)
 {
 	size_t i, j;
 	double fitness;
@@ -143,17 +103,22 @@ static double set_UB_fitness(gsl_vector const *x, void *params)
 	HklSample *sample = parameters->sample;
 	const HklMatrix *UB = parameters->UB;
 
-	sample->ux->value = euler_x = gsl_vector_get(x, 0);
-	sample->uy->value = euler_y = gsl_vector_get(x, 1);
-	sample->uz->value = euler_z = gsl_vector_get(x, 2);
-	sample->lattice->a->value = gsl_vector_get(x, 3);
-	sample->lattice->b->value = gsl_vector_get(x, 4);
-	sample->lattice->c->value = gsl_vector_get(x, 5);
-	sample->lattice->alpha->value = gsl_vector_get(x, 6);
-	sample->lattice->beta->value = gsl_vector_get(x, 7);
-	sample->lattice->gamma->value = gsl_vector_get(x, 8);
+	euler_x = gsl_vector_get(x, 0);
+	euler_y = gsl_vector_get(x, 1);
+	euler_z = gsl_vector_get(x, 2);
+
+	hkl_parameter_value_set(sample->ux, euler_x, NULL);
+	hkl_parameter_value_set(sample->uy, euler_y, NULL);
+	hkl_parameter_value_set(sample->uz, euler_z, NULL);
+	hkl_parameter_value_set(sample->lattice->a, gsl_vector_get(x, 3), NULL);
+	hkl_parameter_value_set(sample->lattice->b, gsl_vector_get(x, 4), NULL);
+	hkl_parameter_value_set(sample->lattice->c, gsl_vector_get(x, 5), NULL);
+	hkl_parameter_value_set(sample->lattice->alpha, gsl_vector_get(x, 6), NULL);
+	hkl_parameter_value_set(sample->lattice->beta, gsl_vector_get(x, 7), NULL);
+	hkl_parameter_value_set(sample->lattice->gamma, gsl_vector_get(x, 8), NULL);
+
 	hkl_matrix_init_from_euler(&sample->U, euler_x, euler_y, euler_z);
-	if (hkl_sample_compute_UB(sample))
+	if (!hkl_sample_compute_UB(sample))
 		return GSL_NAN;
 
 	fitness = 0.;
@@ -165,7 +130,7 @@ static double set_UB_fitness(gsl_vector const *x, void *params)
 	return fitness;
 }
 
-static double mono_crystal_fitness(gsl_vector const *x, void *params)
+static double mono_crystal_fitness(const gsl_vector *x, void *params)
 {
 	size_t i, j;
 	double fitness;
@@ -173,26 +138,28 @@ static double mono_crystal_fitness(gsl_vector const *x, void *params)
 	double euler_y;
 	double euler_z;
 	HklSample *sample = params;
-
-	sample->ux->value = euler_x = gsl_vector_get(x, 0);
-	sample->uy->value = euler_y = gsl_vector_get(x, 1);
-	sample->uz->value = euler_z = gsl_vector_get(x, 2);
-	sample->lattice->a->value = gsl_vector_get(x, 3);
-	sample->lattice->b->value = gsl_vector_get(x, 4);
-	sample->lattice->c->value = gsl_vector_get(x, 5);
-	sample->lattice->alpha->value = gsl_vector_get(x, 6);
-	sample->lattice->beta->value = gsl_vector_get(x, 7);
-	sample->lattice->gamma->value = gsl_vector_get(x, 8);
+	HklSampleReflection *reflection;
+
+	euler_x = gsl_vector_get(x, 0);
+	euler_y = gsl_vector_get(x, 1);
+	euler_z = gsl_vector_get(x, 2);
+
+	hkl_parameter_value_set(sample->ux, euler_x, NULL);
+	hkl_parameter_value_set(sample->uy, euler_y, NULL);
+	hkl_parameter_value_set(sample->uz, euler_z, NULL);
+	hkl_parameter_value_set(sample->lattice->a, gsl_vector_get(x, 3), NULL);
+	hkl_parameter_value_set(sample->lattice->b, gsl_vector_get(x, 4), NULL);
+	hkl_parameter_value_set(sample->lattice->c, gsl_vector_get(x, 5), NULL);
+	hkl_parameter_value_set(sample->lattice->alpha, gsl_vector_get(x, 6), NULL);
+	hkl_parameter_value_set(sample->lattice->beta, gsl_vector_get(x, 7), NULL);
+	hkl_parameter_value_set(sample->lattice->gamma, gsl_vector_get(x, 8), NULL);
 	hkl_matrix_init_from_euler(&sample->U, euler_x, euler_y, euler_z);
-	if (hkl_sample_compute_UB(sample))
+	if (!hkl_sample_compute_UB(sample))
 		return GSL_NAN;
 
 	fitness = 0.;
-	for(i=0; i<HKL_LIST_LEN(sample->reflections); ++i) {
-		HklSampleReflection *reflection;
-
-		reflection = sample->reflections[i];
-		if(reflection->flag == HKL_TRUE){
+	list_for_each(&sample->reflections, reflection, list){
+		if(reflection->flag){
 			HklVector UBh;
 
 			UBh = reflection->hkl;
@@ -222,15 +189,15 @@ static double minimize(HklSample *sample, double (* f) (const gsl_vector * x, vo
 
 	/* Starting point */
 	x = gsl_vector_alloc (9);
-	gsl_vector_set (x, 0, sample->ux->value);
-	gsl_vector_set (x, 1, sample->uy->value);
-	gsl_vector_set (x, 2, sample->uz->value);
-	gsl_vector_set (x, 3, sample->lattice->a->value);
-	gsl_vector_set (x, 4, sample->lattice->b->value);
-	gsl_vector_set (x, 5, sample->lattice->c->value);
-	gsl_vector_set (x, 6, sample->lattice->alpha->value);
-	gsl_vector_set (x, 7, sample->lattice->beta->value);
-	gsl_vector_set (x, 8, sample->lattice->gamma->value);
+	gsl_vector_set (x, 0, hkl_parameter_value_get(sample->ux));
+	gsl_vector_set (x, 1, hkl_parameter_value_get(sample->uy));
+	gsl_vector_set (x, 2, hkl_parameter_value_get(sample->uz));
+	gsl_vector_set (x, 3, hkl_parameter_value_get(sample->lattice->a));
+	gsl_vector_set (x, 4, hkl_parameter_value_get(sample->lattice->b));
+	gsl_vector_set (x, 5, hkl_parameter_value_get(sample->lattice->c));
+	gsl_vector_set (x, 6, hkl_parameter_value_get(sample->lattice->alpha));
+	gsl_vector_set (x, 7, hkl_parameter_value_get(sample->lattice->beta));
+	gsl_vector_set (x, 8, hkl_parameter_value_get(sample->lattice->gamma));
 
 	/* Set initial step sizes to 1 */
 	ss = gsl_vector_alloc (9);
@@ -271,7 +238,15 @@ static double minimize(HklSample *sample, double (* f) (const gsl_vector * x, vo
 /* HklSample */
 /*************/
 
-HklSample* hkl_sample_new(char const *name, HklSampleType type)
+/**
+ * hkl_sample_new:
+ * @name:
+ *
+ * constructor
+ *
+ * Returns:
+ **/
+HklSample* hkl_sample_new(const char *name)
 {
 	HklSample *self = NULL;
 
@@ -282,7 +257,6 @@ HklSample* hkl_sample_new(char const *name, HklSampleType type)
 	self = HKL_MALLOC(HklSample);
 
 	self->name = strdup(name);
-	self->type = type;
 	self->lattice = hkl_lattice_new_default();
 	hkl_matrix_init(&self->U,1, 0, 0, 0, 1, 0, 0, 0, 1);
 	hkl_matrix_init(&self->UB,1, 0, 0, 0, 1, 0, 0, 0, 1);
@@ -301,43 +275,59 @@ HklSample* hkl_sample_new(char const *name, HklSampleType type)
 				     &hkl_unit_angle_deg);
 
 	hkl_sample_compute_UB(self);
-	HKL_LIST_INIT(self->reflections);
+	list_head_init(&self->reflections);
 
 	return self;
 }
 
-HklSample *hkl_sample_new_copy(HklSample const *src)
+/**
+ * hkl_sample_new_copy: (skip)
+ * @self:
+ *
+ * copy constructor
+ *
+ * Returns:
+ **/
+HklSample *hkl_sample_new_copy(const HklSample *self)
 {
-	HklSample *self = NULL;
-	size_t len;
-	size_t i;
+	HklSample *dup = NULL;
+	HklSampleReflection *reflection;
 
 	/* check parameters */
-	if(!src)
-		return self;
+	if(!self)
+		return dup;
 
-	self = HKL_MALLOC(HklSample);
+	dup = HKL_MALLOC(HklSample);
 
-	self->name = strdup(src->name);
-	self->type = src->type;
-	self->lattice = hkl_lattice_new_copy(src->lattice);
-	self->U = src->U;
-	self->UB = src->UB;
-	self->ux = hkl_parameter_new_copy(src->ux);
-	self->uy = hkl_parameter_new_copy(src->uy);
-	self->uz = hkl_parameter_new_copy(src->uz);
+	dup->name = strdup(self->name);
+	dup->lattice = hkl_lattice_new_copy(self->lattice);
+	dup->U = self->U;
+	dup->UB = self->UB;
+	dup->ux = hkl_parameter_new_copy(self->ux);
+	dup->uy = hkl_parameter_new_copy(self->uy);
+	dup->uz = hkl_parameter_new_copy(self->uz);
 
 	/* copy the reflections */
-	len = HKL_LIST_LEN(src->reflections);
-	HKL_LIST_ALLOC(self->reflections, len);
-	for(i=0; i<len; ++i)
-		self->reflections[i] = hkl_sample_reflection_new_copy(src->reflections[i]);
+	list_head_init(&dup->reflections);
+	list_for_each(&self->reflections, reflection, list){
+		list_add_tail(&dup->reflections,
+			      &hkl_sample_reflection_new_copy(reflection)->list);
+	}
 
-	return self;
+	return dup;
 }
 
+/**
+ * hkl_sample_free: (skip)
+ * @self:
+ *
+ * destructor
+ **/
 void hkl_sample_free(HklSample *self)
 {
+	HklSampleReflection *reflection;
+	HklSampleReflection *next;
+
 	if (!self)
 		return;
 
@@ -346,63 +336,183 @@ void hkl_sample_free(HklSample *self)
 	hkl_parameter_free(self->ux);
 	hkl_parameter_free(self->uy);
 	hkl_parameter_free(self->uz);
-	HKL_LIST_FREE_DESTRUCTOR(self->reflections, hkl_sample_reflection_free);
+	list_for_each_safe(&self->reflections, reflection, next, list){
+		list_del(&reflection->list);
+		hkl_sample_reflection_free(reflection);
+	}
 	free(self);
 }
 
-void hkl_sample_set_name(HklSample *self, char const *name)
+/**
+ * hkl_sample_name_get:
+ * @self: the this ptr
+ *
+ * Return value: the name of the sample
+ **/
+const char *hkl_sample_name_get(const HklSample *self)
 {
-	if (!self)
-		return;
+	return self->name;
+}
 
+/**
+ * hkl_sample_name_set:
+ * @self: the this ptr
+ * @name: the new name to set
+ *
+ * set the name of the sample
+ **/
+void hkl_sample_name_set(HklSample *self, const char *name)
+{
 	if(self->name)
 		free(self->name);
 	self->name = strdup(name);
 }
 
-int hkl_sample_set_lattice(HklSample *self,
-			   double a, double b, double c,
-			   double alpha, double beta, double gamma)
+/**
+ * hkl_sample_lattice_get:
+ * @self: the this ptr
+ *
+ * Return value: the lattice parameters of the sample.
+ **/
+const HklLattice *hkl_sample_lattice_get(HklSample *self)
 {
-	int status;
+	return self->lattice;
+}
 
-	if (!self)
-		return HKL_FAIL;
+/**
+ * hkl_sample_lattice_set:
+ * @self: the this ptr
+ * @lattice: the lattice to set
+ **/
+void hkl_sample_lattice_set(HklSample *self, const HklLattice *lattice)
+{
+	hkl_lattice_lattice_set(self->lattice, lattice);
+	hkl_sample_compute_UB(self);
+}
 
+/**
+ * hkl_sample_ux_get:
+ * @self: the this ptr
+ *
+ * Return value: the ux part of the U matrix.
+ **/
+const HklParameter *hkl_sample_ux_get(const HklSample *self)
+{
+	return self->ux;
+}
 
-	status = hkl_lattice_set(self->lattice, a, b, c, alpha, beta, gamma);
-	if (status == HKL_SUCCESS)
-		hkl_sample_compute_UB(self);
-	return status;
+/**
+ * hkl_sample_uy_get:
+ * @self: the this ptr
+ *
+ * Return value: the uy part of the U matrix.
+ **/
+const HklParameter *hkl_sample_uy_get(const HklSample *self)
+{
+	return self->uy;
 }
 
-/* TODO test */
-int hkl_sample_set_U_from_euler(HklSample *self,
-				double x, double y, double z)
+/**
+ * hkl_sample_uz_get:
+ * @self: the this ptr
+ *
+ * Return value: the uz part of the U matrix.
+ **/
+const HklParameter *hkl_sample_uz_get(const HklSample *self)
 {
-	if (!self)
-		return HKL_FAIL;
+	return self->uz;
+}
 
-	hkl_matrix_init_from_euler(&self->U, x, y, z);
+/**
+ * hkl_sample_ux_set:
+ * @self: the this ptr
+ * @ux: the ux parameter to set
+
+ * set the ux part of the U matrix.
+ **/
+void hkl_sample_ux_set(HklSample *self,
+		       const HklParameter *ux)
+{
+	hkl_parameter_init_copy(self->ux, ux);
+	hkl_matrix_init_from_euler(&self->U,
+				   hkl_parameter_value_get(self->ux),
+				   hkl_parameter_value_get(self->uy),
+				   hkl_parameter_value_get(self->uz));
 	hkl_sample_compute_UB(self);
-	hkl_parameter_set_value(self->ux, x);
-	hkl_parameter_set_value(self->uy, y);
-	hkl_parameter_set_value(self->uz, z);
+}
+
+/**
+ * hkl_sample_uy_set:
+ * @self: the this ptr
+ * @uy: the uy parameter to set
 
-	return HKL_SUCCESS;
+ * set the uy part of the U matrix.
+ **/
+void hkl_sample_uy_set(HklSample *self,
+		       const HklParameter *uy)
+{
+	hkl_parameter_init_copy(self->uy, uy);
+	hkl_matrix_init_from_euler(&self->U,
+				   hkl_parameter_value_get(self->ux),
+				   hkl_parameter_value_get(self->uy),
+				   hkl_parameter_value_get(self->uz));
+	hkl_sample_compute_UB(self);
 }
 
-void hkl_sample_get_UB(HklSample *self, HklMatrix *UB)
+/**
+ * hkl_sample_uz_set:
+ * @self: the this ptr
+ * @uz: the uz parameter to set
+
+ * set the uz part of the U matrix.
+ **/
+void hkl_sample_uz_set(HklSample *self,
+		       const HklParameter *uz)
+{
+	hkl_parameter_init_copy(self->uz, uz);
+	hkl_matrix_init_from_euler(&self->U,
+				   hkl_parameter_value_get(self->ux),
+				   hkl_parameter_value_get(self->uy),
+				   hkl_parameter_value_get(self->uz));
+	hkl_sample_compute_UB(self);
+}
+
+/**
+ * hkl_sample_U_get:
+ * @self: the this ptr
+ *
+ * Return value: the U matrix of the sample
+ **/
+const HklMatrix *hkl_sample_U_get(const HklSample *self)
 {
-	if (!self || !UB)
-		return;
+	return &self->U;
+}
+
+void hkl_sample_U_set(HklSample *self, const HklMatrix *U)
+{
+	double x, y, z;
 
+	hkl_matrix_matrix_set(&self->U, U);
 	hkl_sample_compute_UB(self);
-	*UB = self->UB;
+	hkl_matrix_to_euler(&self->U, &x, &y, &z);
+	hkl_parameter_value_set(self->ux, x, NULL);
+	hkl_parameter_value_set(self->uy, y, NULL);
+	hkl_parameter_value_set(self->uz, z, NULL);
+}
+
+/**
+ * hkl_sample_UB_get:
+ * @self: the this ptr.
+ *
+ * Return value: get the UB matrix of the sample
+ **/
+const HklMatrix *hkl_sample_UB_get(const HklSample *self)
+{
+	return &self->UB;
 }
 
 /**
- * hkl_sample_set_UB: set the UB matrix of the sample
+ * hkl_sample_UB_set:
  * @self: the sample to modify
  * @UB: the UB matrix to set
  *
@@ -411,66 +521,94 @@ void hkl_sample_get_UB(HklSample *self, HklMatrix *UB)
  * this operation. We keep the B matrix constant.
  * U * B = UB -> U = UB * B^-1
  **/
-double hkl_sample_set_UB(HklSample *self, const HklMatrix *UB)
+double hkl_sample_UB_set(HklSample *self, const HklMatrix *UB)
 {
-	struct set_UB_t params;
-
-	if(!self || !UB)
-		return -1;
-
-	params.sample = self;
-	params.UB = UB;
+	struct set_UB_t params = {
+		.sample = self,
+		.UB = UB
+	};
 
 	return minimize(self, set_UB_fitness, &params);
 }
 
-HklSampleReflection *hkl_sample_add_reflection(HklSample *self,
-					       HklGeometry *geometry,
-					       HklDetector const *detector,
-					       double h, double k, double l)
+/**
+ * hkl_sample_first_reflection_get: (skip)
+ * @self: the this ptr
+ *
+ * Return value: the first HklSampleReflection of the sample.
+ **/ 
+HklSampleReflection *hkl_sample_first_reflection_get(const HklSample *self)
 {
-	HklSampleReflection *ref;
-
-	ref = hkl_sample_reflection_new(geometry, detector, h, k, l);
-
-	if(ref)
-		HKL_LIST_ADD_VALUE(self->reflections, ref);
-
-	return ref;
+	return list_top(&self->reflections, HklSampleReflection, list);
 }
 
-HklSampleReflection* hkl_sample_get_ith_reflection(HklSample const *self, size_t idx)
+/**
+ * hkl_sample_next_reflection_get: (skip)
+ * @self: the this ptr
+ * @reflection: the current reflection
+ *
+ * Return value: (allow-none): the next reflection or NULL if no more reflection
+ **/
+HklSampleReflection *hkl_sample_next_reflection_get(const HklSample *self,
+						    const HklSampleReflection *reflection)
 {
-	if (!self)
+	if (&self->reflections.n == reflection->list.next)
 		return NULL;
-
-	return self->reflections[idx];
+	else
+		return list_entry(reflection->list.next, HklSampleReflection, list);
 }
 
-int hkl_sample_del_reflection(HklSample *self, size_t idx)
+/**
+ * hkl_sample_add_reflection: (skip)
+ * @self: the this ptr
+ * @reflection: The reflection to add
+ *
+ * add a reflection to the sample, if the reflection is already part
+ * of the sample reflection list, this method does nothing.
+ **/
+void hkl_sample_add_reflection(HklSample *self,
+			       HklSampleReflection *reflection)
 {
-	if (!self)
-		return HKL_FAIL;
+	HklSampleReflection *ref;
 
-	hkl_sample_reflection_free(self->reflections[idx]);
-	HKL_LIST_DEL(self->reflections, idx);
+	list_for_each(&self->reflections, ref, list){
+		if (ref == reflection)
+			return;
+	}
 
-	return HKL_SUCCESS;
+	list_add_tail(&self->reflections, &reflection->list);
 }
 
-int hkl_sample_compute_UB_busing_levy(HklSample *self, size_t idx1, size_t idx2)
+/**
+ * hkl_sample_del_reflection:
+ * @self: the this ptr
+ * @reflection: the reflection to remove.
+ *
+ * remove an HklSampleRefelction from the reflections list.
+ **/
+void hkl_sample_del_reflection(HklSample *self,
+			       HklSampleReflection *reflection)
 {
-	HklSampleReflection *r1;
-	HklSampleReflection *r2;
-
-	if (!self
-	    || idx1 >= HKL_LIST_LEN(self->reflections)
-	    || idx2 >= HKL_LIST_LEN(self->reflections))
-		return HKL_FAIL;
+	list_del(&reflection->list);
+	hkl_sample_reflection_free(reflection);
+}
 
-	r1 = self->reflections[idx1];
-	r2 = self->reflections[idx2];
+/**
+ * hkl_sample_compute_UB_busing_levy:
+ * @self: the this ptr
+ * @r1: the first #HklsampleReflection
+ * @r2: the second #HklSampleReflection
+ *
+ * compute the UB matrix using the Busing and Levy method
+ * #todo: add ref
+ *
+ * Returns: 0 or 1 if it succeed
+ **/
+int hkl_sample_compute_UB_busing_levy(HklSample *self,
+				      const HklSampleReflection *r1,
+				      const HklSampleReflection *r2)
 
+{
 	if (!hkl_vector_is_colinear(&r1->hkl, &r2->hkl)) {
 		HklVector h1c;
 		HklVector h2c;
@@ -493,53 +631,78 @@ int hkl_sample_compute_UB_busing_levy(HklSample *self, size_t idx1, size_t idx2)
 		hkl_sample_compute_UxUyUz(self);
 		hkl_sample_compute_UB(self);
 	} else
-		return HKL_FAIL;
-	
-	return HKL_SUCCESS;
+		return HKL_FALSE;
+
+	return HKL_TRUE;
 }
 
+/**
+ * hkl_sample_affine:
+ * @self: the this ptr
+ *
+ * affine the sample
+ *
+ * Returns: the fitness of the affined #HklSample
+ **/
 double hkl_sample_affine(HklSample *self)
 {
-	if(!self)
-		return GSL_NAN;
-
 	return minimize(self, mono_crystal_fitness, self);
 }
 
-double hkl_sample_get_reflection_mesured_angle(HklSample const *self,
-					       size_t idx1, size_t idx2)
+/**
+ * hkl_sample_get_reflection_mesured_angle:
+ * @self: the this ptr
+ * @r1: the first #HklSampleReflection
+ * @r2: the second #HklSampleReflection
+ *
+ * get the mesured angles between two #HklSampleReflection
+ *
+ * Returns: the mesured angle beetween them
+ **/
+double hkl_sample_get_reflection_mesured_angle(const HklSample *self,
+					       const HklSampleReflection *r1,
+					       const HklSampleReflection *r2)
 {
-	if (!self
-	    || idx1 >= HKL_LIST_LEN(self->reflections)
-	    || idx2 >= HKL_LIST_LEN(self->reflections))
-		return GSL_NAN;
-
-	return hkl_vector_angle(&self->reflections[idx1]->_hkl,
-				&self->reflections[idx2]->_hkl);
+	return hkl_vector_angle(&r1->_hkl,
+				&r2->_hkl);
 }
 
-double hkl_sample_get_reflection_theoretical_angle(HklSample const *self,
-						   size_t idx1, size_t idx2)
+/**
+ * hkl_sample_get_reflection_theoretical_angle:
+ * @self: the this ptr
+ * @r1: the first #HklSampleReflection
+ * @r2: the second #HklSampleReflection
+ *
+ * get the theoretical angles between two #HklSampleReflection
+ *
+ * Returns: the theoretical angle beetween them
+ **/
+double hkl_sample_get_reflection_theoretical_angle(const HklSample *self,
+						   const HklSampleReflection *r1,
+						   const HklSampleReflection *r2)
 {
 	HklVector hkl1;
 	HklVector hkl2;
 
-	if (!self
-	    || idx1 >= HKL_LIST_LEN(self->reflections)
-	    || idx2 >= HKL_LIST_LEN(self->reflections))
-		return GSL_NAN;
-
-	hkl1 = self->reflections[idx1]->hkl;
-	hkl2 = self->reflections[idx2]->hkl;
+	hkl1 = r1->hkl;
+	hkl2 = r2->hkl;
 	hkl_matrix_times_vector(&self->UB, &hkl1);
 	hkl_matrix_times_vector(&self->UB, &hkl2);
 
 	return hkl_vector_angle(&hkl1, &hkl2);
 }
 
-void hkl_sample_fprintf(FILE *f,  HklSample const *self)
+/**
+ * hkl_sample_fprintf: (skip)
+ * @f:
+ * @self:
+ *
+ * print to a file a sample
+ **/
+void hkl_sample_fprintf(FILE *f, const HklSample *self)
 {
-	size_t i, len;
+	if(!self)
+		return;
 
 	fprintf(f, "\nSample name: \"%s\"", self->name);
 
@@ -565,32 +728,27 @@ void hkl_sample_fprintf(FILE *f,  HklSample const *self)
 	fprintf(f, "\nUB:\n");
 	hkl_matrix_fprintf(f, &self->UB);
 
-	len = HKL_LIST_LEN(self->reflections);
-	if (len){
+	if (!list_empty(&self->reflections)){
 		HklSampleReflection *reflection;
-		HklAxis *axes;
-		size_t axes_len;
+		HklParameter **axis;
 
-		reflection  = hkl_sample_get_ith_reflection(self, 0);
+		reflection  = list_top(&self->reflections, HklSampleReflection, list);
 
 		fprintf(f, "Reflections:");
 		fprintf(f, "\n");
-		fprintf(f, "i %-10.6s %-10.6s %-10.6s", "h", "k", "l");
-		axes = reflection->geometry->axes;
-		axes_len = HKL_LIST_LEN(reflection->geometry->axes);
-		for(i=0; i<axes_len; ++i)
-			fprintf(f, " %-10.6s", hkl_axis_get_name(&axes[i]));
-
-		for(i=0; i<len; ++i){
-			size_t j;
-			
-			reflection  = hkl_sample_get_ith_reflection(self, i);
-			axes = reflection->geometry->axes;
-			axes_len = HKL_LIST_LEN(reflection->geometry->axes);
-			fprintf(f, "\n%d %-10.6f %-10.6f %-10.6f", i, 
-				reflection->hkl.data[0], reflection->hkl.data[1], reflection->hkl.data[2]);
-			for(j=0; j<axes_len; ++j)
-				fprintf(f, " %-10.6f", hkl_axis_get_value_unit(&axes[j]));
+		fprintf(f, "%-10.6s %-10.6s %-10.6s", "h", "k", "l");
+		darray_foreach(axis, reflection->geometry->axes){
+			fprintf(f, " %-10.6s", (*axis)->name);
+		}
+
+		list_for_each(&self->reflections, reflection, list){
+			fprintf(f, "\n%-10.6f %-10.6f %-10.6f",
+				reflection->hkl.data[0],
+				reflection->hkl.data[1],
+				reflection->hkl.data[2]);
+			darray_foreach(axis, reflection->geometry->axes){
+				fprintf(f, " %-10.6f", hkl_parameter_value_unit_get(*axis));
+			}
 		}
 	}
 }
@@ -599,159 +757,164 @@ void hkl_sample_fprintf(FILE *f,  HklSample const *self)
 /* HklSampleReflection */
 /***********************/
 
-void hkl_sample_reflection_set_hkl(HklSampleReflection *self, double h, double k, double l)
+/**
+ * hkl_sample_reflection_new:
+ * @geometry:
+ * @detector:
+ * @h:
+ * @k:
+ * @l:
+ *
+ * constructeur
+ *
+ * Returns:
+ **/
+HklSampleReflection *hkl_sample_reflection_new(const HklGeometry *geometry,
+					       const HklDetector *detector,
+					       double h, double k, double l)
 {
-	if(!self
-	   || (fabs(h) + fabs(k) + fabs(l) < HKL_EPSILON))
-		return;
+	HklSampleReflection *self;
 
+	if (!geometry || !detector)
+		return NULL;
+
+	self = HKL_MALLOC(HklSampleReflection);
+
+	self->geometry = hkl_geometry_new_copy(geometry);
+	self->detector = hkl_detector_new_copy(detector);
 	self->hkl.data[0] = h;
 	self->hkl.data[1] = k;
 	self->hkl.data[2] = l;
-}
-
-void hkl_sample_reflection_set_flag(HklSampleReflection *self, int flag)
-{
-	if(!self)
-		return;
-	self->flag = flag;
-}
-
-void hkl_sample_reflection_set_geometry(HklSampleReflection *self, HklGeometry *geometry)
-{
-	if(!self || !geometry)
-		return;
-
-	if(self->geometry){
-		if(self->geometry != geometry){
-			hkl_geometry_free(self->geometry);
-			self->geometry = hkl_geometry_new_copy(geometry);
-		}
-	}else
-		self->geometry = hkl_geometry_new_copy(geometry);
+	self->flag = HKL_TRUE;
 
 	hkl_sample_reflection_update(self);
-}
-
-/*****************/
-/* HklSampleList */
-/*****************/
-
-HklSampleList *hkl_sample_list_new(void)
-{
-	HklSampleList *self = NULL;
-	self = HKL_MALLOC(HklSampleList);
-
-	HKL_LIST_INIT(self->samples);
-	self->current = NULL;
 
 	return self;
 }
 
-void hkl_sample_list_free(HklSampleList *self)
+/**
+ * hkl_sample_reflection_new_copy: (skip)
+ * @self:
+ *
+ * copy constructor
+ *
+ * Returns:
+ **/
+HklSampleReflection *hkl_sample_reflection_new_copy(const HklSampleReflection *self)
 {
-	if (self){
-		HKL_LIST_FREE_DESTRUCTOR(self->samples, hkl_sample_free);
-		self->current = NULL;
-		free(self);
-	}
-}
+	HklSampleReflection *dup = NULL;
 
-void hkl_sample_list_clear(HklSampleList *self)
-{
-	if(self){
-		HKL_LIST_FREE_DESTRUCTOR(self->samples, hkl_sample_free);
-		self->current = NULL;
-		HKL_LIST_INIT(self->samples);
-	}
-}
+	dup = HKL_MALLOC(HklSampleReflection);
 
-HklSample *hkl_sample_list_append(HklSampleList *self, HklSample *sample)
-{
-	if (!self || !sample
-	    || hkl_sample_list_get_idx_from_name(self, sample->name) != HKL_FAIL)
-		return NULL;
-
-	HKL_LIST_ADD_VALUE(self->samples, sample);
+	dup->geometry = hkl_geometry_new_copy(self->geometry);
+	dup->detector = hkl_detector_new_copy(self->detector);
+	dup->hkl = self->hkl;
+	dup->_hkl = self->_hkl;
+	dup->flag = self->flag;
 
-	return sample;
+	return dup;
 }
 
-void hkl_sample_list_del(HklSampleList *self, HklSample *sample)
+/**
+ * hkl_sample_reflection_free: (skip)
+ * @self:
+ *
+ * destructor
+ **/
+void hkl_sample_reflection_free(HklSampleReflection *self)
 {
-	if(self && sample){
-		if (self->current == sample)
-			self->current = NULL;
-		HKL_LIST_DEL_ITEM_DESTRUCTOR(self->samples, sample, hkl_sample_free);
-	}
+	hkl_geometry_free(self->geometry);
+	hkl_detector_free(self->detector);
+	free(self);
 }
 
-/* TODO test */
-size_t hkl_sample_list_len(HklSampleList const *self)
+/**
+ * hkl_sample_reflection_hkl_get:
+ * @self: the this ptr
+ * @h: (out caller-allocates): the h-coordinate of the #HklSampleReflection
+ * @k: (out caller-allocates): the k-coordinate of the #HklSampleReflection
+ * @l: (out caller-allocates): the l-coordinate of the #HklSampleReflection
+ *
+ * get the hkl coordinates of the #HklSampleReflection
+ **/
+void hkl_sample_reflection_hkl_get(const HklSampleReflection *self,
+				   double *h, double *k, double *l)
 {
-	return HKL_LIST_LEN(self->samples);
+	*h = self->hkl.data[0];
+	*k = self->hkl.data[1];
+	*l = self->hkl.data[2];
 }
 
-/* TODO test */
-HklSample *hkl_sample_list_get_ith(HklSampleList *self, size_t idx)
+/**
+ * hkl_sample_reflection_hkl_set:
+ * @self: the this ptr
+ * @h: the h-coordinate of the #HklSampleReflection
+ * @k: the k-coordinate of the #HklSampleReflection
+ * @l: the l-coordinate of the #HklSampleReflection
+ *
+ * set the hkl coordinates of the #HklSampleReflection
+ **/
+void hkl_sample_reflection_hkl_set(HklSampleReflection *self, double h, double k, double l)
 {
-	HklSample *sample = NULL;
-	if (self && idx < HKL_LIST_LEN(self->samples))
-		sample = self->samples[idx];
+	if((fabs(h) + fabs(k) + fabs(l) < HKL_EPSILON))
+		return;
 
-	return sample;
+	self->hkl.data[0] = h;
+	self->hkl.data[1] = k;
+	self->hkl.data[2] = l;
 }
 
-/* TODO test */
-HklSample *hkl_sample_list_get_by_name(HklSampleList *self, char const *name)
+/**
+ * hkl_sample_reflection_flag_get: (skip)
+ * @self:
+ *
+ * get the flag of the reflection
+ **/
+int hkl_sample_reflection_flag_get(const HklSampleReflection *self)
 {
-	HklSample *sample = NULL;
-	size_t idx;
-
-	if (!self || !name)
-		return sample;
-
-	idx = hkl_sample_list_get_idx_from_name(self, name);
-	if (HKL_FAIL != idx)
-		sample = self->samples[idx];
-
-	return sample;
+	return self->flag;
 }
 
-size_t hkl_sample_list_get_idx_from_name(HklSampleList *self, char const *name)
+/**
+ * hkl_sample_reflection_flag_set: (skip)
+ * @self:
+ * @flag:
+ *
+ * set the flag of the reglection
+ **/
+void hkl_sample_reflection_flag_set(HklSampleReflection *self, int flag)
 {
-	size_t idx;
-
-	if (!self || !name || !self->samples)
-		return HKL_FAIL;
-
-	for(idx=0; idx<HKL_LIST_LEN(self->samples); ++idx)
-		if (!strcmp(self->samples[idx]->name, name))
-			return idx;
-
-	return HKL_FAIL;
+	self->flag = flag;
 }
 
-int hkl_sample_list_select_current(HklSampleList *self, char const *name)
+/**
+ * hkl_sample_reflection_geometry_get: (skip)
+ * @self:
+ *
+ * set the geometry of the reflection
+ **/
+const HklGeometry *hkl_sample_reflection_geometry_get(HklSampleReflection *self)
 {
-	size_t idx;
-	int res = HKL_FAIL;
-
-	if(!self || !name || !self->samples)
-		return res;
-
-	idx = hkl_sample_list_get_idx_from_name(self, name);
-	if (idx != HKL_FAIL){
-		self->current = self->samples[idx];
-		res = HKL_SUCCESS;
-	}
-
-	return res;
+	return self->geometry;
 }
 
-void hkl_sample_list_fprintf(FILE *f, HklSampleList const *self)
+/**
+ * hkl_sample_reflection_geometry_set: (skip)
+ * @self:
+ * @geometry:
+ *
+ * set the geometry of the reflection
+ **/
+void hkl_sample_reflection_geometry_set(HklSampleReflection *self,
+					const HklGeometry *geometry)
 {
-	size_t i;
-	for(i=0; i<HKL_LIST_LEN(self->samples); ++i)
-		hkl_sample_fprintf(f, self->samples[i]);
+	if(self->geometry){
+		if(self->geometry != geometry){
+			hkl_geometry_free(self->geometry);
+			self->geometry = hkl_geometry_new_copy(geometry);
+		}
+	}else
+		self->geometry = hkl_geometry_new_copy(geometry);
+
+	hkl_sample_reflection_update(self);
 }
diff --git a/hkl/hkl-sample.h b/hkl/hkl-sample.h
deleted file mode 100644
index fc2d02e..0000000
--- a/hkl/hkl-sample.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_SAMPLE_H__
-#define __HKL_SAMPLE_H__
-
-#include <hkl/hkl-lattice.h>
-#include <hkl/hkl-geometry.h>
-#include <hkl/hkl-detector.h>
-#include <hkl/hkl-list.h>
-
-HKL_BEGIN_DECLS
-
-typedef struct _HklSample HklSample;
-typedef struct _HklSampleReflection HklSampleReflection;
-typedef struct _HklSampleList HklSampleList;
-
-enum _HklSampleType {
-	HKL_SAMPLE_TYPE_MONOCRYSTAL
-};
-
-typedef enum _HklSampleType HklSampleType;
-
-struct _HklSample {
-	char *name;
-	HklSampleType type;
-	HklLattice *lattice;
-	HklMatrix U;
-	HklMatrix UB;
-	HklParameter *ux;
-	HklParameter *uy;
-	HklParameter *uz;
-	HKL_LIST(HklSampleReflection *, reflections);
-};
-
-struct _HklSampleReflection {
-	HklGeometry *geometry;
-	HklDetector detector;
-	HklVector hkl;
-	HklVector _hkl;
-	int flag;
-};
-
-struct _HklSampleList {
-	HKL_LIST(HklSample *, samples);
-	HklSample *current;
-};
-
-/*************/
-/* HklSample */
-/*************/
-
-extern HklSample *hkl_sample_new(char const *name, HklSampleType type);
-extern HklSample *hkl_sample_new_copy(HklSample const *self);
-
-extern void hkl_sample_free(HklSample *self);
-
-extern void hkl_sample_set_name(HklSample *self, char const *name);
-
-extern int hkl_sample_set_lattice(HklSample *self,
-				  double a, double b, double c,
-				  double alpha, double beta, double gamma);
-
-extern int hkl_sample_set_U_from_euler(HklSample *self,
-				       double x, double y, double z);
-
-extern void hkl_sample_get_UB(HklSample *self, HklMatrix *UB);
-
-extern double hkl_sample_set_UB(HklSample *self, const HklMatrix *UB);
-
-extern HklSampleReflection *hkl_sample_add_reflection(HklSample *self,
-						      HklGeometry *geometry,
-						      HklDetector const *detector,
-						      double h, double k, double l);
-
-extern HklSampleReflection *hkl_sample_get_ith_reflection(HklSample const *self,
-							  size_t idx);
-
-extern int hkl_sample_del_reflection(HklSample *self, size_t idx);
-
-extern int hkl_sample_compute_UB_busing_levy(HklSample *self,
-					     size_t idx1, size_t idx2);
-
-extern double hkl_sample_affine(HklSample *sample);
-
-extern double hkl_sample_get_reflection_mesured_angle(HklSample const *self,
-						      size_t idx1, size_t idx2);
-
-extern double hkl_sample_get_reflection_theoretical_angle(HklSample const *self,
-							  size_t idx1, size_t idx2);
-
-extern void hkl_sample_fprintf(FILE *f, HklSample const *self);
-
-
-/***********************/
-/* hklSampleReflection */
-/***********************/
-
-void hkl_sample_reflection_set_hkl(HklSampleReflection *self, double h, double k, double l);
-
-void hkl_sample_reflection_set_flag(HklSampleReflection *self, int flag);
-
-void hkl_sample_reflection_set_geometry(HklSampleReflection *self, HklGeometry *geometry);
-
-/*****************/
-/* HklSampleList */
-/*****************/
-
-extern HklSampleList *hkl_sample_list_new(void);
-
-extern void hkl_sample_list_free(HklSampleList *self);
-
-extern HklSample *hkl_sample_list_append(HklSampleList *self,
-					 HklSample *sample);
-
-extern void hkl_sample_list_clear(HklSampleList *self);
-
-extern void hkl_sample_list_del(HklSampleList *self, HklSample *sample);
-
-extern size_t hkl_sample_list_len(HklSampleList const *self);
-
-extern HklSample *hkl_sample_list_get_ith(HklSampleList *self, size_t idx);
-
-extern HklSample *hkl_sample_list_get_by_name(HklSampleList *self,
-					      char const *name);
-
-extern size_t hkl_sample_list_get_idx_from_name(HklSampleList *self,
-						char const *name);
-
-extern int hkl_sample_list_select_current(HklSampleList *self, char const *name);
-
-extern void hkl_sample_list_fprintf(FILE *f, HklSampleList const *self);
-
-HKL_END_DECLS
-
-#endif
diff --git a/hkl/hkl-source.h b/hkl/hkl-source-private.h
similarity index 83%
rename from hkl/hkl-source.h
rename to hkl/hkl-source-private.h
index b827b8c..3c45209 100644
--- a/hkl/hkl-source.h
+++ b/hkl/hkl-source-private.h
@@ -13,16 +13,16 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_SOURCE_H__
-#define __HKL_SOURCE_H__
+#ifndef __HKL_SOURCE_PRIVATE_H__
+#define __HKL_SOURCE_PRIVATE_H__
 
-#include <hkl/hkl-vector.h>
+#include "hkl-vector-private.h"
 
 HKL_BEGIN_DECLS
 
@@ -36,6 +36,10 @@ struct _HklSource
 	HklVector direction;
 };
 
+extern HklSource *hkl_source_dup(const HklSource *self);
+
+extern void hkl_source_free(HklSource *self);
+
 extern int hkl_source_init(HklSource *self, double wave_length,
 			   double x, double y, double z);
 
@@ -49,4 +53,4 @@ extern void hkl_source_fprintf(FILE *f, HklSource const *self);
 
 HKL_END_DECLS
 
-#endif /* __HKL_SOURCE_H__ */
+#endif /* __HKL_SOURCE_PRIVATE_H__ */
diff --git a/hkl/hkl-source.c b/hkl/hkl-source.c
index c984e9f..7135cda 100644
--- a/hkl/hkl-source.c
+++ b/hkl/hkl-source.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,12 +22,56 @@
 #include <stdlib.h>
 #include <math.h>
 
-#include <hkl/hkl-source.h>
+#include "hkl-macros-private.h"
+#include "hkl-source-private.h"
 
+/**
+ * hkl_source_dup:
+ * @self: the #Hklsource to copy
+ *
+ * copy constructor
+ * TODO test
+ *
+ * Returns:
+ **/
+HklSource *hkl_source_dup(const HklSource *self)
+{
+	HklSource *dup = HKL_MALLOC(HklSource);
+
+	*dup = *self;
+
+	return dup;
+}
+
+/**
+ * hkl_source_free:
+ * @self: the #Hklsource to delete
+ *
+ * destructor
+ * TODO: test
+ **/
+void hkl_source_free(HklSource *self)
+{
+	if (self)
+		free(self);
+}
+
+/**
+ * hkl_source_init:
+ * @self: the #Hklsource to initialize
+ * @wave_length: the wave length to set
+ * @x: x coordinates of the ki vector
+ * @y: y coordinates of the ki vector
+ * @z: z coordinates of the ki vector
+ *
+ * initialize the #HklSource
+ *
+ * Returns: HKL_SUCCESS if everythongs goes fine, HKL_FAIL otherwise
+ **/
 int hkl_source_init(HklSource *self,
 		    double wave_length, double x, double y, double z)
 {
-	if (wave_length > HKL_EPSILON && 
+	if (wave_length > HKL_EPSILON &&
 	    ( x > HKL_EPSILON || y > HKL_EPSILON || z > HKL_EPSILON)) {
 		double norm;
 
@@ -36,12 +80,20 @@ int hkl_source_init(HklSource *self,
 		self->wave_length = wave_length;
 		hkl_vector_init(&self->direction, x, y, z);
 		hkl_vector_div_double(&self->direction, norm);
-		return HKL_SUCCESS;
+		return HKL_TRUE;
 	} else
-		return HKL_FAIL;
+		return HKL_FALSE;
 }
 
-/** compare two sources */
+/**
+ * hkl_source_cmp: (skip)
+ * @self: 1st #Hklsource
+ * @s: 2nd #Hklsource
+ *
+ * compare two sources
+ *
+ * Returns:
+ **/
 int hkl_source_cmp(HklSource const *self, HklSource const *s)
 {
 	return ( (fabs(self->wave_length - s->wave_length) < HKL_EPSILON)
@@ -49,19 +101,39 @@ int hkl_source_cmp(HklSource const *self, HklSource const *s)
 					   &s->direction));
 }
 
-/** compute the ki hkl_vector */
+/**
+ * hkl_source_compute_ki: (skip)
+ * @self:
+ * @ki: (out caller-allocates):
+ *
+ * compute the ki hkl_vector
+ **/
 void hkl_source_compute_ki(HklSource const *self, HklVector *ki)
 {
 	*ki = self->direction;
 	hkl_vector_times_double(ki, HKL_TAU / self->wave_length);
 }
 
+/**
+ * hkl_source_get_wavelength: (skip)
+ * @self:
+ *
+ * get the wave_length
+ *
+ * Returns: the wave_length
+ **/
 double hkl_source_get_wavelength(HklSource const *self)
 {
 	return self->wave_length;
 }
 
-/** printf the source */
+/**
+ * hkl_source_fprintf: (skip)
+ * @f:
+ * @self:
+ *
+ * printf the source
+ **/
 void hkl_source_fprintf(FILE *f, HklSource const *self)
 {
 	fprintf(f, "%f", self->wave_length);
diff --git a/hkl/hkl-type-builtins.c b/hkl/hkl-type-builtins.c
new file mode 100644
index 0000000..56745f3
--- /dev/null
+++ b/hkl/hkl-type-builtins.c
@@ -0,0 +1,27 @@
+
+/* Generated data (by glib-mkenums) */
+
+#undef HKL_DISABLE_DEPRECATED
+#define HKL_ENABLE_BROKEN
+#include <glib-object.h>
+#include "hkl.h"
+#include "hkl-type-builtins.h"
+/* enumerations from "../hkl.h" */
+GType
+hkl_detector_type_get_type (void)
+{
+    static GType etype = 0;
+    if (G_UNLIKELY(etype == 0)) {
+        static const GEnumValue values[] = {
+            { HKL_DETECTOR_TYPE_0D, "HKL_DETECTOR_TYPE_0D", "0d" },
+            { 0, NULL, NULL }
+        };
+        etype = g_enum_register_static (g_intern_static_string ("HklDetectorType"), values);
+    }
+    return etype;
+}
+
+#define __HKL_TYPE_BUILTINS_C__
+
+/* Generated data ends here */
+
diff --git a/hkl/hkl-type-builtins.c.template b/hkl/hkl-type-builtins.c.template
new file mode 100644
index 0000000..8028ea4
--- /dev/null
+++ b/hkl/hkl-type-builtins.c.template
@@ -0,0 +1,38 @@
+/*** BEGIN file-header ***/
+#undef HKL_DISABLE_DEPRECATED
+#define HKL_ENABLE_BROKEN
+#include <glib-object.h>
+#include "hkl.h"
+#include "hkl-type-builtins.h"
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType
+ at enum_name@_get_type (void)
+{
+    static GType etype = 0;
+    if (G_UNLIKELY(etype == 0)) {
+        static const G at Type@Value values[] = {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+            { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+            { 0, NULL, NULL }
+        };
+        etype = g_ at type@_register_static (g_intern_static_string ("@EnumName@"), values);
+    }
+    return etype;
+}
+
+/*** END value-tail ***/
+
+/*** BEGIN file-tail ***/
+#define __HKL_TYPE_BUILTINS_C__
+/*** END file-tail ***/
diff --git a/hkl/hkl-type-builtins.h b/hkl/hkl-type-builtins.h
new file mode 100644
index 0000000..e8e7c9b
--- /dev/null
+++ b/hkl/hkl-type-builtins.h
@@ -0,0 +1,19 @@
+
+/* Generated data (by glib-mkenums) */
+
+#ifndef __HKL_TYPE_BUILTINS_H__
+#define __HKL_TYPE_BUILTINS_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* enumerations from "../hkl.h" */
+HKLAPI GType hkl_detector_type_get_type (void) G_GNUC_CONST;
+#define HKL_TYPE_DETECTOR_TYPE (hkl_detector_type_get_type ())
+G_END_DECLS
+
+#endif /* __HKL_TYPE_BUILTINS_H__ */
+
+/* Generated data ends here */
+
diff --git a/hkl/hkl-type-builtins.h.template b/hkl/hkl-type-builtins.h.template
new file mode 100644
index 0000000..b256013
--- /dev/null
+++ b/hkl/hkl-type-builtins.h.template
@@ -0,0 +1,24 @@
+/*** BEGIN file-header ***/
+#ifndef __HKL_TYPE_BUILTINS_H__
+#define __HKL_TYPE_BUILTINS_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+HKLAPI GType @enum_name at _get_type (void) G_GNUC_CONST;
+#define @ENUMPREFIX at _TYPE_@ENUMSHORT@ (@enum_name at _get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* __HKL_TYPE_BUILTINS_H__ */
+/*** END file-tail ***/
diff --git a/hkl/hkl-types.c b/hkl/hkl-types.c
new file mode 100644
index 0000000..02890e7
--- /dev/null
+++ b/hkl/hkl-types.c
@@ -0,0 +1,253 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2011-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl-detector-private.h"
+#include "hkl-error-private.h"
+#include "hkl-lattice-private.h"
+#include "hkl-pseudoaxis-private.h"
+#include "hkl-sample-private.h"
+#include "hkl-types.h"
+
+GType hkl_error_get_type (void) {
+        static volatile gsize hkl_error_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_error_type_id__volatile)) {
+                GType hkl_error_type_id;
+                hkl_error_type_id = g_boxed_type_register_static ("HklError",
+								  (GBoxedCopyFunc) hkl_error_new_copy,
+								  (GBoxedFreeFunc) hkl_error_free);
+                g_once_init_leave (&hkl_error_type_id__volatile, hkl_error_type_id);
+        }
+        return hkl_error_type_id__volatile;
+}
+
+GType hkl_vector_get_type (void) {
+        static volatile gsize hkl_vector_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_vector_type_id__volatile)) {
+                GType hkl_vector_type_id;
+                hkl_vector_type_id = g_boxed_type_register_static ("HklVector",
+								   (GBoxedCopyFunc) hkl_vector_dup,
+								   (GBoxedFreeFunc) hkl_vector_free);
+                g_once_init_leave (&hkl_vector_type_id__volatile, hkl_vector_type_id);
+        }
+        return hkl_vector_type_id__volatile;
+}
+
+GType hkl_matrix_get_type (void) {
+        static volatile gsize hkl_matrix_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_matrix_type_id__volatile)) {
+                GType hkl_matrix_type_id;
+                hkl_matrix_type_id = g_boxed_type_register_static ("HklMatrix",
+								   (GBoxedCopyFunc) hkl_matrix_dup,
+								   (GBoxedFreeFunc) hkl_matrix_free);
+                g_once_init_leave (&hkl_matrix_type_id__volatile, hkl_matrix_type_id);
+        }
+        return hkl_matrix_type_id__volatile;
+}
+
+GType hkl_unit_get_type (void) {
+        static volatile gsize hkl_unit_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_unit_type_id__volatile)) {
+                GType hkl_unit_type_id;
+                hkl_unit_type_id = g_boxed_type_register_static ("HklUnit",
+								 (GBoxedCopyFunc) hkl_unit_dup,
+								 (GBoxedFreeFunc) hkl_unit_free);
+                g_once_init_leave (&hkl_unit_type_id__volatile, hkl_unit_type_id);
+        }
+        return hkl_unit_type_id__volatile;
+}
+
+GType hkl_parameter_get_type (void) {
+        static volatile gsize hkl_parameter_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_parameter_type_id__volatile)) {
+                GType hkl_parameter_type_id;
+                hkl_parameter_type_id = g_boxed_type_register_static ("HklParameter",
+								      (GBoxedCopyFunc) hkl_parameter_new_copy,
+								      (GBoxedFreeFunc) hkl_parameter_free);
+                g_once_init_leave (&hkl_parameter_type_id__volatile, hkl_parameter_type_id);
+        }
+        return hkl_parameter_type_id__volatile;
+}
+
+static HklEngine* hkl_parameter_list_fake_ref(HklEngine *src)
+{
+	return src;
+}
+
+static void hkl_parameter_list_fake_unref(HklEngine *src)
+{
+	return;
+}
+
+GType hkl_parameter_list_get_type (void) {
+        static volatile gsize hkl_parameter_list_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_parameter_list_type_id__volatile)) {
+                GType hkl_parameter_list_type_id;
+                hkl_parameter_list_type_id = g_boxed_type_register_static ("HklParameterList",
+									   (GBoxedCopyFunc) hkl_parameter_list_fake_ref,
+									   (GBoxedFreeFunc) hkl_parameter_list_fake_unref);
+                g_once_init_leave (&hkl_parameter_list_type_id__volatile, hkl_parameter_list_type_id);
+        }
+        return hkl_parameter_list_type_id__volatile;
+}
+
+GType hkl_axis_get_type (void) {
+        static volatile gsize hkl_axis_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_axis_type_id__volatile)) {
+                GType hkl_axis_type_id;
+                hkl_axis_type_id = g_boxed_type_register_static ("HklAxis",
+								 (GBoxedCopyFunc) hkl_parameter_new_copy,
+								 (GBoxedFreeFunc) hkl_parameter_free);
+                g_once_init_leave (&hkl_axis_type_id__volatile, hkl_axis_type_id);
+        }
+        return hkl_axis_type_id__volatile;
+}
+
+GType hkl_geometry_get_type (void) {
+        static volatile gsize hkl_geometry_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_geometry_type_id__volatile)) {
+                GType hkl_geometry_type_id;
+                hkl_geometry_type_id = g_boxed_type_register_static ("HklGeometry",
+								     (GBoxedCopyFunc) hkl_geometry_new_copy,
+								     (GBoxedFreeFunc) hkl_geometry_free);
+                g_once_init_leave (&hkl_geometry_type_id__volatile, hkl_geometry_type_id);
+        }
+        return hkl_geometry_type_id__volatile;
+}
+
+GType hkl_geometry_list_item_get_type (void) {
+        static volatile gsize hkl_geometry_list_item_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_geometry_list_item_type_id__volatile)) {
+                GType hkl_geometry_list_item_type_id;
+                hkl_geometry_list_item_type_id = g_boxed_type_register_static ("HklGeometryListItem",
+									       (GBoxedCopyFunc) hkl_geometry_list_item_new_copy,
+									       (GBoxedFreeFunc) hkl_geometry_list_item_free);
+                g_once_init_leave (&hkl_geometry_list_item_type_id__volatile, hkl_geometry_list_item_type_id);
+        }
+        return hkl_geometry_list_item_type_id__volatile;
+}
+
+GType hkl_geometry_list_get_type (void) {
+        static volatile gsize hkl_geometry_list_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_geometry_list_type_id__volatile)) {
+                GType hkl_geometry_list_type_id;
+                hkl_geometry_list_type_id = g_boxed_type_register_static ("HklGeometryList",
+									  (GBoxedCopyFunc) hkl_geometry_list_new_copy,
+									  (GBoxedFreeFunc) hkl_geometry_list_free);
+                g_once_init_leave (&hkl_geometry_list_type_id__volatile, hkl_geometry_list_type_id);
+        }
+        return hkl_geometry_list_type_id__volatile;
+}
+
+GType hkl_detector_get_type (void) {
+        static volatile gsize hkl_detector_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_detector_type_id__volatile)) {
+                GType hkl_detector_type_id;
+                hkl_detector_type_id = g_boxed_type_register_static ("HklDetector",
+								     (GBoxedCopyFunc) hkl_detector_new_copy,
+								     (GBoxedFreeFunc) hkl_detector_free);
+                g_once_init_leave (&hkl_detector_type_id__volatile, hkl_detector_type_id);
+        }
+        return hkl_detector_type_id__volatile;
+}
+
+GType hkl_lattice_get_type (void) {
+        static volatile gsize hkl_lattice_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_lattice_type_id__volatile)) {
+                GType hkl_lattice_type_id;
+                hkl_lattice_type_id = g_boxed_type_register_static ("HklLattice",
+								    (GBoxedCopyFunc) hkl_lattice_new_copy,
+								    (GBoxedFreeFunc) hkl_lattice_free);
+                g_once_init_leave (&hkl_lattice_type_id__volatile, hkl_lattice_type_id);
+        }
+        return hkl_lattice_type_id__volatile;
+}
+
+GType hkl_sample_reflection_get_type (void) {
+        static volatile gsize hkl_sample_reflection_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_sample_reflection_type_id__volatile)) {
+                GType hkl_sample_reflection_type_id;
+                hkl_sample_reflection_type_id = g_boxed_type_register_static ("HklSampleReflection",
+									      (GBoxedCopyFunc) hkl_sample_reflection_new_copy,
+									      (GBoxedFreeFunc) hkl_sample_reflection_free);
+                g_once_init_leave (&hkl_sample_reflection_type_id__volatile, hkl_sample_reflection_type_id);
+        }
+        return hkl_sample_reflection_type_id__volatile;
+}
+
+GType hkl_sample_get_type (void) {
+        static volatile gsize hkl_sample_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_sample_type_id__volatile)) {
+                GType hkl_sample_type_id;
+                hkl_sample_type_id = g_boxed_type_register_static ("HklSample",
+								   (GBoxedCopyFunc) hkl_sample_new_copy,
+								   (GBoxedFreeFunc) hkl_sample_free);
+                g_once_init_leave (&hkl_sample_type_id__volatile, hkl_sample_type_id);
+        }
+        return hkl_sample_type_id__volatile;
+}
+
+GType hkl_pseudo_axis_get_type (void) {
+        static volatile gsize hkl_pseudo_axis_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_pseudo_axis_type_id__volatile)) {
+                GType hkl_pseudo_axis_type_id;
+                hkl_pseudo_axis_type_id = g_boxed_type_register_static ("HklPseudoAxis",
+									(GBoxedCopyFunc) hkl_parameter_new_copy,
+									(GBoxedFreeFunc) hkl_parameter_free);
+                g_once_init_leave (&hkl_pseudo_axis_type_id__volatile, hkl_pseudo_axis_type_id);
+        }
+        return hkl_pseudo_axis_type_id__volatile;
+}
+
+static HklEngine* hkl_engine_fake_ref(HklEngine *src)
+{
+	return src;
+}
+
+static void hkl_engine_fake_unref(HklEngine *src)
+{
+	return;
+}
+
+GType hkl_engine_get_type (void) {
+        static volatile gsize hkl_engine_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_engine_type_id__volatile)) {
+                GType hkl_engine_type_id;
+                hkl_engine_type_id = g_boxed_type_register_static (
+			"HklEngine",
+			(GBoxedCopyFunc) hkl_engine_fake_ref,
+			(GBoxedFreeFunc) hkl_engine_fake_unref);
+                g_once_init_leave (&hkl_engine_type_id__volatile, hkl_engine_type_id);
+        }
+        return hkl_engine_type_id__volatile;
+}
+
+GType hkl_engine_list_get_type (void) {
+        static volatile gsize hkl_engine_list_type_id__volatile = 0;
+        if (g_once_init_enter (&hkl_engine_list_type_id__volatile)) {
+                GType hkl_engine_list_type_id;
+                hkl_engine_list_type_id = g_boxed_type_register_static (
+			"HklEngineList",
+			(GBoxedCopyFunc) hkl_engine_list_new_copy,
+			(GBoxedFreeFunc) hkl_engine_list_free);
+                g_once_init_leave (&hkl_engine_list_type_id__volatile, hkl_engine_list_type_id);
+        }
+        return hkl_engine_list_type_id__volatile;
+}
diff --git a/hkl/hkl-types.h b/hkl/hkl-types.h
new file mode 100644
index 0000000..d22f91c
--- /dev/null
+++ b/hkl/hkl-types.h
@@ -0,0 +1,85 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#ifndef __HKL_GLIB_H__
+#define __HKL_GLIB_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "hkl.h"
+
+G_BEGIN_DECLS
+
+#define TYPE_HKL_ERROR (hkl_error_get_type ())
+HKLAPI GType hkl_error_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_VECTOR (hkl_vector_get_type ())
+HKLAPI GType hkl_vector_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_MATRIX (hkl_matrix_get_type ())
+HKLAPI GType hkl_matrix_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_UNIT (hkl_unit_get_type ())
+HKLAPI GType hkl_unit_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_PARAMETER (hkl_parameter_get_type ())
+HKLAPI GType hkl_parameter_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_PARAMETER_LIST (hkl_parameter_list_get_type ())
+HKLAPI GType hkl_parameter_list_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_AXIS (hkl_axis_get_type ())
+HKLAPI GType hkl_axis_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_GEOMETRY (hkl_geometry_get_type ())
+HKLAPI GType hkl_geometry_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_GEOMETRY_LIST_ITEM (hkl_geometry_list_item_get_type ())
+HKLAPI GType hkl_geometry_list_item_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_GEOMETRY_LIST (hkl_geometry_list_get_type ())
+HKLAPI GType hkl_geometry_list_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_DETECTOR (hkl_detector_get_type ())
+HKLAPI GType hkl_detector_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_LATTICE (hkl_lattice_get_type ())
+HKLAPI GType hkl_lattice_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_SAMPLE_REFLECTION (hkl_sample_reflection_get_type ())
+HKLAPI GType hkl_sample_reflection_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_SAMPLE (hkl_sample_get_type ())
+HKLAPI GType hkl_sample_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_PSEUDO_AXIS (hkl_pseudo_axis_get_type ())
+HKLAPI GType hkl_pseudo_axis_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_ENGINE (hkl_engine_get_type ())
+HKLAPI GType hkl_engine_get_type (void) G_GNUC_CONST;
+
+#define TYPE_HKL_ENGINE_LIST (hkl_engine_list_get_type ())
+HKLAPI GType hkl_engine_list_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif
diff --git a/hkl/hkl-unit.h b/hkl/hkl-unit-private.h
similarity index 74%
rename from hkl/hkl-unit.h
rename to hkl/hkl-unit-private.h
index 7df8bc5..96e5d80 100644
--- a/hkl/hkl-unit.h
+++ b/hkl/hkl-unit-private.h
@@ -13,29 +13,27 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_UNIT_H__
-#define __HKL_UNIT_H__
+#ifndef __HKL_UNIT_PRIVATE_H__
+#define __HKL_UNIT_PRIVATE_H__
 
-#include <hkl/hkl-macros.h>
+#include "hkl.h"
 
 HKL_BEGIN_DECLS
 
 typedef struct _HklUnit HklUnit;
 
-enum _HklUnitType
+typedef enum _HklUnitType /*< unit,prefix=HKL >*/
 {
 	HKL_UNIT_ANGLE_DEG,
 	HKL_UNIT_ANGLE_RAD,
 	HKL_UNIT_LENGTH_NM
-};
-
-typedef enum _HklUnitType HklUnitType;
+} HklUnitType;
 
 struct _HklUnit
 {
@@ -45,13 +43,16 @@ struct _HklUnit
 };
 
 static HklUnit const hkl_unit_angle_deg = {HKL_UNIT_ANGLE_DEG, "Degree", "°"};
-static HklUnit const hkl_unit_angle_rad = {HKL_UNIT_ANGLE_RAD, "Radian", ""};
+static HklUnit const hkl_unit_angle_rad = {HKL_UNIT_ANGLE_RAD, "Radian", "rad"};
 static HklUnit const hkl_unit_length_nm = {HKL_UNIT_LENGTH_NM, "Nano Meter", "nm"};
 
-extern int hkl_unit_compatible(HklUnit const *self, HklUnit const *unit);
+extern HklUnit *hkl_unit_dup(const HklUnit *self);
+extern void hkl_unit_free(HklUnit *self);
+
+extern int hkl_unit_compatible(const HklUnit *self, const HklUnit *unit);
 
-extern double hkl_unit_factor(HklUnit const *self, HklUnit const *unit);
+extern double hkl_unit_factor(const HklUnit *self, const HklUnit *unit);
 
 HKL_END_DECLS
 
-#endif /* __HKL_UNIT_H__ */
+#endif /* __HKL_UNIT_PRIVATE_H__ */
diff --git a/hkl/hkl-unit.c b/hkl/hkl-unit.c
index 9e5c911..ff0014a 100644
--- a/hkl/hkl-unit.c
+++ b/hkl/hkl-unit.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -22,9 +22,52 @@
 #include <math.h>
 #include <gsl/gsl_nan.h>
 #include <gsl/gsl_sys.h> /* gsl_nan()! */
-#include <hkl/hkl-unit.h>
 
-int hkl_unit_compatible(HklUnit const *self, HklUnit const * unit)
+#include "hkl-macros-private.h"
+#include "hkl-unit-private.h"
+
+/**
+ * hkl_unit_dup: (skip)
+ * @self:
+ *
+ * copy an #Hklunit
+ *
+ * Returns: the copied #HklUnit (memory must be release with
+ * hkl_unit_free)
+ **/
+HklUnit* hkl_unit_dup(const HklUnit *self)
+{
+	if (!self)
+		return NULL;
+
+	HklUnit *dup = HKL_MALLOC(HklUnit);
+	*dup = *self;
+
+	return dup;
+}
+
+/**
+ * hkl_unit_free: (skip)
+ * @self:
+ *
+ * release the memory of an #HklUnit
+ **/
+void hkl_unit_free(HklUnit *self)
+{
+	if (self)
+		free(self);
+}
+
+/**
+ * hkl_unit_compatible: (skip)
+ * @self: the first @HklUnit
+ * @unit: the second @HklUnit to check
+ *
+ * check if two units are compatible.
+ *
+ * Returns: HKL_TRUE or HKL_FALSE
+ **/
+int hkl_unit_compatible(const HklUnit *self, const HklUnit *unit)
 {
 	int res = HKL_TRUE;
 	if (self && unit){
@@ -62,7 +105,17 @@ int hkl_unit_compatible(HklUnit const *self, HklUnit const * unit)
 	return res;
 }
 
-double hkl_unit_factor(HklUnit const *self, HklUnit const *unit)
+/**
+ * hkl_unit_factor:
+ * @self:
+ * @unit:
+ *
+ * compute the factor to convert from one @Hklunit to another one.
+ * @self * factor =  @unit
+ *
+ * Returns: the factor of the conversion.
+ **/
+double hkl_unit_factor(const HklUnit *self, const HklUnit *unit)
 {
 	double factor = 1.;
 
diff --git a/hkl/hkl-vector.h b/hkl/hkl-vector-private.h
similarity index 79%
rename from hkl/hkl-vector.h
rename to hkl/hkl-vector-private.h
index 6ad3ec2..17b5754 100644
--- a/hkl/hkl-vector.h
+++ b/hkl/hkl-vector-private.h
@@ -13,33 +13,43 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_VECTOR_H__
-#define __HKL_VECTOR_H__
+#ifndef __HKL_VECTOR_PRIVATE_H__
+#define __HKL_VECTOR_PRIVATE_H__
 
 #include <stdio.h>
 #include <math.h>
-#include <hkl/hkl-macros.h>
+
+#include "hkl.h"
 
 HKL_BEGIN_DECLS
 
 /* forward declaration begin */
-typedef struct _HklMatrix HklMatrix;
 typedef struct _HklQuaternion HklQuaternion;
 /* forward declaration end */
 
 typedef struct _HklVector HklVector;
 
+/**
+ * HklVector:
+ * @data: (skip): contain the vector data
+
+ *  A struct containing a 3D space coordinates.
+ **/
 struct _HklVector
 {
 	double data[3];
 };
 
+HklVector* hkl_vector_dup(const HklVector* self);
+
+void hkl_vector_free(HklVector* self);
+
 extern void hkl_vector_init(HklVector *self, double x, double y, double z);
 
 extern void hkl_vector_fprintf(FILE *file, const HklVector *self);
@@ -76,6 +86,11 @@ extern double hkl_vector_oriented_angle(const HklVector *self,
 					const HklVector *vector,
 					const HklVector *ref);
 
+extern double hkl_vector_oriented_angle_points(const HklVector *self,
+					       const HklVector *p2,
+					       const HklVector *p3,
+					       const HklVector *ref);
+
 extern double hkl_vector_norm2(const HklVector *self);
 
 extern int hkl_vector_normalize(HklVector *self);
@@ -99,10 +114,17 @@ extern void hkl_vector_rotated_around_vector(HklVector *self,
 extern void hkl_vector_rotated_quaternion(HklVector *self,
 					  const HklQuaternion *qr);
 
+extern void hkl_vector_rotated_around_line(HklVector *self, double angle,
+					   const HklVector *c1, const HklVector *c2);
+
 extern int hkl_vector_is_null(const HklVector *self);
 
 extern void hkl_vector_project_on_plan(HklVector *self,
-				       const HklVector *plan);
+				       const HklVector *normal);
+
+extern void hkl_vector_project_on_plan_with_point(HklVector *self,
+						  const HklVector *normal,
+						  const HklVector *point);
 
 HKL_END_DECLS
 
diff --git a/hkl/hkl-vector.c b/hkl/hkl-vector.c
index 908c7da..4a55123 100644
--- a/hkl/hkl-vector.c
+++ b/hkl/hkl-vector.c
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
@@ -24,9 +24,36 @@
 
 #include <gsl/gsl_math.h>
 
-#include <hkl/hkl-vector.h>
-#include <hkl/hkl-matrix.h>
-#include <hkl/hkl-quaternion.h>
+#include "hkl-vector-private.h"
+#include "hkl-macros-private.h"
+#include "hkl-matrix-private.h"
+#include "hkl-quaternion-private.h"
+
+/**
+ * hkl_vector_dup: (skip)
+ * @self: the HklVector to copy
+ *
+ * Copy an HklVector
+ *
+ * Returns: A copy of self which need to be free using hkl_vector_free
+ **/
+HklVector* hkl_vector_dup (const HklVector* self) {
+        HklVector* dup;
+
+	dup = HKL_MALLOC(HklVector);
+        memcpy(dup, self, sizeof (HklVector));
+        return dup;
+}
+
+/**
+ * hkl_vector_free: (skip)
+ * @self:
+ *
+ * delete an HklVector struct
+ **/
+void hkl_vector_free (HklVector* self) {
+	free(self);
+}
 
 /**
  * hkl_vector_init:
@@ -45,7 +72,7 @@ void hkl_vector_init(HklVector *self, double x, double y, double z)
 }
 
 /**
- * hkl_vector_fprintf:
+ * hkl_vector_fprintf: (skip)
  * @file: the stream to print into
  * @self: the #HklVector to print.
  *
@@ -57,7 +84,7 @@ void hkl_vector_fprintf(FILE *file, const HklVector *self)
 }
 
 /**
- * hkl_vector_cmp:
+ * hkl_vector_cmp: (skip)
  * @self: the first vector
  * @vector: th vector to compare with
  *
@@ -76,7 +103,15 @@ int hkl_vector_cmp(const HklVector *self, const HklVector *vector)
 	return HKL_FALSE;
 }
 
-/**not yet used*/
+/**
+ * hkl_vector_is_opposite: (skip)
+ * @self:
+ * @vector:
+ *
+ * Check if two vectors are oposite.
+ *
+ * Returns: HKL_TRUE is vector are oposite vectors.
+ **/
 int hkl_vector_is_opposite(const HklVector *self, const HklVector *vector)
 {
 	unsigned int i;
@@ -88,7 +123,7 @@ int hkl_vector_is_opposite(const HklVector *self, const HklVector *vector)
 }
 
 /**
- * hkl_vector_add_vector:
+ * hkl_vector_add_vector: (skip)
  * @self: the modified #HklVector
  * @vector: the #hklvector to add
  *
@@ -102,7 +137,7 @@ void hkl_vector_add_vector(HklVector *self, const HklVector *vector)
 }
 
 /**
- * hkl_vector_minus_vector:
+ * hkl_vector_minus_vector: (skip)
  * @self: the modified #HklVector
  * @vector: the #hklvector to substract
  *
@@ -116,7 +151,7 @@ void hkl_vector_minus_vector(HklVector *self, const HklVector *vector)
 }
 
 /**
- * hkl_vector_div_double:
+ * hkl_vector_div_double: (skip)
  * @self: the #HklVector to divide.
  * @d: constant use to divide the #HklVector
  *
@@ -130,7 +165,7 @@ void hkl_vector_div_double(HklVector *self, const double d)
 }
 
 /**
- * hkl_vector_times_double:
+ * hkl_vector_times_double: (skip)
  * @self: the #HklVector to modify
  * @d: the multiply factor
  *
@@ -144,7 +179,7 @@ void hkl_vector_times_double(HklVector *self, const double d)
 }
 
 /**
- * hkl_vector_times_vector:
+ * hkl_vector_times_vector: (skip)
  * @self: the #HklVector to modify
  * @vector: the #HklVector use to modify the first one
  *
@@ -159,7 +194,7 @@ void hkl_vector_times_vector(HklVector *self, const HklVector *vector)
 }
 
 /**
- * hkl_vector_times_smatrix:
+ * hkl_vector_times_matrix: (skip)
  * @self: the #HklVector to multiply
  * @m: the #HklMatrix use to multiply the #HklVector
  *
@@ -177,7 +212,7 @@ void hkl_vector_times_matrix(HklVector *self, const HklMatrix *m)
 }
 
 /**
- * hkl_vector_sum:
+ * hkl_vector_sum: (skip)
  * @self: the #HklVector to sum.
  *
  * compute the #HklVector sum of all its elements.
@@ -190,7 +225,7 @@ double hkl_vector_sum(const HklVector *self)
 }
 
 /**
- * hkl_vector_scalar_product:
+ * hkl_vector_scalar_product: (skip)
  * @self: the first #HklVector
  * @vector: the second #HklVector
  *
@@ -209,7 +244,7 @@ double hkl_vector_scalar_product(const HklVector *self, const HklVector *vector)
 }
 
 /**
- * hkl_vector_vectorial_product:
+ * hkl_vector_vectorial_product: (skip)
  * @self: the first #HklVector (modify)
  * @vector: the second #HklVector
  *
@@ -227,7 +262,7 @@ void hkl_vector_vectorial_product(HklVector *self, const HklVector *vector)
 
 
 /**
- * hkl_vector_angle:
+ * hkl_vector_angle: (skip)
  * @self: the fist #HklVector
  * @vector: the second #HklVector
  *
@@ -246,8 +281,8 @@ double hkl_vector_angle(const HklVector *self, const HklVector *vector)
 	norm_self = hkl_vector_norm2(self);
 	norm_vector = hkl_vector_norm2(vector);
 
-	if(norm_self < HKL_EPSILON || norm_vector < HKL_EPSILON)
-		return GSL_NAN;
+	if (norm_self < HKL_EPSILON || norm_vector < HKL_EPSILON)
+		return 0.0;
 
 	norm = norm_self * norm_vector;
 
@@ -265,7 +300,7 @@ double hkl_vector_angle(const HklVector *self, const HklVector *vector)
 }
 
 /**
- * hkl_vector_oriented_angle:
+ * hkl_vector_oriented_angle: (skip)
  * @self: the first #HklVector
  * @vector: the second #HklVector
  * @ref: the reference #HklVector
@@ -295,9 +330,37 @@ double hkl_vector_oriented_angle(const HklVector *self,
 		angle = -angle;
 	return angle;
 }
+/**
+ * hkl_vector_oriented_angle_points: (skip)
+ * @self: the first point
+ * @p2: the second point
+ * @p3: the third point
+ * @ref: the reference #HklVector
+ *
+ * compute the angles beetween three points (p1, p2, p3) and use
+ * a reference #HklVector to orientate the space. That's
+ * way the return value can be in beetween [-pi, pi].
+ * the (self, vector, ref) is a right oriented base.
+ *
+ * Returns: the angles [-pi, pi]
+ **/
+double hkl_vector_oriented_angle_points(const HklVector *self,
+					const HklVector *p2,
+					const HklVector *p3,
+					const HklVector *ref)
+{
+	HklVector v1;
+	HklVector v2;
+
+	v1 = *self;
+	v2 = *p3;
+	hkl_vector_minus_vector(&v1, p2);
+	hkl_vector_minus_vector(&v2, p2);
+	return hkl_vector_oriented_angle(&v1, &v2, ref);
+}
 
 /**
- * hkl_vector_normalize:
+ * hkl_vector_normalize: (skip)
  * @self: the #HklVector to normalize
  *
  * normalize a hkl_vector
@@ -306,20 +369,17 @@ double hkl_vector_oriented_angle(const HklVector *self,
  **/
 int hkl_vector_normalize(HklVector *self)
 {
-	int status = HKL_FAIL;
-
 	double norm = hkl_vector_norm2(self);
-	if ( norm > HKL_EPSILON )
-	{
-		hkl_vector_div_double(self, norm);
-		status = HKL_SUCCESS;
-	}
+	if ( norm <= HKL_EPSILON )
+		return HKL_FALSE;
+
+	hkl_vector_div_double(self, norm);
 
-	return status;
+	return HKL_TRUE;
 }
 
 /**
- * hkl_vector_is_colinear:
+ * hkl_vector_is_colinear: (skip)
  * @self: the first #HklVector
  * @vector: the second #HklVector
  *
@@ -341,12 +401,12 @@ int hkl_vector_is_colinear(const HklVector *self, const HklVector *vector)
 
 
 /**
- * hkl_vector_randomize:
+ * hkl_vector_randomize: (skip)
  * @self: the #HklVector to randomize
  *
  * initialize a vector with random values.
  * coordinates range [-1, 1]
- **/
+ */
 void hkl_vector_randomize(HklVector *self)
 {
 	self->data[0] = -1 + 2 *rand()/(RAND_MAX+1.0);
@@ -355,7 +415,7 @@ void hkl_vector_randomize(HklVector *self)
 }
 
 /**
- * hkl_vector_randomize_vector:
+ * hkl_vector_randomize_vector: (skip)
  * @self: the #HklVector to randomize
  * @vector: the #HklVector result to avoid
  *
@@ -370,14 +430,14 @@ void hkl_vector_randomize_vector(HklVector *self, const HklVector *vector)
 }
 
 /**
- * hkl_vector_randomize_vector_vector:
+ * hkl_vector_randomize_vector_vector: (skip)
  * @self: the #HklVector to randomize
  * @vector1: the first #HklVector solution to avoid
  * @vector2: the second #HklVector solution to avoid
  *
  * randomize an #HklVector an be sure that it is not equal
  * to the #HklVector vector1 and vector2.
- * 
+ *
  **/
 void hkl_vector_randomize_vector_vector(HklVector *self,
 					const HklVector *vector1,
@@ -389,7 +449,7 @@ void hkl_vector_randomize_vector_vector(HklVector *self,
 }
 
 /**
- * hkl_vector_rotated_around_vector:
+ * hkl_vector_rotated_around_vector: (skip)
  * @self: the #HklVector to rotate
  * @axe: the axe of rotation
  * @angle: the angle of the rotation
@@ -423,7 +483,7 @@ void hkl_vector_rotated_around_vector(HklVector *self,
 }
 
 /**
- * hkl_vector_norm2:
+ * hkl_vector_norm2: (skip)
  * @self: the #hklvector use to compute the norm2
  *
  * compute the norm2 of an #HklVector
@@ -438,7 +498,7 @@ double hkl_vector_norm2(const HklVector *self)
 }
 
 /**
- * hkl_vector_rotated_quaternion:
+ * hkl_vector_rotated_quaternion: (skip)
  * @self: the #HklVector to rotate
  * @qr: the #HklQuaternion use to rotate the vector
  *
@@ -470,7 +530,35 @@ void hkl_vector_rotated_quaternion(HklVector *self, const HklQuaternion *qr)
 }
 
 /**
- * hkl_vector_is_null:
+ * hkl_vector_rotated_around_line: (skip)
+ * @self: the point to rotate around a line
+ * @angle: the angle of the rotation
+ * @c1: the fist point of the line
+ * @c2: the second point of the line
+ *
+ * This method rotate a point around a line defined by two points
+ * of a certain amount of angle. The rotation is right handed.
+ * this mean that c2 - c1 gives the direction of the rotation.
+ **/
+void hkl_vector_rotated_around_line(HklVector *self, double angle,
+				    const HklVector *c1, const HklVector *c2)
+{
+	HklVector axis;
+
+	if (!self || !c1 || !c2 || fabs(angle) < HKL_EPSILON)
+		return;
+
+	axis = *c2;
+	hkl_vector_minus_vector(&axis, c1);
+	/* the c2 - c1 vector must be non null */
+
+	hkl_vector_minus_vector(self, c1);
+	hkl_vector_rotated_around_vector(self, &axis, angle);
+	hkl_vector_add_vector(self, c1);
+}
+
+/**
+ * hkl_vector_is_null: (skip)
  * @self: the #hklvector to check
  *
  * check if all the coordinates of an #HklVector are null.
@@ -489,21 +577,50 @@ int hkl_vector_is_null(const HklVector *self)
 }
 
 /**
- * hkl_vector_project_on_plan:
- * @self: the vector to project (modify)
- * @plan: the normal of the plane.
+ * hkl_vector_project_on_plan: (skip)
+ * @self: the vector to project
+ * @normal: the normal of the plane.
  *
- * project an #HklVector on a plan.
+ * project an #HklVector on a plan of normal which contain
+ * the origin [0, 0, 0]
  *
- * @todo test
  **/
 void hkl_vector_project_on_plan(HklVector *self,
-				const HklVector *plan)
+				const HklVector *normal)
 {
 	HklVector tmp;
 
-	tmp = *plan;
+	if(!self || !normal)
+		return;
+
+	tmp = *normal;
 	hkl_vector_normalize(&tmp);
 	hkl_vector_times_double(&tmp, hkl_vector_scalar_product(self, &tmp));
 	hkl_vector_minus_vector(self, &tmp);
 }
+
+/**
+ * hkl_vector_project_on_plan_with_point: (skip)
+ * @self: the vector to project (modify)
+ * @normal: the normal of the plane.
+ * @point: a point of the plan.
+ *
+ * project an #HklVector on a plan of normal #normal which contain #point.
+ **/
+void hkl_vector_project_on_plan_with_point(HklVector *self,
+					   const HklVector *normal,
+					   const HklVector *point)
+{
+	HklVector tmp;
+	double d1, d2;
+
+	if(!self || !normal || !point)
+		return;
+
+	tmp = *normal;
+	hkl_vector_normalize(&tmp);
+	d1 = hkl_vector_scalar_product(self, &tmp);
+	d2 = hkl_vector_scalar_product(point, &tmp);
+	hkl_vector_times_double(&tmp, d1 - d2);
+	hkl_vector_minus_vector(self, &tmp);
+}
diff --git a/hkl.pc.in b/hkl3d.pc.in
similarity index 66%
copy from hkl.pc.in
copy to hkl3d.pc.in
index 89c654f..46130fd 100644
--- a/hkl.pc.in
+++ b/hkl3d.pc.in
@@ -3,11 +3,10 @@ exec_prefix=${prefix}
 libdir=${exec_prefix}/lib
 includedir=${prefix}/include
 
-Name: hkl
+Name: hkl3d
 Description: Library for hkl Diffractometer computation
 Version: @VERSION@
-URL: http://repo.or.cz/w/hkl.git
-Requires: gsl
-Libs: -L${libdir} -lhkl
-Libs.private: -lm
+Requires: hkl libg3d
+URL: http://repo.or.cz/w/hkl3d.git
+Libs: -L${libdir} -lhkl3d
 Cflags: -I${includedir}
diff --git a/hkl3d/Makefile.am b/hkl3d/Makefile.am
new file mode 100644
index 0000000..1c24a89
--- /dev/null
+++ b/hkl3d/Makefile.am
@@ -0,0 +1,41 @@
+
+# Process this file with automake to produce Makefile.in
+SUBDIRS = bullet
+
+AM_CXXFLAGS = \
+	-fpermissive \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/hkl \
+	-I$(top_srcdir)/hkl3d \
+	-I$(top_srcdir)/hkl3d/bullet/src\
+	-DPKGDATA=\""$(pkgdatadir)"\" \
+	$(G3D_CFLAGS)\
+	$(YAML_CFLAGS)
+
+AM_LDFLAGS = -version-info 0:0:0 \
+	$(G3D_LIBS)\
+	$(YAML_LIBS)
+
+lib_LTLIBRARIES = \
+	libhkl3d.la
+
+include_HEADERS = hkl3d.h
+
+libhkl3d_la_SOURCES = hkl3d.cpp
+
+libhkl3d_la_LIBADD = \
+	$(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletmath.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletcollision.la
+
+if CONDITIONAL_BUILD_MULTITHREADED
+AM_CXXFLAGS += -DUSE_PARALLEL_DISPATCHER=1
+libhkl3d_la_LIBADD += $(top_builddir)/hkl3d/bullet/src/libbulletmultithreaded.la
+endif
+
+# Support for GNU Flymake, in Emacs.
+check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
+check-syntax:
+	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
+
+.PHONY: check-syntax
diff --git a/hkl3d/Makefile.in b/hkl3d/Makefile.in
new file mode 100644
index 0000000..fb87ceb
--- /dev/null
+++ b/hkl3d/Makefile.in
@@ -0,0 +1,847 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am__append_1 = -DUSE_PARALLEL_DISPATCHER=1
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am__append_2 = $(top_builddir)/hkl3d/bullet/src/libbulletmultithreaded.la
+subdir = hkl3d
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/depcomp $(include_HEADERS)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libhkl3d_la_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletmath.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletcollision.la \
+	$(am__append_2)
+am_libhkl3d_la_OBJECTS = hkl3d.lo
+libhkl3d_la_OBJECTS = $(am_libhkl3d_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_ at AM_V@)
+am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
+SOURCES = $(libhkl3d_la_SOURCES)
+DIST_SOURCES = $(libhkl3d_la_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+HEADERS = $(include_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+
+# Process this file with automake to produce Makefile.in
+SUBDIRS = bullet
+AM_CXXFLAGS = -fpermissive -I$(top_srcdir) -I$(top_srcdir)/hkl \
+	-I$(top_srcdir)/hkl3d -I$(top_srcdir)/hkl3d/bullet/src \
+	-DPKGDATA=\""$(pkgdatadir)"\" $(G3D_CFLAGS) $(YAML_CFLAGS) \
+	$(am__append_1)
+AM_LDFLAGS = -version-info 0:0:0 \
+	$(G3D_LIBS)\
+	$(YAML_LIBS)
+
+lib_LTLIBRARIES = \
+	libhkl3d.la
+
+include_HEADERS = hkl3d.h
+libhkl3d_la_SOURCES = hkl3d.cpp
+libhkl3d_la_LIBADD = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletmath.la \
+	$(top_builddir)/hkl3d/bullet/src/libbulletcollision.la \
+	$(am__append_2)
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu hkl3d/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu hkl3d/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libhkl3d.la: $(libhkl3d_la_OBJECTS) $(libhkl3d_la_DEPENDENCIES) $(EXTRA_libhkl3d_la_DEPENDENCIES) 
+	$(AM_V_CXXLD)$(CXXLINK) -rpath $(libdir) $(libhkl3d_la_OBJECTS) $(libhkl3d_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-includeHEADERS: $(include_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+	done
+
+uninstall-includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-includeHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libLTLIBRARIES \
+	clean-libtool cscopelist-am ctags ctags-am distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-includeHEADERS install-info \
+	install-info-am install-libLTLIBRARIES install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-includeHEADERS uninstall-libLTLIBRARIES
+
+
+# Support for GNU Flymake, in Emacs.
+check-syntax: AM_CXXFLAGS += -fsyntax-only -pipe
+check-syntax:
+	test -z "$(CHK_SOURCES)" || $(CXXCOMPILE) $(CHK_SOURCES)
+
+.PHONY: check-syntax
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/hkl3d/bullet/AUTHORS b/hkl3d/bullet/AUTHORS
new file mode 100644
index 0000000..f2cc86d
--- /dev/null
+++ b/hkl3d/bullet/AUTHORS
@@ -0,0 +1,22 @@
+
+Bullet Physics Library is an open source project with help from the community at the Physics Forum
+See the forum at http://bulletphysics.com
+
+The project was started by Erwin Coumans
+
+Following people contributed to Bullet
+(random order, please let us know on the forum if your name should be in this list)
+
+Gino van den Bergen: LinearMath classes
+Christer Ericson: parts of the voronoi simplex solver
+Simon Hobbs: 3d axis sweep and prune, Extras/SATCollision, separating axis theorem + SIMD code
+Dirk Gregorius: generic D6 constraint
+Erin Catto: accumulated impulse in sequential impulse
+Nathanael Presson: EPA penetration depth calculation
+Francisco Leon: GIMPACT Concave Concave collision
+Joerg Henrichs: make buildsystem (work in progress)
+Eric Sunshine: jam + msvcgen buildsystem
+Steve Baker: GPU physics and general implementation improvements
+Jay Lee: Double precision support
+KleMiX, aka Vsevolod Klementjev, managed version, rewritten in C# for XNA
+Erwin Coumans: most other source code
diff --git a/hkl3d/bullet/COPYING b/hkl3d/bullet/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/hkl3d/bullet/COPYING
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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 3 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, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/hkl3d/bullet/ChangeLog b/hkl3d/bullet/ChangeLog
new file mode 100644
index 0000000..1c10933
--- /dev/null
+++ b/hkl3d/bullet/ChangeLog
@@ -0,0 +1,755 @@
+Bullet Continuous Collision Detection and Physics Library
+Primary author and maintainer: Erwin Coumans
+
+This ChangeLog is incomplete, for an up-to-date list of all fixed issues see http://bullet.googlecode.com
+using http://tinyurl.com/yabmjjj
+
+
+2010 February
+	- Bullet 2.76 release, revision 2010
+	- support for the .bullet binary file format
+	- btInternalEdgeUtility to adjust unwanted collisions against internal triangle edges
+	- Improved Maya Dynamica plugin with better constraint authoring and .bullet file export
+
+
+2009 September 17
+	- Minor update to Bullet 2.75 release, revision 1776
+	- Support for btConvex2dShape, check out Bullet/Demos/Box2dDemo
+	- Fixes in build systems
+	- Minor fix in btGjkPairDetector
+	- Initialize world transform for btCollisionShape in constructor
+
+
+2009 September 6
+	- Bullet 2.75 release
+	- Added SPH fluid simulation in Extras, not integrated with rigid body / soft body yet
+	Thanks to Rama Hoetzlein to make this contribution available under the ZLib license
+	- add special capsule-capsule collider code in btConvexConvexCollisionAlgorithm, to speed up capsule-ragdolls
+	- soft body improvement: faster building of bending constraints
+	- soft body improvement: allow to disable/enable cluster self-collision
+	- soft body fix: 'exploding' soft bodies when using cluster collision
+	- fix some degenerate cases in continuous convex cast, could impact ray cast/convex cast
+	Thanks to Jacob Langford for the report and reproduction cases, see http://code.google.com/p/bullet/issues/detail?id=250&can=1&start=200
+	- re-enabled split impulse
+	- added btHinge2Constraint, btUniversalConstraint, btGeneric6DofSpringConstraint
+	- demonstrate 2D physics with 2D/3D object interaction
+	
+
+2008 December 2
+	- Fix contact refresh issues with btCompoundShape, introduced with btDbvt acceleration structure in btCompoundCollisionAlgorithm
+	- Made btSequentialImpulseConstraintSolver 100% compatible with ODE quickstep
+	constraints can use 'solveConstraint' method or 'getInfo/getInfo2'
+
+2008 November 30
+	- Add highly optimized SIMD branchless PGS/SI solver innerloop 
+
+2008 November 12
+	- Add compound shape export to BulletColladaConverter
+	Thanks to JamesH for the report: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=12&t=2840
+	- Fix compiler build for Visual Studio 6
+	Thanks to JoF for the report: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2841
+
+2008 November 11
+	- Add CProfileManager::dumpAll() to dump performance statistics to console using printf.
+	- Add support for interaction between btSoftBody and btCollisionObject/btGhostObject
+
+2008 November 8
+	- Fix PosixThreadSupport
+	- Add improved btHeightfieldTerrainShape support and new Demos/TerrainDemo
+	Thanks to tomva, http://code.google.com/p/bullet/issues/detail?id=63&can=1
+	- Moved kinematic character controller from Demos/CharacterDemo into src/BulletDynamics/Character/btKinematicCharacterController.cpp
+
+2008 November 6
+	- reduced default memory pool allocation from 40Mb to 3Mb. This should be more suitable for all platforms, including iPhone
+	- improved CUDA broadphase
+	- IBM Cell SDK 3.x support, fix ibmsdk Makefiles
+	- improved CMake support with 'install' and 'framework option
+	
+2008 November 4
+	- add btAxisSweep::resetPool to avoid non-determinism due to shuffled linked list
+	Thanks to Ole for the contribution, 
+
+2008 October 30
+	- disabled btTriangleMesh duplicate search by default, it is extremely slow
+	- added Extras/IFF binary chunk serialization library as preparation for in-game native platform serialization (planned COLLADA DOM -> IFF converter)
+
+2008 October 20
+	- added SCE Physics Effects box-box collision detection for SPU/BulletMultiThreaded version
+	See Bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
+	Thanks to Sony Computer Entertainment Japan, SCEI for the contribution
+
+2008 October 17
+	- Added btGhostObject support, this helps character controller, explosions, triggers and other local spatial queries
+
+2008 October 10
+	- Moved aabb to btBroadphaseProxy, improves rayTest dramatically. Further raytest improvements using the broadphase acceleration structures are planned
+	- Moved BulletMultiThreaded from Extras to /src/BulletMultiThreaded for better integration
+
+
+2008 October 3
+	- Add support for autoconf automake
+	./autogen.sh and ./configure will create both Makefile and Jamfile. CMake and autogenerated Visual Studio projectfiles remain supported too.
+	- Improved ColladaConverter: plane shape export, and callback for shape construction to allow deletion of memory
+	
+2008 Sept 30
+	- Improved Soft Body support, fixed issues related to soft body colliding against concave triangle meshes
+	- Shared more code between regular version and SPU/BulletMultiThreaded, in particular GJK/EPA
+
+2008 Sept 28
+	- Fixed rotation issues in Dynamic Maya Plugin
+
+2008 Sept 11
+	- Enable CCD motion clamping for btDiscreteDynamicsWorld, to avoid tunneling. A more advanced solution will be implemented in btContinuousDynamicsWorld.
+
+2008 Sept 7
+	- Add btScaledBvhTriangleMeshShape, to allow re-use of btBvhTriangleMeshShape of different sizes, without copying of the BVH data.
+
+2008 Sept 5
+	- Enabled Demos/ForkLiftDemo
+	Thanks Roman Ponomarev.
+
+2008 Sept 4
+	- Added btCudaBroadphase in Extras/CUDA: some research into accelerating Bullet using CUDA.
+	Thanks to the particle demo from the NVidia CUDA SDK.
+	
+2008 Sept 3
+	- Several bug fixes and contributions related to inertia tensor, memory leaks etc.
+	Thanks to Ole K.
+
+2008 Sept 1
+	- Updated CDTestFramework, with latest version of OPCODE Array SAP. See Extras/CDTestFramework
+	Thanks to Pierre Terdiman for the update
+
+2008 August 25
+	- Walt Disney Studios contributes their in-house Maya Plugin for simulating Bullet physics, with options for other engines such as PhysBam or PhysX.
+	Thanks to Nicola Candussi and Arthur Shek
+	
+2008 August 14
+	- Improved performance for btDbvtBroadphase, based on dual dynamic AABB trees (one for static, one for dynamic objects, where objects can move from one to the other tree)
+	Thanks to Nathanael Presson again, for all his work.
+	
+2008 July 31
+	- Added Havok .hkx to COLLADA Physics .dae converter patch+information
+	- Fix btSubsimplexConvexCast
+	Thanks to Nacho, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2422)
+	- Fix in rendering, GL_STENCIL
+	- btTriangleIndexVertexArray indices should be unsigned int/unsigned short int,
+	- Made InternalProcessAllTriangles virtual, thanks to
+	Both thank to Fullmetalcoder, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2401
+	- clamp impulse for btPoint2PointConstraint
+	Thanks to Martijn Reuvers, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2418
+	- Free memory of bvh, pass in scaling factor (optional)
+	Thanks to Roy Eltham, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=2375
+
+2008 July 27
+
+btDbvtBroadphase:
+	- Fixed a performance issues reported by 'reltham'
+	- Added btDbvtBroadphase::optimize() for people who want good performances right
+away or don't do dynamics.
+	- fixed compilation issues when DBVT_BP_PROFILE was set.
+btSoftBody:
+	- Fixed singular matrix issues related to polar decomposition (flat meshes).
+DemoApplication:
+	- Shadows (enable/disable through 'g' or DemoApplication::setShadows(bool)).
+	- Texture can be enable/disable through 'u'
+CDFramework:
+	- fixed compilation issues.
+	All thanks to Nathanael Presson
+
+2008 July 10
+	- Added btMultimaterialTriangleMeshShape and MultiMaterialDemo
+	Thanks to Alex Silverman for the contribution
+
+2008 June 30
+	- Added initial support for kinematic character controller
+	Thanks to John McCutchan
+
+2008 April 14
+	- Added ray cast support for Soft Bodies
+	Thanks to Nathanael Presson for the contribution
+	
+2008 April 9
+	- Cleanup of Stan Melax ConvexHull, removed Extras/ConvexHull, moved sources into LinearMath/BulletCollision
+
+2008 April 4
+	- Added btSliderConstraint and demo
+	Thanks Roman Ponomarev
+	
+2008 April 3
+	- Fixed btMinkowskiSumShape, and added hitpoint to btSubsimplexConvexCast
+
+2008 April 2
+	- Added Extras/CdTestFrameWork
+	Thanks Pierre Terdiman
+
+2008 April 1
+	- Added posix thread (pthread) support
+	Thanks Enrico
+
+2008 March 30
+	- Added Soft Body, cloth, rope and deformable volumes, including demos and interaction
+	Thanks Nathanael Presson for this great contribution
+	
+	2008 March 17
+	- Improved BulletColladaConverter
+	Thanks John McCutchan
+
+2008 March 15
+	- btMultiSapBroadphase in a working state. Needs more optimizations to be fully useable.
+	- Allow btOptimizedBvh to be used for arbitrary objects, not just triangles
+	- added quicksort to btAlignedObjectArray
+	- removed btTypedUserInfo, added btHashMap
+
+2008 March 30
+	- Moved quickstep solver and boxbox into Bullet/src folder
+	Thanks Russell L. Smith for permission to redistribute Open Dynamics Engine quickstep and box-box under the ZLib license	
+
+2008 Feb 27
+	- Added initial version for Character Control Demo
+	- Applied fixes to IBM Cell SDK 3.0 build makefiles
+	Thanks Jochen and mojo for reporting/providing patch: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1922
+
+2008 Feb 8
+	- Bugfixes in ConvexCast support against the world.
+	Thanks to Isgmasa for reporting/providing fix: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1823
+
+2008 Feb 6
+	- Added btCapsuleShapeX and btCapsuleShapeZ for capsules around X and Z axis (default capsule is around Y)
+	
+2008 Feb 3
+	- Added btTypedUserInfo, useful for serialization
+
+2008 Jan 31
+	- Add support for 16 and 32-bit indices for SPU / BulletMultiThreaded version.
+
+2008 Jan 29
+	- Added COLLADA Physics export/serialization/snapshot from any Bullet btDynamicsWorld. Saving the physics world into a text .xml file is useful for debugging etc.
+
+2008 Jan 23
+	- Added Stan Melax Convex Hull utility library in Extras/ConvexHull. This is useful to render non-polyhedral convex objects, and to simplify convex polyhedra.
+	
+2008 Jan 14
+	- Add support for batch raycasting on SPU / BulletMultiThreaded
+	
+2007 Dec 16
+	- Added btRigidBodyConstructionInfo, to make it easier to set individual setting (and leave other untouched) during rigid body construction.
+	Thanks Vangelis Kokkevis for pointing this out.
+	- Fixed memoryleak in the ConstraintDemo and Raytracer demo.
+	- Fixed issue with clearing forces/gravity at the end of the stepSimulation, instead of during internalSingleStepSimulation.
+	Thanks chunky for pointing this out: http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1780
+	- Disabled additional damping in rigid body by default, but enable it in most demos. Set btRigidBodyConstructionInfo m_additionalDamping to true to enable this.
+	- Removed obsolete QUICKPROF BEGIN/END_PROFILE, and enabled BT_PROFILE. Profiling is enabled by default (see Bullet/Demos/OpenGL/DemoApplication.cpp how to use this).
+	User can switch off profiling by enabling define BT_NO_PROFILE in Bullet/src/btQuickprof.h.
+
+2007 Dec 14
+	- Added Hello World and BulletMultiThreaded demos
+	- Add portable version of BulletMultiThreaded, through SequentialThreadSupport (non-parallel but sharing the same code-path)
+	- Add Cmake support for AllBulletDemos
+	
+
+2007 Dec 11
+	- Moved the 'btRigidBody::clearForce' to the end of the stepSimulation, instead of in each substep.
+	See discussion http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1601
+	- Added btConvexPlaneCollisionAlgorithm, makes planes perform better, and prevents tunneling
+	Thanks Andy O'Neil for reporting the performance/functionality issue
+	- Fixes for IBM Cell SDK 3.0
+	Thanks to Jochen Roth for the patch.
+
+2007 Dec 10
+	- Fixes in btHeightfieldTerrainShape
+	Thanks to Jay Lee for the patch.
+
+2007	Dec 9
+	- Only update aabb of active objects
+	Thanks Peter Tchernev for reporting (http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1764 )
+	- Added workaround to compile libxml under Visual Studio 2008 Beta 2
+	- Make glui compile under MSVC 9.0 beta (vsnprintf is already defined)
+
+2007 Dec 6
+	- Added DynamicControlDemo, showing dynamic control through constraint motors
+		Thanks to Eddy Boxerman
+	- Add support for generic concave shapes for convex cast.
+	- Added convex cast query to collision world.
+	- Added workaround for OpenGL bug in Mac OS X 10.5.0 (Leopard)
+	- Added concave raycast demo
+		All above thanks to John McCutchan (JMC)
+	- Fixed issues that prevent Linux version to compile. 
+	Thanks to Enrico for reporting and patch, see
+	- Fixed misleading name 'numTriangleIndices' into 'numTriangles'
+	Thanks Sean Tasker for reporting:
+
+2007 Nov 28:
+	- Added raycast against trianglemesh. Will be extended to object cast soon.
+	Thanks John McCutchan (JMC)
+	- make getNumPoints const correct, add const getPoints(). 
+	Thanks Dirk Gregorius
+	- Bugfix: allow btCollisionObjects (non-btRigidBody) to interact properly with btRigidBody for cache-friendly btSequentialImpulseConstraintSolver.
+	Thanks Andy O'Neil for pointing this out.
+	- Bugfix: don't fail if spheres have identical center, use arbitrary separating normal (1,0,0)
+	Thanks Sean Tasker for reporting! http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1681
+
+
+2007, November 20
+	- Added hierarchical profiling
+	- Fixed memory leak in btMultiSapBroadphase,
+	- Fixed hash function (typo, should use 2 proxies)
+	Thanks to Stephen (shatcher) for reporting and fixes! http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1696
+
+2007 Nov 11
+	- Fixed parallel solver (BulletMultiThreaded) friction issue
+	- Terminate Win32 Threads when closing the CcdPhysicsDemo (when USE_PARALLEL_SOLVER/USE_PARALLEL_DISPATCHER is defined)
+
+2007 Nov 6
+	- Added support for 16-bit indices for triangle meshes
+	- Added support for multiple mesh parts using btBvhTriangleMeshShape.
+	Thanks to Tim Johansson
+	
+2007 Oct 22
+	- All memory allocations go through btAlignedAlloc/btAlignedFree. User can override this to verify memory leaks
+	- added a few more demos to AllBulletDemos
+	- fix for one of the constructors of btHingeConstraint
+	Thanks Marcus Hennix
+	
+2007 Oct 20
+	- included glui, a GLUT/OpenGL based toolkit for some graphical user elements
+	Removed dynamic_cast from glui, to allow linkage without rtti
+	- added Box2D framework using glui, allowing all demos to run within one executable
+	Thanks Erin Catto for the FrameWork skeleton (http://www.box2d.org)
+
+2007 Ocy 17
+	- Allow user to pass in their own memory (stack and pool) allocators, through collisionConfiguration. See demos how to use this
+
+2007 Oct 14
+	- Included working version of Cell SPU parallel optimized version for Libspe2 SPU task scheduler.
+	This version compiles and runs on Playstation 3 Linux and IBM CellBlade, see BulletSpuOptimized.pdf for build instructions
+	(Official Playstation 3 developers can request a SPURS version through Sony PS3 Devnet.)
+	Thanks to IBM 'Extreme Blue' project for the contribution
+	http://www-913.ibm.com/employment/us/extremeblue/ 
+	Thanks Minh Cuong Tran, Benjamin Hoeferlin, Frederick Roth and Martina Huellmann
+	for various contributions to get this initial Libspe2 parallel version up and running.
+
+2007 Oct 13
+	- made 'btCollisionShape::calculateLocalInertia' const
+	Thanks to cgripeos, see http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1514
+	- applied a large patch to remove warnings
+	Thanks to Enrico, see http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1568
+	- removed SSE includes, added #incude <string.h> for memset in Extras/quickstep, thanks Eternl Knight
+
+2007 Oct 11
+	- added Hashed Overlapping Pair Cache, recommended by Pierre Terdiman. It works like a charm, thanks Pierre and Erin Catto (code from Box2D)
+	- modified some margins inside btBoxShape, btCylinderShape and btSphereShape
+	- added cone debug rendering (for cones with x, y and z up-axis)
+	- added improvements for optional Extra/quickstep, thanks to Remotion
+	- some performance improvements for Bullet constraint solver
+
+2007 Sept 28
+	- upgraded GIMPACT to version 0.3
+	Thanks to Francisco Leon
+
+2007 Sept 27
+	- added contribution from IBM Extreme Blue project for Libspe2 support. This allow to execute BulletMultiThreaded on Cell SPU under PS3 Linux and Cell Blade. See http://www-913.ibm.com/employment/us/extremeblue
+	Thanks to Minh Cuong Tran, Frederick Roth, Martina Heullmann and Benjamin Hoeferlin.
+
+2007 Sept 13
+	- Improved btGenericD6Constraint. It can be used to create ragdolls (similar to the new btConeTwistConstraint). See GenericJointDemo
+	- Added support for Bullet constraints in the optional Extras/quickstep ODE solver. See CcdPhysicsDemo, enable #COMPARE_WITH_QUICKSTEP and add libquickstep to the dependencies.
+	For both patches/improvements thanks Francisco Leon/projectileman
+		
+2007 Sept 10
+	- removed union from btQuadWordStorage, it caused issues under certain version of gcc/Linux
+
+2007 Sept 10
+	- Reverted constraint solver, due to some issues. Need to review the recent memory allocation changes.
+	- Fixed issue with kinematic objects rotating at low speed: quaternion was de-normalized, passing value > 1 into acosf returns #IND00 invalid values
+	- 16 byte memory alignment for BVH serialization
+	- memory cleanup for btPoolAllocator
+
+2007 Sept 9
+	- Added serialization for BVH/btBvhTriangleMeshShape, including endian swapping. See ConcaveDemo for an example.
+	Thanks to Phil Knight for the contribution.
+	- Fixed issues related to stack allocator/compound collision algorithm
+	Thanks Proctoid, http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=18&t=1460
+	- Increase some default memory pool settings, and added a fallback for the constraints solver to use heap memory
+	- Removed accidential testing code in btScalar.h related to operator new.	
+	- Enable btAxis3Sweep and bt32BitAxis3Sweep to be linked in at the same time, using template
+	
+2007 Sept 7
+	- Replaced several dynamic memory allocations by stack allocation and pool allocations
+	- Added branch-free quantized aabb bounding box overlap check, works better on Playstation 3 and XBox 360
+	Thanks to Phil Knight. Also see www.cellperformance.com for related articles
+	- Collision algorithms and settings for the memory/stack allocator can be done using btDefaultCollisionConfiguration
+	This is an API change. See demos how to modify existing implementations with a one-liner.
+	- Register several collision algorithms by default (sphere-sphere, sphere-box, sphere-triangle)
+	- Use other traveral method for BVH by default, this improves triangle mesh collision performance.
+	
+2007 Aug 31
+	- fixed MSVC 6 build
+	Thanks Proctoid, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1375
+	- fixed double precision build issues
+	Thanks Alex Silverman, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1434
+
+2007 Aug 24
+	- fixed bug in btMatrix3x3::transposeTimes(const btMatrix3x3& m) const. Luckily it wasn't used in core parts of the library (yet).
+	Thanks to Jay Lee
+	
+2007 Aug 15
+	- fixed bug in Extras/GIMPACT 0.2 related to moving triangle meshes
+	Thanks Thomas, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1368
+
+2007 Aug 14
+	- added parallel constraint solver. Works on Playstation 3 Cell SPU and multi core (Win Threads on PC and XBox 360).
+	  See Extras/BulletMultiThreaded for SpuSolverTask subfolder and SpuParallelSolver.cpp
+	  Thanks Marten Svanfeldt (Starbreeze Studios)	
+	- fixed some bugs related to parallel collision detection (Extras/BulletMultiThreaded)
+	  Thanks Marten Svanfeldt (Starbreeze Studios)	
+	
+2007 Aug 2
+	- added compound and concave-convex (swapped) case for BulletMultiThreaded collision detection, thanks to Marten Svanfeldt
+	- refactored broadphase and overlapping pair cache. This allows performance improvement by combining multiple broadphases. This helps add/remove of large batches of objects and large worlds. See also Pierre Terdiman forum topic:
+	http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329
+
+
+2007 July 27
+	- added Ragdoll Demo
+		Thanks to Marten Svanfeldt (Starbreeze Studios)
+
+	- added Vector Math library for SIMD 3D graphics linear algebra (vector, matrix, quaternion)
+		See Bullet/Extras/vectormathlibrary
+		Supports SIMD SSE, PowerPC PPU and Cell SPU (including PS3 Linux and CellBlade), as well as generic portable scalar version
+		Will be used to improve BulletMultiThreaded performance
+		Open Sourced by Sony Computer Entertainment Inc. under the new BSD license
+	- added SIMD math library
+		4-way SIMD for common math functions like atan2f4, cosf4, floorf4, fabsf4, rsqrtf4 etc. Used by Vector Math library under PPU and SPU.
+		Supports PowerPC (PPU) and Cell SPU, including PS3 Linux and CellBlade.
+		See Bullet/Extras/simdmathlibrary
+		Open sourced by Sony Computer Entertainment Inc. under the new BSD license
+
+	
+2007 July 25
+	- added several patches: per-rigidbody sleeping threshold. added Assert to prevent deletion of rigidbody while constraints are still pointing at it
+		Thanks to Marten Svanfeldt (Starbreeze Studios)
+	
+2007 July 13
+	- fixed relative #include paths again. We can't use "../" relative paths: some compilers choke on it (it causes extreme long paths)
+		Within the libraries, we always need to start with "BulletCollision/" or "BulletDynamics/ or "LinearMath/"
+
+2007 July 10
+	- Updated Bullet User Manual
+
+2007 July 5
+	- added btConeTwistConstraint, especially useful for ragdolls. See Demos/RagdollDemo
+		Thanks to Marten Svanfeldt (Starbreeze Studios)
+
+2007 June 29
+	- btHeightfieldTerrainShape: Added heightfield support, with customizations
+	- Upgraded to GIMPACT 0.2, see Extras/GIMPACT and MovingConcaveDemo
+	- Several patches from Marten Svanfeldt (Starbreeze Studios)
+		Improved collision filtering (in broadphase and rigidbody)
+		Improved debug rendering
+		Allow to set collision filter group/mask in addRigidBody
+		
+		
+2007 June 15
+	- Changed btAlignedObjectArray to call copy constructor/replacement new for duplication, rather then assignment operator (operator=).
+
+2007 June 11
+	- Added multi-threading. Originally for Playstation 3 Cell SPU, but the same code can run using Win32 Threads using fake DMA transfers (memcpy)
+		Libspe2 support for Cell Blade / PS3 Linux is upcoming
+		See Extras/BulletMultiThreaded. Usage: replace btCollisionDispatcher by btSpuGatheringCollisionDispatcher
+
+	- Added managed Bullet library, entirely rewritten in C# for Windows and XBox 360 XNA
+		See Extras/BulletX
+		Thanks to KleMiX, aka Vsevolod Klementjev
+
+2007 May 31
+	- sign-bit went wrong in case of 32-bit broadphase, causing quantization problems. 
+		Thanks DevO for reporting.
+
+2007 May 23
+	- Fixed quantization problem for planar triangle meshes in btOptimizedBvh
+		Thanks Phil Knight for reporting and helping to fix this bug.
+		
+2007 May 20
+	- btAxisSweep3: Fixed a bug in btAxisSweep3 (sweep and prune) related to object removal. Only showed up when at least one btStaticPlaneShape was inserted.
+		Thanks tbp for more details on reproducing case.
+	- btAxisSweep3: Fixed issue with full 32bit precision btAxisSweep3 (define BP_USE_FIXEDPOINT_INT_32), it used only 0xffff/65536 for quantization instead of full integer space (0xffffffff)
+	- btRaycastVehicle: Added 'getForwardVector' and getCurrentSpeedKmHour utility functions
+	- Fixed local scaling issues (btConvexTriangleMeshShape, btBvhTriangleMeshShape, removed scaling from btMatrix3x3). 
+		Thanks Volker for reporting!
+	- Added second filename search, so that starting BspDemo and ConvexDecompositionDemo from within Visual Studio (without setting the starting path) still works
+
+2007 April 22
+	- Added braking functionality to btRaycastVehicle
+	- Removed tons of warnings, under MSVC 2005 compilation in -W4
+	
+2007 March 21
+	- Fixed issues: comma at end of enum causes errors for some compilers
+	- Fixed initialization bug in LocalRayResult (	m_localShapeInfo(localShapeInfo) )
+	
+2007 March 20
+	- Added refit tree to quantized stackless tree, and updated ConcaveDemo as example.
+	
+2007 March 17
+	- Added constraint solver optimizations, avoiding cross products during iterations, and gather rigidbody/constraint info in contiguous memory (btSolverBody/btSolverConstraint)
+	- These optimizations don't give large benefit yet, but it has good potential. Turned on by default. Can be switched off using solver->setSolverMode(SOLVER_RANDMIZE_ORDER).
+	- Enabled anti-jitter for rigid bodies. This is experimental, and can be switched off by setting a global (it is experimental so no proper interface) gJitterVelocityDampingFactor = 1.0;
+	- Fixed bug in islandmanifold.heapSort(btPersistentManifoldSortPredicate()); , thanks Noehrgel for reporting this (affected Sun Solaris)
+	
+2007 March 12
+	- Added compile-time toggle between on 16-bit and 32-bit fixed-point SAP broadphase. 
+		This allows the number of bodies to exceed 32767
+	- Enable useQuantizedAabbCompression on btTriangleMesh, see ColladaDemo
+	
+2007 March 8
+	- Fixed bug in constraint/island sorting (caused by replacing STL by dedicated btAlignedObjectArray with heapSort)
+		Thanks Clemens Unterkofler for pointing this out!
+
+2007 March 6
+	- removed STL from the Bullet library: replace std::vector by btAlignedObjectArray. Also removed the std::set for overlapping pair set, and turned it into an overlapping pair array. The SAP only adds objects, never removed. Removal is postponed for during traversal of overlapping pairs (duplicates and non-overlapping pairs are removed during that traversal).
+	- added heap sort and binary search/linear search to btAlignedObjectArray
+	- fixed wrong cast, thanks Hamstray, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1015
+
+
+2007 Feb 25
+	- Improved performance of convex collision shapes, cache local AABB instead of recomputation. This fixes issue with very slow performance in larger .bsp levels
+	
+2007 Feb 24
+	- Added compressed/quantized AABB tree, 16 bytes per node, while supporting 32-bit (triangle) indices. 
+	  Should be faster and smaller then original version (quantized aabb check is done in integer space)
+		Original aabb tree nodes are still supported. They are 44 bytes, with full floating point precision and additional subPart index.
+	- added meter-unit scaling support in ColladaConverter.cpp
+
+2007 Feb 21
+	- Build system: updated bullet.pc.in library names
+	- Updated EPA comparison integration (missing parameter)
+	
+2007 Jan 04
+	- fixed optimized AABB tree building: in some cases the tree building fails due to unbalanced trees, which generated stack overflow
+	
+2006 Dec 15
+	- added contribution to allow double precision collision detection/dynamics. Define BT_USE_DOUBLE_PRECISION in your project and libraries that include Bullet
+
+2006 Dec 14
+	- merged contact and non-contact constraint solving into one loop, will improve stability of jointed bodies during collisions
+	- added first draft for hingeConstraint motor
+	
+2006 Dec 8, Erwin Coumans
+	- preparation for SIMD: added btAlignedAllocator and btAlignedObjectArray, to replace stl std::vector, same interface, but compatible with 16 byte alignment
+	- cleaned up dependencies in autogenerated msvc projectfiles
+	- aligned btVector3 on 16 bytes boundary, under win32. see if developers will come up with problems
+
+2006 Dec 04, Erwin Coumans
+	Added btNearCallback. This is similar to Open Dynamics Engine (ODE) dNearCallback, but important differences:
+	- contact points are persistent (lifetime more then one frame, for warmstarting/incremental contact point management)
+	- continuous collision detection, time of impact
+	Added btRigidBody::isInWorld(), returns true if btRigidBody is inside a btCollisionWorld/btDynamicsWorld derived class
+	Added angularFactor to btRigidbody, this helps some character control (no angular impulse applied)
+
+
+2006 Nov 28
+	Moved StackAlloc from EPA into LinearMath/btStackAlloc
+	renamed internal class ConcaveShape into btConcaveShape
+	added btHeightfieldTerrainShape (not completed yet)
+		
+2006 Nov 15 Nathanael Presson
+	Added EPA penetration depth algorithm, Expanding Polytope Algorithm
+	Added Pierre Terdiman penetration depth comparison/test DEMO
+	Fixed Bullet's Minkowski sampling penetration depth solver
+	Contributed by Nathanael Presson
+	
+2006 Nov 11 Francisco Le�n N�jera
+	Added GIMPACT trimesh collision detection: concave versus concave,
+	Contributed by Francisco Le�n N�jera
+
+2006 Nov 2
+	Minor refactoring: btCollisionObject changes from struct into class, added accessor methods
+	Force use of btMotionState to synchronize graphics transform, disabled old btRigidBody constructor that accepts btTransform
+	Renamed treshold into threshold throughout the code
+	
+2006 Oct 30
+	Enable decoupling of physics and graphics framerate using interpolation and internal fixed timestep, based on btMotionState
+	Enabled raycast vehicle demo (still needs tuning)
+	Refresh contact points, even when they are already persistent.
+	Fixed debugDraw colors (thanks pc0de for reporting)
+	Use Dispatcher in ConcaveConvexCollisionAlgorithm (so it uses the registered collision algorithm, not hardcoded convexconcave)
+	Improved performance of constraint solver by precalculating the cross product/impulse arm
+	Added collision comparison code: ODE box-box, also sphere-triangle
+	Added safety check into GJK, and an assert for AABB's that are very large
+	Fixed kinematic support (deriving velocities for animated objects)
+	Updated comparison/optional quickstep solver in Extras
+	UserCollisionAlgorithm demonstrates btTriangleMesh usage (easier trimesh compared to index array version)
+	Removed scaling from btTransform (we only want to deal with rigid transforms)
+	
+2006 Oct 4
+	Fixed minor leak in btOptimizeBVH
+	Cleanup of btRigidBody construction
+	added getW() in btQuaternion
+	assert when setLinearVelocity is called on btRigidBody
+	renamed projectfile library from collada-dom to colladadom (to make VC6 happy)
+	
+2006 Sept 27
+	Big Refactoring: renamed and moved files, create a replacement for CcdPhysicsEnvironment/CcdPhysicsController.
+	All Bullet classes in LinearMath, BulletCollision and BulletDynamics start with bt, and methods start with lowercase.
+	Moved classes into src folder, which is the only include folder needed.
+	Added 2 headerfiles in src: btBulletCollisionCommon.h and btBulletDynamicsCommon.h
+
+2006 Sept 23
+	Fixed 2 bugs, causing crashes when removing objects. Should do better unit-testing. UnionFind and 3D SAP were involved.
+	
+2006 Sept 19
+	Allow programmable friction and contact solver model. User can register their own functions for several interaction types.
+	Improved performance, and removed hardcoded maximum overlaps (switched from C-array to stl::set)
+	
+2006 Sept 16
+	Added Bullet 2.0  User Manual
+	Allow registration of custom user collision algorithms
+
+2006 Sept 10
+	Started cleaning up demos
+	
+2006 Sept 4
+	Fixed concave collision bug (caused instability/missing collisions in meshes/compounds)
+	Fixed memoryleak in OptimizedBvh, added RayTestSingle to CollisionWorld
+	Prepared for VehicleDemo
+	Increased Performance (island generation for sleeping objects took too much time)
+	Better COLLADA 1.4.1 physics conformance in ColladaDemo
+
+2006 August 11
+	Added Quake BspDemo
+	Improved CCD for compound and non-convex objects
+
+2006 August 10
+	Added per-triangle material (friction/restitution) support for non-convex meshes. See ConcaveDemo for usage.
+
+2006 August 9
+	Added CMake support (see http://cmake.org)
+	This can autogenerate makefiles, projectfiles cross platform (including MacOS X Xcode )
+	Just run cmake . in the root folder and it will autogenerate build files
+	
+2006 July 26 Erwin Coumans
+	Upgraded to COLLADA-DOM 1.4.1, latest SVN version
+	ColladaDemo can export snapshots to .dae
+	
+2006 July 24 Erwin Coumans
+	Added Compound CollisionShape support
+	(this is still low performance -> requires stackless tree-versus-tree traversal for better performance)
+
+2006 July 15 Erwin Coumans
+	Added initial support for Parallel execution (collision detection, constraint solving)
+	See ParallelPhysicsEnvironment in Extras\PhysicsInterface\CcdPhysics
+	
+2006 July 10 Erwin Coumans
+	Added MacOS X support (some build issues mainly)
+		
+2006 July 5 Erwin Coumans
+	Improved COLLADA 1.4 physics import, both COLLADA-DOM and FCollada
+
+2006 June 29 Erwin Coumans
+	Refactoring of the broadphase
+	Moved some optional files to Extras: Algebraic ccd and EPA, quickstep
+	Moved the limits on bodies/overlap to 32k and 65k
+	
+2006 June 25 Erwin Coumans
+	Added basic Collision Filtering, during broadphase
+	Allow adding meshes to the TriangleIndexVertexArray,
+	(input for TriangleMeshShape) 
+	Preparation for CompoundShape
+
+2006 June 19 Erwin Coumans
+	Added support for COLLADA Physics Import.
+	Both jam and Visual Studio can compile ColladaDemo
+
+2006 June 18 Dirk Gregorius <dirk at dirkgregorius.de>
+	Started implementing Generic6DOF joint and setup basic interface
+
+
+2006 June 17 Frank Richter <resqu at gmx.ch>
+	Bumped version in configure.ac to 1.5.6 (assuming that "1.5f" is
+	  the next version released).
+	Updated files in mk/autoconf and mk/jam with copies from CS; fixes a 
+	  GLU detection issue on MinGW.
+	Set msvc/bullet_ico.ico as the default application icon.
+	Disabled exceptions for gcc builds.
+	Applied a patch from Michael D. Adams to fix a warning with gcc.
+2006 jUNE 16 Erwin Coumans
+	Constraints now merge simulation islands.
+
+2006 May 24
+	Improved GJK accuracy, fixed GjkConvexCast issue, thanks to ~MyXa~ for reporting
+	
+2006 May 19
+	Added restitution support
+	Moved out Friction and Dynamics info from ManifoldPoint (removed logical dependency)
+	Added a void* m_userPersistentData in ManifoldPoint.
+	Added a ContactDestroyedCallback, to allow user to handle destruction of m_userPersistentData
+
+2006 May 13
+	Fixed some bugs in friction / jacobian calculations. Reported by Dirk Gregorius. Thanks!
+
+2006 May 9
+	Fixed raycasting filtering
+	Moved repository to SVN at https://svn.sourceforge.net/svnroot/bullet
+		
+2006 April 27
+	Moved raycasting to CollisionWorld, to make it more generic
+	Added basic CCD option in the CcdCollisionDemo
+	Fixed 'noResponse' mode, for triggering rigidbodies (useful for Artificial Intelligence queries)
+	Improved Bullet/ODE sample (in Extras)
+		
+2006 April 10
+	Separating Axis Test (SAT) convex hull collision detector, contribution by Simon Hobbs
+	Added SIMD SSE Math classes (for above SAT)
+	Added Mouse picking in CcdPhysicsDemo
+	Improved penetration depth estimation in MinkowskiPenetrationDepthSolver, both accuracy and performance
+	Added Hinge constraint
+	Added quickprof profiling (see http://sourceforge.net/projects/quickprof )
+		
+2006 March 21 Frank Richter <resqu at gmx.ch>
+	Removed VC manifest files.
+	Removed superfluous "grpplugins" projects.
+
+2006 March 20 Erwin Coumans
+	Clamped the acculumated impulse rather then intermediate impulse (within the iteration)
+	Use the persistent contacts for reusing the impulse
+	Separated friction and normal solving for better stability
+	Decreased the default number of iterations of the constraint solver from 10 to 4
+
+2006 March 19 Frank Richter <resqu at gmx.ch>
+	Removed a couple of CSisms from the VC projects.
+	Fixed VC include & lib paths to go to the Addtional* options
+	  instead the command line arguments.
+	Added pkgconfig support.
+
+2006 March 14 Frank Richter <resqu at gmx.ch>
+	Added support for shipped GLUT on MinGW.
+	Fixed GLUT support on MinGW.
+
+2006 March 13 Frank Richter <resqu at gmx.ch>
+	Bolted on Jam-based build system.
+	Generated VC project files.
+	Fixed GCC warnings.
+	Fixed Linux build issues.
+
+2006 March 13
+Added 3D Sweep and Prune Broadphase Collision Detection, Contribution from Simon Hobbs.
+
+2006 March 2
+	Minor change in license to ZLib/LibPNG
+	This makes it legally a bit easier to deploy on Playstation 3
+	Prepared for more generic constraints, added ConstraintsDemo
+
+2006 Feb 23
+	Rearranged files and dependencies to allow for easier standalone Collision Detection without Bullet Dynamics.
+	See Demos/CollisionInterfaceDemo and Extras/ode/ode/test/test_BulletGjk.cpp for examples how to use.
+
+2005 August 6
+	Bullet 0.2 release with demos, sources, doxygen, draft manual
+
+2005 June 1
+	First public release of Bullet
+	
+
+... todo: add history
+
+2003 Initial version (continuous collision detection)
diff --git a/hkl3d/bullet/Makefile.am b/hkl3d/bullet/Makefile.am
new file mode 100644
index 0000000..2d304a7
--- /dev/null
+++ b/hkl3d/bullet/Makefile.am
@@ -0,0 +1,3 @@
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS=src
diff --git a/hkl3d/bullet/Makefile.in b/hkl3d/bullet/Makefile.in
new file mode 100644
index 0000000..de1a594
--- /dev/null
+++ b/hkl3d/bullet/Makefile.in
@@ -0,0 +1,656 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = hkl3d/bullet
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am AUTHORS \
+	COPYING ChangeLog NEWS README
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = src
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu hkl3d/bullet/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu hkl3d/bullet/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libtool cscopelist-am ctags \
+	ctags-am distclean distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/hkl3d/bullet/NEWS b/hkl3d/bullet/NEWS
new file mode 100644
index 0000000..d976ae4
--- /dev/null
+++ b/hkl3d/bullet/NEWS
@@ -0,0 +1,4 @@
+
+For news, visit the Bullet Physics Forum at
+http://www.continuousphysics.com/Bullet/phpBB2/viewforum.php?f=9
+
diff --git a/hkl3d/bullet/README b/hkl3d/bullet/README
new file mode 100644
index 0000000..8f37053
--- /dev/null
+++ b/hkl3d/bullet/README
@@ -0,0 +1,7 @@
+
+Bullet is a 3D Collision Detection and Rigid Body Dynamics Library for games and animation.
+Free for commercial use, including Playstation 3, open source under the ZLib License.
+Discrete and continuous collision detection, integrated into Blender 3D, and COLLADA 1.4 Physics import. 
+
+See the Bullet_User_Manual.pdf for more info and visit the Bullet Physics Forum at
+http://bulletphysics.com
diff --git a/hkl3d/bullet/src/Bullet-C-Api.h b/hkl3d/bullet/src/Bullet-C-Api.h
new file mode 100644
index 0000000..f27a17d
--- /dev/null
+++ b/hkl3d/bullet/src/Bullet-C-Api.h
@@ -0,0 +1,176 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+	Draft high-level generic physics C-API. For low-level access, use the physics SDK native API's.
+	Work in progress, functionality will be added on demand.
+
+	If possible, use the richer Bullet C++ API, by including "btBulletDynamicsCommon.h"
+*/
+
+#ifndef BULLET_C_API_H
+#define BULLET_C_API_H
+
+#define PL_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
+
+#ifdef BT_USE_DOUBLE_PRECISION
+typedef double	plReal;
+#else
+typedef float	plReal;
+#endif
+
+typedef plReal	plVector3[3];
+typedef plReal	plQuaternion[4];
+
+#ifdef __cplusplus
+extern "C" { 
+#endif
+
+/**	Particular physics SDK (C-API) */
+	PL_DECLARE_HANDLE(plPhysicsSdkHandle);
+
+/** 	Dynamics world, belonging to some physics SDK (C-API)*/
+	PL_DECLARE_HANDLE(plDynamicsWorldHandle);
+
+/** Rigid Body that can be part of a Dynamics World (C-API)*/	
+	PL_DECLARE_HANDLE(plRigidBodyHandle);
+
+/** 	Collision Shape/Geometry, property of a Rigid Body (C-API)*/
+	PL_DECLARE_HANDLE(plCollisionShapeHandle);
+
+/** Constraint for Rigid Bodies (C-API)*/
+	PL_DECLARE_HANDLE(plConstraintHandle);
+
+/** Triangle Mesh interface (C-API)*/
+	PL_DECLARE_HANDLE(plMeshInterfaceHandle);
+
+/** Broadphase Scene/Proxy Handles (C-API)*/
+	PL_DECLARE_HANDLE(plCollisionBroadphaseHandle);
+	PL_DECLARE_HANDLE(plBroadphaseProxyHandle);
+	PL_DECLARE_HANDLE(plCollisionWorldHandle);
+
+/**
+	Create and Delete a Physics SDK	
+*/
+
+	extern	plPhysicsSdkHandle	plNewBulletSdk(void); //this could be also another sdk, like ODE, PhysX etc.
+	extern	void		plDeletePhysicsSdk(plPhysicsSdkHandle	physicsSdk);
+
+/** Collision World, not strictly necessary, you can also just create a Dynamics World with Rigid Bodies which internally manages the Collision World with Collision Objects */
+
+	typedef void(*btBroadphaseCallback)(void* clientData, void* object1,void* object2);
+
+	extern plCollisionBroadphaseHandle	plCreateSapBroadphase(btBroadphaseCallback beginCallback,btBroadphaseCallback endCallback);
+
+	extern void	plDestroyBroadphase(plCollisionBroadphaseHandle bp);
+
+	extern 	plBroadphaseProxyHandle plCreateProxy(plCollisionBroadphaseHandle bp, void* clientData, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);
+
+	extern void plDestroyProxy(plCollisionBroadphaseHandle bp, plBroadphaseProxyHandle proxyHandle);
+
+	extern void plSetBoundingBox(plBroadphaseProxyHandle proxyHandle, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);
+
+/* todo: add pair cache support with queries like add/remove/find pair */
+	
+	extern plCollisionWorldHandle plCreateCollisionWorld(plPhysicsSdkHandle physicsSdk);
+
+/* todo: add/remove objects */
+	
+
+/* Dynamics World */
+
+	extern  plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdk);
+
+	extern  void           plDeleteDynamicsWorld(plDynamicsWorldHandle world);
+
+	extern	void	plStepSimulation(plDynamicsWorldHandle,	plReal	timeStep);
+
+	extern  void plAddRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object);
+
+	extern  void plRemoveRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object);
+
+
+/* Rigid Body  */
+
+	extern  plRigidBodyHandle plCreateRigidBody(	void* user_data,  float mass, plCollisionShapeHandle cshape );
+
+	extern  void plDeleteRigidBody(plRigidBodyHandle body);
+
+
+/* Collision Shape definition */
+
+	extern  plCollisionShapeHandle plNewSphereShape(plReal radius);
+	extern  plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z);
+	extern  plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height);	
+	extern  plCollisionShapeHandle plNewConeShape(plReal radius, plReal height);
+	extern  plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height);
+	extern	plCollisionShapeHandle plNewCompoundShape(void);
+	extern	void	plAddChildShape(plCollisionShapeHandle compoundShape,plCollisionShapeHandle childShape, plVector3 childPos,plQuaternion childOrn);
+
+	extern  void plDeleteShape(plCollisionShapeHandle shape);
+
+	/* Convex Meshes */
+	extern  plCollisionShapeHandle plNewConvexHullShape(void);
+	extern  void		plAddVertex(plCollisionShapeHandle convexHull, plReal x,plReal y,plReal z);
+/* Concave static triangle meshes */
+	extern  plMeshInterfaceHandle		   plNewMeshInterface(void);
+	extern  void		plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2);
+	extern  plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle);
+
+	extern  void plSetScaling(plCollisionShapeHandle shape, plVector3 scaling);
+
+/* SOLID has Response Callback/Table/Management */
+/* PhysX has Triggers, User Callbacks and filtering */
+/* ODE has the typedef void dNearCallback (void *data, dGeomID o1, dGeomID o2); */
+
+/*	typedef void plUpdatedPositionCallback(void* userData, plRigidBodyHandle	rbHandle, plVector3 pos); */
+/*	typedef void plUpdatedOrientationCallback(void* userData, plRigidBodyHandle	rbHandle, plQuaternion orientation); */
+
+	/* get world transform */
+	extern void	plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);
+	extern void	plGetPosition(plRigidBodyHandle object,plVector3 position);
+	extern void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation);
+
+	/* set world transform (position/orientation) */
+	extern  void plSetPosition(plRigidBodyHandle object, const plVector3 position);
+	extern  void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation);
+	extern	void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient);
+	extern	void plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);
+
+	typedef struct plRayCastResult {
+		plRigidBodyHandle		m_body;  
+		plCollisionShapeHandle	m_shape; 		
+		plVector3				m_positionWorld; 		
+		plVector3				m_normalWorld;
+	} plRayCastResult;
+
+	extern  int plRayCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plRayCastResult res);
+
+	/* Sweep API */
+
+	/* extern  plRigidBodyHandle plObjectCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal); */
+
+	/* Continuous Collision Detection API */
+	
+	// needed for source/blender/blenkernel/intern/collision.c
+	double plNearestPoints(float p1[3], float p2[3], float p3[3], float q1[3], float q2[3], float q3[3], float *pa, float *pb, float normal[3]);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif //BULLET_C_API_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
new file mode 100644
index 0000000..7776330
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
@@ -0,0 +1,37 @@
+
+//Bullet Continuous Collision Detection and Physics Library
+//Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+
+//
+// btAxisSweep3
+//
+// Copyright (c) 2006 Simon Hobbs
+//
+// This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+#include "btAxisSweep3.h"
+
+
+btAxisSweep3::btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles, btOverlappingPairCache* pairCache, bool disableRaycastAccelerator)
+:btAxisSweep3Internal<unsigned short int>(worldAabbMin,worldAabbMax,0xfffe,0xffff,maxHandles,pairCache,disableRaycastAccelerator)
+{
+	// 1 handle is reserved as sentinel
+	btAssert(maxHandles > 1 && maxHandles < 32767);
+
+}
+
+
+bt32BitAxisSweep3::bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles , btOverlappingPairCache* pairCache , bool disableRaycastAccelerator)
+:btAxisSweep3Internal<unsigned int>(worldAabbMin,worldAabbMax,0xfffffffe,0x7fffffff,maxHandles,pairCache,disableRaycastAccelerator)
+{
+	// 1 handle is reserved as sentinel
+	btAssert(maxHandles > 1 && maxHandles < 2147483647);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h
new file mode 100644
index 0000000..4f4d94b
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h
@@ -0,0 +1,1051 @@
+//Bullet Continuous Collision Detection and Physics Library
+//Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+//
+// btAxisSweep3.h
+//
+// Copyright (c) 2006 Simon Hobbs
+//
+// This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+
+#ifndef BT_AXIS_SWEEP_3_H
+#define BT_AXIS_SWEEP_3_H
+
+#include "LinearMath/btVector3.h"
+#include "btOverlappingPairCache.h"
+#include "btBroadphaseInterface.h"
+#include "btBroadphaseProxy.h"
+#include "btOverlappingPairCallback.h"
+#include "btDbvtBroadphase.h"
+
+//#define DEBUG_BROADPHASE 1
+#define USE_OVERLAP_TEST_ON_REMOVES 1
+
+/// The internal templace class btAxisSweep3Internal implements the sweep and prune broadphase.
+/// It uses quantized integers to represent the begin and end points for each of the 3 axis.
+/// Dont use this class directly, use btAxisSweep3 or bt32BitAxisSweep3 instead.
+template <typename BP_FP_INT_TYPE>
+class btAxisSweep3Internal : public btBroadphaseInterface
+{
+protected:
+
+	BP_FP_INT_TYPE	m_bpHandleMask;
+	BP_FP_INT_TYPE	m_handleSentinel;
+
+public:
+	
+ BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	class Edge
+	{
+	public:
+		BP_FP_INT_TYPE m_pos;			// low bit is min/max
+		BP_FP_INT_TYPE m_handle;
+
+		BP_FP_INT_TYPE IsMax() const {return static_cast<BP_FP_INT_TYPE>(m_pos & 1);}
+	};
+
+public:
+	class	Handle : public btBroadphaseProxy
+	{
+	public:
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+	
+		// indexes into the edge arrays
+		BP_FP_INT_TYPE m_minEdges[3], m_maxEdges[3];		// 6 * 2 = 12
+//		BP_FP_INT_TYPE m_uniqueId;
+		btBroadphaseProxy*	m_dbvtProxy;//for faster raycast
+		//void* m_pOwner; this is now in btBroadphaseProxy.m_clientObject
+	
+		SIMD_FORCE_INLINE void SetNextFree(BP_FP_INT_TYPE next) {m_minEdges[0] = next;}
+		SIMD_FORCE_INLINE BP_FP_INT_TYPE GetNextFree() const {return m_minEdges[0];}
+	};		// 24 bytes + 24 for Edge structures = 44 bytes total per entry
+
+	
+protected:
+	btVector3 m_worldAabbMin;						// overall system bounds
+	btVector3 m_worldAabbMax;						// overall system bounds
+
+	btVector3 m_quantize;						// scaling factor for quantization
+
+	BP_FP_INT_TYPE m_numHandles;						// number of active handles
+	BP_FP_INT_TYPE m_maxHandles;						// max number of handles
+	Handle* m_pHandles;						// handles pool
+	
+	BP_FP_INT_TYPE m_firstFreeHandle;		// free handles list
+
+	Edge* m_pEdges[3];						// edge arrays for the 3 axes (each array has m_maxHandles * 2 + 2 sentinel entries)
+	void* m_pEdgesRawPtr[3];
+
+	btOverlappingPairCache* m_pairCache;
+
+	///btOverlappingPairCallback is an additional optional user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.
+	btOverlappingPairCallback* m_userPairCallback;
+	
+	bool	m_ownsPairCache;
+
+	int	m_invalidPair;
+
+	///additional dynamic aabb structure, used to accelerate ray cast queries.
+	///can be disabled using a optional argument in the constructor
+	btDbvtBroadphase*	m_raycastAccelerator;
+	btOverlappingPairCache*	m_nullPairCache;
+
+
+	// allocation/deallocation
+	BP_FP_INT_TYPE allocHandle();
+	void freeHandle(BP_FP_INT_TYPE handle);
+	
+
+	bool testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1);
+
+#ifdef DEBUG_BROADPHASE
+	void debugPrintAxis(int axis,bool checkCardinality=true);
+#endif //DEBUG_BROADPHASE
+
+	//Overlap* AddOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);
+	//void RemoveOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);
+
+	
+
+	void sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
+	void sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
+	void sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
+	void sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );
+
+public:
+
+	btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles = 16384, btOverlappingPairCache* pairCache=0,bool disableRaycastAccelerator = false);
+
+	virtual	~btAxisSweep3Internal();
+
+	BP_FP_INT_TYPE getNumHandles() const
+	{
+		return m_numHandles;
+	}
+
+	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);
+	
+	BP_FP_INT_TYPE addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
+	void removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher);
+	void updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
+	SIMD_FORCE_INLINE Handle* getHandle(BP_FP_INT_TYPE index) const {return m_pHandles + index;}
+
+	virtual void resetPool(btDispatcher* dispatcher);
+
+	void	processAllOverlappingPairs(btOverlapCallback* callback);
+
+	//Broadphase Interface
+	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
+	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
+	virtual void  getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
+	
+	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
+	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
+
+	
+	void quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const;
+	///unQuantize should be conservative: aabbMin/aabbMax should be larger then 'getAabb' result
+	void unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
+	
+	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
+
+	btOverlappingPairCache*	getOverlappingPairCache()
+	{
+		return m_pairCache;
+	}
+	const btOverlappingPairCache*	getOverlappingPairCache() const
+	{
+		return m_pairCache;
+	}
+
+	void	setOverlappingPairUserCallback(btOverlappingPairCallback* pairCallback)
+	{
+		m_userPairCallback = pairCallback;
+	}
+	const btOverlappingPairCallback*	getOverlappingPairUserCallback() const
+	{
+		return m_userPairCallback;
+	}
+
+	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame
+	///will add some transform later
+	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
+	{
+		aabbMin = m_worldAabbMin;
+		aabbMax = m_worldAabbMax;
+	}
+
+	virtual void	printStats()
+	{
+/*		printf("btAxisSweep3.h\n");
+		printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);
+		printf("aabbMin=%f,%f,%f,aabbMax=%f,%f,%f\n",m_worldAabbMin.getX(),m_worldAabbMin.getY(),m_worldAabbMin.getZ(),
+			m_worldAabbMax.getX(),m_worldAabbMax.getY(),m_worldAabbMax.getZ());
+			*/
+
+	}
+
+};
+
+////////////////////////////////////////////////////////////////////
+
+
+
+
+#ifdef DEBUG_BROADPHASE
+#include <stdio.h>
+
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3<BP_FP_INT_TYPE>::debugPrintAxis(int axis, bool checkCardinality)
+{
+	int numEdges = m_pHandles[0].m_maxEdges[axis];
+	printf("SAP Axis %d, numEdges=%d\n",axis,numEdges);
+
+	int i;
+	for (i=0;i<numEdges+1;i++)
+	{
+		Edge* pEdge = m_pEdges[axis] + i;
+		Handle* pHandlePrev = getHandle(pEdge->m_handle);
+		int handleIndex = pEdge->IsMax()? pHandlePrev->m_maxEdges[axis] : pHandlePrev->m_minEdges[axis];
+		char beginOrEnd;
+		beginOrEnd=pEdge->IsMax()?'E':'B';
+		printf("	[%c,h=%d,p=%x,i=%d]\n",beginOrEnd,pEdge->m_handle,pEdge->m_pos,handleIndex);
+	}
+
+	if (checkCardinality)
+		btAssert(numEdges == m_numHandles*2+1);
+}
+#endif //DEBUG_BROADPHASE
+
+template <typename BP_FP_INT_TYPE>
+btBroadphaseProxy*	btAxisSweep3Internal<BP_FP_INT_TYPE>::createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)
+{
+		(void)shapeType;
+		BP_FP_INT_TYPE handleId = addHandle(aabbMin,aabbMax, userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,multiSapProxy);
+		
+		Handle* handle = getHandle(handleId);
+		
+		if (m_raycastAccelerator)
+		{
+			btBroadphaseProxy* rayProxy = m_raycastAccelerator->createProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,0);
+			handle->m_dbvtProxy = rayProxy;
+		}
+		return handle;
+}
+
+
+
+template <typename BP_FP_INT_TYPE>
+void	btAxisSweep3Internal<BP_FP_INT_TYPE>::destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
+{
+	Handle* handle = static_cast<Handle*>(proxy);
+	if (m_raycastAccelerator)
+		m_raycastAccelerator->destroyProxy(handle->m_dbvtProxy,dispatcher);
+	removeHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), dispatcher);
+}
+
+template <typename BP_FP_INT_TYPE>
+void	btAxisSweep3Internal<BP_FP_INT_TYPE>::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)
+{
+	Handle* handle = static_cast<Handle*>(proxy);
+	handle->m_aabbMin = aabbMin;
+	handle->m_aabbMax = aabbMax;
+	updateHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), aabbMin, aabbMax,dispatcher);
+	if (m_raycastAccelerator)
+		m_raycastAccelerator->setAabb(handle->m_dbvtProxy,aabbMin,aabbMax,dispatcher);
+
+}
+
+template <typename BP_FP_INT_TYPE>
+void	btAxisSweep3Internal<BP_FP_INT_TYPE>::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)
+{
+	if (m_raycastAccelerator)
+	{
+		m_raycastAccelerator->rayTest(rayFrom,rayTo,rayCallback,aabbMin,aabbMax);
+	} else
+	{
+		//choose axis?
+		BP_FP_INT_TYPE axis = 0;
+		//for each proxy
+		for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)
+		{
+			if (m_pEdges[axis][i].IsMax())
+			{
+				rayCallback.process(getHandle(m_pEdges[axis][i].m_handle));
+			}
+		}
+	}
+}
+
+template <typename BP_FP_INT_TYPE>
+void	btAxisSweep3Internal<BP_FP_INT_TYPE>::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)
+{
+	if (m_raycastAccelerator)
+	{
+		m_raycastAccelerator->aabbTest(aabbMin,aabbMax,callback);
+	} else
+	{
+		//choose axis?
+		BP_FP_INT_TYPE axis = 0;
+		//for each proxy
+		for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)
+		{
+			if (m_pEdges[axis][i].IsMax())
+			{
+				Handle* handle = getHandle(m_pEdges[axis][i].m_handle);
+				if (TestAabbAgainstAabb2(aabbMin,aabbMax,handle->m_aabbMin,handle->m_aabbMax))
+				{
+					callback.process(handle);
+				}
+			}
+		}
+	}
+}
+
+
+
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
+{
+	Handle* pHandle = static_cast<Handle*>(proxy);
+	aabbMin = pHandle->m_aabbMin;
+	aabbMax = pHandle->m_aabbMax;
+}
+
+
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
+{
+	Handle* pHandle = static_cast<Handle*>(proxy);
+
+	unsigned short vecInMin[3];
+	unsigned short vecInMax[3];
+
+	vecInMin[0] = m_pEdges[0][pHandle->m_minEdges[0]].m_pos ;
+	vecInMax[0] = m_pEdges[0][pHandle->m_maxEdges[0]].m_pos +1 ;
+	vecInMin[1] = m_pEdges[1][pHandle->m_minEdges[1]].m_pos ;
+	vecInMax[1] = m_pEdges[1][pHandle->m_maxEdges[1]].m_pos +1 ;
+	vecInMin[2] = m_pEdges[2][pHandle->m_minEdges[2]].m_pos ;
+	vecInMax[2] = m_pEdges[2][pHandle->m_maxEdges[2]].m_pos +1 ;
+	
+	aabbMin.setValue((btScalar)(vecInMin[0]) / (m_quantize.getX()),(btScalar)(vecInMin[1]) / (m_quantize.getY()),(btScalar)(vecInMin[2]) / (m_quantize.getZ()));
+	aabbMin += m_worldAabbMin;
+	
+	aabbMax.setValue((btScalar)(vecInMax[0]) / (m_quantize.getX()),(btScalar)(vecInMax[1]) / (m_quantize.getY()),(btScalar)(vecInMax[2]) / (m_quantize.getZ()));
+	aabbMax += m_worldAabbMin;
+}
+
+
+
+
+template <typename BP_FP_INT_TYPE>
+btAxisSweep3Internal<BP_FP_INT_TYPE>::btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel,BP_FP_INT_TYPE userMaxHandles, btOverlappingPairCache* pairCache , bool disableRaycastAccelerator)
+:m_bpHandleMask(handleMask),
+m_handleSentinel(handleSentinel),
+m_pairCache(pairCache),
+m_userPairCallback(0),
+m_ownsPairCache(false),
+m_invalidPair(0),
+m_raycastAccelerator(0)
+{
+	BP_FP_INT_TYPE maxHandles = static_cast<BP_FP_INT_TYPE>(userMaxHandles+1);//need to add one sentinel handle
+
+	if (!m_pairCache)
+	{
+		void* ptr = btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16);
+		m_pairCache = new(ptr) btHashedOverlappingPairCache();
+		m_ownsPairCache = true;
+	}
+
+	if (!disableRaycastAccelerator)
+	{
+		m_nullPairCache = new (btAlignedAlloc(sizeof(btNullPairCache),16)) btNullPairCache();
+		m_raycastAccelerator = new (btAlignedAlloc(sizeof(btDbvtBroadphase),16)) btDbvtBroadphase(m_nullPairCache);//m_pairCache);
+		m_raycastAccelerator->m_deferedcollide = true;//don't add/remove pairs
+	}
+
+	//btAssert(bounds.HasVolume());
+
+	// init bounds
+	m_worldAabbMin = worldAabbMin;
+	m_worldAabbMax = worldAabbMax;
+
+	btVector3 aabbSize = m_worldAabbMax - m_worldAabbMin;
+
+	BP_FP_INT_TYPE	maxInt = m_handleSentinel;
+
+	m_quantize = btVector3(btScalar(maxInt),btScalar(maxInt),btScalar(maxInt)) / aabbSize;
+
+	// allocate handles buffer, using btAlignedAlloc, and put all handles on free list
+	m_pHandles = new Handle[maxHandles];
+	
+	m_maxHandles = maxHandles;
+	m_numHandles = 0;
+
+	// handle 0 is reserved as the null index, and is also used as the sentinel
+	m_firstFreeHandle = 1;
+	{
+		for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < maxHandles; i++)
+			m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));
+		m_pHandles[maxHandles - 1].SetNextFree(0);
+	}
+
+	{
+		// allocate edge buffers
+		for (int i = 0; i < 3; i++)
+		{
+			m_pEdgesRawPtr[i] = btAlignedAlloc(sizeof(Edge)*maxHandles*2,16);
+			m_pEdges[i] = new(m_pEdgesRawPtr[i]) Edge[maxHandles * 2];
+		}
+	}
+	//removed overlap management
+
+	// make boundary sentinels
+	
+	m_pHandles[0].m_clientObject = 0;
+
+	for (int axis = 0; axis < 3; axis++)
+	{
+		m_pHandles[0].m_minEdges[axis] = 0;
+		m_pHandles[0].m_maxEdges[axis] = 1;
+
+		m_pEdges[axis][0].m_pos = 0;
+		m_pEdges[axis][0].m_handle = 0;
+		m_pEdges[axis][1].m_pos = m_handleSentinel;
+		m_pEdges[axis][1].m_handle = 0;
+#ifdef DEBUG_BROADPHASE
+		debugPrintAxis(axis);
+#endif //DEBUG_BROADPHASE
+
+	}
+
+}
+
+template <typename BP_FP_INT_TYPE>
+btAxisSweep3Internal<BP_FP_INT_TYPE>::~btAxisSweep3Internal()
+{
+	if (m_raycastAccelerator)
+	{
+		m_nullPairCache->~btOverlappingPairCache();
+		btAlignedFree(m_nullPairCache);
+		m_raycastAccelerator->~btDbvtBroadphase();
+		btAlignedFree (m_raycastAccelerator);
+	}
+
+	for (int i = 2; i >= 0; i--)
+	{
+		btAlignedFree(m_pEdgesRawPtr[i]);
+	}
+	delete [] m_pHandles;
+
+	if (m_ownsPairCache)
+	{
+		m_pairCache->~btOverlappingPairCache();
+		btAlignedFree(m_pairCache);
+	}
+}
+
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const
+{
+#ifdef OLD_CLAMPING_METHOD
+	///problem with this clamping method is that the floating point during quantization might still go outside the range [(0|isMax) .. (m_handleSentinel&m_bpHandleMask]|isMax]
+	///see http://code.google.com/p/bullet/issues/detail?id=87
+	btVector3 clampedPoint(point);
+	clampedPoint.setMax(m_worldAabbMin);
+	clampedPoint.setMin(m_worldAabbMax);
+	btVector3 v = (clampedPoint - m_worldAabbMin) * m_quantize;
+	out[0] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getX() & m_bpHandleMask) | isMax);
+	out[1] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getY() & m_bpHandleMask) | isMax);
+	out[2] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getZ() & m_bpHandleMask) | isMax);
+#else
+	btVector3 v = (point - m_worldAabbMin) * m_quantize;
+	out[0]=(v[0]<=0)?(BP_FP_INT_TYPE)isMax:(v[0]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[0]&m_bpHandleMask)|isMax);
+	out[1]=(v[1]<=0)?(BP_FP_INT_TYPE)isMax:(v[1]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[1]&m_bpHandleMask)|isMax);
+	out[2]=(v[2]<=0)?(BP_FP_INT_TYPE)isMax:(v[2]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[2]&m_bpHandleMask)|isMax);
+#endif //OLD_CLAMPING_METHOD
+}
+
+
+template <typename BP_FP_INT_TYPE>
+BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::allocHandle()
+{
+	btAssert(m_firstFreeHandle);
+
+	BP_FP_INT_TYPE handle = m_firstFreeHandle;
+	m_firstFreeHandle = getHandle(handle)->GetNextFree();
+	m_numHandles++;
+
+	return handle;
+}
+
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::freeHandle(BP_FP_INT_TYPE handle)
+{
+	btAssert(handle > 0 && handle < m_maxHandles);
+
+	getHandle(handle)->SetNextFree(m_firstFreeHandle);
+	m_firstFreeHandle = handle;
+
+	m_numHandles--;
+}
+
+
+template <typename BP_FP_INT_TYPE>
+BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)
+{
+	// quantize the bounds
+	BP_FP_INT_TYPE min[3], max[3];
+	quantize(min, aabbMin, 0);
+	quantize(max, aabbMax, 1);
+
+	// allocate a handle
+	BP_FP_INT_TYPE handle = allocHandle();
+	
+
+	Handle* pHandle = getHandle(handle);
+	
+	pHandle->m_uniqueId = static_cast<int>(handle);
+	//pHandle->m_pOverlaps = 0;
+	pHandle->m_clientObject = pOwner;
+	pHandle->m_collisionFilterGroup = collisionFilterGroup;
+	pHandle->m_collisionFilterMask = collisionFilterMask;
+	pHandle->m_multiSapParentProxy = multiSapProxy;
+
+	// compute current limit of edge arrays
+	BP_FP_INT_TYPE limit = static_cast<BP_FP_INT_TYPE>(m_numHandles * 2);
+
+	
+	// insert new edges just inside the max boundary edge
+	for (BP_FP_INT_TYPE axis = 0; axis < 3; axis++)
+	{
+
+		m_pHandles[0].m_maxEdges[axis] += 2;
+
+		m_pEdges[axis][limit + 1] = m_pEdges[axis][limit - 1];
+
+		m_pEdges[axis][limit - 1].m_pos = min[axis];
+		m_pEdges[axis][limit - 1].m_handle = handle;
+
+		m_pEdges[axis][limit].m_pos = max[axis];
+		m_pEdges[axis][limit].m_handle = handle;
+
+		pHandle->m_minEdges[axis] = static_cast<BP_FP_INT_TYPE>(limit - 1);
+		pHandle->m_maxEdges[axis] = limit;
+	}
+
+	// now sort the new edges to their correct position
+	sortMinDown(0, pHandle->m_minEdges[0], dispatcher,false);
+	sortMaxDown(0, pHandle->m_maxEdges[0], dispatcher,false);
+	sortMinDown(1, pHandle->m_minEdges[1], dispatcher,false);
+	sortMaxDown(1, pHandle->m_maxEdges[1], dispatcher,false);
+	sortMinDown(2, pHandle->m_minEdges[2], dispatcher,true);
+	sortMaxDown(2, pHandle->m_maxEdges[2], dispatcher,true);
+
+
+	return handle;
+}
+
+
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher)
+{
+
+	Handle* pHandle = getHandle(handle);
+
+	//explicitly remove the pairs containing the proxy
+	//we could do it also in the sortMinUp (passing true)
+	///@todo: compare performance
+	if (!m_pairCache->hasDeferredRemoval())
+	{
+		m_pairCache->removeOverlappingPairsContainingProxy(pHandle,dispatcher);
+	}
+
+	// compute current limit of edge arrays
+	int limit = static_cast<int>(m_numHandles * 2);
+	
+	int axis;
+
+	for (axis = 0;axis<3;axis++)
+	{
+		m_pHandles[0].m_maxEdges[axis] -= 2;
+	}
+
+	// remove the edges by sorting them up to the end of the list
+	for ( axis = 0; axis < 3; axis++)
+	{
+		Edge* pEdges = m_pEdges[axis];
+		BP_FP_INT_TYPE max = pHandle->m_maxEdges[axis];
+		pEdges[max].m_pos = m_handleSentinel;
+
+		sortMaxUp(axis,max,dispatcher,false);
+
+
+		BP_FP_INT_TYPE i = pHandle->m_minEdges[axis];
+		pEdges[i].m_pos = m_handleSentinel;
+
+
+		sortMinUp(axis,i,dispatcher,false);
+
+		pEdges[limit-1].m_handle = 0;
+		pEdges[limit-1].m_pos = m_handleSentinel;
+		
+#ifdef DEBUG_BROADPHASE
+			debugPrintAxis(axis,false);
+#endif //DEBUG_BROADPHASE
+
+
+	}
+
+
+	// free the handle
+	freeHandle(handle);
+
+	
+}
+
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::resetPool(btDispatcher* dispatcher)
+{
+	if (m_numHandles == 0)
+	{
+		m_firstFreeHandle = 1;
+		{
+			for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < m_maxHandles; i++)
+				m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));
+			m_pHandles[m_maxHandles - 1].SetNextFree(0);
+		}
+	}
+}       
+
+
+extern int gOverlappingPairs;
+//#include <stdio.h>
+
+template <typename BP_FP_INT_TYPE>
+void	btAxisSweep3Internal<BP_FP_INT_TYPE>::calculateOverlappingPairs(btDispatcher* dispatcher)
+{
+
+	if (m_pairCache->hasDeferredRemoval())
+	{
+	
+		btBroadphasePairArray&	overlappingPairArray = m_pairCache->getOverlappingPairArray();
+
+		//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
+		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
+
+		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
+		m_invalidPair = 0;
+
+		
+		int i;
+
+		btBroadphasePair previousPair;
+		previousPair.m_pProxy0 = 0;
+		previousPair.m_pProxy1 = 0;
+		previousPair.m_algorithm = 0;
+		
+		
+		for (i=0;i<overlappingPairArray.size();i++)
+		{
+		
+			btBroadphasePair& pair = overlappingPairArray[i];
+
+			bool isDuplicate = (pair == previousPair);
+
+			previousPair = pair;
+
+			bool needsRemoval = false;
+
+			if (!isDuplicate)
+			{
+				///important to use an AABB test that is consistent with the broadphase
+				bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);
+
+				if (hasOverlap)
+				{
+					needsRemoval = false;//callback->processOverlap(pair);
+				} else
+				{
+					needsRemoval = true;
+				}
+			} else
+			{
+				//remove duplicate
+				needsRemoval = true;
+				//should have no algorithm
+				btAssert(!pair.m_algorithm);
+			}
+			
+			if (needsRemoval)
+			{
+				m_pairCache->cleanOverlappingPair(pair,dispatcher);
+
+		//		m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
+		//		m_overlappingPairArray.pop_back();
+				pair.m_pProxy0 = 0;
+				pair.m_pProxy1 = 0;
+				m_invalidPair++;
+				gOverlappingPairs--;
+			} 
+			
+		}
+
+	///if you don't like to skip the invalid pairs in the array, execute following code:
+	#define CLEAN_INVALID_PAIRS 1
+	#ifdef CLEAN_INVALID_PAIRS
+
+		//perform a sort, to sort 'invalid' pairs to the end
+		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
+
+		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
+		m_invalidPair = 0;
+	#endif//CLEAN_INVALID_PAIRS
+		
+		//printf("overlappingPairArray.size()=%d\n",overlappingPairArray.size());
+	}
+
+}
+
+
+template <typename BP_FP_INT_TYPE>
+bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
+{
+	const Handle* pHandleA = static_cast<Handle*>(proxy0);
+	const Handle* pHandleB = static_cast<Handle*>(proxy1);
+	
+	//optimization 1: check the array index (memory address), instead of the m_pos
+
+	for (int axis = 0; axis < 3; axis++)
+	{ 
+		if (pHandleA->m_maxEdges[axis] < pHandleB->m_minEdges[axis] || 
+			pHandleB->m_maxEdges[axis] < pHandleA->m_minEdges[axis]) 
+		{ 
+			return false; 
+		} 
+	} 
+	return true;
+}
+
+template <typename BP_FP_INT_TYPE>
+bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1)
+{
+	//optimization 1: check the array index (memory address), instead of the m_pos
+
+	if (pHandleA->m_maxEdges[axis0] < pHandleB->m_minEdges[axis0] || 
+		pHandleB->m_maxEdges[axis0] < pHandleA->m_minEdges[axis0] ||
+		pHandleA->m_maxEdges[axis1] < pHandleB->m_minEdges[axis1] ||
+		pHandleB->m_maxEdges[axis1] < pHandleA->m_minEdges[axis1]) 
+	{ 
+		return false; 
+	} 
+	return true;
+}
+
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)
+{
+//	btAssert(bounds.IsFinite());
+	//btAssert(bounds.HasVolume());
+
+	Handle* pHandle = getHandle(handle);
+
+	// quantize the new bounds
+	BP_FP_INT_TYPE min[3], max[3];
+	quantize(min, aabbMin, 0);
+	quantize(max, aabbMax, 1);
+
+	// update changed edges
+	for (int axis = 0; axis < 3; axis++)
+	{
+		BP_FP_INT_TYPE emin = pHandle->m_minEdges[axis];
+		BP_FP_INT_TYPE emax = pHandle->m_maxEdges[axis];
+
+		int dmin = (int)min[axis] - (int)m_pEdges[axis][emin].m_pos;
+		int dmax = (int)max[axis] - (int)m_pEdges[axis][emax].m_pos;
+
+		m_pEdges[axis][emin].m_pos = min[axis];
+		m_pEdges[axis][emax].m_pos = max[axis];
+
+		// expand (only adds overlaps)
+		if (dmin < 0)
+			sortMinDown(axis, emin,dispatcher,true);
+
+		if (dmax > 0)
+			sortMaxUp(axis, emax,dispatcher,true);
+
+		// shrink (only removes overlaps)
+		if (dmin > 0)
+			sortMinUp(axis, emin,dispatcher,true);
+
+		if (dmax < 0)
+			sortMaxDown(axis, emax,dispatcher,true);
+
+#ifdef DEBUG_BROADPHASE
+	debugPrintAxis(axis);
+#endif //DEBUG_BROADPHASE
+	}
+
+	
+}
+
+
+
+
+// sorting a min edge downwards can only ever *add* overlaps
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* /* dispatcher */, bool updateOverlaps)
+{
+
+	Edge* pEdge = m_pEdges[axis] + edge;
+	Edge* pPrev = pEdge - 1;
+	Handle* pHandleEdge = getHandle(pEdge->m_handle);
+
+	while (pEdge->m_pos < pPrev->m_pos)
+	{
+		Handle* pHandlePrev = getHandle(pPrev->m_handle);
+
+		if (pPrev->IsMax())
+		{
+			// if previous edge is a maximum check the bounds and add an overlap if necessary
+			const int axis1 = (1  << axis) & 3;
+			const int axis2 = (1  << axis1) & 3;
+			if (updateOverlaps && testOverlap2D(pHandleEdge, pHandlePrev,axis1,axis2))
+			{
+				m_pairCache->addOverlappingPair(pHandleEdge,pHandlePrev);
+				if (m_userPairCallback)
+					m_userPairCallback->addOverlappingPair(pHandleEdge,pHandlePrev);
+
+				//AddOverlap(pEdge->m_handle, pPrev->m_handle);
+
+			}
+
+			// update edge reference in other handle
+			pHandlePrev->m_maxEdges[axis]++;
+		}
+		else
+			pHandlePrev->m_minEdges[axis]++;
+
+		pHandleEdge->m_minEdges[axis]--;
+
+		// swap the edges
+		Edge swap = *pEdge;
+		*pEdge = *pPrev;
+		*pPrev = swap;
+
+		// decrement
+		pEdge--;
+		pPrev--;
+	}
+
+#ifdef DEBUG_BROADPHASE
+	debugPrintAxis(axis);
+#endif //DEBUG_BROADPHASE
+
+}
+
+// sorting a min edge upwards can only ever *remove* overlaps
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps)
+{
+	Edge* pEdge = m_pEdges[axis] + edge;
+	Edge* pNext = pEdge + 1;
+	Handle* pHandleEdge = getHandle(pEdge->m_handle);
+
+	while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos))
+	{
+		Handle* pHandleNext = getHandle(pNext->m_handle);
+
+		if (pNext->IsMax())
+		{
+			Handle* handle0 = getHandle(pEdge->m_handle);
+			Handle* handle1 = getHandle(pNext->m_handle);
+			const int axis1 = (1  << axis) & 3;
+			const int axis2 = (1  << axis1) & 3;
+			
+			// if next edge is maximum remove any overlap between the two handles
+			if (updateOverlaps 
+#ifdef USE_OVERLAP_TEST_ON_REMOVES
+				&& testOverlap2D(handle0,handle1,axis1,axis2)
+#endif //USE_OVERLAP_TEST_ON_REMOVES
+				)
+			{
+				
+
+				m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher);	
+				if (m_userPairCallback)
+					m_userPairCallback->removeOverlappingPair(handle0,handle1,dispatcher);
+				
+			}
+
+
+			// update edge reference in other handle
+			pHandleNext->m_maxEdges[axis]--;
+		}
+		else
+			pHandleNext->m_minEdges[axis]--;
+
+		pHandleEdge->m_minEdges[axis]++;
+
+		// swap the edges
+		Edge swap = *pEdge;
+		*pEdge = *pNext;
+		*pNext = swap;
+
+		// increment
+		pEdge++;
+		pNext++;
+	}
+
+
+}
+
+// sorting a max edge downwards can only ever *remove* overlaps
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps)
+{
+
+	Edge* pEdge = m_pEdges[axis] + edge;
+	Edge* pPrev = pEdge - 1;
+	Handle* pHandleEdge = getHandle(pEdge->m_handle);
+
+	while (pEdge->m_pos < pPrev->m_pos)
+	{
+		Handle* pHandlePrev = getHandle(pPrev->m_handle);
+
+		if (!pPrev->IsMax())
+		{
+			// if previous edge was a minimum remove any overlap between the two handles
+			Handle* handle0 = getHandle(pEdge->m_handle);
+			Handle* handle1 = getHandle(pPrev->m_handle);
+			const int axis1 = (1  << axis) & 3;
+			const int axis2 = (1  << axis1) & 3;
+
+			if (updateOverlaps  
+#ifdef USE_OVERLAP_TEST_ON_REMOVES
+				&& testOverlap2D(handle0,handle1,axis1,axis2)
+#endif //USE_OVERLAP_TEST_ON_REMOVES
+				)
+			{
+				//this is done during the overlappingpairarray iteration/narrowphase collision
+
+				
+				m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher);
+				if (m_userPairCallback)
+					m_userPairCallback->removeOverlappingPair(handle0,handle1,dispatcher);
+			
+
+
+			}
+
+			// update edge reference in other handle
+			pHandlePrev->m_minEdges[axis]++;;
+		}
+		else
+			pHandlePrev->m_maxEdges[axis]++;
+
+		pHandleEdge->m_maxEdges[axis]--;
+
+		// swap the edges
+		Edge swap = *pEdge;
+		*pEdge = *pPrev;
+		*pPrev = swap;
+
+		// decrement
+		pEdge--;
+		pPrev--;
+	}
+
+	
+#ifdef DEBUG_BROADPHASE
+	debugPrintAxis(axis);
+#endif //DEBUG_BROADPHASE
+
+}
+
+// sorting a max edge upwards can only ever *add* overlaps
+template <typename BP_FP_INT_TYPE>
+void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* /* dispatcher */, bool updateOverlaps)
+{
+	Edge* pEdge = m_pEdges[axis] + edge;
+	Edge* pNext = pEdge + 1;
+	Handle* pHandleEdge = getHandle(pEdge->m_handle);
+
+	while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos))
+	{
+		Handle* pHandleNext = getHandle(pNext->m_handle);
+
+		const int axis1 = (1  << axis) & 3;
+		const int axis2 = (1  << axis1) & 3;
+
+		if (!pNext->IsMax())
+		{
+			// if next edge is a minimum check the bounds and add an overlap if necessary
+			if (updateOverlaps && testOverlap2D(pHandleEdge, pHandleNext,axis1,axis2))
+			{
+				Handle* handle0 = getHandle(pEdge->m_handle);
+				Handle* handle1 = getHandle(pNext->m_handle);
+				m_pairCache->addOverlappingPair(handle0,handle1);
+				if (m_userPairCallback)
+					m_userPairCallback->addOverlappingPair(handle0,handle1);
+			}
+
+			// update edge reference in other handle
+			pHandleNext->m_minEdges[axis]--;
+		}
+		else
+			pHandleNext->m_maxEdges[axis]--;
+
+		pHandleEdge->m_maxEdges[axis]++;
+
+		// swap the edges
+		Edge swap = *pEdge;
+		*pEdge = *pNext;
+		*pNext = swap;
+
+		// increment
+		pEdge++;
+		pNext++;
+	}
+	
+}
+
+
+
+////////////////////////////////////////////////////////////////////
+
+
+/// The btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase.
+/// It uses arrays rather then lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats.
+/// For large worlds and many objects, use bt32BitAxisSweep3 or btDbvtBroadphase instead. bt32BitAxisSweep3 has higher precision and allows more then 16384 objects at the cost of more memory and bit of performance.
+class btAxisSweep3 : public btAxisSweep3Internal<unsigned short int>
+{
+public:
+
+	btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles = 16384, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);
+
+};
+
+/// The bt32BitAxisSweep3 allows higher precision quantization and more objects compared to the btAxisSweep3 sweep and prune.
+/// This comes at the cost of more memory per handle, and a bit slower performance.
+/// It uses arrays rather then lists for storage of the 3 axis.
+class bt32BitAxisSweep3 : public btAxisSweep3Internal<unsigned int>
+{
+public:
+
+	bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles = 1500000, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);
+
+};
+
+#endif
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
new file mode 100644
index 0000000..f1bf005
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
@@ -0,0 +1,82 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef		BT_BROADPHASE_INTERFACE_H
+#define 	BT_BROADPHASE_INTERFACE_H
+
+
+
+struct btDispatcherInfo;
+class btDispatcher;
+#include "btBroadphaseProxy.h"
+
+class btOverlappingPairCache;
+
+
+
+struct	btBroadphaseAabbCallback
+{
+	virtual ~btBroadphaseAabbCallback() {}
+	virtual bool	process(const btBroadphaseProxy* proxy) = 0;
+};
+
+
+struct	btBroadphaseRayCallback : public btBroadphaseAabbCallback
+{
+	///added some cached data to accelerate ray-AABB tests
+	btVector3		m_rayDirectionInverse;
+	unsigned int	m_signs[3];
+	btScalar		m_lambda_max;
+
+	virtual ~btBroadphaseRayCallback() {}
+};
+
+#include "LinearMath/btVector3.h"
+
+///The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.
+///Some implementations for this broadphase interface include btAxisSweep3, bt32BitAxisSweep3 and btDbvtBroadphase.
+///The actual overlapping pair management, storage, adding and removing of pairs is dealt by the btOverlappingPairCache class.
+class btBroadphaseInterface
+{
+public:
+	virtual ~btBroadphaseInterface() {}
+
+	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy) =0;
+	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)=0;
+	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)=0;
+	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const =0;
+
+	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0)) = 0;
+
+	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback) = 0;
+
+	///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
+	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher)=0;
+
+	virtual	btOverlappingPairCache*	getOverlappingPairCache()=0;
+	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const =0;
+
+	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame
+	///will add some transform later
+	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const =0;
+
+	///reset broadphase internal structures, to ensure determinism/reproducability
+	virtual void resetPool(btDispatcher* dispatcher) { (void) dispatcher; };
+
+	virtual void	printStats() = 0;
+
+};
+
+#endif //BT_BROADPHASE_INTERFACE_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
new file mode 100644
index 0000000..f4d7341
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
@@ -0,0 +1,17 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btBroadphaseProxy.h"
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
new file mode 100644
index 0000000..32e8f03
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
@@ -0,0 +1,270 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_BROADPHASE_PROXY_H
+#define BT_BROADPHASE_PROXY_H
+
+#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btAlignedAllocator.h"
+
+
+/// btDispatcher uses these types
+/// IMPORTANT NOTE:The types are ordered polyhedral, implicit convex and concave
+/// to facilitate type checking
+/// CUSTOM_POLYHEDRAL_SHAPE_TYPE,CUSTOM_CONVEX_SHAPE_TYPE and CUSTOM_CONCAVE_SHAPE_TYPE can be used to extend Bullet without modifying source code
+enum BroadphaseNativeTypes
+{
+	// polyhedral convex shapes
+	BOX_SHAPE_PROXYTYPE,
+	TRIANGLE_SHAPE_PROXYTYPE,
+	TETRAHEDRAL_SHAPE_PROXYTYPE,
+	CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE,
+	CONVEX_HULL_SHAPE_PROXYTYPE,
+	CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE,
+	CUSTOM_POLYHEDRAL_SHAPE_TYPE,
+//implicit convex shapes
+IMPLICIT_CONVEX_SHAPES_START_HERE,
+	SPHERE_SHAPE_PROXYTYPE,
+	MULTI_SPHERE_SHAPE_PROXYTYPE,
+	CAPSULE_SHAPE_PROXYTYPE,
+	CONE_SHAPE_PROXYTYPE,
+	CONVEX_SHAPE_PROXYTYPE,
+	CYLINDER_SHAPE_PROXYTYPE,
+	UNIFORM_SCALING_SHAPE_PROXYTYPE,
+	MINKOWSKI_SUM_SHAPE_PROXYTYPE,
+	MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,
+	BOX_2D_SHAPE_PROXYTYPE,
+	CONVEX_2D_SHAPE_PROXYTYPE,
+	CUSTOM_CONVEX_SHAPE_TYPE,
+//concave shapes
+CONCAVE_SHAPES_START_HERE,
+	//keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy!
+	TRIANGLE_MESH_SHAPE_PROXYTYPE,
+	SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE,
+	///used for demo integration FAST/Swift collision library and Bullet
+	FAST_CONCAVE_MESH_PROXYTYPE,
+	//terrain
+	TERRAIN_SHAPE_PROXYTYPE,
+///Used for GIMPACT Trimesh integration
+	GIMPACT_SHAPE_PROXYTYPE,
+///Multimaterial mesh
+    MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE,
+	
+	EMPTY_SHAPE_PROXYTYPE,
+	STATIC_PLANE_PROXYTYPE,
+	CUSTOM_CONCAVE_SHAPE_TYPE,
+CONCAVE_SHAPES_END_HERE,
+
+	COMPOUND_SHAPE_PROXYTYPE,
+
+	SOFTBODY_SHAPE_PROXYTYPE,
+	HFFLUID_SHAPE_PROXYTYPE,
+	HFFLUID_BUOYANT_CONVEX_SHAPE_PROXYTYPE,
+	INVALID_SHAPE_PROXYTYPE,
+
+	MAX_BROADPHASE_COLLISION_TYPES
+	
+};
+
+
+///The btBroadphaseProxy is the main class that can be used with the Bullet broadphases. 
+///It stores collision shape type information, collision filter information and a client object, typically a btCollisionObject or btRigidBody.
+ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy
+{
+
+BT_DECLARE_ALIGNED_ALLOCATOR();
+	
+	///optional filtering to cull potential collisions
+	enum CollisionFilterGroups
+	{
+	        DefaultFilter = 1,
+	        StaticFilter = 2,
+	        KinematicFilter = 4,
+	        DebrisFilter = 8,
+			SensorTrigger = 16,
+			CharacterFilter = 32,
+	        AllFilter = -1 //all bits sets: DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger
+	};
+
+	//Usually the client btCollisionObject or Rigidbody class
+	void*	m_clientObject;
+	short int m_collisionFilterGroup;
+	short int m_collisionFilterMask;
+	void*	m_multiSapParentProxy;		
+	int			m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc.
+
+	btVector3	m_aabbMin;
+	btVector3	m_aabbMax;
+
+	SIMD_FORCE_INLINE int getUid() const
+	{
+		return m_uniqueId;
+	}
+
+	//used for memory pools
+	btBroadphaseProxy() :m_clientObject(0),m_multiSapParentProxy(0)
+	{
+	}
+
+	btBroadphaseProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask,void* multiSapParentProxy=0)
+		:m_clientObject(userPtr),
+		m_collisionFilterGroup(collisionFilterGroup),
+		m_collisionFilterMask(collisionFilterMask),
+		m_aabbMin(aabbMin),
+		m_aabbMax(aabbMax)
+	{
+		m_multiSapParentProxy = multiSapParentProxy;
+	}
+
+	
+
+	static SIMD_FORCE_INLINE bool isPolyhedral(int proxyType)
+	{
+		return (proxyType  < IMPLICIT_CONVEX_SHAPES_START_HERE);
+	}
+
+	static SIMD_FORCE_INLINE bool	isConvex(int proxyType)
+	{
+		return (proxyType < CONCAVE_SHAPES_START_HERE);
+	}
+
+	static SIMD_FORCE_INLINE bool	isNonMoving(int proxyType)
+	{
+		return (isConcave(proxyType) && !(proxyType==GIMPACT_SHAPE_PROXYTYPE));
+	}
+
+	static SIMD_FORCE_INLINE bool	isConcave(int proxyType)
+	{
+		return ((proxyType > CONCAVE_SHAPES_START_HERE) &&
+			(proxyType < CONCAVE_SHAPES_END_HERE));
+	}
+	static SIMD_FORCE_INLINE bool	isCompound(int proxyType)
+	{
+		return (proxyType == COMPOUND_SHAPE_PROXYTYPE);
+	}
+
+	static SIMD_FORCE_INLINE bool	isSoftBody(int proxyType)
+	{
+		return (proxyType == SOFTBODY_SHAPE_PROXYTYPE);
+	}
+
+	static SIMD_FORCE_INLINE bool isInfinite(int proxyType)
+	{
+		return (proxyType == STATIC_PLANE_PROXYTYPE);
+	}
+
+	static SIMD_FORCE_INLINE bool isConvex2d(int proxyType)
+	{
+		return (proxyType == BOX_2D_SHAPE_PROXYTYPE) ||	(proxyType == CONVEX_2D_SHAPE_PROXYTYPE);
+	}
+
+	
+}
+;
+
+class btCollisionAlgorithm;
+
+struct btBroadphaseProxy;
+
+
+
+///The btBroadphasePair class contains a pair of aabb-overlapping objects.
+///A btDispatcher can search a btCollisionAlgorithm that performs exact/narrowphase collision detection on the actual collision shapes.
+ATTRIBUTE_ALIGNED16(struct) btBroadphasePair
+{
+	btBroadphasePair ()
+		:
+	m_pProxy0(0),
+		m_pProxy1(0),
+		m_algorithm(0),
+		m_internalInfo1(0)
+	{
+	}
+
+BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btBroadphasePair(const btBroadphasePair& other)
+		:		m_pProxy0(other.m_pProxy0),
+				m_pProxy1(other.m_pProxy1),
+				m_algorithm(other.m_algorithm),
+				m_internalInfo1(other.m_internalInfo1)
+	{
+	}
+	btBroadphasePair(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1)
+	{
+
+		//keep them sorted, so the std::set operations work
+		if (proxy0.m_uniqueId < proxy1.m_uniqueId)
+        { 
+            m_pProxy0 = &proxy0; 
+            m_pProxy1 = &proxy1; 
+        }
+        else 
+        { 
+			m_pProxy0 = &proxy1; 
+            m_pProxy1 = &proxy0; 
+        }
+
+		m_algorithm = 0;
+		m_internalInfo1 = 0;
+
+	}
+	
+	btBroadphaseProxy* m_pProxy0;
+	btBroadphaseProxy* m_pProxy1;
+	
+	mutable btCollisionAlgorithm* m_algorithm;
+	union { void* m_internalInfo1; int m_internalTmpValue;};//don't use this data, it will be removed in future version.
+
+};
+
+/*
+//comparison for set operation, see Solid DT_Encounter
+SIMD_FORCE_INLINE bool operator<(const btBroadphasePair& a, const btBroadphasePair& b) 
+{ 
+    return a.m_pProxy0 < b.m_pProxy0 || 
+        (a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 < b.m_pProxy1); 
+}
+*/
+
+
+
+class btBroadphasePairSortPredicate
+{
+	public:
+
+		bool operator() ( const btBroadphasePair& a, const btBroadphasePair& b )
+		{
+			const int uidA0 = a.m_pProxy0 ? a.m_pProxy0->m_uniqueId : -1;
+			const int uidB0 = b.m_pProxy0 ? b.m_pProxy0->m_uniqueId : -1;
+			const int uidA1 = a.m_pProxy1 ? a.m_pProxy1->m_uniqueId : -1;
+			const int uidB1 = b.m_pProxy1 ? b.m_pProxy1->m_uniqueId : -1;
+
+			 return uidA0 > uidB0 || 
+				(a.m_pProxy0 == b.m_pProxy0 && uidA1 > uidB1) ||
+				(a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 == b.m_pProxy1 && a.m_algorithm > b.m_algorithm); 
+		}
+};
+
+
+SIMD_FORCE_INLINE bool operator==(const btBroadphasePair& a, const btBroadphasePair& b) 
+{
+	 return (a.m_pProxy0 == b.m_pProxy0) && (a.m_pProxy1 == b.m_pProxy1);
+}
+
+
+#endif //BT_BROADPHASE_PROXY_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
new file mode 100644
index 0000000..c95d1be
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
@@ -0,0 +1,23 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btCollisionAlgorithm.h"
+#include "btDispatcher.h"
+
+btCollisionAlgorithm::btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
+{
+	m_dispatcher = ci.m_dispatcher1;
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h
new file mode 100644
index 0000000..36eec97
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h
@@ -0,0 +1,80 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COLLISION_ALGORITHM_H
+#define BT_COLLISION_ALGORITHM_H
+
+#include "LinearMath/btScalar.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+struct btBroadphaseProxy;
+class btDispatcher;
+class btManifoldResult;
+class btCollisionObject;
+struct btDispatcherInfo;
+class	btPersistentManifold;
+
+typedef btAlignedObjectArray<btPersistentManifold*>	btManifoldArray;
+
+struct btCollisionAlgorithmConstructionInfo
+{
+	btCollisionAlgorithmConstructionInfo()
+		:m_dispatcher1(0),
+		m_manifold(0)
+	{
+	}
+	btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp)
+		:m_dispatcher1(dispatcher)
+	{
+		(void)temp;
+	}
+
+	btDispatcher*	m_dispatcher1;
+	btPersistentManifold*	m_manifold;
+
+//	int	getDispatcherId();
+
+};
+
+
+///btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatcher.
+///It is persistent over frames
+class btCollisionAlgorithm
+{
+
+protected:
+
+	btDispatcher*	m_dispatcher;
+
+protected:
+//	int	getDispatcherId();
+	
+public:
+
+	btCollisionAlgorithm() {};
+
+	btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci);
+
+	virtual ~btCollisionAlgorithm() {};
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray) = 0;
+};
+
+
+#endif //BT_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.cpp
new file mode 100644
index 0000000..95443af
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.cpp
@@ -0,0 +1,1295 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+///btDbvt implementation by Nathanael Presson
+
+#include "btDbvt.h"
+
+//
+typedef btAlignedObjectArray<btDbvtNode*>			tNodeArray;
+typedef btAlignedObjectArray<const btDbvtNode*>	tConstNodeArray;
+
+//
+struct btDbvtNodeEnumerator : btDbvt::ICollide
+{
+	tConstNodeArray	nodes;
+	void Process(const btDbvtNode* n) { nodes.push_back(n); }
+};
+
+//
+static DBVT_INLINE int			indexof(const btDbvtNode* node)
+{
+	return(node->parent->childs[1]==node);
+}
+
+//
+static DBVT_INLINE btDbvtVolume	merge(	const btDbvtVolume& a,
+									  const btDbvtVolume& b)
+{
+#if (DBVT_MERGE_IMPL==DBVT_IMPL_SSE)
+	ATTRIBUTE_ALIGNED16(char locals[sizeof(btDbvtAabbMm)]);
+	btDbvtVolume&	res=*(btDbvtVolume*)locals;
+#else
+		btDbvtVolume	res;
+#endif
+	Merge(a,b,res);
+	return(res);
+}
+
+// volume+edge lengths
+static DBVT_INLINE btScalar		size(const btDbvtVolume& a)
+{
+	const btVector3	edges=a.Lengths();
+	return(	edges.x()*edges.y()*edges.z()+
+		edges.x()+edges.y()+edges.z());
+}
+
+//
+static void						getmaxdepth(const btDbvtNode* node,int depth,int& maxdepth)
+{
+	if(node->isinternal())
+	{
+		getmaxdepth(node->childs[0],depth+1,maxdepth);
+		getmaxdepth(node->childs[1],depth+1,maxdepth);
+	} else maxdepth=btMax(maxdepth,depth);
+}
+
+//
+static DBVT_INLINE void			deletenode(	btDbvt* pdbvt,
+										   btDbvtNode* node)
+{
+	btAlignedFree(pdbvt->m_free);
+	pdbvt->m_free=node;
+}
+
+//
+static void						recursedeletenode(	btDbvt* pdbvt,
+												  btDbvtNode* node)
+{
+	if(!node->isleaf())
+	{
+		recursedeletenode(pdbvt,node->childs[0]);
+		recursedeletenode(pdbvt,node->childs[1]);
+	}
+	if(node==pdbvt->m_root) pdbvt->m_root=0;
+	deletenode(pdbvt,node);
+}
+
+//
+static DBVT_INLINE btDbvtNode*	createnode(	btDbvt* pdbvt,
+										   btDbvtNode* parent,
+										   void* data)
+{
+	btDbvtNode*	node;
+	if(pdbvt->m_free)
+	{ node=pdbvt->m_free;pdbvt->m_free=0; }
+	else
+	{ node=new(btAlignedAlloc(sizeof(btDbvtNode),16)) btDbvtNode(); }
+	node->parent	=	parent;
+	node->data		=	data;
+	node->childs[1]	=	0;
+	return(node);
+}
+
+//
+static DBVT_INLINE btDbvtNode*	createnode(	btDbvt* pdbvt,
+										   btDbvtNode* parent,
+										   const btDbvtVolume& volume,
+										   void* data)
+{
+	btDbvtNode*	node=createnode(pdbvt,parent,data);
+	node->volume=volume;
+	return(node);
+}
+
+//
+static DBVT_INLINE btDbvtNode*	createnode(	btDbvt* pdbvt,
+										   btDbvtNode* parent,
+										   const btDbvtVolume& volume0,
+										   const btDbvtVolume& volume1,
+										   void* data)
+{
+	btDbvtNode*	node=createnode(pdbvt,parent,data);
+	Merge(volume0,volume1,node->volume);
+	return(node);
+}
+
+//
+static void						insertleaf(	btDbvt* pdbvt,
+										   btDbvtNode* root,
+										   btDbvtNode* leaf)
+{
+	if(!pdbvt->m_root)
+	{
+		pdbvt->m_root	=	leaf;
+		leaf->parent	=	0;
+	}
+	else
+	{
+		if(!root->isleaf())
+		{
+			do	{
+				root=root->childs[Select(	leaf->volume,
+					root->childs[0]->volume,
+					root->childs[1]->volume)];
+			} while(!root->isleaf());
+		}
+		btDbvtNode*	prev=root->parent;
+		btDbvtNode*	node=createnode(pdbvt,prev,leaf->volume,root->volume,0);
+		if(prev)
+		{
+			prev->childs[indexof(root)]	=	node;
+			node->childs[0]				=	root;root->parent=node;
+			node->childs[1]				=	leaf;leaf->parent=node;
+			do	{
+				if(!prev->volume.Contain(node->volume))
+					Merge(prev->childs[0]->volume,prev->childs[1]->volume,prev->volume);
+				else
+					break;
+				node=prev;
+			} while(0!=(prev=node->parent));
+		}
+		else
+		{
+			node->childs[0]	=	root;root->parent=node;
+			node->childs[1]	=	leaf;leaf->parent=node;
+			pdbvt->m_root	=	node;
+		}
+	}
+}
+
+//
+static btDbvtNode*				removeleaf(	btDbvt* pdbvt,
+										   btDbvtNode* leaf)
+{
+	if(leaf==pdbvt->m_root)
+	{
+		pdbvt->m_root=0;
+		return(0);
+	}
+	else
+	{
+		btDbvtNode*	parent=leaf->parent;
+		btDbvtNode*	prev=parent->parent;
+		btDbvtNode*	sibling=parent->childs[1-indexof(leaf)];			
+		if(prev)
+		{
+			prev->childs[indexof(parent)]=sibling;
+			sibling->parent=prev;
+			deletenode(pdbvt,parent);
+			while(prev)
+			{
+				const btDbvtVolume	pb=prev->volume;
+				Merge(prev->childs[0]->volume,prev->childs[1]->volume,prev->volume);
+				if(NotEqual(pb,prev->volume))
+				{
+					prev=prev->parent;
+				} else break;
+			}
+			return(prev?prev:pdbvt->m_root);
+		}
+		else
+		{								
+			pdbvt->m_root=sibling;
+			sibling->parent=0;
+			deletenode(pdbvt,parent);
+			return(pdbvt->m_root);
+		}			
+	}
+}
+
+//
+static void						fetchleaves(btDbvt* pdbvt,
+											btDbvtNode* root,
+											tNodeArray& leaves,
+											int depth=-1)
+{
+	if(root->isinternal()&&depth)
+	{
+		fetchleaves(pdbvt,root->childs[0],leaves,depth-1);
+		fetchleaves(pdbvt,root->childs[1],leaves,depth-1);
+		deletenode(pdbvt,root);
+	}
+	else
+	{
+		leaves.push_back(root);
+	}
+}
+
+//
+static void						split(	const tNodeArray& leaves,
+									  tNodeArray& left,
+									  tNodeArray& right,
+									  const btVector3& org,
+									  const btVector3& axis)
+{
+	left.resize(0);
+	right.resize(0);
+	for(int i=0,ni=leaves.size();i<ni;++i)
+	{
+		if(btDot(axis,leaves[i]->volume.Center()-org)<0)
+			left.push_back(leaves[i]);
+		else
+			right.push_back(leaves[i]);
+	}
+}
+
+//
+static btDbvtVolume				bounds(	const tNodeArray& leaves)
+{
+#if DBVT_MERGE_IMPL==DBVT_IMPL_SSE
+	ATTRIBUTE_ALIGNED16(char	locals[sizeof(btDbvtVolume)]);
+	btDbvtVolume&	volume=*(btDbvtVolume*)locals;
+	volume=leaves[0]->volume;
+#else
+	btDbvtVolume volume=leaves[0]->volume;
+#endif
+	for(int i=1,ni=leaves.size();i<ni;++i)
+	{
+		Merge(volume,leaves[i]->volume,volume);
+	}
+	return(volume);
+}
+
+//
+static void						bottomup(	btDbvt* pdbvt,
+										 tNodeArray& leaves)
+{
+	while(leaves.size()>1)
+	{
+		btScalar	minsize=SIMD_INFINITY;
+		int			minidx[2]={-1,-1};
+		for(int i=0;i<leaves.size();++i)
+		{
+			for(int j=i+1;j<leaves.size();++j)
+			{
+				const btScalar	sz=size(merge(leaves[i]->volume,leaves[j]->volume));
+				if(sz<minsize)
+				{
+					minsize		=	sz;
+					minidx[0]	=	i;
+					minidx[1]	=	j;
+				}
+			}
+		}
+		btDbvtNode*	n[]	=	{leaves[minidx[0]],leaves[minidx[1]]};
+		btDbvtNode*	p	=	createnode(pdbvt,0,n[0]->volume,n[1]->volume,0);
+		p->childs[0]		=	n[0];
+		p->childs[1]		=	n[1];
+		n[0]->parent		=	p;
+		n[1]->parent		=	p;
+		leaves[minidx[0]]	=	p;
+		leaves.swap(minidx[1],leaves.size()-1);
+		leaves.pop_back();
+	}
+}
+
+//
+static btDbvtNode*			topdown(btDbvt* pdbvt,
+									tNodeArray& leaves,
+									int bu_treshold)
+{
+	static const btVector3	axis[]={btVector3(1,0,0),
+		btVector3(0,1,0),
+		btVector3(0,0,1)};
+	if(leaves.size()>1)
+	{
+		if(leaves.size()>bu_treshold)
+		{
+			const btDbvtVolume	vol=bounds(leaves);
+			const btVector3			org=vol.Center();
+			tNodeArray				sets[2];
+			int						bestaxis=-1;
+			int						bestmidp=leaves.size();
+			int						splitcount[3][2]={{0,0},{0,0},{0,0}};
+			int i;
+			for( i=0;i<leaves.size();++i)
+			{
+				const btVector3	x=leaves[i]->volume.Center()-org;
+				for(int j=0;j<3;++j)
+				{
+					++splitcount[j][btDot(x,axis[j])>0?1:0];
+				}
+			}
+			for( i=0;i<3;++i)
+			{
+				if((splitcount[i][0]>0)&&(splitcount[i][1]>0))
+				{
+					const int	midp=(int)btFabs(btScalar(splitcount[i][0]-splitcount[i][1]));
+					if(midp<bestmidp)
+					{
+						bestaxis=i;
+						bestmidp=midp;
+					}
+				}
+			}
+			if(bestaxis>=0)
+			{
+				sets[0].reserve(splitcount[bestaxis][0]);
+				sets[1].reserve(splitcount[bestaxis][1]);
+				split(leaves,sets[0],sets[1],org,axis[bestaxis]);
+			}
+			else
+			{
+				sets[0].reserve(leaves.size()/2+1);
+				sets[1].reserve(leaves.size()/2);
+				for(int i=0,ni=leaves.size();i<ni;++i)
+				{
+					sets[i&1].push_back(leaves[i]);
+				}
+			}
+			btDbvtNode*	node=createnode(pdbvt,0,vol,0);
+			node->childs[0]=topdown(pdbvt,sets[0],bu_treshold);
+			node->childs[1]=topdown(pdbvt,sets[1],bu_treshold);
+			node->childs[0]->parent=node;
+			node->childs[1]->parent=node;
+			return(node);
+		}
+		else
+		{
+			bottomup(pdbvt,leaves);
+			return(leaves[0]);
+		}
+	}
+	return(leaves[0]);
+}
+
+//
+static DBVT_INLINE btDbvtNode*	sort(btDbvtNode* n,btDbvtNode*& r)
+{
+	btDbvtNode*	p=n->parent;
+	btAssert(n->isinternal());
+	if(p>n)
+	{
+		const int		i=indexof(n);
+		const int		j=1-i;
+		btDbvtNode*	s=p->childs[j];
+		btDbvtNode*	q=p->parent;
+		btAssert(n==p->childs[i]);
+		if(q) q->childs[indexof(p)]=n; else r=n;
+		s->parent=n;
+		p->parent=n;
+		n->parent=q;
+		p->childs[0]=n->childs[0];
+		p->childs[1]=n->childs[1];
+		n->childs[0]->parent=p;
+		n->childs[1]->parent=p;
+		n->childs[i]=p;
+		n->childs[j]=s;
+		btSwap(p->volume,n->volume);
+		return(p);
+	}
+	return(n);
+}
+
+#if 0
+static DBVT_INLINE btDbvtNode*	walkup(btDbvtNode* n,int count)
+{
+	while(n&&(count--)) n=n->parent;
+	return(n);
+}
+#endif
+
+//
+// Api
+//
+
+//
+btDbvt::btDbvt()
+{
+	m_root		=	0;
+	m_free		=	0;
+	m_lkhd		=	-1;
+	m_leaves	=	0;
+	m_opath		=	0;
+}
+
+//
+btDbvt::~btDbvt()
+{
+	clear();
+}
+
+//
+void			btDbvt::clear()
+{
+	if(m_root)	
+		recursedeletenode(this,m_root);
+	btAlignedFree(m_free);
+	m_free=0;
+	m_lkhd		=	-1;
+	m_stkStack.clear();
+	m_opath		=	0;
+	
+}
+
+//
+void			btDbvt::optimizeBottomUp()
+{
+	if(m_root)
+	{
+		tNodeArray leaves;
+		leaves.reserve(m_leaves);
+		fetchleaves(this,m_root,leaves);
+		bottomup(this,leaves);
+		m_root=leaves[0];
+	}
+}
+
+//
+void			btDbvt::optimizeTopDown(int bu_treshold)
+{
+	if(m_root)
+	{
+		tNodeArray	leaves;
+		leaves.reserve(m_leaves);
+		fetchleaves(this,m_root,leaves);
+		m_root=topdown(this,leaves,bu_treshold);
+	}
+}
+
+//
+void			btDbvt::optimizeIncremental(int passes)
+{
+	if(passes<0) passes=m_leaves;
+	if(m_root&&(passes>0))
+	{
+		do	{
+			btDbvtNode*		node=m_root;
+			unsigned	bit=0;
+			while(node->isinternal())
+			{
+				node=sort(node,m_root)->childs[(m_opath>>bit)&1];
+				bit=(bit+1)&(sizeof(unsigned)*8-1);
+			}
+			update(node);
+			++m_opath;
+		} while(--passes);
+	}
+}
+
+//
+btDbvtNode*	btDbvt::insert(const btDbvtVolume& volume,void* data)
+{
+	btDbvtNode*	leaf=createnode(this,0,volume,data);
+	insertleaf(this,m_root,leaf);
+	++m_leaves;
+	return(leaf);
+}
+
+//
+void			btDbvt::update(btDbvtNode* leaf,int lookahead)
+{
+	btDbvtNode*	root=removeleaf(this,leaf);
+	if(root)
+	{
+		if(lookahead>=0)
+		{
+			for(int i=0;(i<lookahead)&&root->parent;++i)
+			{
+				root=root->parent;
+			}
+		} else root=m_root;
+	}
+	insertleaf(this,root,leaf);
+}
+
+//
+void			btDbvt::update(btDbvtNode* leaf,btDbvtVolume& volume)
+{
+	btDbvtNode*	root=removeleaf(this,leaf);
+	if(root)
+	{
+		if(m_lkhd>=0)
+		{
+			for(int i=0;(i<m_lkhd)&&root->parent;++i)
+			{
+				root=root->parent;
+			}
+		} else root=m_root;
+	}
+	leaf->volume=volume;
+	insertleaf(this,root,leaf);
+}
+
+//
+bool			btDbvt::update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity,btScalar margin)
+{
+	if(leaf->volume.Contain(volume)) return(false);
+	volume.Expand(btVector3(margin,margin,margin));
+	volume.SignedExpand(velocity);
+	update(leaf,volume);
+	return(true);
+}
+
+//
+bool			btDbvt::update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity)
+{
+	if(leaf->volume.Contain(volume)) return(false);
+	volume.SignedExpand(velocity);
+	update(leaf,volume);
+	return(true);
+}
+
+//
+bool			btDbvt::update(btDbvtNode* leaf,btDbvtVolume& volume,btScalar margin)
+{
+	if(leaf->volume.Contain(volume)) return(false);
+	volume.Expand(btVector3(margin,margin,margin));
+	update(leaf,volume);
+	return(true);
+}
+
+//
+void			btDbvt::remove(btDbvtNode* leaf)
+{
+	removeleaf(this,leaf);
+	deletenode(this,leaf);
+	--m_leaves;
+}
+
+//
+void			btDbvt::write(IWriter* iwriter) const
+{
+	btDbvtNodeEnumerator	nodes;
+	nodes.nodes.reserve(m_leaves*2);
+	enumNodes(m_root,nodes);
+	iwriter->Prepare(m_root,nodes.nodes.size());
+	for(int i=0;i<nodes.nodes.size();++i)
+	{
+		const btDbvtNode* n=nodes.nodes[i];
+		int			p=-1;
+		if(n->parent) p=nodes.nodes.findLinearSearch(n->parent);
+		if(n->isinternal())
+		{
+			const int	c0=nodes.nodes.findLinearSearch(n->childs[0]);
+			const int	c1=nodes.nodes.findLinearSearch(n->childs[1]);
+			iwriter->WriteNode(n,i,p,c0,c1);
+		}
+		else
+		{
+			iwriter->WriteLeaf(n,i,p);
+		}	
+	}
+}
+
+//
+void			btDbvt::clone(btDbvt& dest,IClone* iclone) const
+{
+	dest.clear();
+	if(m_root!=0)
+	{	
+		btAlignedObjectArray<sStkCLN>	stack;
+		stack.reserve(m_leaves);
+		stack.push_back(sStkCLN(m_root,0));
+		do	{
+			const int		i=stack.size()-1;
+			const sStkCLN	e=stack[i];
+			btDbvtNode*			n=createnode(&dest,e.parent,e.node->volume,e.node->data);
+			stack.pop_back();
+			if(e.parent!=0)
+				e.parent->childs[i&1]=n;
+			else
+				dest.m_root=n;
+			if(e.node->isinternal())
+			{
+				stack.push_back(sStkCLN(e.node->childs[0],n));
+				stack.push_back(sStkCLN(e.node->childs[1],n));
+			}
+			else
+			{
+				iclone->CloneLeaf(n);
+			}
+		} while(stack.size()>0);
+	}
+}
+
+//
+int				btDbvt::maxdepth(const btDbvtNode* node)
+{
+	int	depth=0;
+	if(node) getmaxdepth(node,1,depth);
+	return(depth);
+}
+
+//
+int				btDbvt::countLeaves(const btDbvtNode* node)
+{
+	if(node->isinternal())
+		return(countLeaves(node->childs[0])+countLeaves(node->childs[1]));
+	else
+		return(1);
+}
+
+//
+void			btDbvt::extractLeaves(const btDbvtNode* node,btAlignedObjectArray<const btDbvtNode*>& leaves)
+{
+	if(node->isinternal())
+	{
+		extractLeaves(node->childs[0],leaves);
+		extractLeaves(node->childs[1],leaves);
+	}
+	else
+	{
+		leaves.push_back(node);
+	}	
+}
+
+//
+#if DBVT_ENABLE_BENCHMARK
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "LinearMath/btQuickProf.h"
+
+/*
+q6600,2.4ghz
+
+/Ox /Ob2 /Oi /Ot /I "." /I "..\.." /I "..\..\src" /D "NDEBUG" /D "_LIB" /D "_WINDOWS" /D "_CRT_SECURE_NO_DEPRECATE" /D "_CRT_NONSTDC_NO_DEPRECATE" /D "WIN32"
+/GF /FD /MT /GS- /Gy /arch:SSE2 /Zc:wchar_t- /Fp"..\..\out\release8\build\libbulletcollision\libbulletcollision.pch"
+/Fo"..\..\out\release8\build\libbulletcollision\\"
+/Fd"..\..\out\release8\build\libbulletcollision\bulletcollision.pdb"
+/W3 /nologo /c /Wp64 /Zi /errorReport:prompt
+
+Benchmarking dbvt...
+World scale: 100.000000
+Extents base: 1.000000
+Extents range: 4.000000
+Leaves: 8192
+sizeof(btDbvtVolume): 32 bytes
+sizeof(btDbvtNode):   44 bytes
+[1] btDbvtVolume intersections: 3499 ms (-1%)
+[2] btDbvtVolume merges: 1934 ms (0%)
+[3] btDbvt::collideTT: 5485 ms (-21%)
+[4] btDbvt::collideTT self: 2814 ms (-20%)
+[5] btDbvt::collideTT xform: 7379 ms (-1%)
+[6] btDbvt::collideTT xform,self: 7270 ms (-2%)
+[7] btDbvt::rayTest: 6314 ms (0%),(332143 r/s)
+[8] insert/remove: 2093 ms (0%),(1001983 ir/s)
+[9] updates (teleport): 1879 ms (-3%),(1116100 u/s)
+[10] updates (jitter): 1244 ms (-4%),(1685813 u/s)
+[11] optimize (incremental): 2514 ms (0%),(1668000 o/s)
+[12] btDbvtVolume notequal: 3659 ms (0%)
+[13] culling(OCL+fullsort): 2218 ms (0%),(461 t/s)
+[14] culling(OCL+qsort): 3688 ms (5%),(2221 t/s)
+[15] culling(KDOP+qsort): 1139 ms (-1%),(7192 t/s)
+[16] insert/remove batch(256): 5092 ms (0%),(823704 bir/s)
+[17] btDbvtVolume select: 3419 ms (0%)
+*/
+
+struct btDbvtBenchmark
+{
+	struct NilPolicy : btDbvt::ICollide
+	{
+		NilPolicy() : m_pcount(0),m_depth(-SIMD_INFINITY),m_checksort(true)		{}
+		void	Process(const btDbvtNode*,const btDbvtNode*)				{ ++m_pcount; }
+		void	Process(const btDbvtNode*)									{ ++m_pcount; }
+		void	Process(const btDbvtNode*,btScalar depth)
+		{
+			++m_pcount;
+			if(m_checksort)
+			{ if(depth>=m_depth) m_depth=depth; else printf("wrong depth: %f (should be >= %f)\r\n",depth,m_depth); }
+		}
+		int			m_pcount;
+		btScalar	m_depth;
+		bool		m_checksort;
+	};
+	struct P14 : btDbvt::ICollide
+	{
+		struct Node
+		{
+			const btDbvtNode*	leaf;
+			btScalar			depth;
+		};
+		void Process(const btDbvtNode* leaf,btScalar depth)
+		{
+			Node	n;
+			n.leaf	=	leaf;
+			n.depth	=	depth;
+		}
+		static int sortfnc(const Node& a,const Node& b)
+		{
+			if(a.depth<b.depth) return(+1);
+			if(a.depth>b.depth) return(-1);
+			return(0);
+		}
+		btAlignedObjectArray<Node>		m_nodes;
+	};
+	struct P15 : btDbvt::ICollide
+	{
+		struct Node
+		{
+			const btDbvtNode*	leaf;
+			btScalar			depth;
+		};
+		void Process(const btDbvtNode* leaf)
+		{
+			Node	n;
+			n.leaf	=	leaf;
+			n.depth	=	dot(leaf->volume.Center(),m_axis);
+		}
+		static int sortfnc(const Node& a,const Node& b)
+		{
+			if(a.depth<b.depth) return(+1);
+			if(a.depth>b.depth) return(-1);
+			return(0);
+		}
+		btAlignedObjectArray<Node>		m_nodes;
+		btVector3						m_axis;
+	};
+	static btScalar			RandUnit()
+	{
+		return(rand()/(btScalar)RAND_MAX);
+	}
+	static btVector3		RandVector3()
+	{
+		return(btVector3(RandUnit(),RandUnit(),RandUnit()));
+	}
+	static btVector3		RandVector3(btScalar cs)
+	{
+		return(RandVector3()*cs-btVector3(cs,cs,cs)/2);
+	}
+	static btDbvtVolume	RandVolume(btScalar cs,btScalar eb,btScalar es)
+	{
+		return(btDbvtVolume::FromCE(RandVector3(cs),btVector3(eb,eb,eb)+RandVector3()*es));
+	}
+	static btTransform		RandTransform(btScalar cs)
+	{
+		btTransform	t;
+		t.setOrigin(RandVector3(cs));
+		t.setRotation(btQuaternion(RandUnit()*SIMD_PI*2,RandUnit()*SIMD_PI*2,RandUnit()*SIMD_PI*2).normalized());
+		return(t);
+	}
+	static void				RandTree(btScalar cs,btScalar eb,btScalar es,int leaves,btDbvt& dbvt)
+	{
+		dbvt.clear();
+		for(int i=0;i<leaves;++i)
+		{
+			dbvt.insert(RandVolume(cs,eb,es),0);
+		}
+	}
+};
+
+void			btDbvt::benchmark()
+{
+	static const btScalar	cfgVolumeCenterScale		=	100;
+	static const btScalar	cfgVolumeExentsBase			=	1;
+	static const btScalar	cfgVolumeExentsScale		=	4;
+	static const int		cfgLeaves					=	8192;
+	static const bool		cfgEnable					=	true;
+
+	//[1] btDbvtVolume intersections
+	bool					cfgBenchmark1_Enable		=	cfgEnable;
+	static const int		cfgBenchmark1_Iterations	=	8;
+	static const int		cfgBenchmark1_Reference		=	3499;
+	//[2] btDbvtVolume merges
+	bool					cfgBenchmark2_Enable		=	cfgEnable;
+	static const int		cfgBenchmark2_Iterations	=	4;
+	static const int		cfgBenchmark2_Reference		=	1945;
+	//[3] btDbvt::collideTT
+	bool					cfgBenchmark3_Enable		=	cfgEnable;
+	static const int		cfgBenchmark3_Iterations	=	512;
+	static const int		cfgBenchmark3_Reference		=	5485;
+	//[4] btDbvt::collideTT self
+	bool					cfgBenchmark4_Enable		=	cfgEnable;
+	static const int		cfgBenchmark4_Iterations	=	512;
+	static const int		cfgBenchmark4_Reference		=	2814;
+	//[5] btDbvt::collideTT xform
+	bool					cfgBenchmark5_Enable		=	cfgEnable;
+	static const int		cfgBenchmark5_Iterations	=	512;
+	static const btScalar	cfgBenchmark5_OffsetScale	=	2;
+	static const int		cfgBenchmark5_Reference		=	7379;
+	//[6] btDbvt::collideTT xform,self
+	bool					cfgBenchmark6_Enable		=	cfgEnable;
+	static const int		cfgBenchmark6_Iterations	=	512;
+	static const btScalar	cfgBenchmark6_OffsetScale	=	2;
+	static const int		cfgBenchmark6_Reference		=	7270;
+	//[7] btDbvt::rayTest
+	bool					cfgBenchmark7_Enable		=	cfgEnable;
+	static const int		cfgBenchmark7_Passes		=	32;
+	static const int		cfgBenchmark7_Iterations	=	65536;
+	static const int		cfgBenchmark7_Reference		=	6307;
+	//[8] insert/remove
+	bool					cfgBenchmark8_Enable		=	cfgEnable;
+	static const int		cfgBenchmark8_Passes		=	32;
+	static const int		cfgBenchmark8_Iterations	=	65536;
+	static const int		cfgBenchmark8_Reference		=	2105;
+	//[9] updates (teleport)
+	bool					cfgBenchmark9_Enable		=	cfgEnable;
+	static const int		cfgBenchmark9_Passes		=	32;
+	static const int		cfgBenchmark9_Iterations	=	65536;
+	static const int		cfgBenchmark9_Reference		=	1879;
+	//[10] updates (jitter)
+	bool					cfgBenchmark10_Enable		=	cfgEnable;
+	static const btScalar	cfgBenchmark10_Scale		=	cfgVolumeCenterScale/10000;
+	static const int		cfgBenchmark10_Passes		=	32;
+	static const int		cfgBenchmark10_Iterations	=	65536;
+	static const int		cfgBenchmark10_Reference	=	1244;
+	//[11] optimize (incremental)
+	bool					cfgBenchmark11_Enable		=	cfgEnable;
+	static const int		cfgBenchmark11_Passes		=	64;
+	static const int		cfgBenchmark11_Iterations	=	65536;
+	static const int		cfgBenchmark11_Reference	=	2510;
+	//[12] btDbvtVolume notequal
+	bool					cfgBenchmark12_Enable		=	cfgEnable;
+	static const int		cfgBenchmark12_Iterations	=	32;
+	static const int		cfgBenchmark12_Reference	=	3677;
+	//[13] culling(OCL+fullsort)
+	bool					cfgBenchmark13_Enable		=	cfgEnable;
+	static const int		cfgBenchmark13_Iterations	=	1024;
+	static const int		cfgBenchmark13_Reference	=	2231;
+	//[14] culling(OCL+qsort)
+	bool					cfgBenchmark14_Enable		=	cfgEnable;
+	static const int		cfgBenchmark14_Iterations	=	8192;
+	static const int		cfgBenchmark14_Reference	=	3500;
+	//[15] culling(KDOP+qsort)
+	bool					cfgBenchmark15_Enable		=	cfgEnable;
+	static const int		cfgBenchmark15_Iterations	=	8192;
+	static const int		cfgBenchmark15_Reference	=	1151;
+	//[16] insert/remove batch
+	bool					cfgBenchmark16_Enable		=	cfgEnable;
+	static const int		cfgBenchmark16_BatchCount	=	256;
+	static const int		cfgBenchmark16_Passes		=	16384;
+	static const int		cfgBenchmark16_Reference	=	5138;
+	//[17] select
+	bool					cfgBenchmark17_Enable		=	cfgEnable;
+	static const int		cfgBenchmark17_Iterations	=	4;
+	static const int		cfgBenchmark17_Reference	=	3390;
+
+	btClock					wallclock;
+	printf("Benchmarking dbvt...\r\n");
+	printf("\tWorld scale: %f\r\n",cfgVolumeCenterScale);
+	printf("\tExtents base: %f\r\n",cfgVolumeExentsBase);
+	printf("\tExtents range: %f\r\n",cfgVolumeExentsScale);
+	printf("\tLeaves: %u\r\n",cfgLeaves);
+	printf("\tsizeof(btDbvtVolume): %u bytes\r\n",sizeof(btDbvtVolume));
+	printf("\tsizeof(btDbvtNode):   %u bytes\r\n",sizeof(btDbvtNode));
+	if(cfgBenchmark1_Enable)
+	{// Benchmark 1	
+		srand(380843);
+		btAlignedObjectArray<btDbvtVolume>	volumes;
+		btAlignedObjectArray<bool>			results;
+		volumes.resize(cfgLeaves);
+		results.resize(cfgLeaves);
+		for(int i=0;i<cfgLeaves;++i)
+		{
+			volumes[i]=btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale);
+		}
+		printf("[1] btDbvtVolume intersections: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark1_Iterations;++i)
+		{
+			for(int j=0;j<cfgLeaves;++j)
+			{
+				for(int k=0;k<cfgLeaves;++k)
+				{
+					results[k]=Intersect(volumes[j],volumes[k]);
+				}
+			}
+		}
+		const int time=(int)wallclock.getTimeMilliseconds();
+		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark1_Reference)*100/time);
+	}
+	if(cfgBenchmark2_Enable)
+	{// Benchmark 2	
+		srand(380843);
+		btAlignedObjectArray<btDbvtVolume>	volumes;
+		btAlignedObjectArray<btDbvtVolume>	results;
+		volumes.resize(cfgLeaves);
+		results.resize(cfgLeaves);
+		for(int i=0;i<cfgLeaves;++i)
+		{
+			volumes[i]=btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale);
+		}
+		printf("[2] btDbvtVolume merges: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark2_Iterations;++i)
+		{
+			for(int j=0;j<cfgLeaves;++j)
+			{
+				for(int k=0;k<cfgLeaves;++k)
+				{
+					Merge(volumes[j],volumes[k],results[k]);
+				}
+			}
+		}
+		const int time=(int)wallclock.getTimeMilliseconds();
+		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark2_Reference)*100/time);
+	}
+	if(cfgBenchmark3_Enable)
+	{// Benchmark 3	
+		srand(380843);
+		btDbvt						dbvt[2];
+		btDbvtBenchmark::NilPolicy	policy;
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt[0]);
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt[1]);
+		dbvt[0].optimizeTopDown();
+		dbvt[1].optimizeTopDown();
+		printf("[3] btDbvt::collideTT: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark3_Iterations;++i)
+		{
+			btDbvt::collideTT(dbvt[0].m_root,dbvt[1].m_root,policy);
+		}
+		const int time=(int)wallclock.getTimeMilliseconds();
+		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark3_Reference)*100/time);
+	}
+	if(cfgBenchmark4_Enable)
+	{// Benchmark 4
+		srand(380843);
+		btDbvt						dbvt;
+		btDbvtBenchmark::NilPolicy	policy;
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		printf("[4] btDbvt::collideTT self: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark4_Iterations;++i)
+		{
+			btDbvt::collideTT(dbvt.m_root,dbvt.m_root,policy);
+		}
+		const int time=(int)wallclock.getTimeMilliseconds();
+		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark4_Reference)*100/time);
+	}
+	if(cfgBenchmark5_Enable)
+	{// Benchmark 5	
+		srand(380843);
+		btDbvt								dbvt[2];
+		btAlignedObjectArray<btTransform>	transforms;
+		btDbvtBenchmark::NilPolicy			policy;
+		transforms.resize(cfgBenchmark5_Iterations);
+		for(int i=0;i<transforms.size();++i)
+		{
+			transforms[i]=btDbvtBenchmark::RandTransform(cfgVolumeCenterScale*cfgBenchmark5_OffsetScale);
+		}
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt[0]);
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt[1]);
+		dbvt[0].optimizeTopDown();
+		dbvt[1].optimizeTopDown();
+		printf("[5] btDbvt::collideTT xform: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark5_Iterations;++i)
+		{
+			btDbvt::collideTT(dbvt[0].m_root,dbvt[1].m_root,transforms[i],policy);
+		}
+		const int time=(int)wallclock.getTimeMilliseconds();
+		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark5_Reference)*100/time);
+	}
+	if(cfgBenchmark6_Enable)
+	{// Benchmark 6	
+		srand(380843);
+		btDbvt								dbvt;
+		btAlignedObjectArray<btTransform>	transforms;
+		btDbvtBenchmark::NilPolicy			policy;
+		transforms.resize(cfgBenchmark6_Iterations);
+		for(int i=0;i<transforms.size();++i)
+		{
+			transforms[i]=btDbvtBenchmark::RandTransform(cfgVolumeCenterScale*cfgBenchmark6_OffsetScale);
+		}
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		printf("[6] btDbvt::collideTT xform,self: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark6_Iterations;++i)
+		{
+			btDbvt::collideTT(dbvt.m_root,dbvt.m_root,transforms[i],policy);		
+		}
+		const int time=(int)wallclock.getTimeMilliseconds();
+		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark6_Reference)*100/time);
+	}
+	if(cfgBenchmark7_Enable)
+	{// Benchmark 7	
+		srand(380843);
+		btDbvt								dbvt;
+		btAlignedObjectArray<btVector3>		rayorg;
+		btAlignedObjectArray<btVector3>		raydir;
+		btDbvtBenchmark::NilPolicy			policy;
+		rayorg.resize(cfgBenchmark7_Iterations);
+		raydir.resize(cfgBenchmark7_Iterations);
+		for(int i=0;i<rayorg.size();++i)
+		{
+			rayorg[i]=btDbvtBenchmark::RandVector3(cfgVolumeCenterScale*2);
+			raydir[i]=btDbvtBenchmark::RandVector3(cfgVolumeCenterScale*2);
+		}
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		printf("[7] btDbvt::rayTest: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark7_Passes;++i)
+		{
+			for(int j=0;j<cfgBenchmark7_Iterations;++j)
+			{
+				btDbvt::rayTest(dbvt.m_root,rayorg[j],rayorg[j]+raydir[j],policy);
+			}
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		unsigned	rays=cfgBenchmark7_Passes*cfgBenchmark7_Iterations;
+		printf("%u ms (%i%%),(%u r/s)\r\n",time,(time-cfgBenchmark7_Reference)*100/time,(rays*1000)/time);
+	}
+	if(cfgBenchmark8_Enable)
+	{// Benchmark 8	
+		srand(380843);
+		btDbvt								dbvt;
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		printf("[8] insert/remove: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark8_Passes;++i)
+		{
+			for(int j=0;j<cfgBenchmark8_Iterations;++j)
+			{
+				dbvt.remove(dbvt.insert(btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale),0));
+			}
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		const int	ir=cfgBenchmark8_Passes*cfgBenchmark8_Iterations;
+		printf("%u ms (%i%%),(%u ir/s)\r\n",time,(time-cfgBenchmark8_Reference)*100/time,ir*1000/time);
+	}
+	if(cfgBenchmark9_Enable)
+	{// Benchmark 9	
+		srand(380843);
+		btDbvt										dbvt;
+		btAlignedObjectArray<const btDbvtNode*>	leaves;
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		dbvt.extractLeaves(dbvt.m_root,leaves);
+		printf("[9] updates (teleport): ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark9_Passes;++i)
+		{
+			for(int j=0;j<cfgBenchmark9_Iterations;++j)
+			{
+				dbvt.update(const_cast<btDbvtNode*>(leaves[rand()%cfgLeaves]),
+					btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale));
+			}
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		const int	up=cfgBenchmark9_Passes*cfgBenchmark9_Iterations;
+		printf("%u ms (%i%%),(%u u/s)\r\n",time,(time-cfgBenchmark9_Reference)*100/time,up*1000/time);
+	}
+	if(cfgBenchmark10_Enable)
+	{// Benchmark 10	
+		srand(380843);
+		btDbvt										dbvt;
+		btAlignedObjectArray<const btDbvtNode*>	leaves;
+		btAlignedObjectArray<btVector3>				vectors;
+		vectors.resize(cfgBenchmark10_Iterations);
+		for(int i=0;i<vectors.size();++i)
+		{
+			vectors[i]=(btDbvtBenchmark::RandVector3()*2-btVector3(1,1,1))*cfgBenchmark10_Scale;
+		}
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		dbvt.extractLeaves(dbvt.m_root,leaves);
+		printf("[10] updates (jitter): ");
+		wallclock.reset();
+
+		for(int i=0;i<cfgBenchmark10_Passes;++i)
+		{
+			for(int j=0;j<cfgBenchmark10_Iterations;++j)
+			{			
+				const btVector3&	d=vectors[j];
+				btDbvtNode*		l=const_cast<btDbvtNode*>(leaves[rand()%cfgLeaves]);
+				btDbvtVolume		v=btDbvtVolume::FromMM(l->volume.Mins()+d,l->volume.Maxs()+d);
+				dbvt.update(l,v);
+			}
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		const int	up=cfgBenchmark10_Passes*cfgBenchmark10_Iterations;
+		printf("%u ms (%i%%),(%u u/s)\r\n",time,(time-cfgBenchmark10_Reference)*100/time,up*1000/time);
+	}
+	if(cfgBenchmark11_Enable)
+	{// Benchmark 11	
+		srand(380843);
+		btDbvt										dbvt;
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		printf("[11] optimize (incremental): ");
+		wallclock.reset();	
+		for(int i=0;i<cfgBenchmark11_Passes;++i)
+		{
+			dbvt.optimizeIncremental(cfgBenchmark11_Iterations);
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		const int	op=cfgBenchmark11_Passes*cfgBenchmark11_Iterations;
+		printf("%u ms (%i%%),(%u o/s)\r\n",time,(time-cfgBenchmark11_Reference)*100/time,op/time*1000);
+	}
+	if(cfgBenchmark12_Enable)
+	{// Benchmark 12	
+		srand(380843);
+		btAlignedObjectArray<btDbvtVolume>	volumes;
+		btAlignedObjectArray<bool>				results;
+		volumes.resize(cfgLeaves);
+		results.resize(cfgLeaves);
+		for(int i=0;i<cfgLeaves;++i)
+		{
+			volumes[i]=btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale);
+		}
+		printf("[12] btDbvtVolume notequal: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark12_Iterations;++i)
+		{
+			for(int j=0;j<cfgLeaves;++j)
+			{
+				for(int k=0;k<cfgLeaves;++k)
+				{
+					results[k]=NotEqual(volumes[j],volumes[k]);
+				}
+			}
+		}
+		const int time=(int)wallclock.getTimeMilliseconds();
+		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark12_Reference)*100/time);
+	}
+	if(cfgBenchmark13_Enable)
+	{// Benchmark 13	
+		srand(380843);
+		btDbvt								dbvt;
+		btAlignedObjectArray<btVector3>		vectors;
+		btDbvtBenchmark::NilPolicy			policy;
+		vectors.resize(cfgBenchmark13_Iterations);
+		for(int i=0;i<vectors.size();++i)
+		{
+			vectors[i]=(btDbvtBenchmark::RandVector3()*2-btVector3(1,1,1)).normalized();
+		}
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		printf("[13] culling(OCL+fullsort): ");
+		wallclock.reset();	
+		for(int i=0;i<cfgBenchmark13_Iterations;++i)
+		{
+			static const btScalar	offset=0;
+			policy.m_depth=-SIMD_INFINITY;
+			dbvt.collideOCL(dbvt.m_root,&vectors[i],&offset,vectors[i],1,policy);
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		const int	t=cfgBenchmark13_Iterations;
+		printf("%u ms (%i%%),(%u t/s)\r\n",time,(time-cfgBenchmark13_Reference)*100/time,(t*1000)/time);
+	}
+	if(cfgBenchmark14_Enable)
+	{// Benchmark 14	
+		srand(380843);
+		btDbvt								dbvt;
+		btAlignedObjectArray<btVector3>		vectors;
+		btDbvtBenchmark::P14				policy;
+		vectors.resize(cfgBenchmark14_Iterations);
+		for(int i=0;i<vectors.size();++i)
+		{
+			vectors[i]=(btDbvtBenchmark::RandVector3()*2-btVector3(1,1,1)).normalized();
+		}
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		policy.m_nodes.reserve(cfgLeaves);
+		printf("[14] culling(OCL+qsort): ");
+		wallclock.reset();	
+		for(int i=0;i<cfgBenchmark14_Iterations;++i)
+		{
+			static const btScalar	offset=0;
+			policy.m_nodes.resize(0);
+			dbvt.collideOCL(dbvt.m_root,&vectors[i],&offset,vectors[i],1,policy,false);
+			policy.m_nodes.quickSort(btDbvtBenchmark::P14::sortfnc);
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		const int	t=cfgBenchmark14_Iterations;
+		printf("%u ms (%i%%),(%u t/s)\r\n",time,(time-cfgBenchmark14_Reference)*100/time,(t*1000)/time);
+	}
+	if(cfgBenchmark15_Enable)
+	{// Benchmark 15	
+		srand(380843);
+		btDbvt								dbvt;
+		btAlignedObjectArray<btVector3>		vectors;
+		btDbvtBenchmark::P15				policy;
+		vectors.resize(cfgBenchmark15_Iterations);
+		for(int i=0;i<vectors.size();++i)
+		{
+			vectors[i]=(btDbvtBenchmark::RandVector3()*2-btVector3(1,1,1)).normalized();
+		}
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		policy.m_nodes.reserve(cfgLeaves);
+		printf("[15] culling(KDOP+qsort): ");
+		wallclock.reset();	
+		for(int i=0;i<cfgBenchmark15_Iterations;++i)
+		{
+			static const btScalar	offset=0;
+			policy.m_nodes.resize(0);
+			policy.m_axis=vectors[i];
+			dbvt.collideKDOP(dbvt.m_root,&vectors[i],&offset,1,policy);
+			policy.m_nodes.quickSort(btDbvtBenchmark::P15::sortfnc);
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		const int	t=cfgBenchmark15_Iterations;
+		printf("%u ms (%i%%),(%u t/s)\r\n",time,(time-cfgBenchmark15_Reference)*100/time,(t*1000)/time);
+	}
+	if(cfgBenchmark16_Enable)
+	{// Benchmark 16	
+		srand(380843);
+		btDbvt								dbvt;
+		btAlignedObjectArray<btDbvtNode*>	batch;
+		btDbvtBenchmark::RandTree(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale,cfgLeaves,dbvt);
+		dbvt.optimizeTopDown();
+		batch.reserve(cfgBenchmark16_BatchCount);
+		printf("[16] insert/remove batch(%u): ",cfgBenchmark16_BatchCount);
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark16_Passes;++i)
+		{
+			for(int j=0;j<cfgBenchmark16_BatchCount;++j)
+			{
+				batch.push_back(dbvt.insert(btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale),0));
+			}
+			for(int j=0;j<cfgBenchmark16_BatchCount;++j)
+			{
+				dbvt.remove(batch[j]);
+			}
+			batch.resize(0);
+		}
+		const int	time=(int)wallclock.getTimeMilliseconds();
+		const int	ir=cfgBenchmark16_Passes*cfgBenchmark16_BatchCount;
+		printf("%u ms (%i%%),(%u bir/s)\r\n",time,(time-cfgBenchmark16_Reference)*100/time,int(ir*1000.0/time));
+	}
+	if(cfgBenchmark17_Enable)
+	{// Benchmark 17
+		srand(380843);
+		btAlignedObjectArray<btDbvtVolume>	volumes;
+		btAlignedObjectArray<int>			results;
+		btAlignedObjectArray<int>			indices;
+		volumes.resize(cfgLeaves);
+		results.resize(cfgLeaves);
+		indices.resize(cfgLeaves);
+		for(int i=0;i<cfgLeaves;++i)
+		{
+			indices[i]=i;
+			volumes[i]=btDbvtBenchmark::RandVolume(cfgVolumeCenterScale,cfgVolumeExentsBase,cfgVolumeExentsScale);
+		}
+		for(int i=0;i<cfgLeaves;++i)
+		{
+			btSwap(indices[i],indices[rand()%cfgLeaves]);
+		}
+		printf("[17] btDbvtVolume select: ");
+		wallclock.reset();
+		for(int i=0;i<cfgBenchmark17_Iterations;++i)
+		{
+			for(int j=0;j<cfgLeaves;++j)
+			{
+				for(int k=0;k<cfgLeaves;++k)
+				{
+					const int idx=indices[k];
+					results[idx]=Select(volumes[idx],volumes[j],volumes[k]);
+				}
+			}
+		}
+		const int time=(int)wallclock.getTimeMilliseconds();
+		printf("%u ms (%i%%)\r\n",time,(time-cfgBenchmark17_Reference)*100/time);
+	}
+	printf("\r\n\r\n");
+}
+#endif
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.h
new file mode 100644
index 0000000..2bb8ef5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvt.h
@@ -0,0 +1,1256 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+///btDbvt implementation by Nathanael Presson
+
+#ifndef BT_DYNAMIC_BOUNDING_VOLUME_TREE_H
+#define BT_DYNAMIC_BOUNDING_VOLUME_TREE_H
+
+#include "LinearMath/btAlignedObjectArray.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btAabbUtil2.h"
+
+//
+// Compile time configuration
+//
+
+
+// Implementation profiles
+#define DBVT_IMPL_GENERIC		0	// Generic implementation	
+#define DBVT_IMPL_SSE			1	// SSE
+
+// Template implementation of ICollide
+#ifdef _WIN32
+#if (defined (_MSC_VER) && _MSC_VER >= 1400)
+#define	DBVT_USE_TEMPLATE		1
+#else
+#define	DBVT_USE_TEMPLATE		0
+#endif
+#else
+#define	DBVT_USE_TEMPLATE		0
+#endif
+
+// Use only intrinsics instead of inline asm
+#define DBVT_USE_INTRINSIC_SSE	1
+
+// Using memmov for collideOCL
+#define DBVT_USE_MEMMOVE		1
+
+// Enable benchmarking code
+#define	DBVT_ENABLE_BENCHMARK	0
+
+// Inlining
+#define DBVT_INLINE				SIMD_FORCE_INLINE
+
+// Specific methods implementation
+
+//SSE gives errors on a MSVC 7.1
+#if defined (BT_USE_SSE) && defined (_WIN32)
+#define DBVT_SELECT_IMPL		DBVT_IMPL_SSE
+#define DBVT_MERGE_IMPL			DBVT_IMPL_SSE
+#define DBVT_INT0_IMPL			DBVT_IMPL_SSE
+#else
+#define DBVT_SELECT_IMPL		DBVT_IMPL_GENERIC
+#define DBVT_MERGE_IMPL			DBVT_IMPL_GENERIC
+#define DBVT_INT0_IMPL			DBVT_IMPL_GENERIC
+#endif
+
+#if	(DBVT_SELECT_IMPL==DBVT_IMPL_SSE)||	\
+	(DBVT_MERGE_IMPL==DBVT_IMPL_SSE)||	\
+	(DBVT_INT0_IMPL==DBVT_IMPL_SSE)
+#include <emmintrin.h>
+#endif
+
+//
+// Auto config and checks
+//
+
+#if DBVT_USE_TEMPLATE
+#define	DBVT_VIRTUAL
+#define DBVT_VIRTUAL_DTOR(a)
+#define DBVT_PREFIX					template <typename T>
+#define DBVT_IPOLICY				T& policy
+#define DBVT_CHECKTYPE				static const ICollide&	typechecker=*(T*)1;(void)typechecker;
+#else
+#define	DBVT_VIRTUAL_DTOR(a)		virtual ~a() {}
+#define DBVT_VIRTUAL				virtual
+#define DBVT_PREFIX
+#define DBVT_IPOLICY				ICollide& policy
+#define DBVT_CHECKTYPE
+#endif
+
+#if DBVT_USE_MEMMOVE
+#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)
+#include <memory.h>
+#endif
+#include <string.h>
+#endif
+
+#ifndef DBVT_USE_TEMPLATE
+#error "DBVT_USE_TEMPLATE undefined"
+#endif
+
+#ifndef DBVT_USE_MEMMOVE
+#error "DBVT_USE_MEMMOVE undefined"
+#endif
+
+#ifndef DBVT_ENABLE_BENCHMARK
+#error "DBVT_ENABLE_BENCHMARK undefined"
+#endif
+
+#ifndef DBVT_SELECT_IMPL
+#error "DBVT_SELECT_IMPL undefined"
+#endif
+
+#ifndef DBVT_MERGE_IMPL
+#error "DBVT_MERGE_IMPL undefined"
+#endif
+
+#ifndef DBVT_INT0_IMPL
+#error "DBVT_INT0_IMPL undefined"
+#endif
+
+//
+// Defaults volumes
+//
+
+/* btDbvtAabbMm			*/ 
+struct	btDbvtAabbMm
+{
+	DBVT_INLINE btVector3			Center() const	{ return((mi+mx)/2); }
+	DBVT_INLINE btVector3			Lengths() const	{ return(mx-mi); }
+	DBVT_INLINE btVector3			Extents() const	{ return((mx-mi)/2); }
+	DBVT_INLINE const btVector3&	Mins() const	{ return(mi); }
+	DBVT_INLINE const btVector3&	Maxs() const	{ return(mx); }
+	static inline btDbvtAabbMm		FromCE(const btVector3& c,const btVector3& e);
+	static inline btDbvtAabbMm		FromCR(const btVector3& c,btScalar r);
+	static inline btDbvtAabbMm		FromMM(const btVector3& mi,const btVector3& mx);
+	static inline btDbvtAabbMm		FromPoints(const btVector3* pts,int n);
+	static inline btDbvtAabbMm		FromPoints(const btVector3** ppts,int n);
+	DBVT_INLINE void				Expand(const btVector3& e);
+	DBVT_INLINE void				SignedExpand(const btVector3& e);
+	DBVT_INLINE bool				Contain(const btDbvtAabbMm& a) const;
+	DBVT_INLINE int					Classify(const btVector3& n,btScalar o,int s) const;
+	DBVT_INLINE btScalar			ProjectMinimum(const btVector3& v,unsigned signs) const;
+	DBVT_INLINE friend bool			Intersect(	const btDbvtAabbMm& a,
+		const btDbvtAabbMm& b);
+	
+	DBVT_INLINE friend bool			Intersect(	const btDbvtAabbMm& a,
+		const btVector3& b);
+
+	DBVT_INLINE friend btScalar		Proximity(	const btDbvtAabbMm& a,
+		const btDbvtAabbMm& b);
+	DBVT_INLINE friend int			Select(		const btDbvtAabbMm& o,
+		const btDbvtAabbMm& a,
+		const btDbvtAabbMm& b);
+	DBVT_INLINE friend void			Merge(		const btDbvtAabbMm& a,
+		const btDbvtAabbMm& b,
+		btDbvtAabbMm& r);
+	DBVT_INLINE friend bool			NotEqual(	const btDbvtAabbMm& a,
+		const btDbvtAabbMm& b);
+private:
+	DBVT_INLINE void				AddSpan(const btVector3& d,btScalar& smi,btScalar& smx) const;
+private:
+	btVector3	mi,mx;
+};
+
+// Types	
+typedef	btDbvtAabbMm	btDbvtVolume;
+
+/* btDbvtNode				*/ 
+struct	btDbvtNode
+{
+	btDbvtVolume	volume;
+	btDbvtNode*		parent;
+	DBVT_INLINE bool	isleaf() const		{ return(childs[1]==0); }
+	DBVT_INLINE bool	isinternal() const	{ return(!isleaf()); }
+	union
+	{
+		btDbvtNode*	childs[2];
+		void*	data;
+		int		dataAsInt;
+	};
+};
+
+///The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes (aabb tree).
+///This btDbvt is used for soft body collision detection and for the btDbvtBroadphase. It has a fast insert, remove and update of nodes.
+///Unlike the btQuantizedBvh, nodes can be dynamically moved around, which allows for change in topology of the underlying data structure.
+struct	btDbvt
+{
+	/* Stack element	*/ 
+	struct	sStkNN
+	{
+		const btDbvtNode*	a;
+		const btDbvtNode*	b;
+		sStkNN() {}
+		sStkNN(const btDbvtNode* na,const btDbvtNode* nb) : a(na),b(nb) {}
+	};
+	struct	sStkNP
+	{
+		const btDbvtNode*	node;
+		int			mask;
+		sStkNP(const btDbvtNode* n,unsigned m) : node(n),mask(m) {}
+	};
+	struct	sStkNPS
+	{
+		const btDbvtNode*	node;
+		int			mask;
+		btScalar	value;
+		sStkNPS() {}
+		sStkNPS(const btDbvtNode* n,unsigned m,btScalar v) : node(n),mask(m),value(v) {}
+	};
+	struct	sStkCLN
+	{
+		const btDbvtNode*	node;
+		btDbvtNode*		parent;
+		sStkCLN(const btDbvtNode* n,btDbvtNode* p) : node(n),parent(p) {}
+	};
+	// Policies/Interfaces
+
+	/* ICollide	*/ 
+	struct	ICollide
+	{		
+		DBVT_VIRTUAL_DTOR(ICollide)
+			DBVT_VIRTUAL void	Process(const btDbvtNode*,const btDbvtNode*)		{}
+		DBVT_VIRTUAL void	Process(const btDbvtNode*)					{}
+		DBVT_VIRTUAL void	Process(const btDbvtNode* n,btScalar)			{ Process(n); }
+		DBVT_VIRTUAL bool	Descent(const btDbvtNode*)					{ return(true); }
+		DBVT_VIRTUAL bool	AllLeaves(const btDbvtNode*)					{ return(true); }
+	};
+	/* IWriter	*/ 
+	struct	IWriter
+	{
+		virtual ~IWriter() {}
+		virtual void		Prepare(const btDbvtNode* root,int numnodes)=0;
+		virtual void		WriteNode(const btDbvtNode*,int index,int parent,int child0,int child1)=0;
+		virtual void		WriteLeaf(const btDbvtNode*,int index,int parent)=0;
+	};
+	/* IClone	*/ 
+	struct	IClone
+	{
+		virtual ~IClone()	{}
+		virtual void		CloneLeaf(btDbvtNode*) {}
+	};
+
+	// Constants
+	enum	{
+		SIMPLE_STACKSIZE	=	64,
+		DOUBLE_STACKSIZE	=	SIMPLE_STACKSIZE*2
+	};
+
+	// Fields
+	btDbvtNode*		m_root;
+	btDbvtNode*		m_free;
+	int				m_lkhd;
+	int				m_leaves;
+	unsigned		m_opath;
+
+	
+	btAlignedObjectArray<sStkNN>	m_stkStack;
+
+
+	// Methods
+	btDbvt();
+	~btDbvt();
+	void			clear();
+	bool			empty() const { return(0==m_root); }
+	void			optimizeBottomUp();
+	void			optimizeTopDown(int bu_treshold=128);
+	void			optimizeIncremental(int passes);
+	btDbvtNode*		insert(const btDbvtVolume& box,void* data);
+	void			update(btDbvtNode* leaf,int lookahead=-1);
+	void			update(btDbvtNode* leaf,btDbvtVolume& volume);
+	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity,btScalar margin);
+	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity);
+	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,btScalar margin);	
+	void			remove(btDbvtNode* leaf);
+	void			write(IWriter* iwriter) const;
+	void			clone(btDbvt& dest,IClone* iclone=0) const;
+	static int		maxdepth(const btDbvtNode* node);
+	static int		countLeaves(const btDbvtNode* node);
+	static void		extractLeaves(const btDbvtNode* node,btAlignedObjectArray<const btDbvtNode*>& leaves);
+#if DBVT_ENABLE_BENCHMARK
+	static void		benchmark();
+#else
+	static void		benchmark(){}
+#endif
+	// DBVT_IPOLICY must support ICollide policy/interface
+	DBVT_PREFIX
+		static void		enumNodes(	const btDbvtNode* root,
+		DBVT_IPOLICY);
+	DBVT_PREFIX
+		static void		enumLeaves(	const btDbvtNode* root,
+		DBVT_IPOLICY);
+	DBVT_PREFIX
+		void		collideTT(	const btDbvtNode* root0,
+		const btDbvtNode* root1,
+		DBVT_IPOLICY);
+
+	DBVT_PREFIX
+		void		collideTTpersistentStack(	const btDbvtNode* root0,
+		  const btDbvtNode* root1,
+		  DBVT_IPOLICY);
+#if 0
+	DBVT_PREFIX
+		void		collideTT(	const btDbvtNode* root0,
+		const btDbvtNode* root1,
+		const btTransform& xform,
+		DBVT_IPOLICY);
+	DBVT_PREFIX
+		void		collideTT(	const btDbvtNode* root0,
+		const btTransform& xform0,
+		const btDbvtNode* root1,
+		const btTransform& xform1,
+		DBVT_IPOLICY);
+#endif
+
+	DBVT_PREFIX
+		void		collideTV(	const btDbvtNode* root,
+		const btDbvtVolume& volume,
+		DBVT_IPOLICY);
+	///rayTest is a re-entrant ray test, and can be called in parallel as long as the btAlignedAlloc is thread-safe (uses locking etc)
+	///rayTest is slower than rayTestInternal, because it builds a local stack, using memory allocations, and it recomputes signs/rayDirectionInverses each time
+	DBVT_PREFIX
+		static void		rayTest(	const btDbvtNode* root,
+		const btVector3& rayFrom,
+		const btVector3& rayTo,
+		DBVT_IPOLICY);
+	///rayTestInternal is faster than rayTest, because it uses a persistent stack (to reduce dynamic memory allocations to a minimum) and it uses precomputed signs/rayInverseDirections
+	///rayTestInternal is used by btDbvtBroadphase to accelerate world ray casts
+	DBVT_PREFIX
+		void		rayTestInternal(	const btDbvtNode* root,
+								const btVector3& rayFrom,
+								const btVector3& rayTo,
+								const btVector3& rayDirectionInverse,
+								unsigned int signs[3],
+								btScalar lambda_max,
+								const btVector3& aabbMin,
+								const btVector3& aabbMax,
+								DBVT_IPOLICY) const;
+
+	DBVT_PREFIX
+		static void		collideKDOP(const btDbvtNode* root,
+		const btVector3* normals,
+		const btScalar* offsets,
+		int count,
+		DBVT_IPOLICY);
+	DBVT_PREFIX
+		static void		collideOCL(	const btDbvtNode* root,
+		const btVector3* normals,
+		const btScalar* offsets,
+		const btVector3& sortaxis,
+		int count,								
+		DBVT_IPOLICY,
+		bool fullsort=true);
+	DBVT_PREFIX
+		static void		collideTU(	const btDbvtNode* root,
+		DBVT_IPOLICY);
+	// Helpers	
+	static DBVT_INLINE int	nearest(const int* i,const btDbvt::sStkNPS* a,btScalar v,int l,int h)
+	{
+		int	m=0;
+		while(l<h)
+		{
+			m=(l+h)>>1;
+			if(a[i[m]].value>=v) l=m+1; else h=m;
+		}
+		return(h);
+	}
+	static DBVT_INLINE int	allocate(	btAlignedObjectArray<int>& ifree,
+		btAlignedObjectArray<sStkNPS>& stock,
+		const sStkNPS& value)
+	{
+		int	i;
+		if(ifree.size()>0)
+		{ i=ifree[ifree.size()-1];ifree.pop_back();stock[i]=value; }
+		else
+		{ i=stock.size();stock.push_back(value); }
+		return(i); 
+	}
+	//
+private:
+	btDbvt(const btDbvt&)	{}	
+};
+
+//
+// Inline's
+//
+
+//
+inline btDbvtAabbMm			btDbvtAabbMm::FromCE(const btVector3& c,const btVector3& e)
+{
+	btDbvtAabbMm box;
+	box.mi=c-e;box.mx=c+e;
+	return(box);
+}
+
+//
+inline btDbvtAabbMm			btDbvtAabbMm::FromCR(const btVector3& c,btScalar r)
+{
+	return(FromCE(c,btVector3(r,r,r)));
+}
+
+//
+inline btDbvtAabbMm			btDbvtAabbMm::FromMM(const btVector3& mi,const btVector3& mx)
+{
+	btDbvtAabbMm box;
+	box.mi=mi;box.mx=mx;
+	return(box);
+}
+
+//
+inline btDbvtAabbMm			btDbvtAabbMm::FromPoints(const btVector3* pts,int n)
+{
+	btDbvtAabbMm box;
+	box.mi=box.mx=pts[0];
+	for(int i=1;i<n;++i)
+	{
+		box.mi.setMin(pts[i]);
+		box.mx.setMax(pts[i]);
+	}
+	return(box);
+}
+
+//
+inline btDbvtAabbMm			btDbvtAabbMm::FromPoints(const btVector3** ppts,int n)
+{
+	btDbvtAabbMm box;
+	box.mi=box.mx=*ppts[0];
+	for(int i=1;i<n;++i)
+	{
+		box.mi.setMin(*ppts[i]);
+		box.mx.setMax(*ppts[i]);
+	}
+	return(box);
+}
+
+//
+DBVT_INLINE void		btDbvtAabbMm::Expand(const btVector3& e)
+{
+	mi-=e;mx+=e;
+}
+
+//
+DBVT_INLINE void		btDbvtAabbMm::SignedExpand(const btVector3& e)
+{
+	if(e.x()>0) mx.setX(mx.x()+e[0]); else mi.setX(mi.x()+e[0]);
+	if(e.y()>0) mx.setY(mx.y()+e[1]); else mi.setY(mi.y()+e[1]);
+	if(e.z()>0) mx.setZ(mx.z()+e[2]); else mi.setZ(mi.z()+e[2]);
+}
+
+//
+DBVT_INLINE bool		btDbvtAabbMm::Contain(const btDbvtAabbMm& a) const
+{
+	return(	(mi.x()<=a.mi.x())&&
+		(mi.y()<=a.mi.y())&&
+		(mi.z()<=a.mi.z())&&
+		(mx.x()>=a.mx.x())&&
+		(mx.y()>=a.mx.y())&&
+		(mx.z()>=a.mx.z()));
+}
+
+//
+DBVT_INLINE int		btDbvtAabbMm::Classify(const btVector3& n,btScalar o,int s) const
+{
+	btVector3			pi,px;
+	switch(s)
+	{
+	case	(0+0+0):	px=btVector3(mi.x(),mi.y(),mi.z());
+		pi=btVector3(mx.x(),mx.y(),mx.z());break;
+	case	(1+0+0):	px=btVector3(mx.x(),mi.y(),mi.z());
+		pi=btVector3(mi.x(),mx.y(),mx.z());break;
+	case	(0+2+0):	px=btVector3(mi.x(),mx.y(),mi.z());
+		pi=btVector3(mx.x(),mi.y(),mx.z());break;
+	case	(1+2+0):	px=btVector3(mx.x(),mx.y(),mi.z());
+		pi=btVector3(mi.x(),mi.y(),mx.z());break;
+	case	(0+0+4):	px=btVector3(mi.x(),mi.y(),mx.z());
+		pi=btVector3(mx.x(),mx.y(),mi.z());break;
+	case	(1+0+4):	px=btVector3(mx.x(),mi.y(),mx.z());
+		pi=btVector3(mi.x(),mx.y(),mi.z());break;
+	case	(0+2+4):	px=btVector3(mi.x(),mx.y(),mx.z());
+		pi=btVector3(mx.x(),mi.y(),mi.z());break;
+	case	(1+2+4):	px=btVector3(mx.x(),mx.y(),mx.z());
+		pi=btVector3(mi.x(),mi.y(),mi.z());break;
+	}
+	if((btDot(n,px)+o)<0)		return(-1);
+	if((btDot(n,pi)+o)>=0)	return(+1);
+	return(0);
+}
+
+//
+DBVT_INLINE btScalar	btDbvtAabbMm::ProjectMinimum(const btVector3& v,unsigned signs) const
+{
+	const btVector3*	b[]={&mx,&mi};
+	const btVector3		p(	b[(signs>>0)&1]->x(),
+		b[(signs>>1)&1]->y(),
+		b[(signs>>2)&1]->z());
+	return(btDot(p,v));
+}
+
+//
+DBVT_INLINE void		btDbvtAabbMm::AddSpan(const btVector3& d,btScalar& smi,btScalar& smx) const
+{
+	for(int i=0;i<3;++i)
+	{
+		if(d[i]<0)
+		{ smi+=mx[i]*d[i];smx+=mi[i]*d[i]; }
+		else
+		{ smi+=mi[i]*d[i];smx+=mx[i]*d[i]; }
+	}
+}
+
+//
+DBVT_INLINE bool		Intersect(	const btDbvtAabbMm& a,
+								  const btDbvtAabbMm& b)
+{
+#if	DBVT_INT0_IMPL == DBVT_IMPL_SSE
+	const __m128	rt(_mm_or_ps(	_mm_cmplt_ps(_mm_load_ps(b.mx),_mm_load_ps(a.mi)),
+		_mm_cmplt_ps(_mm_load_ps(a.mx),_mm_load_ps(b.mi))));
+	const __int32*	pu((const __int32*)&rt);
+	return((pu[0]|pu[1]|pu[2])==0);
+#else
+	return(	(a.mi.x()<=b.mx.x())&&
+		(a.mx.x()>=b.mi.x())&&
+		(a.mi.y()<=b.mx.y())&&
+		(a.mx.y()>=b.mi.y())&&
+		(a.mi.z()<=b.mx.z())&&		
+		(a.mx.z()>=b.mi.z()));
+#endif
+}
+
+
+
+//
+DBVT_INLINE bool		Intersect(	const btDbvtAabbMm& a,
+								  const btVector3& b)
+{
+	return(	(b.x()>=a.mi.x())&&
+		(b.y()>=a.mi.y())&&
+		(b.z()>=a.mi.z())&&
+		(b.x()<=a.mx.x())&&
+		(b.y()<=a.mx.y())&&
+		(b.z()<=a.mx.z()));
+}
+
+
+
+
+
+//////////////////////////////////////
+
+
+//
+DBVT_INLINE btScalar	Proximity(	const btDbvtAabbMm& a,
+								  const btDbvtAabbMm& b)
+{
+	const btVector3	d=(a.mi+a.mx)-(b.mi+b.mx);
+	return(btFabs(d.x())+btFabs(d.y())+btFabs(d.z()));
+}
+
+
+
+//
+DBVT_INLINE int			Select(	const btDbvtAabbMm& o,
+							   const btDbvtAabbMm& a,
+							   const btDbvtAabbMm& b)
+{
+#if	DBVT_SELECT_IMPL == DBVT_IMPL_SSE
+	static ATTRIBUTE_ALIGNED16(const unsigned __int32)	mask[]={0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff};
+	///@todo: the intrinsic version is 11% slower
+#if DBVT_USE_INTRINSIC_SSE
+
+	union btSSEUnion ///NOTE: if we use more intrinsics, move btSSEUnion into the LinearMath directory
+	{
+	   __m128		ssereg;
+	   float		floats[4];
+	   int			ints[4];
+	};
+
+	__m128	omi(_mm_load_ps(o.mi));
+	omi=_mm_add_ps(omi,_mm_load_ps(o.mx));
+	__m128	ami(_mm_load_ps(a.mi));
+	ami=_mm_add_ps(ami,_mm_load_ps(a.mx));
+	ami=_mm_sub_ps(ami,omi);
+	ami=_mm_and_ps(ami,_mm_load_ps((const float*)mask));
+	__m128	bmi(_mm_load_ps(b.mi));
+	bmi=_mm_add_ps(bmi,_mm_load_ps(b.mx));
+	bmi=_mm_sub_ps(bmi,omi);
+	bmi=_mm_and_ps(bmi,_mm_load_ps((const float*)mask));
+	__m128	t0(_mm_movehl_ps(ami,ami));
+	ami=_mm_add_ps(ami,t0);
+	ami=_mm_add_ss(ami,_mm_shuffle_ps(ami,ami,1));
+	__m128 t1(_mm_movehl_ps(bmi,bmi));
+	bmi=_mm_add_ps(bmi,t1);
+	bmi=_mm_add_ss(bmi,_mm_shuffle_ps(bmi,bmi,1));
+	
+	btSSEUnion tmp;
+	tmp.ssereg = _mm_cmple_ss(bmi,ami);
+	return tmp.ints[0]&1;
+
+#else
+	ATTRIBUTE_ALIGNED16(__int32	r[1]);
+	__asm
+	{
+		mov		eax,o
+			mov		ecx,a
+			mov		edx,b
+			movaps	xmm0,[eax]
+		movaps	xmm5,mask
+			addps	xmm0,[eax+16]	
+		movaps	xmm1,[ecx]
+		movaps	xmm2,[edx]
+		addps	xmm1,[ecx+16]
+		addps	xmm2,[edx+16]
+		subps	xmm1,xmm0
+			subps	xmm2,xmm0
+			andps	xmm1,xmm5
+			andps	xmm2,xmm5
+			movhlps	xmm3,xmm1
+			movhlps	xmm4,xmm2
+			addps	xmm1,xmm3
+			addps	xmm2,xmm4
+			pshufd	xmm3,xmm1,1
+			pshufd	xmm4,xmm2,1
+			addss	xmm1,xmm3
+			addss	xmm2,xmm4
+			cmpless	xmm2,xmm1
+			movss	r,xmm2
+	}
+	return(r[0]&1);
+#endif
+#else
+	return(Proximity(o,a)<Proximity(o,b)?0:1);
+#endif
+}
+
+//
+DBVT_INLINE void		Merge(	const btDbvtAabbMm& a,
+							  const btDbvtAabbMm& b,
+							  btDbvtAabbMm& r)
+{
+#if DBVT_MERGE_IMPL==DBVT_IMPL_SSE
+	__m128	ami(_mm_load_ps(a.mi));
+	__m128	amx(_mm_load_ps(a.mx));
+	__m128	bmi(_mm_load_ps(b.mi));
+	__m128	bmx(_mm_load_ps(b.mx));
+	ami=_mm_min_ps(ami,bmi);
+	amx=_mm_max_ps(amx,bmx);
+	_mm_store_ps(r.mi,ami);
+	_mm_store_ps(r.mx,amx);
+#else
+	for(int i=0;i<3;++i)
+	{
+		if(a.mi[i]<b.mi[i]) r.mi[i]=a.mi[i]; else r.mi[i]=b.mi[i];
+		if(a.mx[i]>b.mx[i]) r.mx[i]=a.mx[i]; else r.mx[i]=b.mx[i];
+	}
+#endif
+}
+
+//
+DBVT_INLINE bool		NotEqual(	const btDbvtAabbMm& a,
+								 const btDbvtAabbMm& b)
+{
+	return(	(a.mi.x()!=b.mi.x())||
+		(a.mi.y()!=b.mi.y())||
+		(a.mi.z()!=b.mi.z())||
+		(a.mx.x()!=b.mx.x())||
+		(a.mx.y()!=b.mx.y())||
+		(a.mx.z()!=b.mx.z()));
+}
+
+//
+// Inline's
+//
+
+//
+DBVT_PREFIX
+inline void		btDbvt::enumNodes(	const btDbvtNode* root,
+								  DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		policy.Process(root);
+	if(root->isinternal())
+	{
+		enumNodes(root->childs[0],policy);
+		enumNodes(root->childs[1],policy);
+	}
+}
+
+//
+DBVT_PREFIX
+inline void		btDbvt::enumLeaves(	const btDbvtNode* root,
+								   DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		if(root->isinternal())
+		{
+			enumLeaves(root->childs[0],policy);
+			enumLeaves(root->childs[1],policy);
+		}
+		else
+		{
+			policy.Process(root);
+		}
+}
+
+//
+DBVT_PREFIX
+inline void		btDbvt::collideTT(	const btDbvtNode* root0,
+								  const btDbvtNode* root1,
+								  DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		if(root0&&root1)
+		{
+			int								depth=1;
+			int								treshold=DOUBLE_STACKSIZE-4;
+			btAlignedObjectArray<sStkNN>	stkStack;
+			stkStack.resize(DOUBLE_STACKSIZE);
+			stkStack[0]=sStkNN(root0,root1);
+			do	{		
+				sStkNN	p=stkStack[--depth];
+				if(depth>treshold)
+				{
+					stkStack.resize(stkStack.size()*2);
+					treshold=stkStack.size()-4;
+				}
+				if(p.a==p.b)
+				{
+					if(p.a->isinternal())
+					{
+						stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[0]);
+						stkStack[depth++]=sStkNN(p.a->childs[1],p.a->childs[1]);
+						stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[1]);
+					}
+				}
+				else if(Intersect(p.a->volume,p.b->volume))
+				{
+					if(p.a->isinternal())
+					{
+						if(p.b->isinternal())
+						{
+							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);
+							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);
+							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);
+							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);
+						}
+						else
+						{
+							stkStack[depth++]=sStkNN(p.a->childs[0],p.b);
+							stkStack[depth++]=sStkNN(p.a->childs[1],p.b);
+						}
+					}
+					else
+					{
+						if(p.b->isinternal())
+						{
+							stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);
+							stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);
+						}
+						else
+						{
+							policy.Process(p.a,p.b);
+						}
+					}
+				}
+			} while(depth);
+		}
+}
+
+
+
+DBVT_PREFIX
+inline void		btDbvt::collideTTpersistentStack(	const btDbvtNode* root0,
+								  const btDbvtNode* root1,
+								  DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		if(root0&&root1)
+		{
+			int								depth=1;
+			int								treshold=DOUBLE_STACKSIZE-4;
+			
+			m_stkStack.resize(DOUBLE_STACKSIZE);
+			m_stkStack[0]=sStkNN(root0,root1);
+			do	{		
+				sStkNN	p=m_stkStack[--depth];
+				if(depth>treshold)
+				{
+					m_stkStack.resize(m_stkStack.size()*2);
+					treshold=m_stkStack.size()-4;
+				}
+				if(p.a==p.b)
+				{
+					if(p.a->isinternal())
+					{
+						m_stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[0]);
+						m_stkStack[depth++]=sStkNN(p.a->childs[1],p.a->childs[1]);
+						m_stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[1]);
+					}
+				}
+				else if(Intersect(p.a->volume,p.b->volume))
+				{
+					if(p.a->isinternal())
+					{
+						if(p.b->isinternal())
+						{
+							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);
+							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);
+							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);
+							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);
+						}
+						else
+						{
+							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b);
+							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b);
+						}
+					}
+					else
+					{
+						if(p.b->isinternal())
+						{
+							m_stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);
+							m_stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);
+						}
+						else
+						{
+							policy.Process(p.a,p.b);
+						}
+					}
+				}
+			} while(depth);
+		}
+}
+
+#if 0
+//
+DBVT_PREFIX
+inline void		btDbvt::collideTT(	const btDbvtNode* root0,
+								  const btDbvtNode* root1,
+								  const btTransform& xform,
+								  DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		if(root0&&root1)
+		{
+			int								depth=1;
+			int								treshold=DOUBLE_STACKSIZE-4;
+			btAlignedObjectArray<sStkNN>	stkStack;
+			stkStack.resize(DOUBLE_STACKSIZE);
+			stkStack[0]=sStkNN(root0,root1);
+			do	{
+				sStkNN	p=stkStack[--depth];
+				if(Intersect(p.a->volume,p.b->volume,xform))
+				{
+					if(depth>treshold)
+					{
+						stkStack.resize(stkStack.size()*2);
+						treshold=stkStack.size()-4;
+					}
+					if(p.a->isinternal())
+					{
+						if(p.b->isinternal())
+						{					
+							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);
+							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);
+							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);
+							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);
+						}
+						else
+						{
+							stkStack[depth++]=sStkNN(p.a->childs[0],p.b);
+							stkStack[depth++]=sStkNN(p.a->childs[1],p.b);
+						}
+					}
+					else
+					{
+						if(p.b->isinternal())
+						{
+							stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);
+							stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);
+						}
+						else
+						{
+							policy.Process(p.a,p.b);
+						}
+					}
+				}
+			} while(depth);
+		}
+}
+//
+DBVT_PREFIX
+inline void		btDbvt::collideTT(	const btDbvtNode* root0,
+								  const btTransform& xform0,
+								  const btDbvtNode* root1,
+								  const btTransform& xform1,
+								  DBVT_IPOLICY)
+{
+	const btTransform	xform=xform0.inverse()*xform1;
+	collideTT(root0,root1,xform,policy);
+}
+#endif 
+
+//
+DBVT_PREFIX
+inline void		btDbvt::collideTV(	const btDbvtNode* root,
+								  const btDbvtVolume& vol,
+								  DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		if(root)
+		{
+			ATTRIBUTE_ALIGNED16(btDbvtVolume)		volume(vol);
+			btAlignedObjectArray<const btDbvtNode*>	stack;
+			stack.resize(0);
+			stack.reserve(SIMPLE_STACKSIZE);
+			stack.push_back(root);
+			do	{
+				const btDbvtNode*	n=stack[stack.size()-1];
+				stack.pop_back();
+				if(Intersect(n->volume,volume))
+				{
+					if(n->isinternal())
+					{
+						stack.push_back(n->childs[0]);
+						stack.push_back(n->childs[1]);
+					}
+					else
+					{
+						policy.Process(n);
+					}
+				}
+			} while(stack.size()>0);
+		}
+}
+
+DBVT_PREFIX
+inline void		btDbvt::rayTestInternal(	const btDbvtNode* root,
+								const btVector3& rayFrom,
+								const btVector3& rayTo,
+								const btVector3& rayDirectionInverse,
+								unsigned int signs[3],
+								btScalar lambda_max,
+								const btVector3& aabbMin,
+								const btVector3& aabbMax,
+								DBVT_IPOLICY) const
+{
+        (void) rayTo;
+	DBVT_CHECKTYPE
+	if(root)
+	{
+		btVector3 resultNormal;
+
+		int								depth=1;
+		int								treshold=DOUBLE_STACKSIZE-2;
+		btAlignedObjectArray<const btDbvtNode*>	stack;
+		stack.resize(DOUBLE_STACKSIZE);
+		stack[0]=root;
+		btVector3 bounds[2];
+		do	
+		{
+			const btDbvtNode*	node=stack[--depth];
+			bounds[0] = node->volume.Mins()-aabbMax;
+			bounds[1] = node->volume.Maxs()-aabbMin;
+			btScalar tmin=1.f,lambda_min=0.f;
+			unsigned int result1=false;
+			result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);
+			if(result1)
+			{
+				if(node->isinternal())
+				{
+					if(depth>treshold)
+					{
+						stack.resize(stack.size()*2);
+						treshold=stack.size()-2;
+					}
+					stack[depth++]=node->childs[0];
+					stack[depth++]=node->childs[1];
+				}
+				else
+				{
+					policy.Process(node);
+				}
+			}
+		} while(depth);
+	}
+}
+
+//
+DBVT_PREFIX
+inline void		btDbvt::rayTest(	const btDbvtNode* root,
+								const btVector3& rayFrom,
+								const btVector3& rayTo,
+								DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		if(root)
+		{
+			btVector3 rayDir = (rayTo-rayFrom);
+			rayDir.normalize ();
+
+			///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
+			btVector3 rayDirectionInverse;
+			rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
+			rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
+			rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
+			unsigned int signs[3] = { rayDirectionInverse[0] < 0.0, rayDirectionInverse[1] < 0.0, rayDirectionInverse[2] < 0.0};
+
+			btScalar lambda_max = rayDir.dot(rayTo-rayFrom);
+
+			btVector3 resultNormal;
+
+			btAlignedObjectArray<const btDbvtNode*>	stack;
+
+			int								depth=1;
+			int								treshold=DOUBLE_STACKSIZE-2;
+
+			stack.resize(DOUBLE_STACKSIZE);
+			stack[0]=root;
+			btVector3 bounds[2];
+			do	{
+				const btDbvtNode*	node=stack[--depth];
+
+				bounds[0] = node->volume.Mins();
+				bounds[1] = node->volume.Maxs();
+				
+				btScalar tmin=1.f,lambda_min=0.f;
+				unsigned int result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);
+
+#ifdef COMPARE_BTRAY_AABB2
+				btScalar param=1.f;
+				bool result2 = btRayAabb(rayFrom,rayTo,node->volume.Mins(),node->volume.Maxs(),param,resultNormal);
+				btAssert(result1 == result2);
+#endif //TEST_BTRAY_AABB2
+
+				if(result1)
+				{
+					if(node->isinternal())
+					{
+						if(depth>treshold)
+						{
+							stack.resize(stack.size()*2);
+							treshold=stack.size()-2;
+						}
+						stack[depth++]=node->childs[0];
+						stack[depth++]=node->childs[1];
+					}
+					else
+					{
+						policy.Process(node);
+					}
+				}
+			} while(depth);
+
+		}
+}
+
+//
+DBVT_PREFIX
+inline void		btDbvt::collideKDOP(const btDbvtNode* root,
+									const btVector3* normals,
+									const btScalar* offsets,
+									int count,
+									DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		if(root)
+		{
+			const int						inside=(1<<count)-1;
+			btAlignedObjectArray<sStkNP>	stack;
+			int								signs[sizeof(unsigned)*8];
+			btAssert(count<int (sizeof(signs)/sizeof(signs[0])));
+			for(int i=0;i<count;++i)
+			{
+				signs[i]=	((normals[i].x()>=0)?1:0)+
+					((normals[i].y()>=0)?2:0)+
+					((normals[i].z()>=0)?4:0);
+			}
+			stack.reserve(SIMPLE_STACKSIZE);
+			stack.push_back(sStkNP(root,0));
+			do	{
+				sStkNP	se=stack[stack.size()-1];
+				bool	out=false;
+				stack.pop_back();
+				for(int i=0,j=1;(!out)&&(i<count);++i,j<<=1)
+				{
+					if(0==(se.mask&j))
+					{
+						const int	side=se.node->volume.Classify(normals[i],offsets[i],signs[i]);
+						switch(side)
+						{
+						case	-1:	out=true;break;
+						case	+1:	se.mask|=j;break;
+						}
+					}
+				}
+				if(!out)
+				{
+					if((se.mask!=inside)&&(se.node->isinternal()))
+					{
+						stack.push_back(sStkNP(se.node->childs[0],se.mask));
+						stack.push_back(sStkNP(se.node->childs[1],se.mask));
+					}
+					else
+					{
+						if(policy.AllLeaves(se.node)) enumLeaves(se.node,policy);
+					}
+				}
+			} while(stack.size());
+		}
+}
+
+//
+DBVT_PREFIX
+inline void		btDbvt::collideOCL(	const btDbvtNode* root,
+								   const btVector3* normals,
+								   const btScalar* offsets,
+								   const btVector3& sortaxis,
+								   int count,
+								   DBVT_IPOLICY,
+								   bool fsort)
+{
+	DBVT_CHECKTYPE
+		if(root)
+		{
+			const unsigned					srtsgns=(sortaxis[0]>=0?1:0)+
+				(sortaxis[1]>=0?2:0)+
+				(sortaxis[2]>=0?4:0);
+			const int						inside=(1<<count)-1;
+			btAlignedObjectArray<sStkNPS>	stock;
+			btAlignedObjectArray<int>		ifree;
+			btAlignedObjectArray<int>		stack;
+			int								signs[sizeof(unsigned)*8];
+			btAssert(count<int (sizeof(signs)/sizeof(signs[0])));
+			for(int i=0;i<count;++i)
+			{
+				signs[i]=	((normals[i].x()>=0)?1:0)+
+					((normals[i].y()>=0)?2:0)+
+					((normals[i].z()>=0)?4:0);
+			}
+			stock.reserve(SIMPLE_STACKSIZE);
+			stack.reserve(SIMPLE_STACKSIZE);
+			ifree.reserve(SIMPLE_STACKSIZE);
+			stack.push_back(allocate(ifree,stock,sStkNPS(root,0,root->volume.ProjectMinimum(sortaxis,srtsgns))));
+			do	{
+				const int	id=stack[stack.size()-1];
+				sStkNPS		se=stock[id];
+				stack.pop_back();ifree.push_back(id);
+				if(se.mask!=inside)
+				{
+					bool	out=false;
+					for(int i=0,j=1;(!out)&&(i<count);++i,j<<=1)
+					{
+						if(0==(se.mask&j))
+						{
+							const int	side=se.node->volume.Classify(normals[i],offsets[i],signs[i]);
+							switch(side)
+							{
+							case	-1:	out=true;break;
+							case	+1:	se.mask|=j;break;
+							}
+						}
+					}
+					if(out) continue;
+				}
+				if(policy.Descent(se.node))
+				{
+					if(se.node->isinternal())
+					{
+						const btDbvtNode* pns[]={	se.node->childs[0],se.node->childs[1]};
+						sStkNPS		nes[]={	sStkNPS(pns[0],se.mask,pns[0]->volume.ProjectMinimum(sortaxis,srtsgns)),
+							sStkNPS(pns[1],se.mask,pns[1]->volume.ProjectMinimum(sortaxis,srtsgns))};
+						const int	q=nes[0].value<nes[1].value?1:0;				
+						int			j=stack.size();
+						if(fsort&&(j>0))
+						{
+							/* Insert 0	*/ 
+							j=nearest(&stack[0],&stock[0],nes[q].value,0,stack.size());
+							stack.push_back(0);
+#if DBVT_USE_MEMMOVE
+							memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));
+#else
+							for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];
+#endif
+							stack[j]=allocate(ifree,stock,nes[q]);
+							/* Insert 1	*/ 
+							j=nearest(&stack[0],&stock[0],nes[1-q].value,j,stack.size());
+							stack.push_back(0);
+#if DBVT_USE_MEMMOVE
+							memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));
+#else
+							for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];
+#endif
+							stack[j]=allocate(ifree,stock,nes[1-q]);
+						}
+						else
+						{
+							stack.push_back(allocate(ifree,stock,nes[q]));
+							stack.push_back(allocate(ifree,stock,nes[1-q]));
+						}
+					}
+					else
+					{
+						policy.Process(se.node,se.value);
+					}
+				}
+			} while(stack.size());
+		}
+}
+
+//
+DBVT_PREFIX
+inline void		btDbvt::collideTU(	const btDbvtNode* root,
+								  DBVT_IPOLICY)
+{
+	DBVT_CHECKTYPE
+		if(root)
+		{
+			btAlignedObjectArray<const btDbvtNode*>	stack;
+			stack.reserve(SIMPLE_STACKSIZE);
+			stack.push_back(root);
+			do	{
+				const btDbvtNode*	n=stack[stack.size()-1];
+				stack.pop_back();
+				if(policy.Descent(n))
+				{
+					if(n->isinternal())
+					{ stack.push_back(n->childs[0]);stack.push_back(n->childs[1]); }
+					else
+					{ policy.Process(n); }
+				}
+			} while(stack.size()>0);
+		}
+}
+
+//
+// PP Cleanup
+//
+
+#undef DBVT_USE_MEMMOVE
+#undef DBVT_USE_TEMPLATE
+#undef DBVT_VIRTUAL_DTOR
+#undef DBVT_VIRTUAL
+#undef DBVT_PREFIX
+#undef DBVT_IPOLICY
+#undef DBVT_CHECKTYPE
+#undef DBVT_IMPL_GENERIC
+#undef DBVT_IMPL_SSE
+#undef DBVT_USE_INTRINSIC_SSE
+#undef DBVT_SELECT_IMPL
+#undef DBVT_MERGE_IMPL
+#undef DBVT_INT0_IMPL
+
+#endif
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
new file mode 100644
index 0000000..75cfac6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
@@ -0,0 +1,796 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///btDbvtBroadphase implementation by Nathanael Presson
+
+#include "btDbvtBroadphase.h"
+
+//
+// Profiling
+//
+
+#if DBVT_BP_PROFILE||DBVT_BP_ENABLE_BENCHMARK
+#include <stdio.h>
+#endif
+
+#if DBVT_BP_PROFILE
+struct	ProfileScope
+{
+	__forceinline ProfileScope(btClock& clock,unsigned long& value) :
+	m_clock(&clock),m_value(&value),m_base(clock.getTimeMicroseconds())
+	{
+	}
+	__forceinline ~ProfileScope()
+	{
+		(*m_value)+=m_clock->getTimeMicroseconds()-m_base;
+	}
+	btClock*		m_clock;
+	unsigned long*	m_value;
+	unsigned long	m_base;
+};
+#define	SPC(_value_)	ProfileScope	spc_scope(m_clock,_value_)
+#else
+#define	SPC(_value_)
+#endif
+
+//
+// Helpers
+//
+
+//
+template <typename T>
+static inline void	listappend(T* item,T*& list)
+{
+	item->links[0]=0;
+	item->links[1]=list;
+	if(list) list->links[0]=item;
+	list=item;
+}
+
+//
+template <typename T>
+static inline void	listremove(T* item,T*& list)
+{
+	if(item->links[0]) item->links[0]->links[1]=item->links[1]; else list=item->links[1];
+	if(item->links[1]) item->links[1]->links[0]=item->links[0];
+}
+
+//
+template <typename T>
+static inline int	listcount(T* root)
+{
+	int	n=0;
+	while(root) { ++n;root=root->links[1]; }
+	return(n);
+}
+
+//
+template <typename T>
+static inline void	clear(T& value)
+{
+	static const struct ZeroDummy : T {} zerodummy;
+	value=zerodummy;
+}
+
+//
+// Colliders
+//
+
+/* Tree collider	*/ 
+struct	btDbvtTreeCollider : btDbvt::ICollide
+{
+	btDbvtBroadphase*	pbp;
+	btDbvtProxy*		proxy;
+	btDbvtTreeCollider(btDbvtBroadphase* p) : pbp(p) {}
+	void	Process(const btDbvtNode* na,const btDbvtNode* nb)
+	{
+		if(na!=nb)
+		{
+			btDbvtProxy*	pa=(btDbvtProxy*)na->data;
+			btDbvtProxy*	pb=(btDbvtProxy*)nb->data;
+#if DBVT_BP_SORTPAIRS
+			if(pa->m_uniqueId>pb->m_uniqueId) 
+				btSwap(pa,pb);
+#endif
+			pbp->m_paircache->addOverlappingPair(pa,pb);
+			++pbp->m_newpairs;
+		}
+	}
+	void	Process(const btDbvtNode* n)
+	{
+		Process(n,proxy->leaf);
+	}
+};
+
+//
+// btDbvtBroadphase
+//
+
+//
+btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache* paircache)
+{
+	m_deferedcollide	=	false;
+	m_needcleanup		=	true;
+	m_releasepaircache	=	(paircache!=0)?false:true;
+	m_prediction		=	0;
+	m_stageCurrent		=	0;
+	m_fixedleft			=	0;
+	m_fupdates			=	1;
+	m_dupdates			=	0;
+	m_cupdates			=	10;
+	m_newpairs			=	1;
+	m_updates_call		=	0;
+	m_updates_done		=	0;
+	m_updates_ratio		=	0;
+	m_paircache			=	paircache? paircache	: new(btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache();
+	m_gid				=	0;
+	m_pid				=	0;
+	m_cid				=	0;
+	for(int i=0;i<=STAGECOUNT;++i)
+	{
+		m_stageRoots[i]=0;
+	}
+#if DBVT_BP_PROFILE
+	clear(m_profiling);
+#endif
+}
+
+//
+btDbvtBroadphase::~btDbvtBroadphase()
+{
+	if(m_releasepaircache) 
+	{
+		m_paircache->~btOverlappingPairCache();
+		btAlignedFree(m_paircache);
+	}
+}
+
+//
+btBroadphaseProxy*				btDbvtBroadphase::createProxy(	const btVector3& aabbMin,
+															  const btVector3& aabbMax,
+															  int /*shapeType*/,
+															  void* userPtr,
+															  short int collisionFilterGroup,
+															  short int collisionFilterMask,
+															  btDispatcher* /*dispatcher*/,
+															  void* /*multiSapProxy*/)
+{
+	btDbvtProxy*		proxy=new(btAlignedAlloc(sizeof(btDbvtProxy),16)) btDbvtProxy(	aabbMin,aabbMax,userPtr,
+		collisionFilterGroup,
+		collisionFilterMask);
+
+	btDbvtAabbMm aabb = btDbvtVolume::FromMM(aabbMin,aabbMax);
+
+	//bproxy->aabb			=	btDbvtVolume::FromMM(aabbMin,aabbMax);
+	proxy->stage		=	m_stageCurrent;
+	proxy->m_uniqueId	=	++m_gid;
+	proxy->leaf			=	m_sets[0].insert(aabb,proxy);
+	listappend(proxy,m_stageRoots[m_stageCurrent]);
+	if(!m_deferedcollide)
+	{
+		btDbvtTreeCollider	collider(this);
+		collider.proxy=proxy;
+		m_sets[0].collideTV(m_sets[0].m_root,aabb,collider);
+		m_sets[1].collideTV(m_sets[1].m_root,aabb,collider);
+	}
+	return(proxy);
+}
+
+//
+void							btDbvtBroadphase::destroyProxy(	btBroadphaseProxy* absproxy,
+															   btDispatcher* dispatcher)
+{
+	btDbvtProxy*	proxy=(btDbvtProxy*)absproxy;
+	if(proxy->stage==STAGECOUNT)
+		m_sets[1].remove(proxy->leaf);
+	else
+		m_sets[0].remove(proxy->leaf);
+	listremove(proxy,m_stageRoots[proxy->stage]);
+	m_paircache->removeOverlappingPairsContainingProxy(proxy,dispatcher);
+	btAlignedFree(proxy);
+	m_needcleanup=true;
+}
+
+void	btDbvtBroadphase::getAabb(btBroadphaseProxy* absproxy,btVector3& aabbMin, btVector3& aabbMax ) const
+{
+	btDbvtProxy*						proxy=(btDbvtProxy*)absproxy;
+	aabbMin = proxy->m_aabbMin;
+	aabbMax = proxy->m_aabbMax;
+}
+
+struct	BroadphaseRayTester : btDbvt::ICollide
+{
+	btBroadphaseRayCallback& m_rayCallback;
+	BroadphaseRayTester(btBroadphaseRayCallback& orgCallback)
+		:m_rayCallback(orgCallback)
+	{
+	}
+	void					Process(const btDbvtNode* leaf)
+	{
+		btDbvtProxy*	proxy=(btDbvtProxy*)leaf->data;
+		m_rayCallback.process(proxy);
+	}
+};	
+
+void	btDbvtBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)
+{
+	BroadphaseRayTester callback(rayCallback);
+
+	m_sets[0].rayTestInternal(	m_sets[0].m_root,
+		rayFrom,
+		rayTo,
+		rayCallback.m_rayDirectionInverse,
+		rayCallback.m_signs,
+		rayCallback.m_lambda_max,
+		aabbMin,
+		aabbMax,
+		callback);
+
+	m_sets[1].rayTestInternal(	m_sets[1].m_root,
+		rayFrom,
+		rayTo,
+		rayCallback.m_rayDirectionInverse,
+		rayCallback.m_signs,
+		rayCallback.m_lambda_max,
+		aabbMin,
+		aabbMax,
+		callback);
+
+}
+
+
+struct	BroadphaseAabbTester : btDbvt::ICollide
+{
+	btBroadphaseAabbCallback& m_aabbCallback;
+	BroadphaseAabbTester(btBroadphaseAabbCallback& orgCallback)
+		:m_aabbCallback(orgCallback)
+	{
+	}
+	void					Process(const btDbvtNode* leaf)
+	{
+		btDbvtProxy*	proxy=(btDbvtProxy*)leaf->data;
+		m_aabbCallback.process(proxy);
+	}
+};	
+
+void	btDbvtBroadphase::aabbTest(const btVector3& aabbMin,const btVector3& aabbMax,btBroadphaseAabbCallback& aabbCallback)
+{
+	BroadphaseAabbTester callback(aabbCallback);
+
+	const ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds=btDbvtVolume::FromMM(aabbMin,aabbMax);
+		//process all children, that overlap with  the given AABB bounds
+	m_sets[0].collideTV(m_sets[0].m_root,bounds,callback);
+	m_sets[1].collideTV(m_sets[1].m_root,bounds,callback);
+
+}
+
+
+
+//
+void							btDbvtBroadphase::setAabb(		btBroadphaseProxy* absproxy,
+														  const btVector3& aabbMin,
+														  const btVector3& aabbMax,
+														  btDispatcher* /*dispatcher*/)
+{
+	btDbvtProxy*						proxy=(btDbvtProxy*)absproxy;
+	ATTRIBUTE_ALIGNED16(btDbvtVolume)	aabb=btDbvtVolume::FromMM(aabbMin,aabbMax);
+#if DBVT_BP_PREVENTFALSEUPDATE
+	if(NotEqual(aabb,proxy->leaf->volume))
+#endif
+	{
+		bool	docollide=false;
+		if(proxy->stage==STAGECOUNT)
+		{/* fixed -> dynamic set	*/ 
+			m_sets[1].remove(proxy->leaf);
+			proxy->leaf=m_sets[0].insert(aabb,proxy);
+			docollide=true;
+		}
+		else
+		{/* dynamic set				*/ 
+			++m_updates_call;
+			if(Intersect(proxy->leaf->volume,aabb))
+			{/* Moving				*/ 
+
+				const btVector3	delta=aabbMin-proxy->m_aabbMin;
+				btVector3		velocity(((proxy->m_aabbMax-proxy->m_aabbMin)/2)*m_prediction);
+				if(delta[0]<0) velocity[0]=-velocity[0];
+				if(delta[1]<0) velocity[1]=-velocity[1];
+				if(delta[2]<0) velocity[2]=-velocity[2];
+				if	(
+#ifdef DBVT_BP_MARGIN				
+					m_sets[0].update(proxy->leaf,aabb,velocity,DBVT_BP_MARGIN)
+#else
+					m_sets[0].update(proxy->leaf,aabb,velocity)
+#endif
+					)
+				{
+					++m_updates_done;
+					docollide=true;
+				}
+			}
+			else
+			{/* Teleporting			*/ 
+				m_sets[0].update(proxy->leaf,aabb);
+				++m_updates_done;
+				docollide=true;
+			}	
+		}
+		listremove(proxy,m_stageRoots[proxy->stage]);
+		proxy->m_aabbMin = aabbMin;
+		proxy->m_aabbMax = aabbMax;
+		proxy->stage	=	m_stageCurrent;
+		listappend(proxy,m_stageRoots[m_stageCurrent]);
+		if(docollide)
+		{
+			m_needcleanup=true;
+			if(!m_deferedcollide)
+			{
+				btDbvtTreeCollider	collider(this);
+				m_sets[1].collideTTpersistentStack(m_sets[1].m_root,proxy->leaf,collider);
+				m_sets[0].collideTTpersistentStack(m_sets[0].m_root,proxy->leaf,collider);
+			}
+		}	
+	}
+}
+
+
+//
+void							btDbvtBroadphase::setAabbForceUpdate(		btBroadphaseProxy* absproxy,
+														  const btVector3& aabbMin,
+														  const btVector3& aabbMax,
+														  btDispatcher* /*dispatcher*/)
+{
+	btDbvtProxy*						proxy=(btDbvtProxy*)absproxy;
+	ATTRIBUTE_ALIGNED16(btDbvtVolume)	aabb=btDbvtVolume::FromMM(aabbMin,aabbMax);
+	bool	docollide=false;
+	if(proxy->stage==STAGECOUNT)
+	{/* fixed -> dynamic set	*/ 
+		m_sets[1].remove(proxy->leaf);
+		proxy->leaf=m_sets[0].insert(aabb,proxy);
+		docollide=true;
+	}
+	else
+	{/* dynamic set				*/ 
+		++m_updates_call;
+		/* Teleporting			*/ 
+		m_sets[0].update(proxy->leaf,aabb);
+		++m_updates_done;
+		docollide=true;
+	}
+	listremove(proxy,m_stageRoots[proxy->stage]);
+	proxy->m_aabbMin = aabbMin;
+	proxy->m_aabbMax = aabbMax;
+	proxy->stage	=	m_stageCurrent;
+	listappend(proxy,m_stageRoots[m_stageCurrent]);
+	if(docollide)
+	{
+		m_needcleanup=true;
+		if(!m_deferedcollide)
+		{
+			btDbvtTreeCollider	collider(this);
+			m_sets[1].collideTTpersistentStack(m_sets[1].m_root,proxy->leaf,collider);
+			m_sets[0].collideTTpersistentStack(m_sets[0].m_root,proxy->leaf,collider);
+		}
+	}	
+}
+
+//
+void							btDbvtBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
+{
+	collide(dispatcher);
+#if DBVT_BP_PROFILE
+	if(0==(m_pid%DBVT_BP_PROFILING_RATE))
+	{	
+		printf("fixed(%u) dynamics(%u) pairs(%u)\r\n",m_sets[1].m_leaves,m_sets[0].m_leaves,m_paircache->getNumOverlappingPairs());
+		unsigned int	total=m_profiling.m_total;
+		if(total<=0) total=1;
+		printf("ddcollide: %u%% (%uus)\r\n",(50+m_profiling.m_ddcollide*100)/total,m_profiling.m_ddcollide/DBVT_BP_PROFILING_RATE);
+		printf("fdcollide: %u%% (%uus)\r\n",(50+m_profiling.m_fdcollide*100)/total,m_profiling.m_fdcollide/DBVT_BP_PROFILING_RATE);
+		printf("cleanup:   %u%% (%uus)\r\n",(50+m_profiling.m_cleanup*100)/total,m_profiling.m_cleanup/DBVT_BP_PROFILING_RATE);
+		printf("total:     %uus\r\n",total/DBVT_BP_PROFILING_RATE);
+		const unsigned long	sum=m_profiling.m_ddcollide+
+			m_profiling.m_fdcollide+
+			m_profiling.m_cleanup;
+		printf("leaked: %u%% (%uus)\r\n",100-((50+sum*100)/total),(total-sum)/DBVT_BP_PROFILING_RATE);
+		printf("job counts: %u%%\r\n",(m_profiling.m_jobcount*100)/((m_sets[0].m_leaves+m_sets[1].m_leaves)*DBVT_BP_PROFILING_RATE));
+		clear(m_profiling);
+		m_clock.reset();
+	}
+#endif
+
+	performDeferredRemoval(dispatcher);
+
+}
+
+void btDbvtBroadphase::performDeferredRemoval(btDispatcher* dispatcher)
+{
+
+	if (m_paircache->hasDeferredRemoval())
+	{
+
+		btBroadphasePairArray&	overlappingPairArray = m_paircache->getOverlappingPairArray();
+
+		//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
+		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
+
+		int invalidPair = 0;
+
+		
+		int i;
+
+		btBroadphasePair previousPair;
+		previousPair.m_pProxy0 = 0;
+		previousPair.m_pProxy1 = 0;
+		previousPair.m_algorithm = 0;
+		
+		
+		for (i=0;i<overlappingPairArray.size();i++)
+		{
+		
+			btBroadphasePair& pair = overlappingPairArray[i];
+
+			bool isDuplicate = (pair == previousPair);
+
+			previousPair = pair;
+
+			bool needsRemoval = false;
+
+			if (!isDuplicate)
+			{
+				//important to perform AABB check that is consistent with the broadphase
+				btDbvtProxy*		pa=(btDbvtProxy*)pair.m_pProxy0;
+				btDbvtProxy*		pb=(btDbvtProxy*)pair.m_pProxy1;
+				bool hasOverlap = Intersect(pa->leaf->volume,pb->leaf->volume);
+
+				if (hasOverlap)
+				{
+					needsRemoval = false;
+				} else
+				{
+					needsRemoval = true;
+				}
+			} else
+			{
+				//remove duplicate
+				needsRemoval = true;
+				//should have no algorithm
+				btAssert(!pair.m_algorithm);
+			}
+			
+			if (needsRemoval)
+			{
+				m_paircache->cleanOverlappingPair(pair,dispatcher);
+
+				pair.m_pProxy0 = 0;
+				pair.m_pProxy1 = 0;
+				invalidPair++;
+			} 
+			
+		}
+
+		//perform a sort, to sort 'invalid' pairs to the end
+		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
+		overlappingPairArray.resize(overlappingPairArray.size() - invalidPair);
+	}
+}
+
+//
+void							btDbvtBroadphase::collide(btDispatcher* dispatcher)
+{
+	/*printf("---------------------------------------------------------\n");
+	printf("m_sets[0].m_leaves=%d\n",m_sets[0].m_leaves);
+	printf("m_sets[1].m_leaves=%d\n",m_sets[1].m_leaves);
+	printf("numPairs = %d\n",getOverlappingPairCache()->getNumOverlappingPairs());
+	{
+		int i;
+		for (i=0;i<getOverlappingPairCache()->getNumOverlappingPairs();i++)
+		{
+			printf("pair[%d]=(%d,%d),",i,getOverlappingPairCache()->getOverlappingPairArray()[i].m_pProxy0->getUid(),
+				getOverlappingPairCache()->getOverlappingPairArray()[i].m_pProxy1->getUid());
+		}
+		printf("\n");
+	}
+*/
+
+
+
+	SPC(m_profiling.m_total);
+	/* optimize				*/ 
+	m_sets[0].optimizeIncremental(1+(m_sets[0].m_leaves*m_dupdates)/100);
+	if(m_fixedleft)
+	{
+		const int count=1+(m_sets[1].m_leaves*m_fupdates)/100;
+		m_sets[1].optimizeIncremental(1+(m_sets[1].m_leaves*m_fupdates)/100);
+		m_fixedleft=btMax<int>(0,m_fixedleft-count);
+	}
+	/* dynamic -> fixed set	*/ 
+	m_stageCurrent=(m_stageCurrent+1)%STAGECOUNT;
+	btDbvtProxy*	current=m_stageRoots[m_stageCurrent];
+	if(current)
+	{
+		btDbvtTreeCollider	collider(this);
+		do	{
+			btDbvtProxy*	next=current->links[1];
+			listremove(current,m_stageRoots[current->stage]);
+			listappend(current,m_stageRoots[STAGECOUNT]);
+#if DBVT_BP_ACCURATESLEEPING
+			m_paircache->removeOverlappingPairsContainingProxy(current,dispatcher);
+			collider.proxy=current;
+			btDbvt::collideTV(m_sets[0].m_root,current->aabb,collider);
+			btDbvt::collideTV(m_sets[1].m_root,current->aabb,collider);
+#endif
+			m_sets[0].remove(current->leaf);
+			ATTRIBUTE_ALIGNED16(btDbvtVolume)	curAabb=btDbvtVolume::FromMM(current->m_aabbMin,current->m_aabbMax);
+			current->leaf	=	m_sets[1].insert(curAabb,current);
+			current->stage	=	STAGECOUNT;	
+			current			=	next;
+		} while(current);
+		m_fixedleft=m_sets[1].m_leaves;
+		m_needcleanup=true;
+	}
+	/* collide dynamics		*/ 
+	{
+		btDbvtTreeCollider	collider(this);
+		if(m_deferedcollide)
+		{
+			SPC(m_profiling.m_fdcollide);
+			m_sets[0].collideTTpersistentStack(m_sets[0].m_root,m_sets[1].m_root,collider);
+		}
+		if(m_deferedcollide)
+		{
+			SPC(m_profiling.m_ddcollide);
+			m_sets[0].collideTTpersistentStack(m_sets[0].m_root,m_sets[0].m_root,collider);
+		}
+	}
+	/* clean up				*/ 
+	if(m_needcleanup)
+	{
+		SPC(m_profiling.m_cleanup);
+		btBroadphasePairArray&	pairs=m_paircache->getOverlappingPairArray();
+		if(pairs.size()>0)
+		{
+
+			int			ni=btMin(pairs.size(),btMax<int>(m_newpairs,(pairs.size()*m_cupdates)/100));
+			for(int i=0;i<ni;++i)
+			{
+				btBroadphasePair&	p=pairs[(m_cid+i)%pairs.size()];
+				btDbvtProxy*		pa=(btDbvtProxy*)p.m_pProxy0;
+				btDbvtProxy*		pb=(btDbvtProxy*)p.m_pProxy1;
+				if(!Intersect(pa->leaf->volume,pb->leaf->volume))
+				{
+#if DBVT_BP_SORTPAIRS
+					if(pa->m_uniqueId>pb->m_uniqueId) 
+						btSwap(pa,pb);
+#endif
+					m_paircache->removeOverlappingPair(pa,pb,dispatcher);
+					--ni;--i;
+				}
+			}
+			if(pairs.size()>0) m_cid=(m_cid+ni)%pairs.size(); else m_cid=0;
+		}
+	}
+	++m_pid;
+	m_newpairs=1;
+	m_needcleanup=false;
+	if(m_updates_call>0)
+	{ m_updates_ratio=m_updates_done/(btScalar)m_updates_call; }
+	else
+	{ m_updates_ratio=0; }
+	m_updates_done/=2;
+	m_updates_call/=2;
+}
+
+//
+void							btDbvtBroadphase::optimize()
+{
+	m_sets[0].optimizeTopDown();
+	m_sets[1].optimizeTopDown();
+}
+
+//
+btOverlappingPairCache*			btDbvtBroadphase::getOverlappingPairCache()
+{
+	return(m_paircache);
+}
+
+//
+const btOverlappingPairCache*	btDbvtBroadphase::getOverlappingPairCache() const
+{
+	return(m_paircache);
+}
+
+//
+void							btDbvtBroadphase::getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
+{
+
+	ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds;
+
+	if(!m_sets[0].empty())
+		if(!m_sets[1].empty())	Merge(	m_sets[0].m_root->volume,
+			m_sets[1].m_root->volume,bounds);
+		else
+			bounds=m_sets[0].m_root->volume;
+	else if(!m_sets[1].empty())	bounds=m_sets[1].m_root->volume;
+	else
+		bounds=btDbvtVolume::FromCR(btVector3(0,0,0),0);
+	aabbMin=bounds.Mins();
+	aabbMax=bounds.Maxs();
+}
+
+void btDbvtBroadphase::resetPool(btDispatcher* dispatcher)
+{
+	
+	int totalObjects = m_sets[0].m_leaves + m_sets[1].m_leaves;
+	if (!totalObjects)
+	{
+		//reset internal dynamic tree data structures
+		m_sets[0].clear();
+		m_sets[1].clear();
+		
+		m_deferedcollide	=	false;
+		m_needcleanup		=	true;
+		m_stageCurrent		=	0;
+		m_fixedleft			=	0;
+		m_fupdates			=	1;
+		m_dupdates			=	0;
+		m_cupdates			=	10;
+		m_newpairs			=	1;
+		m_updates_call		=	0;
+		m_updates_done		=	0;
+		m_updates_ratio		=	0;
+		
+		m_gid				=	0;
+		m_pid				=	0;
+		m_cid				=	0;
+		for(int i=0;i<=STAGECOUNT;++i)
+		{
+			m_stageRoots[i]=0;
+		}
+	}
+}
+
+//
+void							btDbvtBroadphase::printStats()
+{}
+
+//
+#if DBVT_BP_ENABLE_BENCHMARK
+
+struct	btBroadphaseBenchmark
+{
+	struct	Experiment
+	{
+		const char*			name;
+		int					object_count;
+		int					update_count;
+		int					spawn_count;
+		int					iterations;
+		btScalar			speed;
+		btScalar			amplitude;
+	};
+	struct	Object
+	{
+		btVector3			center;
+		btVector3			extents;
+		btBroadphaseProxy*	proxy;
+		btScalar			time;
+		void				update(btScalar speed,btScalar amplitude,btBroadphaseInterface* pbi)
+		{
+			time		+=	speed;
+			center[0]	=	btCos(time*(btScalar)2.17)*amplitude+
+				btSin(time)*amplitude/2;
+			center[1]	=	btCos(time*(btScalar)1.38)*amplitude+
+				btSin(time)*amplitude;
+			center[2]	=	btSin(time*(btScalar)0.777)*amplitude;
+			pbi->setAabb(proxy,center-extents,center+extents,0);
+		}
+	};
+	static int		UnsignedRand(int range=RAND_MAX-1)	{ return(rand()%(range+1)); }
+	static btScalar	UnitRand()							{ return(UnsignedRand(16384)/(btScalar)16384); }
+	static void		OutputTime(const char* name,btClock& c,unsigned count=0)
+	{
+		const unsigned long	us=c.getTimeMicroseconds();
+		const unsigned long	ms=(us+500)/1000;
+		const btScalar		sec=us/(btScalar)(1000*1000);
+		if(count>0)
+			printf("%s : %u us (%u ms), %.2f/s\r\n",name,us,ms,count/sec);
+		else
+			printf("%s : %u us (%u ms)\r\n",name,us,ms);
+	}
+};
+
+void							btDbvtBroadphase::benchmark(btBroadphaseInterface* pbi)
+{
+	static const btBroadphaseBenchmark::Experiment		experiments[]=
+	{
+		{"1024o.10%",1024,10,0,8192,(btScalar)0.005,(btScalar)100},
+		/*{"4096o.10%",4096,10,0,8192,(btScalar)0.005,(btScalar)100},
+		{"8192o.10%",8192,10,0,8192,(btScalar)0.005,(btScalar)100},*/
+	};
+	static const int										nexperiments=sizeof(experiments)/sizeof(experiments[0]);
+	btAlignedObjectArray<btBroadphaseBenchmark::Object*>	objects;
+	btClock													wallclock;
+	/* Begin			*/ 
+	for(int iexp=0;iexp<nexperiments;++iexp)
+	{
+		const btBroadphaseBenchmark::Experiment&	experiment=experiments[iexp];
+		const int									object_count=experiment.object_count;
+		const int									update_count=(object_count*experiment.update_count)/100;
+		const int									spawn_count=(object_count*experiment.spawn_count)/100;
+		const btScalar								speed=experiment.speed;	
+		const btScalar								amplitude=experiment.amplitude;
+		printf("Experiment #%u '%s':\r\n",iexp,experiment.name);
+		printf("\tObjects: %u\r\n",object_count);
+		printf("\tUpdate: %u\r\n",update_count);
+		printf("\tSpawn: %u\r\n",spawn_count);
+		printf("\tSpeed: %f\r\n",speed);
+		printf("\tAmplitude: %f\r\n",amplitude);
+		srand(180673);
+		/* Create objects	*/ 
+		wallclock.reset();
+		objects.reserve(object_count);
+		for(int i=0;i<object_count;++i)
+		{
+			btBroadphaseBenchmark::Object*	po=new btBroadphaseBenchmark::Object();
+			po->center[0]=btBroadphaseBenchmark::UnitRand()*50;
+			po->center[1]=btBroadphaseBenchmark::UnitRand()*50;
+			po->center[2]=btBroadphaseBenchmark::UnitRand()*50;
+			po->extents[0]=btBroadphaseBenchmark::UnitRand()*2+2;
+			po->extents[1]=btBroadphaseBenchmark::UnitRand()*2+2;
+			po->extents[2]=btBroadphaseBenchmark::UnitRand()*2+2;
+			po->time=btBroadphaseBenchmark::UnitRand()*2000;
+			po->proxy=pbi->createProxy(po->center-po->extents,po->center+po->extents,0,po,1,1,0,0);
+			objects.push_back(po);
+		}
+		btBroadphaseBenchmark::OutputTime("\tInitialization",wallclock);
+		/* First update		*/ 
+		wallclock.reset();
+		for(int i=0;i<objects.size();++i)
+		{
+			objects[i]->update(speed,amplitude,pbi);
+		}
+		btBroadphaseBenchmark::OutputTime("\tFirst update",wallclock);
+		/* Updates			*/ 
+		wallclock.reset();
+		for(int i=0;i<experiment.iterations;++i)
+		{
+			for(int j=0;j<update_count;++j)
+			{				
+				objects[j]->update(speed,amplitude,pbi);
+			}
+			pbi->calculateOverlappingPairs(0);
+		}
+		btBroadphaseBenchmark::OutputTime("\tUpdate",wallclock,experiment.iterations);
+		/* Clean up			*/ 
+		wallclock.reset();
+		for(int i=0;i<objects.size();++i)
+		{
+			pbi->destroyProxy(objects[i]->proxy,0);
+			delete objects[i];
+		}
+		objects.resize(0);
+		btBroadphaseBenchmark::OutputTime("\tRelease",wallclock);
+	}
+
+}
+#else
+void							btDbvtBroadphase::benchmark(btBroadphaseInterface*)
+{}
+#endif
+
+#if DBVT_BP_PROFILE
+#undef	SPC
+#endif
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
new file mode 100644
index 0000000..18b64ad
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
@@ -0,0 +1,146 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///btDbvtBroadphase implementation by Nathanael Presson
+#ifndef BT_DBVT_BROADPHASE_H
+#define BT_DBVT_BROADPHASE_H
+
+#include "BulletCollision/BroadphaseCollision/btDbvt.h"
+#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
+
+//
+// Compile time config
+//
+
+#define	DBVT_BP_PROFILE					0
+//#define DBVT_BP_SORTPAIRS				1
+#define DBVT_BP_PREVENTFALSEUPDATE		0
+#define DBVT_BP_ACCURATESLEEPING		0
+#define DBVT_BP_ENABLE_BENCHMARK		0
+#define DBVT_BP_MARGIN					(btScalar)0.05
+
+#if DBVT_BP_PROFILE
+#define	DBVT_BP_PROFILING_RATE	256
+#include "LinearMath/btQuickprof.h"
+#endif
+
+//
+// btDbvtProxy
+//
+struct btDbvtProxy : btBroadphaseProxy
+{
+	/* Fields		*/ 
+	//btDbvtAabbMm	aabb;
+	btDbvtNode*		leaf;
+	btDbvtProxy*	links[2];
+	int				stage;
+	/* ctor			*/ 
+	btDbvtProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) :
+	btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask)
+	{
+		links[0]=links[1]=0;
+	}
+};
+
+typedef btAlignedObjectArray<btDbvtProxy*>	btDbvtProxyArray;
+
+///The btDbvtBroadphase implements a broadphase using two dynamic AABB bounding volume hierarchies/trees (see btDbvt).
+///One tree is used for static/non-moving objects, and another tree is used for dynamic objects. Objects can move from one tree to the other.
+///This is a very fast broadphase, especially for very dynamic worlds where many objects are moving. Its insert/add and remove of objects is generally faster than the sweep and prune broadphases btAxisSweep3 and bt32BitAxisSweep3.
+struct	btDbvtBroadphase : btBroadphaseInterface
+{
+	/* Config		*/ 
+	enum	{
+		DYNAMIC_SET			=	0,	/* Dynamic set index	*/ 
+		FIXED_SET			=	1,	/* Fixed set index		*/ 
+		STAGECOUNT			=	2	/* Number of stages		*/ 
+	};
+	/* Fields		*/ 
+	btDbvt					m_sets[2];					// Dbvt sets
+	btDbvtProxy*			m_stageRoots[STAGECOUNT+1];	// Stages list
+	btOverlappingPairCache*	m_paircache;				// Pair cache
+	btScalar				m_prediction;				// Velocity prediction
+	int						m_stageCurrent;				// Current stage
+	int						m_fupdates;					// % of fixed updates per frame
+	int						m_dupdates;					// % of dynamic updates per frame
+	int						m_cupdates;					// % of cleanup updates per frame
+	int						m_newpairs;					// Number of pairs created
+	int						m_fixedleft;				// Fixed optimization left
+	unsigned				m_updates_call;				// Number of updates call
+	unsigned				m_updates_done;				// Number of updates done
+	btScalar				m_updates_ratio;			// m_updates_done/m_updates_call
+	int						m_pid;						// Parse id
+	int						m_cid;						// Cleanup index
+	int						m_gid;						// Gen id
+	bool					m_releasepaircache;			// Release pair cache on delete
+	bool					m_deferedcollide;			// Defere dynamic/static collision to collide call
+	bool					m_needcleanup;				// Need to run cleanup?
+#if DBVT_BP_PROFILE
+	btClock					m_clock;
+	struct	{
+		unsigned long		m_total;
+		unsigned long		m_ddcollide;
+		unsigned long		m_fdcollide;
+		unsigned long		m_cleanup;
+		unsigned long		m_jobcount;
+	}				m_profiling;
+#endif
+	/* Methods		*/ 
+	btDbvtBroadphase(btOverlappingPairCache* paircache=0);
+	~btDbvtBroadphase();
+	void							collide(btDispatcher* dispatcher);
+	void							optimize();
+	
+	/* btBroadphaseInterface Implementation	*/
+	btBroadphaseProxy*				createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);
+	virtual void					destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+	virtual void					setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
+	virtual void					rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));
+	virtual void					aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
+
+	virtual void					getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
+	virtual	void					calculateOverlappingPairs(btDispatcher* dispatcher);
+	virtual	btOverlappingPairCache*	getOverlappingPairCache();
+	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const;
+	virtual	void					getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const;
+	virtual	void					printStats();
+
+
+	///reset broadphase internal structures, to ensure determinism/reproducability
+	virtual void resetPool(btDispatcher* dispatcher);
+
+	void	performDeferredRemoval(btDispatcher* dispatcher);
+	
+	void	setVelocityPrediction(btScalar prediction)
+	{
+		m_prediction = prediction;
+	}
+	btScalar getVelocityPrediction() const
+	{
+		return m_prediction;
+	}
+
+	///this setAabbForceUpdate is similar to setAabb but always forces the aabb update. 
+	///it is not part of the btBroadphaseInterface but specific to btDbvtBroadphase.
+	///it bypasses certain optimizations that prevent aabb updates (when the aabb shrinks), see
+	///http://code.google.com/p/bullet/issues/detail?id=223
+	void							setAabbForceUpdate(		btBroadphaseProxy* absproxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* /*dispatcher*/);
+
+	static void						benchmark(btBroadphaseInterface*);
+
+
+};
+
+#endif
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp
new file mode 100644
index 0000000..2076822
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.cpp
@@ -0,0 +1,22 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btDispatcher.h"
+
+btDispatcher::~btDispatcher()
+{
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h
new file mode 100644
index 0000000..a79cf94
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btDispatcher.h
@@ -0,0 +1,110 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_DISPATCHER_H
+#define BT_DISPATCHER_H
+#include "LinearMath/btScalar.h"
+
+class btCollisionAlgorithm;
+struct btBroadphaseProxy;
+class btRigidBody;
+class	btCollisionObject;
+class btOverlappingPairCache;
+
+
+class btPersistentManifold;
+class btStackAlloc;
+class btPoolAllocator;
+
+struct btDispatcherInfo
+{
+	enum DispatchFunc
+	{
+		DISPATCH_DISCRETE = 1,
+		DISPATCH_CONTINUOUS
+	};
+	btDispatcherInfo()
+		:m_timeStep(btScalar(0.)),
+		m_stepCount(0),
+		m_dispatchFunc(DISPATCH_DISCRETE),
+		m_timeOfImpact(btScalar(1.)),
+		m_useContinuous(true),
+		m_debugDraw(0),
+		m_enableSatConvex(false),
+		m_enableSPU(true),
+		m_useEpa(true),
+		m_allowedCcdPenetration(btScalar(0.04)),
+		m_useConvexConservativeDistanceUtil(false),
+		m_convexConservativeDistanceThreshold(0.0f),
+		m_stackAllocator(0)
+	{
+
+	}
+	btScalar	m_timeStep;
+	int			m_stepCount;
+	int			m_dispatchFunc;
+	mutable btScalar	m_timeOfImpact;
+	bool		m_useContinuous;
+	class btIDebugDraw*	m_debugDraw;
+	bool		m_enableSatConvex;
+	bool		m_enableSPU;
+	bool		m_useEpa;
+	btScalar	m_allowedCcdPenetration;
+	bool		m_useConvexConservativeDistanceUtil;
+	btScalar	m_convexConservativeDistanceThreshold;
+	btStackAlloc*	m_stackAllocator;
+};
+
+///The btDispatcher interface class can be used in combination with broadphase to dispatch calculations for overlapping pairs.
+///For example for pairwise collision detection, calculating contact points stored in btPersistentManifold or user callbacks (game logic).
+class btDispatcher
+{
+
+
+public:
+	virtual ~btDispatcher() ;
+
+	virtual btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold=0) = 0;
+
+	virtual btPersistentManifold*	getNewManifold(void* body0,void* body1)=0;
+
+	virtual void releaseManifold(btPersistentManifold* manifold)=0;
+
+	virtual void clearManifold(btPersistentManifold* manifold)=0;
+
+	virtual bool	needsCollision(btCollisionObject* body0,btCollisionObject* body1) = 0;
+
+	virtual bool	needsResponse(btCollisionObject* body0,btCollisionObject* body1)=0;
+
+	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher)  =0;
+
+	virtual int getNumManifolds() const = 0;
+
+	virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0;
+
+	virtual	btPersistentManifold**	getInternalManifoldPointer() = 0;
+
+	virtual	btPoolAllocator*	getInternalManifoldPool() = 0;
+
+	virtual	const btPoolAllocator*	getInternalManifoldPool() const = 0;
+
+	virtual	void* allocateCollisionAlgorithm(int size)  = 0;
+
+	virtual	void freeCollisionAlgorithm(void* ptr) = 0;
+
+};
+
+
+#endif //BT_DISPATCHER_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
new file mode 100644
index 0000000..6712f52
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
@@ -0,0 +1,489 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btMultiSapBroadphase.h"
+
+#include "btSimpleBroadphase.h"
+#include "LinearMath/btAabbUtil2.h"
+#include "btQuantizedBvh.h"
+
+///	btSapBroadphaseArray	m_sapBroadphases;
+
+///	btOverlappingPairCache*	m_overlappingPairs;
+extern int gOverlappingPairs;
+
+/*
+class btMultiSapSortedOverlappingPairCache : public btSortedOverlappingPairCache
+{
+public:
+
+	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
+	{
+		return btSortedOverlappingPairCache::addOverlappingPair((btBroadphaseProxy*)proxy0->m_multiSapParentProxy,(btBroadphaseProxy*)proxy1->m_multiSapParentProxy);
+	}
+};
+
+*/
+
+btMultiSapBroadphase::btMultiSapBroadphase(int /*maxProxies*/,btOverlappingPairCache* pairCache)
+:m_overlappingPairs(pairCache),
+m_optimizedAabbTree(0),
+m_ownsPairCache(false),
+m_invalidPair(0)
+{
+	if (!m_overlappingPairs)
+	{
+		m_ownsPairCache = true;
+		void* mem = btAlignedAlloc(sizeof(btSortedOverlappingPairCache),16);
+		m_overlappingPairs = new (mem)btSortedOverlappingPairCache();
+	}
+
+	struct btMultiSapOverlapFilterCallback : public btOverlapFilterCallback
+	{
+		virtual ~btMultiSapOverlapFilterCallback()
+		{}
+		// return true when pairs need collision
+		virtual bool	needBroadphaseCollision(btBroadphaseProxy* childProxy0,btBroadphaseProxy* childProxy1) const
+		{
+			btBroadphaseProxy* multiProxy0 = (btBroadphaseProxy*)childProxy0->m_multiSapParentProxy;
+			btBroadphaseProxy* multiProxy1 = (btBroadphaseProxy*)childProxy1->m_multiSapParentProxy;
+			
+			bool collides = (multiProxy0->m_collisionFilterGroup & multiProxy1->m_collisionFilterMask) != 0;
+			collides = collides && (multiProxy1->m_collisionFilterGroup & multiProxy0->m_collisionFilterMask);
+	
+			return collides;
+		}
+	};
+
+	void* mem = btAlignedAlloc(sizeof(btMultiSapOverlapFilterCallback),16);
+	m_filterCallback = new (mem)btMultiSapOverlapFilterCallback();
+
+	m_overlappingPairs->setOverlapFilterCallback(m_filterCallback);
+//	mem = btAlignedAlloc(sizeof(btSimpleBroadphase),16);
+//	m_simpleBroadphase = new (mem) btSimpleBroadphase(maxProxies,m_overlappingPairs);
+}
+
+btMultiSapBroadphase::~btMultiSapBroadphase()
+{
+	if (m_ownsPairCache)
+	{
+		m_overlappingPairs->~btOverlappingPairCache();
+		btAlignedFree(m_overlappingPairs);
+	}
+}
+
+
+void	btMultiSapBroadphase::buildTree(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax)
+{
+	m_optimizedAabbTree = new btQuantizedBvh();
+	m_optimizedAabbTree->setQuantizationValues(bvhAabbMin,bvhAabbMax);
+	QuantizedNodeArray&	nodes = m_optimizedAabbTree->getLeafNodeArray();
+	for (int i=0;i<m_sapBroadphases.size();i++)
+	{
+		btQuantizedBvhNode node;
+		btVector3 aabbMin,aabbMax;
+		m_sapBroadphases[i]->getBroadphaseAabb(aabbMin,aabbMax);
+		m_optimizedAabbTree->quantize(&node.m_quantizedAabbMin[0],aabbMin,0);
+		m_optimizedAabbTree->quantize(&node.m_quantizedAabbMax[0],aabbMax,1);
+		int partId = 0;
+		node.m_escapeIndexOrTriangleIndex = (partId<<(31-MAX_NUM_PARTS_IN_BITS)) | i;
+		nodes.push_back(node);
+	}
+	m_optimizedAabbTree->buildInternal();
+}
+
+btBroadphaseProxy*	btMultiSapBroadphase::createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* /*ignoreMe*/)
+{
+	//void* ignoreMe -> we could think of recursive multi-sap, if someone is interested
+
+	void* mem = btAlignedAlloc(sizeof(btMultiSapProxy),16);
+	btMultiSapProxy* proxy = new (mem)btMultiSapProxy(aabbMin,  aabbMax,shapeType,userPtr, collisionFilterGroup,collisionFilterMask);
+	m_multiSapProxies.push_back(proxy);
+
+	///this should deal with inserting/removal into child broadphases
+	setAabb(proxy,aabbMin,aabbMax,dispatcher);
+	return proxy;
+}
+
+void	btMultiSapBroadphase::destroyProxy(btBroadphaseProxy* /*proxy*/,btDispatcher* /*dispatcher*/)
+{
+	///not yet
+	btAssert(0);
+
+}
+
+
+void	btMultiSapBroadphase::addToChildBroadphase(btMultiSapProxy* parentMultiSapProxy, btBroadphaseProxy* childProxy, btBroadphaseInterface*	childBroadphase)
+{
+	void* mem = btAlignedAlloc(sizeof(btBridgeProxy),16);
+	btBridgeProxy* bridgeProxyRef = new(mem) btBridgeProxy;
+	bridgeProxyRef->m_childProxy = childProxy;
+	bridgeProxyRef->m_childBroadphase = childBroadphase;
+	parentMultiSapProxy->m_bridgeProxies.push_back(bridgeProxyRef);
+}
+
+
+bool boxIsContainedWithinBox(const btVector3& amin,const btVector3& amax,const btVector3& bmin,const btVector3& bmax);
+bool boxIsContainedWithinBox(const btVector3& amin,const btVector3& amax,const btVector3& bmin,const btVector3& bmax)
+{
+return
+amin.getX() >= bmin.getX() && amax.getX() <= bmax.getX() &&
+amin.getY() >= bmin.getY() && amax.getY() <= bmax.getY() &&
+amin.getZ() >= bmin.getZ() && amax.getZ() <= bmax.getZ();
+}
+
+
+
+
+
+
+void	btMultiSapBroadphase::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
+{
+	btMultiSapProxy* multiProxy = static_cast<btMultiSapProxy*>(proxy);
+	aabbMin = multiProxy->m_aabbMin;
+	aabbMax = multiProxy->m_aabbMax;
+}
+
+void	btMultiSapBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin,const btVector3& aabbMax)
+{
+	for (int i=0;i<m_multiSapProxies.size();i++)
+	{
+		rayCallback.process(m_multiSapProxies[i]);
+	}
+}
+
+
+//#include <stdio.h>
+
+void	btMultiSapBroadphase::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)
+{
+	btMultiSapProxy* multiProxy = static_cast<btMultiSapProxy*>(proxy);
+	multiProxy->m_aabbMin = aabbMin;
+	multiProxy->m_aabbMax = aabbMax;
+	
+	
+//	bool fullyContained = false;
+//	bool alreadyInSimple = false;
+	
+
+
+	
+	struct MyNodeOverlapCallback : public btNodeOverlapCallback
+	{
+		btMultiSapBroadphase*	m_multiSap;
+		btMultiSapProxy*		m_multiProxy;
+		btDispatcher*			m_dispatcher;
+
+		MyNodeOverlapCallback(btMultiSapBroadphase* multiSap,btMultiSapProxy* multiProxy,btDispatcher* dispatcher)
+			:m_multiSap(multiSap),
+			m_multiProxy(multiProxy),
+			m_dispatcher(dispatcher)
+		{
+
+		}
+
+		virtual void processNode(int /*nodeSubPart*/, int broadphaseIndex)
+		{
+			btBroadphaseInterface* childBroadphase = m_multiSap->getBroadphaseArray()[broadphaseIndex];
+
+			int containingBroadphaseIndex = -1;
+			//already found?
+			for (int i=0;i<m_multiProxy->m_bridgeProxies.size();i++)
+			{
+
+				if (m_multiProxy->m_bridgeProxies[i]->m_childBroadphase == childBroadphase)
+				{
+					containingBroadphaseIndex = i;
+					break;
+				}
+			}
+			if (containingBroadphaseIndex<0)
+			{
+				//add it
+				btBroadphaseProxy* childProxy = childBroadphase->createProxy(m_multiProxy->m_aabbMin,m_multiProxy->m_aabbMax,m_multiProxy->m_shapeType,m_multiProxy->m_clientObject,m_multiProxy->m_collisionFilterGroup,m_multiProxy->m_collisionFilterMask, m_dispatcher,m_multiProxy);
+				m_multiSap->addToChildBroadphase(m_multiProxy,childProxy,childBroadphase);
+
+			}
+		}
+	};
+
+	MyNodeOverlapCallback	myNodeCallback(this,multiProxy,dispatcher);
+
+
+
+	
+	if (m_optimizedAabbTree)
+		m_optimizedAabbTree->reportAabbOverlappingNodex(&myNodeCallback,aabbMin,aabbMax);
+
+	int i;
+
+	for ( i=0;i<multiProxy->m_bridgeProxies.size();i++)
+	{
+		btVector3 worldAabbMin,worldAabbMax;
+		multiProxy->m_bridgeProxies[i]->m_childBroadphase->getBroadphaseAabb(worldAabbMin,worldAabbMax);
+		bool overlapsBroadphase = TestAabbAgainstAabb2(worldAabbMin,worldAabbMax,multiProxy->m_aabbMin,multiProxy->m_aabbMax);
+		if (!overlapsBroadphase)
+		{
+			//remove it now
+			btBridgeProxy* bridgeProxy = multiProxy->m_bridgeProxies[i];
+
+			btBroadphaseProxy* childProxy = bridgeProxy->m_childProxy;
+			bridgeProxy->m_childBroadphase->destroyProxy(childProxy,dispatcher);
+			
+			multiProxy->m_bridgeProxies.swap( i,multiProxy->m_bridgeProxies.size()-1);
+			multiProxy->m_bridgeProxies.pop_back();
+
+		}
+	}
+
+
+	/*
+
+	if (1)
+	{
+
+		//find broadphase that contain this multiProxy
+		int numChildBroadphases = getBroadphaseArray().size();
+		for (int i=0;i<numChildBroadphases;i++)
+		{
+			btBroadphaseInterface* childBroadphase = getBroadphaseArray()[i];
+			btVector3 worldAabbMin,worldAabbMax;
+			childBroadphase->getBroadphaseAabb(worldAabbMin,worldAabbMax);
+			bool overlapsBroadphase = TestAabbAgainstAabb2(worldAabbMin,worldAabbMax,multiProxy->m_aabbMin,multiProxy->m_aabbMax);
+			
+		//	fullyContained = fullyContained || boxIsContainedWithinBox(worldAabbMin,worldAabbMax,multiProxy->m_aabbMin,multiProxy->m_aabbMax);
+			int containingBroadphaseIndex = -1;
+			
+			//if already contains this
+			
+			for (int i=0;i<multiProxy->m_bridgeProxies.size();i++)
+			{
+				if (multiProxy->m_bridgeProxies[i]->m_childBroadphase == childBroadphase)
+				{
+					containingBroadphaseIndex = i;
+				}
+				alreadyInSimple = alreadyInSimple || (multiProxy->m_bridgeProxies[i]->m_childBroadphase == m_simpleBroadphase);
+			}
+
+			if (overlapsBroadphase)
+			{
+				if (containingBroadphaseIndex<0)
+				{
+					btBroadphaseProxy* childProxy = childBroadphase->createProxy(aabbMin,aabbMax,multiProxy->m_shapeType,multiProxy->m_clientObject,multiProxy->m_collisionFilterGroup,multiProxy->m_collisionFilterMask, dispatcher);
+					childProxy->m_multiSapParentProxy = multiProxy;
+					addToChildBroadphase(multiProxy,childProxy,childBroadphase);
+				}
+			} else
+			{
+				if (containingBroadphaseIndex>=0)
+				{
+					//remove
+					btBridgeProxy* bridgeProxy = multiProxy->m_bridgeProxies[containingBroadphaseIndex];
+
+					btBroadphaseProxy* childProxy = bridgeProxy->m_childProxy;
+					bridgeProxy->m_childBroadphase->destroyProxy(childProxy,dispatcher);
+					
+					multiProxy->m_bridgeProxies.swap( containingBroadphaseIndex,multiProxy->m_bridgeProxies.size()-1);
+					multiProxy->m_bridgeProxies.pop_back();
+				}
+			}
+		}
+
+
+		///If we are in no other child broadphase, stick the proxy in the global 'simple' broadphase (brute force)
+		///hopefully we don't end up with many entries here (can assert/provide feedback on stats)
+		if (0)//!multiProxy->m_bridgeProxies.size())
+		{
+			///we don't pass the userPtr but our multisap proxy. We need to patch this, before processing an actual collision
+			///this is needed to be able to calculate the aabb overlap
+			btBroadphaseProxy* childProxy = m_simpleBroadphase->createProxy(aabbMin,aabbMax,multiProxy->m_shapeType,multiProxy->m_clientObject,multiProxy->m_collisionFilterGroup,multiProxy->m_collisionFilterMask, dispatcher);
+			childProxy->m_multiSapParentProxy = multiProxy;
+			addToChildBroadphase(multiProxy,childProxy,m_simpleBroadphase);
+		}
+	}
+
+	if (!multiProxy->m_bridgeProxies.size())
+	{
+		///we don't pass the userPtr but our multisap proxy. We need to patch this, before processing an actual collision
+		///this is needed to be able to calculate the aabb overlap
+		btBroadphaseProxy* childProxy = m_simpleBroadphase->createProxy(aabbMin,aabbMax,multiProxy->m_shapeType,multiProxy->m_clientObject,multiProxy->m_collisionFilterGroup,multiProxy->m_collisionFilterMask, dispatcher);
+		childProxy->m_multiSapParentProxy = multiProxy;
+		addToChildBroadphase(multiProxy,childProxy,m_simpleBroadphase);
+	}
+*/
+
+
+	//update
+	for ( i=0;i<multiProxy->m_bridgeProxies.size();i++)
+	{
+		btBridgeProxy* bridgeProxyRef = multiProxy->m_bridgeProxies[i];
+		bridgeProxyRef->m_childBroadphase->setAabb(bridgeProxyRef->m_childProxy,aabbMin,aabbMax,dispatcher);
+	}
+
+}
+bool stopUpdating=false;
+
+
+
+class btMultiSapBroadphasePairSortPredicate
+{
+	public:
+
+		bool operator() ( const btBroadphasePair& a1, const btBroadphasePair& b1 )
+		{
+				btMultiSapBroadphase::btMultiSapProxy* aProxy0 = a1.m_pProxy0 ? (btMultiSapBroadphase::btMultiSapProxy*)a1.m_pProxy0->m_multiSapParentProxy : 0;
+				btMultiSapBroadphase::btMultiSapProxy* aProxy1 = a1.m_pProxy1 ? (btMultiSapBroadphase::btMultiSapProxy*)a1.m_pProxy1->m_multiSapParentProxy : 0;
+				btMultiSapBroadphase::btMultiSapProxy* bProxy0 = b1.m_pProxy0 ? (btMultiSapBroadphase::btMultiSapProxy*)b1.m_pProxy0->m_multiSapParentProxy : 0;
+				btMultiSapBroadphase::btMultiSapProxy* bProxy1 = b1.m_pProxy1 ? (btMultiSapBroadphase::btMultiSapProxy*)b1.m_pProxy1->m_multiSapParentProxy : 0;
+
+				 return aProxy0 > bProxy0 || 
+					(aProxy0 == bProxy0 && aProxy1 > bProxy1) ||
+					(aProxy0 == bProxy0 && aProxy1 == bProxy1 && a1.m_algorithm > b1.m_algorithm); 
+		}
+};
+
+
+        ///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
+void    btMultiSapBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
+{
+
+//	m_simpleBroadphase->calculateOverlappingPairs(dispatcher);
+
+	if (!stopUpdating && getOverlappingPairCache()->hasDeferredRemoval())
+	{
+	
+		btBroadphasePairArray&	overlappingPairArray = getOverlappingPairCache()->getOverlappingPairArray();
+
+	//	quicksort(overlappingPairArray,0,overlappingPairArray.size());
+
+		overlappingPairArray.quickSort(btMultiSapBroadphasePairSortPredicate());
+
+		//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
+	//	overlappingPairArray.heapSort(btMultiSapBroadphasePairSortPredicate());
+
+		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
+		m_invalidPair = 0;
+
+		
+		int i;
+
+		btBroadphasePair previousPair;
+		previousPair.m_pProxy0 = 0;
+		previousPair.m_pProxy1 = 0;
+		previousPair.m_algorithm = 0;
+		
+		
+		for (i=0;i<overlappingPairArray.size();i++)
+		{
+		
+			btBroadphasePair& pair = overlappingPairArray[i];
+
+			btMultiSapProxy* aProxy0 = pair.m_pProxy0 ? (btMultiSapProxy*)pair.m_pProxy0->m_multiSapParentProxy : 0;
+			btMultiSapProxy* aProxy1 = pair.m_pProxy1 ? (btMultiSapProxy*)pair.m_pProxy1->m_multiSapParentProxy : 0;
+			btMultiSapProxy* bProxy0 = previousPair.m_pProxy0 ? (btMultiSapProxy*)previousPair.m_pProxy0->m_multiSapParentProxy : 0;
+			btMultiSapProxy* bProxy1 = previousPair.m_pProxy1 ? (btMultiSapProxy*)previousPair.m_pProxy1->m_multiSapParentProxy : 0;
+
+			bool isDuplicate = (aProxy0 == bProxy0) && (aProxy1 == bProxy1);
+			
+			previousPair = pair;
+
+			bool needsRemoval = false;
+
+			if (!isDuplicate)
+			{
+				bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);
+
+				if (hasOverlap)
+				{
+					needsRemoval = false;//callback->processOverlap(pair);
+				} else
+				{
+					needsRemoval = true;
+				}
+			} else
+			{
+				//remove duplicate
+				needsRemoval = true;
+				//should have no algorithm
+				btAssert(!pair.m_algorithm);
+			}
+			
+			if (needsRemoval)
+			{
+				getOverlappingPairCache()->cleanOverlappingPair(pair,dispatcher);
+
+		//		m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
+		//		m_overlappingPairArray.pop_back();
+				pair.m_pProxy0 = 0;
+				pair.m_pProxy1 = 0;
+				m_invalidPair++;
+				gOverlappingPairs--;
+			} 
+			
+		}
+
+	///if you don't like to skip the invalid pairs in the array, execute following code:
+	#define CLEAN_INVALID_PAIRS 1
+	#ifdef CLEAN_INVALID_PAIRS
+
+		//perform a sort, to sort 'invalid' pairs to the end
+		//overlappingPairArray.heapSort(btMultiSapBroadphasePairSortPredicate());
+		overlappingPairArray.quickSort(btMultiSapBroadphasePairSortPredicate());
+
+		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
+		m_invalidPair = 0;
+	#endif//CLEAN_INVALID_PAIRS
+		
+		//printf("overlappingPairArray.size()=%d\n",overlappingPairArray.size());
+	}
+
+
+}
+
+
+bool	btMultiSapBroadphase::testAabbOverlap(btBroadphaseProxy* childProxy0,btBroadphaseProxy* childProxy1)
+{
+	btMultiSapProxy* multiSapProxy0 = (btMultiSapProxy*)childProxy0->m_multiSapParentProxy;
+		btMultiSapProxy* multiSapProxy1 = (btMultiSapProxy*)childProxy1->m_multiSapParentProxy;
+
+		return	TestAabbAgainstAabb2(multiSapProxy0->m_aabbMin,multiSapProxy0->m_aabbMax,
+			multiSapProxy1->m_aabbMin,multiSapProxy1->m_aabbMax);
+		
+}
+
+
+void	btMultiSapBroadphase::printStats()
+{
+/*	printf("---------------------------------\n");
+	
+		printf("btMultiSapBroadphase.h\n");
+		printf("numHandles = %d\n",m_multiSapProxies.size());
+			//find broadphase that contain this multiProxy
+		int numChildBroadphases = getBroadphaseArray().size();
+		for (int i=0;i<numChildBroadphases;i++)
+		{
+
+			btBroadphaseInterface* childBroadphase = getBroadphaseArray()[i];
+			childBroadphase->printStats();
+
+		}
+		*/
+
+}
+
+void btMultiSapBroadphase::resetPool(btDispatcher* dispatcher)
+{
+	// not yet
+}
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h
new file mode 100644
index 0000000..7bcfe6b
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h
@@ -0,0 +1,151 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef BT_MULTI_SAP_BROADPHASE
+#define BT_MULTI_SAP_BROADPHASE
+
+#include "btBroadphaseInterface.h"
+#include "LinearMath/btAlignedObjectArray.h"
+#include "btOverlappingPairCache.h"
+
+
+class btBroadphaseInterface;
+class btSimpleBroadphase;
+
+
+typedef btAlignedObjectArray<btBroadphaseInterface*> btSapBroadphaseArray;
+
+///The btMultiSapBroadphase is a research project, not recommended to use in production. Use btAxisSweep3 or btDbvtBroadphase instead.
+///The btMultiSapBroadphase is a broadphase that contains multiple SAP broadphases.
+///The user can add SAP broadphases that cover the world. A btBroadphaseProxy can be in multiple child broadphases at the same time.
+///A btQuantizedBvh acceleration structures finds overlapping SAPs for each btBroadphaseProxy.
+///See http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=328
+///and http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329
+class btMultiSapBroadphase :public btBroadphaseInterface
+{
+	btSapBroadphaseArray	m_sapBroadphases;
+	
+	btSimpleBroadphase*		m_simpleBroadphase;
+
+	btOverlappingPairCache*	m_overlappingPairs;
+
+	class btQuantizedBvh*			m_optimizedAabbTree;
+
+
+	bool					m_ownsPairCache;
+	
+	btOverlapFilterCallback*	m_filterCallback;
+
+	int			m_invalidPair;
+
+	struct	btBridgeProxy
+	{
+		btBroadphaseProxy*		m_childProxy;
+		btBroadphaseInterface*	m_childBroadphase;
+	};
+
+
+public:
+
+	struct	btMultiSapProxy	: public btBroadphaseProxy
+	{
+
+		///array with all the entries that this proxy belongs to
+		btAlignedObjectArray<btBridgeProxy*> m_bridgeProxies;
+		btVector3	m_aabbMin;
+		btVector3	m_aabbMax;
+
+		int	m_shapeType;
+
+/*		void*	m_userPtr;
+		short int	m_collisionFilterGroup;
+		short int	m_collisionFilterMask;
+*/
+		btMultiSapProxy(const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask)
+			:btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask),
+			m_aabbMin(aabbMin),
+			m_aabbMax(aabbMax),
+			m_shapeType(shapeType)
+		{
+			m_multiSapParentProxy =this;
+		}
+
+		
+	};
+
+protected:
+
+
+	btAlignedObjectArray<btMultiSapProxy*> m_multiSapProxies;
+
+public:
+
+	btMultiSapBroadphase(int maxProxies = 16384,btOverlappingPairCache* pairCache=0);
+
+
+	btSapBroadphaseArray&	getBroadphaseArray()
+	{
+		return m_sapBroadphases;
+	}
+
+	const btSapBroadphaseArray&	getBroadphaseArray() const
+	{
+		return m_sapBroadphases;
+	}
+
+	virtual ~btMultiSapBroadphase();
+
+	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy);
+	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher);
+	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
+
+	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));
+
+	void	addToChildBroadphase(btMultiSapProxy* parentMultiSapProxy, btBroadphaseProxy* childProxy, btBroadphaseInterface*	childBroadphase);
+
+	///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
+	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);
+
+	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
+
+	virtual	btOverlappingPairCache*	getOverlappingPairCache()
+	{
+		return m_overlappingPairs;
+	}
+	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const
+	{
+		return m_overlappingPairs;
+	}
+
+	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame
+	///will add some transform later
+	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
+	{
+		aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
+		aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
+	}
+
+	void	buildTree(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax);
+
+	virtual void	printStats();
+
+	void quicksort (btBroadphasePairArray& a, int lo, int hi);
+
+	///reset broadphase internal structures, to ensure determinism/reproducability
+	virtual void resetPool(btDispatcher* dispatcher);
+
+};
+
+#endif //BT_MULTI_SAP_BROADPHASE
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
new file mode 100644
index 0000000..041bbe0
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
@@ -0,0 +1,633 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#include "btOverlappingPairCache.h"
+
+#include "btDispatcher.h"
+#include "btCollisionAlgorithm.h"
+#include "LinearMath/btAabbUtil2.h"
+
+#include <stdio.h>
+
+int	gOverlappingPairs = 0;
+
+int gRemovePairs =0;
+int gAddedPairs =0;
+int gFindPairs =0;
+
+
+
+
+btHashedOverlappingPairCache::btHashedOverlappingPairCache():
+	m_overlapFilterCallback(0),
+	m_blockedForChanges(false),
+	m_ghostPairCallback(0)
+{
+	int initialAllocatedSize= 2;
+	m_overlappingPairArray.reserve(initialAllocatedSize);
+	growTables();
+}
+
+
+
+
+btHashedOverlappingPairCache::~btHashedOverlappingPairCache()
+{
+}
+
+
+
+void	btHashedOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher)
+{
+	if (pair.m_algorithm)
+	{
+		{
+			pair.m_algorithm->~btCollisionAlgorithm();
+			dispatcher->freeCollisionAlgorithm(pair.m_algorithm);
+			pair.m_algorithm=0;
+		}
+	}
+}
+
+
+
+
+void	btHashedOverlappingPairCache::cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
+{
+
+	class	CleanPairCallback : public btOverlapCallback
+	{
+		btBroadphaseProxy* m_cleanProxy;
+		btOverlappingPairCache*	m_pairCache;
+		btDispatcher* m_dispatcher;
+
+	public:
+		CleanPairCallback(btBroadphaseProxy* cleanProxy,btOverlappingPairCache* pairCache,btDispatcher* dispatcher)
+			:m_cleanProxy(cleanProxy),
+			m_pairCache(pairCache),
+			m_dispatcher(dispatcher)
+		{
+		}
+		virtual	bool	processOverlap(btBroadphasePair& pair)
+		{
+			if ((pair.m_pProxy0 == m_cleanProxy) ||
+				(pair.m_pProxy1 == m_cleanProxy))
+			{
+				m_pairCache->cleanOverlappingPair(pair,m_dispatcher);
+			}
+			return false;
+		}
+		
+	};
+
+	CleanPairCallback cleanPairs(proxy,this,dispatcher);
+
+	processAllOverlappingPairs(&cleanPairs,dispatcher);
+
+}
+
+
+
+
+void	btHashedOverlappingPairCache::removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
+{
+
+	class	RemovePairCallback : public btOverlapCallback
+	{
+		btBroadphaseProxy* m_obsoleteProxy;
+
+	public:
+		RemovePairCallback(btBroadphaseProxy* obsoleteProxy)
+			:m_obsoleteProxy(obsoleteProxy)
+		{
+		}
+		virtual	bool	processOverlap(btBroadphasePair& pair)
+		{
+			return ((pair.m_pProxy0 == m_obsoleteProxy) ||
+				(pair.m_pProxy1 == m_obsoleteProxy));
+		}
+		
+	};
+
+
+	RemovePairCallback removeCallback(proxy);
+
+	processAllOverlappingPairs(&removeCallback,dispatcher);
+}
+
+
+
+
+
+btBroadphasePair* btHashedOverlappingPairCache::findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
+{
+	gFindPairs++;
+	if(proxy0->m_uniqueId>proxy1->m_uniqueId) 
+		btSwap(proxy0,proxy1);
+	int proxyId1 = proxy0->getUid();
+	int proxyId2 = proxy1->getUid();
+
+	/*if (proxyId1 > proxyId2) 
+		btSwap(proxyId1, proxyId2);*/
+
+	int hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1), static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));
+
+	if (hash >= m_hashTable.size())
+	{
+		return NULL;
+	}
+
+	int index = m_hashTable[hash];
+	while (index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false)
+	{
+		index = m_next[index];
+	}
+
+	if (index == BT_NULL_PAIR)
+	{
+		return NULL;
+	}
+
+	btAssert(index < m_overlappingPairArray.size());
+
+	return &m_overlappingPairArray[index];
+}
+
+//#include <stdio.h>
+
+void	btHashedOverlappingPairCache::growTables()
+{
+
+	int newCapacity = m_overlappingPairArray.capacity();
+
+	if (m_hashTable.size() < newCapacity)
+	{
+		//grow hashtable and next table
+		int curHashtableSize = m_hashTable.size();
+
+		m_hashTable.resize(newCapacity);
+		m_next.resize(newCapacity);
+
+
+		int i;
+
+		for (i= 0; i < newCapacity; ++i)
+		{
+			m_hashTable[i] = BT_NULL_PAIR;
+		}
+		for (i = 0; i < newCapacity; ++i)
+		{
+			m_next[i] = BT_NULL_PAIR;
+		}
+
+		for(i=0;i<curHashtableSize;i++)
+		{
+	
+			const btBroadphasePair& pair = m_overlappingPairArray[i];
+			int proxyId1 = pair.m_pProxy0->getUid();
+			int proxyId2 = pair.m_pProxy1->getUid();
+			/*if (proxyId1 > proxyId2) 
+				btSwap(proxyId1, proxyId2);*/
+			int	hashValue = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1),static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));	// New hash value with new mask
+			m_next[i] = m_hashTable[hashValue];
+			m_hashTable[hashValue] = i;
+		}
+
+
+	}
+}
+
+btBroadphasePair* btHashedOverlappingPairCache::internalAddPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
+{
+	if(proxy0->m_uniqueId>proxy1->m_uniqueId) 
+		btSwap(proxy0,proxy1);
+	int proxyId1 = proxy0->getUid();
+	int proxyId2 = proxy1->getUid();
+
+	/*if (proxyId1 > proxyId2) 
+		btSwap(proxyId1, proxyId2);*/
+
+	int	hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1),static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));	// New hash value with new mask
+
+
+	btBroadphasePair* pair = internalFindPair(proxy0, proxy1, hash);
+	if (pair != NULL)
+	{
+		return pair;
+	}
+	/*for(int i=0;i<m_overlappingPairArray.size();++i)
+		{
+		if(	(m_overlappingPairArray[i].m_pProxy0==proxy0)&&
+			(m_overlappingPairArray[i].m_pProxy1==proxy1))
+			{
+			printf("Adding duplicated %u<>%u\r\n",proxyId1,proxyId2);
+			internalFindPair(proxy0, proxy1, hash);
+			}
+		}*/
+	int count = m_overlappingPairArray.size();
+	int oldCapacity = m_overlappingPairArray.capacity();
+	void* mem = &m_overlappingPairArray.expandNonInitializing();
+
+	//this is where we add an actual pair, so also call the 'ghost'
+	if (m_ghostPairCallback)
+		m_ghostPairCallback->addOverlappingPair(proxy0,proxy1);
+
+	int newCapacity = m_overlappingPairArray.capacity();
+
+	if (oldCapacity < newCapacity)
+	{
+		growTables();
+		//hash with new capacity
+		hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1),static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));
+	}
+	
+	pair = new (mem) btBroadphasePair(*proxy0,*proxy1);
+//	pair->m_pProxy0 = proxy0;
+//	pair->m_pProxy1 = proxy1;
+	pair->m_algorithm = 0;
+	pair->m_internalTmpValue = 0;
+	
+
+	m_next[count] = m_hashTable[hash];
+	m_hashTable[hash] = count;
+
+	return pair;
+}
+
+
+
+void* btHashedOverlappingPairCache::removeOverlappingPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1,btDispatcher* dispatcher)
+{
+	gRemovePairs++;
+	if(proxy0->m_uniqueId>proxy1->m_uniqueId) 
+		btSwap(proxy0,proxy1);
+	int proxyId1 = proxy0->getUid();
+	int proxyId2 = proxy1->getUid();
+
+	/*if (proxyId1 > proxyId2) 
+		btSwap(proxyId1, proxyId2);*/
+
+	int	hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1),static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity()-1));
+
+	btBroadphasePair* pair = internalFindPair(proxy0, proxy1, hash);
+	if (pair == NULL)
+	{
+		return 0;
+	}
+
+	cleanOverlappingPair(*pair,dispatcher);
+
+	void* userData = pair->m_internalInfo1;
+
+	btAssert(pair->m_pProxy0->getUid() == proxyId1);
+	btAssert(pair->m_pProxy1->getUid() == proxyId2);
+
+	int pairIndex = int(pair - &m_overlappingPairArray[0]);
+	btAssert(pairIndex < m_overlappingPairArray.size());
+
+	// Remove the pair from the hash table.
+	int index = m_hashTable[hash];
+	btAssert(index != BT_NULL_PAIR);
+
+	int previous = BT_NULL_PAIR;
+	while (index != pairIndex)
+	{
+		previous = index;
+		index = m_next[index];
+	}
+
+	if (previous != BT_NULL_PAIR)
+	{
+		btAssert(m_next[previous] == pairIndex);
+		m_next[previous] = m_next[pairIndex];
+	}
+	else
+	{
+		m_hashTable[hash] = m_next[pairIndex];
+	}
+
+	// We now move the last pair into spot of the
+	// pair being removed. We need to fix the hash
+	// table indices to support the move.
+
+	int lastPairIndex = m_overlappingPairArray.size() - 1;
+
+	if (m_ghostPairCallback)
+		m_ghostPairCallback->removeOverlappingPair(proxy0, proxy1,dispatcher);
+
+	// If the removed pair is the last pair, we are done.
+	if (lastPairIndex == pairIndex)
+	{
+		m_overlappingPairArray.pop_back();
+		return userData;
+	}
+
+	// Remove the last pair from the hash table.
+	const btBroadphasePair* last = &m_overlappingPairArray[lastPairIndex];
+		/* missing swap here too, Nat. */ 
+	int lastHash = static_cast<int>(getHash(static_cast<unsigned int>(last->m_pProxy0->getUid()), static_cast<unsigned int>(last->m_pProxy1->getUid())) & (m_overlappingPairArray.capacity()-1));
+
+	index = m_hashTable[lastHash];
+	btAssert(index != BT_NULL_PAIR);
+
+	previous = BT_NULL_PAIR;
+	while (index != lastPairIndex)
+	{
+		previous = index;
+		index = m_next[index];
+	}
+
+	if (previous != BT_NULL_PAIR)
+	{
+		btAssert(m_next[previous] == lastPairIndex);
+		m_next[previous] = m_next[lastPairIndex];
+	}
+	else
+	{
+		m_hashTable[lastHash] = m_next[lastPairIndex];
+	}
+
+	// Copy the last pair into the remove pair's spot.
+	m_overlappingPairArray[pairIndex] = m_overlappingPairArray[lastPairIndex];
+
+	// Insert the last pair into the hash table
+	m_next[pairIndex] = m_hashTable[lastHash];
+	m_hashTable[lastHash] = pairIndex;
+
+	m_overlappingPairArray.pop_back();
+
+	return userData;
+}
+//#include <stdio.h>
+
+void	btHashedOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback,btDispatcher* dispatcher)
+{
+
+	int i;
+
+//	printf("m_overlappingPairArray.size()=%d\n",m_overlappingPairArray.size());
+	for (i=0;i<m_overlappingPairArray.size();)
+	{
+	
+		btBroadphasePair* pair = &m_overlappingPairArray[i];
+		if (callback->processOverlap(*pair))
+		{
+			removeOverlappingPair(pair->m_pProxy0,pair->m_pProxy1,dispatcher);
+
+			gOverlappingPairs--;
+		} else
+		{
+			i++;
+		}
+	}
+}
+
+void	btHashedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)
+{
+	///need to keep hashmap in sync with pair address, so rebuild all
+	btBroadphasePairArray tmpPairs;
+	int i;
+	for (i=0;i<m_overlappingPairArray.size();i++)
+	{
+		tmpPairs.push_back(m_overlappingPairArray[i]);
+	}
+
+	for (i=0;i<tmpPairs.size();i++)
+	{
+		removeOverlappingPair(tmpPairs[i].m_pProxy0,tmpPairs[i].m_pProxy1,dispatcher);
+	}
+	
+	for (i = 0; i < m_next.size(); i++)
+	{
+		m_next[i] = BT_NULL_PAIR;
+	}
+
+	tmpPairs.quickSort(btBroadphasePairSortPredicate());
+
+	for (i=0;i<tmpPairs.size();i++)
+	{
+		addOverlappingPair(tmpPairs[i].m_pProxy0,tmpPairs[i].m_pProxy1);
+	}
+
+	
+}
+
+
+void*	btSortedOverlappingPairCache::removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1, btDispatcher* dispatcher )
+{
+	if (!hasDeferredRemoval())
+	{
+		btBroadphasePair findPair(*proxy0,*proxy1);
+
+		int findIndex = m_overlappingPairArray.findLinearSearch(findPair);
+		if (findIndex < m_overlappingPairArray.size())
+		{
+			gOverlappingPairs--;
+			btBroadphasePair& pair = m_overlappingPairArray[findIndex];
+			void* userData = pair.m_internalInfo1;
+			cleanOverlappingPair(pair,dispatcher);
+			if (m_ghostPairCallback)
+				m_ghostPairCallback->removeOverlappingPair(proxy0, proxy1,dispatcher);
+			
+			m_overlappingPairArray.swap(findIndex,m_overlappingPairArray.capacity()-1);
+			m_overlappingPairArray.pop_back();
+			return userData;
+		}
+	}
+
+	return 0;
+}
+
+
+
+
+
+
+
+
+btBroadphasePair*	btSortedOverlappingPairCache::addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
+{
+	//don't add overlap with own
+	btAssert(proxy0 != proxy1);
+
+	if (!needsBroadphaseCollision(proxy0,proxy1))
+		return 0;
+	
+	void* mem = &m_overlappingPairArray.expandNonInitializing();
+	btBroadphasePair* pair = new (mem) btBroadphasePair(*proxy0,*proxy1);
+	
+	gOverlappingPairs++;
+	gAddedPairs++;
+	
+	if (m_ghostPairCallback)
+		m_ghostPairCallback->addOverlappingPair(proxy0, proxy1);
+	return pair;
+	
+}
+
+///this findPair becomes really slow. Either sort the list to speedup the query, or
+///use a different solution. It is mainly used for Removing overlapping pairs. Removal could be delayed.
+///we could keep a linked list in each proxy, and store pair in one of the proxies (with lowest memory address)
+///Also we can use a 2D bitmap, which can be useful for a future GPU implementation
+ btBroadphasePair*	btSortedOverlappingPairCache::findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
+{
+	if (!needsBroadphaseCollision(proxy0,proxy1))
+		return 0;
+
+	btBroadphasePair tmpPair(*proxy0,*proxy1);
+	int findIndex = m_overlappingPairArray.findLinearSearch(tmpPair);
+
+	if (findIndex < m_overlappingPairArray.size())
+	{
+		//btAssert(it != m_overlappingPairSet.end());
+		 btBroadphasePair* pair = &m_overlappingPairArray[findIndex];
+		return pair;
+	}
+	return 0;
+}
+
+
+
+
+
+
+
+
+
+
+//#include <stdio.h>
+
+void	btSortedOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback,btDispatcher* dispatcher)
+{
+
+	int i;
+
+	for (i=0;i<m_overlappingPairArray.size();)
+	{
+	
+		btBroadphasePair* pair = &m_overlappingPairArray[i];
+		if (callback->processOverlap(*pair))
+		{
+			cleanOverlappingPair(*pair,dispatcher);
+			pair->m_pProxy0 = 0;
+			pair->m_pProxy1 = 0;
+			m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
+			m_overlappingPairArray.pop_back();
+			gOverlappingPairs--;
+		} else
+		{
+			i++;
+		}
+	}
+}
+
+
+
+
+btSortedOverlappingPairCache::btSortedOverlappingPairCache():
+	m_blockedForChanges(false),
+	m_hasDeferredRemoval(true),
+	m_overlapFilterCallback(0),
+	m_ghostPairCallback(0)
+{
+	int initialAllocatedSize= 2;
+	m_overlappingPairArray.reserve(initialAllocatedSize);
+}
+
+btSortedOverlappingPairCache::~btSortedOverlappingPairCache()
+{
+}
+
+void	btSortedOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher)
+{
+	if (pair.m_algorithm)
+	{
+		{
+			pair.m_algorithm->~btCollisionAlgorithm();
+			dispatcher->freeCollisionAlgorithm(pair.m_algorithm);
+			pair.m_algorithm=0;
+			gRemovePairs--;
+		}
+	}
+}
+
+
+void	btSortedOverlappingPairCache::cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
+{
+
+	class	CleanPairCallback : public btOverlapCallback
+	{
+		btBroadphaseProxy* m_cleanProxy;
+		btOverlappingPairCache*	m_pairCache;
+		btDispatcher* m_dispatcher;
+
+	public:
+		CleanPairCallback(btBroadphaseProxy* cleanProxy,btOverlappingPairCache* pairCache,btDispatcher* dispatcher)
+			:m_cleanProxy(cleanProxy),
+			m_pairCache(pairCache),
+			m_dispatcher(dispatcher)
+		{
+		}
+		virtual	bool	processOverlap(btBroadphasePair& pair)
+		{
+			if ((pair.m_pProxy0 == m_cleanProxy) ||
+				(pair.m_pProxy1 == m_cleanProxy))
+			{
+				m_pairCache->cleanOverlappingPair(pair,m_dispatcher);
+			}
+			return false;
+		}
+		
+	};
+
+	CleanPairCallback cleanPairs(proxy,this,dispatcher);
+
+	processAllOverlappingPairs(&cleanPairs,dispatcher);
+
+}
+
+
+void	btSortedOverlappingPairCache::removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)
+{
+
+	class	RemovePairCallback : public btOverlapCallback
+	{
+		btBroadphaseProxy* m_obsoleteProxy;
+
+	public:
+		RemovePairCallback(btBroadphaseProxy* obsoleteProxy)
+			:m_obsoleteProxy(obsoleteProxy)
+		{
+		}
+		virtual	bool	processOverlap(btBroadphasePair& pair)
+		{
+			return ((pair.m_pProxy0 == m_obsoleteProxy) ||
+				(pair.m_pProxy1 == m_obsoleteProxy));
+		}
+		
+	};
+
+	RemovePairCallback removeCallback(proxy);
+
+	processAllOverlappingPairs(&removeCallback,dispatcher);
+}
+
+void	btSortedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)
+{
+	//should already be sorted
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
new file mode 100644
index 0000000..7a3806c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
@@ -0,0 +1,469 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_OVERLAPPING_PAIR_CACHE_H
+#define BT_OVERLAPPING_PAIR_CACHE_H
+
+
+#include "btBroadphaseInterface.h"
+#include "btBroadphaseProxy.h"
+#include "btOverlappingPairCallback.h"
+
+#include "LinearMath/btAlignedObjectArray.h"
+class btDispatcher;
+
+typedef btAlignedObjectArray<btBroadphasePair>	btBroadphasePairArray;
+
+struct	btOverlapCallback
+{
+	virtual ~btOverlapCallback()
+	{}
+	//return true for deletion of the pair
+	virtual bool	processOverlap(btBroadphasePair& pair) = 0;
+
+};
+
+struct btOverlapFilterCallback
+{
+	virtual ~btOverlapFilterCallback()
+	{}
+	// return true when pairs need collision
+	virtual bool	needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const = 0;
+};
+
+
+
+
+
+
+
+extern int gRemovePairs;
+extern int gAddedPairs;
+extern int gFindPairs;
+
+const int BT_NULL_PAIR=0xffffffff;
+
+///The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases.
+///The btHashedOverlappingPairCache and btSortedOverlappingPairCache classes are two implementations.
+class btOverlappingPairCache : public btOverlappingPairCallback
+{
+public:
+	virtual ~btOverlappingPairCache() {} // this is needed so we can get to the derived class destructor
+
+	virtual btBroadphasePair*	getOverlappingPairArrayPtr() = 0;
+	
+	virtual const btBroadphasePair*	getOverlappingPairArrayPtr() const = 0;
+
+	virtual btBroadphasePairArray&	getOverlappingPairArray() = 0;
+
+	virtual	void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher) = 0;
+
+	virtual int getNumOverlappingPairs() const = 0;
+
+	virtual void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher) = 0;
+
+	virtual	void setOverlapFilterCallback(btOverlapFilterCallback* callback) = 0;
+
+	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher) = 0;
+
+	virtual btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) = 0;
+
+	virtual bool	hasDeferredRemoval() = 0;
+
+	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)=0;
+
+	virtual void	sortOverlappingPairs(btDispatcher* dispatcher) = 0;
+
+
+};
+
+/// Hash-space based Pair Cache, thanks to Erin Catto, Box2D, http://www.box2d.org, and Pierre Terdiman, Codercorner, http://codercorner.com
+class btHashedOverlappingPairCache : public btOverlappingPairCache
+{
+	btBroadphasePairArray	m_overlappingPairArray;
+	btOverlapFilterCallback* m_overlapFilterCallback;
+	bool		m_blockedForChanges;
+
+
+public:
+	btHashedOverlappingPairCache();
+	virtual ~btHashedOverlappingPairCache();
+
+	
+	void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+
+	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher);
+	
+	SIMD_FORCE_INLINE bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const
+	{
+		if (m_overlapFilterCallback)
+			return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);
+
+		bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
+		collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
+		
+		return collides;
+	}
+
+	// Add a pair and return the new pair. If the pair already exists,
+	// no new pair is created and the old one is returned.
+	virtual btBroadphasePair* 	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
+	{
+		gAddedPairs++;
+
+		if (!needsBroadphaseCollision(proxy0,proxy1))
+			return 0;
+
+		return internalAddPair(proxy0,proxy1);
+	}
+
+	
+
+	void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+
+	
+	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher);
+
+	virtual btBroadphasePair*	getOverlappingPairArrayPtr()
+	{
+		return &m_overlappingPairArray[0];
+	}
+
+	const btBroadphasePair*	getOverlappingPairArrayPtr() const
+	{
+		return &m_overlappingPairArray[0];
+	}
+
+	btBroadphasePairArray&	getOverlappingPairArray()
+	{
+		return m_overlappingPairArray;
+	}
+
+	const btBroadphasePairArray&	getOverlappingPairArray() const
+	{
+		return m_overlappingPairArray;
+	}
+
+	void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher);
+
+
+
+	btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1);
+
+	int GetCount() const { return m_overlappingPairArray.size(); }
+//	btBroadphasePair* GetPairs() { return m_pairs; }
+
+	btOverlapFilterCallback* getOverlapFilterCallback()
+	{
+		return m_overlapFilterCallback;
+	}
+
+	void setOverlapFilterCallback(btOverlapFilterCallback* callback)
+	{
+		m_overlapFilterCallback = callback;
+	}
+
+	int	getNumOverlappingPairs() const
+	{
+		return m_overlappingPairArray.size();
+	}
+private:
+	
+	btBroadphasePair* 	internalAddPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
+
+	void	growTables();
+
+	SIMD_FORCE_INLINE bool equalsPair(const btBroadphasePair& pair, int proxyId1, int proxyId2)
+	{	
+		return pair.m_pProxy0->getUid() == proxyId1 && pair.m_pProxy1->getUid() == proxyId2;
+	}
+
+	/*
+	// Thomas Wang's hash, see: http://www.concentric.net/~Ttwang/tech/inthash.htm
+	// This assumes proxyId1 and proxyId2 are 16-bit.
+	SIMD_FORCE_INLINE int getHash(int proxyId1, int proxyId2)
+	{
+		int key = (proxyId2 << 16) | proxyId1;
+		key = ~key + (key << 15);
+		key = key ^ (key >> 12);
+		key = key + (key << 2);
+		key = key ^ (key >> 4);
+		key = key * 2057;
+		key = key ^ (key >> 16);
+		return key;
+	}
+	*/
+
+
+	
+	SIMD_FORCE_INLINE	unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)
+	{
+		int key = static_cast<int>(((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16));
+		// Thomas Wang's hash
+
+		key += ~(key << 15);
+		key ^=  (key >> 10);
+		key +=  (key << 3);
+		key ^=  (key >> 6);
+		key += ~(key << 11);
+		key ^=  (key >> 16);
+		return static_cast<unsigned int>(key);
+	}
+	
+
+
+
+
+	SIMD_FORCE_INLINE btBroadphasePair* internalFindPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1, int hash)
+	{
+		int proxyId1 = proxy0->getUid();
+		int proxyId2 = proxy1->getUid();
+		#if 0 // wrong, 'equalsPair' use unsorted uids, copy-past devil striked again. Nat.
+		if (proxyId1 > proxyId2) 
+			btSwap(proxyId1, proxyId2);
+		#endif
+
+		int index = m_hashTable[hash];
+		
+		while( index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false)
+		{
+			index = m_next[index];
+		}
+
+		if ( index == BT_NULL_PAIR )
+		{
+			return NULL;
+		}
+
+		btAssert(index < m_overlappingPairArray.size());
+
+		return &m_overlappingPairArray[index];
+	}
+
+	virtual bool	hasDeferredRemoval()
+	{
+		return false;
+	}
+
+	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)
+	{
+		m_ghostPairCallback = ghostPairCallback;
+	}
+
+	virtual void	sortOverlappingPairs(btDispatcher* dispatcher);
+	
+
+protected:
+	
+	btAlignedObjectArray<int>	m_hashTable;
+	btAlignedObjectArray<int>	m_next;
+	btOverlappingPairCallback*	m_ghostPairCallback;
+	
+};
+
+
+
+
+///btSortedOverlappingPairCache maintains the objects with overlapping AABB
+///Typically managed by the Broadphase, Axis3Sweep or btSimpleBroadphase
+class	btSortedOverlappingPairCache : public btOverlappingPairCache
+{
+	protected:
+		//avoid brute-force finding all the time
+		btBroadphasePairArray	m_overlappingPairArray;
+
+		//during the dispatch, check that user doesn't destroy/create proxy
+		bool		m_blockedForChanges;
+
+		///by default, do the removal during the pair traversal
+		bool		m_hasDeferredRemoval;
+		
+		//if set, use the callback instead of the built in filter in needBroadphaseCollision
+		btOverlapFilterCallback* m_overlapFilterCallback;
+
+		btOverlappingPairCallback*	m_ghostPairCallback;
+
+	public:
+			
+		btSortedOverlappingPairCache();	
+		virtual ~btSortedOverlappingPairCache();
+
+		virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher);
+
+		void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher);
+
+		void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher);
+		
+		btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
+
+		btBroadphasePair*	findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
+			
+		
+		void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+
+		void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+
+
+		inline bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const
+		{
+			if (m_overlapFilterCallback)
+				return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);
+
+			bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;
+			collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);
+			
+			return collides;
+		}
+		
+		btBroadphasePairArray&	getOverlappingPairArray()
+		{
+			return m_overlappingPairArray;
+		}
+
+		const btBroadphasePairArray&	getOverlappingPairArray() const
+		{
+			return m_overlappingPairArray;
+		}
+
+		
+
+
+		btBroadphasePair*	getOverlappingPairArrayPtr()
+		{
+			return &m_overlappingPairArray[0];
+		}
+
+		const btBroadphasePair*	getOverlappingPairArrayPtr() const
+		{
+			return &m_overlappingPairArray[0];
+		}
+
+		int	getNumOverlappingPairs() const
+		{
+			return m_overlappingPairArray.size();
+		}
+		
+		btOverlapFilterCallback* getOverlapFilterCallback()
+		{
+			return m_overlapFilterCallback;
+		}
+
+		void setOverlapFilterCallback(btOverlapFilterCallback* callback)
+		{
+			m_overlapFilterCallback = callback;
+		}
+
+		virtual bool	hasDeferredRemoval()
+		{
+			return m_hasDeferredRemoval;
+		}
+
+		virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)
+		{
+			m_ghostPairCallback = ghostPairCallback;
+		}
+
+		virtual void	sortOverlappingPairs(btDispatcher* dispatcher);
+		
+
+};
+
+
+
+///btNullPairCache skips add/removal of overlapping pairs. Userful for benchmarking and unit testing.
+class btNullPairCache : public btOverlappingPairCache
+{
+
+	btBroadphasePairArray	m_overlappingPairArray;
+
+public:
+
+	virtual btBroadphasePair*	getOverlappingPairArrayPtr()
+	{
+		return &m_overlappingPairArray[0];
+	}
+	const btBroadphasePair*	getOverlappingPairArrayPtr() const
+	{
+		return &m_overlappingPairArray[0];
+	}
+	btBroadphasePairArray&	getOverlappingPairArray()
+	{
+		return m_overlappingPairArray;
+	}
+	
+	virtual	void	cleanOverlappingPair(btBroadphasePair& /*pair*/,btDispatcher* /*dispatcher*/)
+	{
+
+	}
+
+	virtual int getNumOverlappingPairs() const
+	{
+		return 0;
+	}
+
+	virtual void	cleanProxyFromPairs(btBroadphaseProxy* /*proxy*/,btDispatcher* /*dispatcher*/)
+	{
+
+	}
+
+	virtual	void setOverlapFilterCallback(btOverlapFilterCallback* /*callback*/)
+	{
+	}
+
+	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* /*dispatcher*/)
+	{
+	}
+
+	virtual btBroadphasePair* findPair(btBroadphaseProxy* /*proxy0*/, btBroadphaseProxy* /*proxy1*/)
+	{
+		return 0;
+	}
+
+	virtual bool	hasDeferredRemoval()
+	{
+		return true;
+	}
+
+	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* /* ghostPairCallback */)
+	{
+
+	}
+
+	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* /*proxy0*/,btBroadphaseProxy* /*proxy1*/)
+	{
+		return 0;
+	}
+
+	virtual void*	removeOverlappingPair(btBroadphaseProxy* /*proxy0*/,btBroadphaseProxy* /*proxy1*/,btDispatcher* /*dispatcher*/)
+	{
+		return 0;
+	}
+
+	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* /*proxy0*/,btDispatcher* /*dispatcher*/)
+	{
+	}
+	
+	virtual void	sortOverlappingPairs(btDispatcher* dispatcher)
+	{
+        (void) dispatcher;
+	}
+
+
+};
+
+
+#endif //BT_OVERLAPPING_PAIR_CACHE_H
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h
new file mode 100644
index 0000000..9c7b6f8
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h
@@ -0,0 +1,40 @@
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef OVERLAPPING_PAIR_CALLBACK_H
+#define OVERLAPPING_PAIR_CALLBACK_H
+
+class btDispatcher;
+struct  btBroadphasePair;
+
+///The btOverlappingPairCallback class is an additional optional broadphase user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.
+class btOverlappingPairCallback
+{
+public:
+	virtual ~btOverlappingPairCallback()
+	{
+
+	}
+	
+	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) = 0;
+
+	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher) = 0;
+
+	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy0,btDispatcher* dispatcher) = 0;
+
+};
+
+#endif //OVERLAPPING_PAIR_CALLBACK_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
new file mode 100644
index 0000000..c911435
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
@@ -0,0 +1,1375 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btQuantizedBvh.h"
+
+#include "LinearMath/btAabbUtil2.h"
+#include "LinearMath/btIDebugDraw.h"
+#include "LinearMath/btSerializer.h"
+
+#define RAYAABB2
+
+btQuantizedBvh::btQuantizedBvh() : 
+					m_bulletVersion(BT_BULLET_VERSION),
+					m_useQuantization(false), 
+					//m_traversalMode(TRAVERSAL_STACKLESS_CACHE_FRIENDLY)
+					m_traversalMode(TRAVERSAL_STACKLESS)
+					//m_traversalMode(TRAVERSAL_RECURSIVE)
+					,m_subtreeHeaderCount(0) //PCK: add this line
+{
+	m_bvhAabbMin.setValue(-SIMD_INFINITY,-SIMD_INFINITY,-SIMD_INFINITY);
+	m_bvhAabbMax.setValue(SIMD_INFINITY,SIMD_INFINITY,SIMD_INFINITY);
+}
+
+
+
+
+
+void btQuantizedBvh::buildInternal()
+{
+	///assumes that caller filled in the m_quantizedLeafNodes
+	m_useQuantization = true;
+	int numLeafNodes = 0;
+	
+	if (m_useQuantization)
+	{
+		//now we have an array of leafnodes in m_leafNodes
+		numLeafNodes = m_quantizedLeafNodes.size();
+
+		m_quantizedContiguousNodes.resize(2*numLeafNodes);
+
+	}
+
+	m_curNodeIndex = 0;
+
+	buildTree(0,numLeafNodes);
+
+	///if the entire tree is small then subtree size, we need to create a header info for the tree
+	if(m_useQuantization && !m_SubtreeHeaders.size())
+	{
+		btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand();
+		subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[0]);
+		subtree.m_rootNodeIndex = 0;
+		subtree.m_subtreeSize = m_quantizedContiguousNodes[0].isLeafNode() ? 1 : m_quantizedContiguousNodes[0].getEscapeIndex();
+	}
+
+	//PCK: update the copy of the size
+	m_subtreeHeaderCount = m_SubtreeHeaders.size();
+
+	//PCK: clear m_quantizedLeafNodes and m_leafNodes, they are temporary
+	m_quantizedLeafNodes.clear();
+	m_leafNodes.clear();
+}
+
+
+
+///just for debugging, to visualize the individual patches/subtrees
+#ifdef DEBUG_PATCH_COLORS
+btVector3 color[4]=
+{
+	btVector3(1,0,0),
+	btVector3(0,1,0),
+	btVector3(0,0,1),
+	btVector3(0,1,1)
+};
+#endif //DEBUG_PATCH_COLORS
+
+
+
+void	btQuantizedBvh::setQuantizationValues(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,btScalar quantizationMargin)
+{
+	//enlarge the AABB to avoid division by zero when initializing the quantization values
+	btVector3 clampValue(quantizationMargin,quantizationMargin,quantizationMargin);
+	m_bvhAabbMin = bvhAabbMin - clampValue;
+	m_bvhAabbMax = bvhAabbMax + clampValue;
+	btVector3 aabbSize = m_bvhAabbMax - m_bvhAabbMin;
+	m_bvhQuantization = btVector3(btScalar(65533.0),btScalar(65533.0),btScalar(65533.0)) / aabbSize;
+	m_useQuantization = true;
+}
+
+
+
+
+btQuantizedBvh::~btQuantizedBvh()
+{
+}
+
+#ifdef DEBUG_TREE_BUILDING
+int gStackDepth = 0;
+int gMaxStackDepth = 0;
+#endif //DEBUG_TREE_BUILDING
+
+void	btQuantizedBvh::buildTree	(int startIndex,int endIndex)
+{
+#ifdef DEBUG_TREE_BUILDING
+	gStackDepth++;
+	if (gStackDepth > gMaxStackDepth)
+		gMaxStackDepth = gStackDepth;
+#endif //DEBUG_TREE_BUILDING
+
+
+	int splitAxis, splitIndex, i;
+	int numIndices =endIndex-startIndex;
+	int curIndex = m_curNodeIndex;
+
+	btAssert(numIndices>0);
+
+	if (numIndices==1)
+	{
+#ifdef DEBUG_TREE_BUILDING
+		gStackDepth--;
+#endif //DEBUG_TREE_BUILDING
+		
+		assignInternalNodeFromLeafNode(m_curNodeIndex,startIndex);
+
+		m_curNodeIndex++;
+		return;	
+	}
+	//calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
+	
+	splitAxis = calcSplittingAxis(startIndex,endIndex);
+
+	splitIndex = sortAndCalcSplittingIndex(startIndex,endIndex,splitAxis);
+
+	int internalNodeIndex = m_curNodeIndex;
+	
+	//set the min aabb to 'inf' or a max value, and set the max aabb to a -inf/minimum value.
+	//the aabb will be expanded during buildTree/mergeInternalNodeAabb with actual node values
+	setInternalNodeAabbMin(m_curNodeIndex,m_bvhAabbMax);//can't use btVector3(SIMD_INFINITY,SIMD_INFINITY,SIMD_INFINITY)) because of quantization
+	setInternalNodeAabbMax(m_curNodeIndex,m_bvhAabbMin);//can't use btVector3(-SIMD_INFINITY,-SIMD_INFINITY,-SIMD_INFINITY)) because of quantization
+	
+	
+	for (i=startIndex;i<endIndex;i++)
+	{
+		mergeInternalNodeAabb(m_curNodeIndex,getAabbMin(i),getAabbMax(i));
+	}
+
+	m_curNodeIndex++;
+	
+
+	//internalNode->m_escapeIndex;
+	
+	int leftChildNodexIndex = m_curNodeIndex;
+
+	//build left child tree
+	buildTree(startIndex,splitIndex);
+
+	int rightChildNodexIndex = m_curNodeIndex;
+	//build right child tree
+	buildTree(splitIndex,endIndex);
+
+#ifdef DEBUG_TREE_BUILDING
+	gStackDepth--;
+#endif //DEBUG_TREE_BUILDING
+
+	int escapeIndex = m_curNodeIndex - curIndex;
+
+	if (m_useQuantization)
+	{
+		//escapeIndex is the number of nodes of this subtree
+		const int sizeQuantizedNode =sizeof(btQuantizedBvhNode);
+		const int treeSizeInBytes = escapeIndex * sizeQuantizedNode;
+		if (treeSizeInBytes > MAX_SUBTREE_SIZE_IN_BYTES)
+		{
+			updateSubtreeHeaders(leftChildNodexIndex,rightChildNodexIndex);
+		}
+	} else
+	{
+
+	}
+
+	setInternalNodeEscapeIndex(internalNodeIndex,escapeIndex);
+
+}
+
+void	btQuantizedBvh::updateSubtreeHeaders(int leftChildNodexIndex,int rightChildNodexIndex)
+{
+	btAssert(m_useQuantization);
+
+	btQuantizedBvhNode& leftChildNode = m_quantizedContiguousNodes[leftChildNodexIndex];
+	int leftSubTreeSize = leftChildNode.isLeafNode() ? 1 : leftChildNode.getEscapeIndex();
+	int leftSubTreeSizeInBytes =  leftSubTreeSize * static_cast<int>(sizeof(btQuantizedBvhNode));
+	
+	btQuantizedBvhNode& rightChildNode = m_quantizedContiguousNodes[rightChildNodexIndex];
+	int rightSubTreeSize = rightChildNode.isLeafNode() ? 1 : rightChildNode.getEscapeIndex();
+	int rightSubTreeSizeInBytes =  rightSubTreeSize *  static_cast<int>(sizeof(btQuantizedBvhNode));
+
+	if(leftSubTreeSizeInBytes <= MAX_SUBTREE_SIZE_IN_BYTES)
+	{
+		btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand();
+		subtree.setAabbFromQuantizeNode(leftChildNode);
+		subtree.m_rootNodeIndex = leftChildNodexIndex;
+		subtree.m_subtreeSize = leftSubTreeSize;
+	}
+
+	if(rightSubTreeSizeInBytes <= MAX_SUBTREE_SIZE_IN_BYTES)
+	{
+		btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand();
+		subtree.setAabbFromQuantizeNode(rightChildNode);
+		subtree.m_rootNodeIndex = rightChildNodexIndex;
+		subtree.m_subtreeSize = rightSubTreeSize;
+	}
+
+	//PCK: update the copy of the size
+	m_subtreeHeaderCount = m_SubtreeHeaders.size();
+}
+
+
+int	btQuantizedBvh::sortAndCalcSplittingIndex(int startIndex,int endIndex,int splitAxis)
+{
+	int i;
+	int splitIndex =startIndex;
+	int numIndices = endIndex - startIndex;
+	btScalar splitValue;
+
+	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(getAabbMax(i)+getAabbMin(i));
+		means+=center;
+	}
+	means *= (btScalar(1.)/(btScalar)numIndices);
+	
+	splitValue = means[splitAxis];
+	
+	//sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(getAabbMax(i)+getAabbMin(i));
+		if (center[splitAxis] > splitValue)
+		{
+			//swap
+			swapLeafNodes(i,splitIndex);
+			splitIndex++;
+		}
+	}
+
+	//if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex
+	//otherwise the tree-building might fail due to stack-overflows in certain cases.
+	//unbalanced1 is unsafe: it can cause stack overflows
+	//bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1)));
+
+	//unbalanced2 should work too: always use center (perfect balanced trees)	
+	//bool unbalanced2 = true;
+
+	//this should be safe too:
+	int rangeBalancedIndices = numIndices/3;
+	bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices)));
+	
+	if (unbalanced)
+	{
+		splitIndex = startIndex+ (numIndices>>1);
+	}
+
+	bool unbal = (splitIndex==startIndex) || (splitIndex == (endIndex));
+	(void)unbal;
+	btAssert(!unbal);
+
+	return splitIndex;
+}
+
+
+int	btQuantizedBvh::calcSplittingAxis(int startIndex,int endIndex)
+{
+	int i;
+
+	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
+	btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.));
+	int numIndices = endIndex-startIndex;
+
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(getAabbMax(i)+getAabbMin(i));
+		means+=center;
+	}
+	means *= (btScalar(1.)/(btScalar)numIndices);
+		
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(getAabbMax(i)+getAabbMin(i));
+		btVector3 diff2 = center-means;
+		diff2 = diff2 * diff2;
+		variance += diff2;
+	}
+	variance *= (btScalar(1.)/	((btScalar)numIndices-1)	);
+	
+	return variance.maxAxis();
+}
+
+
+
+void	btQuantizedBvh::reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	//either choose recursive traversal (walkTree) or stackless (walkStacklessTree)
+
+	if (m_useQuantization)
+	{
+		///quantize query AABB
+		unsigned short int quantizedQueryAabbMin[3];
+		unsigned short int quantizedQueryAabbMax[3];
+		quantizeWithClamp(quantizedQueryAabbMin,aabbMin,0);
+		quantizeWithClamp(quantizedQueryAabbMax,aabbMax,1);
+
+		switch (m_traversalMode)
+		{
+		case TRAVERSAL_STACKLESS:
+				walkStacklessQuantizedTree(nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax,0,m_curNodeIndex);
+			break;
+		case TRAVERSAL_STACKLESS_CACHE_FRIENDLY:
+				walkStacklessQuantizedTreeCacheFriendly(nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax);
+			break;
+		case TRAVERSAL_RECURSIVE:
+			{
+				const btQuantizedBvhNode* rootNode = &m_quantizedContiguousNodes[0];
+				walkRecursiveQuantizedTreeAgainstQueryAabb(rootNode,nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax);
+			}
+			break;
+		default:
+			//unsupported
+			btAssert(0);
+		}
+	} else
+	{
+		walkStacklessTree(nodeCallback,aabbMin,aabbMax);
+	}
+}
+
+
+int maxIterations = 0;
+
+
+void	btQuantizedBvh::walkStacklessTree(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	btAssert(!m_useQuantization);
+
+	const btOptimizedBvhNode* rootNode = &m_contiguousNodes[0];
+	int escapeIndex, curIndex = 0;
+	int walkIterations = 0;
+	bool isLeafNode;
+	//PCK: unsigned instead of bool
+	unsigned aabbOverlap;
+
+	while (curIndex < m_curNodeIndex)
+	{
+		//catch bugs in tree data
+		btAssert (walkIterations < m_curNodeIndex);
+
+		walkIterations++;
+		aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
+		isLeafNode = rootNode->m_escapeIndex == -1;
+		
+		//PCK: unsigned instead of bool
+		if (isLeafNode && (aabbOverlap != 0))
+		{
+			nodeCallback->processNode(rootNode->m_subPart,rootNode->m_triangleIndex);
+		} 
+		
+		//PCK: unsigned instead of bool
+		if ((aabbOverlap != 0) || isLeafNode)
+		{
+			rootNode++;
+			curIndex++;
+		} else
+		{
+			escapeIndex = rootNode->m_escapeIndex;
+			rootNode += escapeIndex;
+			curIndex += escapeIndex;
+		}
+	}
+	if (maxIterations < walkIterations)
+		maxIterations = walkIterations;
+
+}
+
+/*
+///this was the original recursive traversal, before we optimized towards stackless traversal
+void	btQuantizedBvh::walkTree(btOptimizedBvhNode* rootNode,btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	bool isLeafNode, aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax);
+	if (aabbOverlap)
+	{
+		isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild);
+		if (isLeafNode)
+		{
+			nodeCallback->processNode(rootNode);
+		} else
+		{
+			walkTree(rootNode->m_leftChild,nodeCallback,aabbMin,aabbMax);
+			walkTree(rootNode->m_rightChild,nodeCallback,aabbMin,aabbMax);
+		}
+	}
+
+}
+*/
+
+void btQuantizedBvh::walkRecursiveQuantizedTreeAgainstQueryAabb(const btQuantizedBvhNode* currentNode,btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const
+{
+	btAssert(m_useQuantization);
+	
+	bool isLeafNode;
+	//PCK: unsigned instead of bool
+	unsigned aabbOverlap;
+
+	//PCK: unsigned instead of bool
+	aabbOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,currentNode->m_quantizedAabbMin,currentNode->m_quantizedAabbMax);
+	isLeafNode = currentNode->isLeafNode();
+		
+	//PCK: unsigned instead of bool
+	if (aabbOverlap != 0)
+	{
+		if (isLeafNode)
+		{
+			nodeCallback->processNode(currentNode->getPartId(),currentNode->getTriangleIndex());
+		} else
+		{
+			//process left and right children
+			const btQuantizedBvhNode* leftChildNode = currentNode+1;
+			walkRecursiveQuantizedTreeAgainstQueryAabb(leftChildNode,nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax);
+
+			const btQuantizedBvhNode* rightChildNode = leftChildNode->isLeafNode() ? leftChildNode+1:leftChildNode+leftChildNode->getEscapeIndex();
+			walkRecursiveQuantizedTreeAgainstQueryAabb(rightChildNode,nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax);
+		}
+	}		
+}
+
+
+
+void	btQuantizedBvh::walkStacklessTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const
+{
+	btAssert(!m_useQuantization);
+
+	const btOptimizedBvhNode* rootNode = &m_contiguousNodes[0];
+	int escapeIndex, curIndex = 0;
+	int walkIterations = 0;
+	bool isLeafNode;
+	//PCK: unsigned instead of bool
+	unsigned aabbOverlap=0;
+	unsigned rayBoxOverlap=0;
+	btScalar lambda_max = 1.0;
+	
+		/* Quick pruning by quantized box */
+	btVector3 rayAabbMin = raySource;
+	btVector3 rayAabbMax = raySource;
+	rayAabbMin.setMin(rayTarget);
+	rayAabbMax.setMax(rayTarget);
+
+	/* Add box cast extents to bounding box */
+	rayAabbMin += aabbMin;
+	rayAabbMax += aabbMax;
+
+#ifdef RAYAABB2
+	btVector3 rayDir = (rayTarget-raySource);
+	rayDir.normalize ();
+	lambda_max = rayDir.dot(rayTarget-raySource);
+	///what about division by zero? --> just set rayDirection[i] to 1.0
+	btVector3 rayDirectionInverse;
+	rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
+	rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
+	rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
+	unsigned int sign[3] = { rayDirectionInverse[0] < 0.0, rayDirectionInverse[1] < 0.0, rayDirectionInverse[2] < 0.0};
+#endif
+
+	btVector3 bounds[2];
+
+	while (curIndex < m_curNodeIndex)
+	{
+		btScalar param = 1.0;
+		//catch bugs in tree data
+		btAssert (walkIterations < m_curNodeIndex);
+
+		walkIterations++;
+
+		bounds[0] = rootNode->m_aabbMinOrg;
+		bounds[1] = rootNode->m_aabbMaxOrg;
+		/* Add box cast extents */
+		bounds[0] -= aabbMax;
+		bounds[1] -= aabbMin;
+
+		aabbOverlap = TestAabbAgainstAabb2(rayAabbMin,rayAabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
+		//perhaps profile if it is worth doing the aabbOverlap test first
+
+#ifdef RAYAABB2
+			///careful with this check: need to check division by zero (above) and fix the unQuantize method
+			///thanks Joerg/hiker for the reproduction case!
+			///http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1858
+		rayBoxOverlap = aabbOverlap ? btRayAabb2 (raySource, rayDirectionInverse, sign, bounds, param, 0.0f, lambda_max) : false;
+
+#else
+		btVector3 normal;
+		rayBoxOverlap = btRayAabb(raySource, rayTarget,bounds[0],bounds[1],param, normal);
+#endif
+
+		isLeafNode = rootNode->m_escapeIndex == -1;
+		
+		//PCK: unsigned instead of bool
+		if (isLeafNode && (rayBoxOverlap != 0))
+		{
+			nodeCallback->processNode(rootNode->m_subPart,rootNode->m_triangleIndex);
+		} 
+		
+		//PCK: unsigned instead of bool
+		if ((rayBoxOverlap != 0) || isLeafNode)
+		{
+			rootNode++;
+			curIndex++;
+		} else
+		{
+			escapeIndex = rootNode->m_escapeIndex;
+			rootNode += escapeIndex;
+			curIndex += escapeIndex;
+		}
+	}
+	if (maxIterations < walkIterations)
+		maxIterations = walkIterations;
+
+}
+
+
+
+void	btQuantizedBvh::walkStacklessQuantizedTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const
+{
+	btAssert(m_useQuantization);
+	
+	int curIndex = startNodeIndex;
+	int walkIterations = 0;
+	int subTreeSize = endNodeIndex - startNodeIndex;
+	(void)subTreeSize;
+
+	const btQuantizedBvhNode* rootNode = &m_quantizedContiguousNodes[startNodeIndex];
+	int escapeIndex;
+	
+	bool isLeafNode;
+	//PCK: unsigned instead of bool
+	unsigned boxBoxOverlap = 0;
+	unsigned rayBoxOverlap = 0;
+
+	btScalar lambda_max = 1.0;
+
+#ifdef RAYAABB2
+	btVector3 rayDirection = (rayTarget-raySource);
+	rayDirection.normalize ();
+	lambda_max = rayDirection.dot(rayTarget-raySource);
+	///what about division by zero? --> just set rayDirection[i] to 1.0
+	rayDirection[0] = rayDirection[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[0];
+	rayDirection[1] = rayDirection[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[1];
+	rayDirection[2] = rayDirection[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDirection[2];
+	unsigned int sign[3] = { rayDirection[0] < 0.0, rayDirection[1] < 0.0, rayDirection[2] < 0.0};
+#endif
+
+	/* Quick pruning by quantized box */
+	btVector3 rayAabbMin = raySource;
+	btVector3 rayAabbMax = raySource;
+	rayAabbMin.setMin(rayTarget);
+	rayAabbMax.setMax(rayTarget);
+
+	/* Add box cast extents to bounding box */
+	rayAabbMin += aabbMin;
+	rayAabbMax += aabbMax;
+
+	unsigned short int quantizedQueryAabbMin[3];
+	unsigned short int quantizedQueryAabbMax[3];
+	quantizeWithClamp(quantizedQueryAabbMin,rayAabbMin,0);
+	quantizeWithClamp(quantizedQueryAabbMax,rayAabbMax,1);
+
+	while (curIndex < endNodeIndex)
+	{
+
+//#define VISUALLY_ANALYZE_BVH 1
+#ifdef VISUALLY_ANALYZE_BVH
+		//some code snippet to debugDraw aabb, to visually analyze bvh structure
+		static int drawPatch = 0;
+		//need some global access to a debugDrawer
+		extern btIDebugDraw* debugDrawerPtr;
+		if (curIndex==drawPatch)
+		{
+			btVector3 aabbMin,aabbMax;
+			aabbMin = unQuantize(rootNode->m_quantizedAabbMin);
+			aabbMax = unQuantize(rootNode->m_quantizedAabbMax);
+			btVector3	color(1,0,0);
+			debugDrawerPtr->drawAabb(aabbMin,aabbMax,color);
+		}
+#endif//VISUALLY_ANALYZE_BVH
+
+		//catch bugs in tree data
+		btAssert (walkIterations < subTreeSize);
+
+		walkIterations++;
+		//PCK: unsigned instead of bool
+		// only interested if this is closer than any previous hit
+		btScalar param = 1.0;
+		rayBoxOverlap = 0;
+		boxBoxOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
+		isLeafNode = rootNode->isLeafNode();
+		if (boxBoxOverlap)
+		{
+			btVector3 bounds[2];
+			bounds[0] = unQuantize(rootNode->m_quantizedAabbMin);
+			bounds[1] = unQuantize(rootNode->m_quantizedAabbMax);
+			/* Add box cast extents */
+			bounds[0] -= aabbMax;
+			bounds[1] -= aabbMin;
+			btVector3 normal;
+#if 0
+			bool ra2 = btRayAabb2 (raySource, rayDirection, sign, bounds, param, 0.0, lambda_max);
+			bool ra = btRayAabb (raySource, rayTarget, bounds[0], bounds[1], param, normal);
+			if (ra2 != ra)
+			{
+				printf("functions don't match\n");
+			}
+#endif
+#ifdef RAYAABB2
+			///careful with this check: need to check division by zero (above) and fix the unQuantize method
+			///thanks Joerg/hiker for the reproduction case!
+			///http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1858
+
+			//BT_PROFILE("btRayAabb2");
+			rayBoxOverlap = btRayAabb2 (raySource, rayDirection, sign, bounds, param, 0.0f, lambda_max);
+			
+#else
+			rayBoxOverlap = true;//btRayAabb(raySource, rayTarget, bounds[0], bounds[1], param, normal);
+#endif
+		}
+		
+		if (isLeafNode && rayBoxOverlap)
+		{
+			nodeCallback->processNode(rootNode->getPartId(),rootNode->getTriangleIndex());
+		}
+		
+		//PCK: unsigned instead of bool
+		if ((rayBoxOverlap != 0) || isLeafNode)
+		{
+			rootNode++;
+			curIndex++;
+		} else
+		{
+			escapeIndex = rootNode->getEscapeIndex();
+			rootNode += escapeIndex;
+			curIndex += escapeIndex;
+		}
+	}
+	if (maxIterations < walkIterations)
+		maxIterations = walkIterations;
+
+}
+
+void	btQuantizedBvh::walkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,int startNodeIndex,int endNodeIndex) const
+{
+	btAssert(m_useQuantization);
+	
+	int curIndex = startNodeIndex;
+	int walkIterations = 0;
+	int subTreeSize = endNodeIndex - startNodeIndex;
+	(void)subTreeSize;
+
+	const btQuantizedBvhNode* rootNode = &m_quantizedContiguousNodes[startNodeIndex];
+	int escapeIndex;
+	
+	bool isLeafNode;
+	//PCK: unsigned instead of bool
+	unsigned aabbOverlap;
+
+	while (curIndex < endNodeIndex)
+	{
+
+//#define VISUALLY_ANALYZE_BVH 1
+#ifdef VISUALLY_ANALYZE_BVH
+		//some code snippet to debugDraw aabb, to visually analyze bvh structure
+		static int drawPatch = 0;
+		//need some global access to a debugDrawer
+		extern btIDebugDraw* debugDrawerPtr;
+		if (curIndex==drawPatch)
+		{
+			btVector3 aabbMin,aabbMax;
+			aabbMin = unQuantize(rootNode->m_quantizedAabbMin);
+			aabbMax = unQuantize(rootNode->m_quantizedAabbMax);
+			btVector3	color(1,0,0);
+			debugDrawerPtr->drawAabb(aabbMin,aabbMax,color);
+		}
+#endif//VISUALLY_ANALYZE_BVH
+
+		//catch bugs in tree data
+		btAssert (walkIterations < subTreeSize);
+
+		walkIterations++;
+		//PCK: unsigned instead of bool
+		aabbOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
+		isLeafNode = rootNode->isLeafNode();
+		
+		if (isLeafNode && aabbOverlap)
+		{
+			nodeCallback->processNode(rootNode->getPartId(),rootNode->getTriangleIndex());
+		} 
+		
+		//PCK: unsigned instead of bool
+		if ((aabbOverlap != 0) || isLeafNode)
+		{
+			rootNode++;
+			curIndex++;
+		} else
+		{
+			escapeIndex = rootNode->getEscapeIndex();
+			rootNode += escapeIndex;
+			curIndex += escapeIndex;
+		}
+	}
+	if (maxIterations < walkIterations)
+		maxIterations = walkIterations;
+
+}
+
+//This traversal can be called from Playstation 3 SPU
+void	btQuantizedBvh::walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const
+{
+	btAssert(m_useQuantization);
+
+	int i;
+
+
+	for (i=0;i<this->m_SubtreeHeaders.size();i++)
+	{
+		const btBvhSubtreeInfo& subtree = m_SubtreeHeaders[i];
+
+		//PCK: unsigned instead of bool
+		unsigned overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
+		if (overlap != 0)
+		{
+			walkStacklessQuantizedTree(nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax,
+				subtree.m_rootNodeIndex,
+				subtree.m_rootNodeIndex+subtree.m_subtreeSize);
+		}
+	}
+}
+
+
+void	btQuantizedBvh::reportRayOverlappingNodex (btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget) const
+{
+	reportBoxCastOverlappingNodex(nodeCallback,raySource,rayTarget,btVector3(0,0,0),btVector3(0,0,0));
+}
+
+
+void	btQuantizedBvh::reportBoxCastOverlappingNodex(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	//always use stackless
+
+	if (m_useQuantization)
+	{
+		walkStacklessQuantizedTreeAgainstRay(nodeCallback, raySource, rayTarget, aabbMin, aabbMax, 0, m_curNodeIndex);
+	}
+	else
+	{
+		walkStacklessTreeAgainstRay(nodeCallback, raySource, rayTarget, aabbMin, aabbMax, 0, m_curNodeIndex);
+	}
+	/*
+	{
+		//recursive traversal
+		btVector3 qaabbMin = raySource;
+		btVector3 qaabbMax = raySource;
+		qaabbMin.setMin(rayTarget);
+		qaabbMax.setMax(rayTarget);
+		qaabbMin += aabbMin;
+		qaabbMax += aabbMax;
+		reportAabbOverlappingNodex(nodeCallback,qaabbMin,qaabbMax);
+	}
+	*/
+
+}
+
+
+void	btQuantizedBvh::swapLeafNodes(int i,int splitIndex)
+{
+	if (m_useQuantization)
+	{
+			btQuantizedBvhNode tmp = m_quantizedLeafNodes[i];
+			m_quantizedLeafNodes[i] = m_quantizedLeafNodes[splitIndex];
+			m_quantizedLeafNodes[splitIndex] = tmp;
+	} else
+	{
+			btOptimizedBvhNode tmp = m_leafNodes[i];
+			m_leafNodes[i] = m_leafNodes[splitIndex];
+			m_leafNodes[splitIndex] = tmp;
+	}
+}
+
+void	btQuantizedBvh::assignInternalNodeFromLeafNode(int internalNode,int leafNodeIndex)
+{
+	if (m_useQuantization)
+	{
+		m_quantizedContiguousNodes[internalNode] = m_quantizedLeafNodes[leafNodeIndex];
+	} else
+	{
+		m_contiguousNodes[internalNode] = m_leafNodes[leafNodeIndex];
+	}
+}
+
+//PCK: include
+#include <new>
+
+#if 0
+//PCK: consts
+static const unsigned BVH_ALIGNMENT = 16;
+static const unsigned BVH_ALIGNMENT_MASK = BVH_ALIGNMENT-1;
+
+static const unsigned BVH_ALIGNMENT_BLOCKS = 2;
+#endif
+
+
+unsigned int btQuantizedBvh::getAlignmentSerializationPadding()
+{
+	// I changed this to 0 since the extra padding is not needed or used.
+	return 0;//BVH_ALIGNMENT_BLOCKS * BVH_ALIGNMENT;
+}
+
+unsigned btQuantizedBvh::calculateSerializeBufferSize() const
+{
+	unsigned baseSize = sizeof(btQuantizedBvh) + getAlignmentSerializationPadding();
+	baseSize += sizeof(btBvhSubtreeInfo) * m_subtreeHeaderCount;
+	if (m_useQuantization)
+	{
+		return baseSize + m_curNodeIndex * sizeof(btQuantizedBvhNode);
+	}
+	return baseSize + m_curNodeIndex * sizeof(btOptimizedBvhNode);
+}
+
+bool btQuantizedBvh::serialize(void *o_alignedDataBuffer, unsigned /*i_dataBufferSize */, bool i_swapEndian) const
+{
+	btAssert(m_subtreeHeaderCount == m_SubtreeHeaders.size());
+	m_subtreeHeaderCount = m_SubtreeHeaders.size();
+
+/*	if (i_dataBufferSize < calculateSerializeBufferSize() || o_alignedDataBuffer == NULL || (((unsigned)o_alignedDataBuffer & BVH_ALIGNMENT_MASK) != 0))
+	{
+		///check alignedment for buffer?
+		btAssert(0);
+		return false;
+	}
+*/
+
+	btQuantizedBvh *targetBvh = (btQuantizedBvh *)o_alignedDataBuffer;
+
+	// construct the class so the virtual function table, etc will be set up
+	// Also, m_leafNodes and m_quantizedLeafNodes will be initialized to default values by the constructor
+	new (targetBvh) btQuantizedBvh;
+
+	if (i_swapEndian)
+	{
+		targetBvh->m_curNodeIndex = static_cast<int>(btSwapEndian(m_curNodeIndex));
+
+
+		btSwapVector3Endian(m_bvhAabbMin,targetBvh->m_bvhAabbMin);
+		btSwapVector3Endian(m_bvhAabbMax,targetBvh->m_bvhAabbMax);
+		btSwapVector3Endian(m_bvhQuantization,targetBvh->m_bvhQuantization);
+
+		targetBvh->m_traversalMode = (btTraversalMode)btSwapEndian(m_traversalMode);
+		targetBvh->m_subtreeHeaderCount = static_cast<int>(btSwapEndian(m_subtreeHeaderCount));
+	}
+	else
+	{
+		targetBvh->m_curNodeIndex = m_curNodeIndex;
+		targetBvh->m_bvhAabbMin = m_bvhAabbMin;
+		targetBvh->m_bvhAabbMax = m_bvhAabbMax;
+		targetBvh->m_bvhQuantization = m_bvhQuantization;
+		targetBvh->m_traversalMode = m_traversalMode;
+		targetBvh->m_subtreeHeaderCount = m_subtreeHeaderCount;
+	}
+
+	targetBvh->m_useQuantization = m_useQuantization;
+
+	unsigned char *nodeData = (unsigned char *)targetBvh;
+	nodeData += sizeof(btQuantizedBvh);
+	
+	unsigned sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK;
+	nodeData += sizeToAdd;
+	
+	int nodeCount = m_curNodeIndex;
+
+	if (m_useQuantization)
+	{
+		targetBvh->m_quantizedContiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount);
+
+		if (i_swapEndian)
+		{
+			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
+			{
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0]);
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1]);
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2]);
+
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0]);
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1]);
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2]);
+
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = static_cast<int>(btSwapEndian(m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex));
+			}
+		}
+		else
+		{
+			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
+			{
+	
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0];
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1];
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2];
+
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0];
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1];
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2];
+
+				targetBvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex;
+
+
+			}
+		}
+		nodeData += sizeof(btQuantizedBvhNode) * nodeCount;
+
+		// this clears the pointer in the member variable it doesn't really do anything to the data
+		// it does call the destructor on the contained objects, but they are all classes with no destructor defined
+		// so the memory (which is not freed) is left alone
+		targetBvh->m_quantizedContiguousNodes.initializeFromBuffer(NULL, 0, 0);
+	}
+	else
+	{
+		targetBvh->m_contiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount);
+
+		if (i_swapEndian)
+		{
+			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
+			{
+				btSwapVector3Endian(m_contiguousNodes[nodeIndex].m_aabbMinOrg, targetBvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg);
+				btSwapVector3Endian(m_contiguousNodes[nodeIndex].m_aabbMaxOrg, targetBvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg);
+
+				targetBvh->m_contiguousNodes[nodeIndex].m_escapeIndex = static_cast<int>(btSwapEndian(m_contiguousNodes[nodeIndex].m_escapeIndex));
+				targetBvh->m_contiguousNodes[nodeIndex].m_subPart = static_cast<int>(btSwapEndian(m_contiguousNodes[nodeIndex].m_subPart));
+				targetBvh->m_contiguousNodes[nodeIndex].m_triangleIndex = static_cast<int>(btSwapEndian(m_contiguousNodes[nodeIndex].m_triangleIndex));
+			}
+		}
+		else
+		{
+			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
+			{
+				targetBvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg = m_contiguousNodes[nodeIndex].m_aabbMinOrg;
+				targetBvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg = m_contiguousNodes[nodeIndex].m_aabbMaxOrg;
+
+				targetBvh->m_contiguousNodes[nodeIndex].m_escapeIndex = m_contiguousNodes[nodeIndex].m_escapeIndex;
+				targetBvh->m_contiguousNodes[nodeIndex].m_subPart = m_contiguousNodes[nodeIndex].m_subPart;
+				targetBvh->m_contiguousNodes[nodeIndex].m_triangleIndex = m_contiguousNodes[nodeIndex].m_triangleIndex;
+			}
+		}
+		nodeData += sizeof(btOptimizedBvhNode) * nodeCount;
+
+		// this clears the pointer in the member variable it doesn't really do anything to the data
+		// it does call the destructor on the contained objects, but they are all classes with no destructor defined
+		// so the memory (which is not freed) is left alone
+		targetBvh->m_contiguousNodes.initializeFromBuffer(NULL, 0, 0);
+	}
+
+	sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK;
+	nodeData += sizeToAdd;
+
+	// Now serialize the subtree headers
+	targetBvh->m_SubtreeHeaders.initializeFromBuffer(nodeData, m_subtreeHeaderCount, m_subtreeHeaderCount);
+	if (i_swapEndian)
+	{
+		for (int i = 0; i < m_subtreeHeaderCount; i++)
+		{
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[0]);
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[1]);
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMin[2]);
+
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[0]);
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[1]);
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = btSwapEndian(m_SubtreeHeaders[i].m_quantizedAabbMax[2]);
+
+			targetBvh->m_SubtreeHeaders[i].m_rootNodeIndex = static_cast<int>(btSwapEndian(m_SubtreeHeaders[i].m_rootNodeIndex));
+			targetBvh->m_SubtreeHeaders[i].m_subtreeSize = static_cast<int>(btSwapEndian(m_SubtreeHeaders[i].m_subtreeSize));
+		}
+	}
+	else
+	{
+		for (int i = 0; i < m_subtreeHeaderCount; i++)
+		{
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = (m_SubtreeHeaders[i].m_quantizedAabbMin[0]);
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = (m_SubtreeHeaders[i].m_quantizedAabbMin[1]);
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = (m_SubtreeHeaders[i].m_quantizedAabbMin[2]);
+
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = (m_SubtreeHeaders[i].m_quantizedAabbMax[0]);
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = (m_SubtreeHeaders[i].m_quantizedAabbMax[1]);
+			targetBvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = (m_SubtreeHeaders[i].m_quantizedAabbMax[2]);
+
+			targetBvh->m_SubtreeHeaders[i].m_rootNodeIndex = (m_SubtreeHeaders[i].m_rootNodeIndex);
+			targetBvh->m_SubtreeHeaders[i].m_subtreeSize = (m_SubtreeHeaders[i].m_subtreeSize);
+
+			// need to clear padding in destination buffer
+			targetBvh->m_SubtreeHeaders[i].m_padding[0] = 0;
+			targetBvh->m_SubtreeHeaders[i].m_padding[1] = 0;
+			targetBvh->m_SubtreeHeaders[i].m_padding[2] = 0;
+		}
+	}
+	nodeData += sizeof(btBvhSubtreeInfo) * m_subtreeHeaderCount;
+
+	// this clears the pointer in the member variable it doesn't really do anything to the data
+	// it does call the destructor on the contained objects, but they are all classes with no destructor defined
+	// so the memory (which is not freed) is left alone
+	targetBvh->m_SubtreeHeaders.initializeFromBuffer(NULL, 0, 0);
+
+	// this wipes the virtual function table pointer at the start of the buffer for the class
+	*((void**)o_alignedDataBuffer) = NULL;
+
+	return true;
+}
+
+btQuantizedBvh *btQuantizedBvh::deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian)
+{
+
+	if (i_alignedDataBuffer == NULL)// || (((unsigned)i_alignedDataBuffer & BVH_ALIGNMENT_MASK) != 0))
+	{
+		return NULL;
+	}
+	btQuantizedBvh *bvh = (btQuantizedBvh *)i_alignedDataBuffer;
+
+	if (i_swapEndian)
+	{
+		bvh->m_curNodeIndex = static_cast<int>(btSwapEndian(bvh->m_curNodeIndex));
+
+		btUnSwapVector3Endian(bvh->m_bvhAabbMin);
+		btUnSwapVector3Endian(bvh->m_bvhAabbMax);
+		btUnSwapVector3Endian(bvh->m_bvhQuantization);
+
+		bvh->m_traversalMode = (btTraversalMode)btSwapEndian(bvh->m_traversalMode);
+		bvh->m_subtreeHeaderCount = static_cast<int>(btSwapEndian(bvh->m_subtreeHeaderCount));
+	}
+
+	unsigned int calculatedBufSize = bvh->calculateSerializeBufferSize();
+	btAssert(calculatedBufSize <= i_dataBufferSize);
+
+	if (calculatedBufSize > i_dataBufferSize)
+	{
+		return NULL;
+	}
+
+	unsigned char *nodeData = (unsigned char *)bvh;
+	nodeData += sizeof(btQuantizedBvh);
+	
+	unsigned sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK;
+	nodeData += sizeToAdd;
+	
+	int nodeCount = bvh->m_curNodeIndex;
+
+	// Must call placement new to fill in virtual function table, etc, but we don't want to overwrite most data, so call a special version of the constructor
+	// Also, m_leafNodes and m_quantizedLeafNodes will be initialized to default values by the constructor
+	new (bvh) btQuantizedBvh(*bvh, false);
+
+	if (bvh->m_useQuantization)
+	{
+		bvh->m_quantizedContiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount);
+
+		if (i_swapEndian)
+		{
+			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
+			{
+				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0]);
+				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[1]);
+				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[2]);
+
+				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0]);
+				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[1]);
+				bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2] = btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[2]);
+
+				bvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = static_cast<int>(btSwapEndian(bvh->m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex));
+			}
+		}
+		nodeData += sizeof(btQuantizedBvhNode) * nodeCount;
+	}
+	else
+	{
+		bvh->m_contiguousNodes.initializeFromBuffer(nodeData, nodeCount, nodeCount);
+
+		if (i_swapEndian)
+		{
+			for (int nodeIndex = 0; nodeIndex < nodeCount; nodeIndex++)
+			{
+				btUnSwapVector3Endian(bvh->m_contiguousNodes[nodeIndex].m_aabbMinOrg);
+				btUnSwapVector3Endian(bvh->m_contiguousNodes[nodeIndex].m_aabbMaxOrg);
+				
+				bvh->m_contiguousNodes[nodeIndex].m_escapeIndex = static_cast<int>(btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_escapeIndex));
+				bvh->m_contiguousNodes[nodeIndex].m_subPart = static_cast<int>(btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_subPart));
+				bvh->m_contiguousNodes[nodeIndex].m_triangleIndex = static_cast<int>(btSwapEndian(bvh->m_contiguousNodes[nodeIndex].m_triangleIndex));
+			}
+		}
+		nodeData += sizeof(btOptimizedBvhNode) * nodeCount;
+	}
+
+	sizeToAdd = 0;//(BVH_ALIGNMENT-((unsigned)nodeData & BVH_ALIGNMENT_MASK))&BVH_ALIGNMENT_MASK;
+	nodeData += sizeToAdd;
+
+	// Now serialize the subtree headers
+	bvh->m_SubtreeHeaders.initializeFromBuffer(nodeData, bvh->m_subtreeHeaderCount, bvh->m_subtreeHeaderCount);
+	if (i_swapEndian)
+	{
+		for (int i = 0; i < bvh->m_subtreeHeaderCount; i++)
+		{
+			bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[0]);
+			bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[1]);
+			bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMin[2]);
+
+			bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[0]);
+			bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[1]);
+			bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2] = btSwapEndian(bvh->m_SubtreeHeaders[i].m_quantizedAabbMax[2]);
+
+			bvh->m_SubtreeHeaders[i].m_rootNodeIndex = static_cast<int>(btSwapEndian(bvh->m_SubtreeHeaders[i].m_rootNodeIndex));
+			bvh->m_SubtreeHeaders[i].m_subtreeSize = static_cast<int>(btSwapEndian(bvh->m_SubtreeHeaders[i].m_subtreeSize));
+		}
+	}
+
+	return bvh;
+}
+
+// Constructor that prevents btVector3's default constructor from being called
+btQuantizedBvh::btQuantizedBvh(btQuantizedBvh &self, bool /* ownsMemory */) :
+m_bvhAabbMin(self.m_bvhAabbMin),
+m_bvhAabbMax(self.m_bvhAabbMax),
+m_bvhQuantization(self.m_bvhQuantization),
+m_bulletVersion(BT_BULLET_VERSION)
+{
+
+}
+
+void btQuantizedBvh::deSerializeFloat(struct btQuantizedBvhFloatData& quantizedBvhFloatData)
+{
+	m_bvhAabbMax.deSerializeFloat(quantizedBvhFloatData.m_bvhAabbMax);
+	m_bvhAabbMin.deSerializeFloat(quantizedBvhFloatData.m_bvhAabbMin);
+	m_bvhQuantization.deSerializeFloat(quantizedBvhFloatData.m_bvhQuantization);
+
+	m_curNodeIndex = quantizedBvhFloatData.m_curNodeIndex;
+	m_useQuantization = quantizedBvhFloatData.m_useQuantization!=0;
+	
+	{
+		int numElem = quantizedBvhFloatData.m_numContiguousLeafNodes;
+		m_contiguousNodes.resize(numElem);
+
+		if (numElem)
+		{
+			btOptimizedBvhNodeFloatData* memPtr = quantizedBvhFloatData.m_contiguousNodesPtr;
+
+			for (int i=0;i<numElem;i++,memPtr++)
+			{
+				m_contiguousNodes[i].m_aabbMaxOrg.deSerializeFloat(memPtr->m_aabbMaxOrg);
+				m_contiguousNodes[i].m_aabbMinOrg.deSerializeFloat(memPtr->m_aabbMinOrg);
+				m_contiguousNodes[i].m_escapeIndex = memPtr->m_escapeIndex;
+				m_contiguousNodes[i].m_subPart = memPtr->m_subPart;
+				m_contiguousNodes[i].m_triangleIndex = memPtr->m_triangleIndex;
+			}
+		}
+	}
+
+	{
+		int numElem = quantizedBvhFloatData.m_numQuantizedContiguousNodes;
+		m_quantizedContiguousNodes.resize(numElem);
+		
+		if (numElem)
+		{
+			btQuantizedBvhNodeData* memPtr = quantizedBvhFloatData.m_quantizedContiguousNodesPtr;
+			for (int i=0;i<numElem;i++,memPtr++)
+			{
+				m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex = memPtr->m_escapeIndexOrTriangleIndex;
+				m_quantizedContiguousNodes[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
+			}
+		}
+	}
+
+	m_traversalMode = btTraversalMode(quantizedBvhFloatData.m_traversalMode);
+	
+	{
+		int numElem = quantizedBvhFloatData.m_numSubtreeHeaders;
+		m_SubtreeHeaders.resize(numElem);
+		if (numElem)
+		{
+			btBvhSubtreeInfoData* memPtr = quantizedBvhFloatData.m_subTreeInfoPtr;
+			for (int i=0;i<numElem;i++,memPtr++)
+			{
+				m_SubtreeHeaders[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0] ;
+				m_SubtreeHeaders[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
+				m_SubtreeHeaders[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
+				m_SubtreeHeaders[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
+				m_SubtreeHeaders[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
+				m_SubtreeHeaders[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
+				m_SubtreeHeaders[i].m_rootNodeIndex = memPtr->m_rootNodeIndex;
+				m_SubtreeHeaders[i].m_subtreeSize = memPtr->m_subtreeSize;
+			}
+		}
+	}
+}
+
+void btQuantizedBvh::deSerializeDouble(struct btQuantizedBvhDoubleData& quantizedBvhDoubleData)
+{
+	m_bvhAabbMax.deSerializeDouble(quantizedBvhDoubleData.m_bvhAabbMax);
+	m_bvhAabbMin.deSerializeDouble(quantizedBvhDoubleData.m_bvhAabbMin);
+	m_bvhQuantization.deSerializeDouble(quantizedBvhDoubleData.m_bvhQuantization);
+
+	m_curNodeIndex = quantizedBvhDoubleData.m_curNodeIndex;
+	m_useQuantization = quantizedBvhDoubleData.m_useQuantization!=0;
+	
+	{
+		int numElem = quantizedBvhDoubleData.m_numContiguousLeafNodes;
+		m_contiguousNodes.resize(numElem);
+
+		if (numElem)
+		{
+			btOptimizedBvhNodeDoubleData* memPtr = quantizedBvhDoubleData.m_contiguousNodesPtr;
+
+			for (int i=0;i<numElem;i++,memPtr++)
+			{
+				m_contiguousNodes[i].m_aabbMaxOrg.deSerializeDouble(memPtr->m_aabbMaxOrg);
+				m_contiguousNodes[i].m_aabbMinOrg.deSerializeDouble(memPtr->m_aabbMinOrg);
+				m_contiguousNodes[i].m_escapeIndex = memPtr->m_escapeIndex;
+				m_contiguousNodes[i].m_subPart = memPtr->m_subPart;
+				m_contiguousNodes[i].m_triangleIndex = memPtr->m_triangleIndex;
+			}
+		}
+	}
+
+	{
+		int numElem = quantizedBvhDoubleData.m_numQuantizedContiguousNodes;
+		m_quantizedContiguousNodes.resize(numElem);
+		
+		if (numElem)
+		{
+			btQuantizedBvhNodeData* memPtr = quantizedBvhDoubleData.m_quantizedContiguousNodesPtr;
+			for (int i=0;i<numElem;i++,memPtr++)
+			{
+				m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex = memPtr->m_escapeIndexOrTriangleIndex;
+				m_quantizedContiguousNodes[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
+				m_quantizedContiguousNodes[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
+			}
+		}
+	}
+
+	m_traversalMode = btTraversalMode(quantizedBvhDoubleData.m_traversalMode);
+	
+	{
+		int numElem = quantizedBvhDoubleData.m_numSubtreeHeaders;
+		m_SubtreeHeaders.resize(numElem);
+		if (numElem)
+		{
+			btBvhSubtreeInfoData* memPtr = quantizedBvhDoubleData.m_subTreeInfoPtr;
+			for (int i=0;i<numElem;i++,memPtr++)
+			{
+				m_SubtreeHeaders[i].m_quantizedAabbMax[0] = memPtr->m_quantizedAabbMax[0] ;
+				m_SubtreeHeaders[i].m_quantizedAabbMax[1] = memPtr->m_quantizedAabbMax[1];
+				m_SubtreeHeaders[i].m_quantizedAabbMax[2] = memPtr->m_quantizedAabbMax[2];
+				m_SubtreeHeaders[i].m_quantizedAabbMin[0] = memPtr->m_quantizedAabbMin[0];
+				m_SubtreeHeaders[i].m_quantizedAabbMin[1] = memPtr->m_quantizedAabbMin[1];
+				m_SubtreeHeaders[i].m_quantizedAabbMin[2] = memPtr->m_quantizedAabbMin[2];
+				m_SubtreeHeaders[i].m_rootNodeIndex = memPtr->m_rootNodeIndex;
+				m_SubtreeHeaders[i].m_subtreeSize = memPtr->m_subtreeSize;
+			}
+		}
+	}
+
+}
+
+
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btQuantizedBvh::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btQuantizedBvhData* quantizedData = (btQuantizedBvhData*)dataBuffer;
+	
+	m_bvhAabbMax.serialize(quantizedData->m_bvhAabbMax);
+	m_bvhAabbMin.serialize(quantizedData->m_bvhAabbMin);
+	m_bvhQuantization.serialize(quantizedData->m_bvhQuantization);
+
+	quantizedData->m_curNodeIndex = m_curNodeIndex;
+	quantizedData->m_useQuantization = m_useQuantization;
+	
+	quantizedData->m_numContiguousLeafNodes = m_contiguousNodes.size();
+	quantizedData->m_contiguousNodesPtr = (btOptimizedBvhNodeData*) (m_contiguousNodes.size() ? serializer->getUniquePointer((void*)&m_contiguousNodes[0]) : 0);
+	if (quantizedData->m_contiguousNodesPtr)
+	{
+		int sz = sizeof(btOptimizedBvhNodeData);
+		int numElem = m_contiguousNodes.size();
+		btChunk* chunk = serializer->allocate(sz,numElem);
+		btOptimizedBvhNodeData* memPtr = (btOptimizedBvhNodeData*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			m_contiguousNodes[i].m_aabbMaxOrg.serialize(memPtr->m_aabbMaxOrg);
+			m_contiguousNodes[i].m_aabbMinOrg.serialize(memPtr->m_aabbMinOrg);
+			memPtr->m_escapeIndex = m_contiguousNodes[i].m_escapeIndex;
+			memPtr->m_subPart = m_contiguousNodes[i].m_subPart;
+			memPtr->m_triangleIndex = m_contiguousNodes[i].m_triangleIndex;
+		}
+		serializer->finalizeChunk(chunk,"btOptimizedBvhNodeData",BT_ARRAY_CODE,(void*)&m_contiguousNodes[0]);
+	}
+
+	quantizedData->m_numQuantizedContiguousNodes = m_quantizedContiguousNodes.size();
+//	printf("quantizedData->m_numQuantizedContiguousNodes=%d\n",quantizedData->m_numQuantizedContiguousNodes);
+	quantizedData->m_quantizedContiguousNodesPtr =(btQuantizedBvhNodeData*) (m_quantizedContiguousNodes.size() ? serializer->getUniquePointer((void*)&m_quantizedContiguousNodes[0]) : 0);
+	if (quantizedData->m_quantizedContiguousNodesPtr)
+	{
+		int sz = sizeof(btQuantizedBvhNodeData);
+		int numElem = m_quantizedContiguousNodes.size();
+		btChunk* chunk = serializer->allocate(sz,numElem);
+		btQuantizedBvhNodeData* memPtr = (btQuantizedBvhNodeData*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			memPtr->m_escapeIndexOrTriangleIndex = m_quantizedContiguousNodes[i].m_escapeIndexOrTriangleIndex;
+			memPtr->m_quantizedAabbMax[0] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[0];
+			memPtr->m_quantizedAabbMax[1] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[1];
+			memPtr->m_quantizedAabbMax[2] = m_quantizedContiguousNodes[i].m_quantizedAabbMax[2];
+			memPtr->m_quantizedAabbMin[0] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[0];
+			memPtr->m_quantizedAabbMin[1] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[1];
+			memPtr->m_quantizedAabbMin[2] = m_quantizedContiguousNodes[i].m_quantizedAabbMin[2];
+		}
+		serializer->finalizeChunk(chunk,"btQuantizedBvhNodeData",BT_ARRAY_CODE,(void*)&m_quantizedContiguousNodes[0]);
+	}
+
+	quantizedData->m_traversalMode = int(m_traversalMode);
+	quantizedData->m_numSubtreeHeaders = m_SubtreeHeaders.size();
+
+	quantizedData->m_subTreeInfoPtr = (btBvhSubtreeInfoData*) (m_SubtreeHeaders.size() ? serializer->getUniquePointer((void*)&m_SubtreeHeaders[0]) : 0);
+	if (quantizedData->m_subTreeInfoPtr)
+	{
+		int sz = sizeof(btBvhSubtreeInfoData);
+		int numElem = m_SubtreeHeaders.size();
+		btChunk* chunk = serializer->allocate(sz,numElem);
+		btBvhSubtreeInfoData* memPtr = (btBvhSubtreeInfoData*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			memPtr->m_quantizedAabbMax[0] = m_SubtreeHeaders[i].m_quantizedAabbMax[0];
+			memPtr->m_quantizedAabbMax[1] = m_SubtreeHeaders[i].m_quantizedAabbMax[1];
+			memPtr->m_quantizedAabbMax[2] = m_SubtreeHeaders[i].m_quantizedAabbMax[2];
+			memPtr->m_quantizedAabbMin[0] = m_SubtreeHeaders[i].m_quantizedAabbMin[0];
+			memPtr->m_quantizedAabbMin[1] = m_SubtreeHeaders[i].m_quantizedAabbMin[1];
+			memPtr->m_quantizedAabbMin[2] = m_SubtreeHeaders[i].m_quantizedAabbMin[2];
+
+			memPtr->m_rootNodeIndex = m_SubtreeHeaders[i].m_rootNodeIndex;
+			memPtr->m_subtreeSize = m_SubtreeHeaders[i].m_subtreeSize;
+		}
+		serializer->finalizeChunk(chunk,"btBvhSubtreeInfoData",BT_ARRAY_CODE,(void*)&m_SubtreeHeaders[0]);
+	}
+	return btQuantizedBvhDataName;
+}
+
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
new file mode 100644
index 0000000..bedb100
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
@@ -0,0 +1,579 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_QUANTIZED_BVH_H
+#define BT_QUANTIZED_BVH_H
+
+class btSerializer;
+
+//#define DEBUG_CHECK_DEQUANTIZATION 1
+#ifdef DEBUG_CHECK_DEQUANTIZATION
+#ifdef __SPU__
+#define printf spu_printf
+#endif //__SPU__
+
+#include <stdio.h>
+#include <stdlib.h>
+#endif //DEBUG_CHECK_DEQUANTIZATION
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btAlignedAllocator.h"
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btQuantizedBvhData btQuantizedBvhDoubleData
+#define btOptimizedBvhNodeData btOptimizedBvhNodeDoubleData
+#define btQuantizedBvhDataName "btQuantizedBvhDoubleData"
+#else
+#define btQuantizedBvhData btQuantizedBvhFloatData
+#define btOptimizedBvhNodeData btOptimizedBvhNodeFloatData
+#define btQuantizedBvhDataName "btQuantizedBvhFloatData"
+#endif
+
+
+
+//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/vclrf__m128.asp
+
+
+//Note: currently we have 16 bytes per quantized node
+#define MAX_SUBTREE_SIZE_IN_BYTES  2048
+
+// 10 gives the potential for 1024 parts, with at most 2^21 (2097152) (minus one
+// actually) triangles each (since the sign bit is reserved
+#define MAX_NUM_PARTS_IN_BITS 10
+
+///btQuantizedBvhNode is a compressed aabb node, 16 bytes.
+///Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).
+ATTRIBUTE_ALIGNED16	(struct) btQuantizedBvhNode
+{
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	//12 bytes
+	unsigned short int	m_quantizedAabbMin[3];
+	unsigned short int	m_quantizedAabbMax[3];
+	//4 bytes
+	int	m_escapeIndexOrTriangleIndex;
+
+	bool isLeafNode() const
+	{
+		//skipindex is negative (internal node), triangleindex >=0 (leafnode)
+		return (m_escapeIndexOrTriangleIndex >= 0);
+	}
+	int getEscapeIndex() const
+	{
+		btAssert(!isLeafNode());
+		return -m_escapeIndexOrTriangleIndex;
+	}
+	int	getTriangleIndex() const
+	{
+		btAssert(isLeafNode());
+		// Get only the lower bits where the triangle index is stored
+		return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
+	}
+	int	getPartId() const
+	{
+		btAssert(isLeafNode());
+		// Get only the highest bits where the part index is stored
+		return (m_escapeIndexOrTriangleIndex>>(31-MAX_NUM_PARTS_IN_BITS));
+	}
+}
+;
+
+/// btOptimizedBvhNode contains both internal and leaf node information.
+/// Total node size is 44 bytes / node. You can use the compressed version of 16 bytes.
+ATTRIBUTE_ALIGNED16 (struct) btOptimizedBvhNode
+{
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	//32 bytes
+	btVector3	m_aabbMinOrg;
+	btVector3	m_aabbMaxOrg;
+
+	//4
+	int	m_escapeIndex;
+
+	//8
+	//for child nodes
+	int	m_subPart;
+	int	m_triangleIndex;
+	int	m_padding[5];//bad, due to alignment
+
+
+};
+
+
+///btBvhSubtreeInfo provides info to gather a subtree of limited size
+ATTRIBUTE_ALIGNED16(class) btBvhSubtreeInfo
+{
+public:
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	//12 bytes
+	unsigned short int	m_quantizedAabbMin[3];
+	unsigned short int	m_quantizedAabbMax[3];
+	//4 bytes, points to the root of the subtree
+	int			m_rootNodeIndex;
+	//4 bytes
+	int			m_subtreeSize;
+	int			m_padding[3];
+
+	btBvhSubtreeInfo()
+	{
+		//memset(&m_padding[0], 0, sizeof(m_padding));
+	}
+
+
+	void	setAabbFromQuantizeNode(const btQuantizedBvhNode& quantizedNode)
+	{
+		m_quantizedAabbMin[0] = quantizedNode.m_quantizedAabbMin[0];
+		m_quantizedAabbMin[1] = quantizedNode.m_quantizedAabbMin[1];
+		m_quantizedAabbMin[2] = quantizedNode.m_quantizedAabbMin[2];
+		m_quantizedAabbMax[0] = quantizedNode.m_quantizedAabbMax[0];
+		m_quantizedAabbMax[1] = quantizedNode.m_quantizedAabbMax[1];
+		m_quantizedAabbMax[2] = quantizedNode.m_quantizedAabbMax[2];
+	}
+}
+;
+
+
+class btNodeOverlapCallback
+{
+public:
+	virtual ~btNodeOverlapCallback() {};
+
+	virtual void processNode(int subPart, int triangleIndex) = 0;
+};
+
+#include "LinearMath/btAlignedAllocator.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+
+
+///for code readability:
+typedef btAlignedObjectArray<btOptimizedBvhNode>	NodeArray;
+typedef btAlignedObjectArray<btQuantizedBvhNode>	QuantizedNodeArray;
+typedef btAlignedObjectArray<btBvhSubtreeInfo>		BvhSubtreeInfoArray;
+
+
+///The btQuantizedBvh class stores an AABB tree that can be quickly traversed on CPU and Cell SPU.
+///It is used by the btBvhTriangleMeshShape as midphase, and by the btMultiSapBroadphase.
+///It is recommended to use quantization for better performance and lower memory requirements.
+ATTRIBUTE_ALIGNED16(class) btQuantizedBvh
+{
+public:
+	enum btTraversalMode
+	{
+		TRAVERSAL_STACKLESS = 0,
+		TRAVERSAL_STACKLESS_CACHE_FRIENDLY,
+		TRAVERSAL_RECURSIVE
+	};
+
+protected:
+
+
+	btVector3			m_bvhAabbMin;
+	btVector3			m_bvhAabbMax;
+	btVector3			m_bvhQuantization;
+
+	int					m_bulletVersion;	//for serialization versioning. It could also be used to detect endianess.
+
+	int					m_curNodeIndex;
+	//quantization data
+	bool				m_useQuantization;
+
+
+
+	NodeArray			m_leafNodes;
+	NodeArray			m_contiguousNodes;
+	QuantizedNodeArray	m_quantizedLeafNodes;
+	QuantizedNodeArray	m_quantizedContiguousNodes;
+	
+	btTraversalMode	m_traversalMode;
+	BvhSubtreeInfoArray		m_SubtreeHeaders;
+
+	//This is only used for serialization so we don't have to add serialization directly to btAlignedObjectArray
+	mutable int m_subtreeHeaderCount;
+
+	
+
+
+
+	///two versions, one for quantized and normal nodes. This allows code-reuse while maintaining readability (no template/macro!)
+	///this might be refactored into a virtual, it is usually not calculated at run-time
+	void	setInternalNodeAabbMin(int nodeIndex, const btVector3& aabbMin)
+	{
+		if (m_useQuantization)
+		{
+			quantize(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] ,aabbMin,0);
+		} else
+		{
+			m_contiguousNodes[nodeIndex].m_aabbMinOrg = aabbMin;
+
+		}
+	}
+	void	setInternalNodeAabbMax(int nodeIndex,const btVector3& aabbMax)
+	{
+		if (m_useQuantization)
+		{
+			quantize(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0],aabbMax,1);
+		} else
+		{
+			m_contiguousNodes[nodeIndex].m_aabbMaxOrg = aabbMax;
+		}
+	}
+
+	btVector3 getAabbMin(int nodeIndex) const
+	{
+		if (m_useQuantization)
+		{
+			return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMin[0]);
+		}
+		//non-quantized
+		return m_leafNodes[nodeIndex].m_aabbMinOrg;
+
+	}
+	btVector3 getAabbMax(int nodeIndex) const
+	{
+		if (m_useQuantization)
+		{
+			return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMax[0]);
+		} 
+		//non-quantized
+		return m_leafNodes[nodeIndex].m_aabbMaxOrg;
+		
+	}
+
+	
+	void	setInternalNodeEscapeIndex(int nodeIndex, int escapeIndex)
+	{
+		if (m_useQuantization)
+		{
+			m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = -escapeIndex;
+		} 
+		else
+		{
+			m_contiguousNodes[nodeIndex].m_escapeIndex = escapeIndex;
+		}
+
+	}
+
+	void mergeInternalNodeAabb(int nodeIndex,const btVector3& newAabbMin,const btVector3& newAabbMax) 
+	{
+		if (m_useQuantization)
+		{
+			unsigned short int quantizedAabbMin[3];
+			unsigned short int quantizedAabbMax[3];
+			quantize(quantizedAabbMin,newAabbMin,0);
+			quantize(quantizedAabbMax,newAabbMax,1);
+			for (int i=0;i<3;i++)
+			{
+				if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] > quantizedAabbMin[i])
+					m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] = quantizedAabbMin[i];
+
+				if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] < quantizedAabbMax[i])
+					m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] = quantizedAabbMax[i];
+
+			}
+		} else
+		{
+			//non-quantized
+			m_contiguousNodes[nodeIndex].m_aabbMinOrg.setMin(newAabbMin);
+			m_contiguousNodes[nodeIndex].m_aabbMaxOrg.setMax(newAabbMax);		
+		}
+	}
+
+	void	swapLeafNodes(int firstIndex,int secondIndex);
+
+	void	assignInternalNodeFromLeafNode(int internalNode,int leafNodeIndex);
+
+protected:
+
+	
+
+	void	buildTree	(int startIndex,int endIndex);
+
+	int	calcSplittingAxis(int startIndex,int endIndex);
+
+	int	sortAndCalcSplittingIndex(int startIndex,int endIndex,int splitAxis);
+	
+	void	walkStacklessTree(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+	void	walkStacklessQuantizedTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const;
+	void	walkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,int startNodeIndex,int endNodeIndex) const;
+	void	walkStacklessTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const;
+
+	///tree traversal designed for small-memory processors like PS3 SPU
+	void	walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const;
+
+	///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal
+	void	walkRecursiveQuantizedTreeAgainstQueryAabb(const btQuantizedBvhNode* currentNode,btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const;
+
+	///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal
+	void	walkRecursiveQuantizedTreeAgainstQuantizedTree(const btQuantizedBvhNode* treeNodeA,const btQuantizedBvhNode* treeNodeB,btNodeOverlapCallback* nodeCallback) const;
+	
+
+
+
+	void	updateSubtreeHeaders(int leftChildNodexIndex,int rightChildNodexIndex);
+
+public:
+	
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btQuantizedBvh();
+
+	virtual ~btQuantizedBvh();
+
+	
+	///***************************************** expert/internal use only *************************
+	void	setQuantizationValues(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,btScalar quantizationMargin=btScalar(1.0));
+	QuantizedNodeArray&	getLeafNodeArray() {			return	m_quantizedLeafNodes;	}
+	///buildInternal is expert use only: assumes that setQuantizationValues and LeafNodeArray are initialized
+	void	buildInternal();
+	///***************************************** expert/internal use only *************************
+
+	void	reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+	void	reportRayOverlappingNodex (btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget) const;
+	void	reportBoxCastOverlappingNodex(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+		SIMD_FORCE_INLINE void quantize(unsigned short* out, const btVector3& point,int isMax) const
+	{
+
+		btAssert(m_useQuantization);
+
+		btAssert(point.getX() <= m_bvhAabbMax.getX());
+		btAssert(point.getY() <= m_bvhAabbMax.getY());
+		btAssert(point.getZ() <= m_bvhAabbMax.getZ());
+
+		btAssert(point.getX() >= m_bvhAabbMin.getX());
+		btAssert(point.getY() >= m_bvhAabbMin.getY());
+		btAssert(point.getZ() >= m_bvhAabbMin.getZ());
+
+		btVector3 v = (point - m_bvhAabbMin) * m_bvhQuantization;
+		///Make sure rounding is done in a way that unQuantize(quantizeWithClamp(...)) is conservative
+		///end-points always set the first bit, so that they are sorted properly (so that neighbouring AABBs overlap properly)
+		///@todo: double-check this
+		if (isMax)
+		{
+			out[0] = (unsigned short) (((unsigned short)(v.getX()+btScalar(1.)) | 1));
+			out[1] = (unsigned short) (((unsigned short)(v.getY()+btScalar(1.)) | 1));
+			out[2] = (unsigned short) (((unsigned short)(v.getZ()+btScalar(1.)) | 1));
+		} else
+		{
+			out[0] = (unsigned short) (((unsigned short)(v.getX()) & 0xfffe));
+			out[1] = (unsigned short) (((unsigned short)(v.getY()) & 0xfffe));
+			out[2] = (unsigned short) (((unsigned short)(v.getZ()) & 0xfffe));
+		}
+
+
+#ifdef DEBUG_CHECK_DEQUANTIZATION
+		btVector3 newPoint = unQuantize(out);
+		if (isMax)
+		{
+			if (newPoint.getX() < point.getX())
+			{
+				printf("unconservative X, diffX = %f, oldX=%f,newX=%f\n",newPoint.getX()-point.getX(), newPoint.getX(),point.getX());
+			}
+			if (newPoint.getY() < point.getY())
+			{
+				printf("unconservative Y, diffY = %f, oldY=%f,newY=%f\n",newPoint.getY()-point.getY(), newPoint.getY(),point.getY());
+			}
+			if (newPoint.getZ() < point.getZ())
+			{
+
+				printf("unconservative Z, diffZ = %f, oldZ=%f,newZ=%f\n",newPoint.getZ()-point.getZ(), newPoint.getZ(),point.getZ());
+			}
+		} else
+		{
+			if (newPoint.getX() > point.getX())
+			{
+				printf("unconservative X, diffX = %f, oldX=%f,newX=%f\n",newPoint.getX()-point.getX(), newPoint.getX(),point.getX());
+			}
+			if (newPoint.getY() > point.getY())
+			{
+				printf("unconservative Y, diffY = %f, oldY=%f,newY=%f\n",newPoint.getY()-point.getY(), newPoint.getY(),point.getY());
+			}
+			if (newPoint.getZ() > point.getZ())
+			{
+				printf("unconservative Z, diffZ = %f, oldZ=%f,newZ=%f\n",newPoint.getZ()-point.getZ(), newPoint.getZ(),point.getZ());
+			}
+		}
+#endif //DEBUG_CHECK_DEQUANTIZATION
+
+	}
+
+
+	SIMD_FORCE_INLINE void quantizeWithClamp(unsigned short* out, const btVector3& point2,int isMax) const
+	{
+
+		btAssert(m_useQuantization);
+
+		btVector3 clampedPoint(point2);
+		clampedPoint.setMax(m_bvhAabbMin);
+		clampedPoint.setMin(m_bvhAabbMax);
+
+		quantize(out,clampedPoint,isMax);
+
+	}
+	
+	SIMD_FORCE_INLINE btVector3	unQuantize(const unsigned short* vecIn) const
+	{
+			btVector3	vecOut;
+			vecOut.setValue(
+			(btScalar)(vecIn[0]) / (m_bvhQuantization.getX()),
+			(btScalar)(vecIn[1]) / (m_bvhQuantization.getY()),
+			(btScalar)(vecIn[2]) / (m_bvhQuantization.getZ()));
+			vecOut += m_bvhAabbMin;
+			return vecOut;
+	}
+
+	///setTraversalMode let's you choose between stackless, recursive or stackless cache friendly tree traversal. Note this is only implemented for quantized trees.
+	void	setTraversalMode(btTraversalMode	traversalMode)
+	{
+		m_traversalMode = traversalMode;
+	}
+
+
+	SIMD_FORCE_INLINE QuantizedNodeArray&	getQuantizedNodeArray()
+	{	
+		return	m_quantizedContiguousNodes;
+	}
+
+
+	SIMD_FORCE_INLINE BvhSubtreeInfoArray&	getSubtreeInfoArray()
+	{
+		return m_SubtreeHeaders;
+	}
+
+////////////////////////////////////////////////////////////////////
+
+	/////Calculate space needed to store BVH for serialization
+	unsigned calculateSerializeBufferSize() const;
+
+	/// Data buffer MUST be 16 byte aligned
+	virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const;
+
+	///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'
+	static btQuantizedBvh *deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian);
+
+	static unsigned int getAlignmentSerializationPadding();
+//////////////////////////////////////////////////////////////////////
+
+	
+	virtual	int	calculateSerializeBufferSizeNew() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+	virtual	void deSerializeFloat(struct btQuantizedBvhFloatData& quantizedBvhFloatData);
+
+	virtual	void deSerializeDouble(struct btQuantizedBvhDoubleData& quantizedBvhDoubleData);
+
+
+////////////////////////////////////////////////////////////////////
+
+	SIMD_FORCE_INLINE bool isQuantized()
+	{
+		return m_useQuantization;
+	}
+
+private:
+	// Special "copy" constructor that allows for in-place deserialization
+	// Prevents btVector3's default constructor from being called, but doesn't inialize much else
+	// ownsMemory should most likely be false if deserializing, and if you are not, don't call this (it also changes the function signature, which we need)
+	btQuantizedBvh(btQuantizedBvh &other, bool ownsMemory);
+
+}
+;
+
+
+struct	btBvhSubtreeInfoData
+{
+	int			m_rootNodeIndex;
+	int			m_subtreeSize;
+	unsigned short m_quantizedAabbMin[3];
+	unsigned short m_quantizedAabbMax[3];
+};
+
+struct btOptimizedBvhNodeFloatData
+{
+	btVector3FloatData	m_aabbMinOrg;
+	btVector3FloatData	m_aabbMaxOrg;
+	int	m_escapeIndex;
+	int	m_subPart;
+	int	m_triangleIndex;
+	char m_pad[4];
+};
+
+struct btOptimizedBvhNodeDoubleData
+{
+	btVector3DoubleData	m_aabbMinOrg;
+	btVector3DoubleData	m_aabbMaxOrg;
+	int	m_escapeIndex;
+	int	m_subPart;
+	int	m_triangleIndex;
+	char	m_pad[4];
+};
+
+
+struct btQuantizedBvhNodeData
+{
+	unsigned short m_quantizedAabbMin[3];
+	unsigned short m_quantizedAabbMax[3];
+	int	m_escapeIndexOrTriangleIndex;
+};
+
+struct	btQuantizedBvhFloatData
+{
+	btVector3FloatData			m_bvhAabbMin;
+	btVector3FloatData			m_bvhAabbMax;
+	btVector3FloatData			m_bvhQuantization;
+	int					m_curNodeIndex;
+	int					m_useQuantization;
+	int					m_numContiguousLeafNodes;
+	int					m_numQuantizedContiguousNodes;
+	btOptimizedBvhNodeFloatData	*m_contiguousNodesPtr;
+	btQuantizedBvhNodeData		*m_quantizedContiguousNodesPtr;
+	btBvhSubtreeInfoData	*m_subTreeInfoPtr;
+	int					m_traversalMode;
+	int					m_numSubtreeHeaders;
+	
+};
+
+struct	btQuantizedBvhDoubleData
+{
+	btVector3DoubleData			m_bvhAabbMin;
+	btVector3DoubleData			m_bvhAabbMax;
+	btVector3DoubleData			m_bvhQuantization;
+	int							m_curNodeIndex;
+	int							m_useQuantization;
+	int							m_numContiguousLeafNodes;
+	int							m_numQuantizedContiguousNodes;
+	btOptimizedBvhNodeDoubleData	*m_contiguousNodesPtr;
+	btQuantizedBvhNodeData			*m_quantizedContiguousNodesPtr;
+
+	int							m_traversalMode;
+	int							m_numSubtreeHeaders;
+	btBvhSubtreeInfoData		*m_subTreeInfoPtr;
+};
+
+
+SIMD_FORCE_INLINE	int	btQuantizedBvh::calculateSerializeBufferSizeNew() const
+{
+	return sizeof(btQuantizedBvhData);
+}
+
+
+
+#endif //BT_QUANTIZED_BVH_H
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
new file mode 100644
index 0000000..752fcd0
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
@@ -0,0 +1,349 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btSimpleBroadphase.h"
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "LinearMath/btAabbUtil2.h"
+
+#include <new>
+
+extern int gOverlappingPairs;
+
+void	btSimpleBroadphase::validate()
+{
+	for (int i=0;i<m_numHandles;i++)
+	{
+		for (int j=i+1;j<m_numHandles;j++)
+		{
+			btAssert(&m_pHandles[i] != &m_pHandles[j]);
+		}
+	}
+	
+}
+
+btSimpleBroadphase::btSimpleBroadphase(int maxProxies, btOverlappingPairCache* overlappingPairCache)
+	:m_pairCache(overlappingPairCache),
+	m_ownsPairCache(false),
+	m_invalidPair(0)
+{
+
+	if (!overlappingPairCache)
+	{
+		void* mem = btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16);
+		m_pairCache = new (mem)btHashedOverlappingPairCache();
+		m_ownsPairCache = true;
+	}
+
+	// allocate handles buffer and put all handles on free list
+	m_pHandlesRawPtr = btAlignedAlloc(sizeof(btSimpleBroadphaseProxy)*maxProxies,16);
+	m_pHandles = new(m_pHandlesRawPtr) btSimpleBroadphaseProxy[maxProxies];
+	m_maxHandles = maxProxies;
+	m_numHandles = 0;
+	m_firstFreeHandle = 0;
+	m_LastHandleIndex = -1;
+	
+
+	{
+		for (int i = m_firstFreeHandle; i < maxProxies; i++)
+		{
+			m_pHandles[i].SetNextFree(i + 1);
+			m_pHandles[i].m_uniqueId = i+2;//any UID will do, we just avoid too trivial values (0,1) for debugging purposes
+		}
+		m_pHandles[maxProxies - 1].SetNextFree(0);
+	
+	}
+
+}
+
+btSimpleBroadphase::~btSimpleBroadphase()
+{
+	btAlignedFree(m_pHandlesRawPtr);
+
+	if (m_ownsPairCache)
+	{
+		m_pairCache->~btOverlappingPairCache();
+		btAlignedFree(m_pairCache);
+	}
+}
+
+
+btBroadphaseProxy*	btSimpleBroadphase::createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* /*dispatcher*/,void* multiSapProxy)
+{
+	if (m_numHandles >= m_maxHandles)
+	{
+		btAssert(0);
+		return 0; //should never happen, but don't let the game crash ;-)
+	}
+	btAssert(aabbMin[0]<= aabbMax[0] && aabbMin[1]<= aabbMax[1] && aabbMin[2]<= aabbMax[2]);
+
+	int newHandleIndex = allocHandle();
+	btSimpleBroadphaseProxy* proxy = new (&m_pHandles[newHandleIndex])btSimpleBroadphaseProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask,multiSapProxy);
+
+	return proxy;
+}
+
+class	RemovingOverlapCallback : public btOverlapCallback
+{
+protected:
+	virtual bool	processOverlap(btBroadphasePair& pair)
+	{
+		(void)pair;
+		btAssert(0);
+		return false;
+	}
+};
+
+class RemovePairContainingProxy
+{
+
+	btBroadphaseProxy*	m_targetProxy;
+	public:
+	virtual ~RemovePairContainingProxy()
+	{
+	}
+protected:
+	virtual bool processOverlap(btBroadphasePair& pair)
+	{
+		btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(pair.m_pProxy0);
+		btSimpleBroadphaseProxy* proxy1 = static_cast<btSimpleBroadphaseProxy*>(pair.m_pProxy1);
+
+		return ((m_targetProxy == proxy0 || m_targetProxy == proxy1));
+	};
+};
+
+void	btSimpleBroadphase::destroyProxy(btBroadphaseProxy* proxyOrg,btDispatcher* dispatcher)
+{
+		
+		btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxyOrg);
+		freeHandle(proxy0);
+
+		m_pairCache->removeOverlappingPairsContainingProxy(proxyOrg,dispatcher);
+
+		//validate();
+		
+}
+
+void	btSimpleBroadphase::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const
+{
+	const btSimpleBroadphaseProxy* sbp = getSimpleProxyFromProxy(proxy);
+	aabbMin = sbp->m_aabbMin;
+	aabbMax = sbp->m_aabbMax;
+}
+
+void	btSimpleBroadphase::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* /*dispatcher*/)
+{
+	btSimpleBroadphaseProxy* sbp = getSimpleProxyFromProxy(proxy);
+	sbp->m_aabbMin = aabbMin;
+	sbp->m_aabbMax = aabbMax;
+}
+
+void	btSimpleBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin,const btVector3& aabbMax)
+{
+	for (int i=0; i <= m_LastHandleIndex; i++)
+	{
+		btSimpleBroadphaseProxy* proxy = &m_pHandles[i];
+		if(!proxy->m_clientObject)
+		{
+			continue;
+		}
+		rayCallback.process(proxy);
+	}
+}
+
+
+void	btSimpleBroadphase::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)
+{
+	for (int i=0; i <= m_LastHandleIndex; i++)
+	{
+		btSimpleBroadphaseProxy* proxy = &m_pHandles[i];
+		if(!proxy->m_clientObject)
+		{
+			continue;
+		}
+		if (TestAabbAgainstAabb2(aabbMin,aabbMax,proxy->m_aabbMin,proxy->m_aabbMax))
+		{
+			callback.process(proxy);
+		}
+	}
+}
+
+
+
+	
+
+
+
+bool	btSimpleBroadphase::aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1)
+{
+	return proxy0->m_aabbMin[0] <= proxy1->m_aabbMax[0] && proxy1->m_aabbMin[0] <= proxy0->m_aabbMax[0] && 
+		   proxy0->m_aabbMin[1] <= proxy1->m_aabbMax[1] && proxy1->m_aabbMin[1] <= proxy0->m_aabbMax[1] &&
+		   proxy0->m_aabbMin[2] <= proxy1->m_aabbMax[2] && proxy1->m_aabbMin[2] <= proxy0->m_aabbMax[2];
+
+}
+
+
+
+//then remove non-overlapping ones
+class CheckOverlapCallback : public btOverlapCallback
+{
+public:
+	virtual bool processOverlap(btBroadphasePair& pair)
+	{
+		return (!btSimpleBroadphase::aabbOverlap(static_cast<btSimpleBroadphaseProxy*>(pair.m_pProxy0),static_cast<btSimpleBroadphaseProxy*>(pair.m_pProxy1)));
+	}
+};
+
+void	btSimpleBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
+{
+	//first check for new overlapping pairs
+	int i,j;
+	if (m_numHandles >= 0)
+	{
+		int new_largest_index = -1;
+		for (i=0; i <= m_LastHandleIndex; i++)
+		{
+			btSimpleBroadphaseProxy* proxy0 = &m_pHandles[i];
+			if(!proxy0->m_clientObject)
+			{
+				continue;
+			}
+			new_largest_index = i;
+			for (j=i+1; j <= m_LastHandleIndex; j++)
+			{
+				btSimpleBroadphaseProxy* proxy1 = &m_pHandles[j];
+				btAssert(proxy0 != proxy1);
+				if(!proxy1->m_clientObject)
+				{
+					continue;
+				}
+
+				btSimpleBroadphaseProxy* p0 = getSimpleProxyFromProxy(proxy0);
+				btSimpleBroadphaseProxy* p1 = getSimpleProxyFromProxy(proxy1);
+
+				if (aabbOverlap(p0,p1))
+				{
+					if ( !m_pairCache->findPair(proxy0,proxy1))
+					{
+						m_pairCache->addOverlappingPair(proxy0,proxy1);
+					}
+				} else
+				{
+					if (!m_pairCache->hasDeferredRemoval())
+					{
+						if ( m_pairCache->findPair(proxy0,proxy1))
+						{
+							m_pairCache->removeOverlappingPair(proxy0,proxy1,dispatcher);
+						}
+					}
+				}
+			}
+		}
+
+		m_LastHandleIndex = new_largest_index;
+
+		if (m_ownsPairCache && m_pairCache->hasDeferredRemoval())
+		{
+
+			btBroadphasePairArray&	overlappingPairArray = m_pairCache->getOverlappingPairArray();
+
+			//perform a sort, to find duplicates and to sort 'invalid' pairs to the end
+			overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
+
+			overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
+			m_invalidPair = 0;
+
+
+			btBroadphasePair previousPair;
+			previousPair.m_pProxy0 = 0;
+			previousPair.m_pProxy1 = 0;
+			previousPair.m_algorithm = 0;
+
+
+			for (i=0;i<overlappingPairArray.size();i++)
+			{
+
+				btBroadphasePair& pair = overlappingPairArray[i];
+
+				bool isDuplicate = (pair == previousPair);
+
+				previousPair = pair;
+
+				bool needsRemoval = false;
+
+				if (!isDuplicate)
+				{
+					bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);
+
+					if (hasOverlap)
+					{
+						needsRemoval = false;//callback->processOverlap(pair);
+					} else
+					{
+						needsRemoval = true;
+					}
+				} else
+				{
+					//remove duplicate
+					needsRemoval = true;
+					//should have no algorithm
+					btAssert(!pair.m_algorithm);
+				}
+
+				if (needsRemoval)
+				{
+					m_pairCache->cleanOverlappingPair(pair,dispatcher);
+
+					//		m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
+					//		m_overlappingPairArray.pop_back();
+					pair.m_pProxy0 = 0;
+					pair.m_pProxy1 = 0;
+					m_invalidPair++;
+					gOverlappingPairs--;
+				} 
+
+			}
+
+			///if you don't like to skip the invalid pairs in the array, execute following code:
+#define CLEAN_INVALID_PAIRS 1
+#ifdef CLEAN_INVALID_PAIRS
+
+			//perform a sort, to sort 'invalid' pairs to the end
+			overlappingPairArray.quickSort(btBroadphasePairSortPredicate());
+
+			overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
+			m_invalidPair = 0;
+#endif//CLEAN_INVALID_PAIRS
+
+		}
+	}
+}
+
+
+bool btSimpleBroadphase::testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
+{
+	btSimpleBroadphaseProxy* p0 = getSimpleProxyFromProxy(proxy0);
+	btSimpleBroadphaseProxy* p1 = getSimpleProxyFromProxy(proxy1);
+	return aabbOverlap(p0,p1);
+}
+
+void	btSimpleBroadphase::resetPool(btDispatcher* dispatcher)
+{
+	//not yet
+}
diff --git a/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
new file mode 100644
index 0000000..7cb3c40
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
@@ -0,0 +1,171 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SIMPLE_BROADPHASE_H
+#define BT_SIMPLE_BROADPHASE_H
+
+
+#include "btOverlappingPairCache.h"
+
+
+struct btSimpleBroadphaseProxy : public btBroadphaseProxy
+{
+	int			m_nextFree;
+	
+//	int			m_handleId;
+
+	
+	btSimpleBroadphaseProxy() {};
+
+	btSimpleBroadphaseProxy(const btVector3& minpt,const btVector3& maxpt,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,void* multiSapProxy)
+	:btBroadphaseProxy(minpt,maxpt,userPtr,collisionFilterGroup,collisionFilterMask,multiSapProxy)
+	{
+		(void)shapeType;
+	}
+	
+	
+	SIMD_FORCE_INLINE void SetNextFree(int next) {m_nextFree = next;}
+	SIMD_FORCE_INLINE int GetNextFree() const {return m_nextFree;}
+
+	
+
+
+};
+
+///The SimpleBroadphase is just a unit-test for btAxisSweep3, bt32BitAxisSweep3, or btDbvtBroadphase, so use those classes instead.
+///It is a brute force aabb culling broadphase based on O(n^2) aabb checks
+class btSimpleBroadphase : public btBroadphaseInterface
+{
+
+protected:
+
+	int		m_numHandles;						// number of active handles
+	int		m_maxHandles;						// max number of handles
+	int		m_LastHandleIndex;							
+	
+	btSimpleBroadphaseProxy* m_pHandles;						// handles pool
+
+	void* m_pHandlesRawPtr;
+	int		m_firstFreeHandle;		// free handles list
+	
+	int allocHandle()
+	{
+		btAssert(m_numHandles < m_maxHandles);
+		int freeHandle = m_firstFreeHandle;
+		m_firstFreeHandle = m_pHandles[freeHandle].GetNextFree();
+		m_numHandles++;
+		if(freeHandle > m_LastHandleIndex)
+		{
+			m_LastHandleIndex = freeHandle;
+		}
+		return freeHandle;
+	}
+
+	void freeHandle(btSimpleBroadphaseProxy* proxy)
+	{
+		int handle = int(proxy-m_pHandles);
+		btAssert(handle >= 0 && handle < m_maxHandles);
+		if(handle == m_LastHandleIndex)
+		{
+			m_LastHandleIndex--;
+		}
+		proxy->SetNextFree(m_firstFreeHandle);
+		m_firstFreeHandle = handle;
+
+		proxy->m_clientObject = 0;
+
+		m_numHandles--;
+	}
+
+	btOverlappingPairCache*	m_pairCache;
+	bool	m_ownsPairCache;
+
+	int	m_invalidPair;
+
+	
+	
+	inline btSimpleBroadphaseProxy*	getSimpleProxyFromProxy(btBroadphaseProxy* proxy)
+	{
+		btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxy);
+		return proxy0;
+	}
+
+	inline const btSimpleBroadphaseProxy*	getSimpleProxyFromProxy(btBroadphaseProxy* proxy) const
+	{
+		const btSimpleBroadphaseProxy* proxy0 = static_cast<const btSimpleBroadphaseProxy*>(proxy);
+		return proxy0;
+	}
+
+	///reset broadphase internal structures, to ensure determinism/reproducability
+	virtual void resetPool(btDispatcher* dispatcher);
+
+
+	void	validate();
+
+protected:
+
+
+	
+
+public:
+	btSimpleBroadphase(int maxProxies=16384,btOverlappingPairCache* overlappingPairCache=0);
+	virtual ~btSimpleBroadphase();
+
+
+		static bool	aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1);
+
+
+	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy);
+
+	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);
+
+	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher);
+	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;
+
+	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));
+	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);
+		
+	btOverlappingPairCache*	getOverlappingPairCache()
+	{
+		return m_pairCache;
+	}
+	const btOverlappingPairCache*	getOverlappingPairCache() const
+	{
+		return m_pairCache;
+	}
+
+	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
+
+
+	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame
+	///will add some transform later
+	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const
+	{
+		aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
+		aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
+	}
+
+	virtual void	printStats()
+	{
+//		printf("btSimpleBroadphase.h\n");
+//		printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);
+	}
+};
+
+
+
+#endif //BT_SIMPLE_BROADPHASE_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
new file mode 100644
index 0000000..23a5c75
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
@@ -0,0 +1,201 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "LinearMath/btScalar.h"
+#include "SphereTriangleDetector.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+
+
+SphereTriangleDetector::SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle,btScalar contactBreakingThreshold)
+:m_sphere(sphere),
+m_triangle(triangle),
+m_contactBreakingThreshold(contactBreakingThreshold)
+{
+
+}
+
+void	SphereTriangleDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults)
+{
+
+	(void)debugDraw;
+	const btTransform& transformA = input.m_transformA;
+	const btTransform& transformB = input.m_transformB;
+
+	btVector3 point,normal;
+	btScalar timeOfImpact = btScalar(1.);
+	btScalar depth = btScalar(0.);
+//	output.m_distance = btScalar(BT_LARGE_FLOAT);
+	//move sphere into triangle space
+	btTransform	sphereInTr = transformB.inverseTimes(transformA);
+
+	if (collide(sphereInTr.getOrigin(),point,normal,depth,timeOfImpact,m_contactBreakingThreshold))
+	{
+		if (swapResults)
+		{
+			btVector3 normalOnB = transformB.getBasis()*normal;
+			btVector3 normalOnA = -normalOnB;
+			btVector3 pointOnA = transformB*point+normalOnB*depth;
+			output.addContactPoint(normalOnA,pointOnA,depth);
+		} else
+		{
+			output.addContactPoint(transformB.getBasis()*normal,transformB*point,depth);
+		}
+	}
+
+}
+
+
+
+// See also geometrictools.com
+// Basic idea: D = |p - (lo + t0*lv)| where t0 = lv . (p - lo) / lv . lv
+btScalar SegmentSqrDistance(const btVector3& from, const btVector3& to,const btVector3 &p, btVector3 &nearest);
+
+btScalar SegmentSqrDistance(const btVector3& from, const btVector3& to,const btVector3 &p, btVector3 &nearest) {
+	btVector3 diff = p - from;
+	btVector3 v = to - from;
+	btScalar t = v.dot(diff);
+	
+	if (t > 0) {
+		btScalar dotVV = v.dot(v);
+		if (t < dotVV) {
+			t /= dotVV;
+			diff -= t*v;
+		} else {
+			t = 1;
+			diff -= v;
+		}
+	} else
+		t = 0;
+
+	nearest = from + t*v;
+	return diff.dot(diff);	
+}
+
+bool SphereTriangleDetector::facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal)  {
+	btVector3 lp(p);
+	btVector3 lnormal(normal);
+	
+	return pointInTriangle(vertices, lnormal, &lp);
+}
+
+bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar contactBreakingThreshold)
+{
+
+	const btVector3* vertices = &m_triangle->getVertexPtr(0);
+	
+	btScalar radius = m_sphere->getRadius();
+	btScalar radiusWithThreshold = radius + contactBreakingThreshold;
+
+	btVector3 normal = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]);
+	normal.normalize();
+	btVector3 p1ToCentre = sphereCenter - vertices[0];
+	btScalar distanceFromPlane = p1ToCentre.dot(normal);
+
+	if (distanceFromPlane < btScalar(0.))
+	{
+		//triangle facing the other way
+		distanceFromPlane *= btScalar(-1.);
+		normal *= btScalar(-1.);
+	}
+
+	bool isInsideContactPlane = distanceFromPlane < radiusWithThreshold;
+	
+	// Check for contact / intersection
+	bool hasContact = false;
+	btVector3 contactPoint;
+	if (isInsideContactPlane) {
+		if (facecontains(sphereCenter,vertices,normal)) {
+			// Inside the contact wedge - touches a point on the shell plane
+			hasContact = true;
+			contactPoint = sphereCenter - normal*distanceFromPlane;
+		} else {
+			// Could be inside one of the contact capsules
+			btScalar contactCapsuleRadiusSqr = radiusWithThreshold*radiusWithThreshold;
+			btVector3 nearestOnEdge;
+			for (int i = 0; i < m_triangle->getNumEdges(); i++) {
+				
+				btVector3 pa;
+				btVector3 pb;
+				
+				m_triangle->getEdge(i,pa,pb);
+
+				btScalar distanceSqr = SegmentSqrDistance(pa,pb,sphereCenter, nearestOnEdge);
+				if (distanceSqr < contactCapsuleRadiusSqr) {
+					// Yep, we're inside a capsule
+					hasContact = true;
+					contactPoint = nearestOnEdge;
+				}
+				
+			}
+		}
+	}
+
+	if (hasContact) {
+		btVector3 contactToCentre = sphereCenter - contactPoint;
+		btScalar distanceSqr = contactToCentre.length2();
+
+		if (distanceSqr < radiusWithThreshold*radiusWithThreshold)
+		{
+			if (distanceSqr>SIMD_EPSILON)
+			{
+				btScalar distance = btSqrt(distanceSqr);
+				resultNormal = contactToCentre;
+				resultNormal.normalize();
+				point = contactPoint;
+				depth = -(radius-distance);
+			} else
+			{
+				btScalar distance = 0.f;
+				resultNormal = normal;
+				point = contactPoint;
+				depth = -radius;
+			}
+			return true;
+		}
+	}
+	
+	return false;
+}
+
+
+bool SphereTriangleDetector::pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p )
+{
+	const btVector3* p1 = &vertices[0];
+	const btVector3* p2 = &vertices[1];
+	const btVector3* p3 = &vertices[2];
+
+	btVector3 edge1( *p2 - *p1 );
+	btVector3 edge2( *p3 - *p2 );
+	btVector3 edge3( *p1 - *p3 );
+
+	btVector3 p1_to_p( *p - *p1 );
+	btVector3 p2_to_p( *p - *p2 );
+	btVector3 p3_to_p( *p - *p3 );
+
+	btVector3 edge1_normal( edge1.cross(normal));
+	btVector3 edge2_normal( edge2.cross(normal));
+	btVector3 edge3_normal( edge3.cross(normal));
+	
+	btScalar r1, r2, r3;
+	r1 = edge1_normal.dot( p1_to_p );
+	r2 = edge2_normal.dot( p2_to_p );
+	r3 = edge3_normal.dot( p3_to_p );
+	if ( ( r1 > 0 && r2 > 0 && r3 > 0 ) ||
+	     ( r1 <= 0 && r2 <= 0 && r3 <= 0 ) )
+		return true;
+	return false;
+
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h
new file mode 100644
index 0000000..22953af
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h
@@ -0,0 +1,51 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SPHERE_TRIANGLE_DETECTOR_H
+#define BT_SPHERE_TRIANGLE_DETECTOR_H
+
+#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
+
+
+
+class btSphereShape;
+class btTriangleShape;
+
+
+
+/// sphere-triangle to match the btDiscreteCollisionDetectorInterface
+struct SphereTriangleDetector : public btDiscreteCollisionDetectorInterface
+{
+	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);
+
+	SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle, btScalar contactBreakingThreshold);
+
+	virtual ~SphereTriangleDetector() {};
+
+	bool collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar	contactBreakingThreshold);
+
+private:
+
+	
+	bool pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p );
+	bool facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal);
+
+	btSphereShape* m_sphere;
+	btTriangleShape* m_triangle;
+	btScalar	m_contactBreakingThreshold;
+	
+};
+#endif //BT_SPHERE_TRIANGLE_DETECTOR_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
new file mode 100644
index 0000000..7e5da6c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
@@ -0,0 +1,47 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btActivatingCollisionAlgorithm.h"
+#include "btCollisionDispatcher.h"
+#include "btCollisionObject.h"
+
+btActivatingCollisionAlgorithm::btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci)
+:btCollisionAlgorithm(ci)
+//,
+//m_colObj0(0),
+//m_colObj1(0)
+{
+}
+btActivatingCollisionAlgorithm::btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* colObj0,btCollisionObject* colObj1)
+:btCollisionAlgorithm(ci)
+//,
+//m_colObj0(0),
+//m_colObj1(0)
+{
+//	if (ci.m_dispatcher1->needsCollision(colObj0,colObj1))
+//	{
+//		m_colObj0 = colObj0;
+//		m_colObj1 = colObj1;
+//		
+//		m_colObj0->activate();
+//		m_colObj1->activate();
+//	}
+}
+
+btActivatingCollisionAlgorithm::~btActivatingCollisionAlgorithm()
+{
+//		m_colObj0->activate();
+//		m_colObj1->activate();
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h
new file mode 100644
index 0000000..25fe088
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h
@@ -0,0 +1,36 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef __BT_ACTIVATING_COLLISION_ALGORITHM_H
+#define __BT_ACTIVATING_COLLISION_ALGORITHM_H
+
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+
+///This class is not enabled yet (work-in-progress) to more aggressively activate objects.
+class btActivatingCollisionAlgorithm : public btCollisionAlgorithm
+{
+//	btCollisionObject* m_colObj0;
+//	btCollisionObject* m_colObj1;
+
+public:
+
+	btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci);
+
+	btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* colObj0,btCollisionObject* colObj1);
+
+	virtual ~btActivatingCollisionAlgorithm();
+
+};
+#endif //__BT_ACTIVATING_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
new file mode 100644
index 0000000..2182d0d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
@@ -0,0 +1,435 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+* The b2CollidePolygons routines are Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///btBox2dBox2dCollisionAlgorithm, with modified b2CollidePolygons routines from the Box2D library.
+///The modifications include: switching from b2Vec to btVector3, redefinition of b2Dot, b2Cross
+
+#include "btBox2dBox2dCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionDispatch/btBoxBoxDetector.h"
+#include "BulletCollision/CollisionShapes/btBox2dShape.h"
+
+#define USE_PERSISTENT_CONTACTS 1
+
+btBox2dBox2dCollisionAlgorithm::btBox2dBox2dCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* obj0,btCollisionObject* obj1)
+: btActivatingCollisionAlgorithm(ci,obj0,obj1),
+m_ownManifold(false),
+m_manifoldPtr(mf)
+{
+	if (!m_manifoldPtr && m_dispatcher->needsCollision(obj0,obj1))
+	{
+		m_manifoldPtr = m_dispatcher->getNewManifold(obj0,obj1);
+		m_ownManifold = true;
+	}
+}
+
+btBox2dBox2dCollisionAlgorithm::~btBox2dBox2dCollisionAlgorithm()
+{
+	
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+	}
+	
+}
+
+
+void b2CollidePolygons(btManifoldResult* manifold,  const btBox2dShape* polyA, const btTransform& xfA, const btBox2dShape* polyB, const btTransform& xfB);
+
+//#include <stdio.h>
+void btBox2dBox2dCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	if (!m_manifoldPtr)
+		return;
+
+	btCollisionObject*	col0 = body0;
+	btCollisionObject*	col1 = body1;
+	btBox2dShape* box0 = (btBox2dShape*)col0->getCollisionShape();
+	btBox2dShape* box1 = (btBox2dShape*)col1->getCollisionShape();
+
+	resultOut->setPersistentManifold(m_manifoldPtr);
+
+	b2CollidePolygons(resultOut,box0,col0->getWorldTransform(),box1,col1->getWorldTransform());
+
+	//  refreshContactPoints is only necessary when using persistent contact points. otherwise all points are newly added
+	if (m_ownManifold)
+	{
+		resultOut->refreshContactPoints();
+	}
+
+}
+
+btScalar btBox2dBox2dCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* /*body0*/,btCollisionObject* /*body1*/,const btDispatcherInfo& /*dispatchInfo*/,btManifoldResult* /*resultOut*/)
+{
+	//not yet
+	return 1.f;
+}
+
+
+struct ClipVertex
+{
+	btVector3 v;
+	int id;
+	//b2ContactID id;
+	//b2ContactID id;
+};
+
+#define b2Dot(a,b) (a).dot(b)
+#define b2Mul(a,b) (a)*(b)
+#define b2MulT(a,b) (a).transpose()*(b)
+#define b2Cross(a,b) (a).cross(b)
+#define btCrossS(a,s) btVector3(s * a.getY(), -s * a.getX(),0.f)
+
+int b2_maxManifoldPoints =2;
+
+static int ClipSegmentToLine(ClipVertex vOut[2], ClipVertex vIn[2],
+					  const btVector3& normal, btScalar offset)
+{
+	// Start with no output points
+	int numOut = 0;
+
+	// Calculate the distance of end points to the line
+	btScalar distance0 = b2Dot(normal, vIn[0].v) - offset;
+	btScalar distance1 = b2Dot(normal, vIn[1].v) - offset;
+
+	// If the points are behind the plane
+	if (distance0 <= 0.0f) vOut[numOut++] = vIn[0];
+	if (distance1 <= 0.0f) vOut[numOut++] = vIn[1];
+
+	// If the points are on different sides of the plane
+	if (distance0 * distance1 < 0.0f)
+	{
+		// Find intersection point of edge and plane
+		btScalar interp = distance0 / (distance0 - distance1);
+		vOut[numOut].v = vIn[0].v + interp * (vIn[1].v - vIn[0].v);
+		if (distance0 > 0.0f)
+		{
+			vOut[numOut].id = vIn[0].id;
+		}
+		else
+		{
+			vOut[numOut].id = vIn[1].id;
+		}
+		++numOut;
+	}
+
+	return numOut;
+}
+
+// Find the separation between poly1 and poly2 for a give edge normal on poly1.
+static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1, int edge1,
+							  const btBox2dShape* poly2, const btTransform& xf2)
+{
+	const btVector3* vertices1 = poly1->getVertices();
+	const btVector3* normals1 = poly1->getNormals();
+
+	int count2 = poly2->getVertexCount();
+	const btVector3* vertices2 = poly2->getVertices();
+
+	btAssert(0 <= edge1 && edge1 < poly1->getVertexCount());
+
+	// Convert normal from poly1's frame into poly2's frame.
+	btVector3 normal1World = b2Mul(xf1.getBasis(), normals1[edge1]);
+	btVector3 normal1 = b2MulT(xf2.getBasis(), normal1World);
+
+	// Find support vertex on poly2 for -normal.
+	int index = 0;
+	btScalar minDot = BT_LARGE_FLOAT;
+
+	for (int i = 0; i < count2; ++i)
+	{
+		btScalar dot = b2Dot(vertices2[i], normal1);
+		if (dot < minDot)
+		{
+			minDot = dot;
+			index = i;
+		}
+	}
+
+	btVector3 v1 = b2Mul(xf1, vertices1[edge1]);
+	btVector3 v2 = b2Mul(xf2, vertices2[index]);
+	btScalar separation = b2Dot(v2 - v1, normal1World);
+	return separation;
+}
+
+// Find the max separation between poly1 and poly2 using edge normals from poly1.
+static btScalar FindMaxSeparation(int* edgeIndex,
+								 const btBox2dShape* poly1, const btTransform& xf1,
+								 const btBox2dShape* poly2, const btTransform& xf2)
+{
+	int count1 = poly1->getVertexCount();
+	const btVector3* normals1 = poly1->getNormals();
+
+	// Vector pointing from the centroid of poly1 to the centroid of poly2.
+	btVector3 d = b2Mul(xf2, poly2->getCentroid()) - b2Mul(xf1, poly1->getCentroid());
+	btVector3 dLocal1 = b2MulT(xf1.getBasis(), d);
+
+	// Find edge normal on poly1 that has the largest projection onto d.
+	int edge = 0;
+	btScalar maxDot = -BT_LARGE_FLOAT;
+	for (int i = 0; i < count1; ++i)
+	{
+		btScalar dot = b2Dot(normals1[i], dLocal1);
+		if (dot > maxDot)
+		{
+			maxDot = dot;
+			edge = i;
+		}
+	}
+
+	// Get the separation for the edge normal.
+	btScalar s = EdgeSeparation(poly1, xf1, edge, poly2, xf2);
+	if (s > 0.0f)
+	{
+		return s;
+	}
+
+	// Check the separation for the previous edge normal.
+	int prevEdge = edge - 1 >= 0 ? edge - 1 : count1 - 1;
+	btScalar sPrev = EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2);
+	if (sPrev > 0.0f)
+	{
+		return sPrev;
+	}
+
+	// Check the separation for the next edge normal.
+	int nextEdge = edge + 1 < count1 ? edge + 1 : 0;
+	btScalar sNext = EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2);
+	if (sNext > 0.0f)
+	{
+		return sNext;
+	}
+
+	// Find the best edge and the search direction.
+	int bestEdge;
+	btScalar bestSeparation;
+	int increment;
+	if (sPrev > s && sPrev > sNext)
+	{
+		increment = -1;
+		bestEdge = prevEdge;
+		bestSeparation = sPrev;
+	}
+	else if (sNext > s)
+	{
+		increment = 1;
+		bestEdge = nextEdge;
+		bestSeparation = sNext;
+	}
+	else
+	{
+		*edgeIndex = edge;
+		return s;
+	}
+
+	// Perform a local search for the best edge normal.
+	for ( ; ; )
+	{
+		if (increment == -1)
+			edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;
+		else
+			edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;
+
+		s = EdgeSeparation(poly1, xf1, edge, poly2, xf2);
+		if (s > 0.0f)
+		{
+			return s;
+		}
+
+		if (s > bestSeparation)
+		{
+			bestEdge = edge;
+			bestSeparation = s;
+		}
+		else
+		{
+			break;
+		}
+	}
+
+	*edgeIndex = bestEdge;
+	return bestSeparation;
+}
+
+static void FindIncidentEdge(ClipVertex c[2],
+							 const btBox2dShape* poly1, const btTransform& xf1, int edge1,
+							 const btBox2dShape* poly2, const btTransform& xf2)
+{
+	const btVector3* normals1 = poly1->getNormals();
+
+	int count2 = poly2->getVertexCount();
+	const btVector3* vertices2 = poly2->getVertices();
+	const btVector3* normals2 = poly2->getNormals();
+
+	btAssert(0 <= edge1 && edge1 < poly1->getVertexCount());
+
+	// Get the normal of the reference edge in poly2's frame.
+	btVector3 normal1 = b2MulT(xf2.getBasis(), b2Mul(xf1.getBasis(), normals1[edge1]));
+
+	// Find the incident edge on poly2.
+	int index = 0;
+	btScalar minDot = BT_LARGE_FLOAT;
+	for (int i = 0; i < count2; ++i)
+	{
+		btScalar dot = b2Dot(normal1, normals2[i]);
+		if (dot < minDot)
+		{
+			minDot = dot;
+			index = i;
+		}
+	}
+
+	// Build the clip vertices for the incident edge.
+	int i1 = index;
+	int i2 = i1 + 1 < count2 ? i1 + 1 : 0;
+
+	c[0].v = b2Mul(xf2, vertices2[i1]);
+//	c[0].id.features.referenceEdge = (unsigned char)edge1;
+//	c[0].id.features.incidentEdge = (unsigned char)i1;
+//	c[0].id.features.incidentVertex = 0;
+
+	c[1].v = b2Mul(xf2, vertices2[i2]);
+//	c[1].id.features.referenceEdge = (unsigned char)edge1;
+//	c[1].id.features.incidentEdge = (unsigned char)i2;
+//	c[1].id.features.incidentVertex = 1;
+}
+
+// Find edge normal of max separation on A - return if separating axis is found
+// Find edge normal of max separation on B - return if separation axis is found
+// Choose reference edge as min(minA, minB)
+// Find incident edge
+// Clip
+
+// The normal points from 1 to 2
+void b2CollidePolygons(btManifoldResult* manifold,
+					  const btBox2dShape* polyA, const btTransform& xfA,
+					  const btBox2dShape* polyB, const btTransform& xfB)
+{
+
+	int edgeA = 0;
+	btScalar separationA = FindMaxSeparation(&edgeA, polyA, xfA, polyB, xfB);
+	if (separationA > 0.0f)
+		return;
+
+	int edgeB = 0;
+	btScalar separationB = FindMaxSeparation(&edgeB, polyB, xfB, polyA, xfA);
+	if (separationB > 0.0f)
+		return;
+
+	const btBox2dShape* poly1;	// reference poly
+	const btBox2dShape* poly2;	// incident poly
+	btTransform xf1, xf2;
+	int edge1;		// reference edge
+	unsigned char flip;
+	const btScalar k_relativeTol = 0.98f;
+	const btScalar k_absoluteTol = 0.001f;
+
+	// TODO_ERIN use "radius" of poly for absolute tolerance.
+	if (separationB > k_relativeTol * separationA + k_absoluteTol)
+	{
+		poly1 = polyB;
+		poly2 = polyA;
+		xf1 = xfB;
+		xf2 = xfA;
+		edge1 = edgeB;
+		flip = 1;
+	}
+	else
+	{
+		poly1 = polyA;
+		poly2 = polyB;
+		xf1 = xfA;
+		xf2 = xfB;
+		edge1 = edgeA;
+		flip = 0;
+	}
+
+	ClipVertex incidentEdge[2];
+	FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);
+
+	int count1 = poly1->getVertexCount();
+	const btVector3* vertices1 = poly1->getVertices();
+
+	btVector3 v11 = vertices1[edge1];
+	btVector3 v12 = edge1 + 1 < count1 ? vertices1[edge1+1] : vertices1[0];
+
+	btVector3 dv = v12 - v11;
+	btVector3 sideNormal = b2Mul(xf1.getBasis(), v12 - v11);
+	sideNormal.normalize();
+	btVector3 frontNormal = btCrossS(sideNormal, 1.0f);
+	
+	
+	v11 = b2Mul(xf1, v11);
+	v12 = b2Mul(xf1, v12);
+
+	btScalar frontOffset = b2Dot(frontNormal, v11);
+	btScalar sideOffset1 = -b2Dot(sideNormal, v11);
+	btScalar sideOffset2 = b2Dot(sideNormal, v12);
+
+	// Clip incident edge against extruded edge1 side edges.
+	ClipVertex clipPoints1[2];
+	clipPoints1[0].v.setValue(0,0,0);
+	clipPoints1[1].v.setValue(0,0,0);
+
+	ClipVertex clipPoints2[2];
+	clipPoints2[0].v.setValue(0,0,0);
+	clipPoints2[1].v.setValue(0,0,0);
+
+
+	int np;
+
+	// Clip to box side 1
+	np = ClipSegmentToLine(clipPoints1, incidentEdge, -sideNormal, sideOffset1);
+
+	if (np < 2)
+		return;
+
+	// Clip to negative box side 1
+	np = ClipSegmentToLine(clipPoints2, clipPoints1,  sideNormal, sideOffset2);
+
+	if (np < 2)
+	{
+		return;
+	}
+
+	// Now clipPoints2 contains the clipped points.
+	btVector3 manifoldNormal = flip ? -frontNormal : frontNormal;
+
+	int pointCount = 0;
+	for (int i = 0; i < b2_maxManifoldPoints; ++i)
+	{
+		btScalar separation = b2Dot(frontNormal, clipPoints2[i].v) - frontOffset;
+
+		if (separation <= 0.0f)
+		{
+			
+			//b2ManifoldPoint* cp = manifold->points + pointCount;
+			//btScalar separation = separation;
+			//cp->localPoint1 = b2MulT(xfA, clipPoints2[i].v);
+			//cp->localPoint2 = b2MulT(xfB, clipPoints2[i].v);
+
+			manifold->addContactPoint(-manifoldNormal,clipPoints2[i].v,separation);
+
+//			cp->id = clipPoints2[i].id;
+//			cp->id.features.flip = flip;
+			++pointCount;
+		}
+	}
+
+//	manifold->pointCount = pointCount;}
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
new file mode 100644
index 0000000..97c5be7
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
@@ -0,0 +1,66 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
+#define BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
+
+#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+
+class btPersistentManifold;
+
+///box-box collision detection
+class btBox2dBox2dCollisionAlgorithm : public btActivatingCollisionAlgorithm
+{
+	bool	m_ownManifold;
+	btPersistentManifold*	m_manifoldPtr;
+	
+public:
+	btBox2dBox2dCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
+		: btActivatingCollisionAlgorithm(ci) {}
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	btBox2dBox2dCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
+
+	virtual ~btBox2dBox2dCollisionAlgorithm();
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		if (m_manifoldPtr && m_ownManifold)
+		{
+			manifoldArray.push_back(m_manifoldPtr);
+		}
+	}
+
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			int bbsize = sizeof(btBox2dBox2dCollisionAlgorithm);
+			void* ptr = ci.m_dispatcher1->allocateCollisionAlgorithm(bbsize);
+			return new(ptr) btBox2dBox2dCollisionAlgorithm(0,ci,body0,body1);
+		}
+	};
+
+};
+
+#endif //BT_BOX_2D_BOX_2D__COLLISION_ALGORITHM_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
new file mode 100644
index 0000000..4962885
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
@@ -0,0 +1,85 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btBoxBoxCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "btBoxBoxDetector.h"
+
+#define USE_PERSISTENT_CONTACTS 1
+
+btBoxBoxCollisionAlgorithm::btBoxBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* obj0,btCollisionObject* obj1)
+: btActivatingCollisionAlgorithm(ci,obj0,obj1),
+m_ownManifold(false),
+m_manifoldPtr(mf)
+{
+	if (!m_manifoldPtr && m_dispatcher->needsCollision(obj0,obj1))
+	{
+		m_manifoldPtr = m_dispatcher->getNewManifold(obj0,obj1);
+		m_ownManifold = true;
+	}
+}
+
+btBoxBoxCollisionAlgorithm::~btBoxBoxCollisionAlgorithm()
+{
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+	}
+}
+
+void btBoxBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	if (!m_manifoldPtr)
+		return;
+
+	btCollisionObject*	col0 = body0;
+	btCollisionObject*	col1 = body1;
+	btBoxShape* box0 = (btBoxShape*)col0->getCollisionShape();
+	btBoxShape* box1 = (btBoxShape*)col1->getCollisionShape();
+
+
+
+	/// report a contact. internally this will be kept persistent, and contact reduction is done
+	resultOut->setPersistentManifold(m_manifoldPtr);
+#ifndef USE_PERSISTENT_CONTACTS	
+	m_manifoldPtr->clearManifold();
+#endif //USE_PERSISTENT_CONTACTS
+
+	btDiscreteCollisionDetectorInterface::ClosestPointInput input;
+	input.m_maximumDistanceSquared = BT_LARGE_FLOAT;
+	input.m_transformA = body0->getWorldTransform();
+	input.m_transformB = body1->getWorldTransform();
+
+	btBoxBoxDetector detector(box0,box1);
+	detector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
+
+#ifdef USE_PERSISTENT_CONTACTS
+	//  refreshContactPoints is only necessary when using persistent contact points. otherwise all points are newly added
+	if (m_ownManifold)
+	{
+		resultOut->refreshContactPoints();
+	}
+#endif //USE_PERSISTENT_CONTACTS
+
+}
+
+btScalar btBoxBoxCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* /*body0*/,btCollisionObject* /*body1*/,const btDispatcherInfo& /*dispatchInfo*/,btManifoldResult* /*resultOut*/)
+{
+	//not yet
+	return 1.f;
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h
new file mode 100644
index 0000000..f0bbae6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h
@@ -0,0 +1,66 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_BOX_BOX__COLLISION_ALGORITHM_H
+#define BT_BOX_BOX__COLLISION_ALGORITHM_H
+
+#include "btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+
+class btPersistentManifold;
+
+///box-box collision detection
+class btBoxBoxCollisionAlgorithm : public btActivatingCollisionAlgorithm
+{
+	bool	m_ownManifold;
+	btPersistentManifold*	m_manifoldPtr;
+	
+public:
+	btBoxBoxCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
+		: btActivatingCollisionAlgorithm(ci) {}
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	btBoxBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
+
+	virtual ~btBoxBoxCollisionAlgorithm();
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		if (m_manifoldPtr && m_ownManifold)
+		{
+			manifoldArray.push_back(m_manifoldPtr);
+		}
+	}
+
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			int bbsize = sizeof(btBoxBoxCollisionAlgorithm);
+			void* ptr = ci.m_dispatcher1->allocateCollisionAlgorithm(bbsize);
+			return new(ptr) btBoxBoxCollisionAlgorithm(0,ci,body0,body1);
+		}
+	};
+
+};
+
+#endif //BT_BOX_BOX__COLLISION_ALGORITHM_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
new file mode 100644
index 0000000..a7c8cf1
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
@@ -0,0 +1,718 @@
+/*
+ * Box-Box collision detection re-distributed under the ZLib license with permission from Russell L. Smith
+ * Original version is from Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith.
+ * All rights reserved.  Email: russ at q12.org   Web: www.q12.org
+ Bullet Continuous Collision Detection and Physics Library
+ Bullet is Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///ODE box-box collision detection is adapted to work with Bullet
+
+#include "btBoxBoxDetector.h"
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+
+#include <float.h>
+#include <string.h>
+
+btBoxBoxDetector::btBoxBoxDetector(btBoxShape* box1,btBoxShape* box2)
+: m_box1(box1),
+m_box2(box2)
+{
+
+}
+
+
+// given two boxes (p1,R1,side1) and (p2,R2,side2), collide them together and
+// generate contact points. this returns 0 if there is no contact otherwise
+// it returns the number of contacts generated.
+// `normal' returns the contact normal.
+// `depth' returns the maximum penetration depth along that normal.
+// `return_code' returns a number indicating the type of contact that was
+// detected:
+//        1,2,3 = box 2 intersects with a face of box 1
+//        4,5,6 = box 1 intersects with a face of box 2
+//        7..15 = edge-edge contact
+// `maxc' is the maximum number of contacts allowed to be generated, i.e.
+// the size of the `contact' array.
+// `contact' and `skip' are the contact array information provided to the
+// collision functions. this function only fills in the position and depth
+// fields.
+struct dContactGeom;
+#define dDOTpq(a,b,p,q) ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*(q)])
+#define dInfinity FLT_MAX
+
+
+/*PURE_INLINE btScalar dDOT   (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,1,1); }
+PURE_INLINE btScalar dDOT13 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,1,3); }
+PURE_INLINE btScalar dDOT31 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,3,1); }
+PURE_INLINE btScalar dDOT33 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,3,3); }
+*/
+static btScalar dDOT   (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,1,1); }
+static btScalar dDOT44 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,4,4); }
+static btScalar dDOT41 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,4,1); }
+static btScalar dDOT14 (const btScalar *a, const btScalar *b) { return dDOTpq(a,b,1,4); }
+#define dMULTIPLYOP1_331(A,op,B,C) \
+{\
+  (A)[0] op dDOT41((B),(C)); \
+  (A)[1] op dDOT41((B+1),(C)); \
+  (A)[2] op dDOT41((B+2),(C)); \
+}
+
+#define dMULTIPLYOP0_331(A,op,B,C) \
+{ \
+  (A)[0] op dDOT((B),(C)); \
+  (A)[1] op dDOT((B+4),(C)); \
+  (A)[2] op dDOT((B+8),(C)); \
+} 
+
+#define dMULTIPLY1_331(A,B,C) dMULTIPLYOP1_331(A,=,B,C)
+#define dMULTIPLY0_331(A,B,C) dMULTIPLYOP0_331(A,=,B,C)
+
+typedef btScalar dMatrix3[4*3];
+
+void dLineClosestApproach (const btVector3& pa, const btVector3& ua,
+			   const btVector3& pb, const btVector3& ub,
+			   btScalar *alpha, btScalar *beta);
+void dLineClosestApproach (const btVector3& pa, const btVector3& ua,
+			   const btVector3& pb, const btVector3& ub,
+			   btScalar *alpha, btScalar *beta)
+{
+  btVector3 p;
+  p[0] = pb[0] - pa[0];
+  p[1] = pb[1] - pa[1];
+  p[2] = pb[2] - pa[2];
+  btScalar uaub = dDOT(ua,ub);
+  btScalar q1 =  dDOT(ua,p);
+  btScalar q2 = -dDOT(ub,p);
+  btScalar d = 1-uaub*uaub;
+  if (d <= btScalar(0.0001f)) {
+    // @@@ this needs to be made more robust
+    *alpha = 0;
+    *beta  = 0;
+  }
+  else {
+    d = 1.f/d;
+    *alpha = (q1 + uaub*q2)*d;
+    *beta  = (uaub*q1 + q2)*d;
+  }
+}
+
+
+
+// find all the intersection points between the 2D rectangle with vertices
+// at (+/-h[0],+/-h[1]) and the 2D quadrilateral with vertices (p[0],p[1]),
+// (p[2],p[3]),(p[4],p[5]),(p[6],p[7]).
+//
+// the intersection points are returned as x,y pairs in the 'ret' array.
+// the number of intersection points is returned by the function (this will
+// be in the range 0 to 8).
+
+static int intersectRectQuad2 (btScalar h[2], btScalar p[8], btScalar ret[16])
+{
+  // q (and r) contain nq (and nr) coordinate points for the current (and
+  // chopped) polygons
+  int nq=4,nr=0;
+  btScalar buffer[16];
+  btScalar *q = p;
+  btScalar *r = ret;
+  for (int dir=0; dir <= 1; dir++) {
+    // direction notation: xy[0] = x axis, xy[1] = y axis
+    for (int sign=-1; sign <= 1; sign += 2) {
+      // chop q along the line xy[dir] = sign*h[dir]
+      btScalar *pq = q;
+      btScalar *pr = r;
+      nr = 0;
+      for (int i=nq; i > 0; i--) {
+	// go through all points in q and all lines between adjacent points
+	if (sign*pq[dir] < h[dir]) {
+	  // this point is inside the chopping line
+	  pr[0] = pq[0];
+	  pr[1] = pq[1];
+	  pr += 2;
+	  nr++;
+	  if (nr & 8) {
+	    q = r;
+	    goto done;
+	  }
+	}
+	btScalar *nextq = (i > 1) ? pq+2 : q;
+	if ((sign*pq[dir] < h[dir]) ^ (sign*nextq[dir] < h[dir])) {
+	  // this line crosses the chopping line
+	  pr[1-dir] = pq[1-dir] + (nextq[1-dir]-pq[1-dir]) /
+	    (nextq[dir]-pq[dir]) * (sign*h[dir]-pq[dir]);
+	  pr[dir] = sign*h[dir];
+	  pr += 2;
+	  nr++;
+	  if (nr & 8) {
+	    q = r;
+	    goto done;
+	  }
+	}
+	pq += 2;
+      }
+      q = r;
+      r = (q==ret) ? buffer : ret;
+      nq = nr;
+    }
+  }
+ done:
+  if (q != ret) memcpy (ret,q,nr*2*sizeof(btScalar));
+  return nr;
+}
+
+
+#define M__PI 3.14159265f
+
+// given n points in the plane (array p, of size 2*n), generate m points that
+// best represent the whole set. the definition of 'best' here is not
+// predetermined - the idea is to select points that give good box-box
+// collision detection behavior. the chosen point indexes are returned in the
+// array iret (of size m). 'i0' is always the first entry in the array.
+// n must be in the range [1..8]. m must be in the range [1..n]. i0 must be
+// in the range [0..n-1].
+
+void cullPoints2 (int n, btScalar p[], int m, int i0, int iret[]);
+void cullPoints2 (int n, btScalar p[], int m, int i0, int iret[])
+{
+  // compute the centroid of the polygon in cx,cy
+  int i,j;
+  btScalar a,cx,cy,q;
+  if (n==1) {
+    cx = p[0];
+    cy = p[1];
+  }
+  else if (n==2) {
+    cx = btScalar(0.5)*(p[0] + p[2]);
+    cy = btScalar(0.5)*(p[1] + p[3]);
+  }
+  else {
+    a = 0;
+    cx = 0;
+    cy = 0;
+    for (i=0; i<(n-1); i++) {
+      q = p[i*2]*p[i*2+3] - p[i*2+2]*p[i*2+1];
+      a += q;
+      cx += q*(p[i*2]+p[i*2+2]);
+      cy += q*(p[i*2+1]+p[i*2+3]);
+    }
+    q = p[n*2-2]*p[1] - p[0]*p[n*2-1];
+	if (btFabs(a+q) > SIMD_EPSILON)
+	{
+		a = 1.f/(btScalar(3.0)*(a+q));
+	} else
+	{
+		a=BT_LARGE_FLOAT;
+	}
+    cx = a*(cx + q*(p[n*2-2]+p[0]));
+    cy = a*(cy + q*(p[n*2-1]+p[1]));
+  }
+
+  // compute the angle of each point w.r.t. the centroid
+  btScalar A[8];
+  for (i=0; i<n; i++) A[i] = btAtan2(p[i*2+1]-cy,p[i*2]-cx);
+
+  // search for points that have angles closest to A[i0] + i*(2*pi/m).
+  int avail[8];
+  for (i=0; i<n; i++) avail[i] = 1;
+  avail[i0] = 0;
+  iret[0] = i0;
+  iret++;
+  for (j=1; j<m; j++) {
+    a = btScalar(j)*(2*M__PI/m) + A[i0];
+    if (a > M__PI) a -= 2*M__PI;
+    btScalar maxdiff=1e9,diff;
+
+    *iret = i0;			// iret is not allowed to keep this value, but it sometimes does, when diff=#QNAN0
+
+    for (i=0; i<n; i++) {
+      if (avail[i]) {
+	diff = btFabs (A[i]-a);
+	if (diff > M__PI) diff = 2*M__PI - diff;
+	if (diff < maxdiff) {
+	  maxdiff = diff;
+	  *iret = i;
+	}
+      }
+    }
+#if defined(DEBUG) || defined (_DEBUG)
+    btAssert (*iret != i0);	// ensure iret got set
+#endif
+    avail[*iret] = 0;
+    iret++;
+  }
+}
+
+
+
+int dBoxBox2 (const btVector3& p1, const dMatrix3 R1,
+	     const btVector3& side1, const btVector3& p2,
+	     const dMatrix3 R2, const btVector3& side2,
+	     btVector3& normal, btScalar *depth, int *return_code,
+		 int maxc, dContactGeom * /*contact*/, int /*skip*/,btDiscreteCollisionDetectorInterface::Result& output);
+int dBoxBox2 (const btVector3& p1, const dMatrix3 R1,
+	     const btVector3& side1, const btVector3& p2,
+	     const dMatrix3 R2, const btVector3& side2,
+	     btVector3& normal, btScalar *depth, int *return_code,
+		 int maxc, dContactGeom * /*contact*/, int /*skip*/,btDiscreteCollisionDetectorInterface::Result& output)
+{
+  const btScalar fudge_factor = btScalar(1.05);
+  btVector3 p,pp,normalC(0.f,0.f,0.f);
+  const btScalar *normalR = 0;
+  btScalar A[3],B[3],R11,R12,R13,R21,R22,R23,R31,R32,R33,
+    Q11,Q12,Q13,Q21,Q22,Q23,Q31,Q32,Q33,s,s2,l;
+  int i,j,invert_normal,code;
+
+  // get vector from centers of box 1 to box 2, relative to box 1
+  p = p2 - p1;
+  dMULTIPLY1_331 (pp,R1,p);		// get pp = p relative to body 1
+
+  // get side lengths / 2
+  A[0] = side1[0]*btScalar(0.5);
+  A[1] = side1[1]*btScalar(0.5);
+  A[2] = side1[2]*btScalar(0.5);
+  B[0] = side2[0]*btScalar(0.5);
+  B[1] = side2[1]*btScalar(0.5);
+  B[2] = side2[2]*btScalar(0.5);
+
+  // Rij is R1'*R2, i.e. the relative rotation between R1 and R2
+  R11 = dDOT44(R1+0,R2+0); R12 = dDOT44(R1+0,R2+1); R13 = dDOT44(R1+0,R2+2);
+  R21 = dDOT44(R1+1,R2+0); R22 = dDOT44(R1+1,R2+1); R23 = dDOT44(R1+1,R2+2);
+  R31 = dDOT44(R1+2,R2+0); R32 = dDOT44(R1+2,R2+1); R33 = dDOT44(R1+2,R2+2);
+
+  Q11 = btFabs(R11); Q12 = btFabs(R12); Q13 = btFabs(R13);
+  Q21 = btFabs(R21); Q22 = btFabs(R22); Q23 = btFabs(R23);
+  Q31 = btFabs(R31); Q32 = btFabs(R32); Q33 = btFabs(R33);
+
+  // for all 15 possible separating axes:
+  //   * see if the axis separates the boxes. if so, return 0.
+  //   * find the depth of the penetration along the separating axis (s2)
+  //   * if this is the largest depth so far, record it.
+  // the normal vector will be set to the separating axis with the smallest
+  // depth. note: normalR is set to point to a column of R1 or R2 if that is
+  // the smallest depth normal so far. otherwise normalR is 0 and normalC is
+  // set to a vector relative to body 1. invert_normal is 1 if the sign of
+  // the normal should be flipped.
+
+#define TST(expr1,expr2,norm,cc) \
+  s2 = btFabs(expr1) - (expr2); \
+  if (s2 > 0) return 0; \
+  if (s2 > s) { \
+    s = s2; \
+    normalR = norm; \
+    invert_normal = ((expr1) < 0); \
+    code = (cc); \
+  }
+
+  s = -dInfinity;
+  invert_normal = 0;
+  code = 0;
+
+  // separating axis = u1,u2,u3
+  TST (pp[0],(A[0] + B[0]*Q11 + B[1]*Q12 + B[2]*Q13),R1+0,1);
+  TST (pp[1],(A[1] + B[0]*Q21 + B[1]*Q22 + B[2]*Q23),R1+1,2);
+  TST (pp[2],(A[2] + B[0]*Q31 + B[1]*Q32 + B[2]*Q33),R1+2,3);
+
+  // separating axis = v1,v2,v3
+  TST (dDOT41(R2+0,p),(A[0]*Q11 + A[1]*Q21 + A[2]*Q31 + B[0]),R2+0,4);
+  TST (dDOT41(R2+1,p),(A[0]*Q12 + A[1]*Q22 + A[2]*Q32 + B[1]),R2+1,5);
+  TST (dDOT41(R2+2,p),(A[0]*Q13 + A[1]*Q23 + A[2]*Q33 + B[2]),R2+2,6);
+
+  // note: cross product axes need to be scaled when s is computed.
+  // normal (n1,n2,n3) is relative to box 1.
+#undef TST
+#define TST(expr1,expr2,n1,n2,n3,cc) \
+  s2 = btFabs(expr1) - (expr2); \
+  if (s2 > SIMD_EPSILON) return 0; \
+  l = btSqrt((n1)*(n1) + (n2)*(n2) + (n3)*(n3)); \
+  if (l > SIMD_EPSILON) { \
+    s2 /= l; \
+    if (s2*fudge_factor > s) { \
+      s = s2; \
+      normalR = 0; \
+      normalC[0] = (n1)/l; normalC[1] = (n2)/l; normalC[2] = (n3)/l; \
+      invert_normal = ((expr1) < 0); \
+      code = (cc); \
+    } \
+  }
+
+  btScalar fudge2 (1.0e-5f);
+
+  Q11 += fudge2;
+  Q12 += fudge2;
+  Q13 += fudge2;
+
+  Q21 += fudge2;
+  Q22 += fudge2;
+  Q23 += fudge2;
+
+  Q31 += fudge2;
+  Q32 += fudge2;
+  Q33 += fudge2;
+
+  // separating axis = u1 x (v1,v2,v3)
+  TST(pp[2]*R21-pp[1]*R31,(A[1]*Q31+A[2]*Q21+B[1]*Q13+B[2]*Q12),0,-R31,R21,7);
+  TST(pp[2]*R22-pp[1]*R32,(A[1]*Q32+A[2]*Q22+B[0]*Q13+B[2]*Q11),0,-R32,R22,8);
+  TST(pp[2]*R23-pp[1]*R33,(A[1]*Q33+A[2]*Q23+B[0]*Q12+B[1]*Q11),0,-R33,R23,9);
+
+  // separating axis = u2 x (v1,v2,v3)
+  TST(pp[0]*R31-pp[2]*R11,(A[0]*Q31+A[2]*Q11+B[1]*Q23+B[2]*Q22),R31,0,-R11,10);
+  TST(pp[0]*R32-pp[2]*R12,(A[0]*Q32+A[2]*Q12+B[0]*Q23+B[2]*Q21),R32,0,-R12,11);
+  TST(pp[0]*R33-pp[2]*R13,(A[0]*Q33+A[2]*Q13+B[0]*Q22+B[1]*Q21),R33,0,-R13,12);
+
+  // separating axis = u3 x (v1,v2,v3)
+  TST(pp[1]*R11-pp[0]*R21,(A[0]*Q21+A[1]*Q11+B[1]*Q33+B[2]*Q32),-R21,R11,0,13);
+  TST(pp[1]*R12-pp[0]*R22,(A[0]*Q22+A[1]*Q12+B[0]*Q33+B[2]*Q31),-R22,R12,0,14);
+  TST(pp[1]*R13-pp[0]*R23,(A[0]*Q23+A[1]*Q13+B[0]*Q32+B[1]*Q31),-R23,R13,0,15);
+
+#undef TST
+
+  if (!code) return 0;
+
+  // if we get to this point, the boxes interpenetrate. compute the normal
+  // in global coordinates.
+  if (normalR) {
+    normal[0] = normalR[0];
+    normal[1] = normalR[4];
+    normal[2] = normalR[8];
+  }
+  else {
+    dMULTIPLY0_331 (normal,R1,normalC);
+  }
+  if (invert_normal) {
+    normal[0] = -normal[0];
+    normal[1] = -normal[1];
+    normal[2] = -normal[2];
+  }
+  *depth = -s;
+
+  // compute contact point(s)
+
+  if (code > 6) {
+    // an edge from box 1 touches an edge from box 2.
+    // find a point pa on the intersecting edge of box 1
+    btVector3 pa;
+    btScalar sign;
+    for (i=0; i<3; i++) pa[i] = p1[i];
+    for (j=0; j<3; j++) {
+      sign = (dDOT14(normal,R1+j) > 0) ? btScalar(1.0) : btScalar(-1.0);
+      for (i=0; i<3; i++) pa[i] += sign * A[j] * R1[i*4+j];
+    }
+
+    // find a point pb on the intersecting edge of box 2
+    btVector3 pb;
+    for (i=0; i<3; i++) pb[i] = p2[i];
+    for (j=0; j<3; j++) {
+      sign = (dDOT14(normal,R2+j) > 0) ? btScalar(-1.0) : btScalar(1.0);
+      for (i=0; i<3; i++) pb[i] += sign * B[j] * R2[i*4+j];
+    }
+
+    btScalar alpha,beta;
+    btVector3 ua,ub;
+    for (i=0; i<3; i++) ua[i] = R1[((code)-7)/3 + i*4];
+    for (i=0; i<3; i++) ub[i] = R2[((code)-7)%3 + i*4];
+
+    dLineClosestApproach (pa,ua,pb,ub,&alpha,&beta);
+    for (i=0; i<3; i++) pa[i] += ua[i]*alpha;
+    for (i=0; i<3; i++) pb[i] += ub[i]*beta;
+
+	{
+		
+		//contact[0].pos[i] = btScalar(0.5)*(pa[i]+pb[i]);
+		//contact[0].depth = *depth;
+		btVector3 pointInWorld;
+
+#ifdef USE_CENTER_POINT
+	    for (i=0; i<3; i++) 
+			pointInWorld[i] = (pa[i]+pb[i])*btScalar(0.5);
+		output.addContactPoint(-normal,pointInWorld,-*depth);
+#else
+		output.addContactPoint(-normal,pb,-*depth);
+
+#endif //
+		*return_code = code;
+	}
+    return 1;
+  }
+
+  // okay, we have a face-something intersection (because the separating
+  // axis is perpendicular to a face). define face 'a' to be the reference
+  // face (i.e. the normal vector is perpendicular to this) and face 'b' to be
+  // the incident face (the closest face of the other box).
+
+  const btScalar *Ra,*Rb,*pa,*pb,*Sa,*Sb;
+  if (code <= 3) {
+    Ra = R1;
+    Rb = R2;
+    pa = p1;
+    pb = p2;
+    Sa = A;
+    Sb = B;
+  }
+  else {
+    Ra = R2;
+    Rb = R1;
+    pa = p2;
+    pb = p1;
+    Sa = B;
+    Sb = A;
+  }
+
+  // nr = normal vector of reference face dotted with axes of incident box.
+  // anr = absolute values of nr.
+  btVector3 normal2,nr,anr;
+  if (code <= 3) {
+    normal2[0] = normal[0];
+    normal2[1] = normal[1];
+    normal2[2] = normal[2];
+  }
+  else {
+    normal2[0] = -normal[0];
+    normal2[1] = -normal[1];
+    normal2[2] = -normal[2];
+  }
+  dMULTIPLY1_331 (nr,Rb,normal2);
+  anr[0] = btFabs (nr[0]);
+  anr[1] = btFabs (nr[1]);
+  anr[2] = btFabs (nr[2]);
+
+  // find the largest compontent of anr: this corresponds to the normal
+  // for the indident face. the other axis numbers of the indicent face
+  // are stored in a1,a2.
+  int lanr,a1,a2;
+  if (anr[1] > anr[0]) {
+    if (anr[1] > anr[2]) {
+      a1 = 0;
+      lanr = 1;
+      a2 = 2;
+    }
+    else {
+      a1 = 0;
+      a2 = 1;
+      lanr = 2;
+    }
+  }
+  else {
+    if (anr[0] > anr[2]) {
+      lanr = 0;
+      a1 = 1;
+      a2 = 2;
+    }
+    else {
+      a1 = 0;
+      a2 = 1;
+      lanr = 2;
+    }
+  }
+
+  // compute center point of incident face, in reference-face coordinates
+  btVector3 center;
+  if (nr[lanr] < 0) {
+    for (i=0; i<3; i++) center[i] = pb[i] - pa[i] + Sb[lanr] * Rb[i*4+lanr];
+  }
+  else {
+    for (i=0; i<3; i++) center[i] = pb[i] - pa[i] - Sb[lanr] * Rb[i*4+lanr];
+  }
+
+  // find the normal and non-normal axis numbers of the reference box
+  int codeN,code1,code2;
+  if (code <= 3) codeN = code-1; else codeN = code-4;
+  if (codeN==0) {
+    code1 = 1;
+    code2 = 2;
+  }
+  else if (codeN==1) {
+    code1 = 0;
+    code2 = 2;
+  }
+  else {
+    code1 = 0;
+    code2 = 1;
+  }
+
+  // find the four corners of the incident face, in reference-face coordinates
+  btScalar quad[8];	// 2D coordinate of incident face (x,y pairs)
+  btScalar c1,c2,m11,m12,m21,m22;
+  c1 = dDOT14 (center,Ra+code1);
+  c2 = dDOT14 (center,Ra+code2);
+  // optimize this? - we have already computed this data above, but it is not
+  // stored in an easy-to-index format. for now it's quicker just to recompute
+  // the four dot products.
+  m11 = dDOT44 (Ra+code1,Rb+a1);
+  m12 = dDOT44 (Ra+code1,Rb+a2);
+  m21 = dDOT44 (Ra+code2,Rb+a1);
+  m22 = dDOT44 (Ra+code2,Rb+a2);
+  {
+    btScalar k1 = m11*Sb[a1];
+    btScalar k2 = m21*Sb[a1];
+    btScalar k3 = m12*Sb[a2];
+    btScalar k4 = m22*Sb[a2];
+    quad[0] = c1 - k1 - k3;
+    quad[1] = c2 - k2 - k4;
+    quad[2] = c1 - k1 + k3;
+    quad[3] = c2 - k2 + k4;
+    quad[4] = c1 + k1 + k3;
+    quad[5] = c2 + k2 + k4;
+    quad[6] = c1 + k1 - k3;
+    quad[7] = c2 + k2 - k4;
+  }
+
+  // find the size of the reference face
+  btScalar rect[2];
+  rect[0] = Sa[code1];
+  rect[1] = Sa[code2];
+
+  // intersect the incident and reference faces
+  btScalar ret[16];
+  int n = intersectRectQuad2 (rect,quad,ret);
+  if (n < 1) return 0;		// this should never happen
+
+  // convert the intersection points into reference-face coordinates,
+  // and compute the contact position and depth for each point. only keep
+  // those points that have a positive (penetrating) depth. delete points in
+  // the 'ret' array as necessary so that 'point' and 'ret' correspond.
+  btScalar point[3*8];		// penetrating contact points
+  btScalar dep[8];			// depths for those points
+  btScalar det1 = 1.f/(m11*m22 - m12*m21);
+  m11 *= det1;
+  m12 *= det1;
+  m21 *= det1;
+  m22 *= det1;
+  int cnum = 0;			// number of penetrating contact points found
+  for (j=0; j < n; j++) {
+    btScalar k1 =  m22*(ret[j*2]-c1) - m12*(ret[j*2+1]-c2);
+    btScalar k2 = -m21*(ret[j*2]-c1) + m11*(ret[j*2+1]-c2);
+    for (i=0; i<3; i++) point[cnum*3+i] =
+			  center[i] + k1*Rb[i*4+a1] + k2*Rb[i*4+a2];
+    dep[cnum] = Sa[codeN] - dDOT(normal2,point+cnum*3);
+    if (dep[cnum] >= 0) {
+      ret[cnum*2] = ret[j*2];
+      ret[cnum*2+1] = ret[j*2+1];
+      cnum++;
+    }
+  }
+  if (cnum < 1) return 0;	// this should never happen
+
+  // we can't generate more contacts than we actually have
+  if (maxc > cnum) maxc = cnum;
+  if (maxc < 1) maxc = 1;
+
+  if (cnum <= maxc) {
+
+	  if (code<4) 
+	  {
+    // we have less contacts than we need, so we use them all
+    for (j=0; j < cnum; j++) 
+	{
+		btVector3 pointInWorld;
+		for (i=0; i<3; i++) 
+			pointInWorld[i] = point[j*3+i] + pa[i];
+		output.addContactPoint(-normal,pointInWorld,-dep[j]);
+
+    }
+	  } else
+	  {
+		  // we have less contacts than we need, so we use them all
+		for (j=0; j < cnum; j++) 
+		{
+			btVector3 pointInWorld;
+			for (i=0; i<3; i++) 
+				pointInWorld[i] = point[j*3+i] + pa[i]-normal[i]*dep[j];
+				//pointInWorld[i] = point[j*3+i] + pa[i];
+			output.addContactPoint(-normal,pointInWorld,-dep[j]);
+		}
+	  }
+  }
+  else {
+    // we have more contacts than are wanted, some of them must be culled.
+    // find the deepest point, it is always the first contact.
+    int i1 = 0;
+    btScalar maxdepth = dep[0];
+    for (i=1; i<cnum; i++) {
+      if (dep[i] > maxdepth) {
+	maxdepth = dep[i];
+	i1 = i;
+      }
+    }
+
+    int iret[8];
+    cullPoints2 (cnum,ret,maxc,i1,iret);
+
+    for (j=0; j < maxc; j++) {
+//      dContactGeom *con = CONTACT(contact,skip*j);
+  //    for (i=0; i<3; i++) con->pos[i] = point[iret[j]*3+i] + pa[i];
+    //  con->depth = dep[iret[j]];
+
+		btVector3 posInWorld;
+		for (i=0; i<3; i++) 
+			posInWorld[i] = point[iret[j]*3+i] + pa[i];
+		if (code<4) 
+	   {
+			output.addContactPoint(-normal,posInWorld,-dep[iret[j]]);
+		} else
+		{
+			output.addContactPoint(-normal,posInWorld-normal*dep[iret[j]],-dep[iret[j]]);
+		}
+    }
+    cnum = maxc;
+  }
+
+  *return_code = code;
+  return cnum;
+}
+
+void	btBoxBoxDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* /*debugDraw*/,bool /*swapResults*/)
+{
+	
+	const btTransform& transformA = input.m_transformA;
+	const btTransform& transformB = input.m_transformB;
+	
+	int skip = 0;
+	dContactGeom *contact = 0;
+
+	dMatrix3 R1;
+	dMatrix3 R2;
+
+	for (int j=0;j<3;j++)
+	{
+		R1[0+4*j] = transformA.getBasis()[j].x();
+		R2[0+4*j] = transformB.getBasis()[j].x();
+
+		R1[1+4*j] = transformA.getBasis()[j].y();
+		R2[1+4*j] = transformB.getBasis()[j].y();
+
+
+		R1[2+4*j] = transformA.getBasis()[j].z();
+		R2[2+4*j] = transformB.getBasis()[j].z();
+
+	}
+
+	
+
+	btVector3 normal;
+	btScalar depth;
+	int return_code;
+	int maxc = 4;
+
+
+	dBoxBox2 (transformA.getOrigin(), 
+	R1,
+	2.f*m_box1->getHalfExtentsWithMargin(),
+	transformB.getOrigin(),
+	R2, 
+	2.f*m_box2->getHalfExtentsWithMargin(),
+	normal, &depth, &return_code,
+	maxc, contact, skip,
+	output
+	);
+
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h
new file mode 100644
index 0000000..3c941f7
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h
@@ -0,0 +1,44 @@
+/*
+ * Box-Box collision detection re-distributed under the ZLib license with permission from Russell L. Smith
+ * Original version is from Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith.
+ * All rights reserved.  Email: russ at q12.org   Web: www.q12.org
+
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef BT_BOX_BOX_DETECTOR_H
+#define BT_BOX_BOX_DETECTOR_H
+
+
+class btBoxShape;
+#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
+
+
+/// btBoxBoxDetector wraps the ODE box-box collision detector
+/// re-distributed under the Zlib license with permission from Russell L. Smith
+struct btBoxBoxDetector : public btDiscreteCollisionDetectorInterface
+{
+	btBoxShape* m_box1;
+	btBoxShape* m_box2;
+
+public:
+
+	btBoxBoxDetector(btBoxShape* box1,btBoxShape* box2);
+
+	virtual ~btBoxBoxDetector() {};
+
+	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);
+
+};
+
+#endif //BT_BOX_BOX_DETECTOR_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h
new file mode 100644
index 0000000..f63e092
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h
@@ -0,0 +1,48 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COLLISION_CONFIGURATION
+#define BT_COLLISION_CONFIGURATION
+
+struct btCollisionAlgorithmCreateFunc;
+
+class btStackAlloc;
+class btPoolAllocator;
+
+///btCollisionConfiguration allows to configure Bullet collision detection
+///stack allocator size, default collision algorithms and persistent manifold pool size
+///@todo: describe the meaning
+class	btCollisionConfiguration
+{
+
+public:
+
+	virtual ~btCollisionConfiguration()
+	{
+	}
+
+	///memory pools
+	virtual btPoolAllocator* getPersistentManifoldPool() = 0;
+
+	virtual btPoolAllocator* getCollisionAlgorithmPool() = 0;
+
+	virtual btStackAlloc*	getStackAllocator() = 0;
+
+	virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1) =0;
+
+};
+
+#endif //BT_COLLISION_CONFIGURATION
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h
new file mode 100644
index 0000000..1d7e744
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h
@@ -0,0 +1,45 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COLLISION_CREATE_FUNC
+#define BT_COLLISION_CREATE_FUNC
+
+#include "LinearMath/btAlignedObjectArray.h"
+class btCollisionAlgorithm;
+class btCollisionObject;
+
+struct btCollisionAlgorithmConstructionInfo;
+
+///Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm
+struct btCollisionAlgorithmCreateFunc
+{
+	bool m_swapped;
+	
+	btCollisionAlgorithmCreateFunc()
+		:m_swapped(false)
+	{
+	}
+	virtual ~btCollisionAlgorithmCreateFunc(){};
+
+	virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& , btCollisionObject* body0,btCollisionObject* body1)
+	{
+		
+		(void)body0;
+		(void)body1;
+		return 0;
+	}
+};
+#endif //BT_COLLISION_CREATE_FUNC
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
new file mode 100644
index 0000000..29674f3
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
@@ -0,0 +1,310 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#include "btCollisionDispatcher.h"
+
+
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
+#include "LinearMath/btPoolAllocator.h"
+#include "BulletCollision/CollisionDispatch/btCollisionConfiguration.h"
+
+int gNumManifold = 0;
+
+#ifdef BT_DEBUG
+#include <stdio.h>
+#endif
+
+
+btCollisionDispatcher::btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration): 
+m_dispatcherFlags(btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD),
+	m_collisionConfiguration(collisionConfiguration)
+{
+	int i;
+
+	setNearCallback(defaultNearCallback);
+	
+	m_collisionAlgorithmPoolAllocator = collisionConfiguration->getCollisionAlgorithmPool();
+
+	m_persistentManifoldPoolAllocator = collisionConfiguration->getPersistentManifoldPool();
+
+	for (i=0;i<MAX_BROADPHASE_COLLISION_TYPES;i++)
+	{
+		for (int j=0;j<MAX_BROADPHASE_COLLISION_TYPES;j++)
+		{
+			m_doubleDispatch[i][j] = m_collisionConfiguration->getCollisionAlgorithmCreateFunc(i,j);
+			btAssert(m_doubleDispatch[i][j]);
+		}
+	}
+	
+	
+}
+
+
+void btCollisionDispatcher::registerCollisionCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc)
+{
+	m_doubleDispatch[proxyType0][proxyType1] = createFunc;
+}
+
+btCollisionDispatcher::~btCollisionDispatcher()
+{
+}
+
+btPersistentManifold*	btCollisionDispatcher::getNewManifold(void* b0,void* b1) 
+{ 
+	gNumManifold++;
+	
+	//btAssert(gNumManifold < 65535);
+	
+
+	btCollisionObject* body0 = (btCollisionObject*)b0;
+	btCollisionObject* body1 = (btCollisionObject*)b1;
+
+	//optional relative contact breaking threshold, turned on by default (use setDispatcherFlags to switch off feature for improved performance)
+	
+	btScalar contactBreakingThreshold =  (m_dispatcherFlags & btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD) ? 
+		btMin(body0->getCollisionShape()->getContactBreakingThreshold(gContactBreakingThreshold) , body1->getCollisionShape()->getContactBreakingThreshold(gContactBreakingThreshold))
+		: gContactBreakingThreshold ;
+
+	btScalar contactProcessingThreshold = btMin(body0->getContactProcessingThreshold(),body1->getContactProcessingThreshold());
+		
+	void* mem = 0;
+	
+	if (m_persistentManifoldPoolAllocator->getFreeCount())
+	{
+		mem = m_persistentManifoldPoolAllocator->allocate(sizeof(btPersistentManifold));
+	} else
+	{
+		//we got a pool memory overflow, by default we fallback to dynamically allocate memory. If we require a contiguous contact pool then assert.
+		if ((m_dispatcherFlags&CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION)==0)
+		{
+			mem = btAlignedAlloc(sizeof(btPersistentManifold),16);
+		} else
+		{
+			btAssert(0);
+			//make sure to increase the m_defaultMaxPersistentManifoldPoolSize in the btDefaultCollisionConstructionInfo/btDefaultCollisionConfiguration
+			return 0;
+		}
+	}
+	btPersistentManifold* manifold = new(mem) btPersistentManifold (body0,body1,0,contactBreakingThreshold,contactProcessingThreshold);
+	manifold->m_index1a = m_manifoldsPtr.size();
+	m_manifoldsPtr.push_back(manifold);
+
+	return manifold;
+}
+
+void btCollisionDispatcher::clearManifold(btPersistentManifold* manifold)
+{
+	manifold->clearManifold();
+}
+
+	
+void btCollisionDispatcher::releaseManifold(btPersistentManifold* manifold)
+{
+	
+	gNumManifold--;
+
+	//printf("releaseManifold: gNumManifold %d\n",gNumManifold);
+	clearManifold(manifold);
+
+	int findIndex = manifold->m_index1a;
+	btAssert(findIndex < m_manifoldsPtr.size());
+	m_manifoldsPtr.swap(findIndex,m_manifoldsPtr.size()-1);
+	m_manifoldsPtr[findIndex]->m_index1a = findIndex;
+	m_manifoldsPtr.pop_back();
+
+	manifold->~btPersistentManifold();
+	if (m_persistentManifoldPoolAllocator->validPtr(manifold))
+	{
+		m_persistentManifoldPoolAllocator->freeMemory(manifold);
+	} else
+	{
+		btAlignedFree(manifold);
+	}
+	
+}
+
+	
+
+btCollisionAlgorithm* btCollisionDispatcher::findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold)
+{
+	
+	btCollisionAlgorithmConstructionInfo ci;
+
+	ci.m_dispatcher1 = this;
+	ci.m_manifold = sharedManifold;
+	btCollisionAlgorithm* algo = m_doubleDispatch[body0->getCollisionShape()->getShapeType()][body1->getCollisionShape()->getShapeType()]->CreateCollisionAlgorithm(ci,body0,body1);
+
+	return algo;
+}
+
+
+
+
+bool	btCollisionDispatcher::needsResponse(btCollisionObject* body0,btCollisionObject* body1)
+{
+	//here you can do filtering
+	bool hasResponse = 
+		(body0->hasContactResponse() && body1->hasContactResponse());
+	//no response between two static/kinematic bodies:
+	hasResponse = hasResponse &&
+		((!body0->isStaticOrKinematicObject()) ||(! body1->isStaticOrKinematicObject()));
+	return hasResponse;
+}
+
+bool	btCollisionDispatcher::needsCollision(btCollisionObject* body0,btCollisionObject* body1)
+{
+	btAssert(body0);
+	btAssert(body1);
+
+	bool needsCollision = true;
+
+#ifdef BT_DEBUG
+	if (!(m_dispatcherFlags & btCollisionDispatcher::CD_STATIC_STATIC_REPORTED))
+	{
+		//broadphase filtering already deals with this
+		if (body0->isStaticOrKinematicObject() && body1->isStaticOrKinematicObject())
+		{
+			m_dispatcherFlags |= btCollisionDispatcher::CD_STATIC_STATIC_REPORTED;
+			printf("warning btCollisionDispatcher::needsCollision: static-static collision!\n");
+		}
+	}
+#endif //BT_DEBUG
+
+	if ((!body0->isActive()) && (!body1->isActive()))
+		needsCollision = false;
+	else if (!body0->checkCollideWith(body1))
+		needsCollision = false;
+	
+	return needsCollision ;
+
+}
+
+
+
+///interface for iterating all overlapping collision pairs, no matter how those pairs are stored (array, set, map etc)
+///this is useful for the collision dispatcher.
+class btCollisionPairCallback : public btOverlapCallback
+{
+	const btDispatcherInfo& m_dispatchInfo;
+	btCollisionDispatcher*	m_dispatcher;
+
+public:
+
+	btCollisionPairCallback(const btDispatcherInfo& dispatchInfo,btCollisionDispatcher*	dispatcher)
+	:m_dispatchInfo(dispatchInfo),
+	m_dispatcher(dispatcher)
+	{
+	}
+
+	/*btCollisionPairCallback& operator=(btCollisionPairCallback& other)
+	{
+		m_dispatchInfo = other.m_dispatchInfo;
+		m_dispatcher = other.m_dispatcher;
+		return *this;
+	}
+	*/
+
+
+	virtual ~btCollisionPairCallback() {}
+
+
+	virtual bool	processOverlap(btBroadphasePair& pair)
+	{
+		(*m_dispatcher->getNearCallback())(pair,*m_dispatcher,m_dispatchInfo);
+
+		return false;
+	}
+};
+
+
+
+void	btCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) 
+{
+	//m_blockedForChanges = true;
+
+	btCollisionPairCallback	collisionCallback(dispatchInfo,this);
+
+	pairCache->processAllOverlappingPairs(&collisionCallback,dispatcher);
+
+	//m_blockedForChanges = false;
+
+}
+
+
+
+
+//by default, Bullet will use this near callback
+void btCollisionDispatcher::defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo)
+{
+		btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
+		btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
+
+		if (dispatcher.needsCollision(colObj0,colObj1))
+		{
+			//dispatcher will keep algorithms persistent in the collision pair
+			if (!collisionPair.m_algorithm)
+			{
+				collisionPair.m_algorithm = dispatcher.findAlgorithm(colObj0,colObj1);
+			}
+
+			if (collisionPair.m_algorithm)
+			{
+				btManifoldResult contactPointResult(colObj0,colObj1);
+				
+				if (dispatchInfo.m_dispatchFunc == 		btDispatcherInfo::DISPATCH_DISCRETE)
+				{
+					//discrete collision detection query
+					collisionPair.m_algorithm->processCollision(colObj0,colObj1,dispatchInfo,&contactPointResult);
+				} else
+				{
+					//continuous collision detection query, time of impact (toi)
+					btScalar toi = collisionPair.m_algorithm->calculateTimeOfImpact(colObj0,colObj1,dispatchInfo,&contactPointResult);
+					if (dispatchInfo.m_timeOfImpact > toi)
+						dispatchInfo.m_timeOfImpact = toi;
+
+				}
+			}
+		}
+
+}
+
+
+void* btCollisionDispatcher::allocateCollisionAlgorithm(int size)
+{
+	if (m_collisionAlgorithmPoolAllocator->getFreeCount())
+	{
+		return m_collisionAlgorithmPoolAllocator->allocate(size);
+	}
+	
+	//warn user for overflow?
+	return	btAlignedAlloc(static_cast<size_t>(size), 16);
+}
+
+void btCollisionDispatcher::freeCollisionAlgorithm(void* ptr)
+{
+	if (m_collisionAlgorithmPoolAllocator->validPtr(ptr))
+	{
+		m_collisionAlgorithmPoolAllocator->freeMemory(ptr);
+	} else
+	{
+		btAlignedFree(ptr);
+	}
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h
new file mode 100644
index 0000000..2fca43f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h
@@ -0,0 +1,172 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COLLISION__DISPATCHER_H
+#define BT_COLLISION__DISPATCHER_H
+
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+
+#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
+
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+class btIDebugDraw;
+class btOverlappingPairCache;
+class btPoolAllocator;
+class btCollisionConfiguration;
+
+#include "btCollisionCreateFunc.h"
+
+#define USE_DISPATCH_REGISTRY_ARRAY 1
+
+class btCollisionDispatcher;
+///user can override this nearcallback for collision filtering and more finegrained control over collision detection
+typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);
+
+
+///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs.
+///Time of Impact, Closest Points and Penetration Depth.
+class btCollisionDispatcher : public btDispatcher
+{
+
+protected:
+
+	int		m_dispatcherFlags;
+
+	btAlignedObjectArray<btPersistentManifold*>	m_manifoldsPtr;
+
+	btManifoldResult	m_defaultManifoldResult;
+
+	btNearCallback		m_nearCallback;
+	
+	btPoolAllocator*	m_collisionAlgorithmPoolAllocator;
+
+	btPoolAllocator*	m_persistentManifoldPoolAllocator;
+
+	btCollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES];
+
+	btCollisionConfiguration*	m_collisionConfiguration;
+
+
+public:
+
+	enum DispatcherFlags
+	{
+		CD_STATIC_STATIC_REPORTED = 1,
+		CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2,
+		CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION = 4
+	};
+
+	int	getDispatcherFlags() const
+	{
+		return m_dispatcherFlags;
+	}
+
+	void	setDispatcherFlags(int flags)
+	{
+		m_dispatcherFlags = flags;
+	}
+
+	///registerCollisionCreateFunc allows registration of custom/alternative collision create functions
+	void	registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc);
+
+	int	getNumManifolds() const
+	{ 
+		return int( m_manifoldsPtr.size());
+	}
+
+	btPersistentManifold**	getInternalManifoldPointer()
+	{
+		return &m_manifoldsPtr[0];
+	}
+
+	 btPersistentManifold* getManifoldByIndexInternal(int index)
+	{
+		return m_manifoldsPtr[index];
+	}
+
+	 const btPersistentManifold* getManifoldByIndexInternal(int index) const
+	{
+		return m_manifoldsPtr[index];
+	}
+
+	btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration);
+
+	virtual ~btCollisionDispatcher();
+
+	virtual btPersistentManifold*	getNewManifold(void* b0,void* b1);
+	
+	virtual void releaseManifold(btPersistentManifold* manifold);
+
+
+	virtual void clearManifold(btPersistentManifold* manifold);
+
+			
+	btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold = 0);
+		
+	virtual bool	needsCollision(btCollisionObject* body0,btCollisionObject* body1);
+	
+	virtual bool	needsResponse(btCollisionObject* body0,btCollisionObject* body1);
+	
+	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ;
+
+	void	setNearCallback(btNearCallback	nearCallback)
+	{
+		m_nearCallback = nearCallback; 
+	}
+
+	btNearCallback	getNearCallback() const
+	{
+		return m_nearCallback;
+	}
+
+	//by default, Bullet will use this near callback
+	static void  defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);
+
+	virtual	void* allocateCollisionAlgorithm(int size);
+
+	virtual	void freeCollisionAlgorithm(void* ptr);
+
+	btCollisionConfiguration*	getCollisionConfiguration()
+	{
+		return m_collisionConfiguration;
+	}
+
+	const btCollisionConfiguration*	getCollisionConfiguration() const
+	{
+		return m_collisionConfiguration;
+	}
+
+	void	setCollisionConfiguration(btCollisionConfiguration* config)
+	{
+		m_collisionConfiguration = config;
+	}
+
+	virtual	btPoolAllocator*	getInternalManifoldPool()
+	{
+		return m_persistentManifoldPoolAllocator;
+	}
+
+	virtual	const btPoolAllocator*	getInternalManifoldPool() const
+	{
+		return m_persistentManifoldPoolAllocator;
+	}
+
+};
+
+#endif //BT_COLLISION__DISPATCHER_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp
new file mode 100644
index 0000000..580ea34
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp
@@ -0,0 +1,116 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btCollisionObject.h"
+#include "LinearMath/btSerializer.h"
+
+btCollisionObject::btCollisionObject()
+	:	m_anisotropicFriction(1.f,1.f,1.f),
+	m_hasAnisotropicFriction(false),
+	m_contactProcessingThreshold(BT_LARGE_FLOAT),
+		m_broadphaseHandle(0),
+		m_collisionShape(0),
+		m_extensionPointer(0),
+		m_rootCollisionShape(0),
+		m_collisionFlags(btCollisionObject::CF_STATIC_OBJECT),
+		m_islandTag1(-1),
+		m_companionId(-1),
+		m_activationState1(1),
+		m_deactivationTime(btScalar(0.)),
+		m_friction(btScalar(0.5)),
+		m_restitution(btScalar(0.)),
+		m_internalType(CO_COLLISION_OBJECT),
+		m_userObjectPointer(0),
+		m_hitFraction(btScalar(1.)),
+		m_ccdSweptSphereRadius(btScalar(0.)),
+		m_ccdMotionThreshold(btScalar(0.)),
+		m_checkCollideWith(false)
+{
+	m_worldTransform.setIdentity();
+}
+
+btCollisionObject::~btCollisionObject()
+{
+}
+
+void btCollisionObject::setActivationState(int newState) 
+{ 
+	if ( (m_activationState1 != DISABLE_DEACTIVATION) && (m_activationState1 != DISABLE_SIMULATION))
+		m_activationState1 = newState;
+}
+
+void btCollisionObject::forceActivationState(int newState)
+{
+	m_activationState1 = newState;
+}
+
+void btCollisionObject::activate(bool forceActivation)
+{
+	if (forceActivation || !(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT)))
+	{
+		setActivationState(ACTIVE_TAG);
+		m_deactivationTime = btScalar(0.);
+	}
+}
+
+const char* btCollisionObject::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+
+	btCollisionObjectData* dataOut = (btCollisionObjectData*)dataBuffer;
+
+	m_worldTransform.serialize(dataOut->m_worldTransform);
+	m_interpolationWorldTransform.serialize(dataOut->m_interpolationWorldTransform);
+	m_interpolationLinearVelocity.serialize(dataOut->m_interpolationLinearVelocity);
+	m_interpolationAngularVelocity.serialize(dataOut->m_interpolationAngularVelocity);
+	m_anisotropicFriction.serialize(dataOut->m_anisotropicFriction);
+	dataOut->m_hasAnisotropicFriction = m_hasAnisotropicFriction;
+	dataOut->m_contactProcessingThreshold = m_contactProcessingThreshold;
+	dataOut->m_broadphaseHandle = 0;
+	dataOut->m_collisionShape = serializer->getUniquePointer(m_collisionShape);
+	dataOut->m_rootCollisionShape = 0;//@todo
+	dataOut->m_collisionFlags = m_collisionFlags;
+	dataOut->m_islandTag1 = m_islandTag1;
+	dataOut->m_companionId = m_companionId;
+	dataOut->m_activationState1 = m_activationState1;
+	dataOut->m_activationState1 = m_activationState1;
+	dataOut->m_deactivationTime = m_deactivationTime;
+	dataOut->m_friction = m_friction;
+	dataOut->m_restitution = m_restitution;
+	dataOut->m_internalType = m_internalType;
+	
+	char* name = (char*) serializer->findNameForPointer(this);
+	dataOut->m_name = (char*)serializer->getUniquePointer(name);
+	if (dataOut->m_name)
+	{
+		serializer->serializeName(name);
+	}
+	dataOut->m_hitFraction = m_hitFraction;
+	dataOut->m_ccdSweptSphereRadius = m_ccdSweptSphereRadius;
+	dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
+	dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
+	dataOut->m_checkCollideWith = m_checkCollideWith;
+
+	return btCollisionObjectDataName;
+}
+
+
+void btCollisionObject::serializeSingleObject(class btSerializer* serializer) const
+{
+	int len = calculateSerializeBufferSize();
+	btChunk* chunk = serializer->allocate(len,1);
+	const char* structType = serialize(chunk->m_oldPtr, serializer);
+	serializer->finalizeChunk(chunk,structType,BT_COLLISIONOBJECT_CODE,(void*)this);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h
new file mode 100644
index 0000000..3a11c96
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionObject.h
@@ -0,0 +1,524 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COLLISION_OBJECT_H
+#define BT_COLLISION_OBJECT_H
+
+#include "LinearMath/btTransform.h"
+
+//island management, m_activationState1
+#define ACTIVE_TAG 1
+#define ISLAND_SLEEPING 2
+#define WANTS_DEACTIVATION 3
+#define DISABLE_DEACTIVATION 4
+#define DISABLE_SIMULATION 5
+
+struct	btBroadphaseProxy;
+class	btCollisionShape;
+struct btCollisionShapeData;
+#include "LinearMath/btMotionState.h"
+#include "LinearMath/btAlignedAllocator.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btCollisionObjectData btCollisionObjectDoubleData
+#define btCollisionObjectDataName "btCollisionObjectDoubleData"
+#else
+#define btCollisionObjectData btCollisionObjectFloatData
+#define btCollisionObjectDataName "btCollisionObjectFloatData"
+#endif
+
+
+/// btCollisionObject can be used to manage collision detection objects. 
+/// btCollisionObject maintains all information that is needed for a collision detection: Shape, Transform and AABB proxy.
+/// They can be added to the btCollisionWorld.
+ATTRIBUTE_ALIGNED16(class)	btCollisionObject
+{
+
+protected:
+
+	btTransform	m_worldTransform;
+
+	///m_interpolationWorldTransform is used for CCD and interpolation
+	///it can be either previous or future (predicted) transform
+	btTransform	m_interpolationWorldTransform;
+	//those two are experimental: just added for bullet time effect, so you can still apply impulses (directly modifying velocities) 
+	//without destroying the continuous interpolated motion (which uses this interpolation velocities)
+	btVector3	m_interpolationLinearVelocity;
+	btVector3	m_interpolationAngularVelocity;
+	
+	btVector3	m_anisotropicFriction;
+	int			m_hasAnisotropicFriction;
+	btScalar	m_contactProcessingThreshold;	
+
+	btBroadphaseProxy*		m_broadphaseHandle;
+	btCollisionShape*		m_collisionShape;
+	///m_extensionPointer is used by some internal low-level Bullet extensions.
+	void*					m_extensionPointer;
+	
+	///m_rootCollisionShape is temporarily used to store the original collision shape
+	///The m_collisionShape might be temporarily replaced by a child collision shape during collision detection purposes
+	///If it is NULL, the m_collisionShape is not temporarily replaced.
+	btCollisionShape*		m_rootCollisionShape;
+
+	int				m_collisionFlags;
+
+	int				m_islandTag1;
+	int				m_companionId;
+
+	int				m_activationState1;
+	btScalar			m_deactivationTime;
+
+	btScalar		m_friction;
+	btScalar		m_restitution;
+
+	///m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc.
+	///do not assign your own m_internalType unless you write a new dynamics object class.
+	int				m_internalType;
+
+	///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer
+	void*			m_userObjectPointer;
+
+	///time of impact calculation
+	btScalar		m_hitFraction; 
+	
+	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
+	btScalar		m_ccdSweptSphereRadius;
+
+	/// Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold
+	btScalar		m_ccdMotionThreshold;
+	
+	/// If some object should have elaborate collision filtering by sub-classes
+	int			m_checkCollideWith;
+
+	virtual bool	checkCollideWithOverride(btCollisionObject* /* co */)
+	{
+		return true;
+	}
+
+public:
+
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	enum CollisionFlags
+	{
+		CF_STATIC_OBJECT= 1,
+		CF_KINEMATIC_OBJECT= 2,
+		CF_NO_CONTACT_RESPONSE = 4,
+		CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution)
+		CF_CHARACTER_OBJECT = 16,
+		CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing
+		CF_DISABLE_SPU_COLLISION_PROCESSING = 64//disable parallel/SPU processing
+	};
+
+	enum	CollisionObjectTypes
+	{
+		CO_COLLISION_OBJECT =1,
+		CO_RIGID_BODY=2,
+		///CO_GHOST_OBJECT keeps track of all objects overlapping its AABB and that pass its collision filter
+		///It is useful for collision sensors, explosion objects, character controller etc.
+		CO_GHOST_OBJECT=4,
+		CO_SOFT_BODY=8,
+		CO_HF_FLUID=16,
+		CO_USER_TYPE=32
+	};
+
+	SIMD_FORCE_INLINE bool mergesSimulationIslands() const
+	{
+		///static objects, kinematic and object without contact response don't merge islands
+		return  ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE) )==0);
+	}
+
+	const btVector3& getAnisotropicFriction() const
+	{
+		return m_anisotropicFriction;
+	}
+	void	setAnisotropicFriction(const btVector3& anisotropicFriction)
+	{
+		m_anisotropicFriction = anisotropicFriction;
+		m_hasAnisotropicFriction = (anisotropicFriction[0]!=1.f) || (anisotropicFriction[1]!=1.f) || (anisotropicFriction[2]!=1.f);
+	}
+	bool	hasAnisotropicFriction() const
+	{
+		return m_hasAnisotropicFriction!=0;
+	}
+
+	///the constraint solver can discard solving contacts, if the distance is above this threshold. 0 by default.
+	///Note that using contacts with positive distance can improve stability. It increases, however, the chance of colliding with degerate contacts, such as 'interior' triangle edges
+	void	setContactProcessingThreshold( btScalar contactProcessingThreshold)
+	{
+		m_contactProcessingThreshold = contactProcessingThreshold;
+	}
+	btScalar	getContactProcessingThreshold() const
+	{
+		return m_contactProcessingThreshold;
+	}
+
+	SIMD_FORCE_INLINE bool		isStaticObject() const {
+		return (m_collisionFlags & CF_STATIC_OBJECT) != 0;
+	}
+
+	SIMD_FORCE_INLINE bool		isKinematicObject() const
+	{
+		return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0;
+	}
+
+	SIMD_FORCE_INLINE bool		isStaticOrKinematicObject() const
+	{
+		return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0 ;
+	}
+
+	SIMD_FORCE_INLINE bool		hasContactResponse() const {
+		return (m_collisionFlags & CF_NO_CONTACT_RESPONSE)==0;
+	}
+
+	
+	btCollisionObject();
+
+	virtual ~btCollisionObject();
+
+	virtual void	setCollisionShape(btCollisionShape* collisionShape)
+	{
+		m_collisionShape = collisionShape;
+		m_rootCollisionShape = collisionShape;
+	}
+
+	SIMD_FORCE_INLINE const btCollisionShape*	getCollisionShape() const
+	{
+		return m_collisionShape;
+	}
+
+	SIMD_FORCE_INLINE btCollisionShape*	getCollisionShape()
+	{
+		return m_collisionShape;
+	}
+
+	SIMD_FORCE_INLINE const btCollisionShape*	getRootCollisionShape() const
+	{
+		return m_rootCollisionShape;
+	}
+
+	SIMD_FORCE_INLINE btCollisionShape*	getRootCollisionShape()
+	{
+		return m_rootCollisionShape;
+	}
+
+	///Avoid using this internal API call
+	///internalSetTemporaryCollisionShape is used to temporary replace the actual collision shape by a child collision shape.
+	void	internalSetTemporaryCollisionShape(btCollisionShape* collisionShape)
+	{
+		m_collisionShape = collisionShape;
+	}
+
+	///Avoid using this internal API call, the extension pointer is used by some Bullet extensions. 
+	///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
+	void*		internalGetExtensionPointer() const
+	{
+		return m_extensionPointer;
+	}
+	///Avoid using this internal API call, the extension pointer is used by some Bullet extensions
+	///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
+	void	internalSetExtensionPointer(void* pointer)
+	{
+		m_extensionPointer = pointer;
+	}
+
+	SIMD_FORCE_INLINE	int	getActivationState() const { return m_activationState1;}
+	
+	void setActivationState(int newState);
+
+	void	setDeactivationTime(btScalar time)
+	{
+		m_deactivationTime = time;
+	}
+	btScalar	getDeactivationTime() const
+	{
+		return m_deactivationTime;
+	}
+
+	void forceActivationState(int newState);
+
+	void	activate(bool forceActivation = false);
+
+	SIMD_FORCE_INLINE bool isActive() const
+	{
+		return ((getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION));
+	}
+
+	void	setRestitution(btScalar rest)
+	{
+		m_restitution = rest;
+	}
+	btScalar	getRestitution() const
+	{
+		return m_restitution;
+	}
+	void	setFriction(btScalar frict)
+	{
+		m_friction = frict;
+	}
+	btScalar	getFriction() const
+	{
+		return m_friction;
+	}
+
+	///reserved for Bullet internal usage
+	int	getInternalType() const
+	{
+		return m_internalType;
+	}
+
+	btTransform&	getWorldTransform()
+	{
+		return m_worldTransform;
+	}
+
+	const btTransform&	getWorldTransform() const
+	{
+		return m_worldTransform;
+	}
+
+	void	setWorldTransform(const btTransform& worldTrans)
+	{
+		m_worldTransform = worldTrans;
+	}
+
+
+	SIMD_FORCE_INLINE btBroadphaseProxy*	getBroadphaseHandle()
+	{
+		return m_broadphaseHandle;
+	}
+
+	SIMD_FORCE_INLINE const btBroadphaseProxy*	getBroadphaseHandle() const
+	{
+		return m_broadphaseHandle;
+	}
+
+	void	setBroadphaseHandle(btBroadphaseProxy* handle)
+	{
+		m_broadphaseHandle = handle;
+	}
+
+
+	const btTransform&	getInterpolationWorldTransform() const
+	{
+		return m_interpolationWorldTransform;
+	}
+
+	btTransform&	getInterpolationWorldTransform()
+	{
+		return m_interpolationWorldTransform;
+	}
+
+	void	setInterpolationWorldTransform(const btTransform&	trans)
+	{
+		m_interpolationWorldTransform = trans;
+	}
+
+	void	setInterpolationLinearVelocity(const btVector3& linvel)
+	{
+		m_interpolationLinearVelocity = linvel;
+	}
+
+	void	setInterpolationAngularVelocity(const btVector3& angvel)
+	{
+		m_interpolationAngularVelocity = angvel;
+	}
+
+	const btVector3&	getInterpolationLinearVelocity() const
+	{
+		return m_interpolationLinearVelocity;
+	}
+
+	const btVector3&	getInterpolationAngularVelocity() const
+	{
+		return m_interpolationAngularVelocity;
+	}
+
+	SIMD_FORCE_INLINE int getIslandTag() const
+	{
+		return	m_islandTag1;
+	}
+
+	void	setIslandTag(int tag)
+	{
+		m_islandTag1 = tag;
+	}
+
+	SIMD_FORCE_INLINE int getCompanionId() const
+	{
+		return	m_companionId;
+	}
+
+	void	setCompanionId(int id)
+	{
+		m_companionId = id;
+	}
+
+	SIMD_FORCE_INLINE btScalar			getHitFraction() const
+	{
+		return m_hitFraction; 
+	}
+
+	void	setHitFraction(btScalar hitFraction)
+	{
+		m_hitFraction = hitFraction;
+	}
+
+	
+	SIMD_FORCE_INLINE int	getCollisionFlags() const
+	{
+		return m_collisionFlags;
+	}
+
+	void	setCollisionFlags(int flags)
+	{
+		m_collisionFlags = flags;
+	}
+	
+	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
+	btScalar			getCcdSweptSphereRadius() const
+	{
+		return m_ccdSweptSphereRadius;
+	}
+
+	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::
+	void	setCcdSweptSphereRadius(btScalar radius)
+	{
+		m_ccdSweptSphereRadius = radius;
+	}
+
+	btScalar 	getCcdMotionThreshold() const
+	{
+		return m_ccdMotionThreshold;
+	}
+
+	btScalar 	getCcdSquareMotionThreshold() const
+	{
+		return m_ccdMotionThreshold*m_ccdMotionThreshold;
+	}
+
+
+
+	/// Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold
+	void	setCcdMotionThreshold(btScalar ccdMotionThreshold)
+	{
+		m_ccdMotionThreshold = ccdMotionThreshold;
+	}
+
+	///users can point to their objects, userPointer is not used by Bullet
+	void*	getUserPointer() const
+	{
+		return m_userObjectPointer;
+	}
+	
+	///users can point to their objects, userPointer is not used by Bullet
+	void	setUserPointer(void* userPointer)
+	{
+		m_userObjectPointer = userPointer;
+	}
+
+
+	inline bool checkCollideWith(btCollisionObject* co)
+	{
+		if (m_checkCollideWith)
+			return checkCollideWithOverride(co);
+
+		return true;
+	}
+
+	virtual	int	calculateSerializeBufferSize()	const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, class btSerializer* serializer) const;
+
+	virtual void serializeSingleObject(class btSerializer* serializer) const;
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btCollisionObjectDoubleData
+{
+	void					*m_broadphaseHandle;
+	void					*m_collisionShape;
+	btCollisionShapeData	*m_rootCollisionShape;
+	char					*m_name;
+
+	btTransformDoubleData	m_worldTransform;
+	btTransformDoubleData	m_interpolationWorldTransform;
+	btVector3DoubleData		m_interpolationLinearVelocity;
+	btVector3DoubleData		m_interpolationAngularVelocity;
+	btVector3DoubleData		m_anisotropicFriction;
+	double					m_contactProcessingThreshold;	
+	double					m_deactivationTime;
+	double					m_friction;
+	double					m_restitution;
+	double					m_hitFraction; 
+	double					m_ccdSweptSphereRadius;
+	double					m_ccdMotionThreshold;
+
+	int						m_hasAnisotropicFriction;
+	int						m_collisionFlags;
+	int						m_islandTag1;
+	int						m_companionId;
+	int						m_activationState1;
+	int						m_internalType;
+	int						m_checkCollideWith;
+
+	char	m_padding[4];
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btCollisionObjectFloatData
+{
+	void					*m_broadphaseHandle;
+	void					*m_collisionShape;
+	btCollisionShapeData	*m_rootCollisionShape;
+	char					*m_name;
+
+	btTransformFloatData	m_worldTransform;
+	btTransformFloatData	m_interpolationWorldTransform;
+	btVector3FloatData		m_interpolationLinearVelocity;
+	btVector3FloatData		m_interpolationAngularVelocity;
+	btVector3FloatData		m_anisotropicFriction;
+	float					m_contactProcessingThreshold;	
+	float					m_deactivationTime;
+	float					m_friction;
+	float					m_restitution;
+	float					m_hitFraction; 
+	float					m_ccdSweptSphereRadius;
+	float					m_ccdMotionThreshold;
+
+	int						m_hasAnisotropicFriction;
+	int						m_collisionFlags;
+	int						m_islandTag1;
+	int						m_companionId;
+	int						m_activationState1;
+	int						m_internalType;
+	int						m_checkCollideWith;
+};
+
+
+
+SIMD_FORCE_INLINE	int	btCollisionObject::calculateSerializeBufferSize() const
+{
+	return sizeof(btCollisionObjectData);
+}
+
+
+
+#endif //BT_COLLISION_OBJECT_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
new file mode 100644
index 0000000..807b3d6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
@@ -0,0 +1,1513 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btCollisionWorld.h"
+#include "btCollisionDispatcher.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h" //for raycasting
+#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" //for raycasting
+#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h"
+#include "BulletCollision/CollisionShapes/btCompoundShape.h"
+#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
+#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
+#include "BulletCollision/BroadphaseCollision/btDbvt.h"
+#include "LinearMath/btAabbUtil2.h"
+#include "LinearMath/btQuickprof.h"
+#include "LinearMath/btStackAlloc.h"
+#include "LinearMath/btSerializer.h"
+#include "BulletCollision/CollisionShapes/btConvexPolyhedron.h"
+
+//#define DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
+
+
+//#define USE_BRUTEFORCE_RAYBROADPHASE 1
+//RECALCULATE_AABB is slower, but benefit is that you don't need to call 'stepSimulation'  or 'updateAabbs' before using a rayTest
+//#define RECALCULATE_AABB_RAYCAST 1
+
+//When the user doesn't provide dispatcher or broadphase, create basic versions (and delete them in destructor)
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
+#include "BulletCollision/CollisionDispatch/btCollisionConfiguration.h"
+
+
+///for debug drawing
+
+//for debug rendering
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
+#include "BulletCollision/CollisionShapes/btCompoundShape.h"
+#include "BulletCollision/CollisionShapes/btConeShape.h"
+#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btCylinderShape.h"
+#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
+#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleCallback.h"
+#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
+
+
+
+btCollisionWorld::btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache, btCollisionConfiguration* collisionConfiguration)
+:m_dispatcher1(dispatcher),
+m_broadphasePairCache(pairCache),
+m_debugDrawer(0),
+m_forceUpdateAllAabbs(true)
+{
+	m_stackAlloc = collisionConfiguration->getStackAllocator();
+	m_dispatchInfo.m_stackAllocator = m_stackAlloc;
+}
+
+
+btCollisionWorld::~btCollisionWorld()
+{
+
+	//clean up remaining objects
+	int i;
+	for (i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* collisionObject= m_collisionObjects[i];
+
+		btBroadphaseProxy* bp = collisionObject->getBroadphaseHandle();
+		if (bp)
+		{
+			//
+			// only clear the cached algorithms
+			//
+			getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bp,m_dispatcher1);
+			getBroadphase()->destroyProxy(bp,m_dispatcher1);
+			collisionObject->setBroadphaseHandle(0);
+		}
+	}
+
+
+}
+
+
+
+
+
+
+
+
+
+
+void	btCollisionWorld::addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup,short int collisionFilterMask)
+{
+
+	btAssert(collisionObject);
+
+	//check that the object isn't already added
+	btAssert( m_collisionObjects.findLinearSearch(collisionObject)  == m_collisionObjects.size());
+
+	m_collisionObjects.push_back(collisionObject);
+
+	//calculate new AABB
+	btTransform trans = collisionObject->getWorldTransform();
+
+	btVector3	minAabb;
+	btVector3	maxAabb;
+	collisionObject->getCollisionShape()->getAabb(trans,minAabb,maxAabb);
+
+	int type = collisionObject->getCollisionShape()->getShapeType();
+	collisionObject->setBroadphaseHandle( getBroadphase()->createProxy(
+		minAabb,
+		maxAabb,
+		type,
+		collisionObject,
+		collisionFilterGroup,
+		collisionFilterMask,
+		m_dispatcher1,0
+		))	;
+
+
+
+
+
+}
+
+
+
+void	btCollisionWorld::updateSingleAabb(btCollisionObject* colObj)
+{
+	btVector3 minAabb,maxAabb;
+	colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
+	//need to increase the aabb for contact thresholds
+	btVector3 contactThreshold(gContactBreakingThreshold,gContactBreakingThreshold,gContactBreakingThreshold);
+	minAabb -= contactThreshold;
+	maxAabb += contactThreshold;
+
+	if(getDispatchInfo().m_useContinuous && colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
+	{
+		btVector3 minAabb2,maxAabb2;
+		colObj->getCollisionShape()->getAabb(colObj->getInterpolationWorldTransform(),minAabb2,maxAabb2);
+		minAabb2 -= contactThreshold;
+		maxAabb2 += contactThreshold;
+		minAabb.setMin(minAabb2);
+		maxAabb.setMax(maxAabb2);
+	}
+
+	btBroadphaseInterface* bp = (btBroadphaseInterface*)m_broadphasePairCache;
+
+	//moving objects should be moderately sized, probably something wrong if not
+	if ( colObj->isStaticObject() || ((maxAabb-minAabb).length2() < btScalar(1e12)))
+	{
+		bp->setAabb(colObj->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1);
+	} else
+	{
+		//something went wrong, investigate
+		//this assert is unwanted in 3D modelers (danger of loosing work)
+		colObj->setActivationState(DISABLE_SIMULATION);
+
+		static bool reportMe = true;
+		if (reportMe && m_debugDrawer)
+		{
+			reportMe = false;
+			m_debugDrawer->reportErrorWarning("Overflow in AABB, object removed from simulation");
+			m_debugDrawer->reportErrorWarning("If you can reproduce this, please email bugs at continuousphysics.com\n");
+			m_debugDrawer->reportErrorWarning("Please include above information, your Platform, version of OS.\n");
+			m_debugDrawer->reportErrorWarning("Thanks.\n");
+		}
+	}
+}
+
+void	btCollisionWorld::updateAabbs()
+{
+	BT_PROFILE("updateAabbs");
+
+	btTransform predictedTrans;
+	for ( int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+
+		//only update aabb of active objects
+		if (m_forceUpdateAllAabbs || colObj->isActive())
+		{
+			updateSingleAabb(colObj);
+		}
+	}
+}
+
+
+
+void	btCollisionWorld::performDiscreteCollisionDetection()
+{
+	BT_PROFILE("performDiscreteCollisionDetection");
+
+	btDispatcherInfo& dispatchInfo = getDispatchInfo();
+
+	updateAabbs();
+
+	{
+		BT_PROFILE("calculateOverlappingPairs");
+		m_broadphasePairCache->calculateOverlappingPairs(m_dispatcher1);
+	}
+
+
+	btDispatcher* dispatcher = getDispatcher();
+	{
+		BT_PROFILE("dispatchAllCollisionPairs");
+		if (dispatcher)
+			dispatcher->dispatchAllCollisionPairs(m_broadphasePairCache->getOverlappingPairCache(),dispatchInfo,m_dispatcher1);
+	}
+
+}
+
+
+
+void	btCollisionWorld::removeCollisionObject(btCollisionObject* collisionObject)
+{
+
+
+	//bool removeFromBroadphase = false;
+
+	{
+
+		btBroadphaseProxy* bp = collisionObject->getBroadphaseHandle();
+		if (bp)
+		{
+			//
+			// only clear the cached algorithms
+			//
+			getBroadphase()->getOverlappingPairCache()->cleanProxyFromPairs(bp,m_dispatcher1);
+			getBroadphase()->destroyProxy(bp,m_dispatcher1);
+			collisionObject->setBroadphaseHandle(0);
+		}
+	}
+
+
+	//swapremove
+	m_collisionObjects.remove(collisionObject);
+
+}
+
+
+
+void	btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans,
+										btCollisionObject* collisionObject,
+										const btCollisionShape* collisionShape,
+										const btTransform& colObjWorldTransform,
+										RayResultCallback& resultCallback)
+{
+	btSphereShape pointShape(btScalar(0.0));
+	pointShape.setMargin(0.f);
+	const btConvexShape* castShape = &pointShape;
+
+	if (collisionShape->isConvex())
+	{
+		//		BT_PROFILE("rayTestConvex");
+		btConvexCast::CastResult castResult;
+		castResult.m_fraction = resultCallback.m_closestHitFraction;
+
+		btConvexShape* convexShape = (btConvexShape*) collisionShape;
+		btVoronoiSimplexSolver	simplexSolver;
+#define USE_SUBSIMPLEX_CONVEX_CAST 1
+#ifdef USE_SUBSIMPLEX_CONVEX_CAST
+		btSubsimplexConvexCast convexCaster(castShape,convexShape,&simplexSolver);
+#else
+		//btGjkConvexCast	convexCaster(castShape,convexShape,&simplexSolver);
+		//btContinuousConvexCollision convexCaster(castShape,convexShape,&simplexSolver,0);
+#endif //#USE_SUBSIMPLEX_CONVEX_CAST
+
+		if (convexCaster.calcTimeOfImpact(rayFromTrans,rayToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
+		{
+			//add hit
+			if (castResult.m_normal.length2() > btScalar(0.0001))
+			{
+				if (castResult.m_fraction < resultCallback.m_closestHitFraction)
+				{
+#ifdef USE_SUBSIMPLEX_CONVEX_CAST
+					//rotate normal into worldspace
+					castResult.m_normal = rayFromTrans.getBasis() * castResult.m_normal;
+#endif //USE_SUBSIMPLEX_CONVEX_CAST
+
+					castResult.m_normal.normalize();
+					btCollisionWorld::LocalRayResult localRayResult
+						(
+						collisionObject,
+						0,
+						castResult.m_normal,
+						castResult.m_fraction
+						);
+
+					bool normalInWorldSpace = true;
+					resultCallback.addSingleResult(localRayResult, normalInWorldSpace);
+
+				}
+			}
+		}
+	} else {
+		if (collisionShape->isConcave())
+		{
+			//			BT_PROFILE("rayTestConcave");
+			if (collisionShape->getShapeType()==TRIANGLE_MESH_SHAPE_PROXYTYPE)
+			{
+				///optimized version for btBvhTriangleMeshShape
+				btBvhTriangleMeshShape* triangleMesh = (btBvhTriangleMeshShape*)collisionShape;
+				btTransform worldTocollisionObject = colObjWorldTransform.inverse();
+				btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin();
+				btVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin();
+
+				//ConvexCast::CastResult
+				struct BridgeTriangleRaycastCallback : public btTriangleRaycastCallback
+				{
+					btCollisionWorld::RayResultCallback* m_resultCallback;
+					btCollisionObject*	m_collisionObject;
+					btTriangleMeshShape*	m_triangleMesh;
+
+					btTransform m_colObjWorldTransform;
+
+					BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
+						btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape*	triangleMesh,const btTransform& colObjWorldTransform):
+					//@BP Mod
+					btTriangleRaycastCallback(from,to, resultCallback->m_flags),
+						m_resultCallback(resultCallback),
+						m_collisionObject(collisionObject),
+						m_triangleMesh(triangleMesh),
+						m_colObjWorldTransform(colObjWorldTransform)
+					{
+					}
+
+
+					virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex )
+					{
+						btCollisionWorld::LocalShapeInfo	shapeInfo;
+						shapeInfo.m_shapePart = partId;
+						shapeInfo.m_triangleIndex = triangleIndex;
+
+						btVector3 hitNormalWorld = m_colObjWorldTransform.getBasis() * hitNormalLocal;
+
+						btCollisionWorld::LocalRayResult rayResult
+							(m_collisionObject,
+							&shapeInfo,
+							hitNormalWorld,
+							hitFraction);
+
+						bool	normalInWorldSpace = true;
+						return m_resultCallback->addSingleResult(rayResult,normalInWorldSpace);
+					}
+
+				};
+
+				BridgeTriangleRaycastCallback rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,triangleMesh,colObjWorldTransform);
+				rcb.m_hitFraction = resultCallback.m_closestHitFraction;
+				triangleMesh->performRaycast(&rcb,rayFromLocal,rayToLocal);
+			} else
+			{
+				//generic (slower) case
+				btConcaveShape* concaveShape = (btConcaveShape*)collisionShape;
+
+				btTransform worldTocollisionObject = colObjWorldTransform.inverse();
+
+				btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin();
+				btVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin();
+
+				//ConvexCast::CastResult
+
+				struct BridgeTriangleRaycastCallback : public btTriangleRaycastCallback
+				{
+					btCollisionWorld::RayResultCallback* m_resultCallback;
+					btCollisionObject*	m_collisionObject;
+					btConcaveShape*	m_triangleMesh;
+
+					btTransform m_colObjWorldTransform;
+
+					BridgeTriangleRaycastCallback( const btVector3& from,const btVector3& to,
+						btCollisionWorld::RayResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape*	triangleMesh, const btTransform& colObjWorldTransform):
+					//@BP Mod
+					btTriangleRaycastCallback(from,to, resultCallback->m_flags),
+						m_resultCallback(resultCallback),
+						m_collisionObject(collisionObject),
+						m_triangleMesh(triangleMesh),
+						m_colObjWorldTransform(colObjWorldTransform)
+					{
+					}
+
+
+					virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex )
+					{
+						btCollisionWorld::LocalShapeInfo	shapeInfo;
+						shapeInfo.m_shapePart = partId;
+						shapeInfo.m_triangleIndex = triangleIndex;
+
+						btVector3 hitNormalWorld = m_colObjWorldTransform.getBasis() * hitNormalLocal;
+
+						btCollisionWorld::LocalRayResult rayResult
+							(m_collisionObject,
+							&shapeInfo,
+							hitNormalWorld,
+							hitFraction);
+
+						bool	normalInWorldSpace = true;
+						return m_resultCallback->addSingleResult(rayResult,normalInWorldSpace);
+					}
+
+				};
+
+
+				BridgeTriangleRaycastCallback	rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,concaveShape, colObjWorldTransform);
+				rcb.m_hitFraction = resultCallback.m_closestHitFraction;
+
+				btVector3 rayAabbMinLocal = rayFromLocal;
+				rayAabbMinLocal.setMin(rayToLocal);
+				btVector3 rayAabbMaxLocal = rayFromLocal;
+				rayAabbMaxLocal.setMax(rayToLocal);
+
+				concaveShape->processAllTriangles(&rcb,rayAabbMinLocal,rayAabbMaxLocal);
+			}
+		} else {
+			//			BT_PROFILE("rayTestCompound");
+			if (collisionShape->isCompound())
+			{
+				struct LocalInfoAdder2 : public RayResultCallback
+				{
+					RayResultCallback* m_userCallback;
+					int m_i;
+					
+					LocalInfoAdder2 (int i, RayResultCallback *user)
+						: m_userCallback(user), m_i(i)
+					{ 
+						m_closestHitFraction = m_userCallback->m_closestHitFraction;
+					}
+					virtual bool needsCollision(btBroadphaseProxy* p) const
+					{
+						return m_userCallback->needsCollision(p);
+					}
+
+					virtual btScalar addSingleResult (btCollisionWorld::LocalRayResult &r, bool b)
+					{
+						btCollisionWorld::LocalShapeInfo shapeInfo;
+						shapeInfo.m_shapePart = -1;
+						shapeInfo.m_triangleIndex = m_i;
+						if (r.m_localShapeInfo == NULL)
+							r.m_localShapeInfo = &shapeInfo;
+
+						const btScalar result = m_userCallback->addSingleResult(r, b);
+						m_closestHitFraction = m_userCallback->m_closestHitFraction;
+						return result;
+					}
+				};
+				
+				struct RayTester : btDbvt::ICollide
+				{
+					btCollisionObject* m_collisionObject;
+					const btCompoundShape* m_compoundShape;
+					const btTransform& m_colObjWorldTransform;
+					const btTransform& m_rayFromTrans;
+					const btTransform& m_rayToTrans;
+					RayResultCallback& m_resultCallback;
+					
+					RayTester(btCollisionObject* collisionObject,
+							const btCompoundShape* compoundShape,
+							const btTransform& colObjWorldTransform,
+							const btTransform& rayFromTrans,
+							const btTransform& rayToTrans,
+							RayResultCallback& resultCallback):
+						m_collisionObject(collisionObject),
+						m_compoundShape(compoundShape),
+						m_colObjWorldTransform(colObjWorldTransform),
+						m_rayFromTrans(rayFromTrans),
+						m_rayToTrans(rayToTrans),
+						m_resultCallback(resultCallback)
+					{
+						
+					}
+					
+					void Process(int i)
+					{
+						const btCollisionShape* childCollisionShape = m_compoundShape->getChildShape(i);
+						const btTransform& childTrans = m_compoundShape->getChildTransform(i);
+						btTransform childWorldTrans = m_colObjWorldTransform * childTrans;
+						
+						// replace collision shape so that callback can determine the triangle
+						btCollisionShape* saveCollisionShape = m_collisionObject->getCollisionShape();
+						m_collisionObject->internalSetTemporaryCollisionShape((btCollisionShape*)childCollisionShape);
+
+						LocalInfoAdder2 my_cb(i, &m_resultCallback);
+
+						rayTestSingle(
+							m_rayFromTrans,
+							m_rayToTrans,
+							m_collisionObject,
+							childCollisionShape,
+							childWorldTrans,
+							my_cb);
+						
+						// restore
+						m_collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
+					}
+					
+					void Process(const btDbvtNode* leaf)
+					{
+						Process(leaf->dataAsInt);
+					}
+				};
+				
+				const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(collisionShape);
+				const btDbvt* dbvt = compoundShape->getDynamicAabbTree();
+
+
+				RayTester rayCB(
+					collisionObject,
+					compoundShape,
+					colObjWorldTransform,
+					rayFromTrans,
+					rayToTrans,
+					resultCallback);
+#ifndef	DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
+				if (dbvt)
+				{
+					btVector3 localRayFrom = colObjWorldTransform.inverseTimes(rayFromTrans).getOrigin();
+					btVector3 localRayTo = colObjWorldTransform.inverseTimes(rayToTrans).getOrigin();
+					btDbvt::rayTest(dbvt->m_root, localRayFrom , localRayTo, rayCB);
+				}
+				else
+#endif //DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION
+				{
+					for (int i = 0, n = compoundShape->getNumChildShapes(); i < n; ++i)
+					{
+						rayCB.Process(i);
+					}	
+				}
+			}
+		}
+	}
+}
+
+void	btCollisionWorld::objectQuerySingle(const btConvexShape* castShape,const btTransform& convexFromTrans,const btTransform& convexToTrans,
+											btCollisionObject* collisionObject,
+											const btCollisionShape* collisionShape,
+											const btTransform& colObjWorldTransform,
+											ConvexResultCallback& resultCallback, btScalar allowedPenetration)
+{
+	if (collisionShape->isConvex())
+	{
+		//BT_PROFILE("convexSweepConvex");
+		btConvexCast::CastResult castResult;
+		castResult.m_allowedPenetration = allowedPenetration;
+		castResult.m_fraction = resultCallback.m_closestHitFraction;//btScalar(1.);//??
+
+		btConvexShape* convexShape = (btConvexShape*) collisionShape;
+		btVoronoiSimplexSolver	simplexSolver;
+		btGjkEpaPenetrationDepthSolver	gjkEpaPenetrationSolver;
+
+		btContinuousConvexCollision convexCaster1(castShape,convexShape,&simplexSolver,&gjkEpaPenetrationSolver);
+		//btGjkConvexCast convexCaster2(castShape,convexShape,&simplexSolver);
+		//btSubsimplexConvexCast convexCaster3(castShape,convexShape,&simplexSolver);
+
+		btConvexCast* castPtr = &convexCaster1;
+
+
+
+		if (castPtr->calcTimeOfImpact(convexFromTrans,convexToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
+		{
+			//add hit
+			if (castResult.m_normal.length2() > btScalar(0.0001))
+			{
+				if (castResult.m_fraction < resultCallback.m_closestHitFraction)
+				{
+					castResult.m_normal.normalize();
+					btCollisionWorld::LocalConvexResult localConvexResult
+						(
+						collisionObject,
+						0,
+						castResult.m_normal,
+						castResult.m_hitPoint,
+						castResult.m_fraction
+						);
+
+					bool normalInWorldSpace = true;
+					resultCallback.addSingleResult(localConvexResult, normalInWorldSpace);
+
+				}
+			}
+		}
+	} else {
+		if (collisionShape->isConcave())
+		{
+			if (collisionShape->getShapeType()==TRIANGLE_MESH_SHAPE_PROXYTYPE)
+			{
+				//BT_PROFILE("convexSweepbtBvhTriangleMesh");
+				btBvhTriangleMeshShape* triangleMesh = (btBvhTriangleMeshShape*)collisionShape;
+				btTransform worldTocollisionObject = colObjWorldTransform.inverse();
+				btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.getOrigin();
+				btVector3 convexToLocal = worldTocollisionObject * convexToTrans.getOrigin();
+				// rotation of box in local mesh space = MeshRotation^-1 * ConvexToRotation
+				btTransform rotationXform = btTransform(worldTocollisionObject.getBasis() * convexToTrans.getBasis());
+
+				//ConvexCast::CastResult
+				struct BridgeTriangleConvexcastCallback : public btTriangleConvexcastCallback
+				{
+					btCollisionWorld::ConvexResultCallback* m_resultCallback;
+					btCollisionObject*	m_collisionObject;
+					btTriangleMeshShape*	m_triangleMesh;
+
+					BridgeTriangleConvexcastCallback(const btConvexShape* castShape, const btTransform& from,const btTransform& to,
+						btCollisionWorld::ConvexResultCallback* resultCallback, btCollisionObject* collisionObject,btTriangleMeshShape*	triangleMesh, const btTransform& triangleToWorld):
+					btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
+						m_resultCallback(resultCallback),
+						m_collisionObject(collisionObject),
+						m_triangleMesh(triangleMesh)
+					{
+					}
+
+
+					virtual btScalar reportHit(const btVector3& hitNormalLocal, const btVector3& hitPointLocal, btScalar hitFraction, int partId, int triangleIndex )
+					{
+						btCollisionWorld::LocalShapeInfo	shapeInfo;
+						shapeInfo.m_shapePart = partId;
+						shapeInfo.m_triangleIndex = triangleIndex;
+						if (hitFraction <= m_resultCallback->m_closestHitFraction)
+						{
+
+							btCollisionWorld::LocalConvexResult convexResult
+								(m_collisionObject,
+								&shapeInfo,
+								hitNormalLocal,
+								hitPointLocal,
+								hitFraction);
+
+							bool	normalInWorldSpace = true;
+
+
+							return m_resultCallback->addSingleResult(convexResult,normalInWorldSpace);
+						}
+						return hitFraction;
+					}
+
+				};
+
+				BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans,convexToTrans,&resultCallback,collisionObject,triangleMesh, colObjWorldTransform);
+				tccb.m_hitFraction = resultCallback.m_closestHitFraction;
+				tccb.m_allowedPenetration = allowedPenetration;
+				btVector3 boxMinLocal, boxMaxLocal;
+				castShape->getAabb(rotationXform, boxMinLocal, boxMaxLocal);
+				triangleMesh->performConvexcast(&tccb,convexFromLocal,convexToLocal,boxMinLocal, boxMaxLocal);
+			} else
+			{
+				if (collisionShape->getShapeType()==STATIC_PLANE_PROXYTYPE)
+				{
+					btConvexCast::CastResult castResult;
+					castResult.m_allowedPenetration = allowedPenetration;
+					castResult.m_fraction = resultCallback.m_closestHitFraction;
+					btStaticPlaneShape* planeShape = (btStaticPlaneShape*) collisionShape;
+					btContinuousConvexCollision convexCaster1(castShape,planeShape);
+					btConvexCast* castPtr = &convexCaster1;
+
+					if (castPtr->calcTimeOfImpact(convexFromTrans,convexToTrans,colObjWorldTransform,colObjWorldTransform,castResult))
+					{
+						//add hit
+						if (castResult.m_normal.length2() > btScalar(0.0001))
+						{
+							if (castResult.m_fraction < resultCallback.m_closestHitFraction)
+							{
+								castResult.m_normal.normalize();
+								btCollisionWorld::LocalConvexResult localConvexResult
+									(
+									collisionObject,
+									0,
+									castResult.m_normal,
+									castResult.m_hitPoint,
+									castResult.m_fraction
+									);
+
+								bool normalInWorldSpace = true;
+								resultCallback.addSingleResult(localConvexResult, normalInWorldSpace);
+							}
+						}
+					}
+
+				} else
+				{
+					//BT_PROFILE("convexSweepConcave");
+					btConcaveShape* concaveShape = (btConcaveShape*)collisionShape;
+					btTransform worldTocollisionObject = colObjWorldTransform.inverse();
+					btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.getOrigin();
+					btVector3 convexToLocal = worldTocollisionObject * convexToTrans.getOrigin();
+					// rotation of box in local mesh space = MeshRotation^-1 * ConvexToRotation
+					btTransform rotationXform = btTransform(worldTocollisionObject.getBasis() * convexToTrans.getBasis());
+
+					//ConvexCast::CastResult
+					struct BridgeTriangleConvexcastCallback : public btTriangleConvexcastCallback
+					{
+						btCollisionWorld::ConvexResultCallback* m_resultCallback;
+						btCollisionObject*	m_collisionObject;
+						btConcaveShape*	m_triangleMesh;
+
+						BridgeTriangleConvexcastCallback(const btConvexShape* castShape, const btTransform& from,const btTransform& to,
+							btCollisionWorld::ConvexResultCallback* resultCallback, btCollisionObject* collisionObject,btConcaveShape*	triangleMesh, const btTransform& triangleToWorld):
+						btTriangleConvexcastCallback(castShape, from,to, triangleToWorld, triangleMesh->getMargin()),
+							m_resultCallback(resultCallback),
+							m_collisionObject(collisionObject),
+							m_triangleMesh(triangleMesh)
+						{
+						}
+
+
+						virtual btScalar reportHit(const btVector3& hitNormalLocal, const btVector3& hitPointLocal, btScalar hitFraction, int partId, int triangleIndex )
+						{
+							btCollisionWorld::LocalShapeInfo	shapeInfo;
+							shapeInfo.m_shapePart = partId;
+							shapeInfo.m_triangleIndex = triangleIndex;
+							if (hitFraction <= m_resultCallback->m_closestHitFraction)
+							{
+
+								btCollisionWorld::LocalConvexResult convexResult
+									(m_collisionObject,
+									&shapeInfo,
+									hitNormalLocal,
+									hitPointLocal,
+									hitFraction);
+
+								bool	normalInWorldSpace = false;
+
+								return m_resultCallback->addSingleResult(convexResult,normalInWorldSpace);
+							}
+							return hitFraction;
+						}
+
+					};
+
+					BridgeTriangleConvexcastCallback tccb(castShape, convexFromTrans,convexToTrans,&resultCallback,collisionObject,concaveShape, colObjWorldTransform);
+					tccb.m_hitFraction = resultCallback.m_closestHitFraction;
+					tccb.m_allowedPenetration = allowedPenetration;
+					btVector3 boxMinLocal, boxMaxLocal;
+					castShape->getAabb(rotationXform, boxMinLocal, boxMaxLocal);
+
+					btVector3 rayAabbMinLocal = convexFromLocal;
+					rayAabbMinLocal.setMin(convexToLocal);
+					btVector3 rayAabbMaxLocal = convexFromLocal;
+					rayAabbMaxLocal.setMax(convexToLocal);
+					rayAabbMinLocal += boxMinLocal;
+					rayAabbMaxLocal += boxMaxLocal;
+					concaveShape->processAllTriangles(&tccb,rayAabbMinLocal,rayAabbMaxLocal);
+				}
+			}
+		} else {
+			///@todo : use AABB tree or other BVH acceleration structure!
+			if (collisionShape->isCompound())
+			{
+				BT_PROFILE("convexSweepCompound");
+				const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(collisionShape);
+				int i=0;
+				for (i=0;i<compoundShape->getNumChildShapes();i++)
+				{
+					btTransform childTrans = compoundShape->getChildTransform(i);
+					const btCollisionShape* childCollisionShape = compoundShape->getChildShape(i);
+					btTransform childWorldTrans = colObjWorldTransform * childTrans;
+					// replace collision shape so that callback can determine the triangle
+					btCollisionShape* saveCollisionShape = collisionObject->getCollisionShape();
+					collisionObject->internalSetTemporaryCollisionShape((btCollisionShape*)childCollisionShape);
+                    struct	LocalInfoAdder : public ConvexResultCallback {
+                            ConvexResultCallback* m_userCallback;
+							int m_i;
+
+                            LocalInfoAdder (int i, ConvexResultCallback *user)
+								: m_userCallback(user), m_i(i)
+							{
+								m_closestHitFraction = m_userCallback->m_closestHitFraction;
+							}
+							virtual bool needsCollision(btBroadphaseProxy* p) const
+							{
+								return m_userCallback->needsCollision(p);
+							}
+                            virtual btScalar addSingleResult (btCollisionWorld::LocalConvexResult&	r,	bool b)
+                            {
+                                    btCollisionWorld::LocalShapeInfo	shapeInfo;
+                                    shapeInfo.m_shapePart = -1;
+                                    shapeInfo.m_triangleIndex = m_i;
+                                    if (r.m_localShapeInfo == NULL)
+                                        r.m_localShapeInfo = &shapeInfo;
+									const btScalar result = m_userCallback->addSingleResult(r, b);
+									m_closestHitFraction = m_userCallback->m_closestHitFraction;
+									return result;
+                                    
+                            }
+                    };
+
+                    LocalInfoAdder my_cb(i, &resultCallback);
+					
+
+					objectQuerySingle(castShape, convexFromTrans,convexToTrans,
+						collisionObject,
+						childCollisionShape,
+						childWorldTrans,
+						my_cb, allowedPenetration);
+					// restore
+					collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
+				}
+			}
+		}
+	}
+}
+
+
+struct btSingleRayCallback : public btBroadphaseRayCallback
+{
+
+	btVector3	m_rayFromWorld;
+	btVector3	m_rayToWorld;
+	btTransform	m_rayFromTrans;
+	btTransform	m_rayToTrans;
+	btVector3	m_hitNormal;
+
+	const btCollisionWorld*	m_world;
+	btCollisionWorld::RayResultCallback&	m_resultCallback;
+
+	btSingleRayCallback(const btVector3& rayFromWorld,const btVector3& rayToWorld,const btCollisionWorld* world,btCollisionWorld::RayResultCallback& resultCallback)
+		:m_rayFromWorld(rayFromWorld),
+		m_rayToWorld(rayToWorld),
+		m_world(world),
+		m_resultCallback(resultCallback)
+	{
+		m_rayFromTrans.setIdentity();
+		m_rayFromTrans.setOrigin(m_rayFromWorld);
+		m_rayToTrans.setIdentity();
+		m_rayToTrans.setOrigin(m_rayToWorld);
+
+		btVector3 rayDir = (rayToWorld-rayFromWorld);
+
+		rayDir.normalize ();
+		///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
+		m_rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
+		m_rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
+		m_rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
+		m_signs[0] = m_rayDirectionInverse[0] < 0.0;
+		m_signs[1] = m_rayDirectionInverse[1] < 0.0;
+		m_signs[2] = m_rayDirectionInverse[2] < 0.0;
+
+		m_lambda_max = rayDir.dot(m_rayToWorld-m_rayFromWorld);
+
+	}
+
+
+
+	virtual bool	process(const btBroadphaseProxy* proxy)
+	{
+		///terminate further ray tests, once the closestHitFraction reached zero
+		if (m_resultCallback.m_closestHitFraction == btScalar(0.f))
+			return false;
+
+		btCollisionObject*	collisionObject = (btCollisionObject*)proxy->m_clientObject;
+
+		//only perform raycast if filterMask matches
+		if(m_resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) 
+		{
+			//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
+			//btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
+#if 0
+#ifdef RECALCULATE_AABB
+			btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
+			collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax);
+#else
+			//getBroadphase()->getAabb(collisionObject->getBroadphaseHandle(),collisionObjectAabbMin,collisionObjectAabbMax);
+			const btVector3& collisionObjectAabbMin = collisionObject->getBroadphaseHandle()->m_aabbMin;
+			const btVector3& collisionObjectAabbMax = collisionObject->getBroadphaseHandle()->m_aabbMax;
+#endif
+#endif
+			//btScalar hitLambda = m_resultCallback.m_closestHitFraction;
+			//culling already done by broadphase
+			//if (btRayAabb(m_rayFromWorld,m_rayToWorld,collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,m_hitNormal))
+			{
+				m_world->rayTestSingle(m_rayFromTrans,m_rayToTrans,
+					collisionObject,
+					collisionObject->getCollisionShape(),
+					collisionObject->getWorldTransform(),
+					m_resultCallback);
+			}
+		}
+		return true;
+	}
+};
+
+void	btCollisionWorld::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const
+{
+	//BT_PROFILE("rayTest");
+	/// use the broadphase to accelerate the search for objects, based on their aabb
+	/// and for each object with ray-aabb overlap, perform an exact ray test
+	btSingleRayCallback rayCB(rayFromWorld,rayToWorld,this,resultCallback);
+
+#ifndef USE_BRUTEFORCE_RAYBROADPHASE
+	m_broadphasePairCache->rayTest(rayFromWorld,rayToWorld,rayCB);
+#else
+	for (int i=0;i<this->getNumCollisionObjects();i++)
+	{
+		rayCB.process(m_collisionObjects[i]->getBroadphaseHandle());
+	}	
+#endif //USE_BRUTEFORCE_RAYBROADPHASE
+
+}
+
+
+struct btSingleSweepCallback : public btBroadphaseRayCallback
+{
+
+	btTransform	m_convexFromTrans;
+	btTransform	m_convexToTrans;
+	btVector3	m_hitNormal;
+	const btCollisionWorld*	m_world;
+	btCollisionWorld::ConvexResultCallback&	m_resultCallback;
+	btScalar	m_allowedCcdPenetration;
+	const btConvexShape* m_castShape;
+
+
+	btSingleSweepCallback(const btConvexShape* castShape, const btTransform& convexFromTrans,const btTransform& convexToTrans,const btCollisionWorld* world,btCollisionWorld::ConvexResultCallback& resultCallback,btScalar allowedPenetration)
+		:m_convexFromTrans(convexFromTrans),
+		m_convexToTrans(convexToTrans),
+		m_world(world),
+		m_resultCallback(resultCallback),
+		m_allowedCcdPenetration(allowedPenetration),
+		m_castShape(castShape)
+	{
+		btVector3 unnormalizedRayDir = (m_convexToTrans.getOrigin()-m_convexFromTrans.getOrigin());
+		btVector3 rayDir = unnormalizedRayDir.normalized();
+		///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
+		m_rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];
+		m_rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];
+		m_rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];
+		m_signs[0] = m_rayDirectionInverse[0] < 0.0;
+		m_signs[1] = m_rayDirectionInverse[1] < 0.0;
+		m_signs[2] = m_rayDirectionInverse[2] < 0.0;
+
+		m_lambda_max = rayDir.dot(unnormalizedRayDir);
+
+	}
+
+	virtual bool	process(const btBroadphaseProxy* proxy)
+	{
+		///terminate further convex sweep tests, once the closestHitFraction reached zero
+		if (m_resultCallback.m_closestHitFraction == btScalar(0.f))
+			return false;
+
+		btCollisionObject*	collisionObject = (btCollisionObject*)proxy->m_clientObject;
+
+		//only perform raycast if filterMask matches
+		if(m_resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) {
+			//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
+			m_world->objectQuerySingle(m_castShape, m_convexFromTrans,m_convexToTrans,
+				collisionObject,
+				collisionObject->getCollisionShape(),
+				collisionObject->getWorldTransform(),
+				m_resultCallback,
+				m_allowedCcdPenetration);
+		}
+
+		return true;
+	}
+};
+
+
+
+void	btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration) const
+{
+
+	BT_PROFILE("convexSweepTest");
+	/// use the broadphase to accelerate the search for objects, based on their aabb
+	/// and for each object with ray-aabb overlap, perform an exact ray test
+	/// unfortunately the implementation for rayTest and convexSweepTest duplicated, albeit practically identical
+
+
+
+	btTransform	convexFromTrans,convexToTrans;
+	convexFromTrans = convexFromWorld;
+	convexToTrans = convexToWorld;
+	btVector3 castShapeAabbMin, castShapeAabbMax;
+	/* Compute AABB that encompasses angular movement */
+	{
+		btVector3 linVel, angVel;
+		btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel);
+		btVector3 zeroLinVel;
+		zeroLinVel.setValue(0,0,0);
+		btTransform R;
+		R.setIdentity ();
+		R.setRotation (convexFromTrans.getRotation());
+		castShape->calculateTemporalAabb (R, zeroLinVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax);
+	}
+
+#ifndef USE_BRUTEFORCE_RAYBROADPHASE
+
+	btSingleSweepCallback	convexCB(castShape,convexFromWorld,convexToWorld,this,resultCallback,allowedCcdPenetration);
+
+	m_broadphasePairCache->rayTest(convexFromTrans.getOrigin(),convexToTrans.getOrigin(),convexCB,castShapeAabbMin,castShapeAabbMax);
+
+#else
+	/// go over all objects, and if the ray intersects their aabb + cast shape aabb,
+	// do a ray-shape query using convexCaster (CCD)
+	int i;
+	for (i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject*	collisionObject= m_collisionObjects[i];
+		//only perform raycast if filterMask matches
+		if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) {
+			//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
+			btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
+			collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax);
+			AabbExpand (collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax);
+			btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing
+			btVector3 hitNormal;
+			if (btRayAabb(convexFromWorld.getOrigin(),convexToWorld.getOrigin(),collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal))
+			{
+				objectQuerySingle(castShape, convexFromTrans,convexToTrans,
+					collisionObject,
+					collisionObject->getCollisionShape(),
+					collisionObject->getWorldTransform(),
+					resultCallback,
+					allowedCcdPenetration);
+			}
+		}
+	}
+#endif //USE_BRUTEFORCE_RAYBROADPHASE
+}
+
+
+
+struct btBridgedManifoldResult : public btManifoldResult
+{
+
+	btCollisionWorld::ContactResultCallback&	m_resultCallback;
+
+	btBridgedManifoldResult( btCollisionObject* obj0,btCollisionObject* obj1,btCollisionWorld::ContactResultCallback& resultCallback )
+		:btManifoldResult(obj0,obj1),
+		m_resultCallback(resultCallback)
+	{
+	}
+
+	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
+	{
+		bool isSwapped = m_manifoldPtr->getBody0() != m_body0;
+		btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
+		btVector3 localA;
+		btVector3 localB;
+		if (isSwapped)
+		{
+			localA = m_rootTransB.invXform(pointA );
+			localB = m_rootTransA.invXform(pointInWorld);
+		} else
+		{
+			localA = m_rootTransA.invXform(pointA );
+			localB = m_rootTransB.invXform(pointInWorld);
+		}
+		
+		btManifoldPoint newPt(localA,localB,normalOnBInWorld,depth);
+		newPt.m_positionWorldOnA = pointA;
+		newPt.m_positionWorldOnB = pointInWorld;
+		
+	   //BP mod, store contact triangles.
+		if (isSwapped)
+		{
+			newPt.m_partId0 = m_partId1;
+			newPt.m_partId1 = m_partId0;
+			newPt.m_index0  = m_index1;
+			newPt.m_index1  = m_index0;
+		} else
+		{
+			newPt.m_partId0 = m_partId0;
+			newPt.m_partId1 = m_partId1;
+			newPt.m_index0  = m_index0;
+			newPt.m_index1  = m_index1;
+		}
+
+		//experimental feature info, for per-triangle material etc.
+		btCollisionObject* obj0 = isSwapped? m_body1 : m_body0;
+		btCollisionObject* obj1 = isSwapped? m_body0 : m_body1;
+		m_resultCallback.addSingleResult(newPt,obj0,newPt.m_partId0,newPt.m_index0,obj1,newPt.m_partId1,newPt.m_index1);
+
+	}
+	
+};
+
+
+
+struct btSingleContactCallback : public btBroadphaseAabbCallback
+{
+
+	btCollisionObject* m_collisionObject;
+	btCollisionWorld*	m_world;
+	btCollisionWorld::ContactResultCallback&	m_resultCallback;
+	
+	
+	btSingleContactCallback(btCollisionObject* collisionObject, btCollisionWorld* world,btCollisionWorld::ContactResultCallback& resultCallback)
+		:m_collisionObject(collisionObject),
+		m_world(world),
+		m_resultCallback(resultCallback)
+	{
+	}
+
+	virtual bool	process(const btBroadphaseProxy* proxy)
+	{
+		btCollisionObject*	collisionObject = (btCollisionObject*)proxy->m_clientObject;
+		if (collisionObject == m_collisionObject)
+			return true;
+
+		//only perform raycast if filterMask matches
+		if(m_resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) 
+		{
+			btCollisionAlgorithm* algorithm = m_world->getDispatcher()->findAlgorithm(m_collisionObject,collisionObject);
+			if (algorithm)
+			{
+				btBridgedManifoldResult contactPointResult(m_collisionObject,collisionObject, m_resultCallback);
+				//discrete collision detection query
+				algorithm->processCollision(m_collisionObject,collisionObject, m_world->getDispatchInfo(),&contactPointResult);
+
+				algorithm->~btCollisionAlgorithm();
+				m_world->getDispatcher()->freeCollisionAlgorithm(algorithm);
+			}
+		}
+		return true;
+	}
+};
+
+
+///contactTest performs a discrete collision test against all objects in the btCollisionWorld, and calls the resultCallback.
+///it reports one or more contact points for every overlapping object (including the one with deepest penetration)
+void	btCollisionWorld::contactTest( btCollisionObject* colObj, ContactResultCallback& resultCallback)
+{
+	btVector3 aabbMin,aabbMax;
+	colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(),aabbMin,aabbMax);
+	btSingleContactCallback	contactCB(colObj,this,resultCallback);
+	
+	m_broadphasePairCache->aabbTest(aabbMin,aabbMax,contactCB);
+}
+
+
+///contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected.
+///it reports one or more contact points (including the one with deepest penetration)
+void	btCollisionWorld::contactPairTest(btCollisionObject* colObjA, btCollisionObject* colObjB, ContactResultCallback& resultCallback)
+{
+	btCollisionAlgorithm* algorithm = getDispatcher()->findAlgorithm(colObjA,colObjB);
+	if (algorithm)
+	{
+		btBridgedManifoldResult contactPointResult(colObjA,colObjB, resultCallback);
+		//discrete collision detection query
+		algorithm->processCollision(colObjA,colObjB, getDispatchInfo(),&contactPointResult);
+
+		algorithm->~btCollisionAlgorithm();
+		getDispatcher()->freeCollisionAlgorithm(algorithm);
+	}
+
+}
+
+
+
+
+class DebugDrawcallback : public btTriangleCallback, public btInternalTriangleIndexCallback
+{
+	btIDebugDraw*	m_debugDrawer;
+	btVector3	m_color;
+	btTransform	m_worldTrans;
+
+public:
+
+	DebugDrawcallback(btIDebugDraw*	debugDrawer,const btTransform& worldTrans,const btVector3& color) :
+	  m_debugDrawer(debugDrawer),
+		  m_color(color),
+		  m_worldTrans(worldTrans)
+	  {
+	  }
+
+	  virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
+	  {
+		  processTriangle(triangle,partId,triangleIndex);
+	  }
+
+	  virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex)
+	  {
+		  (void)partId;
+		  (void)triangleIndex;
+
+		  btVector3 wv0,wv1,wv2;
+		  wv0 = m_worldTrans*triangle[0];
+		  wv1 = m_worldTrans*triangle[1];
+		  wv2 = m_worldTrans*triangle[2];
+		  btVector3 center = (wv0+wv1+wv2)*btScalar(1./3.);
+
+		  btVector3 normal = (wv1-wv0).cross(wv2-wv0);
+		  normal.normalize();
+		  btVector3 normalColor(1,1,0);
+		  m_debugDrawer->drawLine(center,center+normal,normalColor);
+
+
+
+		 
+		  m_debugDrawer->drawLine(wv0,wv1,m_color);
+		  m_debugDrawer->drawLine(wv1,wv2,m_color);
+		  m_debugDrawer->drawLine(wv2,wv0,m_color);
+	  }
+};
+
+
+void btCollisionWorld::debugDrawObject(const btTransform& worldTransform, const btCollisionShape* shape, const btVector3& color)
+{
+	// Draw a small simplex at the center of the object
+	getDebugDrawer()->drawTransform(worldTransform,1);
+
+	if (shape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE)
+	{
+		const btCompoundShape* compoundShape = static_cast<const btCompoundShape*>(shape);
+		for (int i=compoundShape->getNumChildShapes()-1;i>=0;i--)
+		{
+			btTransform childTrans = compoundShape->getChildTransform(i);
+			const btCollisionShape* colShape = compoundShape->getChildShape(i);
+			debugDrawObject(worldTransform*childTrans,colShape,color);
+		}
+
+	} else
+	{
+		switch (shape->getShapeType())
+		{
+
+		case BOX_SHAPE_PROXYTYPE:
+			{
+				const btBoxShape* boxShape = static_cast<const btBoxShape*>(shape);
+				btVector3 halfExtents = boxShape->getHalfExtentsWithMargin();
+				getDebugDrawer()->drawBox(-halfExtents,halfExtents,worldTransform,color);
+				break;
+			}
+
+		case SPHERE_SHAPE_PROXYTYPE:
+			{
+				const btSphereShape* sphereShape = static_cast<const btSphereShape*>(shape);
+				btScalar radius = sphereShape->getMargin();//radius doesn't include the margin, so draw with margin
+
+				getDebugDrawer()->drawSphere(radius, worldTransform, color);
+				break;
+			}
+		case MULTI_SPHERE_SHAPE_PROXYTYPE:
+			{
+				const btMultiSphereShape* multiSphereShape = static_cast<const btMultiSphereShape*>(shape);
+
+				btTransform childTransform;
+				childTransform.setIdentity();
+
+				for (int i = multiSphereShape->getSphereCount()-1; i>=0;i--)
+				{
+					childTransform.setOrigin(multiSphereShape->getSpherePosition(i));
+					getDebugDrawer()->drawSphere(multiSphereShape->getSphereRadius(i), worldTransform*childTransform, color);
+				}
+
+				break;
+			}
+		case CAPSULE_SHAPE_PROXYTYPE:
+			{
+				const btCapsuleShape* capsuleShape = static_cast<const btCapsuleShape*>(shape);
+
+				btScalar radius = capsuleShape->getRadius();
+				btScalar halfHeight = capsuleShape->getHalfHeight();
+
+				int upAxis = capsuleShape->getUpAxis();
+				getDebugDrawer()->drawCapsule(radius, halfHeight, upAxis, worldTransform, color);
+				break;
+			}
+		case CONE_SHAPE_PROXYTYPE:
+			{
+				const btConeShape* coneShape = static_cast<const btConeShape*>(shape);
+				btScalar radius = coneShape->getRadius();//+coneShape->getMargin();
+				btScalar height = coneShape->getHeight();//+coneShape->getMargin();
+
+				int upAxis= coneShape->getConeUpIndex();
+				getDebugDrawer()->drawCone(radius, height, upAxis, worldTransform, color);
+				break;
+
+			}
+		case CYLINDER_SHAPE_PROXYTYPE:
+			{
+				const btCylinderShape* cylinder = static_cast<const btCylinderShape*>(shape);
+				int upAxis = cylinder->getUpAxis();
+				btScalar radius = cylinder->getRadius();
+				btScalar halfHeight = cylinder->getHalfExtentsWithMargin()[upAxis];
+				getDebugDrawer()->drawCylinder(radius, halfHeight, upAxis, worldTransform, color);
+				break;
+			}
+
+		case STATIC_PLANE_PROXYTYPE:
+			{
+				const btStaticPlaneShape* staticPlaneShape = static_cast<const btStaticPlaneShape*>(shape);
+				btScalar planeConst = staticPlaneShape->getPlaneConstant();
+				const btVector3& planeNormal = staticPlaneShape->getPlaneNormal();
+				getDebugDrawer()->drawPlane(planeNormal, planeConst,worldTransform, color);
+				break;
+
+			}
+		default:
+			{
+
+				if (shape->isConcave())
+				{
+					btConcaveShape* concaveMesh = (btConcaveShape*) shape;
+
+					///@todo pass camera, for some culling? no -> we are not a graphics lib
+					btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+					btVector3 aabbMin(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
+
+					DebugDrawcallback drawCallback(getDebugDrawer(),worldTransform,color);
+					concaveMesh->processAllTriangles(&drawCallback,aabbMin,aabbMax);
+
+				}
+
+				if (shape->getShapeType() == CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE)
+				{
+					btConvexTriangleMeshShape* convexMesh = (btConvexTriangleMeshShape*) shape;
+					//todo: pass camera for some culling			
+					btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+					btVector3 aabbMin(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
+					//DebugDrawcallback drawCallback;
+					DebugDrawcallback drawCallback(getDebugDrawer(),worldTransform,color);
+					convexMesh->getMeshInterface()->InternalProcessAllTriangles(&drawCallback,aabbMin,aabbMax);
+				}
+
+
+				/// for polyhedral shapes
+				if (shape->isPolyhedral())
+				{
+					btPolyhedralConvexShape* polyshape = (btPolyhedralConvexShape*) shape;
+
+					int i;
+					if (polyshape->getConvexPolyhedron())
+					{
+						const btConvexPolyhedron* poly = polyshape->getConvexPolyhedron();
+						for (i=0;i<poly->m_faces.size();i++)
+						{
+							btVector3 centroid(0,0,0);
+							int numVerts = poly->m_faces[i].m_indices.size();
+							if (numVerts)
+							{
+								int lastV = poly->m_faces[i].m_indices[numVerts-1];
+								for (int v=0;v<poly->m_faces[i].m_indices.size();v++)
+								{
+									int curVert = poly->m_faces[i].m_indices[v];
+									centroid+=poly->m_vertices[curVert];
+									getDebugDrawer()->drawLine(worldTransform*poly->m_vertices[lastV],worldTransform*poly->m_vertices[curVert],color);
+									lastV = curVert;
+								}
+							}
+							centroid*= 1./btScalar(numVerts);
+
+							btVector3 normalColor(1,1,0);
+							btVector3 faceNormal(poly->m_faces[i].m_plane[0],poly->m_faces[i].m_plane[1],poly->m_faces[i].m_plane[2]);
+							getDebugDrawer()->drawLine(worldTransform*centroid,worldTransform*(centroid+faceNormal),normalColor);
+							
+							
+						}
+
+						
+					} else
+					{
+						for (i=0;i<polyshape->getNumEdges();i++)
+						{
+							btVector3 a,b;
+							polyshape->getEdge(i,a,b);
+							btVector3 wa = worldTransform * a;
+							btVector3 wb = worldTransform * b;
+							getDebugDrawer()->drawLine(wa,wb,color);
+						}
+					}
+
+
+				}
+			}
+		}
+	}
+}
+
+
+void	btCollisionWorld::debugDrawWorld()
+{
+	if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawContactPoints)
+	{
+		int numManifolds = getDispatcher()->getNumManifolds();
+		btVector3 color(0,0,0);
+		for (int i=0;i<numManifolds;i++)
+		{
+			btPersistentManifold* contactManifold = getDispatcher()->getManifoldByIndexInternal(i);
+			//btCollisionObject* obA = static_cast<btCollisionObject*>(contactManifold->getBody0());
+			//btCollisionObject* obB = static_cast<btCollisionObject*>(contactManifold->getBody1());
+
+			int numContacts = contactManifold->getNumContacts();
+			for (int j=0;j<numContacts;j++)
+			{
+				btManifoldPoint& cp = contactManifold->getContactPoint(j);
+				getDebugDrawer()->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color);
+			}
+		}
+	}
+
+	if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb))
+	{
+		int i;
+
+		for (  i=0;i<m_collisionObjects.size();i++)
+		{
+			btCollisionObject* colObj = m_collisionObjects[i];
+			if ((colObj->getCollisionFlags() & btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT)==0)
+			{
+				if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe)
+				{
+					btVector3 color(btScalar(1.),btScalar(1.),btScalar(1.));
+					switch(colObj->getActivationState())
+					{
+					case  ACTIVE_TAG:
+						color = btVector3(btScalar(1.),btScalar(1.),btScalar(1.)); break;
+					case ISLAND_SLEEPING:
+						color =  btVector3(btScalar(0.),btScalar(1.),btScalar(0.));break;
+					case WANTS_DEACTIVATION:
+						color = btVector3(btScalar(0.),btScalar(1.),btScalar(1.));break;
+					case DISABLE_DEACTIVATION:
+						color = btVector3(btScalar(1.),btScalar(0.),btScalar(0.));break;
+					case DISABLE_SIMULATION:
+						color = btVector3(btScalar(1.),btScalar(1.),btScalar(0.));break;
+					default:
+						{
+							color = btVector3(btScalar(1),btScalar(0.),btScalar(0.));
+						}
+					};
+
+					debugDrawObject(colObj->getWorldTransform(),colObj->getCollisionShape(),color);
+				}
+				if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
+				{
+					btVector3 minAabb,maxAabb;
+					btVector3 colorvec(1,0,0);
+					colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
+					btVector3 contactThreshold(gContactBreakingThreshold,gContactBreakingThreshold,gContactBreakingThreshold);
+					minAabb -= contactThreshold;
+					maxAabb += contactThreshold;
+
+					btVector3 minAabb2,maxAabb2;
+
+					if(colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
+					{
+						colObj->getCollisionShape()->getAabb(colObj->getInterpolationWorldTransform(),minAabb2,maxAabb2);
+						minAabb2 -= contactThreshold;
+						maxAabb2 += contactThreshold;
+						minAabb.setMin(minAabb2);
+						maxAabb.setMax(maxAabb2);
+					}
+
+					m_debugDrawer->drawAabb(minAabb,maxAabb,colorvec);
+				}
+			}
+
+		}
+	}
+}
+
+
+void	btCollisionWorld::serializeCollisionObjects(btSerializer* serializer)
+{
+	int i;
+	//serialize all collision objects
+	for (i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		if (colObj->getInternalType() == btCollisionObject::CO_COLLISION_OBJECT)
+		{
+			colObj->serializeSingleObject(serializer);
+		}
+	}
+
+	///keep track of shapes already serialized
+	btHashMap<btHashPtr,btCollisionShape*>	serializedShapes;
+
+	for (i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		btCollisionShape* shape = colObj->getCollisionShape();
+
+		if (!serializedShapes.find(shape))
+		{
+			serializedShapes.insert(shape,shape);
+			shape->serializeSingleShape(serializer);
+		}
+	}
+
+}
+
+
+void	btCollisionWorld::serialize(btSerializer* serializer)
+{
+
+	serializer->startSerialization();
+	
+	serializeCollisionObjects(serializer);
+	
+	serializer->finishSerialization();
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
new file mode 100644
index 0000000..0a92d2d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
@@ -0,0 +1,509 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://bulletphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+/**
+ * @mainpage Bullet Documentation
+ *
+ * @section intro_sec Introduction
+ * Bullet Collision Detection & Physics SDK
+ *
+ * Bullet is a Collision Detection and Rigid Body Dynamics Library. The Library is Open Source and free for commercial use, under the ZLib license ( http://opensource.org/licenses/zlib-license.php ).
+ *
+ * The main documentation is Bullet_User_Manual.pdf, included in the source code distribution.
+ * There is the Physics Forum for feedback and general Collision Detection and Physics discussions.
+ * Please visit http://www.bulletphysics.com
+ *
+ * @section install_sec Installation
+ *
+ * @subsection step1 Step 1: Download
+ * You can download the Bullet Physics Library from the Google Code repository: http://code.google.com/p/bullet/downloads/list
+ *
+ * @subsection step2 Step 2: Building
+ * Bullet main build system for all platforms is cmake, you can download http://www.cmake.org
+ * cmake can autogenerate projectfiles for Microsoft Visual Studio, Apple Xcode, KDevelop and Unix Makefiles.
+ * The easiest is to run the CMake cmake-gui graphical user interface and choose the options and generate projectfiles.
+ * You can also use cmake in the command-line. Here are some examples for various platforms:
+ * cmake . -G "Visual Studio 9 2008"
+ * cmake . -G Xcode
+ * cmake . -G "Unix Makefiles"
+ * Although cmake is recommended, you can also use autotools for UNIX: ./autogen.sh ./configure to create a Makefile and then run make.
+ * 
+ * @subsection step3 Step 3: Testing demos
+ * Try to run and experiment with BasicDemo executable as a starting point.
+ * Bullet can be used in several ways, as Full Rigid Body simulation, as Collision Detector Library or Low Level / Snippets like the GJK Closest Point calculation.
+ * The Dependencies can be seen in this documentation under Directories
+ * 
+ * @subsection step4 Step 4: Integrating in your application, full Rigid Body and Soft Body simulation
+ * Check out BasicDemo how to create a btDynamicsWorld, btRigidBody and btCollisionShape, Stepping the simulation and synchronizing your graphics object transform.
+ * Check out SoftDemo how to use soft body dynamics, using btSoftRigidDynamicsWorld.
+ * @subsection step5 Step 5 : Integrate the Collision Detection Library (without Dynamics and other Extras)
+ * Bullet Collision Detection can also be used without the Dynamics/Extras.
+ * Check out btCollisionWorld and btCollisionObject, and the CollisionInterfaceDemo.
+ * @subsection step6 Step 6 : Use Snippets like the GJK Closest Point calculation.
+ * Bullet has been designed in a modular way keeping dependencies to a minimum. The ConvexHullDistance demo demonstrates direct use of btGjkPairDetector.
+ *
+ * @section copyright Copyright
+ * For up-to-data information and copyright and contributors list check out the Bullet_User_Manual.pdf
+ * 
+ */
+ 
+ 
+
+#ifndef BT_COLLISION_WORLD_H
+#define BT_COLLISION_WORLD_H
+
+class btStackAlloc;
+class btCollisionShape;
+class btConvexShape;
+class btBroadphaseInterface;
+class btSerializer;
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+#include "btCollisionObject.h"
+#include "btCollisionDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+///CollisionWorld is interface and container for the collision detection
+class btCollisionWorld
+{
+
+	
+protected:
+
+	btAlignedObjectArray<btCollisionObject*>	m_collisionObjects;
+	
+	btDispatcher*	m_dispatcher1;
+
+	btDispatcherInfo	m_dispatchInfo;
+
+	btStackAlloc*	m_stackAlloc;
+
+	btBroadphaseInterface*	m_broadphasePairCache;
+
+	btIDebugDraw*	m_debugDrawer;
+
+	///m_forceUpdateAllAabbs can be set to false as an optimization to only update active object AABBs
+	///it is true by default, because it is error-prone (setting the position of static objects wouldn't update their AABB)
+	bool m_forceUpdateAllAabbs;
+
+	void	serializeCollisionObjects(btSerializer* serializer);
+
+public:
+
+	//this constructor doesn't own the dispatcher and paircache/broadphase
+	btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphasePairCache, btCollisionConfiguration* collisionConfiguration);
+
+	virtual ~btCollisionWorld();
+
+	void	setBroadphase(btBroadphaseInterface*	pairCache)
+	{
+		m_broadphasePairCache = pairCache;
+	}
+
+	const btBroadphaseInterface*	getBroadphase() const
+	{
+		return m_broadphasePairCache;
+	}
+
+	btBroadphaseInterface*	getBroadphase()
+	{
+		return m_broadphasePairCache;
+	}
+
+	btOverlappingPairCache*	getPairCache()
+	{
+		return m_broadphasePairCache->getOverlappingPairCache();
+	}
+
+
+	btDispatcher*	getDispatcher()
+	{
+		return m_dispatcher1;
+	}
+
+	const btDispatcher*	getDispatcher() const
+	{
+		return m_dispatcher1;
+	}
+
+	void	updateSingleAabb(btCollisionObject* colObj);
+
+	virtual void	updateAabbs();
+	
+	virtual void	setDebugDrawer(btIDebugDraw*	debugDrawer)
+	{
+			m_debugDrawer = debugDrawer;
+	}
+
+	virtual btIDebugDraw*	getDebugDrawer()
+	{
+		return m_debugDrawer;
+	}
+
+	virtual void	debugDrawWorld();
+
+	virtual void debugDrawObject(const btTransform& worldTransform, const btCollisionShape* shape, const btVector3& color);
+
+
+	///LocalShapeInfo gives extra information for complex shapes
+	///Currently, only btTriangleMeshShape is available, so it just contains triangleIndex and subpart
+	struct	LocalShapeInfo
+	{
+		int	m_shapePart;
+		int	m_triangleIndex;
+		
+		//const btCollisionShape*	m_shapeTemp;
+		//const btTransform*	m_shapeLocalTransform;
+	};
+
+	struct	LocalRayResult
+	{
+		LocalRayResult(btCollisionObject*	collisionObject, 
+			LocalShapeInfo*	localShapeInfo,
+			const btVector3&		hitNormalLocal,
+			btScalar hitFraction)
+		:m_collisionObject(collisionObject),
+		m_localShapeInfo(localShapeInfo),
+		m_hitNormalLocal(hitNormalLocal),
+		m_hitFraction(hitFraction)
+		{
+		}
+
+		btCollisionObject*		m_collisionObject;
+		LocalShapeInfo*			m_localShapeInfo;
+		btVector3				m_hitNormalLocal;
+		btScalar				m_hitFraction;
+
+	};
+
+	///RayResultCallback is used to report new raycast results
+	struct	RayResultCallback
+	{
+		btScalar	m_closestHitFraction;
+		btCollisionObject*		m_collisionObject;
+		short int	m_collisionFilterGroup;
+		short int	m_collisionFilterMask;
+      //@BP Mod - Custom flags, currently used to enable backface culling on tri-meshes, see btRaycastCallback
+      unsigned int m_flags;
+
+		virtual ~RayResultCallback()
+		{
+		}
+		bool	hasHit() const
+		{
+			return (m_collisionObject != 0);
+		}
+
+		RayResultCallback()
+			:m_closestHitFraction(btScalar(1.)),
+			m_collisionObject(0),
+			m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),
+			m_collisionFilterMask(btBroadphaseProxy::AllFilter),
+         //@BP Mod
+         m_flags(0)
+		{
+		}
+
+		virtual bool needsCollision(btBroadphaseProxy* proxy0) const
+		{
+			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;
+			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);
+			return collides;
+		}
+
+
+		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace) = 0;
+	};
+
+	struct	ClosestRayResultCallback : public RayResultCallback
+	{
+		ClosestRayResultCallback(const btVector3&	rayFromWorld,const btVector3&	rayToWorld)
+		:m_rayFromWorld(rayFromWorld),
+		m_rayToWorld(rayToWorld)
+		{
+		}
+
+		btVector3	m_rayFromWorld;//used to calculate hitPointWorld from hitFraction
+		btVector3	m_rayToWorld;
+
+		btVector3	m_hitNormalWorld;
+		btVector3	m_hitPointWorld;
+			
+		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace)
+		{
+			//caller already does the filter on the m_closestHitFraction
+			btAssert(rayResult.m_hitFraction <= m_closestHitFraction);
+			
+			m_closestHitFraction = rayResult.m_hitFraction;
+			m_collisionObject = rayResult.m_collisionObject;
+			if (normalInWorldSpace)
+			{
+				m_hitNormalWorld = rayResult.m_hitNormalLocal;
+			} else
+			{
+				///need to transform normal into worldspace
+				m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
+			}
+			m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
+			return rayResult.m_hitFraction;
+		}
+	};
+
+	struct	AllHitsRayResultCallback : public RayResultCallback
+	{
+		AllHitsRayResultCallback(const btVector3&	rayFromWorld,const btVector3&	rayToWorld)
+		:m_rayFromWorld(rayFromWorld),
+		m_rayToWorld(rayToWorld)
+		{
+		}
+
+		btAlignedObjectArray<btCollisionObject*>		m_collisionObjects;
+
+		btVector3	m_rayFromWorld;//used to calculate hitPointWorld from hitFraction
+		btVector3	m_rayToWorld;
+
+		btAlignedObjectArray<btVector3>	m_hitNormalWorld;
+		btAlignedObjectArray<btVector3>	m_hitPointWorld;
+		btAlignedObjectArray<btScalar> m_hitFractions;
+			
+		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace)
+		{
+			m_collisionObject = rayResult.m_collisionObject;
+			m_collisionObjects.push_back(rayResult.m_collisionObject);
+			btVector3 hitNormalWorld;
+			if (normalInWorldSpace)
+			{
+				hitNormalWorld = rayResult.m_hitNormalLocal;
+			} else
+			{
+				///need to transform normal into worldspace
+				hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;
+			}
+			m_hitNormalWorld.push_back(hitNormalWorld);
+			btVector3 hitPointWorld;
+			hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
+			m_hitPointWorld.push_back(hitPointWorld);
+			m_hitFractions.push_back(rayResult.m_hitFraction);
+			return m_closestHitFraction;
+		}
+	};
+
+
+	struct LocalConvexResult
+	{
+		LocalConvexResult(btCollisionObject*	hitCollisionObject, 
+			LocalShapeInfo*	localShapeInfo,
+			const btVector3&		hitNormalLocal,
+			const btVector3&		hitPointLocal,
+			btScalar hitFraction
+			)
+		:m_hitCollisionObject(hitCollisionObject),
+		m_localShapeInfo(localShapeInfo),
+		m_hitNormalLocal(hitNormalLocal),
+		m_hitPointLocal(hitPointLocal),
+		m_hitFraction(hitFraction)
+		{
+		}
+
+		btCollisionObject*		m_hitCollisionObject;
+		LocalShapeInfo*			m_localShapeInfo;
+		btVector3				m_hitNormalLocal;
+		btVector3				m_hitPointLocal;
+		btScalar				m_hitFraction;
+	};
+
+	///RayResultCallback is used to report new raycast results
+	struct	ConvexResultCallback
+	{
+		btScalar	m_closestHitFraction;
+		short int	m_collisionFilterGroup;
+		short int	m_collisionFilterMask;
+		
+		ConvexResultCallback()
+			:m_closestHitFraction(btScalar(1.)),
+			m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),
+			m_collisionFilterMask(btBroadphaseProxy::AllFilter)
+		{
+		}
+
+		virtual ~ConvexResultCallback()
+		{
+		}
+		
+		bool	hasHit() const
+		{
+			return (m_closestHitFraction < btScalar(1.));
+		}
+
+		
+
+		virtual bool needsCollision(btBroadphaseProxy* proxy0) const
+		{
+			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;
+			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);
+			return collides;
+		}
+
+		virtual	btScalar	addSingleResult(LocalConvexResult& convexResult,bool normalInWorldSpace) = 0;
+	};
+
+	struct	ClosestConvexResultCallback : public ConvexResultCallback
+	{
+		ClosestConvexResultCallback(const btVector3&	convexFromWorld,const btVector3&	convexToWorld)
+		:m_convexFromWorld(convexFromWorld),
+		m_convexToWorld(convexToWorld),
+		m_hitCollisionObject(0)
+		{
+		}
+
+		btVector3	m_convexFromWorld;//used to calculate hitPointWorld from hitFraction
+		btVector3	m_convexToWorld;
+
+		btVector3	m_hitNormalWorld;
+		btVector3	m_hitPointWorld;
+		btCollisionObject*	m_hitCollisionObject;
+		
+		virtual	btScalar	addSingleResult(LocalConvexResult& convexResult,bool normalInWorldSpace)
+		{
+//caller already does the filter on the m_closestHitFraction
+			btAssert(convexResult.m_hitFraction <= m_closestHitFraction);
+						
+			m_closestHitFraction = convexResult.m_hitFraction;
+			m_hitCollisionObject = convexResult.m_hitCollisionObject;
+			if (normalInWorldSpace)
+			{
+				m_hitNormalWorld = convexResult.m_hitNormalLocal;
+			} else
+			{
+				///need to transform normal into worldspace
+				m_hitNormalWorld = m_hitCollisionObject->getWorldTransform().getBasis()*convexResult.m_hitNormalLocal;
+			}
+			m_hitPointWorld = convexResult.m_hitPointLocal;
+			return convexResult.m_hitFraction;
+		}
+	};
+
+	///ContactResultCallback is used to report contact points
+	struct	ContactResultCallback
+	{
+		short int	m_collisionFilterGroup;
+		short int	m_collisionFilterMask;
+		
+		ContactResultCallback()
+			:m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),
+			m_collisionFilterMask(btBroadphaseProxy::AllFilter)
+		{
+		}
+
+		virtual ~ContactResultCallback()
+		{
+		}
+		
+		virtual bool needsCollision(btBroadphaseProxy* proxy0) const
+		{
+			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;
+			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);
+			return collides;
+		}
+
+		virtual	btScalar	addSingleResult(btManifoldPoint& cp,	const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1) = 0;
+	};
+
+
+
+	int	getNumCollisionObjects() const
+	{
+		return int(m_collisionObjects.size());
+	}
+
+	/// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback
+	/// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
+	virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const; 
+
+	/// convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback
+	/// This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.
+	void    convexSweepTest (const btConvexShape* castShape, const btTransform& from, const btTransform& to, ConvexResultCallback& resultCallback,  btScalar allowedCcdPenetration = btScalar(0.)) const;
+
+	///contactTest performs a discrete collision test between colObj against all objects in the btCollisionWorld, and calls the resultCallback.
+	///it reports one or more contact points for every overlapping object (including the one with deepest penetration)
+	void	contactTest(btCollisionObject* colObj, ContactResultCallback& resultCallback);
+
+	///contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected.
+	///it reports one or more contact points (including the one with deepest penetration)
+	void	contactPairTest(btCollisionObject* colObjA, btCollisionObject* colObjB, ContactResultCallback& resultCallback);
+
+
+	/// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest.
+	/// In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape.
+	/// This allows more customization.
+	static void	rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans,
+					  btCollisionObject* collisionObject,
+					  const btCollisionShape* collisionShape,
+					  const btTransform& colObjWorldTransform,
+					  RayResultCallback& resultCallback);
+
+	/// objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest.
+	static void	objectQuerySingle(const btConvexShape* castShape, const btTransform& rayFromTrans,const btTransform& rayToTrans,
+					  btCollisionObject* collisionObject,
+					  const btCollisionShape* collisionShape,
+					  const btTransform& colObjWorldTransform,
+					  ConvexResultCallback& resultCallback, btScalar	allowedPenetration);
+
+	virtual void	addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter,short int collisionFilterMask=btBroadphaseProxy::AllFilter);
+
+	btCollisionObjectArray& getCollisionObjectArray()
+	{
+		return m_collisionObjects;
+	}
+
+	const btCollisionObjectArray& getCollisionObjectArray() const
+	{
+		return m_collisionObjects;
+	}
+
+
+	virtual void	removeCollisionObject(btCollisionObject* collisionObject);
+
+	virtual void	performDiscreteCollisionDetection();
+
+	btDispatcherInfo& getDispatchInfo()
+	{
+		return m_dispatchInfo;
+	}
+
+	const btDispatcherInfo& getDispatchInfo() const
+	{
+		return m_dispatchInfo;
+	}
+	
+	bool	getForceUpdateAllAabbs() const
+	{
+		return m_forceUpdateAllAabbs;
+	}
+	void setForceUpdateAllAabbs( bool forceUpdateAllAabbs)
+	{
+		m_forceUpdateAllAabbs = forceUpdateAllAabbs;
+	}
+
+	///Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bullet/Demos/SerializeDemo)
+	virtual	void	serialize(btSerializer* serializer);
+
+};
+
+
+#endif //BT_COLLISION_WORLD_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
new file mode 100644
index 0000000..54889a6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
@@ -0,0 +1,353 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btCompoundShape.h"
+#include "BulletCollision/BroadphaseCollision/btDbvt.h"
+#include "LinearMath/btIDebugDraw.h"
+#include "LinearMath/btAabbUtil2.h"
+#include "btManifoldResult.h"
+
+btCompoundCollisionAlgorithm::btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped)
+:btActivatingCollisionAlgorithm(ci,body0,body1),
+m_isSwapped(isSwapped),
+m_sharedManifold(ci.m_manifold)
+{
+	m_ownsManifold = false;
+
+	btCollisionObject* colObj = m_isSwapped? body1 : body0;
+	btAssert (colObj->getCollisionShape()->isCompound());
+	
+	btCompoundShape* compoundShape = static_cast<btCompoundShape*>(colObj->getCollisionShape());
+	m_compoundShapeRevision = compoundShape->getUpdateRevision();
+	
+	preallocateChildAlgorithms(body0,body1);
+}
+
+void	btCompoundCollisionAlgorithm::preallocateChildAlgorithms(btCollisionObject* body0,btCollisionObject* body1)
+{
+	btCollisionObject* colObj = m_isSwapped? body1 : body0;
+	btCollisionObject* otherObj = m_isSwapped? body0 : body1;
+	btAssert (colObj->getCollisionShape()->isCompound());
+	
+	btCompoundShape* compoundShape = static_cast<btCompoundShape*>(colObj->getCollisionShape());
+
+	int numChildren = compoundShape->getNumChildShapes();
+	int i;
+	
+	m_childCollisionAlgorithms.resize(numChildren);
+	for (i=0;i<numChildren;i++)
+	{
+		if (compoundShape->getDynamicAabbTree())
+		{
+			m_childCollisionAlgorithms[i] = 0;
+		} else
+		{
+			btCollisionShape* tmpShape = colObj->getCollisionShape();
+			btCollisionShape* childShape = compoundShape->getChildShape(i);
+			colObj->internalSetTemporaryCollisionShape( childShape );
+			m_childCollisionAlgorithms[i] = m_dispatcher->findAlgorithm(colObj,otherObj,m_sharedManifold);
+			colObj->internalSetTemporaryCollisionShape( tmpShape );
+		}
+	}
+}
+
+void	btCompoundCollisionAlgorithm::removeChildAlgorithms()
+{
+	int numChildren = m_childCollisionAlgorithms.size();
+	int i;
+	for (i=0;i<numChildren;i++)
+	{
+		if (m_childCollisionAlgorithms[i])
+		{
+			m_childCollisionAlgorithms[i]->~btCollisionAlgorithm();
+			m_dispatcher->freeCollisionAlgorithm(m_childCollisionAlgorithms[i]);
+		}
+	}
+}
+
+btCompoundCollisionAlgorithm::~btCompoundCollisionAlgorithm()
+{
+	removeChildAlgorithms();
+}
+
+
+
+
+struct	btCompoundLeafCallback : btDbvt::ICollide
+{
+
+public:
+
+	btCollisionObject* m_compoundColObj;
+	btCollisionObject* m_otherObj;
+	btDispatcher* m_dispatcher;
+	const btDispatcherInfo& m_dispatchInfo;
+	btManifoldResult*	m_resultOut;
+	btCollisionAlgorithm**	m_childCollisionAlgorithms;
+	btPersistentManifold*	m_sharedManifold;
+
+
+
+
+	btCompoundLeafCallback (btCollisionObject* compoundObj,btCollisionObject* otherObj,btDispatcher* dispatcher,const btDispatcherInfo& dispatchInfo,btManifoldResult*	resultOut,btCollisionAlgorithm**	childCollisionAlgorithms,btPersistentManifold*	sharedManifold)
+		:m_compoundColObj(compoundObj),m_otherObj(otherObj),m_dispatcher(dispatcher),m_dispatchInfo(dispatchInfo),m_resultOut(resultOut),
+		m_childCollisionAlgorithms(childCollisionAlgorithms),
+		m_sharedManifold(sharedManifold)
+	{
+
+	}
+
+
+	void	ProcessChildShape(btCollisionShape* childShape,int index)
+	{
+		btAssert(index>=0);
+		btCompoundShape* compoundShape = static_cast<btCompoundShape*>(m_compoundColObj->getCollisionShape());
+		btAssert(index<compoundShape->getNumChildShapes());
+
+
+		//backup
+		btTransform	orgTrans = m_compoundColObj->getWorldTransform();
+		btTransform	orgInterpolationTrans = m_compoundColObj->getInterpolationWorldTransform();
+		const btTransform& childTrans = compoundShape->getChildTransform(index);
+		btTransform	newChildWorldTrans = orgTrans*childTrans ;
+
+		//perform an AABB check first
+		btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;
+		childShape->getAabb(newChildWorldTrans,aabbMin0,aabbMax0);
+		m_otherObj->getCollisionShape()->getAabb(m_otherObj->getWorldTransform(),aabbMin1,aabbMax1);
+
+		if (TestAabbAgainstAabb2(aabbMin0,aabbMax0,aabbMin1,aabbMax1))
+		{
+
+			m_compoundColObj->setWorldTransform( newChildWorldTrans);
+			m_compoundColObj->setInterpolationWorldTransform(newChildWorldTrans);
+
+			//the contactpoint is still projected back using the original inverted worldtrans
+			btCollisionShape* tmpShape = m_compoundColObj->getCollisionShape();
+			m_compoundColObj->internalSetTemporaryCollisionShape( childShape );
+
+			if (!m_childCollisionAlgorithms[index])
+				m_childCollisionAlgorithms[index] = m_dispatcher->findAlgorithm(m_compoundColObj,m_otherObj,m_sharedManifold);
+
+			///detect swapping case
+			if (m_resultOut->getBody0Internal() == m_compoundColObj)
+			{
+				m_resultOut->setShapeIdentifiersA(-1,index);
+			} else
+			{
+				m_resultOut->setShapeIdentifiersB(-1,index);
+			}
+
+			m_childCollisionAlgorithms[index]->processCollision(m_compoundColObj,m_otherObj,m_dispatchInfo,m_resultOut);
+			if (m_dispatchInfo.m_debugDraw && (m_dispatchInfo.m_debugDraw->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
+			{
+				btVector3 worldAabbMin,worldAabbMax;
+				m_dispatchInfo.m_debugDraw->drawAabb(aabbMin0,aabbMax0,btVector3(1,1,1));
+				m_dispatchInfo.m_debugDraw->drawAabb(aabbMin1,aabbMax1,btVector3(1,1,1));
+			}
+			
+			//revert back transform
+			m_compoundColObj->internalSetTemporaryCollisionShape( tmpShape);
+			m_compoundColObj->setWorldTransform(  orgTrans );
+			m_compoundColObj->setInterpolationWorldTransform(orgInterpolationTrans);
+		}
+	}
+	void		Process(const btDbvtNode* leaf)
+	{
+		int index = leaf->dataAsInt;
+
+		btCompoundShape* compoundShape = static_cast<btCompoundShape*>(m_compoundColObj->getCollisionShape());
+		btCollisionShape* childShape = compoundShape->getChildShape(index);
+		if (m_dispatchInfo.m_debugDraw && (m_dispatchInfo.m_debugDraw->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
+		{
+			btVector3 worldAabbMin,worldAabbMax;
+			btTransform	orgTrans = m_compoundColObj->getWorldTransform();
+			btTransformAabb(leaf->volume.Mins(),leaf->volume.Maxs(),0.,orgTrans,worldAabbMin,worldAabbMax);
+			m_dispatchInfo.m_debugDraw->drawAabb(worldAabbMin,worldAabbMax,btVector3(1,0,0));
+		}
+		ProcessChildShape(childShape,index);
+
+	}
+};
+
+
+
+
+
+
+void btCompoundCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	btCollisionObject* colObj = m_isSwapped? body1 : body0;
+	btCollisionObject* otherObj = m_isSwapped? body0 : body1;
+
+	
+
+	btAssert (colObj->getCollisionShape()->isCompound());
+	btCompoundShape* compoundShape = static_cast<btCompoundShape*>(colObj->getCollisionShape());
+
+	///btCompoundShape might have changed:
+	////make sure the internal child collision algorithm caches are still valid
+	if (compoundShape->getUpdateRevision() != m_compoundShapeRevision)
+	{
+		///clear and update all
+		removeChildAlgorithms();
+		
+		preallocateChildAlgorithms(body0,body1);
+	}
+
+
+	btDbvt* tree = compoundShape->getDynamicAabbTree();
+	//use a dynamic aabb tree to cull potential child-overlaps
+	btCompoundLeafCallback  callback(colObj,otherObj,m_dispatcher,dispatchInfo,resultOut,&m_childCollisionAlgorithms[0],m_sharedManifold);
+
+	///we need to refresh all contact manifolds
+	///note that we should actually recursively traverse all children, btCompoundShape can nested more then 1 level deep
+	///so we should add a 'refreshManifolds' in the btCollisionAlgorithm
+	{
+		int i;
+		btManifoldArray manifoldArray;
+		for (i=0;i<m_childCollisionAlgorithms.size();i++)
+		{
+			if (m_childCollisionAlgorithms[i])
+			{
+				m_childCollisionAlgorithms[i]->getAllContactManifolds(manifoldArray);
+				for (int m=0;m<manifoldArray.size();m++)
+				{
+					if (manifoldArray[m]->getNumContacts())
+					{
+						resultOut->setPersistentManifold(manifoldArray[m]);
+						resultOut->refreshContactPoints();
+						resultOut->setPersistentManifold(0);//??necessary?
+					}
+				}
+				manifoldArray.resize(0);
+			}
+		}
+	}
+
+	if (tree)
+	{
+
+		btVector3 localAabbMin,localAabbMax;
+		btTransform otherInCompoundSpace;
+		otherInCompoundSpace = colObj->getWorldTransform().inverse() * otherObj->getWorldTransform();
+		otherObj->getCollisionShape()->getAabb(otherInCompoundSpace,localAabbMin,localAabbMax);
+
+		const ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
+		//process all children, that overlap with  the given AABB bounds
+		tree->collideTV(tree->m_root,bounds,callback);
+
+	} else
+	{
+		//iterate over all children, perform an AABB check inside ProcessChildShape
+		int numChildren = m_childCollisionAlgorithms.size();
+		int i;
+		for (i=0;i<numChildren;i++)
+		{
+			callback.ProcessChildShape(compoundShape->getChildShape(i),i);
+		}
+	}
+
+	{
+				//iterate over all children, perform an AABB check inside ProcessChildShape
+		int numChildren = m_childCollisionAlgorithms.size();
+		int i;
+		btManifoldArray	manifoldArray;
+        btCollisionShape* childShape = 0;
+        btTransform	orgTrans;
+        btTransform	orgInterpolationTrans;
+        btTransform	newChildWorldTrans;
+        btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;        
+        
+		for (i=0;i<numChildren;i++)
+		{
+			if (m_childCollisionAlgorithms[i])
+			{
+				childShape = compoundShape->getChildShape(i);
+			//if not longer overlapping, remove the algorithm
+                orgTrans = colObj->getWorldTransform();
+                orgInterpolationTrans = colObj->getInterpolationWorldTransform();
+				const btTransform& childTrans = compoundShape->getChildTransform(i);
+                newChildWorldTrans = orgTrans*childTrans ;
+
+				//perform an AABB check first
+				childShape->getAabb(newChildWorldTrans,aabbMin0,aabbMax0);
+				otherObj->getCollisionShape()->getAabb(otherObj->getWorldTransform(),aabbMin1,aabbMax1);
+
+				if (!TestAabbAgainstAabb2(aabbMin0,aabbMax0,aabbMin1,aabbMax1))
+				{
+					m_childCollisionAlgorithms[i]->~btCollisionAlgorithm();
+					m_dispatcher->freeCollisionAlgorithm(m_childCollisionAlgorithms[i]);
+					m_childCollisionAlgorithms[i] = 0;
+				}
+			}
+		}
+	}
+}
+
+btScalar	btCompoundCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+
+	btCollisionObject* colObj = m_isSwapped? body1 : body0;
+	btCollisionObject* otherObj = m_isSwapped? body0 : body1;
+
+	btAssert (colObj->getCollisionShape()->isCompound());
+	
+	btCompoundShape* compoundShape = static_cast<btCompoundShape*>(colObj->getCollisionShape());
+
+	//We will use the OptimizedBVH, AABB tree to cull potential child-overlaps
+	//If both proxies are Compound, we will deal with that directly, by performing sequential/parallel tree traversals
+	//given Proxy0 and Proxy1, if both have a tree, Tree0 and Tree1, this means:
+	//determine overlapping nodes of Proxy1 using Proxy0 AABB against Tree1
+	//then use each overlapping node AABB against Tree0
+	//and vise versa.
+
+	btScalar hitFraction = btScalar(1.);
+
+	int numChildren = m_childCollisionAlgorithms.size();
+	int i;
+    btTransform	orgTrans;
+    btScalar frac;
+	for (i=0;i<numChildren;i++)
+	{
+		//temporarily exchange parent btCollisionShape with childShape, and recurse
+		btCollisionShape* childShape = compoundShape->getChildShape(i);
+
+		//backup
+        orgTrans = colObj->getWorldTransform();
+	
+		const btTransform& childTrans = compoundShape->getChildTransform(i);
+		//btTransform	newChildWorldTrans = orgTrans*childTrans ;
+		colObj->setWorldTransform( orgTrans*childTrans );
+
+		btCollisionShape* tmpShape = colObj->getCollisionShape();
+		colObj->internalSetTemporaryCollisionShape( childShape );
+        frac = m_childCollisionAlgorithms[i]->calculateTimeOfImpact(colObj,otherObj,dispatchInfo,resultOut);
+		if (frac<hitFraction)
+		{
+			hitFraction = frac;
+		}
+		//revert back
+		colObj->internalSetTemporaryCollisionShape( tmpShape);
+		colObj->setWorldTransform( orgTrans);
+	}
+	return hitFraction;
+
+}
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
new file mode 100644
index 0000000..4045749
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
@@ -0,0 +1,86 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COMPOUND_COLLISION_ALGORITHM_H
+#define BT_COMPOUND_COLLISION_ALGORITHM_H
+
+#include "btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
+
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+class btDispatcher;
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "btCollisionCreateFunc.h"
+#include "LinearMath/btAlignedObjectArray.h"
+class btDispatcher;
+class btCollisionObject;
+
+/// btCompoundCollisionAlgorithm  supports collision between CompoundCollisionShapes and other collision shapes
+class btCompoundCollisionAlgorithm  : public btActivatingCollisionAlgorithm
+{
+	btAlignedObjectArray<btCollisionAlgorithm*> m_childCollisionAlgorithms;
+	bool m_isSwapped;
+
+	class btPersistentManifold*	m_sharedManifold;
+	bool					m_ownsManifold;
+
+	int	m_compoundShapeRevision;//to keep track of changes, so that childAlgorithm array can be updated
+	
+	void	removeChildAlgorithms();
+	
+	void	preallocateChildAlgorithms(btCollisionObject* body0,btCollisionObject* body1);
+
+public:
+
+	btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);
+
+	virtual ~btCompoundCollisionAlgorithm();
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		int i;
+		for (i=0;i<m_childCollisionAlgorithms.size();i++)
+		{
+			if (m_childCollisionAlgorithms[i])
+				m_childCollisionAlgorithms[i]->getAllContactManifolds(manifoldArray);
+		}
+	}
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm));
+			return new(mem) btCompoundCollisionAlgorithm(ci,body0,body1,false);
+		}
+	};
+
+	struct SwappedCreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm));
+			return new(mem) btCompoundCollisionAlgorithm(ci,body0,body1,true);
+		}
+	};
+
+};
+
+#endif //BT_COMPOUND_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
new file mode 100644
index 0000000..db7f884
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
@@ -0,0 +1,247 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConvex2dConvex2dAlgorithm.h"
+
+//#include <stdio.h>
+#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
+
+
+#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
+
+#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
+#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
+
+
+
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+
+#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
+
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
+
+
+btConvex2dConvex2dAlgorithm::CreateFunc::CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver)
+{
+	m_numPerturbationIterations = 0;
+	m_minimumPointsPerturbationThreshold = 3;
+	m_simplexSolver = simplexSolver;
+	m_pdSolver = pdSolver;
+}
+
+btConvex2dConvex2dAlgorithm::CreateFunc::~CreateFunc() 
+{ 
+}
+
+btConvex2dConvex2dAlgorithm::btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver,int numPerturbationIterations, int minimumPointsPerturbationThreshold)
+: btActivatingCollisionAlgorithm(ci,body0,body1),
+m_simplexSolver(simplexSolver),
+m_pdSolver(pdSolver),
+m_ownManifold (false),
+m_manifoldPtr(mf),
+m_lowLevelOfDetail(false),
+ m_numPerturbationIterations(numPerturbationIterations),
+m_minimumPointsPerturbationThreshold(minimumPointsPerturbationThreshold)
+{
+	(void)body0;
+	(void)body1;
+}
+
+
+
+
+btConvex2dConvex2dAlgorithm::~btConvex2dConvex2dAlgorithm()
+{
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+	}
+}
+
+void	btConvex2dConvex2dAlgorithm ::setLowLevelOfDetail(bool useLowLevel)
+{
+	m_lowLevelOfDetail = useLowLevel;
+}
+
+
+
+extern btScalar gContactBreakingThreshold;
+
+
+//
+// Convex-Convex collision algorithm
+//
+void btConvex2dConvex2dAlgorithm ::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+
+	if (!m_manifoldPtr)
+	{
+		//swapped?
+		m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1);
+		m_ownManifold = true;
+	}
+	resultOut->setPersistentManifold(m_manifoldPtr);
+
+	//comment-out next line to test multi-contact generation
+	//resultOut->getPersistentManifold()->clearManifold();
+
+
+	btConvexShape* min0 = static_cast<btConvexShape*>(body0->getCollisionShape());
+	btConvexShape* min1 = static_cast<btConvexShape*>(body1->getCollisionShape());
+
+	btVector3  normalOnB;
+	btVector3  pointOnBWorld;
+
+	{
+
+
+		btGjkPairDetector::ClosestPointInput input;
+
+		btGjkPairDetector	gjkPairDetector(min0,min1,m_simplexSolver,m_pdSolver);
+		//TODO: if (dispatchInfo.m_useContinuous)
+		gjkPairDetector.setMinkowskiA(min0);
+		gjkPairDetector.setMinkowskiB(min1);
+
+		{
+			input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold();
+			input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared;
+		}
+
+		input.m_stackAlloc = dispatchInfo.m_stackAllocator;
+		input.m_transformA = body0->getWorldTransform();
+		input.m_transformB = body1->getWorldTransform();
+
+		gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
+
+		btVector3 v0,v1;
+		btVector3 sepNormalWorldSpace;
+
+	}
+
+	if (m_ownManifold)
+	{
+		resultOut->refreshContactPoints();
+	}
+
+}
+
+
+
+
+btScalar	btConvex2dConvex2dAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)resultOut;
+	(void)dispatchInfo;
+	///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold
+
+	///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold
+	///col0->m_worldTransform,
+	btScalar resultFraction = btScalar(1.);
+
+
+	btScalar squareMot0 = (col0->getInterpolationWorldTransform().getOrigin() - col0->getWorldTransform().getOrigin()).length2();
+	btScalar squareMot1 = (col1->getInterpolationWorldTransform().getOrigin() - col1->getWorldTransform().getOrigin()).length2();
+
+	if (squareMot0 < col0->getCcdSquareMotionThreshold() &&
+		squareMot1 < col1->getCcdSquareMotionThreshold())
+		return resultFraction;
+
+
+	//An adhoc way of testing the Continuous Collision Detection algorithms
+	//One object is approximated as a sphere, to simplify things
+	//Starting in penetration should report no time of impact
+	//For proper CCD, better accuracy and handling of 'allowed' penetration should be added
+	//also the mainloop of the physics should have a kind of toi queue (something like Brian Mirtich's application of Timewarp for Rigidbodies)
+
+
+	/// Convex0 against sphere for Convex1
+	{
+		btConvexShape* convex0 = static_cast<btConvexShape*>(col0->getCollisionShape());
+
+		btSphereShape	sphere1(col1->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation
+		btConvexCast::CastResult result;
+		btVoronoiSimplexSolver voronoiSimplex;
+		//SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
+		///Simplification, one object is simplified as a sphere
+		btGjkConvexCast ccd1( convex0 ,&sphere1,&voronoiSimplex);
+		//ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
+		if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(),
+			col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result))
+		{
+
+			//store result.m_fraction in both bodies
+
+			if (col0->getHitFraction()> result.m_fraction)
+				col0->setHitFraction( result.m_fraction );
+
+			if (col1->getHitFraction() > result.m_fraction)
+				col1->setHitFraction( result.m_fraction);
+
+			if (resultFraction > result.m_fraction)
+				resultFraction = result.m_fraction;
+
+		}
+
+
+
+
+	}
+
+	/// Sphere (for convex0) against Convex1
+	{
+		btConvexShape* convex1 = static_cast<btConvexShape*>(col1->getCollisionShape());
+
+		btSphereShape	sphere0(col0->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation
+		btConvexCast::CastResult result;
+		btVoronoiSimplexSolver voronoiSimplex;
+		//SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
+		///Simplification, one object is simplified as a sphere
+		btGjkConvexCast ccd1(&sphere0,convex1,&voronoiSimplex);
+		//ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
+		if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(),
+			col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result))
+		{
+
+			//store result.m_fraction in both bodies
+
+			if (col0->getHitFraction()	> result.m_fraction)
+				col0->setHitFraction( result.m_fraction);
+
+			if (col1->getHitFraction() > result.m_fraction)
+				col1->setHitFraction( result.m_fraction);
+
+			if (resultFraction > result.m_fraction)
+				resultFraction = result.m_fraction;
+
+		}
+	}
+
+	return resultFraction;
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h
new file mode 100644
index 0000000..53d13b8
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h
@@ -0,0 +1,95 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
+#define BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
+
+#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "LinearMath/btTransformUtil.h" //for btConvexSeparatingDistanceUtil
+
+class btConvexPenetrationDepthSolver;
+
+
+///The convex2dConvex2dAlgorithm collision algorithm support 2d collision detection for btConvex2dShape
+///Currently it requires the btMinkowskiPenetrationDepthSolver, it has support for 2d penetration depth computation
+class btConvex2dConvex2dAlgorithm : public btActivatingCollisionAlgorithm
+{
+	btSimplexSolverInterface*		m_simplexSolver;
+	btConvexPenetrationDepthSolver* m_pdSolver;
+
+	
+	bool	m_ownManifold;
+	btPersistentManifold*	m_manifoldPtr;
+	bool			m_lowLevelOfDetail;
+	
+	int m_numPerturbationIterations;
+	int m_minimumPointsPerturbationThreshold;
+
+public:
+
+	btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold);
+
+
+	virtual ~btConvex2dConvex2dAlgorithm();
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		///should we use m_ownManifold to avoid adding duplicates?
+		if (m_manifoldPtr && m_ownManifold)
+			manifoldArray.push_back(m_manifoldPtr);
+	}
+
+
+	void	setLowLevelOfDetail(bool useLowLevel);
+
+
+	const btPersistentManifold*	getManifold()
+	{
+		return m_manifoldPtr;
+	}
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+
+		btConvexPenetrationDepthSolver*		m_pdSolver;
+		btSimplexSolverInterface*			m_simplexSolver;
+		int m_numPerturbationIterations;
+		int m_minimumPointsPerturbationThreshold;
+
+		CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver);
+		
+		virtual ~CreateFunc();
+
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvex2dConvex2dAlgorithm));
+			return new(mem) btConvex2dConvex2dAlgorithm(ci.m_manifold,ci,body0,body1,m_simplexSolver,m_pdSolver,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);
+		}
+	};
+
+
+};
+
+#endif //BT_CONVEX_2D_CONVEX_2D_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
new file mode 100644
index 0000000..d2b2c22
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
@@ -0,0 +1,312 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btConvexConcaveCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionShapes/btConcaveShape.h"
+#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
+#include "BulletCollision/NarrowPhaseCollision/btRaycastCallback.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "LinearMath/btIDebugDraw.h"
+#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
+
+btConvexConcaveCollisionAlgorithm::btConvexConcaveCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1,bool isSwapped)
+: btActivatingCollisionAlgorithm(ci,body0,body1),
+m_isSwapped(isSwapped),
+m_btConvexTriangleCallback(ci.m_dispatcher1,body0,body1,isSwapped)
+{
+}
+
+btConvexConcaveCollisionAlgorithm::~btConvexConcaveCollisionAlgorithm()
+{
+}
+
+void	btConvexConcaveCollisionAlgorithm::getAllContactManifolds(btManifoldArray&	manifoldArray)
+{
+	if (m_btConvexTriangleCallback.m_manifoldPtr)
+	{
+		manifoldArray.push_back(m_btConvexTriangleCallback.m_manifoldPtr);
+	}
+}
+
+
+btConvexTriangleCallback::btConvexTriangleCallback(btDispatcher*  dispatcher,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped):
+	  m_dispatcher(dispatcher),
+	m_dispatchInfoPtr(0)
+{
+	m_convexBody = isSwapped? body1:body0;
+	m_triBody = isSwapped? body0:body1;
+	
+	  //
+	  // create the manifold from the dispatcher 'manifold pool'
+	  //
+	  m_manifoldPtr = m_dispatcher->getNewManifold(m_convexBody,m_triBody);
+
+  	  clearCache();
+}
+
+btConvexTriangleCallback::~btConvexTriangleCallback()
+{
+	clearCache();
+	m_dispatcher->releaseManifold( m_manifoldPtr );
+  
+}
+  
+
+void	btConvexTriangleCallback::clearCache()
+{
+	m_dispatcher->clearManifold(m_manifoldPtr);
+}
+
+
+
+void btConvexTriangleCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex)
+{
+ 
+	//just for debugging purposes
+	//printf("triangle %d",m_triangleCount++);
+
+
+	//aabb filter is already applied!	
+
+	btCollisionAlgorithmConstructionInfo ci;
+	ci.m_dispatcher1 = m_dispatcher;
+
+	btCollisionObject* ob = static_cast<btCollisionObject*>(m_triBody);
+
+
+#if 0	
+	///debug drawing of the overlapping triangles
+	if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && (m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe ))
+	{
+		btVector3 color(1,1,0);
+		btTransform& tr = ob->getWorldTransform();
+		m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[0]),tr(triangle[1]),color);
+		m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[1]),tr(triangle[2]),color);
+		m_dispatchInfoPtr->m_debugDraw->drawLine(tr(triangle[2]),tr(triangle[0]),color);
+	}
+#endif
+	
+	if (m_convexBody->getCollisionShape()->isConvex())
+	{
+		btTriangleShape tm(triangle[0],triangle[1],triangle[2]);	
+		tm.setMargin(m_collisionMarginTriangle);
+		
+		btCollisionShape* tmpShape = ob->getCollisionShape();
+		ob->internalSetTemporaryCollisionShape( &tm );
+
+		btCollisionAlgorithm* colAlgo = ci.m_dispatcher1->findAlgorithm(m_convexBody,m_triBody,m_manifoldPtr);
+
+		if (m_resultOut->getBody0Internal() == m_triBody)
+		{
+			m_resultOut->setShapeIdentifiersA(partId,triangleIndex);
+		}
+		else
+		{
+			m_resultOut->setShapeIdentifiersB(partId,triangleIndex);
+		}
+	
+		colAlgo->processCollision(m_convexBody,m_triBody,*m_dispatchInfoPtr,m_resultOut);
+		colAlgo->~btCollisionAlgorithm();
+		ci.m_dispatcher1->freeCollisionAlgorithm(colAlgo);
+		ob->internalSetTemporaryCollisionShape( tmpShape);
+	}
+
+
+}
+
+
+
+void	btConvexTriangleCallback::setTimeStepAndCounters(btScalar collisionMarginTriangle,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	m_dispatchInfoPtr = &dispatchInfo;
+	m_collisionMarginTriangle = collisionMarginTriangle;
+	m_resultOut = resultOut;
+
+	//recalc aabbs
+	btTransform convexInTriangleSpace;
+	convexInTriangleSpace = m_triBody->getWorldTransform().inverse() * m_convexBody->getWorldTransform();
+	btCollisionShape* convexShape = static_cast<btCollisionShape*>(m_convexBody->getCollisionShape());
+	//CollisionShape* triangleShape = static_cast<btCollisionShape*>(triBody->m_collisionShape);
+	convexShape->getAabb(convexInTriangleSpace,m_aabbMin,m_aabbMax);
+	btScalar extraMargin = collisionMarginTriangle;
+	btVector3 extra(extraMargin,extraMargin,extraMargin);
+
+	m_aabbMax += extra;
+	m_aabbMin -= extra;
+	
+}
+
+void btConvexConcaveCollisionAlgorithm::clearCache()
+{
+	m_btConvexTriangleCallback.clearCache();
+
+}
+
+void btConvexConcaveCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	
+	
+	btCollisionObject* convexBody = m_isSwapped ? body1 : body0;
+	btCollisionObject* triBody = m_isSwapped ? body0 : body1;
+
+	if (triBody->getCollisionShape()->isConcave())
+	{
+
+
+		btCollisionObject*	triOb = triBody;
+		btConcaveShape* concaveShape = static_cast<btConcaveShape*>( triOb->getCollisionShape());
+		
+		if (convexBody->getCollisionShape()->isConvex())
+		{
+			btScalar collisionMarginTriangle = concaveShape->getMargin();
+					
+			resultOut->setPersistentManifold(m_btConvexTriangleCallback.m_manifoldPtr);
+			m_btConvexTriangleCallback.setTimeStepAndCounters(collisionMarginTriangle,dispatchInfo,resultOut);
+
+			//Disable persistency. previously, some older algorithm calculated all contacts in one go, so you can clear it here.
+			//m_dispatcher->clearManifold(m_btConvexTriangleCallback.m_manifoldPtr);
+
+			m_btConvexTriangleCallback.m_manifoldPtr->setBodies(convexBody,triBody);
+
+			concaveShape->processAllTriangles( &m_btConvexTriangleCallback,m_btConvexTriangleCallback.getAabbMin(),m_btConvexTriangleCallback.getAabbMax());
+			
+			resultOut->refreshContactPoints();
+	
+		}
+	
+	}
+
+}
+
+
+btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)resultOut;
+	(void)dispatchInfo;
+	btCollisionObject* convexbody = m_isSwapped ? body1 : body0;
+	btCollisionObject* triBody = m_isSwapped ? body0 : body1;
+
+
+	//quick approximation using raycast, todo: hook up to the continuous collision detection (one of the btConvexCast)
+
+	//only perform CCD above a certain threshold, this prevents blocking on the long run
+	//because object in a blocked ccd state (hitfraction<1) get their linear velocity halved each frame...
+	btScalar squareMot0 = (convexbody->getInterpolationWorldTransform().getOrigin() - convexbody->getWorldTransform().getOrigin()).length2();
+	if (squareMot0 < convexbody->getCcdSquareMotionThreshold())
+	{
+		return btScalar(1.);
+	}
+
+	//const btVector3& from = convexbody->m_worldTransform.getOrigin();
+	//btVector3 to = convexbody->m_interpolationWorldTransform.getOrigin();
+	//todo: only do if the motion exceeds the 'radius'
+
+	btTransform triInv = triBody->getWorldTransform().inverse();
+	btTransform convexFromLocal = triInv * convexbody->getWorldTransform();
+	btTransform convexToLocal = triInv * convexbody->getInterpolationWorldTransform();
+
+	struct LocalTriangleSphereCastCallback	: public btTriangleCallback
+	{
+		btTransform m_ccdSphereFromTrans;
+		btTransform m_ccdSphereToTrans;
+		btTransform	m_meshTransform;
+
+		btScalar	m_ccdSphereRadius;
+		btScalar	m_hitFraction;
+	
+
+		LocalTriangleSphereCastCallback(const btTransform& from,const btTransform& to,btScalar ccdSphereRadius,btScalar hitFraction)
+			:m_ccdSphereFromTrans(from),
+			m_ccdSphereToTrans(to),
+			m_ccdSphereRadius(ccdSphereRadius),
+			m_hitFraction(hitFraction)
+		{			
+		}
+		
+		
+		virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
+		{
+			(void)partId;
+			(void)triangleIndex;
+			//do a swept sphere for now
+			btTransform ident;
+			ident.setIdentity();
+			btConvexCast::CastResult castResult;
+			castResult.m_fraction = m_hitFraction;
+			btSphereShape	pointShape(m_ccdSphereRadius);
+			btTriangleShape	triShape(triangle[0],triangle[1],triangle[2]);
+			btVoronoiSimplexSolver	simplexSolver;
+			btSubsimplexConvexCast convexCaster(&pointShape,&triShape,&simplexSolver);
+			//GjkConvexCast	convexCaster(&pointShape,convexShape,&simplexSolver);
+			//ContinuousConvexCollision convexCaster(&pointShape,convexShape,&simplexSolver,0);
+			//local space?
+
+			if (convexCaster.calcTimeOfImpact(m_ccdSphereFromTrans,m_ccdSphereToTrans,
+				ident,ident,castResult))
+			{
+				if (m_hitFraction > castResult.m_fraction)
+					m_hitFraction = castResult.m_fraction;
+			}
+
+		}
+
+	};
+
+
+	
+
+	
+	if (triBody->getCollisionShape()->isConcave())
+	{
+		btVector3 rayAabbMin = convexFromLocal.getOrigin();
+		rayAabbMin.setMin(convexToLocal.getOrigin());
+		btVector3 rayAabbMax = convexFromLocal.getOrigin();
+		rayAabbMax.setMax(convexToLocal.getOrigin());
+		btScalar ccdRadius0 = convexbody->getCcdSweptSphereRadius();
+		rayAabbMin -= btVector3(ccdRadius0,ccdRadius0,ccdRadius0);
+		rayAabbMax += btVector3(ccdRadius0,ccdRadius0,ccdRadius0);
+
+		btScalar curHitFraction = btScalar(1.); //is this available?
+		LocalTriangleSphereCastCallback raycastCallback(convexFromLocal,convexToLocal,
+			convexbody->getCcdSweptSphereRadius(),curHitFraction);
+
+		raycastCallback.m_hitFraction = convexbody->getHitFraction();
+
+		btCollisionObject* concavebody = triBody;
+
+		btConcaveShape* triangleMesh = (btConcaveShape*) concavebody->getCollisionShape();
+		
+		if (triangleMesh)
+		{
+			triangleMesh->processAllTriangles(&raycastCallback,rayAabbMin,rayAabbMax);
+		}
+	
+
+
+		if (raycastCallback.m_hitFraction < convexbody->getHitFraction())
+		{
+			convexbody->setHitFraction( raycastCallback.m_hitFraction);
+			return raycastCallback.m_hitFraction;
+		}
+	}
+
+	return btScalar(1.);
+
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
new file mode 100644
index 0000000..f718d1d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
@@ -0,0 +1,116 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
+#define BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
+
+#include "btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
+#include "BulletCollision/CollisionShapes/btTriangleCallback.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+class btDispatcher;
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "btCollisionCreateFunc.h"
+
+///For each triangle in the concave mesh that overlaps with the AABB of a convex (m_convexProxy), processTriangle is called.
+class btConvexTriangleCallback : public btTriangleCallback
+{
+	btCollisionObject* m_convexBody;
+	btCollisionObject* m_triBody;
+
+	btVector3	m_aabbMin;
+	btVector3	m_aabbMax ;
+
+
+	btManifoldResult* m_resultOut;
+	btDispatcher*	m_dispatcher;
+	const btDispatcherInfo* m_dispatchInfoPtr;
+	btScalar m_collisionMarginTriangle;
+	
+public:
+int	m_triangleCount;
+	
+	btPersistentManifold*	m_manifoldPtr;
+
+	btConvexTriangleCallback(btDispatcher* dispatcher,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);
+
+	void	setTimeStepAndCounters(btScalar collisionMarginTriangle,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual ~btConvexTriangleCallback();
+
+	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
+	
+	void clearCache();
+
+	SIMD_FORCE_INLINE const btVector3& getAabbMin() const
+	{
+		return m_aabbMin;
+	}
+	SIMD_FORCE_INLINE const btVector3& getAabbMax() const
+	{
+		return m_aabbMax;
+	}
+
+};
+
+
+
+
+/// btConvexConcaveCollisionAlgorithm  supports collision between convex shapes and (concave) trianges meshes.
+class btConvexConcaveCollisionAlgorithm  : public btActivatingCollisionAlgorithm
+{
+
+	bool	m_isSwapped;
+
+	btConvexTriangleCallback m_btConvexTriangleCallback;
+
+
+
+public:
+
+	btConvexConcaveCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);
+
+	virtual ~btConvexConcaveCollisionAlgorithm();
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray);
+	
+	void	clearCache();
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConcaveCollisionAlgorithm));
+			return new(mem) btConvexConcaveCollisionAlgorithm(ci,body0,body1,false);
+		}
+	};
+
+	struct SwappedCreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConcaveCollisionAlgorithm));
+			return new(mem) btConvexConcaveCollisionAlgorithm(ci,body0,body1,true);
+		}
+	};
+
+};
+
+#endif //BT_CONVEX_CONCAVE_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
new file mode 100644
index 0000000..79353a4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
@@ -0,0 +1,679 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///Specialized capsule-capsule collision algorithm has been added for Bullet 2.75 release to increase ragdoll performance
+///If you experience problems with capsule-capsule collision, try to define BT_DISABLE_CAPSULE_CAPSULE_COLLIDER and report it in the Bullet forums
+///with reproduction case
+//define BT_DISABLE_CAPSULE_CAPSULE_COLLIDER 1
+
+#include "btConvexConvexAlgorithm.h"
+
+//#include <stdio.h>
+#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+
+
+
+#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
+
+#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
+#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
+
+
+
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+
+#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
+
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h"
+
+
+///////////
+
+
+
+static SIMD_FORCE_INLINE void segmentsClosestPoints(
+	btVector3& ptsVector,
+	btVector3& offsetA,
+	btVector3& offsetB,
+	btScalar& tA, btScalar& tB,
+	const btVector3& translation,
+	const btVector3& dirA, btScalar hlenA,
+	const btVector3& dirB, btScalar hlenB )
+{
+	// compute the parameters of the closest points on each line segment
+
+	btScalar dirA_dot_dirB = btDot(dirA,dirB);
+	btScalar dirA_dot_trans = btDot(dirA,translation);
+	btScalar dirB_dot_trans = btDot(dirB,translation);
+
+	btScalar denom = 1.0f - dirA_dot_dirB * dirA_dot_dirB;
+
+	if ( denom == 0.0f ) {
+		tA = 0.0f;
+	} else {
+		tA = ( dirA_dot_trans - dirB_dot_trans * dirA_dot_dirB ) / denom;
+		if ( tA < -hlenA )
+			tA = -hlenA;
+		else if ( tA > hlenA )
+			tA = hlenA;
+	}
+
+	tB = tA * dirA_dot_dirB - dirB_dot_trans;
+
+	if ( tB < -hlenB ) {
+		tB = -hlenB;
+		tA = tB * dirA_dot_dirB + dirA_dot_trans;
+
+		if ( tA < -hlenA )
+			tA = -hlenA;
+		else if ( tA > hlenA )
+			tA = hlenA;
+	} else if ( tB > hlenB ) {
+		tB = hlenB;
+		tA = tB * dirA_dot_dirB + dirA_dot_trans;
+
+		if ( tA < -hlenA )
+			tA = -hlenA;
+		else if ( tA > hlenA )
+			tA = hlenA;
+	}
+
+	// compute the closest points relative to segment centers.
+
+	offsetA = dirA * tA;
+	offsetB = dirB * tB;
+
+	ptsVector = translation - offsetA + offsetB;
+}
+
+
+static SIMD_FORCE_INLINE btScalar capsuleCapsuleDistance(
+	btVector3& normalOnB,
+	btVector3& pointOnB,
+	btScalar capsuleLengthA,
+	btScalar	capsuleRadiusA,
+	btScalar capsuleLengthB,
+	btScalar	capsuleRadiusB,
+	int capsuleAxisA,
+	int capsuleAxisB,
+	const btTransform& transformA,
+	const btTransform& transformB,
+	btScalar distanceThreshold )
+{
+	btVector3 directionA = transformA.getBasis().getColumn(capsuleAxisA);
+	btVector3 translationA = transformA.getOrigin();
+	btVector3 directionB = transformB.getBasis().getColumn(capsuleAxisB);
+	btVector3 translationB = transformB.getOrigin();
+
+	// translation between centers
+
+	btVector3 translation = translationB - translationA;
+
+	// compute the closest points of the capsule line segments
+
+	btVector3 ptsVector;           // the vector between the closest points
+	
+	btVector3 offsetA, offsetB;    // offsets from segment centers to their closest points
+	btScalar tA, tB;              // parameters on line segment
+
+	segmentsClosestPoints( ptsVector, offsetA, offsetB, tA, tB, translation,
+						   directionA, capsuleLengthA, directionB, capsuleLengthB );
+
+	btScalar distance = ptsVector.length() - capsuleRadiusA - capsuleRadiusB;
+
+	if ( distance > distanceThreshold )
+		return distance;
+
+	btScalar lenSqr = ptsVector.length2();
+	if (lenSqr<= (SIMD_EPSILON*SIMD_EPSILON))
+	{
+		//degenerate case where 2 capsules are likely at the same location: take a vector tangential to 'directionA'
+		btVector3 q;
+		btPlaneSpace1(directionA,normalOnB,q);
+	} else
+	{
+		// compute the contact normal
+		normalOnB = ptsVector*-btRecipSqrt(lenSqr);
+	}
+	pointOnB = transformB.getOrigin()+offsetB + normalOnB * capsuleRadiusB;
+
+	return distance;
+}
+
+
+
+
+
+
+
+//////////
+
+
+
+
+
+btConvexConvexAlgorithm::CreateFunc::CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver)
+{
+	m_numPerturbationIterations = 0;
+	m_minimumPointsPerturbationThreshold = 3;
+	m_simplexSolver = simplexSolver;
+	m_pdSolver = pdSolver;
+}
+
+btConvexConvexAlgorithm::CreateFunc::~CreateFunc() 
+{ 
+}
+
+btConvexConvexAlgorithm::btConvexConvexAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver,int numPerturbationIterations, int minimumPointsPerturbationThreshold)
+: btActivatingCollisionAlgorithm(ci,body0,body1),
+m_simplexSolver(simplexSolver),
+m_pdSolver(pdSolver),
+m_ownManifold (false),
+m_manifoldPtr(mf),
+m_lowLevelOfDetail(false),
+#ifdef USE_SEPDISTANCE_UTIL2
+m_sepDistance((static_cast<btConvexShape*>(body0->getCollisionShape()))->getAngularMotionDisc(),
+			  (static_cast<btConvexShape*>(body1->getCollisionShape()))->getAngularMotionDisc()),
+#endif
+m_numPerturbationIterations(numPerturbationIterations),
+m_minimumPointsPerturbationThreshold(minimumPointsPerturbationThreshold)
+{
+	(void)body0;
+	(void)body1;
+}
+
+
+
+
+btConvexConvexAlgorithm::~btConvexConvexAlgorithm()
+{
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+	}
+}
+
+void	btConvexConvexAlgorithm ::setLowLevelOfDetail(bool useLowLevel)
+{
+	m_lowLevelOfDetail = useLowLevel;
+}
+
+
+struct btPerturbedContactResult : public btManifoldResult
+{
+	btManifoldResult* m_originalManifoldResult;
+	btTransform m_transformA;
+	btTransform m_transformB;
+	btTransform	m_unPerturbedTransform;
+	bool	m_perturbA;
+	btIDebugDraw*	m_debugDrawer;
+
+
+	btPerturbedContactResult(btManifoldResult* originalResult,const btTransform& transformA,const btTransform& transformB,const btTransform& unPerturbedTransform,bool perturbA,btIDebugDraw* debugDrawer)
+		:m_originalManifoldResult(originalResult),
+		m_transformA(transformA),
+		m_transformB(transformB),
+		m_unPerturbedTransform(unPerturbedTransform),
+		m_perturbA(perturbA),
+		m_debugDrawer(debugDrawer)
+	{
+	}
+	virtual ~ btPerturbedContactResult()
+	{
+	}
+
+	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar orgDepth)
+	{
+		btVector3 endPt,startPt;
+		btScalar newDepth;
+		btVector3 newNormal;
+
+		if (m_perturbA)
+		{
+			btVector3 endPtOrg = pointInWorld + normalOnBInWorld*orgDepth;
+			endPt = (m_unPerturbedTransform*m_transformA.inverse())(endPtOrg);
+			newDepth = (endPt -  pointInWorld).dot(normalOnBInWorld);
+			startPt = endPt+normalOnBInWorld*newDepth;
+		} else
+		{
+			endPt = pointInWorld + normalOnBInWorld*orgDepth;
+			startPt = (m_unPerturbedTransform*m_transformB.inverse())(pointInWorld);
+			newDepth = (endPt -  startPt).dot(normalOnBInWorld);
+			
+		}
+
+//#define DEBUG_CONTACTS 1
+#ifdef DEBUG_CONTACTS
+		m_debugDrawer->drawLine(startPt,endPt,btVector3(1,0,0));
+		m_debugDrawer->drawSphere(startPt,0.05,btVector3(0,1,0));
+		m_debugDrawer->drawSphere(endPt,0.05,btVector3(0,0,1));
+#endif //DEBUG_CONTACTS
+
+		
+		m_originalManifoldResult->addContactPoint(normalOnBInWorld,startPt,newDepth);
+	}
+
+};
+
+extern btScalar gContactBreakingThreshold;
+
+
+//
+// Convex-Convex collision algorithm
+//
+void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+
+	if (!m_manifoldPtr)
+	{
+		//swapped?
+		m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1);
+		m_ownManifold = true;
+	}
+	resultOut->setPersistentManifold(m_manifoldPtr);
+
+	//comment-out next line to test multi-contact generation
+	//resultOut->getPersistentManifold()->clearManifold();
+	
+
+	btConvexShape* min0 = static_cast<btConvexShape*>(body0->getCollisionShape());
+	btConvexShape* min1 = static_cast<btConvexShape*>(body1->getCollisionShape());
+
+	btVector3  normalOnB;
+		btVector3  pointOnBWorld;
+#ifndef BT_DISABLE_CAPSULE_CAPSULE_COLLIDER
+	if ((min0->getShapeType() == CAPSULE_SHAPE_PROXYTYPE) && (min1->getShapeType() == CAPSULE_SHAPE_PROXYTYPE))
+	{
+		btCapsuleShape* capsuleA = (btCapsuleShape*) min0;
+		btCapsuleShape* capsuleB = (btCapsuleShape*) min1;
+		btVector3 localScalingA = capsuleA->getLocalScaling();
+		btVector3 localScalingB = capsuleB->getLocalScaling();
+		
+		btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
+
+		btScalar dist = capsuleCapsuleDistance(normalOnB,	pointOnBWorld,capsuleA->getHalfHeight(),capsuleA->getRadius(),
+			capsuleB->getHalfHeight(),capsuleB->getRadius(),capsuleA->getUpAxis(),capsuleB->getUpAxis(),
+			body0->getWorldTransform(),body1->getWorldTransform(),threshold);
+
+		if (dist<threshold)
+		{
+			btAssert(normalOnB.length2()>=(SIMD_EPSILON*SIMD_EPSILON));
+			resultOut->addContactPoint(normalOnB,pointOnBWorld,dist);	
+		}
+		resultOut->refreshContactPoints();
+		return;
+	}
+#endif //BT_DISABLE_CAPSULE_CAPSULE_COLLIDER
+
+
+
+
+#ifdef USE_SEPDISTANCE_UTIL2
+	if (dispatchInfo.m_useConvexConservativeDistanceUtil)
+	{
+		m_sepDistance.updateSeparatingDistance(body0->getWorldTransform(),body1->getWorldTransform());
+	}
+
+	if (!dispatchInfo.m_useConvexConservativeDistanceUtil || m_sepDistance.getConservativeSeparatingDistance()<=0.f)
+#endif //USE_SEPDISTANCE_UTIL2
+
+	{
+
+	
+	btGjkPairDetector::ClosestPointInput input;
+
+	btGjkPairDetector	gjkPairDetector(min0,min1,m_simplexSolver,m_pdSolver);
+	//TODO: if (dispatchInfo.m_useContinuous)
+	gjkPairDetector.setMinkowskiA(min0);
+	gjkPairDetector.setMinkowskiB(min1);
+
+#ifdef USE_SEPDISTANCE_UTIL2
+	if (dispatchInfo.m_useConvexConservativeDistanceUtil)
+	{
+		input.m_maximumDistanceSquared = BT_LARGE_FLOAT;
+	} else
+#endif //USE_SEPDISTANCE_UTIL2
+	{
+		//if (dispatchInfo.m_convexMaxDistanceUseCPT)
+		//{
+		//	input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactProcessingThreshold();
+		//} else
+		//{
+		input.m_maximumDistanceSquared = min0->getMargin() + min1->getMargin() + m_manifoldPtr->getContactBreakingThreshold();
+//		}
+
+		input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared;
+	}
+
+	input.m_stackAlloc = dispatchInfo.m_stackAllocator;
+	input.m_transformA = body0->getWorldTransform();
+	input.m_transformB = body1->getWorldTransform();
+
+
+
+	
+
+#ifdef USE_SEPDISTANCE_UTIL2
+	btScalar sepDist = 0.f;
+	if (dispatchInfo.m_useConvexConservativeDistanceUtil)
+	{
+		sepDist = gjkPairDetector.getCachedSeparatingDistance();
+		if (sepDist>SIMD_EPSILON)
+		{
+			sepDist += dispatchInfo.m_convexConservativeDistanceThreshold;
+			//now perturbe directions to get multiple contact points
+			
+		}
+	}
+#endif //USE_SEPDISTANCE_UTIL2
+
+	if (min0->isPolyhedral() && min1->isPolyhedral())
+	{
+
+
+		struct btDummyResult : public btDiscreteCollisionDetectorInterface::Result
+		{
+			virtual void setShapeIdentifiersA(int partId0,int index0){}
+			virtual void setShapeIdentifiersB(int partId1,int index1){}
+			virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth) 
+			{
+			}
+		};
+		
+		btDummyResult dummy;
+
+
+		btPolyhedralConvexShape* polyhedronA = (btPolyhedralConvexShape*) min0;
+		btPolyhedralConvexShape* polyhedronB = (btPolyhedralConvexShape*) min1;
+		if (polyhedronA->getConvexPolyhedron() && polyhedronB->getConvexPolyhedron())
+		{
+
+
+			gjkPairDetector.getClosestPoints(input,dummy,dispatchInfo.m_debugDraw);
+			
+
+			btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
+
+			btScalar minDist = 0.f;
+			btVector3 sepNormalWorldSpace;
+			bool foundSepAxis  = true;
+
+			if (dispatchInfo.m_enableSatConvex)
+			{
+				foundSepAxis = btPolyhedralContactClipping::findSeparatingAxis(
+					*polyhedronA->getConvexPolyhedron(), *polyhedronB->getConvexPolyhedron(),
+					body0->getWorldTransform(), 
+					body1->getWorldTransform(),
+					sepNormalWorldSpace);
+			} else
+			{
+				sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
+				minDist = gjkPairDetector.getCachedSeparatingDistance();
+			}
+			if (foundSepAxis)
+			{
+//				printf("sepNormalWorldSpace=%f,%f,%f\n",sepNormalWorldSpace.getX(),sepNormalWorldSpace.getY(),sepNormalWorldSpace.getZ());
+
+				btPolyhedralContactClipping::clipHullAgainstHull(sepNormalWorldSpace, *polyhedronA->getConvexPolyhedron(), *polyhedronB->getConvexPolyhedron(),
+					body0->getWorldTransform(), 
+					body1->getWorldTransform(), minDist-threshold, threshold, *resultOut);
+ 				
+			}
+			if (m_ownManifold)
+			{
+				resultOut->refreshContactPoints();
+			}
+			return;
+
+		} else
+		{
+			//we can also deal with convex versus triangle (without connectivity data)
+			if (polyhedronA->getConvexPolyhedron() && polyhedronB->getShapeType()==TRIANGLE_SHAPE_PROXYTYPE)
+			{
+				gjkPairDetector.getClosestPoints(input,dummy,dispatchInfo.m_debugDraw);
+		
+				btVector3 sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
+
+				btVertexArray vertices;
+				btTriangleShape* tri = (btTriangleShape*)polyhedronB;
+				vertices.push_back(	body1->getWorldTransform()*tri->m_vertices1[0]);
+				vertices.push_back(	body1->getWorldTransform()*tri->m_vertices1[1]);
+				vertices.push_back(	body1->getWorldTransform()*tri->m_vertices1[2]);
+
+				btScalar threshold = m_manifoldPtr->getContactBreakingThreshold();
+				btScalar minDist = gjkPairDetector.getCachedSeparatingDistance();
+				btPolyhedralContactClipping::clipFaceAgainstHull(sepNormalWorldSpace, *polyhedronA->getConvexPolyhedron(), 
+					body0->getWorldTransform(), vertices, minDist-threshold, threshold, *resultOut);
+				
+				
+				if (m_ownManifold)
+				{
+					resultOut->refreshContactPoints();
+				}
+				
+				return;
+			}
+			
+		}
+
+
+	}
+	
+	gjkPairDetector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
+
+	//now perform 'm_numPerturbationIterations' collision queries with the perturbated collision objects
+	
+	//perform perturbation when more then 'm_minimumPointsPerturbationThreshold' points
+	if (m_numPerturbationIterations && resultOut->getPersistentManifold()->getNumContacts() < m_minimumPointsPerturbationThreshold)
+	{
+		
+		int i;
+		btVector3 v0,v1;
+		btVector3 sepNormalWorldSpace;
+	
+		sepNormalWorldSpace = gjkPairDetector.getCachedSeparatingAxis().normalized();
+		btPlaneSpace1(sepNormalWorldSpace,v0,v1);
+
+
+		bool perturbeA = true;
+		const btScalar angleLimit = 0.125f * SIMD_PI;
+		btScalar perturbeAngle;
+		btScalar radiusA = min0->getAngularMotionDisc();
+		btScalar radiusB = min1->getAngularMotionDisc();
+		if (radiusA < radiusB)
+		{
+			perturbeAngle = gContactBreakingThreshold /radiusA;
+			perturbeA = true;
+		} else
+		{
+			perturbeAngle = gContactBreakingThreshold / radiusB;
+			perturbeA = false;
+		}
+		if ( perturbeAngle > angleLimit ) 
+				perturbeAngle = angleLimit;
+
+		btTransform unPerturbedTransform;
+		if (perturbeA)
+		{
+			unPerturbedTransform = input.m_transformA;
+		} else
+		{
+			unPerturbedTransform = input.m_transformB;
+		}
+		
+		for ( i=0;i<m_numPerturbationIterations;i++)
+		{
+			if (v0.length2()>SIMD_EPSILON)
+			{
+			btQuaternion perturbeRot(v0,perturbeAngle);
+			btScalar iterationAngle = i*(SIMD_2_PI/btScalar(m_numPerturbationIterations));
+			btQuaternion rotq(sepNormalWorldSpace,iterationAngle);
+			
+			
+			if (perturbeA)
+			{
+				input.m_transformA.setBasis(  btMatrix3x3(rotq.inverse()*perturbeRot*rotq)*body0->getWorldTransform().getBasis());
+				input.m_transformB = body1->getWorldTransform();
+#ifdef DEBUG_CONTACTS
+				dispatchInfo.m_debugDraw->drawTransform(input.m_transformA,10.0);
+#endif //DEBUG_CONTACTS
+			} else
+			{
+				input.m_transformA = body0->getWorldTransform();
+				input.m_transformB.setBasis( btMatrix3x3(rotq.inverse()*perturbeRot*rotq)*body1->getWorldTransform().getBasis());
+#ifdef DEBUG_CONTACTS
+				dispatchInfo.m_debugDraw->drawTransform(input.m_transformB,10.0);
+#endif
+			}
+			
+			btPerturbedContactResult perturbedResultOut(resultOut,input.m_transformA,input.m_transformB,unPerturbedTransform,perturbeA,dispatchInfo.m_debugDraw);
+			gjkPairDetector.getClosestPoints(input,perturbedResultOut,dispatchInfo.m_debugDraw);
+			}
+			
+		}
+	}
+
+	
+
+#ifdef USE_SEPDISTANCE_UTIL2
+	if (dispatchInfo.m_useConvexConservativeDistanceUtil && (sepDist>SIMD_EPSILON))
+	{
+		m_sepDistance.initSeparatingDistance(gjkPairDetector.getCachedSeparatingAxis(),sepDist,body0->getWorldTransform(),body1->getWorldTransform());
+	}
+#endif //USE_SEPDISTANCE_UTIL2
+
+
+	}
+
+	if (m_ownManifold)
+	{
+		resultOut->refreshContactPoints();
+	}
+
+}
+
+
+
+bool disableCcd = false;
+btScalar	btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)resultOut;
+	(void)dispatchInfo;
+	///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold
+    
+	///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold
+	///col0->m_worldTransform,
+	btScalar resultFraction = btScalar(1.);
+
+
+	btScalar squareMot0 = (col0->getInterpolationWorldTransform().getOrigin() - col0->getWorldTransform().getOrigin()).length2();
+	btScalar squareMot1 = (col1->getInterpolationWorldTransform().getOrigin() - col1->getWorldTransform().getOrigin()).length2();
+    
+	if (squareMot0 < col0->getCcdSquareMotionThreshold() &&
+		squareMot1 < col1->getCcdSquareMotionThreshold())
+		return resultFraction;
+
+	if (disableCcd)
+		return btScalar(1.);
+
+
+	//An adhoc way of testing the Continuous Collision Detection algorithms
+	//One object is approximated as a sphere, to simplify things
+	//Starting in penetration should report no time of impact
+	//For proper CCD, better accuracy and handling of 'allowed' penetration should be added
+	//also the mainloop of the physics should have a kind of toi queue (something like Brian Mirtich's application of Timewarp for Rigidbodies)
+
+		
+	/// Convex0 against sphere for Convex1
+	{
+		btConvexShape* convex0 = static_cast<btConvexShape*>(col0->getCollisionShape());
+
+		btSphereShape	sphere1(col1->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation
+		btConvexCast::CastResult result;
+		btVoronoiSimplexSolver voronoiSimplex;
+		//SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
+		///Simplification, one object is simplified as a sphere
+		btGjkConvexCast ccd1( convex0 ,&sphere1,&voronoiSimplex);
+		//ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
+		if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(),
+			col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result))
+		{
+		
+			//store result.m_fraction in both bodies
+		
+			if (col0->getHitFraction()> result.m_fraction)
+				col0->setHitFraction( result.m_fraction );
+
+			if (col1->getHitFraction() > result.m_fraction)
+				col1->setHitFraction( result.m_fraction);
+
+			if (resultFraction > result.m_fraction)
+				resultFraction = result.m_fraction;
+
+		}
+		
+		
+
+
+	}
+
+	/// Sphere (for convex0) against Convex1
+	{
+		btConvexShape* convex1 = static_cast<btConvexShape*>(col1->getCollisionShape());
+
+		btSphereShape	sphere0(col0->getCcdSweptSphereRadius()); //todo: allow non-zero sphere sizes, for better approximation
+		btConvexCast::CastResult result;
+		btVoronoiSimplexSolver voronoiSimplex;
+		//SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
+		///Simplification, one object is simplified as a sphere
+		btGjkConvexCast ccd1(&sphere0,convex1,&voronoiSimplex);
+		//ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
+		if (ccd1.calcTimeOfImpact(col0->getWorldTransform(),col0->getInterpolationWorldTransform(),
+			col1->getWorldTransform(),col1->getInterpolationWorldTransform(),result))
+		{
+		
+			//store result.m_fraction in both bodies
+		
+			if (col0->getHitFraction()	> result.m_fraction)
+				col0->setHitFraction( result.m_fraction);
+
+			if (col1->getHitFraction() > result.m_fraction)
+				col1->setHitFraction( result.m_fraction);
+
+			if (resultFraction > result.m_fraction)
+				resultFraction = result.m_fraction;
+
+		}
+	}
+	
+	return resultFraction;
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h
new file mode 100644
index 0000000..4380b80
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h
@@ -0,0 +1,109 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_CONVEX_ALGORITHM_H
+#define BT_CONVEX_CONVEX_ALGORITHM_H
+
+#include "btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+#include "btCollisionCreateFunc.h"
+#include "btCollisionDispatcher.h"
+#include "LinearMath/btTransformUtil.h" //for btConvexSeparatingDistanceUtil
+
+class btConvexPenetrationDepthSolver;
+
+///Enabling USE_SEPDISTANCE_UTIL2 requires 100% reliable distance computation. However, when using large size ratios GJK can be imprecise
+///so the distance is not conservative. In that case, enabling this USE_SEPDISTANCE_UTIL2 would result in failing/missing collisions.
+///Either improve GJK for large size ratios (testing a 100 units versus a 0.1 unit object) or only enable the util
+///for certain pairs that have a small size ratio
+
+//#define USE_SEPDISTANCE_UTIL2 1
+
+///The convexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations between two convex objects.
+///Multiple contact points are calculated by perturbing the orientation of the smallest object orthogonal to the separating normal.
+///This idea was described by Gino van den Bergen in this forum topic http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=4&t=288&p=888#p888
+class btConvexConvexAlgorithm : public btActivatingCollisionAlgorithm
+{
+#ifdef USE_SEPDISTANCE_UTIL2
+	btConvexSeparatingDistanceUtil	m_sepDistance;
+#endif
+	btSimplexSolverInterface*		m_simplexSolver;
+	btConvexPenetrationDepthSolver* m_pdSolver;
+
+	
+	bool	m_ownManifold;
+	btPersistentManifold*	m_manifoldPtr;
+	bool			m_lowLevelOfDetail;
+	
+	int m_numPerturbationIterations;
+	int m_minimumPointsPerturbationThreshold;
+
+
+	///cache separating vector to speedup collision detection
+	
+
+public:
+
+	btConvexConvexAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold);
+
+
+	virtual ~btConvexConvexAlgorithm();
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		///should we use m_ownManifold to avoid adding duplicates?
+		if (m_manifoldPtr && m_ownManifold)
+			manifoldArray.push_back(m_manifoldPtr);
+	}
+
+
+	void	setLowLevelOfDetail(bool useLowLevel);
+
+
+	const btPersistentManifold*	getManifold()
+	{
+		return m_manifoldPtr;
+	}
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+
+		btConvexPenetrationDepthSolver*		m_pdSolver;
+		btSimplexSolverInterface*			m_simplexSolver;
+		int m_numPerturbationIterations;
+		int m_minimumPointsPerturbationThreshold;
+
+		CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver);
+		
+		virtual ~CreateFunc();
+
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConvexAlgorithm));
+			return new(mem) btConvexConvexAlgorithm(ci.m_manifold,ci,body0,body1,m_simplexSolver,m_pdSolver,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);
+		}
+	};
+
+
+};
+
+#endif //BT_CONVEX_CONVEX_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
new file mode 100644
index 0000000..dda85dc
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
@@ -0,0 +1,155 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConvexPlaneCollisionAlgorithm.h"
+
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
+
+//#include <stdio.h>
+
+btConvexPlaneCollisionAlgorithm::btConvexPlaneCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped, int numPerturbationIterations,int minimumPointsPerturbationThreshold)
+: btCollisionAlgorithm(ci),
+m_ownManifold(false),
+m_manifoldPtr(mf),
+m_isSwapped(isSwapped),
+m_numPerturbationIterations(numPerturbationIterations),
+m_minimumPointsPerturbationThreshold(minimumPointsPerturbationThreshold)
+{
+	btCollisionObject* convexObj = m_isSwapped? col1 : col0;
+	btCollisionObject* planeObj = m_isSwapped? col0 : col1;
+
+	if (!m_manifoldPtr && m_dispatcher->needsCollision(convexObj,planeObj))
+	{
+		m_manifoldPtr = m_dispatcher->getNewManifold(convexObj,planeObj);
+		m_ownManifold = true;
+	}
+}
+
+
+btConvexPlaneCollisionAlgorithm::~btConvexPlaneCollisionAlgorithm()
+{
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+	}
+}
+
+void btConvexPlaneCollisionAlgorithm::collideSingleContact (const btQuaternion& perturbeRot, btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+    btCollisionObject* convexObj = m_isSwapped? body1 : body0;
+	btCollisionObject* planeObj = m_isSwapped? body0: body1;
+
+	btConvexShape* convexShape = (btConvexShape*) convexObj->getCollisionShape();
+	btStaticPlaneShape* planeShape = (btStaticPlaneShape*) planeObj->getCollisionShape();
+
+    bool hasCollision = false;
+	const btVector3& planeNormal = planeShape->getPlaneNormal();
+	const btScalar& planeConstant = planeShape->getPlaneConstant();
+	
+	btTransform convexWorldTransform = convexObj->getWorldTransform();
+	btTransform convexInPlaneTrans;
+	convexInPlaneTrans= planeObj->getWorldTransform().inverse() * convexWorldTransform;
+	//now perturbe the convex-world transform
+	convexWorldTransform.getBasis()*=btMatrix3x3(perturbeRot);
+	btTransform planeInConvex;
+	planeInConvex= convexWorldTransform.inverse() * planeObj->getWorldTransform();
+	
+	btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis()*-planeNormal);
+
+	btVector3 vtxInPlane = convexInPlaneTrans(vtx);
+	btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
+
+	btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
+	btVector3 vtxInPlaneWorld = planeObj->getWorldTransform() * vtxInPlaneProjected;
+
+	hasCollision = distance < m_manifoldPtr->getContactBreakingThreshold();
+	resultOut->setPersistentManifold(m_manifoldPtr);
+	if (hasCollision)
+	{
+		/// report a contact. internally this will be kept persistent, and contact reduction is done
+		btVector3 normalOnSurfaceB = planeObj->getWorldTransform().getBasis() * planeNormal;
+		btVector3 pOnB = vtxInPlaneWorld;
+		resultOut->addContactPoint(normalOnSurfaceB,pOnB,distance);
+	}
+}
+
+
+void btConvexPlaneCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)dispatchInfo;
+	if (!m_manifoldPtr)
+		return;
+
+    btCollisionObject* convexObj = m_isSwapped? body1 : body0;
+	btCollisionObject* planeObj = m_isSwapped? body0: body1;
+
+	btConvexShape* convexShape = (btConvexShape*) convexObj->getCollisionShape();
+	btStaticPlaneShape* planeShape = (btStaticPlaneShape*) planeObj->getCollisionShape();
+
+    
+	const btVector3& planeNormal = planeShape->getPlaneNormal();
+	//const btScalar& planeConstant = planeShape->getPlaneConstant();
+
+	//first perform a collision query with the non-perturbated collision objects
+	{
+		btQuaternion rotq(0,0,0,1);
+		collideSingleContact(rotq,body0,body1,dispatchInfo,resultOut);
+	}
+
+	if (resultOut->getPersistentManifold()->getNumContacts()<m_minimumPointsPerturbationThreshold)
+	{
+		btVector3 v0,v1;
+		btPlaneSpace1(planeNormal,v0,v1);
+		//now perform 'm_numPerturbationIterations' collision queries with the perturbated collision objects
+
+		const btScalar angleLimit = 0.125f * SIMD_PI;
+		btScalar perturbeAngle;
+		btScalar radius = convexShape->getAngularMotionDisc();
+		perturbeAngle = gContactBreakingThreshold / radius;
+		if ( perturbeAngle > angleLimit ) 
+				perturbeAngle = angleLimit;
+
+		btQuaternion perturbeRot(v0,perturbeAngle);
+		for (int i=0;i<m_numPerturbationIterations;i++)
+		{
+			btScalar iterationAngle = i*(SIMD_2_PI/btScalar(m_numPerturbationIterations));
+			btQuaternion rotq(planeNormal,iterationAngle);
+			collideSingleContact(rotq.inverse()*perturbeRot*rotq,body0,body1,dispatchInfo,resultOut);
+		}
+	}
+
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr->getNumContacts())
+		{
+			resultOut->refreshContactPoints();
+		}
+	}
+}
+
+btScalar btConvexPlaneCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)resultOut;
+	(void)dispatchInfo;
+	(void)col0;
+	(void)col1;
+
+	//not yet
+	return btScalar(1.);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
new file mode 100644
index 0000000..a3d59f4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
@@ -0,0 +1,84 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
+#define BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
+
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+class btPersistentManifold;
+#include "btCollisionDispatcher.h"
+
+#include "LinearMath/btVector3.h"
+
+/// btSphereBoxCollisionAlgorithm  provides sphere-box collision detection.
+/// Other features are frame-coherency (persistent data) and collision response.
+class btConvexPlaneCollisionAlgorithm : public btCollisionAlgorithm
+{
+	bool		m_ownManifold;
+	btPersistentManifold*	m_manifoldPtr;
+	bool		m_isSwapped;
+	int			m_numPerturbationIterations;
+	int			m_minimumPointsPerturbationThreshold;
+
+public:
+
+	btConvexPlaneCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped, int numPerturbationIterations,int minimumPointsPerturbationThreshold);
+
+	virtual ~btConvexPlaneCollisionAlgorithm();
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	void collideSingleContact (const btQuaternion& perturbeRot, btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		if (m_manifoldPtr && m_ownManifold)
+		{
+			manifoldArray.push_back(m_manifoldPtr);
+		}
+	}
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		int	m_numPerturbationIterations;
+		int m_minimumPointsPerturbationThreshold;
+			
+		CreateFunc() 
+			: m_numPerturbationIterations(1),
+			m_minimumPointsPerturbationThreshold(1)
+		{
+		}
+		
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexPlaneCollisionAlgorithm));
+			if (!m_swapped)
+			{
+				return new(mem) btConvexPlaneCollisionAlgorithm(0,ci,body0,body1,false,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);
+			} else
+			{
+				return new(mem) btConvexPlaneCollisionAlgorithm(0,ci,body0,body1,true,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);
+			}
+		}
+	};
+
+};
+
+#endif //BT_CONVEX_PLANE_COLLISION_ALGORITHM_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
new file mode 100644
index 0000000..c27d8ce
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
@@ -0,0 +1,298 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btDefaultCollisionConfiguration.h"
+
+#include "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h"
+#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
+#include "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h"
+#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
+#include "BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+
+
+
+#include "LinearMath/btStackAlloc.h"
+#include "LinearMath/btPoolAllocator.h"
+
+
+
+
+
+btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo& constructionInfo)
+//btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(btStackAlloc*	stackAlloc,btPoolAllocator*	persistentManifoldPool,btPoolAllocator*	collisionAlgorithmPool)
+{
+
+	void* mem = btAlignedAlloc(sizeof(btVoronoiSimplexSolver),16);
+	m_simplexSolver = new (mem)btVoronoiSimplexSolver();
+
+	if (constructionInfo.m_useEpaPenetrationAlgorithm)
+	{
+		mem = btAlignedAlloc(sizeof(btGjkEpaPenetrationDepthSolver),16);
+		m_pdSolver = new (mem)btGjkEpaPenetrationDepthSolver;
+	}else
+	{
+		mem = btAlignedAlloc(sizeof(btMinkowskiPenetrationDepthSolver),16);
+		m_pdSolver = new (mem)btMinkowskiPenetrationDepthSolver;
+	}
+	
+	//default CreationFunctions, filling the m_doubleDispatch table
+	mem = btAlignedAlloc(sizeof(btConvexConvexAlgorithm::CreateFunc),16);
+	m_convexConvexCreateFunc = new(mem) btConvexConvexAlgorithm::CreateFunc(m_simplexSolver,m_pdSolver);
+	mem = btAlignedAlloc(sizeof(btConvexConcaveCollisionAlgorithm::CreateFunc),16);
+	m_convexConcaveCreateFunc = new (mem)btConvexConcaveCollisionAlgorithm::CreateFunc;
+	mem = btAlignedAlloc(sizeof(btConvexConcaveCollisionAlgorithm::CreateFunc),16);
+	m_swappedConvexConcaveCreateFunc = new (mem)btConvexConcaveCollisionAlgorithm::SwappedCreateFunc;
+	mem = btAlignedAlloc(sizeof(btCompoundCollisionAlgorithm::CreateFunc),16);
+	m_compoundCreateFunc = new (mem)btCompoundCollisionAlgorithm::CreateFunc;
+	mem = btAlignedAlloc(sizeof(btCompoundCollisionAlgorithm::SwappedCreateFunc),16);
+	m_swappedCompoundCreateFunc = new (mem)btCompoundCollisionAlgorithm::SwappedCreateFunc;
+	mem = btAlignedAlloc(sizeof(btEmptyAlgorithm::CreateFunc),16);
+	m_emptyCreateFunc = new(mem) btEmptyAlgorithm::CreateFunc;
+	
+	mem = btAlignedAlloc(sizeof(btSphereSphereCollisionAlgorithm::CreateFunc),16);
+	m_sphereSphereCF = new(mem) btSphereSphereCollisionAlgorithm::CreateFunc;
+#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
+	mem = btAlignedAlloc(sizeof(btSphereBoxCollisionAlgorithm::CreateFunc),16);
+	m_sphereBoxCF = new(mem) btSphereBoxCollisionAlgorithm::CreateFunc;
+	mem = btAlignedAlloc(sizeof(btSphereBoxCollisionAlgorithm::CreateFunc),16);
+	m_boxSphereCF = new (mem)btSphereBoxCollisionAlgorithm::CreateFunc;
+	m_boxSphereCF->m_swapped = true;
+#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
+
+	mem = btAlignedAlloc(sizeof(btSphereTriangleCollisionAlgorithm::CreateFunc),16);
+	m_sphereTriangleCF = new (mem)btSphereTriangleCollisionAlgorithm::CreateFunc;
+	mem = btAlignedAlloc(sizeof(btSphereTriangleCollisionAlgorithm::CreateFunc),16);
+	m_triangleSphereCF = new (mem)btSphereTriangleCollisionAlgorithm::CreateFunc;
+	m_triangleSphereCF->m_swapped = true;
+	
+	mem = btAlignedAlloc(sizeof(btBoxBoxCollisionAlgorithm::CreateFunc),16);
+	m_boxBoxCF = new(mem)btBoxBoxCollisionAlgorithm::CreateFunc;
+
+	//convex versus plane
+	mem = btAlignedAlloc (sizeof(btConvexPlaneCollisionAlgorithm::CreateFunc),16);
+	m_convexPlaneCF = new (mem) btConvexPlaneCollisionAlgorithm::CreateFunc;
+	mem = btAlignedAlloc (sizeof(btConvexPlaneCollisionAlgorithm::CreateFunc),16);
+	m_planeConvexCF = new (mem) btConvexPlaneCollisionAlgorithm::CreateFunc;
+	m_planeConvexCF->m_swapped = true;
+	
+	///calculate maximum element size, big enough to fit any collision algorithm in the memory pool
+	int maxSize = sizeof(btConvexConvexAlgorithm);
+	int maxSize2 = sizeof(btConvexConcaveCollisionAlgorithm);
+	int maxSize3 = sizeof(btCompoundCollisionAlgorithm);
+	int sl = sizeof(btConvexSeparatingDistanceUtil);
+	sl = sizeof(btGjkPairDetector);
+	int	collisionAlgorithmMaxElementSize = btMax(maxSize,constructionInfo.m_customCollisionAlgorithmMaxElementSize);
+	collisionAlgorithmMaxElementSize = btMax(collisionAlgorithmMaxElementSize,maxSize2);
+	collisionAlgorithmMaxElementSize = btMax(collisionAlgorithmMaxElementSize,maxSize3);
+
+	if (constructionInfo.m_stackAlloc)
+	{
+		m_ownsStackAllocator = false;
+		this->m_stackAlloc = constructionInfo.m_stackAlloc;
+	} else
+	{
+		m_ownsStackAllocator = true;
+		void* mem = btAlignedAlloc(sizeof(btStackAlloc),16);
+		m_stackAlloc = new(mem)btStackAlloc(constructionInfo.m_defaultStackAllocatorSize);
+	}
+		
+	if (constructionInfo.m_persistentManifoldPool)
+	{
+		m_ownsPersistentManifoldPool = false;
+		m_persistentManifoldPool = constructionInfo.m_persistentManifoldPool;
+	} else
+	{
+		m_ownsPersistentManifoldPool = true;
+		void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16);
+		m_persistentManifoldPool = new (mem) btPoolAllocator(sizeof(btPersistentManifold),constructionInfo.m_defaultMaxPersistentManifoldPoolSize);
+	}
+	
+	if (constructionInfo.m_collisionAlgorithmPool)
+	{
+		m_ownsCollisionAlgorithmPool = false;
+		m_collisionAlgorithmPool = constructionInfo.m_collisionAlgorithmPool;
+	} else
+	{
+		m_ownsCollisionAlgorithmPool = true;
+		void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16);
+		m_collisionAlgorithmPool = new(mem) btPoolAllocator(collisionAlgorithmMaxElementSize,constructionInfo.m_defaultMaxCollisionAlgorithmPoolSize);
+	}
+
+
+}
+
+btDefaultCollisionConfiguration::~btDefaultCollisionConfiguration()
+{
+	if (m_ownsStackAllocator)
+	{
+		m_stackAlloc->destroy();
+		m_stackAlloc->~btStackAlloc();
+		btAlignedFree(m_stackAlloc);
+	}
+	if (m_ownsCollisionAlgorithmPool)
+	{
+		m_collisionAlgorithmPool->~btPoolAllocator();
+		btAlignedFree(m_collisionAlgorithmPool);
+	}
+	if (m_ownsPersistentManifoldPool)
+	{
+		m_persistentManifoldPool->~btPoolAllocator();
+		btAlignedFree(m_persistentManifoldPool);
+	}
+
+	m_convexConvexCreateFunc->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree(	m_convexConvexCreateFunc);
+
+	m_convexConcaveCreateFunc->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_convexConcaveCreateFunc);
+	m_swappedConvexConcaveCreateFunc->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_swappedConvexConcaveCreateFunc);
+
+	m_compoundCreateFunc->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_compoundCreateFunc);
+
+	m_swappedCompoundCreateFunc->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_swappedCompoundCreateFunc);
+
+	m_emptyCreateFunc->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_emptyCreateFunc);
+
+	m_sphereSphereCF->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_sphereSphereCF);
+
+#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
+	m_sphereBoxCF->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_sphereBoxCF);
+	m_boxSphereCF->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_boxSphereCF);
+#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
+
+	m_sphereTriangleCF->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_sphereTriangleCF);
+	m_triangleSphereCF->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_triangleSphereCF);
+	m_boxBoxCF->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_boxBoxCF);
+
+	m_convexPlaneCF->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_convexPlaneCF);
+	m_planeConvexCF->~btCollisionAlgorithmCreateFunc();
+	btAlignedFree( m_planeConvexCF);
+
+	m_simplexSolver->~btVoronoiSimplexSolver();
+	btAlignedFree(m_simplexSolver);
+
+	m_pdSolver->~btConvexPenetrationDepthSolver();
+	
+	btAlignedFree(m_pdSolver);
+
+
+}
+
+
+btCollisionAlgorithmCreateFunc* btDefaultCollisionConfiguration::getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1)
+{
+
+
+
+	if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
+	{
+		return	m_sphereSphereCF;
+	}
+#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
+	if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE) && (proxyType1==BOX_SHAPE_PROXYTYPE))
+	{
+		return	m_sphereBoxCF;
+	}
+
+	if ((proxyType0 == BOX_SHAPE_PROXYTYPE ) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
+	{
+		return	m_boxSphereCF;
+	}
+#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
+
+
+	if ((proxyType0 == SPHERE_SHAPE_PROXYTYPE ) && (proxyType1==TRIANGLE_SHAPE_PROXYTYPE))
+	{
+		return	m_sphereTriangleCF;
+	}
+
+	if ((proxyType0 == TRIANGLE_SHAPE_PROXYTYPE  ) && (proxyType1==SPHERE_SHAPE_PROXYTYPE))
+	{
+		return	m_triangleSphereCF;
+	} 
+
+	if ((proxyType0 == BOX_SHAPE_PROXYTYPE) && (proxyType1 == BOX_SHAPE_PROXYTYPE))
+	{
+		return m_boxBoxCF;
+	}
+	
+	if (btBroadphaseProxy::isConvex(proxyType0) && (proxyType1 == STATIC_PLANE_PROXYTYPE))
+	{
+		return m_convexPlaneCF;
+	}
+
+	if (btBroadphaseProxy::isConvex(proxyType1) && (proxyType0 == STATIC_PLANE_PROXYTYPE))
+	{
+		return m_planeConvexCF;
+	}
+	
+
+
+	if (btBroadphaseProxy::isConvex(proxyType0) && btBroadphaseProxy::isConvex(proxyType1))
+	{
+		return m_convexConvexCreateFunc;
+	}
+
+	if (btBroadphaseProxy::isConvex(proxyType0) && btBroadphaseProxy::isConcave(proxyType1))
+	{
+		return m_convexConcaveCreateFunc;
+	}
+
+	if (btBroadphaseProxy::isConvex(proxyType1) && btBroadphaseProxy::isConcave(proxyType0))
+	{
+		return m_swappedConvexConcaveCreateFunc;
+	}
+
+	if (btBroadphaseProxy::isCompound(proxyType0))
+	{
+		return m_compoundCreateFunc;
+	} else
+	{
+		if (btBroadphaseProxy::isCompound(proxyType1))
+		{
+			return m_swappedCompoundCreateFunc;
+		}
+	}
+
+	//failed to find an algorithm
+	return m_emptyCreateFunc;
+}
+
+void btDefaultCollisionConfiguration::setConvexConvexMultipointIterations(int numPerturbationIterations, int minimumPointsPerturbationThreshold)
+{
+	btConvexConvexAlgorithm::CreateFunc* convexConvex = (btConvexConvexAlgorithm::CreateFunc*) m_convexConvexCreateFunc;
+	convexConvex->m_numPerturbationIterations = numPerturbationIterations;
+	convexConvex->m_minimumPointsPerturbationThreshold = minimumPointsPerturbationThreshold;
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h
new file mode 100644
index 0000000..6aa0d8c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h
@@ -0,0 +1,135 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_DEFAULT_COLLISION_CONFIGURATION
+#define BT_DEFAULT_COLLISION_CONFIGURATION
+
+#include "btCollisionConfiguration.h"
+class btVoronoiSimplexSolver;
+class btConvexPenetrationDepthSolver;
+
+struct	btDefaultCollisionConstructionInfo
+{
+	btStackAlloc*		m_stackAlloc;
+	btPoolAllocator*	m_persistentManifoldPool;
+	btPoolAllocator*	m_collisionAlgorithmPool;
+	int					m_defaultMaxPersistentManifoldPoolSize;
+	int					m_defaultMaxCollisionAlgorithmPoolSize;
+	int					m_customCollisionAlgorithmMaxElementSize;
+	int					m_defaultStackAllocatorSize;
+	int					m_useEpaPenetrationAlgorithm;
+
+	btDefaultCollisionConstructionInfo()
+		:m_stackAlloc(0),
+		m_persistentManifoldPool(0),
+		m_collisionAlgorithmPool(0),
+		m_defaultMaxPersistentManifoldPoolSize(4096),
+		m_defaultMaxCollisionAlgorithmPoolSize(4096),
+		m_customCollisionAlgorithmMaxElementSize(0),
+		m_defaultStackAllocatorSize(0),
+		m_useEpaPenetrationAlgorithm(true)
+	{
+	}
+};
+
+
+
+///btCollisionConfiguration allows to configure Bullet collision detection
+///stack allocator, pool memory allocators
+///@todo: describe the meaning
+class	btDefaultCollisionConfiguration : public btCollisionConfiguration
+{
+
+protected:
+
+	int	m_persistentManifoldPoolSize;
+	
+	btStackAlloc*	m_stackAlloc;
+	bool	m_ownsStackAllocator;
+
+	btPoolAllocator*	m_persistentManifoldPool;
+	bool	m_ownsPersistentManifoldPool;
+
+
+	btPoolAllocator*	m_collisionAlgorithmPool;
+	bool	m_ownsCollisionAlgorithmPool;
+
+	//default simplex/penetration depth solvers
+	btVoronoiSimplexSolver*	m_simplexSolver;
+	btConvexPenetrationDepthSolver*	m_pdSolver;
+	
+	//default CreationFunctions, filling the m_doubleDispatch table
+	btCollisionAlgorithmCreateFunc*	m_convexConvexCreateFunc;
+	btCollisionAlgorithmCreateFunc*	m_convexConcaveCreateFunc;
+	btCollisionAlgorithmCreateFunc*	m_swappedConvexConcaveCreateFunc;
+	btCollisionAlgorithmCreateFunc*	m_compoundCreateFunc;
+	btCollisionAlgorithmCreateFunc*	m_swappedCompoundCreateFunc;
+	btCollisionAlgorithmCreateFunc* m_emptyCreateFunc;
+	btCollisionAlgorithmCreateFunc* m_sphereSphereCF;
+#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM
+	btCollisionAlgorithmCreateFunc* m_sphereBoxCF;
+	btCollisionAlgorithmCreateFunc* m_boxSphereCF;
+#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM
+
+	btCollisionAlgorithmCreateFunc* m_boxBoxCF;
+	btCollisionAlgorithmCreateFunc*	m_sphereTriangleCF;
+	btCollisionAlgorithmCreateFunc*	m_triangleSphereCF;
+	btCollisionAlgorithmCreateFunc*	m_planeConvexCF;
+	btCollisionAlgorithmCreateFunc*	m_convexPlaneCF;
+	
+public:
+
+
+	btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo& constructionInfo = btDefaultCollisionConstructionInfo());
+
+	virtual ~btDefaultCollisionConfiguration();
+
+		///memory pools
+	virtual btPoolAllocator* getPersistentManifoldPool()
+	{
+		return m_persistentManifoldPool;
+	}
+
+	virtual btPoolAllocator* getCollisionAlgorithmPool()
+	{
+		return m_collisionAlgorithmPool;
+	}
+
+	virtual btStackAlloc*	getStackAllocator()
+	{
+		return m_stackAlloc;
+	}
+
+	virtual	btVoronoiSimplexSolver*	getSimplexSolver()
+	{
+		return m_simplexSolver;
+	}
+
+
+	virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1);
+
+	///Use this method to allow to generate multiple contact points between at once, between two objects using the generic convex-convex algorithm.
+	///By default, this feature is disabled for best performance.
+	///@param numPerturbationIterations controls the number of collision queries. Set it to zero to disable the feature.
+	///@param minimumPointsPerturbationThreshold is the minimum number of points in the contact cache, above which the feature is disabled
+	///3 is a good value for both params, if you want to enable the feature. This is because the default contact cache contains a maximum of 4 points, and one collision query at the unperturbed orientation is performed first.
+	///See Bullet/Demos/CollisionDemo for an example how this feature gathers multiple points.
+	///@todo we could add a per-object setting of those parameters, for level-of-detail collision detection.
+	void	setConvexConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold = 3);
+
+};
+
+#endif //BT_DEFAULT_COLLISION_CONFIGURATION
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
new file mode 100644
index 0000000..9360543
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
@@ -0,0 +1,34 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btEmptyCollisionAlgorithm.h"
+
+
+
+btEmptyAlgorithm::btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
+	: btCollisionAlgorithm(ci)
+{
+}
+
+void btEmptyAlgorithm::processCollision (btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* )
+{
+}
+
+btScalar btEmptyAlgorithm::calculateTimeOfImpact(btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* )
+{
+	return btScalar(1.);
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h
new file mode 100644
index 0000000..f03c9dc
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h
@@ -0,0 +1,54 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_EMPTY_ALGORITH
+#define BT_EMPTY_ALGORITH
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+#include "btCollisionCreateFunc.h"
+#include "btCollisionDispatcher.h"
+
+#define ATTRIBUTE_ALIGNED(a)
+
+///EmptyAlgorithm is a stub for unsupported collision pairs.
+///The dispatcher can dispatch a persistent btEmptyAlgorithm to avoid a search every frame.
+class btEmptyAlgorithm : public btCollisionAlgorithm
+{
+
+public:
+	
+	btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci);
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+	}
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			(void)body0;
+			(void)body1;
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btEmptyAlgorithm));
+			return new(mem) btEmptyAlgorithm(ci);
+		}
+	};
+
+} ATTRIBUTE_ALIGNED(16);
+
+#endif //BT_EMPTY_ALGORITH
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.cpp
new file mode 100644
index 0000000..86141fa
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.cpp
@@ -0,0 +1,171 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btGhostObject.h"
+#include "btCollisionWorld.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "LinearMath/btAabbUtil2.h"
+
+btGhostObject::btGhostObject()
+{
+	m_internalType = CO_GHOST_OBJECT;
+}
+
+btGhostObject::~btGhostObject()
+{
+	///btGhostObject should have been removed from the world, so no overlapping objects
+	btAssert(!m_overlappingObjects.size());
+}
+
+
+void btGhostObject::addOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btBroadphaseProxy* thisProxy)
+{
+	btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject;
+	btAssert(otherObject);
+	///if this linearSearch becomes too slow (too many overlapping objects) we should add a more appropriate data structure
+	int index = m_overlappingObjects.findLinearSearch(otherObject);
+	if (index==m_overlappingObjects.size())
+	{
+		//not found
+		m_overlappingObjects.push_back(otherObject);
+	}
+}
+
+void btGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy)
+{
+	btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject;
+	btAssert(otherObject);
+	int index = m_overlappingObjects.findLinearSearch(otherObject);
+	if (index<m_overlappingObjects.size())
+	{
+		m_overlappingObjects[index] = m_overlappingObjects[m_overlappingObjects.size()-1];
+		m_overlappingObjects.pop_back();
+	}
+}
+
+
+btPairCachingGhostObject::btPairCachingGhostObject()
+{
+	m_hashPairCache = new (btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache();
+}
+
+btPairCachingGhostObject::~btPairCachingGhostObject()
+{
+	m_hashPairCache->~btHashedOverlappingPairCache();
+	btAlignedFree( m_hashPairCache );
+}
+
+void btPairCachingGhostObject::addOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btBroadphaseProxy* thisProxy)
+{
+	btBroadphaseProxy*actualThisProxy = thisProxy ? thisProxy : getBroadphaseHandle();
+	btAssert(actualThisProxy);
+
+	btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject;
+	btAssert(otherObject);
+	int index = m_overlappingObjects.findLinearSearch(otherObject);
+	if (index==m_overlappingObjects.size())
+	{
+		m_overlappingObjects.push_back(otherObject);
+		m_hashPairCache->addOverlappingPair(actualThisProxy,otherProxy);
+	}
+}
+
+void btPairCachingGhostObject::removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy1)
+{
+	btCollisionObject* otherObject = (btCollisionObject*)otherProxy->m_clientObject;
+	btBroadphaseProxy* actualThisProxy = thisProxy1 ? thisProxy1 : getBroadphaseHandle();
+	btAssert(actualThisProxy);
+
+	btAssert(otherObject);
+	int index = m_overlappingObjects.findLinearSearch(otherObject);
+	if (index<m_overlappingObjects.size())
+	{
+		m_overlappingObjects[index] = m_overlappingObjects[m_overlappingObjects.size()-1];
+		m_overlappingObjects.pop_back();
+		m_hashPairCache->removeOverlappingPair(actualThisProxy,otherProxy,dispatcher);
+	}
+}
+
+
+void	btGhostObject::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration) const
+{
+	btTransform	convexFromTrans,convexToTrans;
+	convexFromTrans = convexFromWorld;
+	convexToTrans = convexToWorld;
+	btVector3 castShapeAabbMin, castShapeAabbMax;
+	/* Compute AABB that encompasses angular movement */
+	{
+		btVector3 linVel, angVel;
+		btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel);
+		btTransform R;
+		R.setIdentity ();
+		R.setRotation (convexFromTrans.getRotation());
+		castShape->calculateTemporalAabb (R, linVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax);
+	}
+
+	/// go over all objects, and if the ray intersects their aabb + cast shape aabb,
+	// do a ray-shape query using convexCaster (CCD)
+	int i;
+	for (i=0;i<m_overlappingObjects.size();i++)
+	{
+		btCollisionObject*	collisionObject= m_overlappingObjects[i];
+		//only perform raycast if filterMask matches
+		if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) {
+			//RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
+			btVector3 collisionObjectAabbMin,collisionObjectAabbMax;
+			collisionObject->getCollisionShape()->getAabb(collisionObject->getWorldTransform(),collisionObjectAabbMin,collisionObjectAabbMax);
+			AabbExpand (collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax);
+			btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing
+			btVector3 hitNormal;
+			if (btRayAabb(convexFromWorld.getOrigin(),convexToWorld.getOrigin(),collisionObjectAabbMin,collisionObjectAabbMax,hitLambda,hitNormal))
+			{
+				btCollisionWorld::objectQuerySingle(castShape, convexFromTrans,convexToTrans,
+					collisionObject,
+						collisionObject->getCollisionShape(),
+						collisionObject->getWorldTransform(),
+						resultCallback,
+						allowedCcdPenetration);
+			}
+		}
+	}
+
+}
+
+void	btGhostObject::rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const
+{
+	btTransform rayFromTrans;
+	rayFromTrans.setIdentity();
+	rayFromTrans.setOrigin(rayFromWorld);
+	btTransform  rayToTrans;
+	rayToTrans.setIdentity();
+	rayToTrans.setOrigin(rayToWorld);
+
+
+	int i;
+	for (i=0;i<m_overlappingObjects.size();i++)
+	{
+		btCollisionObject*	collisionObject= m_overlappingObjects[i];
+		//only perform raycast if filterMask matches
+		if(resultCallback.needsCollision(collisionObject->getBroadphaseHandle())) 
+		{
+			btCollisionWorld::rayTestSingle(rayFromTrans,rayToTrans,
+							collisionObject,
+								collisionObject->getCollisionShape(),
+								collisionObject->getWorldTransform(),
+								resultCallback);
+		}
+	}
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.h
new file mode 100644
index 0000000..8ec8613
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btGhostObject.h
@@ -0,0 +1,175 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_GHOST_OBJECT_H
+#define BT_GHOST_OBJECT_H
+
+
+#include "btCollisionObject.h"
+#include "BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h"
+#include "LinearMath/btAlignedAllocator.h"
+#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
+#include "btCollisionWorld.h"
+
+class btConvexShape;
+
+class btDispatcher;
+
+///The btGhostObject can keep track of all objects that are overlapping
+///By default, this overlap is based on the AABB
+///This is useful for creating a character controller, collision sensors/triggers, explosions etc.
+///We plan on adding rayTest and other queries for the btGhostObject
+ATTRIBUTE_ALIGNED16(class) btGhostObject : public btCollisionObject
+{
+protected:
+
+	btAlignedObjectArray<btCollisionObject*> m_overlappingObjects;
+
+public:
+
+	btGhostObject();
+
+	virtual ~btGhostObject();
+
+	void	convexSweepTest(const class btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration = 0.f) const;
+
+	void	rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const; 
+
+	///this method is mainly for expert/internal use only.
+	virtual void	addOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btBroadphaseProxy* thisProxy=0);
+	///this method is mainly for expert/internal use only.
+	virtual void	removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy=0);
+
+	int	getNumOverlappingObjects() const
+	{
+		return m_overlappingObjects.size();
+	}
+
+	btCollisionObject*	getOverlappingObject(int index)
+	{
+		return m_overlappingObjects[index];
+	}
+
+	const btCollisionObject*	getOverlappingObject(int index) const
+	{
+		return m_overlappingObjects[index];
+	}
+
+	btAlignedObjectArray<btCollisionObject*>&	getOverlappingPairs()
+	{
+		return m_overlappingObjects;
+	}
+
+	const btAlignedObjectArray<btCollisionObject*>	getOverlappingPairs() const
+	{
+		return m_overlappingObjects;
+	}
+
+	//
+	// internal cast
+	//
+
+	static const btGhostObject*	upcast(const btCollisionObject* colObj)
+	{
+		if (colObj->getInternalType()==CO_GHOST_OBJECT)
+			return (const btGhostObject*)colObj;
+		return 0;
+	}
+	static btGhostObject*			upcast(btCollisionObject* colObj)
+	{
+		if (colObj->getInternalType()==CO_GHOST_OBJECT)
+			return (btGhostObject*)colObj;
+		return 0;
+	}
+
+};
+
+class	btPairCachingGhostObject : public btGhostObject
+{
+	btHashedOverlappingPairCache*	m_hashPairCache;
+
+public:
+
+	btPairCachingGhostObject();
+
+	virtual ~btPairCachingGhostObject();
+
+	///this method is mainly for expert/internal use only.
+	virtual void	addOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btBroadphaseProxy* thisProxy=0);
+
+	virtual void	removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy=0);
+
+	btHashedOverlappingPairCache*	getOverlappingPairCache()
+	{
+		return m_hashPairCache;
+	}
+
+};
+
+
+
+///The btGhostPairCallback interfaces and forwards adding and removal of overlapping pairs from the btBroadphaseInterface to btGhostObject.
+class btGhostPairCallback : public btOverlappingPairCallback
+{
+	
+public:
+	btGhostPairCallback()
+	{
+	}
+
+	virtual ~btGhostPairCallback()
+	{
+		
+	}
+
+	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)
+	{
+		btCollisionObject* colObj0 = (btCollisionObject*) proxy0->m_clientObject;
+		btCollisionObject* colObj1 = (btCollisionObject*) proxy1->m_clientObject;
+		btGhostObject* ghost0 = 		btGhostObject::upcast(colObj0);
+		btGhostObject* ghost1 = 		btGhostObject::upcast(colObj1);
+		if (ghost0)
+			ghost0->addOverlappingObjectInternal(proxy1, proxy0);
+		if (ghost1)
+			ghost1->addOverlappingObjectInternal(proxy0, proxy1);
+		return 0;
+	}
+
+	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher)
+	{
+		btCollisionObject* colObj0 = (btCollisionObject*) proxy0->m_clientObject;
+		btCollisionObject* colObj1 = (btCollisionObject*) proxy1->m_clientObject;
+		btGhostObject* ghost0 = 		btGhostObject::upcast(colObj0);
+		btGhostObject* ghost1 = 		btGhostObject::upcast(colObj1);
+		if (ghost0)
+			ghost0->removeOverlappingObjectInternal(proxy1,dispatcher,proxy0);
+		if (ghost1)
+			ghost1->removeOverlappingObjectInternal(proxy0,dispatcher,proxy1);
+		return 0;
+	}
+
+	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* /*proxy0*/,btDispatcher* /*dispatcher*/)
+	{
+		btAssert(0);
+		//need to keep track of all ghost objects and call them here
+		//m_hashPairCache->removeOverlappingPairsContainingProxy(proxy0,dispatcher);
+	}
+
+	
+
+};
+
+#endif
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
new file mode 100644
index 0000000..3ebe3ed
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
@@ -0,0 +1,842 @@
+#include "btInternalEdgeUtility.h"
+
+#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
+#include "LinearMath/btIDebugDraw.h"
+
+
+//#define DEBUG_INTERNAL_EDGE
+
+#ifdef DEBUG_INTERNAL_EDGE
+#include <stdio.h>
+#endif //DEBUG_INTERNAL_EDGE
+
+
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+static btIDebugDraw* gDebugDrawer = 0;
+
+void	btSetDebugDrawer(btIDebugDraw* debugDrawer)
+{
+	gDebugDrawer = debugDrawer;
+}
+
+static void    btDebugDrawLine(const btVector3& from,const btVector3& to, const btVector3& color)
+{
+	if (gDebugDrawer)
+		gDebugDrawer->drawLine(from,to,color);
+}
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+
+static int	btGetHash(int partId, int triangleIndex)
+{
+	int hash = (partId<<(31-MAX_NUM_PARTS_IN_BITS)) | triangleIndex;
+	return hash;
+}
+
+
+
+static btScalar btGetAngle(const btVector3& edgeA, const btVector3& normalA,const btVector3& normalB)
+{
+	const btVector3 refAxis0  = edgeA;
+	const btVector3 refAxis1  = normalA;
+	const btVector3 swingAxis = normalB;
+	btScalar angle = btAtan2(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1));
+	return  angle;
+}
+
+
+struct btConnectivityProcessor : public btTriangleCallback
+{
+	int				m_partIdA;
+	int				m_triangleIndexA;
+	btVector3*		m_triangleVerticesA;
+	btTriangleInfoMap*	m_triangleInfoMap;
+
+
+	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
+	{
+		//skip self-collisions
+		if ((m_partIdA == partId) && (m_triangleIndexA == triangleIndex))
+			return;
+
+		//skip duplicates (disabled for now)
+		//if ((m_partIdA <= partId) && (m_triangleIndexA <= triangleIndex))
+		//	return;
+
+		//search for shared vertices and edges
+		int numshared = 0;
+		int sharedVertsA[3]={-1,-1,-1};
+		int sharedVertsB[3]={-1,-1,-1};
+
+		///skip degenerate triangles
+		btScalar crossBSqr = ((triangle[1]-triangle[0]).cross(triangle[2]-triangle[0])).length2();
+		if (crossBSqr < m_triangleInfoMap->m_equalVertexThreshold)
+			return;
+
+
+		btScalar crossASqr = ((m_triangleVerticesA[1]-m_triangleVerticesA[0]).cross(m_triangleVerticesA[2]-m_triangleVerticesA[0])).length2();
+		///skip degenerate triangles
+		if (crossASqr< m_triangleInfoMap->m_equalVertexThreshold)
+			return;
+
+#if 0
+		printf("triangle A[0]	=	(%f,%f,%f)\ntriangle A[1]	=	(%f,%f,%f)\ntriangle A[2]	=	(%f,%f,%f)\n",
+			m_triangleVerticesA[0].getX(),m_triangleVerticesA[0].getY(),m_triangleVerticesA[0].getZ(),
+			m_triangleVerticesA[1].getX(),m_triangleVerticesA[1].getY(),m_triangleVerticesA[1].getZ(),
+			m_triangleVerticesA[2].getX(),m_triangleVerticesA[2].getY(),m_triangleVerticesA[2].getZ());
+
+		printf("partId=%d, triangleIndex=%d\n",partId,triangleIndex);
+		printf("triangle B[0]	=	(%f,%f,%f)\ntriangle B[1]	=	(%f,%f,%f)\ntriangle B[2]	=	(%f,%f,%f)\n",
+			triangle[0].getX(),triangle[0].getY(),triangle[0].getZ(),
+			triangle[1].getX(),triangle[1].getY(),triangle[1].getZ(),
+			triangle[2].getX(),triangle[2].getY(),triangle[2].getZ());
+#endif
+
+		for (int i=0;i<3;i++)
+		{
+			for (int j=0;j<3;j++)
+			{
+				if ( (m_triangleVerticesA[i]-triangle[j]).length2() < m_triangleInfoMap->m_equalVertexThreshold)
+				{
+					sharedVertsA[numshared] = i;
+					sharedVertsB[numshared] = j;
+					numshared++;
+					///degenerate case
+					if(numshared >= 3)
+						return;
+				}
+			}
+			///degenerate case
+			if(numshared >= 3)
+				return;
+		}
+		switch (numshared)
+		{
+		case 0:
+			{
+				break;
+			}
+		case 1:
+			{
+				//shared vertex
+				break;
+			}
+		case 2:
+			{
+				//shared edge
+				//we need to make sure the edge is in the order V2V0 and not V0V2 so that the signs are correct
+				if (sharedVertsA[0] == 0 && sharedVertsA[1] == 2)
+				{
+					sharedVertsA[0] = 2;
+					sharedVertsA[1] = 0;
+					int tmp = sharedVertsB[1];
+					sharedVertsB[1] = sharedVertsB[0];
+					sharedVertsB[0] = tmp;
+				}
+
+				int hash = btGetHash(m_partIdA,m_triangleIndexA);
+
+				btTriangleInfo* info = m_triangleInfoMap->find(hash);
+				if (!info)
+				{
+					btTriangleInfo tmp;
+					m_triangleInfoMap->insert(hash,tmp);
+					info = m_triangleInfoMap->find(hash);
+				}
+
+				int sumvertsA = sharedVertsA[0]+sharedVertsA[1];
+				int otherIndexA = 3-sumvertsA;
+
+				
+				btVector3 edge(m_triangleVerticesA[sharedVertsA[1]]-m_triangleVerticesA[sharedVertsA[0]]);
+
+				btTriangleShape tA(m_triangleVerticesA[0],m_triangleVerticesA[1],m_triangleVerticesA[2]);
+				int otherIndexB = 3-(sharedVertsB[0]+sharedVertsB[1]);
+
+				btTriangleShape tB(triangle[sharedVertsB[1]],triangle[sharedVertsB[0]],triangle[otherIndexB]);
+				//btTriangleShape tB(triangle[0],triangle[1],triangle[2]);
+
+				btVector3 normalA;
+				btVector3 normalB;
+				tA.calcNormal(normalA);
+				tB.calcNormal(normalB);
+				edge.normalize();
+				btVector3 edgeCrossA = edge.cross(normalA).normalize();
+
+				{
+					btVector3 tmp = m_triangleVerticesA[otherIndexA]-m_triangleVerticesA[sharedVertsA[0]];
+					if (edgeCrossA.dot(tmp) < 0)
+					{
+						edgeCrossA*=-1;
+					}
+				}
+
+				btVector3 edgeCrossB = edge.cross(normalB).normalize();
+
+				{
+					btVector3 tmp = triangle[otherIndexB]-triangle[sharedVertsB[0]];
+					if (edgeCrossB.dot(tmp) < 0)
+					{
+						edgeCrossB*=-1;
+					}
+				}
+
+				btScalar	angle2 = 0;
+				btScalar	ang4 = 0.f;
+
+
+				btVector3 calculatedEdge = edgeCrossA.cross(edgeCrossB);
+				btScalar len2 = calculatedEdge.length2();
+
+				btScalar correctedAngle(0);
+				btVector3 calculatedNormalB = normalA;
+				bool isConvex = false;
+
+				if (len2<m_triangleInfoMap->m_planarEpsilon)
+				{
+					angle2 = 0.f;
+					ang4 = 0.f;
+				} else
+				{
+
+					calculatedEdge.normalize();
+					btVector3 calculatedNormalA = calculatedEdge.cross(edgeCrossA);
+					calculatedNormalA.normalize();
+					angle2 = btGetAngle(calculatedNormalA,edgeCrossA,edgeCrossB);
+					ang4 = SIMD_PI-angle2;
+					btScalar dotA = normalA.dot(edgeCrossB);
+					///@todo: check if we need some epsilon, due to floating point imprecision
+					isConvex = (dotA<0.);
+
+					correctedAngle = isConvex ? ang4 : -ang4;
+					btQuaternion orn2(calculatedEdge,-correctedAngle);
+					calculatedNormalB = btMatrix3x3(orn2)*normalA;
+
+
+				}
+
+				
+
+				
+							
+				//alternatively use 
+				//btVector3 calculatedNormalB2 = quatRotate(orn,normalA);
+
+
+				switch (sumvertsA)
+				{
+				case 1:
+					{
+						btVector3 edge = m_triangleVerticesA[0]-m_triangleVerticesA[1];
+						btQuaternion orn(edge,-correctedAngle);
+						btVector3 computedNormalB = quatRotate(orn,normalA);
+						btScalar bla = computedNormalB.dot(normalB);
+						if (bla<0)
+						{
+							computedNormalB*=-1;
+							info->m_flags |= TRI_INFO_V0V1_SWAP_NORMALB;
+						}
+#ifdef DEBUG_INTERNAL_EDGE
+						if ((computedNormalB-normalB).length()>0.0001)
+						{
+							printf("warning: normals not identical\n");
+						}
+#endif//DEBUG_INTERNAL_EDGE
+
+						info->m_edgeV0V1Angle = -correctedAngle;
+
+						if (isConvex)
+							info->m_flags |= TRI_INFO_V0V1_CONVEX;
+						break;
+					}
+				case 2:
+					{
+						btVector3 edge = m_triangleVerticesA[2]-m_triangleVerticesA[0];
+						btQuaternion orn(edge,-correctedAngle);
+						btVector3 computedNormalB = quatRotate(orn,normalA);
+						if (computedNormalB.dot(normalB)<0)
+						{
+							computedNormalB*=-1;
+							info->m_flags |= TRI_INFO_V2V0_SWAP_NORMALB;
+						}
+
+#ifdef DEBUG_INTERNAL_EDGE
+						if ((computedNormalB-normalB).length()>0.0001)
+						{
+							printf("warning: normals not identical\n");
+						}
+#endif //DEBUG_INTERNAL_EDGE
+						info->m_edgeV2V0Angle = -correctedAngle;
+						if (isConvex)
+							info->m_flags |= TRI_INFO_V2V0_CONVEX;
+						break;	
+					}
+				case 3:
+					{
+						btVector3 edge = m_triangleVerticesA[1]-m_triangleVerticesA[2];
+						btQuaternion orn(edge,-correctedAngle);
+						btVector3 computedNormalB = quatRotate(orn,normalA);
+						if (computedNormalB.dot(normalB)<0)
+						{
+							info->m_flags |= TRI_INFO_V1V2_SWAP_NORMALB;
+							computedNormalB*=-1;
+						}
+#ifdef DEBUG_INTERNAL_EDGE
+						if ((computedNormalB-normalB).length()>0.0001)
+						{
+							printf("warning: normals not identical\n");
+						}
+#endif //DEBUG_INTERNAL_EDGE
+						info->m_edgeV1V2Angle = -correctedAngle;
+
+						if (isConvex)
+							info->m_flags |= TRI_INFO_V1V2_CONVEX;
+						break;
+					}
+				}
+
+				break;
+			}
+		default:
+			{
+				//				printf("warning: duplicate triangle\n");
+			}
+
+		}
+	}
+};
+/////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////
+
+void btGenerateInternalEdgeInfo (btBvhTriangleMeshShape*trimeshShape, btTriangleInfoMap* triangleInfoMap)
+{
+	//the user pointer shouldn't already be used for other purposes, we intend to store connectivity info there!
+	if (trimeshShape->getTriangleInfoMap())
+		return;
+
+	trimeshShape->setTriangleInfoMap(triangleInfoMap);
+
+	btStridingMeshInterface* meshInterface = trimeshShape->getMeshInterface();
+	const btVector3& meshScaling = meshInterface->getScaling();
+
+	for (int partId = 0; partId< meshInterface->getNumSubParts();partId++)
+	{
+		const unsigned char *vertexbase = 0;
+		int numverts = 0;
+		PHY_ScalarType type = PHY_INTEGER;
+		int stride = 0;
+		const unsigned char *indexbase = 0;
+		int indexstride = 0;
+		int numfaces = 0;
+		PHY_ScalarType indicestype = PHY_INTEGER;
+		//PHY_ScalarType indexType=0;
+
+		btVector3 triangleVerts[3];
+		meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,	type,stride,&indexbase,indexstride,numfaces,indicestype,partId);
+		btVector3 aabbMin,aabbMax;
+
+		for (int triangleIndex = 0 ; triangleIndex < numfaces;triangleIndex++)
+		{
+			unsigned int* gfxbase = (unsigned int*)(indexbase+triangleIndex*indexstride);
+
+			for (int j=2;j>=0;j--)
+			{
+
+				int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
+				if (type == PHY_FLOAT)
+				{
+					float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
+					triangleVerts[j] = btVector3(
+						graphicsbase[0]*meshScaling.getX(),
+						graphicsbase[1]*meshScaling.getY(),
+						graphicsbase[2]*meshScaling.getZ());
+				}
+				else
+				{
+					double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
+					triangleVerts[j] = btVector3( btScalar(graphicsbase[0]*meshScaling.getX()), btScalar(graphicsbase[1]*meshScaling.getY()), btScalar(graphicsbase[2]*meshScaling.getZ()));
+				}
+			}
+			aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+			aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)); 
+			aabbMin.setMin(triangleVerts[0]);
+			aabbMax.setMax(triangleVerts[0]);
+			aabbMin.setMin(triangleVerts[1]);
+			aabbMax.setMax(triangleVerts[1]);
+			aabbMin.setMin(triangleVerts[2]);
+			aabbMax.setMax(triangleVerts[2]);
+
+			btConnectivityProcessor connectivityProcessor;
+			connectivityProcessor.m_partIdA = partId;
+			connectivityProcessor.m_triangleIndexA = triangleIndex;
+			connectivityProcessor.m_triangleVerticesA = &triangleVerts[0];
+			connectivityProcessor.m_triangleInfoMap  = triangleInfoMap;
+
+			trimeshShape->processAllTriangles(&connectivityProcessor,aabbMin,aabbMax);
+		}
+
+	}
+
+}
+
+
+
+
+// Given a point and a line segment (defined by two points), compute the closest point
+// in the line.  Cap the point at the endpoints of the line segment.
+void btNearestPointInLineSegment(const btVector3 &point, const btVector3& line0, const btVector3& line1, btVector3& nearestPoint)
+{
+	btVector3 lineDelta     = line1 - line0;
+
+	// Handle degenerate lines
+	if ( lineDelta.fuzzyZero())
+	{
+		nearestPoint = line0;
+	}
+	else
+	{
+		btScalar delta = (point-line0).dot(lineDelta) / (lineDelta).dot(lineDelta);
+
+		// Clamp the point to conform to the segment's endpoints
+		if ( delta < 0 )
+			delta = 0;
+		else if ( delta > 1 )
+			delta = 1;
+
+		nearestPoint = line0 + lineDelta*delta;
+	}
+}
+
+
+
+
+bool	btClampNormal(const btVector3& edge,const btVector3& tri_normal_org,const btVector3& localContactNormalOnB, btScalar correctedEdgeAngle, btVector3 & clampedLocalNormal)
+{
+	btVector3 tri_normal = tri_normal_org;
+	//we only have a local triangle normal, not a local contact normal -> only normal in world space...
+	//either compute the current angle all in local space, or all in world space
+
+	btVector3 edgeCross = edge.cross(tri_normal).normalize();
+	btScalar curAngle = btGetAngle(edgeCross,tri_normal,localContactNormalOnB);
+
+	if (correctedEdgeAngle<0)
+	{
+		if (curAngle < correctedEdgeAngle)
+		{
+			btScalar diffAngle = correctedEdgeAngle-curAngle;
+			btQuaternion rotation(edge,diffAngle );
+			clampedLocalNormal = btMatrix3x3(rotation)*localContactNormalOnB;
+			return true;
+		}
+	}
+
+	if (correctedEdgeAngle>=0)
+	{
+		if (curAngle > correctedEdgeAngle)
+		{
+			btScalar diffAngle = correctedEdgeAngle-curAngle;
+			btQuaternion rotation(edge,diffAngle );
+			clampedLocalNormal = btMatrix3x3(rotation)*localContactNormalOnB;
+			return true;
+		}
+	}
+	return false;
+}
+
+
+
+/// Changes a btManifoldPoint collision normal to the normal from the mesh.
+void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObject* colObj0,const btCollisionObject* colObj1, int partId0, int index0, int normalAdjustFlags)
+{
+	//btAssert(colObj0->getCollisionShape()->getShapeType() == TRIANGLE_SHAPE_PROXYTYPE);
+	if (colObj0->getCollisionShape()->getShapeType() != TRIANGLE_SHAPE_PROXYTYPE)
+		return;
+
+	btBvhTriangleMeshShape* trimesh = 0;
+	
+	if( colObj0->getRootCollisionShape()->getShapeType() == SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE )
+	   trimesh = ((btScaledBvhTriangleMeshShape*)colObj0->getRootCollisionShape())->getChildShape();
+   else	   
+	   trimesh = (btBvhTriangleMeshShape*)colObj0->getRootCollisionShape();
+	   
+   	btTriangleInfoMap* triangleInfoMapPtr = (btTriangleInfoMap*) trimesh->getTriangleInfoMap();
+	if (!triangleInfoMapPtr)
+		return;
+
+	int hash = btGetHash(partId0,index0);
+
+
+	btTriangleInfo* info = triangleInfoMapPtr->find(hash);
+	if (!info)
+		return;
+
+	btScalar frontFacing = (normalAdjustFlags & BT_TRIANGLE_CONVEX_BACKFACE_MODE)==0? 1.f : -1.f;
+	
+	const btTriangleShape* tri_shape = static_cast<const btTriangleShape*>(colObj0->getCollisionShape());
+	btVector3 v0,v1,v2;
+	tri_shape->getVertex(0,v0);
+	tri_shape->getVertex(1,v1);
+	tri_shape->getVertex(2,v2);
+
+	btVector3 center = (v0+v1+v2)*btScalar(1./3.);
+
+	btVector3 red(1,0,0), green(0,1,0),blue(0,0,1),white(1,1,1),black(0,0,0);
+	btVector3 tri_normal;
+	tri_shape->calcNormal(tri_normal);
+
+	//btScalar dot = tri_normal.dot(cp.m_normalWorldOnB);
+	btVector3 nearest;
+	btNearestPointInLineSegment(cp.m_localPointB,v0,v1,nearest);
+
+	btVector3 contact = cp.m_localPointB;
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+	const btTransform& tr = colObj0->getWorldTransform();
+	btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,red);
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+
+
+	bool isNearEdge = false;
+
+	int numConcaveEdgeHits = 0;
+	int numConvexEdgeHits = 0;
+
+	btVector3 localContactNormalOnB = colObj0->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB;
+	localContactNormalOnB.normalize();//is this necessary?
+	
+	// Get closest edge
+	int      bestedge=-1;
+	float    disttobestedge=BT_LARGE_FLOAT;
+	//
+	// Edge 0 -> 1
+	if (btFabs(info->m_edgeV0V1Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
+	{	
+	   btVector3 nearest;
+	   btNearestPointInLineSegment( cp.m_localPointB, v0, v1, nearest );
+	   float     len=(contact-nearest).length();
+	   //
+	   if( len < disttobestedge )
+	   {
+	      bestedge=0;
+	      disttobestedge=len;
+      }	      
+   }	   
+	// Edge 1 -> 2
+	if (btFabs(info->m_edgeV1V2Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
+	{	
+	   btVector3 nearest;
+	   btNearestPointInLineSegment( cp.m_localPointB, v1, v2, nearest );
+	   float     len=(contact-nearest).length();
+	   //
+	   if( len < disttobestedge )
+	   {
+	      bestedge=1;
+	      disttobestedge=len;
+      }	      
+   }	   
+	// Edge 2 -> 0
+	if (btFabs(info->m_edgeV2V0Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
+	{	
+	   btVector3 nearest;
+	   btNearestPointInLineSegment( cp.m_localPointB, v2, v0, nearest );
+	   float     len=(contact-nearest).length();
+	   //
+	   if( len < disttobestedge )
+	   {
+	      bestedge=2;
+	      disttobestedge=len;
+      }	      
+   }   	      	
+	
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+   btVector3 upfix=tri_normal * btVector3(0.1f,0.1f,0.1f);
+   btDebugDrawLine(tr * v0 + upfix, tr * v1 + upfix, red );
+#endif   
+	if (btFabs(info->m_edgeV0V1Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
+	{
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+		btDebugDrawLine(tr*contact,tr*(contact+cp.m_normalWorldOnB*10),black);
+#endif
+		btScalar len = (contact-nearest).length();
+		if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
+		if( bestedge==0 )
+		{
+			btVector3 edge(v0-v1);
+			isNearEdge = true;
+
+			if (info->m_edgeV0V1Angle==btScalar(0))
+			{
+				numConcaveEdgeHits++;
+			} else
+			{
+
+				bool isEdgeConvex = (info->m_flags & TRI_INFO_V0V1_CONVEX);
+				btScalar swapFactor = isEdgeConvex ? btScalar(1) : btScalar(-1);
+	#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+				btDebugDrawLine(tr*nearest,tr*(nearest+swapFactor*tri_normal*10),white);
+	#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+				btVector3 nA = swapFactor * tri_normal;
+
+				btQuaternion orn(edge,info->m_edgeV0V1Angle);
+				btVector3 computedNormalB = quatRotate(orn,tri_normal);
+				if (info->m_flags & TRI_INFO_V0V1_SWAP_NORMALB)
+					computedNormalB*=-1;
+				btVector3 nB = swapFactor*computedNormalB;
+
+				btScalar	NdotA = localContactNormalOnB.dot(nA);
+				btScalar	NdotB = localContactNormalOnB.dot(nB);
+				bool backFacingNormal = (NdotA< triangleInfoMapPtr->m_convexEpsilon) && (NdotB<triangleInfoMapPtr->m_convexEpsilon);
+
+#ifdef DEBUG_INTERNAL_EDGE
+				{
+					
+					btDebugDrawLine(cp.getPositionWorldOnB(),cp.getPositionWorldOnB()+tr.getBasis()*(nB*20),red);
+				}
+#endif //DEBUG_INTERNAL_EDGE
+
+
+				if (backFacingNormal)
+				{
+					numConcaveEdgeHits++;
+				}
+				else
+				{
+					numConvexEdgeHits++;
+					btVector3 clampedLocalNormal;
+					bool isClamped = btClampNormal(edge,swapFactor*tri_normal,localContactNormalOnB, info->m_edgeV0V1Angle,clampedLocalNormal);
+					if (isClamped)
+					{
+						if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED)!=0) || (clampedLocalNormal.dot(frontFacing*tri_normal)>0))
+						{
+							btVector3 newNormal = colObj0->getWorldTransform().getBasis() * clampedLocalNormal;
+							//					cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB);
+							cp.m_normalWorldOnB = newNormal;
+							// Reproject collision point along normal. (what about cp.m_distance1?)
+							cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
+							cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);
+							
+						}
+					}
+				}
+			}
+		}
+	}
+
+	btNearestPointInLineSegment(contact,v1,v2,nearest);
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+	btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,green);
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+   btDebugDrawLine(tr * v1 + upfix, tr * v2 + upfix , green );
+#endif   
+
+	if (btFabs(info->m_edgeV1V2Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
+	{
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+		btDebugDrawLine(tr*contact,tr*(contact+cp.m_normalWorldOnB*10),black);
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+
+
+		btScalar len = (contact-nearest).length();
+		if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
+		if( bestedge==1 )
+		{
+			isNearEdge = true;
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+			btDebugDrawLine(tr*nearest,tr*(nearest+tri_normal*10),white);
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+			btVector3 edge(v1-v2);
+
+			isNearEdge = true;
+
+			if (info->m_edgeV1V2Angle == btScalar(0))
+			{
+				numConcaveEdgeHits++;
+			} else
+			{
+				bool isEdgeConvex = (info->m_flags & TRI_INFO_V1V2_CONVEX)!=0;
+				btScalar swapFactor = isEdgeConvex ? btScalar(1) : btScalar(-1);
+	#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+				btDebugDrawLine(tr*nearest,tr*(nearest+swapFactor*tri_normal*10),white);
+	#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+				btVector3 nA = swapFactor * tri_normal;
+				
+				btQuaternion orn(edge,info->m_edgeV1V2Angle);
+				btVector3 computedNormalB = quatRotate(orn,tri_normal);
+				if (info->m_flags & TRI_INFO_V1V2_SWAP_NORMALB)
+					computedNormalB*=-1;
+				btVector3 nB = swapFactor*computedNormalB;
+
+#ifdef DEBUG_INTERNAL_EDGE
+				{
+					btDebugDrawLine(cp.getPositionWorldOnB(),cp.getPositionWorldOnB()+tr.getBasis()*(nB*20),red);
+				}
+#endif //DEBUG_INTERNAL_EDGE
+
+
+				btScalar	NdotA = localContactNormalOnB.dot(nA);
+				btScalar	NdotB = localContactNormalOnB.dot(nB);
+				bool backFacingNormal = (NdotA< triangleInfoMapPtr->m_convexEpsilon) && (NdotB<triangleInfoMapPtr->m_convexEpsilon);
+
+				if (backFacingNormal)
+				{
+					numConcaveEdgeHits++;
+				}
+				else
+				{
+					numConvexEdgeHits++;
+					btVector3 localContactNormalOnB = colObj0->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB;
+					btVector3 clampedLocalNormal;
+					bool isClamped = btClampNormal(edge,swapFactor*tri_normal,localContactNormalOnB, info->m_edgeV1V2Angle,clampedLocalNormal);
+					if (isClamped)
+					{
+						if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED)!=0) || (clampedLocalNormal.dot(frontFacing*tri_normal)>0))
+						{
+							btVector3 newNormal = colObj0->getWorldTransform().getBasis() * clampedLocalNormal;
+							//					cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB);
+							cp.m_normalWorldOnB = newNormal;
+							// Reproject collision point along normal.
+							cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
+							cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);
+						}
+					}
+				}
+			}
+		}
+	}
+
+	btNearestPointInLineSegment(contact,v2,v0,nearest);
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+	btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,blue);
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+   btDebugDrawLine(tr * v2 + upfix, tr * v0 + upfix , blue );
+#endif   
+
+	if (btFabs(info->m_edgeV2V0Angle)< triangleInfoMapPtr->m_maxEdgeAngleThreshold)
+	{
+
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+		btDebugDrawLine(tr*contact,tr*(contact+cp.m_normalWorldOnB*10),black);
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+		btScalar len = (contact-nearest).length();
+		if(len<triangleInfoMapPtr->m_edgeDistanceThreshold)
+		if( bestedge==2 )
+		{
+			isNearEdge = true;
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+			btDebugDrawLine(tr*nearest,tr*(nearest+tri_normal*10),white);
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+			btVector3 edge(v2-v0);
+
+			if (info->m_edgeV2V0Angle==btScalar(0))
+			{
+				numConcaveEdgeHits++;
+			} else
+			{
+
+				bool isEdgeConvex = (info->m_flags & TRI_INFO_V2V0_CONVEX)!=0;
+				btScalar swapFactor = isEdgeConvex ? btScalar(1) : btScalar(-1);
+	#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+				btDebugDrawLine(tr*nearest,tr*(nearest+swapFactor*tri_normal*10),white);
+	#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+				btVector3 nA = swapFactor * tri_normal;
+				btQuaternion orn(edge,info->m_edgeV2V0Angle);
+				btVector3 computedNormalB = quatRotate(orn,tri_normal);
+				if (info->m_flags & TRI_INFO_V2V0_SWAP_NORMALB)
+					computedNormalB*=-1;
+				btVector3 nB = swapFactor*computedNormalB;
+
+#ifdef DEBUG_INTERNAL_EDGE
+				{
+					btDebugDrawLine(cp.getPositionWorldOnB(),cp.getPositionWorldOnB()+tr.getBasis()*(nB*20),red);
+				}
+#endif //DEBUG_INTERNAL_EDGE
+
+				btScalar	NdotA = localContactNormalOnB.dot(nA);
+				btScalar	NdotB = localContactNormalOnB.dot(nB);
+				bool backFacingNormal = (NdotA< triangleInfoMapPtr->m_convexEpsilon) && (NdotB<triangleInfoMapPtr->m_convexEpsilon);
+
+				if (backFacingNormal)
+				{
+					numConcaveEdgeHits++;
+				}
+				else
+				{
+					numConvexEdgeHits++;
+					//				printf("hitting convex edge\n");
+
+
+					btVector3 localContactNormalOnB = colObj0->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB;
+					btVector3 clampedLocalNormal;
+					bool isClamped = btClampNormal(edge,swapFactor*tri_normal,localContactNormalOnB,info->m_edgeV2V0Angle,clampedLocalNormal);
+					if (isClamped)
+					{
+						if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED)!=0) || (clampedLocalNormal.dot(frontFacing*tri_normal)>0))
+						{
+							btVector3 newNormal = colObj0->getWorldTransform().getBasis() * clampedLocalNormal;
+							//					cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB);
+							cp.m_normalWorldOnB = newNormal;
+							// Reproject collision point along normal.
+							cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
+							cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);
+						}
+					}
+				} 
+			}
+			
+
+		}
+	}
+
+#ifdef DEBUG_INTERNAL_EDGE
+	{
+		btVector3 color(0,1,1);
+		btDebugDrawLine(cp.getPositionWorldOnB(),cp.getPositionWorldOnB()+cp.m_normalWorldOnB*10,color);
+	}
+#endif //DEBUG_INTERNAL_EDGE
+
+	if (isNearEdge)
+	{
+
+		if (numConcaveEdgeHits>0)
+		{
+			if ((normalAdjustFlags & BT_TRIANGLE_CONCAVE_DOUBLE_SIDED)!=0)
+			{
+				//fix tri_normal so it pointing the same direction as the current local contact normal
+				if (tri_normal.dot(localContactNormalOnB) < 0)
+				{
+					tri_normal *= -1;
+				}
+				cp.m_normalWorldOnB = colObj0->getWorldTransform().getBasis()*tri_normal;
+			} else
+			{
+				btVector3 newNormal = tri_normal *frontFacing;
+				//if the tri_normal is pointing opposite direction as the current local contact normal, skip it
+				btScalar d = newNormal.dot(localContactNormalOnB) ;
+				if (d< 0)
+				{
+					return;
+				}
+				//modify the normal to be the triangle normal (or backfacing normal)
+				cp.m_normalWorldOnB = colObj0->getWorldTransform().getBasis() *newNormal;
+			}
+						
+			// Reproject collision point along normal.
+			cp.m_positionWorldOnB = cp.m_positionWorldOnA - cp.m_normalWorldOnB * cp.m_distance1;
+			cp.m_localPointB = colObj0->getWorldTransform().invXform(cp.m_positionWorldOnB);
+		}
+	}
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h
new file mode 100644
index 0000000..9efb012
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h
@@ -0,0 +1,46 @@
+
+#ifndef BT_INTERNAL_EDGE_UTILITY_H
+#define BT_INTERNAL_EDGE_UTILITY_H
+
+#include "LinearMath/btHashMap.h"
+#include "LinearMath/btVector3.h"
+
+#include "BulletCollision/CollisionShapes/btTriangleInfoMap.h"
+
+///The btInternalEdgeUtility helps to avoid or reduce artifacts due to wrong collision normals caused by internal edges.
+///See also http://code.google.com/p/bullet/issues/detail?id=27
+
+class btBvhTriangleMeshShape;
+class btCollisionObject;
+class btManifoldPoint;
+class btIDebugDraw;
+
+
+
+enum btInternalEdgeAdjustFlags
+{
+	BT_TRIANGLE_CONVEX_BACKFACE_MODE = 1,
+	BT_TRIANGLE_CONCAVE_DOUBLE_SIDED = 2, //double sided options are experimental, single sided is recommended
+	BT_TRIANGLE_CONVEX_DOUBLE_SIDED = 4
+};
+
+
+///Call btGenerateInternalEdgeInfo to create triangle info, store in the shape 'userInfo'
+void	btGenerateInternalEdgeInfo (btBvhTriangleMeshShape*trimeshShape, btTriangleInfoMap* triangleInfoMap);
+
+
+///Call the btFixMeshNormal to adjust the collision normal, using the triangle info map (generated using btGenerateInternalEdgeInfo)
+///If this info map is missing, or the triangle is not store in this map, nothing will be done
+void	btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObject* trimeshColObj0,const btCollisionObject* otherColObj1, int partId0, int index0, int normalAdjustFlags = 0);
+
+///Enable the BT_INTERNAL_EDGE_DEBUG_DRAW define and call btSetDebugDrawer, to get visual info to see if the internal edge utility works properly.
+///If the utility doesn't work properly, you might have to adjust the threshold values in btTriangleInfoMap
+//#define BT_INTERNAL_EDGE_DEBUG_DRAW
+
+#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
+void	btSetDebugDrawer(btIDebugDraw* debugDrawer);
+#endif //BT_INTERNAL_EDGE_DEBUG_DRAW
+
+
+#endif //BT_INTERNAL_EDGE_UTILITY_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
new file mode 100644
index 0000000..fd684c0
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
@@ -0,0 +1,135 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btManifoldResult.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+
+
+///This is to allow MaterialCombiner/Custom Friction/Restitution values
+ContactAddedCallback		gContactAddedCallback=0;
+
+///User can override this material combiner by implementing gContactAddedCallback and setting body0->m_collisionFlags |= btCollisionObject::customMaterialCallback;
+inline btScalar	calculateCombinedFriction(const btCollisionObject* body0,const btCollisionObject* body1)
+{
+	btScalar friction = body0->getFriction() * body1->getFriction();
+
+	const btScalar MAX_FRICTION  = btScalar(10.);
+	if (friction < -MAX_FRICTION)
+		friction = -MAX_FRICTION;
+	if (friction > MAX_FRICTION)
+		friction = MAX_FRICTION;
+	return friction;
+
+}
+
+inline btScalar	calculateCombinedRestitution(const btCollisionObject* body0,const btCollisionObject* body1)
+{
+	return body0->getRestitution() * body1->getRestitution();
+}
+
+
+
+btManifoldResult::btManifoldResult(btCollisionObject* body0,btCollisionObject* body1)
+		:m_manifoldPtr(0),
+		m_body0(body0),
+		m_body1(body1)
+#ifdef DEBUG_PART_INDEX
+		,m_partId0(-1),
+	m_partId1(-1),
+	m_index0(-1),
+	m_index1(-1)
+#endif //DEBUG_PART_INDEX
+{
+	m_rootTransA = body0->getWorldTransform();
+	m_rootTransB = body1->getWorldTransform();
+}
+
+
+void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
+{
+	btAssert(m_manifoldPtr);
+	//order in manifold needs to match
+
+//	if (depth > m_manifoldPtr->getContactBreakingThreshold())
+	if (depth > m_manifoldPtr->getContactProcessingThreshold())
+		return;
+
+	bool isSwapped = m_manifoldPtr->getBody0() != m_body0;
+
+	btVector3 pointA = pointInWorld + normalOnBInWorld * depth;
+
+	btVector3 localA;
+	btVector3 localB;
+	
+	if (isSwapped)
+	{
+		localA = m_rootTransB.invXform(pointA );
+		localB = m_rootTransA.invXform(pointInWorld);
+	} else
+	{
+		localA = m_rootTransA.invXform(pointA );
+		localB = m_rootTransB.invXform(pointInWorld);
+	}
+
+	btManifoldPoint newPt(localA,localB,normalOnBInWorld,depth);
+	newPt.m_positionWorldOnA = pointA;
+	newPt.m_positionWorldOnB = pointInWorld;
+	
+	int insertIndex = m_manifoldPtr->getCacheEntry(newPt);
+
+	newPt.m_combinedFriction = calculateCombinedFriction(m_body0,m_body1);
+	newPt.m_combinedRestitution = calculateCombinedRestitution(m_body0,m_body1);
+
+   //BP mod, store contact triangles.
+	if (isSwapped)
+	{
+		newPt.m_partId0 = m_partId1;
+		newPt.m_partId1 = m_partId0;
+		newPt.m_index0  = m_index1;
+		newPt.m_index1  = m_index0;
+	} else
+	{
+		newPt.m_partId0 = m_partId0;
+		newPt.m_partId1 = m_partId1;
+		newPt.m_index0  = m_index0;
+		newPt.m_index1  = m_index1;
+	}
+	//printf("depth=%f\n",depth);
+	///@todo, check this for any side effects
+	if (insertIndex >= 0)
+	{
+		//const btManifoldPoint& oldPoint = m_manifoldPtr->getContactPoint(insertIndex);
+		m_manifoldPtr->replaceContactPoint(newPt,insertIndex);
+	} else
+	{
+		insertIndex = m_manifoldPtr->addManifoldPoint(newPt);
+	}
+	
+	//User can override friction and/or restitution
+	if (gContactAddedCallback &&
+		//and if either of the two bodies requires custom material
+		 ((m_body0->getCollisionFlags() & btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK) ||
+		   (m_body1->getCollisionFlags() & btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK)))
+	{
+		//experimental feature info, for per-triangle material etc.
+		btCollisionObject* obj0 = isSwapped? m_body1 : m_body0;
+		btCollisionObject* obj1 = isSwapped? m_body0 : m_body1;
+		(*gContactAddedCallback)(m_manifoldPtr->getContactPoint(insertIndex),obj0,newPt.m_partId0,newPt.m_index0,obj1,newPt.m_partId1,newPt.m_index1);
+	}
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h
new file mode 100644
index 0000000..18199b4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btManifoldResult.h
@@ -0,0 +1,128 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_MANIFOLD_RESULT_H
+#define BT_MANIFOLD_RESULT_H
+
+class btCollisionObject;
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+class btManifoldPoint;
+
+#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
+
+#include "LinearMath/btTransform.h"
+
+typedef bool (*ContactAddedCallback)(btManifoldPoint& cp,	const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1);
+extern ContactAddedCallback		gContactAddedCallback;
+
+//#define DEBUG_PART_INDEX 1
+
+
+///btManifoldResult is a helper class to manage  contact results.
+class btManifoldResult : public btDiscreteCollisionDetectorInterface::Result
+{
+protected:
+
+	btPersistentManifold* m_manifoldPtr;
+
+	//we need this for compounds
+	btTransform	m_rootTransA;
+	btTransform	m_rootTransB;
+
+	btCollisionObject* m_body0;
+	btCollisionObject* m_body1;
+	int	m_partId0;
+	int m_partId1;
+	int m_index0;
+	int m_index1;
+	
+
+public:
+
+	btManifoldResult()
+#ifdef DEBUG_PART_INDEX
+		:
+	m_partId0(-1),
+	m_partId1(-1),
+	m_index0(-1),
+	m_index1(-1)
+#endif //DEBUG_PART_INDEX
+	{
+	}
+
+	btManifoldResult(btCollisionObject* body0,btCollisionObject* body1);
+
+	virtual ~btManifoldResult() {};
+
+	void	setPersistentManifold(btPersistentManifold* manifoldPtr)
+	{
+		m_manifoldPtr = manifoldPtr;
+	}
+
+	const btPersistentManifold*	getPersistentManifold() const
+	{
+		return m_manifoldPtr;
+	}
+	btPersistentManifold*	getPersistentManifold()
+	{
+		return m_manifoldPtr;
+	}
+
+	virtual void setShapeIdentifiersA(int partId0,int index0)
+	{
+		m_partId0=partId0;
+		m_index0=index0;
+	}
+
+	virtual void setShapeIdentifiersB(	int partId1,int index1)
+	{
+		m_partId1=partId1;
+		m_index1=index1;
+	}
+
+
+	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth);
+
+	SIMD_FORCE_INLINE	void refreshContactPoints()
+	{
+		btAssert(m_manifoldPtr);
+		if (!m_manifoldPtr->getNumContacts())
+			return;
+
+		bool isSwapped = m_manifoldPtr->getBody0() != m_body0;
+
+		if (isSwapped)
+		{
+			m_manifoldPtr->refreshContactPoints(m_rootTransB,m_rootTransA);
+		} else
+		{
+			m_manifoldPtr->refreshContactPoints(m_rootTransA,m_rootTransB);
+		}
+	}
+
+	const btCollisionObject* getBody0Internal() const
+	{
+		return m_body0;
+	}
+
+	const btCollisionObject* getBody1Internal() const
+	{
+		return m_body1;
+	}
+	
+};
+
+#endif //BT_MANIFOLD_RESULT_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
new file mode 100644
index 0000000..bb2a7f2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
@@ -0,0 +1,443 @@
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "LinearMath/btScalar.h"
+#include "btSimulationIslandManager.h"
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
+
+//#include <stdio.h>
+#include "LinearMath/btQuickprof.h"
+
+btSimulationIslandManager::btSimulationIslandManager():
+m_splitIslands(true)
+{
+}
+
+btSimulationIslandManager::~btSimulationIslandManager()
+{
+}
+
+
+void btSimulationIslandManager::initUnionFind(int n)
+{
+		m_unionFind.reset(n);
+}
+		
+
+void btSimulationIslandManager::findUnions(btDispatcher* /* dispatcher */,btCollisionWorld* colWorld)
+{
+	
+	{
+		btOverlappingPairCache* pairCachePtr = colWorld->getPairCache();
+		const int numOverlappingPairs = pairCachePtr->getNumOverlappingPairs();
+		btBroadphasePair* pairPtr = pairCachePtr->getOverlappingPairArrayPtr();
+		
+		for (int i=0;i<numOverlappingPairs;i++)
+		{
+			const btBroadphasePair& collisionPair = pairPtr[i];
+			btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
+			btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
+
+			if (((colObj0) && ((colObj0)->mergesSimulationIslands())) &&
+				((colObj1) && ((colObj1)->mergesSimulationIslands())))
+			{
+
+				m_unionFind.unite((colObj0)->getIslandTag(),
+					(colObj1)->getIslandTag());
+			}
+		}
+	}
+}
+
+#ifdef STATIC_SIMULATION_ISLAND_OPTIMIZATION
+void   btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher)
+{
+
+	// put the index into m_controllers into m_tag   
+	int index = 0;
+	{
+
+		int i;
+		for (i=0;i<colWorld->getCollisionObjectArray().size(); i++)
+		{
+			btCollisionObject*   collisionObject= colWorld->getCollisionObjectArray()[i];
+			//Adding filtering here
+			if (!collisionObject->isStaticOrKinematicObject())
+			{
+				collisionObject->setIslandTag(index++);
+			}
+			collisionObject->setCompanionId(-1);
+			collisionObject->setHitFraction(btScalar(1.));
+		}
+	}
+	// do the union find
+
+	initUnionFind( index );
+
+	findUnions(dispatcher,colWorld);
+}
+
+void   btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld)
+{
+	// put the islandId ('find' value) into m_tag   
+	{
+		int index = 0;
+		int i;
+		for (i=0;i<colWorld->getCollisionObjectArray().size();i++)
+		{
+			btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i];
+			if (!collisionObject->isStaticOrKinematicObject())
+			{
+				collisionObject->setIslandTag( m_unionFind.find(index) );
+				//Set the correct object offset in Collision Object Array
+				m_unionFind.getElement(index).m_sz = i;
+				collisionObject->setCompanionId(-1);
+				index++;
+			} else
+			{
+				collisionObject->setIslandTag(-1);
+				collisionObject->setCompanionId(-2);
+			}
+		}
+	}
+}
+
+
+#else //STATIC_SIMULATION_ISLAND_OPTIMIZATION
+void	btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher)
+{
+
+	initUnionFind( int (colWorld->getCollisionObjectArray().size()));
+
+	// put the index into m_controllers into m_tag	
+	{
+
+		int index = 0;
+		int i;
+		for (i=0;i<colWorld->getCollisionObjectArray().size(); i++)
+		{
+			btCollisionObject*	collisionObject= colWorld->getCollisionObjectArray()[i];
+			collisionObject->setIslandTag(index);
+			collisionObject->setCompanionId(-1);
+			collisionObject->setHitFraction(btScalar(1.));
+			index++;
+
+		}
+	}
+	// do the union find
+
+	findUnions(dispatcher,colWorld);
+}
+
+void	btSimulationIslandManager::storeIslandActivationState(btCollisionWorld* colWorld)
+{
+	// put the islandId ('find' value) into m_tag	
+	{
+
+
+		int index = 0;
+		int i;
+		for (i=0;i<colWorld->getCollisionObjectArray().size();i++)
+		{
+			btCollisionObject* collisionObject= colWorld->getCollisionObjectArray()[i];
+			if (!collisionObject->isStaticOrKinematicObject())
+			{
+				collisionObject->setIslandTag( m_unionFind.find(index) );
+				collisionObject->setCompanionId(-1);
+			} else
+			{
+				collisionObject->setIslandTag(-1);
+				collisionObject->setCompanionId(-2);
+			}
+			index++;
+		}
+	}
+}
+
+#endif //STATIC_SIMULATION_ISLAND_OPTIMIZATION
+
+inline	int	getIslandId(const btPersistentManifold* lhs)
+{
+	int islandId;
+	const btCollisionObject* rcolObj0 = static_cast<const btCollisionObject*>(lhs->getBody0());
+	const btCollisionObject* rcolObj1 = static_cast<const btCollisionObject*>(lhs->getBody1());
+	islandId= rcolObj0->getIslandTag()>=0?rcolObj0->getIslandTag():rcolObj1->getIslandTag();
+	return islandId;
+
+}
+
+
+
+/// function object that routes calls to operator<
+class btPersistentManifoldSortPredicate
+{
+	public:
+
+		SIMD_FORCE_INLINE bool operator() ( const btPersistentManifold* lhs, const btPersistentManifold* rhs )
+		{
+			return getIslandId(lhs) < getIslandId(rhs);
+		}
+};
+
+
+void btSimulationIslandManager::buildIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld)
+{
+
+	BT_PROFILE("islandUnionFindAndQuickSort");
+	
+	btCollisionObjectArray& collisionObjects = collisionWorld->getCollisionObjectArray();
+
+	m_islandmanifold.resize(0);
+
+	//we are going to sort the unionfind array, and store the element id in the size
+	//afterwards, we clean unionfind, to make sure no-one uses it anymore
+	
+	getUnionFind().sortIslands();
+	int numElem = getUnionFind().getNumElements();
+
+	int endIslandIndex=1;
+	int startIslandIndex;
+
+
+	//update the sleeping state for bodies, if all are sleeping
+	for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex)
+	{
+		int islandId = getUnionFind().getElement(startIslandIndex).m_id;
+		for (endIslandIndex = startIslandIndex+1;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++)
+		{
+		}
+
+		//int numSleeping = 0;
+
+		bool allSleeping = true;
+
+		int idx;
+		for (idx=startIslandIndex;idx<endIslandIndex;idx++)
+		{
+			int i = getUnionFind().getElement(idx).m_sz;
+
+			btCollisionObject* colObj0 = collisionObjects[i];
+			if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1))
+			{
+//				printf("error in island management\n");
+			}
+
+			btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1));
+			if (colObj0->getIslandTag() == islandId)
+			{
+				if (colObj0->getActivationState()== ACTIVE_TAG)
+				{
+					allSleeping = false;
+				}
+				if (colObj0->getActivationState()== DISABLE_DEACTIVATION)
+				{
+					allSleeping = false;
+				}
+			}
+		}
+			
+
+		if (allSleeping)
+		{
+			int idx;
+			for (idx=startIslandIndex;idx<endIslandIndex;idx++)
+			{
+				int i = getUnionFind().getElement(idx).m_sz;
+				btCollisionObject* colObj0 = collisionObjects[i];
+				if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1))
+				{
+//					printf("error in island management\n");
+				}
+
+				btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1));
+
+				if (colObj0->getIslandTag() == islandId)
+				{
+					colObj0->setActivationState( ISLAND_SLEEPING );
+				}
+			}
+		} else
+		{
+
+			int idx;
+			for (idx=startIslandIndex;idx<endIslandIndex;idx++)
+			{
+				int i = getUnionFind().getElement(idx).m_sz;
+
+				btCollisionObject* colObj0 = collisionObjects[i];
+				if ((colObj0->getIslandTag() != islandId) && (colObj0->getIslandTag() != -1))
+				{
+//					printf("error in island management\n");
+				}
+
+				btAssert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1));
+
+				if (colObj0->getIslandTag() == islandId)
+				{
+					if ( colObj0->getActivationState() == ISLAND_SLEEPING)
+					{
+						colObj0->setActivationState( WANTS_DEACTIVATION);
+						colObj0->setDeactivationTime(0.f);
+					}
+				}
+			}
+		}
+	}
+
+	
+	int i;
+	int maxNumManifolds = dispatcher->getNumManifolds();
+
+//#define SPLIT_ISLANDS 1
+//#ifdef SPLIT_ISLANDS
+
+	
+//#endif //SPLIT_ISLANDS
+
+	
+	for (i=0;i<maxNumManifolds ;i++)
+	{
+		 btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i);
+		 
+		 btCollisionObject* colObj0 = static_cast<btCollisionObject*>(manifold->getBody0());
+		 btCollisionObject* colObj1 = static_cast<btCollisionObject*>(manifold->getBody1());
+		
+		 ///@todo: check sleeping conditions!
+		 if (((colObj0) && colObj0->getActivationState() != ISLAND_SLEEPING) ||
+			((colObj1) && colObj1->getActivationState() != ISLAND_SLEEPING))
+		{
+		
+			//kinematic objects don't merge islands, but wake up all connected objects
+			if (colObj0->isKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING)
+			{
+				colObj1->activate();
+			}
+			if (colObj1->isKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING)
+			{
+				colObj0->activate();
+			}
+			if(m_splitIslands)
+			{ 
+				//filtering for response
+				if (dispatcher->needsResponse(colObj0,colObj1))
+					m_islandmanifold.push_back(manifold);
+			}
+		}
+	}
+}
+
+
+
+///@todo: this is random access, it can be walked 'cache friendly'!
+void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld, IslandCallback* callback)
+{
+	btCollisionObjectArray& collisionObjects = collisionWorld->getCollisionObjectArray();
+
+	buildIslands(dispatcher,collisionWorld);
+
+	int endIslandIndex=1;
+	int startIslandIndex;
+	int numElem = getUnionFind().getNumElements();
+
+	BT_PROFILE("processIslands");
+
+	if(!m_splitIslands)
+	{
+		btPersistentManifold** manifold = dispatcher->getInternalManifoldPointer();
+		int maxNumManifolds = dispatcher->getNumManifolds();
+		callback->ProcessIsland(&collisionObjects[0],collisionObjects.size(),manifold,maxNumManifolds, -1);
+	}
+	else
+	{
+		// Sort manifolds, based on islands
+		// Sort the vector using predicate and std::sort
+		//std::sort(islandmanifold.begin(), islandmanifold.end(), btPersistentManifoldSortPredicate);
+
+		int numManifolds = int (m_islandmanifold.size());
+
+		//we should do radix sort, it it much faster (O(n) instead of O (n log2(n))
+		m_islandmanifold.quickSort(btPersistentManifoldSortPredicate());
+
+		//now process all active islands (sets of manifolds for now)
+
+		int startManifoldIndex = 0;
+		int endManifoldIndex = 1;
+
+		//int islandId;
+
+		
+
+	//	printf("Start Islands\n");
+
+		//traverse the simulation islands, and call the solver, unless all objects are sleeping/deactivated
+		for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex)
+		{
+			int islandId = getUnionFind().getElement(startIslandIndex).m_id;
+
+
+			   bool islandSleeping = true;
+	                
+					for (endIslandIndex = startIslandIndex;(endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);endIslandIndex++)
+					{
+							int i = getUnionFind().getElement(endIslandIndex).m_sz;
+							btCollisionObject* colObj0 = collisionObjects[i];
+							m_islandBodies.push_back(colObj0);
+							if (colObj0->isActive())
+									islandSleeping = false;
+					}
+	                
+
+			//find the accompanying contact manifold for this islandId
+			int numIslandManifolds = 0;
+			btPersistentManifold** startManifold = 0;
+
+			if (startManifoldIndex<numManifolds)
+			{
+				int curIslandId = getIslandId(m_islandmanifold[startManifoldIndex]);
+				if (curIslandId == islandId)
+				{
+					startManifold = &m_islandmanifold[startManifoldIndex];
+				
+					for (endManifoldIndex = startManifoldIndex+1;(endManifoldIndex<numManifolds) && (islandId == getIslandId(m_islandmanifold[endManifoldIndex]));endManifoldIndex++)
+					{
+
+					}
+					/// Process the actual simulation, only if not sleeping/deactivated
+					numIslandManifolds = endManifoldIndex-startManifoldIndex;
+				}
+
+			}
+
+			if (!islandSleeping)
+			{
+				callback->ProcessIsland(&m_islandBodies[0],m_islandBodies.size(),startManifold,numIslandManifolds, islandId);
+	//			printf("Island callback of size:%d bodies, %d manifolds\n",islandBodies.size(),numIslandManifolds);
+			}
+			
+			if (numIslandManifolds)
+			{
+				startManifoldIndex = endManifoldIndex;
+			}
+
+			m_islandBodies.resize(0);
+		}
+	} // else if(!splitIslands) 
+
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h
new file mode 100644
index 0000000..84b0c6a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h
@@ -0,0 +1,81 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SIMULATION_ISLAND_MANAGER_H
+#define BT_SIMULATION_ISLAND_MANAGER_H
+
+#include "BulletCollision/CollisionDispatch/btUnionFind.h"
+#include "btCollisionCreateFunc.h"
+#include "LinearMath/btAlignedObjectArray.h"
+#include "btCollisionObject.h"
+
+class btCollisionObject;
+class btCollisionWorld;
+class btDispatcher;
+class btPersistentManifold;
+
+
+///SimulationIslandManager creates and handles simulation islands, using btUnionFind
+class btSimulationIslandManager
+{
+	btUnionFind m_unionFind;
+
+	btAlignedObjectArray<btPersistentManifold*>  m_islandmanifold;
+	btAlignedObjectArray<btCollisionObject* >  m_islandBodies;
+	
+	bool m_splitIslands;
+	
+public:
+	btSimulationIslandManager();
+	virtual ~btSimulationIslandManager();
+
+
+	void initUnionFind(int n);	
+	
+		
+	btUnionFind& getUnionFind() { return m_unionFind;}
+
+	virtual	void	updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher);
+	virtual	void	storeIslandActivationState(btCollisionWorld* world);
+
+
+	void	findUnions(btDispatcher* dispatcher,btCollisionWorld* colWorld);
+
+	
+
+	struct	IslandCallback
+	{
+		virtual ~IslandCallback() {};
+
+		virtual	void	ProcessIsland(btCollisionObject** bodies,int numBodies,class btPersistentManifold**	manifolds,int numManifolds, int islandId) = 0;
+	};
+
+	void	buildAndProcessIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld, IslandCallback* callback);
+
+	void buildIslands(btDispatcher* dispatcher,btCollisionWorld* colWorld);
+
+	bool getSplitIslands()
+	{
+		return m_splitIslands;
+	}
+	void setSplitIslands(bool doSplitIslands)
+	{
+		m_splitIslands = doSplitIslands;
+	}
+
+};
+
+#endif //BT_SIMULATION_ISLAND_MANAGER_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
new file mode 100644
index 0000000..8df8769
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
@@ -0,0 +1,260 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btSphereBoxCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+//#include <stdio.h>
+
+btSphereBoxCollisionAlgorithm::btSphereBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped)
+: btActivatingCollisionAlgorithm(ci,col0,col1),
+m_ownManifold(false),
+m_manifoldPtr(mf),
+m_isSwapped(isSwapped)
+{
+	btCollisionObject* sphereObj = m_isSwapped? col1 : col0;
+	btCollisionObject* boxObj = m_isSwapped? col0 : col1;
+	
+	if (!m_manifoldPtr && m_dispatcher->needsCollision(sphereObj,boxObj))
+	{
+		m_manifoldPtr = m_dispatcher->getNewManifold(sphereObj,boxObj);
+		m_ownManifold = true;
+	}
+}
+
+
+btSphereBoxCollisionAlgorithm::~btSphereBoxCollisionAlgorithm()
+{
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+	}
+}
+
+
+
+void btSphereBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)dispatchInfo;
+	(void)resultOut;
+	if (!m_manifoldPtr)
+		return;
+
+	btCollisionObject* sphereObj = m_isSwapped? body1 : body0;
+	btCollisionObject* boxObj = m_isSwapped? body0 : body1;
+
+
+	btSphereShape* sphere0 = (btSphereShape*)sphereObj->getCollisionShape();
+
+	btVector3 normalOnSurfaceB;
+	btVector3 pOnBox,pOnSphere;
+	btVector3 sphereCenter = sphereObj->getWorldTransform().getOrigin();
+	btScalar radius = sphere0->getRadius();
+	
+	btScalar dist = getSphereDistance(boxObj,pOnBox,pOnSphere,sphereCenter,radius);
+
+	resultOut->setPersistentManifold(m_manifoldPtr);
+
+	if (dist < SIMD_EPSILON)
+	{
+		btVector3 normalOnSurfaceB = (pOnBox- pOnSphere).normalize();
+
+		/// report a contact. internally this will be kept persistent, and contact reduction is done
+
+		resultOut->addContactPoint(normalOnSurfaceB,pOnBox,dist);
+		
+	}
+
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr->getNumContacts())
+		{
+			resultOut->refreshContactPoints();
+		}
+	}
+
+}
+
+btScalar btSphereBoxCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)resultOut;
+	(void)dispatchInfo;
+	(void)col0;
+	(void)col1;
+
+	//not yet
+	return btScalar(1.);
+}
+
+
+btScalar btSphereBoxCollisionAlgorithm::getSphereDistance(btCollisionObject* boxObj, btVector3& pointOnBox, btVector3& v3PointOnSphere, const btVector3& sphereCenter, btScalar fRadius ) 
+{
+
+	btScalar margins;
+	btVector3 bounds[2];
+	btBoxShape* boxShape= (btBoxShape*)boxObj->getCollisionShape();
+	
+	bounds[0] = -boxShape->getHalfExtentsWithoutMargin();
+	bounds[1] = boxShape->getHalfExtentsWithoutMargin();
+
+	margins = boxShape->getMargin();//also add sphereShape margin?
+
+	const btTransform&	m44T = boxObj->getWorldTransform();
+
+	btVector3	boundsVec[2];
+	btScalar	fPenetration;
+
+	boundsVec[0] = bounds[0];
+	boundsVec[1] = bounds[1];
+
+	btVector3	marginsVec( margins, margins, margins );
+
+	// add margins
+	bounds[0] += marginsVec;
+	bounds[1] -= marginsVec;
+
+	/////////////////////////////////////////////////
+
+	btVector3	tmp, prel, n[6], normal, v3P;
+	btScalar   fSep = btScalar(10000000.0), fSepThis;
+
+	n[0].setValue( btScalar(-1.0),  btScalar(0.0),  btScalar(0.0) );
+	n[1].setValue(  btScalar(0.0), btScalar(-1.0),  btScalar(0.0) );
+	n[2].setValue(  btScalar(0.0),  btScalar(0.0), btScalar(-1.0) );
+	n[3].setValue(  btScalar(1.0),  btScalar(0.0),  btScalar(0.0) );
+	n[4].setValue(  btScalar(0.0),  btScalar(1.0),  btScalar(0.0) );
+	n[5].setValue(  btScalar(0.0),  btScalar(0.0),  btScalar(1.0) );
+
+	// convert  point in local space
+	prel = m44T.invXform( sphereCenter);
+	
+	bool	bFound = false;
+
+	v3P = prel;
+
+	for (int i=0;i<6;i++)
+	{
+		int j = i<3? 0:1;
+		if ( (fSepThis = ((v3P-bounds[j]) .dot(n[i]))) > btScalar(0.0) )
+		{
+			v3P = v3P - n[i]*fSepThis;		
+			bFound = true;
+		}
+	}
+	
+	//
+
+	if ( bFound )
+	{
+		bounds[0] = boundsVec[0];
+		bounds[1] = boundsVec[1];
+
+		normal = (prel - v3P).normalize();
+		pointOnBox = v3P + normal*margins;
+		v3PointOnSphere = prel - normal*fRadius;
+
+		if ( ((v3PointOnSphere - pointOnBox) .dot (normal)) > btScalar(0.0) )
+		{
+			return btScalar(1.0);
+		}
+
+		// transform back in world space
+		tmp = m44T( pointOnBox);
+		pointOnBox    = tmp;
+		tmp  = m44T( v3PointOnSphere);		
+		v3PointOnSphere = tmp;
+		btScalar fSeps2 = (pointOnBox-v3PointOnSphere).length2();
+		
+		//if this fails, fallback into deeper penetration case, below
+		if (fSeps2 > SIMD_EPSILON)
+		{
+			fSep = - btSqrt(fSeps2);
+			normal = (pointOnBox-v3PointOnSphere);
+			normal *= btScalar(1.)/fSep;
+		}
+
+		return fSep;
+	}
+
+	//////////////////////////////////////////////////
+	// Deep penetration case
+
+	fPenetration = getSpherePenetration( boxObj,pointOnBox, v3PointOnSphere, sphereCenter, fRadius,bounds[0],bounds[1] );
+
+	bounds[0] = boundsVec[0];
+	bounds[1] = boundsVec[1];
+
+	if ( fPenetration <= btScalar(0.0) )
+		return (fPenetration-margins);
+	else
+		return btScalar(1.0);
+}
+
+btScalar btSphereBoxCollisionAlgorithm::getSpherePenetration( btCollisionObject* boxObj,btVector3& pointOnBox, btVector3& v3PointOnSphere, const btVector3& sphereCenter, btScalar fRadius, const btVector3& aabbMin, const btVector3& aabbMax) 
+{
+
+	btVector3 bounds[2];
+
+	bounds[0] = aabbMin;
+	bounds[1] = aabbMax;
+
+	btVector3	p0, tmp, prel, n[6], normal;
+	btScalar   fSep = btScalar(-10000000.0), fSepThis;
+
+	// set p0 and normal to a default value to shup up GCC
+	p0.setValue(btScalar(0.), btScalar(0.), btScalar(0.));
+	normal.setValue(btScalar(0.), btScalar(0.), btScalar(0.));
+
+	n[0].setValue( btScalar(-1.0),  btScalar(0.0),  btScalar(0.0) );
+	n[1].setValue(  btScalar(0.0), btScalar(-1.0),  btScalar(0.0) );
+	n[2].setValue(  btScalar(0.0),  btScalar(0.0), btScalar(-1.0) );
+	n[3].setValue(  btScalar(1.0),  btScalar(0.0),  btScalar(0.0) );
+	n[4].setValue(  btScalar(0.0),  btScalar(1.0),  btScalar(0.0) );
+	n[5].setValue(  btScalar(0.0),  btScalar(0.0),  btScalar(1.0) );
+
+	const btTransform&	m44T = boxObj->getWorldTransform();
+
+	// convert  point in local space
+	prel = m44T.invXform( sphereCenter);
+
+	///////////
+
+	for (int i=0;i<6;i++)
+	{
+		int j = i<3 ? 0:1;
+		if ( (fSepThis = ((prel-bounds[j]) .dot( n[i]))-fRadius) > btScalar(0.0) )	return btScalar(1.0);
+		if ( fSepThis > fSep )
+		{
+			p0 = bounds[j];	normal = (btVector3&)n[i];
+			fSep = fSepThis;
+		}
+	}
+
+	pointOnBox = prel - normal*(normal.dot((prel-p0)));
+	v3PointOnSphere = pointOnBox + normal*fSep;
+
+	// transform back in world space
+	tmp  = m44T( pointOnBox);		
+	pointOnBox    = tmp;
+	tmp  = m44T( v3PointOnSphere);		v3PointOnSphere = tmp;
+	normal = (pointOnBox-v3PointOnSphere).normalize();
+
+	return fSep;
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h
new file mode 100644
index 0000000..60286ae
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h
@@ -0,0 +1,75 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SPHERE_BOX_COLLISION_ALGORITHM_H
+#define BT_SPHERE_BOX_COLLISION_ALGORITHM_H
+
+#include "btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+class btPersistentManifold;
+#include "btCollisionDispatcher.h"
+
+#include "LinearMath/btVector3.h"
+
+/// btSphereBoxCollisionAlgorithm  provides sphere-box collision detection.
+/// Other features are frame-coherency (persistent data) and collision response.
+class btSphereBoxCollisionAlgorithm : public btActivatingCollisionAlgorithm
+{
+	bool	m_ownManifold;
+	btPersistentManifold*	m_manifoldPtr;
+	bool	m_isSwapped;
+	
+public:
+
+	btSphereBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped);
+
+	virtual ~btSphereBoxCollisionAlgorithm();
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		if (m_manifoldPtr && m_ownManifold)
+		{
+			manifoldArray.push_back(m_manifoldPtr);
+		}
+	}
+
+	btScalar getSphereDistance( btCollisionObject* boxObj,btVector3& v3PointOnBox, btVector3& v3PointOnSphere, const btVector3& v3SphereCenter, btScalar fRadius );
+
+	btScalar getSpherePenetration( btCollisionObject* boxObj, btVector3& v3PointOnBox, btVector3& v3PointOnSphere, const btVector3& v3SphereCenter, btScalar fRadius, const btVector3& aabbMin, const btVector3& aabbMax);
+	
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereBoxCollisionAlgorithm));
+			if (!m_swapped)
+			{
+				return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0,body1,false);
+			} else
+			{
+				return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0,body1,true);
+			}
+		}
+	};
+
+};
+
+#endif //BT_SPHERE_BOX_COLLISION_ALGORITHM_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
new file mode 100644
index 0000000..5c4e78f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
@@ -0,0 +1,105 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btSphereSphereCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+
+btSphereSphereCollisionAlgorithm::btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1)
+: btActivatingCollisionAlgorithm(ci,col0,col1),
+m_ownManifold(false),
+m_manifoldPtr(mf)
+{
+	if (!m_manifoldPtr)
+	{
+		m_manifoldPtr = m_dispatcher->getNewManifold(col0,col1);
+		m_ownManifold = true;
+	}
+}
+
+btSphereSphereCollisionAlgorithm::~btSphereSphereCollisionAlgorithm()
+{
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+	}
+}
+
+void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)dispatchInfo;
+
+	if (!m_manifoldPtr)
+		return;
+
+	resultOut->setPersistentManifold(m_manifoldPtr);
+
+	btSphereShape* sphere0 = (btSphereShape*)col0->getCollisionShape();
+	btSphereShape* sphere1 = (btSphereShape*)col1->getCollisionShape();
+
+	btVector3 diff = col0->getWorldTransform().getOrigin()-  col1->getWorldTransform().getOrigin();
+	btScalar len = diff.length();
+	btScalar radius0 = sphere0->getRadius();
+	btScalar radius1 = sphere1->getRadius();
+
+#ifdef CLEAR_MANIFOLD
+	m_manifoldPtr->clearManifold(); //don't do this, it disables warmstarting
+#endif
+
+	///iff distance positive, don't generate a new contact
+	if ( len > (radius0+radius1))
+	{
+#ifndef CLEAR_MANIFOLD
+		resultOut->refreshContactPoints();
+#endif //CLEAR_MANIFOLD
+		return;
+	}
+	///distance (negative means penetration)
+	btScalar dist = len - (radius0+radius1);
+
+	btVector3 normalOnSurfaceB(1,0,0);
+	if (len > SIMD_EPSILON)
+	{
+		normalOnSurfaceB = diff / len;
+	}
+
+	///point on A (worldspace)
+	///btVector3 pos0 = col0->getWorldTransform().getOrigin() - radius0 * normalOnSurfaceB;
+	///point on B (worldspace)
+	btVector3 pos1 = col1->getWorldTransform().getOrigin() + radius1* normalOnSurfaceB;
+
+	/// report a contact. internally this will be kept persistent, and contact reduction is done
+	
+	
+	resultOut->addContactPoint(normalOnSurfaceB,pos1,dist);
+
+#ifndef CLEAR_MANIFOLD
+	resultOut->refreshContactPoints();
+#endif //CLEAR_MANIFOLD
+
+}
+
+btScalar btSphereSphereCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)col0;
+	(void)col1;
+	(void)dispatchInfo;
+	(void)resultOut;
+
+	//not yet
+	return btScalar(1.);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h
new file mode 100644
index 0000000..e55acf2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h
@@ -0,0 +1,66 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
+#define BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
+
+#include "btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+#include "btCollisionDispatcher.h"
+
+class btPersistentManifold;
+
+/// btSphereSphereCollisionAlgorithm  provides sphere-sphere collision detection.
+/// Other features are frame-coherency (persistent data) and collision response.
+/// Also provides the most basic sample for custom/user btCollisionAlgorithm
+class btSphereSphereCollisionAlgorithm : public btActivatingCollisionAlgorithm
+{
+	bool	m_ownManifold;
+	btPersistentManifold*	m_manifoldPtr;
+	
+public:
+	btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
+
+	btSphereSphereCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
+		: btActivatingCollisionAlgorithm(ci) {}
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		if (m_manifoldPtr && m_ownManifold)
+		{
+			manifoldArray.push_back(m_manifoldPtr);
+		}
+	}
+	
+	virtual ~btSphereSphereCollisionAlgorithm();
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereSphereCollisionAlgorithm));
+			return new(mem) btSphereSphereCollisionAlgorithm(0,ci,body0,body1);
+		}
+	};
+
+};
+
+#endif //BT_SPHERE_SPHERE_COLLISION_ALGORITHM_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
new file mode 100644
index 0000000..c327c3f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
@@ -0,0 +1,84 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btSphereTriangleCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "SphereTriangleDetector.h"
+
+
+btSphereTriangleCollisionAlgorithm::btSphereTriangleCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1,bool swapped)
+: btActivatingCollisionAlgorithm(ci,col0,col1),
+m_ownManifold(false),
+m_manifoldPtr(mf),
+m_swapped(swapped)
+{
+	if (!m_manifoldPtr)
+	{
+		m_manifoldPtr = m_dispatcher->getNewManifold(col0,col1);
+		m_ownManifold = true;
+	}
+}
+
+btSphereTriangleCollisionAlgorithm::~btSphereTriangleCollisionAlgorithm()
+{
+	if (m_ownManifold)
+	{
+		if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+	}
+}
+
+void btSphereTriangleCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	if (!m_manifoldPtr)
+		return;
+
+	btCollisionObject* sphereObj = m_swapped? col1 : col0;
+	btCollisionObject* triObj = m_swapped? col0 : col1;
+
+	btSphereShape* sphere = (btSphereShape*)sphereObj->getCollisionShape();
+	btTriangleShape* triangle = (btTriangleShape*)triObj->getCollisionShape();
+	
+	/// report a contact. internally this will be kept persistent, and contact reduction is done
+	resultOut->setPersistentManifold(m_manifoldPtr);
+	SphereTriangleDetector detector(sphere,triangle, m_manifoldPtr->getContactBreakingThreshold());
+	
+	btDiscreteCollisionDetectorInterface::ClosestPointInput input;
+	input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);///@todo: tighter bounds
+	input.m_transformA = sphereObj->getWorldTransform();
+	input.m_transformB = triObj->getWorldTransform();
+
+	bool swapResults = m_swapped;
+
+	detector.getClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw,swapResults);
+
+	if (m_ownManifold)
+		resultOut->refreshContactPoints();
+	
+}
+
+btScalar btSphereTriangleCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	(void)resultOut;
+	(void)dispatchInfo;
+	(void)col0;
+	(void)col1;
+
+	//not yet
+	return btScalar(1.);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
new file mode 100644
index 0000000..7c6c4d8
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
@@ -0,0 +1,69 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
+#define BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
+
+#include "btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+class btPersistentManifold;
+#include "btCollisionDispatcher.h"
+
+/// btSphereSphereCollisionAlgorithm  provides sphere-sphere collision detection.
+/// Other features are frame-coherency (persistent data) and collision response.
+/// Also provides the most basic sample for custom/user btCollisionAlgorithm
+class btSphereTriangleCollisionAlgorithm : public btActivatingCollisionAlgorithm
+{
+	bool	m_ownManifold;
+	btPersistentManifold*	m_manifoldPtr;
+	bool	m_swapped;
+	
+public:
+	btSphereTriangleCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool swapped);
+
+	btSphereTriangleCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
+		: btActivatingCollisionAlgorithm(ci) {}
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		if (m_manifoldPtr && m_ownManifold)
+		{
+			manifoldArray.push_back(m_manifoldPtr);
+		}
+	}
+	
+	virtual ~btSphereTriangleCollisionAlgorithm();
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereTriangleCollisionAlgorithm));
+
+			return new(mem) btSphereTriangleCollisionAlgorithm(ci.m_manifold,ci,body0,body1,m_swapped);
+		}
+	};
+
+};
+
+#endif //BT_SPHERE_TRIANGLE_COLLISION_ALGORITHM_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
new file mode 100644
index 0000000..4c4f58d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
@@ -0,0 +1,82 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btUnionFind.h"
+
+
+
+btUnionFind::~btUnionFind()
+{
+	Free();
+
+}
+
+btUnionFind::btUnionFind()
+{ 
+
+}
+
+void	btUnionFind::allocate(int N)
+{
+	m_elements.resize(N);
+}
+void	btUnionFind::Free()
+{
+	m_elements.clear();
+}
+
+
+void	btUnionFind::reset(int N)
+{
+	allocate(N);
+
+	for (int i = 0; i < N; i++) 
+	{ 
+		m_elements[i].m_id = i; m_elements[i].m_sz = 1; 
+	} 
+}
+
+
+class btUnionFindElementSortPredicate
+{
+	public:
+
+		bool operator() ( const btElement& lhs, const btElement& rhs )
+		{
+			return lhs.m_id < rhs.m_id;
+		}
+};
+
+///this is a special operation, destroying the content of btUnionFind.
+///it sorts the elements, based on island id, in order to make it easy to iterate over islands
+void	btUnionFind::sortIslands()
+{
+
+	//first store the original body index, and islandId
+	int numElements = m_elements.size();
+	
+	for (int i=0;i<numElements;i++)
+	{
+		m_elements[i].m_id = find(i);
+#ifndef STATIC_SIMULATION_ISLAND_OPTIMIZATION
+		m_elements[i].m_sz = i;
+#endif //STATIC_SIMULATION_ISLAND_OPTIMIZATION
+	}
+	
+	 // Sort the vector using predicate and std::sort
+	  //std::sort(m_elements.begin(), m_elements.end(), btUnionFindElementSortPredicate);
+	  m_elements.quickSort(btUnionFindElementSortPredicate());
+
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.h b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.h
new file mode 100644
index 0000000..ef2a292
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionDispatch/btUnionFind.h
@@ -0,0 +1,129 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_UNION_FIND_H
+#define BT_UNION_FIND_H
+
+#include "LinearMath/btAlignedObjectArray.h"
+
+#define USE_PATH_COMPRESSION 1
+
+///see for discussion of static island optimizations by Vroonsh here: http://code.google.com/p/bullet/issues/detail?id=406
+#define STATIC_SIMULATION_ISLAND_OPTIMIZATION 1
+
+struct	btElement
+{
+	int	m_id;
+	int	m_sz;
+};
+
+///UnionFind calculates connected subsets
+// Implements weighted Quick Union with path compression
+// optimization: could use short ints instead of ints (halving memory, would limit the number of rigid bodies to 64k, sounds reasonable)
+class btUnionFind
+  {
+    private:
+		btAlignedObjectArray<btElement>	m_elements;
+
+    public:
+	  
+		btUnionFind();
+		~btUnionFind();
+
+	
+		//this is a special operation, destroying the content of btUnionFind.
+		//it sorts the elements, based on island id, in order to make it easy to iterate over islands
+		void	sortIslands();
+
+	  void	reset(int N);
+
+	  SIMD_FORCE_INLINE int	getNumElements() const
+	  {
+		  return int(m_elements.size());
+	  }
+	  SIMD_FORCE_INLINE bool  isRoot(int x) const
+	  {
+		  return (x == m_elements[x].m_id);
+	  }
+
+	  btElement&	getElement(int index)
+	  {
+		  return m_elements[index];
+	  }
+	  const btElement& getElement(int index) const
+	  {
+		  return m_elements[index];
+	  }
+   
+	  void	allocate(int N);
+	  void	Free();
+
+
+
+
+	  int find(int p, int q)
+		{ 
+			return (find(p) == find(q)); 
+		}
+
+		void unite(int p, int q)
+		{
+			int i = find(p), j = find(q);
+			if (i == j) 
+				return;
+
+#ifndef USE_PATH_COMPRESSION
+			//weighted quick union, this keeps the 'trees' balanced, and keeps performance of unite O( log(n) )
+			if (m_elements[i].m_sz < m_elements[j].m_sz)
+			{ 
+				m_elements[i].m_id = j; m_elements[j].m_sz += m_elements[i].m_sz; 
+			}
+			else 
+			{ 
+				m_elements[j].m_id = i; m_elements[i].m_sz += m_elements[j].m_sz; 
+			}
+#else
+			m_elements[i].m_id = j; m_elements[j].m_sz += m_elements[i].m_sz; 
+#endif //USE_PATH_COMPRESSION
+		}
+
+		int find(int x)
+		{ 
+			//btAssert(x < m_N);
+			//btAssert(x >= 0);
+
+			while (x != m_elements[x].m_id) 
+			{
+		//not really a reason not to use path compression, and it flattens the trees/improves find performance dramatically
+	
+		#ifdef USE_PATH_COMPRESSION
+				const btElement* elementPtr = &m_elements[m_elements[x].m_id];
+				m_elements[x].m_id = elementPtr->m_id;
+				x = elementPtr->m_id;			
+		#else//
+				x = m_elements[x].m_id;
+		#endif		
+				//btAssert(x < m_N);
+				//btAssert(x >= 0);
+
+			}
+			return x; 
+		}
+
+
+  };
+
+
+#endif //BT_UNION_FIND_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.cpp
new file mode 100644
index 0000000..ecce028
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.cpp
@@ -0,0 +1,42 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btBox2dShape.h"
+
+
+//{ 
+
+
+void btBox2dShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
+}
+
+
+void	btBox2dShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	//btScalar margin = btScalar(0.);
+	btVector3 halfExtents = getHalfExtentsWithMargin();
+
+	btScalar lx=btScalar(2.)*(halfExtents.x());
+	btScalar ly=btScalar(2.)*(halfExtents.y());
+	btScalar lz=btScalar(2.)*(halfExtents.z());
+
+	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
+					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
+					mass/(btScalar(12.0)) * (lx*lx + ly*ly));
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.h
new file mode 100644
index 0000000..93e8fab
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBox2dShape.h
@@ -0,0 +1,363 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_OBB_BOX_2D_SHAPE_H
+#define BT_OBB_BOX_2D_SHAPE_H
+
+#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btMinMax.h"
+
+///The btBox2dShape is a box primitive around the origin, its sides axis aligned with length specified by half extents, in local shape coordinates. When used as part of a btCollisionObject or btRigidBody it will be an oriented box in world space.
+class btBox2dShape: public btPolyhedralConvexShape
+{
+
+	//btVector3	m_boxHalfExtents1; //use m_implicitShapeDimensions instead
+
+	btVector3 m_centroid;
+	btVector3 m_vertices[4];
+	btVector3 m_normals[4];
+
+public:
+
+	btVector3 getHalfExtentsWithMargin() const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+		btVector3 margin(getMargin(),getMargin(),getMargin());
+		halfExtents += margin;
+		return halfExtents;
+	}
+	
+	const btVector3& getHalfExtentsWithoutMargin() const
+	{
+		return m_implicitShapeDimensions;//changed in Bullet 2.63: assume the scaling and margin are included
+	}
+	
+
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec) const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+		btVector3 margin(getMargin(),getMargin(),getMargin());
+		halfExtents += margin;
+		
+		return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
+			btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
+			btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
+	}
+
+	SIMD_FORCE_INLINE  btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+	{
+		const btVector3& halfExtents = getHalfExtentsWithoutMargin();
+		
+		return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
+			btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
+			btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
+	}
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+	{
+		const btVector3& halfExtents = getHalfExtentsWithoutMargin();
+	
+		for (int i=0;i<numVectors;i++)
+		{
+			const btVector3& vec = vectors[i];
+			supportVerticesOut[i].setValue(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
+				btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
+				btFsels(vec.z(), halfExtents.z(), -halfExtents.z())); 
+		}
+
+	}
+
+
+	btBox2dShape( const btVector3& boxHalfExtents) 
+		: btPolyhedralConvexShape(),
+		m_centroid(0,0,0)
+	{
+		m_vertices[0].setValue(-boxHalfExtents.getX(),-boxHalfExtents.getY(),0);
+		m_vertices[1].setValue(boxHalfExtents.getX(),-boxHalfExtents.getY(),0);
+		m_vertices[2].setValue(boxHalfExtents.getX(),boxHalfExtents.getY(),0);
+		m_vertices[3].setValue(-boxHalfExtents.getX(),boxHalfExtents.getY(),0);
+
+		m_normals[0].setValue(0,-1,0);
+		m_normals[1].setValue(1,0,0);
+		m_normals[2].setValue(0,1,0);
+		m_normals[3].setValue(-1,0,0);
+
+		m_shapeType = BOX_2D_SHAPE_PROXYTYPE;
+		btVector3 margin(getMargin(),getMargin(),getMargin());
+		m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin;
+	};
+
+	virtual void setMargin(btScalar collisionMargin)
+	{
+		//correct the m_implicitShapeDimensions for the margin
+		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
+		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
+		
+		btConvexInternalShape::setMargin(collisionMargin);
+		btVector3 newMargin(getMargin(),getMargin(),getMargin());
+		m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
+
+	}
+	virtual void	setLocalScaling(const btVector3& scaling)
+	{
+		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
+		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
+		btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
+
+		btConvexInternalShape::setLocalScaling(scaling);
+
+		m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
+
+	}
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+
+
+
+
+	int	getVertexCount() const
+	{
+		return 4;
+	}
+
+	virtual int getNumVertices()const
+	{
+		return 4;
+	}
+
+	const btVector3* getVertices() const
+	{
+		return &m_vertices[0];
+	}
+
+	const btVector3* getNormals() const
+	{
+		return &m_normals[0];
+	}
+
+
+
+
+
+
+
+	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const
+	{
+		//this plane might not be aligned...
+		btVector4 plane ;
+		getPlaneEquation(plane,i);
+		planeNormal = btVector3(plane.getX(),plane.getY(),plane.getZ());
+		planeSupport = localGetSupportingVertex(-planeNormal);
+	}
+
+
+	const btVector3& getCentroid() const
+	{
+		return m_centroid;
+	}
+	
+	virtual int getNumPlanes() const
+	{
+		return 6;
+	}	
+	
+	
+
+	virtual int getNumEdges() const
+	{
+		return 12;
+	}
+
+
+	virtual void getVertex(int i,btVector3& vtx) const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+
+		vtx = btVector3(
+				halfExtents.x() * (1-(i&1)) - halfExtents.x() * (i&1),
+				halfExtents.y() * (1-((i&2)>>1)) - halfExtents.y() * ((i&2)>>1),
+				halfExtents.z() * (1-((i&4)>>2)) - halfExtents.z() * ((i&4)>>2));
+	}
+	
+
+	virtual void	getPlaneEquation(btVector4& plane,int i) const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+
+		switch (i)
+		{
+		case 0:
+			plane.setValue(btScalar(1.),btScalar(0.),btScalar(0.),-halfExtents.x());
+			break;
+		case 1:
+			plane.setValue(btScalar(-1.),btScalar(0.),btScalar(0.),-halfExtents.x());
+			break;
+		case 2:
+			plane.setValue(btScalar(0.),btScalar(1.),btScalar(0.),-halfExtents.y());
+			break;
+		case 3:
+			plane.setValue(btScalar(0.),btScalar(-1.),btScalar(0.),-halfExtents.y());
+			break;
+		case 4:
+			plane.setValue(btScalar(0.),btScalar(0.),btScalar(1.),-halfExtents.z());
+			break;
+		case 5:
+			plane.setValue(btScalar(0.),btScalar(0.),btScalar(-1.),-halfExtents.z());
+			break;
+		default:
+			btAssert(0);
+		}
+	}
+
+	
+	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const
+	//virtual void getEdge(int i,Edge& edge) const
+	{
+		int edgeVert0 = 0;
+		int edgeVert1 = 0;
+
+		switch (i)
+		{
+		case 0:
+				edgeVert0 = 0;
+				edgeVert1 = 1;
+			break;
+		case 1:
+				edgeVert0 = 0;
+				edgeVert1 = 2;
+			break;
+		case 2:
+			edgeVert0 = 1;
+			edgeVert1 = 3;
+
+			break;
+		case 3:
+			edgeVert0 = 2;
+			edgeVert1 = 3;
+			break;
+		case 4:
+			edgeVert0 = 0;
+			edgeVert1 = 4;
+			break;
+		case 5:
+			edgeVert0 = 1;
+			edgeVert1 = 5;
+
+			break;
+		case 6:
+			edgeVert0 = 2;
+			edgeVert1 = 6;
+			break;
+		case 7:
+			edgeVert0 = 3;
+			edgeVert1 = 7;
+			break;
+		case 8:
+			edgeVert0 = 4;
+			edgeVert1 = 5;
+			break;
+		case 9:
+			edgeVert0 = 4;
+			edgeVert1 = 6;
+			break;
+		case 10:
+			edgeVert0 = 5;
+			edgeVert1 = 7;
+			break;
+		case 11:
+			edgeVert0 = 6;
+			edgeVert1 = 7;
+			break;
+		default:
+			btAssert(0);
+
+		}
+
+		getVertex(edgeVert0,pa );
+		getVertex(edgeVert1,pb );
+	}
+
+
+
+
+	
+	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+
+		//btScalar minDist = 2*tolerance;
+		
+		bool result =	(pt.x() <= (halfExtents.x()+tolerance)) &&
+						(pt.x() >= (-halfExtents.x()-tolerance)) &&
+						(pt.y() <= (halfExtents.y()+tolerance)) &&
+						(pt.y() >= (-halfExtents.y()-tolerance)) &&
+						(pt.z() <= (halfExtents.z()+tolerance)) &&
+						(pt.z() >= (-halfExtents.z()-tolerance));
+		
+		return result;
+	}
+
+
+	//debugging
+	virtual const char*	getName()const
+	{
+		return "Box2d";
+	}
+
+	virtual int		getNumPreferredPenetrationDirections() const
+	{
+		return 6;
+	}
+	
+	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
+	{
+		switch (index)
+		{
+		case 0:
+			penetrationVector.setValue(btScalar(1.),btScalar(0.),btScalar(0.));
+			break;
+		case 1:
+			penetrationVector.setValue(btScalar(-1.),btScalar(0.),btScalar(0.));
+			break;
+		case 2:
+			penetrationVector.setValue(btScalar(0.),btScalar(1.),btScalar(0.));
+			break;
+		case 3:
+			penetrationVector.setValue(btScalar(0.),btScalar(-1.),btScalar(0.));
+			break;
+		case 4:
+			penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(1.));
+			break;
+		case 5:
+			penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(-1.));
+			break;
+		default:
+			btAssert(0);
+		}
+	}
+
+};
+
+#endif //BT_OBB_BOX_2D_SHAPE_H
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp
new file mode 100644
index 0000000..c6644ef
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.cpp
@@ -0,0 +1,41 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#include "btBoxShape.h"
+
+
+//{ 
+
+
+void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
+}
+
+
+void	btBoxShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	//btScalar margin = btScalar(0.);
+	btVector3 halfExtents = getHalfExtentsWithMargin();
+
+	btScalar lx=btScalar(2.)*(halfExtents.x());
+	btScalar ly=btScalar(2.)*(halfExtents.y());
+	btScalar lz=btScalar(2.)*(halfExtents.z());
+
+	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
+					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
+					mass/(btScalar(12.0)) * (lx*lx + ly*ly));
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h
new file mode 100644
index 0000000..8b8525d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBoxShape.h
@@ -0,0 +1,318 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_OBB_BOX_MINKOWSKI_H
+#define BT_OBB_BOX_MINKOWSKI_H
+
+#include "btPolyhedralConvexShape.h"
+#include "btCollisionMargin.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btMinMax.h"
+
+///The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by half extents, in local shape coordinates. When used as part of a btCollisionObject or btRigidBody it will be an oriented box in world space.
+class btBoxShape: public btPolyhedralConvexShape
+{
+
+	//btVector3	m_boxHalfExtents1; //use m_implicitShapeDimensions instead
+
+
+public:
+
+	btVector3 getHalfExtentsWithMargin() const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+		btVector3 margin(getMargin(),getMargin(),getMargin());
+		halfExtents += margin;
+		return halfExtents;
+	}
+	
+	const btVector3& getHalfExtentsWithoutMargin() const
+	{
+		return m_implicitShapeDimensions;//scaling is included, margin is not
+	}
+	
+
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec) const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+		btVector3 margin(getMargin(),getMargin(),getMargin());
+		halfExtents += margin;
+		
+		return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
+			btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
+			btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
+	}
+
+	SIMD_FORCE_INLINE  btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+	{
+		const btVector3& halfExtents = getHalfExtentsWithoutMargin();
+		
+		return btVector3(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
+			btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
+			btFsels(vec.z(), halfExtents.z(), -halfExtents.z()));
+	}
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+	{
+		const btVector3& halfExtents = getHalfExtentsWithoutMargin();
+	
+		for (int i=0;i<numVectors;i++)
+		{
+			const btVector3& vec = vectors[i];
+			supportVerticesOut[i].setValue(btFsels(vec.x(), halfExtents.x(), -halfExtents.x()),
+				btFsels(vec.y(), halfExtents.y(), -halfExtents.y()),
+				btFsels(vec.z(), halfExtents.z(), -halfExtents.z())); 
+		}
+
+	}
+
+
+	btBoxShape( const btVector3& boxHalfExtents) 
+		: btPolyhedralConvexShape()
+	{
+		m_shapeType = BOX_SHAPE_PROXYTYPE;
+		btVector3 margin(getMargin(),getMargin(),getMargin());
+		m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin;
+	};
+
+	virtual void setMargin(btScalar collisionMargin)
+	{
+		//correct the m_implicitShapeDimensions for the margin
+		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
+		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
+		
+		btConvexInternalShape::setMargin(collisionMargin);
+		btVector3 newMargin(getMargin(),getMargin(),getMargin());
+		m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
+
+	}
+	virtual void	setLocalScaling(const btVector3& scaling)
+	{
+		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
+		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
+		btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
+
+		btConvexInternalShape::setLocalScaling(scaling);
+
+		m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
+
+	}
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const
+	{
+		//this plane might not be aligned...
+		btVector4 plane ;
+		getPlaneEquation(plane,i);
+		planeNormal = btVector3(plane.getX(),plane.getY(),plane.getZ());
+		planeSupport = localGetSupportingVertex(-planeNormal);
+	}
+
+	
+	virtual int getNumPlanes() const
+	{
+		return 6;
+	}	
+	
+	virtual int	getNumVertices() const 
+	{
+		return 8;
+	}
+
+	virtual int getNumEdges() const
+	{
+		return 12;
+	}
+
+
+	virtual void getVertex(int i,btVector3& vtx) const
+	{
+		btVector3 halfExtents = getHalfExtentsWithMargin();
+
+		vtx = btVector3(
+				halfExtents.x() * (1-(i&1)) - halfExtents.x() * (i&1),
+				halfExtents.y() * (1-((i&2)>>1)) - halfExtents.y() * ((i&2)>>1),
+				halfExtents.z() * (1-((i&4)>>2)) - halfExtents.z() * ((i&4)>>2));
+	}
+	
+
+	virtual void	getPlaneEquation(btVector4& plane,int i) const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+
+		switch (i)
+		{
+		case 0:
+			plane.setValue(btScalar(1.),btScalar(0.),btScalar(0.),-halfExtents.x());
+			break;
+		case 1:
+			plane.setValue(btScalar(-1.),btScalar(0.),btScalar(0.),-halfExtents.x());
+			break;
+		case 2:
+			plane.setValue(btScalar(0.),btScalar(1.),btScalar(0.),-halfExtents.y());
+			break;
+		case 3:
+			plane.setValue(btScalar(0.),btScalar(-1.),btScalar(0.),-halfExtents.y());
+			break;
+		case 4:
+			plane.setValue(btScalar(0.),btScalar(0.),btScalar(1.),-halfExtents.z());
+			break;
+		case 5:
+			plane.setValue(btScalar(0.),btScalar(0.),btScalar(-1.),-halfExtents.z());
+			break;
+		default:
+			btAssert(0);
+		}
+	}
+
+	
+	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const
+	//virtual void getEdge(int i,Edge& edge) const
+	{
+		int edgeVert0 = 0;
+		int edgeVert1 = 0;
+
+		switch (i)
+		{
+		case 0:
+				edgeVert0 = 0;
+				edgeVert1 = 1;
+			break;
+		case 1:
+				edgeVert0 = 0;
+				edgeVert1 = 2;
+			break;
+		case 2:
+			edgeVert0 = 1;
+			edgeVert1 = 3;
+
+			break;
+		case 3:
+			edgeVert0 = 2;
+			edgeVert1 = 3;
+			break;
+		case 4:
+			edgeVert0 = 0;
+			edgeVert1 = 4;
+			break;
+		case 5:
+			edgeVert0 = 1;
+			edgeVert1 = 5;
+
+			break;
+		case 6:
+			edgeVert0 = 2;
+			edgeVert1 = 6;
+			break;
+		case 7:
+			edgeVert0 = 3;
+			edgeVert1 = 7;
+			break;
+		case 8:
+			edgeVert0 = 4;
+			edgeVert1 = 5;
+			break;
+		case 9:
+			edgeVert0 = 4;
+			edgeVert1 = 6;
+			break;
+		case 10:
+			edgeVert0 = 5;
+			edgeVert1 = 7;
+			break;
+		case 11:
+			edgeVert0 = 6;
+			edgeVert1 = 7;
+			break;
+		default:
+			btAssert(0);
+
+		}
+
+		getVertex(edgeVert0,pa );
+		getVertex(edgeVert1,pb );
+	}
+
+
+
+
+	
+	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+
+		//btScalar minDist = 2*tolerance;
+		
+		bool result =	(pt.x() <= (halfExtents.x()+tolerance)) &&
+						(pt.x() >= (-halfExtents.x()-tolerance)) &&
+						(pt.y() <= (halfExtents.y()+tolerance)) &&
+						(pt.y() >= (-halfExtents.y()-tolerance)) &&
+						(pt.z() <= (halfExtents.z()+tolerance)) &&
+						(pt.z() >= (-halfExtents.z()-tolerance));
+		
+		return result;
+	}
+
+
+	//debugging
+	virtual const char*	getName()const
+	{
+		return "Box";
+	}
+
+	virtual int		getNumPreferredPenetrationDirections() const
+	{
+		return 6;
+	}
+	
+	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
+	{
+		switch (index)
+		{
+		case 0:
+			penetrationVector.setValue(btScalar(1.),btScalar(0.),btScalar(0.));
+			break;
+		case 1:
+			penetrationVector.setValue(btScalar(-1.),btScalar(0.),btScalar(0.));
+			break;
+		case 2:
+			penetrationVector.setValue(btScalar(0.),btScalar(1.),btScalar(0.));
+			break;
+		case 3:
+			penetrationVector.setValue(btScalar(0.),btScalar(-1.),btScalar(0.));
+			break;
+		case 4:
+			penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(1.));
+			break;
+		case 5:
+			penetrationVector.setValue(btScalar(0.),btScalar(0.),btScalar(-1.));
+			break;
+		default:
+			btAssert(0);
+		}
+	}
+
+};
+
+
+#endif //BT_OBB_BOX_MINKOWSKI_H
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
new file mode 100644
index 0000000..ace4cfa
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
@@ -0,0 +1,466 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+//#define DISABLE_BVH
+
+#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
+#include "LinearMath/btSerializer.h"
+
+///Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization.
+///Uses an interface to access the triangles to allow for sharing graphics/physics triangles.
+btBvhTriangleMeshShape::btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh)
+:btTriangleMeshShape(meshInterface),
+m_bvh(0),
+m_triangleInfoMap(0),
+m_useQuantizedAabbCompression(useQuantizedAabbCompression),
+m_ownsBvh(false)
+{
+	m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;
+	//construct bvh from meshInterface
+#ifndef DISABLE_BVH
+
+	if (buildBvh)
+	{
+		buildOptimizedBvh();
+	}
+
+#endif //DISABLE_BVH
+
+}
+
+btBvhTriangleMeshShape::btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,bool buildBvh)
+:btTriangleMeshShape(meshInterface),
+m_bvh(0),
+m_triangleInfoMap(0),
+m_useQuantizedAabbCompression(useQuantizedAabbCompression),
+m_ownsBvh(false)
+{
+	m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;
+	//construct bvh from meshInterface
+#ifndef DISABLE_BVH
+
+	if (buildBvh)
+	{
+		void* mem = btAlignedAlloc(sizeof(btOptimizedBvh),16);
+		m_bvh = new (mem) btOptimizedBvh();
+		
+		m_bvh->build(meshInterface,m_useQuantizedAabbCompression,bvhAabbMin,bvhAabbMax);
+		m_ownsBvh = true;
+	}
+
+#endif //DISABLE_BVH
+
+}
+
+void	btBvhTriangleMeshShape::partialRefitTree(const btVector3& aabbMin,const btVector3& aabbMax)
+{
+	m_bvh->refitPartial( m_meshInterface,aabbMin,aabbMax );
+	
+	m_localAabbMin.setMin(aabbMin);
+	m_localAabbMax.setMax(aabbMax);
+}
+
+
+void	btBvhTriangleMeshShape::refitTree(const btVector3& aabbMin,const btVector3& aabbMax)
+{
+	m_bvh->refit( m_meshInterface, aabbMin,aabbMax );
+	
+	recalcLocalAabb();
+}
+
+btBvhTriangleMeshShape::~btBvhTriangleMeshShape()
+{
+	if (m_ownsBvh)
+	{
+		m_bvh->~btOptimizedBvh();
+		btAlignedFree(m_bvh);
+	}
+}
+
+void	btBvhTriangleMeshShape::performRaycast (btTriangleCallback* callback, const btVector3& raySource, const btVector3& rayTarget)
+{
+	struct	MyNodeOverlapCallback : public btNodeOverlapCallback
+	{
+		btStridingMeshInterface*	m_meshInterface;
+		btTriangleCallback* m_callback;
+
+		MyNodeOverlapCallback(btTriangleCallback* callback,btStridingMeshInterface* meshInterface)
+			:m_meshInterface(meshInterface),
+			m_callback(callback)
+		{
+		}
+				
+		virtual void processNode(int nodeSubPart, int nodeTriangleIndex)
+		{
+			btVector3 m_triangle[3];
+			const unsigned char *vertexbase;
+			int numverts;
+			PHY_ScalarType type;
+			int stride;
+			const unsigned char *indexbase;
+			int indexstride;
+			int numfaces;
+			PHY_ScalarType indicestype;
+
+			m_meshInterface->getLockedReadOnlyVertexIndexBase(
+				&vertexbase,
+				numverts,
+				type,
+				stride,
+				&indexbase,
+				indexstride,
+				numfaces,
+				indicestype,
+				nodeSubPart);
+
+			unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
+			btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT);
+	
+			const btVector3& meshScaling = m_meshInterface->getScaling();
+			for (int j=2;j>=0;j--)
+			{
+				int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
+				
+				if (type == PHY_FLOAT)
+				{
+					float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
+					
+					m_triangle[j] = btVector3(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());		
+				}
+				else
+				{
+					double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
+					
+					m_triangle[j] = btVector3(btScalar(graphicsbase[0])*meshScaling.getX(),btScalar(graphicsbase[1])*meshScaling.getY(),btScalar(graphicsbase[2])*meshScaling.getZ());		
+				}
+			}
+
+			/* Perform ray vs. triangle collision here */
+			m_callback->processTriangle(m_triangle,nodeSubPart,nodeTriangleIndex);
+			m_meshInterface->unLockReadOnlyVertexBase(nodeSubPart);
+		}
+	};
+
+	MyNodeOverlapCallback	myNodeCallback(callback,m_meshInterface);
+
+	m_bvh->reportRayOverlappingNodex(&myNodeCallback,raySource,rayTarget);
+}
+
+void	btBvhTriangleMeshShape::performConvexcast (btTriangleCallback* callback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax)
+{
+	struct	MyNodeOverlapCallback : public btNodeOverlapCallback
+	{
+		btStridingMeshInterface*	m_meshInterface;
+		btTriangleCallback* m_callback;
+
+		MyNodeOverlapCallback(btTriangleCallback* callback,btStridingMeshInterface* meshInterface)
+			:m_meshInterface(meshInterface),
+			m_callback(callback)
+		{
+		}
+				
+		virtual void processNode(int nodeSubPart, int nodeTriangleIndex)
+		{
+			btVector3 m_triangle[3];
+			const unsigned char *vertexbase;
+			int numverts;
+			PHY_ScalarType type;
+			int stride;
+			const unsigned char *indexbase;
+			int indexstride;
+			int numfaces;
+			PHY_ScalarType indicestype;
+
+			m_meshInterface->getLockedReadOnlyVertexIndexBase(
+				&vertexbase,
+				numverts,
+				type,
+				stride,
+				&indexbase,
+				indexstride,
+				numfaces,
+				indicestype,
+				nodeSubPart);
+
+			unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
+			btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT);
+	
+			const btVector3& meshScaling = m_meshInterface->getScaling();
+			for (int j=2;j>=0;j--)
+			{
+				int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
+
+				if (type == PHY_FLOAT)
+				{
+					float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
+
+					m_triangle[j] = btVector3(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());		
+				}
+				else
+				{
+					double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
+					
+					m_triangle[j] = btVector3(btScalar(graphicsbase[0])*meshScaling.getX(),btScalar(graphicsbase[1])*meshScaling.getY(),btScalar(graphicsbase[2])*meshScaling.getZ());		
+				}
+			}
+
+			/* Perform ray vs. triangle collision here */
+			m_callback->processTriangle(m_triangle,nodeSubPart,nodeTriangleIndex);
+			m_meshInterface->unLockReadOnlyVertexBase(nodeSubPart);
+		}
+	};
+
+	MyNodeOverlapCallback	myNodeCallback(callback,m_meshInterface);
+
+	m_bvh->reportBoxCastOverlappingNodex (&myNodeCallback, raySource, rayTarget, aabbMin, aabbMax);
+}
+
+//perform bvh tree traversal and report overlapping triangles to 'callback'
+void	btBvhTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+
+#ifdef DISABLE_BVH
+	//brute force traverse all triangles
+	btTriangleMeshShape::processAllTriangles(callback,aabbMin,aabbMax);
+#else
+
+	//first get all the nodes
+
+	
+	struct	MyNodeOverlapCallback : public btNodeOverlapCallback
+	{
+		btStridingMeshInterface*	m_meshInterface;
+		btTriangleCallback*		m_callback;
+		btVector3				m_triangle[3];
+
+
+		MyNodeOverlapCallback(btTriangleCallback* callback,btStridingMeshInterface* meshInterface)
+			:m_meshInterface(meshInterface),
+			m_callback(callback)
+		{
+		}
+				
+		virtual void processNode(int nodeSubPart, int nodeTriangleIndex)
+		{
+			const unsigned char *vertexbase;
+			int numverts;
+			PHY_ScalarType type;
+			int stride;
+			const unsigned char *indexbase;
+			int indexstride;
+			int numfaces;
+			PHY_ScalarType indicestype;
+			
+
+			m_meshInterface->getLockedReadOnlyVertexIndexBase(
+				&vertexbase,
+				numverts,
+				type,
+				stride,
+				&indexbase,
+				indexstride,
+				numfaces,
+				indicestype,
+				nodeSubPart);
+
+			unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
+			btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT||indicestype==PHY_UCHAR);
+	
+			const btVector3& meshScaling = m_meshInterface->getScaling();
+			for (int j=2;j>=0;j--)
+			{
+				
+				int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:indicestype==PHY_INTEGER?gfxbase[j]:((unsigned char*)gfxbase)[j];
+
+
+#ifdef DEBUG_TRIANGLE_MESH
+				printf("%d ,",graphicsindex);
+#endif //DEBUG_TRIANGLE_MESH
+				if (type == PHY_FLOAT)
+				{
+					float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
+					
+					m_triangle[j] = btVector3(
+																		graphicsbase[0]*meshScaling.getX(),
+																		graphicsbase[1]*meshScaling.getY(),
+																		graphicsbase[2]*meshScaling.getZ());
+				}
+				else
+				{
+					double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
+
+					m_triangle[j] = btVector3(
+						btScalar(graphicsbase[0])*meshScaling.getX(),
+						btScalar(graphicsbase[1])*meshScaling.getY(),
+						btScalar(graphicsbase[2])*meshScaling.getZ());
+				}
+#ifdef DEBUG_TRIANGLE_MESH
+				printf("triangle vertices:%f,%f,%f\n",triangle[j].x(),triangle[j].y(),triangle[j].z());
+#endif //DEBUG_TRIANGLE_MESH
+			}
+
+			m_callback->processTriangle(m_triangle,nodeSubPart,nodeTriangleIndex);
+			m_meshInterface->unLockReadOnlyVertexBase(nodeSubPart);
+		}
+
+	};
+
+	MyNodeOverlapCallback	myNodeCallback(callback,m_meshInterface);
+
+	m_bvh->reportAabbOverlappingNodex(&myNodeCallback,aabbMin,aabbMax);
+
+
+#endif//DISABLE_BVH
+
+
+}
+
+void   btBvhTriangleMeshShape::setLocalScaling(const btVector3& scaling)
+{
+   if ((getLocalScaling() -scaling).length2() > SIMD_EPSILON)
+   {
+      btTriangleMeshShape::setLocalScaling(scaling);
+	  buildOptimizedBvh();
+   }
+}
+
+void   btBvhTriangleMeshShape::buildOptimizedBvh()
+{
+	if (m_ownsBvh)
+	{
+		m_bvh->~btOptimizedBvh();
+		btAlignedFree(m_bvh);
+	}
+	///m_localAabbMin/m_localAabbMax is already re-calculated in btTriangleMeshShape. We could just scale aabb, but this needs some more work
+	void* mem = btAlignedAlloc(sizeof(btOptimizedBvh),16);
+	m_bvh = new(mem) btOptimizedBvh();
+	//rebuild the bvh...
+	m_bvh->build(m_meshInterface,m_useQuantizedAabbCompression,m_localAabbMin,m_localAabbMax);
+	m_ownsBvh = true;
+}
+
+void   btBvhTriangleMeshShape::setOptimizedBvh(btOptimizedBvh* bvh, const btVector3& scaling)
+{
+   btAssert(!m_bvh);
+   btAssert(!m_ownsBvh);
+
+   m_bvh = bvh;
+   m_ownsBvh = false;
+   // update the scaling without rebuilding the bvh
+   if ((getLocalScaling() -scaling).length2() > SIMD_EPSILON)
+   {
+      btTriangleMeshShape::setLocalScaling(scaling);
+   }
+}
+
+
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btBvhTriangleMeshShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btTriangleMeshShapeData* trimeshData = (btTriangleMeshShapeData*) dataBuffer;
+
+	btCollisionShape::serialize(&trimeshData->m_collisionShapeData,serializer);
+
+	m_meshInterface->serialize(&trimeshData->m_meshInterface, serializer);
+
+	trimeshData->m_collisionMargin = float(m_collisionMargin);
+
+	
+
+	if (m_bvh && !(serializer->getSerializationFlags()&BT_SERIALIZE_NO_BVH))
+	{
+		void* chunk = serializer->findPointer(m_bvh);
+		if (chunk)
+		{
+#ifdef BT_USE_DOUBLE_PRECISION
+			trimeshData->m_quantizedDoubleBvh = (btQuantizedBvhData*)chunk;
+			trimeshData->m_quantizedFloatBvh = 0;
+#else
+			trimeshData->m_quantizedFloatBvh  = (btQuantizedBvhData*)chunk;
+			trimeshData->m_quantizedDoubleBvh= 0;
+#endif //BT_USE_DOUBLE_PRECISION
+		} else
+		{
+
+#ifdef BT_USE_DOUBLE_PRECISION
+			trimeshData->m_quantizedDoubleBvh = (btQuantizedBvhData*)serializer->getUniquePointer(m_bvh);
+			trimeshData->m_quantizedFloatBvh = 0;
+#else
+			trimeshData->m_quantizedFloatBvh  = (btQuantizedBvhData*)serializer->getUniquePointer(m_bvh);
+			trimeshData->m_quantizedDoubleBvh= 0;
+#endif //BT_USE_DOUBLE_PRECISION
+	
+			int sz = m_bvh->calculateSerializeBufferSizeNew();
+			btChunk* chunk = serializer->allocate(sz,1);
+			const char* structType = m_bvh->serialize(chunk->m_oldPtr, serializer);
+			serializer->finalizeChunk(chunk,structType,BT_QUANTIZED_BVH_CODE,m_bvh);
+		}
+	} else
+	{
+		trimeshData->m_quantizedFloatBvh = 0;
+		trimeshData->m_quantizedDoubleBvh = 0;
+	}
+
+	
+
+	if (m_triangleInfoMap && !(serializer->getSerializationFlags()&BT_SERIALIZE_NO_TRIANGLEINFOMAP))
+	{
+		void* chunk = serializer->findPointer(m_triangleInfoMap);
+		if (chunk)
+		{
+			trimeshData->m_triangleInfoMap = (btTriangleInfoMapData*)chunk;
+		} else
+		{
+			trimeshData->m_triangleInfoMap = (btTriangleInfoMapData*)serializer->getUniquePointer(m_triangleInfoMap);
+			int sz = m_triangleInfoMap->calculateSerializeBufferSize();
+			btChunk* chunk = serializer->allocate(sz,1);
+			const char* structType = m_triangleInfoMap->serialize(chunk->m_oldPtr, serializer);
+			serializer->finalizeChunk(chunk,structType,BT_TRIANLGE_INFO_MAP,m_triangleInfoMap);
+		}
+	} else
+	{
+		trimeshData->m_triangleInfoMap = 0;
+	}
+
+	return "btTriangleMeshShapeData";
+}
+
+void	btBvhTriangleMeshShape::serializeSingleBvh(btSerializer* serializer) const
+{
+	if (m_bvh)
+	{
+		int len = m_bvh->calculateSerializeBufferSizeNew(); //make sure not to use calculateSerializeBufferSize because it is used for in-place
+		btChunk* chunk = serializer->allocate(len,1);
+		const char* structType = m_bvh->serialize(chunk->m_oldPtr, serializer);
+		serializer->finalizeChunk(chunk,structType,BT_QUANTIZED_BVH_CODE,(void*)m_bvh);
+	}
+}
+
+void	btBvhTriangleMeshShape::serializeSingleTriangleInfoMap(btSerializer* serializer) const
+{
+	if (m_triangleInfoMap)
+	{
+		int len = m_triangleInfoMap->calculateSerializeBufferSize();
+		btChunk* chunk = serializer->allocate(len,1);
+		const char* structType = m_triangleInfoMap->serialize(chunk->m_oldPtr, serializer);
+		serializer->finalizeChunk(chunk,structType,BT_TRIANLGE_INFO_MAP,(void*)m_triangleInfoMap);
+	}
+}
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h
new file mode 100644
index 0000000..d1c2162
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h
@@ -0,0 +1,139 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_BVH_TRIANGLE_MESH_SHAPE_H
+#define BT_BVH_TRIANGLE_MESH_SHAPE_H
+
+#include "btTriangleMeshShape.h"
+#include "btOptimizedBvh.h"
+#include "LinearMath/btAlignedAllocator.h"
+#include "btTriangleInfoMap.h"
+
+///The btBvhTriangleMeshShape is a static-triangle mesh shape with several optimizations, such as bounding volume hierarchy and cache friendly traversal for PlayStation 3 Cell SPU. It is recommended to enable useQuantizedAabbCompression for better memory usage.
+///It takes a triangle mesh as input, for example a btTriangleMesh or btTriangleIndexVertexArray. The btBvhTriangleMeshShape class allows for triangle mesh deformations by a refit or partialRefit method.
+///Instead of building the bounding volume hierarchy acceleration structure, it is also possible to serialize (save) and deserialize (load) the structure from disk.
+///See Demos\ConcaveDemo\ConcavePhysicsDemo.cpp for an example.
+ATTRIBUTE_ALIGNED16(class) btBvhTriangleMeshShape : public btTriangleMeshShape
+{
+
+	btOptimizedBvh*	m_bvh;
+	btTriangleInfoMap*	m_triangleInfoMap;
+
+	bool m_useQuantizedAabbCompression;
+	bool m_ownsBvh;
+	bool m_pad[11];////need padding due to alignment
+
+public:
+
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	
+	btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true);
+
+	///optionally pass in a larger bvh aabb, used for quantization. This allows for deformations within this aabb
+	btBvhTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax, bool buildBvh = true);
+	
+	virtual ~btBvhTriangleMeshShape();
+
+	bool getOwnsBvh () const
+	{
+		return m_ownsBvh;
+	}
+
+
+	
+	void performRaycast (btTriangleCallback* callback, const btVector3& raySource, const btVector3& rayTarget);
+	void performConvexcast (btTriangleCallback* callback, const btVector3& boxSource, const btVector3& boxTarget, const btVector3& boxMin, const btVector3& boxMax);
+
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+	void	refitTree(const btVector3& aabbMin,const btVector3& aabbMax);
+
+	///for a fast incremental refit of parts of the tree. Note: the entire AABB of the tree will become more conservative, it never shrinks
+	void	partialRefitTree(const btVector3& aabbMin,const btVector3& aabbMax);
+
+	//debugging
+	virtual const char*	getName()const {return "BVHTRIANGLEMESH";}
+
+
+	virtual void	setLocalScaling(const btVector3& scaling);
+	
+	btOptimizedBvh*	getOptimizedBvh()
+	{
+		return m_bvh;
+	}
+
+	void	setOptimizedBvh(btOptimizedBvh* bvh, const btVector3& localScaling=btVector3(1,1,1));
+
+	void    buildOptimizedBvh();
+
+	bool	usesQuantizedAabbCompression() const
+	{
+		return	m_useQuantizedAabbCompression;
+	}
+
+	void	setTriangleInfoMap(btTriangleInfoMap* triangleInfoMap)
+	{
+		m_triangleInfoMap = triangleInfoMap;
+	}
+
+	const btTriangleInfoMap*	getTriangleInfoMap() const
+	{
+		return m_triangleInfoMap;
+	}
+	
+	btTriangleInfoMap*	getTriangleInfoMap()
+	{
+		return m_triangleInfoMap;
+	}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+	virtual void	serializeSingleBvh(btSerializer* serializer) const;
+
+	virtual void	serializeSingleTriangleInfoMap(btSerializer* serializer) const;
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btTriangleMeshShapeData
+{
+	btCollisionShapeData	m_collisionShapeData;
+
+	btStridingMeshInterfaceData m_meshInterface;
+
+	btQuantizedBvhFloatData		*m_quantizedFloatBvh;
+	btQuantizedBvhDoubleData	*m_quantizedDoubleBvh;
+
+	btTriangleInfoMapData	*m_triangleInfoMap;
+	
+	float	m_collisionMargin;
+
+	char m_pad3[4];
+	
+};
+
+
+SIMD_FORCE_INLINE	int	btBvhTriangleMeshShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btTriangleMeshShapeData);
+}
+
+
+
+#endif //BT_BVH_TRIANGLE_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp
new file mode 100644
index 0000000..2faa11d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp
@@ -0,0 +1,171 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btCapsuleShape.h"
+
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+#include "LinearMath/btQuaternion.h"
+
+btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : btConvexInternalShape ()
+{
+	m_shapeType = CAPSULE_SHAPE_PROXYTYPE;
+	m_upAxis = 1;
+	m_implicitShapeDimensions.setValue(radius,0.5f*height,radius);
+}
+
+ 
+ btVector3	btCapsuleShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
+{
+
+	btVector3 supVec(0,0,0);
+
+	btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
+
+	btVector3 vec = vec0;
+	btScalar lenSqr = vec.length2();
+	if (lenSqr < btScalar(0.0001))
+	{
+		vec.setValue(1,0,0);
+	} else
+	{
+		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
+		vec *= rlen;
+	}
+
+	btVector3 vtx;
+	btScalar newDot;
+	
+	btScalar radius = getRadius();
+
+
+	{
+		btVector3 pos(0,0,0);
+		pos[getUpAxis()] = getHalfHeight();
+
+		vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
+		newDot = vec.dot(vtx);
+		if (newDot > maxDot)
+		{
+			maxDot = newDot;
+			supVec = vtx;
+		}
+	}
+	{
+		btVector3 pos(0,0,0);
+		pos[getUpAxis()] = -getHalfHeight();
+
+		vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
+		newDot = vec.dot(vtx);
+		if (newDot > maxDot)
+		{
+			maxDot = newDot;
+			supVec = vtx;
+		}
+	}
+
+	return supVec;
+
+}
+
+ void	btCapsuleShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+
+	
+	btScalar radius = getRadius();
+
+	for (int j=0;j<numVectors;j++)
+	{
+		btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
+		const btVector3& vec = vectors[j];
+
+		btVector3 vtx;
+		btScalar newDot;
+		{
+			btVector3 pos(0,0,0);
+			pos[getUpAxis()] = getHalfHeight();
+			vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
+			newDot = vec.dot(vtx);
+			if (newDot > maxDot)
+			{
+				maxDot = newDot;
+				supportVerticesOut[j] = vtx;
+			}
+		}
+		{
+			btVector3 pos(0,0,0);
+			pos[getUpAxis()] = -getHalfHeight();
+			vtx = pos +vec*m_localScaling*(radius) - vec * getMargin();
+			newDot = vec.dot(vtx);
+			if (newDot > maxDot)
+			{
+				maxDot = newDot;
+				supportVerticesOut[j] = vtx;
+			}
+		}
+		
+	}
+}
+
+
+void	btCapsuleShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	//as an approximation, take the inertia of the box that bounds the spheres
+
+	btTransform ident;
+	ident.setIdentity();
+
+	
+	btScalar radius = getRadius();
+
+	btVector3 halfExtents(radius,radius,radius);
+	halfExtents[getUpAxis()]+=getHalfHeight();
+
+	btScalar margin = CONVEX_DISTANCE_MARGIN;
+
+	btScalar lx=btScalar(2.)*(halfExtents[0]+margin);
+	btScalar ly=btScalar(2.)*(halfExtents[1]+margin);
+	btScalar lz=btScalar(2.)*(halfExtents[2]+margin);
+	const btScalar x2 = lx*lx;
+	const btScalar y2 = ly*ly;
+	const btScalar z2 = lz*lz;
+	const btScalar scaledmass = mass * btScalar(.08333333);
+
+	inertia[0] = scaledmass * (y2+z2);
+	inertia[1] = scaledmass * (x2+z2);
+	inertia[2] = scaledmass * (x2+y2);
+
+}
+
+btCapsuleShapeX::btCapsuleShapeX(btScalar radius,btScalar height)
+{
+	m_upAxis = 0;
+	m_implicitShapeDimensions.setValue(0.5f*height, radius,radius);
+}
+
+
+
+
+
+
+btCapsuleShapeZ::btCapsuleShapeZ(btScalar radius,btScalar height)
+{
+	m_upAxis = 2;
+	m_implicitShapeDimensions.setValue(radius,radius,0.5f*height);
+}
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h
new file mode 100644
index 0000000..ab763ab
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h
@@ -0,0 +1,173 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CAPSULE_SHAPE_H
+#define BT_CAPSULE_SHAPE_H
+
+#include "btConvexInternalShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+
+
+///The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned around the X axis and btCapsuleShapeZ around the Z axis.
+///The total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps.
+///The btCapsuleShape is a convex hull of two spheres. The btMultiSphereShape is a more general collision shape that takes the convex hull of multiple sphere, so it can also represent a capsule when just using two spheres.
+class btCapsuleShape : public btConvexInternalShape
+{
+protected:
+	int	m_upAxis;
+
+protected:
+	///only used for btCapsuleShapeZ and btCapsuleShapeX subclasses.
+	btCapsuleShape() : btConvexInternalShape() {m_shapeType = CAPSULE_SHAPE_PROXYTYPE;};
+
+public:
+	btCapsuleShape(btScalar radius,btScalar height);
+
+	///CollisionShape Interface
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	/// btConvexShape Interface
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+	
+	virtual void setMargin(btScalar collisionMargin)
+	{
+		//correct the m_implicitShapeDimensions for the margin
+		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
+		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
+		
+		btConvexInternalShape::setMargin(collisionMargin);
+		btVector3 newMargin(getMargin(),getMargin(),getMargin());
+		m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
+
+	}
+
+	virtual void getAabb (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
+	{
+			btVector3 halfExtents(getRadius(),getRadius(),getRadius());
+			halfExtents[m_upAxis] = getRadius() + getHalfHeight();
+			halfExtents += btVector3(getMargin(),getMargin(),getMargin());
+			btMatrix3x3 abs_b = t.getBasis().absolute();  
+			btVector3 center = t.getOrigin();
+			btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));		  
+			
+			aabbMin = center - extent;
+			aabbMax = center + extent;
+	}
+
+	virtual const char*	getName()const 
+	{
+		return "CapsuleShape";
+	}
+
+	int	getUpAxis() const
+	{
+		return m_upAxis;
+	}
+
+	btScalar	getRadius() const
+	{
+		int radiusAxis = (m_upAxis+2)%3;
+		return m_implicitShapeDimensions[radiusAxis];
+	}
+
+	btScalar	getHalfHeight() const
+	{
+		return m_implicitShapeDimensions[m_upAxis];
+	}
+
+	virtual void	setLocalScaling(const btVector3& scaling)
+	{
+		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
+		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
+		btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
+
+		btConvexInternalShape::setLocalScaling(scaling);
+
+		m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
+
+	}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+
+};
+
+///btCapsuleShapeX represents a capsule around the Z axis
+///the total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps.
+class btCapsuleShapeX : public btCapsuleShape
+{
+public:
+
+	btCapsuleShapeX(btScalar radius,btScalar height);
+		
+	//debugging
+	virtual const char*	getName()const
+	{
+		return "CapsuleX";
+	}
+
+	
+
+};
+
+///btCapsuleShapeZ represents a capsule around the Z axis
+///the total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps.
+class btCapsuleShapeZ : public btCapsuleShape
+{
+public:
+	btCapsuleShapeZ(btScalar radius,btScalar height);
+
+		//debugging
+	virtual const char*	getName()const
+	{
+		return "CapsuleZ";
+	}
+
+	
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btCapsuleShapeData
+{
+	btConvexInternalShapeData	m_convexInternalShapeData;
+
+	int	m_upAxis;
+
+	char	m_padding[4];
+};
+
+SIMD_FORCE_INLINE	int	btCapsuleShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btCapsuleShapeData);
+}
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btCapsuleShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btCapsuleShapeData* shapeData = (btCapsuleShapeData*) dataBuffer;
+	
+	btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer);
+
+	shapeData->m_upAxis = m_upAxis;
+	
+	return "btCapsuleShapeData";
+}
+
+#endif //BT_CAPSULE_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h
new file mode 100644
index 0000000..e9736ee
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionMargin.h
@@ -0,0 +1,26 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COLLISION_MARGIN_H
+#define BT_COLLISION_MARGIN_H
+
+//used by Gjk and some other algorithms
+
+#define CONVEX_DISTANCE_MARGIN btScalar(0.04)// btScalar(0.1)//;//btScalar(0.01)
+
+
+
+#endif //BT_COLLISION_MARGIN_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp
new file mode 100644
index 0000000..39ee21c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.cpp
@@ -0,0 +1,119 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "LinearMath/btSerializer.h"
+
+/*
+  Make sure this dummy function never changes so that it
+  can be used by probes that are checking whether the
+  library is actually installed.
+*/
+extern "C" 
+{
+void btBulletCollisionProbe ();
+
+void btBulletCollisionProbe () {}
+}
+
+
+
+void	btCollisionShape::getBoundingSphere(btVector3& center,btScalar& radius) const
+{
+	btTransform tr;
+	tr.setIdentity();
+	btVector3 aabbMin,aabbMax;
+
+	getAabb(tr,aabbMin,aabbMax);
+
+	radius = (aabbMax-aabbMin).length()*btScalar(0.5);
+	center = (aabbMin+aabbMax)*btScalar(0.5);
+}
+
+
+btScalar	btCollisionShape::getContactBreakingThreshold(btScalar defaultContactThreshold) const
+{
+	return getAngularMotionDisc() * defaultContactThreshold;
+}
+
+btScalar	btCollisionShape::getAngularMotionDisc() const
+{
+	///@todo cache this value, to improve performance
+	btVector3	center;
+	btScalar disc;
+	getBoundingSphere(center,disc);
+	disc += (center).length();
+	return disc;
+}
+
+void btCollisionShape::calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) const
+{
+	//start with static aabb
+	getAabb(curTrans,temporalAabbMin,temporalAabbMax);
+
+	btScalar temporalAabbMaxx = temporalAabbMax.getX();
+	btScalar temporalAabbMaxy = temporalAabbMax.getY();
+	btScalar temporalAabbMaxz = temporalAabbMax.getZ();
+	btScalar temporalAabbMinx = temporalAabbMin.getX();
+	btScalar temporalAabbMiny = temporalAabbMin.getY();
+	btScalar temporalAabbMinz = temporalAabbMin.getZ();
+
+	// add linear motion
+	btVector3 linMotion = linvel*timeStep;
+	///@todo: simd would have a vector max/min operation, instead of per-element access
+	if (linMotion.x() > btScalar(0.))
+		temporalAabbMaxx += linMotion.x(); 
+	else
+		temporalAabbMinx += linMotion.x();
+	if (linMotion.y() > btScalar(0.))
+		temporalAabbMaxy += linMotion.y(); 
+	else
+		temporalAabbMiny += linMotion.y();
+	if (linMotion.z() > btScalar(0.))
+		temporalAabbMaxz += linMotion.z(); 
+	else
+		temporalAabbMinz += linMotion.z();
+
+	//add conservative angular motion
+	btScalar angularMotion = angvel.length() * getAngularMotionDisc() * timeStep;
+	btVector3 angularMotion3d(angularMotion,angularMotion,angularMotion);
+	temporalAabbMin = btVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz);
+	temporalAabbMax = btVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz);
+
+	temporalAabbMin -= angularMotion3d;
+	temporalAabbMax += angularMotion3d;
+}
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btCollisionShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btCollisionShapeData* shapeData = (btCollisionShapeData*) dataBuffer;
+	char* name = (char*) serializer->findNameForPointer(this);
+	shapeData->m_name = (char*)serializer->getUniquePointer(name);
+	if (shapeData->m_name)
+	{
+		serializer->serializeName(name);
+	}
+	shapeData->m_shapeType = m_shapeType;
+	//shapeData->m_padding//??
+	return "btCollisionShapeData";
+}
+
+void	btCollisionShape::serializeSingleShape(btSerializer* serializer) const
+{
+	int len = calculateSerializeBufferSize();
+	btChunk* chunk = serializer->allocate(len,1);
+	const char* structType = serialize(chunk->m_oldPtr, serializer);
+	serializer->finalizeChunk(chunk,structType,BT_SHAPE_CODE,(void*)this);
+}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h
new file mode 100644
index 0000000..865c106
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCollisionShape.h
@@ -0,0 +1,150 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COLLISION_SHAPE_H
+#define BT_COLLISION_SHAPE_H
+
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
+class btSerializer;
+
+
+///The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
+class btCollisionShape
+{
+protected:
+	int m_shapeType;
+	void* m_userPointer;
+
+public:
+
+	btCollisionShape() : m_shapeType (INVALID_SHAPE_PROXYTYPE), m_userPointer(0)
+	{
+	}
+
+	virtual ~btCollisionShape()
+	{
+	}
+
+	///getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0;
+
+	virtual void	getBoundingSphere(btVector3& center,btScalar& radius) const;
+
+	///getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations.
+	virtual btScalar	getAngularMotionDisc() const;
+
+	virtual btScalar	getContactBreakingThreshold(btScalar defaultContactThresholdFactor) const;
+
+
+	///calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep)
+	///result is conservative
+	void calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) const;
+
+
+
+	SIMD_FORCE_INLINE bool	isPolyhedral() const
+	{
+		return btBroadphaseProxy::isPolyhedral(getShapeType());
+	}
+
+	SIMD_FORCE_INLINE bool	isConvex2d() const
+	{
+		return btBroadphaseProxy::isConvex2d(getShapeType());
+	}
+
+	SIMD_FORCE_INLINE bool	isConvex() const
+	{
+		return btBroadphaseProxy::isConvex(getShapeType());
+	}
+	SIMD_FORCE_INLINE bool	isNonMoving() const
+	{
+		return btBroadphaseProxy::isNonMoving(getShapeType());
+	}
+	SIMD_FORCE_INLINE bool	isConcave() const
+	{
+		return btBroadphaseProxy::isConcave(getShapeType());
+	}
+	SIMD_FORCE_INLINE bool	isCompound() const
+	{
+		return btBroadphaseProxy::isCompound(getShapeType());
+	}
+
+	SIMD_FORCE_INLINE bool	isSoftBody() const
+	{
+		return btBroadphaseProxy::isSoftBody(getShapeType());
+	}
+
+	///isInfinite is used to catch simulation error (aabb check)
+	SIMD_FORCE_INLINE bool isInfinite() const
+	{
+		return btBroadphaseProxy::isInfinite(getShapeType());
+	}
+
+#ifndef __SPU__
+	virtual void	setLocalScaling(const btVector3& scaling) =0;
+	virtual const btVector3& getLocalScaling() const =0;
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const = 0;
+
+
+//debugging support
+	virtual const char*	getName()const =0 ;
+#endif //__SPU__
+
+	
+	int		getShapeType() const { return m_shapeType; }
+	virtual void	setMargin(btScalar margin) = 0;
+	virtual btScalar	getMargin() const = 0;
+
+	
+	///optional user data pointer
+	void	setUserPointer(void*  userPtr)
+	{
+		m_userPointer = userPtr;
+	}
+
+	void*	getUserPointer() const
+	{
+		return m_userPointer;
+	}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+	virtual void	serializeSingleShape(btSerializer* serializer) const;
+
+};	
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btCollisionShapeData
+{
+	char	*m_name;
+	int		m_shapeType;
+	char	m_padding[4];
+};
+
+SIMD_FORCE_INLINE	int	btCollisionShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btCollisionShapeData);
+}
+
+
+
+#endif //BT_COLLISION_SHAPE_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp
new file mode 100644
index 0000000..4eb860c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.cpp
@@ -0,0 +1,356 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btCompoundShape.h"
+#include "btCollisionShape.h"
+#include "BulletCollision/BroadphaseCollision/btDbvt.h"
+#include "LinearMath/btSerializer.h"
+
+btCompoundShape::btCompoundShape(bool enableDynamicAabbTree)
+: m_localAabbMin(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT)),
+m_localAabbMax(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)),
+m_dynamicAabbTree(0),
+m_updateRevision(1),
+m_collisionMargin(btScalar(0.)),
+m_localScaling(btScalar(1.),btScalar(1.),btScalar(1.))
+{
+	m_shapeType = COMPOUND_SHAPE_PROXYTYPE;
+
+	if (enableDynamicAabbTree)
+	{
+		void* mem = btAlignedAlloc(sizeof(btDbvt),16);
+		m_dynamicAabbTree = new(mem) btDbvt();
+		btAssert(mem==m_dynamicAabbTree);
+	}
+}
+
+
+btCompoundShape::~btCompoundShape()
+{
+	if (m_dynamicAabbTree)
+	{
+		m_dynamicAabbTree->~btDbvt();
+		btAlignedFree(m_dynamicAabbTree);
+	}
+}
+
+void	btCompoundShape::addChildShape(const btTransform& localTransform,btCollisionShape* shape)
+{
+	m_updateRevision++;
+	//m_childTransforms.push_back(localTransform);
+	//m_childShapes.push_back(shape);
+	btCompoundShapeChild child;
+	child.m_node = 0;
+	child.m_transform = localTransform;
+	child.m_childShape = shape;
+	child.m_childShapeType = shape->getShapeType();
+	child.m_childMargin = shape->getMargin();
+
+	
+	//extend the local aabbMin/aabbMax
+	btVector3 localAabbMin,localAabbMax;
+	shape->getAabb(localTransform,localAabbMin,localAabbMax);
+	for (int i=0;i<3;i++)
+	{
+		if (m_localAabbMin[i] > localAabbMin[i])
+		{
+			m_localAabbMin[i] = localAabbMin[i];
+		}
+		if (m_localAabbMax[i] < localAabbMax[i])
+		{
+			m_localAabbMax[i] = localAabbMax[i];
+		}
+
+	}
+	if (m_dynamicAabbTree)
+	{
+		const btDbvtVolume	bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
+		int index = m_children.size();
+		child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
+	}
+
+	m_children.push_back(child);
+
+}
+
+void	btCompoundShape::updateChildTransform(int childIndex, const btTransform& newChildTransform,bool shouldRecalculateLocalAabb)
+{
+	m_children[childIndex].m_transform = newChildTransform;
+
+	if (m_dynamicAabbTree)
+	{
+		///update the dynamic aabb tree
+		btVector3 localAabbMin,localAabbMax;
+		m_children[childIndex].m_childShape->getAabb(newChildTransform,localAabbMin,localAabbMax);
+		ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
+		//int index = m_children.size()-1;
+		m_dynamicAabbTree->update(m_children[childIndex].m_node,bounds);
+	}
+
+	if (shouldRecalculateLocalAabb)
+	{
+		recalculateLocalAabb();
+	}
+}
+
+void btCompoundShape::removeChildShapeByIndex(int childShapeIndex)
+{
+	m_updateRevision++;
+	btAssert(childShapeIndex >=0 && childShapeIndex < m_children.size());
+	if (m_dynamicAabbTree)
+	{
+		m_dynamicAabbTree->remove(m_children[childShapeIndex].m_node);
+	}
+	m_children.swap(childShapeIndex,m_children.size()-1);
+    if (m_dynamicAabbTree) 
+		m_children[childShapeIndex].m_node->dataAsInt = childShapeIndex;
+	m_children.pop_back();
+
+}
+
+
+
+void btCompoundShape::removeChildShape(btCollisionShape* shape)
+{
+	m_updateRevision++;
+	// Find the children containing the shape specified, and remove those children.
+	//note: there might be multiple children using the same shape!
+	for(int i = m_children.size()-1; i >= 0 ; i--)
+	{
+		if(m_children[i].m_childShape == shape)
+		{
+			removeChildShapeByIndex(i);
+		}
+	}
+
+
+
+	recalculateLocalAabb();
+}
+
+void btCompoundShape::recalculateLocalAabb()
+{
+	// Recalculate the local aabb
+	// Brute force, it iterates over all the shapes left.
+
+	m_localAabbMin = btVector3(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+	m_localAabbMax = btVector3(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
+
+	//extend the local aabbMin/aabbMax
+	for (int j = 0; j < m_children.size(); j++)
+	{
+		btVector3 localAabbMin,localAabbMax;
+		m_children[j].m_childShape->getAabb(m_children[j].m_transform, localAabbMin, localAabbMax);
+		for (int i=0;i<3;i++)
+		{
+			if (m_localAabbMin[i] > localAabbMin[i])
+				m_localAabbMin[i] = localAabbMin[i];
+			if (m_localAabbMax[i] < localAabbMax[i])
+				m_localAabbMax[i] = localAabbMax[i];
+		}
+	}
+}
+
+///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+void btCompoundShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin);
+	btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin);
+	
+	//avoid an illegal AABB when there are no children
+	if (!m_children.size())
+	{
+		localHalfExtents.setValue(0,0,0);
+		localCenter.setValue(0,0,0);
+	}
+	localHalfExtents += btVector3(getMargin(),getMargin(),getMargin());
+		
+
+	btMatrix3x3 abs_b = trans.getBasis().absolute();  
+
+	btVector3 center = trans(localCenter);
+
+	btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
+		abs_b[1].dot(localHalfExtents),
+		abs_b[2].dot(localHalfExtents));
+	aabbMin = center-extent;
+	aabbMax = center+extent;
+	
+}
+
+void	btCompoundShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	//approximation: take the inertia from the aabb for now
+	btTransform ident;
+	ident.setIdentity();
+	btVector3 aabbMin,aabbMax;
+	getAabb(ident,aabbMin,aabbMax);
+
+	btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);
+
+	btScalar lx=btScalar(2.)*(halfExtents.x());
+	btScalar ly=btScalar(2.)*(halfExtents.y());
+	btScalar lz=btScalar(2.)*(halfExtents.z());
+
+	inertia[0] = mass/(btScalar(12.0)) * (ly*ly + lz*lz);
+	inertia[1] = mass/(btScalar(12.0)) * (lx*lx + lz*lz);
+	inertia[2] = mass/(btScalar(12.0)) * (lx*lx + ly*ly);
+
+}
+
+
+
+
+void btCompoundShape::calculatePrincipalAxisTransform(btScalar* masses, btTransform& principal, btVector3& inertia) const
+{
+	int n = m_children.size();
+
+	btScalar totalMass = 0;
+	btVector3 center(0, 0, 0);
+	int k;
+
+	for (k = 0; k < n; k++)
+	{
+		btAssert(masses[k]>0);
+		center += m_children[k].m_transform.getOrigin() * masses[k];
+		totalMass += masses[k];
+	}
+
+	btAssert(totalMass>0);
+
+	center /= totalMass;
+	principal.setOrigin(center);
+
+	btMatrix3x3 tensor(0, 0, 0, 0, 0, 0, 0, 0, 0);
+	for ( k = 0; k < n; k++)
+	{
+		btVector3 i;
+		m_children[k].m_childShape->calculateLocalInertia(masses[k], i);
+
+		const btTransform& t = m_children[k].m_transform;
+		btVector3 o = t.getOrigin() - center;
+
+		//compute inertia tensor in coordinate system of compound shape
+		btMatrix3x3 j = t.getBasis().transpose();
+		j[0] *= i[0];
+		j[1] *= i[1];
+		j[2] *= i[2];
+		j = t.getBasis() * j;
+
+		//add inertia tensor
+		tensor[0] += j[0];
+		tensor[1] += j[1];
+		tensor[2] += j[2];
+
+		//compute inertia tensor of pointmass at o
+		btScalar o2 = o.length2();
+		j[0].setValue(o2, 0, 0);
+		j[1].setValue(0, o2, 0);
+		j[2].setValue(0, 0, o2);
+		j[0] += o * -o.x(); 
+		j[1] += o * -o.y(); 
+		j[2] += o * -o.z();
+
+		//add inertia tensor of pointmass
+		tensor[0] += masses[k] * j[0];
+		tensor[1] += masses[k] * j[1];
+		tensor[2] += masses[k] * j[2];
+	}
+
+	tensor.diagonalize(principal.getBasis(), btScalar(0.00001), 20);
+	inertia.setValue(tensor[0][0], tensor[1][1], tensor[2][2]);
+}
+
+
+
+void btCompoundShape::setLocalScaling(const btVector3& scaling)
+{
+
+	for(int i = 0; i < m_children.size(); i++)
+	{
+		btTransform childTrans = getChildTransform(i);
+		btVector3 childScale = m_children[i].m_childShape->getLocalScaling();
+//		childScale = childScale * (childTrans.getBasis() * scaling);
+		childScale = childScale * scaling / m_localScaling;
+		m_children[i].m_childShape->setLocalScaling(childScale);
+		childTrans.setOrigin((childTrans.getOrigin())*scaling);
+		updateChildTransform(i, childTrans,false);
+	}
+	
+	m_localScaling = scaling;
+	recalculateLocalAabb();
+
+}
+
+
+void btCompoundShape::createAabbTreeFromChildren()
+{
+    if ( !m_dynamicAabbTree )
+    {
+        void* mem = btAlignedAlloc(sizeof(btDbvt),16);
+        m_dynamicAabbTree = new(mem) btDbvt();
+        btAssert(mem==m_dynamicAabbTree);
+
+        for ( int index = 0; index < m_children.size(); index++ )
+        {
+            btCompoundShapeChild &child = m_children[index];
+
+            //extend the local aabbMin/aabbMax
+            btVector3 localAabbMin,localAabbMax;
+            child.m_childShape->getAabb(child.m_transform,localAabbMin,localAabbMax);
+
+            const btDbvtVolume  bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
+            child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
+        }
+    }
+}
+
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btCompoundShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+
+	btCompoundShapeData* shapeData = (btCompoundShapeData*) dataBuffer;
+	btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer);
+
+	shapeData->m_collisionMargin = float(m_collisionMargin);
+	shapeData->m_numChildShapes = m_children.size();
+	shapeData->m_childShapePtr = 0;
+	if (shapeData->m_numChildShapes)
+	{
+		btChunk* chunk = serializer->allocate(sizeof(btCompoundShapeChildData),shapeData->m_numChildShapes);
+		btCompoundShapeChildData* memPtr = (btCompoundShapeChildData*)chunk->m_oldPtr;
+		shapeData->m_childShapePtr = (btCompoundShapeChildData*)serializer->getUniquePointer(memPtr);
+
+		for (int i=0;i<shapeData->m_numChildShapes;i++,memPtr++)
+		{
+			memPtr->m_childMargin = float(m_children[i].m_childMargin);
+			memPtr->m_childShape = (btCollisionShapeData*)serializer->getUniquePointer(m_children[i].m_childShape);
+			//don't serialize shapes that already have been serialized
+			if (!serializer->findPointer(m_children[i].m_childShape))
+			{
+				btChunk* chunk = serializer->allocate(m_children[i].m_childShape->calculateSerializeBufferSize(),1);
+				const char* structType = m_children[i].m_childShape->serialize(chunk->m_oldPtr,serializer);
+				serializer->finalizeChunk(chunk,structType,BT_SHAPE_CODE,m_children[i].m_childShape);
+			} 
+
+			memPtr->m_childShapeType = m_children[i].m_childShapeType;
+			m_children[i].m_transform.serializeFloat(memPtr->m_transform);
+		}
+		serializer->finalizeChunk(chunk,"btCompoundShapeChildData",BT_ARRAY_CODE,chunk->m_oldPtr);
+	}
+	return "btCompoundShapeData";
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h
new file mode 100644
index 0000000..141034a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCompoundShape.h
@@ -0,0 +1,212 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_COMPOUND_SHAPE_H
+#define BT_COMPOUND_SHAPE_H
+
+#include "btCollisionShape.h"
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "btCollisionMargin.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+//class btOptimizedBvh;
+struct btDbvt;
+
+ATTRIBUTE_ALIGNED16(struct) btCompoundShapeChild
+{
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btTransform			m_transform;
+	btCollisionShape*	m_childShape;
+	int					m_childShapeType;
+	btScalar			m_childMargin;
+	struct btDbvtNode*	m_node;
+};
+
+SIMD_FORCE_INLINE bool operator==(const btCompoundShapeChild& c1, const btCompoundShapeChild& c2)
+{
+	return  ( c1.m_transform      == c2.m_transform &&
+		c1.m_childShape     == c2.m_childShape &&
+		c1.m_childShapeType == c2.m_childShapeType &&
+		c1.m_childMargin    == c2.m_childMargin );
+}
+
+/// The btCompoundShape allows to store multiple other btCollisionShapes
+/// This allows for moving concave collision objects. This is more general then the static concave btBvhTriangleMeshShape.
+/// It has an (optional) dynamic aabb tree to accelerate early rejection tests. 
+/// @todo: This aabb tree can also be use to speed up ray tests on btCompoundShape, see http://code.google.com/p/bullet/issues/detail?id=25
+/// Currently, removal of child shapes is only supported when disabling the aabb tree (pass 'false' in the constructor of btCompoundShape)
+ATTRIBUTE_ALIGNED16(class) btCompoundShape	: public btCollisionShape
+{
+	btAlignedObjectArray<btCompoundShapeChild> m_children;
+	btVector3						m_localAabbMin;
+	btVector3						m_localAabbMax;
+
+	btDbvt*							m_dynamicAabbTree;
+
+	///increment m_updateRevision when adding/removing/replacing child shapes, so that some caches can be updated
+	int								m_updateRevision;
+
+	btScalar	m_collisionMargin;
+
+protected:
+	btVector3	m_localScaling;
+
+public:
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btCompoundShape(bool enableDynamicAabbTree = true);
+
+	virtual ~btCompoundShape();
+
+	void	addChildShape(const btTransform& localTransform,btCollisionShape* shape);
+
+	/// Remove all children shapes that contain the specified shape
+	virtual void removeChildShape(btCollisionShape* shape);
+
+	void removeChildShapeByIndex(int childShapeindex);
+
+
+	int		getNumChildShapes() const
+	{
+		return int (m_children.size());
+	}
+
+	btCollisionShape* getChildShape(int index)
+	{
+		return m_children[index].m_childShape;
+	}
+	const btCollisionShape* getChildShape(int index) const
+	{
+		return m_children[index].m_childShape;
+	}
+
+	btTransform&	getChildTransform(int index)
+	{
+		return m_children[index].m_transform;
+	}
+	const btTransform&	getChildTransform(int index) const
+	{
+		return m_children[index].m_transform;
+	}
+
+	///set a new transform for a child, and update internal data structures (local aabb and dynamic tree)
+	void	updateChildTransform(int childIndex, const btTransform& newChildTransform, bool shouldRecalculateLocalAabb = true);
+
+
+	btCompoundShapeChild* getChildList()
+	{
+		return &m_children[0];
+	}
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+	virtual	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	/** Re-calculate the local Aabb. Is called at the end of removeChildShapes. 
+	Use this yourself if you modify the children or their transforms. */
+	virtual void recalculateLocalAabb(); 
+
+	virtual void	setLocalScaling(const btVector3& scaling);
+
+	virtual const btVector3& getLocalScaling() const 
+	{
+		return m_localScaling;
+	}
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual void	setMargin(btScalar margin)
+	{
+		m_collisionMargin = margin;
+	}
+	virtual btScalar	getMargin() const
+	{
+		return m_collisionMargin;
+	}
+	virtual const char*	getName()const
+	{
+		return "Compound";
+	}
+
+	const btDbvt*	getDynamicAabbTree() const
+	{
+		return m_dynamicAabbTree;
+	}
+	
+	btDbvt*	getDynamicAabbTree()
+	{
+		return m_dynamicAabbTree;
+	}
+
+	void createAabbTreeFromChildren();
+
+	///computes the exact moment of inertia and the transform from the coordinate system defined by the principal axes of the moment of inertia
+	///and the center of mass to the current coordinate system. "masses" points to an array of masses of the children. The resulting transform
+	///"principal" has to be applied inversely to all children transforms in order for the local coordinate system of the compound
+	///shape to be centered at the center of mass and to coincide with the principal axes. This also necessitates a correction of the world transform
+	///of the collision object by the principal transform.
+	void calculatePrincipalAxisTransform(btScalar* masses, btTransform& principal, btVector3& inertia) const;
+
+	int	getUpdateRevision() const
+	{
+		return m_updateRevision;
+	}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct btCompoundShapeChildData
+{
+	btTransformFloatData	m_transform;
+	btCollisionShapeData	*m_childShape;
+	int						m_childShapeType;
+	float					m_childMargin;
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btCompoundShapeData
+{
+	btCollisionShapeData		m_collisionShapeData;
+
+	btCompoundShapeChildData	*m_childShapePtr;
+
+	int							m_numChildShapes;
+
+	float	m_collisionMargin;
+
+};
+
+
+SIMD_FORCE_INLINE	int	btCompoundShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btCompoundShapeData);
+}
+
+
+
+
+
+
+
+#endif //BT_COMPOUND_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp
new file mode 100644
index 0000000..58ff84a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.cpp
@@ -0,0 +1,27 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btConcaveShape.h"
+
+btConcaveShape::btConcaveShape() : m_collisionMargin(btScalar(0.))
+{
+
+}
+
+btConcaveShape::~btConcaveShape()
+{
+
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h
new file mode 100644
index 0000000..2a03241
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConcaveShape.h
@@ -0,0 +1,60 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONCAVE_SHAPE_H
+#define BT_CONCAVE_SHAPE_H
+
+#include "btCollisionShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+#include "btTriangleCallback.h"
+
+/// PHY_ScalarType enumerates possible scalar types.
+/// See the btStridingMeshInterface or btHeightfieldTerrainShape for its use
+typedef enum PHY_ScalarType {
+	PHY_FLOAT,
+	PHY_DOUBLE,
+	PHY_INTEGER,
+	PHY_SHORT,
+	PHY_FIXEDPOINT88,
+	PHY_UCHAR
+} PHY_ScalarType;
+
+///The btConcaveShape class provides an interface for non-moving (static) concave shapes.
+///It has been implemented by the btStaticPlaneShape, btBvhTriangleMeshShape and btHeightfieldTerrainShape.
+class btConcaveShape : public btCollisionShape
+{
+protected:
+	btScalar m_collisionMargin;
+
+public:
+	btConcaveShape();
+
+	virtual ~btConcaveShape();
+
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const = 0;
+
+	virtual btScalar getMargin() const {
+		return m_collisionMargin;
+	}
+	virtual void setMargin(btScalar collisionMargin)
+	{
+		m_collisionMargin = collisionMargin;
+	}
+
+
+
+};
+
+#endif //BT_CONCAVE_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp
new file mode 100644
index 0000000..5e83087
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.cpp
@@ -0,0 +1,143 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConeShape.h"
+
+
+
+btConeShape::btConeShape (btScalar radius,btScalar height): btConvexInternalShape (),
+m_radius (radius),
+m_height(height)
+{
+	m_shapeType = CONE_SHAPE_PROXYTYPE;
+	setConeUpIndex(1);
+	btVector3 halfExtents;
+	m_sinAngle = (m_radius / btSqrt(m_radius * m_radius + m_height * m_height));
+}
+
+btConeShapeZ::btConeShapeZ (btScalar radius,btScalar height):
+btConeShape(radius,height)
+{
+	setConeUpIndex(2);
+}
+
+btConeShapeX::btConeShapeX (btScalar radius,btScalar height):
+btConeShape(radius,height)
+{
+	setConeUpIndex(0);
+}
+
+///choose upAxis index
+void	btConeShape::setConeUpIndex(int upIndex)
+{
+	switch (upIndex)
+	{
+	case 0:
+			m_coneIndices[0] = 1;
+			m_coneIndices[1] = 0;
+			m_coneIndices[2] = 2;
+		break;
+	case 1:
+			m_coneIndices[0] = 0;
+			m_coneIndices[1] = 1;
+			m_coneIndices[2] = 2;
+		break;
+	case 2:
+			m_coneIndices[0] = 0;
+			m_coneIndices[1] = 2;
+			m_coneIndices[2] = 1;
+		break;
+	default:
+		btAssert(0);
+	};
+}
+
+btVector3 btConeShape::coneLocalSupport(const btVector3& v) const
+{
+	
+	btScalar halfHeight = m_height * btScalar(0.5);
+
+ if (v[m_coneIndices[1]] > v.length() * m_sinAngle)
+ {
+	btVector3 tmp;
+
+	tmp[m_coneIndices[0]] = btScalar(0.);
+	tmp[m_coneIndices[1]] = halfHeight;
+	tmp[m_coneIndices[2]] = btScalar(0.);
+	return tmp;
+ }
+  else {
+    btScalar s = btSqrt(v[m_coneIndices[0]] * v[m_coneIndices[0]] + v[m_coneIndices[2]] * v[m_coneIndices[2]]);
+    if (s > SIMD_EPSILON) {
+      btScalar d = m_radius / s;
+	  btVector3 tmp;
+	  tmp[m_coneIndices[0]] = v[m_coneIndices[0]] * d;
+	  tmp[m_coneIndices[1]] = -halfHeight;
+	  tmp[m_coneIndices[2]] = v[m_coneIndices[2]] * d;
+	  return tmp;
+    }
+    else  {
+		btVector3 tmp;
+		tmp[m_coneIndices[0]] = btScalar(0.);
+		tmp[m_coneIndices[1]] = -halfHeight;
+		tmp[m_coneIndices[2]] = btScalar(0.);
+		return tmp;
+	}
+  }
+
+}
+
+btVector3	btConeShape::localGetSupportingVertexWithoutMargin(const btVector3& vec) const
+{
+		return coneLocalSupport(vec);
+}
+
+void	btConeShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	for (int i=0;i<numVectors;i++)
+	{
+		const btVector3& vec = vectors[i];
+		supportVerticesOut[i] = coneLocalSupport(vec);
+	}
+}
+
+
+btVector3	btConeShape::localGetSupportingVertex(const btVector3& vec)  const
+{
+	btVector3 supVertex = coneLocalSupport(vec);
+	if ( getMargin()!=btScalar(0.) )
+	{
+		btVector3 vecnorm = vec;
+		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
+		{
+			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
+		} 
+		vecnorm.normalize();
+		supVertex+= getMargin() * vecnorm;
+	}
+	return supVertex;
+}
+
+
+void	btConeShape::setLocalScaling(const btVector3& scaling)
+{
+	int axis = m_coneIndices[1];
+	int r1 = m_coneIndices[0];
+	int r2 = m_coneIndices[2];
+	m_height *= scaling[axis] / m_localScaling[axis];
+	m_radius *= (scaling[r1] / m_localScaling[r1] + scaling[r2] / m_localScaling[r2]) / 2;
+	m_sinAngle = (m_radius / btSqrt(m_radius * m_radius + m_height * m_height));
+	btConvexInternalShape::setLocalScaling(scaling);
+}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.h
new file mode 100644
index 0000000..b69b5c5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConeShape.h
@@ -0,0 +1,103 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONE_MINKOWSKI_H
+#define BT_CONE_MINKOWSKI_H
+
+#include "btConvexInternalShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+
+///The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y axis. The btConeShapeX is aligned around the X axis and btConeShapeZ around the Z axis.
+class btConeShape : public btConvexInternalShape
+
+{
+
+	btScalar m_sinAngle;
+	btScalar m_radius;
+	btScalar m_height;
+	int		m_coneIndices[3];
+	btVector3 coneLocalSupport(const btVector3& v) const;
+
+
+public:
+	btConeShape (btScalar radius,btScalar height);
+	
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec) const;
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec) const;
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+
+	btScalar getRadius() const { return m_radius;}
+	btScalar getHeight() const { return m_height;}
+
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const
+	{
+		btTransform identity;
+		identity.setIdentity();
+		btVector3 aabbMin,aabbMax;
+		getAabb(identity,aabbMin,aabbMax);
+
+		btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);
+
+		btScalar margin = getMargin();
+
+		btScalar lx=btScalar(2.)*(halfExtents.x()+margin);
+		btScalar ly=btScalar(2.)*(halfExtents.y()+margin);
+		btScalar lz=btScalar(2.)*(halfExtents.z()+margin);
+		const btScalar x2 = lx*lx;
+		const btScalar y2 = ly*ly;
+		const btScalar z2 = lz*lz;
+		const btScalar scaledmass = mass * btScalar(0.08333333);
+
+		inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
+
+//		inertia.x() = scaledmass * (y2+z2);
+//		inertia.y() = scaledmass * (x2+z2);
+//		inertia.z() = scaledmass * (x2+y2);
+	}
+
+
+		virtual const char*	getName()const 
+		{
+			return "Cone";
+		}
+		
+		///choose upAxis index
+		void	setConeUpIndex(int upIndex);
+		
+		int	getConeUpIndex() const
+		{
+			return m_coneIndices[1];
+		}
+
+	virtual void	setLocalScaling(const btVector3& scaling);
+
+};
+
+///btConeShape implements a Cone shape, around the X axis
+class btConeShapeX : public btConeShape
+{
+	public:
+		btConeShapeX(btScalar radius,btScalar height);
+};
+
+///btConeShapeZ implements a Cone shape, around the Z axis
+class btConeShapeZ : public btConeShape
+{
+	public:
+		btConeShapeZ(btScalar radius,btScalar height);
+};
+#endif //BT_CONE_MINKOWSKI_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp
new file mode 100644
index 0000000..10ea3e9
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.cpp
@@ -0,0 +1,92 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConvex2dShape.h"
+
+btConvex2dShape::btConvex2dShape(	btConvexShape* convexChildShape):
+btConvexShape (), m_childConvexShape(convexChildShape)
+{
+	m_shapeType = CONVEX_2D_SHAPE_PROXYTYPE;
+}
+	
+btConvex2dShape::~btConvex2dShape()
+{
+}
+
+	
+
+btVector3	btConvex2dShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+{
+	return m_childConvexShape->localGetSupportingVertexWithoutMargin(vec);
+}
+
+void	btConvex2dShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	m_childConvexShape->batchedUnitVectorGetSupportingVertexWithoutMargin(vectors,supportVerticesOut,numVectors);
+}
+
+
+btVector3	btConvex2dShape::localGetSupportingVertex(const btVector3& vec)const
+{
+	return m_childConvexShape->localGetSupportingVertex(vec);
+}
+
+
+void	btConvex2dShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	///this linear upscaling is not realistic, but we don't deal with large mass ratios...
+	m_childConvexShape->calculateLocalInertia(mass,inertia);
+}
+
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+void btConvex2dShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	m_childConvexShape->getAabb(t,aabbMin,aabbMax);
+}
+
+void btConvex2dShape::getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	m_childConvexShape->getAabbSlow(t,aabbMin,aabbMax);
+}
+
+void	btConvex2dShape::setLocalScaling(const btVector3& scaling) 
+{
+	m_childConvexShape->setLocalScaling(scaling);
+}
+
+const btVector3& btConvex2dShape::getLocalScaling() const
+{
+	return m_childConvexShape->getLocalScaling();
+}
+
+void	btConvex2dShape::setMargin(btScalar margin)
+{
+	m_childConvexShape->setMargin(margin);
+}
+btScalar	btConvex2dShape::getMargin() const
+{
+	return m_childConvexShape->getMargin();
+}
+
+int		btConvex2dShape::getNumPreferredPenetrationDirections() const
+{
+	return m_childConvexShape->getNumPreferredPenetrationDirections();
+}
+	
+void	btConvex2dShape::getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
+{
+	m_childConvexShape->getPreferredPenetrationDirection(index,penetrationVector);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.h
new file mode 100644
index 0000000..caf5432
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvex2dShape.h
@@ -0,0 +1,80 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_2D_SHAPE_H
+#define BT_CONVEX_2D_SHAPE_H
+
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+
+///The btConvex2dShape allows to use arbitrary convex shapes as 2d convex shapes, with the Z component assumed to be 0.
+///For 2d boxes, the btBox2dShape is recommended.
+class btConvex2dShape : public btConvexShape
+{
+	btConvexShape*	m_childConvexShape;
+
+	public:
+	
+	btConvex2dShape(	btConvexShape* convexChildShape);
+	
+	virtual ~btConvex2dShape();
+	
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	btConvexShape*	getChildShape() 
+	{
+		return m_childConvexShape;
+	}
+
+	const btConvexShape*	getChildShape() const
+	{
+		return m_childConvexShape;
+	}
+
+	virtual const char*	getName()const 
+	{
+		return "Convex2dShape";
+	}
+	
+
+
+	///////////////////////////
+
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	virtual void	setLocalScaling(const btVector3& scaling) ;
+	virtual const btVector3& getLocalScaling() const ;
+
+	virtual void	setMargin(btScalar margin);
+	virtual btScalar	getMargin() const;
+
+	virtual int		getNumPreferredPenetrationDirections() const;
+	
+	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const;
+
+
+};
+
+#endif //BT_CONVEX_2D_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
new file mode 100644
index 0000000..69bc67c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
@@ -0,0 +1,211 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConvexHullShape.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+
+#include "LinearMath/btQuaternion.h"
+#include "LinearMath/btSerializer.h"
+
+btConvexHullShape ::btConvexHullShape (const btScalar* points,int numPoints,int stride) : btPolyhedralConvexAabbCachingShape ()
+{
+	m_shapeType = CONVEX_HULL_SHAPE_PROXYTYPE;
+	m_unscaledPoints.resize(numPoints);
+
+	unsigned char* pointsAddress = (unsigned char*)points;
+
+	for (int i=0;i<numPoints;i++)
+	{
+		btScalar* point = (btScalar*)pointsAddress;
+		m_unscaledPoints[i] = btVector3(point[0], point[1], point[2]);
+		pointsAddress += stride;
+	}
+
+	recalcLocalAabb();
+
+}
+
+
+
+void btConvexHullShape::setLocalScaling(const btVector3& scaling)
+{
+	m_localScaling = scaling;
+	recalcLocalAabb();
+}
+
+void btConvexHullShape::addPoint(const btVector3& point)
+{
+	m_unscaledPoints.push_back(point);
+	recalcLocalAabb();
+
+}
+
+btVector3	btConvexHullShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+{
+	btVector3 supVec(btScalar(0.),btScalar(0.),btScalar(0.));
+	btScalar newDot,maxDot = btScalar(-BT_LARGE_FLOAT);
+
+	for (int i=0;i<m_unscaledPoints.size();i++)
+	{
+		btVector3 vtx = m_unscaledPoints[i] * m_localScaling;
+
+		newDot = vec.dot(vtx);
+		if (newDot > maxDot)
+		{
+			maxDot = newDot;
+			supVec = vtx;
+		}
+	}
+	return supVec;
+}
+
+void	btConvexHullShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	btScalar newDot;
+	//use 'w' component of supportVerticesOut?
+	{
+		for (int i=0;i<numVectors;i++)
+		{
+			supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
+		}
+	}
+	for (int i=0;i<m_unscaledPoints.size();i++)
+	{
+		btVector3 vtx = getScaledPoint(i);
+
+		for (int j=0;j<numVectors;j++)
+		{
+			const btVector3& vec = vectors[j];
+			
+			newDot = vec.dot(vtx);
+			if (newDot > supportVerticesOut[j][3])
+			{
+				//WARNING: don't swap next lines, the w component would get overwritten!
+				supportVerticesOut[j] = vtx;
+				supportVerticesOut[j][3] = newDot;
+			}
+		}
+	}
+
+
+
+}
+	
+
+
+btVector3	btConvexHullShape::localGetSupportingVertex(const btVector3& vec)const
+{
+	btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec);
+
+	if ( getMargin()!=btScalar(0.) )
+	{
+		btVector3 vecnorm = vec;
+		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
+		{
+			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
+		} 
+		vecnorm.normalize();
+		supVertex+= getMargin() * vecnorm;
+	}
+	return supVertex;
+}
+
+
+
+
+
+
+
+
+
+//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection
+//Please note that you can debug-draw btConvexHullShape with the Raytracer Demo
+int	btConvexHullShape::getNumVertices() const
+{
+	return m_unscaledPoints.size();
+}
+
+int btConvexHullShape::getNumEdges() const
+{
+	return m_unscaledPoints.size();
+}
+
+void btConvexHullShape::getEdge(int i,btVector3& pa,btVector3& pb) const
+{
+
+	int index0 = i%m_unscaledPoints.size();
+	int index1 = (i+1)%m_unscaledPoints.size();
+	pa = getScaledPoint(index0);
+	pb = getScaledPoint(index1);
+}
+
+void btConvexHullShape::getVertex(int i,btVector3& vtx) const
+{
+	vtx = getScaledPoint(i);
+}
+
+int	btConvexHullShape::getNumPlanes() const
+{
+	return 0;
+}
+
+void btConvexHullShape::getPlane(btVector3& ,btVector3& ,int ) const
+{
+
+	btAssert(0);
+}
+
+//not yet
+bool btConvexHullShape::isInside(const btVector3& ,btScalar ) const
+{
+	btAssert(0);
+	return false;
+}
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btConvexHullShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	//int szc = sizeof(btConvexHullShapeData);
+	btConvexHullShapeData* shapeData = (btConvexHullShapeData*) dataBuffer;
+	btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer);
+
+	int numElem = m_unscaledPoints.size();
+	shapeData->m_numUnscaledPoints = numElem;
+#ifdef BT_USE_DOUBLE_PRECISION
+	shapeData->m_unscaledPointsFloatPtr = 0;
+	shapeData->m_unscaledPointsDoublePtr = numElem ? (btVector3Data*)serializer->getUniquePointer((void*)&m_unscaledPoints[0]):  0;
+#else
+	shapeData->m_unscaledPointsFloatPtr = numElem ? (btVector3Data*)serializer->getUniquePointer((void*)&m_unscaledPoints[0]):  0;
+	shapeData->m_unscaledPointsDoublePtr = 0;
+#endif
+	
+	if (numElem)
+	{
+		int sz = sizeof(btVector3Data);
+	//	int sz2 = sizeof(btVector3DoubleData);
+	//	int sz3 = sizeof(btVector3FloatData);
+		btChunk* chunk = serializer->allocate(sz,numElem);
+		btVector3Data* memPtr = (btVector3Data*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			m_unscaledPoints[i].serialize(*memPtr);
+		}
+		serializer->finalizeChunk(chunk,btVector3DataName,BT_ARRAY_CODE,(void*)&m_unscaledPoints[0]);
+	}
+	
+	return "btConvexHullShapeData";
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h
new file mode 100644
index 0000000..1f7c89d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexHullShape.h
@@ -0,0 +1,120 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_HULL_SHAPE_H
+#define BT_CONVEX_HULL_SHAPE_H
+
+#include "btPolyhedralConvexShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+#include "LinearMath/btAlignedObjectArray.h"
+
+
+///The btConvexHullShape implements an implicit convex hull of an array of vertices.
+///Bullet provides a general and fast collision detector for convex shapes based on GJK and EPA using localGetSupportingVertex.
+ATTRIBUTE_ALIGNED16(class) btConvexHullShape : public btPolyhedralConvexAabbCachingShape
+{
+	btAlignedObjectArray<btVector3>	m_unscaledPoints;
+
+public:
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	
+	///this constructor optionally takes in a pointer to points. Each point is assumed to be 3 consecutive btScalar (x,y,z), the striding defines the number of bytes between each point, in memory.
+	///It is easier to not pass any points in the constructor, and just add one point at a time, using addPoint.
+	///btConvexHullShape make an internal copy of the points.
+	btConvexHullShape(const btScalar* points=0,int numPoints=0, int stride=sizeof(btVector3));
+
+	void addPoint(const btVector3& point);
+
+	
+	btVector3* getUnscaledPoints()
+	{
+		return &m_unscaledPoints[0];
+	}
+
+	const btVector3* getUnscaledPoints() const
+	{
+		return &m_unscaledPoints[0];
+	}
+
+	///getPoints is obsolete, please use getUnscaledPoints
+	const btVector3* getPoints() const
+	{
+		return getUnscaledPoints();
+	}
+
+	
+
+
+	SIMD_FORCE_INLINE	btVector3 getScaledPoint(int i) const
+	{
+		return m_unscaledPoints[i] * m_localScaling;
+	}
+
+	SIMD_FORCE_INLINE	int getNumPoints() const 
+	{
+		return m_unscaledPoints.size();
+	}
+
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+	
+
+
+	//debugging
+	virtual const char*	getName()const {return "Convex";}
+
+	
+	virtual int	getNumVertices() const;
+	virtual int getNumEdges() const;
+	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
+	virtual void getVertex(int i,btVector3& vtx) const;
+	virtual int	getNumPlanes() const;
+	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
+	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const;
+
+	///in case we receive negative scaling
+	virtual void	setLocalScaling(const btVector3& scaling);
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btConvexHullShapeData
+{
+	btConvexInternalShapeData	m_convexInternalShapeData;
+
+	btVector3FloatData	*m_unscaledPointsFloatPtr;
+	btVector3DoubleData	*m_unscaledPointsDoublePtr;
+
+	int		m_numUnscaledPoints;
+	char m_padding3[4];
+
+};
+
+
+SIMD_FORCE_INLINE	int	btConvexHullShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btConvexHullShapeData);
+}
+
+
+#endif //BT_CONVEX_HULL_SHAPE_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp
new file mode 100644
index 0000000..083d60b
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp
@@ -0,0 +1,151 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btConvexInternalShape.h"
+
+
+
+btConvexInternalShape::btConvexInternalShape()
+: m_localScaling(btScalar(1.),btScalar(1.),btScalar(1.)),
+m_collisionMargin(CONVEX_DISTANCE_MARGIN)
+{
+}
+
+
+void	btConvexInternalShape::setLocalScaling(const btVector3& scaling)
+{
+	m_localScaling = scaling.absolute();
+}
+
+
+
+void	btConvexInternalShape::getAabbSlow(const btTransform& trans,btVector3&minAabb,btVector3&maxAabb) const
+{
+#ifndef __SPU__
+	//use localGetSupportingVertexWithoutMargin?
+	btScalar margin = getMargin();
+	for (int i=0;i<3;i++)
+	{
+		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
+		vec[i] = btScalar(1.);
+
+		btVector3 sv = localGetSupportingVertex(vec*trans.getBasis());
+
+		btVector3 tmp = trans(sv);
+		maxAabb[i] = tmp[i]+margin;
+		vec[i] = btScalar(-1.);
+		tmp = trans(localGetSupportingVertex(vec*trans.getBasis()));
+		minAabb[i] = tmp[i]-margin;
+	}
+#endif
+}
+
+
+
+btVector3	btConvexInternalShape::localGetSupportingVertex(const btVector3& vec)const
+{
+#ifndef __SPU__
+
+	 btVector3	supVertex = localGetSupportingVertexWithoutMargin(vec);
+
+	if ( getMargin()!=btScalar(0.) )
+	{
+		btVector3 vecnorm = vec;
+		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
+		{
+			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
+		} 
+		vecnorm.normalize();
+		supVertex+= getMargin() * vecnorm;
+	}
+	return supVertex;
+
+#else
+	btAssert(0);
+	return btVector3(0,0,0);
+#endif //__SPU__
+
+ }
+
+
+btConvexInternalAabbCachingShape::btConvexInternalAabbCachingShape()
+	:	btConvexInternalShape(),
+m_localAabbMin(1,1,1),
+m_localAabbMax(-1,-1,-1),
+m_isLocalAabbValid(false)
+{
+}
+
+
+void btConvexInternalAabbCachingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin());
+}
+
+void	btConvexInternalAabbCachingShape::setLocalScaling(const btVector3& scaling)
+{
+	btConvexInternalShape::setLocalScaling(scaling);
+	recalcLocalAabb();
+}
+
+
+void	btConvexInternalAabbCachingShape::recalcLocalAabb()
+{
+	m_isLocalAabbValid = true;
+	
+	#if 1
+	static const btVector3 _directions[] =
+	{
+		btVector3( 1.,  0.,  0.),
+		btVector3( 0.,  1.,  0.),
+		btVector3( 0.,  0.,  1.),
+		btVector3( -1., 0.,  0.),
+		btVector3( 0., -1.,  0.),
+		btVector3( 0.,  0., -1.)
+	};
+	
+	btVector3 _supporting[] =
+	{
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.)
+	};
+	
+	batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6);
+	
+	for ( int i = 0; i < 3; ++i )
+	{
+		m_localAabbMax[i] = _supporting[i][i] + m_collisionMargin;
+		m_localAabbMin[i] = _supporting[i + 3][i] - m_collisionMargin;
+	}
+	
+	#else
+
+	for (int i=0;i<3;i++)
+	{
+		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
+		vec[i] = btScalar(1.);
+		btVector3 tmp = localGetSupportingVertex(vec);
+		m_localAabbMax[i] = tmp[i]+m_collisionMargin;
+		vec[i] = btScalar(-1.);
+		tmp = localGetSupportingVertex(vec);
+		m_localAabbMin[i] = tmp[i]-m_collisionMargin;
+	}
+	#endif
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h
new file mode 100644
index 0000000..1252773
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexInternalShape.h
@@ -0,0 +1,202 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_INTERNAL_SHAPE_H
+#define BT_CONVEX_INTERNAL_SHAPE_H
+
+#include "btConvexShape.h"
+#include "LinearMath/btAabbUtil2.h"
+
+
+///The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
+class btConvexInternalShape : public btConvexShape
+{
+
+	protected:
+
+	//local scaling. collisionMargin is not scaled !
+	btVector3	m_localScaling;
+
+	btVector3	m_implicitShapeDimensions;
+	
+	btScalar	m_collisionMargin;
+
+	btScalar	m_padding;
+
+	btConvexInternalShape();
+
+public:
+
+	
+
+	virtual ~btConvexInternalShape()
+	{
+
+	}
+
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
+
+	const btVector3& getImplicitShapeDimensions() const
+	{
+		return m_implicitShapeDimensions;
+	}
+
+	///warning: use setImplicitShapeDimensions with care
+	///changing a collision shape while the body is in the world is not recommended,
+	///it is best to remove the body from the world, then make the change, and re-add it
+	///alternatively flush the contact points, see documentation for 'cleanProxyFromPairs'
+	void	setImplicitShapeDimensions(const btVector3& dimensions)
+	{
+		m_implicitShapeDimensions = dimensions;
+	}
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+	{
+		getAabbSlow(t,aabbMin,aabbMax);
+	}
+
+
+	
+	virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+
+	virtual void	setLocalScaling(const btVector3& scaling);
+	virtual const btVector3& getLocalScaling() const 
+	{
+		return m_localScaling;
+	}
+
+	const btVector3& getLocalScalingNV() const 
+	{
+		return m_localScaling;
+	}
+
+	virtual void	setMargin(btScalar margin)
+	{
+		m_collisionMargin = margin;
+	}
+	virtual btScalar	getMargin() const
+	{
+		return m_collisionMargin;
+	}
+
+	btScalar	getMarginNV() const
+	{
+		return m_collisionMargin;
+	}
+
+	virtual int		getNumPreferredPenetrationDirections() const
+	{
+		return 0;
+	}
+	
+	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
+	{
+		(void)penetrationVector;
+		(void)index;
+		btAssert(0);
+	}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+	
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btConvexInternalShapeData
+{
+	btCollisionShapeData	m_collisionShapeData;
+
+	btVector3FloatData	m_localScaling;
+
+	btVector3FloatData	m_implicitShapeDimensions;
+	
+	float			m_collisionMargin;
+
+	int	m_padding;
+
+};
+
+
+
+SIMD_FORCE_INLINE	int	btConvexInternalShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btConvexInternalShapeData);
+}
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btConvexInternalShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btConvexInternalShapeData* shapeData = (btConvexInternalShapeData*) dataBuffer;
+	btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer);
+
+	m_implicitShapeDimensions.serializeFloat(shapeData->m_implicitShapeDimensions);
+	m_localScaling.serializeFloat(shapeData->m_localScaling);
+	shapeData->m_collisionMargin = float(m_collisionMargin);
+
+	return "btConvexInternalShapeData";
+}
+
+
+
+
+///btConvexInternalAabbCachingShape adds local aabb caching for convex shapes, to avoid expensive bounding box calculations
+class btConvexInternalAabbCachingShape : public btConvexInternalShape
+{
+	btVector3	m_localAabbMin;
+	btVector3	m_localAabbMax;
+	bool		m_isLocalAabbValid;
+	
+protected:
+					
+	btConvexInternalAabbCachingShape();
+	
+	void setCachedLocalAabb (const btVector3& aabbMin, const btVector3& aabbMax)
+	{
+		m_isLocalAabbValid = true;
+		m_localAabbMin = aabbMin;
+		m_localAabbMax = aabbMax;
+	}
+
+	inline void getCachedLocalAabb (btVector3& aabbMin, btVector3& aabbMax) const
+	{
+		btAssert(m_isLocalAabbValid);
+		aabbMin = m_localAabbMin;
+		aabbMax = m_localAabbMax;
+	}
+
+	inline void getNonvirtualAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax, btScalar margin) const
+	{
+
+		//lazy evaluation of local aabb
+		btAssert(m_isLocalAabbValid);
+		btTransformAabb(m_localAabbMin,m_localAabbMax,margin,trans,aabbMin,aabbMax);
+	}
+		
+public:
+		
+	virtual void	setLocalScaling(const btVector3& scaling);
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	void	recalcLocalAabb();
+
+};
+
+#endif //BT_CONVEX_INTERNAL_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
new file mode 100644
index 0000000..c1b155a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
@@ -0,0 +1,157 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConvexPointCloudShape.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+
+#include "LinearMath/btQuaternion.h"
+
+void btConvexPointCloudShape::setLocalScaling(const btVector3& scaling)
+{
+	m_localScaling = scaling;
+	recalcLocalAabb();
+}
+
+#ifndef __SPU__
+btVector3	btConvexPointCloudShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
+{
+	btVector3 supVec(btScalar(0.),btScalar(0.),btScalar(0.));
+	btScalar newDot,maxDot = btScalar(-BT_LARGE_FLOAT);
+
+	btVector3 vec = vec0;
+	btScalar lenSqr = vec.length2();
+	if (lenSqr < btScalar(0.0001))
+	{
+		vec.setValue(1,0,0);
+	} else
+	{
+		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
+		vec *= rlen;
+	}
+
+
+	for (int i=0;i<m_numPoints;i++)
+	{
+		btVector3 vtx = getScaledPoint(i);
+
+		newDot = vec.dot(vtx);
+		if (newDot > maxDot)
+		{
+			maxDot = newDot;
+			supVec = vtx;
+		}
+	}
+	return supVec;
+}
+
+void	btConvexPointCloudShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	btScalar newDot;
+	//use 'w' component of supportVerticesOut?
+	{
+		for (int i=0;i<numVectors;i++)
+		{
+			supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
+		}
+	}
+	for (int i=0;i<m_numPoints;i++)
+	{
+		btVector3 vtx = getScaledPoint(i);
+
+		for (int j=0;j<numVectors;j++)
+		{
+			const btVector3& vec = vectors[j];
+			
+			newDot = vec.dot(vtx);
+			if (newDot > supportVerticesOut[j][3])
+			{
+				//WARNING: don't swap next lines, the w component would get overwritten!
+				supportVerticesOut[j] = vtx;
+				supportVerticesOut[j][3] = newDot;
+			}
+		}
+	}
+
+
+
+}
+	
+
+
+btVector3	btConvexPointCloudShape::localGetSupportingVertex(const btVector3& vec)const
+{
+	btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec);
+
+	if ( getMargin()!=btScalar(0.) )
+	{
+		btVector3 vecnorm = vec;
+		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
+		{
+			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
+		} 
+		vecnorm.normalize();
+		supVertex+= getMargin() * vecnorm;
+	}
+	return supVertex;
+}
+
+
+#endif
+
+
+
+
+
+
+//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection
+//Please note that you can debug-draw btConvexHullShape with the Raytracer Demo
+int	btConvexPointCloudShape::getNumVertices() const
+{
+	return m_numPoints;
+}
+
+int btConvexPointCloudShape::getNumEdges() const
+{
+	return 0;
+}
+
+void btConvexPointCloudShape::getEdge(int i,btVector3& pa,btVector3& pb) const
+{
+	btAssert (0);
+}
+
+void btConvexPointCloudShape::getVertex(int i,btVector3& vtx) const
+{
+	vtx = m_unscaledPoints[i]*m_localScaling;
+}
+
+int	btConvexPointCloudShape::getNumPlanes() const
+{
+	return 0;
+}
+
+void btConvexPointCloudShape::getPlane(btVector3& ,btVector3& ,int ) const
+{
+
+	btAssert(0);
+}
+
+//not yet
+bool btConvexPointCloudShape::isInside(const btVector3& ,btScalar ) const
+{
+	btAssert(0);
+	return false;
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.h
new file mode 100644
index 0000000..54b5afa
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.h
@@ -0,0 +1,105 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_POINT_CLOUD_SHAPE_H
+#define BT_CONVEX_POINT_CLOUD_SHAPE_H
+
+#include "btPolyhedralConvexShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+#include "LinearMath/btAlignedObjectArray.h"
+
+///The btConvexPointCloudShape implements an implicit convex hull of an array of vertices.
+ATTRIBUTE_ALIGNED16(class) btConvexPointCloudShape : public btPolyhedralConvexAabbCachingShape
+{
+	btVector3* m_unscaledPoints;
+	int m_numPoints;
+
+public:
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btConvexPointCloudShape()
+	{
+		m_localScaling.setValue(1.f,1.f,1.f);
+		m_shapeType = CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE;
+		m_unscaledPoints = 0;
+		m_numPoints = 0;
+	}
+
+	btConvexPointCloudShape(btVector3* points,int numPoints, const btVector3& localScaling,bool computeAabb = true)
+	{
+		m_localScaling = localScaling;
+		m_shapeType = CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE;
+		m_unscaledPoints = points;
+		m_numPoints = numPoints;
+
+		if (computeAabb)
+			recalcLocalAabb();
+	}
+
+	void setPoints (btVector3* points, int numPoints, bool computeAabb = true,const btVector3& localScaling=btVector3(1.f,1.f,1.f))
+	{
+		m_unscaledPoints = points;
+		m_numPoints = numPoints;
+		m_localScaling = localScaling;
+
+		if (computeAabb)
+			recalcLocalAabb();
+	}
+
+	SIMD_FORCE_INLINE	btVector3* getUnscaledPoints()
+	{
+		return m_unscaledPoints;
+	}
+
+	SIMD_FORCE_INLINE	const btVector3* getUnscaledPoints() const
+	{
+		return m_unscaledPoints;
+	}
+
+	SIMD_FORCE_INLINE	int getNumPoints() const 
+	{
+		return m_numPoints;
+	}
+
+	SIMD_FORCE_INLINE	btVector3	getScaledPoint( int index) const
+	{
+		return m_unscaledPoints[index] * m_localScaling;
+	}
+
+#ifndef __SPU__
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+#endif
+
+
+	//debugging
+	virtual const char*	getName()const {return "ConvexPointCloud";}
+
+	virtual int	getNumVertices() const;
+	virtual int getNumEdges() const;
+	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
+	virtual void getVertex(int i,btVector3& vtx) const;
+	virtual int	getNumPlanes() const;
+	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
+	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const;
+
+	///in case we receive negative scaling
+	virtual void	setLocalScaling(const btVector3& scaling);
+};
+
+
+#endif //BT_CONVEX_POINT_CLOUD_SHAPE_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
new file mode 100644
index 0000000..6fceb6f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
@@ -0,0 +1,185 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2011 Advanced Micro Devices, Inc.  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+///This file was written by Erwin Coumans
+///Separating axis rest based on work from Pierre Terdiman, see
+///And contact clipping based on work from Simon Hobbs
+
+
+#include "btConvexPolyhedron.h"
+#include "LinearMath/btHashMap.h"
+
+btConvexPolyhedron::btConvexPolyhedron()
+{
+
+}
+btConvexPolyhedron::~btConvexPolyhedron()
+{
+
+}
+
+
+inline bool IsAlmostZero(const btVector3& v)
+{
+	if(fabsf(v.x())>1e-6 || fabsf(v.y())>1e-6 || fabsf(v.z())>1e-6)	return false;
+	return true;
+}
+
+struct btInternalVertexPair
+{
+	btInternalVertexPair(short int v0,short int v1)
+		:m_v0(v0),
+		m_v1(v1)
+	{
+		if (m_v1>m_v0)
+			btSwap(m_v0,m_v1);
+	}
+	short int m_v0;
+	short int m_v1;
+	int getHash() const
+	{
+		return m_v0+(m_v1<<16);
+	}
+	bool equals(const btInternalVertexPair& other) const
+	{
+		return m_v0==other.m_v0 && m_v1==other.m_v1;
+	}
+};
+
+struct btInternalEdge
+{
+	btInternalEdge()
+		:m_face0(-1),
+		m_face1(-1)
+	{
+	}
+	short int m_face0;
+	short int m_face1;
+};
+
+//
+
+void	btConvexPolyhedron::initialize()
+{
+	btHashMap<btInternalVertexPair,btInternalEdge> edges;
+
+	float TotalArea = 0.0f;
+	
+	m_localCenter.setValue(0, 0, 0);
+	for(int i=0;i<m_faces.size();i++)
+	{
+		int numVertices = m_faces[i].m_indices.size();
+		int NbTris = numVertices;
+		for(int j=0;j<NbTris;j++)
+		{
+			int k = (j+1)%numVertices;
+			btInternalVertexPair vp(m_faces[i].m_indices[j],m_faces[i].m_indices[k]);
+			btInternalEdge* edptr = edges.find(vp);
+			btVector3 edge = m_vertices[vp.m_v1]-m_vertices[vp.m_v0];
+			edge.normalize();
+
+			bool found = false;
+
+			for (int p=0;p<m_uniqueEdges.size();p++)
+			{
+				
+				if (IsAlmostZero(m_uniqueEdges[p]-edge) || 
+					IsAlmostZero(m_uniqueEdges[p]+edge))
+				{
+					found = true;
+					break;
+				}
+			}
+
+			if (!found)
+			{
+				m_uniqueEdges.push_back(edge);
+			}
+
+			if (edptr)
+			{
+				btAssert(edptr->m_face0>=0);
+				btAssert(edptr->m_face1<0);
+				edptr->m_face1 = i;
+			} else
+			{
+				btInternalEdge ed;
+				ed.m_face0 = i;
+				edges.insert(vp,ed);
+			}
+		}
+	}
+
+	for(int i=0;i<m_faces.size();i++)
+	{
+		int numVertices = m_faces[i].m_indices.size();
+		m_faces[i].m_connectedFaces.resize(numVertices);
+
+		for(int j=0;j<numVertices;j++)
+		{
+			int k = (j+1)%numVertices;
+			btInternalVertexPair vp(m_faces[i].m_indices[j],m_faces[i].m_indices[k]);
+			btInternalEdge* edptr = edges.find(vp);
+			btAssert(edptr);
+			btAssert(edptr->m_face0>=0);
+			btAssert(edptr->m_face1>=0);
+
+			int connectedFace = (edptr->m_face0==i)?edptr->m_face1:edptr->m_face0;
+			m_faces[i].m_connectedFaces[j] = connectedFace;
+		}
+	}
+
+	for(int i=0;i<m_faces.size();i++)
+	{
+		int numVertices = m_faces[i].m_indices.size();
+		int NbTris = numVertices-2;
+		
+		const btVector3& p0 = m_vertices[m_faces[i].m_indices[0]];
+		for(int j=1;j<=NbTris;j++)
+		{
+			int k = (j+1)%numVertices;
+			const btVector3& p1 = m_vertices[m_faces[i].m_indices[j]];
+			const btVector3& p2 = m_vertices[m_faces[i].m_indices[k]];
+			float Area = ((p0 - p1).cross(p0 - p2)).length() * 0.5f;
+			btVector3 Center = (p0+p1+p2)/3.0f;
+			m_localCenter += Area * Center;
+			TotalArea += Area;
+		}
+	}
+	m_localCenter /= TotalArea;
+
+}
+
+
+void btConvexPolyhedron::project(const btTransform& trans, const btVector3& dir, float& min, float& max) const
+{
+	min = FLT_MAX;
+	max = -FLT_MAX;
+	int numVerts = m_vertices.size();
+	for(int i=0;i<numVerts;i++)
+	{
+		btVector3 pt = trans * m_vertices[i];
+		float dp = pt.dot(dir);
+		if(dp < min)	min = dp;
+		if(dp > max)	max = dp;
+	}
+	if(min>max)
+	{
+		float tmp = min;
+		min = max;
+		max = tmp;
+	}
+}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.h
new file mode 100644
index 0000000..a64cdbf
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexPolyhedron.h
@@ -0,0 +1,54 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2011 Advanced Micro Devices, Inc.  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+///This file was written by Erwin Coumans
+
+
+#ifndef _BT_POLYHEDRAL_FEATURES_H
+#define _BT_POLYHEDRAL_FEATURES_H
+
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+
+struct btFace
+{
+	btAlignedObjectArray<int>	m_indices;
+	btAlignedObjectArray<int>	m_connectedFaces;
+	float	m_plane[4];
+};
+
+
+class btConvexPolyhedron
+{
+	public:
+	btConvexPolyhedron();
+	virtual	~btConvexPolyhedron();
+
+	btAlignedObjectArray<btVector3>	m_vertices;
+	btAlignedObjectArray<btFace>	m_faces;
+	btAlignedObjectArray<btVector3> m_uniqueEdges;
+	btVector3		m_localCenter;
+
+	void	initialize();
+
+	void project(const btTransform& trans, const btVector3& dir, float& min, float& max) const;
+};
+
+	
+#endif //_BT_POLYHEDRAL_FEATURES_H
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp
new file mode 100644
index 0000000..f5f3aa5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.cpp
@@ -0,0 +1,429 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConvexShape.h"
+#include "btTriangleShape.h"
+#include "btSphereShape.h"
+#include "btCylinderShape.h"
+#include "btCapsuleShape.h"
+#include "btConvexHullShape.h"
+#include "btConvexPointCloudShape.h"
+
+///not supported on IBM SDK, until we fix the alignment of btVector3
+#if defined (__CELLOS_LV2__) && defined (__SPU__)
+#include <spu_intrinsics.h>
+static inline vec_float4 vec_dot3( vec_float4 vec0, vec_float4 vec1 )
+{
+    vec_float4 result;
+    result = spu_mul( vec0, vec1 );
+    result = spu_madd( spu_rlqwbyte( vec0, 4 ), spu_rlqwbyte( vec1, 4 ), result );
+    return spu_madd( spu_rlqwbyte( vec0, 8 ), spu_rlqwbyte( vec1, 8 ), result );
+}
+#endif //__SPU__
+
+btConvexShape::btConvexShape ()
+{
+}
+
+btConvexShape::~btConvexShape()
+{
+
+}
+
+
+
+static btVector3 convexHullSupport (const btVector3& localDirOrg, const btVector3* points, int numPoints, const btVector3& localScaling)
+{	
+
+	btVector3 vec = localDirOrg * localScaling;
+
+#if defined (__CELLOS_LV2__) && defined (__SPU__)
+
+	btVector3 localDir = vec;
+
+	vec_float4 v_distMax = {-FLT_MAX,0,0,0};
+	vec_int4 v_idxMax = {-999,0,0,0};
+	int v=0;
+	int numverts = numPoints;
+
+	for(;v<(int)numverts-4;v+=4) {
+		vec_float4 p0 = vec_dot3(points[v  ].get128(),localDir.get128());
+		vec_float4 p1 = vec_dot3(points[v+1].get128(),localDir.get128());
+		vec_float4 p2 = vec_dot3(points[v+2].get128(),localDir.get128());
+		vec_float4 p3 = vec_dot3(points[v+3].get128(),localDir.get128());
+		const vec_int4 i0 = {v  ,0,0,0};
+		const vec_int4 i1 = {v+1,0,0,0};
+		const vec_int4 i2 = {v+2,0,0,0};
+		const vec_int4 i3 = {v+3,0,0,0};
+		vec_uint4  retGt01 = spu_cmpgt(p0,p1);
+		vec_float4 pmax01 = spu_sel(p1,p0,retGt01);
+		vec_int4   imax01 = spu_sel(i1,i0,retGt01);
+		vec_uint4  retGt23 = spu_cmpgt(p2,p3);
+		vec_float4 pmax23 = spu_sel(p3,p2,retGt23);
+		vec_int4   imax23 = spu_sel(i3,i2,retGt23);
+		vec_uint4  retGt0123 = spu_cmpgt(pmax01,pmax23);
+		vec_float4 pmax0123 = spu_sel(pmax23,pmax01,retGt0123);
+		vec_int4   imax0123 = spu_sel(imax23,imax01,retGt0123);
+		vec_uint4  retGtMax = spu_cmpgt(v_distMax,pmax0123);
+		v_distMax = spu_sel(pmax0123,v_distMax,retGtMax);
+		v_idxMax = spu_sel(imax0123,v_idxMax,retGtMax);
+	}
+	for(;v<(int)numverts;v++) {
+		vec_float4 p = vec_dot3(points[v].get128(),localDir.get128());
+		const vec_int4 i = {v,0,0,0};
+		vec_uint4  retGtMax = spu_cmpgt(v_distMax,p);
+		v_distMax = spu_sel(p,v_distMax,retGtMax);
+		v_idxMax = spu_sel(i,v_idxMax,retGtMax);
+	}
+	int ptIndex = spu_extract(v_idxMax,0);
+	const btVector3& supVec= points[ptIndex] * localScaling;
+	return supVec;
+#else
+
+	btScalar newDot,maxDot = btScalar(-BT_LARGE_FLOAT);
+	int ptIndex = -1;
+
+	for (int i=0;i<numPoints;i++)
+	{
+
+		newDot = vec.dot(points[i]);
+		if (newDot > maxDot)
+		{
+			maxDot = newDot;
+			ptIndex = i;
+		}
+	}
+	btAssert(ptIndex >= 0);
+	btVector3 supVec = points[ptIndex] * localScaling;
+	return supVec;
+#endif //__SPU__
+}
+
+btVector3 btConvexShape::localGetSupportVertexWithoutMarginNonVirtual (const btVector3& localDir) const
+{
+	switch (m_shapeType)
+	{
+    case SPHERE_SHAPE_PROXYTYPE:
+	{
+		return btVector3(0,0,0);
+    }
+	case BOX_SHAPE_PROXYTYPE:
+	{
+		btBoxShape* convexShape = (btBoxShape*)this;
+		const btVector3& halfExtents = convexShape->getImplicitShapeDimensions();
+
+		return btVector3(btFsels(localDir.x(), halfExtents.x(), -halfExtents.x()),
+			btFsels(localDir.y(), halfExtents.y(), -halfExtents.y()),
+			btFsels(localDir.z(), halfExtents.z(), -halfExtents.z()));
+	}
+	case TRIANGLE_SHAPE_PROXYTYPE:
+	{
+		btTriangleShape* triangleShape = (btTriangleShape*)this;
+		btVector3 dir(localDir.getX(),localDir.getY(),localDir.getZ());
+		btVector3* vertices = &triangleShape->m_vertices1[0];
+		btVector3 dots(dir.dot(vertices[0]), dir.dot(vertices[1]), dir.dot(vertices[2]));
+		btVector3 sup = vertices[dots.maxAxis()];
+		return btVector3(sup.getX(),sup.getY(),sup.getZ());
+	}
+	case CYLINDER_SHAPE_PROXYTYPE:
+	{
+		btCylinderShape* cylShape = (btCylinderShape*)this;
+		//mapping of halfextents/dimension onto radius/height depends on how cylinder local orientation is (upAxis)
+
+		btVector3 halfExtents = cylShape->getImplicitShapeDimensions();
+		btVector3 v(localDir.getX(),localDir.getY(),localDir.getZ());
+		int cylinderUpAxis = cylShape->getUpAxis();
+		int XX(1),YY(0),ZZ(2);
+
+		switch (cylinderUpAxis)
+		{
+		case 0:
+		{
+			XX = 1;
+			YY = 0;
+			ZZ = 2;
+		}
+		break;
+		case 1:
+		{
+			XX = 0;
+			YY = 1;
+			ZZ = 2;	
+		}
+		break;
+		case 2:
+		{
+			XX = 0;
+			YY = 2;
+			ZZ = 1;
+			
+		}
+		break;
+		default:
+			btAssert(0);
+		break;
+		};
+
+		btScalar radius = halfExtents[XX];
+		btScalar halfHeight = halfExtents[cylinderUpAxis];
+
+		btVector3 tmp;
+		btScalar d ;
+
+		btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
+		if (s != btScalar(0.0))
+		{
+			d = radius / s;  
+			tmp[XX] = v[XX] * d;
+			tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
+			tmp[ZZ] = v[ZZ] * d;
+			return btVector3(tmp.getX(),tmp.getY(),tmp.getZ());
+		} else {
+			tmp[XX] = radius;
+			tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
+			tmp[ZZ] = btScalar(0.0);
+			return btVector3(tmp.getX(),tmp.getY(),tmp.getZ());
+		}
+	}
+	case CAPSULE_SHAPE_PROXYTYPE:
+	{
+		btVector3 vec0(localDir.getX(),localDir.getY(),localDir.getZ());
+
+		btCapsuleShape* capsuleShape = (btCapsuleShape*)this;
+		btScalar halfHeight = capsuleShape->getHalfHeight();
+		int capsuleUpAxis = capsuleShape->getUpAxis();
+
+		btScalar radius = capsuleShape->getRadius();
+		btVector3 supVec(0,0,0);
+
+		btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
+
+		btVector3 vec = vec0;
+		btScalar lenSqr = vec.length2();
+		if (lenSqr < btScalar(0.0001))
+		{
+			vec.setValue(1,0,0);
+		} else
+		{
+			btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
+			vec *= rlen;
+		}
+		btVector3 vtx;
+		btScalar newDot;
+		{
+			btVector3 pos(0,0,0);
+			pos[capsuleUpAxis] = halfHeight;
+
+			//vtx = pos +vec*(radius);
+			vtx = pos +vec*capsuleShape->getLocalScalingNV()*(radius) - vec * capsuleShape->getMarginNV();
+			newDot = vec.dot(vtx);
+			
+
+			if (newDot > maxDot)
+			{
+				maxDot = newDot;
+				supVec = vtx;
+			}
+		}
+		{
+			btVector3 pos(0,0,0);
+			pos[capsuleUpAxis] = -halfHeight;
+
+			//vtx = pos +vec*(radius);
+			vtx = pos +vec*capsuleShape->getLocalScalingNV()*(radius) - vec * capsuleShape->getMarginNV();
+			newDot = vec.dot(vtx);
+			if (newDot > maxDot)
+			{
+				maxDot = newDot;
+				supVec = vtx;
+			}
+		}
+		return btVector3(supVec.getX(),supVec.getY(),supVec.getZ());	
+	}
+	case CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE:
+	{
+		btConvexPointCloudShape* convexPointCloudShape = (btConvexPointCloudShape*)this;
+		btVector3* points = convexPointCloudShape->getUnscaledPoints ();
+		int numPoints = convexPointCloudShape->getNumPoints ();
+		return convexHullSupport (localDir, points, numPoints,convexPointCloudShape->getLocalScalingNV());
+	}
+	case CONVEX_HULL_SHAPE_PROXYTYPE:
+	{
+		btConvexHullShape* convexHullShape = (btConvexHullShape*)this;
+		btVector3* points = convexHullShape->getUnscaledPoints();
+		int numPoints = convexHullShape->getNumPoints ();
+		return convexHullSupport (localDir, points, numPoints,convexHullShape->getLocalScalingNV());
+	}
+    default:
+#ifndef __SPU__
+		return this->localGetSupportingVertexWithoutMargin (localDir);
+#else
+		btAssert (0);
+#endif
+	}
+
+	// should never reach here
+	btAssert (0);
+	return btVector3 (btScalar(0.0f), btScalar(0.0f), btScalar(0.0f));
+}
+
+btVector3 btConvexShape::localGetSupportVertexNonVirtual (const btVector3& localDir) const
+{
+	btVector3 localDirNorm = localDir;
+	if (localDirNorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
+	{
+		localDirNorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
+	}
+	localDirNorm.normalize ();
+
+	return localGetSupportVertexWithoutMarginNonVirtual(localDirNorm)+ getMarginNonVirtual() * localDirNorm;
+}
+
+/* TODO: This should be bumped up to btCollisionShape () */
+btScalar btConvexShape::getMarginNonVirtual () const
+{
+	switch (m_shapeType)
+	{
+    case SPHERE_SHAPE_PROXYTYPE:
+	{
+		btSphereShape* sphereShape = (btSphereShape*)this;
+		return sphereShape->getRadius ();
+	}
+	case BOX_SHAPE_PROXYTYPE:
+	{
+		btBoxShape* convexShape = (btBoxShape*)this;
+		return convexShape->getMarginNV ();
+	}
+	case TRIANGLE_SHAPE_PROXYTYPE:
+	{
+		btTriangleShape* triangleShape = (btTriangleShape*)this;
+		return triangleShape->getMarginNV ();
+	}
+	case CYLINDER_SHAPE_PROXYTYPE:
+	{
+		btCylinderShape* cylShape = (btCylinderShape*)this;
+		return cylShape->getMarginNV();
+	}
+	case CAPSULE_SHAPE_PROXYTYPE:
+	{
+		btCapsuleShape* capsuleShape = (btCapsuleShape*)this;
+		return capsuleShape->getMarginNV();
+	}
+	case CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE:
+	/* fall through */
+	case CONVEX_HULL_SHAPE_PROXYTYPE:
+	{
+		btPolyhedralConvexShape* convexHullShape = (btPolyhedralConvexShape*)this;
+		return convexHullShape->getMarginNV();
+	}
+    default:
+#ifndef __SPU__
+		return this->getMargin ();
+#else
+		btAssert (0);
+#endif
+	}
+
+	// should never reach here
+	btAssert (0);
+	return btScalar(0.0f);
+}
+#ifndef __SPU__
+void btConvexShape::getAabbNonVirtual (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
+{
+	switch (m_shapeType)
+	{
+    case SPHERE_SHAPE_PROXYTYPE:
+	{
+		btSphereShape* sphereShape = (btSphereShape*)this;
+		btScalar radius = sphereShape->getImplicitShapeDimensions().getX();// * convexShape->getLocalScaling().getX();
+		btScalar margin = radius + sphereShape->getMarginNonVirtual();
+		const btVector3& center = t.getOrigin();
+		btVector3 extent(margin,margin,margin);
+		aabbMin = center - extent;
+		aabbMax = center + extent;
+    }
+	break;
+	case CYLINDER_SHAPE_PROXYTYPE:
+	/* fall through */
+	case BOX_SHAPE_PROXYTYPE:
+	{
+		btBoxShape* convexShape = (btBoxShape*)this;
+		btScalar margin=convexShape->getMarginNonVirtual();
+		btVector3 halfExtents = convexShape->getImplicitShapeDimensions();
+		halfExtents += btVector3(margin,margin,margin);
+		btMatrix3x3 abs_b = t.getBasis().absolute();  
+		btVector3 center = t.getOrigin();
+		btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
+		
+		aabbMin = center - extent;
+		aabbMax = center + extent;
+		break;
+	}
+	case TRIANGLE_SHAPE_PROXYTYPE:
+	{
+		btTriangleShape* triangleShape = (btTriangleShape*)this;
+		btScalar margin = triangleShape->getMarginNonVirtual();
+		for (int i=0;i<3;i++)
+		{
+			btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
+			vec[i] = btScalar(1.);
+
+			btVector3 sv = localGetSupportVertexWithoutMarginNonVirtual(vec*t.getBasis());
+
+			btVector3 tmp = t(sv);
+			aabbMax[i] = tmp[i]+margin;
+			vec[i] = btScalar(-1.);
+			tmp = t(localGetSupportVertexWithoutMarginNonVirtual(vec*t.getBasis()));
+			aabbMin[i] = tmp[i]-margin;
+		}	
+	}
+	break;
+	case CAPSULE_SHAPE_PROXYTYPE:
+	{
+		btCapsuleShape* capsuleShape = (btCapsuleShape*)this;
+		btVector3 halfExtents(capsuleShape->getRadius(),capsuleShape->getRadius(),capsuleShape->getRadius());
+		int m_upAxis = capsuleShape->getUpAxis();
+		halfExtents[m_upAxis] = capsuleShape->getRadius() + capsuleShape->getHalfHeight();
+		halfExtents += btVector3(capsuleShape->getMarginNonVirtual(),capsuleShape->getMarginNonVirtual(),capsuleShape->getMarginNonVirtual());
+		btMatrix3x3 abs_b = t.getBasis().absolute();  
+		btVector3 center = t.getOrigin();
+		btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));		  	
+		aabbMin = center - extent;
+		aabbMax = center + extent;
+	}
+	break;
+	case CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE:
+	case CONVEX_HULL_SHAPE_PROXYTYPE:
+	{
+		btPolyhedralConvexAabbCachingShape* convexHullShape = (btPolyhedralConvexAabbCachingShape*)this;
+		btScalar margin = convexHullShape->getMarginNonVirtual();
+		convexHullShape->getNonvirtualAabb (t, aabbMin, aabbMax, margin);
+	}
+	break;
+    default:
+#ifndef __SPU__
+		this->getAabb (t, aabbMin, aabbMax);
+#else
+		btAssert (0);
+#endif
+	break;
+	}
+
+	// should never reach here
+	btAssert (0);
+}
+
+#endif //__SPU__
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h
new file mode 100644
index 0000000..cab4bb6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexShape.h
@@ -0,0 +1,82 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_SHAPE_INTERFACE1
+#define BT_CONVEX_SHAPE_INTERFACE1
+
+#include "btCollisionShape.h"
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "btCollisionMargin.h"
+#include "LinearMath/btAlignedAllocator.h"
+
+#define MAX_PREFERRED_PENETRATION_DIRECTIONS 10
+
+/// The btConvexShape is an abstract shape interface, implemented by all convex shapes such as btBoxShape, btConvexHullShape etc.
+/// It describes general convex shapes using the localGetSupportingVertex interface, used by collision detectors such as btGjkPairDetector.
+ATTRIBUTE_ALIGNED16(class) btConvexShape : public btCollisionShape
+{
+
+
+public:
+
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btConvexShape ();
+
+	virtual ~btConvexShape();
+
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const = 0;
+
+	////////
+	#ifndef __SPU__
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec) const=0;
+	#endif //#ifndef __SPU__
+
+	btVector3 localGetSupportVertexWithoutMarginNonVirtual (const btVector3& vec) const;
+	btVector3 localGetSupportVertexNonVirtual (const btVector3& vec) const;
+	btScalar getMarginNonVirtual () const;
+	void getAabbNonVirtual (const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const;
+
+	
+	//notice that the vectors should be unit length
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const= 0;
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0;
+
+	virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0;
+
+	virtual void	setLocalScaling(const btVector3& scaling) =0;
+	virtual const btVector3& getLocalScaling() const =0;
+
+	virtual void	setMargin(btScalar margin)=0;
+
+	virtual btScalar	getMargin() const=0;
+
+	virtual int		getNumPreferredPenetrationDirections() const=0;
+	
+	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const=0;
+
+
+	
+	
+};
+
+
+
+#endif //BT_CONVEX_SHAPE_INTERFACE1
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
new file mode 100644
index 0000000..0f9ced5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
@@ -0,0 +1,315 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConvexTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+
+#include "LinearMath/btQuaternion.h"
+#include "BulletCollision/CollisionShapes/btStridingMeshInterface.h"
+
+
+btConvexTriangleMeshShape ::btConvexTriangleMeshShape (btStridingMeshInterface* meshInterface, bool calcAabb)
+: btPolyhedralConvexAabbCachingShape(), m_stridingMesh(meshInterface)
+{
+	m_shapeType = CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE;
+	if ( calcAabb )
+		recalcLocalAabb();
+}
+
+
+
+
+///It's not nice to have all this virtual function overhead, so perhaps we can also gather the points once
+///but then we are duplicating
+class LocalSupportVertexCallback: public btInternalTriangleIndexCallback
+{
+
+	btVector3 m_supportVertexLocal;
+public:
+
+	btScalar m_maxDot;
+	btVector3 m_supportVecLocal;
+
+	LocalSupportVertexCallback(const btVector3& supportVecLocal)
+		: m_supportVertexLocal(btScalar(0.),btScalar(0.),btScalar(0.)),
+		m_maxDot(btScalar(-BT_LARGE_FLOAT)),
+                m_supportVecLocal(supportVecLocal)
+	{
+	}
+
+	virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
+	{
+		(void)triangleIndex;
+		(void)partId;
+
+		for (int i=0;i<3;i++)
+		{
+			btScalar dot = m_supportVecLocal.dot(triangle[i]);
+			if (dot > m_maxDot)
+			{
+				m_maxDot = dot;
+				m_supportVertexLocal = triangle[i];
+			}
+		}
+	}
+	
+	btVector3	GetSupportVertexLocal()
+	{
+		return m_supportVertexLocal;
+	}
+
+};
+
+
+
+
+
+btVector3	btConvexTriangleMeshShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
+{
+	btVector3 supVec(btScalar(0.),btScalar(0.),btScalar(0.));
+
+	btVector3 vec = vec0;
+	btScalar lenSqr = vec.length2();
+	if (lenSqr < btScalar(0.0001))
+	{
+		vec.setValue(1,0,0);
+	} else
+	{
+		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
+		vec *= rlen;
+	}
+
+	LocalSupportVertexCallback	supportCallback(vec);
+	btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+	m_stridingMesh->InternalProcessAllTriangles(&supportCallback,-aabbMax,aabbMax);
+	supVec = supportCallback.GetSupportVertexLocal();
+
+	return supVec;
+}
+
+void	btConvexTriangleMeshShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	//use 'w' component of supportVerticesOut?
+	{
+		for (int i=0;i<numVectors;i++)
+		{
+			supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
+		}
+	}
+	
+	///@todo: could do the batch inside the callback!
+
+
+	for (int j=0;j<numVectors;j++)
+	{
+		const btVector3& vec = vectors[j];
+		LocalSupportVertexCallback	supportCallback(vec);
+		btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+		m_stridingMesh->InternalProcessAllTriangles(&supportCallback,-aabbMax,aabbMax);
+		supportVerticesOut[j] = supportCallback.GetSupportVertexLocal();
+	}
+	
+}
+	
+
+
+btVector3	btConvexTriangleMeshShape::localGetSupportingVertex(const btVector3& vec)const
+{
+	btVector3 supVertex = localGetSupportingVertexWithoutMargin(vec);
+
+	if ( getMargin()!=btScalar(0.) )
+	{
+		btVector3 vecnorm = vec;
+		if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
+		{
+			vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
+		} 
+		vecnorm.normalize();
+		supVertex+= getMargin() * vecnorm;
+	}
+	return supVertex;
+}
+
+
+
+
+
+
+
+
+
+//currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection
+//Please note that you can debug-draw btConvexTriangleMeshShape with the Raytracer Demo
+int	btConvexTriangleMeshShape::getNumVertices() const
+{
+	//cache this?
+	return 0;
+	
+}
+
+int btConvexTriangleMeshShape::getNumEdges() const
+{
+	return 0;
+}
+
+void btConvexTriangleMeshShape::getEdge(int ,btVector3& ,btVector3& ) const
+{
+	btAssert(0);	
+}
+
+void btConvexTriangleMeshShape::getVertex(int ,btVector3& ) const
+{
+	btAssert(0);
+}
+
+int	btConvexTriangleMeshShape::getNumPlanes() const
+{
+	return 0;
+}
+
+void btConvexTriangleMeshShape::getPlane(btVector3& ,btVector3& ,int  ) const
+{
+	btAssert(0);
+}
+
+//not yet
+bool btConvexTriangleMeshShape::isInside(const btVector3& ,btScalar ) const
+{
+	btAssert(0);
+	return false;
+}
+
+
+
+void	btConvexTriangleMeshShape::setLocalScaling(const btVector3& scaling)
+{
+	m_stridingMesh->setScaling(scaling);
+	
+	recalcLocalAabb();
+	
+}
+
+
+const btVector3& btConvexTriangleMeshShape::getLocalScaling() const
+{
+	return m_stridingMesh->getScaling();
+}
+
+void btConvexTriangleMeshShape::calculatePrincipalAxisTransform(btTransform& principal, btVector3& inertia, btScalar& volume) const
+{
+   class CenterCallback: public btInternalTriangleIndexCallback
+   {
+      bool first;
+      btVector3 ref;
+      btVector3 sum;
+      btScalar volume;
+
+   public:
+
+      CenterCallback() : first(true), ref(0, 0, 0), sum(0, 0, 0), volume(0)
+      {
+      }
+
+      virtual void internalProcessTriangleIndex(btVector3* triangle, int partId, int triangleIndex)
+      {
+         (void) triangleIndex;
+         (void) partId;
+         if (first)
+         {
+            ref = triangle[0];
+            first = false;
+         }
+         else
+         {
+            btScalar vol = btFabs((triangle[0] - ref).triple(triangle[1] - ref, triangle[2] - ref));
+            sum += (btScalar(0.25) * vol) * ((triangle[0] + triangle[1] + triangle[2] + ref));
+            volume += vol;
+         }
+      }
+      
+      btVector3 getCenter()
+      {
+         return (volume > 0) ? sum / volume : ref;
+      }
+
+      btScalar getVolume()
+      {
+         return volume * btScalar(1. / 6);
+      }
+
+   };
+
+   class InertiaCallback: public btInternalTriangleIndexCallback
+   {
+      btMatrix3x3 sum;
+      btVector3 center;
+
+   public:
+
+      InertiaCallback(btVector3& center) : sum(0, 0, 0, 0, 0, 0, 0, 0, 0), center(center)
+      {
+      }
+
+      virtual void internalProcessTriangleIndex(btVector3* triangle, int partId, int triangleIndex)
+      {
+         (void) triangleIndex;
+         (void) partId;
+         btMatrix3x3 i;
+         btVector3 a = triangle[0] - center;
+         btVector3 b = triangle[1] - center;
+         btVector3 c = triangle[2] - center;
+         btScalar volNeg = -btFabs(a.triple(b, c)) * btScalar(1. / 6);
+         for (int j = 0; j < 3; j++)
+         {
+            for (int k = 0; k <= j; k++)
+            {
+               i[j][k] = i[k][j] = volNeg * (btScalar(0.1) * (a[j] * a[k] + b[j] * b[k] + c[j] * c[k])
+                  + btScalar(0.05) * (a[j] * b[k] + a[k] * b[j] + a[j] * c[k] + a[k] * c[j] + b[j] * c[k] + b[k] * c[j]));
+            }
+         }
+         btScalar i00 = -i[0][0];
+         btScalar i11 = -i[1][1];
+         btScalar i22 = -i[2][2];
+         i[0][0] = i11 + i22; 
+         i[1][1] = i22 + i00; 
+         i[2][2] = i00 + i11;
+         sum[0] += i[0];
+         sum[1] += i[1];
+         sum[2] += i[2];
+      }
+      
+      btMatrix3x3& getInertia()
+      {
+         return sum;
+      }
+
+   };
+
+   CenterCallback centerCallback;
+   btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+   m_stridingMesh->InternalProcessAllTriangles(&centerCallback, -aabbMax, aabbMax);
+   btVector3 center = centerCallback.getCenter();
+   principal.setOrigin(center);
+   volume = centerCallback.getVolume();
+
+   InertiaCallback inertiaCallback(center);
+   m_stridingMesh->InternalProcessAllTriangles(&inertiaCallback, -aabbMax, aabbMax);
+
+   btMatrix3x3& i = inertiaCallback.getInertia();
+   i.diagonalize(principal.getBasis(), btScalar(0.00001), 20);
+   inertia.setValue(i[0][0], i[1][1], i[2][2]);
+   inertia /= volume;
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h
new file mode 100644
index 0000000..af5d003
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h
@@ -0,0 +1,75 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef BT_CONVEX_TRIANGLEMESH_SHAPE_H
+#define BT_CONVEX_TRIANGLEMESH_SHAPE_H
+
+
+#include "btPolyhedralConvexShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+
+
+/// The btConvexTriangleMeshShape is a convex hull of a triangle mesh, but the performance is not as good as btConvexHullShape.
+/// A small benefit of this class is that it uses the btStridingMeshInterface, so you can avoid the duplication of the triangle mesh data. Nevertheless, most users should use the much better performing btConvexHullShape instead.
+class btConvexTriangleMeshShape : public btPolyhedralConvexAabbCachingShape
+{
+
+	class btStridingMeshInterface*	m_stridingMesh;
+
+public:
+	btConvexTriangleMeshShape(btStridingMeshInterface* meshInterface, bool calcAabb = true);
+
+	class btStridingMeshInterface*	getMeshInterface()
+	{
+		return m_stridingMesh;
+	}
+	const class btStridingMeshInterface* getMeshInterface() const
+	{
+		return m_stridingMesh;
+	}
+	
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+	
+	//debugging
+	virtual const char*	getName()const {return "ConvexTrimesh";}
+	
+	virtual int	getNumVertices() const;
+	virtual int getNumEdges() const;
+	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
+	virtual void getVertex(int i,btVector3& vtx) const;
+	virtual int	getNumPlanes() const;
+	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const;
+	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const;
+
+	
+	virtual void	setLocalScaling(const btVector3& scaling);
+	virtual const btVector3& getLocalScaling() const;
+
+	///computes the exact moment of inertia and the transform from the coordinate system defined by the principal axes of the moment of inertia
+	///and the center of mass to the current coordinate system. A mass of 1 is assumed, for other masses just multiply the computed "inertia"
+	///by the mass. The resulting transform "principal" has to be applied inversely to the mesh in order for the local coordinate system of the
+	///shape to be centered at the center of mass and to coincide with the principal axes. This also necessitates a correction of the world transform
+	///of the collision object by the principal transform. This method also computes the volume of the convex mesh.
+	void calculatePrincipalAxisTransform(btTransform& principal, btVector3& inertia, btScalar& volume) const;
+
+};
+
+
+
+#endif //BT_CONVEX_TRIANGLEMESH_SHAPE_H
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp
new file mode 100644
index 0000000..c2e534b
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.cpp
@@ -0,0 +1,279 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btCylinderShape.h"
+
+btCylinderShape::btCylinderShape (const btVector3& halfExtents)
+:btConvexInternalShape(),
+m_upAxis(1)
+{
+	btVector3 margin(getMargin(),getMargin(),getMargin());
+	m_implicitShapeDimensions = (halfExtents * m_localScaling) - margin;
+	m_shapeType = CYLINDER_SHAPE_PROXYTYPE;
+}
+
+
+btCylinderShapeX::btCylinderShapeX (const btVector3& halfExtents)
+:btCylinderShape(halfExtents)
+{
+	m_upAxis = 0;
+
+}
+
+
+btCylinderShapeZ::btCylinderShapeZ (const btVector3& halfExtents)
+:btCylinderShape(halfExtents)
+{
+	m_upAxis = 2;
+
+}
+
+void btCylinderShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
+}
+
+void	btCylinderShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+
+//Until Bullet 2.77 a box approximation was used, so uncomment this if you need backwards compatibility
+//#define USE_BOX_INERTIA_APPROXIMATION 1
+#ifndef USE_BOX_INERTIA_APPROXIMATION
+
+	/*
+	cylinder is defined as following:
+	*
+	* - principle axis aligned along y by default, radius in x, z-value not used
+	* - for btCylinderShapeX: principle axis aligned along x, radius in y direction, z-value not used
+	* - for btCylinderShapeZ: principle axis aligned along z, radius in x direction, y-value not used
+	*
+	*/
+
+	btScalar radius2;	// square of cylinder radius
+	btScalar height2;	// square of cylinder height
+	btVector3 halfExtents = getHalfExtentsWithMargin();	// get cylinder dimension
+	btScalar div12 = mass / 12.f;
+	btScalar div4 = mass / 4.f;
+	btScalar div2 = mass / 2.f;
+	int idxRadius, idxHeight;
+
+	switch (m_upAxis)	// get indices of radius and height of cylinder
+	{
+		case 0:		// cylinder is aligned along x
+			idxRadius = 1;
+			idxHeight = 0;
+			break;
+		case 2:		// cylinder is aligned along z
+			idxRadius = 0;
+			idxHeight = 2;
+			break;
+		default:	// cylinder is aligned along y
+			idxRadius = 0;
+			idxHeight = 1;
+	}
+
+	// calculate squares
+	radius2 = halfExtents[idxRadius] * halfExtents[idxRadius];
+	height2 = btScalar(4.) * halfExtents[idxHeight] * halfExtents[idxHeight];
+
+	// calculate tensor terms
+	btScalar t1 = div12 * height2 + div4 * radius2;
+	btScalar t2 = div2 * radius2;
+
+	switch (m_upAxis)	// set diagonal elements of inertia tensor
+	{
+		case 0:		// cylinder is aligned along x
+			inertia.setValue(t2,t1,t1);
+			break;
+		case 2:		// cylinder is aligned along z
+			inertia.setValue(t1,t1,t2);
+			break;
+		default:	// cylinder is aligned along y
+			inertia.setValue(t1,t2,t1);
+	}
+#else //USE_BOX_INERTIA_APPROXIMATION
+	//approximation of box shape
+	btVector3 halfExtents = getHalfExtentsWithMargin();
+
+	btScalar lx=btScalar(2.)*(halfExtents.x());
+	btScalar ly=btScalar(2.)*(halfExtents.y());
+	btScalar lz=btScalar(2.)*(halfExtents.z());
+
+	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
+					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
+					mass/(btScalar(12.0)) * (lx*lx + ly*ly));
+#endif //USE_BOX_INERTIA_APPROXIMATION
+}
+
+
+SIMD_FORCE_INLINE btVector3 CylinderLocalSupportX(const btVector3& halfExtents,const btVector3& v) 
+{
+const int cylinderUpAxis = 0;
+const int XX = 1;
+const int YY = 0;
+const int ZZ = 2;
+
+	//mapping depends on how cylinder local orientation is
+	// extents of the cylinder is: X,Y is for radius, and Z for height
+
+
+	btScalar radius = halfExtents[XX];
+	btScalar halfHeight = halfExtents[cylinderUpAxis];
+
+
+    btVector3 tmp;
+	btScalar d ;
+
+    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
+    if (s != btScalar(0.0))
+	{
+        d = radius / s;  
+		tmp[XX] = v[XX] * d;
+		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
+		tmp[ZZ] = v[ZZ] * d;
+		return tmp;
+	}
+    else
+	{
+	    tmp[XX] = radius;
+		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
+		tmp[ZZ] = btScalar(0.0);
+		return tmp;
+    }
+
+
+}
+
+
+
+
+
+
+inline  btVector3 CylinderLocalSupportY(const btVector3& halfExtents,const btVector3& v) 
+{
+
+const int cylinderUpAxis = 1;
+const int XX = 0;
+const int YY = 1;
+const int ZZ = 2;
+
+
+	btScalar radius = halfExtents[XX];
+	btScalar halfHeight = halfExtents[cylinderUpAxis];
+
+
+    btVector3 tmp;
+	btScalar d ;
+
+    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
+    if (s != btScalar(0.0))
+	{
+        d = radius / s;  
+		tmp[XX] = v[XX] * d;
+		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
+		tmp[ZZ] = v[ZZ] * d;
+		return tmp;
+	}
+    else
+	{
+	    tmp[XX] = radius;
+		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
+		tmp[ZZ] = btScalar(0.0);
+		return tmp;
+    }
+
+}
+
+inline btVector3 CylinderLocalSupportZ(const btVector3& halfExtents,const btVector3& v) 
+{
+const int cylinderUpAxis = 2;
+const int XX = 0;
+const int YY = 2;
+const int ZZ = 1;
+
+	//mapping depends on how cylinder local orientation is
+	// extents of the cylinder is: X,Y is for radius, and Z for height
+
+
+	btScalar radius = halfExtents[XX];
+	btScalar halfHeight = halfExtents[cylinderUpAxis];
+
+
+    btVector3 tmp;
+	btScalar d ;
+
+    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
+    if (s != btScalar(0.0))
+	{
+        d = radius / s;  
+		tmp[XX] = v[XX] * d;
+		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
+		tmp[ZZ] = v[ZZ] * d;
+		return tmp;
+	}
+    else
+	{
+	    tmp[XX] = radius;
+		tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
+		tmp[ZZ] = btScalar(0.0);
+		return tmp;
+    }
+
+
+}
+
+btVector3	btCylinderShapeX::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+{
+	return CylinderLocalSupportX(getHalfExtentsWithoutMargin(),vec);
+}
+
+
+btVector3	btCylinderShapeZ::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+{
+	return CylinderLocalSupportZ(getHalfExtentsWithoutMargin(),vec);
+}
+btVector3	btCylinderShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+{
+	return CylinderLocalSupportY(getHalfExtentsWithoutMargin(),vec);
+}
+
+void	btCylinderShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	for (int i=0;i<numVectors;i++)
+	{
+		supportVerticesOut[i] = CylinderLocalSupportY(getHalfExtentsWithoutMargin(),vectors[i]);
+	}
+}
+
+void	btCylinderShapeZ::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	for (int i=0;i<numVectors;i++)
+	{
+		supportVerticesOut[i] = CylinderLocalSupportZ(getHalfExtentsWithoutMargin(),vectors[i]);
+	}
+}
+
+
+
+
+void	btCylinderShapeX::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	for (int i=0;i<numVectors;i++)
+	{
+		supportVerticesOut[i] = CylinderLocalSupportX(getHalfExtentsWithoutMargin(),vectors[i]);
+	}
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.h
new file mode 100644
index 0000000..125bfc7
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btCylinderShape.h
@@ -0,0 +1,200 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CYLINDER_MINKOWSKI_H
+#define BT_CYLINDER_MINKOWSKI_H
+
+#include "btBoxShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+#include "LinearMath/btVector3.h"
+
+/// The btCylinderShape class implements a cylinder shape primitive, centered around the origin. Its central axis aligned with the Y axis. btCylinderShapeX is aligned with the X axis and btCylinderShapeZ around the Z axis.
+class btCylinderShape : public btConvexInternalShape
+
+{
+
+protected:
+
+	int	m_upAxis;
+
+public:
+
+	btVector3 getHalfExtentsWithMargin() const
+	{
+		btVector3 halfExtents = getHalfExtentsWithoutMargin();
+		btVector3 margin(getMargin(),getMargin(),getMargin());
+		halfExtents += margin;
+		return halfExtents;
+	}
+	
+	const btVector3& getHalfExtentsWithoutMargin() const
+	{
+		return m_implicitShapeDimensions;//changed in Bullet 2.63: assume the scaling and margin are included
+	}
+
+	btCylinderShape (const btVector3& halfExtents);
+	
+	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+
+	virtual void setMargin(btScalar collisionMargin)
+	{
+		//correct the m_implicitShapeDimensions for the margin
+		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
+		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
+		
+		btConvexInternalShape::setMargin(collisionMargin);
+		btVector3 newMargin(getMargin(),getMargin(),getMargin());
+		m_implicitShapeDimensions = implicitShapeDimensionsWithMargin - newMargin;
+
+	}
+
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec) const
+	{
+
+		btVector3 supVertex;
+		supVertex = localGetSupportingVertexWithoutMargin(vec);
+		
+		if ( getMargin()!=btScalar(0.) )
+		{
+			btVector3 vecnorm = vec;
+			if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
+			{
+				vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
+			} 
+			vecnorm.normalize();
+			supVertex+= getMargin() * vecnorm;
+		}
+		return supVertex;
+	}
+
+
+	//use box inertia
+	//	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+
+	int	getUpAxis() const
+	{
+		return m_upAxis;
+	}
+
+	virtual btScalar getRadius() const
+	{
+		return getHalfExtentsWithMargin().getX();
+	}
+
+	virtual void	setLocalScaling(const btVector3& scaling)
+	{
+		btVector3 oldMargin(getMargin(),getMargin(),getMargin());
+		btVector3 implicitShapeDimensionsWithMargin = m_implicitShapeDimensions+oldMargin;
+		btVector3 unScaledImplicitShapeDimensionsWithMargin = implicitShapeDimensionsWithMargin / m_localScaling;
+
+		btConvexInternalShape::setLocalScaling(scaling);
+
+		m_implicitShapeDimensions = (unScaledImplicitShapeDimensionsWithMargin * m_localScaling) - oldMargin;
+
+	}
+
+	//debugging
+	virtual const char*	getName()const
+	{
+		return "CylinderY";
+	}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+};
+
+class btCylinderShapeX : public btCylinderShape
+{
+public:
+	btCylinderShapeX (const btVector3& halfExtents);
+
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+	
+		//debugging
+	virtual const char*	getName()const
+	{
+		return "CylinderX";
+	}
+
+	virtual btScalar getRadius() const
+	{
+		return getHalfExtentsWithMargin().getY();
+	}
+
+};
+
+class btCylinderShapeZ : public btCylinderShape
+{
+public:
+	btCylinderShapeZ (const btVector3& halfExtents);
+
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+
+		//debugging
+	virtual const char*	getName()const
+	{
+		return "CylinderZ";
+	}
+
+	virtual btScalar getRadius() const
+	{
+		return getHalfExtentsWithMargin().getX();
+	}
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btCylinderShapeData
+{
+	btConvexInternalShapeData	m_convexInternalShapeData;
+
+	int	m_upAxis;
+
+	char	m_padding[4];
+};
+
+SIMD_FORCE_INLINE	int	btCylinderShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btCylinderShapeData);
+}
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btCylinderShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btCylinderShapeData* shapeData = (btCylinderShapeData*) dataBuffer;
+	
+	btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData,serializer);
+
+	shapeData->m_upAxis = m_upAxis;
+	
+	return "btCylinderShapeData";
+}
+
+
+
+#endif //BT_CYLINDER_MINKOWSKI_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.cpp
new file mode 100644
index 0000000..a9e6df5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.cpp
@@ -0,0 +1,50 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btEmptyShape.h"
+
+
+#include "btCollisionShape.h"
+
+
+btEmptyShape::btEmptyShape() : btConcaveShape ()
+{
+	m_shapeType = EMPTY_SHAPE_PROXYTYPE;
+}
+
+
+btEmptyShape::~btEmptyShape()
+{
+}
+
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+void btEmptyShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	btVector3 margin(getMargin(),getMargin(),getMargin());
+
+	aabbMin = t.getOrigin() - margin;
+
+	aabbMax = t.getOrigin() + margin;
+
+}
+
+void	btEmptyShape::calculateLocalInertia(btScalar ,btVector3& ) const
+{
+	btAssert(0);
+}
+
+	
+	
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.h
new file mode 100644
index 0000000..87b7b66
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btEmptyShape.h
@@ -0,0 +1,70 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_EMPTY_SHAPE_H
+#define BT_EMPTY_SHAPE_H
+
+#include "btConcaveShape.h"
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "btCollisionMargin.h"
+
+
+
+
+/// The btEmptyShape is a collision shape without actual collision detection shape, so most users should ignore this class.
+/// It can be replaced by another shape during runtime, but the inertia tensor should be recomputed.
+class btEmptyShape	: public btConcaveShape
+{
+public:
+	btEmptyShape();
+
+	virtual ~btEmptyShape();
+
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+
+	virtual void	setLocalScaling(const btVector3& scaling)
+	{
+		m_localScaling = scaling;
+	}
+	virtual const btVector3& getLocalScaling() const 
+	{
+		return m_localScaling;
+	}
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+	
+	virtual const char*	getName()const
+	{
+		return "Empty";
+	}
+
+	virtual void processAllTriangles(btTriangleCallback* ,const btVector3& ,const btVector3& ) const
+	{
+	}
+
+protected:
+	btVector3	m_localScaling;
+
+};
+
+
+
+#endif //BT_EMPTY_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
new file mode 100644
index 0000000..3a1e6f4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
@@ -0,0 +1,411 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btHeightfieldTerrainShape.h"
+
+#include "LinearMath/btTransformUtil.h"
+
+
+
+btHeightfieldTerrainShape::btHeightfieldTerrainShape
+(
+int heightStickWidth, int heightStickLength, void* heightfieldData,
+btScalar heightScale, btScalar minHeight, btScalar maxHeight,int upAxis,
+PHY_ScalarType hdt, bool flipQuadEdges
+)
+{
+	initialize(heightStickWidth, heightStickLength, heightfieldData,
+	           heightScale, minHeight, maxHeight, upAxis, hdt,
+	           flipQuadEdges);
+}
+
+
+
+btHeightfieldTerrainShape::btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength,void* heightfieldData,btScalar maxHeight,int upAxis,bool useFloatData,bool flipQuadEdges)
+{
+	// legacy constructor: support only float or unsigned char,
+	// 	and min height is zero
+	PHY_ScalarType hdt = (useFloatData) ? PHY_FLOAT : PHY_UCHAR;
+	btScalar minHeight = 0.0;
+
+	// previously, height = uchar * maxHeight / 65535.
+	// So to preserve legacy behavior, heightScale = maxHeight / 65535
+	btScalar heightScale = maxHeight / 65535;
+
+	initialize(heightStickWidth, heightStickLength, heightfieldData,
+	           heightScale, minHeight, maxHeight, upAxis, hdt,
+	           flipQuadEdges);
+}
+
+
+
+void btHeightfieldTerrainShape::initialize
+(
+int heightStickWidth, int heightStickLength, void* heightfieldData,
+btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis,
+PHY_ScalarType hdt, bool flipQuadEdges
+)
+{
+	// validation
+	btAssert(heightStickWidth > 1 && "bad width");
+	btAssert(heightStickLength > 1 && "bad length");
+	btAssert(heightfieldData && "null heightfield data");
+	// btAssert(heightScale) -- do we care?  Trust caller here
+	btAssert(minHeight <= maxHeight && "bad min/max height");
+	btAssert(upAxis >= 0 && upAxis < 3 &&
+	    "bad upAxis--should be in range [0,2]");
+	btAssert(hdt != PHY_UCHAR || hdt != PHY_FLOAT || hdt != PHY_SHORT &&
+	    "Bad height data type enum");
+
+	// initialize member variables
+	m_shapeType = TERRAIN_SHAPE_PROXYTYPE;
+	m_heightStickWidth = heightStickWidth;
+	m_heightStickLength = heightStickLength;
+	m_minHeight = minHeight;
+	m_maxHeight = maxHeight;
+	m_width = (btScalar) (heightStickWidth - 1);
+	m_length = (btScalar) (heightStickLength - 1);
+	m_heightScale = heightScale;
+	m_heightfieldDataUnknown = heightfieldData;
+	m_heightDataType = hdt;
+	m_flipQuadEdges = flipQuadEdges;
+	m_useDiamondSubdivision = false;
+	m_upAxis = upAxis;
+	m_localScaling.setValue(btScalar(1.), btScalar(1.), btScalar(1.));
+
+	// determine min/max axis-aligned bounding box (aabb) values
+	switch (m_upAxis)
+	{
+	case 0:
+		{
+			m_localAabbMin.setValue(m_minHeight, 0, 0);
+			m_localAabbMax.setValue(m_maxHeight, m_width, m_length);
+			break;
+		}
+	case 1:
+		{
+			m_localAabbMin.setValue(0, m_minHeight, 0);
+			m_localAabbMax.setValue(m_width, m_maxHeight, m_length);
+			break;
+		};
+	case 2:
+		{
+			m_localAabbMin.setValue(0, 0, m_minHeight);
+			m_localAabbMax.setValue(m_width, m_length, m_maxHeight);
+			break;
+		}
+	default:
+		{
+			//need to get valid m_upAxis
+			btAssert(0 && "Bad m_upAxis");
+		}
+	}
+
+	// remember origin (defined as exact middle of aabb)
+	m_localOrigin = btScalar(0.5) * (m_localAabbMin + m_localAabbMax);
+}
+
+
+
+btHeightfieldTerrainShape::~btHeightfieldTerrainShape()
+{
+}
+
+
+
+void btHeightfieldTerrainShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	btVector3 halfExtents = (m_localAabbMax-m_localAabbMin)* m_localScaling * btScalar(0.5);
+
+	btVector3 localOrigin(0, 0, 0);
+	localOrigin[m_upAxis] = (m_minHeight + m_maxHeight) * btScalar(0.5);
+	localOrigin *= m_localScaling;
+
+	btMatrix3x3 abs_b = t.getBasis().absolute();  
+	btVector3 center = t.getOrigin();
+	btVector3 extent = btVector3(abs_b[0].dot(halfExtents),
+		   abs_b[1].dot(halfExtents),
+		  abs_b[2].dot(halfExtents));
+	extent += btVector3(getMargin(),getMargin(),getMargin());
+
+	aabbMin = center - extent;
+	aabbMax = center + extent;
+}
+
+
+/// This returns the "raw" (user's initial) height, not the actual height.
+/// The actual height needs to be adjusted to be relative to the center
+///   of the heightfield's AABB.
+btScalar
+btHeightfieldTerrainShape::getRawHeightFieldValue(int x,int y) const
+{
+	btScalar val = 0.f;
+	switch (m_heightDataType)
+	{
+	case PHY_FLOAT:
+		{
+			val = m_heightfieldDataFloat[(y*m_heightStickWidth)+x];
+			break;
+		}
+
+	case PHY_UCHAR:
+		{
+			unsigned char heightFieldValue = m_heightfieldDataUnsignedChar[(y*m_heightStickWidth)+x];
+			val = heightFieldValue * m_heightScale;
+			break;
+		}
+
+	case PHY_SHORT:
+		{
+			short hfValue = m_heightfieldDataShort[(y * m_heightStickWidth) + x];
+			val = hfValue * m_heightScale;
+			break;
+		}
+
+	default:
+		{
+			btAssert(!"Bad m_heightDataType");
+		}
+	}
+
+	return val;
+}
+
+
+
+
+/// this returns the vertex in bullet-local coordinates
+void	btHeightfieldTerrainShape::getVertex(int x,int y,btVector3& vertex) const
+{
+	btAssert(x>=0);
+	btAssert(y>=0);
+	btAssert(x<m_heightStickWidth);
+	btAssert(y<m_heightStickLength);
+
+	btScalar	height = getRawHeightFieldValue(x,y);
+
+	switch (m_upAxis)
+	{
+	case 0:
+		{
+		vertex.setValue(
+			height - m_localOrigin.getX(),
+			(-m_width/btScalar(2.0)) + x,
+			(-m_length/btScalar(2.0) ) + y
+			);
+			break;
+		}
+	case 1:
+		{
+			vertex.setValue(
+			(-m_width/btScalar(2.0)) + x,
+			height - m_localOrigin.getY(),
+			(-m_length/btScalar(2.0)) + y
+			);
+			break;
+		};
+	case 2:
+		{
+			vertex.setValue(
+			(-m_width/btScalar(2.0)) + x,
+			(-m_length/btScalar(2.0)) + y,
+			height - m_localOrigin.getZ()
+			);
+			break;
+		}
+	default:
+		{
+			//need to get valid m_upAxis
+			btAssert(0);
+		}
+	}
+
+	vertex*=m_localScaling;
+}
+
+
+
+static inline int
+getQuantized
+(
+btScalar x
+)
+{
+	if (x < 0.0) {
+		return (int) (x - 0.5);
+	}
+	return (int) (x + 0.5);
+}
+
+
+
+/// given input vector, return quantized version
+/**
+  This routine is basically determining the gridpoint indices for a given
+  input vector, answering the question: "which gridpoint is closest to the
+  provided point?".
+
+  "with clamp" means that we restrict the point to be in the heightfield's
+  axis-aligned bounding box.
+ */
+void btHeightfieldTerrainShape::quantizeWithClamp(int* out, const btVector3& point,int /*isMax*/) const
+{
+	btVector3 clampedPoint(point);
+	clampedPoint.setMax(m_localAabbMin);
+	clampedPoint.setMin(m_localAabbMax);
+
+	out[0] = getQuantized(clampedPoint.getX());
+	out[1] = getQuantized(clampedPoint.getY());
+	out[2] = getQuantized(clampedPoint.getZ());
+		
+}
+
+
+
+/// process all triangles within the provided axis-aligned bounding box
+/**
+  basic algorithm:
+    - convert input aabb to local coordinates (scale down and shift for local origin)
+    - convert input aabb to a range of heightfield grid points (quantize)
+    - iterate over all triangles in that subset of the grid
+ */
+void	btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	// scale down the input aabb's so they are in local (non-scaled) coordinates
+	btVector3	localAabbMin = aabbMin*btVector3(1.f/m_localScaling[0],1.f/m_localScaling[1],1.f/m_localScaling[2]);
+	btVector3	localAabbMax = aabbMax*btVector3(1.f/m_localScaling[0],1.f/m_localScaling[1],1.f/m_localScaling[2]);
+
+	// account for local origin
+	localAabbMin += m_localOrigin;
+	localAabbMax += m_localOrigin;
+
+	//quantize the aabbMin and aabbMax, and adjust the start/end ranges
+	int	quantizedAabbMin[3];
+	int	quantizedAabbMax[3];
+	quantizeWithClamp(quantizedAabbMin, localAabbMin,0);
+	quantizeWithClamp(quantizedAabbMax, localAabbMax,1);
+	
+	// expand the min/max quantized values
+	// this is to catch the case where the input aabb falls between grid points!
+	for (int i = 0; i < 3; ++i) {
+		quantizedAabbMin[i]--;
+		quantizedAabbMax[i]++;
+	}	
+
+	int startX=0;
+	int endX=m_heightStickWidth-1;
+	int startJ=0;
+	int endJ=m_heightStickLength-1;
+
+	switch (m_upAxis)
+	{
+	case 0:
+		{
+			if (quantizedAabbMin[1]>startX)
+				startX = quantizedAabbMin[1];
+			if (quantizedAabbMax[1]<endX)
+				endX = quantizedAabbMax[1];
+			if (quantizedAabbMin[2]>startJ)
+				startJ = quantizedAabbMin[2];
+			if (quantizedAabbMax[2]<endJ)
+				endJ = quantizedAabbMax[2];
+			break;
+		}
+	case 1:
+		{
+			if (quantizedAabbMin[0]>startX)
+				startX = quantizedAabbMin[0];
+			if (quantizedAabbMax[0]<endX)
+				endX = quantizedAabbMax[0];
+			if (quantizedAabbMin[2]>startJ)
+				startJ = quantizedAabbMin[2];
+			if (quantizedAabbMax[2]<endJ)
+				endJ = quantizedAabbMax[2];
+			break;
+		};
+	case 2:
+		{
+			if (quantizedAabbMin[0]>startX)
+				startX = quantizedAabbMin[0];
+			if (quantizedAabbMax[0]<endX)
+				endX = quantizedAabbMax[0];
+			if (quantizedAabbMin[1]>startJ)
+				startJ = quantizedAabbMin[1];
+			if (quantizedAabbMax[1]<endJ)
+				endJ = quantizedAabbMax[1];
+			break;
+		}
+	default:
+		{
+			//need to get valid m_upAxis
+			btAssert(0);
+		}
+	}
+
+	
+  
+
+	for(int j=startJ; j<endJ; j++)
+	{
+		for(int x=startX; x<endX; x++)
+		{
+			btVector3 vertices[3];
+			if (m_flipQuadEdges || (m_useDiamondSubdivision && !((j+x) & 1)))
+			{
+        //first triangle
+        getVertex(x,j,vertices[0]);
+        getVertex(x+1,j,vertices[1]);
+        getVertex(x+1,j+1,vertices[2]);
+        callback->processTriangle(vertices,x,j);
+        //second triangle
+        getVertex(x,j,vertices[0]);
+        getVertex(x+1,j+1,vertices[1]);
+        getVertex(x,j+1,vertices[2]);
+        callback->processTriangle(vertices,x,j);				
+			} else
+			{
+        //first triangle
+        getVertex(x,j,vertices[0]);
+        getVertex(x,j+1,vertices[1]);
+        getVertex(x+1,j,vertices[2]);
+        callback->processTriangle(vertices,x,j);
+        //second triangle
+        getVertex(x+1,j,vertices[0]);
+        getVertex(x,j+1,vertices[1]);
+        getVertex(x+1,j+1,vertices[2]);
+        callback->processTriangle(vertices,x,j);
+			}
+		}
+	}
+
+	
+
+}
+
+void	btHeightfieldTerrainShape::calculateLocalInertia(btScalar ,btVector3& inertia) const
+{
+	//moving concave objects not supported
+	
+	inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+}
+
+void	btHeightfieldTerrainShape::setLocalScaling(const btVector3& scaling)
+{
+	m_localScaling = scaling;
+}
+const btVector3& btHeightfieldTerrainShape::getLocalScaling() const
+{
+	return m_localScaling;
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h
new file mode 100644
index 0000000..710c29e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h
@@ -0,0 +1,161 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_HEIGHTFIELD_TERRAIN_SHAPE_H
+#define BT_HEIGHTFIELD_TERRAIN_SHAPE_H
+
+#include "btConcaveShape.h"
+
+///btHeightfieldTerrainShape simulates a 2D heightfield terrain
+/**
+  The caller is responsible for maintaining the heightfield array; this
+  class does not make a copy.
+
+  The heightfield can be dynamic so long as the min/max height values
+  capture the extremes (heights must always be in that range).
+
+  The local origin of the heightfield is assumed to be the exact
+  center (as determined by width and length and height, with each
+  axis multiplied by the localScaling).
+
+  \b NOTE: be careful with coordinates.  If you have a heightfield with a local
+  min height of -100m, and a max height of +500m, you may be tempted to place it
+  at the origin (0,0) and expect the heights in world coordinates to be
+  -100 to +500 meters.
+  Actually, the heights will be -300 to +300m, because bullet will re-center
+  the heightfield based on its AABB (which is determined by the min/max
+  heights).  So keep in mind that once you create a btHeightfieldTerrainShape
+  object, the heights will be adjusted relative to the center of the AABB.  This
+  is different to the behavior of many rendering engines, but is useful for
+  physics engines.
+
+  Most (but not all) rendering and heightfield libraries assume upAxis = 1
+  (that is, the y-axis is "up").  This class allows any of the 3 coordinates
+  to be "up".  Make sure your choice of axis is consistent with your rendering
+  system.
+
+  The heightfield heights are determined from the data type used for the
+  heightfieldData array.  
+
+   - PHY_UCHAR: height at a point is the uchar value at the
+       grid point, multipled by heightScale.  uchar isn't recommended
+       because of its inability to deal with negative values, and
+       low resolution (8-bit).
+
+   - PHY_SHORT: height at a point is the short int value at that grid
+       point, multipled by heightScale.
+
+   - PHY_FLOAT: height at a point is the float value at that grid
+       point.  heightScale is ignored when using the float heightfield
+       data type.
+
+  Whatever the caller specifies as minHeight and maxHeight will be honored.
+  The class will not inspect the heightfield to discover the actual minimum
+  or maximum heights.  These values are used to determine the heightfield's
+  axis-aligned bounding box, multiplied by localScaling.
+
+  For usage and testing see the TerrainDemo.
+ */
+class btHeightfieldTerrainShape : public btConcaveShape
+{
+protected:
+	btVector3	m_localAabbMin;
+	btVector3	m_localAabbMax;
+	btVector3	m_localOrigin;
+
+	///terrain data
+	int	m_heightStickWidth;
+	int m_heightStickLength;
+	btScalar	m_minHeight;
+	btScalar	m_maxHeight;
+	btScalar m_width;
+	btScalar m_length;
+	btScalar m_heightScale;
+	union
+	{
+		unsigned char*	m_heightfieldDataUnsignedChar;
+		short*		m_heightfieldDataShort;
+		btScalar*			m_heightfieldDataFloat;
+		void*			m_heightfieldDataUnknown;
+	};
+
+	PHY_ScalarType	m_heightDataType;	
+	bool	m_flipQuadEdges;
+  bool  m_useDiamondSubdivision;
+
+	int	m_upAxis;
+	
+	btVector3	m_localScaling;
+
+	virtual btScalar	getRawHeightFieldValue(int x,int y) const;
+	void		quantizeWithClamp(int* out, const btVector3& point,int isMax) const;
+	void		getVertex(int x,int y,btVector3& vertex) const;
+
+
+
+	/// protected initialization
+	/**
+	  Handles the work of constructors so that public constructors can be
+	  backwards-compatible without a lot of copy/paste.
+	 */
+	void initialize(int heightStickWidth, int heightStickLength,
+	                void* heightfieldData, btScalar heightScale,
+	                btScalar minHeight, btScalar maxHeight, int upAxis,
+	                PHY_ScalarType heightDataType, bool flipQuadEdges);
+
+public:
+	/// preferred constructor
+	/**
+	  This constructor supports a range of heightfield
+	  data types, and allows for a non-zero minimum height value.
+	  heightScale is needed for any integer-based heightfield data types.
+	 */
+	btHeightfieldTerrainShape(int heightStickWidth,int heightStickLength,
+	                          void* heightfieldData, btScalar heightScale,
+	                          btScalar minHeight, btScalar maxHeight,
+	                          int upAxis, PHY_ScalarType heightDataType,
+	                          bool flipQuadEdges);
+
+	/// legacy constructor
+	/**
+	  The legacy constructor assumes the heightfield has a minimum height
+	  of zero.  Only unsigned char or floats are supported.  For legacy
+	  compatibility reasons, heightScale is calculated as maxHeight / 65535 
+	  (and is only used when useFloatData = false).
+ 	 */
+	btHeightfieldTerrainShape(int heightStickWidth,int heightStickLength,void* heightfieldData, btScalar maxHeight,int upAxis,bool useFloatData,bool flipQuadEdges);
+
+	virtual ~btHeightfieldTerrainShape();
+
+
+	void setUseDiamondSubdivision(bool useDiamondSubdivision=true) { m_useDiamondSubdivision = useDiamondSubdivision;}
+
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual void	setLocalScaling(const btVector3& scaling);
+	
+	virtual const btVector3& getLocalScaling() const;
+	
+	//debugging
+	virtual const char*	getName()const {return "HEIGHTFIELD";}
+
+};
+
+#endif //BT_HEIGHTFIELD_TERRAIN_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMaterial.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMaterial.h
new file mode 100644
index 0000000..866f9b4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMaterial.h
@@ -0,0 +1,35 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/// This file was created by Alex Silverman
+
+#ifndef BT_MATERIAL_H
+#define BT_MATERIAL_H
+
+// Material class to be used by btMultimaterialTriangleMeshShape to store triangle properties
+class btMaterial
+{
+    // public members so that materials can change due to world events
+public:
+    btScalar m_friction;
+    btScalar m_restitution;
+    int pad[2];
+
+    btMaterial(){}
+    btMaterial(btScalar fric, btScalar rest) { m_friction = fric; m_restitution = rest; }
+};
+
+#endif // BT_MATERIAL_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
new file mode 100644
index 0000000..06707e2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
@@ -0,0 +1,60 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btMinkowskiSumShape.h"
+
+
+btMinkowskiSumShape::btMinkowskiSumShape(const btConvexShape* shapeA,const btConvexShape* shapeB)
+: btConvexInternalShape (),
+m_shapeA(shapeA),
+m_shapeB(shapeB)
+{
+	m_shapeType = MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE;
+	m_transA.setIdentity();
+	m_transB.setIdentity();
+}
+
+btVector3 btMinkowskiSumShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+{
+	btVector3 supVertexA = m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(vec*m_transA.getBasis()));
+	btVector3 supVertexB = m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(-vec*m_transB.getBasis()));
+	return  supVertexA - supVertexB;
+}
+
+void	btMinkowskiSumShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	///@todo: could make recursive use of batching. probably this shape is not used frequently.
+	for (int i=0;i<numVectors;i++)
+	{
+		supportVerticesOut[i] = localGetSupportingVertexWithoutMargin(vectors[i]);
+	}
+
+}
+
+
+
+btScalar	btMinkowskiSumShape::getMargin() const
+{
+	return m_shapeA->getMargin() + m_shapeB->getMargin();
+}
+
+
+void	btMinkowskiSumShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	(void)mass;
+	btAssert(0);
+	inertia.setValue(0,0,0);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h
new file mode 100644
index 0000000..6c844e8
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h
@@ -0,0 +1,60 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_MINKOWSKI_SUM_SHAPE_H
+#define BT_MINKOWSKI_SUM_SHAPE_H
+
+#include "btConvexInternalShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+
+/// The btMinkowskiSumShape is only for advanced users. This shape represents implicit based minkowski sum of two convex implicit shapes.
+class btMinkowskiSumShape : public btConvexInternalShape
+{
+
+	btTransform	m_transA;
+	btTransform	m_transB;
+	const btConvexShape*	m_shapeA;
+	const btConvexShape*	m_shapeB;
+
+public:
+
+	btMinkowskiSumShape(const btConvexShape* shapeA,const btConvexShape* shapeB);
+
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	void	setTransformA(const btTransform&	transA) { m_transA = transA;}
+	void	setTransformB(const btTransform&	transB) { m_transB = transB;}
+
+	const btTransform& getTransformA()const  { return m_transA;}
+	const btTransform& GetTransformB()const  { return m_transB;}
+
+
+	virtual btScalar	getMargin() const;
+
+	const btConvexShape*	getShapeA() const { return m_shapeA;}
+	const btConvexShape*	getShapeB() const { return m_shapeB;}
+
+	virtual const char*	getName()const 
+	{
+		return "MinkowskiSum";
+	}
+};
+
+#endif //BT_MINKOWSKI_SUM_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp
new file mode 100644
index 0000000..c996bfc
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp
@@ -0,0 +1,167 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#include "btMultiSphereShape.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+#include "LinearMath/btQuaternion.h"
+#include "LinearMath/btSerializer.h"
+
+btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres)
+:btConvexInternalAabbCachingShape ()
+{
+	m_shapeType = MULTI_SPHERE_SHAPE_PROXYTYPE;
+	//btScalar startMargin = btScalar(BT_LARGE_FLOAT);
+
+	m_localPositionArray.resize(numSpheres);
+	m_radiArray.resize(numSpheres);
+	for (int i=0;i<numSpheres;i++)
+	{
+		m_localPositionArray[i] = positions[i];
+		m_radiArray[i] = radi[i];
+		
+	}
+
+	recalcLocalAabb();
+
+}
+
+ 
+ btVector3	btMultiSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
+{
+	int i;
+	btVector3 supVec(0,0,0);
+
+	btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
+
+
+	btVector3 vec = vec0;
+	btScalar lenSqr = vec.length2();
+	if (lenSqr < (SIMD_EPSILON*SIMD_EPSILON))
+	{
+		vec.setValue(1,0,0);
+	} else
+	{
+		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
+		vec *= rlen;
+	}
+
+	btVector3 vtx;
+	btScalar newDot;
+
+	const btVector3* pos = &m_localPositionArray[0];
+	const btScalar* rad = &m_radiArray[0];
+	int numSpheres = m_localPositionArray.size();
+
+	for (i=0;i<numSpheres;i++)
+	{
+		vtx = (*pos) +vec*m_localScaling*(*rad) - vec * getMargin();
+		pos++;
+		rad++;
+		newDot = vec.dot(vtx);
+		if (newDot > maxDot)
+		{
+			maxDot = newDot;
+			supVec = vtx;
+		}
+	}
+
+	return supVec;
+
+}
+
+ void	btMultiSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+
+	for (int j=0;j<numVectors;j++)
+	{
+		btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
+
+		const btVector3& vec = vectors[j];
+
+		btVector3 vtx;
+		btScalar newDot;
+
+		const btVector3* pos = &m_localPositionArray[0];
+		const btScalar* rad = &m_radiArray[0];
+		int numSpheres = m_localPositionArray.size();
+		for (int i=0;i<numSpheres;i++)
+		{
+			vtx = (*pos) +vec*m_localScaling*(*rad) - vec * getMargin();
+			pos++;
+			rad++;
+			newDot = vec.dot(vtx);
+			if (newDot > maxDot)
+			{
+				maxDot = newDot;
+				supportVerticesOut[j] = vtx;
+			}
+		}
+	}
+}
+
+
+
+
+
+
+
+
+void	btMultiSphereShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	//as an approximation, take the inertia of the box that bounds the spheres
+
+	btVector3 localAabbMin,localAabbMax;
+	getCachedLocalAabb(localAabbMin,localAabbMax);
+	btVector3 halfExtents = (localAabbMax-localAabbMin)*btScalar(0.5);
+
+	btScalar lx=btScalar(2.)*(halfExtents.x());
+	btScalar ly=btScalar(2.)*(halfExtents.y());
+	btScalar lz=btScalar(2.)*(halfExtents.z());
+
+	inertia.setValue(mass/(btScalar(12.0)) * (ly*ly + lz*lz),
+					mass/(btScalar(12.0)) * (lx*lx + lz*lz),
+					mass/(btScalar(12.0)) * (lx*lx + ly*ly));
+
+}
+
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btMultiSphereShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btMultiSphereShapeData* shapeData = (btMultiSphereShapeData*) dataBuffer;
+	btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer);
+
+	int numElem = m_localPositionArray.size();
+	shapeData->m_localPositionArrayPtr = numElem ? (btPositionAndRadius*)serializer->getUniquePointer((void*)&m_localPositionArray[0]):  0;
+	
+	shapeData->m_localPositionArraySize = numElem;
+	if (numElem)
+	{
+		btChunk* chunk = serializer->allocate(sizeof(btPositionAndRadius),numElem);
+		btPositionAndRadius* memPtr = (btPositionAndRadius*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			m_localPositionArray[i].serializeFloat(memPtr->m_pos);
+			memPtr->m_radius = float(m_radiArray[i]);
+		}
+		serializer->finalizeChunk(chunk,"btPositionAndRadius",BT_ARRAY_CODE,(void*)&m_localPositionArray[0]);
+	}
+	
+	return "btMultiSphereShapeData";
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h
new file mode 100644
index 0000000..06c5d16
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultiSphereShape.h
@@ -0,0 +1,99 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_MULTI_SPHERE_MINKOWSKI_H
+#define BT_MULTI_SPHERE_MINKOWSKI_H
+
+#include "btConvexInternalShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+#include "LinearMath/btAlignedObjectArray.h"
+#include "LinearMath/btAabbUtil2.h"
+
+
+
+///The btMultiSphereShape represents the convex hull of a collection of spheres. You can create special capsules or other smooth volumes.
+///It is possible to animate the spheres for deformation, but call 'recalcLocalAabb' after changing any sphere position/radius
+class btMultiSphereShape : public btConvexInternalAabbCachingShape
+{
+	
+	btAlignedObjectArray<btVector3> m_localPositionArray;
+	btAlignedObjectArray<btScalar>  m_radiArray;
+	
+public:
+	btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres);
+
+	///CollisionShape Interface
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	/// btConvexShape Interface
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+	
+	int	getSphereCount() const
+	{
+		return m_localPositionArray.size();
+	}
+
+	const btVector3&	getSpherePosition(int index) const
+	{
+		return m_localPositionArray[index];
+	}
+
+	btScalar	getSphereRadius(int index) const
+	{
+		return m_radiArray[index];
+	}
+
+
+	virtual const char*	getName()const 
+	{
+		return "MultiSphere";
+	}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+
+};
+
+
+struct	btPositionAndRadius
+{
+	btVector3FloatData	m_pos;
+	float		m_radius;
+};
+
+struct	btMultiSphereShapeData
+{
+	btConvexInternalShapeData	m_convexInternalShapeData;
+
+	btPositionAndRadius	*m_localPositionArrayPtr;
+	int				m_localPositionArraySize;
+	char	m_padding[4];
+};
+
+
+
+SIMD_FORCE_INLINE	int	btMultiSphereShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btMultiSphereShapeData);
+}
+
+
+
+#endif //BT_MULTI_SPHERE_MINKOWSKI_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp
new file mode 100644
index 0000000..58799ac
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp
@@ -0,0 +1,45 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/// This file was created by Alex Silverman
+
+#include "BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h"
+//#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
+
+
+///Obtains the material for a specific triangle
+const btMaterial * btMultimaterialTriangleMeshShape::getMaterialProperties(int partID, int triIndex)
+{
+    const unsigned char * materialBase = 0;
+    int numMaterials;
+    PHY_ScalarType materialType;
+    int materialStride;
+    const unsigned char * triangleMaterialBase = 0;
+    int numTriangles;
+    int triangleMaterialStride;
+    PHY_ScalarType triangleType;
+
+    ((btTriangleIndexVertexMaterialArray*)m_meshInterface)->getLockedReadOnlyMaterialBase(&materialBase, numMaterials, materialType, materialStride,
+        &triangleMaterialBase, numTriangles, triangleMaterialStride, triangleType, partID);
+
+    // return the pointer to the place with the friction for the triangle
+    // TODO: This depends on whether it's a moving mesh or not
+    // BUG IN GIMPACT
+    //return (btScalar*)(&materialBase[triangleMaterialBase[(triIndex-1) * triangleMaterialStride] * materialStride]);
+    int * matInd = (int *)(&(triangleMaterialBase[(triIndex * triangleMaterialStride)]));
+    btMaterial *matVal = (btMaterial *)(&(materialBase[*matInd * materialStride]));
+    return (matVal);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h
new file mode 100644
index 0000000..2b92ab7
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h
@@ -0,0 +1,120 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/// This file was created by Alex Silverman
+
+#ifndef BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
+#define BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
+
+#include "btBvhTriangleMeshShape.h"
+#include "btMaterial.h"
+
+///The BvhTriangleMaterialMeshShape extends the btBvhTriangleMeshShape. Its main contribution is the interface into a material array, which allows per-triangle friction and restitution.
+ATTRIBUTE_ALIGNED16(class) btMultimaterialTriangleMeshShape : public btBvhTriangleMeshShape
+{
+    btAlignedObjectArray <btMaterial*> m_materialList;
+    int ** m_triangleMaterials;
+
+public:
+
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+    btMultimaterialTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression, bool buildBvh = true):
+        btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, buildBvh)
+        {
+            m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;
+
+            const unsigned char *vertexbase;
+            int numverts;
+            PHY_ScalarType type;
+            int stride;
+            const unsigned char *indexbase;
+            int indexstride;
+            int numfaces;
+            PHY_ScalarType indicestype;
+
+            //m_materialLookup = (int**)(btAlignedAlloc(sizeof(int*) * meshInterface->getNumSubParts(), 16));
+
+            for(int i = 0; i < meshInterface->getNumSubParts(); i++)
+            {
+                m_meshInterface->getLockedReadOnlyVertexIndexBase(
+                    &vertexbase,
+                    numverts,
+                    type,
+                    stride,
+                    &indexbase,
+                    indexstride,
+                    numfaces,
+                    indicestype,
+                    i);
+                //m_materialLookup[i] = (int*)(btAlignedAlloc(sizeof(int) * numfaces, 16));
+            }
+        }
+
+	///optionally pass in a larger bvh aabb, used for quantization. This allows for deformations within this aabb
+	btMultimaterialTriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression,const btVector3& bvhAabbMin,const btVector3& bvhAabbMax, bool buildBvh = true):
+        btBvhTriangleMeshShape(meshInterface, useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax, buildBvh)
+        {
+            m_shapeType = MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE;
+
+            const unsigned char *vertexbase;
+            int numverts;
+            PHY_ScalarType type;
+            int stride;
+            const unsigned char *indexbase;
+            int indexstride;
+            int numfaces;
+            PHY_ScalarType indicestype;
+
+            //m_materialLookup = (int**)(btAlignedAlloc(sizeof(int*) * meshInterface->getNumSubParts(), 16));
+
+            for(int i = 0; i < meshInterface->getNumSubParts(); i++)
+            {
+                m_meshInterface->getLockedReadOnlyVertexIndexBase(
+                    &vertexbase,
+                    numverts,
+                    type,
+                    stride,
+                    &indexbase,
+                    indexstride,
+                    numfaces,
+                    indicestype,
+                    i);
+                //m_materialLookup[i] = (int*)(btAlignedAlloc(sizeof(int) * numfaces * 2, 16));
+            }
+        }
+	
+    virtual ~btMultimaterialTriangleMeshShape()
+    {
+/*
+        for(int i = 0; i < m_meshInterface->getNumSubParts(); i++)
+        {
+            btAlignedFree(m_materialValues[i]);
+            m_materialLookup[i] = NULL;
+        }
+        btAlignedFree(m_materialValues);
+        m_materialLookup = NULL;
+*/
+    }
+	//debugging
+	virtual const char*	getName()const {return "MULTIMATERIALTRIANGLEMESH";}
+
+    ///Obtains the material for a specific triangle
+    const btMaterial * getMaterialProperties(int partID, int triIndex);
+
+}
+;
+
+#endif //BT_BVH_TRIANGLE_MATERIAL_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp
new file mode 100644
index 0000000..981b8a2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp
@@ -0,0 +1,391 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btOptimizedBvh.h"
+#include "btStridingMeshInterface.h"
+#include "LinearMath/btAabbUtil2.h"
+#include "LinearMath/btIDebugDraw.h"
+
+
+btOptimizedBvh::btOptimizedBvh()
+{ 
+}
+
+btOptimizedBvh::~btOptimizedBvh()
+{
+}
+
+
+void btOptimizedBvh::build(btStridingMeshInterface* triangles, bool useQuantizedAabbCompression, const btVector3& bvhAabbMin, const btVector3& bvhAabbMax)
+{
+	m_useQuantization = useQuantizedAabbCompression;
+
+
+	// NodeArray	triangleNodes;
+
+	struct	NodeTriangleCallback : public btInternalTriangleIndexCallback
+	{
+
+		NodeArray&	m_triangleNodes;
+
+		NodeTriangleCallback& operator=(NodeTriangleCallback& other)
+		{
+			m_triangleNodes = other.m_triangleNodes;
+			return *this;
+		}
+		
+		NodeTriangleCallback(NodeArray&	triangleNodes)
+			:m_triangleNodes(triangleNodes)
+		{
+		}
+
+		virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
+		{
+			btOptimizedBvhNode node;
+			btVector3	aabbMin,aabbMax;
+			aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+			aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)); 
+			aabbMin.setMin(triangle[0]);
+			aabbMax.setMax(triangle[0]);
+			aabbMin.setMin(triangle[1]);
+			aabbMax.setMax(triangle[1]);
+			aabbMin.setMin(triangle[2]);
+			aabbMax.setMax(triangle[2]);
+
+			//with quantization?
+			node.m_aabbMinOrg = aabbMin;
+			node.m_aabbMaxOrg = aabbMax;
+
+			node.m_escapeIndex = -1;
+	
+			//for child nodes
+			node.m_subPart = partId;
+			node.m_triangleIndex = triangleIndex;
+			m_triangleNodes.push_back(node);
+		}
+	};
+	struct	QuantizedNodeTriangleCallback : public btInternalTriangleIndexCallback
+	{
+		QuantizedNodeArray&	m_triangleNodes;
+		const btQuantizedBvh* m_optimizedTree; // for quantization
+
+		QuantizedNodeTriangleCallback& operator=(QuantizedNodeTriangleCallback& other)
+		{
+			m_triangleNodes = other.m_triangleNodes;
+			m_optimizedTree = other.m_optimizedTree;
+			return *this;
+		}
+
+		QuantizedNodeTriangleCallback(QuantizedNodeArray&	triangleNodes,const btQuantizedBvh* tree)
+			:m_triangleNodes(triangleNodes),m_optimizedTree(tree)
+		{
+		}
+
+		virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
+		{
+			// The partId and triangle index must fit in the same (positive) integer
+			btAssert(partId < (1<<MAX_NUM_PARTS_IN_BITS));
+			btAssert(triangleIndex < (1<<(31-MAX_NUM_PARTS_IN_BITS)));
+			//negative indices are reserved for escapeIndex
+			btAssert(triangleIndex>=0);
+
+			btQuantizedBvhNode node;
+			btVector3	aabbMin,aabbMax;
+			aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+			aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)); 
+			aabbMin.setMin(triangle[0]);
+			aabbMax.setMax(triangle[0]);
+			aabbMin.setMin(triangle[1]);
+			aabbMax.setMax(triangle[1]);
+			aabbMin.setMin(triangle[2]);
+			aabbMax.setMax(triangle[2]);
+
+			//PCK: add these checks for zero dimensions of aabb
+			const btScalar MIN_AABB_DIMENSION = btScalar(0.002);
+			const btScalar MIN_AABB_HALF_DIMENSION = btScalar(0.001);
+			if (aabbMax.x() - aabbMin.x() < MIN_AABB_DIMENSION)
+			{
+				aabbMax.setX(aabbMax.x() + MIN_AABB_HALF_DIMENSION);
+				aabbMin.setX(aabbMin.x() - MIN_AABB_HALF_DIMENSION);
+			}
+			if (aabbMax.y() - aabbMin.y() < MIN_AABB_DIMENSION)
+			{
+				aabbMax.setY(aabbMax.y() + MIN_AABB_HALF_DIMENSION);
+				aabbMin.setY(aabbMin.y() - MIN_AABB_HALF_DIMENSION);
+			}
+			if (aabbMax.z() - aabbMin.z() < MIN_AABB_DIMENSION)
+			{
+				aabbMax.setZ(aabbMax.z() + MIN_AABB_HALF_DIMENSION);
+				aabbMin.setZ(aabbMin.z() - MIN_AABB_HALF_DIMENSION);
+			}
+
+			m_optimizedTree->quantize(&node.m_quantizedAabbMin[0],aabbMin,0);
+			m_optimizedTree->quantize(&node.m_quantizedAabbMax[0],aabbMax,1);
+
+			node.m_escapeIndexOrTriangleIndex = (partId<<(31-MAX_NUM_PARTS_IN_BITS)) | triangleIndex;
+
+			m_triangleNodes.push_back(node);
+		}
+	};
+	
+
+
+	int numLeafNodes = 0;
+
+	
+	if (m_useQuantization)
+	{
+
+		//initialize quantization values
+		setQuantizationValues(bvhAabbMin,bvhAabbMax);
+
+		QuantizedNodeTriangleCallback	callback(m_quantizedLeafNodes,this);
+
+	
+		triangles->InternalProcessAllTriangles(&callback,m_bvhAabbMin,m_bvhAabbMax);
+
+		//now we have an array of leafnodes in m_leafNodes
+		numLeafNodes = m_quantizedLeafNodes.size();
+
+
+		m_quantizedContiguousNodes.resize(2*numLeafNodes);
+
+
+	} else
+	{
+		NodeTriangleCallback	callback(m_leafNodes);
+
+		btVector3 aabbMin(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
+		btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+
+		triangles->InternalProcessAllTriangles(&callback,aabbMin,aabbMax);
+
+		//now we have an array of leafnodes in m_leafNodes
+		numLeafNodes = m_leafNodes.size();
+
+		m_contiguousNodes.resize(2*numLeafNodes);
+	}
+
+	m_curNodeIndex = 0;
+
+	buildTree(0,numLeafNodes);
+
+	///if the entire tree is small then subtree size, we need to create a header info for the tree
+	if(m_useQuantization && !m_SubtreeHeaders.size())
+	{
+		btBvhSubtreeInfo& subtree = m_SubtreeHeaders.expand();
+		subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[0]);
+		subtree.m_rootNodeIndex = 0;
+		subtree.m_subtreeSize = m_quantizedContiguousNodes[0].isLeafNode() ? 1 : m_quantizedContiguousNodes[0].getEscapeIndex();
+	}
+
+	//PCK: update the copy of the size
+	m_subtreeHeaderCount = m_SubtreeHeaders.size();
+
+	//PCK: clear m_quantizedLeafNodes and m_leafNodes, they are temporary
+	m_quantizedLeafNodes.clear();
+	m_leafNodes.clear();
+}
+
+
+
+
+void	btOptimizedBvh::refit(btStridingMeshInterface* meshInterface,const btVector3& aabbMin,const btVector3& aabbMax)
+{
+	if (m_useQuantization)
+	{
+
+		setQuantizationValues(aabbMin,aabbMax);
+
+		updateBvhNodes(meshInterface,0,m_curNodeIndex,0);
+
+		///now update all subtree headers
+
+		int i;
+		for (i=0;i<m_SubtreeHeaders.size();i++)
+		{
+			btBvhSubtreeInfo& subtree = m_SubtreeHeaders[i];
+			subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[subtree.m_rootNodeIndex]);
+		}
+
+	} else
+	{
+
+	}
+}
+
+
+
+
+void	btOptimizedBvh::refitPartial(btStridingMeshInterface* meshInterface,const btVector3& aabbMin,const btVector3& aabbMax)
+{
+	//incrementally initialize quantization values
+	btAssert(m_useQuantization);
+
+	btAssert(aabbMin.getX() > m_bvhAabbMin.getX());
+	btAssert(aabbMin.getY() > m_bvhAabbMin.getY());
+	btAssert(aabbMin.getZ() > m_bvhAabbMin.getZ());
+
+	btAssert(aabbMax.getX() < m_bvhAabbMax.getX());
+	btAssert(aabbMax.getY() < m_bvhAabbMax.getY());
+	btAssert(aabbMax.getZ() < m_bvhAabbMax.getZ());
+
+	///we should update all quantization values, using updateBvhNodes(meshInterface);
+	///but we only update chunks that overlap the given aabb
+	
+	unsigned short	quantizedQueryAabbMin[3];
+	unsigned short	quantizedQueryAabbMax[3];
+
+	quantize(&quantizedQueryAabbMin[0],aabbMin,0);
+	quantize(&quantizedQueryAabbMax[0],aabbMax,1);
+
+	int i;
+	for (i=0;i<this->m_SubtreeHeaders.size();i++)
+	{
+		btBvhSubtreeInfo& subtree = m_SubtreeHeaders[i];
+
+		//PCK: unsigned instead of bool
+		unsigned overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
+		if (overlap != 0)
+		{
+			updateBvhNodes(meshInterface,subtree.m_rootNodeIndex,subtree.m_rootNodeIndex+subtree.m_subtreeSize,i);
+
+			subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[subtree.m_rootNodeIndex]);
+		}
+	}
+	
+}
+
+void	btOptimizedBvh::updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index)
+{
+	(void)index;
+
+	btAssert(m_useQuantization);
+
+	int curNodeSubPart=-1;
+
+	//get access info to trianglemesh data
+		const unsigned char *vertexbase = 0;
+		int numverts = 0;
+		PHY_ScalarType type = PHY_INTEGER;
+		int stride = 0;
+		const unsigned char *indexbase = 0;
+		int indexstride = 0;
+		int numfaces = 0;
+		PHY_ScalarType indicestype = PHY_INTEGER;
+
+		btVector3	triangleVerts[3];
+		btVector3	aabbMin,aabbMax;
+		const btVector3& meshScaling = meshInterface->getScaling();
+		
+		int i;
+		for (i=endNode-1;i>=firstNode;i--)
+		{
+
+
+			btQuantizedBvhNode& curNode = m_quantizedContiguousNodes[i];
+			if (curNode.isLeafNode())
+			{
+				//recalc aabb from triangle data
+				int nodeSubPart = curNode.getPartId();
+				int nodeTriangleIndex = curNode.getTriangleIndex();
+				if (nodeSubPart != curNodeSubPart)
+				{
+					if (curNodeSubPart >= 0)
+						meshInterface->unLockReadOnlyVertexBase(curNodeSubPart);
+					meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,	type,stride,&indexbase,indexstride,numfaces,indicestype,nodeSubPart);
+
+					curNodeSubPart = nodeSubPart;
+					btAssert(indicestype==PHY_INTEGER||indicestype==PHY_SHORT);
+				}
+				//triangles->getLockedReadOnlyVertexIndexBase(vertexBase,numVerts,
+
+				unsigned int* gfxbase = (unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
+				
+				
+				for (int j=2;j>=0;j--)
+				{
+					
+					int graphicsindex = indicestype==PHY_SHORT?((unsigned short*)gfxbase)[j]:gfxbase[j];
+					if (type == PHY_FLOAT)
+					{
+						float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
+						triangleVerts[j] = btVector3(
+							graphicsbase[0]*meshScaling.getX(),
+							graphicsbase[1]*meshScaling.getY(),
+							graphicsbase[2]*meshScaling.getZ());
+					}
+					else
+					{
+						double* graphicsbase = (double*)(vertexbase+graphicsindex*stride);
+						triangleVerts[j] = btVector3( btScalar(graphicsbase[0]*meshScaling.getX()), btScalar(graphicsbase[1]*meshScaling.getY()), btScalar(graphicsbase[2]*meshScaling.getZ()));
+					}
+				}
+
+
+				
+				aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+				aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)); 
+				aabbMin.setMin(triangleVerts[0]);
+				aabbMax.setMax(triangleVerts[0]);
+				aabbMin.setMin(triangleVerts[1]);
+				aabbMax.setMax(triangleVerts[1]);
+				aabbMin.setMin(triangleVerts[2]);
+				aabbMax.setMax(triangleVerts[2]);
+
+				quantize(&curNode.m_quantizedAabbMin[0],aabbMin,0);
+				quantize(&curNode.m_quantizedAabbMax[0],aabbMax,1);
+				
+			} else
+			{
+				//combine aabb from both children
+
+				btQuantizedBvhNode* leftChildNode = &m_quantizedContiguousNodes[i+1];
+				
+				btQuantizedBvhNode* rightChildNode = leftChildNode->isLeafNode() ? &m_quantizedContiguousNodes[i+2] :
+					&m_quantizedContiguousNodes[i+1+leftChildNode->getEscapeIndex()];
+				
+
+				{
+					for (int i=0;i<3;i++)
+					{
+						curNode.m_quantizedAabbMin[i] = leftChildNode->m_quantizedAabbMin[i];
+						if (curNode.m_quantizedAabbMin[i]>rightChildNode->m_quantizedAabbMin[i])
+							curNode.m_quantizedAabbMin[i]=rightChildNode->m_quantizedAabbMin[i];
+
+						curNode.m_quantizedAabbMax[i] = leftChildNode->m_quantizedAabbMax[i];
+						if (curNode.m_quantizedAabbMax[i] < rightChildNode->m_quantizedAabbMax[i])
+							curNode.m_quantizedAabbMax[i] = rightChildNode->m_quantizedAabbMax[i];
+					}
+				}
+			}
+
+		}
+
+		if (curNodeSubPart >= 0)
+			meshInterface->unLockReadOnlyVertexBase(curNodeSubPart);
+
+		
+}
+
+///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'
+btOptimizedBvh* btOptimizedBvh::deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian)
+{
+	btQuantizedBvh* bvh = btQuantizedBvh::deSerializeInPlace(i_alignedDataBuffer,i_dataBufferSize,i_swapEndian);
+	
+	//we don't add additional data so just do a static upcast
+	return static_cast<btOptimizedBvh*>(bvh);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h
new file mode 100644
index 0000000..715961f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btOptimizedBvh.h
@@ -0,0 +1,65 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///Contains contributions from Disney Studio's
+
+#ifndef BT_OPTIMIZED_BVH_H
+#define BT_OPTIMIZED_BVH_H
+
+#include "BulletCollision/BroadphaseCollision/btQuantizedBvh.h"
+
+class btStridingMeshInterface;
+
+
+///The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes, through the btStridingMeshInterface.
+ATTRIBUTE_ALIGNED16(class) btOptimizedBvh : public btQuantizedBvh
+{
+	
+public:
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+protected:
+
+public:
+
+	btOptimizedBvh();
+
+	virtual ~btOptimizedBvh();
+
+	void	build(btStridingMeshInterface* triangles,bool useQuantizedAabbCompression, const btVector3& bvhAabbMin, const btVector3& bvhAabbMax);
+
+	void	refit(btStridingMeshInterface* triangles,const btVector3& aabbMin,const btVector3& aabbMax);
+
+	void	refitPartial(btStridingMeshInterface* triangles,const btVector3& aabbMin, const btVector3& aabbMax);
+
+	void	updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index);
+
+	/// Data buffer MUST be 16 byte aligned
+	virtual bool serializeInPlace(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
+	{
+		return btQuantizedBvh::serialize(o_alignedDataBuffer,i_dataBufferSize,i_swapEndian);
+
+	}
+
+	///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'
+	static btOptimizedBvh *deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian);
+
+
+};
+
+
+#endif //BT_OPTIMIZED_BVH_H
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
new file mode 100644
index 0000000..e84767e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
@@ -0,0 +1,338 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
+#include "btConvexPolyhedron.h"
+#include "LinearMath/btConvexHullComputer.h"
+#include <new>
+
+btPolyhedralConvexShape::btPolyhedralConvexShape() :btConvexInternalShape(),
+m_polyhedron(0)
+{
+
+}
+
+btPolyhedralConvexShape::~btPolyhedralConvexShape()
+{
+	if (m_polyhedron)
+	{
+		btAlignedFree(m_polyhedron);
+	}
+}
+
+bool	btPolyhedralConvexShape::initializePolyhedralFeatures()
+{
+	if (m_polyhedron)
+		btAlignedFree(m_polyhedron);
+	
+	void* mem = btAlignedAlloc(sizeof(btConvexPolyhedron),16);
+	m_polyhedron = new (mem) btConvexPolyhedron;
+
+	btAlignedObjectArray<btVector3> tmpVertices;
+	for (int i=0;i<getNumVertices();i++)
+	{
+		btVector3& newVertex = tmpVertices.expand();
+		getVertex(i,newVertex);
+	}
+
+	btConvexHullComputer conv;
+	conv.compute(&tmpVertices[0].getX(), sizeof(btVector3),tmpVertices.size(),0.f,0.f);
+
+	
+
+	btAlignedObjectArray<btVector3> faceNormals;
+	int numFaces = conv.faces.size();
+	faceNormals.resize(numFaces);
+	btConvexHullComputer* convexUtil = &conv;
+
+	
+	
+	m_polyhedron->m_faces.resize(numFaces);
+	int numVertices = convexUtil->vertices.size();
+	m_polyhedron->m_vertices.resize(numVertices);
+	for (int p=0;p<numVertices;p++)
+	{
+		m_polyhedron->m_vertices[p] = convexUtil->vertices[p];
+	}
+
+	for (int i=0;i<numFaces;i++)
+	{
+		int face = convexUtil->faces[i];
+		//printf("face=%d\n",face);
+		const btConvexHullComputer::Edge*  firstEdge = &convexUtil->edges[face];
+		const btConvexHullComputer::Edge*  edge = firstEdge;
+
+		btVector3 edges[3];
+		int numEdges = 0;
+		//compute face normals
+
+		btScalar maxCross2 = 0.f;
+		int chosenEdge = -1;
+
+		do
+		{
+			
+			int src = edge->getSourceVertex();
+			m_polyhedron->m_faces[i].m_indices.push_back(src);
+			int targ = edge->getTargetVertex();
+			btVector3 wa = convexUtil->vertices[src];
+
+			btVector3 wb = convexUtil->vertices[targ];
+			btVector3 newEdge = wb-wa;
+			newEdge.normalize();
+			if (numEdges<2)
+				edges[numEdges++] = newEdge;
+
+			edge = edge->getNextEdgeOfFace();
+		} while (edge!=firstEdge);
+
+		btScalar planeEq = 1e30f;
+
+		
+		if (numEdges==2)
+		{
+			faceNormals[i] = edges[0].cross(edges[1]);
+			faceNormals[i].normalize();
+			m_polyhedron->m_faces[i].m_plane[0] = -faceNormals[i].getX();
+			m_polyhedron->m_faces[i].m_plane[1] = -faceNormals[i].getY();
+			m_polyhedron->m_faces[i].m_plane[2] = -faceNormals[i].getZ();
+			m_polyhedron->m_faces[i].m_plane[3] = planeEq;
+
+		}
+		else
+		{
+			btAssert(0);//degenerate?
+			faceNormals[i].setZero();
+		}
+
+		for (int v=0;v<m_polyhedron->m_faces[i].m_indices.size();v++)
+		{
+			btScalar eq = m_polyhedron->m_vertices[m_polyhedron->m_faces[i].m_indices[v]].dot(faceNormals[i]);
+			if (planeEq>eq)
+			{
+				planeEq=eq;
+			}
+		}
+		m_polyhedron->m_faces[i].m_plane[3] = planeEq;
+	}
+
+
+	if (m_polyhedron->m_faces.size() && conv.vertices.size())
+	{
+
+		for (int f=0;f<m_polyhedron->m_faces.size();f++)
+		{
+			
+			btVector3 planeNormal(m_polyhedron->m_faces[f].m_plane[0],m_polyhedron->m_faces[f].m_plane[1],m_polyhedron->m_faces[f].m_plane[2]);
+			btScalar planeEq = m_polyhedron->m_faces[f].m_plane[3];
+
+			btVector3 supVec = localGetSupportingVertex(-planeNormal);
+
+			if (supVec.dot(planeNormal)<planeEq)
+			{
+				m_polyhedron->m_faces[f].m_plane[0] *= -1;
+				m_polyhedron->m_faces[f].m_plane[1] *= -1;
+				m_polyhedron->m_faces[f].m_plane[2] *= -1;
+				m_polyhedron->m_faces[f].m_plane[3] *= -1;
+				int numVerts = m_polyhedron->m_faces[f].m_indices.size();
+				for (int v=0;v<numVerts/2;v++)
+				{
+					btSwap(m_polyhedron->m_faces[f].m_indices[v],m_polyhedron->m_faces[f].m_indices[numVerts-1-v]);
+				}
+			}
+		}
+	}
+
+	
+
+	m_polyhedron->initialize();
+
+	return true;
+}
+
+
+btVector3	btPolyhedralConvexShape::localGetSupportingVertexWithoutMargin(const btVector3& vec0)const
+{
+
+
+	btVector3 supVec(0,0,0);
+#ifndef __SPU__
+	int i;
+	btScalar maxDot(btScalar(-BT_LARGE_FLOAT));
+
+	btVector3 vec = vec0;
+	btScalar lenSqr = vec.length2();
+	if (lenSqr < btScalar(0.0001))
+	{
+		vec.setValue(1,0,0);
+	} else
+	{
+		btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
+		vec *= rlen;
+	}
+
+	btVector3 vtx;
+	btScalar newDot;
+
+	for (i=0;i<getNumVertices();i++)
+	{
+		getVertex(i,vtx);
+		newDot = vec.dot(vtx);
+		if (newDot > maxDot)
+		{
+			maxDot = newDot;
+			supVec = vtx;
+		}
+	}
+
+	
+#endif //__SPU__
+	return supVec;
+}
+
+
+
+void	btPolyhedralConvexShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+#ifndef __SPU__
+	int i;
+
+	btVector3 vtx;
+	btScalar newDot;
+
+	for (i=0;i<numVectors;i++)
+	{
+		supportVerticesOut[i][3] = btScalar(-BT_LARGE_FLOAT);
+	}
+
+	for (int j=0;j<numVectors;j++)
+	{
+	
+		const btVector3& vec = vectors[j];
+
+		for (i=0;i<getNumVertices();i++)
+		{
+			getVertex(i,vtx);
+			newDot = vec.dot(vtx);
+			if (newDot > supportVerticesOut[j][3])
+			{
+				//WARNING: don't swap next lines, the w component would get overwritten!
+				supportVerticesOut[j] = vtx;
+				supportVerticesOut[j][3] = newDot;
+			}
+		}
+	}
+#endif //__SPU__
+}
+
+
+
+void	btPolyhedralConvexShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+#ifndef __SPU__
+	//not yet, return box inertia
+
+	btScalar margin = getMargin();
+
+	btTransform ident;
+	ident.setIdentity();
+	btVector3 aabbMin,aabbMax;
+	getAabb(ident,aabbMin,aabbMax);
+	btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);
+
+	btScalar lx=btScalar(2.)*(halfExtents.x()+margin);
+	btScalar ly=btScalar(2.)*(halfExtents.y()+margin);
+	btScalar lz=btScalar(2.)*(halfExtents.z()+margin);
+	const btScalar x2 = lx*lx;
+	const btScalar y2 = ly*ly;
+	const btScalar z2 = lz*lz;
+	const btScalar scaledmass = mass * btScalar(0.08333333);
+
+	inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
+#endif //__SPU__
+}
+
+
+
+void	btPolyhedralConvexAabbCachingShape::setLocalScaling(const btVector3& scaling)
+{
+	btConvexInternalShape::setLocalScaling(scaling);
+	recalcLocalAabb();
+}
+
+btPolyhedralConvexAabbCachingShape::btPolyhedralConvexAabbCachingShape()
+:btPolyhedralConvexShape(),
+m_localAabbMin(1,1,1),
+m_localAabbMax(-1,-1,-1),
+m_isLocalAabbValid(false)
+{
+}
+
+void btPolyhedralConvexAabbCachingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	getNonvirtualAabb(trans,aabbMin,aabbMax,getMargin());
+}
+
+void	btPolyhedralConvexAabbCachingShape::recalcLocalAabb()
+{
+	m_isLocalAabbValid = true;
+	
+	#if 1
+	static const btVector3 _directions[] =
+	{
+		btVector3( 1.,  0.,  0.),
+		btVector3( 0.,  1.,  0.),
+		btVector3( 0.,  0.,  1.),
+		btVector3( -1., 0.,  0.),
+		btVector3( 0., -1.,  0.),
+		btVector3( 0.,  0., -1.)
+	};
+	
+	btVector3 _supporting[] =
+	{
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.)
+	};
+	
+	batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6);
+	
+	for ( int i = 0; i < 3; ++i )
+	{
+		m_localAabbMax[i] = _supporting[i][i] + m_collisionMargin;
+		m_localAabbMin[i] = _supporting[i + 3][i] - m_collisionMargin;
+	}
+	
+	#else
+
+	for (int i=0;i<3;i++)
+	{
+		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
+		vec[i] = btScalar(1.);
+		btVector3 tmp = localGetSupportingVertex(vec);
+		m_localAabbMax[i] = tmp[i]+m_collisionMargin;
+		vec[i] = btScalar(-1.);
+		tmp = localGetSupportingVertex(vec);
+		m_localAabbMin[i] = tmp[i]-m_collisionMargin;
+	}
+	#endif
+}
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
new file mode 100644
index 0000000..ee2e1e2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
@@ -0,0 +1,112 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_POLYHEDRAL_CONVEX_SHAPE_H
+#define BT_POLYHEDRAL_CONVEX_SHAPE_H
+
+#include "LinearMath/btMatrix3x3.h"
+#include "btConvexInternalShape.h"
+class btConvexPolyhedron;
+
+
+///The btPolyhedralConvexShape is an internal interface class for polyhedral convex shapes.
+class btPolyhedralConvexShape : public btConvexInternalShape
+{
+	
+
+protected:
+	
+	btConvexPolyhedron* m_polyhedron;
+
+public:
+
+	btPolyhedralConvexShape();
+
+	virtual ~btPolyhedralConvexShape();
+
+	///optional method mainly used to generate multiple contact points by clipping polyhedral features (faces/edges)
+	virtual bool	initializePolyhedralFeatures();
+
+	const btConvexPolyhedron*	getConvexPolyhedron() const
+	{
+		return m_polyhedron;
+	}
+
+	//brute force implementations
+
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+	
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+	
+	
+	virtual int	getNumVertices() const = 0 ;
+	virtual int getNumEdges() const = 0;
+	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const = 0;
+	virtual void getVertex(int i,btVector3& vtx) const = 0;
+	virtual int	getNumPlanes() const = 0;
+	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i ) const = 0;
+//	virtual int getIndex(int i) const = 0 ; 
+
+	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const = 0;
+	
+};
+
+
+///The btPolyhedralConvexAabbCachingShape adds aabb caching to the btPolyhedralConvexShape
+class btPolyhedralConvexAabbCachingShape : public btPolyhedralConvexShape
+{
+
+	btVector3	m_localAabbMin;
+	btVector3	m_localAabbMax;
+	bool		m_isLocalAabbValid;
+		
+protected:
+
+	void setCachedLocalAabb (const btVector3& aabbMin, const btVector3& aabbMax)
+	{
+		m_isLocalAabbValid = true;
+		m_localAabbMin = aabbMin;
+		m_localAabbMax = aabbMax;
+	}
+
+	inline void getCachedLocalAabb (btVector3& aabbMin, btVector3& aabbMax) const
+	{
+		btAssert(m_isLocalAabbValid);
+		aabbMin = m_localAabbMin;
+		aabbMax = m_localAabbMax;
+	}
+
+public:
+
+	btPolyhedralConvexAabbCachingShape();
+	
+	inline void getNonvirtualAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax, btScalar margin) const
+	{
+
+		//lazy evaluation of local aabb
+		btAssert(m_isLocalAabbValid);
+		btTransformAabb(m_localAabbMin,m_localAabbMax,margin,trans,aabbMin,aabbMax);
+	}
+
+	virtual void	setLocalScaling(const btVector3& scaling);
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	void	recalcLocalAabb();
+
+};
+
+#endif //BT_POLYHEDRAL_CONVEX_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
new file mode 100644
index 0000000..25d58d6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
@@ -0,0 +1,123 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btScaledBvhTriangleMeshShape.h"
+
+btScaledBvhTriangleMeshShape::btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape* childShape,const btVector3& localScaling)
+:m_localScaling(localScaling),m_bvhTriMeshShape(childShape)
+{
+	m_shapeType = SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE;
+}
+
+btScaledBvhTriangleMeshShape::~btScaledBvhTriangleMeshShape()
+{
+}
+
+
+class btScaledTriangleCallback : public btTriangleCallback
+{
+	btTriangleCallback* m_originalCallback;
+
+	btVector3	m_localScaling;
+
+public:
+
+	btScaledTriangleCallback(btTriangleCallback* originalCallback,const btVector3& localScaling)
+		:m_originalCallback(originalCallback),
+		m_localScaling(localScaling)
+	{
+	}
+
+	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
+	{
+		btVector3 newTriangle[3];
+		newTriangle[0] = triangle[0]*m_localScaling;
+		newTriangle[1] = triangle[1]*m_localScaling;
+		newTriangle[2] = triangle[2]*m_localScaling;
+		m_originalCallback->processTriangle(&newTriangle[0],partId,triangleIndex);
+	}
+};
+
+void	btScaledBvhTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	btScaledTriangleCallback scaledCallback(callback,m_localScaling);
+	
+	btVector3 invLocalScaling(1.f/m_localScaling.getX(),1.f/m_localScaling.getY(),1.f/m_localScaling.getZ());
+	btVector3 scaledAabbMin,scaledAabbMax;
+
+	///support negative scaling
+	scaledAabbMin[0] = m_localScaling.getX() >= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
+	scaledAabbMin[1] = m_localScaling.getY() >= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
+	scaledAabbMin[2] = m_localScaling.getZ() >= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
+	scaledAabbMin[3] = 0.f;
+	
+	scaledAabbMax[0] = m_localScaling.getX() <= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
+	scaledAabbMax[1] = m_localScaling.getY() <= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
+	scaledAabbMax[2] = m_localScaling.getZ() <= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
+	scaledAabbMax[3] = 0.f;
+	
+	
+	m_bvhTriMeshShape->processAllTriangles(&scaledCallback,scaledAabbMin,scaledAabbMax);
+}
+
+
+void	btScaledBvhTriangleMeshShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	btVector3 localAabbMin = m_bvhTriMeshShape->getLocalAabbMin();
+	btVector3 localAabbMax = m_bvhTriMeshShape->getLocalAabbMax();
+
+	btVector3 tmpLocalAabbMin = localAabbMin * m_localScaling;
+	btVector3 tmpLocalAabbMax = localAabbMax * m_localScaling;
+
+	localAabbMin[0] = (m_localScaling.getX() >= 0.) ? tmpLocalAabbMin[0] : tmpLocalAabbMax[0];
+	localAabbMin[1] = (m_localScaling.getY() >= 0.) ? tmpLocalAabbMin[1] : tmpLocalAabbMax[1];
+	localAabbMin[2] = (m_localScaling.getZ() >= 0.) ? tmpLocalAabbMin[2] : tmpLocalAabbMax[2];
+	localAabbMax[0] = (m_localScaling.getX() <= 0.) ? tmpLocalAabbMin[0] : tmpLocalAabbMax[0];
+	localAabbMax[1] = (m_localScaling.getY() <= 0.) ? tmpLocalAabbMin[1] : tmpLocalAabbMax[1];
+	localAabbMax[2] = (m_localScaling.getZ() <= 0.) ? tmpLocalAabbMin[2] : tmpLocalAabbMax[2];
+
+	btVector3 localHalfExtents = btScalar(0.5)*(localAabbMax-localAabbMin);
+	btScalar margin = m_bvhTriMeshShape->getMargin();
+	localHalfExtents += btVector3(margin,margin,margin);
+	btVector3 localCenter = btScalar(0.5)*(localAabbMax+localAabbMin);
+	
+	btMatrix3x3 abs_b = trans.getBasis().absolute();  
+
+	btVector3 center = trans(localCenter);
+
+	btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
+		   abs_b[1].dot(localHalfExtents),
+		  abs_b[2].dot(localHalfExtents));
+	aabbMin = center - extent;
+	aabbMax = center + extent;
+
+}
+
+void	btScaledBvhTriangleMeshShape::setLocalScaling(const btVector3& scaling)
+{
+	m_localScaling = scaling;
+}
+
+const btVector3& btScaledBvhTriangleMeshShape::getLocalScaling() const
+{
+	return m_localScaling;
+}
+
+void	btScaledBvhTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	///don't make this a movable object!
+//	btAssert(0);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h
new file mode 100644
index 0000000..ff86ef3
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h
@@ -0,0 +1,93 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
+#define BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
+
+#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
+
+
+///The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMeshShape.
+///Note that each btBvhTriangleMeshShape still can have its own local scaling, independent from this btScaledBvhTriangleMeshShape 'localScaling'
+ATTRIBUTE_ALIGNED16(class) btScaledBvhTriangleMeshShape : public btConcaveShape
+{
+	
+	
+	btVector3	m_localScaling;
+
+	btBvhTriangleMeshShape*	m_bvhTriMeshShape;
+
+public:
+
+
+	btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape* childShape,const btVector3& localScaling);
+
+	virtual ~btScaledBvhTriangleMeshShape();
+
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+	virtual void	setLocalScaling(const btVector3& scaling);
+	virtual const btVector3& getLocalScaling() const;
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+	btBvhTriangleMeshShape*	getChildShape()
+	{
+		return m_bvhTriMeshShape;
+	}
+
+	const btBvhTriangleMeshShape*	getChildShape() const
+	{
+		return m_bvhTriMeshShape;
+	}
+
+	//debugging
+	virtual const char*	getName()const {return "SCALEDBVHTRIANGLEMESH";}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btScaledTriangleMeshShapeData
+{
+	btTriangleMeshShapeData	m_trimeshShapeData;
+
+	btVector3FloatData	m_localScaling;
+};
+
+
+SIMD_FORCE_INLINE	int	btScaledBvhTriangleMeshShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btScaledTriangleMeshShapeData);
+}
+
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btScaledBvhTriangleMeshShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btScaledTriangleMeshShapeData* scaledMeshData = (btScaledTriangleMeshShapeData*) dataBuffer;
+	m_bvhTriMeshShape->serialize(&scaledMeshData->m_trimeshShapeData,serializer);
+	scaledMeshData->m_trimeshShapeData.m_collisionShapeData.m_shapeType = SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE;
+	m_localScaling.serializeFloat(scaledMeshData->m_localScaling);
+	return "btScaledTriangleMeshShapeData";
+}
+
+
+#endif //BT_SCALED_BVH_TRIANGLE_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.cpp
new file mode 100644
index 0000000..3beaf86
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.cpp
@@ -0,0 +1,170 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+//btShapeHull was implemented by John McCutchan.
+
+
+#include "btShapeHull.h"
+#include "LinearMath/btConvexHull.h"
+
+#define NUM_UNITSPHERE_POINTS 42
+
+btShapeHull::btShapeHull (const btConvexShape* shape)
+{
+	m_shape = shape;
+	m_vertices.clear ();
+	m_indices.clear();
+	m_numIndices = 0;
+}
+
+btShapeHull::~btShapeHull ()
+{
+	m_indices.clear();	
+	m_vertices.clear ();
+}
+
+bool
+btShapeHull::buildHull (btScalar /*margin*/)
+{
+	int numSampleDirections = NUM_UNITSPHERE_POINTS;
+	{
+		int numPDA = m_shape->getNumPreferredPenetrationDirections();
+		if (numPDA)
+		{
+			for (int i=0;i<numPDA;i++)
+			{
+				btVector3 norm;
+				m_shape->getPreferredPenetrationDirection(i,norm);
+				getUnitSpherePoints()[numSampleDirections] = norm;
+				numSampleDirections++;
+			}
+		}
+	}
+
+	btVector3 supportPoints[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	int i;
+	for (i = 0; i < numSampleDirections; i++)
+	{
+		supportPoints[i] = m_shape->localGetSupportingVertex(getUnitSpherePoints()[i]);
+	}
+
+	HullDesc hd;
+	hd.mFlags = QF_TRIANGLES;
+	hd.mVcount = static_cast<unsigned int>(numSampleDirections);
+
+#ifdef BT_USE_DOUBLE_PRECISION
+	hd.mVertices = &supportPoints[0];
+	hd.mVertexStride = sizeof(btVector3);
+#else
+	hd.mVertices = &supportPoints[0];
+	hd.mVertexStride = sizeof (btVector3);
+#endif
+
+	HullLibrary hl;
+	HullResult hr;
+	if (hl.CreateConvexHull (hd, hr) == QE_FAIL)
+	{
+		return false;
+	}
+
+	m_vertices.resize (static_cast<int>(hr.mNumOutputVertices));
+
+
+	for (i = 0; i < static_cast<int>(hr.mNumOutputVertices); i++)
+	{
+		m_vertices[i] = hr.m_OutputVertices[i];
+	}
+	m_numIndices = hr.mNumIndices;
+	m_indices.resize(static_cast<int>(m_numIndices));
+	for (i = 0; i < static_cast<int>(m_numIndices); i++)
+	{
+		m_indices[i] = hr.m_Indices[i];
+	}
+
+	// free temporary hull result that we just copied
+	hl.ReleaseResult (hr);
+
+	return true;
+}
+
+int
+btShapeHull::numTriangles () const
+{
+	return static_cast<int>(m_numIndices / 3);
+}
+
+int
+btShapeHull::numVertices () const
+{
+	return m_vertices.size ();
+}
+
+int
+btShapeHull::numIndices () const
+{
+	return static_cast<int>(m_numIndices);
+}
+
+
+btVector3* btShapeHull::getUnitSpherePoints()
+{
+	static btVector3 sUnitSpherePoints[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2] = 
+	{
+		btVector3(btScalar(0.000000) , btScalar(-0.000000),btScalar(-1.000000)),
+		btVector3(btScalar(0.723608) , btScalar(-0.525725),btScalar(-0.447219)),
+		btVector3(btScalar(-0.276388) , btScalar(-0.850649),btScalar(-0.447219)),
+		btVector3(btScalar(-0.894426) , btScalar(-0.000000),btScalar(-0.447216)),
+		btVector3(btScalar(-0.276388) , btScalar(0.850649),btScalar(-0.447220)),
+		btVector3(btScalar(0.723608) , btScalar(0.525725),btScalar(-0.447219)),
+		btVector3(btScalar(0.276388) , btScalar(-0.850649),btScalar(0.447220)),
+		btVector3(btScalar(-0.723608) , btScalar(-0.525725),btScalar(0.447219)),
+		btVector3(btScalar(-0.723608) , btScalar(0.525725),btScalar(0.447219)),
+		btVector3(btScalar(0.276388) , btScalar(0.850649),btScalar(0.447219)),
+		btVector3(btScalar(0.894426) , btScalar(0.000000),btScalar(0.447216)),
+		btVector3(btScalar(-0.000000) , btScalar(0.000000),btScalar(1.000000)),
+		btVector3(btScalar(0.425323) , btScalar(-0.309011),btScalar(-0.850654)),
+		btVector3(btScalar(-0.162456) , btScalar(-0.499995),btScalar(-0.850654)),
+		btVector3(btScalar(0.262869) , btScalar(-0.809012),btScalar(-0.525738)),
+		btVector3(btScalar(0.425323) , btScalar(0.309011),btScalar(-0.850654)),
+		btVector3(btScalar(0.850648) , btScalar(-0.000000),btScalar(-0.525736)),
+		btVector3(btScalar(-0.525730) , btScalar(-0.000000),btScalar(-0.850652)),
+		btVector3(btScalar(-0.688190) , btScalar(-0.499997),btScalar(-0.525736)),
+		btVector3(btScalar(-0.162456) , btScalar(0.499995),btScalar(-0.850654)),
+		btVector3(btScalar(-0.688190) , btScalar(0.499997),btScalar(-0.525736)),
+		btVector3(btScalar(0.262869) , btScalar(0.809012),btScalar(-0.525738)),
+		btVector3(btScalar(0.951058) , btScalar(0.309013),btScalar(0.000000)),
+		btVector3(btScalar(0.951058) , btScalar(-0.309013),btScalar(0.000000)),
+		btVector3(btScalar(0.587786) , btScalar(-0.809017),btScalar(0.000000)),
+		btVector3(btScalar(0.000000) , btScalar(-1.000000),btScalar(0.000000)),
+		btVector3(btScalar(-0.587786) , btScalar(-0.809017),btScalar(0.000000)),
+		btVector3(btScalar(-0.951058) , btScalar(-0.309013),btScalar(-0.000000)),
+		btVector3(btScalar(-0.951058) , btScalar(0.309013),btScalar(-0.000000)),
+		btVector3(btScalar(-0.587786) , btScalar(0.809017),btScalar(-0.000000)),
+		btVector3(btScalar(-0.000000) , btScalar(1.000000),btScalar(-0.000000)),
+		btVector3(btScalar(0.587786) , btScalar(0.809017),btScalar(-0.000000)),
+		btVector3(btScalar(0.688190) , btScalar(-0.499997),btScalar(0.525736)),
+		btVector3(btScalar(-0.262869) , btScalar(-0.809012),btScalar(0.525738)),
+		btVector3(btScalar(-0.850648) , btScalar(0.000000),btScalar(0.525736)),
+		btVector3(btScalar(-0.262869) , btScalar(0.809012),btScalar(0.525738)),
+		btVector3(btScalar(0.688190) , btScalar(0.499997),btScalar(0.525736)),
+		btVector3(btScalar(0.525730) , btScalar(0.000000),btScalar(0.850652)),
+		btVector3(btScalar(0.162456) , btScalar(-0.499995),btScalar(0.850654)),
+		btVector3(btScalar(-0.425323) , btScalar(-0.309011),btScalar(0.850654)),
+		btVector3(btScalar(-0.425323) , btScalar(0.309011),btScalar(0.850654)),
+		btVector3(btScalar(0.162456) , btScalar(0.499995),btScalar(0.850654))
+	};
+	return sUnitSpherePoints;
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.h
new file mode 100644
index 0000000..642a288
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btShapeHull.h
@@ -0,0 +1,59 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///btShapeHull implemented by John McCutchan.
+
+#ifndef BT_SHAPE_HULL_H
+#define BT_SHAPE_HULL_H
+
+#include "LinearMath/btAlignedObjectArray.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+
+
+///The btShapeHull class takes a btConvexShape, builds a simplified convex hull using btConvexHull and provides triangle indices and vertices.
+///It can be useful for to simplify a complex convex object and for visualization of a non-polyhedral convex object.
+///It approximates the convex hull using the supporting vertex of 42 directions.
+class btShapeHull
+{
+protected:
+
+	btAlignedObjectArray<btVector3> m_vertices;
+	btAlignedObjectArray<unsigned int> m_indices;
+	unsigned int m_numIndices;
+	const btConvexShape* m_shape;
+
+	static btVector3* getUnitSpherePoints();
+
+public:
+	btShapeHull (const btConvexShape* shape);
+	~btShapeHull ();
+
+	bool buildHull (btScalar margin);
+
+	int numTriangles () const;
+	int numVertices () const;
+	int numIndices () const;
+
+	const btVector3* getVertexPointer() const
+	{
+		return &m_vertices[0];
+	}
+	const unsigned int* getIndexPointer() const
+	{
+		return &m_indices[0];
+	}
+};
+
+#endif //BT_SHAPE_HULL_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp
new file mode 100644
index 0000000..b9a736c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.cpp
@@ -0,0 +1,71 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btSphereShape.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+
+#include "LinearMath/btQuaternion.h"
+
+btVector3	btSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+{
+	(void)vec;
+	return btVector3(btScalar(0.),btScalar(0.),btScalar(0.));
+}
+
+void	btSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	(void)vectors;
+
+	for (int i=0;i<numVectors;i++)
+	{
+		supportVerticesOut[i].setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+	}
+}
+
+
+btVector3	btSphereShape::localGetSupportingVertex(const btVector3& vec)const
+{
+	btVector3 supVertex;
+	supVertex = localGetSupportingVertexWithoutMargin(vec);
+
+	btVector3 vecnorm = vec;
+	if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
+	{
+		vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
+	} 
+	vecnorm.normalize();
+	supVertex+= getMargin() * vecnorm;
+	return supVertex;
+}
+
+
+//broken due to scaling
+void btSphereShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	const btVector3& center = t.getOrigin();
+	btVector3 extent(getMargin(),getMargin(),getMargin());
+	aabbMin = center - extent;
+	aabbMax = center + extent;
+}
+
+
+
+void	btSphereShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	btScalar elem = btScalar(0.4) * mass * getMargin()*getMargin();
+	inertia.setValue(elem,elem,elem);
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h
new file mode 100644
index 0000000..b192efe
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btSphereShape.h
@@ -0,0 +1,73 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef BT_SPHERE_MINKOWSKI_H
+#define BT_SPHERE_MINKOWSKI_H
+
+#include "btConvexInternalShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+
+///The btSphereShape implements an implicit sphere, centered around a local origin with radius.
+ATTRIBUTE_ALIGNED16(class) btSphereShape : public btConvexInternalShape
+
+{
+	
+public:
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btSphereShape (btScalar radius) : btConvexInternalShape ()
+	{
+		m_shapeType = SPHERE_SHAPE_PROXYTYPE;
+		m_implicitShapeDimensions.setX(radius);
+		m_collisionMargin = radius;
+	}
+	
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+	//notice that the vectors should be unit length
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+
+	btScalar	getRadius() const { return m_implicitShapeDimensions.getX() * m_localScaling.getX();}
+
+	void	setUnscaledRadius(btScalar	radius)
+	{
+		m_implicitShapeDimensions.setX(radius);
+		btConvexInternalShape::setMargin(radius);
+	}
+
+	//debugging
+	virtual const char*	getName()const {return "SPHERE";}
+
+	virtual void	setMargin(btScalar margin)
+	{
+		btConvexInternalShape::setMargin(margin);
+	}
+	virtual btScalar	getMargin() const
+	{
+		//to improve gjk behaviour, use radius+margin as the full margin, so never get into the penetration case
+		//this means, non-uniform scaling is not supported anymore
+		return getRadius();
+	}
+
+
+};
+
+
+#endif //BT_SPHERE_MINKOWSKI_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
new file mode 100644
index 0000000..38ef8f0
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
@@ -0,0 +1,107 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btStaticPlaneShape.h"
+
+#include "LinearMath/btTransformUtil.h"
+
+
+btStaticPlaneShape::btStaticPlaneShape(const btVector3& planeNormal,btScalar planeConstant)
+: btConcaveShape (), m_planeNormal(planeNormal.normalized()),
+m_planeConstant(planeConstant),
+m_localScaling(btScalar(0.),btScalar(0.),btScalar(0.))
+{
+	m_shapeType = STATIC_PLANE_PROXYTYPE;
+	//	btAssert( btFuzzyZero(m_planeNormal.length() - btScalar(1.)) );
+}
+
+
+btStaticPlaneShape::~btStaticPlaneShape()
+{
+}
+
+
+
+void btStaticPlaneShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	(void)t;
+	/*
+	btVector3 infvec (btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+
+	btVector3 center = m_planeNormal*m_planeConstant;
+	aabbMin = center + infvec*m_planeNormal;
+	aabbMax = aabbMin;
+	aabbMin.setMin(center - infvec*m_planeNormal);
+	aabbMax.setMax(center - infvec*m_planeNormal); 
+	*/
+
+	aabbMin.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
+	aabbMax.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+
+}
+
+
+
+
+void	btStaticPlaneShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+
+	btVector3 halfExtents = (aabbMax - aabbMin) * btScalar(0.5);
+	btScalar radius = halfExtents.length();
+	btVector3 center = (aabbMax + aabbMin) * btScalar(0.5);
+	
+	//this is where the triangles are generated, given AABB and plane equation (normal/constant)
+
+	btVector3 tangentDir0,tangentDir1;
+
+	//tangentDir0/tangentDir1 can be precalculated
+	btPlaneSpace1(m_planeNormal,tangentDir0,tangentDir1);
+
+	btVector3 supVertex0,supVertex1;
+
+	btVector3 projectedCenter = center - (m_planeNormal.dot(center) - m_planeConstant)*m_planeNormal;
+	
+	btVector3 triangle[3];
+	triangle[0] = projectedCenter + tangentDir0*radius + tangentDir1*radius;
+	triangle[1] = projectedCenter + tangentDir0*radius - tangentDir1*radius;
+	triangle[2] = projectedCenter - tangentDir0*radius - tangentDir1*radius;
+
+	callback->processTriangle(triangle,0,0);
+
+	triangle[0] = projectedCenter - tangentDir0*radius - tangentDir1*radius;
+	triangle[1] = projectedCenter - tangentDir0*radius + tangentDir1*radius;
+	triangle[2] = projectedCenter + tangentDir0*radius + tangentDir1*radius;
+
+	callback->processTriangle(triangle,0,1);
+
+}
+
+void	btStaticPlaneShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	(void)mass;
+
+	//moving concave objects not supported
+	
+	inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+}
+
+void	btStaticPlaneShape::setLocalScaling(const btVector3& scaling)
+{
+	m_localScaling = scaling;
+}
+const btVector3& btStaticPlaneShape::getLocalScaling() const
+{
+	return m_localScaling;
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h
new file mode 100644
index 0000000..b13825e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h
@@ -0,0 +1,103 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_STATIC_PLANE_SHAPE_H
+#define BT_STATIC_PLANE_SHAPE_H
+
+#include "btConcaveShape.h"
+
+
+///The btStaticPlaneShape simulates an infinite non-moving (static) collision plane.
+ATTRIBUTE_ALIGNED16(class) btStaticPlaneShape : public btConcaveShape
+{
+protected:
+	btVector3	m_localAabbMin;
+	btVector3	m_localAabbMax;
+	
+	btVector3	m_planeNormal;
+	btScalar      m_planeConstant;
+	btVector3	m_localScaling;
+
+public:
+	btStaticPlaneShape(const btVector3& planeNormal,btScalar planeConstant);
+
+	virtual ~btStaticPlaneShape();
+
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual void	setLocalScaling(const btVector3& scaling);
+	virtual const btVector3& getLocalScaling() const;
+	
+	const btVector3&	getPlaneNormal() const
+	{
+		return	m_planeNormal;
+	}
+
+	const btScalar&	getPlaneConstant() const
+	{
+		return	m_planeConstant;
+	}
+
+	//debugging
+	virtual const char*	getName()const {return "STATICPLANE";}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btStaticPlaneShapeData
+{
+	btCollisionShapeData	m_collisionShapeData;
+
+	btVector3FloatData	m_localScaling;
+	btVector3FloatData	m_planeNormal;
+	float			m_planeConstant;
+	char	m_pad[4];
+};
+
+
+SIMD_FORCE_INLINE	int	btStaticPlaneShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btStaticPlaneShapeData);
+}
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btStaticPlaneShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btStaticPlaneShapeData* planeData = (btStaticPlaneShapeData*) dataBuffer;
+	btCollisionShape::serialize(&planeData->m_collisionShapeData,serializer);
+
+	m_localScaling.serializeFloat(planeData->m_localScaling);
+	m_planeNormal.serializeFloat(planeData->m_planeNormal);
+	planeData->m_planeConstant = float(m_planeConstant);
+		
+	return "btStaticPlaneShapeData";
+}
+
+
+#endif //BT_STATIC_PLANE_SHAPE_H
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
new file mode 100644
index 0000000..bc2f9f2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
@@ -0,0 +1,379 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btStridingMeshInterface.h"
+#include "LinearMath/btSerializer.h"
+
+btStridingMeshInterface::~btStridingMeshInterface()
+{
+
+}
+
+
+void	btStridingMeshInterface::InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	(void)aabbMin;
+	(void)aabbMax;
+	int numtotalphysicsverts = 0;
+	int part,graphicssubparts = getNumSubParts();
+	const unsigned char * vertexbase;
+	const unsigned char * indexbase;
+	int indexstride;
+	PHY_ScalarType type;
+	PHY_ScalarType gfxindextype;
+	int stride,numverts,numtriangles;
+	int gfxindex;
+	btVector3 triangle[3];
+
+	btVector3 meshScaling = getScaling();
+
+	///if the number of parts is big, the performance might drop due to the innerloop switch on indextype
+	for (part=0;part<graphicssubparts ;part++)
+	{
+		getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,type,stride,&indexbase,indexstride,numtriangles,gfxindextype,part);
+		numtotalphysicsverts+=numtriangles*3; //upper bound
+
+		///unlike that developers want to pass in double-precision meshes in single-precision Bullet build
+		///so disable this feature by default
+		///see patch http://code.google.com/p/bullet/issues/detail?id=213
+
+		switch (type)
+		{
+		case PHY_FLOAT:
+		 {
+
+			 float* graphicsbase;
+
+			 switch (gfxindextype)
+			 {
+			 case PHY_INTEGER:
+				 {
+					 for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+					 {
+						 unsigned int* tri_indices= (unsigned int*)(indexbase+gfxindex*indexstride);
+						 graphicsbase = (float*)(vertexbase+tri_indices[0]*stride);
+						 triangle[0].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());
+						 graphicsbase = (float*)(vertexbase+tri_indices[1]*stride);
+						 triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
+						 graphicsbase = (float*)(vertexbase+tri_indices[2]*stride);
+						 triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
+						 callback->internalProcessTriangleIndex(triangle,part,gfxindex);
+					 }
+					 break;
+				 }
+			 case PHY_SHORT:
+				 {
+					 for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+					 {
+						 unsigned short int* tri_indices= (unsigned short int*)(indexbase+gfxindex*indexstride);
+						 graphicsbase = (float*)(vertexbase+tri_indices[0]*stride);
+						 triangle[0].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());
+						 graphicsbase = (float*)(vertexbase+tri_indices[1]*stride);
+						 triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
+						 graphicsbase = (float*)(vertexbase+tri_indices[2]*stride);
+						 triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
+						 callback->internalProcessTriangleIndex(triangle,part,gfxindex);
+					 }
+					 break;
+				 }
+			case PHY_UCHAR:
+				 {
+					 for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+					 {
+						 unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
+						 graphicsbase = (float*)(vertexbase+tri_indices[0]*stride);
+						 triangle[0].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),graphicsbase[2]*meshScaling.getZ());
+						 graphicsbase = (float*)(vertexbase+tri_indices[1]*stride);
+						 triangle[1].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
+						 graphicsbase = (float*)(vertexbase+tri_indices[2]*stride);
+						 triangle[2].setValue(graphicsbase[0]*meshScaling.getX(),graphicsbase[1]*meshScaling.getY(),	graphicsbase[2]*meshScaling.getZ());
+						 callback->internalProcessTriangleIndex(triangle,part,gfxindex);
+					 }
+					 break;
+				 }
+			 default:
+				 btAssert((gfxindextype == PHY_INTEGER) || (gfxindextype == PHY_SHORT));
+			 }
+			 break;
+		 }
+
+		case PHY_DOUBLE:
+			{
+				double* graphicsbase;
+
+				switch (gfxindextype)
+				{
+				case PHY_INTEGER:
+					{
+						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+						{
+							unsigned int* tri_indices= (unsigned int*)(indexbase+gfxindex*indexstride);
+							graphicsbase = (double*)(vertexbase+tri_indices[0]*stride);
+							triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ());
+							graphicsbase = (double*)(vertexbase+tri_indices[1]*stride);
+							triangle[1].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
+							graphicsbase = (double*)(vertexbase+tri_indices[2]*stride);
+							triangle[2].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
+							callback->internalProcessTriangleIndex(triangle,part,gfxindex);
+						}
+						break;
+					}
+				case PHY_SHORT:
+					{
+						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+						{
+							unsigned short int* tri_indices= (unsigned short int*)(indexbase+gfxindex*indexstride);
+							graphicsbase = (double*)(vertexbase+tri_indices[0]*stride);
+							triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ());
+							graphicsbase = (double*)(vertexbase+tri_indices[1]*stride);
+							triangle[1].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
+							graphicsbase = (double*)(vertexbase+tri_indices[2]*stride);
+							triangle[2].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
+							callback->internalProcessTriangleIndex(triangle,part,gfxindex);
+						}
+						break;
+					}
+				case PHY_UCHAR:
+					{
+						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+						{
+							unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
+							graphicsbase = (double*)(vertexbase+tri_indices[0]*stride);
+							triangle[0].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),(btScalar)graphicsbase[2]*meshScaling.getZ());
+							graphicsbase = (double*)(vertexbase+tri_indices[1]*stride);
+							triangle[1].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
+							graphicsbase = (double*)(vertexbase+tri_indices[2]*stride);
+							triangle[2].setValue((btScalar)graphicsbase[0]*meshScaling.getX(),(btScalar)graphicsbase[1]*meshScaling.getY(),  (btScalar)graphicsbase[2]*meshScaling.getZ());
+							callback->internalProcessTriangleIndex(triangle,part,gfxindex);
+						}
+						break;
+					}
+				default:
+					btAssert((gfxindextype == PHY_INTEGER) || (gfxindextype == PHY_SHORT));
+				}
+				break;
+			}
+		default:
+			btAssert((type == PHY_FLOAT) || (type == PHY_DOUBLE));
+		}
+
+		unLockReadOnlyVertexBase(part);
+	}
+}
+
+void	btStridingMeshInterface::calculateAabbBruteForce(btVector3& aabbMin,btVector3& aabbMax)
+{
+
+	struct	AabbCalculationCallback : public btInternalTriangleIndexCallback
+	{
+		btVector3	m_aabbMin;
+		btVector3	m_aabbMax;
+
+		AabbCalculationCallback()
+		{
+			m_aabbMin.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+			m_aabbMax.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
+		}
+
+		virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex)
+		{
+			(void)partId;
+			(void)triangleIndex;
+
+			m_aabbMin.setMin(triangle[0]);
+			m_aabbMax.setMax(triangle[0]);
+			m_aabbMin.setMin(triangle[1]);
+			m_aabbMax.setMax(triangle[1]);
+			m_aabbMin.setMin(triangle[2]);
+			m_aabbMax.setMax(triangle[2]);
+		}
+	};
+
+	//first calculate the total aabb for all triangles
+	AabbCalculationCallback	aabbCallback;
+	aabbMin.setValue(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));
+	aabbMax.setValue(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+	InternalProcessAllTriangles(&aabbCallback,aabbMin,aabbMax);
+
+	aabbMin = aabbCallback.m_aabbMin;
+	aabbMax = aabbCallback.m_aabbMax;
+}
+
+
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btStridingMeshInterfaceData* trimeshData = (btStridingMeshInterfaceData*) dataBuffer;
+
+	trimeshData->m_numMeshParts = getNumSubParts();
+
+	//void* uniquePtr = 0;
+
+	trimeshData->m_meshPartsPtr = 0;
+
+	if (trimeshData->m_numMeshParts)
+	{
+		btChunk* chunk = serializer->allocate(sizeof(btMeshPartData),trimeshData->m_numMeshParts);
+		btMeshPartData* memPtr = (btMeshPartData*)chunk->m_oldPtr;
+		trimeshData->m_meshPartsPtr = (btMeshPartData *)serializer->getUniquePointer(memPtr);
+
+
+	//	int numtotalphysicsverts = 0;
+		int part,graphicssubparts = getNumSubParts();
+		const unsigned char * vertexbase;
+		const unsigned char * indexbase;
+		int indexstride;
+		PHY_ScalarType type;
+		PHY_ScalarType gfxindextype;
+		int stride,numverts,numtriangles;
+		int gfxindex;
+	//	btVector3 triangle[3];
+
+		btVector3 meshScaling = getScaling();
+
+		///if the number of parts is big, the performance might drop due to the innerloop switch on indextype
+		for (part=0;part<graphicssubparts ;part++,memPtr++)
+		{
+			getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,type,stride,&indexbase,indexstride,numtriangles,gfxindextype,part);
+			memPtr->m_numTriangles = numtriangles;//indices = 3*numtriangles
+			memPtr->m_numVertices = numverts;
+			memPtr->m_indices16 = 0;
+			memPtr->m_indices32 = 0;
+			memPtr->m_3indices16 = 0;
+			memPtr->m_vertices3f = 0;
+			memPtr->m_vertices3d = 0;
+
+			switch (gfxindextype)
+			{
+			case PHY_INTEGER:
+				{
+					int numindices = numtriangles*3;
+				
+					if (numindices)
+					{
+						btChunk* chunk = serializer->allocate(sizeof(btIntIndexData),numindices);
+						btIntIndexData* tmpIndices = (btIntIndexData*)chunk->m_oldPtr;
+						memPtr->m_indices32 = (btIntIndexData*)serializer->getUniquePointer(tmpIndices);
+						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+						{
+							unsigned int* tri_indices= (unsigned int*)(indexbase+gfxindex*indexstride);
+							tmpIndices[gfxindex*3].m_value = tri_indices[0];
+							tmpIndices[gfxindex*3+1].m_value = tri_indices[1];
+							tmpIndices[gfxindex*3+2].m_value = tri_indices[2];
+						}
+						serializer->finalizeChunk(chunk,"btIntIndexData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
+					}
+					break;
+				}
+			case PHY_SHORT:
+				{
+					if (numtriangles)
+					{
+						btChunk* chunk = serializer->allocate(sizeof(btShortIntIndexTripletData),numtriangles);
+						btShortIntIndexTripletData* tmpIndices = (btShortIntIndexTripletData*)chunk->m_oldPtr;
+						memPtr->m_3indices16 = (btShortIntIndexTripletData*) serializer->getUniquePointer(tmpIndices);
+						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+						{
+							unsigned short int* tri_indices= (unsigned short int*)(indexbase+gfxindex*indexstride);
+							tmpIndices[gfxindex].m_values[0] = tri_indices[0];
+							tmpIndices[gfxindex].m_values[1] = tri_indices[1];
+							tmpIndices[gfxindex].m_values[2] = tri_indices[2];
+						}
+						serializer->finalizeChunk(chunk,"btShortIntIndexTripletData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
+					}
+					break;
+				}
+				case PHY_UCHAR:
+				{
+					if (numtriangles)
+					{
+						btChunk* chunk = serializer->allocate(sizeof(btCharIndexTripletData),numtriangles);
+						btCharIndexTripletData* tmpIndices = (btCharIndexTripletData*)chunk->m_oldPtr;
+						memPtr->m_3indices8 = (btCharIndexTripletData*) serializer->getUniquePointer(tmpIndices);
+						for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
+						{
+							unsigned char* tri_indices= (unsigned char*)(indexbase+gfxindex*indexstride);
+							tmpIndices[gfxindex].m_values[0] = tri_indices[0];
+							tmpIndices[gfxindex].m_values[1] = tri_indices[1];
+							tmpIndices[gfxindex].m_values[2] = tri_indices[2];
+						}
+						serializer->finalizeChunk(chunk,"btCharIndexTripletData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
+					}
+					break;
+				}
+			default:
+				{
+					btAssert(0);
+					//unknown index type
+				}
+			}
+
+			switch (type)
+			{
+			case PHY_FLOAT:
+			 {
+				 float* graphicsbase;
+
+				 if (numverts)
+				 {
+					 btChunk* chunk = serializer->allocate(sizeof(btVector3FloatData),numverts);
+					 btVector3FloatData* tmpVertices = (btVector3FloatData*) chunk->m_oldPtr;
+					 memPtr->m_vertices3f = (btVector3FloatData *)serializer->getUniquePointer(tmpVertices);
+					 for (int i=0;i<numverts;i++)
+					 {
+						 graphicsbase = (float*)(vertexbase+i*stride);
+						 tmpVertices[i].m_floats[0] = graphicsbase[0];
+						 tmpVertices[i].m_floats[1] = graphicsbase[1];
+						 tmpVertices[i].m_floats[2] = graphicsbase[2];
+					 }
+					 serializer->finalizeChunk(chunk,"btVector3FloatData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
+				 }
+				 break;
+				}
+
+			case PHY_DOUBLE:
+				{
+					if (numverts)
+					{
+						btChunk* chunk = serializer->allocate(sizeof(btVector3DoubleData),numverts);
+						btVector3DoubleData* tmpVertices = (btVector3DoubleData*) chunk->m_oldPtr;
+						memPtr->m_vertices3d = (btVector3DoubleData *) serializer->getUniquePointer(tmpVertices);
+						for (int i=0;i<numverts;i++)
+					 {
+						 double* graphicsbase = (double*)(vertexbase+i*stride);//for now convert to float, might leave it at double
+						 tmpVertices[i].m_floats[0] = graphicsbase[0];
+						 tmpVertices[i].m_floats[1] = graphicsbase[1];
+						 tmpVertices[i].m_floats[2] = graphicsbase[2];
+					 }
+						serializer->finalizeChunk(chunk,"btVector3DoubleData",BT_ARRAY_CODE,(void*)chunk->m_oldPtr);
+					}
+					break;
+				}
+
+			default:
+				btAssert((type == PHY_FLOAT) || (type == PHY_DOUBLE));
+			}
+
+			unLockReadOnlyVertexBase(part);
+		}
+
+		serializer->finalizeChunk(chunk,"btMeshPartData",BT_ARRAY_CODE,chunk->m_oldPtr);
+	}
+
+
+	m_scaling.serializeFloat(trimeshData->m_scaling);
+	return "btStridingMeshInterfaceData";
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h
new file mode 100644
index 0000000..f2b27ad
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h
@@ -0,0 +1,162 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_STRIDING_MESHINTERFACE_H
+#define BT_STRIDING_MESHINTERFACE_H
+
+#include "LinearMath/btVector3.h"
+#include "btTriangleCallback.h"
+#include "btConcaveShape.h"
+
+
+
+
+
+///	The btStridingMeshInterface is the interface class for high performance generic access to triangle meshes, used in combination with btBvhTriangleMeshShape and some other collision shapes.
+/// Using index striding of 3*sizeof(integer) it can use triangle arrays, using index striding of 1*sizeof(integer) it can handle triangle strips.
+/// It allows for sharing graphics and collision meshes. Also it provides locking/unlocking of graphics meshes that are in gpu memory.
+class  btStridingMeshInterface
+{
+	protected:
+	
+		btVector3 m_scaling;
+
+	public:
+		btStridingMeshInterface() :m_scaling(btScalar(1.),btScalar(1.),btScalar(1.))
+		{
+
+		}
+
+		virtual ~btStridingMeshInterface();
+
+
+
+		virtual void	InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+		///brute force method to calculate aabb
+		void	calculateAabbBruteForce(btVector3& aabbMin,btVector3& aabbMax);
+
+		/// get read and write access to a subpart of a triangle mesh
+		/// this subpart has a continuous array of vertices and indices
+		/// in this way the mesh can be handled as chunks of memory with striding
+		/// very similar to OpenGL vertexarray support
+		/// make a call to unLockVertexBase when the read and write access is finished	
+		virtual void	getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0)=0;
+		
+		virtual void	getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const=0;
+	
+		/// unLockVertexBase finishes the access to a subpart of the triangle mesh
+		/// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
+		virtual void	unLockVertexBase(int subpart)=0;
+
+		virtual void	unLockReadOnlyVertexBase(int subpart) const=0;
+
+
+		/// getNumSubParts returns the number of seperate subparts
+		/// each subpart has a continuous array of vertices and indices
+		virtual int		getNumSubParts() const=0;
+
+		virtual void	preallocateVertices(int numverts)=0;
+		virtual void	preallocateIndices(int numindices)=0;
+
+		virtual bool	hasPremadeAabb() const { return false; }
+		virtual void	setPremadeAabb(const btVector3& aabbMin, const btVector3& aabbMax ) const
+                {
+                        (void) aabbMin;
+                        (void) aabbMax;
+                }
+		virtual void	getPremadeAabb(btVector3* aabbMin, btVector3* aabbMax ) const
+        {
+            (void) aabbMin;
+            (void) aabbMax;
+        }
+
+		const btVector3&	getScaling() const {
+			return m_scaling;
+		}
+		void	setScaling(const btVector3& scaling)
+		{
+			m_scaling = scaling;
+		}
+
+		virtual	int	calculateSerializeBufferSize() const;
+
+		///fills the dataBuffer and returns the struct name (and 0 on failure)
+		virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+
+};
+
+struct	btIntIndexData
+{
+	int	m_value;
+};
+
+struct	btShortIntIndexData
+{
+	short m_value;
+	char m_pad[2];
+};
+
+struct	btShortIntIndexTripletData
+{
+	short	m_values[3];
+	char	m_pad[2];
+};
+
+struct	btCharIndexTripletData
+{
+	unsigned char m_values[3];
+	char	m_pad;
+};
+
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btMeshPartData
+{
+	btVector3FloatData			*m_vertices3f;
+	btVector3DoubleData			*m_vertices3d;
+
+	btIntIndexData				*m_indices32;
+	btShortIntIndexTripletData	*m_3indices16;
+	btCharIndexTripletData		*m_3indices8;
+
+	btShortIntIndexData			*m_indices16;//backwards compatibility
+
+	int                     m_numTriangles;//length of m_indices = m_numTriangles
+	int                     m_numVertices;
+};
+
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btStridingMeshInterfaceData
+{
+	btMeshPartData	*m_meshPartsPtr;
+	btVector3FloatData	m_scaling;
+	int	m_numMeshParts;
+	char m_padding[4];
+};
+
+
+
+
+SIMD_FORCE_INLINE	int	btStridingMeshInterface::calculateSerializeBufferSize() const
+{
+	return sizeof(btStridingMeshInterfaceData);
+}
+
+
+
+#endif //BT_STRIDING_MESHINTERFACE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp
new file mode 100644
index 0000000..52f346b
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.cpp
@@ -0,0 +1,218 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btTetrahedronShape.h"
+#include "LinearMath/btMatrix3x3.h"
+
+btBU_Simplex1to4::btBU_Simplex1to4() : btPolyhedralConvexAabbCachingShape (),
+m_numVertices(0)
+{
+	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
+}
+
+btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0) : btPolyhedralConvexAabbCachingShape (),
+m_numVertices(0)
+{
+	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
+	addVertex(pt0);
+}
+
+btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1) : btPolyhedralConvexAabbCachingShape (),
+m_numVertices(0)
+{
+	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
+	addVertex(pt0);
+	addVertex(pt1);
+}
+
+btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2) : btPolyhedralConvexAabbCachingShape (),
+m_numVertices(0)
+{
+	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
+	addVertex(pt0);
+	addVertex(pt1);
+	addVertex(pt2);
+}
+
+btBU_Simplex1to4::btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3) : btPolyhedralConvexAabbCachingShape (),
+m_numVertices(0)
+{
+	m_shapeType = TETRAHEDRAL_SHAPE_PROXYTYPE;
+	addVertex(pt0);
+	addVertex(pt1);
+	addVertex(pt2);
+	addVertex(pt3);
+}
+
+
+void btBU_Simplex1to4::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+#if 1
+	btPolyhedralConvexAabbCachingShape::getAabb(t,aabbMin,aabbMax);
+#else
+	aabbMin.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);
+	aabbMax.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);
+
+	//just transform the vertices in worldspace, and take their AABB
+	for (int i=0;i<m_numVertices;i++)
+	{
+		btVector3 worldVertex = t(m_vertices[i]);
+		aabbMin.setMin(worldVertex);
+		aabbMax.setMax(worldVertex);
+	}
+#endif
+}
+
+
+
+
+
+void btBU_Simplex1to4::addVertex(const btVector3& pt)
+{
+	m_vertices[m_numVertices++] = pt;
+	recalcLocalAabb();
+}
+
+
+int	btBU_Simplex1to4::getNumVertices() const
+{
+	return m_numVertices;
+}
+
+int btBU_Simplex1to4::getNumEdges() const
+{
+	//euler formula, F-E+V = 2, so E = F+V-2
+
+	switch (m_numVertices)
+	{
+	case 0:
+		return 0;
+	case 1: return 0;
+	case 2: return 1;
+	case 3: return 3;
+	case 4: return 6;
+
+
+	}
+
+	return 0;
+}
+
+void btBU_Simplex1to4::getEdge(int i,btVector3& pa,btVector3& pb) const
+{
+	
+    switch (m_numVertices)
+	{
+
+	case 2: 
+		pa = m_vertices[0];
+		pb = m_vertices[1];
+		break;
+	case 3:  
+		switch (i)
+		{
+		case 0:
+			pa = m_vertices[0];
+			pb = m_vertices[1];
+			break;
+		case 1:
+			pa = m_vertices[1];
+			pb = m_vertices[2];
+			break;
+		case 2:
+			pa = m_vertices[2];
+			pb = m_vertices[0];
+			break;
+
+		}
+		break;
+	case 4: 
+		switch (i)
+		{
+		case 0:
+			pa = m_vertices[0];
+			pb = m_vertices[1];
+			break;
+		case 1:
+			pa = m_vertices[1];
+			pb = m_vertices[2];
+			break;
+		case 2:
+			pa = m_vertices[2];
+			pb = m_vertices[0];
+			break;
+		case 3:
+			pa = m_vertices[0];
+			pb = m_vertices[3];
+			break;
+		case 4:
+			pa = m_vertices[1];
+			pb = m_vertices[3];
+			break;
+		case 5:
+			pa = m_vertices[2];
+			pb = m_vertices[3];
+			break;
+		}
+
+	}
+
+
+
+
+}
+
+void btBU_Simplex1to4::getVertex(int i,btVector3& vtx) const
+{
+	vtx = m_vertices[i];
+}
+
+int	btBU_Simplex1to4::getNumPlanes() const
+{
+	switch (m_numVertices)
+	{
+	case 0:
+			return 0;
+	case 1:
+			return 0;
+	case 2:
+			return 0;
+	case 3:
+			return 2;
+	case 4:
+			return 4;
+	default:
+		{
+		}
+	}
+	return 0;
+}
+
+
+void btBU_Simplex1to4::getPlane(btVector3&, btVector3& ,int ) const
+{
+	
+}
+
+int btBU_Simplex1to4::getIndex(int ) const
+{
+	return 0;
+}
+
+bool btBU_Simplex1to4::isInside(const btVector3& ,btScalar ) const
+{
+	return false;
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h
new file mode 100644
index 0000000..6b7128e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTetrahedronShape.h
@@ -0,0 +1,74 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SIMPLEX_1TO4_SHAPE
+#define BT_SIMPLEX_1TO4_SHAPE
+
+
+#include "btPolyhedralConvexShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+
+
+///The btBU_Simplex1to4 implements tetrahedron, triangle, line, vertex collision shapes. In most cases it is better to use btConvexHullShape instead.
+class btBU_Simplex1to4 : public btPolyhedralConvexAabbCachingShape
+{
+protected:
+
+	int	m_numVertices;
+	btVector3	m_vertices[4];
+
+public:
+	btBU_Simplex1to4();
+
+	btBU_Simplex1to4(const btVector3& pt0);
+	btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1);
+	btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2);
+	btBU_Simplex1to4(const btVector3& pt0,const btVector3& pt1,const btVector3& pt2,const btVector3& pt3);
+
+    
+	void	reset()
+	{
+		m_numVertices = 0;
+	}
+	
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	void addVertex(const btVector3& pt);
+
+	//PolyhedralConvexShape interface
+
+	virtual int	getNumVertices() const;
+
+	virtual int getNumEdges() const;
+
+	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const;
+	
+	virtual void getVertex(int i,btVector3& vtx) const;
+
+	virtual int	getNumPlanes() const;
+
+	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i) const;
+
+	virtual int getIndex(int i) const;
+
+	virtual	bool isInside(const btVector3& pt,btScalar tolerance) const;
+
+
+	///getName is for debugging
+	virtual const char*	getName()const { return "btBU_Simplex1to4";}
+
+};
+
+#endif //BT_SIMPLEX_1TO4_SHAPE
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp
new file mode 100644
index 0000000..3027e65
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp
@@ -0,0 +1,35 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btTriangleBuffer.h"
+
+
+
+
+
+
+
+void btTriangleBuffer::processTriangle(btVector3* triangle,int partId,int  triangleIndex)
+{
+		btTriangle	tri;
+		tri.m_vertex0 = triangle[0];
+		tri.m_vertex1 = triangle[1];
+		tri.m_vertex2 = triangle[2];
+		tri.m_partId = partId;
+		tri.m_triangleIndex = triangleIndex;
+			
+		m_triangleBuffer.push_back(tri);
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.h
new file mode 100644
index 0000000..b71fc8b
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleBuffer.h
@@ -0,0 +1,69 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_TRIANGLE_BUFFER_H
+#define BT_TRIANGLE_BUFFER_H
+
+#include "btTriangleCallback.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+struct	btTriangle
+{
+	btVector3	m_vertex0;
+	btVector3	m_vertex1;
+	btVector3	m_vertex2;
+	int	m_partId;
+	int	m_triangleIndex;
+};
+
+///The btTriangleBuffer callback can be useful to collect and store overlapping triangles between AABB and concave objects that support 'processAllTriangles'
+///Example usage of this class:
+///			btTriangleBuffer	triBuf;
+///			concaveShape->processAllTriangles(&triBuf,aabbMin, aabbMax);
+///			for (int i=0;i<triBuf.getNumTriangles();i++)
+///			{
+///				const btTriangle& tri = triBuf.getTriangle(i);
+///				//do something useful here with the triangle
+///			}
+class btTriangleBuffer : public btTriangleCallback
+{
+
+	btAlignedObjectArray<btTriangle>	m_triangleBuffer;
+	
+public:
+
+
+	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
+	
+	int	getNumTriangles() const
+	{
+		return int(m_triangleBuffer.size());
+	}
+	
+	const btTriangle&	getTriangle(int index) const
+	{
+		return m_triangleBuffer[index];
+	}
+
+	void	clearBuffer()
+	{
+		m_triangleBuffer.clear();
+	}
+	
+};
+
+
+#endif //BT_TRIANGLE_BUFFER_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp
new file mode 100644
index 0000000..f558bf6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.cpp
@@ -0,0 +1,28 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btTriangleCallback.h"
+
+btTriangleCallback::~btTriangleCallback()
+{
+
+}
+
+
+btInternalTriangleIndexCallback::~btInternalTriangleIndexCallback()
+{
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h
new file mode 100644
index 0000000..461c57f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleCallback.h
@@ -0,0 +1,42 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_TRIANGLE_CALLBACK_H
+#define BT_TRIANGLE_CALLBACK_H
+
+#include "LinearMath/btVector3.h"
+
+
+///The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTriangles.
+///This callback is called by processAllTriangles for all btConcaveShape derived class, such as  btBvhTriangleMeshShape, btStaticPlaneShape and btHeightfieldTerrainShape.
+class btTriangleCallback
+{
+public:
+
+	virtual ~btTriangleCallback();
+	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) = 0;
+};
+
+class btInternalTriangleIndexCallback
+{
+public:
+
+	virtual ~btInternalTriangleIndexCallback();
+	virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int  triangleIndex) = 0;
+};
+
+
+
+#endif //BT_TRIANGLE_CALLBACK_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
new file mode 100644
index 0000000..a665024
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
@@ -0,0 +1,95 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btTriangleIndexVertexArray.h"
+
+btTriangleIndexVertexArray::btTriangleIndexVertexArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,int numVertices,btScalar* vertexBase,int vertexStride)
+: m_hasAabb(0)
+{
+	btIndexedMesh mesh;
+
+	mesh.m_numTriangles = numTriangles;
+	mesh.m_triangleIndexBase = (const unsigned char *)triangleIndexBase;
+	mesh.m_triangleIndexStride = triangleIndexStride;
+	mesh.m_numVertices = numVertices;
+	mesh.m_vertexBase = (const unsigned char *)vertexBase;
+	mesh.m_vertexStride = vertexStride;
+
+	addIndexedMesh(mesh);
+
+}
+
+btTriangleIndexVertexArray::~btTriangleIndexVertexArray()
+{
+
+}
+
+void	btTriangleIndexVertexArray::getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart)
+{
+	btAssert(subpart< getNumSubParts() );
+
+	btIndexedMesh& mesh = m_indexedMeshes[subpart];
+
+	numverts = mesh.m_numVertices;
+	(*vertexbase) = (unsigned char *) mesh.m_vertexBase;
+
+   type = mesh.m_vertexType;
+
+	vertexStride = mesh.m_vertexStride;
+
+	numfaces = mesh.m_numTriangles;
+
+	(*indexbase) = (unsigned char *)mesh.m_triangleIndexBase;
+	indexstride = mesh.m_triangleIndexStride;
+	indicestype = mesh.m_indexType;
+}
+
+void	btTriangleIndexVertexArray::getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) const
+{
+	const btIndexedMesh& mesh = m_indexedMeshes[subpart];
+
+	numverts = mesh.m_numVertices;
+	(*vertexbase) = (const unsigned char *)mesh.m_vertexBase;
+
+   type = mesh.m_vertexType;
+   
+	vertexStride = mesh.m_vertexStride;
+
+	numfaces = mesh.m_numTriangles;
+	(*indexbase) = (const unsigned char *)mesh.m_triangleIndexBase;
+	indexstride = mesh.m_triangleIndexStride;
+	indicestype = mesh.m_indexType;
+}
+
+bool	btTriangleIndexVertexArray::hasPremadeAabb() const
+{
+	return (m_hasAabb == 1);
+}
+
+
+void	btTriangleIndexVertexArray::setPremadeAabb(const btVector3& aabbMin, const btVector3& aabbMax ) const
+{
+	m_aabbMin = aabbMin;
+	m_aabbMax = aabbMax;
+	m_hasAabb = 1; // this is intentionally an int see notes in header
+}
+
+void	btTriangleIndexVertexArray::getPremadeAabb(btVector3* aabbMin, btVector3* aabbMax ) const
+{
+	*aabbMin = m_aabbMin;
+	*aabbMax = m_aabbMax;
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h
new file mode 100644
index 0000000..c64ea6e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h
@@ -0,0 +1,131 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_TRIANGLE_INDEX_VERTEX_ARRAY_H
+#define BT_TRIANGLE_INDEX_VERTEX_ARRAY_H
+
+#include "btStridingMeshInterface.h"
+#include "LinearMath/btAlignedObjectArray.h"
+#include "LinearMath/btScalar.h"
+
+
+///The btIndexedMesh indexes a single vertex and index array. Multiple btIndexedMesh objects can be passed into a btTriangleIndexVertexArray using addIndexedMesh.
+///Instead of the number of indices, we pass the number of triangles.
+ATTRIBUTE_ALIGNED16( struct)	btIndexedMesh
+{
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+   int                     m_numTriangles;
+   const unsigned char *   m_triangleIndexBase;
+   int                     m_triangleIndexStride;
+   int                     m_numVertices;
+   const unsigned char *   m_vertexBase;
+   int                     m_vertexStride;
+
+   // The index type is set when adding an indexed mesh to the
+   // btTriangleIndexVertexArray, do not set it manually
+   PHY_ScalarType m_indexType;
+
+   // The vertex type has a default type similar to Bullet's precision mode (float or double)
+   // but can be set manually if you for example run Bullet with double precision but have
+   // mesh data in single precision..
+   PHY_ScalarType m_vertexType;
+
+
+   btIndexedMesh()
+	   :m_indexType(PHY_INTEGER),
+#ifdef BT_USE_DOUBLE_PRECISION
+      m_vertexType(PHY_DOUBLE)
+#else // BT_USE_DOUBLE_PRECISION
+      m_vertexType(PHY_FLOAT)
+#endif // BT_USE_DOUBLE_PRECISION
+      {
+      }
+}
+;
+
+
+typedef btAlignedObjectArray<btIndexedMesh>	IndexedMeshArray;
+
+///The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing triangle/index arrays.
+///Additional meshes can be added using addIndexedMesh
+///No duplcate is made of the vertex/index data, it only indexes into external vertex/index arrays.
+///So keep those arrays around during the lifetime of this btTriangleIndexVertexArray.
+ATTRIBUTE_ALIGNED16( class) btTriangleIndexVertexArray : public btStridingMeshInterface
+{
+protected:
+	IndexedMeshArray	m_indexedMeshes;
+	int m_pad[2];
+	mutable int m_hasAabb; // using int instead of bool to maintain alignment
+	mutable btVector3 m_aabbMin;
+	mutable btVector3 m_aabbMax;
+
+public:
+
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btTriangleIndexVertexArray() : m_hasAabb(0)
+	{
+	}
+
+	virtual ~btTriangleIndexVertexArray();
+
+	//just to be backwards compatible
+	btTriangleIndexVertexArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,int numVertices,btScalar* vertexBase,int vertexStride);
+	
+	void	addIndexedMesh(const btIndexedMesh& mesh, PHY_ScalarType indexType = PHY_INTEGER)
+	{
+		m_indexedMeshes.push_back(mesh);
+		m_indexedMeshes[m_indexedMeshes.size()-1].m_indexType = indexType;
+	}
+	
+	
+	virtual void	getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0);
+
+	virtual void	getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const;
+
+	/// unLockVertexBase finishes the access to a subpart of the triangle mesh
+	/// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
+	virtual void	unLockVertexBase(int subpart) {(void)subpart;}
+
+	virtual void	unLockReadOnlyVertexBase(int subpart) const {(void)subpart;}
+
+	/// getNumSubParts returns the number of seperate subparts
+	/// each subpart has a continuous array of vertices and indices
+	virtual int		getNumSubParts() const { 
+		return (int)m_indexedMeshes.size();
+	}
+
+	IndexedMeshArray&	getIndexedMeshArray()
+	{
+		return m_indexedMeshes;
+	}
+
+	const IndexedMeshArray&	getIndexedMeshArray() const
+	{
+		return m_indexedMeshes;
+	}
+
+	virtual void	preallocateVertices(int numverts){(void) numverts;}
+	virtual void	preallocateIndices(int numindices){(void) numindices;}
+
+	virtual bool	hasPremadeAabb() const;
+	virtual void	setPremadeAabb(const btVector3& aabbMin, const btVector3& aabbMax ) const;
+	virtual void	getPremadeAabb(btVector3* aabbMin, btVector3* aabbMax ) const;
+
+}
+;
+
+#endif //BT_TRIANGLE_INDEX_VERTEX_ARRAY_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
new file mode 100644
index 0000000..dc56294
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
@@ -0,0 +1,86 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///This file was created by Alex Silverman
+
+#include "btTriangleIndexVertexMaterialArray.h"
+
+btTriangleIndexVertexMaterialArray::btTriangleIndexVertexMaterialArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,
+                                   int numVertices,btScalar* vertexBase,int vertexStride,
+                                   int numMaterials, unsigned char* materialBase, int materialStride,
+                                   int* triangleMaterialsBase, int materialIndexStride) :
+btTriangleIndexVertexArray(numTriangles, triangleIndexBase, triangleIndexStride, numVertices, vertexBase, vertexStride)
+{
+    btMaterialProperties mat;
+
+    mat.m_numMaterials = numMaterials;
+    mat.m_materialBase = materialBase;
+    mat.m_materialStride = materialStride;
+#ifdef BT_USE_DOUBLE_PRECISION
+    mat.m_materialType = PHY_DOUBLE;
+#else
+    mat.m_materialType = PHY_FLOAT;
+#endif
+
+    mat.m_numTriangles = numTriangles;
+    mat.m_triangleMaterialsBase = (unsigned char *)triangleMaterialsBase;
+    mat.m_triangleMaterialStride = materialIndexStride;
+    mat.m_triangleType = PHY_INTEGER;
+
+    addMaterialProperties(mat);
+}
+
+
+void btTriangleIndexVertexMaterialArray::getLockedMaterialBase(unsigned char **materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
+                                   unsigned char ** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType, int subpart)
+{
+    btAssert(subpart< getNumSubParts() );
+
+    btMaterialProperties& mats = m_materials[subpart];
+
+    numMaterials = mats.m_numMaterials;
+    (*materialBase) = (unsigned char *) mats.m_materialBase;
+#ifdef BT_USE_DOUBLE_PRECISION
+    materialType = PHY_DOUBLE;
+#else
+    materialType = PHY_FLOAT;
+#endif
+    materialStride = mats.m_materialStride;
+
+    numTriangles = mats.m_numTriangles;
+    (*triangleMaterialBase) = (unsigned char *)mats.m_triangleMaterialsBase;
+    triangleMaterialStride = mats.m_triangleMaterialStride;
+    triangleType = mats.m_triangleType;
+}
+
+void btTriangleIndexVertexMaterialArray::getLockedReadOnlyMaterialBase(const unsigned char **materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
+                                           const unsigned char ** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType, int subpart)
+{
+    btMaterialProperties& mats = m_materials[subpart];
+
+    numMaterials = mats.m_numMaterials;
+    (*materialBase) = (const unsigned char *) mats.m_materialBase;
+#ifdef BT_USE_DOUBLE_PRECISION
+    materialType = PHY_DOUBLE;
+#else
+    materialType = PHY_FLOAT;
+#endif
+    materialStride = mats.m_materialStride;
+
+    numTriangles = mats.m_numTriangles;
+    (*triangleMaterialBase) = (const unsigned char *)mats.m_triangleMaterialsBase;
+    triangleMaterialStride = mats.m_triangleMaterialStride;
+    triangleType = mats.m_triangleType;
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h
new file mode 100644
index 0000000..ba4f7b4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h
@@ -0,0 +1,84 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///This file was created by Alex Silverman
+
+#ifndef BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
+#define BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
+
+#include "btTriangleIndexVertexArray.h"
+
+
+ATTRIBUTE_ALIGNED16( struct)	btMaterialProperties
+{
+    ///m_materialBase ==========> 2 btScalar values make up one material, friction then restitution
+    int m_numMaterials;
+    const unsigned char * m_materialBase;
+    int m_materialStride;
+    PHY_ScalarType m_materialType;
+    ///m_numTriangles <=========== This exists in the btIndexedMesh object for the same subpart, but since we're
+    ///                           padding the structure, it can be reproduced at no real cost
+    ///m_triangleMaterials =====> 1 integer value makes up one entry
+    ///                           eg: m_triangleMaterials[1] = 5; // This will set triangle 2 to use material 5
+    int m_numTriangles; 
+    const unsigned char * m_triangleMaterialsBase;
+    int m_triangleMaterialStride;
+    ///m_triangleType <========== Automatically set in addMaterialProperties
+    PHY_ScalarType m_triangleType;
+};
+
+typedef btAlignedObjectArray<btMaterialProperties>	MaterialArray;
+
+///Teh btTriangleIndexVertexMaterialArray is built on TriangleIndexVertexArray
+///The addition of a material array allows for the utilization of the partID and
+///triangleIndex that are returned in the ContactAddedCallback.  As with
+///TriangleIndexVertexArray, no duplicate is made of the material data, so it
+///is the users responsibility to maintain the array during the lifetime of the
+///TriangleIndexVertexMaterialArray.
+ATTRIBUTE_ALIGNED16(class) btTriangleIndexVertexMaterialArray : public btTriangleIndexVertexArray
+{
+protected:
+    MaterialArray       m_materials;
+		
+public:
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+    btTriangleIndexVertexMaterialArray()
+	{
+	}
+
+    btTriangleIndexVertexMaterialArray(int numTriangles,int* triangleIndexBase,int triangleIndexStride,
+        int numVertices,btScalar* vertexBase,int vertexStride,
+        int numMaterials, unsigned char* materialBase, int materialStride,
+        int* triangleMaterialsBase, int materialIndexStride);
+
+    virtual ~btTriangleIndexVertexMaterialArray() {}
+
+    void	addMaterialProperties(const btMaterialProperties& mat, PHY_ScalarType triangleType = PHY_INTEGER)
+    {
+        m_materials.push_back(mat);
+        m_materials[m_materials.size()-1].m_triangleType = triangleType;
+    }
+
+    virtual void getLockedMaterialBase(unsigned char **materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
+        unsigned char ** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType ,int subpart = 0);
+
+    virtual void getLockedReadOnlyMaterialBase(const unsigned char **materialBase, int& numMaterials, PHY_ScalarType& materialType, int& materialStride,
+        const unsigned char ** triangleMaterialBase, int& numTriangles, int& triangleMaterialStride, PHY_ScalarType& triangleType, int subpart = 0);
+
+}
+;
+
+#endif //BT_MULTIMATERIAL_TRIANGLE_INDEX_VERTEX_ARRAY_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleInfoMap.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleInfoMap.h
new file mode 100644
index 0000000..5aadfc6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleInfoMap.h
@@ -0,0 +1,240 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2010 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef _BT_TRIANGLE_INFO_MAP_H
+#define _BT_TRIANGLE_INFO_MAP_H
+
+
+#include "LinearMath/btHashMap.h"
+#include "LinearMath/btSerializer.h"
+
+
+///for btTriangleInfo m_flags
+#define TRI_INFO_V0V1_CONVEX 1
+#define TRI_INFO_V1V2_CONVEX 2
+#define TRI_INFO_V2V0_CONVEX 4
+
+#define TRI_INFO_V0V1_SWAP_NORMALB 8
+#define TRI_INFO_V1V2_SWAP_NORMALB 16
+#define TRI_INFO_V2V0_SWAP_NORMALB 32
+
+
+///The btTriangleInfo structure stores information to adjust collision normals to avoid collisions against internal edges
+///it can be generated using 
+struct	btTriangleInfo
+{
+	btTriangleInfo()
+	{
+		m_edgeV0V1Angle = SIMD_2_PI;
+		m_edgeV1V2Angle = SIMD_2_PI;
+		m_edgeV2V0Angle = SIMD_2_PI;
+		m_flags=0;
+	}
+
+	int			m_flags;
+
+	btScalar	m_edgeV0V1Angle;
+	btScalar	m_edgeV1V2Angle;
+	btScalar	m_edgeV2V0Angle;
+
+};
+
+typedef btHashMap<btHashInt,btTriangleInfo> btInternalTriangleInfoMap;
+
+
+///The btTriangleInfoMap stores edge angle information for some triangles. You can compute this information yourself or using btGenerateInternalEdgeInfo.
+struct	btTriangleInfoMap : public btInternalTriangleInfoMap
+{
+	btScalar	m_convexEpsilon;///used to determine if an edge or contact normal is convex, using the dot product
+	btScalar	m_planarEpsilon; ///used to determine if a triangle edge is planar with zero angle
+	btScalar	m_equalVertexThreshold; ///used to compute connectivity: if the distance between two vertices is smaller than m_equalVertexThreshold, they are considered to be 'shared'
+	btScalar	m_edgeDistanceThreshold; ///used to determine edge contacts: if the closest distance between a contact point and an edge is smaller than this distance threshold it is considered to "hit the edge"
+	btScalar	m_maxEdgeAngleThreshold; //ignore edges that connect triangles at an angle larger than this m_maxEdgeAngleThreshold
+	btScalar	m_zeroAreaThreshold; ///used to determine if a triangle is degenerate (length squared of cross product of 2 triangle edges < threshold)
+	
+	
+	btTriangleInfoMap()
+	{
+		m_convexEpsilon = 0.00f;
+		m_planarEpsilon = 0.0001f;
+		m_equalVertexThreshold = btScalar(0.0001)*btScalar(0.0001);
+		m_edgeDistanceThreshold = btScalar(0.1);
+		m_zeroAreaThreshold = btScalar(0.0001)*btScalar(0.0001);
+		m_maxEdgeAngleThreshold = SIMD_2_PI;
+	}
+	virtual ~btTriangleInfoMap() {}
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+	void	deSerialize(struct btTriangleInfoMapData& data);
+
+};
+
+struct	btTriangleInfoData
+{
+	int			m_flags;
+	float	m_edgeV0V1Angle;
+	float	m_edgeV1V2Angle;
+	float	m_edgeV2V0Angle;
+};
+
+struct	btTriangleInfoMapData
+{
+	int					*m_hashTablePtr;
+	int					*m_nextPtr;
+	btTriangleInfoData	*m_valueArrayPtr;
+	int					*m_keyArrayPtr;
+
+	float	m_convexEpsilon;
+	float	m_planarEpsilon;
+	float	m_equalVertexThreshold; 
+	float	m_edgeDistanceThreshold;
+	float	m_zeroAreaThreshold;
+
+	int		m_nextSize;
+	int		m_hashTableSize;
+	int		m_numValues;
+	int		m_numKeys;
+	char	m_padding[4];
+};
+
+SIMD_FORCE_INLINE	int	btTriangleInfoMap::calculateSerializeBufferSize() const
+{
+	return sizeof(btTriangleInfoMapData);
+}
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btTriangleInfoMap::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btTriangleInfoMapData* tmapData = (btTriangleInfoMapData*) dataBuffer;
+	tmapData->m_convexEpsilon = m_convexEpsilon;
+	tmapData->m_planarEpsilon = m_planarEpsilon;
+	tmapData->m_equalVertexThreshold = m_equalVertexThreshold;
+	tmapData->m_edgeDistanceThreshold = m_edgeDistanceThreshold;
+	tmapData->m_zeroAreaThreshold = m_zeroAreaThreshold;
+	
+	tmapData->m_hashTableSize = m_hashTable.size();
+
+	tmapData->m_hashTablePtr = tmapData->m_hashTableSize ? (int*)serializer->getUniquePointer((void*)&m_hashTable[0]) : 0;
+	if (tmapData->m_hashTablePtr)
+	{ 
+		//serialize an int buffer
+		int sz = sizeof(int);
+		int numElem = tmapData->m_hashTableSize;
+		btChunk* chunk = serializer->allocate(sz,numElem);
+		int* memPtr = (int*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			*memPtr = m_hashTable[i];
+		}
+		serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*)&m_hashTable[0]);
+
+	}
+
+	tmapData->m_nextSize = m_next.size();
+	tmapData->m_nextPtr = tmapData->m_nextSize? (int*)serializer->getUniquePointer((void*)&m_next[0]): 0;
+	if (tmapData->m_nextPtr)
+	{
+		int sz = sizeof(int);
+		int numElem = tmapData->m_nextSize;
+		btChunk* chunk = serializer->allocate(sz,numElem);
+		int* memPtr = (int*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			*memPtr = m_next[i];
+		}
+		serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*)&m_next[0]);
+	}
+	
+	tmapData->m_numValues = m_valueArray.size();
+	tmapData->m_valueArrayPtr = tmapData->m_numValues ? (btTriangleInfoData*)serializer->getUniquePointer((void*)&m_valueArray[0]): 0;
+	if (tmapData->m_valueArrayPtr)
+	{
+		int sz = sizeof(btTriangleInfoData);
+		int numElem = tmapData->m_numValues;
+		btChunk* chunk = serializer->allocate(sz,numElem);
+		btTriangleInfoData* memPtr = (btTriangleInfoData*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			memPtr->m_edgeV0V1Angle = m_valueArray[i].m_edgeV0V1Angle;
+			memPtr->m_edgeV1V2Angle = m_valueArray[i].m_edgeV1V2Angle;
+			memPtr->m_edgeV2V0Angle = m_valueArray[i].m_edgeV2V0Angle;
+			memPtr->m_flags = m_valueArray[i].m_flags;
+		}
+		serializer->finalizeChunk(chunk,"btTriangleInfoData",BT_ARRAY_CODE,(void*) &m_valueArray[0]);
+	}
+	
+	tmapData->m_numKeys = m_keyArray.size();
+	tmapData->m_keyArrayPtr = tmapData->m_numKeys ? (int*)serializer->getUniquePointer((void*)&m_keyArray[0]) : 0;
+	if (tmapData->m_keyArrayPtr)
+	{
+		int sz = sizeof(int);
+		int numElem = tmapData->m_numValues;
+		btChunk* chunk = serializer->allocate(sz,numElem);
+		int* memPtr = (int*)chunk->m_oldPtr;
+		for (int i=0;i<numElem;i++,memPtr++)
+		{
+			*memPtr = m_keyArray[i].getUid1();
+		}
+		serializer->finalizeChunk(chunk,"int",BT_ARRAY_CODE,(void*) &m_keyArray[0]);
+
+	}
+	return "btTriangleInfoMapData";
+}
+
+
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	void	btTriangleInfoMap::deSerialize(btTriangleInfoMapData& tmapData )
+{
+
+
+	m_convexEpsilon = tmapData.m_convexEpsilon;
+	m_planarEpsilon = tmapData.m_planarEpsilon;
+	m_equalVertexThreshold = tmapData.m_equalVertexThreshold;
+	m_edgeDistanceThreshold = tmapData.m_edgeDistanceThreshold;
+	m_zeroAreaThreshold = tmapData.m_zeroAreaThreshold;
+	m_hashTable.resize(tmapData.m_hashTableSize);
+	int i =0;
+	for (i=0;i<tmapData.m_hashTableSize;i++)
+	{
+		m_hashTable[i] = tmapData.m_hashTablePtr[i];
+	}
+	m_next.resize(tmapData.m_nextSize);
+	for (i=0;i<tmapData.m_nextSize;i++)
+	{
+		m_next[i] = tmapData.m_nextPtr[i];
+	}
+	m_valueArray.resize(tmapData.m_numValues);
+	for (i=0;i<tmapData.m_numValues;i++)
+	{
+		m_valueArray[i].m_edgeV0V1Angle = tmapData.m_valueArrayPtr[i].m_edgeV0V1Angle;
+		m_valueArray[i].m_edgeV1V2Angle = tmapData.m_valueArrayPtr[i].m_edgeV1V2Angle;
+		m_valueArray[i].m_edgeV2V0Angle = tmapData.m_valueArrayPtr[i].m_edgeV2V0Angle;
+		m_valueArray[i].m_flags = tmapData.m_valueArrayPtr[i].m_flags;
+	}
+	
+	m_keyArray.resize(tmapData.m_numKeys,btHashInt(0));
+	for (i=0;i<tmapData.m_numKeys;i++)
+	{
+		m_keyArray[i].setUid1(tmapData.m_keyArrayPtr[i]);
+	}
+}
+
+
+#endif //_BT_TRIANGLE_INFO_MAP_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp
new file mode 100644
index 0000000..b29e0f7
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp
@@ -0,0 +1,140 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btTriangleMesh.h"
+
+
+
+btTriangleMesh::btTriangleMesh (bool use32bitIndices,bool use4componentVertices)
+:m_use32bitIndices(use32bitIndices),
+m_use4componentVertices(use4componentVertices),
+m_weldingThreshold(0.0)
+{
+	btIndexedMesh meshIndex;
+	meshIndex.m_numTriangles = 0;
+	meshIndex.m_numVertices = 0;
+	meshIndex.m_indexType = PHY_INTEGER;
+	meshIndex.m_triangleIndexBase = 0;
+	meshIndex.m_triangleIndexStride = 3*sizeof(int);
+	meshIndex.m_vertexBase = 0;
+	meshIndex.m_vertexStride = sizeof(btVector3);
+	m_indexedMeshes.push_back(meshIndex);
+
+	if (m_use32bitIndices)
+	{
+		m_indexedMeshes[0].m_numTriangles = m_32bitIndices.size()/3;
+		m_indexedMeshes[0].m_triangleIndexBase = 0;
+		m_indexedMeshes[0].m_indexType = PHY_INTEGER;
+		m_indexedMeshes[0].m_triangleIndexStride = 3*sizeof(int);
+	} else
+	{
+		m_indexedMeshes[0].m_numTriangles = m_16bitIndices.size()/3;
+		m_indexedMeshes[0].m_triangleIndexBase = 0;
+		m_indexedMeshes[0].m_indexType = PHY_SHORT;
+		m_indexedMeshes[0].m_triangleIndexStride = 3*sizeof(short int);
+	}
+
+	if (m_use4componentVertices)
+	{
+		m_indexedMeshes[0].m_numVertices = m_4componentVertices.size();
+		m_indexedMeshes[0].m_vertexBase = 0;
+		m_indexedMeshes[0].m_vertexStride = sizeof(btVector3);
+	} else
+	{
+		m_indexedMeshes[0].m_numVertices = m_3componentVertices.size()/3;
+		m_indexedMeshes[0].m_vertexBase = 0;
+		m_indexedMeshes[0].m_vertexStride = 3*sizeof(btScalar);
+	}
+
+
+}
+
+void	btTriangleMesh::addIndex(int index)
+{
+	if (m_use32bitIndices)
+	{
+		m_32bitIndices.push_back(index);
+		m_indexedMeshes[0].m_triangleIndexBase = (unsigned char*) &m_32bitIndices[0];
+	} else
+	{
+		m_16bitIndices.push_back(index);
+		m_indexedMeshes[0].m_triangleIndexBase = (unsigned char*) &m_16bitIndices[0];
+	}
+}
+
+
+int	btTriangleMesh::findOrAddVertex(const btVector3& vertex, bool removeDuplicateVertices)
+{
+	//return index of new/existing vertex
+	///@todo: could use acceleration structure for this
+	if (m_use4componentVertices)
+	{
+		if (removeDuplicateVertices)
+			{
+			for (int i=0;i< m_4componentVertices.size();i++)
+			{
+				if ((m_4componentVertices[i]-vertex).length2() <= m_weldingThreshold)
+				{
+					return i;
+				}
+			}
+		}
+		m_indexedMeshes[0].m_numVertices++;
+		m_4componentVertices.push_back(vertex);
+		m_indexedMeshes[0].m_vertexBase = (unsigned char*)&m_4componentVertices[0];
+
+		return m_4componentVertices.size()-1;
+		
+	} else
+	{
+		
+		if (removeDuplicateVertices)
+		{
+			for (int i=0;i< m_3componentVertices.size();i+=3)
+			{
+				btVector3 vtx(m_3componentVertices[i],m_3componentVertices[i+1],m_3componentVertices[i+2]);
+				if ((vtx-vertex).length2() <= m_weldingThreshold)
+				{
+					return i/3;
+				}
+			}
+	}
+		m_3componentVertices.push_back((float)vertex.getX());
+		m_3componentVertices.push_back((float)vertex.getY());
+		m_3componentVertices.push_back((float)vertex.getZ());
+		m_indexedMeshes[0].m_numVertices++;
+		m_indexedMeshes[0].m_vertexBase = (unsigned char*)&m_3componentVertices[0];
+		return (m_3componentVertices.size()/3)-1;
+	}
+
+}
+		
+void	btTriangleMesh::addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2,bool removeDuplicateVertices)
+{
+	m_indexedMeshes[0].m_numTriangles++;
+	addIndex(findOrAddVertex(vertex0,removeDuplicateVertices));
+	addIndex(findOrAddVertex(vertex1,removeDuplicateVertices));
+	addIndex(findOrAddVertex(vertex2,removeDuplicateVertices));
+}
+
+int btTriangleMesh::getNumTriangles() const
+{
+	if (m_use32bitIndices)
+	{
+		return m_32bitIndices.size() / 3;
+	}
+	return m_16bitIndices.size() / 3;
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h
new file mode 100644
index 0000000..f623157
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMesh.h
@@ -0,0 +1,69 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_TRIANGLE_MESH_H
+#define BT_TRIANGLE_MESH_H
+
+#include "btTriangleIndexVertexArray.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+///The btTriangleMesh class is a convenience class derived from btTriangleIndexVertexArray, that provides storage for a concave triangle mesh. It can be used as data for the btBvhTriangleMeshShape.
+///It allows either 32bit or 16bit indices, and 4 (x-y-z-w) or 3 (x-y-z) component vertices.
+///If you want to share triangle/index data between graphics mesh and collision mesh (btBvhTriangleMeshShape), you can directly use btTriangleIndexVertexArray or derive your own class from btStridingMeshInterface.
+///Performance of btTriangleMesh and btTriangleIndexVertexArray used in a btBvhTriangleMeshShape is the same.
+class btTriangleMesh : public btTriangleIndexVertexArray
+{
+	btAlignedObjectArray<btVector3>	m_4componentVertices;
+	btAlignedObjectArray<float>		m_3componentVertices;
+
+	btAlignedObjectArray<unsigned int>		m_32bitIndices;
+	btAlignedObjectArray<unsigned short int>		m_16bitIndices;
+	bool	m_use32bitIndices;
+	bool	m_use4componentVertices;
+	
+
+	public:
+		btScalar	m_weldingThreshold;
+
+		btTriangleMesh (bool use32bitIndices=true,bool use4componentVertices=true);
+
+		bool	getUse32bitIndices() const
+		{
+			return m_use32bitIndices;
+		}
+
+		bool	getUse4componentVertices() const
+		{
+			return m_use4componentVertices;
+		}
+		///By default addTriangle won't search for duplicate vertices, because the search is very slow for large triangle meshes.
+		///In general it is better to directly use btTriangleIndexVertexArray instead.
+		void	addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2, bool removeDuplicateVertices=false);
+		
+		int getNumTriangles() const;
+
+		virtual void	preallocateVertices(int numverts){(void) numverts;}
+		virtual void	preallocateIndices(int numindices){(void) numindices;}
+
+		///findOrAddVertex is an internal method, use addTriangle instead
+		int		findOrAddVertex(const btVector3& vertex, bool removeDuplicateVertices);
+		///addIndex is an internal method, use addTriangle instead
+		void	addIndex(int index);
+		
+};
+
+#endif //BT_TRIANGLE_MESH_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
new file mode 100644
index 0000000..683684d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
@@ -0,0 +1,211 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btTriangleMeshShape.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btQuaternion.h"
+#include "btStridingMeshInterface.h"
+#include "LinearMath/btAabbUtil2.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+
+
+btTriangleMeshShape::btTriangleMeshShape(btStridingMeshInterface* meshInterface)
+: btConcaveShape (), m_meshInterface(meshInterface)
+{
+	m_shapeType = TRIANGLE_MESH_SHAPE_PROXYTYPE;
+	if(meshInterface->hasPremadeAabb())
+	{
+		meshInterface->getPremadeAabb(&m_localAabbMin, &m_localAabbMax);
+	}
+	else
+	{
+		recalcLocalAabb();
+	}
+}
+
+
+btTriangleMeshShape::~btTriangleMeshShape()
+{
+		
+}
+
+
+
+
+void btTriangleMeshShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
+{
+
+	btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin);
+	localHalfExtents += btVector3(getMargin(),getMargin(),getMargin());
+	btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin);
+	
+	btMatrix3x3 abs_b = trans.getBasis().absolute();  
+
+	btVector3 center = trans(localCenter);
+
+	btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
+		   abs_b[1].dot(localHalfExtents),
+		  abs_b[2].dot(localHalfExtents));
+	aabbMin = center - extent;
+	aabbMax = center + extent;
+
+
+}
+
+void	btTriangleMeshShape::recalcLocalAabb()
+{
+	for (int i=0;i<3;i++)
+	{
+		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
+		vec[i] = btScalar(1.);
+		btVector3 tmp = localGetSupportingVertex(vec);
+		m_localAabbMax[i] = tmp[i]+m_collisionMargin;
+		vec[i] = btScalar(-1.);
+		tmp = localGetSupportingVertex(vec);
+		m_localAabbMin[i] = tmp[i]-m_collisionMargin;
+	}
+}
+
+
+
+class SupportVertexCallback : public btTriangleCallback
+{
+
+	btVector3 m_supportVertexLocal;
+public:
+
+	btTransform	m_worldTrans;
+	btScalar m_maxDot;
+	btVector3 m_supportVecLocal;
+
+	SupportVertexCallback(const btVector3& supportVecWorld,const btTransform& trans)
+		: m_supportVertexLocal(btScalar(0.),btScalar(0.),btScalar(0.)), m_worldTrans(trans) ,m_maxDot(btScalar(-BT_LARGE_FLOAT))
+		
+	{
+		m_supportVecLocal = supportVecWorld * m_worldTrans.getBasis();
+	}
+
+	virtual void processTriangle( btVector3* triangle,int partId, int triangleIndex)
+	{
+		(void)partId;
+		(void)triangleIndex;
+		for (int i=0;i<3;i++)
+		{
+			btScalar dot = m_supportVecLocal.dot(triangle[i]);
+			if (dot > m_maxDot)
+			{
+				m_maxDot = dot;
+				m_supportVertexLocal = triangle[i];
+			}
+		}
+	}
+
+	btVector3 GetSupportVertexWorldSpace()
+	{
+		return m_worldTrans(m_supportVertexLocal);
+	}
+
+	btVector3	GetSupportVertexLocal()
+	{
+		return m_supportVertexLocal;
+	}
+
+};
+
+	
+void btTriangleMeshShape::setLocalScaling(const btVector3& scaling)
+{
+	m_meshInterface->setScaling(scaling);
+	recalcLocalAabb();
+}
+
+const btVector3& btTriangleMeshShape::getLocalScaling() const
+{
+	return m_meshInterface->getScaling();
+}
+
+
+
+
+
+
+//#define DEBUG_TRIANGLE_MESH
+
+
+
+void	btTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+		struct FilteredCallback : public btInternalTriangleIndexCallback
+	{
+		btTriangleCallback* m_callback;
+		btVector3 m_aabbMin;
+		btVector3 m_aabbMax;
+
+		FilteredCallback(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax)
+			:m_callback(callback),
+			m_aabbMin(aabbMin),
+			m_aabbMax(aabbMax)
+		{
+		}
+
+		virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex)
+		{
+			if (TestTriangleAgainstAabb2(&triangle[0],m_aabbMin,m_aabbMax))
+			{
+				//check aabb in triangle-space, before doing this
+				m_callback->processTriangle(triangle,partId,triangleIndex);
+			}
+			
+		}
+
+	};
+
+	FilteredCallback filterCallback(callback,aabbMin,aabbMax);
+
+	m_meshInterface->InternalProcessAllTriangles(&filterCallback,aabbMin,aabbMax);
+}
+
+
+
+
+
+void	btTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	(void)mass;
+	//moving concave objects not supported
+	btAssert(0);
+	inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+}
+
+
+btVector3 btTriangleMeshShape::localGetSupportingVertex(const btVector3& vec) const
+{
+	btVector3 supportVertex;
+
+	btTransform ident;
+	ident.setIdentity();
+
+	SupportVertexCallback supportCallback(vec,ident);
+
+	btVector3 aabbMax(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+	
+	processAllTriangles(&supportCallback,-aabbMax,aabbMax);
+		
+	supportVertex = supportCallback.GetSupportVertexLocal();
+
+	return supportVertex;
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h
new file mode 100644
index 0000000..c8caf8f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h
@@ -0,0 +1,89 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_TRIANGLE_MESH_SHAPE_H
+#define BT_TRIANGLE_MESH_SHAPE_H
+
+#include "btConcaveShape.h"
+#include "btStridingMeshInterface.h"
+
+
+///The btTriangleMeshShape is an internal concave triangle mesh interface. Don't use this class directly, use btBvhTriangleMeshShape instead.
+class btTriangleMeshShape : public btConcaveShape
+{
+protected:
+	btVector3	m_localAabbMin;
+	btVector3	m_localAabbMax;
+	btStridingMeshInterface* m_meshInterface;
+
+	///btTriangleMeshShape constructor has been disabled/protected, so that users will not mistakenly use this class.
+	///Don't use btTriangleMeshShape but use btBvhTriangleMeshShape instead!
+	btTriangleMeshShape(btStridingMeshInterface* meshInterface);
+
+public:
+
+	virtual ~btTriangleMeshShape();
+
+	virtual btVector3 localGetSupportingVertex(const btVector3& vec) const;
+
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+	{
+		btAssert(0);
+		return localGetSupportingVertex(vec);
+	}
+
+	void	recalcLocalAabb();
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual void	setLocalScaling(const btVector3& scaling);
+	virtual const btVector3& getLocalScaling() const;
+	
+	btStridingMeshInterface* getMeshInterface()
+	{
+		return m_meshInterface;
+	}
+
+	const btStridingMeshInterface* getMeshInterface() const
+	{
+		return m_meshInterface;
+	}
+
+	const btVector3& getLocalAabbMin() const
+	{
+		return m_localAabbMin;
+	}
+	const btVector3& getLocalAabbMax() const
+	{
+		return m_localAabbMax;
+	}
+
+
+
+	//debugging
+	virtual const char*	getName()const {return "TRIANGLEMESH";}
+
+	
+
+};
+
+
+
+
+#endif //BT_TRIANGLE_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h
new file mode 100644
index 0000000..71b0557
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btTriangleShape.h
@@ -0,0 +1,182 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_OBB_TRIANGLE_MINKOWSKI_H
+#define BT_OBB_TRIANGLE_MINKOWSKI_H
+
+#include "btConvexShape.h"
+#include "btBoxShape.h"
+
+ATTRIBUTE_ALIGNED16(class) btTriangleShape : public btPolyhedralConvexShape
+{
+
+
+public:
+
+	btVector3	m_vertices1[3];
+
+	virtual int getNumVertices() const
+	{
+		return 3;
+	}
+
+	btVector3& getVertexPtr(int index)
+	{
+		return m_vertices1[index];
+	}
+
+	const btVector3& getVertexPtr(int index) const
+	{
+		return m_vertices1[index];
+	}
+	virtual void getVertex(int index,btVector3& vert) const
+	{
+		vert = m_vertices1[index];
+	}
+
+	virtual int getNumEdges() const
+	{
+		return 3;
+	}
+	
+	virtual void getEdge(int i,btVector3& pa,btVector3& pb) const
+	{
+		getVertex(i,pa);
+		getVertex((i+1)%3,pb);
+	}
+
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax)const 
+	{
+//		btAssert(0);
+		getAabbSlow(t,aabbMin,aabbMax);
+	}
+
+	btVector3 localGetSupportingVertexWithoutMargin(const btVector3& dir)const 
+	{
+		btVector3 dots(dir.dot(m_vertices1[0]), dir.dot(m_vertices1[1]), dir.dot(m_vertices1[2]));
+	  	return m_vertices1[dots.maxAxis()];
+
+	}
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+	{
+		for (int i=0;i<numVectors;i++)
+		{
+			const btVector3& dir = vectors[i];
+			btVector3 dots(dir.dot(m_vertices1[0]), dir.dot(m_vertices1[1]), dir.dot(m_vertices1[2]));
+  			supportVerticesOut[i] = m_vertices1[dots.maxAxis()];
+		}
+
+	}
+
+	btTriangleShape() : btPolyhedralConvexShape ()
+    {
+		m_shapeType = TRIANGLE_SHAPE_PROXYTYPE;
+	}
+
+	btTriangleShape(const btVector3& p0,const btVector3& p1,const btVector3& p2) : btPolyhedralConvexShape ()
+    {
+		m_shapeType = TRIANGLE_SHAPE_PROXYTYPE;
+        m_vertices1[0] = p0;
+        m_vertices1[1] = p1;
+        m_vertices1[2] = p2;
+    }
+
+
+	virtual void getPlane(btVector3& planeNormal,btVector3& planeSupport,int i) const
+	{
+		getPlaneEquation(i,planeNormal,planeSupport);
+	}
+
+	virtual int	getNumPlanes() const
+	{
+		return 1;
+	}
+
+	void calcNormal(btVector3& normal) const
+	{
+		normal = (m_vertices1[1]-m_vertices1[0]).cross(m_vertices1[2]-m_vertices1[0]);
+		normal.normalize();
+	}
+
+	virtual void getPlaneEquation(int i, btVector3& planeNormal,btVector3& planeSupport) const
+	{
+		(void)i;
+		calcNormal(planeNormal);
+		planeSupport = m_vertices1[0];
+	}
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const
+	{
+		(void)mass;
+		btAssert(0);
+		inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+	}
+
+		virtual	bool isInside(const btVector3& pt,btScalar tolerance) const
+	{
+		btVector3 normal;
+		calcNormal(normal);
+		//distance to plane
+		btScalar dist = pt.dot(normal);
+		btScalar planeconst = m_vertices1[0].dot(normal);
+		dist -= planeconst;
+		if (dist >= -tolerance && dist <= tolerance)
+		{
+			//inside check on edge-planes
+			int i;
+			for (i=0;i<3;i++)
+			{
+				btVector3 pa,pb;
+				getEdge(i,pa,pb);
+				btVector3 edge = pb-pa;
+				btVector3 edgeNormal = edge.cross(normal);
+				edgeNormal.normalize();
+				btScalar dist = pt.dot( edgeNormal);
+				btScalar edgeConst = pa.dot(edgeNormal);
+				dist -= edgeConst;
+				if (dist < -tolerance)
+					return false;
+			}
+			
+			return true;
+		}
+
+		return false;
+	}
+		//debugging
+		virtual const char*	getName()const
+		{
+			return "Triangle";
+		}
+
+		virtual int		getNumPreferredPenetrationDirections() const
+		{
+			return 2;
+		}
+		
+		virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
+		{
+			calcNormal(penetrationVector);
+			if (index)
+				penetrationVector *= btScalar(-1.);
+		}
+
+
+};
+
+#endif //BT_OBB_TRIANGLE_MINKOWSKI_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp
new file mode 100644
index 0000000..b148bbd
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp
@@ -0,0 +1,160 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btUniformScalingShape.h"
+
+btUniformScalingShape::btUniformScalingShape(	btConvexShape* convexChildShape,btScalar uniformScalingFactor):
+btConvexShape (), m_childConvexShape(convexChildShape),
+m_uniformScalingFactor(uniformScalingFactor)
+{
+	m_shapeType = UNIFORM_SCALING_SHAPE_PROXYTYPE;
+}
+	
+btUniformScalingShape::~btUniformScalingShape()
+{
+}
+	
+
+btVector3	btUniformScalingShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
+{
+	btVector3 tmpVertex;
+	tmpVertex = m_childConvexShape->localGetSupportingVertexWithoutMargin(vec);
+	return tmpVertex*m_uniformScalingFactor;
+}
+
+void	btUniformScalingShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
+{
+	m_childConvexShape->batchedUnitVectorGetSupportingVertexWithoutMargin(vectors,supportVerticesOut,numVectors);
+	int i;
+	for (i=0;i<numVectors;i++)
+	{
+		supportVerticesOut[i] = supportVerticesOut[i] * m_uniformScalingFactor;
+	}
+}
+
+
+btVector3	btUniformScalingShape::localGetSupportingVertex(const btVector3& vec)const
+{
+	btVector3 tmpVertex;
+	tmpVertex = m_childConvexShape->localGetSupportingVertex(vec);
+	return tmpVertex*m_uniformScalingFactor;
+}
+
+
+void	btUniformScalingShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+
+	///this linear upscaling is not realistic, but we don't deal with large mass ratios...
+	btVector3 tmpInertia;
+	m_childConvexShape->calculateLocalInertia(mass,tmpInertia);
+	inertia = tmpInertia * m_uniformScalingFactor;
+}
+
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+void btUniformScalingShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
+{
+	getAabbSlow(trans,aabbMin,aabbMax);
+
+}
+
+void btUniformScalingShape::getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+{
+#if 1
+	btVector3 _directions[] =
+	{
+		btVector3( 1.,  0.,  0.),
+		btVector3( 0.,  1.,  0.),
+		btVector3( 0.,  0.,  1.),
+		btVector3( -1., 0.,  0.),
+		btVector3( 0., -1.,  0.),
+		btVector3( 0.,  0., -1.)
+	};
+	
+	btVector3 _supporting[] =
+	{
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.),
+		btVector3( 0., 0., 0.)
+	};
+
+	for (int i=0;i<6;i++)
+	{
+		_directions[i] = _directions[i]*t.getBasis();
+	}
+	
+	batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6);
+	
+	btVector3 aabbMin1(0,0,0),aabbMax1(0,0,0);
+
+	for ( int i = 0; i < 3; ++i )
+	{
+		aabbMax1[i] = t(_supporting[i])[i];
+		aabbMin1[i] = t(_supporting[i + 3])[i];
+	}
+	btVector3 marginVec(getMargin(),getMargin(),getMargin());
+	aabbMin = aabbMin1-marginVec;
+	aabbMax = aabbMax1+marginVec;
+	
+#else
+
+	btScalar margin = getMargin();
+	for (int i=0;i<3;i++)
+	{
+		btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
+		vec[i] = btScalar(1.);
+		btVector3 sv = localGetSupportingVertex(vec*t.getBasis());
+		btVector3 tmp = t(sv);
+		aabbMax[i] = tmp[i]+margin;
+		vec[i] = btScalar(-1.);
+		sv = localGetSupportingVertex(vec*t.getBasis());
+		tmp = t(sv);
+		aabbMin[i] = tmp[i]-margin;
+	}
+
+#endif
+}
+
+void	btUniformScalingShape::setLocalScaling(const btVector3& scaling) 
+{
+	m_childConvexShape->setLocalScaling(scaling);
+}
+
+const btVector3& btUniformScalingShape::getLocalScaling() const
+{
+	return m_childConvexShape->getLocalScaling();
+}
+
+void	btUniformScalingShape::setMargin(btScalar margin)
+{
+	m_childConvexShape->setMargin(margin);
+}
+btScalar	btUniformScalingShape::getMargin() const
+{
+	return m_childConvexShape->getMargin() * m_uniformScalingFactor;
+}
+
+int		btUniformScalingShape::getNumPreferredPenetrationDirections() const
+{
+	return m_childConvexShape->getNumPreferredPenetrationDirections();
+}
+	
+void	btUniformScalingShape::getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
+{
+	m_childConvexShape->getPreferredPenetrationDirection(index,penetrationVector);
+}
diff --git a/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h
new file mode 100644
index 0000000..cbf7e6f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/CollisionShapes/btUniformScalingShape.h
@@ -0,0 +1,87 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_UNIFORM_SCALING_SHAPE_H
+#define BT_UNIFORM_SCALING_SHAPE_H
+
+#include "btConvexShape.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
+
+///The btUniformScalingShape allows to re-use uniform scaled instances of btConvexShape in a memory efficient way.
+///Istead of using btUniformScalingShape, it is better to use the non-uniform setLocalScaling method on convex shapes that implement it.
+class btUniformScalingShape : public btConvexShape
+{
+	btConvexShape*	m_childConvexShape;
+
+	btScalar	m_uniformScalingFactor;
+	
+	public:
+	
+	btUniformScalingShape(	btConvexShape* convexChildShape, btScalar uniformScalingFactor);
+	
+	virtual ~btUniformScalingShape();
+	
+	virtual btVector3	localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
+
+	virtual btVector3	localGetSupportingVertex(const btVector3& vec)const;
+
+	virtual void	batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	btScalar	getUniformScalingFactor() const
+	{
+		return m_uniformScalingFactor;
+	}
+
+	btConvexShape*	getChildShape() 
+	{
+		return m_childConvexShape;
+	}
+
+	const btConvexShape*	getChildShape() const
+	{
+		return m_childConvexShape;
+	}
+
+	virtual const char*	getName()const 
+	{
+		return "UniformScalingShape";
+	}
+	
+
+
+	///////////////////////////
+
+
+	///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
+	void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	virtual void getAabbSlow(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
+
+	virtual void	setLocalScaling(const btVector3& scaling) ;
+	virtual const btVector3& getLocalScaling() const ;
+
+	virtual void	setMargin(btScalar margin);
+	virtual btScalar	getMargin() const;
+
+	virtual int		getNumPreferredPenetrationDirections() const;
+	
+	virtual void	getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const;
+
+
+};
+
+#endif //BT_UNIFORM_SCALING_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btBoxCollision.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btBoxCollision.h
new file mode 100644
index 0000000..d5676aa
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btBoxCollision.h
@@ -0,0 +1,647 @@
+#ifndef BT_BOX_COLLISION_H_INCLUDED
+#define BT_BOX_COLLISION_H_INCLUDED
+
+/*! \file gim_box_collision.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "LinearMath/btTransform.h"
+
+
+///Swap numbers
+#define BT_SWAP_NUMBERS(a,b){ \
+    a = a+b; \
+    b = a-b; \
+    a = a-b; \
+}\
+
+
+#define BT_MAX(a,b) (a<b?b:a)
+#define BT_MIN(a,b) (a>b?b:a)
+
+#define BT_GREATER(x, y)	btFabs(x) > (y)
+
+#define BT_MAX3(a,b,c) BT_MAX(a,BT_MAX(b,c))
+#define BT_MIN3(a,b,c) BT_MIN(a,BT_MIN(b,c))
+
+
+
+
+
+
+enum eBT_PLANE_INTERSECTION_TYPE
+{
+	BT_CONST_BACK_PLANE = 0,
+	BT_CONST_COLLIDE_PLANE,
+	BT_CONST_FRONT_PLANE
+};
+
+//SIMD_FORCE_INLINE bool test_cross_edge_box(
+//	const btVector3 & edge,
+//	const btVector3 & absolute_edge,
+//	const btVector3 & pointa,
+//	const btVector3 & pointb, const btVector3 & extend,
+//	int dir_index0,
+//	int dir_index1
+//	int component_index0,
+//	int component_index1)
+//{
+//	// dir coords are -z and y
+//
+//	const btScalar dir0 = -edge[dir_index0];
+//	const btScalar dir1 = edge[dir_index1];
+//	btScalar pmin = pointa[component_index0]*dir0 + pointa[component_index1]*dir1;
+//	btScalar pmax = pointb[component_index0]*dir0 + pointb[component_index1]*dir1;
+//	//find minmax
+//	if(pmin>pmax)
+//	{
+//		BT_SWAP_NUMBERS(pmin,pmax);
+//	}
+//	//find extends
+//	const btScalar rad = extend[component_index0] * absolute_edge[dir_index0] +
+//					extend[component_index1] * absolute_edge[dir_index1];
+//
+//	if(pmin>rad || -rad>pmax) return false;
+//	return true;
+//}
+//
+//SIMD_FORCE_INLINE bool test_cross_edge_box_X_axis(
+//	const btVector3 & edge,
+//	const btVector3 & absolute_edge,
+//	const btVector3 & pointa,
+//	const btVector3 & pointb, btVector3 & extend)
+//{
+//
+//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,2,1,1,2);
+//}
+//
+//
+//SIMD_FORCE_INLINE bool test_cross_edge_box_Y_axis(
+//	const btVector3 & edge,
+//	const btVector3 & absolute_edge,
+//	const btVector3 & pointa,
+//	const btVector3 & pointb, btVector3 & extend)
+//{
+//
+//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,0,2,2,0);
+//}
+//
+//SIMD_FORCE_INLINE bool test_cross_edge_box_Z_axis(
+//	const btVector3 & edge,
+//	const btVector3 & absolute_edge,
+//	const btVector3 & pointa,
+//	const btVector3 & pointb, btVector3 & extend)
+//{
+//
+//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,1,0,0,1);
+//}
+
+
+#define TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,i_dir_0,i_dir_1,i_comp_0,i_comp_1)\
+{\
+	const btScalar dir0 = -edge[i_dir_0];\
+	const btScalar dir1 = edge[i_dir_1];\
+	btScalar pmin = pointa[i_comp_0]*dir0 + pointa[i_comp_1]*dir1;\
+	btScalar pmax = pointb[i_comp_0]*dir0 + pointb[i_comp_1]*dir1;\
+	if(pmin>pmax)\
+	{\
+		BT_SWAP_NUMBERS(pmin,pmax); \
+	}\
+	const btScalar abs_dir0 = absolute_edge[i_dir_0];\
+	const btScalar abs_dir1 = absolute_edge[i_dir_1];\
+	const btScalar rad = _extend[i_comp_0] * abs_dir0 + _extend[i_comp_1] * abs_dir1;\
+	if(pmin>rad || -rad>pmax) return false;\
+}\
+
+
+#define TEST_CROSS_EDGE_BOX_X_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
+{\
+	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,2,1,1,2);\
+}\
+
+#define TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
+{\
+	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,0,2,2,0);\
+}\
+
+#define TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
+{\
+	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,1,0,0,1);\
+}\
+
+
+//! Returns the dot product between a vec3f and the col of a matrix
+SIMD_FORCE_INLINE btScalar bt_mat3_dot_col(
+const btMatrix3x3 & mat, const btVector3 & vec3, int colindex)
+{
+	return vec3[0]*mat[0][colindex] + vec3[1]*mat[1][colindex] + vec3[2]*mat[2][colindex];
+}
+
+
+//!  Class for transforming a model1 to the space of model0
+ATTRIBUTE_ALIGNED16	(class) BT_BOX_BOX_TRANSFORM_CACHE
+{
+public:
+    btVector3  m_T1to0;//!< Transforms translation of model1 to model 0
+	btMatrix3x3 m_R1to0;//!< Transforms Rotation of model1 to model 0, equal  to R0' * R1
+	btMatrix3x3 m_AR;//!< Absolute value of m_R1to0
+
+	SIMD_FORCE_INLINE void calc_absolute_matrix()
+	{
+//		static const btVector3 vepsi(1e-6f,1e-6f,1e-6f);
+//		m_AR[0] = vepsi + m_R1to0[0].absolute();
+//		m_AR[1] = vepsi + m_R1to0[1].absolute();
+//		m_AR[2] = vepsi + m_R1to0[2].absolute();
+
+		int i,j;
+
+        for(i=0;i<3;i++)
+        {
+            for(j=0;j<3;j++ )
+            {
+            	m_AR[i][j] = 1e-6f + btFabs(m_R1to0[i][j]);
+            }
+        }
+
+	}
+
+	BT_BOX_BOX_TRANSFORM_CACHE()
+	{
+	}
+
+
+
+	//! Calc the transformation relative  1 to 0. Inverts matrics by transposing
+	SIMD_FORCE_INLINE void calc_from_homogenic(const btTransform & trans0,const btTransform & trans1)
+	{
+
+		btTransform temp_trans = trans0.inverse();
+		temp_trans = temp_trans * trans1;
+
+		m_T1to0 = temp_trans.getOrigin();
+		m_R1to0 = temp_trans.getBasis();
+
+
+		calc_absolute_matrix();
+	}
+
+	//! Calcs the full invertion of the matrices. Useful for scaling matrices
+	SIMD_FORCE_INLINE void calc_from_full_invert(const btTransform & trans0,const btTransform & trans1)
+	{
+		m_R1to0 = trans0.getBasis().inverse();
+		m_T1to0 = m_R1to0 * (-trans0.getOrigin());
+
+		m_T1to0 += m_R1to0*trans1.getOrigin();
+		m_R1to0 *= trans1.getBasis();
+
+		calc_absolute_matrix();
+	}
+
+	SIMD_FORCE_INLINE btVector3 transform(const btVector3 & point) const
+	{
+		return btVector3(m_R1to0[0].dot(point) + m_T1to0.x(),
+			m_R1to0[1].dot(point) + m_T1to0.y(),
+			m_R1to0[2].dot(point) + m_T1to0.z());
+	}
+};
+
+
+#define BOX_PLANE_EPSILON 0.000001f
+
+//! Axis aligned box
+ATTRIBUTE_ALIGNED16	(class) btAABB
+{
+public:
+	btVector3 m_min;
+	btVector3 m_max;
+
+	btAABB()
+	{}
+
+
+	btAABB(const btVector3 & V1,
+			 const btVector3 & V2,
+			 const btVector3 & V3)
+	{
+		m_min[0] = BT_MIN3(V1[0],V2[0],V3[0]);
+		m_min[1] = BT_MIN3(V1[1],V2[1],V3[1]);
+		m_min[2] = BT_MIN3(V1[2],V2[2],V3[2]);
+
+		m_max[0] = BT_MAX3(V1[0],V2[0],V3[0]);
+		m_max[1] = BT_MAX3(V1[1],V2[1],V3[1]);
+		m_max[2] = BT_MAX3(V1[2],V2[2],V3[2]);
+	}
+
+	btAABB(const btVector3 & V1,
+			 const btVector3 & V2,
+			 const btVector3 & V3,
+			 btScalar margin)
+	{
+		m_min[0] = BT_MIN3(V1[0],V2[0],V3[0]);
+		m_min[1] = BT_MIN3(V1[1],V2[1],V3[1]);
+		m_min[2] = BT_MIN3(V1[2],V2[2],V3[2]);
+
+		m_max[0] = BT_MAX3(V1[0],V2[0],V3[0]);
+		m_max[1] = BT_MAX3(V1[1],V2[1],V3[1]);
+		m_max[2] = BT_MAX3(V1[2],V2[2],V3[2]);
+
+		m_min[0] -= margin;
+		m_min[1] -= margin;
+		m_min[2] -= margin;
+		m_max[0] += margin;
+		m_max[1] += margin;
+		m_max[2] += margin;
+	}
+
+	btAABB(const btAABB &other):
+		m_min(other.m_min),m_max(other.m_max)
+	{
+	}
+
+	btAABB(const btAABB &other,btScalar margin ):
+		m_min(other.m_min),m_max(other.m_max)
+	{
+		m_min[0] -= margin;
+		m_min[1] -= margin;
+		m_min[2] -= margin;
+		m_max[0] += margin;
+		m_max[1] += margin;
+		m_max[2] += margin;
+	}
+
+	SIMD_FORCE_INLINE void invalidate()
+	{
+		m_min[0] = SIMD_INFINITY;
+		m_min[1] = SIMD_INFINITY;
+		m_min[2] = SIMD_INFINITY;
+		m_max[0] = -SIMD_INFINITY;
+		m_max[1] = -SIMD_INFINITY;
+		m_max[2] = -SIMD_INFINITY;
+	}
+
+	SIMD_FORCE_INLINE void increment_margin(btScalar margin)
+	{
+		m_min[0] -= margin;
+		m_min[1] -= margin;
+		m_min[2] -= margin;
+		m_max[0] += margin;
+		m_max[1] += margin;
+		m_max[2] += margin;
+	}
+
+	SIMD_FORCE_INLINE void copy_with_margin(const btAABB &other, btScalar margin)
+	{
+		m_min[0] = other.m_min[0] - margin;
+		m_min[1] = other.m_min[1] - margin;
+		m_min[2] = other.m_min[2] - margin;
+
+		m_max[0] = other.m_max[0] + margin;
+		m_max[1] = other.m_max[1] + margin;
+		m_max[2] = other.m_max[2] + margin;
+	}
+
+	template<typename CLASS_POINT>
+	SIMD_FORCE_INLINE void calc_from_triangle(
+							const CLASS_POINT & V1,
+							const CLASS_POINT & V2,
+							const CLASS_POINT & V3)
+	{
+		m_min[0] = BT_MIN3(V1[0],V2[0],V3[0]);
+		m_min[1] = BT_MIN3(V1[1],V2[1],V3[1]);
+		m_min[2] = BT_MIN3(V1[2],V2[2],V3[2]);
+
+		m_max[0] = BT_MAX3(V1[0],V2[0],V3[0]);
+		m_max[1] = BT_MAX3(V1[1],V2[1],V3[1]);
+		m_max[2] = BT_MAX3(V1[2],V2[2],V3[2]);
+	}
+
+	template<typename CLASS_POINT>
+	SIMD_FORCE_INLINE void calc_from_triangle_margin(
+							const CLASS_POINT & V1,
+							const CLASS_POINT & V2,
+							const CLASS_POINT & V3, btScalar margin)
+	{
+		m_min[0] = BT_MIN3(V1[0],V2[0],V3[0]);
+		m_min[1] = BT_MIN3(V1[1],V2[1],V3[1]);
+		m_min[2] = BT_MIN3(V1[2],V2[2],V3[2]);
+
+		m_max[0] = BT_MAX3(V1[0],V2[0],V3[0]);
+		m_max[1] = BT_MAX3(V1[1],V2[1],V3[1]);
+		m_max[2] = BT_MAX3(V1[2],V2[2],V3[2]);
+
+		m_min[0] -= margin;
+		m_min[1] -= margin;
+		m_min[2] -= margin;
+		m_max[0] += margin;
+		m_max[1] += margin;
+		m_max[2] += margin;
+	}
+
+	//! Apply a transform to an AABB
+	SIMD_FORCE_INLINE void appy_transform(const btTransform & trans)
+	{
+		btVector3 center = (m_max+m_min)*0.5f;
+		btVector3 extends = m_max - center;
+		// Compute new center
+		center = trans(center);
+
+		btVector3 textends(extends.dot(trans.getBasis().getRow(0).absolute()),
+ 				 extends.dot(trans.getBasis().getRow(1).absolute()),
+				 extends.dot(trans.getBasis().getRow(2).absolute()));
+
+		m_min = center - textends;
+		m_max = center + textends;
+	}
+
+
+	//! Apply a transform to an AABB
+	SIMD_FORCE_INLINE void appy_transform_trans_cache(const BT_BOX_BOX_TRANSFORM_CACHE & trans)
+	{
+		btVector3 center = (m_max+m_min)*0.5f;
+		btVector3 extends = m_max - center;
+		// Compute new center
+		center = trans.transform(center);
+
+		btVector3 textends(extends.dot(trans.m_R1to0.getRow(0).absolute()),
+ 				 extends.dot(trans.m_R1to0.getRow(1).absolute()),
+				 extends.dot(trans.m_R1to0.getRow(2).absolute()));
+
+		m_min = center - textends;
+		m_max = center + textends;
+	}
+
+	//! Merges a Box
+	SIMD_FORCE_INLINE void merge(const btAABB & box)
+	{
+		m_min[0] = BT_MIN(m_min[0],box.m_min[0]);
+		m_min[1] = BT_MIN(m_min[1],box.m_min[1]);
+		m_min[2] = BT_MIN(m_min[2],box.m_min[2]);
+
+		m_max[0] = BT_MAX(m_max[0],box.m_max[0]);
+		m_max[1] = BT_MAX(m_max[1],box.m_max[1]);
+		m_max[2] = BT_MAX(m_max[2],box.m_max[2]);
+	}
+
+	//! Merges a point
+	template<typename CLASS_POINT>
+	SIMD_FORCE_INLINE void merge_point(const CLASS_POINT & point)
+	{
+		m_min[0] = BT_MIN(m_min[0],point[0]);
+		m_min[1] = BT_MIN(m_min[1],point[1]);
+		m_min[2] = BT_MIN(m_min[2],point[2]);
+
+		m_max[0] = BT_MAX(m_max[0],point[0]);
+		m_max[1] = BT_MAX(m_max[1],point[1]);
+		m_max[2] = BT_MAX(m_max[2],point[2]);
+	}
+
+	//! Gets the extend and center
+	SIMD_FORCE_INLINE void get_center_extend(btVector3 & center,btVector3 & extend)  const
+	{
+		center = (m_max+m_min)*0.5f;
+		extend = m_max - center;
+	}
+
+	//! Finds the intersecting box between this box and the other.
+	SIMD_FORCE_INLINE void find_intersection(const btAABB & other, btAABB & intersection)  const
+	{
+		intersection.m_min[0] = BT_MAX(other.m_min[0],m_min[0]);
+		intersection.m_min[1] = BT_MAX(other.m_min[1],m_min[1]);
+		intersection.m_min[2] = BT_MAX(other.m_min[2],m_min[2]);
+
+		intersection.m_max[0] = BT_MIN(other.m_max[0],m_max[0]);
+		intersection.m_max[1] = BT_MIN(other.m_max[1],m_max[1]);
+		intersection.m_max[2] = BT_MIN(other.m_max[2],m_max[2]);
+	}
+
+
+	SIMD_FORCE_INLINE bool has_collision(const btAABB & other) const
+	{
+		if(m_min[0] > other.m_max[0] ||
+		   m_max[0] < other.m_min[0] ||
+		   m_min[1] > other.m_max[1] ||
+		   m_max[1] < other.m_min[1] ||
+		   m_min[2] > other.m_max[2] ||
+		   m_max[2] < other.m_min[2])
+		{
+			return false;
+		}
+		return true;
+	}
+
+	/*! \brief Finds the Ray intersection parameter.
+	\param aabb Aligned box
+	\param vorigin A vec3f with the origin of the ray
+	\param vdir A vec3f with the direction of the ray
+	*/
+	SIMD_FORCE_INLINE bool collide_ray(const btVector3 & vorigin,const btVector3 & vdir)  const
+	{
+		btVector3 extents,center;
+		this->get_center_extend(center,extents);;
+
+		btScalar Dx = vorigin[0] - center[0];
+		if(BT_GREATER(Dx, extents[0]) && Dx*vdir[0]>=0.0f)	return false;
+		btScalar Dy = vorigin[1] - center[1];
+		if(BT_GREATER(Dy, extents[1]) && Dy*vdir[1]>=0.0f)	return false;
+		btScalar Dz = vorigin[2] - center[2];
+		if(BT_GREATER(Dz, extents[2]) && Dz*vdir[2]>=0.0f)	return false;
+
+
+		btScalar f = vdir[1] * Dz - vdir[2] * Dy;
+		if(btFabs(f) > extents[1]*btFabs(vdir[2]) + extents[2]*btFabs(vdir[1])) return false;
+		f = vdir[2] * Dx - vdir[0] * Dz;
+		if(btFabs(f) > extents[0]*btFabs(vdir[2]) + extents[2]*btFabs(vdir[0]))return false;
+		f = vdir[0] * Dy - vdir[1] * Dx;
+		if(btFabs(f) > extents[0]*btFabs(vdir[1]) + extents[1]*btFabs(vdir[0]))return false;
+		return true;
+	}
+
+
+	SIMD_FORCE_INLINE void projection_interval(const btVector3 & direction, btScalar &vmin, btScalar &vmax) const
+	{
+		btVector3 center = (m_max+m_min)*0.5f;
+		btVector3 extend = m_max-center;
+
+		btScalar _fOrigin =  direction.dot(center);
+		btScalar _fMaximumExtent = extend.dot(direction.absolute());
+		vmin = _fOrigin - _fMaximumExtent;
+		vmax = _fOrigin + _fMaximumExtent;
+	}
+
+	SIMD_FORCE_INLINE eBT_PLANE_INTERSECTION_TYPE plane_classify(const btVector4 &plane) const
+	{
+		btScalar _fmin,_fmax;
+		this->projection_interval(plane,_fmin,_fmax);
+
+		if(plane[3] > _fmax + BOX_PLANE_EPSILON)
+		{
+			return BT_CONST_BACK_PLANE; // 0
+		}
+
+		if(plane[3]+BOX_PLANE_EPSILON >=_fmin)
+		{
+			return BT_CONST_COLLIDE_PLANE; //1
+		}
+		return BT_CONST_FRONT_PLANE;//2
+	}
+
+	SIMD_FORCE_INLINE bool overlapping_trans_conservative(const btAABB & box, btTransform & trans1_to_0) const
+	{
+		btAABB tbox = box;
+		tbox.appy_transform(trans1_to_0);
+		return has_collision(tbox);
+	}
+
+	SIMD_FORCE_INLINE bool overlapping_trans_conservative2(const btAABB & box,
+		const BT_BOX_BOX_TRANSFORM_CACHE & trans1_to_0) const
+	{
+		btAABB tbox = box;
+		tbox.appy_transform_trans_cache(trans1_to_0);
+		return has_collision(tbox);
+	}
+
+	//! transcache is the transformation cache from box to this AABB
+	SIMD_FORCE_INLINE bool overlapping_trans_cache(
+		const btAABB & box,const BT_BOX_BOX_TRANSFORM_CACHE & transcache, bool fulltest) const
+	{
+
+		//Taken from OPCODE
+		btVector3 ea,eb;//extends
+		btVector3 ca,cb;//extends
+		get_center_extend(ca,ea);
+		box.get_center_extend(cb,eb);
+
+
+		btVector3 T;
+		btScalar t,t2;
+		int i;
+
+		// Class I : A's basis vectors
+		for(i=0;i<3;i++)
+		{
+			T[i] =  transcache.m_R1to0[i].dot(cb) + transcache.m_T1to0[i] - ca[i];
+			t = transcache.m_AR[i].dot(eb) + ea[i];
+			if(BT_GREATER(T[i], t))	return false;
+		}
+		// Class II : B's basis vectors
+		for(i=0;i<3;i++)
+		{
+			t = bt_mat3_dot_col(transcache.m_R1to0,T,i);
+			t2 = bt_mat3_dot_col(transcache.m_AR,ea,i) + eb[i];
+			if(BT_GREATER(t,t2))	return false;
+		}
+		// Class III : 9 cross products
+		if(fulltest)
+		{
+			int j,m,n,o,p,q,r;
+			for(i=0;i<3;i++)
+			{
+				m = (i+1)%3;
+				n = (i+2)%3;
+				o = i==0?1:0;
+				p = i==2?1:2;
+				for(j=0;j<3;j++)
+				{
+					q = j==2?1:2;
+					r = j==0?1:0;
+					t = T[n]*transcache.m_R1to0[m][j] - T[m]*transcache.m_R1to0[n][j];
+					t2 = ea[o]*transcache.m_AR[p][j] + ea[p]*transcache.m_AR[o][j] +
+						eb[r]*transcache.m_AR[i][q] + eb[q]*transcache.m_AR[i][r];
+					if(BT_GREATER(t,t2))	return false;
+				}
+			}
+		}
+		return true;
+	}
+
+	//! Simple test for planes.
+	SIMD_FORCE_INLINE bool collide_plane(
+		const btVector4 & plane) const
+	{
+		eBT_PLANE_INTERSECTION_TYPE classify = plane_classify(plane);
+		return (classify == BT_CONST_COLLIDE_PLANE);
+	}
+
+	//! test for a triangle, with edges
+	SIMD_FORCE_INLINE bool collide_triangle_exact(
+		const btVector3 & p1,
+		const btVector3 & p2,
+		const btVector3 & p3,
+		const btVector4 & triangle_plane) const
+	{
+		if(!collide_plane(triangle_plane)) return false;
+
+		btVector3 center,extends;
+		this->get_center_extend(center,extends);
+
+		const btVector3 v1(p1 - center);
+		const btVector3 v2(p2 - center);
+		const btVector3 v3(p3 - center);
+
+		//First axis
+		btVector3 diff(v2 - v1);
+		btVector3 abs_diff = diff.absolute();
+		//Test With X axis
+		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v1,v3,extends);
+		//Test With Y axis
+		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v1,v3,extends);
+		//Test With Z axis
+		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v1,v3,extends);
+
+
+		diff = v3 - v2;
+		abs_diff = diff.absolute();
+		//Test With X axis
+		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v2,v1,extends);
+		//Test With Y axis
+		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v2,v1,extends);
+		//Test With Z axis
+		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v2,v1,extends);
+
+		diff = v1 - v3;
+		abs_diff = diff.absolute();
+		//Test With X axis
+		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v3,v2,extends);
+		//Test With Y axis
+		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v3,v2,extends);
+		//Test With Z axis
+		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v3,v2,extends);
+
+		return true;
+	}
+};
+
+
+//! Compairison of transformation objects
+SIMD_FORCE_INLINE bool btCompareTransformsEqual(const btTransform & t1,const btTransform & t2)
+{
+	if(!(t1.getOrigin() == t2.getOrigin()) ) return false;
+
+	if(!(t1.getBasis().getRow(0) == t2.getBasis().getRow(0)) ) return false;
+	if(!(t1.getBasis().getRow(1) == t2.getBasis().getRow(1)) ) return false;
+	if(!(t1.getBasis().getRow(2) == t2.getBasis().getRow(2)) ) return false;
+	return true;
+}
+
+
+
+#endif // GIM_BOX_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btClipPolygon.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btClipPolygon.h
new file mode 100644
index 0000000..de0a523
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btClipPolygon.h
@@ -0,0 +1,182 @@
+#ifndef BT_CLIP_POLYGON_H_INCLUDED
+#define BT_CLIP_POLYGON_H_INCLUDED
+
+/*! \file btClipPolygon.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btGeometryUtil.h"
+
+
+SIMD_FORCE_INLINE btScalar bt_distance_point_plane(const btVector4 & plane,const btVector3 &point)
+{
+	return point.dot(plane) - plane[3];
+}
+
+/*! Vector blending
+Takes two vectors a, b, blends them together*/
+SIMD_FORCE_INLINE void bt_vec_blend(btVector3 &vr, const btVector3 &va,const btVector3 &vb, btScalar blend_factor)
+{
+	vr = (1-blend_factor)*va + blend_factor*vb;
+}
+
+//! This function calcs the distance from a 3D plane
+SIMD_FORCE_INLINE void bt_plane_clip_polygon_collect(
+						const btVector3 & point0,
+						const btVector3 & point1,
+						btScalar dist0,
+						btScalar dist1,
+						btVector3 * clipped,
+						int & clipped_count)
+{
+	bool _prevclassif = (dist0>SIMD_EPSILON);
+	bool _classif = (dist1>SIMD_EPSILON);
+	if(_classif!=_prevclassif)
+	{
+		btScalar blendfactor = -dist0/(dist1-dist0);
+		bt_vec_blend(clipped[clipped_count],point0,point1,blendfactor);
+		clipped_count++;
+	}
+	if(!_classif)
+	{
+		clipped[clipped_count] = point1;
+		clipped_count++;
+	}
+}
+
+
+//! Clips a polygon by a plane
+/*!
+*\return The count of the clipped counts
+*/
+SIMD_FORCE_INLINE int bt_plane_clip_polygon(
+						const btVector4 & plane,
+						const btVector3 * polygon_points,
+						int polygon_point_count,
+						btVector3 * clipped)
+{
+    int clipped_count = 0;
+
+
+    //clip first point
+	btScalar firstdist = bt_distance_point_plane(plane,polygon_points[0]);;
+	if(!(firstdist>SIMD_EPSILON))
+	{
+		clipped[clipped_count] = polygon_points[0];
+		clipped_count++;
+	}
+
+	btScalar olddist = firstdist;
+	for(int i=1;i<polygon_point_count;i++)
+	{
+		btScalar dist = bt_distance_point_plane(plane,polygon_points[i]);
+
+		bt_plane_clip_polygon_collect(
+						polygon_points[i-1],polygon_points[i],
+						olddist,
+						dist,
+						clipped,
+						clipped_count);
+
+
+		olddist = dist;
+	}
+
+	//RETURN TO FIRST  point
+
+	bt_plane_clip_polygon_collect(
+					polygon_points[polygon_point_count-1],polygon_points[0],
+					olddist,
+					firstdist,
+					clipped,
+					clipped_count);
+
+	return clipped_count;
+}
+
+//! Clips a polygon by a plane
+/*!
+*\param clipped must be an array of 16 points.
+*\return The count of the clipped counts
+*/
+SIMD_FORCE_INLINE int bt_plane_clip_triangle(
+						const btVector4 & plane,
+						const btVector3 & point0,
+						const btVector3 & point1,
+						const btVector3& point2,
+						btVector3 * clipped // an allocated array of 16 points at least
+						)
+{
+    int clipped_count = 0;
+
+    //clip first point0
+	btScalar firstdist = bt_distance_point_plane(plane,point0);;
+	if(!(firstdist>SIMD_EPSILON))
+	{
+		clipped[clipped_count] = point0;
+		clipped_count++;
+	}
+
+	// point 1
+	btScalar olddist = firstdist;
+	btScalar dist = bt_distance_point_plane(plane,point1);
+
+	bt_plane_clip_polygon_collect(
+					point0,point1,
+					olddist,
+					dist,
+					clipped,
+					clipped_count);
+
+	olddist = dist;
+
+
+	// point 2
+	dist = bt_distance_point_plane(plane,point2);
+
+	bt_plane_clip_polygon_collect(
+					point1,point2,
+					olddist,
+					dist,
+					clipped,
+					clipped_count);
+	olddist = dist;
+
+
+
+	//RETURN TO FIRST  point0
+	bt_plane_clip_polygon_collect(
+					point2,point0,
+					olddist,
+					firstdist,
+					clipped,
+					clipped_count);
+
+	return clipped_count;
+}
+
+
+
+
+
+#endif // GIM_TRI_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btContactProcessing.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btContactProcessing.h
new file mode 100644
index 0000000..0c66f8e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btContactProcessing.h
@@ -0,0 +1,145 @@
+#ifndef BT_CONTACT_H_INCLUDED
+#define BT_CONTACT_H_INCLUDED
+
+/*! \file gim_contact.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btAlignedObjectArray.h"
+#include "btTriangleShapeEx.h"
+
+
+
+/**
+Configuration var for applying interpolation of  contact normals
+*/
+#define NORMAL_CONTACT_AVERAGE 1
+
+#define CONTACT_DIFF_EPSILON 0.00001f
+
+///The GIM_CONTACT is an internal GIMPACT structure, similar to btManifoldPoint.
+///@todo: remove and replace GIM_CONTACT by btManifoldPoint.
+class GIM_CONTACT
+{
+public:
+    btVector3 m_point;
+    btVector3 m_normal;
+    btScalar m_depth;//Positive value indicates interpenetration
+    btScalar m_distance;//Padding not for use
+    int m_feature1;//Face number
+    int m_feature2;//Face number
+public:
+    GIM_CONTACT()
+    {
+    }
+
+    GIM_CONTACT(const GIM_CONTACT & contact):
+				m_point(contact.m_point),
+				m_normal(contact.m_normal),
+				m_depth(contact.m_depth),
+				m_feature1(contact.m_feature1),
+				m_feature2(contact.m_feature2)
+    {
+    }
+
+    GIM_CONTACT(const btVector3 &point,const btVector3 & normal,
+    	 			btScalar depth, int feature1, int feature2):
+				m_point(point),
+				m_normal(normal),
+				m_depth(depth),
+				m_feature1(feature1),
+				m_feature2(feature2)
+    {
+    }
+
+	//! Calcs key for coord classification
+    SIMD_FORCE_INLINE unsigned int calc_key_contact() const
+    {
+    	int _coords[] = {
+    		(int)(m_point[0]*1000.0f+1.0f),
+    		(int)(m_point[1]*1333.0f),
+    		(int)(m_point[2]*2133.0f+3.0f)};
+		unsigned int _hash=0;
+		unsigned int *_uitmp = (unsigned int *)(&_coords[0]);
+		_hash = *_uitmp;
+		_uitmp++;
+		_hash += (*_uitmp)<<4;
+		_uitmp++;
+		_hash += (*_uitmp)<<8;
+		return _hash;
+    }
+
+    SIMD_FORCE_INLINE void interpolate_normals( btVector3 * normals,int normal_count)
+    {
+    	btVector3 vec_sum(m_normal);
+		for(int i=0;i<normal_count;i++)
+		{
+			vec_sum += normals[i];
+		}
+
+		btScalar vec_sum_len = vec_sum.length2();
+		if(vec_sum_len <CONTACT_DIFF_EPSILON) return;
+
+		//GIM_INV_SQRT(vec_sum_len,vec_sum_len); // 1/sqrt(vec_sum_len)
+
+		m_normal = vec_sum/btSqrt(vec_sum_len);
+    }
+
+};
+
+
+class btContactArray:public btAlignedObjectArray<GIM_CONTACT>
+{
+public:
+	btContactArray()
+	{
+		reserve(64);
+	}
+
+	SIMD_FORCE_INLINE void push_contact(
+		const btVector3 &point,const btVector3 & normal,
+		btScalar depth, int feature1, int feature2)
+	{
+		push_back( GIM_CONTACT(point,normal,depth,feature1,feature2) );
+	}
+
+	SIMD_FORCE_INLINE void push_triangle_contacts(
+		const GIM_TRIANGLE_CONTACT & tricontact,
+		int feature1,int feature2)
+	{
+		for(int i = 0;i<tricontact.m_point_count ;i++ )
+		{
+			push_contact(
+				tricontact.m_points[i],
+				tricontact.m_separating_normal,
+				tricontact.m_penetration_depth,feature1,feature2);
+		}
+	}
+
+	void merge_contacts(const btContactArray & contacts, bool normal_contact_average = true);
+
+	void merge_contacts_unique(const btContactArray & contacts);
+};
+
+
+#endif // GIM_CONTACT_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.cpp
new file mode 100644
index 0000000..8632331
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.cpp
@@ -0,0 +1,498 @@
+/*! \file gim_box_set.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#include "btGImpactBvh.h"
+#include "LinearMath/btQuickprof.h"
+
+#ifdef TRI_COLLISION_PROFILING
+
+btClock g_tree_clock;
+
+float g_accum_tree_collision_time = 0;
+int g_count_traversing = 0;
+
+
+void bt_begin_gim02_tree_time()
+{
+	g_tree_clock.reset();
+}
+
+void bt_end_gim02_tree_time()
+{
+	g_accum_tree_collision_time += g_tree_clock.getTimeMicroseconds();
+	g_count_traversing++;
+}
+
+//! Gets the average time in miliseconds of tree collisions
+float btGImpactBvh::getAverageTreeCollisionTime()
+{
+	if(g_count_traversing == 0) return 0;
+
+	float avgtime = g_accum_tree_collision_time;
+	avgtime /= (float)g_count_traversing;
+
+	g_accum_tree_collision_time = 0;
+	g_count_traversing = 0;
+	return avgtime;
+
+//	float avgtime = g_count_traversing;
+//	g_count_traversing = 0;
+//	return avgtime;
+
+}
+
+#endif //TRI_COLLISION_PROFILING
+
+/////////////////////// btBvhTree /////////////////////////////////
+
+int btBvhTree::_calc_splitting_axis(
+	GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex)
+{
+
+	int i;
+
+	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
+	btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.));
+	int numIndices = endIndex-startIndex;
+
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		means+=center;
+	}
+	means *= (btScalar(1.)/(btScalar)numIndices);
+
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		btVector3 diff2 = center-means;
+		diff2 = diff2 * diff2;
+		variance += diff2;
+	}
+	variance *= (btScalar(1.)/	((btScalar)numIndices-1)	);
+
+	return variance.maxAxis();
+}
+
+
+int btBvhTree::_sort_and_calc_splitting_index(
+	GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,
+	int endIndex, int splitAxis)
+{
+	int i;
+	int splitIndex =startIndex;
+	int numIndices = endIndex - startIndex;
+
+	// average of centers
+	btScalar splitValue = 0.0f;
+
+	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		means+=center;
+	}
+	means *= (btScalar(1.)/(btScalar)numIndices);
+
+	splitValue = means[splitAxis];
+
+
+	//sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		if (center[splitAxis] > splitValue)
+		{
+			//swap
+			primitive_boxes.swap(i,splitIndex);
+			//swapLeafNodes(i,splitIndex);
+			splitIndex++;
+		}
+	}
+
+	//if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex
+	//otherwise the tree-building might fail due to stack-overflows in certain cases.
+	//unbalanced1 is unsafe: it can cause stack overflows
+	//bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1)));
+
+	//unbalanced2 should work too: always use center (perfect balanced trees)
+	//bool unbalanced2 = true;
+
+	//this should be safe too:
+	int rangeBalancedIndices = numIndices/3;
+	bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices)));
+
+	if (unbalanced)
+	{
+		splitIndex = startIndex+ (numIndices>>1);
+	}
+
+	btAssert(!((splitIndex==startIndex) || (splitIndex == (endIndex))));
+
+	return splitIndex;
+
+}
+
+
+void btBvhTree::_build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex)
+{
+	int curIndex = m_num_nodes;
+	m_num_nodes++;
+
+	btAssert((endIndex-startIndex)>0);
+
+	if ((endIndex-startIndex)==1)
+	{
+	    //We have a leaf node
+	    setNodeBound(curIndex,primitive_boxes[startIndex].m_bound);
+		m_node_array[curIndex].setDataIndex(primitive_boxes[startIndex].m_data);
+
+		return;
+	}
+	//calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
+
+	//split axis
+	int splitIndex = _calc_splitting_axis(primitive_boxes,startIndex,endIndex);
+
+	splitIndex = _sort_and_calc_splitting_index(
+			primitive_boxes,startIndex,endIndex,
+			splitIndex//split axis
+			);
+
+
+	//calc this node bounding box
+
+	btAABB node_bound;
+	node_bound.invalidate();
+
+	for (int i=startIndex;i<endIndex;i++)
+	{
+		node_bound.merge(primitive_boxes[i].m_bound);
+	}
+
+	setNodeBound(curIndex,node_bound);
+
+
+	//build left branch
+	_build_sub_tree(primitive_boxes, startIndex, splitIndex );
+
+
+	//build right branch
+	 _build_sub_tree(primitive_boxes, splitIndex ,endIndex);
+
+	m_node_array[curIndex].setEscapeIndex(m_num_nodes - curIndex);
+
+
+}
+
+//! stackless build tree
+void btBvhTree::build_tree(
+	GIM_BVH_DATA_ARRAY & primitive_boxes)
+{
+	// initialize node count to 0
+	m_num_nodes = 0;
+	// allocate nodes
+	m_node_array.resize(primitive_boxes.size()*2);
+
+	_build_sub_tree(primitive_boxes, 0, primitive_boxes.size());
+}
+
+////////////////////////////////////class btGImpactBvh
+
+void btGImpactBvh::refit()
+{
+	int nodecount = getNodeCount();
+	while(nodecount--)
+	{
+		if(isLeafNode(nodecount))
+		{
+			btAABB leafbox;
+			m_primitive_manager->get_primitive_box(getNodeData(nodecount),leafbox);
+			setNodeBound(nodecount,leafbox);
+		}
+		else
+		{
+			//const GIM_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);
+			//get left bound
+			btAABB bound;
+			bound.invalidate();
+
+			btAABB temp_box;
+
+			int child_node = getLeftNode(nodecount);
+			if(child_node)
+			{
+				getNodeBound(child_node,temp_box);
+				bound.merge(temp_box);
+			}
+
+			child_node = getRightNode(nodecount);
+			if(child_node)
+			{
+				getNodeBound(child_node,temp_box);
+				bound.merge(temp_box);
+			}
+
+			setNodeBound(nodecount,bound);
+		}
+	}
+}
+
+//! this rebuild the entire set
+void btGImpactBvh::buildSet()
+{
+	//obtain primitive boxes
+	GIM_BVH_DATA_ARRAY primitive_boxes;
+	primitive_boxes.resize(m_primitive_manager->get_primitive_count());
+
+	for (int i = 0;i<primitive_boxes.size() ;i++ )
+	{
+		 m_primitive_manager->get_primitive_box(i,primitive_boxes[i].m_bound);
+		 primitive_boxes[i].m_data = i;
+	}
+
+	m_box_tree.build_tree(primitive_boxes);
+}
+
+//! returns the indices of the primitives in the m_primitive_manager
+bool btGImpactBvh::boxQuery(const btAABB & box, btAlignedObjectArray<int> & collided_results) const
+{
+	int curIndex = 0;
+	int numNodes = getNodeCount();
+
+	while (curIndex < numNodes)
+	{
+		btAABB bound;
+		getNodeBound(curIndex,bound);
+
+		//catch bugs in tree data
+
+		bool aabbOverlap = bound.has_collision(box);
+		bool isleafnode = isLeafNode(curIndex);
+
+		if (isleafnode && aabbOverlap)
+		{
+			collided_results.push_back(getNodeData(curIndex));
+		}
+
+		if (aabbOverlap || isleafnode)
+		{
+			//next subnode
+			curIndex++;
+		}
+		else
+		{
+			//skip node
+			curIndex+= getEscapeNodeIndex(curIndex);
+		}
+	}
+	if(collided_results.size()>0) return true;
+	return false;
+}
+
+
+
+//! returns the indices of the primitives in the m_primitive_manager
+bool btGImpactBvh::rayQuery(
+	const btVector3 & ray_dir,const btVector3 & ray_origin ,
+	btAlignedObjectArray<int> & collided_results) const
+{
+	int curIndex = 0;
+	int numNodes = getNodeCount();
+
+	while (curIndex < numNodes)
+	{
+		btAABB bound;
+		getNodeBound(curIndex,bound);
+
+		//catch bugs in tree data
+
+		bool aabbOverlap = bound.collide_ray(ray_origin,ray_dir);
+		bool isleafnode = isLeafNode(curIndex);
+
+		if (isleafnode && aabbOverlap)
+		{
+			collided_results.push_back(getNodeData( curIndex));
+		}
+
+		if (aabbOverlap || isleafnode)
+		{
+			//next subnode
+			curIndex++;
+		}
+		else
+		{
+			//skip node
+			curIndex+= getEscapeNodeIndex(curIndex);
+		}
+	}
+	if(collided_results.size()>0) return true;
+	return false;
+}
+
+
+SIMD_FORCE_INLINE bool _node_collision(
+	btGImpactBvh * boxset0, btGImpactBvh * boxset1,
+	const BT_BOX_BOX_TRANSFORM_CACHE & trans_cache_1to0,
+	int node0 ,int node1, bool complete_primitive_tests)
+{
+	btAABB box0;
+	boxset0->getNodeBound(node0,box0);
+	btAABB box1;
+	boxset1->getNodeBound(node1,box1);
+
+	return box0.overlapping_trans_cache(box1,trans_cache_1to0,complete_primitive_tests );
+//	box1.appy_transform_trans_cache(trans_cache_1to0);
+//	return box0.has_collision(box1);
+
+}
+
+
+//stackless recursive collision routine
+static void _find_collision_pairs_recursive(
+	btGImpactBvh * boxset0, btGImpactBvh * boxset1,
+	btPairSet * collision_pairs,
+	const BT_BOX_BOX_TRANSFORM_CACHE & trans_cache_1to0,
+	int node0, int node1, bool complete_primitive_tests)
+{
+
+
+
+	if( _node_collision(
+		boxset0,boxset1,trans_cache_1to0,
+		node0,node1,complete_primitive_tests) ==false) return;//avoid colliding internal nodes
+
+	if(boxset0->isLeafNode(node0))
+	{
+		if(boxset1->isLeafNode(node1))
+		{
+			// collision result
+			collision_pairs->push_pair(
+				boxset0->getNodeData(node0),boxset1->getNodeData(node1));
+			return;
+		}
+		else
+		{
+
+			//collide left recursive
+
+			_find_collision_pairs_recursive(
+								boxset0,boxset1,
+								collision_pairs,trans_cache_1to0,
+								node0,boxset1->getLeftNode(node1),false);
+
+			//collide right recursive
+			_find_collision_pairs_recursive(
+								boxset0,boxset1,
+								collision_pairs,trans_cache_1to0,
+								node0,boxset1->getRightNode(node1),false);
+
+
+		}
+	}
+	else
+	{
+		if(boxset1->isLeafNode(node1))
+		{
+
+			//collide left recursive
+			_find_collision_pairs_recursive(
+								boxset0,boxset1,
+								collision_pairs,trans_cache_1to0,
+								boxset0->getLeftNode(node0),node1,false);
+
+
+			//collide right recursive
+
+			_find_collision_pairs_recursive(
+								boxset0,boxset1,
+								collision_pairs,trans_cache_1to0,
+								boxset0->getRightNode(node0),node1,false);
+
+
+		}
+		else
+		{
+			//collide left0 left1
+
+
+
+			_find_collision_pairs_recursive(
+				boxset0,boxset1,
+				collision_pairs,trans_cache_1to0,
+				boxset0->getLeftNode(node0),boxset1->getLeftNode(node1),false);
+
+			//collide left0 right1
+
+			_find_collision_pairs_recursive(
+				boxset0,boxset1,
+				collision_pairs,trans_cache_1to0,
+				boxset0->getLeftNode(node0),boxset1->getRightNode(node1),false);
+
+
+			//collide right0 left1
+
+			_find_collision_pairs_recursive(
+				boxset0,boxset1,
+				collision_pairs,trans_cache_1to0,
+				boxset0->getRightNode(node0),boxset1->getLeftNode(node1),false);
+
+			//collide right0 right1
+
+			_find_collision_pairs_recursive(
+				boxset0,boxset1,
+				collision_pairs,trans_cache_1to0,
+				boxset0->getRightNode(node0),boxset1->getRightNode(node1),false);
+
+		}// else if node1 is not a leaf
+	}// else if node0 is not a leaf
+}
+
+
+void btGImpactBvh::find_collision(btGImpactBvh * boxset0, const btTransform & trans0,
+		btGImpactBvh * boxset1, const btTransform & trans1,
+		btPairSet & collision_pairs)
+{
+
+	if(boxset0->getNodeCount()==0 || boxset1->getNodeCount()==0 ) return;
+
+	BT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0;
+
+	trans_cache_1to0.calc_from_homogenic(trans0,trans1);
+
+#ifdef TRI_COLLISION_PROFILING
+	bt_begin_gim02_tree_time();
+#endif //TRI_COLLISION_PROFILING
+
+	_find_collision_pairs_recursive(
+		boxset0,boxset1,
+		&collision_pairs,trans_cache_1to0,0,0,true);
+#ifdef TRI_COLLISION_PROFILING
+	bt_end_gim02_tree_time();
+#endif //TRI_COLLISION_PROFILING
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.h
new file mode 100644
index 0000000..6174ae9
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactBvh.h
@@ -0,0 +1,396 @@
+#ifndef GIM_BOX_SET_H_INCLUDED
+#define GIM_BOX_SET_H_INCLUDED
+
+/*! \file gim_box_set.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "LinearMath/btAlignedObjectArray.h"
+
+#include "btBoxCollision.h"
+#include "btTriangleShapeEx.h"
+
+
+
+
+
+//! Overlapping pair
+struct GIM_PAIR
+{
+    int m_index1;
+    int m_index2;
+    GIM_PAIR()
+    {}
+
+    GIM_PAIR(const GIM_PAIR & p)
+    {
+    	m_index1 = p.m_index1;
+    	m_index2 = p.m_index2;
+	}
+
+	GIM_PAIR(int index1, int index2)
+    {
+    	m_index1 = index1;
+    	m_index2 = index2;
+	}
+};
+
+//! A pairset array
+class btPairSet: public btAlignedObjectArray<GIM_PAIR>
+{
+public:
+	btPairSet()
+	{
+		reserve(32);
+	}
+	inline void push_pair(int index1,int index2)
+	{
+		push_back(GIM_PAIR(index1,index2));
+	}
+
+	inline void push_pair_inv(int index1,int index2)
+	{
+		push_back(GIM_PAIR(index2,index1));
+	}
+};
+
+
+///GIM_BVH_DATA is an internal GIMPACT collision structure to contain axis aligned bounding box
+struct GIM_BVH_DATA
+{
+	btAABB m_bound;
+	int m_data;
+};
+
+//! Node Structure for trees
+class GIM_BVH_TREE_NODE
+{
+public:
+	btAABB m_bound;
+protected:
+	int	m_escapeIndexOrDataIndex;
+public:
+	GIM_BVH_TREE_NODE()
+	{
+		m_escapeIndexOrDataIndex = 0;
+	}
+
+	SIMD_FORCE_INLINE bool isLeafNode() const
+	{
+		//skipindex is negative (internal node), triangleindex >=0 (leafnode)
+		return (m_escapeIndexOrDataIndex>=0);
+	}
+
+	SIMD_FORCE_INLINE int getEscapeIndex() const
+	{
+		//btAssert(m_escapeIndexOrDataIndex < 0);
+		return -m_escapeIndexOrDataIndex;
+	}
+
+	SIMD_FORCE_INLINE void setEscapeIndex(int index)
+	{
+		m_escapeIndexOrDataIndex = -index;
+	}
+
+	SIMD_FORCE_INLINE int getDataIndex() const
+	{
+		//btAssert(m_escapeIndexOrDataIndex >= 0);
+
+		return m_escapeIndexOrDataIndex;
+	}
+
+	SIMD_FORCE_INLINE void setDataIndex(int index)
+	{
+		m_escapeIndexOrDataIndex = index;
+	}
+
+};
+
+
+class GIM_BVH_DATA_ARRAY:public btAlignedObjectArray<GIM_BVH_DATA>
+{
+};
+
+
+class GIM_BVH_TREE_NODE_ARRAY:public btAlignedObjectArray<GIM_BVH_TREE_NODE>
+{
+};
+
+
+
+
+//! Basic Box tree structure
+class btBvhTree
+{
+protected:
+	int m_num_nodes;
+	GIM_BVH_TREE_NODE_ARRAY m_node_array;
+protected:
+	int _sort_and_calc_splitting_index(
+		GIM_BVH_DATA_ARRAY & primitive_boxes,
+		 int startIndex,  int endIndex, int splitAxis);
+
+	int _calc_splitting_axis(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex);
+
+	void _build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex);
+public:
+	btBvhTree()
+	{
+		m_num_nodes = 0;
+	}
+
+	//! prototype functions for box tree management
+	//!@{
+	void build_tree(GIM_BVH_DATA_ARRAY & primitive_boxes);
+
+	SIMD_FORCE_INLINE void clearNodes()
+	{
+		m_node_array.clear();
+		m_num_nodes = 0;
+	}
+
+	//! node count
+	SIMD_FORCE_INLINE int getNodeCount() const
+	{
+		return m_num_nodes;
+	}
+
+	//! tells if the node is a leaf
+	SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
+	{
+		return m_node_array[nodeindex].isLeafNode();
+	}
+
+	SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
+	{
+		return m_node_array[nodeindex].getDataIndex();
+	}
+
+	SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB & bound) const
+	{
+		bound = m_node_array[nodeindex].m_bound;
+	}
+
+	SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB & bound)
+	{
+		m_node_array[nodeindex].m_bound = bound;
+	}
+
+	SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
+	{
+		return nodeindex+1;
+	}
+
+	SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
+	{
+		if(m_node_array[nodeindex+1].isLeafNode()) return nodeindex+2;
+		return nodeindex+1 + m_node_array[nodeindex+1].getEscapeIndex();
+	}
+
+	SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
+	{
+		return m_node_array[nodeindex].getEscapeIndex();
+	}
+
+	SIMD_FORCE_INLINE const GIM_BVH_TREE_NODE * get_node_pointer(int index = 0) const
+	{
+		return &m_node_array[index];
+	}
+
+	//!@}
+};
+
+
+//! Prototype Base class for primitive classification
+/*!
+This class is a wrapper for primitive collections.
+This tells relevant info for the Bounding Box set classes, which take care of space classification.
+This class can manage Compound shapes and trimeshes, and if it is managing trimesh then the  Hierarchy Bounding Box classes will take advantage of primitive Vs Box overlapping tests for getting optimal results and less Per Box compairisons.
+*/
+class btPrimitiveManagerBase
+{
+public:
+
+	virtual ~btPrimitiveManagerBase() {}
+
+	//! determines if this manager consist on only triangles, which special case will be optimized
+	virtual bool is_trimesh() const = 0;
+	virtual int get_primitive_count() const = 0;
+	virtual void get_primitive_box(int prim_index ,btAABB & primbox) const = 0;
+	//! retrieves only the points of the triangle, and the collision margin
+	virtual void get_primitive_triangle(int prim_index,btPrimitiveTriangle & triangle) const= 0;
+};
+
+
+//! Structure for containing Boxes
+/*!
+This class offers an structure for managing a box tree of primitives.
+Requires a Primitive prototype (like btPrimitiveManagerBase )
+*/
+class btGImpactBvh
+{
+protected:
+	btBvhTree m_box_tree;
+	btPrimitiveManagerBase * m_primitive_manager;
+
+protected:
+	//stackless refit
+	void refit();
+public:
+
+	//! this constructor doesn't build the tree. you must call	buildSet
+	btGImpactBvh()
+	{
+		m_primitive_manager = NULL;
+	}
+
+	//! this constructor doesn't build the tree. you must call	buildSet
+	btGImpactBvh(btPrimitiveManagerBase * primitive_manager)
+	{
+		m_primitive_manager = primitive_manager;
+	}
+
+	SIMD_FORCE_INLINE btAABB getGlobalBox()  const
+	{
+		btAABB totalbox;
+		getNodeBound(0, totalbox);
+		return totalbox;
+	}
+
+	SIMD_FORCE_INLINE void setPrimitiveManager(btPrimitiveManagerBase * primitive_manager)
+	{
+		m_primitive_manager = primitive_manager;
+	}
+
+	SIMD_FORCE_INLINE btPrimitiveManagerBase * getPrimitiveManager() const
+	{
+		return m_primitive_manager;
+	}
+
+
+//! node manager prototype functions
+///@{
+
+	//! this attemps to refit the box set.
+	SIMD_FORCE_INLINE void update()
+	{
+		refit();
+	}
+
+	//! this rebuild the entire set
+	void buildSet();
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	bool boxQuery(const btAABB & box, btAlignedObjectArray<int> & collided_results) const;
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	SIMD_FORCE_INLINE bool boxQueryTrans(const btAABB & box,
+		 const btTransform & transform, btAlignedObjectArray<int> & collided_results) const
+	{
+		btAABB transbox=box;
+		transbox.appy_transform(transform);
+		return boxQuery(transbox,collided_results);
+	}
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	bool rayQuery(
+		const btVector3 & ray_dir,const btVector3 & ray_origin ,
+		btAlignedObjectArray<int> & collided_results) const;
+
+	//! tells if this set has hierarcht
+	SIMD_FORCE_INLINE bool hasHierarchy() const
+	{
+		return true;
+	}
+
+	//! tells if this set is a trimesh
+	SIMD_FORCE_INLINE bool isTrimesh()  const
+	{
+		return m_primitive_manager->is_trimesh();
+	}
+
+	//! node count
+	SIMD_FORCE_INLINE int getNodeCount() const
+	{
+		return m_box_tree.getNodeCount();
+	}
+
+	//! tells if the node is a leaf
+	SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
+	{
+		return m_box_tree.isLeafNode(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
+	{
+		return m_box_tree.getNodeData(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB & bound)  const
+	{
+		m_box_tree.getNodeBound(nodeindex, bound);
+	}
+
+	SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB & bound)
+	{
+		m_box_tree.setNodeBound(nodeindex, bound);
+	}
+
+
+	SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
+	{
+		return m_box_tree.getLeftNode(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
+	{
+		return m_box_tree.getRightNode(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
+	{
+		return m_box_tree.getEscapeNodeIndex(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE void getNodeTriangle(int nodeindex,btPrimitiveTriangle & triangle) const
+	{
+		m_primitive_manager->get_primitive_triangle(getNodeData(nodeindex),triangle);
+	}
+
+
+	SIMD_FORCE_INLINE const GIM_BVH_TREE_NODE * get_node_pointer(int index = 0) const
+	{
+		return m_box_tree.get_node_pointer(index);
+	}
+
+#ifdef TRI_COLLISION_PROFILING
+	static float getAverageTreeCollisionTime();
+#endif //TRI_COLLISION_PROFILING
+
+	static void find_collision(btGImpactBvh * boxset1, const btTransform & trans1,
+		btGImpactBvh * boxset2, const btTransform & trans2,
+		btPairSet & collision_pairs);
+};
+
+
+#endif // GIM_BOXPRUNING_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
new file mode 100644
index 0000000..2f2c09f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
@@ -0,0 +1,904 @@
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+/*
+Author: Francisco Len N�jera
+Concave-Concave Collision
+
+*/
+
+#include "BulletCollision/CollisionDispatch/btManifoldResult.h"
+#include "LinearMath/btIDebugDraw.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "btGImpactCollisionAlgorithm.h"
+#include "btContactProcessing.h"
+#include "LinearMath/btQuickprof.h"
+
+
+//! Class for accessing the plane equation
+class btPlaneShape : public btStaticPlaneShape
+{
+public:
+
+	btPlaneShape(const btVector3& v, float f)
+		:btStaticPlaneShape(v,f)
+	{
+	}
+
+	void get_plane_equation(btVector4 &equation)
+	{
+		equation[0] = m_planeNormal[0];
+		equation[1] = m_planeNormal[1];
+		equation[2] = m_planeNormal[2];
+		equation[3] = m_planeConstant;
+	}
+
+
+	void get_plane_equation_transformed(const btTransform & trans,btVector4 &equation)
+	{
+		equation[0] = trans.getBasis().getRow(0).dot(m_planeNormal);
+		equation[1] = trans.getBasis().getRow(1).dot(m_planeNormal);
+		equation[2] = trans.getBasis().getRow(2).dot(m_planeNormal);
+		equation[3] = trans.getOrigin().dot(m_planeNormal) + m_planeConstant;
+	}
+};
+
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+#ifdef TRI_COLLISION_PROFILING
+
+btClock g_triangle_clock;
+
+float g_accum_triangle_collision_time = 0;
+int g_count_triangle_collision = 0;
+
+void bt_begin_gim02_tri_time()
+{
+	g_triangle_clock.reset();
+}
+
+void bt_end_gim02_tri_time()
+{
+	g_accum_triangle_collision_time += g_triangle_clock.getTimeMicroseconds();
+	g_count_triangle_collision++;
+}
+#endif //TRI_COLLISION_PROFILING
+//! Retrieving shapes shapes
+/*!
+Declared here due of insuficent space on Pool allocators
+*/
+//!@{
+class GIM_ShapeRetriever
+{
+public:
+	btGImpactShapeInterface * m_gim_shape;
+	btTriangleShapeEx m_trishape;
+	btTetrahedronShapeEx m_tetrashape;
+
+public:
+	class ChildShapeRetriever
+	{
+	public:
+		GIM_ShapeRetriever * m_parent;
+		virtual btCollisionShape * getChildShape(int index)
+		{
+			return m_parent->m_gim_shape->getChildShape(index);
+		}
+		virtual ~ChildShapeRetriever() {}
+	};
+
+	class TriangleShapeRetriever:public ChildShapeRetriever
+	{
+	public:
+
+		virtual btCollisionShape * getChildShape(int index)
+		{
+			m_parent->m_gim_shape->getBulletTriangle(index,m_parent->m_trishape);
+			return &m_parent->m_trishape;
+		}
+		virtual ~TriangleShapeRetriever() {}
+	};
+
+	class TetraShapeRetriever:public ChildShapeRetriever
+	{
+	public:
+
+		virtual btCollisionShape * getChildShape(int index)
+		{
+			m_parent->m_gim_shape->getBulletTetrahedron(index,m_parent->m_tetrashape);
+			return &m_parent->m_tetrashape;
+		}
+	};
+public:
+	ChildShapeRetriever m_child_retriever;
+	TriangleShapeRetriever m_tri_retriever;
+	TetraShapeRetriever  m_tetra_retriever;
+	ChildShapeRetriever * m_current_retriever;
+
+	GIM_ShapeRetriever(btGImpactShapeInterface * gim_shape)
+	{
+		m_gim_shape = gim_shape;
+		//select retriever
+		if(m_gim_shape->needsRetrieveTriangles())
+		{
+			m_current_retriever = &m_tri_retriever;
+		}
+		else if(m_gim_shape->needsRetrieveTetrahedrons())
+		{
+			m_current_retriever = &m_tetra_retriever;
+		}
+		else
+		{
+			m_current_retriever = &m_child_retriever;
+		}
+
+		m_current_retriever->m_parent = this;
+	}
+
+	btCollisionShape * getChildShape(int index)
+	{
+		return m_current_retriever->getChildShape(index);
+	}
+
+
+};
+
+
+
+//!@}
+
+
+#ifdef TRI_COLLISION_PROFILING
+
+//! Gets the average time in miliseconds of tree collisions
+float btGImpactCollisionAlgorithm::getAverageTreeCollisionTime()
+{
+	return btGImpactBoxSet::getAverageTreeCollisionTime();
+
+}
+
+//! Gets the average time in miliseconds of triangle collisions
+float btGImpactCollisionAlgorithm::getAverageTriangleCollisionTime()
+{
+	if(g_count_triangle_collision == 0) return 0;
+
+	float avgtime = g_accum_triangle_collision_time;
+	avgtime /= (float)g_count_triangle_collision;
+
+	g_accum_triangle_collision_time = 0;
+	g_count_triangle_collision = 0;
+
+	return avgtime;
+}
+
+#endif //TRI_COLLISION_PROFILING
+
+
+
+btGImpactCollisionAlgorithm::btGImpactCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+: btActivatingCollisionAlgorithm(ci,body0,body1)
+{
+	m_manifoldPtr = NULL;
+	m_convex_algorithm = NULL;
+}
+
+btGImpactCollisionAlgorithm::~btGImpactCollisionAlgorithm()
+{
+	clearCache();
+}
+
+
+
+
+
+void btGImpactCollisionAlgorithm::addContactPoint(btCollisionObject * body0,
+				btCollisionObject * body1,
+				const btVector3 & point,
+				const btVector3 & normal,
+				btScalar distance)
+{
+	m_resultOut->setShapeIdentifiersA(m_part0,m_triface0);
+	m_resultOut->setShapeIdentifiersB(m_part1,m_triface1);
+	checkManifold(body0,body1);
+	m_resultOut->addContactPoint(normal,point,distance);
+}
+
+
+void btGImpactCollisionAlgorithm::shape_vs_shape_collision(
+					  btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btCollisionShape * shape0,
+					  btCollisionShape * shape1)
+{
+
+	btCollisionShape* tmpShape0 = body0->getCollisionShape();
+	btCollisionShape* tmpShape1 = body1->getCollisionShape();
+	
+	body0->internalSetTemporaryCollisionShape(shape0);
+	body1->internalSetTemporaryCollisionShape(shape1);
+
+	{
+		btCollisionAlgorithm* algor = newAlgorithm(body0,body1);
+		// post :	checkManifold is called
+
+		m_resultOut->setShapeIdentifiersA(m_part0,m_triface0);
+		m_resultOut->setShapeIdentifiersB(m_part1,m_triface1);
+
+		algor->processCollision(body0,body1,*m_dispatchInfo,m_resultOut);
+
+		algor->~btCollisionAlgorithm();
+		m_dispatcher->freeCollisionAlgorithm(algor);
+	}
+
+	body0->internalSetTemporaryCollisionShape(tmpShape0);
+	body1->internalSetTemporaryCollisionShape(tmpShape1);
+}
+
+void btGImpactCollisionAlgorithm::convex_vs_convex_collision(
+					  btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btCollisionShape * shape0,
+					  btCollisionShape * shape1)
+{
+
+	btCollisionShape* tmpShape0 = body0->getCollisionShape();
+	btCollisionShape* tmpShape1 = body1->getCollisionShape();
+	
+	body0->internalSetTemporaryCollisionShape(shape0);
+	body1->internalSetTemporaryCollisionShape(shape1);
+
+
+	m_resultOut->setShapeIdentifiersA(m_part0,m_triface0);
+	m_resultOut->setShapeIdentifiersB(m_part1,m_triface1);
+
+	checkConvexAlgorithm(body0,body1);
+	m_convex_algorithm->processCollision(body0,body1,*m_dispatchInfo,m_resultOut);
+
+	body0->internalSetTemporaryCollisionShape(tmpShape0);
+	body1->internalSetTemporaryCollisionShape(tmpShape1);
+
+}
+
+
+
+
+void btGImpactCollisionAlgorithm::gimpact_vs_gimpact_find_pairs(
+					  const btTransform & trans0,
+					  const btTransform & trans1,
+					  btGImpactShapeInterface * shape0,
+					  btGImpactShapeInterface * shape1,btPairSet & pairset)
+{
+	if(shape0->hasBoxSet() && shape1->hasBoxSet())
+	{
+		btGImpactBoxSet::find_collision(shape0->getBoxSet(),trans0,shape1->getBoxSet(),trans1,pairset);
+	}
+	else
+	{
+		btAABB boxshape0;
+		btAABB boxshape1;
+		int i = shape0->getNumChildShapes();
+
+		while(i--)
+		{
+			shape0->getChildAabb(i,trans0,boxshape0.m_min,boxshape0.m_max);
+
+			int j = shape1->getNumChildShapes();
+			while(j--)
+			{
+				shape1->getChildAabb(i,trans1,boxshape1.m_min,boxshape1.m_max);
+
+				if(boxshape1.has_collision(boxshape0))
+				{
+					pairset.push_pair(i,j);
+				}
+			}
+		}
+	}
+
+
+}
+
+
+void btGImpactCollisionAlgorithm::gimpact_vs_shape_find_pairs(
+					  const btTransform & trans0,
+					  const btTransform & trans1,
+					  btGImpactShapeInterface * shape0,
+					  btCollisionShape * shape1,
+					  btAlignedObjectArray<int> & collided_primitives)
+{
+
+	btAABB boxshape;
+
+
+	if(shape0->hasBoxSet())
+	{
+		btTransform trans1to0 = trans0.inverse();
+		trans1to0 *= trans1;
+
+		shape1->getAabb(trans1to0,boxshape.m_min,boxshape.m_max);
+
+		shape0->getBoxSet()->boxQuery(boxshape, collided_primitives);
+	}
+	else
+	{
+		shape1->getAabb(trans1,boxshape.m_min,boxshape.m_max);
+
+		btAABB boxshape0;
+		int i = shape0->getNumChildShapes();
+
+		while(i--)
+		{
+			shape0->getChildAabb(i,trans0,boxshape0.m_min,boxshape0.m_max);
+
+			if(boxshape.has_collision(boxshape0))
+			{
+				collided_primitives.push_back(i);
+			}
+		}
+
+	}
+
+}
+
+
+void btGImpactCollisionAlgorithm::collide_gjk_triangles(btCollisionObject * body0,
+				  btCollisionObject * body1,
+				  btGImpactMeshShapePart * shape0,
+				  btGImpactMeshShapePart * shape1,
+				  const int * pairs, int pair_count)
+{
+	btTriangleShapeEx tri0;
+	btTriangleShapeEx tri1;
+
+	shape0->lockChildShapes();
+	shape1->lockChildShapes();
+
+	const int * pair_pointer = pairs;
+
+	while(pair_count--)
+	{
+
+		m_triface0 = *(pair_pointer);
+		m_triface1 = *(pair_pointer+1);
+		pair_pointer+=2;
+
+
+
+		shape0->getBulletTriangle(m_triface0,tri0);
+		shape1->getBulletTriangle(m_triface1,tri1);
+
+
+		//collide two convex shapes
+		if(tri0.overlap_test_conservative(tri1))
+		{
+			convex_vs_convex_collision(body0,body1,&tri0,&tri1);
+		}
+
+	}
+
+	shape0->unlockChildShapes();
+	shape1->unlockChildShapes();
+}
+
+void btGImpactCollisionAlgorithm::collide_sat_triangles(btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btGImpactMeshShapePart * shape0,
+					  btGImpactMeshShapePart * shape1,
+					  const int * pairs, int pair_count)
+{
+	btTransform orgtrans0 = body0->getWorldTransform();
+	btTransform orgtrans1 = body1->getWorldTransform();
+
+	btPrimitiveTriangle ptri0;
+	btPrimitiveTriangle ptri1;
+	GIM_TRIANGLE_CONTACT contact_data;
+
+	shape0->lockChildShapes();
+	shape1->lockChildShapes();
+
+	const int * pair_pointer = pairs;
+
+	while(pair_count--)
+	{
+
+		m_triface0 = *(pair_pointer);
+		m_triface1 = *(pair_pointer+1);
+		pair_pointer+=2;
+
+
+		shape0->getPrimitiveTriangle(m_triface0,ptri0);
+		shape1->getPrimitiveTriangle(m_triface1,ptri1);
+
+		#ifdef TRI_COLLISION_PROFILING
+		bt_begin_gim02_tri_time();
+		#endif
+
+		ptri0.applyTransform(orgtrans0);
+		ptri1.applyTransform(orgtrans1);
+
+
+		//build planes
+		ptri0.buildTriPlane();
+		ptri1.buildTriPlane();
+		// test conservative
+
+
+
+		if(ptri0.overlap_test_conservative(ptri1))
+		{
+			if(ptri0.find_triangle_collision_clip_method(ptri1,contact_data))
+			{
+
+				int j = contact_data.m_point_count;
+				while(j--)
+				{
+
+					addContactPoint(body0, body1,
+								contact_data.m_points[j],
+								contact_data.m_separating_normal,
+								-contact_data.m_penetration_depth);
+				}
+			}
+		}
+
+		#ifdef TRI_COLLISION_PROFILING
+		bt_end_gim02_tri_time();
+		#endif
+
+	}
+
+	shape0->unlockChildShapes();
+	shape1->unlockChildShapes();
+
+}
+
+
+void btGImpactCollisionAlgorithm::gimpact_vs_gimpact(
+						btCollisionObject * body0,
+					   	btCollisionObject * body1,
+					  	btGImpactShapeInterface * shape0,
+					  	btGImpactShapeInterface * shape1)
+{
+
+	if(shape0->getGImpactShapeType()==CONST_GIMPACT_TRIMESH_SHAPE)
+	{
+		btGImpactMeshShape * meshshape0 = static_cast<btGImpactMeshShape *>(shape0);
+		m_part0 = meshshape0->getMeshPartCount();
+
+		while(m_part0--)
+		{
+			gimpact_vs_gimpact(body0,body1,meshshape0->getMeshPart(m_part0),shape1);
+		}
+
+		return;
+	}
+
+	if(shape1->getGImpactShapeType()==CONST_GIMPACT_TRIMESH_SHAPE)
+	{
+		btGImpactMeshShape * meshshape1 = static_cast<btGImpactMeshShape *>(shape1);
+		m_part1 = meshshape1->getMeshPartCount();
+
+		while(m_part1--)
+		{
+
+			gimpact_vs_gimpact(body0,body1,shape0,meshshape1->getMeshPart(m_part1));
+
+		}
+
+		return;
+	}
+
+
+	btTransform orgtrans0 = body0->getWorldTransform();
+	btTransform orgtrans1 = body1->getWorldTransform();
+
+	btPairSet pairset;
+
+	gimpact_vs_gimpact_find_pairs(orgtrans0,orgtrans1,shape0,shape1,pairset);
+
+	if(pairset.size()== 0) return;
+
+	if(shape0->getGImpactShapeType() == CONST_GIMPACT_TRIMESH_SHAPE_PART &&
+		shape1->getGImpactShapeType() == CONST_GIMPACT_TRIMESH_SHAPE_PART)
+	{
+		btGImpactMeshShapePart * shapepart0 = static_cast<btGImpactMeshShapePart * >(shape0);
+		btGImpactMeshShapePart * shapepart1 = static_cast<btGImpactMeshShapePart * >(shape1);
+		//specialized function
+		#ifdef BULLET_TRIANGLE_COLLISION
+		collide_gjk_triangles(body0,body1,shapepart0,shapepart1,&pairset[0].m_index1,pairset.size());
+		#else
+		collide_sat_triangles(body0,body1,shapepart0,shapepart1,&pairset[0].m_index1,pairset.size());
+		#endif
+
+		return;
+	}
+
+	//general function
+
+	shape0->lockChildShapes();
+	shape1->lockChildShapes();
+
+	GIM_ShapeRetriever retriever0(shape0);
+	GIM_ShapeRetriever retriever1(shape1);
+
+	bool child_has_transform0 = shape0->childrenHasTransform();
+	bool child_has_transform1 = shape1->childrenHasTransform();
+
+	int i = pairset.size();
+	while(i--)
+	{
+		GIM_PAIR * pair = &pairset[i];
+		m_triface0 = pair->m_index1;
+		m_triface1 = pair->m_index2;
+		btCollisionShape * colshape0 = retriever0.getChildShape(m_triface0);
+		btCollisionShape * colshape1 = retriever1.getChildShape(m_triface1);
+
+		if(child_has_transform0)
+		{
+			body0->setWorldTransform(orgtrans0*shape0->getChildTransform(m_triface0));
+		}
+
+		if(child_has_transform1)
+		{
+			body1->setWorldTransform(orgtrans1*shape1->getChildTransform(m_triface1));
+		}
+
+		//collide two convex shapes
+		convex_vs_convex_collision(body0,body1,colshape0,colshape1);
+
+
+		if(child_has_transform0)
+		{
+			body0->setWorldTransform(orgtrans0);
+		}
+
+		if(child_has_transform1)
+		{
+			body1->setWorldTransform(orgtrans1);
+		}
+
+	}
+
+	shape0->unlockChildShapes();
+	shape1->unlockChildShapes();
+}
+
+void btGImpactCollisionAlgorithm::gimpact_vs_shape(btCollisionObject * body0,
+				  btCollisionObject * body1,
+				  btGImpactShapeInterface * shape0,
+				  btCollisionShape * shape1,bool swapped)
+{
+	if(shape0->getGImpactShapeType()==CONST_GIMPACT_TRIMESH_SHAPE)
+	{
+		btGImpactMeshShape * meshshape0 = static_cast<btGImpactMeshShape *>(shape0);
+		int& part = swapped ? m_part1 : m_part0;
+		part = meshshape0->getMeshPartCount();
+
+		while(part--)
+		{
+
+			gimpact_vs_shape(body0,
+				  body1,
+				  meshshape0->getMeshPart(part),
+				  shape1,swapped);
+
+		}
+
+		return;
+	}
+
+	#ifdef GIMPACT_VS_PLANE_COLLISION
+	if(shape0->getGImpactShapeType() == CONST_GIMPACT_TRIMESH_SHAPE_PART &&
+		shape1->getShapeType() == STATIC_PLANE_PROXYTYPE)
+	{
+		btGImpactMeshShapePart * shapepart = static_cast<btGImpactMeshShapePart *>(shape0);
+		btStaticPlaneShape * planeshape = static_cast<btStaticPlaneShape * >(shape1);
+		gimpacttrimeshpart_vs_plane_collision(body0,body1,shapepart,planeshape,swapped);
+		return;
+	}
+
+	#endif
+
+
+
+	if(shape1->isCompound())
+	{
+		btCompoundShape * compoundshape = static_cast<btCompoundShape *>(shape1);
+		gimpact_vs_compoundshape(body0,body1,shape0,compoundshape,swapped);
+		return;
+	}
+	else if(shape1->isConcave())
+	{
+		btConcaveShape * concaveshape = static_cast<btConcaveShape *>(shape1);
+		gimpact_vs_concave(body0,body1,shape0,concaveshape,swapped);
+		return;
+	}
+
+
+	btTransform orgtrans0 = body0->getWorldTransform();
+
+	btTransform orgtrans1 = body1->getWorldTransform();
+
+	btAlignedObjectArray<int> collided_results;
+
+	gimpact_vs_shape_find_pairs(orgtrans0,orgtrans1,shape0,shape1,collided_results);
+
+	if(collided_results.size() == 0) return;
+
+
+	shape0->lockChildShapes();
+
+	GIM_ShapeRetriever retriever0(shape0);
+
+
+	bool child_has_transform0 = shape0->childrenHasTransform();
+
+
+	int i = collided_results.size();
+
+	while(i--)
+	{
+		int child_index = collided_results[i];
+        if(swapped)
+    		m_triface1 = child_index;
+        else
+            m_triface0 = child_index;
+
+		btCollisionShape * colshape0 = retriever0.getChildShape(child_index);
+
+		if(child_has_transform0)
+		{
+			body0->setWorldTransform(orgtrans0*shape0->getChildTransform(child_index));
+		}
+
+		//collide two shapes
+		if(swapped)
+		{
+			shape_vs_shape_collision(body1,body0,shape1,colshape0);
+		}
+		else
+		{
+			shape_vs_shape_collision(body0,body1,colshape0,shape1);
+		}
+
+		//restore transforms
+		if(child_has_transform0)
+		{
+			body0->setWorldTransform(orgtrans0);
+		}
+
+	}
+
+	shape0->unlockChildShapes();
+
+}
+
+void btGImpactCollisionAlgorithm::gimpact_vs_compoundshape(btCollisionObject * body0,
+				  btCollisionObject * body1,
+				  btGImpactShapeInterface * shape0,
+				  btCompoundShape * shape1,bool swapped)
+{
+	btTransform orgtrans1 = body1->getWorldTransform();
+
+	int i = shape1->getNumChildShapes();
+	while(i--)
+	{
+
+		btCollisionShape * colshape1 = shape1->getChildShape(i);
+		btTransform childtrans1 = orgtrans1*shape1->getChildTransform(i);
+
+		body1->setWorldTransform(childtrans1);
+
+		//collide child shape
+		gimpact_vs_shape(body0, body1,
+					  shape0,colshape1,swapped);
+
+
+		//restore transforms
+		body1->setWorldTransform(orgtrans1);
+	}
+}
+
+void btGImpactCollisionAlgorithm::gimpacttrimeshpart_vs_plane_collision(
+					  btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btGImpactMeshShapePart * shape0,
+					  btStaticPlaneShape * shape1,bool swapped)
+{
+
+
+	btTransform orgtrans0 = body0->getWorldTransform();
+	btTransform orgtrans1 = body1->getWorldTransform();
+
+	btPlaneShape * planeshape = static_cast<btPlaneShape *>(shape1);
+	btVector4 plane;
+	planeshape->get_plane_equation_transformed(orgtrans1,plane);
+
+	//test box against plane
+
+	btAABB tribox;
+	shape0->getAabb(orgtrans0,tribox.m_min,tribox.m_max);
+	tribox.increment_margin(planeshape->getMargin());
+
+	if( tribox.plane_classify(plane)!= BT_CONST_COLLIDE_PLANE) return;
+
+	shape0->lockChildShapes();
+
+	btScalar margin = shape0->getMargin() + planeshape->getMargin();
+
+	btVector3 vertex;
+	int vi = shape0->getVertexCount();
+	while(vi--)
+	{
+		shape0->getVertex(vi,vertex);
+		vertex = orgtrans0(vertex);
+
+		btScalar distance = vertex.dot(plane) - plane[3] - margin;
+
+		if(distance<0.0)//add contact
+		{
+			if(swapped)
+			{
+				addContactPoint(body1, body0,
+					vertex,
+					-plane,
+					distance);
+			}
+			else
+			{
+				addContactPoint(body0, body1,
+					vertex,
+					plane,
+					distance);
+			}
+		}
+	}
+
+	shape0->unlockChildShapes();
+}
+
+
+
+
+class btGImpactTriangleCallback: public btTriangleCallback
+{
+public:
+	btGImpactCollisionAlgorithm * algorithm;
+	btCollisionObject * body0;
+	btCollisionObject * body1;
+	btGImpactShapeInterface * gimpactshape0;
+	bool swapped;
+	btScalar margin;
+
+	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
+	{
+		btTriangleShapeEx tri1(triangle[0],triangle[1],triangle[2]);
+		tri1.setMargin(margin);
+        if(swapped)
+        {
+            algorithm->setPart0(partId);
+            algorithm->setFace0(triangleIndex);
+        }
+        else
+        {
+            algorithm->setPart1(partId);
+            algorithm->setFace1(triangleIndex);
+        }
+		algorithm->gimpact_vs_shape(
+							body0,body1,gimpactshape0,&tri1,swapped);
+	}
+};
+
+
+
+
+void btGImpactCollisionAlgorithm::gimpact_vs_concave(
+				  btCollisionObject * body0,
+				  btCollisionObject * body1,
+				  btGImpactShapeInterface * shape0,
+				  btConcaveShape * shape1,bool swapped)
+{
+	//create the callback
+	btGImpactTriangleCallback tricallback;
+	tricallback.algorithm = this;
+	tricallback.body0 = body0;
+	tricallback.body1 = body1;
+	tricallback.gimpactshape0 = shape0;
+	tricallback.swapped = swapped;
+	tricallback.margin = shape1->getMargin();
+
+	//getting the trimesh AABB
+	btTransform gimpactInConcaveSpace;
+
+	gimpactInConcaveSpace = body1->getWorldTransform().inverse() * body0->getWorldTransform();
+
+	btVector3 minAABB,maxAABB;
+	shape0->getAabb(gimpactInConcaveSpace,minAABB,maxAABB);
+
+	shape1->processAllTriangles(&tricallback,minAABB,maxAABB);
+
+}
+
+
+
+void btGImpactCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+    clearCache();
+
+    m_resultOut = resultOut;
+	m_dispatchInfo = &dispatchInfo;
+    btGImpactShapeInterface * gimpactshape0;
+    btGImpactShapeInterface * gimpactshape1;
+
+	if (body0->getCollisionShape()->getShapeType()==GIMPACT_SHAPE_PROXYTYPE)
+	{
+		gimpactshape0 = static_cast<btGImpactShapeInterface *>(body0->getCollisionShape());
+
+		if( body1->getCollisionShape()->getShapeType()==GIMPACT_SHAPE_PROXYTYPE )
+		{
+			gimpactshape1 = static_cast<btGImpactShapeInterface *>(body1->getCollisionShape());
+
+			gimpact_vs_gimpact(body0,body1,gimpactshape0,gimpactshape1);
+		}
+		else
+		{
+			gimpact_vs_shape(body0,body1,gimpactshape0,body1->getCollisionShape(),false);
+		}
+
+	}
+	else if (body1->getCollisionShape()->getShapeType()==GIMPACT_SHAPE_PROXYTYPE )
+	{
+		gimpactshape1 = static_cast<btGImpactShapeInterface *>(body1->getCollisionShape());
+
+		gimpact_vs_shape(body1,body0,gimpactshape1,body0->getCollisionShape(),true);
+	}
+}
+
+
+btScalar btGImpactCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	return 1.f;
+
+}
+
+///////////////////////////////////// REGISTERING ALGORITHM //////////////////////////////////////////////
+
+
+
+//! Use this function for register the algorithm externally
+void btGImpactCollisionAlgorithm::registerAlgorithm(btCollisionDispatcher * dispatcher)
+{
+
+	static btGImpactCollisionAlgorithm::CreateFunc s_gimpact_cf;
+
+	int i;
+
+	for ( i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ )
+	{
+		dispatcher->registerCollisionCreateFunc(GIMPACT_SHAPE_PROXYTYPE,i ,&s_gimpact_cf);
+	}
+
+	for ( i = 0;i < MAX_BROADPHASE_COLLISION_TYPES ;i++ )
+	{
+		dispatcher->registerCollisionCreateFunc(i,GIMPACT_SHAPE_PROXYTYPE ,&s_gimpact_cf);
+	}
+
+}
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h
new file mode 100644
index 0000000..6b6e07c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h
@@ -0,0 +1,306 @@
+/*! \file btGImpactShape.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_GIMPACT_BVH_CONCAVE_COLLISION_ALGORITHM_H
+#define BT_GIMPACT_BVH_CONCAVE_COLLISION_ALGORITHM_H
+
+#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+class btDispatcher;
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+
+#include "LinearMath/btAlignedObjectArray.h"
+
+#include "btGImpactShape.h"
+#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
+#include "BulletCollision/CollisionShapes/btCompoundShape.h"
+#include "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h"
+#include "LinearMath/btIDebugDraw.h"
+
+
+
+//! Collision Algorithm for GImpact Shapes
+/*!
+For register this algorithm in Bullet, proceed as following:
+ \code
+btCollisionDispatcher * dispatcher = static_cast<btCollisionDispatcher *>(m_dynamicsWorld ->getDispatcher());
+btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher);
+ \endcode
+*/
+class btGImpactCollisionAlgorithm : public btActivatingCollisionAlgorithm
+{
+protected:
+	btCollisionAlgorithm * m_convex_algorithm;
+    btPersistentManifold * m_manifoldPtr;
+	btManifoldResult* m_resultOut;
+	const btDispatcherInfo * m_dispatchInfo;
+	int m_triface0;
+	int m_part0;
+	int m_triface1;
+	int m_part1;
+
+
+	//! Creates a new contact point
+	SIMD_FORCE_INLINE btPersistentManifold* newContactManifold(btCollisionObject* body0,btCollisionObject* body1)
+	{
+		m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1);
+		return m_manifoldPtr;
+	}
+
+	SIMD_FORCE_INLINE void destroyConvexAlgorithm()
+	{
+		if(m_convex_algorithm)
+		{
+			m_convex_algorithm->~btCollisionAlgorithm();
+			m_dispatcher->freeCollisionAlgorithm( m_convex_algorithm);
+			m_convex_algorithm = NULL;
+		}
+	}
+
+	SIMD_FORCE_INLINE void destroyContactManifolds()
+	{
+		if(m_manifoldPtr == NULL) return;
+		m_dispatcher->releaseManifold(m_manifoldPtr);
+		m_manifoldPtr = NULL;
+	}
+
+	SIMD_FORCE_INLINE void clearCache()
+	{
+		destroyContactManifolds();
+		destroyConvexAlgorithm();
+
+		m_triface0 = -1;
+		m_part0 = -1;
+		m_triface1 = -1;
+		m_part1 = -1;
+	}
+
+	SIMD_FORCE_INLINE btPersistentManifold* getLastManifold()
+	{
+		return m_manifoldPtr;
+	}
+
+
+	// Call before process collision
+	SIMD_FORCE_INLINE void checkManifold(btCollisionObject* body0,btCollisionObject* body1)
+	{
+		if(getLastManifold() == 0)
+		{
+			newContactManifold(body0,body1);
+		}
+
+		m_resultOut->setPersistentManifold(getLastManifold());
+	}
+
+	// Call before process collision
+	SIMD_FORCE_INLINE btCollisionAlgorithm * newAlgorithm(btCollisionObject* body0,btCollisionObject* body1)
+	{
+		checkManifold(body0,body1);
+
+		btCollisionAlgorithm * convex_algorithm = m_dispatcher->findAlgorithm(
+				body0,body1,getLastManifold());
+		return convex_algorithm ;
+	}
+
+	// Call before process collision
+	SIMD_FORCE_INLINE void checkConvexAlgorithm(btCollisionObject* body0,btCollisionObject* body1)
+	{
+		if(m_convex_algorithm) return;
+		m_convex_algorithm = newAlgorithm(body0,body1);
+	}
+
+
+
+
+	void addContactPoint(btCollisionObject * body0,
+					btCollisionObject * body1,
+					const btVector3 & point,
+					const btVector3 & normal,
+					btScalar distance);
+
+//! Collision routines
+//!@{
+
+	void collide_gjk_triangles(btCollisionObject * body0,
+				  btCollisionObject * body1,
+				  btGImpactMeshShapePart * shape0,
+				  btGImpactMeshShapePart * shape1,
+				  const int * pairs, int pair_count);
+
+	void collide_sat_triangles(btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btGImpactMeshShapePart * shape0,
+					  btGImpactMeshShapePart * shape1,
+					  const int * pairs, int pair_count);
+
+
+
+
+	void shape_vs_shape_collision(
+					  btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btCollisionShape * shape0,
+					  btCollisionShape * shape1);
+
+	void convex_vs_convex_collision(btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btCollisionShape * shape0,
+					  btCollisionShape * shape1);
+
+
+
+	void gimpact_vs_gimpact_find_pairs(
+					  const btTransform & trans0,
+					  const btTransform & trans1,
+					  btGImpactShapeInterface * shape0,
+					  btGImpactShapeInterface * shape1,btPairSet & pairset);
+
+	void gimpact_vs_shape_find_pairs(
+					  const btTransform & trans0,
+					  const btTransform & trans1,
+					  btGImpactShapeInterface * shape0,
+					  btCollisionShape * shape1,
+					  btAlignedObjectArray<int> & collided_primitives);
+
+
+	void gimpacttrimeshpart_vs_plane_collision(
+					  btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btGImpactMeshShapePart * shape0,
+					  btStaticPlaneShape * shape1,bool swapped);
+
+
+public:
+
+	btGImpactCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
+
+	virtual ~btGImpactCollisionAlgorithm();
+
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		if (m_manifoldPtr)
+			manifoldArray.push_back(m_manifoldPtr);
+	}
+
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btGImpactCollisionAlgorithm));
+			return new(mem) btGImpactCollisionAlgorithm(ci,body0,body1);
+		}
+	};
+
+	//! Use this function for register the algorithm externally
+	static void registerAlgorithm(btCollisionDispatcher * dispatcher);
+#ifdef TRI_COLLISION_PROFILING
+	//! Gets the average time in miliseconds of tree collisions
+	static float getAverageTreeCollisionTime();
+
+	//! Gets the average time in miliseconds of triangle collisions
+	static float getAverageTriangleCollisionTime();
+#endif //TRI_COLLISION_PROFILING
+
+	//! Collides two gimpact shapes
+	/*!
+	\pre shape0 and shape1 couldn't be btGImpactMeshShape objects
+	*/
+
+
+	void gimpact_vs_gimpact(btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btGImpactShapeInterface * shape0,
+					  btGImpactShapeInterface * shape1);
+
+	void gimpact_vs_shape(btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btGImpactShapeInterface * shape0,
+					  btCollisionShape * shape1,bool swapped);
+
+	void gimpact_vs_compoundshape(btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btGImpactShapeInterface * shape0,
+					  btCompoundShape * shape1,bool swapped);
+
+	void gimpact_vs_concave(
+					  btCollisionObject * body0,
+					  btCollisionObject * body1,
+					  btGImpactShapeInterface * shape0,
+					  btConcaveShape * shape1,bool swapped);
+
+
+
+
+		/// Accessor/Mutator pairs for Part and triangleID
+    void 	setFace0(int value) 
+    { 
+    	m_triface0 = value; 
+    }
+    int getFace0() 
+    { 
+    	return m_triface0; 
+    }
+    void setFace1(int value) 
+    { 
+    	m_triface1 = value; 
+    }
+    int getFace1() 
+    { 
+    	return m_triface1; 
+    }
+    void setPart0(int value) 
+    { 
+    	m_part0 = value; 
+    }
+    int getPart0() 
+    { 
+    	return m_part0; 
+    }
+    void setPart1(int value) 
+    { 
+    	m_part1 = value; 
+		}
+    int getPart1() 
+    { 
+    	return m_part1; 
+    }
+
+};
+
+
+//algorithm details
+//#define BULLET_TRIANGLE_COLLISION 1
+#define GIMPACT_VS_PLANE_COLLISION 1
+
+
+
+#endif //BT_GIMPACT_BVH_CONCAVE_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactMassUtil.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactMassUtil.h
new file mode 100644
index 0000000..2543aef
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactMassUtil.h
@@ -0,0 +1,60 @@
+/*! \file btGImpactMassUtil.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef GIMPACT_MASS_UTIL_H
+#define GIMPACT_MASS_UTIL_H
+
+#include "LinearMath/btTransform.h"
+
+
+
+SIMD_FORCE_INLINE btVector3 gim_inertia_add_transformed(
+	const btVector3 & source_inertia, const btVector3 & added_inertia, const btTransform & transform)
+{
+	btMatrix3x3  rotatedTensor = transform.getBasis().scaled(added_inertia) * transform.getBasis().transpose();
+
+	btScalar x2 = transform.getOrigin()[0];
+	x2*= x2;
+	btScalar y2 = transform.getOrigin()[1];
+	y2*= y2;
+	btScalar z2 = transform.getOrigin()[2];
+	z2*= z2;
+
+	btScalar ix = rotatedTensor[0][0]*(y2+z2);
+	btScalar iy = rotatedTensor[1][1]*(x2+z2);
+	btScalar iz = rotatedTensor[2][2]*(x2+y2);
+
+	return btVector3(source_inertia[0]+ix,source_inertia[1]+iy,source_inertia[2] + iz);
+}
+
+SIMD_FORCE_INLINE btVector3 gim_get_point_inertia(const btVector3 & point, btScalar mass)
+{
+	btScalar x2 = point[0]*point[0];
+	btScalar y2 = point[1]*point[1];
+	btScalar z2 = point[2]*point[2];
+	return btVector3(mass*(y2+z2),mass*(x2+z2),mass*(x2+y2));
+}
+
+
+#endif //GIMPACT_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
new file mode 100644
index 0000000..cd4dfdb
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
@@ -0,0 +1,528 @@
+/*! \file gim_box_set.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btGImpactQuantizedBvh.h"
+#include "LinearMath/btQuickprof.h"
+
+#ifdef TRI_COLLISION_PROFILING
+btClock g_q_tree_clock;
+
+
+float g_q_accum_tree_collision_time = 0;
+int g_q_count_traversing = 0;
+
+
+void bt_begin_gim02_q_tree_time()
+{
+	g_q_tree_clock.reset();
+}
+
+void bt_end_gim02_q_tree_time()
+{
+	g_q_accum_tree_collision_time += g_q_tree_clock.getTimeMicroseconds();
+	g_q_count_traversing++;
+}
+
+
+//! Gets the average time in miliseconds of tree collisions
+float btGImpactQuantizedBvh::getAverageTreeCollisionTime()
+{
+	if(g_q_count_traversing == 0) return 0;
+
+	float avgtime = g_q_accum_tree_collision_time;
+	avgtime /= (float)g_q_count_traversing;
+
+	g_q_accum_tree_collision_time = 0;
+	g_q_count_traversing = 0;
+	return avgtime;
+
+//	float avgtime = g_q_count_traversing;
+//	g_q_count_traversing = 0;
+//	return avgtime;
+
+}
+
+#endif //TRI_COLLISION_PROFILING
+
+/////////////////////// btQuantizedBvhTree /////////////////////////////////
+
+void btQuantizedBvhTree::calc_quantization(
+	GIM_BVH_DATA_ARRAY & primitive_boxes, btScalar boundMargin)
+{
+	//calc globa box
+	btAABB global_bound;
+	global_bound.invalidate();
+
+	for (int i=0;i<primitive_boxes.size() ;i++ )
+	{
+		global_bound.merge(primitive_boxes[i].m_bound);
+	}
+
+	bt_calc_quantization_parameters(
+		m_global_bound.m_min,m_global_bound.m_max,m_bvhQuantization,global_bound.m_min,global_bound.m_max,boundMargin);
+
+}
+
+
+
+int btQuantizedBvhTree::_calc_splitting_axis(
+	GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex)
+{
+
+	int i;
+
+	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
+	btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.));
+	int numIndices = endIndex-startIndex;
+
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		means+=center;
+	}
+	means *= (btScalar(1.)/(btScalar)numIndices);
+
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		btVector3 diff2 = center-means;
+		diff2 = diff2 * diff2;
+		variance += diff2;
+	}
+	variance *= (btScalar(1.)/	((btScalar)numIndices-1)	);
+
+	return variance.maxAxis();
+}
+
+
+int btQuantizedBvhTree::_sort_and_calc_splitting_index(
+	GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,
+	int endIndex, int splitAxis)
+{
+	int i;
+	int splitIndex =startIndex;
+	int numIndices = endIndex - startIndex;
+
+	// average of centers
+	btScalar splitValue = 0.0f;
+
+	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		means+=center;
+	}
+	means *= (btScalar(1.)/(btScalar)numIndices);
+
+	splitValue = means[splitAxis];
+
+
+	//sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		if (center[splitAxis] > splitValue)
+		{
+			//swap
+			primitive_boxes.swap(i,splitIndex);
+			//swapLeafNodes(i,splitIndex);
+			splitIndex++;
+		}
+	}
+
+	//if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex
+	//otherwise the tree-building might fail due to stack-overflows in certain cases.
+	//unbalanced1 is unsafe: it can cause stack overflows
+	//bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1)));
+
+	//unbalanced2 should work too: always use center (perfect balanced trees)
+	//bool unbalanced2 = true;
+
+	//this should be safe too:
+	int rangeBalancedIndices = numIndices/3;
+	bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices)));
+
+	if (unbalanced)
+	{
+		splitIndex = startIndex+ (numIndices>>1);
+	}
+
+	btAssert(!((splitIndex==startIndex) || (splitIndex == (endIndex))));
+
+	return splitIndex;
+
+}
+
+
+void btQuantizedBvhTree::_build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex)
+{
+	int curIndex = m_num_nodes;
+	m_num_nodes++;
+
+	btAssert((endIndex-startIndex)>0);
+
+	if ((endIndex-startIndex)==1)
+	{
+	    //We have a leaf node
+	    setNodeBound(curIndex,primitive_boxes[startIndex].m_bound);
+		m_node_array[curIndex].setDataIndex(primitive_boxes[startIndex].m_data);
+
+		return;
+	}
+	//calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
+
+	//split axis
+	int splitIndex = _calc_splitting_axis(primitive_boxes,startIndex,endIndex);
+
+	splitIndex = _sort_and_calc_splitting_index(
+			primitive_boxes,startIndex,endIndex,
+			splitIndex//split axis
+			);
+
+
+	//calc this node bounding box
+
+	btAABB node_bound;
+	node_bound.invalidate();
+
+	for (int i=startIndex;i<endIndex;i++)
+	{
+		node_bound.merge(primitive_boxes[i].m_bound);
+	}
+
+	setNodeBound(curIndex,node_bound);
+
+
+	//build left branch
+	_build_sub_tree(primitive_boxes, startIndex, splitIndex );
+
+
+	//build right branch
+	 _build_sub_tree(primitive_boxes, splitIndex ,endIndex);
+
+	m_node_array[curIndex].setEscapeIndex(m_num_nodes - curIndex);
+
+
+}
+
+//! stackless build tree
+void btQuantizedBvhTree::build_tree(
+	GIM_BVH_DATA_ARRAY & primitive_boxes)
+{
+	calc_quantization(primitive_boxes);
+	// initialize node count to 0
+	m_num_nodes = 0;
+	// allocate nodes
+	m_node_array.resize(primitive_boxes.size()*2);
+
+	_build_sub_tree(primitive_boxes, 0, primitive_boxes.size());
+}
+
+////////////////////////////////////class btGImpactQuantizedBvh
+
+void btGImpactQuantizedBvh::refit()
+{
+	int nodecount = getNodeCount();
+	while(nodecount--)
+	{
+		if(isLeafNode(nodecount))
+		{
+			btAABB leafbox;
+			m_primitive_manager->get_primitive_box(getNodeData(nodecount),leafbox);
+			setNodeBound(nodecount,leafbox);
+		}
+		else
+		{
+			//const GIM_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);
+			//get left bound
+			btAABB bound;
+			bound.invalidate();
+
+			btAABB temp_box;
+
+			int child_node = getLeftNode(nodecount);
+			if(child_node)
+			{
+				getNodeBound(child_node,temp_box);
+				bound.merge(temp_box);
+			}
+
+			child_node = getRightNode(nodecount);
+			if(child_node)
+			{
+				getNodeBound(child_node,temp_box);
+				bound.merge(temp_box);
+			}
+
+			setNodeBound(nodecount,bound);
+		}
+	}
+}
+
+//! this rebuild the entire set
+void btGImpactQuantizedBvh::buildSet()
+{
+	//obtain primitive boxes
+	GIM_BVH_DATA_ARRAY primitive_boxes;
+	primitive_boxes.resize(m_primitive_manager->get_primitive_count());
+
+	for (int i = 0;i<primitive_boxes.size() ;i++ )
+	{
+		 m_primitive_manager->get_primitive_box(i,primitive_boxes[i].m_bound);
+		 primitive_boxes[i].m_data = i;
+	}
+
+	m_box_tree.build_tree(primitive_boxes);
+}
+
+//! returns the indices of the primitives in the m_primitive_manager
+bool btGImpactQuantizedBvh::boxQuery(const btAABB & box, btAlignedObjectArray<int> & collided_results) const
+{
+	int curIndex = 0;
+	int numNodes = getNodeCount();
+
+	//quantize box
+
+	unsigned short quantizedMin[3];
+	unsigned short quantizedMax[3];
+
+	m_box_tree.quantizePoint(quantizedMin,box.m_min);
+	m_box_tree.quantizePoint(quantizedMax,box.m_max);
+
+
+	while (curIndex < numNodes)
+	{
+
+		//catch bugs in tree data
+
+		bool aabbOverlap = m_box_tree.testQuantizedBoxOverlapp(curIndex, quantizedMin,quantizedMax);
+		bool isleafnode = isLeafNode(curIndex);
+
+		if (isleafnode && aabbOverlap)
+		{
+			collided_results.push_back(getNodeData(curIndex));
+		}
+
+		if (aabbOverlap || isleafnode)
+		{
+			//next subnode
+			curIndex++;
+		}
+		else
+		{
+			//skip node
+			curIndex+= getEscapeNodeIndex(curIndex);
+		}
+	}
+	if(collided_results.size()>0) return true;
+	return false;
+}
+
+
+
+//! returns the indices of the primitives in the m_primitive_manager
+bool btGImpactQuantizedBvh::rayQuery(
+	const btVector3 & ray_dir,const btVector3 & ray_origin ,
+	btAlignedObjectArray<int> & collided_results) const
+{
+	int curIndex = 0;
+	int numNodes = getNodeCount();
+
+	while (curIndex < numNodes)
+	{
+		btAABB bound;
+		getNodeBound(curIndex,bound);
+
+		//catch bugs in tree data
+
+		bool aabbOverlap = bound.collide_ray(ray_origin,ray_dir);
+		bool isleafnode = isLeafNode(curIndex);
+
+		if (isleafnode && aabbOverlap)
+		{
+			collided_results.push_back(getNodeData( curIndex));
+		}
+
+		if (aabbOverlap || isleafnode)
+		{
+			//next subnode
+			curIndex++;
+		}
+		else
+		{
+			//skip node
+			curIndex+= getEscapeNodeIndex(curIndex);
+		}
+	}
+	if(collided_results.size()>0) return true;
+	return false;
+}
+
+
+SIMD_FORCE_INLINE bool _quantized_node_collision(
+	btGImpactQuantizedBvh * boxset0, btGImpactQuantizedBvh * boxset1,
+	const BT_BOX_BOX_TRANSFORM_CACHE & trans_cache_1to0,
+	int node0 ,int node1, bool complete_primitive_tests)
+{
+	btAABB box0;
+	boxset0->getNodeBound(node0,box0);
+	btAABB box1;
+	boxset1->getNodeBound(node1,box1);
+
+	return box0.overlapping_trans_cache(box1,trans_cache_1to0,complete_primitive_tests );
+//	box1.appy_transform_trans_cache(trans_cache_1to0);
+//	return box0.has_collision(box1);
+
+}
+
+
+//stackless recursive collision routine
+static void _find_quantized_collision_pairs_recursive(
+	btGImpactQuantizedBvh * boxset0, btGImpactQuantizedBvh * boxset1,
+	btPairSet * collision_pairs,
+	const BT_BOX_BOX_TRANSFORM_CACHE & trans_cache_1to0,
+	int node0, int node1, bool complete_primitive_tests)
+{
+
+
+
+	if( _quantized_node_collision(
+		boxset0,boxset1,trans_cache_1to0,
+		node0,node1,complete_primitive_tests) ==false) return;//avoid colliding internal nodes
+
+	if(boxset0->isLeafNode(node0))
+	{
+		if(boxset1->isLeafNode(node1))
+		{
+			// collision result
+			collision_pairs->push_pair(
+				boxset0->getNodeData(node0),boxset1->getNodeData(node1));
+			return;
+		}
+		else
+		{
+
+			//collide left recursive
+
+			_find_quantized_collision_pairs_recursive(
+								boxset0,boxset1,
+								collision_pairs,trans_cache_1to0,
+								node0,boxset1->getLeftNode(node1),false);
+
+			//collide right recursive
+			_find_quantized_collision_pairs_recursive(
+								boxset0,boxset1,
+								collision_pairs,trans_cache_1to0,
+								node0,boxset1->getRightNode(node1),false);
+
+
+		}
+	}
+	else
+	{
+		if(boxset1->isLeafNode(node1))
+		{
+
+			//collide left recursive
+			_find_quantized_collision_pairs_recursive(
+								boxset0,boxset1,
+								collision_pairs,trans_cache_1to0,
+								boxset0->getLeftNode(node0),node1,false);
+
+
+			//collide right recursive
+
+			_find_quantized_collision_pairs_recursive(
+								boxset0,boxset1,
+								collision_pairs,trans_cache_1to0,
+								boxset0->getRightNode(node0),node1,false);
+
+
+		}
+		else
+		{
+			//collide left0 left1
+
+
+
+			_find_quantized_collision_pairs_recursive(
+				boxset0,boxset1,
+				collision_pairs,trans_cache_1to0,
+				boxset0->getLeftNode(node0),boxset1->getLeftNode(node1),false);
+
+			//collide left0 right1
+
+			_find_quantized_collision_pairs_recursive(
+				boxset0,boxset1,
+				collision_pairs,trans_cache_1to0,
+				boxset0->getLeftNode(node0),boxset1->getRightNode(node1),false);
+
+
+			//collide right0 left1
+
+			_find_quantized_collision_pairs_recursive(
+				boxset0,boxset1,
+				collision_pairs,trans_cache_1to0,
+				boxset0->getRightNode(node0),boxset1->getLeftNode(node1),false);
+
+			//collide right0 right1
+
+			_find_quantized_collision_pairs_recursive(
+				boxset0,boxset1,
+				collision_pairs,trans_cache_1to0,
+				boxset0->getRightNode(node0),boxset1->getRightNode(node1),false);
+
+		}// else if node1 is not a leaf
+	}// else if node0 is not a leaf
+}
+
+
+void btGImpactQuantizedBvh::find_collision(btGImpactQuantizedBvh * boxset0, const btTransform & trans0,
+		btGImpactQuantizedBvh * boxset1, const btTransform & trans1,
+		btPairSet & collision_pairs)
+{
+
+	if(boxset0->getNodeCount()==0 || boxset1->getNodeCount()==0 ) return;
+
+	BT_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0;
+
+	trans_cache_1to0.calc_from_homogenic(trans0,trans1);
+
+#ifdef TRI_COLLISION_PROFILING
+	bt_begin_gim02_q_tree_time();
+#endif //TRI_COLLISION_PROFILING
+
+	_find_quantized_collision_pairs_recursive(
+		boxset0,boxset1,
+		&collision_pairs,trans_cache_1to0,0,0,true);
+#ifdef TRI_COLLISION_PROFILING
+	bt_end_gim02_q_tree_time();
+#endif //TRI_COLLISION_PROFILING
+
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.h
new file mode 100644
index 0000000..9c99077
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactQuantizedBvh.h
@@ -0,0 +1,372 @@
+#ifndef GIM_QUANTIZED_SET_H_INCLUDED
+#define GIM_QUANTIZED_SET_H_INCLUDED
+
+/*! \file btGImpactQuantizedBvh.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btGImpactBvh.h"
+#include "btQuantization.h"
+
+
+
+
+
+///btQuantizedBvhNode is a compressed aabb node, 16 bytes.
+///Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).
+ATTRIBUTE_ALIGNED16	(struct) BT_QUANTIZED_BVH_NODE
+{
+	//12 bytes
+	unsigned short int	m_quantizedAabbMin[3];
+	unsigned short int	m_quantizedAabbMax[3];
+	//4 bytes
+	int	m_escapeIndexOrDataIndex;
+
+	BT_QUANTIZED_BVH_NODE()
+	{
+		m_escapeIndexOrDataIndex = 0;
+	}
+
+	SIMD_FORCE_INLINE bool isLeafNode() const
+	{
+		//skipindex is negative (internal node), triangleindex >=0 (leafnode)
+		return (m_escapeIndexOrDataIndex>=0);
+	}
+
+	SIMD_FORCE_INLINE int getEscapeIndex() const
+	{
+		//btAssert(m_escapeIndexOrDataIndex < 0);
+		return -m_escapeIndexOrDataIndex;
+	}
+
+	SIMD_FORCE_INLINE void setEscapeIndex(int index)
+	{
+		m_escapeIndexOrDataIndex = -index;
+	}
+
+	SIMD_FORCE_INLINE int getDataIndex() const
+	{
+		//btAssert(m_escapeIndexOrDataIndex >= 0);
+
+		return m_escapeIndexOrDataIndex;
+	}
+
+	SIMD_FORCE_INLINE void setDataIndex(int index)
+	{
+		m_escapeIndexOrDataIndex = index;
+	}
+
+	SIMD_FORCE_INLINE bool testQuantizedBoxOverlapp(
+		unsigned short * quantizedMin,unsigned short * quantizedMax) const
+	{
+		if(m_quantizedAabbMin[0] > quantizedMax[0] ||
+		   m_quantizedAabbMax[0] < quantizedMin[0] ||
+		   m_quantizedAabbMin[1] > quantizedMax[1] ||
+		   m_quantizedAabbMax[1] < quantizedMin[1] ||
+		   m_quantizedAabbMin[2] > quantizedMax[2] ||
+		   m_quantizedAabbMax[2] < quantizedMin[2])
+		{
+			return false;
+		}
+		return true;
+	}
+
+};
+
+
+
+class GIM_QUANTIZED_BVH_NODE_ARRAY:public btAlignedObjectArray<BT_QUANTIZED_BVH_NODE>
+{
+};
+
+
+
+
+//! Basic Box tree structure
+class btQuantizedBvhTree
+{
+protected:
+	int m_num_nodes;
+	GIM_QUANTIZED_BVH_NODE_ARRAY m_node_array;
+	btAABB m_global_bound;
+	btVector3 m_bvhQuantization;
+protected:
+	void calc_quantization(GIM_BVH_DATA_ARRAY & primitive_boxes, btScalar boundMargin = btScalar(1.0) );
+
+	int _sort_and_calc_splitting_index(
+		GIM_BVH_DATA_ARRAY & primitive_boxes,
+		 int startIndex,  int endIndex, int splitAxis);
+
+	int _calc_splitting_axis(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex);
+
+	void _build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,  int endIndex);
+public:
+	btQuantizedBvhTree()
+	{
+		m_num_nodes = 0;
+	}
+
+	//! prototype functions for box tree management
+	//!@{
+	void build_tree(GIM_BVH_DATA_ARRAY & primitive_boxes);
+
+	SIMD_FORCE_INLINE void quantizePoint(
+		unsigned short * quantizedpoint, const btVector3 & point) const
+	{
+		bt_quantize_clamp(quantizedpoint,point,m_global_bound.m_min,m_global_bound.m_max,m_bvhQuantization);
+	}
+
+
+	SIMD_FORCE_INLINE bool testQuantizedBoxOverlapp(
+		int node_index,
+		unsigned short * quantizedMin,unsigned short * quantizedMax) const
+	{
+		return m_node_array[node_index].testQuantizedBoxOverlapp(quantizedMin,quantizedMax);
+	}
+
+	SIMD_FORCE_INLINE void clearNodes()
+	{
+		m_node_array.clear();
+		m_num_nodes = 0;
+	}
+
+	//! node count
+	SIMD_FORCE_INLINE int getNodeCount() const
+	{
+		return m_num_nodes;
+	}
+
+	//! tells if the node is a leaf
+	SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
+	{
+		return m_node_array[nodeindex].isLeafNode();
+	}
+
+	SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
+	{
+		return m_node_array[nodeindex].getDataIndex();
+	}
+
+	SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB & bound) const
+	{
+		bound.m_min = bt_unquantize(
+			m_node_array[nodeindex].m_quantizedAabbMin,
+			m_global_bound.m_min,m_bvhQuantization);
+
+		bound.m_max = bt_unquantize(
+			m_node_array[nodeindex].m_quantizedAabbMax,
+			m_global_bound.m_min,m_bvhQuantization);
+	}
+
+	SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB & bound)
+	{
+		bt_quantize_clamp(	m_node_array[nodeindex].m_quantizedAabbMin,
+							bound.m_min,
+							m_global_bound.m_min,
+							m_global_bound.m_max,
+							m_bvhQuantization);
+
+		bt_quantize_clamp(	m_node_array[nodeindex].m_quantizedAabbMax,
+							bound.m_max,
+							m_global_bound.m_min,
+							m_global_bound.m_max,
+							m_bvhQuantization);
+	}
+
+	SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
+	{
+		return nodeindex+1;
+	}
+
+	SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
+	{
+		if(m_node_array[nodeindex+1].isLeafNode()) return nodeindex+2;
+		return nodeindex+1 + m_node_array[nodeindex+1].getEscapeIndex();
+	}
+
+	SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
+	{
+		return m_node_array[nodeindex].getEscapeIndex();
+	}
+
+	SIMD_FORCE_INLINE const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index = 0) const
+	{
+		return &m_node_array[index];
+	}
+
+	//!@}
+};
+
+
+
+//! Structure for containing Boxes
+/*!
+This class offers an structure for managing a box tree of primitives.
+Requires a Primitive prototype (like btPrimitiveManagerBase )
+*/
+class btGImpactQuantizedBvh
+{
+protected:
+	btQuantizedBvhTree m_box_tree;
+	btPrimitiveManagerBase * m_primitive_manager;
+
+protected:
+	//stackless refit
+	void refit();
+public:
+
+	//! this constructor doesn't build the tree. you must call	buildSet
+	btGImpactQuantizedBvh()
+	{
+		m_primitive_manager = NULL;
+	}
+
+	//! this constructor doesn't build the tree. you must call	buildSet
+	btGImpactQuantizedBvh(btPrimitiveManagerBase * primitive_manager)
+	{
+		m_primitive_manager = primitive_manager;
+	}
+
+	SIMD_FORCE_INLINE btAABB getGlobalBox()  const
+	{
+		btAABB totalbox;
+		getNodeBound(0, totalbox);
+		return totalbox;
+	}
+
+	SIMD_FORCE_INLINE void setPrimitiveManager(btPrimitiveManagerBase * primitive_manager)
+	{
+		m_primitive_manager = primitive_manager;
+	}
+
+	SIMD_FORCE_INLINE btPrimitiveManagerBase * getPrimitiveManager() const
+	{
+		return m_primitive_manager;
+	}
+
+
+//! node manager prototype functions
+///@{
+
+	//! this attemps to refit the box set.
+	SIMD_FORCE_INLINE void update()
+	{
+		refit();
+	}
+
+	//! this rebuild the entire set
+	void buildSet();
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	bool boxQuery(const btAABB & box, btAlignedObjectArray<int> & collided_results) const;
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	SIMD_FORCE_INLINE bool boxQueryTrans(const btAABB & box,
+		 const btTransform & transform, btAlignedObjectArray<int> & collided_results) const
+	{
+		btAABB transbox=box;
+		transbox.appy_transform(transform);
+		return boxQuery(transbox,collided_results);
+	}
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	bool rayQuery(
+		const btVector3 & ray_dir,const btVector3 & ray_origin ,
+		btAlignedObjectArray<int> & collided_results) const;
+
+	//! tells if this set has hierarcht
+	SIMD_FORCE_INLINE bool hasHierarchy() const
+	{
+		return true;
+	}
+
+	//! tells if this set is a trimesh
+	SIMD_FORCE_INLINE bool isTrimesh()  const
+	{
+		return m_primitive_manager->is_trimesh();
+	}
+
+	//! node count
+	SIMD_FORCE_INLINE int getNodeCount() const
+	{
+		return m_box_tree.getNodeCount();
+	}
+
+	//! tells if the node is a leaf
+	SIMD_FORCE_INLINE bool isLeafNode(int nodeindex) const
+	{
+		return m_box_tree.isLeafNode(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE int getNodeData(int nodeindex) const
+	{
+		return m_box_tree.getNodeData(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE void getNodeBound(int nodeindex, btAABB & bound)  const
+	{
+		m_box_tree.getNodeBound(nodeindex, bound);
+	}
+
+	SIMD_FORCE_INLINE void setNodeBound(int nodeindex, const btAABB & bound)
+	{
+		m_box_tree.setNodeBound(nodeindex, bound);
+	}
+
+
+	SIMD_FORCE_INLINE int getLeftNode(int nodeindex) const
+	{
+		return m_box_tree.getLeftNode(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE int getRightNode(int nodeindex) const
+	{
+		return m_box_tree.getRightNode(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE int getEscapeNodeIndex(int nodeindex) const
+	{
+		return m_box_tree.getEscapeNodeIndex(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE void getNodeTriangle(int nodeindex,btPrimitiveTriangle & triangle) const
+	{
+		m_primitive_manager->get_primitive_triangle(getNodeData(nodeindex),triangle);
+	}
+
+
+	SIMD_FORCE_INLINE const BT_QUANTIZED_BVH_NODE * get_node_pointer(int index = 0) const
+	{
+		return m_box_tree.get_node_pointer(index);
+	}
+
+#ifdef TRI_COLLISION_PROFILING
+	static float getAverageTreeCollisionTime();
+#endif //TRI_COLLISION_PROFILING
+
+	static void find_collision(btGImpactQuantizedBvh * boxset1, const btTransform & trans1,
+		btGImpactQuantizedBvh * boxset2, const btTransform & trans2,
+		btPairSet & collision_pairs);
+};
+
+
+#endif // GIM_BOXPRUNING_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.cpp
new file mode 100644
index 0000000..cceace5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.cpp
@@ -0,0 +1,203 @@
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btGImpactShape.h"
+#include "btGImpactMassUtil.h"
+
+
+#define CALC_EXACT_INERTIA 1
+
+void btGImpactCompoundShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	lockChildShapes();
+#ifdef CALC_EXACT_INERTIA
+	inertia.setValue(0.f,0.f,0.f);
+
+	int i = this->getNumChildShapes();
+	btScalar shapemass = mass/btScalar(i);
+
+	while(i--)
+	{
+		btVector3 temp_inertia;
+		m_childShapes[i]->calculateLocalInertia(shapemass,temp_inertia);
+		if(childrenHasTransform())
+		{
+			inertia = gim_inertia_add_transformed( inertia,temp_inertia,m_childTransforms[i]);
+		}
+		else
+		{
+			inertia = gim_inertia_add_transformed( inertia,temp_inertia,btTransform::getIdentity());
+		}
+
+	}
+
+#else
+
+	// Calc box inertia
+
+	btScalar lx= m_localAABB.m_max[0] - m_localAABB.m_min[0];
+	btScalar ly= m_localAABB.m_max[1] - m_localAABB.m_min[1];
+	btScalar lz= m_localAABB.m_max[2] - m_localAABB.m_min[2];
+	const btScalar x2 = lx*lx;
+	const btScalar y2 = ly*ly;
+	const btScalar z2 = lz*lz;
+	const btScalar scaledmass = mass * btScalar(0.08333333);
+
+	inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
+
+#endif
+	unlockChildShapes();
+}
+
+
+
+void btGImpactMeshShapePart::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+	lockChildShapes();
+
+
+#ifdef CALC_EXACT_INERTIA
+	inertia.setValue(0.f,0.f,0.f);
+
+	int i = this->getVertexCount();
+	btScalar pointmass = mass/btScalar(i);
+
+	while(i--)
+	{
+		btVector3 pointintertia;
+		this->getVertex(i,pointintertia);
+		pointintertia = gim_get_point_inertia(pointintertia,pointmass);
+		inertia+=pointintertia;
+	}
+
+#else
+
+	// Calc box inertia
+
+	btScalar lx= m_localAABB.m_max[0] - m_localAABB.m_min[0];
+	btScalar ly= m_localAABB.m_max[1] - m_localAABB.m_min[1];
+	btScalar lz= m_localAABB.m_max[2] - m_localAABB.m_min[2];
+	const btScalar x2 = lx*lx;
+	const btScalar y2 = ly*ly;
+	const btScalar z2 = lz*lz;
+	const btScalar scaledmass = mass * btScalar(0.08333333);
+
+	inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
+
+#endif
+
+	unlockChildShapes();
+}
+
+void btGImpactMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
+{
+
+#ifdef CALC_EXACT_INERTIA
+	inertia.setValue(0.f,0.f,0.f);
+
+	int i = this->getMeshPartCount();
+	btScalar partmass = mass/btScalar(i);
+
+	while(i--)
+	{
+		btVector3 partinertia;
+		getMeshPart(i)->calculateLocalInertia(partmass,partinertia);
+		inertia+=partinertia;
+	}
+
+#else
+
+	// Calc box inertia
+
+	btScalar lx= m_localAABB.m_max[0] - m_localAABB.m_min[0];
+	btScalar ly= m_localAABB.m_max[1] - m_localAABB.m_min[1];
+	btScalar lz= m_localAABB.m_max[2] - m_localAABB.m_min[2];
+	const btScalar x2 = lx*lx;
+	const btScalar y2 = ly*ly;
+	const btScalar z2 = lz*lz;
+	const btScalar scaledmass = mass * btScalar(0.08333333);
+
+	inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));
+
+#endif
+}
+
+void btGImpactMeshShape::rayTest(const btVector3& rayFrom, const btVector3& rayTo, btCollisionWorld::RayResultCallback& resultCallback) const
+{
+}
+
+
+void btGImpactMeshShapePart::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	lockChildShapes();
+	btAABB box;
+	box.m_min = aabbMin;
+	box.m_max = aabbMax;
+
+	btAlignedObjectArray<int> collided;
+	m_box_set.boxQuery(box,collided);
+
+	if(collided.size()==0)
+	{
+		unlockChildShapes();
+		return;
+	}
+
+	int part = (int)getPart();
+	btPrimitiveTriangle triangle;
+	int i = collided.size();
+	while(i--)
+	{
+		this->getPrimitiveTriangle(collided[i],triangle);
+		callback->processTriangle(triangle.m_vertices,part,collided[i]);
+	}
+	unlockChildShapes();
+
+}
+
+void btGImpactMeshShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+{
+	int i = m_mesh_parts.size();
+	while(i--)
+	{
+		m_mesh_parts[i]->processAllTriangles(callback,aabbMin,aabbMax);
+	}
+}
+
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btGImpactMeshShape::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btGImpactMeshShapeData* trimeshData = (btGImpactMeshShapeData*) dataBuffer;
+
+	btCollisionShape::serialize(&trimeshData->m_collisionShapeData,serializer);
+
+	m_meshInterface->serialize(&trimeshData->m_meshInterface, serializer);
+
+	trimeshData->m_collisionMargin = float(m_collisionMargin);
+
+	localScaling.serializeFloat(trimeshData->m_localScaling);
+
+	trimeshData->m_gimpactSubType = int(getGImpactShapeType());
+
+	return "btGImpactMeshShapeData";
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.h
new file mode 100644
index 0000000..90015bb
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGImpactShape.h
@@ -0,0 +1,1171 @@
+/*! \file btGImpactShape.h
+\author Francisco Len N�jera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef GIMPACT_SHAPE_H
+#define GIMPACT_SHAPE_H
+
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+#include "BulletCollision/CollisionShapes/btStridingMeshInterface.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
+#include "BulletCollision/CollisionShapes/btConcaveShape.h"
+#include "BulletCollision/CollisionShapes/btTetrahedronShape.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "LinearMath/btAlignedObjectArray.h"
+
+#include "btGImpactQuantizedBvh.h" // box tree class
+
+
+//! declare Quantized trees, (you can change to float based trees)
+typedef btGImpactQuantizedBvh btGImpactBoxSet;
+
+enum eGIMPACT_SHAPE_TYPE
+{
+	CONST_GIMPACT_COMPOUND_SHAPE = 0,
+	CONST_GIMPACT_TRIMESH_SHAPE_PART,
+	CONST_GIMPACT_TRIMESH_SHAPE
+};
+
+
+//! Helper class for tetrahedrons
+class btTetrahedronShapeEx:public btBU_Simplex1to4
+{
+public:
+	btTetrahedronShapeEx()
+	{
+		m_numVertices = 4;
+	}
+
+
+	SIMD_FORCE_INLINE void setVertices(
+		const btVector3 & v0,const btVector3 & v1,
+		const btVector3 & v2,const btVector3 & v3)
+	{
+		m_vertices[0] = v0;
+		m_vertices[1] = v1;
+		m_vertices[2] = v2;
+		m_vertices[3] = v3;
+		recalcLocalAabb();
+	}
+};
+
+
+//! Base class for gimpact shapes
+class btGImpactShapeInterface : public btConcaveShape
+{
+protected:
+    btAABB m_localAABB;
+    bool m_needs_update;
+    btVector3  localScaling;
+    btGImpactBoxSet m_box_set;// optionally boxset
+
+	//! use this function for perfofm refit in bounding boxes
+    //! use this function for perfofm refit in bounding boxes
+    virtual void calcLocalAABB()
+    {
+		lockChildShapes();
+    	if(m_box_set.getNodeCount() == 0)
+    	{
+    		m_box_set.buildSet();
+    	}
+    	else
+    	{
+    		m_box_set.update();
+    	}
+    	unlockChildShapes();
+
+    	m_localAABB = m_box_set.getGlobalBox();
+    }
+
+
+public:
+	btGImpactShapeInterface()
+	{
+		m_shapeType=GIMPACT_SHAPE_PROXYTYPE;
+		m_localAABB.invalidate();
+		m_needs_update = true;
+		localScaling.setValue(1.f,1.f,1.f);
+	}
+
+
+	//! performs refit operation
+	/*!
+	Updates the entire Box set of this shape.
+	\pre postUpdate() must be called for attemps to calculating the box set, else this function
+		will does nothing.
+	\post if m_needs_update == true, then it calls calcLocalAABB();
+	*/
+    SIMD_FORCE_INLINE void updateBound()
+    {
+    	if(!m_needs_update) return;
+    	calcLocalAABB();
+    	m_needs_update  = false;
+    }
+
+    //! If the Bounding box is not updated, then this class attemps to calculate it.
+    /*!
+    \post Calls updateBound() for update the box set.
+    */
+    void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+    {
+        btAABB transformedbox = m_localAABB;
+        transformedbox.appy_transform(t);
+        aabbMin = transformedbox.m_min;
+        aabbMax = transformedbox.m_max;
+    }
+
+    //! Tells to this object that is needed to refit the box set
+    virtual void postUpdate()
+    {
+    	m_needs_update = true;
+    }
+
+	//! Obtains the local box, which is the global calculated box of the total of subshapes
+	SIMD_FORCE_INLINE const btAABB & getLocalBox()
+	{
+		return m_localAABB;
+	}
+
+
+    virtual int	getShapeType() const
+    {
+        return GIMPACT_SHAPE_PROXYTYPE;
+    }
+
+    /*!
+	\post You must call updateBound() for update the box set.
+	*/
+	virtual void	setLocalScaling(const btVector3& scaling)
+	{
+		localScaling = scaling;
+		postUpdate();
+	}
+
+	virtual const btVector3& getLocalScaling() const
+	{
+		return localScaling;
+	}
+
+
+	virtual void setMargin(btScalar margin)
+    {
+    	m_collisionMargin = margin;
+    	int i = getNumChildShapes();
+    	while(i--)
+    	{
+			btCollisionShape* child = getChildShape(i);
+			child->setMargin(margin);
+    	}
+
+		m_needs_update = true;
+    }
+
+
+	//! Subshape member functions
+	//!@{
+
+	//! Base method for determinig which kind of GIMPACT shape we get
+	virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const = 0 ;
+
+	//! gets boxset
+	SIMD_FORCE_INLINE btGImpactBoxSet * getBoxSet()
+	{
+		return &m_box_set;
+	}
+
+	//! Determines if this class has a hierarchy structure for sorting its primitives
+	SIMD_FORCE_INLINE bool hasBoxSet()  const
+	{
+		if(m_box_set.getNodeCount() == 0) return false;
+		return true;
+	}
+
+	//! Obtains the primitive manager
+	virtual const btPrimitiveManagerBase * getPrimitiveManager()  const = 0;
+
+
+	//! Gets the number of children
+	virtual int	getNumChildShapes() const  = 0;
+
+	//! if true, then its children must get transforms.
+	virtual bool childrenHasTransform() const = 0;
+
+	//! Determines if this shape has triangles
+	virtual bool needsRetrieveTriangles() const = 0;
+
+	//! Determines if this shape has tetrahedrons
+	virtual bool needsRetrieveTetrahedrons() const = 0;
+
+	virtual void getBulletTriangle(int prim_index,btTriangleShapeEx & triangle) const = 0;
+
+	virtual void getBulletTetrahedron(int prim_index,btTetrahedronShapeEx & tetrahedron) const = 0;
+
+
+
+	//! call when reading child shapes
+	virtual void lockChildShapes() const
+	{
+	}
+
+	virtual void unlockChildShapes() const
+	{
+	}
+
+	//! if this trimesh
+	SIMD_FORCE_INLINE void getPrimitiveTriangle(int index,btPrimitiveTriangle & triangle) const
+	{
+		getPrimitiveManager()->get_primitive_triangle(index,triangle);
+	}
+
+
+	//! Retrieves the bound from a child
+    /*!
+    */
+    virtual void getChildAabb(int child_index,const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+    {
+        btAABB child_aabb;
+        getPrimitiveManager()->get_primitive_box(child_index,child_aabb);
+        child_aabb.appy_transform(t);
+        aabbMin = child_aabb.m_min;
+        aabbMax = child_aabb.m_max;
+    }
+
+	//! Gets the children
+	virtual btCollisionShape* getChildShape(int index) = 0;
+
+
+	//! Gets the child
+	virtual const btCollisionShape* getChildShape(int index) const = 0;
+
+	//! Gets the children transform
+	virtual btTransform	getChildTransform(int index) const = 0;
+
+	//! Sets the children transform
+	/*!
+	\post You must call updateBound() for update the box set.
+	*/
+	virtual void setChildTransform(int index, const btTransform & transform) = 0;
+
+	//!@}
+
+
+	//! virtual method for ray collision
+	virtual void rayTest(const btVector3& rayFrom, const btVector3& rayTo, btCollisionWorld::RayResultCallback& resultCallback)  const
+	{
+        (void) rayFrom; (void) rayTo; (void) resultCallback;
+	}
+
+	//! Function for retrieve triangles.
+	/*!
+	It gives the triangles in local space
+	*/
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
+	{
+        (void) callback; (void) aabbMin; (void) aabbMax;
+	}
+
+	//!@}
+
+};
+
+
+//! btGImpactCompoundShape allows to handle multiple btCollisionShape objects at once
+/*!
+This class only can manage Convex subshapes
+*/
+class btGImpactCompoundShape	: public btGImpactShapeInterface
+{
+public:
+	//! compound primitive manager
+	class CompoundPrimitiveManager:public btPrimitiveManagerBase
+	{
+	public:
+		virtual ~CompoundPrimitiveManager() {}
+		btGImpactCompoundShape * m_compoundShape;
+
+
+		CompoundPrimitiveManager(const CompoundPrimitiveManager& compound)
+            : btPrimitiveManagerBase()
+		{
+			m_compoundShape = compound.m_compoundShape;
+		}
+
+		CompoundPrimitiveManager(btGImpactCompoundShape * compoundShape)
+		{
+			m_compoundShape = compoundShape;
+		}
+
+		CompoundPrimitiveManager()
+		{
+			m_compoundShape = NULL;
+		}
+
+		virtual bool is_trimesh() const
+		{
+			return false;
+		}
+
+		virtual int get_primitive_count() const
+		{
+			return (int )m_compoundShape->getNumChildShapes();
+		}
+
+		virtual void get_primitive_box(int prim_index ,btAABB & primbox) const
+		{
+			btTransform prim_trans;
+			if(m_compoundShape->childrenHasTransform())
+			{
+				prim_trans = m_compoundShape->getChildTransform(prim_index);
+			}
+			else
+			{
+				prim_trans.setIdentity();
+			}
+			const btCollisionShape* shape = m_compoundShape->getChildShape(prim_index);
+			shape->getAabb(prim_trans,primbox.m_min,primbox.m_max);
+		}
+
+		virtual void get_primitive_triangle(int prim_index,btPrimitiveTriangle & triangle) const
+		{
+			btAssert(0);
+            (void) prim_index; (void) triangle;
+		}
+
+	};
+
+
+
+protected:
+	CompoundPrimitiveManager m_primitive_manager;
+	btAlignedObjectArray<btTransform>		m_childTransforms;
+	btAlignedObjectArray<btCollisionShape*>	m_childShapes;
+
+
+public:
+
+	btGImpactCompoundShape(bool children_has_transform = true)
+	{
+        (void) children_has_transform;
+		m_primitive_manager.m_compoundShape = this;
+		m_box_set.setPrimitiveManager(&m_primitive_manager);
+	}
+
+	virtual ~btGImpactCompoundShape()
+	{
+	}
+
+
+	//! if true, then its children must get transforms.
+	virtual bool childrenHasTransform() const
+	{
+		if(m_childTransforms.size()==0) return false;
+		return true;
+	}
+
+
+	//! Obtains the primitive manager
+	virtual const btPrimitiveManagerBase * getPrimitiveManager()  const
+	{
+		return &m_primitive_manager;
+	}
+
+	//! Obtains the compopund primitive manager
+	SIMD_FORCE_INLINE CompoundPrimitiveManager * getCompoundPrimitiveManager()
+	{
+		return &m_primitive_manager;
+	}
+
+	//! Gets the number of children
+	virtual int	getNumChildShapes() const
+	{
+		return m_childShapes.size();
+	}
+
+
+	//! Use this method for adding children. Only Convex shapes are allowed.
+	void addChildShape(const btTransform& localTransform,btCollisionShape* shape)
+	{
+		btAssert(shape->isConvex());
+		m_childTransforms.push_back(localTransform);
+		m_childShapes.push_back(shape);
+	}
+
+	//! Use this method for adding children. Only Convex shapes are allowed.
+	void addChildShape(btCollisionShape* shape)
+	{
+		btAssert(shape->isConvex());
+		m_childShapes.push_back(shape);
+	}
+
+	//! Gets the children
+	virtual btCollisionShape* getChildShape(int index)
+	{
+		return m_childShapes[index];
+	}
+
+	//! Gets the children
+	virtual const btCollisionShape* getChildShape(int index) const
+	{
+		return m_childShapes[index];
+	}
+
+	//! Retrieves the bound from a child
+    /*!
+    */
+    virtual void getChildAabb(int child_index,const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+    {
+
+    	if(childrenHasTransform())
+    	{
+    		m_childShapes[child_index]->getAabb(t*m_childTransforms[child_index],aabbMin,aabbMax);
+    	}
+    	else
+    	{
+    		m_childShapes[child_index]->getAabb(t,aabbMin,aabbMax);
+    	}
+    }
+
+
+	//! Gets the children transform
+	virtual btTransform	getChildTransform(int index) const
+	{
+		btAssert(m_childTransforms.size() == m_childShapes.size());
+		return m_childTransforms[index];
+	}
+
+	//! Sets the children transform
+	/*!
+	\post You must call updateBound() for update the box set.
+	*/
+	virtual void setChildTransform(int index, const btTransform & transform)
+	{
+		btAssert(m_childTransforms.size() == m_childShapes.size());
+		m_childTransforms[index] = transform;
+		postUpdate();
+	}
+
+	//! Determines if this shape has triangles
+	virtual bool needsRetrieveTriangles() const
+	{
+		return false;
+	}
+
+	//! Determines if this shape has tetrahedrons
+	virtual bool needsRetrieveTetrahedrons() const
+	{
+		return false;
+	}
+
+
+	virtual void getBulletTriangle(int prim_index,btTriangleShapeEx & triangle) const
+	{
+        (void) prim_index; (void) triangle;
+		btAssert(0);
+	}
+
+	virtual void getBulletTetrahedron(int prim_index,btTetrahedronShapeEx & tetrahedron) const
+	{
+        (void) prim_index; (void) tetrahedron;
+		btAssert(0);
+	}
+
+
+	//! Calculates the exact inertia tensor for this shape
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+	virtual const char*	getName()const
+	{
+		return "GImpactCompound";
+	}
+
+	virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
+	{
+		return CONST_GIMPACT_COMPOUND_SHAPE;
+	}
+
+};
+
+
+
+//! This class manages a sub part of a mesh supplied by the btStridingMeshInterface interface.
+/*!
+- Simply create this shape by passing the btStridingMeshInterface to the constructor btGImpactMeshShapePart, then you must call updateBound() after creating the mesh
+- When making operations with this shape, you must call <b>lock</b> before accessing to the trimesh primitives, and then call <b>unlock</b>
+- You can handle deformable meshes with this shape, by calling postUpdate() every time when changing the mesh vertices.
+
+*/
+class btGImpactMeshShapePart : public btGImpactShapeInterface
+{
+public:
+	//! Trimesh primitive manager
+	/*!
+	Manages the info from btStridingMeshInterface object and controls the Lock/Unlock mechanism
+	*/
+	class TrimeshPrimitiveManager:public btPrimitiveManagerBase
+	{
+	public:
+		btScalar m_margin;
+		btStridingMeshInterface * m_meshInterface;
+		btVector3 m_scale;
+		int m_part;
+		int m_lock_count;
+		const unsigned char *vertexbase;
+		int numverts;
+		PHY_ScalarType type;
+		int stride;
+		const unsigned char *indexbase;
+		int indexstride;
+		int  numfaces;
+		PHY_ScalarType indicestype;
+
+		TrimeshPrimitiveManager()
+		{
+			m_meshInterface = NULL;
+			m_part = 0;
+			m_margin = 0.01f;
+			m_scale = btVector3(1.f,1.f,1.f);
+			m_lock_count = 0;
+			vertexbase = 0;
+			numverts = 0;
+			stride = 0;
+			indexbase = 0;
+			indexstride = 0;
+			numfaces = 0;
+		}
+
+ 		TrimeshPrimitiveManager(const TrimeshPrimitiveManager & manager)
+            : btPrimitiveManagerBase()
+		{
+			m_meshInterface = manager.m_meshInterface;
+			m_part = manager.m_part;
+			m_margin = manager.m_margin;
+			m_scale = manager.m_scale;
+			m_lock_count = 0;
+			vertexbase = 0;
+			numverts = 0;
+			stride = 0;
+			indexbase = 0;
+			indexstride = 0;
+			numfaces = 0;
+
+		}
+
+		TrimeshPrimitiveManager(
+			btStridingMeshInterface * meshInterface,	int part)
+		{
+			m_meshInterface = meshInterface;
+			m_part = part;
+			m_scale = m_meshInterface->getScaling();
+			m_margin = 0.1f;
+			m_lock_count = 0;
+			vertexbase = 0;
+			numverts = 0;
+			stride = 0;
+			indexbase = 0;
+			indexstride = 0;
+			numfaces = 0;
+
+		}
+
+		virtual ~TrimeshPrimitiveManager() {}
+
+		void lock()
+		{
+			if(m_lock_count>0)
+			{
+				m_lock_count++;
+				return;
+			}
+			m_meshInterface->getLockedReadOnlyVertexIndexBase(
+				&vertexbase,numverts,
+				type, stride,&indexbase, indexstride, numfaces,indicestype,m_part);
+
+			m_lock_count = 1;
+		}
+
+		void unlock()
+		{
+			if(m_lock_count == 0) return;
+			if(m_lock_count>1)
+			{
+				--m_lock_count;
+				return;
+			}
+			m_meshInterface->unLockReadOnlyVertexBase(m_part);
+			vertexbase = NULL;
+			m_lock_count = 0;
+		}
+
+		virtual bool is_trimesh() const
+		{
+			return true;
+		}
+
+		virtual int get_primitive_count() const
+		{
+			return (int )numfaces;
+		}
+
+		SIMD_FORCE_INLINE int get_vertex_count() const
+		{
+			return (int )numverts;
+		}
+
+		SIMD_FORCE_INLINE void get_indices(int face_index,int &i0,int &i1,int &i2) const
+		{
+			if(indicestype == PHY_SHORT)
+			{
+				short * s_indices = (short *)(indexbase + face_index*indexstride);
+				i0 = s_indices[0];
+				i1 = s_indices[1];
+				i2 = s_indices[2];
+			}
+			else
+			{
+				int * i_indices = (int *)(indexbase + face_index*indexstride);
+				i0 = i_indices[0];
+				i1 = i_indices[1];
+				i2 = i_indices[2];
+			}
+		}
+
+		SIMD_FORCE_INLINE void get_vertex(int vertex_index, btVector3 & vertex) const
+		{
+			if(type == PHY_DOUBLE)
+			{
+				double * dvertices = (double *)(vertexbase + vertex_index*stride);
+				vertex[0] = btScalar(dvertices[0]*m_scale[0]);
+				vertex[1] = btScalar(dvertices[1]*m_scale[1]);
+				vertex[2] = btScalar(dvertices[2]*m_scale[2]);
+			}
+			else
+			{
+				float * svertices = (float *)(vertexbase + vertex_index*stride);
+				vertex[0] = svertices[0]*m_scale[0];
+				vertex[1] = svertices[1]*m_scale[1];
+				vertex[2] = svertices[2]*m_scale[2];
+			}
+		}
+
+		virtual void get_primitive_box(int prim_index ,btAABB & primbox) const
+		{
+			btPrimitiveTriangle  triangle;
+			get_primitive_triangle(prim_index,triangle);
+			primbox.calc_from_triangle_margin(
+				triangle.m_vertices[0],
+				triangle.m_vertices[1],triangle.m_vertices[2],triangle.m_margin);
+		}
+
+		virtual void get_primitive_triangle(int prim_index,btPrimitiveTriangle & triangle) const
+		{
+			int indices[3];
+			get_indices(prim_index,indices[0],indices[1],indices[2]);
+			get_vertex(indices[0],triangle.m_vertices[0]);
+			get_vertex(indices[1],triangle.m_vertices[1]);
+			get_vertex(indices[2],triangle.m_vertices[2]);
+			triangle.m_margin = m_margin;
+		}
+
+		SIMD_FORCE_INLINE void get_bullet_triangle(int prim_index,btTriangleShapeEx & triangle) const
+		{
+			int indices[3];
+			get_indices(prim_index,indices[0],indices[1],indices[2]);
+			get_vertex(indices[0],triangle.m_vertices1[0]);
+			get_vertex(indices[1],triangle.m_vertices1[1]);
+			get_vertex(indices[2],triangle.m_vertices1[2]);
+			triangle.setMargin(m_margin);
+		}
+
+	};
+
+
+protected:
+	TrimeshPrimitiveManager m_primitive_manager;
+public:
+
+	btGImpactMeshShapePart()
+	{
+		m_box_set.setPrimitiveManager(&m_primitive_manager);
+	}
+
+
+	btGImpactMeshShapePart(btStridingMeshInterface * meshInterface,	int part)
+	{
+		m_primitive_manager.m_meshInterface = meshInterface;
+		m_primitive_manager.m_part = part;
+		m_box_set.setPrimitiveManager(&m_primitive_manager);
+	}
+
+	virtual ~btGImpactMeshShapePart()
+	{
+	}
+
+	//! if true, then its children must get transforms.
+	virtual bool childrenHasTransform() const
+	{
+		return false;
+	}
+
+
+	//! call when reading child shapes
+	virtual void lockChildShapes() const
+	{
+		void * dummy = (void*)(m_box_set.getPrimitiveManager());
+		TrimeshPrimitiveManager * dummymanager = static_cast<TrimeshPrimitiveManager *>(dummy);
+		dummymanager->lock();
+	}
+
+	virtual void unlockChildShapes()  const
+	{
+		void * dummy = (void*)(m_box_set.getPrimitiveManager());
+		TrimeshPrimitiveManager * dummymanager = static_cast<TrimeshPrimitiveManager *>(dummy);
+		dummymanager->unlock();
+	}
+
+	//! Gets the number of children
+	virtual int	getNumChildShapes() const
+	{
+		return m_primitive_manager.get_primitive_count();
+	}
+
+
+	//! Gets the children
+	virtual btCollisionShape* getChildShape(int index)
+	{
+        (void) index;
+		btAssert(0);
+		return NULL;
+	}
+
+
+
+	//! Gets the child
+	virtual const btCollisionShape* getChildShape(int index) const
+	{
+        (void) index;
+		btAssert(0);
+		return NULL;
+	}
+
+	//! Gets the children transform
+	virtual btTransform	getChildTransform(int index) const
+	{
+        (void) index;
+		btAssert(0);
+		return btTransform();
+	}
+
+	//! Sets the children transform
+	/*!
+	\post You must call updateBound() for update the box set.
+	*/
+	virtual void setChildTransform(int index, const btTransform & transform)
+	{
+        (void) index;
+        (void) transform;
+		btAssert(0);
+	}
+
+
+	//! Obtains the primitive manager
+	virtual const btPrimitiveManagerBase * getPrimitiveManager()  const
+	{
+		return &m_primitive_manager;
+	}
+
+	SIMD_FORCE_INLINE TrimeshPrimitiveManager * getTrimeshPrimitiveManager()
+	{
+		return &m_primitive_manager;
+	}
+
+
+
+
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+
+
+
+	virtual const char*	getName()const
+	{
+		return "GImpactMeshShapePart";
+	}
+
+	virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
+	{
+		return CONST_GIMPACT_TRIMESH_SHAPE_PART;
+	}
+
+	//! Determines if this shape has triangles
+	virtual bool needsRetrieveTriangles() const
+	{
+		return true;
+	}
+
+	//! Determines if this shape has tetrahedrons
+	virtual bool needsRetrieveTetrahedrons() const
+	{
+		return false;
+	}
+
+	virtual void getBulletTriangle(int prim_index,btTriangleShapeEx & triangle) const
+	{
+		m_primitive_manager.get_bullet_triangle(prim_index,triangle);
+	}
+
+	virtual void getBulletTetrahedron(int prim_index,btTetrahedronShapeEx & tetrahedron) const
+	{
+        (void) prim_index;
+        (void) tetrahedron;
+		btAssert(0);
+	}
+
+
+
+	SIMD_FORCE_INLINE int getVertexCount() const
+	{
+		return m_primitive_manager.get_vertex_count();
+	}
+
+	SIMD_FORCE_INLINE void getVertex(int vertex_index, btVector3 & vertex) const
+	{
+		m_primitive_manager.get_vertex(vertex_index,vertex);
+	}
+
+	SIMD_FORCE_INLINE void setMargin(btScalar margin)
+    {
+    	m_primitive_manager.m_margin = margin;
+    	postUpdate();
+    }
+
+    SIMD_FORCE_INLINE btScalar getMargin() const
+    {
+    	return m_primitive_manager.m_margin;
+    }
+
+    virtual void	setLocalScaling(const btVector3& scaling)
+    {
+    	m_primitive_manager.m_scale = scaling;
+    	postUpdate();
+    }
+
+    virtual const btVector3& getLocalScaling() const
+    {
+    	return m_primitive_manager.m_scale;
+    }
+
+    SIMD_FORCE_INLINE int getPart() const
+    {
+    	return (int)m_primitive_manager.m_part;
+    }
+
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+};
+
+
+//! This class manages a mesh supplied by the btStridingMeshInterface interface.
+/*!
+Set of btGImpactMeshShapePart parts
+- Simply create this shape by passing the btStridingMeshInterface to the constructor btGImpactMeshShape, then you must call updateBound() after creating the mesh
+
+- You can handle deformable meshes with this shape, by calling postUpdate() every time when changing the mesh vertices.
+
+*/
+class btGImpactMeshShape : public btGImpactShapeInterface
+{
+	btStridingMeshInterface* m_meshInterface;
+
+protected:
+	btAlignedObjectArray<btGImpactMeshShapePart*> m_mesh_parts;
+	void buildMeshParts(btStridingMeshInterface * meshInterface)
+	{
+		for (int i=0;i<meshInterface->getNumSubParts() ;++i )
+		{
+			btGImpactMeshShapePart * newpart = new btGImpactMeshShapePart(meshInterface,i);
+			m_mesh_parts.push_back(newpart);
+		}
+	}
+
+	//! use this function for perfofm refit in bounding boxes
+    virtual void calcLocalAABB()
+    {
+    	m_localAABB.invalidate();
+    	int i = m_mesh_parts.size();
+    	while(i--)
+    	{
+    		m_mesh_parts[i]->updateBound();
+    		m_localAABB.merge(m_mesh_parts[i]->getLocalBox());
+    	}
+    }
+
+public:
+	btGImpactMeshShape(btStridingMeshInterface * meshInterface)
+	{
+		m_meshInterface = meshInterface;
+		buildMeshParts(meshInterface);
+	}
+
+	virtual ~btGImpactMeshShape()
+	{
+		int i = m_mesh_parts.size();
+    	while(i--)
+    	{
+			btGImpactMeshShapePart * part = m_mesh_parts[i];
+			delete part;
+    	}
+		m_mesh_parts.clear();
+	}
+
+
+	btStridingMeshInterface* getMeshInterface()
+	{
+		return m_meshInterface;
+	}
+
+	const btStridingMeshInterface* getMeshInterface() const
+	{
+		return m_meshInterface;
+	}
+
+	int getMeshPartCount() const
+	{
+		return m_mesh_parts.size();
+	}
+
+	btGImpactMeshShapePart * getMeshPart(int index)
+	{
+		return m_mesh_parts[index];
+	}
+
+
+
+	const btGImpactMeshShapePart * getMeshPart(int index) const
+	{
+		return m_mesh_parts[index];
+	}
+
+
+	virtual void	setLocalScaling(const btVector3& scaling)
+	{
+		localScaling = scaling;
+
+		int i = m_mesh_parts.size();
+    	while(i--)
+    	{
+			btGImpactMeshShapePart * part = m_mesh_parts[i];
+			part->setLocalScaling(scaling);
+    	}
+
+		m_needs_update = true;
+	}
+
+	virtual void setMargin(btScalar margin)
+    {
+    	m_collisionMargin = margin;
+
+		int i = m_mesh_parts.size();
+    	while(i--)
+    	{
+			btGImpactMeshShapePart * part = m_mesh_parts[i];
+			part->setMargin(margin);
+    	}
+
+		m_needs_update = true;
+    }
+
+	//! Tells to this object that is needed to refit all the meshes
+    virtual void postUpdate()
+    {
+		int i = m_mesh_parts.size();
+    	while(i--)
+    	{
+			btGImpactMeshShapePart * part = m_mesh_parts[i];
+			part->postUpdate();
+    	}
+
+    	m_needs_update = true;
+    }
+
+	virtual void	calculateLocalInertia(btScalar mass,btVector3& inertia) const;
+
+
+	//! Obtains the primitive manager
+	virtual const btPrimitiveManagerBase * getPrimitiveManager()  const
+	{
+		btAssert(0);
+		return NULL;
+	}
+
+
+	//! Gets the number of children
+	virtual int	getNumChildShapes() const
+	{
+		btAssert(0);
+		return 0;
+	}
+
+
+	//! if true, then its children must get transforms.
+	virtual bool childrenHasTransform() const
+	{
+		btAssert(0);
+		return false;
+	}
+
+	//! Determines if this shape has triangles
+	virtual bool needsRetrieveTriangles() const
+	{
+		btAssert(0);
+		return false;
+	}
+
+	//! Determines if this shape has tetrahedrons
+	virtual bool needsRetrieveTetrahedrons() const
+	{
+		btAssert(0);
+		return false;
+	}
+
+	virtual void getBulletTriangle(int prim_index,btTriangleShapeEx & triangle) const
+	{
+        (void) prim_index; (void) triangle;
+		btAssert(0);
+	}
+
+	virtual void getBulletTetrahedron(int prim_index,btTetrahedronShapeEx & tetrahedron) const
+	{
+        (void) prim_index; (void) tetrahedron;
+		btAssert(0);
+	}
+
+	//! call when reading child shapes
+	virtual void lockChildShapes() const
+	{
+		btAssert(0);
+	}
+
+	virtual void unlockChildShapes() const
+	{
+		btAssert(0);
+	}
+
+
+
+
+	//! Retrieves the bound from a child
+    /*!
+    */
+    virtual void getChildAabb(int child_index,const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
+    {
+        (void) child_index; (void) t; (void) aabbMin; (void) aabbMax;
+        btAssert(0);
+    }
+
+	//! Gets the children
+	virtual btCollisionShape* getChildShape(int index)
+	{
+        (void) index;
+		btAssert(0);
+		return NULL;
+	}
+
+
+	//! Gets the child
+	virtual const btCollisionShape* getChildShape(int index) const
+	{
+        (void) index;
+		btAssert(0);
+		return NULL;
+	}
+
+	//! Gets the children transform
+	virtual btTransform	getChildTransform(int index) const
+	{
+        (void) index;
+		btAssert(0);
+		return btTransform();
+	}
+
+	//! Sets the children transform
+	/*!
+	\post You must call updateBound() for update the box set.
+	*/
+	virtual void setChildTransform(int index, const btTransform & transform)
+	{
+        (void) index; (void) transform;
+		btAssert(0);
+	}
+
+
+	virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
+	{
+		return CONST_GIMPACT_TRIMESH_SHAPE;
+	}
+
+
+	virtual const char*	getName()const
+	{
+		return "GImpactMesh";
+	}
+
+	virtual void rayTest(const btVector3& rayFrom, const btVector3& rayTo, btCollisionWorld::RayResultCallback& resultCallback)  const;
+
+	//! Function for retrieve triangles.
+	/*!
+	It gives the triangles in local space
+	*/
+	virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btGImpactMeshShapeData
+{
+	btCollisionShapeData	m_collisionShapeData;
+
+	btStridingMeshInterfaceData m_meshInterface;
+
+	btVector3FloatData	m_localScaling;
+
+	float	m_collisionMargin;
+
+	int		m_gimpactSubType;
+};
+
+SIMD_FORCE_INLINE	int	btGImpactMeshShape::calculateSerializeBufferSize() const
+{
+	return sizeof(btGImpactMeshShapeData);
+}
+
+
+#endif //GIMPACT_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGenericPoolAllocator.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGenericPoolAllocator.h
new file mode 100644
index 0000000..b46d851
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGenericPoolAllocator.h
@@ -0,0 +1,163 @@
+/*! \file btGenericPoolAllocator.h
+\author Francisco Leon Najera. email projectileman at yahoo.com
+
+General purpose allocator class
+*/
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_GENERIC_POOL_ALLOCATOR_H
+#define BT_GENERIC_POOL_ALLOCATOR_H
+
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include "LinearMath/btAlignedAllocator.h"
+
+#define BT_UINT_MAX UINT_MAX
+#define BT_DEFAULT_MAX_POOLS 16
+
+
+//! Generic Pool class
+class btGenericMemoryPool
+{
+public:
+	unsigned char * m_pool; //[m_element_size*m_max_element_count];
+	size_t * m_free_nodes; //[m_max_element_count];//! free nodes
+	size_t * m_allocated_sizes;//[m_max_element_count];//! Number of elements allocated per node
+	size_t m_allocated_count;
+	size_t m_free_nodes_count;
+protected:
+	size_t m_element_size;
+	size_t m_max_element_count;
+
+	size_t allocate_from_free_nodes(size_t num_elements);
+	size_t allocate_from_pool(size_t num_elements);
+
+public:
+
+	void init_pool(size_t element_size, size_t element_count);
+
+	void end_pool();
+
+
+	btGenericMemoryPool(size_t element_size, size_t element_count)
+	{
+		init_pool(element_size, element_count);
+	}
+
+	~btGenericMemoryPool()
+	{
+		end_pool();
+	}
+
+
+	inline size_t get_pool_capacity()
+	{
+		return m_element_size*m_max_element_count;
+	}
+
+	inline size_t gem_element_size()
+	{
+		return m_element_size;
+	}
+
+	inline size_t get_max_element_count()
+	{
+		return m_max_element_count;
+	}
+
+	inline size_t get_allocated_count()
+	{
+		return m_allocated_count;
+	}
+
+	inline size_t get_free_positions_count()
+	{
+		return m_free_nodes_count;
+	}
+
+	inline void * get_element_data(size_t element_index)
+	{
+		return &m_pool[element_index*m_element_size];
+	}
+
+	//! Allocates memory in pool
+	/*!
+	\param size_bytes size in bytes of the buffer
+	*/
+	void * allocate(size_t size_bytes);
+
+	bool freeMemory(void * pointer);
+};
+
+
+
+
+//! Generic Allocator with pools
+/*!
+General purpose Allocator which can create Memory Pools dynamiacally as needed.
+*/
+class btGenericPoolAllocator
+{
+protected:
+	size_t m_pool_element_size;
+	size_t m_pool_element_count;
+public:
+	btGenericMemoryPool * m_pools[BT_DEFAULT_MAX_POOLS];
+	size_t m_pool_count;
+
+
+	inline size_t get_pool_capacity()
+	{
+		return m_pool_element_size*m_pool_element_count;
+	}
+
+
+protected:
+	// creates a pool
+	btGenericMemoryPool * push_new_pool();
+
+	void * failback_alloc(size_t size_bytes);
+
+	bool failback_free(void * pointer);
+public:
+
+	btGenericPoolAllocator(size_t pool_element_size, size_t pool_element_count)
+	{
+		m_pool_count = 0;
+		m_pool_element_size = pool_element_size;
+		m_pool_element_count = pool_element_count;
+	}
+
+	virtual ~btGenericPoolAllocator();
+
+	//! Allocates memory in pool
+	/*!
+	\param size_bytes size in bytes of the buffer
+	*/
+	void * allocate(size_t size_bytes);
+
+	bool freeMemory(void * pointer);
+};
+
+
+
+void * btPoolAlloc(size_t size);
+void * btPoolRealloc(void *ptr, size_t oldsize, size_t newsize);
+void btPoolFree(void *ptr);
+
+
+#endif
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btGeometryOperations.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btGeometryOperations.h
new file mode 100644
index 0000000..60f0651
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btGeometryOperations.h
@@ -0,0 +1,212 @@
+#ifndef BT_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
+#define BT_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
+
+/*! \file btGeometryOperations.h
+*\author Francisco Leon Najera
+
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btBoxCollision.h"
+
+
+
+
+
+#define PLANEDIREPSILON 0.0000001f
+#define PARALELENORMALS 0.000001f
+
+
+#define BT_CLAMP(number,minval,maxval) (number<minval?minval:(number>maxval?maxval:number))
+
+/// Calc a plane from a triangle edge an a normal. plane is a vec4f
+SIMD_FORCE_INLINE void bt_edge_plane(const btVector3 & e1,const btVector3 &  e2, const btVector3 & normal,btVector4 & plane)
+{
+	btVector3 planenormal = (e2-e1).cross(normal);
+	planenormal.normalize();
+	plane.setValue(planenormal[0],planenormal[1],planenormal[2],e2.dot(planenormal));
+}
+
+
+
+//***************** SEGMENT and LINE FUNCTIONS **********************************///
+
+/*! Finds the closest point(cp) to (v) on a segment (e1,e2)
+ */
+SIMD_FORCE_INLINE void bt_closest_point_on_segment(
+	btVector3 & cp, const btVector3 & v,
+	const btVector3  &e1,const btVector3 &e2)
+{
+    btVector3 n = e2-e1;
+    cp = v - e1;
+	btScalar _scalar = cp.dot(n)/n.dot(n);
+	if(_scalar <0.0f)
+	{
+	    cp = e1;
+	}
+	else if(_scalar >1.0f)
+	{
+	    cp = e2;
+	}
+	else
+	{
+		cp = _scalar*n + e1;
+	}
+}
+
+
+//! line plane collision
+/*!
+*\return
+	-0  if the ray never intersects
+	-1 if the ray collides in front
+	-2 if the ray collides in back
+*/
+
+SIMD_FORCE_INLINE int bt_line_plane_collision(
+	const btVector4 & plane,
+	const btVector3 & vDir,
+	const btVector3 & vPoint,
+	btVector3 & pout,
+	btScalar &tparam,
+	btScalar tmin, btScalar tmax)
+{
+
+	btScalar _dotdir = vDir.dot(plane);
+
+	if(btFabs(_dotdir)<PLANEDIREPSILON)
+	{
+		tparam = tmax;
+	    return 0;
+	}
+
+	btScalar _dis = bt_distance_point_plane(plane,vPoint);
+	char returnvalue = _dis<0.0f? 2:1;
+	tparam = -_dis/_dotdir;
+
+	if(tparam<tmin)
+	{
+		returnvalue = 0;
+		tparam = tmin;
+	}
+	else if(tparam>tmax)
+	{
+		returnvalue = 0;
+		tparam = tmax;
+	}
+	pout = tparam*vDir + vPoint;
+	return returnvalue;
+}
+
+
+//! Find closest points on segments
+SIMD_FORCE_INLINE void bt_segment_collision(
+	const btVector3 & vA1,
+	const btVector3 & vA2,
+	const btVector3 & vB1,
+	const btVector3 & vB2,
+	btVector3 & vPointA,
+	btVector3 & vPointB)
+{
+    btVector3 AD = vA2 - vA1;
+    btVector3 BD = vB2 - vB1;
+    btVector3 N = AD.cross(BD);
+    btScalar tp = N.length2();
+
+    btVector4 _M;//plane
+
+    if(tp<SIMD_EPSILON)//ARE PARALELE
+    {
+    	//project B over A
+    	bool invert_b_order = false;
+    	_M[0] = vB1.dot(AD);
+    	_M[1] = vB2.dot(AD);
+
+    	if(_M[0]>_M[1])
+    	{
+    		invert_b_order  = true;
+    		BT_SWAP_NUMBERS(_M[0],_M[1]);
+    	}
+    	_M[2] = vA1.dot(AD);
+    	_M[3] = vA2.dot(AD);
+    	//mid points
+    	N[0] = (_M[0]+_M[1])*0.5f;
+    	N[1] = (_M[2]+_M[3])*0.5f;
+
+    	if(N[0]<N[1])
+    	{
+    		if(_M[1]<_M[2])
+    		{
+    			vPointB = invert_b_order?vB1:vB2;
+    			vPointA = vA1;
+    		}
+    		else if(_M[1]<_M[3])
+    		{
+    			vPointB = invert_b_order?vB1:vB2;
+    			bt_closest_point_on_segment(vPointA,vPointB,vA1,vA2);
+    		}
+    		else
+    		{
+    			vPointA = vA2;
+    			bt_closest_point_on_segment(vPointB,vPointA,vB1,vB2);
+    		}
+    	}
+    	else
+    	{
+    		if(_M[3]<_M[0])
+    		{
+    			vPointB = invert_b_order?vB2:vB1;
+    			vPointA = vA2;
+    		}
+    		else if(_M[3]<_M[1])
+    		{
+    			vPointA = vA2;
+    			bt_closest_point_on_segment(vPointB,vPointA,vB1,vB2);
+    		}
+    		else
+    		{
+    			vPointB = invert_b_order?vB1:vB2;
+    			bt_closest_point_on_segment(vPointA,vPointB,vA1,vA2);
+    		}
+    	}
+    	return;
+    }
+
+    N = N.cross(BD);
+    _M.setValue(N[0],N[1],N[2],vB1.dot(N));
+
+	// get point A as the plane collision point
+    bt_line_plane_collision(_M,AD,vA1,vPointA,tp,btScalar(0), btScalar(1));
+
+    /*Closest point on segment*/
+    vPointB = vPointA - vB1;
+	tp = vPointB.dot(BD);
+	tp/= BD.dot(BD);
+	tp = BT_CLAMP(tp,0.0f,1.0f);
+
+	vPointB = tp*BD + vB1;
+}
+
+
+
+
+
+#endif // GIM_VECTOR_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btQuantization.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btQuantization.h
new file mode 100644
index 0000000..bd2633c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btQuantization.h
@@ -0,0 +1,88 @@
+#ifndef BT_GIMPACT_QUANTIZATION_H_INCLUDED
+#define BT_GIMPACT_QUANTIZATION_H_INCLUDED
+
+/*! \file btQuantization.h
+*\author Francisco Leon Najera
+
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "LinearMath/btTransform.h"
+
+
+
+
+
+
+SIMD_FORCE_INLINE void bt_calc_quantization_parameters(
+	btVector3 & outMinBound,
+	btVector3 & outMaxBound,
+	btVector3 & bvhQuantization,
+	const btVector3& srcMinBound,const btVector3& srcMaxBound,
+	btScalar quantizationMargin)
+{
+	//enlarge the AABB to avoid division by zero when initializing the quantization values
+	btVector3 clampValue(quantizationMargin,quantizationMargin,quantizationMargin);
+	outMinBound = srcMinBound - clampValue;
+	outMaxBound = srcMaxBound + clampValue;
+	btVector3 aabbSize = outMaxBound - outMinBound;
+	bvhQuantization = btVector3(btScalar(65535.0),
+								btScalar(65535.0),
+								btScalar(65535.0)) / aabbSize;
+}
+
+
+SIMD_FORCE_INLINE void bt_quantize_clamp(
+	unsigned short* out,
+	const btVector3& point,
+	const btVector3 & min_bound,
+	const btVector3 & max_bound,
+	const btVector3 & bvhQuantization)
+{
+
+	btVector3 clampedPoint(point);
+	clampedPoint.setMax(min_bound);
+	clampedPoint.setMin(max_bound);
+
+	btVector3 v = (clampedPoint - min_bound) * bvhQuantization;
+	out[0] = (unsigned short)(v.getX()+0.5f);
+	out[1] = (unsigned short)(v.getY()+0.5f);
+	out[2] = (unsigned short)(v.getZ()+0.5f);
+}
+
+
+SIMD_FORCE_INLINE btVector3 bt_unquantize(
+	const unsigned short* vecIn,
+	const btVector3 & offset,
+	const btVector3 & bvhQuantization)
+{
+	btVector3	vecOut;
+	vecOut.setValue(
+		(btScalar)(vecIn[0]) / (bvhQuantization.getX()),
+		(btScalar)(vecIn[1]) / (bvhQuantization.getY()),
+		(btScalar)(vecIn[2]) / (bvhQuantization.getZ()));
+	vecOut += offset;
+	return vecOut;
+}
+
+
+
+#endif // BT_GIMPACT_QUANTIZATION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.cpp
new file mode 100644
index 0000000..ca76cc5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.cpp
@@ -0,0 +1,218 @@
+/*! \file btGImpactTriangleShape.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btTriangleShapeEx.h"
+
+
+
+void GIM_TRIANGLE_CONTACT::merge_points(const btVector4 & plane,
+                                       btScalar margin, const btVector3 * points, int point_count)
+{
+    m_point_count = 0;
+    m_penetration_depth= -1000.0f;
+
+    int point_indices[MAX_TRI_CLIPPING];
+
+	int _k;
+
+    for ( _k=0;_k<point_count;_k++)
+    {
+        btScalar _dist = - bt_distance_point_plane(plane,points[_k]) + margin;
+
+        if (_dist>=0.0f)
+        {
+            if (_dist>m_penetration_depth)
+            {
+                m_penetration_depth = _dist;
+                point_indices[0] = _k;
+                m_point_count=1;
+            }
+            else if ((_dist+SIMD_EPSILON)>=m_penetration_depth)
+            {
+                point_indices[m_point_count] = _k;
+                m_point_count++;
+            }
+        }
+    }
+
+    for ( _k=0;_k<m_point_count;_k++)
+    {
+        m_points[_k] = points[point_indices[_k]];
+    }
+}
+
+///class btPrimitiveTriangle
+bool btPrimitiveTriangle::overlap_test_conservative(const btPrimitiveTriangle& other)
+{
+    btScalar total_margin = m_margin + other.m_margin;
+    // classify points on other triangle
+    btScalar dis0 = bt_distance_point_plane(m_plane,other.m_vertices[0]) - total_margin;
+
+    btScalar dis1 = bt_distance_point_plane(m_plane,other.m_vertices[1]) - total_margin;
+
+    btScalar dis2 = bt_distance_point_plane(m_plane,other.m_vertices[2]) - total_margin;
+
+    if (dis0>0.0f&&dis1>0.0f&&dis2>0.0f) return false;
+
+    // classify points on this triangle
+    dis0 = bt_distance_point_plane(other.m_plane,m_vertices[0]) - total_margin;
+
+    dis1 = bt_distance_point_plane(other.m_plane,m_vertices[1]) - total_margin;
+
+    dis2 = bt_distance_point_plane(other.m_plane,m_vertices[2]) - total_margin;
+
+    if (dis0>0.0f&&dis1>0.0f&&dis2>0.0f) return false;
+
+    return true;
+}
+
+int btPrimitiveTriangle::clip_triangle(btPrimitiveTriangle & other, btVector3 * clipped_points )
+{
+    // edge 0
+
+    btVector3 temp_points[MAX_TRI_CLIPPING];
+
+
+    btVector4 edgeplane;
+
+    get_edge_plane(0,edgeplane);
+
+
+    int clipped_count = bt_plane_clip_triangle(
+                            edgeplane,other.m_vertices[0],other.m_vertices[1],other.m_vertices[2],temp_points);
+
+    if (clipped_count == 0) return 0;
+
+    btVector3 temp_points1[MAX_TRI_CLIPPING];
+
+
+    // edge 1
+    get_edge_plane(1,edgeplane);
+
+
+    clipped_count = bt_plane_clip_polygon(edgeplane,temp_points,clipped_count,temp_points1);
+
+    if (clipped_count == 0) return 0;
+
+    // edge 2
+    get_edge_plane(2,edgeplane);
+
+    clipped_count = bt_plane_clip_polygon(
+                        edgeplane,temp_points1,clipped_count,clipped_points);
+
+    return clipped_count;
+}
+
+bool btPrimitiveTriangle::find_triangle_collision_clip_method(btPrimitiveTriangle & other, GIM_TRIANGLE_CONTACT & contacts)
+{
+    btScalar margin = m_margin + other.m_margin;
+
+    btVector3 clipped_points[MAX_TRI_CLIPPING];
+    int clipped_count;
+    //create planes
+    // plane v vs U points
+
+    GIM_TRIANGLE_CONTACT contacts1;
+
+    contacts1.m_separating_normal = m_plane;
+
+
+    clipped_count = clip_triangle(other,clipped_points);
+
+    if (clipped_count == 0 )
+    {
+        return false;//Reject
+    }
+
+    //find most deep interval face1
+    contacts1.merge_points(contacts1.m_separating_normal,margin,clipped_points,clipped_count);
+    if (contacts1.m_point_count == 0) return false; // too far
+    //Normal pointing to this triangle
+    contacts1.m_separating_normal *= -1.f;
+
+
+    //Clip tri1 by tri2 edges
+    GIM_TRIANGLE_CONTACT contacts2;
+    contacts2.m_separating_normal = other.m_plane;
+
+    clipped_count = other.clip_triangle(*this,clipped_points);
+
+    if (clipped_count == 0 )
+    {
+        return false;//Reject
+    }
+
+    //find most deep interval face1
+    contacts2.merge_points(contacts2.m_separating_normal,margin,clipped_points,clipped_count);
+    if (contacts2.m_point_count == 0) return false; // too far
+
+
+
+
+    ////check most dir for contacts
+    if (contacts2.m_penetration_depth<contacts1.m_penetration_depth)
+    {
+        contacts.copy_from(contacts2);
+    }
+    else
+    {
+        contacts.copy_from(contacts1);
+    }
+    return true;
+}
+
+
+
+///class btTriangleShapeEx: public btTriangleShape
+
+bool btTriangleShapeEx::overlap_test_conservative(const btTriangleShapeEx& other)
+{
+    btScalar total_margin = getMargin() + other.getMargin();
+
+    btVector4 plane0;
+    buildTriPlane(plane0);
+    btVector4 plane1;
+    other.buildTriPlane(plane1);
+
+    // classify points on other triangle
+    btScalar dis0 = bt_distance_point_plane(plane0,other.m_vertices1[0]) - total_margin;
+
+    btScalar dis1 = bt_distance_point_plane(plane0,other.m_vertices1[1]) - total_margin;
+
+    btScalar dis2 = bt_distance_point_plane(plane0,other.m_vertices1[2]) - total_margin;
+
+    if (dis0>0.0f&&dis1>0.0f&&dis2>0.0f) return false;
+
+    // classify points on this triangle
+    dis0 = bt_distance_point_plane(plane1,m_vertices1[0]) - total_margin;
+
+    dis1 = bt_distance_point_plane(plane1,m_vertices1[1]) - total_margin;
+
+    dis2 = bt_distance_point_plane(plane1,m_vertices1[2]) - total_margin;
+
+    if (dis0>0.0f&&dis1>0.0f&&dis2>0.0f) return false;
+
+    return true;
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.h b/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.h
new file mode 100644
index 0000000..973c2ed
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/btTriangleShapeEx.h
@@ -0,0 +1,180 @@
+/*! \file btGImpactShape.h
+\author Francisco Leon Najera
+*/
+/*
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2007 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef GIMPACT_TRIANGLE_SHAPE_EX_H
+#define GIMPACT_TRIANGLE_SHAPE_EX_H
+
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+#include "btBoxCollision.h"
+#include "btClipPolygon.h"
+#include "btGeometryOperations.h"
+
+
+#define MAX_TRI_CLIPPING 16
+
+//! Structure for collision
+struct GIM_TRIANGLE_CONTACT
+{
+    btScalar m_penetration_depth;
+    int m_point_count;
+    btVector4 m_separating_normal;
+    btVector3 m_points[MAX_TRI_CLIPPING];
+
+	SIMD_FORCE_INLINE void copy_from(const GIM_TRIANGLE_CONTACT& other)
+	{
+		m_penetration_depth = other.m_penetration_depth;
+		m_separating_normal = other.m_separating_normal;
+		m_point_count = other.m_point_count;
+		int i = m_point_count;
+		while(i--)
+		{
+			m_points[i] = other.m_points[i];
+		}
+	}
+
+	GIM_TRIANGLE_CONTACT()
+	{
+	}
+
+	GIM_TRIANGLE_CONTACT(const GIM_TRIANGLE_CONTACT& other)
+	{
+		copy_from(other);
+	}
+
+    //! classify points that are closer
+    void merge_points(const btVector4 & plane,
+    				btScalar margin, const btVector3 * points, int point_count);
+
+};
+
+
+
+class btPrimitiveTriangle
+{
+public:
+	btVector3 m_vertices[3];
+	btVector4 m_plane;
+	btScalar m_margin;
+	btScalar m_dummy;
+	btPrimitiveTriangle():m_margin(0.01f)
+	{
+
+	}
+
+
+	SIMD_FORCE_INLINE void buildTriPlane()
+	{
+		btVector3 normal = (m_vertices[1]-m_vertices[0]).cross(m_vertices[2]-m_vertices[0]);
+		normal.normalize();
+		m_plane.setValue(normal[0],normal[1],normal[2],m_vertices[0].dot(normal));
+	}
+
+	//! Test if triangles could collide
+	bool overlap_test_conservative(const btPrimitiveTriangle& other);
+
+	//! Calcs the plane which is paralele to the edge and perpendicular to the triangle plane
+	/*!
+	\pre this triangle must have its plane calculated.
+	*/
+	SIMD_FORCE_INLINE void get_edge_plane(int edge_index, btVector4 &plane)  const
+    {
+		const btVector3 & e0 = m_vertices[edge_index];
+		const btVector3 & e1 = m_vertices[(edge_index+1)%3];
+		bt_edge_plane(e0,e1,m_plane,plane);
+    }
+
+    void applyTransform(const btTransform& t)
+	{
+		m_vertices[0] = t(m_vertices[0]);
+		m_vertices[1] = t(m_vertices[1]);
+		m_vertices[2] = t(m_vertices[2]);
+	}
+
+	//! Clips the triangle against this
+	/*!
+	\pre clipped_points must have MAX_TRI_CLIPPING size, and this triangle must have its plane calculated.
+	\return the number of clipped points
+	*/
+    int clip_triangle(btPrimitiveTriangle & other, btVector3 * clipped_points );
+
+	//! Find collision using the clipping method
+	/*!
+	\pre this triangle and other must have their triangles calculated
+	*/
+    bool find_triangle_collision_clip_method(btPrimitiveTriangle & other, GIM_TRIANGLE_CONTACT & contacts);
+};
+
+
+
+//! Helper class for colliding Bullet Triangle Shapes
+/*!
+This class implements a better getAabb method than the previous btTriangleShape class
+*/
+class btTriangleShapeEx: public btTriangleShape
+{
+public:
+
+	btTriangleShapeEx():btTriangleShape(btVector3(0,0,0),btVector3(0,0,0),btVector3(0,0,0))
+	{
+	}
+
+	btTriangleShapeEx(const btVector3& p0,const btVector3& p1,const btVector3& p2):	btTriangleShape(p0,p1,p2)
+	{
+	}
+
+	btTriangleShapeEx(const btTriangleShapeEx & other):	btTriangleShape(other.m_vertices1[0],other.m_vertices1[1],other.m_vertices1[2])
+	{
+	}
+
+	virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax)const
+	{
+		btVector3 tv0 = t(m_vertices1[0]);
+		btVector3 tv1 = t(m_vertices1[1]);
+		btVector3 tv2 = t(m_vertices1[2]);
+
+		btAABB trianglebox(tv0,tv1,tv2,m_collisionMargin);
+		aabbMin = trianglebox.m_min;
+		aabbMax = trianglebox.m_max;
+	}
+
+	void applyTransform(const btTransform& t)
+	{
+		m_vertices1[0] = t(m_vertices1[0]);
+		m_vertices1[1] = t(m_vertices1[1]);
+		m_vertices1[2] = t(m_vertices1[2]);
+	}
+
+	SIMD_FORCE_INLINE void buildTriPlane(btVector4 & plane) const
+	{
+		btVector3 normal = (m_vertices1[1]-m_vertices1[0]).cross(m_vertices1[2]-m_vertices1[0]);
+		normal.normalize();
+		plane.setValue(normal[0],normal[1],normal[2],m_vertices1[0].dot(normal));
+	}
+
+	bool overlap_test_conservative(const btTriangleShapeEx& other);
+};
+
+
+#endif //GIMPACT_TRIANGLE_MESH_SHAPE_H
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_array.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_array.h
new file mode 100644
index 0000000..cfd5da8
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_array.h
@@ -0,0 +1,326 @@
+#ifndef GIM_ARRAY_H_INCLUDED
+#define GIM_ARRAY_H_INCLUDED
+/*! \file gim_array.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+#include "gim_memory.h"
+
+
+#define GIM_ARRAY_GROW_INCREMENT 2
+#define GIM_ARRAY_GROW_FACTOR 2
+
+//!	Very simple array container with fast access and simd memory
+template<typename T>
+class gim_array
+{
+public:
+//! properties
+//!@{
+    T *m_data;
+    GUINT m_size;
+    GUINT m_allocated_size;
+//!@}
+//! protected operations
+//!@{
+
+    inline void destroyData()
+	{
+	    m_allocated_size = 0;
+		if(m_data==NULL) return;
+		gim_free(m_data);
+		m_data = NULL;
+	}
+
+	inline bool resizeData(GUINT newsize)
+	{
+		if(newsize==0)
+		{
+			destroyData();
+			return true;
+		}
+
+		if(m_size>0)
+		{
+            m_data = (T*)gim_realloc(m_data,m_size*sizeof(T),newsize*sizeof(T));
+		}
+		else
+		{
+		    m_data = (T*)gim_alloc(newsize*sizeof(T));
+		}
+		m_allocated_size = newsize;
+		return true;
+	}
+
+	inline bool growingCheck()
+	{
+		if(m_allocated_size<=m_size)
+		{
+		    GUINT requestsize = m_size;
+		    m_size = m_allocated_size;
+			if(resizeData((requestsize+GIM_ARRAY_GROW_INCREMENT)*GIM_ARRAY_GROW_FACTOR)==false) return false;
+		}
+		return true;
+	}
+
+//!@}
+//! public operations
+//!@{
+    inline  bool reserve(GUINT size)
+    {
+        if(m_allocated_size>=size) return false;
+        return resizeData(size);
+    }
+
+    inline void clear_range(GUINT start_range)
+    {
+        while(m_size>start_range)
+        {
+            m_data[--m_size].~T();
+        }
+    }
+
+    inline void clear()
+    {
+        if(m_size==0)return;
+        clear_range(0);
+    }
+
+    inline void clear_memory()
+    {
+        clear();
+        destroyData();
+    }
+
+    gim_array()
+    {
+        m_data = 0;
+        m_size = 0;
+        m_allocated_size = 0;
+    }
+
+    gim_array(GUINT reservesize)
+    {
+        m_data = 0;
+        m_size = 0;
+
+        m_allocated_size = 0;
+        reserve(reservesize);
+    }
+
+    ~gim_array()
+    {
+        clear_memory();
+    }
+
+    inline GUINT size() const
+    {
+        return m_size;
+    }
+
+    inline GUINT max_size() const
+    {
+        return m_allocated_size;
+    }
+
+    inline T & operator[](size_t i)
+	{
+		return m_data[i];
+	}
+	inline  const T & operator[](size_t i) const
+	{
+		return m_data[i];
+	}
+
+    inline T * pointer(){ return m_data;}
+    inline const T * pointer() const
+    { return m_data;}
+
+
+    inline T * get_pointer_at(GUINT i)
+	{
+		return m_data + i;
+	}
+
+	inline const T * get_pointer_at(GUINT i) const
+	{
+		return m_data + i;
+	}
+
+	inline T & at(GUINT i)
+	{
+		return m_data[i];
+	}
+
+	inline const T & at(GUINT i) const
+	{
+		return m_data[i];
+	}
+
+	inline T & front()
+	{
+		return *m_data;
+	}
+
+	inline const T & front() const
+	{
+		return *m_data;
+	}
+
+	inline T & back()
+	{
+		return m_data[m_size-1];
+	}
+
+	inline const T & back() const
+	{
+		return m_data[m_size-1];
+	}
+
+
+	inline void swap(GUINT i, GUINT j)
+	{
+	    gim_swap_elements(m_data,i,j);
+	}
+
+	inline void push_back(const T & obj)
+	{
+	    this->growingCheck();
+	    m_data[m_size] = obj;
+	    m_size++;
+	}
+
+	//!Simply increase the m_size, doesn't call the new element constructor
+	inline void push_back_mem()
+	{
+	    this->growingCheck();
+	    m_size++;
+	}
+
+	inline void push_back_memcpy(const T & obj)
+	{
+	    this->growingCheck();
+	    irr_simd_memcpy(&m_data[m_size],&obj,sizeof(T));
+	    m_size++;
+	}
+
+	inline void pop_back()
+	{
+	    m_size--;
+        m_data[m_size].~T();
+	}
+
+	//!Simply decrease the m_size, doesn't call the deleted element destructor
+	inline void pop_back_mem()
+	{
+	    m_size--;
+	}
+
+    //! fast erase
+	inline void erase(GUINT index)
+	{
+	    if(index<m_size-1)
+	    {
+	        swap(index,m_size-1);
+	    }
+	    pop_back();
+	}
+
+	inline void erase_sorted_mem(GUINT index)
+	{
+	    m_size--;
+	    for(GUINT i = index;i<m_size;i++)
+	    {
+	        gim_simd_memcpy(m_data+i,m_data+i+1,sizeof(T));
+	    }
+	}
+
+	inline void erase_sorted(GUINT index)
+	{
+	    m_data[index].~T();
+	    erase_sorted_mem(index);
+	}
+
+	inline void insert_mem(GUINT index)
+	{
+	    this->growingCheck();
+	    for(GUINT i = m_size;i>index;i--)
+	    {
+	        gim_simd_memcpy(m_data+i,m_data+i-1,sizeof(T));
+	    }
+	    m_size++;
+	}
+
+	inline void insert(const T & obj,GUINT index)
+	{
+	    insert_mem(index);
+	    m_data[index] = obj;
+	}
+
+	inline void resize(GUINT size, bool call_constructor = true)
+	{
+
+	    if(size>m_size)
+	    {
+            reserve(size);
+            if(call_constructor)
+            {
+            	T obj;
+                while(m_size<size)
+                {
+                    m_data[m_size] = obj;
+                    m_size++;
+                }
+            }
+            else
+            {
+            	m_size = size;
+            }
+	    }
+	    else if(size<m_size)
+	    {
+	        if(call_constructor) clear_range(size);
+	        m_size = size;
+	    }
+	}
+
+	inline void refit()
+	{
+	    resizeData(m_size);
+	}
+
+};
+
+
+
+
+
+#endif // GIM_CONTAINERS_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_basic_geometry_operations.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_basic_geometry_operations.h
new file mode 100644
index 0000000..9152774
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_basic_geometry_operations.h
@@ -0,0 +1,543 @@
+#ifndef GIM_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
+#define GIM_BASIC_GEOMETRY_OPERATIONS_H_INCLUDED
+
+/*! \file gim_basic_geometry_operations.h
+*\author Francisco Leon Najera
+type independant geometry routines
+
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+
+#include "gim_linear_math.h"
+
+
+
+
+
+#define PLANEDIREPSILON 0.0000001f
+#define PARALELENORMALS 0.000001f
+
+
+#define TRIANGLE_NORMAL(v1,v2,v3,n)\
+{\
+	vec3f _dif1,_dif2;\
+    VEC_DIFF(_dif1,v2,v1);\
+    VEC_DIFF(_dif2,v3,v1);\
+    VEC_CROSS(n,_dif1,_dif2);\
+    VEC_NORMALIZE(n);\
+}\
+
+#define TRIANGLE_NORMAL_FAST(v1,v2,v3,n){\
+    vec3f _dif1,_dif2; \
+    VEC_DIFF(_dif1,v2,v1); \
+    VEC_DIFF(_dif2,v3,v1); \
+    VEC_CROSS(n,_dif1,_dif2); \
+}\
+
+/// plane is a vec4f
+#define TRIANGLE_PLANE(v1,v2,v3,plane) {\
+    TRIANGLE_NORMAL(v1,v2,v3,plane);\
+    plane[3] = VEC_DOT(v1,plane);\
+}\
+
+/// plane is a vec4f
+#define TRIANGLE_PLANE_FAST(v1,v2,v3,plane) {\
+    TRIANGLE_NORMAL_FAST(v1,v2,v3,plane);\
+    plane[3] = VEC_DOT(v1,plane);\
+}\
+
+/// Calc a plane from an edge an a normal. plane is a vec4f
+#define EDGE_PLANE(e1,e2,n,plane) {\
+    vec3f _dif; \
+    VEC_DIFF(_dif,e2,e1); \
+    VEC_CROSS(plane,_dif,n); \
+    VEC_NORMALIZE(plane); \
+    plane[3] = VEC_DOT(e1,plane);\
+}\
+
+#define DISTANCE_PLANE_POINT(plane,point) (VEC_DOT(plane,point) - plane[3])
+
+#define PROJECT_POINT_PLANE(point,plane,projected) {\
+	GREAL _dis;\
+	_dis = DISTANCE_PLANE_POINT(plane,point);\
+	VEC_SCALE(projected,-_dis,plane);\
+	VEC_SUM(projected,projected,point);	\
+}\
+
+//! Verifies if a point is in the plane hull
+template<typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE bool POINT_IN_HULL(
+	const CLASS_POINT& point,const CLASS_PLANE * planes,GUINT plane_count)
+{
+	GREAL _dis;
+	for (GUINT _i = 0;_i< plane_count;++_i)
+	{
+		_dis = DISTANCE_PLANE_POINT(planes[_i],point);
+	    if(_dis>0.0f) return false;
+	}
+	return true;
+}
+
+template<typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE void PLANE_CLIP_SEGMENT(
+	const CLASS_POINT& s1,
+	const CLASS_POINT &s2,const CLASS_PLANE &plane,CLASS_POINT &clipped)
+{
+	GREAL _dis1,_dis2;
+	_dis1 = DISTANCE_PLANE_POINT(plane,s1);
+	VEC_DIFF(clipped,s2,s1);
+	_dis2 = VEC_DOT(clipped,plane);
+	VEC_SCALE(clipped,-_dis1/_dis2,clipped);
+	VEC_SUM(clipped,clipped,s1);
+}
+
+enum ePLANE_INTERSECTION_TYPE
+{
+	G_BACK_PLANE = 0,
+	G_COLLIDE_PLANE,
+	G_FRONT_PLANE
+};
+
+enum eLINE_PLANE_INTERSECTION_TYPE
+{
+	G_FRONT_PLANE_S1 = 0,
+	G_FRONT_PLANE_S2,
+	G_BACK_PLANE_S1,
+	G_BACK_PLANE_S2,
+	G_COLLIDE_PLANE_S1,
+	G_COLLIDE_PLANE_S2
+};
+
+//! Confirms if the plane intersect the edge or nor
+/*!
+intersection type must have the following values
+<ul>
+<li> 0 : Segment in front of plane, s1 closest
+<li> 1 : Segment in front of plane, s2 closest
+<li> 2 : Segment in back of plane, s1 closest
+<li> 3 : Segment in back of plane, s2 closest
+<li> 4 : Segment collides plane, s1 in back
+<li> 5 : Segment collides plane, s2 in back
+</ul>
+*/
+
+template<typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE eLINE_PLANE_INTERSECTION_TYPE PLANE_CLIP_SEGMENT2(
+	const CLASS_POINT& s1,
+	const CLASS_POINT &s2,
+	const CLASS_PLANE &plane,CLASS_POINT &clipped)
+{
+	GREAL _dis1 = DISTANCE_PLANE_POINT(plane,s1);
+	GREAL _dis2 = DISTANCE_PLANE_POINT(plane,s2);
+	if(_dis1 >-G_EPSILON && _dis2 >-G_EPSILON)
+	{
+	    if(_dis1<_dis2) return G_FRONT_PLANE_S1;
+	    return G_FRONT_PLANE_S2;
+	}
+	else if(_dis1 <G_EPSILON && _dis2 <G_EPSILON)
+	{
+	    if(_dis1>_dis2) return G_BACK_PLANE_S1;
+	    return G_BACK_PLANE_S2;
+	}
+
+	VEC_DIFF(clipped,s2,s1);
+	_dis2 = VEC_DOT(clipped,plane);
+	VEC_SCALE(clipped,-_dis1/_dis2,clipped);
+	VEC_SUM(clipped,clipped,s1);
+	if(_dis1<_dis2) return G_COLLIDE_PLANE_S1;
+	return G_COLLIDE_PLANE_S2;
+}
+
+//! Confirms if the plane intersect the edge or not
+/*!
+clipped1 and clipped2 are the vertices behind the plane.
+clipped1 is the closest
+
+intersection_type must have the following values
+<ul>
+<li> 0 : Segment in front of plane, s1 closest
+<li> 1 : Segment in front of plane, s2 closest
+<li> 2 : Segment in back of plane, s1 closest
+<li> 3 : Segment in back of plane, s2 closest
+<li> 4 : Segment collides plane, s1 in back
+<li> 5 : Segment collides plane, s2 in back
+</ul>
+*/
+template<typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE eLINE_PLANE_INTERSECTION_TYPE PLANE_CLIP_SEGMENT_CLOSEST(
+	const CLASS_POINT& s1,
+	const CLASS_POINT &s2,
+	const CLASS_PLANE &plane,
+	CLASS_POINT &clipped1,CLASS_POINT &clipped2)
+{
+	eLINE_PLANE_INTERSECTION_TYPE intersection_type = PLANE_CLIP_SEGMENT2(s1,s2,plane,clipped1);
+	switch(intersection_type)
+	{
+	case G_FRONT_PLANE_S1:
+		VEC_COPY(clipped1,s1);
+	    VEC_COPY(clipped2,s2);
+		break;
+	case G_FRONT_PLANE_S2:
+		VEC_COPY(clipped1,s2);
+	    VEC_COPY(clipped2,s1);
+		break;
+	case G_BACK_PLANE_S1:
+		VEC_COPY(clipped1,s1);
+	    VEC_COPY(clipped2,s2);
+		break;
+	case G_BACK_PLANE_S2:
+		VEC_COPY(clipped1,s2);
+	    VEC_COPY(clipped2,s1);
+		break;
+	case G_COLLIDE_PLANE_S1:
+		VEC_COPY(clipped2,s1);
+		break;
+	case G_COLLIDE_PLANE_S2:
+		VEC_COPY(clipped2,s2);
+		break;
+	}
+	return intersection_type;
+}
+
+
+//! Finds the 2 smallest cartesian coordinates of a plane normal
+#define PLANE_MINOR_AXES(plane, i0, i1) VEC_MINOR_AXES(plane, i0, i1)
+
+//! Ray plane collision in one way
+/*!
+Intersects plane in one way only. The ray must face the plane (normals must be in opossite directions).<br/>
+It uses the PLANEDIREPSILON constant.
+*/
+template<typename T,typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE bool RAY_PLANE_COLLISION(
+	const CLASS_PLANE & plane,
+	const CLASS_POINT & vDir,
+	const CLASS_POINT & vPoint,
+	CLASS_POINT & pout,T &tparam)
+{
+	GREAL _dis,_dotdir;
+	_dotdir = VEC_DOT(plane,vDir);
+	if(_dotdir<PLANEDIREPSILON)
+	{
+	    return false;
+	}
+	_dis = DISTANCE_PLANE_POINT(plane,vPoint);
+	tparam = -_dis/_dotdir;
+	VEC_SCALE(pout,tparam,vDir);
+	VEC_SUM(pout,vPoint,pout);
+	return true;
+}
+
+//! line collision
+/*!
+*\return
+	-0  if the ray never intersects
+	-1 if the ray collides in front
+	-2 if the ray collides in back
+*/
+template<typename T,typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE GUINT LINE_PLANE_COLLISION(
+	const CLASS_PLANE & plane,
+	const CLASS_POINT & vDir,
+	const CLASS_POINT & vPoint,
+	CLASS_POINT & pout,
+	T &tparam,
+	T tmin, T tmax)
+{
+	GREAL _dis,_dotdir;
+	_dotdir = VEC_DOT(plane,vDir);
+	if(btFabs(_dotdir)<PLANEDIREPSILON)
+	{
+		tparam = tmax;
+	    return 0;
+	}
+	_dis = DISTANCE_PLANE_POINT(plane,vPoint);
+	char returnvalue = _dis<0.0f?2:1;
+	tparam = -_dis/_dotdir;
+
+	if(tparam<tmin)
+	{
+		returnvalue = 0;
+		tparam = tmin;
+	}
+	else if(tparam>tmax)
+	{
+		returnvalue = 0;
+		tparam = tmax;
+	}
+
+	VEC_SCALE(pout,tparam,vDir);
+	VEC_SUM(pout,vPoint,pout);
+	return returnvalue;
+}
+
+/*! \brief Returns the Ray on which 2 planes intersect if they do.
+    Written by Rodrigo Hernandez on ODE convex collision
+
+  \param p1 Plane 1
+  \param p2 Plane 2
+  \param p Contains the origin of the ray upon returning if planes intersect
+  \param d Contains the direction of the ray upon returning if planes intersect
+  \return true if the planes intersect, 0 if paralell.
+
+*/
+template<typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE bool INTERSECT_PLANES(
+		const CLASS_PLANE &p1,
+		const CLASS_PLANE &p2,
+		CLASS_POINT &p,
+		CLASS_POINT &d)
+{
+	VEC_CROSS(d,p1,p2);
+  	GREAL denom = VEC_DOT(d, d);
+  	if(GIM_IS_ZERO(denom)) return false;
+	vec3f _n;
+	_n[0]=p1[3]*p2[0] - p2[3]*p1[0];
+	_n[1]=p1[3]*p2[1] - p2[3]*p1[1];
+	_n[2]=p1[3]*p2[2] - p2[3]*p1[2];
+	VEC_CROSS(p,_n,d);
+	p[0]/=denom;
+	p[1]/=denom;
+	p[2]/=denom;
+	return true;
+}
+
+//***************** SEGMENT and LINE FUNCTIONS **********************************///
+
+/*! Finds the closest point(cp) to (v) on a segment (e1,e2)
+ */
+template<typename CLASS_POINT>
+SIMD_FORCE_INLINE void CLOSEST_POINT_ON_SEGMENT(
+	CLASS_POINT & cp, const CLASS_POINT & v,
+	const CLASS_POINT &e1,const CLASS_POINT &e2)
+{
+    vec3f _n;
+    VEC_DIFF(_n,e2,e1);
+    VEC_DIFF(cp,v,e1);
+	GREAL _scalar = VEC_DOT(cp, _n);
+	_scalar/= VEC_DOT(_n, _n);
+	if(_scalar <0.0f)
+	{
+	    VEC_COPY(cp,e1);
+	}
+	else if(_scalar >1.0f)
+	{
+	    VEC_COPY(cp,e2);
+	}
+	else
+	{
+        VEC_SCALE(cp,_scalar,_n);
+        VEC_SUM(cp,cp,e1);
+	}
+}
+
+
+/*! \brief Finds the line params where these lines intersect.
+
+\param dir1 Direction of line 1
+\param point1 Point of line 1
+\param dir2 Direction of line 2
+\param point2 Point of line 2
+\param t1 Result Parameter for line 1
+\param t2 Result Parameter for line 2
+\param dointersect  0  if the lines won't intersect, else 1
+
+*/
+template<typename T,typename CLASS_POINT>
+SIMD_FORCE_INLINE bool LINE_INTERSECTION_PARAMS(
+	const CLASS_POINT & dir1,
+	CLASS_POINT & point1,
+	const CLASS_POINT & dir2,
+	CLASS_POINT &  point2,
+	T& t1,T& t2)
+{
+    GREAL det;
+	GREAL e1e1 = VEC_DOT(dir1,dir1);
+	GREAL e1e2 = VEC_DOT(dir1,dir2);
+	GREAL e2e2 = VEC_DOT(dir2,dir2);
+	vec3f p1p2;
+    VEC_DIFF(p1p2,point1,point2);
+    GREAL p1p2e1 = VEC_DOT(p1p2,dir1);
+	GREAL p1p2e2 = VEC_DOT(p1p2,dir2);
+	det = e1e2*e1e2 - e1e1*e2e2;
+	if(GIM_IS_ZERO(det)) return false;
+	t1 = (e1e2*p1p2e2 - e2e2*p1p2e1)/det;
+	t2 = (e1e1*p1p2e2 - e1e2*p1p2e1)/det;
+	return true;
+}
+
+//! Find closest points on segments
+template<typename CLASS_POINT>
+SIMD_FORCE_INLINE void SEGMENT_COLLISION(
+	const CLASS_POINT & vA1,
+	const CLASS_POINT & vA2,
+	const CLASS_POINT & vB1,
+	const CLASS_POINT & vB2,
+	CLASS_POINT & vPointA,
+	CLASS_POINT & vPointB)
+{
+    CLASS_POINT _AD,_BD,_N;
+    vec4f _M;//plane
+    VEC_DIFF(_AD,vA2,vA1);
+    VEC_DIFF(_BD,vB2,vB1);
+    VEC_CROSS(_N,_AD,_BD);
+    GREAL _tp = VEC_DOT(_N,_N);
+    if(_tp<G_EPSILON)//ARE PARALELE
+    {
+    	//project B over A
+    	bool invert_b_order = false;
+    	_M[0] = VEC_DOT(vB1,_AD);
+    	_M[1] = VEC_DOT(vB2,_AD);
+    	if(_M[0]>_M[1])
+    	{
+    		invert_b_order  = true;
+    		GIM_SWAP_NUMBERS(_M[0],_M[1]);
+    	}
+    	_M[2] = VEC_DOT(vA1,_AD);
+    	_M[3] = VEC_DOT(vA2,_AD);
+    	//mid points
+    	_N[0] = (_M[0]+_M[1])*0.5f;
+    	_N[1] = (_M[2]+_M[3])*0.5f;
+
+    	if(_N[0]<_N[1])
+    	{
+    		if(_M[1]<_M[2])
+    		{
+    			vPointB = invert_b_order?vB1:vB2;
+    			vPointA = vA1;
+    		}
+    		else if(_M[1]<_M[3])
+    		{
+    			vPointB = invert_b_order?vB1:vB2;
+    			CLOSEST_POINT_ON_SEGMENT(vPointA,vPointB,vA1,vA2);
+    		}
+    		else
+    		{
+    			vPointA = vA2;
+    			CLOSEST_POINT_ON_SEGMENT(vPointB,vPointA,vB1,vB2);
+    		}
+    	}
+    	else
+    	{
+    		if(_M[3]<_M[0])
+    		{
+    			vPointB = invert_b_order?vB2:vB1;
+    			vPointA = vA2;
+    		}
+    		else if(_M[3]<_M[1])
+    		{
+    			vPointA = vA2;
+    			CLOSEST_POINT_ON_SEGMENT(vPointB,vPointA,vB1,vB2);
+    		}
+    		else
+    		{
+    			vPointB = invert_b_order?vB1:vB2;
+    			CLOSEST_POINT_ON_SEGMENT(vPointA,vPointB,vA1,vA2);
+    		}
+    	}
+    	return;
+    }
+
+
+    VEC_CROSS(_M,_N,_BD);
+    _M[3] = VEC_DOT(_M,vB1);
+
+    LINE_PLANE_COLLISION(_M,_AD,vA1,vPointA,_tp,btScalar(0), btScalar(1));
+    /*Closest point on segment*/
+    VEC_DIFF(vPointB,vPointA,vB1);
+	_tp = VEC_DOT(vPointB, _BD);
+	_tp/= VEC_DOT(_BD, _BD);
+	_tp = GIM_CLAMP(_tp,0.0f,1.0f);
+    VEC_SCALE(vPointB,_tp,_BD);
+    VEC_SUM(vPointB,vPointB,vB1);
+}
+
+
+
+
+//! Line box intersection in one dimension
+/*!
+
+*\param pos Position of the ray
+*\param dir Projection of the Direction of the ray
+*\param bmin Minimum bound of the box
+*\param bmax Maximum bound of the box
+*\param tfirst the minimum projection. Assign to 0 at first.
+*\param tlast the maximum projection. Assign to INFINITY at first.
+*\return true if there is an intersection.
+*/
+template<typename T>
+SIMD_FORCE_INLINE bool BOX_AXIS_INTERSECT(T pos, T dir,T bmin, T bmax, T & tfirst, T & tlast)
+{
+	if(GIM_IS_ZERO(dir))
+	{
+        return !(pos < bmin || pos > bmax);
+	}
+	GREAL a0 = (bmin - pos) / dir;
+	GREAL a1 = (bmax - pos) / dir;
+	if(a0 > a1)   GIM_SWAP_NUMBERS(a0, a1);
+	tfirst = GIM_MAX(a0, tfirst);
+	tlast = GIM_MIN(a1, tlast);
+	if (tlast < tfirst) return false;
+	return true;
+}
+
+
+//! Sorts 3 componets
+template<typename T>
+SIMD_FORCE_INLINE void SORT_3_INDICES(
+		const T * values,
+		GUINT * order_indices)
+{
+	//get minimum
+	order_indices[0] = values[0] < values[1] ? (values[0] < values[2] ? 0 : 2) : (values[1] < values[2] ? 1 : 2);
+
+	//get second and third
+	GUINT i0 = (order_indices[0] + 1)%3;
+	GUINT i1 = (i0 + 1)%3;
+
+	if(values[i0] < values[i1])
+	{
+		order_indices[1] = i0;
+		order_indices[2] = i1;
+	}
+	else
+	{
+		order_indices[1] = i1;
+		order_indices[2] = i0;
+	}
+}
+
+
+
+
+
+#endif // GIM_VECTOR_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_bitset.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_bitset.h
new file mode 100644
index 0000000..7dee48a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_bitset.h
@@ -0,0 +1,123 @@
+#ifndef GIM_BITSET_H_INCLUDED
+#define GIM_BITSET_H_INCLUDED
+/*! \file gim_bitset.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+#include "gim_array.h"
+
+
+#define GUINT_BIT_COUNT 32
+#define GUINT_EXPONENT 5
+
+class gim_bitset
+{
+public:
+    gim_array<GUINT> m_container;
+
+    gim_bitset()
+    {
+
+    }
+
+    gim_bitset(GUINT bits_count)
+    {
+        resize(bits_count);
+    }
+
+    ~gim_bitset()
+    {
+    }
+
+	inline bool resize(GUINT newsize)
+	{
+		GUINT oldsize = m_container.size();
+		m_container.resize(newsize/GUINT_BIT_COUNT + 1,false);
+		while(oldsize<m_container.size())
+		{
+			m_container[oldsize] = 0;
+		}
+		return true;
+	}
+
+	inline GUINT size()
+	{
+		return m_container.size()*GUINT_BIT_COUNT;
+	}
+
+	inline void set_all()
+	{
+		for(GUINT i = 0;i<m_container.size();++i)
+		{
+			m_container[i] = 0xffffffff;
+		}
+	}
+
+	inline void clear_all()
+	{
+	    for(GUINT i = 0;i<m_container.size();++i)
+		{
+			m_container[i] = 0;
+		}
+	}
+
+	inline void set(GUINT bit_index)
+	{
+		if(bit_index>=size())
+		{
+			resize(bit_index);
+		}
+		m_container[bit_index >> GUINT_EXPONENT] |= (1 << (bit_index & (GUINT_BIT_COUNT-1)));
+	}
+
+	///Return 0 or 1
+	inline char get(GUINT bit_index)
+	{
+		if(bit_index>=size())
+		{
+			return 0;
+		}
+		char value = m_container[bit_index >> GUINT_EXPONENT] &
+					 (1 << (bit_index & (GUINT_BIT_COUNT-1)));
+		return value;
+	}
+
+	inline void clear(GUINT bit_index)
+	{
+	    m_container[bit_index >> GUINT_EXPONENT] &= ~(1 << (bit_index & (GUINT_BIT_COUNT-1)));
+	}
+};
+
+
+
+
+
+#endif // GIM_CONTAINERS_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_collision.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_collision.h
new file mode 100644
index 0000000..b360dd4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_collision.h
@@ -0,0 +1,590 @@
+#ifndef GIM_BOX_COLLISION_H_INCLUDED
+#define GIM_BOX_COLLISION_H_INCLUDED
+
+/*! \file gim_box_collision.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+#include "gim_basic_geometry_operations.h"
+#include "LinearMath/btTransform.h"
+
+
+
+//SIMD_FORCE_INLINE bool test_cross_edge_box(
+//	const btVector3 & edge,
+//	const btVector3 & absolute_edge,
+//	const btVector3 & pointa,
+//	const btVector3 & pointb, const btVector3 & extend,
+//	int dir_index0,
+//	int dir_index1
+//	int component_index0,
+//	int component_index1)
+//{
+//	// dir coords are -z and y
+//
+//	const btScalar dir0 = -edge[dir_index0];
+//	const btScalar dir1 = edge[dir_index1];
+//	btScalar pmin = pointa[component_index0]*dir0 + pointa[component_index1]*dir1;
+//	btScalar pmax = pointb[component_index0]*dir0 + pointb[component_index1]*dir1;
+//	//find minmax
+//	if(pmin>pmax)
+//	{
+//		GIM_SWAP_NUMBERS(pmin,pmax);
+//	}
+//	//find extends
+//	const btScalar rad = extend[component_index0] * absolute_edge[dir_index0] +
+//					extend[component_index1] * absolute_edge[dir_index1];
+//
+//	if(pmin>rad || -rad>pmax) return false;
+//	return true;
+//}
+//
+//SIMD_FORCE_INLINE bool test_cross_edge_box_X_axis(
+//	const btVector3 & edge,
+//	const btVector3 & absolute_edge,
+//	const btVector3 & pointa,
+//	const btVector3 & pointb, btVector3 & extend)
+//{
+//
+//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,2,1,1,2);
+//}
+//
+//
+//SIMD_FORCE_INLINE bool test_cross_edge_box_Y_axis(
+//	const btVector3 & edge,
+//	const btVector3 & absolute_edge,
+//	const btVector3 & pointa,
+//	const btVector3 & pointb, btVector3 & extend)
+//{
+//
+//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,0,2,2,0);
+//}
+//
+//SIMD_FORCE_INLINE bool test_cross_edge_box_Z_axis(
+//	const btVector3 & edge,
+//	const btVector3 & absolute_edge,
+//	const btVector3 & pointa,
+//	const btVector3 & pointb, btVector3 & extend)
+//{
+//
+//	return test_cross_edge_box(edge,absolute_edge,pointa,pointb,extend,1,0,0,1);
+//}
+
+#define TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,i_dir_0,i_dir_1,i_comp_0,i_comp_1)\
+{\
+	const btScalar dir0 = -edge[i_dir_0];\
+	const btScalar dir1 = edge[i_dir_1];\
+	btScalar pmin = pointa[i_comp_0]*dir0 + pointa[i_comp_1]*dir1;\
+	btScalar pmax = pointb[i_comp_0]*dir0 + pointb[i_comp_1]*dir1;\
+	if(pmin>pmax)\
+	{\
+		GIM_SWAP_NUMBERS(pmin,pmax); \
+	}\
+	const btScalar abs_dir0 = absolute_edge[i_dir_0];\
+	const btScalar abs_dir1 = absolute_edge[i_dir_1];\
+	const btScalar rad = _extend[i_comp_0] * abs_dir0 + _extend[i_comp_1] * abs_dir1;\
+	if(pmin>rad || -rad>pmax) return false;\
+}\
+
+
+#define TEST_CROSS_EDGE_BOX_X_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
+{\
+	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,2,1,1,2);\
+}\
+
+#define TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
+{\
+	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,0,2,2,0);\
+}\
+
+#define TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(edge,absolute_edge,pointa,pointb,_extend)\
+{\
+	TEST_CROSS_EDGE_BOX_MCR(edge,absolute_edge,pointa,pointb,_extend,1,0,0,1);\
+}\
+
+
+
+//!  Class for transforming a model1 to the space of model0
+class GIM_BOX_BOX_TRANSFORM_CACHE
+{
+public:
+    btVector3  m_T1to0;//!< Transforms translation of model1 to model 0
+	btMatrix3x3 m_R1to0;//!< Transforms Rotation of model1 to model 0, equal  to R0' * R1
+	btMatrix3x3 m_AR;//!< Absolute value of m_R1to0
+
+	SIMD_FORCE_INLINE void calc_absolute_matrix()
+	{
+		static const btVector3 vepsi(1e-6f,1e-6f,1e-6f);
+		m_AR[0] = vepsi + m_R1to0[0].absolute();
+		m_AR[1] = vepsi + m_R1to0[1].absolute();
+		m_AR[2] = vepsi + m_R1to0[2].absolute();
+	}
+
+	GIM_BOX_BOX_TRANSFORM_CACHE()
+	{
+	}
+
+
+	GIM_BOX_BOX_TRANSFORM_CACHE(mat4f  trans1_to_0)
+	{
+		COPY_MATRIX_3X3(m_R1to0,trans1_to_0)
+        MAT_GET_TRANSLATION(trans1_to_0,m_T1to0)
+		calc_absolute_matrix();
+	}
+
+	//! Calc the transformation relative  1 to 0. Inverts matrics by transposing
+	SIMD_FORCE_INLINE void calc_from_homogenic(const btTransform & trans0,const btTransform & trans1)
+	{
+
+		m_R1to0 = trans0.getBasis().transpose();
+		m_T1to0 = m_R1to0 * (-trans0.getOrigin());
+
+		m_T1to0 += m_R1to0*trans1.getOrigin();
+		m_R1to0 *= trans1.getBasis();
+
+		calc_absolute_matrix();
+	}
+
+	//! Calcs the full invertion of the matrices. Useful for scaling matrices
+	SIMD_FORCE_INLINE void calc_from_full_invert(const btTransform & trans0,const btTransform & trans1)
+	{
+		m_R1to0 = trans0.getBasis().inverse();
+		m_T1to0 = m_R1to0 * (-trans0.getOrigin());
+
+		m_T1to0 += m_R1to0*trans1.getOrigin();
+		m_R1to0 *= trans1.getBasis();
+
+		calc_absolute_matrix();
+	}
+
+	SIMD_FORCE_INLINE btVector3 transform(const btVector3 & point)
+	{
+		return btVector3(m_R1to0[0].dot(point) + m_T1to0.x(),
+			m_R1to0[1].dot(point) + m_T1to0.y(),
+			m_R1to0[2].dot(point) + m_T1to0.z());
+	}
+};
+
+
+#define BOX_PLANE_EPSILON 0.000001f
+
+//! Axis aligned box
+class GIM_AABB
+{
+public:
+	btVector3 m_min;
+	btVector3 m_max;
+
+	GIM_AABB()
+	{}
+
+
+	GIM_AABB(const btVector3 & V1,
+			 const btVector3 & V2,
+			 const btVector3 & V3)
+	{
+		m_min[0] = GIM_MIN3(V1[0],V2[0],V3[0]);
+		m_min[1] = GIM_MIN3(V1[1],V2[1],V3[1]);
+		m_min[2] = GIM_MIN3(V1[2],V2[2],V3[2]);
+
+		m_max[0] = GIM_MAX3(V1[0],V2[0],V3[0]);
+		m_max[1] = GIM_MAX3(V1[1],V2[1],V3[1]);
+		m_max[2] = GIM_MAX3(V1[2],V2[2],V3[2]);
+	}
+
+	GIM_AABB(const btVector3 & V1,
+			 const btVector3 & V2,
+			 const btVector3 & V3,
+			 GREAL margin)
+	{
+		m_min[0] = GIM_MIN3(V1[0],V2[0],V3[0]);
+		m_min[1] = GIM_MIN3(V1[1],V2[1],V3[1]);
+		m_min[2] = GIM_MIN3(V1[2],V2[2],V3[2]);
+
+		m_max[0] = GIM_MAX3(V1[0],V2[0],V3[0]);
+		m_max[1] = GIM_MAX3(V1[1],V2[1],V3[1]);
+		m_max[2] = GIM_MAX3(V1[2],V2[2],V3[2]);
+
+		m_min[0] -= margin;
+		m_min[1] -= margin;
+		m_min[2] -= margin;
+		m_max[0] += margin;
+		m_max[1] += margin;
+		m_max[2] += margin;
+	}
+
+	GIM_AABB(const GIM_AABB &other):
+		m_min(other.m_min),m_max(other.m_max)
+	{
+	}
+
+	GIM_AABB(const GIM_AABB &other,btScalar margin ):
+		m_min(other.m_min),m_max(other.m_max)
+	{
+		m_min[0] -= margin;
+		m_min[1] -= margin;
+		m_min[2] -= margin;
+		m_max[0] += margin;
+		m_max[1] += margin;
+		m_max[2] += margin;
+	}
+
+	SIMD_FORCE_INLINE void invalidate()
+	{
+		m_min[0] = G_REAL_INFINITY;
+		m_min[1] = G_REAL_INFINITY;
+		m_min[2] = G_REAL_INFINITY;
+		m_max[0] = -G_REAL_INFINITY;
+		m_max[1] = -G_REAL_INFINITY;
+		m_max[2] = -G_REAL_INFINITY;
+	}
+
+	SIMD_FORCE_INLINE void increment_margin(btScalar margin)
+	{
+		m_min[0] -= margin;
+		m_min[1] -= margin;
+		m_min[2] -= margin;
+		m_max[0] += margin;
+		m_max[1] += margin;
+		m_max[2] += margin;
+	}
+
+	SIMD_FORCE_INLINE void copy_with_margin(const GIM_AABB &other, btScalar margin)
+	{
+		m_min[0] = other.m_min[0] - margin;
+		m_min[1] = other.m_min[1] - margin;
+		m_min[2] = other.m_min[2] - margin;
+
+		m_max[0] = other.m_max[0] + margin;
+		m_max[1] = other.m_max[1] + margin;
+		m_max[2] = other.m_max[2] + margin;
+	}
+
+	template<typename CLASS_POINT>
+	SIMD_FORCE_INLINE void calc_from_triangle(
+							const CLASS_POINT & V1,
+							const CLASS_POINT & V2,
+							const CLASS_POINT & V3)
+	{
+		m_min[0] = GIM_MIN3(V1[0],V2[0],V3[0]);
+		m_min[1] = GIM_MIN3(V1[1],V2[1],V3[1]);
+		m_min[2] = GIM_MIN3(V1[2],V2[2],V3[2]);
+
+		m_max[0] = GIM_MAX3(V1[0],V2[0],V3[0]);
+		m_max[1] = GIM_MAX3(V1[1],V2[1],V3[1]);
+		m_max[2] = GIM_MAX3(V1[2],V2[2],V3[2]);
+	}
+
+	template<typename CLASS_POINT>
+	SIMD_FORCE_INLINE void calc_from_triangle_margin(
+							const CLASS_POINT & V1,
+							const CLASS_POINT & V2,
+							const CLASS_POINT & V3, btScalar margin)
+	{
+		m_min[0] = GIM_MIN3(V1[0],V2[0],V3[0]);
+		m_min[1] = GIM_MIN3(V1[1],V2[1],V3[1]);
+		m_min[2] = GIM_MIN3(V1[2],V2[2],V3[2]);
+
+		m_max[0] = GIM_MAX3(V1[0],V2[0],V3[0]);
+		m_max[1] = GIM_MAX3(V1[1],V2[1],V3[1]);
+		m_max[2] = GIM_MAX3(V1[2],V2[2],V3[2]);
+
+		m_min[0] -= margin;
+		m_min[1] -= margin;
+		m_min[2] -= margin;
+		m_max[0] += margin;
+		m_max[1] += margin;
+		m_max[2] += margin;
+	}
+
+	//! Apply a transform to an AABB
+	SIMD_FORCE_INLINE void appy_transform(const btTransform & trans)
+	{
+		btVector3 center = (m_max+m_min)*0.5f;
+		btVector3 extends = m_max - center;
+		// Compute new center
+		center = trans(center);
+
+		btVector3 textends(extends.dot(trans.getBasis().getRow(0).absolute()),
+ 				 extends.dot(trans.getBasis().getRow(1).absolute()),
+				 extends.dot(trans.getBasis().getRow(2).absolute()));
+
+		m_min = center - textends;
+		m_max = center + textends;
+	}
+
+	//! Merges a Box
+	SIMD_FORCE_INLINE void merge(const GIM_AABB & box)
+	{
+		m_min[0] = GIM_MIN(m_min[0],box.m_min[0]);
+		m_min[1] = GIM_MIN(m_min[1],box.m_min[1]);
+		m_min[2] = GIM_MIN(m_min[2],box.m_min[2]);
+
+		m_max[0] = GIM_MAX(m_max[0],box.m_max[0]);
+		m_max[1] = GIM_MAX(m_max[1],box.m_max[1]);
+		m_max[2] = GIM_MAX(m_max[2],box.m_max[2]);
+	}
+
+	//! Merges a point
+	template<typename CLASS_POINT>
+	SIMD_FORCE_INLINE void merge_point(const CLASS_POINT & point)
+	{
+		m_min[0] = GIM_MIN(m_min[0],point[0]);
+		m_min[1] = GIM_MIN(m_min[1],point[1]);
+		m_min[2] = GIM_MIN(m_min[2],point[2]);
+
+		m_max[0] = GIM_MAX(m_max[0],point[0]);
+		m_max[1] = GIM_MAX(m_max[1],point[1]);
+		m_max[2] = GIM_MAX(m_max[2],point[2]);
+	}
+
+	//! Gets the extend and center
+	SIMD_FORCE_INLINE void get_center_extend(btVector3 & center,btVector3 & extend)  const
+	{
+		center = (m_max+m_min)*0.5f;
+		extend = m_max - center;
+	}
+
+	//! Finds the intersecting box between this box and the other.
+	SIMD_FORCE_INLINE void find_intersection(const GIM_AABB & other, GIM_AABB & intersection)  const
+	{
+		intersection.m_min[0] = GIM_MAX(other.m_min[0],m_min[0]);
+		intersection.m_min[1] = GIM_MAX(other.m_min[1],m_min[1]);
+		intersection.m_min[2] = GIM_MAX(other.m_min[2],m_min[2]);
+
+		intersection.m_max[0] = GIM_MIN(other.m_max[0],m_max[0]);
+		intersection.m_max[1] = GIM_MIN(other.m_max[1],m_max[1]);
+		intersection.m_max[2] = GIM_MIN(other.m_max[2],m_max[2]);
+	}
+
+
+	SIMD_FORCE_INLINE bool has_collision(const GIM_AABB & other) const
+	{
+		if(m_min[0] > other.m_max[0] ||
+		   m_max[0] < other.m_min[0] ||
+		   m_min[1] > other.m_max[1] ||
+		   m_max[1] < other.m_min[1] ||
+		   m_min[2] > other.m_max[2] ||
+		   m_max[2] < other.m_min[2])
+		{
+			return false;
+		}
+		return true;
+	}
+
+	/*! \brief Finds the Ray intersection parameter.
+	\param aabb Aligned box
+	\param vorigin A vec3f with the origin of the ray
+	\param vdir A vec3f with the direction of the ray
+	*/
+	SIMD_FORCE_INLINE bool collide_ray(const btVector3 & vorigin,const btVector3 & vdir)
+	{
+		btVector3 extents,center;
+		this->get_center_extend(center,extents);;
+
+		btScalar Dx = vorigin[0] - center[0];
+		if(GIM_GREATER(Dx, extents[0]) && Dx*vdir[0]>=0.0f)	return false;
+		btScalar Dy = vorigin[1] - center[1];
+		if(GIM_GREATER(Dy, extents[1]) && Dy*vdir[1]>=0.0f)	return false;
+		btScalar Dz = vorigin[2] - center[2];
+		if(GIM_GREATER(Dz, extents[2]) && Dz*vdir[2]>=0.0f)	return false;
+
+
+		btScalar f = vdir[1] * Dz - vdir[2] * Dy;
+		if(btFabs(f) > extents[1]*btFabs(vdir[2]) + extents[2]*btFabs(vdir[1])) return false;
+		f = vdir[2] * Dx - vdir[0] * Dz;
+		if(btFabs(f) > extents[0]*btFabs(vdir[2]) + extents[2]*btFabs(vdir[0]))return false;
+		f = vdir[0] * Dy - vdir[1] * Dx;
+		if(btFabs(f) > extents[0]*btFabs(vdir[1]) + extents[1]*btFabs(vdir[0]))return false;
+		return true;
+	}
+
+
+	SIMD_FORCE_INLINE void projection_interval(const btVector3 & direction, btScalar &vmin, btScalar &vmax) const
+	{
+		btVector3 center = (m_max+m_min)*0.5f;
+		btVector3 extend = m_max-center;
+
+		btScalar _fOrigin =  direction.dot(center);
+		btScalar _fMaximumExtent = extend.dot(direction.absolute());
+		vmin = _fOrigin - _fMaximumExtent;
+		vmax = _fOrigin + _fMaximumExtent;
+	}
+
+	SIMD_FORCE_INLINE ePLANE_INTERSECTION_TYPE plane_classify(const btVector4 &plane) const
+	{
+		btScalar _fmin,_fmax;
+		this->projection_interval(plane,_fmin,_fmax);
+
+		if(plane[3] > _fmax + BOX_PLANE_EPSILON)
+		{
+			return G_BACK_PLANE; // 0
+		}
+
+		if(plane[3]+BOX_PLANE_EPSILON >=_fmin)
+		{
+			return G_COLLIDE_PLANE; //1
+		}
+		return G_FRONT_PLANE;//2
+	}
+
+	SIMD_FORCE_INLINE bool overlapping_trans_conservative(const GIM_AABB & box, btTransform & trans1_to_0)
+	{
+		GIM_AABB tbox = box;
+		tbox.appy_transform(trans1_to_0);
+		return has_collision(tbox);
+	}
+
+	//! transcache is the transformation cache from box to this AABB
+	SIMD_FORCE_INLINE bool overlapping_trans_cache(
+		const GIM_AABB & box,const GIM_BOX_BOX_TRANSFORM_CACHE & transcache, bool fulltest)
+	{
+
+		//Taken from OPCODE
+		btVector3 ea,eb;//extends
+		btVector3 ca,cb;//extends
+		get_center_extend(ca,ea);
+		box.get_center_extend(cb,eb);
+
+
+		btVector3 T;
+		btScalar t,t2;
+		int i;
+
+		// Class I : A's basis vectors
+		for(i=0;i<3;i++)
+		{
+			T[i] =  transcache.m_R1to0[i].dot(cb) + transcache.m_T1to0[i] - ca[i];
+			t = transcache.m_AR[i].dot(eb) + ea[i];
+			if(GIM_GREATER(T[i], t))	return false;
+		}
+		// Class II : B's basis vectors
+		for(i=0;i<3;i++)
+		{
+			t = MAT_DOT_COL(transcache.m_R1to0,T,i);
+			t2 = MAT_DOT_COL(transcache.m_AR,ea,i) + eb[i];
+			if(GIM_GREATER(t,t2))	return false;
+		}
+		// Class III : 9 cross products
+		if(fulltest)
+		{
+			int j,m,n,o,p,q,r;
+			for(i=0;i<3;i++)
+			{
+				m = (i+1)%3;
+				n = (i+2)%3;
+				o = i==0?1:0;
+				p = i==2?1:2;
+				for(j=0;j<3;j++)
+				{
+					q = j==2?1:2;
+					r = j==0?1:0;
+					t = T[n]*transcache.m_R1to0[m][j] - T[m]*transcache.m_R1to0[n][j];
+					t2 = ea[o]*transcache.m_AR[p][j] + ea[p]*transcache.m_AR[o][j] +
+						eb[r]*transcache.m_AR[i][q] + eb[q]*transcache.m_AR[i][r];
+					if(GIM_GREATER(t,t2))	return false;
+				}
+			}
+		}
+		return true;
+	}
+
+	//! Simple test for planes.
+	SIMD_FORCE_INLINE bool collide_plane(
+		const btVector4 & plane)
+	{
+		ePLANE_INTERSECTION_TYPE classify = plane_classify(plane);
+		return (classify == G_COLLIDE_PLANE);
+	}
+
+	//! test for a triangle, with edges
+	SIMD_FORCE_INLINE bool collide_triangle_exact(
+		const btVector3 & p1,
+		const btVector3 & p2,
+		const btVector3 & p3,
+		const btVector4 & triangle_plane)
+	{
+		if(!collide_plane(triangle_plane)) return false;
+
+		btVector3 center,extends;
+		this->get_center_extend(center,extends);
+
+		const btVector3 v1(p1 - center);
+		const btVector3 v2(p2 - center);
+		const btVector3 v3(p3 - center);
+
+		//First axis
+		btVector3 diff(v2 - v1);
+		btVector3 abs_diff = diff.absolute();
+		//Test With X axis
+		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v1,v3,extends);
+		//Test With Y axis
+		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v1,v3,extends);
+		//Test With Z axis
+		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v1,v3,extends);
+
+
+		diff = v3 - v2;
+		abs_diff = diff.absolute();
+		//Test With X axis
+		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v2,v1,extends);
+		//Test With Y axis
+		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v2,v1,extends);
+		//Test With Z axis
+		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v2,v1,extends);
+
+		diff = v1 - v3;
+		abs_diff = diff.absolute();
+		//Test With X axis
+		TEST_CROSS_EDGE_BOX_X_AXIS_MCR(diff,abs_diff,v3,v2,extends);
+		//Test With Y axis
+		TEST_CROSS_EDGE_BOX_Y_AXIS_MCR(diff,abs_diff,v3,v2,extends);
+		//Test With Z axis
+		TEST_CROSS_EDGE_BOX_Z_AXIS_MCR(diff,abs_diff,v3,v2,extends);
+
+		return true;
+	}
+};
+
+
+//! Compairison of transformation objects
+SIMD_FORCE_INLINE bool btCompareTransformsEqual(const btTransform & t1,const btTransform & t2)
+{
+	if(!(t1.getOrigin() == t2.getOrigin()) ) return false;
+
+	if(!(t1.getBasis().getRow(0) == t2.getBasis().getRow(0)) ) return false;
+	if(!(t1.getBasis().getRow(1) == t2.getBasis().getRow(1)) ) return false;
+	if(!(t1.getBasis().getRow(2) == t2.getBasis().getRow(2)) ) return false;
+	return true;
+}
+
+
+
+#endif // GIM_BOX_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.cpp
new file mode 100644
index 0000000..0c3d7ba
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.cpp
@@ -0,0 +1,182 @@
+
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+
+#include "gim_box_set.h"
+
+
+GUINT GIM_BOX_TREE::_calc_splitting_axis(
+	gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,  GUINT endIndex)
+{
+	GUINT i;
+
+	btVector3 means(btScalar(0.),btScalar(0.),btScalar(0.));
+	btVector3 variance(btScalar(0.),btScalar(0.),btScalar(0.));
+	GUINT numIndices = endIndex-startIndex;
+
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		means+=center;
+	}
+	means *= (btScalar(1.)/(btScalar)numIndices);
+
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btVector3 center = btScalar(0.5)*(primitive_boxes[i].m_bound.m_max +
+					 primitive_boxes[i].m_bound.m_min);
+		btVector3 diff2 = center-means;
+		diff2 = diff2 * diff2;
+		variance += diff2;
+	}
+	variance *= (btScalar(1.)/	((btScalar)numIndices-1)	);
+
+	return variance.maxAxis();
+}
+
+
+GUINT GIM_BOX_TREE::_sort_and_calc_splitting_index(
+	gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,
+	GUINT endIndex, GUINT splitAxis)
+{
+	GUINT i;
+	GUINT splitIndex =startIndex;
+	GUINT numIndices = endIndex - startIndex;
+
+	// average of centers
+	btScalar splitValue = 0.0f;
+	for (i=startIndex;i<endIndex;i++)
+	{
+		splitValue+= 0.5f*(primitive_boxes[i].m_bound.m_max[splitAxis] +
+					 primitive_boxes[i].m_bound.m_min[splitAxis]);
+	}
+	splitValue /= (btScalar)numIndices;
+
+	//sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
+	for (i=startIndex;i<endIndex;i++)
+	{
+		btScalar center = 0.5f*(primitive_boxes[i].m_bound.m_max[splitAxis] +
+					 primitive_boxes[i].m_bound.m_min[splitAxis]);
+		if (center > splitValue)
+		{
+			//swap
+			primitive_boxes.swap(i,splitIndex);
+			splitIndex++;
+		}
+	}
+
+	//if the splitIndex causes unbalanced trees, fix this by using the center in between startIndex and endIndex
+	//otherwise the tree-building might fail due to stack-overflows in certain cases.
+	//unbalanced1 is unsafe: it can cause stack overflows
+	//bool unbalanced1 = ((splitIndex==startIndex) || (splitIndex == (endIndex-1)));
+
+	//unbalanced2 should work too: always use center (perfect balanced trees)
+	//bool unbalanced2 = true;
+
+	//this should be safe too:
+	GUINT rangeBalancedIndices = numIndices/3;
+	bool unbalanced = ((splitIndex<=(startIndex+rangeBalancedIndices)) || (splitIndex >=(endIndex-1-rangeBalancedIndices)));
+
+	if (unbalanced)
+	{
+		splitIndex = startIndex+ (numIndices>>1);
+	}
+
+	btAssert(!((splitIndex==startIndex) || (splitIndex == (endIndex))));
+
+	return splitIndex;
+}
+
+
+void GIM_BOX_TREE::_build_sub_tree(gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,  GUINT endIndex)
+{
+	GUINT current_index = m_num_nodes++;
+
+	btAssert((endIndex-startIndex)>0);
+
+	if((endIndex-startIndex) == 1) //we got a leaf
+	{		
+		m_node_array[current_index].m_left = 0;
+		m_node_array[current_index].m_right = 0;
+		m_node_array[current_index].m_escapeIndex = 0;
+
+		m_node_array[current_index].m_bound = primitive_boxes[startIndex].m_bound;
+		m_node_array[current_index].m_data = primitive_boxes[startIndex].m_data;
+		return;
+	}
+
+	//configure inner node
+
+	GUINT splitIndex;
+
+	//calc this node bounding box
+	m_node_array[current_index].m_bound.invalidate();	
+	for (splitIndex=startIndex;splitIndex<endIndex;splitIndex++)
+	{
+		m_node_array[current_index].m_bound.merge(primitive_boxes[splitIndex].m_bound);
+	}
+
+	//calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
+
+	//split axis
+	splitIndex = _calc_splitting_axis(primitive_boxes,startIndex,endIndex);
+
+	splitIndex = _sort_and_calc_splitting_index(
+			primitive_boxes,startIndex,endIndex,splitIndex);
+
+	//configure this inner node : the left node index
+	m_node_array[current_index].m_left = m_num_nodes;
+	//build left child tree
+	_build_sub_tree(primitive_boxes, startIndex, splitIndex );
+
+	//configure this inner node : the right node index
+	m_node_array[current_index].m_right = m_num_nodes;
+
+	//build right child tree
+	_build_sub_tree(primitive_boxes, splitIndex ,endIndex);
+
+	//configure this inner node : the escape index
+	m_node_array[current_index].m_escapeIndex  = m_num_nodes - current_index;
+}
+
+//! stackless build tree
+void GIM_BOX_TREE::build_tree(
+	gim_array<GIM_AABB_DATA> & primitive_boxes)
+{
+	// initialize node count to 0
+	m_num_nodes = 0;
+	// allocate nodes
+	m_node_array.resize(primitive_boxes.size()*2);
+	
+	_build_sub_tree(primitive_boxes, 0, primitive_boxes.size());
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.h
new file mode 100644
index 0000000..61d190a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_box_set.h
@@ -0,0 +1,674 @@
+#ifndef GIM_BOX_SET_H_INCLUDED
+#define GIM_BOX_SET_H_INCLUDED
+
+/*! \file gim_box_set.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+
+#include "gim_array.h"
+#include "gim_radixsort.h"
+#include "gim_box_collision.h"
+#include "gim_tri_collision.h"
+
+
+
+//! Overlapping pair
+struct GIM_PAIR
+{
+    GUINT m_index1;
+    GUINT m_index2;
+    GIM_PAIR()
+    {}
+
+    GIM_PAIR(const GIM_PAIR & p)
+    {
+    	m_index1 = p.m_index1;
+    	m_index2 = p.m_index2;
+	}
+
+	GIM_PAIR(GUINT index1, GUINT index2)
+    {
+    	m_index1 = index1;
+    	m_index2 = index2;
+	}
+};
+
+//! A pairset array
+class gim_pair_set: public gim_array<GIM_PAIR>
+{
+public:
+	gim_pair_set():gim_array<GIM_PAIR>(32)
+	{
+	}
+	inline void push_pair(GUINT index1,GUINT index2)
+	{
+		push_back(GIM_PAIR(index1,index2));
+	}
+
+	inline void push_pair_inv(GUINT index1,GUINT index2)
+	{
+		push_back(GIM_PAIR(index2,index1));
+	}
+};
+
+
+//! Prototype Base class for primitive classification
+/*!
+This class is a wrapper for primitive collections.
+This tells relevant info for the Bounding Box set classes, which take care of space classification.
+This class can manage Compound shapes and trimeshes, and if it is managing trimesh then the  Hierarchy Bounding Box classes will take advantage of primitive Vs Box overlapping tests for getting optimal results and less Per Box compairisons.
+*/
+class GIM_PRIMITIVE_MANAGER_PROTOTYPE
+{
+public:
+
+	virtual ~GIM_PRIMITIVE_MANAGER_PROTOTYPE() {}
+	//! determines if this manager consist on only triangles, which special case will be optimized
+	virtual bool is_trimesh() = 0;
+	virtual GUINT get_primitive_count() = 0;
+	virtual void get_primitive_box(GUINT prim_index ,GIM_AABB & primbox) = 0;
+	virtual void get_primitive_triangle(GUINT prim_index,GIM_TRIANGLE & triangle) = 0;
+};
+
+
+struct GIM_AABB_DATA
+{
+	GIM_AABB m_bound;
+	GUINT m_data;
+};
+
+//! Node Structure for trees
+struct GIM_BOX_TREE_NODE
+{
+	GIM_AABB m_bound;
+	GUINT m_left;//!< Left subtree
+	GUINT m_right;//!< Right subtree
+	GUINT m_escapeIndex;//!< Scape index for traversing
+	GUINT m_data;//!< primitive index if apply
+
+	GIM_BOX_TREE_NODE()
+	{
+	    m_left = 0;
+	    m_right = 0;
+	    m_escapeIndex = 0;
+	    m_data = 0;
+	}
+
+	SIMD_FORCE_INLINE bool is_leaf_node() const
+	{
+	    return  (!m_left && !m_right);
+	}
+};
+
+//! Basic Box tree structure
+class GIM_BOX_TREE
+{
+protected:
+	GUINT m_num_nodes;
+	gim_array<GIM_BOX_TREE_NODE> m_node_array;
+protected:
+	GUINT _sort_and_calc_splitting_index(
+		gim_array<GIM_AABB_DATA> & primitive_boxes,
+		 GUINT startIndex,  GUINT endIndex, GUINT splitAxis);
+
+	GUINT _calc_splitting_axis(gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,  GUINT endIndex);
+
+	void _build_sub_tree(gim_array<GIM_AABB_DATA> & primitive_boxes, GUINT startIndex,  GUINT endIndex);
+public:
+	GIM_BOX_TREE()
+	{
+		m_num_nodes = 0;
+	}
+
+	//! prototype functions for box tree management
+	//!@{
+	void build_tree(gim_array<GIM_AABB_DATA> & primitive_boxes);
+
+	SIMD_FORCE_INLINE void clearNodes()
+	{
+		m_node_array.clear();
+		m_num_nodes = 0;
+	}
+
+	//! node count
+	SIMD_FORCE_INLINE GUINT getNodeCount() const
+	{
+		return m_num_nodes;
+	}
+
+	//! tells if the node is a leaf
+	SIMD_FORCE_INLINE bool isLeafNode(GUINT nodeindex) const
+	{
+		return m_node_array[nodeindex].is_leaf_node();
+	}
+
+	SIMD_FORCE_INLINE GUINT getNodeData(GUINT nodeindex) const
+	{
+		return m_node_array[nodeindex].m_data;
+	}
+
+	SIMD_FORCE_INLINE void getNodeBound(GUINT nodeindex, GIM_AABB & bound) const
+	{
+		bound = m_node_array[nodeindex].m_bound;
+	}
+
+	SIMD_FORCE_INLINE void setNodeBound(GUINT nodeindex, const GIM_AABB & bound)
+	{
+		m_node_array[nodeindex].m_bound = bound;
+	}
+
+	SIMD_FORCE_INLINE GUINT getLeftNodeIndex(GUINT nodeindex)  const
+	{
+		return m_node_array[nodeindex].m_left;
+	}
+
+	SIMD_FORCE_INLINE GUINT getRightNodeIndex(GUINT nodeindex)  const
+	{
+		return m_node_array[nodeindex].m_right;
+	}
+
+	SIMD_FORCE_INLINE GUINT getScapeNodeIndex(GUINT nodeindex) const
+	{
+		return m_node_array[nodeindex].m_escapeIndex;
+	}
+
+	//!@}
+};
+
+
+//! Generic Box Tree Template
+/*!
+This class offers an structure for managing a box tree of primitives.
+Requires a Primitive prototype (like GIM_PRIMITIVE_MANAGER_PROTOTYPE ) and
+a Box tree structure ( like GIM_BOX_TREE).
+*/
+template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
+class GIM_BOX_TREE_TEMPLATE_SET
+{
+protected:
+	_GIM_PRIMITIVE_MANAGER_PROTOTYPE m_primitive_manager;
+	_GIM_BOX_TREE_PROTOTYPE m_box_tree;
+protected:
+	//stackless refit
+	SIMD_FORCE_INLINE void refit()
+	{
+		GUINT nodecount = getNodeCount();
+		while(nodecount--)
+		{
+			if(isLeafNode(nodecount))
+			{
+				GIM_AABB leafbox;
+				m_primitive_manager.get_primitive_box(getNodeData(nodecount),leafbox);
+				setNodeBound(nodecount,leafbox);
+			}
+			else
+			{
+				//get left bound
+				GUINT childindex = getLeftNodeIndex(nodecount);
+				GIM_AABB bound;
+				getNodeBound(childindex,bound);
+				//get right bound
+				childindex = getRightNodeIndex(nodecount);
+				GIM_AABB bound2;
+				getNodeBound(childindex,bound2);
+				bound.merge(bound2);
+
+				setNodeBound(nodecount,bound);
+			}
+		}
+	}
+public:
+
+	GIM_BOX_TREE_TEMPLATE_SET()
+	{
+	}
+
+	SIMD_FORCE_INLINE GIM_AABB getGlobalBox()  const
+	{
+		GIM_AABB totalbox;
+		getNodeBound(0, totalbox);
+		return totalbox;
+	}
+
+	SIMD_FORCE_INLINE void setPrimitiveManager(const _GIM_PRIMITIVE_MANAGER_PROTOTYPE & primitive_manager)
+	{
+		m_primitive_manager = primitive_manager;
+	}
+
+	const _GIM_PRIMITIVE_MANAGER_PROTOTYPE & getPrimitiveManager() const
+	{
+		return m_primitive_manager;
+	}
+
+	_GIM_PRIMITIVE_MANAGER_PROTOTYPE & getPrimitiveManager()
+	{
+		return m_primitive_manager;
+	}
+
+//! node manager prototype functions
+///@{
+
+	//! this attemps to refit the box set.
+	SIMD_FORCE_INLINE void update()
+	{
+		refit();
+	}
+
+	//! this rebuild the entire set
+	SIMD_FORCE_INLINE void buildSet()
+	{
+		//obtain primitive boxes
+		gim_array<GIM_AABB_DATA> primitive_boxes;
+		primitive_boxes.resize(m_primitive_manager.get_primitive_count(),false);
+
+		for (GUINT i = 0;i<primitive_boxes.size() ;i++ )
+		{
+			 m_primitive_manager.get_primitive_box(i,primitive_boxes[i].m_bound);
+			 primitive_boxes[i].m_data = i;
+		}
+
+		m_box_tree.build_tree(primitive_boxes);
+	}
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	SIMD_FORCE_INLINE bool boxQuery(const GIM_AABB & box, gim_array<GUINT> & collided_results) const
+	{
+		GUINT curIndex = 0;
+		GUINT numNodes = getNodeCount();
+
+		while (curIndex < numNodes)
+		{
+			GIM_AABB bound;
+			getNodeBound(curIndex,bound);
+
+			//catch bugs in tree data
+
+			bool aabbOverlap = bound.has_collision(box);
+			bool isleafnode = isLeafNode(curIndex);
+
+			if (isleafnode && aabbOverlap)
+			{
+				collided_results.push_back(getNodeData(curIndex));
+			}
+
+			if (aabbOverlap || isleafnode)
+			{
+				//next subnode
+				curIndex++;
+			}
+			else
+			{
+				//skip node
+				curIndex+= getScapeNodeIndex(curIndex);
+			}
+		}
+		if(collided_results.size()>0) return true;
+		return false;
+	}
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	SIMD_FORCE_INLINE bool boxQueryTrans(const GIM_AABB & box,
+		 const btTransform & transform, gim_array<GUINT> & collided_results) const
+	{
+		GIM_AABB transbox=box;
+		transbox.appy_transform(transform);
+		return boxQuery(transbox,collided_results);
+	}
+
+	//! returns the indices of the primitives in the m_primitive_manager
+	SIMD_FORCE_INLINE bool rayQuery(
+		const btVector3 & ray_dir,const btVector3 & ray_origin ,
+		gim_array<GUINT> & collided_results) const
+	{
+		GUINT curIndex = 0;
+		GUINT numNodes = getNodeCount();
+
+		while (curIndex < numNodes)
+		{
+			GIM_AABB bound;
+			getNodeBound(curIndex,bound);
+
+			//catch bugs in tree data
+
+			bool aabbOverlap = bound.collide_ray(ray_origin,ray_dir);
+			bool isleafnode = isLeafNode(curIndex);
+
+			if (isleafnode && aabbOverlap)
+			{
+				collided_results.push_back(getNodeData( curIndex));
+			}
+
+			if (aabbOverlap || isleafnode)
+			{
+				//next subnode
+				curIndex++;
+			}
+			else
+			{
+				//skip node
+				curIndex+= getScapeNodeIndex(curIndex);
+			}
+		}
+		if(collided_results.size()>0) return true;
+		return false;
+	}
+
+	//! tells if this set has hierarcht
+	SIMD_FORCE_INLINE bool hasHierarchy() const
+	{
+		return true;
+	}
+
+	//! tells if this set is a trimesh
+	SIMD_FORCE_INLINE bool isTrimesh()  const
+	{
+		return m_primitive_manager.is_trimesh();
+	}
+
+	//! node count
+	SIMD_FORCE_INLINE GUINT getNodeCount() const
+	{
+		return m_box_tree.getNodeCount();
+	}
+
+	//! tells if the node is a leaf
+	SIMD_FORCE_INLINE bool isLeafNode(GUINT nodeindex) const
+	{
+		return m_box_tree.isLeafNode(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE GUINT getNodeData(GUINT nodeindex) const
+	{
+		return m_box_tree.getNodeData(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE void getNodeBound(GUINT nodeindex, GIM_AABB & bound)  const
+	{
+		m_box_tree.getNodeBound(nodeindex, bound);
+	}
+
+	SIMD_FORCE_INLINE void setNodeBound(GUINT nodeindex, const GIM_AABB & bound)
+	{
+		m_box_tree.setNodeBound(nodeindex, bound);
+	}
+
+	SIMD_FORCE_INLINE GUINT getLeftNodeIndex(GUINT nodeindex) const
+	{
+		return m_box_tree.getLeftNodeIndex(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE GUINT getRightNodeIndex(GUINT nodeindex) const
+	{
+		return m_box_tree.getRightNodeIndex(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE GUINT getScapeNodeIndex(GUINT nodeindex) const
+	{
+		return m_box_tree.getScapeNodeIndex(nodeindex);
+	}
+
+	SIMD_FORCE_INLINE void getNodeTriangle(GUINT nodeindex,GIM_TRIANGLE & triangle) const
+	{
+		m_primitive_manager.get_primitive_triangle(getNodeData(nodeindex),triangle);
+	}
+
+};
+
+//! Class for Box Tree Sets
+/*!
+this has the GIM_BOX_TREE implementation for bounding boxes.
+*/
+template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE>
+class GIM_BOX_TREE_SET: public GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, GIM_BOX_TREE>
+{
+public:
+
+};
+
+
+
+
+
+/// GIM_BOX_SET collision methods
+template<typename BOX_SET_CLASS0,typename BOX_SET_CLASS1>
+class GIM_TREE_TREE_COLLIDER
+{
+public:
+	gim_pair_set * m_collision_pairs;
+	BOX_SET_CLASS0 * m_boxset0;
+	BOX_SET_CLASS1 * m_boxset1;
+	GUINT current_node0;
+	GUINT current_node1;
+	bool node0_is_leaf;
+	bool node1_is_leaf;
+	bool t0_is_trimesh;
+	bool t1_is_trimesh;
+	bool node0_has_triangle;
+	bool node1_has_triangle;
+	GIM_AABB m_box0;
+	GIM_AABB m_box1;
+	GIM_BOX_BOX_TRANSFORM_CACHE trans_cache_1to0;
+	btTransform trans_cache_0to1;
+	GIM_TRIANGLE m_tri0;
+	btVector4 m_tri0_plane;
+	GIM_TRIANGLE m_tri1;
+	btVector4 m_tri1_plane;
+
+
+public:
+	GIM_TREE_TREE_COLLIDER()
+	{
+		current_node0 = G_UINT_INFINITY;
+		current_node1 = G_UINT_INFINITY;
+	}
+protected:
+	SIMD_FORCE_INLINE void retrieve_node0_triangle(GUINT node0)
+	{
+		if(node0_has_triangle) return;
+		m_boxset0->getNodeTriangle(node0,m_tri0);
+		//transform triangle
+		m_tri0.m_vertices[0] = trans_cache_0to1(m_tri0.m_vertices[0]);
+		m_tri0.m_vertices[1] = trans_cache_0to1(m_tri0.m_vertices[1]);
+		m_tri0.m_vertices[2] = trans_cache_0to1(m_tri0.m_vertices[2]);
+		m_tri0.get_plane(m_tri0_plane);
+
+		node0_has_triangle = true;
+	}
+
+	SIMD_FORCE_INLINE void retrieve_node1_triangle(GUINT node1)
+	{
+		if(node1_has_triangle) return;
+		m_boxset1->getNodeTriangle(node1,m_tri1);
+		//transform triangle
+		m_tri1.m_vertices[0] = trans_cache_1to0.transform(m_tri1.m_vertices[0]);
+		m_tri1.m_vertices[1] = trans_cache_1to0.transform(m_tri1.m_vertices[1]);
+		m_tri1.m_vertices[2] = trans_cache_1to0.transform(m_tri1.m_vertices[2]);
+		m_tri1.get_plane(m_tri1_plane);
+
+		node1_has_triangle = true;
+	}
+
+	SIMD_FORCE_INLINE void retrieve_node0_info(GUINT node0)
+	{
+		if(node0 == current_node0) return;
+		m_boxset0->getNodeBound(node0,m_box0);
+		node0_is_leaf = m_boxset0->isLeafNode(node0);
+		node0_has_triangle = false;
+		current_node0 = node0;
+	}
+
+	SIMD_FORCE_INLINE void retrieve_node1_info(GUINT node1)
+	{
+		if(node1 == current_node1) return;
+		m_boxset1->getNodeBound(node1,m_box1);
+		node1_is_leaf = m_boxset1->isLeafNode(node1);
+		node1_has_triangle = false;
+		current_node1 = node1;
+	}
+
+	SIMD_FORCE_INLINE bool node_collision(GUINT node0 ,GUINT node1)
+	{
+		retrieve_node0_info(node0);
+		retrieve_node1_info(node1);
+		bool result = m_box0.overlapping_trans_cache(m_box1,trans_cache_1to0,true);
+		if(!result) return false;
+
+		if(t0_is_trimesh && node0_is_leaf)
+		{
+			//perform primitive vs box collision
+			retrieve_node0_triangle(node0);
+			//do triangle vs box collision
+			m_box1.increment_margin(m_tri0.m_margin);
+
+			result = m_box1.collide_triangle_exact(
+				m_tri0.m_vertices[0],m_tri0.m_vertices[1],m_tri0.m_vertices[2],m_tri0_plane);
+
+			m_box1.increment_margin(-m_tri0.m_margin);
+
+			if(!result) return false;
+			return true;
+		}
+		else if(t1_is_trimesh && node1_is_leaf)
+		{
+			//perform primitive vs box collision
+			retrieve_node1_triangle(node1);
+			//do triangle vs box collision
+			m_box0.increment_margin(m_tri1.m_margin);
+
+			result = m_box0.collide_triangle_exact(
+				m_tri1.m_vertices[0],m_tri1.m_vertices[1],m_tri1.m_vertices[2],m_tri1_plane);
+
+			m_box0.increment_margin(-m_tri1.m_margin);
+
+			if(!result) return false;
+			return true;
+		}
+		return true;
+	}
+
+	//stackless collision routine
+	void find_collision_pairs()
+	{
+		gim_pair_set stack_collisions;
+		stack_collisions.reserve(32);
+
+		//add the first pair
+		stack_collisions.push_pair(0,0);
+
+
+		while(stack_collisions.size())
+		{
+			//retrieve the last pair and pop
+			GUINT node0 = stack_collisions.back().m_index1;
+			GUINT node1 = stack_collisions.back().m_index2;
+			stack_collisions.pop_back();
+			if(node_collision(node0,node1)) // a collision is found
+			{
+				if(node0_is_leaf)
+				{
+					if(node1_is_leaf)
+					{
+						m_collision_pairs->push_pair(m_boxset0->getNodeData(node0),m_boxset1->getNodeData(node1));
+					}
+					else
+					{
+						//collide left
+						stack_collisions.push_pair(node0,m_boxset1->getLeftNodeIndex(node1));
+
+						//collide right
+						stack_collisions.push_pair(node0,m_boxset1->getRightNodeIndex(node1));
+					}
+				}
+				else
+				{
+					if(node1_is_leaf)
+					{
+						//collide left
+						stack_collisions.push_pair(m_boxset0->getLeftNodeIndex(node0),node1);
+						//collide right
+						stack_collisions.push_pair(m_boxset0->getRightNodeIndex(node0),node1);
+					}
+					else
+					{
+						GUINT left0 = m_boxset0->getLeftNodeIndex(node0);
+						GUINT right0 = m_boxset0->getRightNodeIndex(node0);
+						GUINT left1 = m_boxset1->getLeftNodeIndex(node1);
+						GUINT right1 = m_boxset1->getRightNodeIndex(node1);
+						//collide left
+						stack_collisions.push_pair(left0,left1);
+						//collide right
+						stack_collisions.push_pair(left0,right1);
+						//collide left
+						stack_collisions.push_pair(right0,left1);
+						//collide right
+						stack_collisions.push_pair(right0,right1);
+
+					}// else if node1 is not a leaf
+				}// else if node0 is not a leaf
+
+			}// if(node_collision(node0,node1))
+		}//while(stack_collisions.size())
+	}
+public:
+	void find_collision(BOX_SET_CLASS0 * boxset1, const btTransform & trans1,
+		BOX_SET_CLASS1 * boxset2, const btTransform & trans2,
+		gim_pair_set & collision_pairs, bool complete_primitive_tests = true)
+	{
+		m_collision_pairs = &collision_pairs;
+		m_boxset0 = boxset1;
+		m_boxset1 = boxset2;
+
+		trans_cache_1to0.calc_from_homogenic(trans1,trans2);
+
+		trans_cache_0to1 =  trans2.inverse();
+		trans_cache_0to1 *= trans1;
+
+
+		if(complete_primitive_tests)
+		{
+			t0_is_trimesh = boxset1->getPrimitiveManager().is_trimesh();
+			t1_is_trimesh = boxset2->getPrimitiveManager().is_trimesh();
+		}
+		else
+		{
+			t0_is_trimesh = false;
+			t1_is_trimesh = false;
+		}
+
+		find_collision_pairs();
+	}
+};
+
+
+#endif // GIM_BOXPRUNING_H_INCLUDED
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_clip_polygon.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_clip_polygon.h
new file mode 100644
index 0000000..e342459
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_clip_polygon.h
@@ -0,0 +1,210 @@
+#ifndef GIM_CLIP_POLYGON_H_INCLUDED
+#define GIM_CLIP_POLYGON_H_INCLUDED
+
+/*! \file gim_tri_collision.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+
+//! This function calcs the distance from a 3D plane
+class DISTANCE_PLANE_3D_FUNC
+{
+public:
+	template<typename CLASS_POINT,typename CLASS_PLANE>
+	inline GREAL operator()(const CLASS_PLANE & plane, const CLASS_POINT & point)
+	{
+		return DISTANCE_PLANE_POINT(plane, point);
+	}
+};
+
+
+
+template<typename CLASS_POINT>
+SIMD_FORCE_INLINE void PLANE_CLIP_POLYGON_COLLECT(
+						const CLASS_POINT & point0,
+						const CLASS_POINT & point1,
+						GREAL dist0,
+						GREAL dist1,
+						CLASS_POINT * clipped,
+						GUINT & clipped_count)
+{
+	GUINT _prevclassif = (dist0>G_EPSILON);
+	GUINT _classif = (dist1>G_EPSILON);
+	if(_classif!=_prevclassif)
+	{
+		GREAL blendfactor = -dist0/(dist1-dist0);
+		VEC_BLEND(clipped[clipped_count],point0,point1,blendfactor);
+		clipped_count++;
+	}
+	if(!_classif)
+	{
+		VEC_COPY(clipped[clipped_count],point1);
+		clipped_count++;
+	}
+}
+
+
+//! Clips a polygon by a plane
+/*!
+*\return The count of the clipped counts
+*/
+template<typename CLASS_POINT,typename CLASS_PLANE, typename DISTANCE_PLANE_FUNC>
+SIMD_FORCE_INLINE GUINT PLANE_CLIP_POLYGON_GENERIC(
+						const CLASS_PLANE & plane,
+						const CLASS_POINT * polygon_points,
+						GUINT polygon_point_count,
+						CLASS_POINT * clipped,DISTANCE_PLANE_FUNC distance_func)
+{
+    GUINT clipped_count = 0;
+
+
+    //clip first point
+	GREAL firstdist = distance_func(plane,polygon_points[0]);;
+	if(!(firstdist>G_EPSILON))
+	{
+		VEC_COPY(clipped[clipped_count],polygon_points[0]);
+		clipped_count++;
+	}
+
+	GREAL olddist = firstdist;
+	for(GUINT _i=1;_i<polygon_point_count;_i++)
+	{		
+		GREAL dist = distance_func(plane,polygon_points[_i]);
+
+		PLANE_CLIP_POLYGON_COLLECT(
+						polygon_points[_i-1],polygon_points[_i],
+						olddist,
+						dist,
+						clipped,
+						clipped_count);
+
+
+		olddist = dist;		
+	}
+
+	//RETURN TO FIRST  point	
+
+	PLANE_CLIP_POLYGON_COLLECT(
+					polygon_points[polygon_point_count-1],polygon_points[0],
+					olddist,
+					firstdist,
+					clipped,
+					clipped_count);
+
+	return clipped_count;
+}
+
+//! Clips a polygon by a plane
+/*!
+*\return The count of the clipped counts
+*/
+template<typename CLASS_POINT,typename CLASS_PLANE, typename DISTANCE_PLANE_FUNC>
+SIMD_FORCE_INLINE GUINT PLANE_CLIP_TRIANGLE_GENERIC(
+						const CLASS_PLANE & plane,
+						const CLASS_POINT & point0,
+						const CLASS_POINT & point1,
+						const CLASS_POINT & point2,
+						CLASS_POINT * clipped,DISTANCE_PLANE_FUNC distance_func)
+{
+    GUINT clipped_count = 0;
+
+    //clip first point
+	GREAL firstdist = distance_func(plane,point0);;
+	if(!(firstdist>G_EPSILON))
+	{
+		VEC_COPY(clipped[clipped_count],point0);
+		clipped_count++;
+	}
+
+	// point 1
+	GREAL olddist = firstdist;
+	GREAL dist = distance_func(plane,point1);
+
+	PLANE_CLIP_POLYGON_COLLECT(
+					point0,point1,
+					olddist,
+					dist,
+					clipped,
+					clipped_count);
+
+	olddist = dist;
+
+
+	// point 2
+	dist = distance_func(plane,point2);
+
+	PLANE_CLIP_POLYGON_COLLECT(
+					point1,point2,
+					olddist,
+					dist,
+					clipped,
+					clipped_count);
+	olddist = dist;
+
+
+
+	//RETURN TO FIRST  point
+	PLANE_CLIP_POLYGON_COLLECT(
+					point2,point0,
+					olddist,
+					firstdist,
+					clipped,
+					clipped_count);
+
+	return clipped_count;
+}
+
+
+template<typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE GUINT PLANE_CLIP_POLYGON3D(
+						const CLASS_PLANE & plane,
+						const CLASS_POINT * polygon_points,
+						GUINT polygon_point_count,
+						CLASS_POINT * clipped)
+{
+	return PLANE_CLIP_POLYGON_GENERIC<CLASS_POINT,CLASS_PLANE>(plane,polygon_points,polygon_point_count,clipped,DISTANCE_PLANE_3D_FUNC());
+}
+
+
+template<typename CLASS_POINT,typename CLASS_PLANE>
+SIMD_FORCE_INLINE GUINT PLANE_CLIP_TRIANGLE3D(
+						const CLASS_PLANE & plane,
+						const CLASS_POINT & point0,
+						const CLASS_POINT & point1,
+						const CLASS_POINT & point2,
+						CLASS_POINT * clipped)
+{
+	return PLANE_CLIP_TRIANGLE_GENERIC<CLASS_POINT,CLASS_PLANE>(plane,point0,point1,point2,clipped,DISTANCE_PLANE_3D_FUNC());
+}
+
+
+
+#endif // GIM_TRI_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.cpp
new file mode 100644
index 0000000..20e41de
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.cpp
@@ -0,0 +1,146 @@
+
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+#include "gim_contact.h"
+
+#define MAX_COINCIDENT 8
+
+void gim_contact_array::merge_contacts(
+	const gim_contact_array & contacts, bool normal_contact_average)
+{
+	clear();
+
+	if(contacts.size()==1)
+	{
+		push_back(contacts.back());
+		return;
+	}
+
+	gim_array<GIM_RSORT_TOKEN> keycontacts(contacts.size());
+	keycontacts.resize(contacts.size(),false);
+
+	//fill key contacts
+
+	GUINT i;
+
+	for (i = 0;i<contacts.size() ;i++ )
+	{
+		keycontacts[i].m_key = contacts[i].calc_key_contact();
+		keycontacts[i].m_value = i;
+	}
+
+	//sort keys
+	gim_heap_sort(keycontacts.pointer(),keycontacts.size(),GIM_RSORT_TOKEN_COMPARATOR());
+
+	// Merge contacts
+
+	GUINT coincident_count=0;
+	btVector3 coincident_normals[MAX_COINCIDENT];
+
+	GUINT last_key = keycontacts[0].m_key;
+	GUINT key = 0;
+
+	push_back(contacts[keycontacts[0].m_value]);
+	GIM_CONTACT * pcontact = &back();
+
+
+
+	for( i=1;i<keycontacts.size();i++)
+	{
+	    key = keycontacts[i].m_key;
+		const GIM_CONTACT * scontact = &contacts[keycontacts[i].m_value];
+
+		if(last_key ==  key)//same points
+		{
+			//merge contact
+			if(pcontact->m_depth - CONTACT_DIFF_EPSILON > scontact->m_depth)//)
+			{
+				*pcontact = *scontact;
+                coincident_count = 0;
+			}
+			else if(normal_contact_average)
+			{
+				if(btFabs(pcontact->m_depth - scontact->m_depth)<CONTACT_DIFF_EPSILON)
+                {
+                    if(coincident_count<MAX_COINCIDENT)
+                    {
+                    	coincident_normals[coincident_count] = scontact->m_normal;
+                        coincident_count++;
+                    }
+                }
+			}
+		}
+		else
+		{//add new contact
+
+		    if(normal_contact_average && coincident_count>0)
+		    {
+		    	pcontact->interpolate_normals(coincident_normals,coincident_count);
+		        coincident_count = 0;
+		    }
+
+		    push_back(*scontact);
+		    pcontact = &back();
+        }
+		last_key = key;
+	}
+}
+
+void gim_contact_array::merge_contacts_unique(const gim_contact_array & contacts)
+{
+	clear();
+
+	if(contacts.size()==1)
+	{
+		push_back(contacts.back());
+		return;
+	}
+
+	GIM_CONTACT average_contact = contacts.back();
+
+	for (GUINT i=1;i<contacts.size() ;i++ )
+	{
+		average_contact.m_point += contacts[i].m_point;
+		average_contact.m_normal += contacts[i].m_normal * contacts[i].m_depth;
+	}
+
+	//divide
+	GREAL divide_average = 1.0f/((GREAL)contacts.size());
+
+	average_contact.m_point *= divide_average;
+
+	average_contact.m_normal *= divide_average;
+
+	average_contact.m_depth = average_contact.m_normal.length();
+
+	average_contact.m_normal /= average_contact.m_depth;
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.h
new file mode 100644
index 0000000..5d9f8ef
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_contact.h
@@ -0,0 +1,164 @@
+#ifndef GIM_CONTACT_H_INCLUDED
+#define GIM_CONTACT_H_INCLUDED
+
+/*! \file gim_contact.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+#include "gim_geometry.h"
+#include "gim_radixsort.h"
+#include "gim_array.h"
+
+
+/**
+Configuration var for applying interpolation of  contact normals
+*/
+#define NORMAL_CONTACT_AVERAGE 1
+#define CONTACT_DIFF_EPSILON 0.00001f
+
+/// Structure for collision results
+///Functions for managing and sorting contacts resulting from a collision query.
+///Contact lists must be create by calling \ref GIM_CREATE_CONTACT_LIST
+///After querys, contact lists must be destroy by calling \ref GIM_DYNARRAY_DESTROY
+///Contacts can be merge for avoid duplicate results by calling \ref gim_merge_contacts
+class GIM_CONTACT
+{
+public:
+    btVector3 m_point;
+    btVector3 m_normal;
+    GREAL m_depth;//Positive value indicates interpenetration
+    GREAL m_distance;//Padding not for use
+    GUINT m_feature1;//Face number
+    GUINT m_feature2;//Face number
+public:
+    GIM_CONTACT()
+    {
+    }
+
+    GIM_CONTACT(const GIM_CONTACT & contact):
+				m_point(contact.m_point),
+				m_normal(contact.m_normal),
+				m_depth(contact.m_depth),
+				m_feature1(contact.m_feature1),
+				m_feature2(contact.m_feature2)
+    {
+    	m_point = contact.m_point;
+    	m_normal = contact.m_normal;
+    	m_depth = contact.m_depth;
+    	m_feature1 = contact.m_feature1;
+    	m_feature2 = contact.m_feature2;
+    }
+
+    GIM_CONTACT(const btVector3 &point,const btVector3 & normal,
+    	 			GREAL depth, GUINT feature1, GUINT feature2):
+				m_point(point),
+				m_normal(normal),
+				m_depth(depth),
+				m_feature1(feature1),
+				m_feature2(feature2)
+    {
+    }
+
+	//! Calcs key for coord classification
+    SIMD_FORCE_INLINE GUINT calc_key_contact() const
+    {
+    	GINT _coords[] = {
+    		(GINT)(m_point[0]*1000.0f+1.0f),
+    		(GINT)(m_point[1]*1333.0f),
+    		(GINT)(m_point[2]*2133.0f+3.0f)};
+		GUINT _hash=0;
+		GUINT *_uitmp = (GUINT *)(&_coords[0]);
+		_hash = *_uitmp;
+		_uitmp++;
+		_hash += (*_uitmp)<<4;
+		_uitmp++;
+		_hash += (*_uitmp)<<8;
+		return _hash;
+    }
+
+    SIMD_FORCE_INLINE void interpolate_normals( btVector3 * normals,GUINT normal_count)
+    {
+    	btVector3 vec_sum(m_normal);
+		for(GUINT i=0;i<normal_count;i++)
+		{
+			vec_sum += normals[i];
+		}
+
+		GREAL vec_sum_len = vec_sum.length2();
+		if(vec_sum_len <CONTACT_DIFF_EPSILON) return;
+
+		GIM_INV_SQRT(vec_sum_len,vec_sum_len); // 1/sqrt(vec_sum_len)
+
+		m_normal = vec_sum*vec_sum_len;
+    }
+
+};
+
+
+class gim_contact_array:public gim_array<GIM_CONTACT>
+{
+public:
+	gim_contact_array():gim_array<GIM_CONTACT>(64)
+	{
+	}
+
+	SIMD_FORCE_INLINE void push_contact(const btVector3 &point,const btVector3 & normal,
+    	 			GREAL depth, GUINT feature1, GUINT feature2)
+	{
+		push_back_mem();
+		GIM_CONTACT & newele = back();
+		newele.m_point = point;
+		newele.m_normal = normal;
+		newele.m_depth = depth;
+		newele.m_feature1 = feature1;
+		newele.m_feature2 = feature2;
+	}
+
+	SIMD_FORCE_INLINE void push_triangle_contacts(
+		const GIM_TRIANGLE_CONTACT_DATA & tricontact,
+		GUINT feature1,GUINT feature2)
+	{
+		for(GUINT i = 0;i<tricontact.m_point_count ;i++ )
+		{
+			push_back_mem();
+			GIM_CONTACT & newele = back();
+			newele.m_point = tricontact.m_points[i];
+			newele.m_normal = tricontact.m_separating_normal;
+			newele.m_depth = tricontact.m_penetration_depth;
+			newele.m_feature1 = feature1;
+			newele.m_feature2 = feature2;
+		}
+	}
+
+	void merge_contacts(const gim_contact_array & contacts, bool normal_contact_average = true);
+	void merge_contacts_unique(const gim_contact_array & contacts);
+};
+
+#endif // GIM_CONTACT_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geom_types.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geom_types.h
new file mode 100644
index 0000000..6b8f9ea
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geom_types.h
@@ -0,0 +1,97 @@
+#ifndef GIM_GEOM_TYPES_H_INCLUDED
+#define GIM_GEOM_TYPES_H_INCLUDED
+
+/*! \file gim_geom_types.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+
+#include "gim_math.h"
+
+
+
+//! Short Integer vector 2D
+typedef GSHORT vec2s[2];
+//! Integer vector 3D
+typedef GSHORT vec3s[3];
+//! Integer vector 4D
+typedef GSHORT vec4s[4];
+
+//! Short Integer vector 2D
+typedef GUSHORT vec2us[2];
+//! Integer vector 3D
+typedef GUSHORT vec3us[3];
+//! Integer vector 4D
+typedef GUSHORT vec4us[4];
+
+//! Integer vector 2D
+typedef GINT vec2i[2];
+//! Integer vector 3D
+typedef GINT vec3i[3];
+//! Integer vector 4D
+typedef GINT vec4i[4];
+
+//! Unsigned Integer vector 2D
+typedef GUINT vec2ui[2];
+//! Unsigned Integer vector 3D
+typedef GUINT vec3ui[3];
+//! Unsigned Integer vector 4D
+typedef GUINT vec4ui[4];
+
+//! Float vector 2D
+typedef GREAL vec2f[2];
+//! Float vector 3D
+typedef GREAL vec3f[3];
+//! Float vector 4D
+typedef GREAL vec4f[4];
+
+//! Double vector 2D
+typedef GREAL2 vec2d[2];
+//! Float vector 3D
+typedef GREAL2 vec3d[3];
+//! Float vector 4D
+typedef GREAL2 vec4d[4];
+
+//! Matrix 2D, row ordered
+typedef GREAL mat2f[2][2];
+//! Matrix 3D, row ordered
+typedef GREAL mat3f[3][3];
+//! Matrix 4D, row ordered
+typedef GREAL mat4f[4][4];
+
+//! Quaternion
+typedef GREAL quatf[4];
+
+//typedef struct _aabb3f aabb3f;
+
+
+
+#endif // GIM_GEOM_TYPES_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geometry.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geometry.h
new file mode 100644
index 0000000..c67a699
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_geometry.h
@@ -0,0 +1,42 @@
+#ifndef GIM_GEOMETRY_H_INCLUDED
+#define GIM_GEOMETRY_H_INCLUDED
+
+/*! \file gim_geometry.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+///Additional Headers for Collision
+#include "gim_basic_geometry_operations.h"
+#include "gim_clip_polygon.h"
+#include "gim_box_collision.h"
+#include "gim_tri_collision.h"
+
+#endif // GIM_VECTOR_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_hash_table.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_hash_table.h
new file mode 100644
index 0000000..e4237c2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_hash_table.h
@@ -0,0 +1,902 @@
+#ifndef GIM_HASH_TABLE_H_INCLUDED
+#define GIM_HASH_TABLE_H_INCLUDED
+/*! \file gim_trimesh_data.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+#include "gim_radixsort.h"
+
+
+#define GIM_INVALID_HASH 0xffffffff //!< A very very high value
+#define GIM_DEFAULT_HASH_TABLE_SIZE 380
+#define GIM_DEFAULT_HASH_TABLE_NODE_SIZE 4
+#define GIM_HASH_TABLE_GROW_FACTOR 2
+
+#define GIM_MIN_RADIX_SORT_SIZE 860 //!< calibrated on a PIII
+
+template<typename T>
+struct GIM_HASH_TABLE_NODE
+{
+    GUINT m_key;
+    T m_data;
+    GIM_HASH_TABLE_NODE()
+    {
+    }
+
+    GIM_HASH_TABLE_NODE(const GIM_HASH_TABLE_NODE & value)
+    {
+        m_key = value.m_key;
+        m_data = value.m_data;
+    }
+
+    GIM_HASH_TABLE_NODE(GUINT key, const T & data)
+    {
+        m_key = key;
+        m_data = data;
+    }
+
+    bool operator <(const GIM_HASH_TABLE_NODE<T> & other) const
+	{
+		///inverse order, further objects are first
+		if(m_key <  other.m_key) return true;
+		return false;
+	}
+
+	bool operator >(const GIM_HASH_TABLE_NODE<T> & other) const
+	{
+		///inverse order, further objects are first
+		if(m_key >  other.m_key) return true;
+		return false;
+	}
+
+	bool operator ==(const GIM_HASH_TABLE_NODE<T> & other) const
+	{
+		///inverse order, further objects are first
+		if(m_key ==  other.m_key) return true;
+		return false;
+	}
+};
+
+///Macro for getting the key
+class GIM_HASH_NODE_GET_KEY
+{
+public:
+	template<class T>
+	inline GUINT operator()( const T& a)
+	{
+		return a.m_key;
+	}
+};
+
+
+
+///Macro for comparing the key and the element
+class GIM_HASH_NODE_CMP_KEY_MACRO
+{
+public:
+	template<class T>
+	inline int operator() ( const T& a, GUINT key)
+	{
+		return ((int)(a.m_key - key));
+	}
+};
+
+///Macro for comparing Hash nodes
+class GIM_HASH_NODE_CMP_MACRO
+{
+public:
+	template<class T>
+	inline int operator() ( const T& a, const T& b )
+	{
+		return ((int)(a.m_key - b.m_key));
+	}
+};
+
+
+
+
+
+//! Sorting for hash table
+/*!
+switch automatically between quicksort and radixsort
+*/
+template<typename T>
+void gim_sort_hash_node_array(T * array, GUINT array_count)
+{
+    if(array_count<GIM_MIN_RADIX_SORT_SIZE)
+    {
+    	gim_heap_sort(array,array_count,GIM_HASH_NODE_CMP_MACRO());
+    }
+    else
+    {
+    	memcopy_elements_func cmpfunc;
+    	gim_radix_sort(array,array_count,GIM_HASH_NODE_GET_KEY(),cmpfunc);
+    }
+}
+
+
+
+
+
+
+// Note: assumes long is at least 32 bits.
+#define GIM_NUM_PRIME 28
+
+static const GUINT gim_prime_list[GIM_NUM_PRIME] =
+{
+  53ul,         97ul,         193ul,       389ul,       769ul,
+  1543ul,       3079ul,       6151ul,      12289ul,     24593ul,
+  49157ul,      98317ul,      196613ul,    393241ul,    786433ul,
+  1572869ul,    3145739ul,    6291469ul,   12582917ul,  25165843ul,
+  50331653ul,   100663319ul,  201326611ul, 402653189ul, 805306457ul,
+  1610612741ul, 3221225473ul, 4294967291ul
+};
+
+inline GUINT gim_next_prime(GUINT number)
+{
+    //Find nearest upper prime
+    GUINT result_ind = 0;
+    gim_binary_search(gim_prime_list,0,(GIM_NUM_PRIME-2),number,result_ind);
+
+    // inv: result_ind < 28
+    return gim_prime_list[result_ind];
+}
+
+
+
+//! A compact hash table implementation
+/*!
+A memory aligned compact hash table that coud be treated as an array.
+It could be a simple sorted array without the overhead of the hash key bucked, or could
+be a formely hash table with an array of keys.
+You can use switch_to_hashtable() and switch_to_sorted_array for saving space or increase speed.
+</br>
+
+<ul>
+<li> if node_size = 0, then this container becomes a simple sorted array allocator. reserve_size is used for reserve memory in m_nodes.
+When the array size reaches the size equivalent to 'min_hash_table_size', then it becomes a hash table by calling check_for_switching_to_hashtable.
+<li> If node_size != 0, then this container becomes a hash table for ever
+</ul>
+
+*/
+template<class T>
+class gim_hash_table
+{
+protected:
+    typedef GIM_HASH_TABLE_NODE<T> _node_type;
+
+    //!The nodes
+    //array< _node_type, SuperAllocator<_node_type> > m_nodes;
+    gim_array< _node_type > m_nodes;
+    //SuperBufferedArray< _node_type > m_nodes;
+    bool m_sorted;
+
+    ///Hash table data management. The hash table has the indices to the corresponding m_nodes array
+    GUINT * m_hash_table;//!<
+    GUINT m_table_size;//!<
+    GUINT m_node_size;//!<
+    GUINT m_min_hash_table_size;
+
+
+
+    //! Returns the cell index
+    inline GUINT _find_cell(GUINT hashkey)
+    {
+        _node_type * nodesptr = m_nodes.pointer();
+        GUINT start_index = (hashkey%m_table_size)*m_node_size;
+        GUINT end_index = start_index + m_node_size;
+
+        while(start_index<end_index)
+        {
+            GUINT value = m_hash_table[start_index];
+            if(value != GIM_INVALID_HASH)
+            {
+                if(nodesptr[value].m_key == hashkey) return start_index;
+            }
+            start_index++;
+        }
+        return GIM_INVALID_HASH;
+    }
+
+    //! Find the avaliable cell for the hashkey, and return an existing cell if it has the same hash key
+    inline GUINT _find_avaliable_cell(GUINT hashkey)
+    {
+        _node_type * nodesptr = m_nodes.pointer();
+        GUINT avaliable_index = GIM_INVALID_HASH;
+        GUINT start_index = (hashkey%m_table_size)*m_node_size;
+        GUINT end_index = start_index + m_node_size;
+
+        while(start_index<end_index)
+        {
+            GUINT value = m_hash_table[start_index];
+            if(value == GIM_INVALID_HASH)
+            {
+                if(avaliable_index==GIM_INVALID_HASH)
+                {
+                    avaliable_index = start_index;
+                }
+            }
+            else if(nodesptr[value].m_key == hashkey)
+            {
+                return start_index;
+            }
+            start_index++;
+        }
+        return avaliable_index;
+    }
+
+
+
+    //! reserves the memory for the hash table.
+    /*!
+    \pre hash table must be empty
+    \post reserves the memory for the hash table, an initializes all elements to GIM_INVALID_HASH.
+    */
+    inline void _reserve_table_memory(GUINT newtablesize)
+    {
+        if(newtablesize==0) return;
+        if(m_node_size==0) return;
+
+        //Get a Prime size
+
+        m_table_size = gim_next_prime(newtablesize);
+
+        GUINT datasize = m_table_size*m_node_size;
+        //Alloc the data buffer
+        m_hash_table =  (GUINT *)gim_alloc(datasize*sizeof(GUINT));
+    }
+
+    inline void _invalidate_keys()
+    {
+        GUINT datasize = m_table_size*m_node_size;
+        for(GUINT i=0;i<datasize;i++)
+        {
+            m_hash_table[i] = GIM_INVALID_HASH;// invalidate keys
+        }
+    }
+
+    //! Clear all memory for the hash table
+    inline void _clear_table_memory()
+    {
+        if(m_hash_table==NULL) return;
+        gim_free(m_hash_table);
+        m_hash_table = NULL;
+        m_table_size = 0;
+    }
+
+    //! Invalidates the keys (Assigning GIM_INVALID_HASH to all) Reorders the hash keys
+    inline void _rehash()
+    {
+        _invalidate_keys();
+
+        _node_type * nodesptr = m_nodes.pointer();
+        for(GUINT i=0;i<(GUINT)m_nodes.size();i++)
+        {
+            GUINT nodekey = nodesptr[i].m_key;
+            if(nodekey != GIM_INVALID_HASH)
+            {
+                //Search for the avaliable cell in buffer
+                GUINT index = _find_avaliable_cell(nodekey);
+
+
+				if(m_hash_table[index]!=GIM_INVALID_HASH)
+				{//The new index is alreade used... discard this new incomming object, repeated key
+				    btAssert(m_hash_table[index]==nodekey);
+					nodesptr[i].m_key = GIM_INVALID_HASH;
+				}
+				else
+				{
+					//;
+					//Assign the value for alloc
+					m_hash_table[index] = i;
+				}
+            }
+        }
+    }
+
+    //! Resize hash table indices
+    inline void _resize_table(GUINT newsize)
+    {
+        //Clear memory
+        _clear_table_memory();
+        //Alloc the data
+        _reserve_table_memory(newsize);
+        //Invalidate keys and rehash
+        _rehash();
+    }
+
+    //! Destroy hash table memory
+    inline void _destroy()
+    {
+        if(m_hash_table==NULL) return;
+        _clear_table_memory();
+    }
+
+    //! Finds an avaliable hash table cell, and resizes the table if there isn't space
+    inline GUINT _assign_hash_table_cell(GUINT hashkey)
+    {
+        GUINT cell_index = _find_avaliable_cell(hashkey);
+
+        if(cell_index==GIM_INVALID_HASH)
+        {
+            //rehashing
+            _resize_table(m_table_size+1);
+            GUINT cell_index = _find_avaliable_cell(hashkey);
+            btAssert(cell_index!=GIM_INVALID_HASH);
+        }
+        return cell_index;
+    }
+
+    //! erase by index in hash table
+    inline bool _erase_by_index_hash_table(GUINT index)
+    {
+        if(index >= m_nodes.size()) return false;
+        if(m_nodes[index].m_key != GIM_INVALID_HASH)
+        {
+            //Search for the avaliable cell in buffer
+            GUINT cell_index = _find_cell(m_nodes[index].m_key);
+
+            btAssert(cell_index!=GIM_INVALID_HASH);
+            btAssert(m_hash_table[cell_index]==index);
+
+            m_hash_table[cell_index] = GIM_INVALID_HASH;
+        }
+
+        return this->_erase_unsorted(index);
+    }
+
+    //! erase by key in hash table
+    inline bool _erase_hash_table(GUINT hashkey)
+    {
+        if(hashkey == GIM_INVALID_HASH) return false;
+
+        //Search for the avaliable cell in buffer
+        GUINT cell_index = _find_cell(hashkey);
+        if(cell_index ==GIM_INVALID_HASH) return false;
+
+        GUINT index = m_hash_table[cell_index];
+        m_hash_table[cell_index] = GIM_INVALID_HASH;
+
+        return this->_erase_unsorted(index);
+    }
+
+
+
+    //! insert an element in hash table
+    /*!
+    If the element exists, this won't insert the element
+    \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted
+    If so, the element has been inserted at the last position of the array.
+    */
+    inline GUINT _insert_hash_table(GUINT hashkey, const T & value)
+    {
+        if(hashkey==GIM_INVALID_HASH)
+        {
+            //Insert anyway
+            _insert_unsorted(hashkey,value);
+            return GIM_INVALID_HASH;
+        }
+
+        GUINT cell_index = _assign_hash_table_cell(hashkey);
+
+        GUINT value_key = m_hash_table[cell_index];
+
+        if(value_key!= GIM_INVALID_HASH) return value_key;// Not overrited
+
+        m_hash_table[cell_index] = m_nodes.size();
+
+        _insert_unsorted(hashkey,value);
+        return GIM_INVALID_HASH;
+    }
+
+    //! insert an element in hash table.
+    /*!
+    If the element exists, this replaces the element.
+    \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted
+    If so, the element has been inserted at the last position of the array.
+    */
+    inline GUINT _insert_hash_table_replace(GUINT hashkey, const T & value)
+    {
+        if(hashkey==GIM_INVALID_HASH)
+        {
+            //Insert anyway
+            _insert_unsorted(hashkey,value);
+            return GIM_INVALID_HASH;
+        }
+
+        GUINT cell_index = _assign_hash_table_cell(hashkey);
+
+        GUINT value_key = m_hash_table[cell_index];
+
+        if(value_key!= GIM_INVALID_HASH)
+        {//replaces the existing
+            m_nodes[value_key] = _node_type(hashkey,value);
+            return value_key;// index of the replaced element
+        }
+
+        m_hash_table[cell_index] = m_nodes.size();
+
+        _insert_unsorted(hashkey,value);
+        return GIM_INVALID_HASH;
+
+    }
+
+    
+    ///Sorted array data management. The hash table has the indices to the corresponding m_nodes array
+    inline bool _erase_sorted(GUINT index)
+    {
+        if(index>=(GUINT)m_nodes.size()) return false;
+        m_nodes.erase_sorted(index);
+		if(m_nodes.size()<2) m_sorted = false;
+        return true;
+    }
+
+    //! faster, but unsorted
+    inline bool _erase_unsorted(GUINT index)
+    {
+        if(index>=m_nodes.size()) return false;
+
+        GUINT lastindex = m_nodes.size()-1;
+        if(index<lastindex && m_hash_table!=0)
+        {
+			GUINT hashkey =  m_nodes[lastindex].m_key;
+			if(hashkey!=GIM_INVALID_HASH)
+			{
+				//update the new position of the last element
+				GUINT cell_index = _find_cell(hashkey);
+				btAssert(cell_index!=GIM_INVALID_HASH);
+				//new position of the last element which will be swaped
+				m_hash_table[cell_index] = index;
+			}
+        }
+        m_nodes.erase(index);
+        m_sorted = false;
+        return true;
+    }
+
+    //! Insert in position ordered
+    /*!
+    Also checks if it is needed to transform this container to a hash table, by calling check_for_switching_to_hashtable
+    */
+    inline void _insert_in_pos(GUINT hashkey, const T & value, GUINT pos)
+    {
+        m_nodes.insert(_node_type(hashkey,value),pos);
+        this->check_for_switching_to_hashtable();
+    }
+
+    //! Insert an element in an ordered array
+    inline GUINT _insert_sorted(GUINT hashkey, const T & value)
+    {
+        if(hashkey==GIM_INVALID_HASH || size()==0)
+        {
+            m_nodes.push_back(_node_type(hashkey,value));
+            return GIM_INVALID_HASH;
+        }
+        //Insert at last position
+        //Sort element
+
+
+        GUINT result_ind=0;
+        GUINT last_index = m_nodes.size()-1;
+        _node_type * ptr = m_nodes.pointer();
+
+        bool found = gim_binary_search_ex(
+        	ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO());
+
+
+        //Insert before found index
+        if(found)
+        {
+            return result_ind;
+        }
+        else
+        {
+            _insert_in_pos(hashkey, value, result_ind);
+        }
+        return GIM_INVALID_HASH;
+    }
+
+    inline GUINT _insert_sorted_replace(GUINT hashkey, const T & value)
+    {
+        if(hashkey==GIM_INVALID_HASH || size()==0)
+        {
+            m_nodes.push_back(_node_type(hashkey,value));
+            return GIM_INVALID_HASH;
+        }
+        //Insert at last position
+        //Sort element
+        GUINT result_ind;
+        GUINT last_index = m_nodes.size()-1;
+        _node_type * ptr = m_nodes.pointer();
+
+        bool found = gim_binary_search_ex(
+        	ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO());
+
+        //Insert before found index
+        if(found)
+        {
+            m_nodes[result_ind] = _node_type(hashkey,value);
+        }
+        else
+        {
+            _insert_in_pos(hashkey, value, result_ind);
+        }
+        return result_ind;
+    }
+
+    //! Fast insertion in m_nodes array
+    inline GUINT  _insert_unsorted(GUINT hashkey, const T & value)
+    {
+        m_nodes.push_back(_node_type(hashkey,value));
+        m_sorted = false;
+        return GIM_INVALID_HASH;
+    }
+
+    
+
+public:
+
+    /*!
+        <li> if node_size = 0, then this container becomes a simple sorted array allocator. reserve_size is used for reserve memory in m_nodes.
+        When the array size reaches the size equivalent to 'min_hash_table_size', then it becomes a hash table by calling check_for_switching_to_hashtable.
+        <li> If node_size != 0, then this container becomes a hash table for ever
+        </ul>
+    */
+    gim_hash_table(GUINT reserve_size = GIM_DEFAULT_HASH_TABLE_SIZE,
+                     GUINT node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE,
+                     GUINT min_hash_table_size = GIM_INVALID_HASH)
+    {
+        m_hash_table = NULL;
+        m_table_size = 0;
+        m_sorted = false;
+        m_node_size = node_size;
+        m_min_hash_table_size = min_hash_table_size;
+
+        if(m_node_size!=0)
+        {
+            if(reserve_size!=0)
+            {
+                m_nodes.reserve(reserve_size);
+                _reserve_table_memory(reserve_size);
+                _invalidate_keys();
+            }
+            else
+            {
+                m_nodes.reserve(GIM_DEFAULT_HASH_TABLE_SIZE);
+                _reserve_table_memory(GIM_DEFAULT_HASH_TABLE_SIZE);
+                _invalidate_keys();
+            }
+        }
+        else if(reserve_size!=0)
+        {
+            m_nodes.reserve(reserve_size);
+        }
+
+    }
+
+    ~gim_hash_table()
+    {
+        _destroy();
+    }
+
+    inline bool is_hash_table()
+    {
+        if(m_hash_table) return true;
+        return false;
+    }
+
+    inline bool is_sorted()
+    {
+        if(size()<2) return true;
+        return m_sorted;
+    }
+
+    bool sort()
+    {
+        if(is_sorted()) return true;
+        if(m_nodes.size()<2) return false;
+
+
+        _node_type * ptr = m_nodes.pointer();
+        GUINT siz = m_nodes.size();
+        gim_sort_hash_node_array(ptr,siz);
+        m_sorted=true;
+
+
+
+        if(m_hash_table)
+        {
+            _rehash();
+        }
+        return true;
+    }
+
+    bool switch_to_hashtable()
+    {
+        if(m_hash_table) return false;
+        if(m_node_size==0) m_node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE;
+        if(m_nodes.size()<GIM_DEFAULT_HASH_TABLE_SIZE)
+        {
+            _resize_table(GIM_DEFAULT_HASH_TABLE_SIZE);
+        }
+        else
+        {
+            _resize_table(m_nodes.size()+1);
+        }
+
+        return true;
+    }
+
+    bool switch_to_sorted_array()
+    {
+        if(m_hash_table==NULL) return true;
+        _clear_table_memory();
+        return sort();
+    }
+
+    //!If the container reaches the
+    bool check_for_switching_to_hashtable()
+    {
+        if(this->m_hash_table) return true;
+
+        if(!(m_nodes.size()< m_min_hash_table_size))
+        {
+            if(m_node_size == 0)
+            {
+                m_node_size = GIM_DEFAULT_HASH_TABLE_NODE_SIZE;
+            }
+
+            _resize_table(m_nodes.size()+1);
+            return true;
+        }
+        return false;
+    }
+
+    inline void set_sorted(bool value)
+    {
+    	m_sorted = value;
+    }
+
+    //! Retrieves the amount of keys.
+    inline GUINT size() const
+    {
+        return m_nodes.size();
+    }
+
+    //! Retrieves the hash key.
+    inline GUINT get_key(GUINT index) const
+    {
+        return m_nodes[index].m_key;
+    }
+
+    //! Retrieves the value by index
+    /*!
+    */
+    inline T * get_value_by_index(GUINT index)
+    {
+        return &m_nodes[index].m_data;
+    }
+
+    inline const T& operator[](GUINT index) const
+    {
+        return m_nodes[index].m_data;
+    }
+
+    inline T& operator[](GUINT index)
+    {
+        return m_nodes[index].m_data;
+    }
+
+    //! Finds the index of the element with the key
+    /*!
+    \return the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted
+    If so, the element has been inserted at the last position of the array.
+    */
+    inline GUINT find(GUINT hashkey)
+    {
+        if(m_hash_table)
+        {
+            GUINT cell_index = _find_cell(hashkey);
+            if(cell_index==GIM_INVALID_HASH) return GIM_INVALID_HASH;
+            return m_hash_table[cell_index];
+        }
+		GUINT last_index = m_nodes.size();
+        if(last_index<2)
+        {
+			if(last_index==0) return GIM_INVALID_HASH;
+            if(m_nodes[0].m_key == hashkey) return 0;
+            return GIM_INVALID_HASH;
+        }
+        else if(m_sorted)
+        {
+            //Binary search
+            GUINT result_ind = 0;
+			last_index--;
+            _node_type *  ptr =  m_nodes.pointer();
+
+            bool found = gim_binary_search_ex(ptr,0,last_index,result_ind,hashkey,GIM_HASH_NODE_CMP_KEY_MACRO());
+
+
+            if(found) return result_ind;
+        }
+        return GIM_INVALID_HASH;
+    }
+
+    //! Retrieves the value associated with the index
+    /*!
+    \return the found element, or null
+    */
+    inline T * get_value(GUINT hashkey)
+    {
+        GUINT index = find(hashkey);
+        if(index == GIM_INVALID_HASH) return NULL;
+        return &m_nodes[index].m_data;
+    }
+
+
+    /*!
+    */
+    inline bool erase_by_index(GUINT index)
+    {
+        if(index > m_nodes.size()) return false;
+
+        if(m_hash_table == NULL)
+        {
+            if(is_sorted())
+            {
+                return this->_erase_sorted(index);
+            }
+            else
+            {
+                return this->_erase_unsorted(index);
+            }
+        }
+        else
+        {
+            return this->_erase_by_index_hash_table(index);
+        }
+        return false;
+    }
+
+
+
+    inline bool erase_by_index_unsorted(GUINT index)
+    {
+        if(index > m_nodes.size()) return false;
+
+        if(m_hash_table == NULL)
+        {
+            return this->_erase_unsorted(index);
+        }
+        else
+        {
+            return this->_erase_by_index_hash_table(index);
+        }
+        return false;
+    }
+
+
+
+    /*!
+
+    */
+    inline bool erase_by_key(GUINT hashkey)
+    {
+        if(size()==0) return false;
+
+        if(m_hash_table)
+        {
+            return this->_erase_hash_table(hashkey);
+        }
+        //Binary search
+
+        if(is_sorted()==false) return false;
+
+        GUINT result_ind = find(hashkey);
+        if(result_ind!= GIM_INVALID_HASH)
+        {
+            return this->_erase_sorted(result_ind);
+        }
+        return false;
+    }
+
+    void clear()
+    {
+        m_nodes.clear();
+
+        if(m_hash_table==NULL) return;
+        GUINT datasize = m_table_size*m_node_size;
+        //Initialize the hashkeys.
+        GUINT i;
+        for(i=0;i<datasize;i++)
+        {
+            m_hash_table[i] = GIM_INVALID_HASH;// invalidate keys
+        }
+		m_sorted = false;
+    }
+
+    //! Insert an element into the hash
+    /*!
+    \return If GIM_INVALID_HASH, the object has been inserted succesfully. Else it returns the position
+    of the existing element.
+    */
+    inline GUINT insert(GUINT hashkey, const T & element)
+    {
+        if(m_hash_table)
+        {
+            return this->_insert_hash_table(hashkey,element);
+        }
+        if(this->is_sorted())
+        {
+            return this->_insert_sorted(hashkey,element);
+        }
+        return this->_insert_unsorted(hashkey,element);
+    }
+
+    //! Insert an element into the hash, and could overrite an existing object with the same hash.
+    /*!
+    \return If GIM_INVALID_HASH, the object has been inserted succesfully. Else it returns the position
+    of the replaced element.
+    */
+    inline GUINT insert_override(GUINT hashkey, const T & element)
+    {
+        if(m_hash_table)
+        {
+            return this->_insert_hash_table_replace(hashkey,element);
+        }
+        if(this->is_sorted())
+        {
+            return this->_insert_sorted_replace(hashkey,element);
+        }
+        this->_insert_unsorted(hashkey,element);
+        return m_nodes.size();
+    }
+
+
+
+    //! Insert an element into the hash,But if this container is a sorted array, this inserts it unsorted
+    /*!
+    */
+    inline GUINT insert_unsorted(GUINT hashkey,const T & element)
+    {
+        if(m_hash_table)
+        {
+            return this->_insert_hash_table(hashkey,element);
+        }
+        return this->_insert_unsorted(hashkey,element);
+    }
+
+
+};
+
+
+
+#endif // GIM_CONTAINERS_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_linear_math.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_linear_math.h
new file mode 100644
index 0000000..64f11b4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_linear_math.h
@@ -0,0 +1,1573 @@
+#ifndef GIM_LINEAR_H_INCLUDED
+#define GIM_LINEAR_H_INCLUDED
+
+/*! \file gim_linear_math.h
+*\author Francisco Leon Najera
+Type Independant Vector and matrix operations.
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+
+#include "gim_math.h"
+#include "gim_geom_types.h"
+
+
+
+
+//! Zero out a 2D vector
+#define VEC_ZERO_2(a)				\
+{						\
+   (a)[0] = (a)[1] = 0.0f;			\
+}\
+
+
+//! Zero out a 3D vector
+#define VEC_ZERO(a)				\
+{						\
+   (a)[0] = (a)[1] = (a)[2] = 0.0f;		\
+}\
+
+
+/// Zero out a 4D vector
+#define VEC_ZERO_4(a)				\
+{						\
+   (a)[0] = (a)[1] = (a)[2] = (a)[3] = 0.0f;	\
+}\
+
+
+/// Vector copy
+#define VEC_COPY_2(b,a)				\
+{						\
+   (b)[0] = (a)[0];				\
+   (b)[1] = (a)[1];				\
+}\
+
+
+/// Copy 3D vector
+#define VEC_COPY(b,a)				\
+{						\
+   (b)[0] = (a)[0];				\
+   (b)[1] = (a)[1];				\
+   (b)[2] = (a)[2];				\
+}\
+
+
+/// Copy 4D vector
+#define VEC_COPY_4(b,a)				\
+{						\
+   (b)[0] = (a)[0];				\
+   (b)[1] = (a)[1];				\
+   (b)[2] = (a)[2];				\
+   (b)[3] = (a)[3];				\
+}\
+
+/// VECTOR SWAP
+#define VEC_SWAP(b,a)				\
+{  \
+    GIM_SWAP_NUMBERS((b)[0],(a)[0]);\
+    GIM_SWAP_NUMBERS((b)[1],(a)[1]);\
+    GIM_SWAP_NUMBERS((b)[2],(a)[2]);\
+}\
+
+/// Vector difference
+#define VEC_DIFF_2(v21,v2,v1)			\
+{						\
+   (v21)[0] = (v2)[0] - (v1)[0];		\
+   (v21)[1] = (v2)[1] - (v1)[1];		\
+}\
+
+
+/// Vector difference
+#define VEC_DIFF(v21,v2,v1)			\
+{						\
+   (v21)[0] = (v2)[0] - (v1)[0];		\
+   (v21)[1] = (v2)[1] - (v1)[1];		\
+   (v21)[2] = (v2)[2] - (v1)[2];		\
+}\
+
+
+/// Vector difference
+#define VEC_DIFF_4(v21,v2,v1)			\
+{						\
+   (v21)[0] = (v2)[0] - (v1)[0];		\
+   (v21)[1] = (v2)[1] - (v1)[1];		\
+   (v21)[2] = (v2)[2] - (v1)[2];		\
+   (v21)[3] = (v2)[3] - (v1)[3];		\
+}\
+
+
+/// Vector sum
+#define VEC_SUM_2(v21,v2,v1)			\
+{						\
+   (v21)[0] = (v2)[0] + (v1)[0];		\
+   (v21)[1] = (v2)[1] + (v1)[1];		\
+}\
+
+
+/// Vector sum
+#define VEC_SUM(v21,v2,v1)			\
+{						\
+   (v21)[0] = (v2)[0] + (v1)[0];		\
+   (v21)[1] = (v2)[1] + (v1)[1];		\
+   (v21)[2] = (v2)[2] + (v1)[2];		\
+}\
+
+
+/// Vector sum
+#define VEC_SUM_4(v21,v2,v1)			\
+{						\
+   (v21)[0] = (v2)[0] + (v1)[0];		\
+   (v21)[1] = (v2)[1] + (v1)[1];		\
+   (v21)[2] = (v2)[2] + (v1)[2];		\
+   (v21)[3] = (v2)[3] + (v1)[3];		\
+}\
+
+
+/// scalar times vector
+#define VEC_SCALE_2(c,a,b)			\
+{						\
+   (c)[0] = (a)*(b)[0];				\
+   (c)[1] = (a)*(b)[1];				\
+}\
+
+
+/// scalar times vector
+#define VEC_SCALE(c,a,b)			\
+{						\
+   (c)[0] = (a)*(b)[0];				\
+   (c)[1] = (a)*(b)[1];				\
+   (c)[2] = (a)*(b)[2];				\
+}\
+
+
+/// scalar times vector
+#define VEC_SCALE_4(c,a,b)			\
+{						\
+   (c)[0] = (a)*(b)[0];				\
+   (c)[1] = (a)*(b)[1];				\
+   (c)[2] = (a)*(b)[2];				\
+   (c)[3] = (a)*(b)[3];				\
+}\
+
+
+/// accumulate scaled vector
+#define VEC_ACCUM_2(c,a,b)			\
+{						\
+   (c)[0] += (a)*(b)[0];			\
+   (c)[1] += (a)*(b)[1];			\
+}\
+
+
+/// accumulate scaled vector
+#define VEC_ACCUM(c,a,b)			\
+{						\
+   (c)[0] += (a)*(b)[0];			\
+   (c)[1] += (a)*(b)[1];			\
+   (c)[2] += (a)*(b)[2];			\
+}\
+
+
+/// accumulate scaled vector
+#define VEC_ACCUM_4(c,a,b)			\
+{						\
+   (c)[0] += (a)*(b)[0];			\
+   (c)[1] += (a)*(b)[1];			\
+   (c)[2] += (a)*(b)[2];			\
+   (c)[3] += (a)*(b)[3];			\
+}\
+
+
+/// Vector dot product
+#define VEC_DOT_2(a,b) ((a)[0]*(b)[0] + (a)[1]*(b)[1])
+
+
+/// Vector dot product
+#define VEC_DOT(a,b) ((a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2])
+
+/// Vector dot product
+#define VEC_DOT_4(a,b)	((a)[0]*(b)[0] + (a)[1]*(b)[1] + (a)[2]*(b)[2] + (a)[3]*(b)[3])
+
+/// vector impact parameter (squared)
+#define VEC_IMPACT_SQ(bsq,direction,position) {\
+   GREAL _llel_ = VEC_DOT(direction, position);\
+   bsq = VEC_DOT(position, position) - _llel_*_llel_;\
+}\
+
+
+/// vector impact parameter
+#define VEC_IMPACT(bsq,direction,position)	{\
+   VEC_IMPACT_SQ(bsq,direction,position);		\
+   GIM_SQRT(bsq,bsq);					\
+}\
+
+/// Vector length
+#define VEC_LENGTH_2(a,l)\
+{\
+    GREAL _pp = VEC_DOT_2(a,a);\
+    GIM_SQRT(_pp,l);\
+}\
+
+
+/// Vector length
+#define VEC_LENGTH(a,l)\
+{\
+    GREAL _pp = VEC_DOT(a,a);\
+    GIM_SQRT(_pp,l);\
+}\
+
+
+/// Vector length
+#define VEC_LENGTH_4(a,l)\
+{\
+    GREAL _pp = VEC_DOT_4(a,a);\
+    GIM_SQRT(_pp,l);\
+}\
+
+/// Vector inv length
+#define VEC_INV_LENGTH_2(a,l)\
+{\
+    GREAL _pp = VEC_DOT_2(a,a);\
+    GIM_INV_SQRT(_pp,l);\
+}\
+
+
+/// Vector inv length
+#define VEC_INV_LENGTH(a,l)\
+{\
+    GREAL _pp = VEC_DOT(a,a);\
+    GIM_INV_SQRT(_pp,l);\
+}\
+
+
+/// Vector inv length
+#define VEC_INV_LENGTH_4(a,l)\
+{\
+    GREAL _pp = VEC_DOT_4(a,a);\
+    GIM_INV_SQRT(_pp,l);\
+}\
+
+
+
+/// distance between two points
+#define VEC_DISTANCE(_len,_va,_vb) {\
+    vec3f _tmp_;				\
+    VEC_DIFF(_tmp_, _vb, _va);			\
+    VEC_LENGTH(_tmp_,_len);			\
+}\
+
+
+/// Vector length
+#define VEC_CONJUGATE_LENGTH(a,l)\
+{\
+    GREAL _pp = 1.0 - a[0]*a[0] - a[1]*a[1] - a[2]*a[2];\
+    GIM_SQRT(_pp,l);\
+}\
+
+
+/// Vector length
+#define VEC_NORMALIZE(a) {	\
+    GREAL len;\
+    VEC_INV_LENGTH(a,len); \
+    if(len<G_REAL_INFINITY)\
+    {\
+        a[0] *= len;				\
+        a[1] *= len;				\
+        a[2] *= len;				\
+    }						\
+}\
+
+/// Set Vector size
+#define VEC_RENORMALIZE(a,newlen) {	\
+    GREAL len;\
+    VEC_INV_LENGTH(a,len); \
+    if(len<G_REAL_INFINITY)\
+    {\
+        len *= newlen;\
+        a[0] *= len;				\
+        a[1] *= len;				\
+        a[2] *= len;				\
+    }						\
+}\
+
+/// Vector cross
+#define VEC_CROSS(c,a,b)		\
+{						\
+   c[0] = (a)[1] * (b)[2] - (a)[2] * (b)[1];	\
+   c[1] = (a)[2] * (b)[0] - (a)[0] * (b)[2];	\
+   c[2] = (a)[0] * (b)[1] - (a)[1] * (b)[0];	\
+}\
+
+
+/*! Vector perp -- assumes that n is of unit length
+ * accepts vector v, subtracts out any component parallel to n */
+#define VEC_PERPENDICULAR(vp,v,n)			\
+{						\
+   GREAL dot = VEC_DOT(v, n);			\
+   vp[0] = (v)[0] - dot*(n)[0];		\
+   vp[1] = (v)[1] - dot*(n)[1];		\
+   vp[2] = (v)[2] - dot*(n)[2];		\
+}\
+
+
+/*! Vector parallel -- assumes that n is of unit length */
+#define VEC_PARALLEL(vp,v,n)			\
+{						\
+   GREAL dot = VEC_DOT(v, n);			\
+   vp[0] = (dot) * (n)[0];			\
+   vp[1] = (dot) * (n)[1];			\
+   vp[2] = (dot) * (n)[2];			\
+}\
+
+/*! Same as Vector parallel --  n can have any length
+ * accepts vector v, subtracts out any component perpendicular to n */
+#define VEC_PROJECT(vp,v,n)			\
+{ \
+	GREAL scalar = VEC_DOT(v, n);			\
+	scalar/= VEC_DOT(n, n); \
+	vp[0] = (scalar) * (n)[0];			\
+    vp[1] = (scalar) * (n)[1];			\
+    vp[2] = (scalar) * (n)[2];			\
+}\
+
+
+/*! accepts vector v*/
+#define VEC_UNPROJECT(vp,v,n)			\
+{ \
+	GREAL scalar = VEC_DOT(v, n);			\
+	scalar = VEC_DOT(n, n)/scalar; \
+	vp[0] = (scalar) * (n)[0];			\
+    vp[1] = (scalar) * (n)[1];			\
+    vp[2] = (scalar) * (n)[2];			\
+}\
+
+
+/*! Vector reflection -- assumes n is of unit length
+ Takes vector v, reflects it against reflector n, and returns vr */
+#define VEC_REFLECT(vr,v,n)			\
+{						\
+   GREAL dot = VEC_DOT(v, n);			\
+   vr[0] = (v)[0] - 2.0 * (dot) * (n)[0];	\
+   vr[1] = (v)[1] - 2.0 * (dot) * (n)[1];	\
+   vr[2] = (v)[2] - 2.0 * (dot) * (n)[2];	\
+}\
+
+
+/*! Vector blending
+Takes two vectors a, b, blends them together with two scalars */
+#define VEC_BLEND_AB(vr,sa,a,sb,b)			\
+{						\
+   vr[0] = (sa) * (a)[0] + (sb) * (b)[0];	\
+   vr[1] = (sa) * (a)[1] + (sb) * (b)[1];	\
+   vr[2] = (sa) * (a)[2] + (sb) * (b)[2];	\
+}\
+
+/*! Vector blending
+Takes two vectors a, b, blends them together with s <=1 */
+#define VEC_BLEND(vr,a,b,s) VEC_BLEND_AB(vr,(1-s),a,s,b)
+
+#define VEC_SET3(a,b,op,c) a[0]=b[0] op c[0]; a[1]=b[1] op c[1]; a[2]=b[2] op c[2];
+
+//! Finds the bigger cartesian coordinate from a vector
+#define VEC_MAYOR_COORD(vec, maxc)\
+{\
+	GREAL A[] = {fabs(vec[0]),fabs(vec[1]),fabs(vec[2])};\
+    maxc =  A[0]>A[1]?(A[0]>A[2]?0:2):(A[1]>A[2]?1:2);\
+}\
+
+//! Finds the 2 smallest cartesian coordinates from a vector
+#define VEC_MINOR_AXES(vec, i0, i1)\
+{\
+	VEC_MAYOR_COORD(vec,i0);\
+	i0 = (i0+1)%3;\
+	i1 = (i0+1)%3;\
+}\
+
+
+
+
+#define VEC_EQUAL(v1,v2) (v1[0]==v2[0]&&v1[1]==v2[1]&&v1[2]==v2[2])
+
+#define VEC_NEAR_EQUAL(v1,v2) (GIM_NEAR_EQUAL(v1[0],v2[0])&&GIM_NEAR_EQUAL(v1[1],v2[1])&&GIM_NEAR_EQUAL(v1[2],v2[2]))
+
+
+/// Vector cross
+#define X_AXIS_CROSS_VEC(dst,src)\
+{					   \
+	dst[0] = 0.0f;     \
+	dst[1] = -src[2];  \
+	dst[2] = src[1];  \
+}\
+
+#define Y_AXIS_CROSS_VEC(dst,src)\
+{					   \
+	dst[0] = src[2];     \
+	dst[1] = 0.0f;  \
+	dst[2] = -src[0];  \
+}\
+
+#define Z_AXIS_CROSS_VEC(dst,src)\
+{					   \
+	dst[0] = -src[1];     \
+	dst[1] = src[0];  \
+	dst[2] = 0.0f;  \
+}\
+
+
+
+
+
+
+/// initialize matrix
+#define IDENTIFY_MATRIX_3X3(m)			\
+{						\
+   m[0][0] = 1.0;				\
+   m[0][1] = 0.0;				\
+   m[0][2] = 0.0;				\
+						\
+   m[1][0] = 0.0;				\
+   m[1][1] = 1.0;				\
+   m[1][2] = 0.0;				\
+						\
+   m[2][0] = 0.0;				\
+   m[2][1] = 0.0;				\
+   m[2][2] = 1.0;				\
+}\
+
+/*! initialize matrix */
+#define IDENTIFY_MATRIX_4X4(m)			\
+{						\
+   m[0][0] = 1.0;				\
+   m[0][1] = 0.0;				\
+   m[0][2] = 0.0;				\
+   m[0][3] = 0.0;				\
+						\
+   m[1][0] = 0.0;				\
+   m[1][1] = 1.0;				\
+   m[1][2] = 0.0;				\
+   m[1][3] = 0.0;				\
+						\
+   m[2][0] = 0.0;				\
+   m[2][1] = 0.0;				\
+   m[2][2] = 1.0;				\
+   m[2][3] = 0.0;				\
+						\
+   m[3][0] = 0.0;				\
+   m[3][1] = 0.0;				\
+   m[3][2] = 0.0;				\
+   m[3][3] = 1.0;				\
+}\
+
+/*! initialize matrix */
+#define ZERO_MATRIX_4X4(m)			\
+{						\
+   m[0][0] = 0.0;				\
+   m[0][1] = 0.0;				\
+   m[0][2] = 0.0;				\
+   m[0][3] = 0.0;				\
+						\
+   m[1][0] = 0.0;				\
+   m[1][1] = 0.0;				\
+   m[1][2] = 0.0;				\
+   m[1][3] = 0.0;				\
+						\
+   m[2][0] = 0.0;				\
+   m[2][1] = 0.0;				\
+   m[2][2] = 0.0;				\
+   m[2][3] = 0.0;				\
+						\
+   m[3][0] = 0.0;				\
+   m[3][1] = 0.0;				\
+   m[3][2] = 0.0;				\
+   m[3][3] = 0.0;				\
+}\
+
+/*! matrix rotation  X */
+#define ROTX_CS(m,cosine,sine)		\
+{					\
+   /* rotation about the x-axis */	\
+					\
+   m[0][0] = 1.0;			\
+   m[0][1] = 0.0;			\
+   m[0][2] = 0.0;			\
+   m[0][3] = 0.0;			\
+					\
+   m[1][0] = 0.0;			\
+   m[1][1] = (cosine);			\
+   m[1][2] = (sine);			\
+   m[1][3] = 0.0;			\
+					\
+   m[2][0] = 0.0;			\
+   m[2][1] = -(sine);			\
+   m[2][2] = (cosine);			\
+   m[2][3] = 0.0;			\
+					\
+   m[3][0] = 0.0;			\
+   m[3][1] = 0.0;			\
+   m[3][2] = 0.0;			\
+   m[3][3] = 1.0;			\
+}\
+
+/*! matrix rotation  Y */
+#define ROTY_CS(m,cosine,sine)		\
+{					\
+   /* rotation about the y-axis */	\
+					\
+   m[0][0] = (cosine);			\
+   m[0][1] = 0.0;			\
+   m[0][2] = -(sine);			\
+   m[0][3] = 0.0;			\
+					\
+   m[1][0] = 0.0;			\
+   m[1][1] = 1.0;			\
+   m[1][2] = 0.0;			\
+   m[1][3] = 0.0;			\
+					\
+   m[2][0] = (sine);			\
+   m[2][1] = 0.0;			\
+   m[2][2] = (cosine);			\
+   m[2][3] = 0.0;			\
+					\
+   m[3][0] = 0.0;			\
+   m[3][1] = 0.0;			\
+   m[3][2] = 0.0;			\
+   m[3][3] = 1.0;			\
+}\
+
+/*! matrix rotation  Z */
+#define ROTZ_CS(m,cosine,sine)		\
+{					\
+   /* rotation about the z-axis */	\
+					\
+   m[0][0] = (cosine);			\
+   m[0][1] = (sine);			\
+   m[0][2] = 0.0;			\
+   m[0][3] = 0.0;			\
+					\
+   m[1][0] = -(sine);			\
+   m[1][1] = (cosine);			\
+   m[1][2] = 0.0;			\
+   m[1][3] = 0.0;			\
+					\
+   m[2][0] = 0.0;			\
+   m[2][1] = 0.0;			\
+   m[2][2] = 1.0;			\
+   m[2][3] = 0.0;			\
+					\
+   m[3][0] = 0.0;			\
+   m[3][1] = 0.0;			\
+   m[3][2] = 0.0;			\
+   m[3][3] = 1.0;			\
+}\
+
+/*! matrix copy */
+#define COPY_MATRIX_2X2(b,a)	\
+{				\
+   b[0][0] = a[0][0];		\
+   b[0][1] = a[0][1];		\
+				\
+   b[1][0] = a[1][0];		\
+   b[1][1] = a[1][1];		\
+				\
+}\
+
+
+/*! matrix copy */
+#define COPY_MATRIX_2X3(b,a)	\
+{				\
+   b[0][0] = a[0][0];		\
+   b[0][1] = a[0][1];		\
+   b[0][2] = a[0][2];		\
+				\
+   b[1][0] = a[1][0];		\
+   b[1][1] = a[1][1];		\
+   b[1][2] = a[1][2];		\
+}\
+
+
+/*! matrix copy */
+#define COPY_MATRIX_3X3(b,a)	\
+{				\
+   b[0][0] = a[0][0];		\
+   b[0][1] = a[0][1];		\
+   b[0][2] = a[0][2];		\
+				\
+   b[1][0] = a[1][0];		\
+   b[1][1] = a[1][1];		\
+   b[1][2] = a[1][2];		\
+				\
+   b[2][0] = a[2][0];		\
+   b[2][1] = a[2][1];		\
+   b[2][2] = a[2][2];		\
+}\
+
+
+/*! matrix copy */
+#define COPY_MATRIX_4X4(b,a)	\
+{				\
+   b[0][0] = a[0][0];		\
+   b[0][1] = a[0][1];		\
+   b[0][2] = a[0][2];		\
+   b[0][3] = a[0][3];		\
+				\
+   b[1][0] = a[1][0];		\
+   b[1][1] = a[1][1];		\
+   b[1][2] = a[1][2];		\
+   b[1][3] = a[1][3];		\
+				\
+   b[2][0] = a[2][0];		\
+   b[2][1] = a[2][1];		\
+   b[2][2] = a[2][2];		\
+   b[2][3] = a[2][3];		\
+				\
+   b[3][0] = a[3][0];		\
+   b[3][1] = a[3][1];		\
+   b[3][2] = a[3][2];		\
+   b[3][3] = a[3][3];		\
+}\
+
+
+/*! matrix transpose */
+#define TRANSPOSE_MATRIX_2X2(b,a)	\
+{				\
+   b[0][0] = a[0][0];		\
+   b[0][1] = a[1][0];		\
+				\
+   b[1][0] = a[0][1];		\
+   b[1][1] = a[1][1];		\
+}\
+
+
+/*! matrix transpose */
+#define TRANSPOSE_MATRIX_3X3(b,a)	\
+{				\
+   b[0][0] = a[0][0];		\
+   b[0][1] = a[1][0];		\
+   b[0][2] = a[2][0];		\
+				\
+   b[1][0] = a[0][1];		\
+   b[1][1] = a[1][1];		\
+   b[1][2] = a[2][1];		\
+				\
+   b[2][0] = a[0][2];		\
+   b[2][1] = a[1][2];		\
+   b[2][2] = a[2][2];		\
+}\
+
+
+/*! matrix transpose */
+#define TRANSPOSE_MATRIX_4X4(b,a)	\
+{				\
+   b[0][0] = a[0][0];		\
+   b[0][1] = a[1][0];		\
+   b[0][2] = a[2][0];		\
+   b[0][3] = a[3][0];		\
+				\
+   b[1][0] = a[0][1];		\
+   b[1][1] = a[1][1];		\
+   b[1][2] = a[2][1];		\
+   b[1][3] = a[3][1];		\
+				\
+   b[2][0] = a[0][2];		\
+   b[2][1] = a[1][2];		\
+   b[2][2] = a[2][2];		\
+   b[2][3] = a[3][2];		\
+				\
+   b[3][0] = a[0][3];		\
+   b[3][1] = a[1][3];		\
+   b[3][2] = a[2][3];		\
+   b[3][3] = a[3][3];		\
+}\
+
+
+/*! multiply matrix by scalar */
+#define SCALE_MATRIX_2X2(b,s,a)		\
+{					\
+   b[0][0] = (s) * a[0][0];		\
+   b[0][1] = (s) * a[0][1];		\
+					\
+   b[1][0] = (s) * a[1][0];		\
+   b[1][1] = (s) * a[1][1];		\
+}\
+
+
+/*! multiply matrix by scalar */
+#define SCALE_MATRIX_3X3(b,s,a)		\
+{					\
+   b[0][0] = (s) * a[0][0];		\
+   b[0][1] = (s) * a[0][1];		\
+   b[0][2] = (s) * a[0][2];		\
+					\
+   b[1][0] = (s) * a[1][0];		\
+   b[1][1] = (s) * a[1][1];		\
+   b[1][2] = (s) * a[1][2];		\
+					\
+   b[2][0] = (s) * a[2][0];		\
+   b[2][1] = (s) * a[2][1];		\
+   b[2][2] = (s) * a[2][2];		\
+}\
+
+
+/*! multiply matrix by scalar */
+#define SCALE_MATRIX_4X4(b,s,a)		\
+{					\
+   b[0][0] = (s) * a[0][0];		\
+   b[0][1] = (s) * a[0][1];		\
+   b[0][2] = (s) * a[0][2];		\
+   b[0][3] = (s) * a[0][3];		\
+					\
+   b[1][0] = (s) * a[1][0];		\
+   b[1][1] = (s) * a[1][1];		\
+   b[1][2] = (s) * a[1][2];		\
+   b[1][3] = (s) * a[1][3];		\
+					\
+   b[2][0] = (s) * a[2][0];		\
+   b[2][1] = (s) * a[2][1];		\
+   b[2][2] = (s) * a[2][2];		\
+   b[2][3] = (s) * a[2][3];		\
+					\
+   b[3][0] = s * a[3][0];		\
+   b[3][1] = s * a[3][1];		\
+   b[3][2] = s * a[3][2];		\
+   b[3][3] = s * a[3][3];		\
+}\
+
+
+/*! multiply matrix by scalar */
+#define SCALE_VEC_MATRIX_2X2(b,svec,a)		\
+{					\
+   b[0][0] = svec[0] * a[0][0];		\
+   b[1][0] = svec[0] * a[1][0];		\
+					\
+   b[0][1] = svec[1] * a[0][1];		\
+   b[1][1] = svec[1] * a[1][1];		\
+}\
+
+
+/*! multiply matrix by scalar. Each columns is scaled by each scalar vector component */
+#define SCALE_VEC_MATRIX_3X3(b,svec,a)		\
+{					\
+   b[0][0] = svec[0] * a[0][0];		\
+   b[1][0] = svec[0] * a[1][0];		\
+   b[2][0] = svec[0] * a[2][0];		\
+					\
+   b[0][1] = svec[1] * a[0][1];		\
+   b[1][1] = svec[1] * a[1][1];		\
+   b[2][1] = svec[1] * a[2][1];		\
+					\
+   b[0][2] = svec[2] * a[0][2];		\
+   b[1][2] = svec[2] * a[1][2];		\
+   b[2][2] = svec[2] * a[2][2];		\
+}\
+
+
+/*! multiply matrix by scalar */
+#define SCALE_VEC_MATRIX_4X4(b,svec,a)		\
+{					\
+   b[0][0] = svec[0] * a[0][0];		\
+   b[1][0] = svec[0] * a[1][0];		\
+   b[2][0] = svec[0] * a[2][0];		\
+   b[3][0] = svec[0] * a[3][0];		\
+					\
+   b[0][1] = svec[1] * a[0][1];		\
+   b[1][1] = svec[1] * a[1][1];		\
+   b[2][1] = svec[1] * a[2][1];		\
+   b[3][1] = svec[1] * a[3][1];		\
+					\
+   b[0][2] = svec[2] * a[0][2];		\
+   b[1][2] = svec[2] * a[1][2];		\
+   b[2][2] = svec[2] * a[2][2];		\
+   b[3][2] = svec[2] * a[3][2];		\
+   \
+   b[0][3] = svec[3] * a[0][3];		\
+   b[1][3] = svec[3] * a[1][3];		\
+   b[2][3] = svec[3] * a[2][3];		\
+   b[3][3] = svec[3] * a[3][3];		\
+}\
+
+
+/*! multiply matrix by scalar */
+#define ACCUM_SCALE_MATRIX_2X2(b,s,a)		\
+{					\
+   b[0][0] += (s) * a[0][0];		\
+   b[0][1] += (s) * a[0][1];		\
+					\
+   b[1][0] += (s) * a[1][0];		\
+   b[1][1] += (s) * a[1][1];		\
+}\
+
+
+/*! multiply matrix by scalar */
+#define ACCUM_SCALE_MATRIX_3X3(b,s,a)		\
+{					\
+   b[0][0] += (s) * a[0][0];		\
+   b[0][1] += (s) * a[0][1];		\
+   b[0][2] += (s) * a[0][2];		\
+					\
+   b[1][0] += (s) * a[1][0];		\
+   b[1][1] += (s) * a[1][1];		\
+   b[1][2] += (s) * a[1][2];		\
+					\
+   b[2][0] += (s) * a[2][0];		\
+   b[2][1] += (s) * a[2][1];		\
+   b[2][2] += (s) * a[2][2];		\
+}\
+
+
+/*! multiply matrix by scalar */
+#define ACCUM_SCALE_MATRIX_4X4(b,s,a)		\
+{					\
+   b[0][0] += (s) * a[0][0];		\
+   b[0][1] += (s) * a[0][1];		\
+   b[0][2] += (s) * a[0][2];		\
+   b[0][3] += (s) * a[0][3];		\
+					\
+   b[1][0] += (s) * a[1][0];		\
+   b[1][1] += (s) * a[1][1];		\
+   b[1][2] += (s) * a[1][2];		\
+   b[1][3] += (s) * a[1][3];		\
+					\
+   b[2][0] += (s) * a[2][0];		\
+   b[2][1] += (s) * a[2][1];		\
+   b[2][2] += (s) * a[2][2];		\
+   b[2][3] += (s) * a[2][3];		\
+					\
+   b[3][0] += (s) * a[3][0];		\
+   b[3][1] += (s) * a[3][1];		\
+   b[3][2] += (s) * a[3][2];		\
+   b[3][3] += (s) * a[3][3];		\
+}\
+
+/*! matrix product */
+/*! c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/
+#define MATRIX_PRODUCT_2X2(c,a,b)		\
+{						\
+   c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0];	\
+   c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1];	\
+						\
+   c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0];	\
+   c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1];	\
+						\
+}\
+
+/*! matrix product */
+/*! c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/
+#define MATRIX_PRODUCT_3X3(c,a,b)				\
+{								\
+   c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0]+a[0][2]*b[2][0];	\
+   c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1]+a[0][2]*b[2][1];	\
+   c[0][2] = a[0][0]*b[0][2]+a[0][1]*b[1][2]+a[0][2]*b[2][2];	\
+								\
+   c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0]+a[1][2]*b[2][0];	\
+   c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1]+a[1][2]*b[2][1];	\
+   c[1][2] = a[1][0]*b[0][2]+a[1][1]*b[1][2]+a[1][2]*b[2][2];	\
+								\
+   c[2][0] = a[2][0]*b[0][0]+a[2][1]*b[1][0]+a[2][2]*b[2][0];	\
+   c[2][1] = a[2][0]*b[0][1]+a[2][1]*b[1][1]+a[2][2]*b[2][1];	\
+   c[2][2] = a[2][0]*b[0][2]+a[2][1]*b[1][2]+a[2][2]*b[2][2];	\
+}\
+
+
+/*! matrix product */
+/*! c[x][y] = a[x][0]*b[0][y]+a[x][1]*b[1][y]+a[x][2]*b[2][y]+a[x][3]*b[3][y];*/
+#define MATRIX_PRODUCT_4X4(c,a,b)		\
+{						\
+   c[0][0] = a[0][0]*b[0][0]+a[0][1]*b[1][0]+a[0][2]*b[2][0]+a[0][3]*b[3][0];\
+   c[0][1] = a[0][0]*b[0][1]+a[0][1]*b[1][1]+a[0][2]*b[2][1]+a[0][3]*b[3][1];\
+   c[0][2] = a[0][0]*b[0][2]+a[0][1]*b[1][2]+a[0][2]*b[2][2]+a[0][3]*b[3][2];\
+   c[0][3] = a[0][0]*b[0][3]+a[0][1]*b[1][3]+a[0][2]*b[2][3]+a[0][3]*b[3][3];\
+						\
+   c[1][0] = a[1][0]*b[0][0]+a[1][1]*b[1][0]+a[1][2]*b[2][0]+a[1][3]*b[3][0];\
+   c[1][1] = a[1][0]*b[0][1]+a[1][1]*b[1][1]+a[1][2]*b[2][1]+a[1][3]*b[3][1];\
+   c[1][2] = a[1][0]*b[0][2]+a[1][1]*b[1][2]+a[1][2]*b[2][2]+a[1][3]*b[3][2];\
+   c[1][3] = a[1][0]*b[0][3]+a[1][1]*b[1][3]+a[1][2]*b[2][3]+a[1][3]*b[3][3];\
+						\
+   c[2][0] = a[2][0]*b[0][0]+a[2][1]*b[1][0]+a[2][2]*b[2][0]+a[2][3]*b[3][0];\
+   c[2][1] = a[2][0]*b[0][1]+a[2][1]*b[1][1]+a[2][2]*b[2][1]+a[2][3]*b[3][1];\
+   c[2][2] = a[2][0]*b[0][2]+a[2][1]*b[1][2]+a[2][2]*b[2][2]+a[2][3]*b[3][2];\
+   c[2][3] = a[2][0]*b[0][3]+a[2][1]*b[1][3]+a[2][2]*b[2][3]+a[2][3]*b[3][3];\
+						\
+   c[3][0] = a[3][0]*b[0][0]+a[3][1]*b[1][0]+a[3][2]*b[2][0]+a[3][3]*b[3][0];\
+   c[3][1] = a[3][0]*b[0][1]+a[3][1]*b[1][1]+a[3][2]*b[2][1]+a[3][3]*b[3][1];\
+   c[3][2] = a[3][0]*b[0][2]+a[3][1]*b[1][2]+a[3][2]*b[2][2]+a[3][3]*b[3][2];\
+   c[3][3] = a[3][0]*b[0][3]+a[3][1]*b[1][3]+a[3][2]*b[2][3]+a[3][3]*b[3][3];\
+}\
+
+
+/*! matrix times vector */
+#define MAT_DOT_VEC_2X2(p,m,v)					\
+{								\
+   p[0] = m[0][0]*v[0] + m[0][1]*v[1];				\
+   p[1] = m[1][0]*v[0] + m[1][1]*v[1];				\
+}\
+
+
+/*! matrix times vector */
+#define MAT_DOT_VEC_3X3(p,m,v)					\
+{								\
+   p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];		\
+   p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];		\
+   p[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2];		\
+}\
+
+
+/*! matrix times vector
+v is a vec4f
+*/
+#define MAT_DOT_VEC_4X4(p,m,v)					\
+{								\
+   p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2] + m[0][3]*v[3];	\
+   p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2] + m[1][3]*v[3];	\
+   p[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2] + m[2][3]*v[3];	\
+   p[3] = m[3][0]*v[0] + m[3][1]*v[1] + m[3][2]*v[2] + m[3][3]*v[3];	\
+}\
+
+/*! matrix times vector
+v is a vec3f
+and m is a mat4f<br>
+Last column is added as the position
+*/
+#define MAT_DOT_VEC_3X4(p,m,v)					\
+{								\
+   p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2] + m[0][3];	\
+   p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2] + m[1][3];	\
+   p[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2] + m[2][3];	\
+}\
+
+
+/*! vector transpose times matrix */
+/*! p[j] = v[0]*m[0][j] + v[1]*m[1][j] + v[2]*m[2][j]; */
+#define VEC_DOT_MAT_3X3(p,v,m)					\
+{								\
+   p[0] = v[0]*m[0][0] + v[1]*m[1][0] + v[2]*m[2][0];		\
+   p[1] = v[0]*m[0][1] + v[1]*m[1][1] + v[2]*m[2][1];		\
+   p[2] = v[0]*m[0][2] + v[1]*m[1][2] + v[2]*m[2][2];		\
+}\
+
+
+/*! affine matrix times vector */
+/** The matrix is assumed to be an affine matrix, with last two
+ * entries representing a translation */
+#define MAT_DOT_VEC_2X3(p,m,v)					\
+{								\
+   p[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2];		\
+   p[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2];		\
+}\
+
+//! Transform a plane
+#define MAT_TRANSFORM_PLANE_4X4(pout,m,plane)\
+{								\
+   pout[0] = m[0][0]*plane[0] + m[0][1]*plane[1]  + m[0][2]*plane[2];\
+   pout[1] = m[1][0]*plane[0] + m[1][1]*plane[1]  + m[1][2]*plane[2];\
+   pout[2] = m[2][0]*plane[0] + m[2][1]*plane[1]  + m[2][2]*plane[2];\
+   pout[3] = m[0][3]*pout[0] + m[1][3]*pout[1]  + m[2][3]*pout[2] + plane[3];\
+}\
+
+
+
+/** inverse transpose of matrix times vector
+ *
+ * This macro computes inverse transpose of matrix m,
+ * and multiplies vector v into it, to yeild vector p
+ *
+ * DANGER !!! Do Not use this on normal vectors!!!
+ * It will leave normals the wrong length !!!
+ * See macro below for use on normals.
+ */
+#define INV_TRANSP_MAT_DOT_VEC_2X2(p,m,v)			\
+{								\
+   GREAL det;						\
+								\
+   det = m[0][0]*m[1][1] - m[0][1]*m[1][0];			\
+   p[0] = m[1][1]*v[0] - m[1][0]*v[1];				\
+   p[1] = - m[0][1]*v[0] + m[0][0]*v[1];			\
+								\
+   /* if matrix not singular, and not orthonormal, then renormalize */ \
+   if ((det!=1.0f) && (det != 0.0f)) {				\
+      det = 1.0f / det;						\
+      p[0] *= det;						\
+      p[1] *= det;						\
+   }								\
+}\
+
+
+/** transform normal vector by inverse transpose of matrix
+ * and then renormalize the vector
+ *
+ * This macro computes inverse transpose of matrix m,
+ * and multiplies vector v into it, to yeild vector p
+ * Vector p is then normalized.
+ */
+#define NORM_XFORM_2X2(p,m,v)					\
+{								\
+   GREAL len;							\
+								\
+   /* do nothing if off-diagonals are zero and diagonals are 	\
+    * equal */							\
+   if ((m[0][1] != 0.0) || (m[1][0] != 0.0) || (m[0][0] != m[1][1])) { \
+      p[0] = m[1][1]*v[0] - m[1][0]*v[1];			\
+      p[1] = - m[0][1]*v[0] + m[0][0]*v[1];			\
+								\
+      len = p[0]*p[0] + p[1]*p[1];				\
+      GIM_INV_SQRT(len,len);					\
+      p[0] *= len;						\
+      p[1] *= len;						\
+   } else {							\
+      VEC_COPY_2 (p, v);					\
+   }								\
+}\
+
+
+/** outer product of vector times vector transpose
+ *
+ * The outer product of vector v and vector transpose t yeilds
+ * dyadic matrix m.
+ */
+#define OUTER_PRODUCT_2X2(m,v,t)				\
+{								\
+   m[0][0] = v[0] * t[0];					\
+   m[0][1] = v[0] * t[1];					\
+								\
+   m[1][0] = v[1] * t[0];					\
+   m[1][1] = v[1] * t[1];					\
+}\
+
+
+/** outer product of vector times vector transpose
+ *
+ * The outer product of vector v and vector transpose t yeilds
+ * dyadic matrix m.
+ */
+#define OUTER_PRODUCT_3X3(m,v,t)				\
+{								\
+   m[0][0] = v[0] * t[0];					\
+   m[0][1] = v[0] * t[1];					\
+   m[0][2] = v[0] * t[2];					\
+								\
+   m[1][0] = v[1] * t[0];					\
+   m[1][1] = v[1] * t[1];					\
+   m[1][2] = v[1] * t[2];					\
+								\
+   m[2][0] = v[2] * t[0];					\
+   m[2][1] = v[2] * t[1];					\
+   m[2][2] = v[2] * t[2];					\
+}\
+
+
+/** outer product of vector times vector transpose
+ *
+ * The outer product of vector v and vector transpose t yeilds
+ * dyadic matrix m.
+ */
+#define OUTER_PRODUCT_4X4(m,v,t)				\
+{								\
+   m[0][0] = v[0] * t[0];					\
+   m[0][1] = v[0] * t[1];					\
+   m[0][2] = v[0] * t[2];					\
+   m[0][3] = v[0] * t[3];					\
+								\
+   m[1][0] = v[1] * t[0];					\
+   m[1][1] = v[1] * t[1];					\
+   m[1][2] = v[1] * t[2];					\
+   m[1][3] = v[1] * t[3];					\
+								\
+   m[2][0] = v[2] * t[0];					\
+   m[2][1] = v[2] * t[1];					\
+   m[2][2] = v[2] * t[2];					\
+   m[2][3] = v[2] * t[3];					\
+								\
+   m[3][0] = v[3] * t[0];					\
+   m[3][1] = v[3] * t[1];					\
+   m[3][2] = v[3] * t[2];					\
+   m[3][3] = v[3] * t[3];					\
+}\
+
+
+/** outer product of vector times vector transpose
+ *
+ * The outer product of vector v and vector transpose t yeilds
+ * dyadic matrix m.
+ */
+#define ACCUM_OUTER_PRODUCT_2X2(m,v,t)				\
+{								\
+   m[0][0] += v[0] * t[0];					\
+   m[0][1] += v[0] * t[1];					\
+								\
+   m[1][0] += v[1] * t[0];					\
+   m[1][1] += v[1] * t[1];					\
+}\
+
+
+/** outer product of vector times vector transpose
+ *
+ * The outer product of vector v and vector transpose t yeilds
+ * dyadic matrix m.
+ */
+#define ACCUM_OUTER_PRODUCT_3X3(m,v,t)				\
+{								\
+   m[0][0] += v[0] * t[0];					\
+   m[0][1] += v[0] * t[1];					\
+   m[0][2] += v[0] * t[2];					\
+								\
+   m[1][0] += v[1] * t[0];					\
+   m[1][1] += v[1] * t[1];					\
+   m[1][2] += v[1] * t[2];					\
+								\
+   m[2][0] += v[2] * t[0];					\
+   m[2][1] += v[2] * t[1];					\
+   m[2][2] += v[2] * t[2];					\
+}\
+
+
+/** outer product of vector times vector transpose
+ *
+ * The outer product of vector v and vector transpose t yeilds
+ * dyadic matrix m.
+ */
+#define ACCUM_OUTER_PRODUCT_4X4(m,v,t)				\
+{								\
+   m[0][0] += v[0] * t[0];					\
+   m[0][1] += v[0] * t[1];					\
+   m[0][2] += v[0] * t[2];					\
+   m[0][3] += v[0] * t[3];					\
+								\
+   m[1][0] += v[1] * t[0];					\
+   m[1][1] += v[1] * t[1];					\
+   m[1][2] += v[1] * t[2];					\
+   m[1][3] += v[1] * t[3];					\
+								\
+   m[2][0] += v[2] * t[0];					\
+   m[2][1] += v[2] * t[1];					\
+   m[2][2] += v[2] * t[2];					\
+   m[2][3] += v[2] * t[3];					\
+								\
+   m[3][0] += v[3] * t[0];					\
+   m[3][1] += v[3] * t[1];					\
+   m[3][2] += v[3] * t[2];					\
+   m[3][3] += v[3] * t[3];					\
+}\
+
+
+/** determinant of matrix
+ *
+ * Computes determinant of matrix m, returning d
+ */
+#define DETERMINANT_2X2(d,m)					\
+{								\
+   d = m[0][0] * m[1][1] - m[0][1] * m[1][0];			\
+}\
+
+
+/** determinant of matrix
+ *
+ * Computes determinant of matrix m, returning d
+ */
+#define DETERMINANT_3X3(d,m)					\
+{								\
+   d = m[0][0] * (m[1][1]*m[2][2] - m[1][2] * m[2][1]);		\
+   d -= m[0][1] * (m[1][0]*m[2][2] - m[1][2] * m[2][0]);	\
+   d += m[0][2] * (m[1][0]*m[2][1] - m[1][1] * m[2][0]);	\
+}\
+
+
+/** i,j,th cofactor of a 4x4 matrix
+ *
+ */
+#define COFACTOR_4X4_IJ(fac,m,i,j) 				\
+{								\
+   GUINT __ii[4], __jj[4], __k;						\
+								\
+   for (__k=0; __k<i; __k++) __ii[__k] = __k;				\
+   for (__k=i; __k<3; __k++) __ii[__k] = __k+1;				\
+   for (__k=0; __k<j; __k++) __jj[__k] = __k;				\
+   for (__k=j; __k<3; __k++) __jj[__k] = __k+1;				\
+								\
+   (fac) = m[__ii[0]][__jj[0]] * (m[__ii[1]][__jj[1]]*m[__ii[2]][__jj[2]] 	\
+                            - m[__ii[1]][__jj[2]]*m[__ii[2]][__jj[1]]); \
+   (fac) -= m[__ii[0]][__jj[1]] * (m[__ii[1]][__jj[0]]*m[__ii[2]][__jj[2]]	\
+                             - m[__ii[1]][__jj[2]]*m[__ii[2]][__jj[0]]);\
+   (fac) += m[__ii[0]][__jj[2]] * (m[__ii[1]][__jj[0]]*m[__ii[2]][__jj[1]]	\
+                             - m[__ii[1]][__jj[1]]*m[__ii[2]][__jj[0]]);\
+								\
+   __k = i+j;							\
+   if ( __k != (__k/2)*2) {						\
+      (fac) = -(fac);						\
+   }								\
+}\
+
+
+/** determinant of matrix
+ *
+ * Computes determinant of matrix m, returning d
+ */
+#define DETERMINANT_4X4(d,m)					\
+{								\
+   GREAL cofac;						\
+   COFACTOR_4X4_IJ (cofac, m, 0, 0);				\
+   d = m[0][0] * cofac;						\
+   COFACTOR_4X4_IJ (cofac, m, 0, 1);				\
+   d += m[0][1] * cofac;					\
+   COFACTOR_4X4_IJ (cofac, m, 0, 2);				\
+   d += m[0][2] * cofac;					\
+   COFACTOR_4X4_IJ (cofac, m, 0, 3);				\
+   d += m[0][3] * cofac;					\
+}\
+
+
+/** cofactor of matrix
+ *
+ * Computes cofactor of matrix m, returning a
+ */
+#define COFACTOR_2X2(a,m)					\
+{								\
+   a[0][0] = (m)[1][1];						\
+   a[0][1] = - (m)[1][0];						\
+   a[1][0] = - (m)[0][1];						\
+   a[1][1] = (m)[0][0];						\
+}\
+
+
+/** cofactor of matrix
+ *
+ * Computes cofactor of matrix m, returning a
+ */
+#define COFACTOR_3X3(a,m)					\
+{								\
+   a[0][0] = m[1][1]*m[2][2] - m[1][2]*m[2][1];			\
+   a[0][1] = - (m[1][0]*m[2][2] - m[2][0]*m[1][2]);		\
+   a[0][2] = m[1][0]*m[2][1] - m[1][1]*m[2][0];			\
+   a[1][0] = - (m[0][1]*m[2][2] - m[0][2]*m[2][1]);		\
+   a[1][1] = m[0][0]*m[2][2] - m[0][2]*m[2][0];			\
+   a[1][2] = - (m[0][0]*m[2][1] - m[0][1]*m[2][0]);		\
+   a[2][0] = m[0][1]*m[1][2] - m[0][2]*m[1][1];			\
+   a[2][1] = - (m[0][0]*m[1][2] - m[0][2]*m[1][0]);		\
+   a[2][2] = m[0][0]*m[1][1] - m[0][1]*m[1][0]);		\
+}\
+
+
+/** cofactor of matrix
+ *
+ * Computes cofactor of matrix m, returning a
+ */
+#define COFACTOR_4X4(a,m)					\
+{								\
+   int i,j;							\
+								\
+   for (i=0; i<4; i++) {					\
+      for (j=0; j<4; j++) {					\
+         COFACTOR_4X4_IJ (a[i][j], m, i, j);			\
+      }								\
+   }								\
+}\
+
+
+/** adjoint of matrix
+ *
+ * Computes adjoint of matrix m, returning a
+ * (Note that adjoint is just the transpose of the cofactor matrix)
+ */
+#define ADJOINT_2X2(a,m)					\
+{								\
+   a[0][0] = (m)[1][1];						\
+   a[1][0] = - (m)[1][0];						\
+   a[0][1] = - (m)[0][1];						\
+   a[1][1] = (m)[0][0];						\
+}\
+
+
+/** adjoint of matrix
+ *
+ * Computes adjoint of matrix m, returning a
+ * (Note that adjoint is just the transpose of the cofactor matrix)
+ */
+#define ADJOINT_3X3(a,m)					\
+{								\
+   a[0][0] = m[1][1]*m[2][2] - m[1][2]*m[2][1];			\
+   a[1][0] = - (m[1][0]*m[2][2] - m[2][0]*m[1][2]);		\
+   a[2][0] = m[1][0]*m[2][1] - m[1][1]*m[2][0];			\
+   a[0][1] = - (m[0][1]*m[2][2] - m[0][2]*m[2][1]);		\
+   a[1][1] = m[0][0]*m[2][2] - m[0][2]*m[2][0];			\
+   a[2][1] = - (m[0][0]*m[2][1] - m[0][1]*m[2][0]);		\
+   a[0][2] = m[0][1]*m[1][2] - m[0][2]*m[1][1];			\
+   a[1][2] = - (m[0][0]*m[1][2] - m[0][2]*m[1][0]);		\
+   a[2][2] = m[0][0]*m[1][1] - m[0][1]*m[1][0]);		\
+}\
+
+
+/** adjoint of matrix
+ *
+ * Computes adjoint of matrix m, returning a
+ * (Note that adjoint is just the transpose of the cofactor matrix)
+ */
+#define ADJOINT_4X4(a,m)					\
+{								\
+   char _i_,_j_;							\
+								\
+   for (_i_=0; _i_<4; _i_++) {					\
+      for (_j_=0; _j_<4; _j_++) {					\
+         COFACTOR_4X4_IJ (a[_j_][_i_], m, _i_, _j_);			\
+      }								\
+   }								\
+}\
+
+
+/** compute adjoint of matrix and scale
+ *
+ * Computes adjoint of matrix m, scales it by s, returning a
+ */
+#define SCALE_ADJOINT_2X2(a,s,m)				\
+{								\
+   a[0][0] = (s) * m[1][1];					\
+   a[1][0] = - (s) * m[1][0];					\
+   a[0][1] = - (s) * m[0][1];					\
+   a[1][1] = (s) * m[0][0];					\
+}\
+
+
+/** compute adjoint of matrix and scale
+ *
+ * Computes adjoint of matrix m, scales it by s, returning a
+ */
+#define SCALE_ADJOINT_3X3(a,s,m)				\
+{								\
+   a[0][0] = (s) * (m[1][1] * m[2][2] - m[1][2] * m[2][1]);	\
+   a[1][0] = (s) * (m[1][2] * m[2][0] - m[1][0] * m[2][2]);	\
+   a[2][0] = (s) * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);	\
+								\
+   a[0][1] = (s) * (m[0][2] * m[2][1] - m[0][1] * m[2][2]);	\
+   a[1][1] = (s) * (m[0][0] * m[2][2] - m[0][2] * m[2][0]);	\
+   a[2][1] = (s) * (m[0][1] * m[2][0] - m[0][0] * m[2][1]);	\
+								\
+   a[0][2] = (s) * (m[0][1] * m[1][2] - m[0][2] * m[1][1]);	\
+   a[1][2] = (s) * (m[0][2] * m[1][0] - m[0][0] * m[1][2]);	\
+   a[2][2] = (s) * (m[0][0] * m[1][1] - m[0][1] * m[1][0]);	\
+}\
+
+
+/** compute adjoint of matrix and scale
+ *
+ * Computes adjoint of matrix m, scales it by s, returning a
+ */
+#define SCALE_ADJOINT_4X4(a,s,m)				\
+{								\
+   char _i_,_j_; \
+   for (_i_=0; _i_<4; _i_++) {					\
+      for (_j_=0; _j_<4; _j_++) {					\
+         COFACTOR_4X4_IJ (a[_j_][_i_], m, _i_, _j_);			\
+         a[_j_][_i_] *= s;						\
+      }								\
+   }								\
+}\
+
+/** inverse of matrix
+ *
+ * Compute inverse of matrix a, returning determinant m and
+ * inverse b
+ */
+#define INVERT_2X2(b,det,a)			\
+{						\
+   GREAL _tmp_;					\
+   DETERMINANT_2X2 (det, a);			\
+   _tmp_ = 1.0 / (det);				\
+   SCALE_ADJOINT_2X2 (b, _tmp_, a);		\
+}\
+
+
+/** inverse of matrix
+ *
+ * Compute inverse of matrix a, returning determinant m and
+ * inverse b
+ */
+#define INVERT_3X3(b,det,a)			\
+{						\
+   GREAL _tmp_;					\
+   DETERMINANT_3X3 (det, a);			\
+   _tmp_ = 1.0 / (det);				\
+   SCALE_ADJOINT_3X3 (b, _tmp_, a);		\
+}\
+
+
+/** inverse of matrix
+ *
+ * Compute inverse of matrix a, returning determinant m and
+ * inverse b
+ */
+#define INVERT_4X4(b,det,a)			\
+{						\
+   GREAL _tmp_;					\
+   DETERMINANT_4X4 (det, a);			\
+   _tmp_ = 1.0 / (det);				\
+   SCALE_ADJOINT_4X4 (b, _tmp_, a);		\
+}\
+
+//! Get the triple(3) row of a transform matrix
+#define MAT_GET_ROW(mat,vec3,rowindex)\
+{\
+    vec3[0] = mat[rowindex][0];\
+    vec3[1] = mat[rowindex][1];\
+    vec3[2] = mat[rowindex][2]; \
+}\
+
+//! Get the tuple(2) row of a transform matrix
+#define MAT_GET_ROW2(mat,vec2,rowindex)\
+{\
+    vec2[0] = mat[rowindex][0];\
+    vec2[1] = mat[rowindex][1];\
+}\
+
+
+//! Get the quad (4) row of a transform matrix
+#define MAT_GET_ROW4(mat,vec4,rowindex)\
+{\
+    vec4[0] = mat[rowindex][0];\
+    vec4[1] = mat[rowindex][1];\
+    vec4[2] = mat[rowindex][2];\
+    vec4[3] = mat[rowindex][3];\
+}\
+
+//! Get the triple(3) col of a transform matrix
+#define MAT_GET_COL(mat,vec3,colindex)\
+{\
+    vec3[0] = mat[0][colindex];\
+    vec3[1] = mat[1][colindex];\
+    vec3[2] = mat[2][colindex]; \
+}\
+
+//! Get the tuple(2) col of a transform matrix
+#define MAT_GET_COL2(mat,vec2,colindex)\
+{\
+    vec2[0] = mat[0][colindex];\
+    vec2[1] = mat[1][colindex];\
+}\
+
+
+//! Get the quad (4) col of a transform matrix
+#define MAT_GET_COL4(mat,vec4,colindex)\
+{\
+    vec4[0] = mat[0][colindex];\
+    vec4[1] = mat[1][colindex];\
+    vec4[2] = mat[2][colindex];\
+    vec4[3] = mat[3][colindex];\
+}\
+
+//! Get the triple(3) col of a transform matrix
+#define MAT_GET_X(mat,vec3)\
+{\
+    MAT_GET_COL(mat,vec3,0);\
+}\
+
+//! Get the triple(3) col of a transform matrix
+#define MAT_GET_Y(mat,vec3)\
+{\
+    MAT_GET_COL(mat,vec3,1);\
+}\
+
+//! Get the triple(3) col of a transform matrix
+#define MAT_GET_Z(mat,vec3)\
+{\
+    MAT_GET_COL(mat,vec3,2);\
+}\
+
+
+//! Get the triple(3) col of a transform matrix
+#define MAT_SET_X(mat,vec3)\
+{\
+    mat[0][0] = vec3[0];\
+    mat[1][0] = vec3[1];\
+    mat[2][0] = vec3[2];\
+}\
+
+//! Get the triple(3) col of a transform matrix
+#define MAT_SET_Y(mat,vec3)\
+{\
+    mat[0][1] = vec3[0];\
+    mat[1][1] = vec3[1];\
+    mat[2][1] = vec3[2];\
+}\
+
+//! Get the triple(3) col of a transform matrix
+#define MAT_SET_Z(mat,vec3)\
+{\
+    mat[0][2] = vec3[0];\
+    mat[1][2] = vec3[1];\
+    mat[2][2] = vec3[2];\
+}\
+
+
+//! Get the triple(3) col of a transform matrix
+#define MAT_GET_TRANSLATION(mat,vec3)\
+{\
+    vec3[0] = mat[0][3];\
+    vec3[1] = mat[1][3];\
+    vec3[2] = mat[2][3]; \
+}\
+
+//! Set the triple(3) col of a transform matrix
+#define MAT_SET_TRANSLATION(mat,vec3)\
+{\
+    mat[0][3] = vec3[0];\
+    mat[1][3] = vec3[1];\
+    mat[2][3] = vec3[2]; \
+}\
+
+
+
+//! Returns the dot product between a vec3f and the row of a matrix
+#define MAT_DOT_ROW(mat,vec3,rowindex) (vec3[0]*mat[rowindex][0] + vec3[1]*mat[rowindex][1] + vec3[2]*mat[rowindex][2])
+
+//! Returns the dot product between a vec2f and the row of a matrix
+#define MAT_DOT_ROW2(mat,vec2,rowindex) (vec2[0]*mat[rowindex][0] + vec2[1]*mat[rowindex][1])
+
+//! Returns the dot product between a vec4f and the row of a matrix
+#define MAT_DOT_ROW4(mat,vec4,rowindex) (vec4[0]*mat[rowindex][0] + vec4[1]*mat[rowindex][1] + vec4[2]*mat[rowindex][2] + vec4[3]*mat[rowindex][3])
+
+
+//! Returns the dot product between a vec3f and the col of a matrix
+#define MAT_DOT_COL(mat,vec3,colindex) (vec3[0]*mat[0][colindex] + vec3[1]*mat[1][colindex] + vec3[2]*mat[2][colindex])
+
+//! Returns the dot product between a vec2f and the col of a matrix
+#define MAT_DOT_COL2(mat,vec2,colindex) (vec2[0]*mat[0][colindex] + vec2[1]*mat[1][colindex])
+
+//! Returns the dot product between a vec4f and the col of a matrix
+#define MAT_DOT_COL4(mat,vec4,colindex) (vec4[0]*mat[0][colindex] + vec4[1]*mat[1][colindex] + vec4[2]*mat[2][colindex] + vec4[3]*mat[3][colindex])
+
+/*!Transpose matrix times vector
+v is a vec3f
+and m is a mat4f<br>
+*/
+#define INV_MAT_DOT_VEC_3X3(p,m,v)					\
+{								\
+   p[0] = MAT_DOT_COL(m,v,0); \
+   p[1] = MAT_DOT_COL(m,v,1);	\
+   p[2] = MAT_DOT_COL(m,v,2);	\
+}\
+
+
+
+#endif // GIM_VECTOR_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_math.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_math.h
new file mode 100644
index 0000000..939079e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_math.h
@@ -0,0 +1,157 @@
+#ifndef GIM_MATH_H_INCLUDED
+#define GIM_MATH_H_INCLUDED
+/*! \file gim_math.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+#include "LinearMath/btScalar.h"
+
+
+
+#define GREAL btScalar
+#define GREAL2 double
+#define GINT int
+#define GUINT unsigned int
+#define GSHORT short
+#define GUSHORT unsigned short
+#define GINT64 long long
+#define GUINT64 unsigned long long
+
+
+
+#define G_PI 3.14159265358979f
+#define G_HALF_PI 1.5707963f
+//267948966
+#define G_TWO_PI 6.28318530f
+//71795864
+#define G_ROOT3 1.73205f
+#define G_ROOT2 1.41421f
+#define G_UINT_INFINITY 0xffffffff //!< A very very high value
+#define G_REAL_INFINITY FLT_MAX
+#define	G_SIGN_BITMASK			0x80000000
+#define G_EPSILON SIMD_EPSILON
+
+
+
+enum GIM_SCALAR_TYPES
+{
+	G_STYPE_REAL =0,
+	G_STYPE_REAL2,
+	G_STYPE_SHORT,
+	G_STYPE_USHORT,
+	G_STYPE_INT,
+	G_STYPE_UINT,
+	G_STYPE_INT64,
+	G_STYPE_UINT64
+};
+
+
+
+#define G_DEGTORAD(X) ((X)*3.1415926f/180.0f)
+#define G_RADTODEG(X) ((X)*180.0f/3.1415926f)
+
+//! Integer representation of a floating-point value.
+#define GIM_IR(x)					((GUINT&)(x))
+
+//! Signed integer representation of a floating-point value.
+#define GIM_SIR(x)					((GINT&)(x))
+
+//! Absolute integer representation of a floating-point value
+#define GIM_AIR(x)					(GIM_IR(x)&0x7fffffff)
+
+//! Floating-point representation of an integer value.
+#define GIM_FR(x)					((GREAL&)(x))
+
+#define GIM_MAX(a,b) (a<b?b:a)
+#define GIM_MIN(a,b) (a>b?b:a)
+
+#define GIM_MAX3(a,b,c) GIM_MAX(a,GIM_MAX(b,c))
+#define GIM_MIN3(a,b,c) GIM_MIN(a,GIM_MIN(b,c))
+
+#define GIM_IS_ZERO(value) (value < G_EPSILON &&  value > -G_EPSILON)
+
+#define GIM_IS_NEGATIVE(value) (value <= -G_EPSILON)
+
+#define GIM_IS_POSISITVE(value) (value >= G_EPSILON)
+
+#define GIM_NEAR_EQUAL(v1,v2) GIM_IS_ZERO((v1-v2))
+
+///returns a clamped number
+#define GIM_CLAMP(number,minval,maxval) (number<minval?minval:(number>maxval?maxval:number))
+
+#define GIM_GREATER(x, y)	btFabs(x) > (y)
+
+///Swap numbers
+#define GIM_SWAP_NUMBERS(a,b){ \
+    a = a+b; \
+    b = a-b; \
+    a = a-b; \
+}\
+
+#define GIM_INV_SQRT(va,isva)\
+{\
+    if(va<=0.0000001f)\
+    {\
+        isva = G_REAL_INFINITY;\
+    }\
+    else\
+    {\
+        GREAL _x = va * 0.5f;\
+        GUINT _y = 0x5f3759df - ( GIM_IR(va) >> 1);\
+        isva = GIM_FR(_y);\
+        isva  = isva * ( 1.5f - ( _x * isva * isva ) );\
+    }\
+}\
+
+#define GIM_SQRT(va,sva)\
+{\
+    GIM_INV_SQRT(va,sva);\
+    sva = 1.0f/sva;\
+}\
+
+//! Computes 1.0f / sqrtf(x). Comes from Quake3. See http://www.magic-software.com/3DGEDInvSqrt.html
+inline GREAL gim_inv_sqrt(GREAL f)
+{
+    GREAL r;
+    GIM_INV_SQRT(f,r);
+    return r;
+}
+
+inline GREAL gim_sqrt(GREAL f)
+{
+    GREAL r;
+    GIM_SQRT(f,r);
+    return r;
+}
+
+
+
+#endif // GIM_MATH_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.cpp
new file mode 100644
index 0000000..1636eb7
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.cpp
@@ -0,0 +1,135 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+
+#include "gim_memory.h"
+#include "stdlib.h"
+
+#ifdef GIM_SIMD_MEMORY
+#include "LinearMath/btAlignedAllocator.h"
+#endif
+
+static gim_alloc_function *g_allocfn = 0;
+static gim_alloca_function *g_allocafn = 0;
+static gim_realloc_function *g_reallocfn = 0;
+static gim_free_function *g_freefn = 0;
+
+void gim_set_alloc_handler (gim_alloc_function *fn)
+{
+  g_allocfn = fn;
+}
+
+void gim_set_alloca_handler (gim_alloca_function *fn)
+{
+  g_allocafn = fn;
+}
+
+void gim_set_realloc_handler (gim_realloc_function *fn)
+{
+  g_reallocfn = fn;
+}
+
+void gim_set_free_handler (gim_free_function *fn)
+{
+  g_freefn = fn;
+}
+
+gim_alloc_function *gim_get_alloc_handler()
+{
+  return g_allocfn;
+}
+
+gim_alloca_function *gim_get_alloca_handler()
+{
+  return g_allocafn;
+}
+
+
+gim_realloc_function *gim_get_realloc_handler ()
+{
+  return g_reallocfn;
+}
+
+
+gim_free_function  *gim_get_free_handler ()
+{
+  return g_freefn;
+}
+
+
+void * gim_alloc(size_t size)
+{
+	void * ptr;
+	if (g_allocfn)
+	{
+		ptr = g_allocfn(size);
+	}
+	else
+	{
+#ifdef GIM_SIMD_MEMORY
+		ptr = btAlignedAlloc(size,16);
+#else
+		ptr = malloc(size);
+#endif
+	}
+  	return ptr;
+}
+
+void * gim_alloca(size_t size)
+{
+  if (g_allocafn) return g_allocafn(size); else return gim_alloc(size);
+}
+
+
+void * gim_realloc(void *ptr, size_t oldsize, size_t newsize)
+{
+ 	void * newptr = gim_alloc(newsize);
+    size_t copysize = oldsize<newsize?oldsize:newsize;
+    gim_simd_memcpy(newptr,ptr,copysize);
+    gim_free(ptr);
+    return newptr;
+}
+
+void gim_free(void *ptr)
+{
+	if (!ptr) return;
+	if (g_freefn)
+	{
+	   g_freefn(ptr);
+	}
+	else
+	{
+	#ifdef GIM_SIMD_MEMORY
+		btAlignedFree(ptr);
+	#else
+		free(ptr);
+	#endif
+	}
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.h
new file mode 100644
index 0000000..e203888
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_memory.h
@@ -0,0 +1,190 @@
+#ifndef GIM_MEMORY_H_INCLUDED
+#define GIM_MEMORY_H_INCLUDED
+/*! \file gim_memory.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+
+#include "gim_math.h"
+#include <string.h>
+
+#ifdef PREFETCH
+#include <xmmintrin.h>	// for prefetch
+#define pfval	64
+#define pfval2	128
+//! Prefetch 64
+#define pf(_x,_i)	_mm_prefetch((void *)(_x + _i + pfval), 0)
+//! Prefetch 128
+#define pf2(_x,_i)	_mm_prefetch((void *)(_x + _i + pfval2), 0)
+#else
+//! Prefetch 64
+#define pf(_x,_i)
+//! Prefetch 128
+#define pf2(_x,_i)
+#endif
+
+
+///Functions for manip packed arrays of numbers
+#define GIM_COPY_ARRAYS(dest_array,source_array,element_count)\
+{\
+    for (GUINT _i_=0;_i_<element_count ;++_i_)\
+    {\
+    	dest_array[_i_] = source_array[_i_];\
+    }\
+}\
+
+#define GIM_COPY_ARRAYS_1(dest_array,source_array,element_count,copy_macro)\
+{\
+    for (GUINT _i_=0;_i_<element_count ;++_i_)\
+    {\
+    	copy_macro(dest_array[_i_],source_array[_i_]);\
+    }\
+}\
+
+
+#define GIM_ZERO_ARRAY(array,element_count)\
+{\
+    for (GUINT _i_=0;_i_<element_count ;++_i_)\
+    {\
+    	array[_i_] = 0;\
+    }\
+}\
+
+#define GIM_CONSTANT_ARRAY(array,element_count,constant)\
+{\
+    for (GUINT _i_=0;_i_<element_count ;++_i_)\
+    {\
+    	array[_i_] = constant;\
+    }\
+}\
+
+
+///Function prototypes to allocate and free memory.
+typedef void * gim_alloc_function (size_t size);
+typedef void * gim_alloca_function (size_t size);//Allocs on the heap
+typedef void * gim_realloc_function (void *ptr, size_t oldsize, size_t newsize);
+typedef void gim_free_function (void *ptr);
+
+
+///Memory Function Handlers
+///set new memory management functions. if fn is 0, the default handlers are used.
+void gim_set_alloc_handler (gim_alloc_function *fn);
+void gim_set_alloca_handler (gim_alloca_function *fn);
+void gim_set_realloc_handler (gim_realloc_function *fn);
+void gim_set_free_handler (gim_free_function *fn);
+
+
+///get current memory management functions.
+gim_alloc_function *gim_get_alloc_handler (void);
+gim_alloca_function *gim_get_alloca_handler(void);
+gim_realloc_function *gim_get_realloc_handler (void);
+gim_free_function  *gim_get_free_handler (void);
+
+
+///Standar Memory functions
+void * gim_alloc(size_t size);
+void * gim_alloca(size_t size);
+void * gim_realloc(void *ptr, size_t oldsize, size_t newsize);
+void gim_free(void *ptr);
+
+
+
+#if defined (_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
+    #define GIM_SIMD_MEMORY 1
+#endif
+
+//! SIMD POINTER INTEGER
+#define SIMD_T GUINT64
+//! SIMD INTEGER SIZE
+#define SIMD_T_SIZE sizeof(SIMD_T)
+
+
+inline void gim_simd_memcpy(void * dst, const void * src, size_t copysize)
+{
+#ifdef GIM_SIMD_MEMORY
+/*
+//'long long int' is incompatible with visual studio 6...
+    //copy words
+    SIMD_T * ui_src_ptr = (SIMD_T *)src;
+    SIMD_T * ui_dst_ptr = (SIMD_T *)dst;
+    while(copysize>=SIMD_T_SIZE)
+    {
+        *(ui_dst_ptr++) = *(ui_src_ptr++);
+        copysize-=SIMD_T_SIZE;
+    }
+    if(copysize==0) return;
+*/
+
+    char * c_src_ptr = (char *)src;
+    char * c_dst_ptr = (char *)dst;
+    while(copysize>0)
+    {
+        *(c_dst_ptr++) = *(c_src_ptr++);
+        copysize--;
+    }
+    return;
+#else
+    memcpy(dst,src,copysize);
+#endif
+}
+
+
+
+template<class T>
+inline void gim_swap_elements(T* _array,size_t _i,size_t _j)
+{
+	T _e_tmp_ = _array[_i];
+	_array[_i] = _array[_j];
+	_array[_j] = _e_tmp_;
+}
+
+
+template<class T>
+inline void gim_swap_elements_memcpy(T* _array,size_t _i,size_t _j)
+{
+	char _e_tmp_[sizeof(T)];
+	gim_simd_memcpy(_e_tmp_,&_array[_i],sizeof(T));
+	gim_simd_memcpy(&_array[_i],&_array[_j],sizeof(T));
+	gim_simd_memcpy(&_array[_j],_e_tmp_,sizeof(T));
+}
+
+template <int SIZE>
+inline void gim_swap_elements_ptr(char * _array,size_t _i,size_t _j)
+{
+	char _e_tmp_[SIZE];
+	_i*=SIZE;
+	_j*=SIZE;
+	gim_simd_memcpy(_e_tmp_,_array+_i,SIZE);
+	gim_simd_memcpy(_array+_i,_array+_j,SIZE);
+	gim_simd_memcpy(_array+_j,_e_tmp_,SIZE);
+}
+
+#endif // GIM_MEMORY_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_radixsort.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_radixsort.h
new file mode 100644
index 0000000..c246ef1
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_radixsort.h
@@ -0,0 +1,406 @@
+#ifndef GIM_RADIXSORT_H_INCLUDED
+#define GIM_RADIXSORT_H_INCLUDED
+/*! \file gim_radixsort.h
+\author Francisco Leon Najera.
+Based on the work of Michael Herf : "fast floating-point radix sort"
+Avaliable on http://www.stereopsis.com/radix.html
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+#include "gim_memory.h"
+
+///Macros for sorting.
+//! Prototype for comparators
+class less_comparator
+{
+	public:
+
+	template<class T,class Z>
+	inline int operator() ( const T& a, const Z& b )
+	{
+		return ( a<b?-1:(a>b?1:0));
+	}
+};
+
+//! Prototype for comparators
+class integer_comparator
+{
+	public:
+
+	template<class T>
+	inline int operator() ( const T& a, const T& b )
+	{
+		return (int)(a-b);
+	}
+};
+
+//!Prototype for getting the integer representation of an object
+class uint_key_func
+{
+public:
+	template<class T>
+	inline GUINT operator()( const T& a)
+	{
+		return (GUINT)a;
+	}
+};
+
+
+//!Prototype for copying elements
+class copy_elements_func
+{
+public:
+	template<class T>
+	inline void operator()(T& a,T& b)
+	{
+		a = b;
+	}
+};
+
+//!Prototype for copying elements
+class memcopy_elements_func
+{
+public:
+	template<class T>
+	inline void operator()(T& a,T& b)
+	{
+		gim_simd_memcpy(&a,&b,sizeof(T));
+	}
+};
+
+
+//! @{
+struct GIM_RSORT_TOKEN
+{
+    GUINT m_key;
+    GUINT m_value;
+    GIM_RSORT_TOKEN()
+    {
+    }
+    GIM_RSORT_TOKEN(const GIM_RSORT_TOKEN& rtoken)
+    {
+    	m_key = rtoken.m_key;
+    	m_value = rtoken.m_value;
+    }
+
+    inline bool operator <(const GIM_RSORT_TOKEN& other) const
+	{
+		return (m_key < other.m_key);
+	}
+
+	inline bool operator >(const GIM_RSORT_TOKEN& other) const
+	{
+		return (m_key > other.m_key);
+	}
+};
+
+//! Prototype for comparators
+class GIM_RSORT_TOKEN_COMPARATOR
+{
+	public:
+
+	inline int operator()( const GIM_RSORT_TOKEN& a, const GIM_RSORT_TOKEN& b )
+	{
+		return (int)((a.m_key) - (b.m_key));
+	}
+};
+
+
+
+#define kHist 2048
+// ---- utils for accessing 11-bit quantities
+#define D11_0(x)	(x & 0x7FF)
+#define D11_1(x)	(x >> 11 & 0x7FF)
+#define D11_2(x)	(x >> 22 )
+
+
+
+///Radix sort for unsigned integer keys
+inline void gim_radix_sort_rtokens(
+				GIM_RSORT_TOKEN * array,
+				GIM_RSORT_TOKEN * sorted, GUINT element_count)
+{
+	GUINT i;
+	GUINT b0[kHist * 3];
+	GUINT *b1 = b0 + kHist;
+	GUINT *b2 = b1 + kHist;
+	for (i = 0; i < kHist * 3; ++i)
+	{
+		b0[i] = 0;
+	}
+	GUINT fi;
+	GUINT pos;
+	for (i = 0; i < element_count; ++i)
+	{
+	    fi = array[i].m_key;
+		b0[D11_0(fi)] ++;
+		b1[D11_1(fi)] ++;
+		b2[D11_2(fi)] ++;
+	}
+	{
+		GUINT sum0 = 0, sum1 = 0, sum2 = 0;
+		GUINT tsum;
+		for (i = 0; i < kHist; ++i)
+		{
+			tsum = b0[i] + sum0;
+			b0[i] = sum0 - 1;
+			sum0 = tsum;
+			tsum = b1[i] + sum1;
+			b1[i] = sum1 - 1;
+			sum1 = tsum;
+			tsum = b2[i] + sum2;
+			b2[i] = sum2 - 1;
+			sum2 = tsum;
+		}
+	}
+	for (i = 0; i < element_count; ++i)
+	{
+        fi = array[i].m_key;
+		pos = D11_0(fi);
+		pos = ++b0[pos];
+		sorted[pos].m_key = array[i].m_key;
+		sorted[pos].m_value = array[i].m_value;
+	}
+	for (i = 0; i < element_count; ++i)
+	{
+        fi = sorted[i].m_key;
+		pos = D11_1(fi);
+		pos = ++b1[pos];
+		array[pos].m_key = sorted[i].m_key;
+		array[pos].m_value = sorted[i].m_value;
+	}
+	for (i = 0; i < element_count; ++i)
+	{
+        fi = array[i].m_key;
+		pos = D11_2(fi);
+		pos = ++b2[pos];
+		sorted[pos].m_key = array[i].m_key;
+		sorted[pos].m_value = array[i].m_value;
+	}
+}
+
+
+
+
+/// Get the sorted tokens from an array. For generic use. Tokens are IRR_RSORT_TOKEN
+/*!
+*\param array Array of elements to sort
+*\param sorted_tokens Tokens of sorted elements
+*\param element_count element count
+*\param uintkey_macro Functor which retrieves the integer representation of an array element
+*/
+template<typename T, class GETKEY_CLASS>
+void gim_radix_sort_array_tokens(
+			T* array ,
+			GIM_RSORT_TOKEN * sorted_tokens,
+			GUINT element_count,GETKEY_CLASS uintkey_macro)
+{
+	GIM_RSORT_TOKEN * _unsorted = (GIM_RSORT_TOKEN *) gim_alloc(sizeof(GIM_RSORT_TOKEN)*element_count);
+    for (GUINT _i=0;_i<element_count;++_i)
+    {
+        _unsorted[_i].m_key = uintkey_macro(array[_i]);
+        _unsorted[_i].m_value = _i;
+    }
+    gim_radix_sort_rtokens(_unsorted,sorted_tokens,element_count);
+    gim_free(_unsorted);
+    gim_free(_unsorted);
+}
+
+/// Sorts array in place. For generic use
+/*!
+\param type Type of the array
+\param array
+\param element_count
+\param get_uintkey_macro Macro for extract the Integer value of the element. Similar to SIMPLE_GET_UINTKEY
+\param copy_elements_macro Macro for copy elements, similar to SIMPLE_COPY_ELEMENTS
+*/
+template<typename T, class GETKEY_CLASS, class COPY_CLASS>
+void gim_radix_sort(
+	T * array, GUINT element_count,
+	GETKEY_CLASS get_uintkey_macro, COPY_CLASS copy_elements_macro)
+{
+	GIM_RSORT_TOKEN * _sorted = (GIM_RSORT_TOKEN  *) gim_alloc(sizeof(GIM_RSORT_TOKEN)*element_count);
+    gim_radix_sort_array_tokens(array,_sorted,element_count,get_uintkey_macro);
+    T * _original_array = (T *) gim_alloc(sizeof(T)*element_count);
+    gim_simd_memcpy(_original_array,array,sizeof(T)*element_count);
+    for (GUINT _i=0;_i<element_count;++_i)
+    {
+        copy_elements_macro(array[_i],_original_array[_sorted[_i].m_value]);
+    }
+    gim_free(_original_array);
+    gim_free(_sorted);
+}
+
+//! Failsafe Iterative binary search,
+/*!
+If the element is not found, it returns the nearest upper element position, may be the further position after the last element.
+\param _array
+\param _start_i the beginning of the array
+\param _end_i the ending  index of the array
+\param _search_key Value to find
+\param _comp_macro macro for comparing elements
+\param _found If true the value has found. Boolean
+\param _result_index the index of the found element, or if not found then it will get the index of the  closest bigger value
+*/
+template<class T, typename KEYCLASS, typename COMP_CLASS>
+bool  gim_binary_search_ex(
+		const T* _array, GUINT _start_i,
+		GUINT _end_i,GUINT & _result_index,
+		const KEYCLASS & _search_key,
+		COMP_CLASS _comp_macro)
+{
+	GUINT _k;
+	int _comp_result;
+	GUINT _i = _start_i;
+	GUINT _j = _end_i+1;
+	while (_i < _j)
+	{
+		_k = (_j+_i-1)/2;
+		_comp_result = _comp_macro(_array[_k], _search_key);
+		if (_comp_result == 0)
+		{
+			_result_index = _k;
+			return true;
+		}
+		else if (_comp_result < 0)
+		{
+			_i = _k+1;
+		}
+		else
+		{
+			_j = _k;
+		}
+	}
+	_result_index = _i;
+	return false;
+}
+
+
+
+//! Failsafe Iterative binary search,Template version
+/*!
+If the element is not found, it returns the nearest upper element position, may be the further position after the last element.
+\param _array
+\param _start_i the beginning of the array
+\param _end_i the ending  index of the array
+\param _search_key Value to find
+\param _result_index the index of the found element, or if not found then it will get the index of the  closest bigger value
+\return true if found, else false
+*/
+template<class T>
+bool gim_binary_search(
+	const T*_array,GUINT _start_i,
+	GUINT _end_i,const T & _search_key,
+	GUINT & _result_index)
+{
+	GUINT _i = _start_i;
+	GUINT _j = _end_i+1;
+	GUINT _k;
+	while(_i < _j)
+	{
+		_k = (_j+_i-1)/2;
+		if(_array[_k]==_search_key)
+		{
+			_result_index = _k;
+			return true;
+		}
+		else if (_array[_k]<_search_key)
+		{
+			_i = _k+1;
+		}
+		else
+		{
+			_j = _k;
+		}
+	}
+	_result_index = _i;
+	return false;
+}
+
+
+
+///heap sort from http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Sort/Heap/
+template <typename T, typename COMP_CLASS>
+void gim_down_heap(T *pArr, GUINT k, GUINT n,COMP_CLASS CompareFunc)
+{
+	/*  PRE: a[k+1..N] is a heap */
+	/* POST:  a[k..N]  is a heap */
+
+	T temp = pArr[k - 1];
+	/* k has child(s) */
+	while (k <= n/2)
+	{
+		int child = 2*k;
+
+		if ((child < (int)n) && CompareFunc(pArr[child - 1] , pArr[child])<0)
+		{
+			child++;
+		}
+		/* pick larger child */
+		if (CompareFunc(temp , pArr[child - 1])<0)
+		{
+			/* move child up */
+			pArr[k - 1] = pArr[child - 1];
+			k = child;
+		}
+		else
+		{
+			break;
+		}
+	}
+	pArr[k - 1] = temp;
+} /*downHeap*/
+
+
+template <typename T, typename COMP_CLASS>
+void gim_heap_sort(T *pArr, GUINT element_count, COMP_CLASS CompareFunc)
+{
+	/* sort a[0..N-1],  N.B. 0 to N-1 */
+	GUINT k;
+	GUINT n = element_count;
+	for (k = n/2; k > 0; k--)
+	{
+		gim_down_heap(pArr, k, n, CompareFunc);
+	}
+
+	/* a[1..N] is now a heap */
+	while ( n>=2 )
+	{
+		gim_swap_elements(pArr,0,n-1); /* largest of a[0..n-1] */
+		--n;
+		/* restore a[1..i-1] heap */
+		gim_down_heap(pArr, 1, n, CompareFunc);
+	}
+}
+
+
+
+
+#endif // GIM_RADIXSORT_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.cpp b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.cpp
new file mode 100644
index 0000000..f9727e1
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.cpp
@@ -0,0 +1,640 @@
+
+/*! \file gim_tri_collision.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+#include "gim_tri_collision.h"
+
+
+#define TRI_LOCAL_EPSILON 0.000001f
+#define MIN_EDGE_EDGE_DIS 0.00001f
+
+
+class GIM_TRIANGLE_CALCULATION_CACHE
+{
+public:
+	GREAL margin;	
+	btVector3 tu_vertices[3];
+	btVector3 tv_vertices[3];
+	btVector4 tu_plane;
+	btVector4 tv_plane;
+	btVector3 closest_point_u;
+	btVector3 closest_point_v;
+	btVector3 edge_edge_dir;
+	btVector3 distances;
+	GREAL du[4];
+	GREAL du0du1;
+	GREAL du0du2;
+	GREAL dv[4];
+	GREAL dv0dv1;
+	GREAL dv0dv2;	
+	btVector3 temp_points[MAX_TRI_CLIPPING];
+	btVector3 temp_points1[MAX_TRI_CLIPPING];
+	btVector3 contact_points[MAX_TRI_CLIPPING];
+	
+
+
+	//! if returns false, the faces are paralele
+	SIMD_FORCE_INLINE bool compute_intervals(
+					const GREAL &D0,
+					const GREAL &D1,
+					const GREAL &D2,
+					const GREAL &D0D1,
+					const GREAL &D0D2,
+					GREAL & scale_edge0,
+					GREAL & scale_edge1,
+					GUINT &edge_index0,
+					GUINT &edge_index1)
+	{
+		if(D0D1>0.0f)
+		{
+			/* here we know that D0D2<=0.0 */
+			/* that is D0, D1 are on the same side, D2 on the other or on the plane */
+			scale_edge0 = -D2/(D0-D2);
+			scale_edge1 = -D1/(D2-D1);
+			edge_index0 = 2;edge_index1 = 1;
+		}
+		else if(D0D2>0.0f)
+		{
+			/* here we know that d0d1<=0.0 */
+			scale_edge0 = -D0/(D1-D0);
+			scale_edge1 = -D1/(D2-D1);
+			edge_index0 = 0;edge_index1 = 1;
+		}
+		else if(D1*D2>0.0f || D0!=0.0f)
+		{
+			/* here we know that d0d1<=0.0 or that D0!=0.0 */
+			scale_edge0 = -D0/(D1-D0);
+			scale_edge1 = -D2/(D0-D2);
+			edge_index0 = 0 ;edge_index1 = 2;
+		}
+		else
+		{
+			return false;
+		}
+		return true;
+	}
+
+
+	//! clip triangle
+	/*!
+	*/
+	SIMD_FORCE_INLINE GUINT clip_triangle(
+		const btVector4 & tri_plane,
+		const btVector3 * tripoints,
+		const btVector3 * srcpoints,
+		btVector3 * clip_points)
+	{
+		// edge 0
+
+		btVector4 edgeplane;
+
+		EDGE_PLANE(tripoints[0],tripoints[1],tri_plane,edgeplane);
+
+		GUINT clipped_count = PLANE_CLIP_TRIANGLE3D(
+			edgeplane,srcpoints[0],srcpoints[1],srcpoints[2],temp_points);
+
+		if(clipped_count == 0) return 0;
+
+		// edge 1
+
+		EDGE_PLANE(tripoints[1],tripoints[2],tri_plane,edgeplane);
+
+		clipped_count = PLANE_CLIP_POLYGON3D(
+			edgeplane,temp_points,clipped_count,temp_points1);
+
+		if(clipped_count == 0) return 0;
+
+		// edge 2
+
+		EDGE_PLANE(tripoints[2],tripoints[0],tri_plane,edgeplane);
+
+		clipped_count = PLANE_CLIP_POLYGON3D(
+			edgeplane,temp_points1,clipped_count,clip_points);
+
+		return clipped_count;
+
+
+		/*GUINT i0 = (tri_plane.closestAxis()+1)%3;
+		GUINT i1 = (i0+1)%3;
+		// edge 0
+		btVector3 temp_points[MAX_TRI_CLIPPING];
+		btVector3 temp_points1[MAX_TRI_CLIPPING];
+
+		GUINT clipped_count= PLANE_CLIP_TRIANGLE_GENERIC(
+			0,srcpoints[0],srcpoints[1],srcpoints[2],temp_points,
+			DISTANCE_EDGE(tripoints[0],tripoints[1],i0,i1));
+		
+		
+		if(clipped_count == 0) return 0;
+
+		// edge 1
+		clipped_count = PLANE_CLIP_POLYGON_GENERIC(
+			0,temp_points,clipped_count,temp_points1,
+			DISTANCE_EDGE(tripoints[1],tripoints[2],i0,i1));
+
+		if(clipped_count == 0) return 0;
+
+		// edge 2
+		clipped_count = PLANE_CLIP_POLYGON_GENERIC(
+			0,temp_points1,clipped_count,clipped_points,
+			DISTANCE_EDGE(tripoints[2],tripoints[0],i0,i1));
+
+		return clipped_count;*/
+	}
+
+	SIMD_FORCE_INLINE void sort_isect(
+		GREAL & isect0,GREAL & isect1,GUINT &e0,GUINT &e1,btVector3 & vec0,btVector3 & vec1)
+	{
+		if(isect1<isect0)
+		{
+			//swap
+			GIM_SWAP_NUMBERS(isect0,isect1);
+			GIM_SWAP_NUMBERS(e0,e1);
+			btVector3 tmp = vec0;
+			vec0 = vec1;
+			vec1 = tmp;
+		}
+	}
+
+	//! Test verifying interval intersection with the direction between planes
+	/*!
+	\pre tv_plane and tu_plane must be set
+	\post
+	distances[2] is set with the distance
+	closest_point_u, closest_point_v, edge_edge_dir are set too
+	\return
+	- 0: faces are paralele
+	- 1: face U casts face V
+	- 2: face V casts face U
+	- 3: nearest edges
+	*/
+	SIMD_FORCE_INLINE GUINT cross_line_intersection_test()
+	{
+		// Compute direction of intersection line
+		edge_edge_dir = tu_plane.cross(tv_plane);
+		GREAL Dlen;
+		VEC_LENGTH(edge_edge_dir,Dlen);
+
+		if(Dlen<0.0001)
+		{
+			return 0; //faces near paralele
+		}
+
+		edge_edge_dir*= 1/Dlen;//normalize
+
+
+		// Compute interval for triangle 1
+		GUINT tu_e0,tu_e1;//edge indices
+		GREAL tu_scale_e0,tu_scale_e1;//edge scale
+		if(!compute_intervals(du[0],du[1],du[2],
+			du0du1,du0du2,tu_scale_e0,tu_scale_e1,tu_e0,tu_e1)) return 0;
+
+		// Compute interval for triangle 2
+		GUINT tv_e0,tv_e1;//edge indices
+		GREAL tv_scale_e0,tv_scale_e1;//edge scale
+
+		if(!compute_intervals(dv[0],dv[1],dv[2],
+			dv0dv1,dv0dv2,tv_scale_e0,tv_scale_e1,tv_e0,tv_e1)) return 0;
+
+		//proyected vertices
+		btVector3 up_e0 = tu_vertices[tu_e0].lerp(tu_vertices[(tu_e0+1)%3],tu_scale_e0);
+		btVector3 up_e1 = tu_vertices[tu_e1].lerp(tu_vertices[(tu_e1+1)%3],tu_scale_e1);
+
+		btVector3 vp_e0 = tv_vertices[tv_e0].lerp(tv_vertices[(tv_e0+1)%3],tv_scale_e0);
+		btVector3 vp_e1 = tv_vertices[tv_e1].lerp(tv_vertices[(tv_e1+1)%3],tv_scale_e1);
+
+		//proyected intervals
+		GREAL isect_u[] = {up_e0.dot(edge_edge_dir),up_e1.dot(edge_edge_dir)};
+		GREAL isect_v[] = {vp_e0.dot(edge_edge_dir),vp_e1.dot(edge_edge_dir)};
+
+		sort_isect(isect_u[0],isect_u[1],tu_e0,tu_e1,up_e0,up_e1);
+		sort_isect(isect_v[0],isect_v[1],tv_e0,tv_e1,vp_e0,vp_e1);
+
+		const GREAL midpoint_u = 0.5f*(isect_u[0]+isect_u[1]); // midpoint
+		const GREAL midpoint_v = 0.5f*(isect_v[0]+isect_v[1]); // midpoint
+
+		if(midpoint_u<midpoint_v)
+		{
+			if(isect_u[1]>=isect_v[1]) // face U casts face V
+			{
+				return 1;
+			}
+			else if(isect_v[0]<=isect_u[0]) // face V casts face U
+			{
+				return 2;
+			}
+			// closest points
+			closest_point_u = up_e1;
+			closest_point_v = vp_e0;
+			// calc edges and separation
+
+			if(isect_u[1]+ MIN_EDGE_EDGE_DIS<isect_v[0]) //calc distance between two lines instead
+			{
+				SEGMENT_COLLISION(
+					tu_vertices[tu_e1],tu_vertices[(tu_e1+1)%3],
+					tv_vertices[tv_e0],tv_vertices[(tv_e0+1)%3],
+					closest_point_u,
+					closest_point_v);
+
+				edge_edge_dir = closest_point_u-closest_point_v;
+				VEC_LENGTH(edge_edge_dir,distances[2]);
+				edge_edge_dir *= 1.0f/distances[2];// normalize
+			}
+			else
+			{
+				distances[2] = isect_v[0]-isect_u[1];//distance negative
+				//edge_edge_dir *= -1.0f; //normal pointing from V to U
+			}
+
+		}
+		else
+		{
+			if(isect_v[1]>=isect_u[1]) // face V casts face U
+			{
+				return 2;
+			}
+			else if(isect_u[0]<=isect_v[0]) // face U casts face V
+			{
+				return 1;
+			}
+			// closest points
+			closest_point_u = up_e0;
+			closest_point_v = vp_e1;
+			// calc edges and separation
+
+			if(isect_v[1]+MIN_EDGE_EDGE_DIS<isect_u[0]) //calc distance between two lines instead
+			{
+				SEGMENT_COLLISION(
+					tu_vertices[tu_e0],tu_vertices[(tu_e0+1)%3],
+					tv_vertices[tv_e1],tv_vertices[(tv_e1+1)%3],
+					closest_point_u,
+					closest_point_v);
+
+				edge_edge_dir = closest_point_u-closest_point_v;
+				VEC_LENGTH(edge_edge_dir,distances[2]);
+				edge_edge_dir *= 1.0f/distances[2];// normalize
+			}
+			else
+			{
+				distances[2] = isect_u[0]-isect_v[1];//distance negative
+				//edge_edge_dir *= -1.0f; //normal pointing from V to U
+			}
+		}
+		return 3;
+	}
+
+
+	//! collides by two sides
+	SIMD_FORCE_INLINE bool triangle_collision(
+					const btVector3 & u0,
+					const btVector3 & u1,
+					const btVector3 & u2,
+					GREAL margin_u,
+					const btVector3 & v0,
+					const btVector3 & v1,
+					const btVector3 & v2,
+					GREAL margin_v,
+					GIM_TRIANGLE_CONTACT_DATA & contacts)
+	{
+
+		margin = margin_u + margin_v;
+
+		tu_vertices[0] = u0;
+		tu_vertices[1] = u1;
+		tu_vertices[2] = u2;
+
+		tv_vertices[0] = v0;
+		tv_vertices[1] = v1;
+		tv_vertices[2] = v2;
+
+		//create planes
+		// plane v vs U points
+
+		TRIANGLE_PLANE(tv_vertices[0],tv_vertices[1],tv_vertices[2],tv_plane);
+
+		du[0] = DISTANCE_PLANE_POINT(tv_plane,tu_vertices[0]);
+		du[1] = DISTANCE_PLANE_POINT(tv_plane,tu_vertices[1]);
+		du[2] = DISTANCE_PLANE_POINT(tv_plane,tu_vertices[2]);
+
+
+		du0du1 = du[0] * du[1];
+		du0du2 = du[0] * du[2];
+
+
+		if(du0du1>0.0f && du0du2>0.0f)	// same sign on all of them + not equal 0 ?
+		{
+			if(du[0]<0) //we need test behind the triangle plane
+			{
+				distances[0] = GIM_MAX3(du[0],du[1],du[2]);
+				distances[0] = -distances[0];
+				if(distances[0]>margin) return false; //never intersect
+
+				//reorder triangle v
+				VEC_SWAP(tv_vertices[0],tv_vertices[1]);
+				VEC_SCALE_4(tv_plane,-1.0f,tv_plane);
+			}
+			else
+			{
+				distances[0] = GIM_MIN3(du[0],du[1],du[2]);
+				if(distances[0]>margin) return false; //never intersect
+			}
+		}
+		else
+		{
+			//Look if we need to invert the triangle
+			distances[0] = (du[0]+du[1]+du[2])/3.0f; //centroid
+
+			if(distances[0]<0.0f)
+			{
+				//reorder triangle v
+				VEC_SWAP(tv_vertices[0],tv_vertices[1]);
+				VEC_SCALE_4(tv_plane,-1.0f,tv_plane);
+
+				distances[0] = GIM_MAX3(du[0],du[1],du[2]);
+				distances[0] = -distances[0];
+			}
+			else
+			{
+				distances[0] = GIM_MIN3(du[0],du[1],du[2]);
+			}
+		}
+
+
+		// plane U vs V points
+
+		TRIANGLE_PLANE(tu_vertices[0],tu_vertices[1],tu_vertices[2],tu_plane);
+
+		dv[0] = DISTANCE_PLANE_POINT(tu_plane,tv_vertices[0]);
+		dv[1] = DISTANCE_PLANE_POINT(tu_plane,tv_vertices[1]);
+		dv[2] = DISTANCE_PLANE_POINT(tu_plane,tv_vertices[2]);
+
+		dv0dv1 = dv[0] * dv[1];
+		dv0dv2 = dv[0] * dv[2];
+
+
+		if(dv0dv1>0.0f && dv0dv2>0.0f)	// same sign on all of them + not equal 0 ?
+		{
+			if(dv[0]<0) //we need test behind the triangle plane
+			{
+				distances[1] = GIM_MAX3(dv[0],dv[1],dv[2]);
+				distances[1] = -distances[1];
+				if(distances[1]>margin) return false; //never intersect
+
+				//reorder triangle u
+				VEC_SWAP(tu_vertices[0],tu_vertices[1]);
+				VEC_SCALE_4(tu_plane,-1.0f,tu_plane);
+			}
+			else
+			{
+				distances[1] = GIM_MIN3(dv[0],dv[1],dv[2]);
+				if(distances[1]>margin) return false; //never intersect
+			}
+		}
+		else
+		{
+			//Look if we need to invert the triangle
+			distances[1] = (dv[0]+dv[1]+dv[2])/3.0f; //centroid
+
+			if(distances[1]<0.0f)
+			{
+				//reorder triangle v
+				VEC_SWAP(tu_vertices[0],tu_vertices[1]);
+				VEC_SCALE_4(tu_plane,-1.0f,tu_plane);
+
+				distances[1] = GIM_MAX3(dv[0],dv[1],dv[2]);
+				distances[1] = -distances[1];
+			}
+			else
+			{
+				distances[1] = GIM_MIN3(dv[0],dv[1],dv[2]);
+			}
+		}
+
+		GUINT bl;
+		/* bl = cross_line_intersection_test();
+		if(bl==3)
+		{
+			//take edge direction too
+			bl = distances.maxAxis();
+		}
+		else
+		{*/
+			bl = 0;
+			if(distances[0]<distances[1]) bl = 1;
+		//}
+
+		if(bl==2) //edge edge separation
+		{
+			if(distances[2]>margin) return false;
+
+			contacts.m_penetration_depth = -distances[2] + margin;
+			contacts.m_points[0] = closest_point_v;
+			contacts.m_point_count = 1;
+			VEC_COPY(contacts.m_separating_normal,edge_edge_dir);
+
+			return true;
+		}
+
+		//clip face against other
+
+		
+		GUINT point_count;
+		//TODO
+		if(bl == 0) //clip U points against V
+		{
+			point_count = clip_triangle(tv_plane,tv_vertices,tu_vertices,contact_points);
+			if(point_count == 0) return false;						
+			contacts.merge_points(tv_plane,margin,contact_points,point_count);			
+		}
+		else //clip V points against U
+		{
+			point_count = clip_triangle(tu_plane,tu_vertices,tv_vertices,contact_points);
+			if(point_count == 0) return false;			
+			contacts.merge_points(tu_plane,margin,contact_points,point_count);
+			contacts.m_separating_normal *= -1.f;
+		}
+		if(contacts.m_point_count == 0) return false;
+		return true;
+	}
+
+};
+
+
+/*class GIM_TRIANGLE_CALCULATION_CACHE
+{
+public:
+	GREAL margin;
+	GUINT clipped_count;
+	btVector3 tu_vertices[3];
+	btVector3 tv_vertices[3];
+	btVector3 temp_points[MAX_TRI_CLIPPING];
+	btVector3 temp_points1[MAX_TRI_CLIPPING];
+	btVector3 clipped_points[MAX_TRI_CLIPPING];
+	GIM_TRIANGLE_CONTACT_DATA contacts1;
+	GIM_TRIANGLE_CONTACT_DATA contacts2;
+
+
+	//! clip triangle
+	GUINT clip_triangle(
+		const btVector4 & tri_plane,
+		const btVector3 * tripoints,
+		const btVector3 * srcpoints,
+		btVector3 * clipped_points)
+	{
+		// edge 0
+
+		btVector4 edgeplane;
+
+		EDGE_PLANE(tripoints[0],tripoints[1],tri_plane,edgeplane);
+
+		GUINT clipped_count = PLANE_CLIP_TRIANGLE3D(
+			edgeplane,srcpoints[0],srcpoints[1],srcpoints[2],temp_points);
+
+		if(clipped_count == 0) return 0;
+
+		// edge 1
+
+		EDGE_PLANE(tripoints[1],tripoints[2],tri_plane,edgeplane);
+
+		clipped_count = PLANE_CLIP_POLYGON3D(
+			edgeplane,temp_points,clipped_count,temp_points1);
+
+		if(clipped_count == 0) return 0;
+
+		// edge 2
+
+		EDGE_PLANE(tripoints[2],tripoints[0],tri_plane,edgeplane);
+
+		clipped_count = PLANE_CLIP_POLYGON3D(
+			edgeplane,temp_points1,clipped_count,clipped_points);
+
+		return clipped_count;
+	}
+
+
+
+
+	//! collides only on one side
+	bool triangle_collision(
+					const btVector3 & u0,
+					const btVector3 & u1,
+					const btVector3 & u2,
+					GREAL margin_u,
+					const btVector3 & v0,
+					const btVector3 & v1,
+					const btVector3 & v2,
+					GREAL margin_v,
+					GIM_TRIANGLE_CONTACT_DATA & contacts)
+	{
+
+		margin = margin_u + margin_v;
+
+		
+		tu_vertices[0] = u0;
+		tu_vertices[1] = u1;
+		tu_vertices[2] = u2;
+
+		tv_vertices[0] = v0;
+		tv_vertices[1] = v1;
+		tv_vertices[2] = v2;
+
+		//create planes
+		// plane v vs U points
+
+
+		TRIANGLE_PLANE(tv_vertices[0],tv_vertices[1],tv_vertices[2],contacts1.m_separating_normal);
+
+		clipped_count = clip_triangle(
+			contacts1.m_separating_normal,tv_vertices,tu_vertices,clipped_points);
+
+		if(clipped_count == 0 )
+		{
+			 return false;//Reject
+		}
+
+		//find most deep interval face1
+		contacts1.merge_points(contacts1.m_separating_normal,margin,clipped_points,clipped_count);
+		if(contacts1.m_point_count == 0) return false; // too far
+
+		//Normal pointing to triangle1
+		//contacts1.m_separating_normal *= -1.f;
+
+		//Clip tri1 by tri2 edges
+
+		TRIANGLE_PLANE(tu_vertices[0],tu_vertices[1],tu_vertices[2],contacts2.m_separating_normal);
+
+		clipped_count = clip_triangle(
+			contacts2.m_separating_normal,tu_vertices,tv_vertices,clipped_points);
+
+		if(clipped_count == 0 )
+		{
+			 return false;//Reject
+		}
+
+		//find most deep interval face1
+		contacts2.merge_points(contacts2.m_separating_normal,margin,clipped_points,clipped_count);
+		if(contacts2.m_point_count == 0) return false; // too far
+
+		contacts2.m_separating_normal *= -1.f;
+
+		////check most dir for contacts
+		if(contacts2.m_penetration_depth<contacts1.m_penetration_depth)
+		{
+			contacts.copy_from(contacts2);
+		}
+		else
+		{
+			contacts.copy_from(contacts1);
+		}
+		return true;
+	}
+
+
+};*/
+
+
+
+bool GIM_TRIANGLE::collide_triangle_hard_test(
+		const GIM_TRIANGLE & other,
+		GIM_TRIANGLE_CONTACT_DATA & contact_data) const
+{
+	GIM_TRIANGLE_CALCULATION_CACHE calc_cache;	
+	return calc_cache.triangle_collision(
+					m_vertices[0],m_vertices[1],m_vertices[2],m_margin,
+					other.m_vertices[0],other.m_vertices[1],other.m_vertices[2],other.m_margin,
+					contact_data);
+
+}
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.h b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.h
new file mode 100644
index 0000000..5b552a1
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/Gimpact/gim_tri_collision.h
@@ -0,0 +1,379 @@
+#ifndef GIM_TRI_COLLISION_H_INCLUDED
+#define GIM_TRI_COLLISION_H_INCLUDED
+
+/*! \file gim_tri_collision.h
+\author Francisco Leon Najera
+*/
+/*
+-----------------------------------------------------------------------------
+This source file is part of GIMPACT Library.
+
+For the latest info, see http://gimpact.sourceforge.net/
+
+Copyright (c) 2006 Francisco Leon Najera. C.C. 80087371.
+email: projectileman at yahoo.com
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of EITHER:
+   (1) The GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 2.1 of the License, or (at
+       your option) any later version. The text of the GNU Lesser
+       General Public License is included with this library in the
+       file GIMPACT-LICENSE-LGPL.TXT.
+   (2) The BSD-style license that is included with this library in
+       the file GIMPACT-LICENSE-BSD.TXT.
+   (3) The zlib/libpng license that is included with this library in
+       the file GIMPACT-LICENSE-ZLIB.TXT.
+
+ This library 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 files
+ GIMPACT-LICENSE-LGPL.TXT, GIMPACT-LICENSE-ZLIB.TXT and GIMPACT-LICENSE-BSD.TXT for more details.
+
+-----------------------------------------------------------------------------
+*/
+
+#include "gim_box_collision.h"
+#include "gim_clip_polygon.h"
+
+
+
+
+#define MAX_TRI_CLIPPING 16
+
+//! Structure for collision
+struct GIM_TRIANGLE_CONTACT_DATA
+{
+    GREAL m_penetration_depth;
+    GUINT m_point_count;
+    btVector4 m_separating_normal;
+    btVector3 m_points[MAX_TRI_CLIPPING];
+
+	SIMD_FORCE_INLINE void copy_from(const GIM_TRIANGLE_CONTACT_DATA& other)
+	{
+		m_penetration_depth = other.m_penetration_depth;
+		m_separating_normal = other.m_separating_normal;
+		m_point_count = other.m_point_count;
+		GUINT i = m_point_count;
+		while(i--)
+		{
+			m_points[i] = other.m_points[i];
+		}
+	}
+
+	GIM_TRIANGLE_CONTACT_DATA()
+	{
+	}
+
+	GIM_TRIANGLE_CONTACT_DATA(const GIM_TRIANGLE_CONTACT_DATA& other)
+	{
+		copy_from(other);
+	}
+
+	
+	
+
+    //! classify points that are closer
+    template<typename DISTANCE_FUNC,typename CLASS_PLANE>
+    SIMD_FORCE_INLINE void mergepoints_generic(const CLASS_PLANE & plane,
+    				GREAL margin, const btVector3 * points, GUINT point_count, DISTANCE_FUNC distance_func)
+    {	
+    	m_point_count = 0;
+    	m_penetration_depth= -1000.0f;
+
+		GUINT point_indices[MAX_TRI_CLIPPING];
+
+		GUINT _k;
+
+		for(_k=0;_k<point_count;_k++)
+		{
+			GREAL _dist = -distance_func(plane,points[_k]) + margin;
+
+			if(_dist>=0.0f)
+			{
+				if(_dist>m_penetration_depth)
+				{
+					m_penetration_depth = _dist;
+					point_indices[0] = _k;
+					m_point_count=1;
+				}
+				else if((_dist+G_EPSILON)>=m_penetration_depth)
+				{
+					point_indices[m_point_count] = _k;
+					m_point_count++;
+				}
+			}
+		}
+
+		for( _k=0;_k<m_point_count;_k++)
+		{
+			m_points[_k] = points[point_indices[_k]];
+		}
+	}
+
+	//! classify points that are closer
+	SIMD_FORCE_INLINE void merge_points(const btVector4 & plane, GREAL margin,
+										 const btVector3 * points, GUINT point_count)
+	{
+		m_separating_normal = plane;
+		mergepoints_generic(plane, margin, points, point_count, DISTANCE_PLANE_3D_FUNC());
+	}
+};
+
+
+//! Class for colliding triangles
+class GIM_TRIANGLE
+{
+public:
+	btScalar m_margin;
+    btVector3 m_vertices[3];
+
+    GIM_TRIANGLE():m_margin(0.1f)
+    {
+    }
+
+    SIMD_FORCE_INLINE GIM_AABB get_box()  const
+    {
+    	return GIM_AABB(m_vertices[0],m_vertices[1],m_vertices[2],m_margin);
+    }
+
+    SIMD_FORCE_INLINE void get_normal(btVector3 &normal)  const
+    {
+    	TRIANGLE_NORMAL(m_vertices[0],m_vertices[1],m_vertices[2],normal);
+    }
+
+    SIMD_FORCE_INLINE void get_plane(btVector4 &plane)  const
+    {
+    	TRIANGLE_PLANE(m_vertices[0],m_vertices[1],m_vertices[2],plane);;
+    }
+
+    SIMD_FORCE_INLINE void apply_transform(const btTransform & trans)
+    {
+    	m_vertices[0] = trans(m_vertices[0]);
+    	m_vertices[1] = trans(m_vertices[1]);
+    	m_vertices[2] = trans(m_vertices[2]);
+    }
+
+    SIMD_FORCE_INLINE void get_edge_plane(GUINT edge_index,const btVector3 &triangle_normal,btVector4 &plane)  const
+    {
+		const btVector3 & e0 = m_vertices[edge_index];
+		const btVector3 & e1 = m_vertices[(edge_index+1)%3];
+		EDGE_PLANE(e0,e1,triangle_normal,plane);
+    }
+
+    //! Gets the relative transformation of this triangle
+    /*!
+    The transformation is oriented to the triangle normal , and aligned to the 1st edge of this triangle. The position corresponds to vertice 0:
+    - triangle normal corresponds to Z axis.
+    - 1st normalized edge corresponds to X axis,
+
+    */
+    SIMD_FORCE_INLINE void get_triangle_transform(btTransform & triangle_transform)  const
+    {
+    	btMatrix3x3 & matrix = triangle_transform.getBasis();
+
+    	btVector3 zaxis;
+    	get_normal(zaxis);
+    	MAT_SET_Z(matrix,zaxis);
+
+    	btVector3 xaxis = m_vertices[1] - m_vertices[0];
+    	VEC_NORMALIZE(xaxis);
+    	MAT_SET_X(matrix,xaxis);
+
+    	//y axis
+    	xaxis = zaxis.cross(xaxis);
+    	MAT_SET_Y(matrix,xaxis);
+
+    	triangle_transform.setOrigin(m_vertices[0]);
+    }
+
+
+	//! Test triangles by finding separating axis
+	/*!
+	\param other Triangle for collide
+	\param contact_data Structure for holding contact points, normal and penetration depth; The normal is pointing toward this triangle from the other triangle
+	*/
+	bool collide_triangle_hard_test(
+		const GIM_TRIANGLE & other,
+		GIM_TRIANGLE_CONTACT_DATA & contact_data) const;
+
+	//! Test boxes before doing hard test
+	/*!
+	\param other Triangle for collide
+	\param contact_data Structure for holding contact points, normal and penetration depth; The normal is pointing toward this triangle from the other triangle
+	\
+	*/
+	SIMD_FORCE_INLINE bool collide_triangle(
+		const GIM_TRIANGLE & other,
+		GIM_TRIANGLE_CONTACT_DATA & contact_data) const
+	{
+		//test box collisioin
+		GIM_AABB boxu(m_vertices[0],m_vertices[1],m_vertices[2],m_margin);
+		GIM_AABB boxv(other.m_vertices[0],other.m_vertices[1],other.m_vertices[2],other.m_margin);
+		if(!boxu.has_collision(boxv)) return false;
+
+		//do hard test
+		return collide_triangle_hard_test(other,contact_data);
+	}
+
+	/*!
+
+	Solve the System for u,v parameters:
+
+	u*axe1[i1] + v*axe2[i1] = vecproj[i1]
+	u*axe1[i2] + v*axe2[i2] = vecproj[i2]
+
+	sustitute:
+	v = (vecproj[i2] - u*axe1[i2])/axe2[i2]
+
+	then the first equation in terms of 'u':
+
+	--> u*axe1[i1] + ((vecproj[i2] - u*axe1[i2])/axe2[i2])*axe2[i1] = vecproj[i1]
+
+	--> u*axe1[i1] + vecproj[i2]*axe2[i1]/axe2[i2] - u*axe1[i2]*axe2[i1]/axe2[i2] = vecproj[i1]
+
+	--> u*(axe1[i1]  - axe1[i2]*axe2[i1]/axe2[i2]) = vecproj[i1] - vecproj[i2]*axe2[i1]/axe2[i2]
+
+	--> u*((axe1[i1]*axe2[i2]  - axe1[i2]*axe2[i1])/axe2[i2]) = (vecproj[i1]*axe2[i2] - vecproj[i2]*axe2[i1])/axe2[i2]
+
+	--> u*(axe1[i1]*axe2[i2]  - axe1[i2]*axe2[i1]) = vecproj[i1]*axe2[i2] - vecproj[i2]*axe2[i1]
+
+	--> u = (vecproj[i1]*axe2[i2] - vecproj[i2]*axe2[i1]) /(axe1[i1]*axe2[i2]  - axe1[i2]*axe2[i1])
+
+if 0.0<= u+v <=1.0 then they are inside of triangle
+
+	\return false if the point is outside of triangle.This function  doesn't take the margin
+	*/
+	SIMD_FORCE_INLINE bool get_uv_parameters(
+			const btVector3 & point,
+			const btVector3 & tri_plane,
+			GREAL & u, GREAL & v) const
+	{
+		btVector3 _axe1 = m_vertices[1]-m_vertices[0];
+		btVector3 _axe2 = m_vertices[2]-m_vertices[0];
+		btVector3 _vecproj = point - m_vertices[0];
+		GUINT _i1 = (tri_plane.closestAxis()+1)%3;
+		GUINT _i2 = (_i1+1)%3;
+		if(btFabs(_axe2[_i2])<G_EPSILON)
+		{
+			u = (_vecproj[_i2]*_axe2[_i1] - _vecproj[_i1]*_axe2[_i2]) /(_axe1[_i2]*_axe2[_i1]  - _axe1[_i1]*_axe2[_i2]);
+			v = (_vecproj[_i1] - u*_axe1[_i1])/_axe2[_i1];
+		}
+		else
+		{
+			u = (_vecproj[_i1]*_axe2[_i2] - _vecproj[_i2]*_axe2[_i1]) /(_axe1[_i1]*_axe2[_i2]  - _axe1[_i2]*_axe2[_i1]);
+			v = (_vecproj[_i2] - u*_axe1[_i2])/_axe2[_i2];
+		}
+
+		if(u<-G_EPSILON)
+		{
+			return false;
+		}
+		else if(v<-G_EPSILON)
+		{
+			return false;
+		}
+		else
+		{
+			btScalar sumuv;
+			sumuv = u+v;
+			if(sumuv<-G_EPSILON)
+			{
+				return false;
+			}
+			else if(sumuv-1.0f>G_EPSILON)
+			{
+				return false;
+			}
+		}
+		return true;
+	}
+
+	//! is point in triangle beam?
+	/*!
+	Test if point is in triangle, with m_margin tolerance
+	*/
+	SIMD_FORCE_INLINE bool is_point_inside(const btVector3 & point, const btVector3 & tri_normal) const
+	{
+		//Test with edge 0
+		btVector4 edge_plane;
+		this->get_edge_plane(0,tri_normal,edge_plane);
+		GREAL dist = DISTANCE_PLANE_POINT(edge_plane,point);
+		if(dist-m_margin>0.0f) return false; // outside plane
+
+		this->get_edge_plane(1,tri_normal,edge_plane);
+		dist = DISTANCE_PLANE_POINT(edge_plane,point);
+		if(dist-m_margin>0.0f) return false; // outside plane
+
+		this->get_edge_plane(2,tri_normal,edge_plane);
+		dist = DISTANCE_PLANE_POINT(edge_plane,point);
+		if(dist-m_margin>0.0f) return false; // outside plane
+		return true;
+	}
+
+
+	//! Bidireccional ray collision
+	SIMD_FORCE_INLINE bool ray_collision(
+		const btVector3 & vPoint,
+		const btVector3 & vDir, btVector3 & pout, btVector3 & triangle_normal,
+		GREAL & tparam, GREAL tmax = G_REAL_INFINITY)
+	{
+		btVector4 faceplane;
+		{
+			btVector3 dif1 = m_vertices[1] - m_vertices[0];
+			btVector3 dif2 = m_vertices[2] - m_vertices[0];
+    		VEC_CROSS(faceplane,dif1,dif2);
+    		faceplane[3] = m_vertices[0].dot(faceplane);
+		}
+
+		GUINT res = LINE_PLANE_COLLISION(faceplane,vDir,vPoint,pout,tparam, btScalar(0), tmax);
+		if(res == 0) return false;
+		if(! is_point_inside(pout,faceplane)) return false;
+
+		if(res==2) //invert normal
+		{
+			triangle_normal.setValue(-faceplane[0],-faceplane[1],-faceplane[2]);
+		}
+		else
+		{
+			triangle_normal.setValue(faceplane[0],faceplane[1],faceplane[2]);
+		}
+
+		VEC_NORMALIZE(triangle_normal);
+
+		return true;
+	}
+
+
+	//! one direccion ray collision
+	SIMD_FORCE_INLINE bool ray_collision_front_side(
+		const btVector3 & vPoint,
+		const btVector3 & vDir, btVector3 & pout, btVector3 & triangle_normal,
+		GREAL & tparam, GREAL tmax = G_REAL_INFINITY)
+	{
+		btVector4 faceplane;
+		{
+			btVector3 dif1 = m_vertices[1] - m_vertices[0];
+			btVector3 dif2 = m_vertices[2] - m_vertices[0];
+    		VEC_CROSS(faceplane,dif1,dif2);
+    		faceplane[3] = m_vertices[0].dot(faceplane);
+		}
+
+		GUINT res = LINE_PLANE_COLLISION(faceplane,vDir,vPoint,pout,tparam, btScalar(0), tmax);
+		if(res != 1) return false;
+
+		if(!is_point_inside(pout,faceplane)) return false;
+
+		triangle_normal.setValue(faceplane[0],faceplane[1],faceplane[2]);
+
+		VEC_NORMALIZE(triangle_normal);
+
+		return true;
+	}
+
+};
+
+
+
+
+#endif // GIM_TRI_COLLISION_H_INCLUDED
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
new file mode 100644
index 0000000..91fcea5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
@@ -0,0 +1,243 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btContinuousConvexCollision.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
+#include "LinearMath/btTransformUtil.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+
+#include "btGjkPairDetector.h"
+#include "btPointCollector.h"
+#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
+
+
+
+btContinuousConvexCollision::btContinuousConvexCollision ( const btConvexShape*	convexA,const btConvexShape*	convexB,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* penetrationDepthSolver)
+:m_simplexSolver(simplexSolver),
+m_penetrationDepthSolver(penetrationDepthSolver),
+m_convexA(convexA),m_convexB1(convexB),m_planeShape(0)
+{
+}
+
+
+btContinuousConvexCollision::btContinuousConvexCollision( const btConvexShape*	convexA,const btStaticPlaneShape*	plane)
+:m_simplexSolver(0),
+m_penetrationDepthSolver(0),
+m_convexA(convexA),m_convexB1(0),m_planeShape(plane)
+{
+}
+
+
+/// This maximum should not be necessary. It allows for untested/degenerate cases in production code.
+/// You don't want your game ever to lock-up.
+#define MAX_ITERATIONS 64
+
+void btContinuousConvexCollision::computeClosestPoints( const btTransform& transA, const btTransform& transB,btPointCollector& pointCollector)
+{
+	if (m_convexB1)
+	{
+		m_simplexSolver->reset();
+		btGjkPairDetector gjk(m_convexA,m_convexB1,m_convexA->getShapeType(),m_convexB1->getShapeType(),m_convexA->getMargin(),m_convexB1->getMargin(),m_simplexSolver,m_penetrationDepthSolver);		
+		btGjkPairDetector::ClosestPointInput input;
+		input.m_transformA = transA;
+		input.m_transformB = transB;
+		gjk.getClosestPoints(input,pointCollector,0);
+	} else
+	{
+		//convex versus plane
+		const btConvexShape* convexShape = m_convexA;
+		const btStaticPlaneShape* planeShape = m_planeShape;
+		
+		bool hasCollision = false;
+		const btVector3& planeNormal = planeShape->getPlaneNormal();
+		const btScalar& planeConstant = planeShape->getPlaneConstant();
+		
+		btTransform convexWorldTransform = transA;
+		btTransform convexInPlaneTrans;
+		convexInPlaneTrans= transB.inverse() * convexWorldTransform;
+		btTransform planeInConvex;
+		planeInConvex= convexWorldTransform.inverse() * transB;
+		
+		btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis()*-planeNormal);
+
+		btVector3 vtxInPlane = convexInPlaneTrans(vtx);
+		btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
+
+		btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
+		btVector3 vtxInPlaneWorld = transB * vtxInPlaneProjected;
+		btVector3 normalOnSurfaceB = transB.getBasis() * planeNormal;
+
+		pointCollector.addContactPoint(
+			normalOnSurfaceB,
+			vtxInPlaneWorld,
+			distance);
+	}
+}
+
+bool	btContinuousConvexCollision::calcTimeOfImpact(
+				const btTransform& fromA,
+				const btTransform& toA,
+				const btTransform& fromB,
+				const btTransform& toB,
+				CastResult& result)
+{
+
+
+	/// compute linear and angular velocity for this interval, to interpolate
+	btVector3 linVelA,angVelA,linVelB,angVelB;
+	btTransformUtil::calculateVelocity(fromA,toA,btScalar(1.),linVelA,angVelA);
+	btTransformUtil::calculateVelocity(fromB,toB,btScalar(1.),linVelB,angVelB);
+
+
+	btScalar boundingRadiusA = m_convexA->getAngularMotionDisc();
+	btScalar boundingRadiusB = m_convexB1?m_convexB1->getAngularMotionDisc():0.f;
+
+	btScalar maxAngularProjectedVelocity = angVelA.length() * boundingRadiusA + angVelB.length() * boundingRadiusB;
+	btVector3 relLinVel = (linVelB-linVelA);
+
+	btScalar relLinVelocLength = (linVelB-linVelA).length();
+	
+	if ((relLinVelocLength+maxAngularProjectedVelocity) == 0.f)
+		return false;
+
+
+
+	btScalar lambda = btScalar(0.);
+	btVector3 v(1,0,0);
+
+	int maxIter = MAX_ITERATIONS;
+
+	btVector3 n;
+	n.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+	bool hasResult = false;
+	btVector3 c;
+
+	btScalar lastLambda = lambda;
+	//btScalar epsilon = btScalar(0.001);
+
+	int numIter = 0;
+	//first solution, using GJK
+
+
+	btScalar radius = 0.001f;
+//	result.drawCoordSystem(sphereTr);
+
+	btPointCollector	pointCollector1;
+
+	{
+	
+		computeClosestPoints(fromA,fromB,pointCollector1);
+
+		hasResult = pointCollector1.m_hasResult;
+		c = pointCollector1.m_pointInWorld;
+	}
+
+	if (hasResult)
+	{
+		btScalar dist;
+		dist = pointCollector1.m_distance + result.m_allowedPenetration;
+		n = pointCollector1.m_normalOnBInWorld;
+		btScalar projectedLinearVelocity = relLinVel.dot(n);
+		if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON)
+			return false;
+
+		//not close enough
+		while (dist > radius)
+		{
+			if (result.m_debugDrawer)
+			{
+				result.m_debugDrawer->drawSphere(c,0.2f,btVector3(1,1,1));
+			}
+			btScalar dLambda = btScalar(0.);
+
+			projectedLinearVelocity = relLinVel.dot(n);
+
+			
+			//don't report time of impact for motion away from the contact normal (or causes minor penetration)
+			if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON)
+				return false;
+			
+			dLambda = dist / (projectedLinearVelocity+ maxAngularProjectedVelocity);
+
+			
+			
+			lambda = lambda + dLambda;
+
+			if (lambda > btScalar(1.))
+				return false;
+
+			if (lambda < btScalar(0.))
+				return false;
+
+
+			//todo: next check with relative epsilon
+			if (lambda <= lastLambda)
+			{
+				return false;
+				//n.setValue(0,0,0);
+				break;
+			}
+			lastLambda = lambda;
+
+			
+
+			//interpolate to next lambda
+			btTransform interpolatedTransA,interpolatedTransB,relativeTrans;
+
+			btTransformUtil::integrateTransform(fromA,linVelA,angVelA,lambda,interpolatedTransA);
+			btTransformUtil::integrateTransform(fromB,linVelB,angVelB,lambda,interpolatedTransB);
+			relativeTrans = interpolatedTransB.inverseTimes(interpolatedTransA);
+
+			if (result.m_debugDrawer)
+			{
+				result.m_debugDrawer->drawSphere(interpolatedTransA.getOrigin(),0.2f,btVector3(1,0,0));
+			}
+
+			result.DebugDraw( lambda );
+
+			btPointCollector	pointCollector;
+			computeClosestPoints(interpolatedTransA,interpolatedTransB,pointCollector);
+
+			if (pointCollector.m_hasResult)
+			{
+				dist = pointCollector.m_distance+result.m_allowedPenetration;
+				c = pointCollector.m_pointInWorld;		
+				n = pointCollector.m_normalOnBInWorld;
+			} else
+			{
+				result.reportFailure(-1, numIter);
+				return false;
+			}
+
+			numIter++;
+			if (numIter > maxIter)
+			{
+				result.reportFailure(-2, numIter);
+				return false;
+			}
+		}
+	
+		result.m_fraction = lambda;
+		result.m_normal = n;
+		result.m_hitPoint = c;
+		return true;
+	}
+
+	return false;
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h
new file mode 100644
index 0000000..bdc0572
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h
@@ -0,0 +1,59 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
+#define BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
+
+#include "btConvexCast.h"
+#include "btSimplexSolverInterface.h"
+class btConvexPenetrationDepthSolver;
+class btConvexShape;
+class btStaticPlaneShape;
+
+/// btContinuousConvexCollision implements angular and linear time of impact for convex objects.
+/// Based on Brian Mirtich's Conservative Advancement idea (PhD thesis).
+/// Algorithm operates in worldspace, in order to keep inbetween motion globally consistent.
+/// It uses GJK at the moment. Future improvement would use minkowski sum / supporting vertex, merging innerloops
+class btContinuousConvexCollision : public btConvexCast
+{
+	btSimplexSolverInterface* m_simplexSolver;
+	btConvexPenetrationDepthSolver*	m_penetrationDepthSolver;
+	const btConvexShape*	m_convexA;
+	//second object is either a convex or a plane (code sharing)
+	const btConvexShape*	m_convexB1;
+	const btStaticPlaneShape*	m_planeShape;
+
+	void computeClosestPoints( const btTransform& transA, const btTransform& transB,struct btPointCollector& pointCollector);
+
+public:
+
+	btContinuousConvexCollision (const btConvexShape*	shapeA,const btConvexShape*	shapeB ,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver);
+
+	btContinuousConvexCollision(const btConvexShape*	shapeA,const btStaticPlaneShape*	plane );
+
+	virtual bool	calcTimeOfImpact(
+				const btTransform& fromA,
+				const btTransform& toA,
+				const btTransform& fromB,
+				const btTransform& toB,
+				CastResult& result);
+
+
+};
+
+
+#endif //BT_CONTINUOUS_COLLISION_CONVEX_CAST_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
new file mode 100644
index 0000000..d2a1310
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
@@ -0,0 +1,20 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btConvexCast.h"
+
+btConvexCast::~btConvexCast()
+{
+}
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h
new file mode 100644
index 0000000..bfd79d0
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h
@@ -0,0 +1,73 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_CONVEX_CAST_H
+#define BT_CONVEX_CAST_H
+
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btScalar.h"
+class btMinkowskiSumShape;
+#include "LinearMath/btIDebugDraw.h"
+
+/// btConvexCast is an interface for Casting
+class btConvexCast
+{
+public:
+
+
+	virtual ~btConvexCast();
+
+	///RayResult stores the closest result
+	/// alternatively, add a callback method to decide about closest/all results
+	struct	CastResult
+	{
+		//virtual bool	addRayResult(const btVector3& normal,btScalar	fraction) = 0;
+				
+		virtual void	DebugDraw(btScalar	fraction) {(void)fraction;}
+		virtual void	drawCoordSystem(const btTransform& trans) {(void)trans;}
+		virtual void	reportFailure(int errNo, int numIterations) {(void)errNo;(void)numIterations;}
+		CastResult()
+			:m_fraction(btScalar(BT_LARGE_FLOAT)),
+			m_debugDrawer(0),
+			m_allowedPenetration(btScalar(0))
+		{
+		}
+
+
+		virtual ~CastResult() {};
+
+		btTransform	m_hitTransformA;
+		btTransform	m_hitTransformB;
+		btVector3	m_normal;
+		btVector3   m_hitPoint;
+		btScalar	m_fraction; //input and output
+		btIDebugDraw* m_debugDrawer;
+		btScalar	m_allowedPenetration;
+
+	};
+
+
+	/// cast a convex against another convex object
+	virtual bool	calcTimeOfImpact(
+					const btTransform& fromA,
+					const btTransform& toA,
+					const btTransform& fromB,
+					const btTransform& toB,
+					CastResult& result) = 0;
+};
+
+#endif //BT_CONVEX_CAST_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h
new file mode 100644
index 0000000..72eb5ae
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h
@@ -0,0 +1,42 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_CONVEX_PENETRATION_DEPTH_H
+#define BT_CONVEX_PENETRATION_DEPTH_H
+
+class btStackAlloc;
+class btVector3;
+#include "btSimplexSolverInterface.h"
+class btConvexShape;
+class btTransform;
+
+///ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.
+class btConvexPenetrationDepthSolver
+{
+public:	
+	
+	virtual ~btConvexPenetrationDepthSolver() {};
+	virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver,
+		const btConvexShape* convexA,const btConvexShape* convexB,
+					const btTransform& transA,const btTransform& transB,
+				btVector3& v, btVector3& pa, btVector3& pb,
+				class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc
+				) = 0;
+
+
+};
+#endif //BT_CONVEX_PENETRATION_DEPTH_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h
new file mode 100644
index 0000000..f958cc5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h
@@ -0,0 +1,91 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
+#define BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
+
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btVector3.h"
+class btStackAlloc;
+
+/// This interface is made to be used by an iterative approach to do TimeOfImpact calculations
+/// This interface allows to query for closest points and penetration depth between two (convex) objects
+/// the closest point is on the second object (B), and the normal points from the surface on B towards A.
+/// distance is between closest points on B and closest point on A. So you can calculate closest point on A
+/// by taking closestPointInA = closestPointInB + m_distance * m_normalOnSurfaceB
+struct btDiscreteCollisionDetectorInterface
+{
+	
+	struct Result
+	{
+	
+		virtual ~Result(){}	
+
+		///setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material combiner
+		virtual void setShapeIdentifiersA(int partId0,int index0)=0;
+		virtual void setShapeIdentifiersB(int partId1,int index1)=0;
+		virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)=0;
+	};
+
+	struct ClosestPointInput
+	{
+		ClosestPointInput()
+			:m_maximumDistanceSquared(btScalar(BT_LARGE_FLOAT)),
+			m_stackAlloc(0)
+		{
+		}
+
+		btTransform m_transformA;
+		btTransform m_transformB;
+		btScalar	m_maximumDistanceSquared;
+		btStackAlloc* m_stackAlloc;
+	};
+
+	virtual ~btDiscreteCollisionDetectorInterface() {};
+
+	//
+	// give either closest points (distance > 0) or penetration (distance)
+	// the normal always points from B towards A
+	//
+	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false) = 0;
+
+};
+
+struct btStorageResult : public btDiscreteCollisionDetectorInterface::Result
+{
+		btVector3	m_normalOnSurfaceB;
+		btVector3	m_closestPointInB;
+		btScalar	m_distance; //negative means penetration !
+
+		btStorageResult() : m_distance(btScalar(BT_LARGE_FLOAT))
+		{
+
+		}
+		virtual ~btStorageResult() {};
+
+		virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
+		{
+			if (depth < m_distance)
+			{
+				m_normalOnSurfaceB = normalOnBInWorld;
+				m_closestPointInB = pointInWorld;
+				m_distance = depth;
+			}
+		}
+};
+
+#endif //BT_DISCRETE_COLLISION_DETECTOR1_INTERFACE_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
new file mode 100644
index 0000000..bef697a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
@@ -0,0 +1,176 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#include "btGjkConvexCast.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "btGjkPairDetector.h"
+#include "btPointCollector.h"
+#include "LinearMath/btTransformUtil.h"
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define MAX_ITERATIONS 64
+#else
+#define MAX_ITERATIONS 32
+#endif
+
+btGjkConvexCast::btGjkConvexCast(const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver)
+:m_simplexSolver(simplexSolver),
+m_convexA(convexA),
+m_convexB(convexB)
+{
+}
+
+bool	btGjkConvexCast::calcTimeOfImpact(
+					const btTransform& fromA,
+					const btTransform& toA,
+					const btTransform& fromB,
+					const btTransform& toB,
+					CastResult& result)
+{
+
+
+	m_simplexSolver->reset();
+
+	/// compute linear velocity for this interval, to interpolate
+	//assume no rotation/angular velocity, assert here?
+	btVector3 linVelA,linVelB;
+	linVelA = toA.getOrigin()-fromA.getOrigin();
+	linVelB = toB.getOrigin()-fromB.getOrigin();
+
+	btScalar radius = btScalar(0.001);
+	btScalar lambda = btScalar(0.);
+	btVector3 v(1,0,0);
+
+	int maxIter = MAX_ITERATIONS;
+
+	btVector3 n;
+	n.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+	bool hasResult = false;
+	btVector3 c;
+	btVector3 r = (linVelA-linVelB);
+
+	btScalar lastLambda = lambda;
+	//btScalar epsilon = btScalar(0.001);
+
+	int numIter = 0;
+	//first solution, using GJK
+
+
+	btTransform identityTrans;
+	identityTrans.setIdentity();
+
+
+//	result.drawCoordSystem(sphereTr);
+
+	btPointCollector	pointCollector;
+
+		
+	btGjkPairDetector gjk(m_convexA,m_convexB,m_simplexSolver,0);//m_penetrationDepthSolver);		
+	btGjkPairDetector::ClosestPointInput input;
+
+	//we don't use margins during CCD
+	//	gjk.setIgnoreMargin(true);
+
+	input.m_transformA = fromA;
+	input.m_transformB = fromB;
+	gjk.getClosestPoints(input,pointCollector,0);
+
+	hasResult = pointCollector.m_hasResult;
+	c = pointCollector.m_pointInWorld;
+
+	if (hasResult)
+	{
+		btScalar dist;
+		dist = pointCollector.m_distance;
+		n = pointCollector.m_normalOnBInWorld;
+
+	
+
+		//not close enough
+		while (dist > radius)
+		{
+			numIter++;
+			if (numIter > maxIter)
+			{
+				return false; //todo: report a failure
+			}
+			btScalar dLambda = btScalar(0.);
+
+			btScalar projectedLinearVelocity = r.dot(n);
+			
+			dLambda = dist / (projectedLinearVelocity);
+
+			lambda = lambda - dLambda;
+
+			if (lambda > btScalar(1.))
+				return false;
+
+			if (lambda < btScalar(0.))
+				return false;
+
+			//todo: next check with relative epsilon
+			if (lambda <= lastLambda)
+			{
+				return false;
+				//n.setValue(0,0,0);
+				break;
+			}
+			lastLambda = lambda;
+
+			//interpolate to next lambda
+			result.DebugDraw( lambda );
+			input.m_transformA.getOrigin().setInterpolate3(fromA.getOrigin(),toA.getOrigin(),lambda);
+			input.m_transformB.getOrigin().setInterpolate3(fromB.getOrigin(),toB.getOrigin(),lambda);
+			
+			gjk.getClosestPoints(input,pointCollector,0);
+			if (pointCollector.m_hasResult)
+			{
+				if (pointCollector.m_distance < btScalar(0.))
+				{
+					result.m_fraction = lastLambda;
+					n = pointCollector.m_normalOnBInWorld;
+					result.m_normal=n;
+					result.m_hitPoint = pointCollector.m_pointInWorld;
+					return true;
+				}
+				c = pointCollector.m_pointInWorld;		
+				n = pointCollector.m_normalOnBInWorld;
+				dist = pointCollector.m_distance;
+			} else
+			{
+				//??
+				return false;
+			}
+
+		}
+
+		//is n normalized?
+		//don't report time of impact for motion away from the contact normal (or causes minor penetration)
+		if (n.dot(r)>=-result.m_allowedPenetration)
+			return false;
+
+		result.m_fraction = lambda;
+		result.m_normal = n;
+		result.m_hitPoint = c;
+		return true;
+	}
+
+	return false;
+
+
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h
new file mode 100644
index 0000000..6a42ee6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h
@@ -0,0 +1,50 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_GJK_CONVEX_CAST_H
+#define BT_GJK_CONVEX_CAST_H
+
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+
+#include "LinearMath/btVector3.h"
+#include "btConvexCast.h"
+class btConvexShape;
+class btMinkowskiSumShape;
+#include "btSimplexSolverInterface.h"
+
+///GjkConvexCast performs a raycast on a convex object using support mapping.
+class btGjkConvexCast : public btConvexCast
+{
+	btSimplexSolverInterface*	m_simplexSolver;
+	const btConvexShape*	m_convexA;
+	const btConvexShape*	m_convexB;
+
+public:
+
+	btGjkConvexCast(const btConvexShape*	convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver);
+
+	/// cast a convex against another convex object
+	virtual bool	calcTimeOfImpact(
+					const btTransform& fromA,
+					const btTransform& toA,
+					const btTransform& fromB,
+					const btTransform& toB,
+					CastResult& result);
+
+};
+
+#endif //BT_GJK_CONVEX_CAST_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
new file mode 100644
index 0000000..f74261d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
@@ -0,0 +1,989 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the
+use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+claim that you wrote the original software. If you use this software in a
+product, an acknowledgment in the product documentation would be appreciated
+but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+GJK-EPA collision solver by Nathanael Presson, 2008
+*/
+#include "BulletCollision/CollisionShapes/btConvexInternalShape.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "btGjkEpa2.h"
+
+#if defined(DEBUG) || defined (_DEBUG)
+#include <stdio.h> //for debug printf
+#ifdef __SPU__
+#include <spu_printf.h>
+#define printf spu_printf
+#endif //__SPU__
+#endif
+
+namespace gjkepa2_impl
+{
+
+	// Config
+
+	/* GJK	*/ 
+#define GJK_MAX_ITERATIONS	128
+#define GJK_ACCURARY		((btScalar)0.0001)
+#define GJK_MIN_DISTANCE	((btScalar)0.0001)
+#define GJK_DUPLICATED_EPS	((btScalar)0.0001)
+#define GJK_SIMPLEX2_EPS	((btScalar)0.0)
+#define GJK_SIMPLEX3_EPS	((btScalar)0.0)
+#define GJK_SIMPLEX4_EPS	((btScalar)0.0)
+
+	/* EPA	*/ 
+#define EPA_MAX_VERTICES	64
+#define EPA_MAX_FACES		(EPA_MAX_VERTICES*2)
+#define EPA_MAX_ITERATIONS	255
+#define EPA_ACCURACY		((btScalar)0.0001)
+#define EPA_FALLBACK		(10*EPA_ACCURACY)
+#define EPA_PLANE_EPS		((btScalar)0.00001)
+#define EPA_INSIDE_EPS		((btScalar)0.01)
+
+
+	// Shorthands
+	typedef unsigned int	U;
+	typedef unsigned char	U1;
+
+	// MinkowskiDiff
+	struct	MinkowskiDiff
+	{
+		const btConvexShape*	m_shapes[2];
+		btMatrix3x3				m_toshape1;
+		btTransform				m_toshape0;
+#ifdef __SPU__
+		bool					m_enableMargin;
+#else
+		btVector3				(btConvexShape::*Ls)(const btVector3&) const;
+#endif//__SPU__
+		
+
+		MinkowskiDiff()
+		{
+
+		}
+#ifdef __SPU__
+			void					EnableMargin(bool enable)
+		{
+			m_enableMargin = enable;
+		}	
+		inline btVector3		Support0(const btVector3& d) const
+		{
+			if (m_enableMargin)
+			{
+				return m_shapes[0]->localGetSupportVertexNonVirtual(d);
+			} else
+			{
+				return m_shapes[0]->localGetSupportVertexWithoutMarginNonVirtual(d);
+			}
+		}
+		inline btVector3		Support1(const btVector3& d) const
+		{
+			if (m_enableMargin)
+			{
+				return m_toshape0*(m_shapes[1]->localGetSupportVertexNonVirtual(m_toshape1*d));
+			} else
+			{
+				return m_toshape0*(m_shapes[1]->localGetSupportVertexWithoutMarginNonVirtual(m_toshape1*d));
+			}
+		}
+#else
+		void					EnableMargin(bool enable)
+		{
+			if(enable)
+				Ls=&btConvexShape::localGetSupportVertexNonVirtual;
+			else
+				Ls=&btConvexShape::localGetSupportVertexWithoutMarginNonVirtual;
+		}	
+		inline btVector3		Support0(const btVector3& d) const
+		{
+			return(((m_shapes[0])->*(Ls))(d));
+		}
+		inline btVector3		Support1(const btVector3& d) const
+		{
+			return(m_toshape0*((m_shapes[1])->*(Ls))(m_toshape1*d));
+		}
+#endif //__SPU__
+
+		inline btVector3		Support(const btVector3& d) const
+		{
+			return(Support0(d)-Support1(-d));
+		}
+		btVector3				Support(const btVector3& d,U index) const
+		{
+			if(index)
+				return(Support1(d));
+			else
+				return(Support0(d));
+		}
+	};
+
+	typedef	MinkowskiDiff	tShape;
+
+
+	// GJK
+	struct	GJK
+	{
+		/* Types		*/ 
+		struct	sSV
+		{
+			btVector3	d,w;
+		};
+		struct	sSimplex
+		{
+			sSV*		c[4];
+			btScalar	p[4];
+			U			rank;
+		};
+		struct	eStatus	{ enum _ {
+			Valid,
+			Inside,
+			Failed		};};
+			/* Fields		*/ 
+			tShape			m_shape;
+			btVector3		m_ray;
+			btScalar		m_distance;
+			sSimplex		m_simplices[2];
+			sSV				m_store[4];
+			sSV*			m_free[4];
+			U				m_nfree;
+			U				m_current;
+			sSimplex*		m_simplex;
+			eStatus::_		m_status;
+			/* Methods		*/ 
+			GJK()
+			{
+				Initialize();
+			}
+			void				Initialize()
+			{
+				m_ray		=	btVector3(0,0,0);
+				m_nfree		=	0;
+				m_status	=	eStatus::Failed;
+				m_current	=	0;
+				m_distance	=	0;
+			}
+			eStatus::_			Evaluate(const tShape& shapearg,const btVector3& guess)
+			{
+				U			iterations=0;
+				btScalar	sqdist=0;
+				btScalar	alpha=0;
+				btVector3	lastw[4];
+				U			clastw=0;
+				/* Initialize solver		*/ 
+				m_free[0]			=	&m_store[0];
+				m_free[1]			=	&m_store[1];
+				m_free[2]			=	&m_store[2];
+				m_free[3]			=	&m_store[3];
+				m_nfree				=	4;
+				m_current			=	0;
+				m_status			=	eStatus::Valid;
+				m_shape				=	shapearg;
+				m_distance			=	0;
+				/* Initialize simplex		*/ 
+				m_simplices[0].rank	=	0;
+				m_ray				=	guess;
+				const btScalar	sqrl=	m_ray.length2();
+				appendvertice(m_simplices[0],sqrl>0?-m_ray:btVector3(1,0,0));
+				m_simplices[0].p[0]	=	1;
+				m_ray				=	m_simplices[0].c[0]->w;	
+				sqdist				=	sqrl;
+				lastw[0]			=
+					lastw[1]			=
+					lastw[2]			=
+					lastw[3]			=	m_ray;
+				/* Loop						*/ 
+				do	{
+					const U		next=1-m_current;
+					sSimplex&	cs=m_simplices[m_current];
+					sSimplex&	ns=m_simplices[next];
+					/* Check zero							*/ 
+					const btScalar	rl=m_ray.length();
+					if(rl<GJK_MIN_DISTANCE)
+					{/* Touching or inside				*/ 
+						m_status=eStatus::Inside;
+						break;
+					}
+					/* Append new vertice in -'v' direction	*/ 
+					appendvertice(cs,-m_ray);
+					const btVector3&	w=cs.c[cs.rank-1]->w;
+					bool				found=false;
+					for(U i=0;i<4;++i)
+					{
+						if((w-lastw[i]).length2()<GJK_DUPLICATED_EPS)
+						{ found=true;break; }
+					}
+					if(found)
+					{/* Return old simplex				*/ 
+						removevertice(m_simplices[m_current]);
+						break;
+					}
+					else
+					{/* Update lastw					*/ 
+						lastw[clastw=(clastw+1)&3]=w;
+					}
+					/* Check for termination				*/ 
+					const btScalar	omega=btDot(m_ray,w)/rl;
+					alpha=btMax(omega,alpha);
+					if(((rl-alpha)-(GJK_ACCURARY*rl))<=0)
+					{/* Return old simplex				*/ 
+						removevertice(m_simplices[m_current]);
+						break;
+					}		
+					/* Reduce simplex						*/ 
+					btScalar	weights[4];
+					U			mask=0;
+					switch(cs.rank)
+					{
+					case	2:	sqdist=projectorigin(	cs.c[0]->w,
+									cs.c[1]->w,
+									weights,mask);break;
+					case	3:	sqdist=projectorigin(	cs.c[0]->w,
+									cs.c[1]->w,
+									cs.c[2]->w,
+									weights,mask);break;
+					case	4:	sqdist=projectorigin(	cs.c[0]->w,
+									cs.c[1]->w,
+									cs.c[2]->w,
+									cs.c[3]->w,
+									weights,mask);break;
+					}
+					if(sqdist>=0)
+					{/* Valid	*/ 
+						ns.rank		=	0;
+						m_ray		=	btVector3(0,0,0);
+						m_current	=	next;
+						for(U i=0,ni=cs.rank;i<ni;++i)
+						{
+							if(mask&(1<<i))
+							{
+								ns.c[ns.rank]		=	cs.c[i];
+								ns.p[ns.rank++]		=	weights[i];
+								m_ray				+=	cs.c[i]->w*weights[i];
+							}
+							else
+							{
+								m_free[m_nfree++]	=	cs.c[i];
+							}
+						}
+						if(mask==15) m_status=eStatus::Inside;
+					}
+					else
+					{/* Return old simplex				*/ 
+						removevertice(m_simplices[m_current]);
+						break;
+					}
+					m_status=((++iterations)<GJK_MAX_ITERATIONS)?m_status:eStatus::Failed;
+				} while(m_status==eStatus::Valid);
+				m_simplex=&m_simplices[m_current];
+				switch(m_status)
+				{
+				case	eStatus::Valid:		m_distance=m_ray.length();break;
+				case	eStatus::Inside:	m_distance=0;break;
+				default:
+					{
+					}
+				}	
+				return(m_status);
+			}
+			bool					EncloseOrigin()
+			{
+				switch(m_simplex->rank)
+				{
+				case	1:
+					{
+						for(U i=0;i<3;++i)
+						{
+							btVector3		axis=btVector3(0,0,0);
+							axis[i]=1;
+							appendvertice(*m_simplex, axis);
+							if(EncloseOrigin())	return(true);
+							removevertice(*m_simplex);
+							appendvertice(*m_simplex,-axis);
+							if(EncloseOrigin())	return(true);
+							removevertice(*m_simplex);
+						}
+					}
+					break;
+				case	2:
+					{
+						const btVector3	d=m_simplex->c[1]->w-m_simplex->c[0]->w;
+						for(U i=0;i<3;++i)
+						{
+							btVector3		axis=btVector3(0,0,0);
+							axis[i]=1;
+							const btVector3	p=btCross(d,axis);
+							if(p.length2()>0)
+							{
+								appendvertice(*m_simplex, p);
+								if(EncloseOrigin())	return(true);
+								removevertice(*m_simplex);
+								appendvertice(*m_simplex,-p);
+								if(EncloseOrigin())	return(true);
+								removevertice(*m_simplex);
+							}
+						}
+					}
+					break;
+				case	3:
+					{
+						const btVector3	n=btCross(m_simplex->c[1]->w-m_simplex->c[0]->w,
+							m_simplex->c[2]->w-m_simplex->c[0]->w);
+						if(n.length2()>0)
+						{
+							appendvertice(*m_simplex,n);
+							if(EncloseOrigin())	return(true);
+							removevertice(*m_simplex);
+							appendvertice(*m_simplex,-n);
+							if(EncloseOrigin())	return(true);
+							removevertice(*m_simplex);
+						}
+					}
+					break;
+				case	4:
+					{
+						if(btFabs(det(	m_simplex->c[0]->w-m_simplex->c[3]->w,
+							m_simplex->c[1]->w-m_simplex->c[3]->w,
+							m_simplex->c[2]->w-m_simplex->c[3]->w))>0)
+							return(true);
+					}
+					break;
+				}
+				return(false);
+			}
+			/* Internals	*/ 
+			void				getsupport(const btVector3& d,sSV& sv) const
+			{
+				sv.d	=	d/d.length();
+				sv.w	=	m_shape.Support(sv.d);
+			}
+			void				removevertice(sSimplex& simplex)
+			{
+				m_free[m_nfree++]=simplex.c[--simplex.rank];
+			}
+			void				appendvertice(sSimplex& simplex,const btVector3& v)
+			{
+				simplex.p[simplex.rank]=0;
+				simplex.c[simplex.rank]=m_free[--m_nfree];
+				getsupport(v,*simplex.c[simplex.rank++]);
+			}
+			static btScalar		det(const btVector3& a,const btVector3& b,const btVector3& c)
+			{
+				return(	a.y()*b.z()*c.x()+a.z()*b.x()*c.y()-
+					a.x()*b.z()*c.y()-a.y()*b.x()*c.z()+
+					a.x()*b.y()*c.z()-a.z()*b.y()*c.x());
+			}
+			static btScalar		projectorigin(	const btVector3& a,
+				const btVector3& b,
+				btScalar* w,U& m)
+			{
+				const btVector3	d=b-a;
+				const btScalar	l=d.length2();
+				if(l>GJK_SIMPLEX2_EPS)
+				{
+					const btScalar	t(l>0?-btDot(a,d)/l:0);
+					if(t>=1)		{ w[0]=0;w[1]=1;m=2;return(b.length2()); }
+					else if(t<=0)	{ w[0]=1;w[1]=0;m=1;return(a.length2()); }
+					else			{ w[0]=1-(w[1]=t);m=3;return((a+d*t).length2()); }
+				}
+				return(-1);
+			}
+			static btScalar		projectorigin(	const btVector3& a,
+				const btVector3& b,
+				const btVector3& c,
+				btScalar* w,U& m)
+			{
+				static const U		imd3[]={1,2,0};
+				const btVector3*	vt[]={&a,&b,&c};
+				const btVector3		dl[]={a-b,b-c,c-a};
+				const btVector3		n=btCross(dl[0],dl[1]);
+				const btScalar		l=n.length2();
+				if(l>GJK_SIMPLEX3_EPS)
+				{
+					btScalar	mindist=-1;
+					btScalar	subw[2]={0.f,0.f};
+					U			subm(0);
+					for(U i=0;i<3;++i)
+					{
+						if(btDot(*vt[i],btCross(dl[i],n))>0)
+						{
+							const U			j=imd3[i];
+							const btScalar	subd(projectorigin(*vt[i],*vt[j],subw,subm));
+							if((mindist<0)||(subd<mindist))
+							{
+								mindist		=	subd;
+								m			=	static_cast<U>(((subm&1)?1<<i:0)+((subm&2)?1<<j:0));
+								w[i]		=	subw[0];
+								w[j]		=	subw[1];
+								w[imd3[j]]	=	0;				
+							}
+						}
+					}
+					if(mindist<0)
+					{
+						const btScalar	d=btDot(a,n);	
+						const btScalar	s=btSqrt(l);
+						const btVector3	p=n*(d/l);
+						mindist	=	p.length2();
+						m		=	7;
+						w[0]	=	(btCross(dl[1],b-p)).length()/s;
+						w[1]	=	(btCross(dl[2],c-p)).length()/s;
+						w[2]	=	1-(w[0]+w[1]);
+					}
+					return(mindist);
+				}
+				return(-1);
+			}
+			static btScalar		projectorigin(	const btVector3& a,
+				const btVector3& b,
+				const btVector3& c,
+				const btVector3& d,
+				btScalar* w,U& m)
+			{
+				static const U		imd3[]={1,2,0};
+				const btVector3*	vt[]={&a,&b,&c,&d};
+				const btVector3		dl[]={a-d,b-d,c-d};
+				const btScalar		vl=det(dl[0],dl[1],dl[2]);
+				const bool			ng=(vl*btDot(a,btCross(b-c,a-b)))<=0;
+				if(ng&&(btFabs(vl)>GJK_SIMPLEX4_EPS))
+				{
+					btScalar	mindist=-1;
+					btScalar	subw[3]={0.f,0.f,0.f};
+					U			subm(0);
+					for(U i=0;i<3;++i)
+					{
+						const U			j=imd3[i];
+						const btScalar	s=vl*btDot(d,btCross(dl[i],dl[j]));
+						if(s>0)
+						{
+							const btScalar	subd=projectorigin(*vt[i],*vt[j],d,subw,subm);
+							if((mindist<0)||(subd<mindist))
+							{
+								mindist		=	subd;
+								m			=	static_cast<U>((subm&1?1<<i:0)+
+									(subm&2?1<<j:0)+
+									(subm&4?8:0));
+								w[i]		=	subw[0];
+								w[j]		=	subw[1];
+								w[imd3[j]]	=	0;
+								w[3]		=	subw[2];
+							}
+						}
+					}
+					if(mindist<0)
+					{
+						mindist	=	0;
+						m		=	15;
+						w[0]	=	det(c,b,d)/vl;
+						w[1]	=	det(a,c,d)/vl;
+						w[2]	=	det(b,a,d)/vl;
+						w[3]	=	1-(w[0]+w[1]+w[2]);
+					}
+					return(mindist);
+				}
+				return(-1);
+			}
+	};
+
+	// EPA
+	struct	EPA
+	{
+		/* Types		*/ 
+		typedef	GJK::sSV	sSV;
+		struct	sFace
+		{
+			btVector3	n;
+			btScalar	d;
+			btScalar	p;
+			sSV*		c[3];
+			sFace*		f[3];
+			sFace*		l[2];
+			U1			e[3];
+			U1			pass;
+		};
+		struct	sList
+		{
+			sFace*		root;
+			U			count;
+			sList() : root(0),count(0)	{}
+		};
+		struct	sHorizon
+		{
+			sFace*		cf;
+			sFace*		ff;
+			U			nf;
+			sHorizon() : cf(0),ff(0),nf(0)	{}
+		};
+		struct	eStatus { enum _ {
+			Valid,
+			Touching,
+			Degenerated,
+			NonConvex,
+			InvalidHull,		
+			OutOfFaces,
+			OutOfVertices,
+			AccuraryReached,
+			FallBack,
+			Failed		};};
+			/* Fields		*/ 
+			eStatus::_		m_status;
+			GJK::sSimplex	m_result;
+			btVector3		m_normal;
+			btScalar		m_depth;
+			sSV				m_sv_store[EPA_MAX_VERTICES];
+			sFace			m_fc_store[EPA_MAX_FACES];
+			U				m_nextsv;
+			sList			m_hull;
+			sList			m_stock;
+			/* Methods		*/ 
+			EPA()
+			{
+				Initialize();	
+			}
+
+
+			static inline void		bind(sFace* fa,U ea,sFace* fb,U eb)
+			{
+				fa->e[ea]=(U1)eb;fa->f[ea]=fb;
+				fb->e[eb]=(U1)ea;fb->f[eb]=fa;
+			}
+			static inline void		append(sList& list,sFace* face)
+			{
+				face->l[0]	=	0;
+				face->l[1]	=	list.root;
+				if(list.root) list.root->l[0]=face;
+				list.root	=	face;
+				++list.count;
+			}
+			static inline void		remove(sList& list,sFace* face)
+			{
+				if(face->l[1]) face->l[1]->l[0]=face->l[0];
+				if(face->l[0]) face->l[0]->l[1]=face->l[1];
+				if(face==list.root) list.root=face->l[1];
+				--list.count;
+			}
+
+
+			void				Initialize()
+			{
+				m_status	=	eStatus::Failed;
+				m_normal	=	btVector3(0,0,0);
+				m_depth		=	0;
+				m_nextsv	=	0;
+				for(U i=0;i<EPA_MAX_FACES;++i)
+				{
+					append(m_stock,&m_fc_store[EPA_MAX_FACES-i-1]);
+				}
+			}
+			eStatus::_			Evaluate(GJK& gjk,const btVector3& guess)
+			{
+				GJK::sSimplex&	simplex=*gjk.m_simplex;
+				if((simplex.rank>1)&&gjk.EncloseOrigin())
+				{
+
+					/* Clean up				*/ 
+					while(m_hull.root)
+					{
+						sFace*	f = m_hull.root;
+						remove(m_hull,f);
+						append(m_stock,f);
+					}
+					m_status	=	eStatus::Valid;
+					m_nextsv	=	0;
+					/* Orient simplex		*/ 
+					if(gjk.det(	simplex.c[0]->w-simplex.c[3]->w,
+						simplex.c[1]->w-simplex.c[3]->w,
+						simplex.c[2]->w-simplex.c[3]->w)<0)
+					{
+						btSwap(simplex.c[0],simplex.c[1]);
+						btSwap(simplex.p[0],simplex.p[1]);
+					}
+					/* Build initial hull	*/ 
+					sFace*	tetra[]={newface(simplex.c[0],simplex.c[1],simplex.c[2],true),
+						newface(simplex.c[1],simplex.c[0],simplex.c[3],true),
+						newface(simplex.c[2],simplex.c[1],simplex.c[3],true),
+						newface(simplex.c[0],simplex.c[2],simplex.c[3],true)};
+					if(m_hull.count==4)
+					{
+						sFace*		best=findbest();
+						sFace		outer=*best;
+						U			pass=0;
+						U			iterations=0;
+						bind(tetra[0],0,tetra[1],0);
+						bind(tetra[0],1,tetra[2],0);
+						bind(tetra[0],2,tetra[3],0);
+						bind(tetra[1],1,tetra[3],2);
+						bind(tetra[1],2,tetra[2],1);
+						bind(tetra[2],2,tetra[3],1);
+						m_status=eStatus::Valid;
+						for(;iterations<EPA_MAX_ITERATIONS;++iterations)
+						{
+							if(m_nextsv<EPA_MAX_VERTICES)
+							{	
+								sHorizon		horizon;
+								sSV*			w=&m_sv_store[m_nextsv++];
+								bool			valid=true;					
+								best->pass	=	(U1)(++pass);
+								gjk.getsupport(best->n,*w);
+								const btScalar	wdist=btDot(best->n,w->w)-best->d;
+								if(wdist>EPA_ACCURACY)
+								{
+									for(U j=0;(j<3)&&valid;++j)
+									{
+										valid&=expand(	pass,w,
+											best->f[j],best->e[j],
+											horizon);
+									}
+									if(valid&&(horizon.nf>=3))
+									{
+										bind(horizon.cf,1,horizon.ff,2);
+										remove(m_hull,best);
+										append(m_stock,best);
+										best=findbest();
+										if(best->p>=outer.p) outer=*best;
+									} else { m_status=eStatus::InvalidHull;break; }
+								} else { m_status=eStatus::AccuraryReached;break; }
+							} else { m_status=eStatus::OutOfVertices;break; }
+						}
+						const btVector3	projection=outer.n*outer.d;
+						m_normal	=	outer.n;
+						m_depth		=	outer.d;
+						m_result.rank	=	3;
+						m_result.c[0]	=	outer.c[0];
+						m_result.c[1]	=	outer.c[1];
+						m_result.c[2]	=	outer.c[2];
+						m_result.p[0]	=	btCross(	outer.c[1]->w-projection,
+							outer.c[2]->w-projection).length();
+						m_result.p[1]	=	btCross(	outer.c[2]->w-projection,
+							outer.c[0]->w-projection).length();
+						m_result.p[2]	=	btCross(	outer.c[0]->w-projection,
+							outer.c[1]->w-projection).length();
+						const btScalar	sum=m_result.p[0]+m_result.p[1]+m_result.p[2];
+						m_result.p[0]	/=	sum;
+						m_result.p[1]	/=	sum;
+						m_result.p[2]	/=	sum;
+						return(m_status);
+					}
+				}
+				/* Fallback		*/ 
+				m_status	=	eStatus::FallBack;
+				m_normal	=	-guess;
+				const btScalar	nl=m_normal.length();
+				if(nl>0)
+					m_normal	=	m_normal/nl;
+				else
+					m_normal	=	btVector3(1,0,0);
+				m_depth	=	0;
+				m_result.rank=1;
+				m_result.c[0]=simplex.c[0];
+				m_result.p[0]=1;	
+				return(m_status);
+			}
+			sFace*				newface(sSV* a,sSV* b,sSV* c,bool forced)
+			{
+				if(m_stock.root)
+				{
+					sFace*	face=m_stock.root;
+					remove(m_stock,face);
+					append(m_hull,face);
+					face->pass	=	0;
+					face->c[0]	=	a;
+					face->c[1]	=	b;
+					face->c[2]	=	c;
+					face->n		=	btCross(b->w-a->w,c->w-a->w);
+					const btScalar	l=face->n.length();
+					const bool		v=l>EPA_ACCURACY;
+					face->p		=	btMin(btMin(
+						btDot(a->w,btCross(face->n,a->w-b->w)),
+						btDot(b->w,btCross(face->n,b->w-c->w))),
+						btDot(c->w,btCross(face->n,c->w-a->w)))	/
+						(v?l:1);
+					face->p		=	face->p>=-EPA_INSIDE_EPS?0:face->p;
+					if(v)
+					{
+						face->d		=	btDot(a->w,face->n)/l;
+						face->n		/=	l;
+						if(forced||(face->d>=-EPA_PLANE_EPS))
+						{
+							return(face);
+						} else m_status=eStatus::NonConvex;
+					} else m_status=eStatus::Degenerated;
+					remove(m_hull,face);
+					append(m_stock,face);
+					return(0);
+				}
+				m_status=m_stock.root?eStatus::OutOfVertices:eStatus::OutOfFaces;
+				return(0);
+			}
+			sFace*				findbest()
+			{
+				sFace*		minf=m_hull.root;
+				btScalar	mind=minf->d*minf->d;
+				btScalar	maxp=minf->p;
+				for(sFace* f=minf->l[1];f;f=f->l[1])
+				{
+					const btScalar	sqd=f->d*f->d;
+					if((f->p>=maxp)&&(sqd<mind))
+					{
+						minf=f;
+						mind=sqd;
+						maxp=f->p;
+					}
+				}
+				return(minf);
+			}
+			bool				expand(U pass,sSV* w,sFace* f,U e,sHorizon& horizon)
+			{
+				static const U	i1m3[]={1,2,0};
+				static const U	i2m3[]={2,0,1};
+				if(f->pass!=pass)
+				{
+					const U	e1=i1m3[e];
+					if((btDot(f->n,w->w)-f->d)<-EPA_PLANE_EPS)
+					{
+						sFace*	nf=newface(f->c[e1],f->c[e],w,false);
+						if(nf)
+						{
+							bind(nf,0,f,e);
+							if(horizon.cf) bind(horizon.cf,1,nf,2); else horizon.ff=nf;
+							horizon.cf=nf;
+							++horizon.nf;
+							return(true);
+						}
+					}
+					else
+					{
+						const U	e2=i2m3[e];
+						f->pass		=	(U1)pass;
+						if(	expand(pass,w,f->f[e1],f->e[e1],horizon)&&
+							expand(pass,w,f->f[e2],f->e[e2],horizon))
+						{
+							remove(m_hull,f);
+							append(m_stock,f);
+							return(true);
+						}
+					}
+				}
+				return(false);
+			}
+
+	};
+
+	//
+	static void	Initialize(	const btConvexShape* shape0,const btTransform& wtrs0,
+		const btConvexShape* shape1,const btTransform& wtrs1,
+		btGjkEpaSolver2::sResults& results,
+		tShape& shape,
+		bool withmargins)
+	{
+		/* Results		*/ 
+		results.witnesses[0]	=
+			results.witnesses[1]	=	btVector3(0,0,0);
+		results.status			=	btGjkEpaSolver2::sResults::Separated;
+		/* Shape		*/ 
+		shape.m_shapes[0]		=	shape0;
+		shape.m_shapes[1]		=	shape1;
+		shape.m_toshape1		=	wtrs1.getBasis().transposeTimes(wtrs0.getBasis());
+		shape.m_toshape0		=	wtrs0.inverseTimes(wtrs1);
+		shape.EnableMargin(withmargins);
+	}
+
+}
+
+//
+// Api
+//
+
+using namespace	gjkepa2_impl;
+
+//
+int			btGjkEpaSolver2::StackSizeRequirement()
+{
+	return(sizeof(GJK)+sizeof(EPA));
+}
+
+//
+bool		btGjkEpaSolver2::Distance(	const btConvexShape*	shape0,
+									  const btTransform&		wtrs0,
+									  const btConvexShape*	shape1,
+									  const btTransform&		wtrs1,
+									  const btVector3&		guess,
+									  sResults&				results)
+{
+	tShape			shape;
+	Initialize(shape0,wtrs0,shape1,wtrs1,results,shape,false);
+	GJK				gjk;
+	GJK::eStatus::_	gjk_status=gjk.Evaluate(shape,guess);
+	if(gjk_status==GJK::eStatus::Valid)
+	{
+		btVector3	w0=btVector3(0,0,0);
+		btVector3	w1=btVector3(0,0,0);
+		for(U i=0;i<gjk.m_simplex->rank;++i)
+		{
+			const btScalar	p=gjk.m_simplex->p[i];
+			w0+=shape.Support( gjk.m_simplex->c[i]->d,0)*p;
+			w1+=shape.Support(-gjk.m_simplex->c[i]->d,1)*p;
+		}
+		results.witnesses[0]	=	wtrs0*w0;
+		results.witnesses[1]	=	wtrs0*w1;
+		results.normal			=	w0-w1;
+		results.distance		=	results.normal.length();
+		results.normal			/=	results.distance>GJK_MIN_DISTANCE?results.distance:1;
+		return(true);
+	}
+	else
+	{
+		results.status	=	gjk_status==GJK::eStatus::Inside?
+			sResults::Penetrating	:
+		sResults::GJK_Failed	;
+		return(false);
+	}
+}
+
+//
+bool	btGjkEpaSolver2::Penetration(	const btConvexShape*	shape0,
+									 const btTransform&		wtrs0,
+									 const btConvexShape*	shape1,
+									 const btTransform&		wtrs1,
+									 const btVector3&		guess,
+									 sResults&				results,
+									 bool					usemargins)
+{
+	tShape			shape;
+	Initialize(shape0,wtrs0,shape1,wtrs1,results,shape,usemargins);
+	GJK				gjk;	
+	GJK::eStatus::_	gjk_status=gjk.Evaluate(shape,-guess);
+	switch(gjk_status)
+	{
+	case	GJK::eStatus::Inside:
+		{
+			EPA				epa;
+			EPA::eStatus::_	epa_status=epa.Evaluate(gjk,-guess);
+			if(epa_status!=EPA::eStatus::Failed)
+			{
+				btVector3	w0=btVector3(0,0,0);
+				for(U i=0;i<epa.m_result.rank;++i)
+				{
+					w0+=shape.Support(epa.m_result.c[i]->d,0)*epa.m_result.p[i];
+				}
+				results.status			=	sResults::Penetrating;
+				results.witnesses[0]	=	wtrs0*w0;
+				results.witnesses[1]	=	wtrs0*(w0-epa.m_normal*epa.m_depth);
+				results.normal			=	-epa.m_normal;
+				results.distance		=	-epa.m_depth;
+				return(true);
+			} else results.status=sResults::EPA_Failed;
+		}
+		break;
+	case	GJK::eStatus::Failed:
+		results.status=sResults::GJK_Failed;
+		break;
+		default:
+					{
+					}
+	}
+	return(false);
+}
+
+#ifndef __SPU__
+//
+btScalar	btGjkEpaSolver2::SignedDistance(const btVector3& position,
+											btScalar margin,
+											const btConvexShape* shape0,
+											const btTransform& wtrs0,
+											sResults& results)
+{
+	tShape			shape;
+	btSphereShape	shape1(margin);
+	btTransform		wtrs1(btQuaternion(0,0,0,1),position);
+	Initialize(shape0,wtrs0,&shape1,wtrs1,results,shape,false);
+	GJK				gjk;	
+	GJK::eStatus::_	gjk_status=gjk.Evaluate(shape,btVector3(1,1,1));
+	if(gjk_status==GJK::eStatus::Valid)
+	{
+		btVector3	w0=btVector3(0,0,0);
+		btVector3	w1=btVector3(0,0,0);
+		for(U i=0;i<gjk.m_simplex->rank;++i)
+		{
+			const btScalar	p=gjk.m_simplex->p[i];
+			w0+=shape.Support( gjk.m_simplex->c[i]->d,0)*p;
+			w1+=shape.Support(-gjk.m_simplex->c[i]->d,1)*p;
+		}
+		results.witnesses[0]	=	wtrs0*w0;
+		results.witnesses[1]	=	wtrs0*w1;
+		const btVector3	delta=	results.witnesses[1]-
+			results.witnesses[0];
+		const btScalar	margin=	shape0->getMarginNonVirtual()+
+			shape1.getMarginNonVirtual();
+		const btScalar	length=	delta.length();	
+		results.normal			=	delta/length;
+		results.witnesses[0]	+=	results.normal*margin;
+		return(length-margin);
+	}
+	else
+	{
+		if(gjk_status==GJK::eStatus::Inside)
+		{
+			if(Penetration(shape0,wtrs0,&shape1,wtrs1,gjk.m_ray,results))
+			{
+				const btVector3	delta=	results.witnesses[0]-
+					results.witnesses[1];
+				const btScalar	length=	delta.length();
+				if (length >= SIMD_EPSILON)
+					results.normal	=	delta/length;			
+				return(-length);
+			}
+		}	
+	}
+	return(SIMD_INFINITY);
+}
+
+//
+bool	btGjkEpaSolver2::SignedDistance(const btConvexShape*	shape0,
+										const btTransform&		wtrs0,
+										const btConvexShape*	shape1,
+										const btTransform&		wtrs1,
+										const btVector3&		guess,
+										sResults&				results)
+{
+	if(!Distance(shape0,wtrs0,shape1,wtrs1,guess,results))
+		return(Penetration(shape0,wtrs0,shape1,wtrs1,guess,results,false));
+	else
+		return(true);
+}
+#endif //__SPU__
+
+/* Symbols cleanup		*/ 
+
+#undef GJK_MAX_ITERATIONS
+#undef GJK_ACCURARY
+#undef GJK_MIN_DISTANCE
+#undef GJK_DUPLICATED_EPS
+#undef GJK_SIMPLEX2_EPS
+#undef GJK_SIMPLEX3_EPS
+#undef GJK_SIMPLEX4_EPS
+
+#undef EPA_MAX_VERTICES
+#undef EPA_MAX_FACES
+#undef EPA_MAX_ITERATIONS
+#undef EPA_ACCURACY
+#undef EPA_FALLBACK
+#undef EPA_PLANE_EPS
+#undef EPA_INSIDE_EPS
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h
new file mode 100644
index 0000000..ac501d5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h
@@ -0,0 +1,75 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the
+use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+claim that you wrote the original software. If you use this software in a
+product, an acknowledgment in the product documentation would be appreciated
+but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+GJK-EPA collision solver by Nathanael Presson, 2008
+*/
+#ifndef BT_GJK_EPA2_H
+#define BT_GJK_EPA2_H
+
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+
+///btGjkEpaSolver contributed under zlib by Nathanael Presson
+struct	btGjkEpaSolver2
+{
+struct	sResults
+	{
+	enum eStatus
+		{
+		Separated,		/* Shapes doesnt penetrate												*/ 
+		Penetrating,	/* Shapes are penetrating												*/ 
+		GJK_Failed,		/* GJK phase fail, no big issue, shapes are probably just 'touching'	*/ 
+		EPA_Failed		/* EPA phase fail, bigger problem, need to save parameters, and debug	*/ 
+		}		status;
+	btVector3	witnesses[2];
+	btVector3	normal;
+	btScalar	distance;
+	};
+
+static int		StackSizeRequirement();
+
+static bool		Distance(	const btConvexShape* shape0,const btTransform& wtrs0,
+							const btConvexShape* shape1,const btTransform& wtrs1,
+							const btVector3& guess,
+							sResults& results);
+
+static bool		Penetration(const btConvexShape* shape0,const btTransform& wtrs0,
+							const btConvexShape* shape1,const btTransform& wtrs1,
+							const btVector3& guess,
+							sResults& results,
+							bool usemargins=true);
+#ifndef __SPU__
+static btScalar	SignedDistance(	const btVector3& position,
+								btScalar margin,
+								const btConvexShape* shape,
+								const btTransform& wtrs,
+								sResults& results);
+							
+static bool		SignedDistance(	const btConvexShape* shape0,const btTransform& wtrs0,
+								const btConvexShape* shape1,const btTransform& wtrs1,
+								const btVector3& guess,
+								sResults& results);
+#endif //__SPU__
+
+};
+
+#endif //BT_GJK_EPA2_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
new file mode 100644
index 0000000..c6dc3f3
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
@@ -0,0 +1,66 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+EPA Copyright (c) Ricardo Padrela 2006
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "btGjkEpaPenetrationDepthSolver.h"
+
+
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
+
+bool btGjkEpaPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& simplexSolver,
+											  const btConvexShape* pConvexA, const btConvexShape* pConvexB,
+											  const btTransform& transformA, const btTransform& transformB,
+											  btVector3& v, btVector3& wWitnessOnA, btVector3& wWitnessOnB,
+											  class btIDebugDraw* debugDraw, btStackAlloc* stackAlloc )
+{
+
+	(void)debugDraw;
+	(void)v;
+	(void)simplexSolver;
+
+//	const btScalar				radialmargin(btScalar(0.));
+	
+	btVector3	guessVector(transformA.getOrigin()-transformB.getOrigin());
+	btGjkEpaSolver2::sResults	results;
+	
+
+	if(btGjkEpaSolver2::Penetration(pConvexA,transformA,
+								pConvexB,transformB,
+								guessVector,results))
+	
+		{
+	//	debugDraw->drawLine(results.witnesses[1],results.witnesses[1]+results.normal,btVector3(255,0,0));
+		//resultOut->addContactPoint(results.normal,results.witnesses[1],-results.depth);
+		wWitnessOnA = results.witnesses[0];
+		wWitnessOnB = results.witnesses[1];
+		v = results.normal;
+		return true;		
+		} else
+	{
+		if(btGjkEpaSolver2::Distance(pConvexA,transformA,pConvexB,transformB,guessVector,results))
+		{
+			wWitnessOnA = results.witnesses[0];
+			wWitnessOnB = results.witnesses[1];
+			v = results.normal;
+			return false;
+		}
+	}
+
+	return false;
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h
new file mode 100644
index 0000000..a49689a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h
@@ -0,0 +1,43 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+EPA Copyright (c) Ricardo Padrela 2006 
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef BT_GJP_EPA_PENETRATION_DEPTH_H
+#define BT_GJP_EPA_PENETRATION_DEPTH_H
+
+#include "btConvexPenetrationDepthSolver.h"
+
+///EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to
+///calculate the penetration depth between two convex shapes.
+class btGjkEpaPenetrationDepthSolver : public btConvexPenetrationDepthSolver
+{
+	public :
+
+		btGjkEpaPenetrationDepthSolver()
+		{
+		}
+
+		bool			calcPenDepth( btSimplexSolverInterface& simplexSolver,
+									  const btConvexShape* pConvexA, const btConvexShape* pConvexB,
+									  const btTransform& transformA, const btTransform& transformB,
+									  btVector3& v, btVector3& wWitnessOnA, btVector3& wWitnessOnB,
+									  class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc );
+
+	private :
+
+};
+
+#endif	// BT_GJP_EPA_PENETRATION_DEPTH_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
new file mode 100644
index 0000000..8af16b9
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
@@ -0,0 +1,457 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btGjkPairDetector.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
+#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h"
+
+
+
+#if defined(DEBUG) || defined (_DEBUG)
+//#define TEST_NON_VIRTUAL 1
+#include <stdio.h> //for debug printf
+#ifdef __SPU__
+#include <spu_printf.h>
+#define printf spu_printf
+//#define DEBUG_SPU_COLLISION_DETECTION 1
+#endif //__SPU__
+#endif
+
+//must be above the machine epsilon
+#define REL_ERROR2 btScalar(1.0e-6)
+
+//temp globals, to improve GJK/EPA/penetration calculations
+int gNumDeepPenetrationChecks = 0;
+int gNumGjkChecks = 0;
+
+
+btGjkPairDetector::btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver)
+:m_cachedSeparatingAxis(btScalar(0.),btScalar(1.),btScalar(0.)),
+m_penetrationDepthSolver(penetrationDepthSolver),
+m_simplexSolver(simplexSolver),
+m_minkowskiA(objectA),
+m_minkowskiB(objectB),
+m_shapeTypeA(objectA->getShapeType()),
+m_shapeTypeB(objectB->getShapeType()),
+m_marginA(objectA->getMargin()),
+m_marginB(objectB->getMargin()),
+m_ignoreMargin(false),
+m_lastUsedMethod(-1),
+m_catchDegeneracies(1)
+{
+}
+btGjkPairDetector::btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,int shapeTypeA,int shapeTypeB,btScalar marginA, btScalar marginB, btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver)
+:m_cachedSeparatingAxis(btScalar(0.),btScalar(1.),btScalar(0.)),
+m_penetrationDepthSolver(penetrationDepthSolver),
+m_simplexSolver(simplexSolver),
+m_minkowskiA(objectA),
+m_minkowskiB(objectB),
+m_shapeTypeA(shapeTypeA),
+m_shapeTypeB(shapeTypeB),
+m_marginA(marginA),
+m_marginB(marginB),
+m_ignoreMargin(false),
+m_lastUsedMethod(-1),
+m_catchDegeneracies(1)
+{
+}
+
+void	btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults)
+{
+	(void)swapResults;
+
+	getClosestPointsNonVirtual(input,output,debugDraw);
+}
+
+#ifdef __SPU__
+void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw)
+#else
+void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw)
+#endif
+{
+	m_cachedSeparatingDistance = 0.f;
+
+	btScalar distance=btScalar(0.);
+	btVector3	normalInB(btScalar(0.),btScalar(0.),btScalar(0.));
+	btVector3 pointOnA,pointOnB;
+	btTransform	localTransA = input.m_transformA;
+	btTransform localTransB = input.m_transformB;
+	btVector3 positionOffset = (localTransA.getOrigin() + localTransB.getOrigin()) * btScalar(0.5);
+	localTransA.getOrigin() -= positionOffset;
+	localTransB.getOrigin() -= positionOffset;
+
+	bool check2d = m_minkowskiA->isConvex2d() && m_minkowskiB->isConvex2d();
+
+	btScalar marginA = m_marginA;
+	btScalar marginB = m_marginB;
+
+	gNumGjkChecks++;
+
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+	spu_printf("inside gjk\n");
+#endif
+	//for CCD we don't use margins
+	if (m_ignoreMargin)
+	{
+		marginA = btScalar(0.);
+		marginB = btScalar(0.);
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+		spu_printf("ignoring margin\n");
+#endif
+	}
+
+	m_curIter = 0;
+	int gGjkMaxIter = 1000;//this is to catch invalid input, perhaps check for #NaN?
+	m_cachedSeparatingAxis.setValue(0,1,0);
+
+	bool isValid = false;
+	bool checkSimplex = false;
+	bool checkPenetration = true;
+	m_degenerateSimplex = 0;
+
+	m_lastUsedMethod = -1;
+
+	{
+		btScalar squaredDistance = BT_LARGE_FLOAT;
+		btScalar delta = btScalar(0.);
+		
+		btScalar margin = marginA + marginB;
+		
+		
+
+		m_simplexSolver->reset();
+		
+		for ( ; ; )
+		//while (true)
+		{
+
+			btVector3 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis();
+			btVector3 seperatingAxisInB = m_cachedSeparatingAxis* input.m_transformB.getBasis();
+
+#if 1
+
+			btVector3 pInA = m_minkowskiA->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInA);
+			btVector3 qInB = m_minkowskiB->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInB);
+
+//			btVector3 pInA  = localGetSupportingVertexWithoutMargin(m_shapeTypeA, m_minkowskiA, seperatingAxisInA,input.m_convexVertexData[0]);//, &featureIndexA);
+//			btVector3 qInB  = localGetSupportingVertexWithoutMargin(m_shapeTypeB, m_minkowskiB, seperatingAxisInB,input.m_convexVertexData[1]);//, &featureIndexB);
+
+#else
+#ifdef __SPU__
+			btVector3 pInA = m_minkowskiA->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInA);
+			btVector3 qInB = m_minkowskiB->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInB);
+#else
+			btVector3 pInA = m_minkowskiA->localGetSupportingVertexWithoutMargin(seperatingAxisInA);
+			btVector3 qInB = m_minkowskiB->localGetSupportingVertexWithoutMargin(seperatingAxisInB);
+#ifdef TEST_NON_VIRTUAL
+			btVector3 pInAv = m_minkowskiA->localGetSupportingVertexWithoutMargin(seperatingAxisInA);
+			btVector3 qInBv = m_minkowskiB->localGetSupportingVertexWithoutMargin(seperatingAxisInB);
+			btAssert((pInAv-pInA).length() < 0.0001);
+			btAssert((qInBv-qInB).length() < 0.0001);
+#endif //
+#endif //__SPU__
+#endif
+
+
+			btVector3  pWorld = localTransA(pInA);	
+			btVector3  qWorld = localTransB(qInB);
+
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+		spu_printf("got local supporting vertices\n");
+#endif
+
+			if (check2d)
+			{
+				pWorld[2] = 0.f;
+				qWorld[2] = 0.f;
+			}
+
+			btVector3 w	= pWorld - qWorld;
+			delta = m_cachedSeparatingAxis.dot(w);
+
+			// potential exit, they don't overlap
+			if ((delta > btScalar(0.0)) && (delta * delta > squaredDistance * input.m_maximumDistanceSquared)) 
+			{
+				m_degenerateSimplex = 10;
+				checkSimplex=true;
+				//checkPenetration = false;
+				break;
+			}
+
+			//exit 0: the new point is already in the simplex, or we didn't come any closer
+			if (m_simplexSolver->inSimplex(w))
+			{
+				m_degenerateSimplex = 1;
+				checkSimplex = true;
+				break;
+			}
+			// are we getting any closer ?
+			btScalar f0 = squaredDistance - delta;
+			btScalar f1 = squaredDistance * REL_ERROR2;
+
+			if (f0 <= f1)
+			{
+				if (f0 <= btScalar(0.))
+				{
+					m_degenerateSimplex = 2;
+				} else
+				{
+					m_degenerateSimplex = 11;
+				}
+				checkSimplex = true;
+				break;
+			}
+
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+		spu_printf("addVertex 1\n");
+#endif
+			//add current vertex to simplex
+			m_simplexSolver->addVertex(w, pWorld, qWorld);
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+		spu_printf("addVertex 2\n");
+#endif
+			btVector3 newCachedSeparatingAxis;
+
+			//calculate the closest point to the origin (update vector v)
+			if (!m_simplexSolver->closest(newCachedSeparatingAxis))
+			{
+				m_degenerateSimplex = 3;
+				checkSimplex = true;
+				break;
+			}
+
+			if(newCachedSeparatingAxis.length2()<REL_ERROR2)
+            {
+				m_cachedSeparatingAxis = newCachedSeparatingAxis;
+                m_degenerateSimplex = 6;
+                checkSimplex = true;
+                break;
+            }
+
+			btScalar previousSquaredDistance = squaredDistance;
+			squaredDistance = newCachedSeparatingAxis.length2();
+#if 0
+///warning: this termination condition leads to some problems in 2d test case see Bullet/Demos/Box2dDemo
+			if (squaredDistance>previousSquaredDistance)
+			{
+				m_degenerateSimplex = 7;
+				squaredDistance = previousSquaredDistance;
+                checkSimplex = false;
+                break;
+			}
+#endif //
+			
+
+			//redundant m_simplexSolver->compute_points(pointOnA, pointOnB);
+
+			//are we getting any closer ?
+			if (previousSquaredDistance - squaredDistance <= SIMD_EPSILON * previousSquaredDistance) 
+			{ 
+//				m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
+				checkSimplex = true;
+				m_degenerateSimplex = 12;
+				
+				break;
+			}
+
+			m_cachedSeparatingAxis = newCachedSeparatingAxis;
+
+			  //degeneracy, this is typically due to invalid/uninitialized worldtransforms for a btCollisionObject   
+              if (m_curIter++ > gGjkMaxIter)   
+              {   
+                      #if defined(DEBUG) || defined (_DEBUG) || defined (DEBUG_SPU_COLLISION_DETECTION)
+
+                              printf("btGjkPairDetector maxIter exceeded:%i\n",m_curIter);   
+                              printf("sepAxis=(%f,%f,%f), squaredDistance = %f, shapeTypeA=%i,shapeTypeB=%i\n",   
+                              m_cachedSeparatingAxis.getX(),   
+                              m_cachedSeparatingAxis.getY(),   
+                              m_cachedSeparatingAxis.getZ(),   
+                              squaredDistance,   
+                              m_minkowskiA->getShapeType(),   
+                              m_minkowskiB->getShapeType());   
+
+                      #endif   
+                      break;   
+
+              } 
+
+
+			bool check = (!m_simplexSolver->fullSimplex());
+			//bool check = (!m_simplexSolver->fullSimplex() && squaredDistance > SIMD_EPSILON * m_simplexSolver->maxVertex());
+
+			if (!check)
+			{
+				//do we need this backup_closest here ?
+//				m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
+				m_degenerateSimplex = 13;
+				break;
+			}
+		}
+
+		if (checkSimplex)
+		{
+			m_simplexSolver->compute_points(pointOnA, pointOnB);
+			normalInB = m_cachedSeparatingAxis;
+			btScalar lenSqr =m_cachedSeparatingAxis.length2();
+			
+			//valid normal
+			if (lenSqr < 0.0001)
+			{
+				m_degenerateSimplex = 5;
+			} 
+			if (lenSqr > SIMD_EPSILON*SIMD_EPSILON)
+			{
+				btScalar rlen = btScalar(1.) / btSqrt(lenSqr );
+				normalInB *= rlen; //normalize
+				btScalar s = btSqrt(squaredDistance);
+			
+				btAssert(s > btScalar(0.0));
+				pointOnA -= m_cachedSeparatingAxis * (marginA / s);
+				pointOnB += m_cachedSeparatingAxis * (marginB / s);
+				distance = ((btScalar(1.)/rlen) - margin);
+				isValid = true;
+				
+				m_lastUsedMethod = 1;
+			} else
+			{
+				m_lastUsedMethod = 2;
+			}
+		}
+
+		bool catchDegeneratePenetrationCase = 
+			(m_catchDegeneracies && m_penetrationDepthSolver && m_degenerateSimplex && ((distance+margin) < 0.01));
+
+		//if (checkPenetration && !isValid)
+		if (checkPenetration && (!isValid || catchDegeneratePenetrationCase ))
+		{
+			//penetration case
+
+			//if there is no way to handle penetrations, bail out
+			if (m_penetrationDepthSolver)
+			{
+				// Penetration depth case.
+				btVector3 tmpPointOnA,tmpPointOnB;
+				
+				gNumDeepPenetrationChecks++;
+				m_cachedSeparatingAxis.setZero();
+
+				bool isValid2 = m_penetrationDepthSolver->calcPenDepth( 
+					*m_simplexSolver, 
+					m_minkowskiA,m_minkowskiB,
+					localTransA,localTransB,
+					m_cachedSeparatingAxis, tmpPointOnA, tmpPointOnB,
+					debugDraw,input.m_stackAlloc
+					);
+
+
+				if (isValid2)
+				{
+					btVector3 tmpNormalInB = tmpPointOnB-tmpPointOnA;
+					btScalar lenSqr = tmpNormalInB.length2();
+					if (lenSqr <= (SIMD_EPSILON*SIMD_EPSILON))
+					{
+						tmpNormalInB = m_cachedSeparatingAxis;
+						lenSqr = m_cachedSeparatingAxis.length2();
+					}
+
+					if (lenSqr > (SIMD_EPSILON*SIMD_EPSILON))
+					{
+						tmpNormalInB /= btSqrt(lenSqr);
+						btScalar distance2 = -(tmpPointOnA-tmpPointOnB).length();
+						//only replace valid penetrations when the result is deeper (check)
+						if (!isValid || (distance2 < distance))
+						{
+							distance = distance2;
+							pointOnA = tmpPointOnA;
+							pointOnB = tmpPointOnB;
+							normalInB = tmpNormalInB;
+							isValid = true;
+							m_lastUsedMethod = 3;
+						} else
+						{
+							m_lastUsedMethod = 8;
+						}
+					} else
+					{
+						m_lastUsedMethod = 9;
+					}
+				} else
+
+				{
+					///this is another degenerate case, where the initial GJK calculation reports a degenerate case
+					///EPA reports no penetration, and the second GJK (using the supporting vector without margin)
+					///reports a valid positive distance. Use the results of the second GJK instead of failing.
+					///thanks to Jacob.Langford for the reproduction case
+					///http://code.google.com/p/bullet/issues/detail?id=250
+
+				
+					if (m_cachedSeparatingAxis.length2() > btScalar(0.))
+					{
+						btScalar distance2 = (tmpPointOnA-tmpPointOnB).length()-margin;
+						//only replace valid distances when the distance is less
+						if (!isValid || (distance2 < distance))
+						{
+							distance = distance2;
+							pointOnA = tmpPointOnA;
+							pointOnB = tmpPointOnB;
+							pointOnA -= m_cachedSeparatingAxis * marginA ;
+							pointOnB += m_cachedSeparatingAxis * marginB ;
+							normalInB = m_cachedSeparatingAxis;
+							normalInB.normalize();
+							isValid = true;
+							m_lastUsedMethod = 6;
+						} else
+						{
+							m_lastUsedMethod = 5;
+						}
+					}
+				}
+				
+			}
+
+		}
+	}
+
+	
+
+	if (isValid && ((distance < 0) || (distance*distance < input.m_maximumDistanceSquared)))
+	{
+#if 0
+///some debugging
+//		if (check2d)
+		{
+			printf("n = %2.3f,%2.3f,%2.3f. ",normalInB[0],normalInB[1],normalInB[2]);
+			printf("distance = %2.3f exit=%d deg=%d\n",distance,m_lastUsedMethod,m_degenerateSimplex);
+		}
+#endif 
+
+		m_cachedSeparatingAxis = normalInB;
+		m_cachedSeparatingDistance = distance;
+
+		output.addContactPoint(
+			normalInB,
+			pointOnB+positionOffset,
+			distance);
+
+	}
+
+
+}
+
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h
new file mode 100644
index 0000000..2277a19
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h
@@ -0,0 +1,103 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+
+#ifndef BT_GJK_PAIR_DETECTOR_H
+#define BT_GJK_PAIR_DETECTOR_H
+
+#include "btDiscreteCollisionDetectorInterface.h"
+#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
+
+class btConvexShape;
+#include "btSimplexSolverInterface.h"
+class btConvexPenetrationDepthSolver;
+
+/// btGjkPairDetector uses GJK to implement the btDiscreteCollisionDetectorInterface
+class btGjkPairDetector : public btDiscreteCollisionDetectorInterface
+{
+	
+
+	btVector3	m_cachedSeparatingAxis;
+	btConvexPenetrationDepthSolver*	m_penetrationDepthSolver;
+	btSimplexSolverInterface* m_simplexSolver;
+	const btConvexShape* m_minkowskiA;
+	const btConvexShape* m_minkowskiB;
+	int	m_shapeTypeA;
+	int m_shapeTypeB;
+	btScalar	m_marginA;
+	btScalar	m_marginB;
+
+	bool		m_ignoreMargin;
+	btScalar	m_cachedSeparatingDistance;
+	
+
+public:
+
+	//some debugging to fix degeneracy problems
+	int			m_lastUsedMethod;
+	int			m_curIter;
+	int			m_degenerateSimplex;
+	int			m_catchDegeneracies;
+
+
+	btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver);
+	btGjkPairDetector(const btConvexShape* objectA,const btConvexShape* objectB,int shapeTypeA,int shapeTypeB,btScalar marginA, btScalar marginB, btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver*	penetrationDepthSolver);
+	virtual ~btGjkPairDetector() {};
+
+	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);
+
+	void	getClosestPointsNonVirtual(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw);
+	
+
+	void setMinkowskiA(btConvexShape* minkA)
+	{
+		m_minkowskiA = minkA;
+	}
+
+	void setMinkowskiB(btConvexShape* minkB)
+	{
+		m_minkowskiB = minkB;
+	}
+	void setCachedSeperatingAxis(const btVector3& seperatingAxis)
+	{
+		m_cachedSeparatingAxis = seperatingAxis;
+	}
+
+	const btVector3& getCachedSeparatingAxis() const
+	{
+		return m_cachedSeparatingAxis;
+	}
+	btScalar	getCachedSeparatingDistance() const
+	{
+		return m_cachedSeparatingDistance;
+	}
+
+	void	setPenetrationDepthSolver(btConvexPenetrationDepthSolver*	penetrationDepthSolver)
+	{
+		m_penetrationDepthSolver = penetrationDepthSolver;
+	}
+
+	///don't use setIgnoreMargin, it's for Bullet's internal use
+	void	setIgnoreMargin(bool ignoreMargin)
+	{
+		m_ignoreMargin = ignoreMargin;
+	}
+
+
+};
+
+#endif //BT_GJK_PAIR_DETECTOR_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
new file mode 100644
index 0000000..0ce9dd2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
@@ -0,0 +1,158 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_MANIFOLD_CONTACT_POINT_H
+#define BT_MANIFOLD_CONTACT_POINT_H
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransformUtil.h"
+
+#ifdef PFX_USE_FREE_VECTORMATH
+	#include "physics_effects/base_level/solver/pfx_constraint_row.h"
+typedef sce::PhysicsEffects::PfxConstraintRow btConstraintRow;
+#else
+	// Don't change following order of parameters
+	ATTRIBUTE_ALIGNED16(struct) btConstraintRow {
+		btScalar m_normal[3];
+		btScalar m_rhs;
+		btScalar m_jacDiagInv;
+		btScalar m_lowerLimit;
+		btScalar m_upperLimit;
+		btScalar m_accumImpulse;
+	};
+	typedef btConstraintRow PfxConstraintRow;
+#endif //PFX_USE_FREE_VECTORMATH
+
+
+
+/// ManifoldContactPoint collects and maintains persistent contactpoints.
+/// used to improve stability and performance of rigidbody dynamics response.
+class btManifoldPoint
+	{
+		public:
+			btManifoldPoint()
+				:m_userPersistentData(0),
+				m_appliedImpulse(0.f),
+				m_lateralFrictionInitialized(false),
+				m_appliedImpulseLateral1(0.f),
+				m_appliedImpulseLateral2(0.f),
+				m_contactMotion1(0.f),
+				m_contactMotion2(0.f),
+				m_contactCFM1(0.f),
+				m_contactCFM2(0.f),
+				m_lifeTime(0)
+			{
+			}
+
+			btManifoldPoint( const btVector3 &pointA, const btVector3 &pointB, 
+					const btVector3 &normal, 
+					btScalar distance ) :
+					m_localPointA( pointA ), 
+					m_localPointB( pointB ), 
+					m_normalWorldOnB( normal ), 
+					m_distance1( distance ),
+					m_combinedFriction(btScalar(0.)),
+					m_combinedRestitution(btScalar(0.)),
+					m_userPersistentData(0),
+					m_appliedImpulse(0.f),
+					m_lateralFrictionInitialized(false),
+					m_appliedImpulseLateral1(0.f),
+					m_appliedImpulseLateral2(0.f),
+					m_contactMotion1(0.f),
+					m_contactMotion2(0.f),
+					m_contactCFM1(0.f),
+					m_contactCFM2(0.f),
+					m_lifeTime(0)
+			{
+				mConstraintRow[0].m_accumImpulse = 0.f;
+				mConstraintRow[1].m_accumImpulse = 0.f;
+				mConstraintRow[2].m_accumImpulse = 0.f;
+			}
+
+			
+
+			btVector3 m_localPointA;			
+			btVector3 m_localPointB;			
+			btVector3	m_positionWorldOnB;
+			///m_positionWorldOnA is redundant information, see getPositionWorldOnA(), but for clarity
+			btVector3	m_positionWorldOnA;
+			btVector3 m_normalWorldOnB;
+		
+			btScalar	m_distance1;
+			btScalar	m_combinedFriction;
+			btScalar	m_combinedRestitution;
+
+         //BP mod, store contact triangles.
+         int	   m_partId0;
+         int      m_partId1;
+         int      m_index0;
+         int      m_index1;
+				
+			mutable void*	m_userPersistentData;
+			btScalar		m_appliedImpulse;
+
+			bool			m_lateralFrictionInitialized;
+			btScalar		m_appliedImpulseLateral1;
+			btScalar		m_appliedImpulseLateral2;
+			btScalar		m_contactMotion1;
+			btScalar		m_contactMotion2;
+			btScalar		m_contactCFM1;
+			btScalar		m_contactCFM2;
+
+			int				m_lifeTime;//lifetime of the contactpoint in frames
+			
+			btVector3		m_lateralFrictionDir1;
+			btVector3		m_lateralFrictionDir2;
+
+
+
+			btConstraintRow mConstraintRow[3];
+
+
+			btScalar getDistance() const
+			{
+				return m_distance1;
+			}
+			int	getLifeTime() const
+			{
+				return m_lifeTime;
+			}
+
+			const btVector3& getPositionWorldOnA() const {
+				return m_positionWorldOnA;
+//				return m_positionWorldOnB + m_normalWorldOnB * m_distance1;
+			}
+
+			const btVector3& getPositionWorldOnB() const
+			{
+				return m_positionWorldOnB;
+			}
+
+			void	setDistance(btScalar dist)
+			{
+				m_distance1 = dist;
+			}
+			
+			///this returns the most recent applied impulse, to satisfy contact constraints by the constraint solver
+			btScalar	getAppliedImpulse() const
+			{
+				return m_appliedImpulse;
+			}
+
+			
+
+	};
+
+#endif //BT_MANIFOLD_CONTACT_POINT_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
new file mode 100644
index 0000000..fe31f08
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
@@ -0,0 +1,362 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btMinkowskiPenetrationDepthSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+
+#define NUM_UNITSPHERE_POINTS 42
+
+
+bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& simplexSolver,
+												   const btConvexShape* convexA,const btConvexShape* convexB,
+												   const btTransform& transA,const btTransform& transB,
+												   btVector3& v, btVector3& pa, btVector3& pb,
+												   class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc
+												   )
+{
+
+	(void)stackAlloc;
+	(void)v;
+	
+	bool check2d= convexA->isConvex2d() && convexB->isConvex2d();
+
+	struct btIntermediateResult : public btDiscreteCollisionDetectorInterface::Result
+	{
+
+		btIntermediateResult():m_hasResult(false)
+		{
+		}
+		
+		btVector3 m_normalOnBInWorld;
+		btVector3 m_pointInWorld;
+		btScalar m_depth;
+		bool	m_hasResult;
+
+		virtual void setShapeIdentifiersA(int partId0,int index0)
+		{
+			(void)partId0;
+			(void)index0;
+		}
+		virtual void setShapeIdentifiersB(int partId1,int index1)
+		{
+			(void)partId1;
+			(void)index1;
+		}
+		void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
+		{
+			m_normalOnBInWorld = normalOnBInWorld;
+			m_pointInWorld = pointInWorld;
+			m_depth = depth;
+			m_hasResult = true;
+		}
+	};
+
+	//just take fixed number of orientation, and sample the penetration depth in that direction
+	btScalar minProj = btScalar(BT_LARGE_FLOAT);
+	btVector3 minNorm(btScalar(0.), btScalar(0.), btScalar(0.));
+	btVector3 minA,minB;
+	btVector3 seperatingAxisInA,seperatingAxisInB;
+	btVector3 pInA,qInB,pWorld,qWorld,w;
+
+#ifndef __SPU__
+#define USE_BATCHED_SUPPORT 1
+#endif
+#ifdef USE_BATCHED_SUPPORT
+
+	btVector3	supportVerticesABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	btVector3	supportVerticesBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	btVector3	seperatingAxisInABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	btVector3	seperatingAxisInBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	int i;
+
+	int numSampleDirections = NUM_UNITSPHERE_POINTS;
+
+	for (i=0;i<numSampleDirections;i++)
+	{
+		btVector3 norm = getPenetrationDirections()[i];
+		seperatingAxisInABatch[i] =  (-norm) * transA.getBasis() ;
+		seperatingAxisInBBatch[i] =  norm   * transB.getBasis() ;
+	}
+
+	{
+		int numPDA = convexA->getNumPreferredPenetrationDirections();
+		if (numPDA)
+		{
+			for (int i=0;i<numPDA;i++)
+			{
+				btVector3 norm;
+				convexA->getPreferredPenetrationDirection(i,norm);
+				norm  = transA.getBasis() * norm;
+				getPenetrationDirections()[numSampleDirections] = norm;
+				seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis();
+				seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis();
+				numSampleDirections++;
+			}
+		}
+	}
+
+	{
+		int numPDB = convexB->getNumPreferredPenetrationDirections();
+		if (numPDB)
+		{
+			for (int i=0;i<numPDB;i++)
+			{
+				btVector3 norm;
+				convexB->getPreferredPenetrationDirection(i,norm);
+				norm  = transB.getBasis() * norm;
+				getPenetrationDirections()[numSampleDirections] = norm;
+				seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis();
+				seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis();
+				numSampleDirections++;
+			}
+		}
+	}
+
+
+
+
+	convexA->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch,supportVerticesABatch,numSampleDirections);
+	convexB->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch,supportVerticesBBatch,numSampleDirections);
+
+	for (i=0;i<numSampleDirections;i++)
+	{
+		btVector3 norm = getPenetrationDirections()[i];
+		if (check2d)
+		{
+			norm[2] = 0.f;
+		}
+		if (norm.length2()>0.01)
+		{
+
+			seperatingAxisInA = seperatingAxisInABatch[i];
+			seperatingAxisInB = seperatingAxisInBBatch[i];
+
+			pInA = supportVerticesABatch[i];
+			qInB = supportVerticesBBatch[i];
+
+			pWorld = transA(pInA);	
+			qWorld = transB(qInB);
+			if (check2d)
+			{
+				pWorld[2] = 0.f;
+				qWorld[2] = 0.f;
+			}
+
+			w	= qWorld - pWorld;
+			btScalar delta = norm.dot(w);
+			//find smallest delta
+			if (delta < minProj)
+			{
+				minProj = delta;
+				minNorm = norm;
+				minA = pWorld;
+				minB = qWorld;
+			}
+		}
+	}	
+#else
+
+	int numSampleDirections = NUM_UNITSPHERE_POINTS;
+
+#ifndef __SPU__
+	{
+		int numPDA = convexA->getNumPreferredPenetrationDirections();
+		if (numPDA)
+		{
+			for (int i=0;i<numPDA;i++)
+			{
+				btVector3 norm;
+				convexA->getPreferredPenetrationDirection(i,norm);
+				norm  = transA.getBasis() * norm;
+				getPenetrationDirections()[numSampleDirections] = norm;
+				numSampleDirections++;
+			}
+		}
+	}
+
+	{
+		int numPDB = convexB->getNumPreferredPenetrationDirections();
+		if (numPDB)
+		{
+			for (int i=0;i<numPDB;i++)
+			{
+				btVector3 norm;
+				convexB->getPreferredPenetrationDirection(i,norm);
+				norm  = transB.getBasis() * norm;
+				getPenetrationDirections()[numSampleDirections] = norm;
+				numSampleDirections++;
+			}
+		}
+	}
+#endif // __SPU__
+
+	for (int i=0;i<numSampleDirections;i++)
+	{
+		const btVector3& norm = getPenetrationDirections()[i];
+		seperatingAxisInA = (-norm)* transA.getBasis();
+		seperatingAxisInB = norm* transB.getBasis();
+		pInA = convexA->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInA);
+		qInB = convexB->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInB);
+		pWorld = transA(pInA);	
+		qWorld = transB(qInB);
+		w	= qWorld - pWorld;
+		btScalar delta = norm.dot(w);
+		//find smallest delta
+		if (delta < minProj)
+		{
+			minProj = delta;
+			minNorm = norm;
+			minA = pWorld;
+			minB = qWorld;
+		}
+	}
+#endif //USE_BATCHED_SUPPORT
+
+	//add the margins
+
+	minA += minNorm*convexA->getMarginNonVirtual();
+	minB -= minNorm*convexB->getMarginNonVirtual();
+	//no penetration
+	if (minProj < btScalar(0.))
+		return false;
+
+	btScalar extraSeparation = 0.5f;///scale dependent
+	minProj += extraSeparation+(convexA->getMarginNonVirtual() + convexB->getMarginNonVirtual());
+
+
+
+
+
+//#define DEBUG_DRAW 1
+#ifdef DEBUG_DRAW
+	if (debugDraw)
+	{
+		btVector3 color(0,1,0);
+		debugDraw->drawLine(minA,minB,color);
+		color = btVector3 (1,1,1);
+		btVector3 vec = minB-minA;
+		btScalar prj2 = minNorm.dot(vec);
+		debugDraw->drawLine(minA,minA+(minNorm*minProj),color);
+
+	}
+#endif //DEBUG_DRAW
+
+	
+
+	btGjkPairDetector gjkdet(convexA,convexB,&simplexSolver,0);
+
+	btScalar offsetDist = minProj;
+	btVector3 offset = minNorm * offsetDist;
+	
+
+
+	btGjkPairDetector::ClosestPointInput input;
+		
+	btVector3 newOrg = transA.getOrigin() + offset;
+
+	btTransform displacedTrans = transA;
+	displacedTrans.setOrigin(newOrg);
+
+	input.m_transformA = displacedTrans;
+	input.m_transformB = transB;
+	input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);//minProj;
+	
+	btIntermediateResult res;
+	gjkdet.setCachedSeperatingAxis(-minNorm);
+	gjkdet.getClosestPoints(input,res,debugDraw);
+
+	btScalar correctedMinNorm = minProj - res.m_depth;
+
+
+	//the penetration depth is over-estimated, relax it
+	btScalar penetration_relaxation= btScalar(1.);
+	minNorm*=penetration_relaxation;
+	
+
+	if (res.m_hasResult)
+	{
+
+		pa = res.m_pointInWorld - minNorm * correctedMinNorm;
+		pb = res.m_pointInWorld;
+		v = minNorm;
+		
+#ifdef DEBUG_DRAW
+		if (debugDraw)
+		{
+			btVector3 color(1,0,0);
+			debugDraw->drawLine(pa,pb,color);
+		}
+#endif//DEBUG_DRAW
+
+
+	}
+	return res.m_hasResult;
+}
+
+btVector3*	btMinkowskiPenetrationDepthSolver::getPenetrationDirections()
+{
+	static btVector3	sPenetrationDirections[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2] = 
+	{
+	btVector3(btScalar(0.000000) , btScalar(-0.000000),btScalar(-1.000000)),
+	btVector3(btScalar(0.723608) , btScalar(-0.525725),btScalar(-0.447219)),
+	btVector3(btScalar(-0.276388) , btScalar(-0.850649),btScalar(-0.447219)),
+	btVector3(btScalar(-0.894426) , btScalar(-0.000000),btScalar(-0.447216)),
+	btVector3(btScalar(-0.276388) , btScalar(0.850649),btScalar(-0.447220)),
+	btVector3(btScalar(0.723608) , btScalar(0.525725),btScalar(-0.447219)),
+	btVector3(btScalar(0.276388) , btScalar(-0.850649),btScalar(0.447220)),
+	btVector3(btScalar(-0.723608) , btScalar(-0.525725),btScalar(0.447219)),
+	btVector3(btScalar(-0.723608) , btScalar(0.525725),btScalar(0.447219)),
+	btVector3(btScalar(0.276388) , btScalar(0.850649),btScalar(0.447219)),
+	btVector3(btScalar(0.894426) , btScalar(0.000000),btScalar(0.447216)),
+	btVector3(btScalar(-0.000000) , btScalar(0.000000),btScalar(1.000000)),
+	btVector3(btScalar(0.425323) , btScalar(-0.309011),btScalar(-0.850654)),
+	btVector3(btScalar(-0.162456) , btScalar(-0.499995),btScalar(-0.850654)),
+	btVector3(btScalar(0.262869) , btScalar(-0.809012),btScalar(-0.525738)),
+	btVector3(btScalar(0.425323) , btScalar(0.309011),btScalar(-0.850654)),
+	btVector3(btScalar(0.850648) , btScalar(-0.000000),btScalar(-0.525736)),
+	btVector3(btScalar(-0.525730) , btScalar(-0.000000),btScalar(-0.850652)),
+	btVector3(btScalar(-0.688190) , btScalar(-0.499997),btScalar(-0.525736)),
+	btVector3(btScalar(-0.162456) , btScalar(0.499995),btScalar(-0.850654)),
+	btVector3(btScalar(-0.688190) , btScalar(0.499997),btScalar(-0.525736)),
+	btVector3(btScalar(0.262869) , btScalar(0.809012),btScalar(-0.525738)),
+	btVector3(btScalar(0.951058) , btScalar(0.309013),btScalar(0.000000)),
+	btVector3(btScalar(0.951058) , btScalar(-0.309013),btScalar(0.000000)),
+	btVector3(btScalar(0.587786) , btScalar(-0.809017),btScalar(0.000000)),
+	btVector3(btScalar(0.000000) , btScalar(-1.000000),btScalar(0.000000)),
+	btVector3(btScalar(-0.587786) , btScalar(-0.809017),btScalar(0.000000)),
+	btVector3(btScalar(-0.951058) , btScalar(-0.309013),btScalar(-0.000000)),
+	btVector3(btScalar(-0.951058) , btScalar(0.309013),btScalar(-0.000000)),
+	btVector3(btScalar(-0.587786) , btScalar(0.809017),btScalar(-0.000000)),
+	btVector3(btScalar(-0.000000) , btScalar(1.000000),btScalar(-0.000000)),
+	btVector3(btScalar(0.587786) , btScalar(0.809017),btScalar(-0.000000)),
+	btVector3(btScalar(0.688190) , btScalar(-0.499997),btScalar(0.525736)),
+	btVector3(btScalar(-0.262869) , btScalar(-0.809012),btScalar(0.525738)),
+	btVector3(btScalar(-0.850648) , btScalar(0.000000),btScalar(0.525736)),
+	btVector3(btScalar(-0.262869) , btScalar(0.809012),btScalar(0.525738)),
+	btVector3(btScalar(0.688190) , btScalar(0.499997),btScalar(0.525736)),
+	btVector3(btScalar(0.525730) , btScalar(0.000000),btScalar(0.850652)),
+	btVector3(btScalar(0.162456) , btScalar(-0.499995),btScalar(0.850654)),
+	btVector3(btScalar(-0.425323) , btScalar(-0.309011),btScalar(0.850654)),
+	btVector3(btScalar(-0.425323) , btScalar(0.309011),btScalar(0.850654)),
+	btVector3(btScalar(0.162456) , btScalar(0.499995),btScalar(0.850654))
+	};
+
+	return sPenetrationDirections;
+}
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h
new file mode 100644
index 0000000..6a8fe52
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h
@@ -0,0 +1,40 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
+#define BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
+
+#include "btConvexPenetrationDepthSolver.h"
+
+///MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation.
+///Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points.
+class btMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver
+{
+protected:
+
+	static btVector3*	getPenetrationDirections();
+
+public:
+
+	virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver,
+	const btConvexShape* convexA,const btConvexShape* convexB,
+				const btTransform& transA,const btTransform& transB,
+			btVector3& v, btVector3& pa, btVector3& pb,
+			class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc
+			);
+};
+
+#endif //BT_MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
new file mode 100644
index 0000000..924a8af
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
@@ -0,0 +1,260 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btPersistentManifold.h"
+#include "LinearMath/btTransform.h"
+
+
+btScalar					gContactBreakingThreshold = btScalar(0.02);
+ContactDestroyedCallback	gContactDestroyedCallback = 0;
+ContactProcessedCallback	gContactProcessedCallback = 0;
+
+
+
+btPersistentManifold::btPersistentManifold()
+:btTypedObject(BT_PERSISTENT_MANIFOLD_TYPE),
+m_body0(0),
+m_body1(0),
+m_cachedPoints (0),
+m_index1a(0)
+{
+}
+
+
+
+
+#ifdef DEBUG_PERSISTENCY
+#include <stdio.h>
+void	btPersistentManifold::DebugPersistency()
+{
+	int i;
+	printf("DebugPersistency : numPoints %d\n",m_cachedPoints);
+	for (i=0;i<m_cachedPoints;i++)
+	{
+		printf("m_pointCache[%d].m_userPersistentData = %x\n",i,m_pointCache[i].m_userPersistentData);
+	}
+}
+#endif //DEBUG_PERSISTENCY
+
+void btPersistentManifold::clearUserCache(btManifoldPoint& pt)
+{
+
+	void* oldPtr = pt.m_userPersistentData;
+	if (oldPtr)
+	{
+#ifdef DEBUG_PERSISTENCY
+		int i;
+		int occurance = 0;
+		for (i=0;i<m_cachedPoints;i++)
+		{
+			if (m_pointCache[i].m_userPersistentData == oldPtr)
+			{
+				occurance++;
+				if (occurance>1)
+					printf("error in clearUserCache\n");
+			}
+		}
+		btAssert(occurance<=0);
+#endif //DEBUG_PERSISTENCY
+
+		if (pt.m_userPersistentData && gContactDestroyedCallback)
+		{
+			(*gContactDestroyedCallback)(pt.m_userPersistentData);
+			pt.m_userPersistentData = 0;
+		}
+		
+#ifdef DEBUG_PERSISTENCY
+		DebugPersistency();
+#endif
+	}
+
+	
+}
+
+
+int btPersistentManifold::sortCachedPoints(const btManifoldPoint& pt) 
+{
+
+		//calculate 4 possible cases areas, and take biggest area
+		//also need to keep 'deepest'
+		
+		int maxPenetrationIndex = -1;
+#define KEEP_DEEPEST_POINT 1
+#ifdef KEEP_DEEPEST_POINT
+		btScalar maxPenetration = pt.getDistance();
+		for (int i=0;i<4;i++)
+		{
+			if (m_pointCache[i].getDistance() < maxPenetration)
+			{
+				maxPenetrationIndex = i;
+				maxPenetration = m_pointCache[i].getDistance();
+			}
+		}
+#endif //KEEP_DEEPEST_POINT
+		
+		btScalar res0(btScalar(0.)),res1(btScalar(0.)),res2(btScalar(0.)),res3(btScalar(0.));
+		if (maxPenetrationIndex != 0)
+		{
+			btVector3 a0 = pt.m_localPointA-m_pointCache[1].m_localPointA;
+			btVector3 b0 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA;
+			btVector3 cross = a0.cross(b0);
+			res0 = cross.length2();
+		}
+		if (maxPenetrationIndex != 1)
+		{
+			btVector3 a1 = pt.m_localPointA-m_pointCache[0].m_localPointA;
+			btVector3 b1 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA;
+			btVector3 cross = a1.cross(b1);
+			res1 = cross.length2();
+		}
+
+		if (maxPenetrationIndex != 2)
+		{
+			btVector3 a2 = pt.m_localPointA-m_pointCache[0].m_localPointA;
+			btVector3 b2 = m_pointCache[3].m_localPointA-m_pointCache[1].m_localPointA;
+			btVector3 cross = a2.cross(b2);
+			res2 = cross.length2();
+		}
+
+		if (maxPenetrationIndex != 3)
+		{
+			btVector3 a3 = pt.m_localPointA-m_pointCache[0].m_localPointA;
+			btVector3 b3 = m_pointCache[2].m_localPointA-m_pointCache[1].m_localPointA;
+			btVector3 cross = a3.cross(b3);
+			res3 = cross.length2();
+		}
+
+		btVector4 maxvec(res0,res1,res2,res3);
+		int biggestarea = maxvec.closestAxis4();
+		return biggestarea;
+}
+
+
+int btPersistentManifold::getCacheEntry(const btManifoldPoint& newPoint) const
+{
+	btScalar shortestDist =  getContactBreakingThreshold() * getContactBreakingThreshold();
+	int size = getNumContacts();
+	int nearestPoint = -1;
+	for( int i = 0; i < size; i++ )
+	{
+		const btManifoldPoint &mp = m_pointCache[i];
+
+		btVector3 diffA =  mp.m_localPointA- newPoint.m_localPointA;
+		const btScalar distToManiPoint = diffA.dot(diffA);
+		if( distToManiPoint < shortestDist )
+		{
+			shortestDist = distToManiPoint;
+			nearestPoint = i;
+		}
+	}
+	return nearestPoint;
+}
+
+int btPersistentManifold::addManifoldPoint(const btManifoldPoint& newPoint)
+{
+	btAssert(validContactDistance(newPoint));
+
+	int insertIndex = getNumContacts();
+	if (insertIndex == MANIFOLD_CACHE_SIZE)
+	{
+#if MANIFOLD_CACHE_SIZE >= 4
+		//sort cache so best points come first, based on area
+		insertIndex = sortCachedPoints(newPoint);
+#else
+		insertIndex = 0;
+#endif
+		clearUserCache(m_pointCache[insertIndex]);
+		
+	} else
+	{
+		m_cachedPoints++;
+
+		
+	}
+	if (insertIndex<0)
+		insertIndex=0;
+
+	btAssert(m_pointCache[insertIndex].m_userPersistentData==0);
+	m_pointCache[insertIndex] = newPoint;
+	return insertIndex;
+}
+
+btScalar	btPersistentManifold::getContactBreakingThreshold() const
+{
+	return m_contactBreakingThreshold;
+}
+
+
+
+void btPersistentManifold::refreshContactPoints(const btTransform& trA,const btTransform& trB)
+{
+	int i;
+#ifdef DEBUG_PERSISTENCY
+	printf("refreshContactPoints posA = (%f,%f,%f) posB = (%f,%f,%f)\n",
+		trA.getOrigin().getX(),
+		trA.getOrigin().getY(),
+		trA.getOrigin().getZ(),
+		trB.getOrigin().getX(),
+		trB.getOrigin().getY(),
+		trB.getOrigin().getZ());
+#endif //DEBUG_PERSISTENCY
+	/// first refresh worldspace positions and distance
+	for (i=getNumContacts()-1;i>=0;i--)
+	{
+		btManifoldPoint &manifoldPoint = m_pointCache[i];
+		manifoldPoint.m_positionWorldOnA = trA( manifoldPoint.m_localPointA );
+		manifoldPoint.m_positionWorldOnB = trB( manifoldPoint.m_localPointB );
+		manifoldPoint.m_distance1 = (manifoldPoint.m_positionWorldOnA -  manifoldPoint.m_positionWorldOnB).dot(manifoldPoint.m_normalWorldOnB);
+		manifoldPoint.m_lifeTime++;
+	}
+
+	/// then 
+	btScalar distance2d;
+	btVector3 projectedDifference,projectedPoint;
+	for (i=getNumContacts()-1;i>=0;i--)
+	{
+		
+		btManifoldPoint &manifoldPoint = m_pointCache[i];
+		//contact becomes invalid when signed distance exceeds margin (projected on contactnormal direction)
+		if (!validContactDistance(manifoldPoint))
+		{
+			removeContactPoint(i);
+		} else
+		{
+			//contact also becomes invalid when relative movement orthogonal to normal exceeds margin
+			projectedPoint = manifoldPoint.m_positionWorldOnA - manifoldPoint.m_normalWorldOnB * manifoldPoint.m_distance1;
+			projectedDifference = manifoldPoint.m_positionWorldOnB - projectedPoint;
+			distance2d = projectedDifference.dot(projectedDifference);
+			if (distance2d  > getContactBreakingThreshold()*getContactBreakingThreshold() )
+			{
+				removeContactPoint(i);
+			} else
+			{
+				//contact point processed callback
+				if (gContactProcessedCallback)
+					(*gContactProcessedCallback)(manifoldPoint,m_body0,m_body1);
+			}
+		}
+	}
+#ifdef DEBUG_PERSISTENCY
+	DebugPersistency();
+#endif //
+}
+
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
new file mode 100644
index 0000000..83d17f2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
@@ -0,0 +1,232 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_PERSISTENT_MANIFOLD_H
+#define BT_PERSISTENT_MANIFOLD_H
+
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+#include "btManifoldPoint.h"
+#include "LinearMath/btAlignedAllocator.h"
+
+struct btCollisionResult;
+
+///maximum contact breaking and merging threshold
+extern btScalar gContactBreakingThreshold;
+
+typedef bool (*ContactDestroyedCallback)(void* userPersistentData);
+typedef bool (*ContactProcessedCallback)(btManifoldPoint& cp,void* body0,void* body1);
+extern ContactDestroyedCallback	gContactDestroyedCallback;
+extern ContactProcessedCallback gContactProcessedCallback;
+
+//the enum starts at 1024 to avoid type conflicts with btTypedConstraint
+enum btContactManifoldTypes
+{
+	MIN_CONTACT_MANIFOLD_TYPE = 1024,
+	BT_PERSISTENT_MANIFOLD_TYPE
+};
+
+#define MANIFOLD_CACHE_SIZE 4
+
+///btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping in the broadphase.
+///Those contact points are created by the collision narrow phase.
+///The cache can be empty, or hold 1,2,3 or 4 points. Some collision algorithms (GJK) might only add one point at a time.
+///updates/refreshes old contact points, and throw them away if necessary (distance becomes too large)
+///reduces the cache to 4 points, when more then 4 points are added, using following rules:
+///the contact point with deepest penetration is always kept, and it tries to maximuze the area covered by the points
+///note that some pairs of objects might have more then one contact manifold.
+
+
+ATTRIBUTE_ALIGNED128( class) btPersistentManifold : public btTypedObject
+//ATTRIBUTE_ALIGNED16( class) btPersistentManifold : public btTypedObject
+{
+
+	btManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE];
+
+	/// this two body pointers can point to the physics rigidbody class.
+	/// void* will allow any rigidbody class
+	void* m_body0;
+	void* m_body1;
+
+	int	m_cachedPoints;
+
+	btScalar	m_contactBreakingThreshold;
+	btScalar	m_contactProcessingThreshold;
+
+	
+	/// sort cached points so most isolated points come first
+	int	sortCachedPoints(const btManifoldPoint& pt);
+
+	int		findContactPoint(const btManifoldPoint* unUsed, int numUnused,const btManifoldPoint& pt);
+
+public:
+
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	int	m_companionIdA;
+	int	m_companionIdB;
+
+	int m_index1a;
+
+	btPersistentManifold();
+
+	btPersistentManifold(void* body0,void* body1,int , btScalar contactBreakingThreshold,btScalar contactProcessingThreshold)
+		: btTypedObject(BT_PERSISTENT_MANIFOLD_TYPE),
+	m_body0(body0),m_body1(body1),m_cachedPoints(0),
+		m_contactBreakingThreshold(contactBreakingThreshold),
+		m_contactProcessingThreshold(contactProcessingThreshold)
+	{
+	}
+
+	SIMD_FORCE_INLINE void* getBody0() { return m_body0;}
+	SIMD_FORCE_INLINE void* getBody1() { return m_body1;}
+
+	SIMD_FORCE_INLINE const void* getBody0() const { return m_body0;}
+	SIMD_FORCE_INLINE const void* getBody1() const { return m_body1;}
+
+	void	setBodies(void* body0,void* body1)
+	{
+		m_body0 = body0;
+		m_body1 = body1;
+	}
+
+	void clearUserCache(btManifoldPoint& pt);
+
+#ifdef DEBUG_PERSISTENCY
+	void	DebugPersistency();
+#endif //
+	
+	SIMD_FORCE_INLINE int	getNumContacts() const { return m_cachedPoints;}
+
+	SIMD_FORCE_INLINE const btManifoldPoint& getContactPoint(int index) const
+	{
+		btAssert(index < m_cachedPoints);
+		return m_pointCache[index];
+	}
+
+	SIMD_FORCE_INLINE btManifoldPoint& getContactPoint(int index)
+	{
+		btAssert(index < m_cachedPoints);
+		return m_pointCache[index];
+	}
+
+	///@todo: get this margin from the current physics / collision environment
+	btScalar	getContactBreakingThreshold() const;
+
+	btScalar	getContactProcessingThreshold() const
+	{
+		return m_contactProcessingThreshold;
+	}
+	
+	int getCacheEntry(const btManifoldPoint& newPoint) const;
+
+	int addManifoldPoint( const btManifoldPoint& newPoint);
+
+	void removeContactPoint (int index)
+	{
+		clearUserCache(m_pointCache[index]);
+
+		int lastUsedIndex = getNumContacts() - 1;
+//		m_pointCache[index] = m_pointCache[lastUsedIndex];
+		if(index != lastUsedIndex) 
+		{
+			m_pointCache[index] = m_pointCache[lastUsedIndex]; 
+			//get rid of duplicated userPersistentData pointer
+			m_pointCache[lastUsedIndex].m_userPersistentData = 0;
+			m_pointCache[lastUsedIndex].mConstraintRow[0].m_accumImpulse = 0.f;
+			m_pointCache[lastUsedIndex].mConstraintRow[1].m_accumImpulse = 0.f;
+			m_pointCache[lastUsedIndex].mConstraintRow[2].m_accumImpulse = 0.f;
+
+			m_pointCache[lastUsedIndex].m_appliedImpulse = 0.f;
+			m_pointCache[lastUsedIndex].m_lateralFrictionInitialized = false;
+			m_pointCache[lastUsedIndex].m_appliedImpulseLateral1 = 0.f;
+			m_pointCache[lastUsedIndex].m_appliedImpulseLateral2 = 0.f;
+			m_pointCache[lastUsedIndex].m_lifeTime = 0;
+		}
+
+		btAssert(m_pointCache[lastUsedIndex].m_userPersistentData==0);
+		m_cachedPoints--;
+	}
+	void replaceContactPoint(const btManifoldPoint& newPoint,int insertIndex)
+	{
+		btAssert(validContactDistance(newPoint));
+
+#define MAINTAIN_PERSISTENCY 1
+#ifdef MAINTAIN_PERSISTENCY
+		int	lifeTime = m_pointCache[insertIndex].getLifeTime();
+		btScalar	appliedImpulse = m_pointCache[insertIndex].mConstraintRow[0].m_accumImpulse;
+		btScalar	appliedLateralImpulse1 = m_pointCache[insertIndex].mConstraintRow[1].m_accumImpulse;
+		btScalar	appliedLateralImpulse2 = m_pointCache[insertIndex].mConstraintRow[2].m_accumImpulse;
+//		bool isLateralFrictionInitialized = m_pointCache[insertIndex].m_lateralFrictionInitialized;
+		
+		
+			
+		btAssert(lifeTime>=0);
+		void* cache = m_pointCache[insertIndex].m_userPersistentData;
+		
+		m_pointCache[insertIndex] = newPoint;
+
+		m_pointCache[insertIndex].m_userPersistentData = cache;
+		m_pointCache[insertIndex].m_appliedImpulse = appliedImpulse;
+		m_pointCache[insertIndex].m_appliedImpulseLateral1 = appliedLateralImpulse1;
+		m_pointCache[insertIndex].m_appliedImpulseLateral2 = appliedLateralImpulse2;
+		
+		m_pointCache[insertIndex].mConstraintRow[0].m_accumImpulse =  appliedImpulse;
+		m_pointCache[insertIndex].mConstraintRow[1].m_accumImpulse = appliedLateralImpulse1;
+		m_pointCache[insertIndex].mConstraintRow[2].m_accumImpulse = appliedLateralImpulse2;
+
+
+		m_pointCache[insertIndex].m_lifeTime = lifeTime;
+#else
+		clearUserCache(m_pointCache[insertIndex]);
+		m_pointCache[insertIndex] = newPoint;
+	
+#endif
+	}
+
+	bool validContactDistance(const btManifoldPoint& pt) const
+	{
+		if (pt.m_lifeTime >1)
+		{
+			return pt.m_distance1 <= getContactBreakingThreshold();
+		}
+		return pt.m_distance1 <= getContactProcessingThreshold();
+	
+	}
+	/// calculated new worldspace coordinates and depth, and reject points that exceed the collision margin
+	void	refreshContactPoints(  const btTransform& trA,const btTransform& trB);
+
+	
+	SIMD_FORCE_INLINE	void	clearManifold()
+	{
+		int i;
+		for (i=0;i<m_cachedPoints;i++)
+		{
+			clearUserCache(m_pointCache[i]);
+		}
+		m_cachedPoints = 0;
+	}
+
+
+
+}
+;
+
+
+
+
+
+#endif //BT_PERSISTENT_MANIFOLD_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h
new file mode 100644
index 0000000..18da171
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPointCollector.h
@@ -0,0 +1,64 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_POINT_COLLECTOR_H
+#define BT_POINT_COLLECTOR_H
+
+#include "btDiscreteCollisionDetectorInterface.h"
+
+
+
+struct btPointCollector : public btDiscreteCollisionDetectorInterface::Result
+{
+	
+	
+	btVector3 m_normalOnBInWorld;
+	btVector3 m_pointInWorld;
+	btScalar	m_distance;//negative means penetration
+
+	bool	m_hasResult;
+
+	btPointCollector () 
+		: m_distance(btScalar(BT_LARGE_FLOAT)),m_hasResult(false)
+	{
+	}
+
+	virtual void setShapeIdentifiersA(int partId0,int index0)
+	{
+		(void)partId0;
+		(void)index0;
+			
+	}
+	virtual void setShapeIdentifiersB(int partId1,int index1)
+	{
+		(void)partId1;
+		(void)index1;
+	}
+
+	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
+	{
+		if (depth< m_distance)
+		{
+			m_hasResult = true;
+			m_normalOnBInWorld = normalOnBInWorld;
+			m_pointInWorld = pointInWorld;
+			//negative means penetration
+			m_distance = depth;
+		}
+	}
+};
+
+#endif //BT_POINT_COLLECTOR_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
new file mode 100644
index 0000000..31fe7da
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
@@ -0,0 +1,360 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2011 Advanced Micro Devices, Inc.  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+///This file was written by Erwin Coumans
+///Separating axis rest based on work from Pierre Terdiman, see
+///And contact clipping based on work from Simon Hobbs
+
+
+#include "btPolyhedralContactClipping.h"
+#include "BulletCollision/CollisionShapes/btConvexPolyhedron.h"
+
+#include <float.h> //for FLT_MAX
+
+
+// Clips a face to the back of a plane
+void btPolyhedralContactClipping::clipFace(const btVertexArray& pVtxIn, btVertexArray& ppVtxOut, const btVector3& planeNormalWS,btScalar planeEqWS)
+{
+	
+	int ve;
+	btScalar ds, de;
+	int numVerts = pVtxIn.size();
+	if (numVerts < 2)
+		return;
+
+	btVector3 firstVertex=pVtxIn[pVtxIn.size()-1];
+	btVector3 endVertex = pVtxIn[0];
+	
+	ds = planeNormalWS.dot(firstVertex)+planeEqWS;
+
+	for (ve = 0; ve < numVerts; ve++)
+	{
+		endVertex=pVtxIn[ve];
+
+		de = planeNormalWS.dot(endVertex)+planeEqWS;
+
+		if (ds<0)
+		{
+			if (de<0)
+			{
+				// Start < 0, end < 0, so output endVertex
+				ppVtxOut.push_back(endVertex);
+			}
+			else
+			{
+				// Start < 0, end >= 0, so output intersection
+				ppVtxOut.push_back( 	firstVertex.lerp(endVertex,btScalar(ds * 1.f/(ds - de))));
+			}
+		}
+		else
+		{
+			if (de<0)
+			{
+				// Start >= 0, end < 0 so output intersection and end
+				ppVtxOut.push_back(firstVertex.lerp(endVertex,btScalar(ds * 1.f/(ds - de))));
+				ppVtxOut.push_back(endVertex);
+			}
+		}
+		firstVertex = endVertex;
+		ds = de;
+	}
+}
+#include <stdio.h>
+
+
+static bool TestSepAxis(const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, const btVector3& sep_axis, float& depth)
+{
+	float Min0,Max0;
+	float Min1,Max1;
+	hullA.project(transA,sep_axis, Min0, Max0);
+	hullB.project(transB, sep_axis, Min1, Max1);
+
+	if(Max0<Min1 || Max1<Min0)
+		return false;
+
+	float d0 = Max0 - Min1;
+	assert(d0>=0.0f);
+	float d1 = Max1 - Min0;
+	assert(d1>=0.0f);
+	depth = d0<d1 ? d0:d1;
+	return true;
+}
+
+
+
+static int gActualSATPairTests=0;
+
+inline bool IsAlmostZero(const btVector3& v)
+{
+	if(fabsf(v.x())>1e-6 || fabsf(v.y())>1e-6 || fabsf(v.z())>1e-6)	return false;
+	return true;
+}
+
+
+bool btPolyhedralContactClipping::findSeparatingAxis(	const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, btVector3& sep)
+{
+	gActualSATPairTests++;
+
+#ifdef TEST_INTERNAL_OBJECTS
+	const btVector3 c0 = transA * hullA.mLocalCenter;
+	const btVector3 c1 = transB * hullB.mLocalCenter;
+	const btVector3 DeltaC2 = c0 - c1;
+#endif
+
+	float dmin = FLT_MAX;
+	int curPlaneTests=0;
+
+	int numFacesA = hullA.m_faces.size();
+	// Test normals from hullA
+	for(int i=0;i<numFacesA;i++)
+	{
+		const btVector3 Normal(hullA.m_faces[i].m_plane[0], hullA.m_faces[i].m_plane[1], hullA.m_faces[i].m_plane[2]);
+		const btVector3 faceANormalWS = transA.getBasis() * Normal;
+
+		curPlaneTests++;
+#ifdef TEST_INTERNAL_OBJECTS
+		gExpectedNbTests++;
+		if(gUseInternalObject && !TestInternalObjects(transA,transB,DeltaC2, faceANormalWS, hullA, hullB, dmin))
+			continue;
+		gActualNbTests++;
+#endif
+
+		float d;
+		if(!TestSepAxis( hullA, hullB, transA,transB, faceANormalWS, d))
+			return false;
+
+		if(d<dmin)
+		{
+			dmin = d;
+			sep = faceANormalWS;
+		}
+	}
+
+	int numFacesB = hullB.m_faces.size();
+	// Test normals from hullB
+	for(int i=0;i<numFacesB;i++)
+	{
+		const btVector3 Normal(hullB.m_faces[i].m_plane[0], hullB.m_faces[i].m_plane[1], hullB.m_faces[i].m_plane[2]);
+		const btVector3 WorldNormal = transB.getBasis() * Normal;
+
+		curPlaneTests++;
+#ifdef TEST_INTERNAL_OBJECTS
+		gExpectedNbTests++;
+		if(gUseInternalObject && !TestInternalObjects(transA,transB,DeltaC2, WorldNormal, hullA, hullB, dmin))
+			continue;
+		gActualNbTests++;
+#endif
+
+		float d;
+		if(!TestSepAxis(hullA, hullB,transA,transB, WorldNormal,d))
+			return false;
+
+		if(d<dmin)
+		{
+			dmin = d;
+			sep = WorldNormal;
+		}
+	}
+
+	btVector3 edgeAstart,edgeAend,edgeBstart,edgeBend;
+
+	int curEdgeEdge = 0;
+	// Test edges
+	for(int e0=0;e0<hullA.m_uniqueEdges.size();e0++)
+	{
+		const btVector3 edge0 = hullA.m_uniqueEdges[e0];
+		const btVector3 WorldEdge0 = transA.getBasis() * edge0;
+		for(int e1=0;e1<hullB.m_uniqueEdges.size();e1++)
+		{
+			const btVector3 edge1 = hullB.m_uniqueEdges[e1];
+			const btVector3 WorldEdge1 = transB.getBasis() * edge1;
+
+			btVector3 Cross = WorldEdge0.cross(WorldEdge1);
+			curEdgeEdge++;
+			if(!IsAlmostZero(Cross))
+			{
+				Cross = Cross.normalize();
+
+#ifdef TEST_INTERNAL_OBJECTS
+				gExpectedNbTests++;
+				if(gUseInternalObject && !TestInternalObjects(transA,transB,DeltaC2, Cross, hullA, hullB, dmin))
+					continue;
+				gActualNbTests++;
+#endif
+
+				float dist;
+				if(!TestSepAxis( hullA, hullB, transA,transB, Cross, dist))
+					return false;
+
+				if(dist<dmin)
+				{
+					dmin = dist;
+					sep = Cross;
+				}
+			}
+		}
+
+	}
+
+	const btVector3 deltaC = transB.getOrigin() - transA.getOrigin();
+	if((deltaC.dot(sep))>0.0f)
+		sep = -sep;
+
+	return true;
+}
+
+void	btPolyhedralContactClipping::clipFaceAgainstHull(const btVector3& separatingNormal, const btConvexPolyhedron& hullA,  const btTransform& transA, btVertexArray& worldVertsB1, const btScalar minDist, btScalar maxDist,btDiscreteCollisionDetectorInterface::Result& resultOut)
+{
+	btVertexArray worldVertsB2;
+	btVertexArray* pVtxIn = &worldVertsB1;
+	btVertexArray* pVtxOut = &worldVertsB2;
+	pVtxOut->reserve(pVtxIn->size());
+
+	int closestFaceA=-1;
+	{
+		btScalar dmin = FLT_MAX;
+		for(int face=0;face<hullA.m_faces.size();face++)
+		{
+			const btVector3 Normal(hullA.m_faces[face].m_plane[0], hullA.m_faces[face].m_plane[1], hullA.m_faces[face].m_plane[2]);
+			const btVector3 faceANormalWS = transA.getBasis() * Normal;
+		
+			btScalar d = faceANormalWS.dot(separatingNormal);
+			if (d < dmin)
+			{
+				dmin = d;
+				closestFaceA = face;
+			}
+		}
+	}
+	if (closestFaceA<0)
+		return;
+
+	const btFace& polyA = hullA.m_faces[closestFaceA];
+
+		// clip polygon to back of planes of all faces of hull A that are adjacent to witness face
+	int numContacts = pVtxIn->size();
+	int numVerticesA = polyA.m_indices.size();
+	for(int e0=0;e0<numVerticesA;e0++)
+	{
+		/*const btVector3& a = hullA.m_vertices[polyA.m_indices[e0]];
+		const btVector3& b = hullA.m_vertices[polyA.m_indices[(e0+1)%numVerticesA]];
+		const btVector3 edge0 = a - b;
+		const btVector3 WorldEdge0 = transA.getBasis() * edge0;
+		*/
+
+		int otherFace = polyA.m_connectedFaces[e0];
+		btVector3 localPlaneNormal (hullA.m_faces[otherFace].m_plane[0],hullA.m_faces[otherFace].m_plane[1],hullA.m_faces[otherFace].m_plane[2]);
+		btScalar localPlaneEq = hullA.m_faces[otherFace].m_plane[3];
+
+		btVector3 planeNormalWS = transA.getBasis()*localPlaneNormal;
+		btScalar planeEqWS=localPlaneEq-planeNormalWS.dot(transA.getOrigin());
+		//clip face
+
+		clipFace(*pVtxIn, *pVtxOut,planeNormalWS,planeEqWS);
+		btSwap(pVtxIn,pVtxOut);
+		pVtxOut->resize(0);
+	}
+
+
+
+//#define ONLY_REPORT_DEEPEST_POINT
+
+	btVector3 point;
+	
+
+	// only keep points that are behind the witness face
+	{
+		btVector3 localPlaneNormal (polyA.m_plane[0],polyA.m_plane[1],polyA.m_plane[2]);
+		btScalar localPlaneEq = polyA.m_plane[3];
+		btVector3 planeNormalWS = transA.getBasis()*localPlaneNormal;
+		btScalar planeEqWS=localPlaneEq-planeNormalWS.dot(transA.getOrigin());
+		for (int i=0;i<pVtxIn->size();i++)
+		{
+			
+			btScalar depth = planeNormalWS.dot(pVtxIn->at(i))+planeEqWS;
+			if (depth <=maxDist && depth >=minDist)
+			{
+				btVector3 point = pVtxIn->at(i);
+#ifdef ONLY_REPORT_DEEPEST_POINT
+				curMaxDist = depth;
+#else
+#if 0
+				if (depth<-3)
+				{
+					printf("error in btPolyhedralContactClipping depth = %f\n", depth);
+					printf("likely wrong separatingNormal passed in\n");
+				} 
+#endif				
+				resultOut.addContactPoint(separatingNormal,point,depth);
+#endif
+			}
+		}
+	}
+#ifdef ONLY_REPORT_DEEPEST_POINT
+	if (curMaxDist<maxDist)
+	{
+		resultOut.addContactPoint(separatingNormal,point,curMaxDist);
+	}
+#endif //ONLY_REPORT_DEEPEST_POINT
+
+}
+
+void	btPolyhedralContactClipping::clipHullAgainstHull(const btVector3& separatingNormal, const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, const btScalar minDist, btScalar maxDist,btDiscreteCollisionDetectorInterface::Result& resultOut)
+{
+
+	btScalar curMaxDist=maxDist;
+	int closestFaceB=-1;
+
+	{
+		btScalar dmax = -FLT_MAX;
+		for(int face=0;face<hullB.m_faces.size();face++)
+		{
+			const btVector3 Normal(hullB.m_faces[face].m_plane[0], hullB.m_faces[face].m_plane[1], hullB.m_faces[face].m_plane[2]);
+			const btVector3 WorldNormal = transB.getBasis() * Normal;
+
+			btScalar d = WorldNormal.dot(separatingNormal);
+			if (d > dmax)
+			{
+				dmax = d;
+				closestFaceB = face;
+			}
+		}
+	}
+
+
+
+	if (closestFaceB<0)
+	{
+		return;
+	}
+
+
+
+	// setup initial clip face (minimizing face from hull B)
+	btVertexArray worldVertsB1;
+	{
+		const btFace& polyB = hullB.m_faces[closestFaceB];
+		const int numVertices = polyB.m_indices.size();
+		for(int e0=0;e0<numVertices;e0++)
+		{
+			const btVector3& b = hullB.m_vertices[polyB.m_indices[e0]];
+			worldVertsB1.push_back(transB*b);
+		}
+	}
+
+	clipFaceAgainstHull(separatingNormal, hullA, transA,worldVertsB1, minDist, maxDist,resultOut);
+
+}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h
new file mode 100644
index 0000000..7ab9c1e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h
@@ -0,0 +1,46 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2011 Advanced Micro Devices, Inc.  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+///This file was written by Erwin Coumans
+
+
+#ifndef BT_POLYHEDRAL_CONTACT_CLIPPING_H
+#define BT_POLYHEDRAL_CONTACT_CLIPPING_H
+
+
+#include "LinearMath/btAlignedObjectArray.h"
+#include "LinearMath/btTransform.h"
+#include "btDiscreteCollisionDetectorInterface.h"
+
+class btConvexPolyhedron;
+
+typedef btAlignedObjectArray<btVector3> btVertexArray;
+
+// Clips a face to the back of a plane
+struct btPolyhedralContactClipping
+{
+	static void clipHullAgainstHull(const btVector3& separatingNormal, const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, const btScalar minDist, btScalar maxDist, btDiscreteCollisionDetectorInterface::Result& resultOut);
+	static void	clipFaceAgainstHull(const btVector3& separatingNormal, const btConvexPolyhedron& hullA,  const btTransform& transA, btVertexArray& worldVertsB1, const btScalar minDist, btScalar maxDist,btDiscreteCollisionDetectorInterface::Result& resultOut);
+
+	static bool findSeparatingAxis(	const btConvexPolyhedron& hullA, const btConvexPolyhedron& hullB, const btTransform& transA,const btTransform& transB, btVector3& sep);
+
+	///the clipFace method is used internally
+	static void clipFace(const btVertexArray& pVtxIn, btVertexArray& ppVtxOut, const btVector3& planeNormalWS,btScalar planeEqWS);
+
+};
+
+#endif // BT_POLYHEDRAL_CONTACT_CLIPPING_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
new file mode 100644
index 0000000..fbe579c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
@@ -0,0 +1,177 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+//#include <stdio.h>
+
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h"
+#include "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
+#include "btRaycastCallback.h"
+
+btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to, unsigned int flags)
+	:
+	m_from(from),
+	m_to(to),
+   //@BP Mod
+   m_flags(flags),
+	m_hitFraction(btScalar(1.))
+{
+
+}
+
+
+
+void btTriangleRaycastCallback::processTriangle(btVector3* triangle,int partId, int triangleIndex)
+{
+	const btVector3 &vert0=triangle[0];
+	const btVector3 &vert1=triangle[1];
+	const btVector3 &vert2=triangle[2];
+
+	btVector3 v10; v10 = vert1 - vert0 ;
+	btVector3 v20; v20 = vert2 - vert0 ;
+
+	btVector3 triangleNormal; triangleNormal = v10.cross( v20 );
+	
+	const btScalar dist = vert0.dot(triangleNormal);
+	btScalar dist_a = triangleNormal.dot(m_from) ;
+	dist_a-= dist;
+	btScalar dist_b = triangleNormal.dot(m_to);
+	dist_b -= dist;
+
+	if ( dist_a * dist_b >= btScalar(0.0) )
+	{
+		return ; // same sign
+	}
+   //@BP Mod - Backface filtering
+   if (((m_flags & kF_FilterBackfaces) != 0) && (dist_a > btScalar(0.0)))
+   {
+      // Backface, skip check
+      return;
+   }
+	
+	const btScalar proj_length=dist_a-dist_b;
+	const btScalar distance = (dist_a)/(proj_length);
+	// Now we have the intersection point on the plane, we'll see if it's inside the triangle
+	// Add an epsilon as a tolerance for the raycast,
+	// in case the ray hits exacly on the edge of the triangle.
+	// It must be scaled for the triangle size.
+	
+	if(distance < m_hitFraction)
+	{
+		
+
+		btScalar edge_tolerance =triangleNormal.length2();		
+		edge_tolerance *= btScalar(-0.0001);
+		btVector3 point; point.setInterpolate3( m_from, m_to, distance);
+		{
+			btVector3 v0p; v0p = vert0 - point;
+			btVector3 v1p; v1p = vert1 - point;
+			btVector3 cp0; cp0 = v0p.cross( v1p );
+
+			if ( (btScalar)(cp0.dot(triangleNormal)) >=edge_tolerance) 
+			{
+						
+
+				btVector3 v2p; v2p = vert2 -  point;
+				btVector3 cp1;
+				cp1 = v1p.cross( v2p);
+				if ( (btScalar)(cp1.dot(triangleNormal)) >=edge_tolerance) 
+				{
+					btVector3 cp2;
+					cp2 = v2p.cross(v0p);
+					
+					if ( (btScalar)(cp2.dot(triangleNormal)) >=edge_tolerance) 
+					{
+                  //@BP Mod
+                  // Triangle normal isn't normalized
+				      triangleNormal.normalize();
+
+                  //@BP Mod - Allow for unflipped normal when raycasting against backfaces
+                  if (((m_flags & kF_KeepUnflippedNormal) != 0) || (dist_a <= btScalar(0.0)))
+						{
+							m_hitFraction = reportHit(-triangleNormal,distance,partId,triangleIndex);
+						}
+						else
+						{
+                     m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex);
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+
+btTriangleConvexcastCallback::btTriangleConvexcastCallback (const btConvexShape* convexShape, const btTransform& convexShapeFrom, const btTransform& convexShapeTo, const btTransform& triangleToWorld, const btScalar triangleCollisionMargin)
+{
+	m_convexShape = convexShape;
+	m_convexShapeFrom = convexShapeFrom;
+	m_convexShapeTo = convexShapeTo;
+	m_triangleToWorld = triangleToWorld;
+	m_hitFraction = 1.0f;
+	m_triangleCollisionMargin = triangleCollisionMargin;
+	m_allowedPenetration = 0.f;
+}
+
+void
+btTriangleConvexcastCallback::processTriangle (btVector3* triangle, int partId, int triangleIndex)
+{
+	btTriangleShape triangleShape (triangle[0], triangle[1], triangle[2]);
+    triangleShape.setMargin(m_triangleCollisionMargin);
+
+	btVoronoiSimplexSolver	simplexSolver;
+	btGjkEpaPenetrationDepthSolver	gjkEpaPenetrationSolver;
+
+//#define  USE_SUBSIMPLEX_CONVEX_CAST 1
+//if you reenable USE_SUBSIMPLEX_CONVEX_CAST see commented out code below
+#ifdef USE_SUBSIMPLEX_CONVEX_CAST
+	btSubsimplexConvexCast convexCaster(m_convexShape, &triangleShape, &simplexSolver);
+#else
+	//btGjkConvexCast	convexCaster(m_convexShape,&triangleShape,&simplexSolver);
+	btContinuousConvexCollision convexCaster(m_convexShape,&triangleShape,&simplexSolver,&gjkEpaPenetrationSolver);
+#endif //#USE_SUBSIMPLEX_CONVEX_CAST
+	
+	btConvexCast::CastResult castResult;
+	castResult.m_fraction = btScalar(1.);
+	castResult.m_allowedPenetration = m_allowedPenetration;
+	if (convexCaster.calcTimeOfImpact(m_convexShapeFrom,m_convexShapeTo,m_triangleToWorld, m_triangleToWorld, castResult))
+	{
+		//add hit
+		if (castResult.m_normal.length2() > btScalar(0.0001))
+		{					
+			if (castResult.m_fraction < m_hitFraction)
+			{
+/* btContinuousConvexCast's normal is already in world space */
+/*
+#ifdef USE_SUBSIMPLEX_CONVEX_CAST
+				//rotate normal into worldspace
+				castResult.m_normal = m_convexShapeFrom.getBasis() * castResult.m_normal;
+#endif //USE_SUBSIMPLEX_CONVEX_CAST
+*/
+				castResult.m_normal.normalize();
+
+				reportHit (castResult.m_normal,
+							castResult.m_hitPoint,
+							castResult.m_fraction,
+							partId,
+							triangleIndex);
+			}
+		}
+	}
+}
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
new file mode 100644
index 0000000..f012889
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
@@ -0,0 +1,72 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_RAYCAST_TRI_CALLBACK_H
+#define BT_RAYCAST_TRI_CALLBACK_H
+
+#include "BulletCollision/CollisionShapes/btTriangleCallback.h"
+#include "LinearMath/btTransform.h"
+struct btBroadphaseProxy;
+class btConvexShape;
+
+class  btTriangleRaycastCallback: public btTriangleCallback
+{
+public:
+
+	//input
+	btVector3 m_from;
+	btVector3 m_to;
+
+   //@BP Mod - allow backface filtering and unflipped normals
+   enum EFlags
+   {
+      kF_None                 = 0,
+      kF_FilterBackfaces      = 1 << 0,
+      kF_KeepUnflippedNormal  = 1 << 1,   // Prevents returned face normal getting flipped when a ray hits a back-facing triangle
+
+      kF_Terminator        = 0xFFFFFFFF
+   };
+   unsigned int m_flags;
+
+	btScalar	m_hitFraction;
+
+	btTriangleRaycastCallback(const btVector3& from,const btVector3& to, unsigned int flags=0);
+	
+	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);
+
+	virtual btScalar reportHit(const btVector3& hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex ) = 0;
+	
+};
+
+class btTriangleConvexcastCallback : public btTriangleCallback
+{
+public:
+	const btConvexShape* m_convexShape;
+	btTransform m_convexShapeFrom;
+	btTransform m_convexShapeTo;
+	btTransform m_triangleToWorld;
+	btScalar m_hitFraction;
+	btScalar m_triangleCollisionMargin;
+	btScalar m_allowedPenetration;
+
+	btTriangleConvexcastCallback (const btConvexShape* convexShape, const btTransform& convexShapeFrom, const btTransform& convexShapeTo, const btTransform& triangleToWorld, const btScalar triangleCollisionMargin);
+
+	virtual void processTriangle (btVector3* triangle, int partId, int triangleIndex);
+
+	virtual btScalar reportHit (const btVector3& hitNormalLocal, const btVector3& hitPointLocal, btScalar hitFraction, int partId, int triangleIndex) = 0;
+};
+
+#endif //BT_RAYCAST_TRI_CALLBACK_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h
new file mode 100644
index 0000000..da8a139
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h
@@ -0,0 +1,63 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_SIMPLEX_SOLVER_INTERFACE_H
+#define BT_SIMPLEX_SOLVER_INTERFACE_H
+
+#include "LinearMath/btVector3.h"
+
+#define NO_VIRTUAL_INTERFACE 1
+#ifdef NO_VIRTUAL_INTERFACE
+#include "btVoronoiSimplexSolver.h"
+#define btSimplexSolverInterface btVoronoiSimplexSolver
+#else
+
+/// btSimplexSolverInterface can incrementally calculate distance between origin and up to 4 vertices
+/// Used by GJK or Linear Casting. Can be implemented by the Johnson-algorithm or alternative approaches based on
+/// voronoi regions or barycentric coordinates
+class btSimplexSolverInterface
+{
+	public:
+		virtual ~btSimplexSolverInterface() {};
+
+	virtual void reset() = 0;
+
+	virtual void addVertex(const btVector3& w, const btVector3& p, const btVector3& q) = 0;
+	
+	virtual bool closest(btVector3& v) = 0;
+
+	virtual btScalar maxVertex() = 0;
+
+	virtual bool fullSimplex() const = 0;
+
+	virtual int getSimplex(btVector3 *pBuf, btVector3 *qBuf, btVector3 *yBuf) const = 0;
+
+	virtual bool inSimplex(const btVector3& w) = 0;
+	
+	virtual void backup_closest(btVector3& v) = 0;
+
+	virtual bool emptySimplex() const = 0;
+
+	virtual void compute_points(btVector3& p1, btVector3& p2) = 0;
+
+	virtual int numVertices() const =0;
+
+
+};
+#endif
+#endif //BT_SIMPLEX_SOLVER_INTERFACE_H
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
new file mode 100644
index 0000000..18eb662
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
@@ -0,0 +1,160 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btSubSimplexConvexCast.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+
+#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h"
+#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
+#include "btPointCollector.h"
+#include "LinearMath/btTransformUtil.h"
+
+btSubsimplexConvexCast::btSubsimplexConvexCast (const btConvexShape* convexA,const btConvexShape* convexB,btSimplexSolverInterface* simplexSolver)
+:m_simplexSolver(simplexSolver),
+m_convexA(convexA),m_convexB(convexB)
+{
+}
+
+///Typically the conservative advancement reaches solution in a few iterations, clip it to 32 for degenerate cases.
+///See discussion about this here http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=565
+#ifdef BT_USE_DOUBLE_PRECISION
+#define MAX_ITERATIONS 64
+#else
+#define MAX_ITERATIONS 32
+#endif
+bool	btSubsimplexConvexCast::calcTimeOfImpact(
+		const btTransform& fromA,
+		const btTransform& toA,
+		const btTransform& fromB,
+		const btTransform& toB,
+		CastResult& result)
+{
+
+	m_simplexSolver->reset();
+
+	btVector3 linVelA,linVelB;
+	linVelA = toA.getOrigin()-fromA.getOrigin();
+	linVelB = toB.getOrigin()-fromB.getOrigin();
+
+	btScalar lambda = btScalar(0.);
+
+	btTransform interpolatedTransA = fromA;
+	btTransform interpolatedTransB = fromB;
+
+	///take relative motion
+	btVector3 r = (linVelA-linVelB);
+	btVector3 v;
+	
+	btVector3 supVertexA = fromA(m_convexA->localGetSupportingVertex(-r*fromA.getBasis()));
+	btVector3 supVertexB = fromB(m_convexB->localGetSupportingVertex(r*fromB.getBasis()));
+	v = supVertexA-supVertexB;
+	int maxIter = MAX_ITERATIONS;
+
+	btVector3 n;
+	n.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+	bool hasResult = false;
+	btVector3 c;
+
+	btScalar lastLambda = lambda;
+
+
+	btScalar dist2 = v.length2();
+#ifdef BT_USE_DOUBLE_PRECISION
+	btScalar epsilon = btScalar(0.0001);
+#else
+	btScalar epsilon = btScalar(0.0001);
+#endif //BT_USE_DOUBLE_PRECISION
+	btVector3	w,p;
+	btScalar VdotR;
+	
+	while ( (dist2 > epsilon) && maxIter--)
+	{
+		supVertexA = interpolatedTransA(m_convexA->localGetSupportingVertex(-v*interpolatedTransA.getBasis()));
+		supVertexB = interpolatedTransB(m_convexB->localGetSupportingVertex(v*interpolatedTransB.getBasis()));
+		w = supVertexA-supVertexB;
+
+		btScalar VdotW = v.dot(w);
+
+		if (lambda > btScalar(1.0))
+		{
+			return false;
+		}
+
+		if ( VdotW > btScalar(0.))
+		{
+			VdotR = v.dot(r);
+
+			if (VdotR >= -(SIMD_EPSILON*SIMD_EPSILON))
+				return false;
+			else
+			{
+				lambda = lambda - VdotW / VdotR;
+				//interpolate to next lambda
+				//	x = s + lambda * r;
+				interpolatedTransA.getOrigin().setInterpolate3(fromA.getOrigin(),toA.getOrigin(),lambda);
+				interpolatedTransB.getOrigin().setInterpolate3(fromB.getOrigin(),toB.getOrigin(),lambda);
+				//m_simplexSolver->reset();
+				//check next line
+				 w = supVertexA-supVertexB;
+				lastLambda = lambda;
+				n = v;
+				hasResult = true;
+			}
+		} 
+		///Just like regular GJK only add the vertex if it isn't already (close) to current vertex, it would lead to divisions by zero and NaN etc.
+		if (!m_simplexSolver->inSimplex(w))
+			m_simplexSolver->addVertex( w, supVertexA , supVertexB);
+
+		if (m_simplexSolver->closest(v))
+		{
+			dist2 = v.length2();
+			hasResult = true;
+			//todo: check this normal for validity
+			//n=v;
+			//printf("V=%f , %f, %f\n",v[0],v[1],v[2]);
+			//printf("DIST2=%f\n",dist2);
+			//printf("numverts = %i\n",m_simplexSolver->numVertices());
+		} else
+		{
+			dist2 = btScalar(0.);
+		} 
+	}
+
+	//int numiter = MAX_ITERATIONS - maxIter;
+//	printf("number of iterations: %d", numiter);
+	
+	//don't report a time of impact when moving 'away' from the hitnormal
+	
+
+	result.m_fraction = lambda;
+	if (n.length2() >= (SIMD_EPSILON*SIMD_EPSILON))
+		result.m_normal = n.normalized();
+	else
+		result.m_normal = btVector3(btScalar(0.0), btScalar(0.0), btScalar(0.0));
+
+	//don't report time of impact for motion away from the contact normal (or causes minor penetration)
+	if (result.m_normal.dot(r)>=-result.m_allowedPenetration)
+		return false;
+
+	btVector3 hitA,hitB;
+	m_simplexSolver->compute_points(hitA,hitB);
+	result.m_hitPoint=hitB;
+	return true;
+}
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h
new file mode 100644
index 0000000..6c81279
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h
@@ -0,0 +1,50 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_SUBSIMPLEX_CONVEX_CAST_H
+#define BT_SUBSIMPLEX_CONVEX_CAST_H
+
+#include "btConvexCast.h"
+#include "btSimplexSolverInterface.h"
+class btConvexShape;
+
+/// btSubsimplexConvexCast implements Gino van den Bergens' paper
+///"Ray Casting against bteral Convex Objects with Application to Continuous Collision Detection"
+/// GJK based Ray Cast, optimized version
+/// Objects should not start in overlap, otherwise results are not defined.
+class btSubsimplexConvexCast : public btConvexCast
+{
+	btSimplexSolverInterface* m_simplexSolver;
+	const btConvexShape*	m_convexA;
+	const btConvexShape*	m_convexB;
+
+public:
+
+	btSubsimplexConvexCast (const btConvexShape*	shapeA,const btConvexShape*	shapeB,btSimplexSolverInterface* simplexSolver);
+
+	//virtual ~btSubsimplexConvexCast();
+	///SimsimplexConvexCast calculateTimeOfImpact calculates the time of impact+normal for the linear cast (sweep) between two moving objects.
+	///Precondition is that objects should not penetration/overlap at the start from the interval. Overlap can be tested using btGjkPairDetector.
+	virtual bool	calcTimeOfImpact(
+			const btTransform& fromA,
+			const btTransform& toA,
+			const btTransform& fromB,
+			const btTransform& toB,
+			CastResult& result);
+
+};
+
+#endif //BT_SUBSIMPLEX_CONVEX_CAST_H
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
new file mode 100644
index 0000000..a775198
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
@@ -0,0 +1,609 @@
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+	
+	Elsevier CDROM license agreements grants nonexclusive license to use the software
+	for any purpose, commercial or non-commercial as long as the following credit is included
+	identifying the original source of the software:
+
+	Parts of the source are "from the book Real-Time Collision Detection by
+	Christer Ericson, published by Morgan Kaufmann Publishers,
+	(c) 2005 Elsevier Inc."
+		
+*/
+
+
+#include "btVoronoiSimplexSolver.h"
+
+#define VERTA  0
+#define VERTB  1
+#define VERTC  2
+#define VERTD  3
+
+#define CATCH_DEGENERATE_TETRAHEDRON 1
+void	btVoronoiSimplexSolver::removeVertex(int index)
+{
+	
+	btAssert(m_numVertices>0);
+	m_numVertices--;
+	m_simplexVectorW[index] = m_simplexVectorW[m_numVertices];
+	m_simplexPointsP[index] = m_simplexPointsP[m_numVertices];
+	m_simplexPointsQ[index] = m_simplexPointsQ[m_numVertices];
+}
+
+void	btVoronoiSimplexSolver::reduceVertices (const btUsageBitfield& usedVerts)
+{
+	if ((numVertices() >= 4) && (!usedVerts.usedVertexD))
+		removeVertex(3);
+
+	if ((numVertices() >= 3) && (!usedVerts.usedVertexC))
+		removeVertex(2);
+
+	if ((numVertices() >= 2) && (!usedVerts.usedVertexB))
+		removeVertex(1);
+	
+	if ((numVertices() >= 1) && (!usedVerts.usedVertexA))
+		removeVertex(0);
+
+}
+
+
+
+
+
+//clear the simplex, remove all the vertices
+void btVoronoiSimplexSolver::reset()
+{
+	m_cachedValidClosest = false;
+	m_numVertices = 0;
+	m_needsUpdate = true;
+	m_lastW = btVector3(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
+	m_cachedBC.reset();
+}
+
+
+
+	//add a vertex
+void btVoronoiSimplexSolver::addVertex(const btVector3& w, const btVector3& p, const btVector3& q)
+{
+	m_lastW = w;
+	m_needsUpdate = true;
+
+	m_simplexVectorW[m_numVertices] = w;
+	m_simplexPointsP[m_numVertices] = p;
+	m_simplexPointsQ[m_numVertices] = q;
+
+	m_numVertices++;
+}
+
+bool	btVoronoiSimplexSolver::updateClosestVectorAndPoints()
+{
+	
+	if (m_needsUpdate)
+	{
+		m_cachedBC.reset();
+
+		m_needsUpdate = false;
+
+		switch (numVertices())
+		{
+		case 0:
+				m_cachedValidClosest = false;
+				break;
+		case 1:
+			{
+				m_cachedP1 = m_simplexPointsP[0];
+				m_cachedP2 = m_simplexPointsQ[0];
+				m_cachedV = m_cachedP1-m_cachedP2; //== m_simplexVectorW[0]
+				m_cachedBC.reset();
+				m_cachedBC.setBarycentricCoordinates(btScalar(1.),btScalar(0.),btScalar(0.),btScalar(0.));
+				m_cachedValidClosest = m_cachedBC.isValid();
+				break;
+			};
+		case 2:
+			{
+			//closest point origin from line segment
+					const btVector3& from = m_simplexVectorW[0];
+					const btVector3& to = m_simplexVectorW[1];
+					btVector3 nearest;
+
+					btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.));
+					btVector3 diff = p - from;
+					btVector3 v = to - from;
+					btScalar t = v.dot(diff);
+					
+					if (t > 0) {
+						btScalar dotVV = v.dot(v);
+						if (t < dotVV) {
+							t /= dotVV;
+							diff -= t*v;
+							m_cachedBC.m_usedVertices.usedVertexA = true;
+							m_cachedBC.m_usedVertices.usedVertexB = true;
+						} else {
+							t = 1;
+							diff -= v;
+							//reduce to 1 point
+							m_cachedBC.m_usedVertices.usedVertexB = true;
+						}
+					} else
+					{
+						t = 0;
+						//reduce to 1 point
+						m_cachedBC.m_usedVertices.usedVertexA = true;
+					}
+					m_cachedBC.setBarycentricCoordinates(1-t,t);
+					nearest = from + t*v;
+
+					m_cachedP1 = m_simplexPointsP[0] + t * (m_simplexPointsP[1] - m_simplexPointsP[0]);
+					m_cachedP2 = m_simplexPointsQ[0] + t * (m_simplexPointsQ[1] - m_simplexPointsQ[0]);
+					m_cachedV = m_cachedP1 - m_cachedP2;
+					
+					reduceVertices(m_cachedBC.m_usedVertices);
+
+					m_cachedValidClosest = m_cachedBC.isValid();
+					break;
+			}
+		case 3: 
+			{ 
+				//closest point origin from triangle 
+				btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.)); 
+
+				const btVector3& a = m_simplexVectorW[0]; 
+				const btVector3& b = m_simplexVectorW[1]; 
+				const btVector3& c = m_simplexVectorW[2]; 
+
+				closestPtPointTriangle(p,a,b,c,m_cachedBC); 
+				m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] + 
+				m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] + 
+				m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2]; 
+
+				m_cachedP2 = m_simplexPointsQ[0] * m_cachedBC.m_barycentricCoords[0] + 
+				m_simplexPointsQ[1] * m_cachedBC.m_barycentricCoords[1] + 
+				m_simplexPointsQ[2] * m_cachedBC.m_barycentricCoords[2]; 
+
+				m_cachedV = m_cachedP1-m_cachedP2; 
+
+				reduceVertices (m_cachedBC.m_usedVertices); 
+				m_cachedValidClosest = m_cachedBC.isValid(); 
+
+				break; 
+			}
+		case 4:
+			{
+
+				
+				btVector3 p (btScalar(0.),btScalar(0.),btScalar(0.));
+				
+				const btVector3& a = m_simplexVectorW[0];
+				const btVector3& b = m_simplexVectorW[1];
+				const btVector3& c = m_simplexVectorW[2];
+				const btVector3& d = m_simplexVectorW[3];
+
+				bool hasSeperation = closestPtPointTetrahedron(p,a,b,c,d,m_cachedBC);
+
+				if (hasSeperation)
+				{
+
+					m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] +
+						m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] +
+						m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2] +
+						m_simplexPointsP[3] * m_cachedBC.m_barycentricCoords[3];
+
+					m_cachedP2 = m_simplexPointsQ[0] * m_cachedBC.m_barycentricCoords[0] +
+						m_simplexPointsQ[1] * m_cachedBC.m_barycentricCoords[1] +
+						m_simplexPointsQ[2] * m_cachedBC.m_barycentricCoords[2] +
+						m_simplexPointsQ[3] * m_cachedBC.m_barycentricCoords[3];
+
+					m_cachedV = m_cachedP1-m_cachedP2;
+					reduceVertices (m_cachedBC.m_usedVertices);
+				} else
+				{
+//					printf("sub distance got penetration\n");
+
+					if (m_cachedBC.m_degenerate)
+					{
+						m_cachedValidClosest = false;
+					} else
+					{
+						m_cachedValidClosest = true;
+						//degenerate case == false, penetration = true + zero
+						m_cachedV.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+					}
+					break;
+				}
+
+				m_cachedValidClosest = m_cachedBC.isValid();
+
+				//closest point origin from tetrahedron
+				break;
+			}
+		default:
+			{
+				m_cachedValidClosest = false;
+			}
+		};
+	}
+
+	return m_cachedValidClosest;
+
+}
+
+//return/calculate the closest vertex
+bool btVoronoiSimplexSolver::closest(btVector3& v)
+{
+	bool succes = updateClosestVectorAndPoints();
+	v = m_cachedV;
+	return succes;
+}
+
+
+
+btScalar btVoronoiSimplexSolver::maxVertex()
+{
+	int i, numverts = numVertices();
+	btScalar maxV = btScalar(0.);
+	for (i=0;i<numverts;i++)
+	{
+		btScalar curLen2 = m_simplexVectorW[i].length2();
+		if (maxV < curLen2)
+			maxV = curLen2;
+	}
+	return maxV;
+}
+
+
+
+	//return the current simplex
+int btVoronoiSimplexSolver::getSimplex(btVector3 *pBuf, btVector3 *qBuf, btVector3 *yBuf) const
+{
+	int i;
+	for (i=0;i<numVertices();i++)
+	{
+		yBuf[i] = m_simplexVectorW[i];
+		pBuf[i] = m_simplexPointsP[i];
+		qBuf[i] = m_simplexPointsQ[i];
+	}
+	return numVertices();
+}
+
+
+
+
+bool btVoronoiSimplexSolver::inSimplex(const btVector3& w)
+{
+	bool found = false;
+	int i, numverts = numVertices();
+	//btScalar maxV = btScalar(0.);
+	
+	//w is in the current (reduced) simplex
+	for (i=0;i<numverts;i++)
+	{
+#ifdef BT_USE_EQUAL_VERTEX_THRESHOLD
+		if ( m_simplexVectorW[i].distance2(w) <= m_equalVertexThreshold)
+#else
+		if (m_simplexVectorW[i] == w)
+#endif
+			found = true;
+	}
+
+	//check in case lastW is already removed
+	if (w == m_lastW)
+		return true;
+    	
+	return found;
+}
+
+void btVoronoiSimplexSolver::backup_closest(btVector3& v) 
+{
+	v = m_cachedV;
+}
+
+
+bool btVoronoiSimplexSolver::emptySimplex() const 
+{
+	return (numVertices() == 0);
+
+}
+
+void btVoronoiSimplexSolver::compute_points(btVector3& p1, btVector3& p2) 
+{
+	updateClosestVectorAndPoints();
+	p1 = m_cachedP1;
+	p2 = m_cachedP2;
+
+}
+
+
+
+
+bool	btVoronoiSimplexSolver::closestPtPointTriangle(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c,btSubSimplexClosestResult& result)
+{
+	result.m_usedVertices.reset();
+
+    // Check if P in vertex region outside A
+    btVector3 ab = b - a;
+    btVector3 ac = c - a;
+    btVector3 ap = p - a;
+    btScalar d1 = ab.dot(ap);
+    btScalar d2 = ac.dot(ap);
+    if (d1 <= btScalar(0.0) && d2 <= btScalar(0.0)) 
+	{
+		result.m_closestPointOnSimplex = a;
+		result.m_usedVertices.usedVertexA = true;
+		result.setBarycentricCoordinates(1,0,0);
+		return true;// a; // barycentric coordinates (1,0,0)
+	}
+
+    // Check if P in vertex region outside B
+    btVector3 bp = p - b;
+    btScalar d3 = ab.dot(bp);
+    btScalar d4 = ac.dot(bp);
+    if (d3 >= btScalar(0.0) && d4 <= d3) 
+	{
+		result.m_closestPointOnSimplex = b;
+		result.m_usedVertices.usedVertexB = true;
+		result.setBarycentricCoordinates(0,1,0);
+
+		return true; // b; // barycentric coordinates (0,1,0)
+	}
+    // Check if P in edge region of AB, if so return projection of P onto AB
+    btScalar vc = d1*d4 - d3*d2;
+    if (vc <= btScalar(0.0) && d1 >= btScalar(0.0) && d3 <= btScalar(0.0)) {
+        btScalar v = d1 / (d1 - d3);
+		result.m_closestPointOnSimplex = a + v * ab;
+		result.m_usedVertices.usedVertexA = true;
+		result.m_usedVertices.usedVertexB = true;
+		result.setBarycentricCoordinates(1-v,v,0);
+		return true;
+        //return a + v * ab; // barycentric coordinates (1-v,v,0)
+    }
+
+    // Check if P in vertex region outside C
+    btVector3 cp = p - c;
+    btScalar d5 = ab.dot(cp);
+    btScalar d6 = ac.dot(cp);
+    if (d6 >= btScalar(0.0) && d5 <= d6) 
+	{
+		result.m_closestPointOnSimplex = c;
+		result.m_usedVertices.usedVertexC = true;
+		result.setBarycentricCoordinates(0,0,1);
+		return true;//c; // barycentric coordinates (0,0,1)
+	}
+
+    // Check if P in edge region of AC, if so return projection of P onto AC
+    btScalar vb = d5*d2 - d1*d6;
+    if (vb <= btScalar(0.0) && d2 >= btScalar(0.0) && d6 <= btScalar(0.0)) {
+        btScalar w = d2 / (d2 - d6);
+		result.m_closestPointOnSimplex = a + w * ac;
+		result.m_usedVertices.usedVertexA = true;
+		result.m_usedVertices.usedVertexC = true;
+		result.setBarycentricCoordinates(1-w,0,w);
+		return true;
+        //return a + w * ac; // barycentric coordinates (1-w,0,w)
+    }
+
+    // Check if P in edge region of BC, if so return projection of P onto BC
+    btScalar va = d3*d6 - d5*d4;
+    if (va <= btScalar(0.0) && (d4 - d3) >= btScalar(0.0) && (d5 - d6) >= btScalar(0.0)) {
+        btScalar w = (d4 - d3) / ((d4 - d3) + (d5 - d6));
+		
+		result.m_closestPointOnSimplex = b + w * (c - b);
+		result.m_usedVertices.usedVertexB = true;
+		result.m_usedVertices.usedVertexC = true;
+		result.setBarycentricCoordinates(0,1-w,w);
+		return true;		
+       // return b + w * (c - b); // barycentric coordinates (0,1-w,w)
+    }
+
+    // P inside face region. Compute Q through its barycentric coordinates (u,v,w)
+    btScalar denom = btScalar(1.0) / (va + vb + vc);
+    btScalar v = vb * denom;
+    btScalar w = vc * denom;
+    
+	result.m_closestPointOnSimplex = a + ab * v + ac * w;
+	result.m_usedVertices.usedVertexA = true;
+	result.m_usedVertices.usedVertexB = true;
+	result.m_usedVertices.usedVertexC = true;
+	result.setBarycentricCoordinates(1-v-w,v,w);
+	
+	return true;
+//	return a + ab * v + ac * w; // = u*a + v*b + w*c, u = va * denom = btScalar(1.0) - v - w
+
+}
+
+
+
+
+
+/// Test if point p and d lie on opposite sides of plane through abc
+int btVoronoiSimplexSolver::pointOutsideOfPlane(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& d)
+{
+	btVector3 normal = (b-a).cross(c-a);
+
+    btScalar signp = (p - a).dot(normal); // [AP AB AC]
+    btScalar signd = (d - a).dot( normal); // [AD AB AC]
+
+#ifdef CATCH_DEGENERATE_TETRAHEDRON
+#ifdef BT_USE_DOUBLE_PRECISION
+if (signd * signd < (btScalar(1e-8) * btScalar(1e-8)))
+	{
+		return -1;
+	}
+#else
+	if (signd * signd < (btScalar(1e-4) * btScalar(1e-4)))
+	{
+//		printf("affine dependent/degenerate\n");//
+		return -1;
+	}
+#endif
+
+#endif
+	// Points on opposite sides if expression signs are opposite
+    return signp * signd < btScalar(0.);
+}
+
+
+bool	btVoronoiSimplexSolver::closestPtPointTetrahedron(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& d, btSubSimplexClosestResult& finalResult)
+{
+	btSubSimplexClosestResult tempResult;
+
+    // Start out assuming point inside all halfspaces, so closest to itself
+	finalResult.m_closestPointOnSimplex = p;
+	finalResult.m_usedVertices.reset();
+    finalResult.m_usedVertices.usedVertexA = true;
+	finalResult.m_usedVertices.usedVertexB = true;
+	finalResult.m_usedVertices.usedVertexC = true;
+	finalResult.m_usedVertices.usedVertexD = true;
+
+    int pointOutsideABC = pointOutsideOfPlane(p, a, b, c, d);
+	int pointOutsideACD = pointOutsideOfPlane(p, a, c, d, b);
+  	int	pointOutsideADB = pointOutsideOfPlane(p, a, d, b, c);
+	int	pointOutsideBDC = pointOutsideOfPlane(p, b, d, c, a);
+
+   if (pointOutsideABC < 0 || pointOutsideACD < 0 || pointOutsideADB < 0 || pointOutsideBDC < 0)
+   {
+	   finalResult.m_degenerate = true;
+	   return false;
+   }
+
+   if (!pointOutsideABC  && !pointOutsideACD && !pointOutsideADB && !pointOutsideBDC)
+	 {
+		 return false;
+	 }
+
+
+    btScalar bestSqDist = FLT_MAX;
+    // If point outside face abc then compute closest point on abc
+	if (pointOutsideABC) 
+	{
+        closestPtPointTriangle(p, a, b, c,tempResult);
+		btVector3 q = tempResult.m_closestPointOnSimplex;
+		
+        btScalar sqDist = (q - p).dot( q - p);
+        // Update best closest point if (squared) distance is less than current best
+        if (sqDist < bestSqDist) {
+			bestSqDist = sqDist;
+			finalResult.m_closestPointOnSimplex = q;
+			//convert result bitmask!
+			finalResult.m_usedVertices.reset();
+			finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
+			finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexB;
+			finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC;
+			finalResult.setBarycentricCoordinates(
+					tempResult.m_barycentricCoords[VERTA],
+					tempResult.m_barycentricCoords[VERTB],
+					tempResult.m_barycentricCoords[VERTC],
+					0
+			);
+
+		}
+    }
+  
+
+	// Repeat test for face acd
+	if (pointOutsideACD) 
+	{
+        closestPtPointTriangle(p, a, c, d,tempResult);
+		btVector3 q = tempResult.m_closestPointOnSimplex;
+		//convert result bitmask!
+
+        btScalar sqDist = (q - p).dot( q - p);
+        if (sqDist < bestSqDist) 
+		{
+			bestSqDist = sqDist;
+			finalResult.m_closestPointOnSimplex = q;
+			finalResult.m_usedVertices.reset();
+			finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
+
+			finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexB;
+			finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexC;
+			finalResult.setBarycentricCoordinates(
+					tempResult.m_barycentricCoords[VERTA],
+					0,
+					tempResult.m_barycentricCoords[VERTB],
+					tempResult.m_barycentricCoords[VERTC]
+			);
+
+		}
+    }
+    // Repeat test for face adb
+
+	
+	if (pointOutsideADB)
+	{
+		closestPtPointTriangle(p, a, d, b,tempResult);
+		btVector3 q = tempResult.m_closestPointOnSimplex;
+		//convert result bitmask!
+
+        btScalar sqDist = (q - p).dot( q - p);
+        if (sqDist < bestSqDist) 
+		{
+			bestSqDist = sqDist;
+			finalResult.m_closestPointOnSimplex = q;
+			finalResult.m_usedVertices.reset();
+			finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
+			finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexC;
+			
+			finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB;
+			finalResult.setBarycentricCoordinates(
+					tempResult.m_barycentricCoords[VERTA],
+					tempResult.m_barycentricCoords[VERTC],
+					0,
+					tempResult.m_barycentricCoords[VERTB]
+			);
+
+		}
+    }
+    // Repeat test for face bdc
+    
+
+	if (pointOutsideBDC)
+	{
+        closestPtPointTriangle(p, b, d, c,tempResult);
+		btVector3 q = tempResult.m_closestPointOnSimplex;
+		//convert result bitmask!
+        btScalar sqDist = (q - p).dot( q - p);
+        if (sqDist < bestSqDist) 
+		{
+			bestSqDist = sqDist;
+			finalResult.m_closestPointOnSimplex = q;
+			finalResult.m_usedVertices.reset();
+			//
+			finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexA;
+			finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC;
+			finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB;
+
+			finalResult.setBarycentricCoordinates(
+					0,
+					tempResult.m_barycentricCoords[VERTA],
+					tempResult.m_barycentricCoords[VERTC],
+					tempResult.m_barycentricCoords[VERTB]
+			);
+
+		}
+    }
+
+	//help! we ended up full !
+	
+	if (finalResult.m_usedVertices.usedVertexA &&
+		finalResult.m_usedVertices.usedVertexB &&
+		finalResult.m_usedVertices.usedVertexC &&
+		finalResult.m_usedVertices.usedVertexD) 
+	{
+		return true;
+	}
+
+    return true;
+}
+
diff --git a/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h
new file mode 100644
index 0000000..f1c7613
--- /dev/null
+++ b/hkl3d/bullet/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h
@@ -0,0 +1,179 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_VORONOI_SIMPLEX_SOLVER_H
+#define BT_VORONOI_SIMPLEX_SOLVER_H
+
+#include "btSimplexSolverInterface.h"
+
+
+
+#define VORONOI_SIMPLEX_MAX_VERTS 5
+
+///disable next define, or use defaultCollisionConfiguration->getSimplexSolver()->setEqualVertexThreshold(0.f) to disable/configure
+#define BT_USE_EQUAL_VERTEX_THRESHOLD
+#define VORONOI_DEFAULT_EQUAL_VERTEX_THRESHOLD 0.0001f
+
+
+struct btUsageBitfield{
+	btUsageBitfield()
+	{
+		reset();
+	}
+
+	void reset()
+	{
+		usedVertexA = false;
+		usedVertexB = false;
+		usedVertexC = false;
+		usedVertexD = false;
+	}
+	unsigned short usedVertexA	: 1;
+	unsigned short usedVertexB	: 1;
+	unsigned short usedVertexC	: 1;
+	unsigned short usedVertexD	: 1;
+	unsigned short unused1		: 1;
+	unsigned short unused2		: 1;
+	unsigned short unused3		: 1;
+	unsigned short unused4		: 1;
+};
+
+
+struct	btSubSimplexClosestResult
+{
+	btVector3	m_closestPointOnSimplex;
+	//MASK for m_usedVertices
+	//stores the simplex vertex-usage, using the MASK, 
+	// if m_usedVertices & MASK then the related vertex is used
+	btUsageBitfield	m_usedVertices;
+	btScalar	m_barycentricCoords[4];
+	bool m_degenerate;
+
+	void	reset()
+	{
+		m_degenerate = false;
+		setBarycentricCoordinates();
+		m_usedVertices.reset();
+	}
+	bool	isValid()
+	{
+		bool valid = (m_barycentricCoords[0] >= btScalar(0.)) &&
+			(m_barycentricCoords[1] >= btScalar(0.)) &&
+			(m_barycentricCoords[2] >= btScalar(0.)) &&
+			(m_barycentricCoords[3] >= btScalar(0.));
+
+
+		return valid;
+	}
+	void	setBarycentricCoordinates(btScalar a=btScalar(0.),btScalar b=btScalar(0.),btScalar c=btScalar(0.),btScalar d=btScalar(0.))
+	{
+		m_barycentricCoords[0] = a;
+		m_barycentricCoords[1] = b;
+		m_barycentricCoords[2] = c;
+		m_barycentricCoords[3] = d;
+	}
+
+};
+
+/// btVoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin.
+/// Can be used with GJK, as an alternative to Johnson distance algorithm.
+#ifdef NO_VIRTUAL_INTERFACE
+class btVoronoiSimplexSolver
+#else
+class btVoronoiSimplexSolver : public btSimplexSolverInterface
+#endif
+{
+public:
+
+	int	m_numVertices;
+
+	btVector3	m_simplexVectorW[VORONOI_SIMPLEX_MAX_VERTS];
+	btVector3	m_simplexPointsP[VORONOI_SIMPLEX_MAX_VERTS];
+	btVector3	m_simplexPointsQ[VORONOI_SIMPLEX_MAX_VERTS];
+
+	
+
+	btVector3	m_cachedP1;
+	btVector3	m_cachedP2;
+	btVector3	m_cachedV;
+	btVector3	m_lastW;
+	
+	btScalar	m_equalVertexThreshold;
+	bool		m_cachedValidClosest;
+
+
+	btSubSimplexClosestResult m_cachedBC;
+
+	bool	m_needsUpdate;
+	
+	void	removeVertex(int index);
+	void	reduceVertices (const btUsageBitfield& usedVerts);
+	bool	updateClosestVectorAndPoints();
+
+	bool	closestPtPointTetrahedron(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& d, btSubSimplexClosestResult& finalResult);
+	int		pointOutsideOfPlane(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& d);
+	bool	closestPtPointTriangle(const btVector3& p, const btVector3& a, const btVector3& b, const btVector3& c,btSubSimplexClosestResult& result);
+
+public:
+
+	btVoronoiSimplexSolver()
+		:  m_equalVertexThreshold(VORONOI_DEFAULT_EQUAL_VERTEX_THRESHOLD)
+	{
+	}
+	 void reset();
+
+	 void addVertex(const btVector3& w, const btVector3& p, const btVector3& q);
+
+	 void	setEqualVertexThreshold(btScalar threshold)
+	 {
+		 m_equalVertexThreshold = threshold;
+	 }
+
+	 btScalar	getEqualVertexThreshold() const
+	 {
+		 return m_equalVertexThreshold;
+	 }
+
+	 bool closest(btVector3& v);
+
+	 btScalar maxVertex();
+
+	 bool fullSimplex() const
+	 {
+		 return (m_numVertices == 4);
+	 }
+
+	 int getSimplex(btVector3 *pBuf, btVector3 *qBuf, btVector3 *yBuf) const;
+
+	 bool inSimplex(const btVector3& w);
+	
+	 void backup_closest(btVector3& v) ;
+
+	 bool emptySimplex() const ;
+
+	 void compute_points(btVector3& p1, btVector3& p2) ;
+
+	 int numVertices() const 
+	 {
+		 return m_numVertices;
+	 }
+
+
+};
+
+#endif //BT_VORONOI_SIMPLEX_SOLVER_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Character/btCharacterControllerInterface.h b/hkl3d/bullet/src/BulletDynamics/Character/btCharacterControllerInterface.h
new file mode 100644
index 0000000..c81813c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Character/btCharacterControllerInterface.h
@@ -0,0 +1,46 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CHARACTER_CONTROLLER_INTERFACE_H
+#define BT_CHARACTER_CONTROLLER_INTERFACE_H
+
+#include "LinearMath/btVector3.h"
+#include "BulletDynamics/Dynamics/btActionInterface.h"
+
+class btCollisionShape;
+class btRigidBody;
+class btCollisionWorld;
+
+class btCharacterControllerInterface : public btActionInterface
+{
+public:
+	btCharacterControllerInterface () {};
+	virtual ~btCharacterControllerInterface () {};
+	
+	virtual void	setWalkDirection(const btVector3& walkDirection) = 0;
+	virtual void	setVelocityForTimeInterval(const btVector3& velocity, btScalar timeInterval) = 0;
+	virtual void	reset () = 0;
+	virtual void	warp (const btVector3& origin) = 0;
+
+	virtual void	preStep ( btCollisionWorld* collisionWorld) = 0;
+	virtual void	playerStep (btCollisionWorld* collisionWorld, btScalar dt) = 0;
+	virtual bool	canJump () const = 0;
+	virtual void	jump () = 0;
+
+	virtual bool	onGround () const = 0;
+};
+
+#endif //BT_CHARACTER_CONTROLLER_INTERFACE_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.cpp b/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.cpp
new file mode 100644
index 0000000..f733dc0
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.cpp
@@ -0,0 +1,641 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "LinearMath/btIDebugDraw.h"
+#include "BulletCollision/CollisionDispatch/btGhostObject.h"
+#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
+#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
+#include "LinearMath/btDefaultMotionState.h"
+#include "btKinematicCharacterController.h"
+
+
+// static helper method
+static btVector3
+getNormalizedVector(const btVector3& v)
+{
+	btVector3 n = v.normalized();
+	if (n.length() < SIMD_EPSILON) {
+		n.setValue(0, 0, 0);
+	}
+	return n;
+}
+
+
+///@todo Interact with dynamic objects,
+///Ride kinematicly animated platforms properly
+///More realistic (or maybe just a config option) falling
+/// -> Should integrate falling velocity manually and use that in stepDown()
+///Support jumping
+///Support ducking
+class btKinematicClosestNotMeRayResultCallback : public btCollisionWorld::ClosestRayResultCallback
+{
+public:
+	btKinematicClosestNotMeRayResultCallback (btCollisionObject* me) : btCollisionWorld::ClosestRayResultCallback(btVector3(0.0, 0.0, 0.0), btVector3(0.0, 0.0, 0.0))
+	{
+		m_me = me;
+	}
+
+	virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace)
+	{
+		if (rayResult.m_collisionObject == m_me)
+			return 1.0;
+
+		return ClosestRayResultCallback::addSingleResult (rayResult, normalInWorldSpace);
+	}
+protected:
+	btCollisionObject* m_me;
+};
+
+class btKinematicClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback
+{
+public:
+	btKinematicClosestNotMeConvexResultCallback (btCollisionObject* me, const btVector3& up, btScalar minSlopeDot)
+	: btCollisionWorld::ClosestConvexResultCallback(btVector3(0.0, 0.0, 0.0), btVector3(0.0, 0.0, 0.0))
+	, m_me(me)
+	, m_up(up)
+	, m_minSlopeDot(minSlopeDot)
+	{
+	}
+
+	virtual btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult,bool normalInWorldSpace)
+	{
+		if (convexResult.m_hitCollisionObject == m_me)
+			return btScalar(1.0);
+
+		btVector3 hitNormalWorld;
+		if (normalInWorldSpace)
+		{
+			hitNormalWorld = convexResult.m_hitNormalLocal;
+		} else
+		{
+			///need to transform normal into worldspace
+			hitNormalWorld = convexResult.m_hitCollisionObject->getWorldTransform().getBasis()*convexResult.m_hitNormalLocal;
+		}
+
+		btScalar dotUp = m_up.dot(hitNormalWorld);
+		if (dotUp < m_minSlopeDot) {
+			return btScalar(1.0);
+		}
+
+		return ClosestConvexResultCallback::addSingleResult (convexResult, normalInWorldSpace);
+	}
+protected:
+	btCollisionObject* m_me;
+	const btVector3 m_up;
+	btScalar m_minSlopeDot;
+};
+
+/*
+ * Returns the reflection direction of a ray going 'direction' hitting a surface with normal 'normal'
+ *
+ * from: http://www-cs-students.stanford.edu/~adityagp/final/node3.html
+ */
+btVector3 btKinematicCharacterController::computeReflectionDirection (const btVector3& direction, const btVector3& normal)
+{
+	return direction - (btScalar(2.0) * direction.dot(normal)) * normal;
+}
+
+/*
+ * Returns the portion of 'direction' that is parallel to 'normal'
+ */
+btVector3 btKinematicCharacterController::parallelComponent (const btVector3& direction, const btVector3& normal)
+{
+	btScalar magnitude = direction.dot(normal);
+	return normal * magnitude;
+}
+
+/*
+ * Returns the portion of 'direction' that is perpindicular to 'normal'
+ */
+btVector3 btKinematicCharacterController::perpindicularComponent (const btVector3& direction, const btVector3& normal)
+{
+	return direction - parallelComponent(direction, normal);
+}
+
+btKinematicCharacterController::btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis)
+{
+	m_upAxis = upAxis;
+	m_addedMargin = 0.02;
+	m_walkDirection.setValue(0,0,0);
+	m_useGhostObjectSweepTest = true;
+	m_ghostObject = ghostObject;
+	m_stepHeight = stepHeight;
+	m_turnAngle = btScalar(0.0);
+	m_convexShape=convexShape;	
+	m_useWalkDirection = true;	// use walk direction by default, legacy behavior
+	m_velocityTimeInterval = 0.0;
+	m_verticalVelocity = 0.0;
+	m_verticalOffset = 0.0;
+	m_gravity = 9.8 * 3 ; // 3G acceleration.
+	m_fallSpeed = 55.0; // Terminal velocity of a sky diver in m/s.
+	m_jumpSpeed = 10.0; // ?
+	m_wasOnGround = false;
+	m_wasJumping = false;
+	setMaxSlope(btRadians(45.0));
+}
+
+btKinematicCharacterController::~btKinematicCharacterController ()
+{
+}
+
+btPairCachingGhostObject* btKinematicCharacterController::getGhostObject()
+{
+	return m_ghostObject;
+}
+
+bool btKinematicCharacterController::recoverFromPenetration ( btCollisionWorld* collisionWorld)
+{
+
+	bool penetration = false;
+
+	collisionWorld->getDispatcher()->dispatchAllCollisionPairs(m_ghostObject->getOverlappingPairCache(), collisionWorld->getDispatchInfo(), collisionWorld->getDispatcher());
+
+	m_currentPosition = m_ghostObject->getWorldTransform().getOrigin();
+	
+	btScalar maxPen = btScalar(0.0);
+	for (int i = 0; i < m_ghostObject->getOverlappingPairCache()->getNumOverlappingPairs(); i++)
+	{
+		m_manifoldArray.resize(0);
+
+		btBroadphasePair* collisionPair = &m_ghostObject->getOverlappingPairCache()->getOverlappingPairArray()[i];
+		
+		if (collisionPair->m_algorithm)
+			collisionPair->m_algorithm->getAllContactManifolds(m_manifoldArray);
+
+		
+		for (int j=0;j<m_manifoldArray.size();j++)
+		{
+			btPersistentManifold* manifold = m_manifoldArray[j];
+			btScalar directionSign = manifold->getBody0() == m_ghostObject ? btScalar(-1.0) : btScalar(1.0);
+			for (int p=0;p<manifold->getNumContacts();p++)
+			{
+				const btManifoldPoint&pt = manifold->getContactPoint(p);
+
+				btScalar dist = pt.getDistance();
+
+				if (dist < 0.0)
+				{
+					if (dist < maxPen)
+					{
+						maxPen = dist;
+						m_touchingNormal = pt.m_normalWorldOnB * directionSign;//??
+
+					}
+					m_currentPosition += pt.m_normalWorldOnB * directionSign * dist * btScalar(0.2);
+					penetration = true;
+				} else {
+					//printf("touching %f\n", dist);
+				}
+			}
+			
+			//manifold->clearManifold();
+		}
+	}
+	btTransform newTrans = m_ghostObject->getWorldTransform();
+	newTrans.setOrigin(m_currentPosition);
+	m_ghostObject->setWorldTransform(newTrans);
+//	printf("m_touchingNormal = %f,%f,%f\n",m_touchingNormal[0],m_touchingNormal[1],m_touchingNormal[2]);
+	return penetration;
+}
+
+void btKinematicCharacterController::stepUp ( btCollisionWorld* world)
+{
+	// phase 1: up
+	btTransform start, end;
+	m_targetPosition = m_currentPosition + getUpAxisDirections()[m_upAxis] * (m_stepHeight + (m_verticalOffset > 0.f?m_verticalOffset:0.f));
+
+	start.setIdentity ();
+	end.setIdentity ();
+
+	/* FIXME: Handle penetration properly */
+	start.setOrigin (m_currentPosition + getUpAxisDirections()[m_upAxis] * (m_convexShape->getMargin() + m_addedMargin));
+	end.setOrigin (m_targetPosition);
+
+	btKinematicClosestNotMeConvexResultCallback callback (m_ghostObject, -getUpAxisDirections()[m_upAxis], btScalar(0.7071));
+	callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup;
+	callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask;
+	
+	if (m_useGhostObjectSweepTest)
+	{
+		m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, world->getDispatchInfo().m_allowedCcdPenetration);
+	}
+	else
+	{
+		world->convexSweepTest (m_convexShape, start, end, callback);
+	}
+	
+	if (callback.hasHit())
+	{
+		// Only modify the position if the hit was a slope and not a wall or ceiling.
+		if(callback.m_hitNormalWorld.dot(getUpAxisDirections()[m_upAxis]) > 0.0)
+		{
+			// we moved up only a fraction of the step height
+			m_currentStepOffset = m_stepHeight * callback.m_closestHitFraction;
+			m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction);
+		}
+		m_verticalVelocity = 0.0;
+		m_verticalOffset = 0.0;
+	} else {
+		m_currentStepOffset = m_stepHeight;
+		m_currentPosition = m_targetPosition;
+	}
+}
+
+void btKinematicCharacterController::updateTargetPositionBasedOnCollision (const btVector3& hitNormal, btScalar tangentMag, btScalar normalMag)
+{
+	btVector3 movementDirection = m_targetPosition - m_currentPosition;
+	btScalar movementLength = movementDirection.length();
+	if (movementLength>SIMD_EPSILON)
+	{
+		movementDirection.normalize();
+
+		btVector3 reflectDir = computeReflectionDirection (movementDirection, hitNormal);
+		reflectDir.normalize();
+
+		btVector3 parallelDir, perpindicularDir;
+
+		parallelDir = parallelComponent (reflectDir, hitNormal);
+		perpindicularDir = perpindicularComponent (reflectDir, hitNormal);
+
+		m_targetPosition = m_currentPosition;
+		if (0)//tangentMag != 0.0)
+		{
+			btVector3 parComponent = parallelDir * btScalar (tangentMag*movementLength);
+//			printf("parComponent=%f,%f,%f\n",parComponent[0],parComponent[1],parComponent[2]);
+			m_targetPosition +=  parComponent;
+		}
+
+		if (normalMag != 0.0)
+		{
+			btVector3 perpComponent = perpindicularDir * btScalar (normalMag*movementLength);
+//			printf("perpComponent=%f,%f,%f\n",perpComponent[0],perpComponent[1],perpComponent[2]);
+			m_targetPosition += perpComponent;
+		}
+	} else
+	{
+//		printf("movementLength don't normalize a zero vector\n");
+	}
+}
+
+void btKinematicCharacterController::stepForwardAndStrafe ( btCollisionWorld* collisionWorld, const btVector3& walkMove)
+{
+	// printf("m_normalizedDirection=%f,%f,%f\n",
+	// 	m_normalizedDirection[0],m_normalizedDirection[1],m_normalizedDirection[2]);
+	// phase 2: forward and strafe
+	btTransform start, end;
+	m_targetPosition = m_currentPosition + walkMove;
+
+	start.setIdentity ();
+	end.setIdentity ();
+	
+	btScalar fraction = 1.0;
+	btScalar distance2 = (m_currentPosition-m_targetPosition).length2();
+//	printf("distance2=%f\n",distance2);
+
+	if (m_touchingContact)
+	{
+		if (m_normalizedDirection.dot(m_touchingNormal) > btScalar(0.0))
+		{
+			updateTargetPositionBasedOnCollision (m_touchingNormal);
+		}
+	}
+
+	int maxIter = 10;
+
+	while (fraction > btScalar(0.01) && maxIter-- > 0)
+	{
+		start.setOrigin (m_currentPosition);
+		end.setOrigin (m_targetPosition);
+		btVector3 sweepDirNegative(m_currentPosition - m_targetPosition);
+
+		btKinematicClosestNotMeConvexResultCallback callback (m_ghostObject, sweepDirNegative, btScalar(0.0));
+		callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup;
+		callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask;
+
+
+		btScalar margin = m_convexShape->getMargin();
+		m_convexShape->setMargin(margin + m_addedMargin);
+
+
+		if (m_useGhostObjectSweepTest)
+		{
+			m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration);
+		} else
+		{
+			collisionWorld->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration);
+		}
+		
+		m_convexShape->setMargin(margin);
+
+		
+		fraction -= callback.m_closestHitFraction;
+
+		if (callback.hasHit())
+		{	
+			// we moved only a fraction
+			btScalar hitDistance;
+			hitDistance = (callback.m_hitPointWorld - m_currentPosition).length();
+
+//			m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction);
+
+			updateTargetPositionBasedOnCollision (callback.m_hitNormalWorld);
+			btVector3 currentDir = m_targetPosition - m_currentPosition;
+			distance2 = currentDir.length2();
+			if (distance2 > SIMD_EPSILON)
+			{
+				currentDir.normalize();
+				/* See Quake2: "If velocity is against original velocity, stop ead to avoid tiny oscilations in sloping corners." */
+				if (currentDir.dot(m_normalizedDirection) <= btScalar(0.0))
+				{
+					break;
+				}
+			} else
+			{
+//				printf("currentDir: don't normalize a zero vector\n");
+				break;
+			}
+
+		} else {
+			// we moved whole way
+			m_currentPosition = m_targetPosition;
+		}
+
+	//	if (callback.m_closestHitFraction == 0.f)
+	//		break;
+
+	}
+}
+
+void btKinematicCharacterController::stepDown ( btCollisionWorld* collisionWorld, btScalar dt)
+{
+	btTransform start, end;
+
+	// phase 3: down
+	/*btScalar additionalDownStep = (m_wasOnGround && !onGround()) ? m_stepHeight : 0.0;
+	btVector3 step_drop = getUpAxisDirections()[m_upAxis] * (m_currentStepOffset + additionalDownStep);
+	btScalar downVelocity = (additionalDownStep == 0.0 && m_verticalVelocity<0.0?-m_verticalVelocity:0.0) * dt;
+	btVector3 gravity_drop = getUpAxisDirections()[m_upAxis] * downVelocity; 
+	m_targetPosition -= (step_drop + gravity_drop);*/
+
+	btScalar downVelocity = (m_verticalVelocity<0.f?-m_verticalVelocity:0.f) * dt;
+	if(downVelocity > 0.0 && downVelocity < m_stepHeight
+		&& (m_wasOnGround || !m_wasJumping))
+	{
+		downVelocity = m_stepHeight;
+	}
+
+	btVector3 step_drop = getUpAxisDirections()[m_upAxis] * (m_currentStepOffset + downVelocity);
+	m_targetPosition -= step_drop;
+
+	start.setIdentity ();
+	end.setIdentity ();
+
+	start.setOrigin (m_currentPosition);
+	end.setOrigin (m_targetPosition);
+
+	btKinematicClosestNotMeConvexResultCallback callback (m_ghostObject, getUpAxisDirections()[m_upAxis], m_maxSlopeCosine);
+	callback.m_collisionFilterGroup = getGhostObject()->getBroadphaseHandle()->m_collisionFilterGroup;
+	callback.m_collisionFilterMask = getGhostObject()->getBroadphaseHandle()->m_collisionFilterMask;
+	
+	if (m_useGhostObjectSweepTest)
+	{
+		m_ghostObject->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration);
+	} else
+	{
+		collisionWorld->convexSweepTest (m_convexShape, start, end, callback, collisionWorld->getDispatchInfo().m_allowedCcdPenetration);
+	}
+
+	if (callback.hasHit())
+	{
+		// we dropped a fraction of the height -> hit floor
+		m_currentPosition.setInterpolate3 (m_currentPosition, m_targetPosition, callback.m_closestHitFraction);
+		m_verticalVelocity = 0.0;
+		m_verticalOffset = 0.0;
+		m_wasJumping = false;
+	} else {
+		// we dropped the full height
+		
+		m_currentPosition = m_targetPosition;
+	}
+}
+
+
+
+void btKinematicCharacterController::setWalkDirection
+(
+const btVector3& walkDirection
+)
+{
+	m_useWalkDirection = true;
+	m_walkDirection = walkDirection;
+	m_normalizedDirection = getNormalizedVector(m_walkDirection);
+}
+
+
+
+void btKinematicCharacterController::setVelocityForTimeInterval
+(
+const btVector3& velocity,
+btScalar timeInterval
+)
+{
+//	printf("setVelocity!\n");
+//	printf("  interval: %f\n", timeInterval);
+//	printf("  velocity: (%f, %f, %f)\n",
+//		 velocity.x(), velocity.y(), velocity.z());
+
+	m_useWalkDirection = false;
+	m_walkDirection = velocity;
+	m_normalizedDirection = getNormalizedVector(m_walkDirection);
+	m_velocityTimeInterval = timeInterval;
+}
+
+
+
+void btKinematicCharacterController::reset ()
+{
+}
+
+void btKinematicCharacterController::warp (const btVector3& origin)
+{
+	btTransform xform;
+	xform.setIdentity();
+	xform.setOrigin (origin);
+	m_ghostObject->setWorldTransform (xform);
+}
+
+
+void btKinematicCharacterController::preStep (  btCollisionWorld* collisionWorld)
+{
+	
+	int numPenetrationLoops = 0;
+	m_touchingContact = false;
+	while (recoverFromPenetration (collisionWorld))
+	{
+		numPenetrationLoops++;
+		m_touchingContact = true;
+		if (numPenetrationLoops > 4)
+		{
+			//printf("character could not recover from penetration = %d\n", numPenetrationLoops);
+			break;
+		}
+	}
+
+	m_currentPosition = m_ghostObject->getWorldTransform().getOrigin();
+	m_targetPosition = m_currentPosition;
+//	printf("m_targetPosition=%f,%f,%f\n",m_targetPosition[0],m_targetPosition[1],m_targetPosition[2]);
+
+	
+}
+
+#include <stdio.h>
+
+void btKinematicCharacterController::playerStep (  btCollisionWorld* collisionWorld, btScalar dt)
+{
+//	printf("playerStep(): ");
+//	printf("  dt = %f", dt);
+
+	// quick check...
+	if (!m_useWalkDirection && m_velocityTimeInterval <= 0.0) {
+//		printf("\n");
+		return;		// no motion
+	}
+
+	m_wasOnGround = onGround();
+
+	// Update fall velocity.
+	m_verticalVelocity -= m_gravity * dt;
+	if(m_verticalVelocity > 0.0 && m_verticalVelocity > m_jumpSpeed)
+	{
+		m_verticalVelocity = m_jumpSpeed;
+	}
+	if(m_verticalVelocity < 0.0 && btFabs(m_verticalVelocity) > btFabs(m_fallSpeed))
+	{
+		m_verticalVelocity = -btFabs(m_fallSpeed);
+	}
+	m_verticalOffset = m_verticalVelocity * dt;
+
+
+	btTransform xform;
+	xform = m_ghostObject->getWorldTransform ();
+
+//	printf("walkDirection(%f,%f,%f)\n",walkDirection[0],walkDirection[1],walkDirection[2]);
+//	printf("walkSpeed=%f\n",walkSpeed);
+
+	stepUp (collisionWorld);
+	if (m_useWalkDirection) {
+		stepForwardAndStrafe (collisionWorld, m_walkDirection);
+	} else {
+		//printf("  time: %f", m_velocityTimeInterval);
+		// still have some time left for moving!
+		btScalar dtMoving =
+			(dt < m_velocityTimeInterval) ? dt : m_velocityTimeInterval;
+		m_velocityTimeInterval -= dt;
+
+		// how far will we move while we are moving?
+		btVector3 move = m_walkDirection * dtMoving;
+
+		//printf("  dtMoving: %f", dtMoving);
+
+		// okay, step
+		stepForwardAndStrafe(collisionWorld, move);
+	}
+	stepDown (collisionWorld, dt);
+
+	// printf("\n");
+
+	xform.setOrigin (m_currentPosition);
+	m_ghostObject->setWorldTransform (xform);
+}
+
+void btKinematicCharacterController::setFallSpeed (btScalar fallSpeed)
+{
+	m_fallSpeed = fallSpeed;
+}
+
+void btKinematicCharacterController::setJumpSpeed (btScalar jumpSpeed)
+{
+	m_jumpSpeed = jumpSpeed;
+}
+
+void btKinematicCharacterController::setMaxJumpHeight (btScalar maxJumpHeight)
+{
+	m_maxJumpHeight = maxJumpHeight;
+}
+
+bool btKinematicCharacterController::canJump () const
+{
+	return onGround();
+}
+
+void btKinematicCharacterController::jump ()
+{
+	if (!canJump())
+		return;
+
+	m_verticalVelocity = m_jumpSpeed;
+	m_wasJumping = true;
+
+#if 0
+	currently no jumping.
+	btTransform xform;
+	m_rigidBody->getMotionState()->getWorldTransform (xform);
+	btVector3 up = xform.getBasis()[1];
+	up.normalize ();
+	btScalar magnitude = (btScalar(1.0)/m_rigidBody->getInvMass()) * btScalar(8.0);
+	m_rigidBody->applyCentralImpulse (up * magnitude);
+#endif
+}
+
+void btKinematicCharacterController::setGravity(btScalar gravity)
+{
+	m_gravity = gravity;
+}
+
+btScalar btKinematicCharacterController::getGravity() const
+{
+	return m_gravity;
+}
+
+void btKinematicCharacterController::setMaxSlope(btScalar slopeRadians)
+{
+	m_maxSlopeRadians = slopeRadians;
+	m_maxSlopeCosine = btCos(slopeRadians);
+}
+
+btScalar btKinematicCharacterController::getMaxSlope() const
+{
+	return m_maxSlopeRadians;
+}
+
+bool btKinematicCharacterController::onGround () const
+{
+	return m_verticalVelocity == 0.0 && m_verticalOffset == 0.0;
+}
+
+
+btVector3* btKinematicCharacterController::getUpAxisDirections()
+{
+	static btVector3 sUpAxisDirection[3] = { btVector3(1.0f, 0.0f, 0.0f), btVector3(0.0f, 1.0f, 0.0f), btVector3(0.0f, 0.0f, 1.0f) };
+	
+	return sUpAxisDirection;
+}
+
+void btKinematicCharacterController::debugDraw(btIDebugDraw* debugDrawer)
+{
+}
diff --git a/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.h b/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.h
new file mode 100644
index 0000000..ad2f9f1
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Character/btKinematicCharacterController.h
@@ -0,0 +1,162 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_KINEMATIC_CHARACTER_CONTROLLER_H
+#define BT_KINEMATIC_CHARACTER_CONTROLLER_H
+
+#include "LinearMath/btVector3.h"
+
+#include "btCharacterControllerInterface.h"
+
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+
+
+class btCollisionShape;
+class btRigidBody;
+class btCollisionWorld;
+class btCollisionDispatcher;
+class btPairCachingGhostObject;
+
+///btKinematicCharacterController is an object that supports a sliding motion in a world.
+///It uses a ghost object and convex sweep test to test for upcoming collisions. This is combined with discrete collision detection to recover from penetrations.
+///Interaction between btKinematicCharacterController and dynamic rigid bodies needs to be explicity implemented by the user.
+class btKinematicCharacterController : public btCharacterControllerInterface
+{
+protected:
+
+	btScalar m_halfHeight;
+	
+	btPairCachingGhostObject* m_ghostObject;
+	btConvexShape*	m_convexShape;//is also in m_ghostObject, but it needs to be convex, so we store it here to avoid upcast
+	
+	btScalar m_verticalVelocity;
+	btScalar m_verticalOffset;
+	btScalar m_fallSpeed;
+	btScalar m_jumpSpeed;
+	btScalar m_maxJumpHeight;
+	btScalar m_maxSlopeRadians; // Slope angle that is set (used for returning the exact value)
+	btScalar m_maxSlopeCosine;  // Cosine equivalent of m_maxSlopeRadians (calculated once when set, for optimization)
+	btScalar m_gravity;
+
+	btScalar m_turnAngle;
+	
+	btScalar m_stepHeight;
+
+	btScalar	m_addedMargin;//@todo: remove this and fix the code
+
+	///this is the desired walk direction, set by the user
+	btVector3	m_walkDirection;
+	btVector3	m_normalizedDirection;
+
+	//some internal variables
+	btVector3 m_currentPosition;
+	btScalar  m_currentStepOffset;
+	btVector3 m_targetPosition;
+
+	///keep track of the contact manifolds
+	btManifoldArray	m_manifoldArray;
+
+	bool m_touchingContact;
+	btVector3 m_touchingNormal;
+
+	bool  m_wasOnGround;
+	bool  m_wasJumping;
+	bool	m_useGhostObjectSweepTest;
+	bool	m_useWalkDirection;
+	btScalar	m_velocityTimeInterval;
+	int m_upAxis;
+
+	static btVector3* getUpAxisDirections();
+
+	btVector3 computeReflectionDirection (const btVector3& direction, const btVector3& normal);
+	btVector3 parallelComponent (const btVector3& direction, const btVector3& normal);
+	btVector3 perpindicularComponent (const btVector3& direction, const btVector3& normal);
+
+	bool recoverFromPenetration ( btCollisionWorld* collisionWorld);
+	void stepUp (btCollisionWorld* collisionWorld);
+	void updateTargetPositionBasedOnCollision (const btVector3& hit_normal, btScalar tangentMag = btScalar(0.0), btScalar normalMag = btScalar(1.0));
+	void stepForwardAndStrafe (btCollisionWorld* collisionWorld, const btVector3& walkMove);
+	void stepDown (btCollisionWorld* collisionWorld, btScalar dt);
+public:
+	btKinematicCharacterController (btPairCachingGhostObject* ghostObject,btConvexShape* convexShape,btScalar stepHeight, int upAxis = 1);
+	~btKinematicCharacterController ();
+	
+
+	///btActionInterface interface
+	virtual void updateAction( btCollisionWorld* collisionWorld,btScalar deltaTime)
+	{
+		preStep ( collisionWorld);
+		playerStep (collisionWorld, deltaTime);
+	}
+	
+	///btActionInterface interface
+	void	debugDraw(btIDebugDraw* debugDrawer);
+
+	void setUpAxis (int axis)
+	{
+		if (axis < 0)
+			axis = 0;
+		if (axis > 2)
+			axis = 2;
+		m_upAxis = axis;
+	}
+
+	/// This should probably be called setPositionIncrementPerSimulatorStep.
+	/// This is neither a direction nor a velocity, but the amount to
+	///	increment the position each simulation iteration, regardless
+	///	of dt.
+	/// This call will reset any velocity set by setVelocityForTimeInterval().
+	virtual void	setWalkDirection(const btVector3& walkDirection);
+
+	/// Caller provides a velocity with which the character should move for
+	///	the given time period.  After the time period, velocity is reset
+	///	to zero.
+	/// This call will reset any walk direction set by setWalkDirection().
+	/// Negative time intervals will result in no motion.
+	virtual void setVelocityForTimeInterval(const btVector3& velocity,
+				btScalar timeInterval);
+
+	void reset ();
+	void warp (const btVector3& origin);
+
+	void preStep (  btCollisionWorld* collisionWorld);
+	void playerStep ( btCollisionWorld* collisionWorld, btScalar dt);
+
+	void setFallSpeed (btScalar fallSpeed);
+	void setJumpSpeed (btScalar jumpSpeed);
+	void setMaxJumpHeight (btScalar maxJumpHeight);
+	bool canJump () const;
+
+	void jump ();
+
+	void setGravity(btScalar gravity);
+	btScalar getGravity() const;
+
+	/// The max slope determines the maximum angle that the controller can walk up.
+	/// The slope angle is measured in radians.
+	void setMaxSlope(btScalar slopeRadians);
+	btScalar getMaxSlope() const;
+
+	btPairCachingGhostObject* getGhostObject();
+	void	setUseGhostSweepTest(bool useGhostObjectSweepTest)
+	{
+		m_useGhostObjectSweepTest = useGhostObjectSweepTest;
+	}
+
+	bool onGround () const;
+};
+
+#endif // BT_KINEMATIC_CHARACTER_CONTROLLER_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
new file mode 100644
index 0000000..bc371e4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
@@ -0,0 +1,1127 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+btConeTwistConstraint is Copyright (c) 2007 Starbreeze Studios
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Written by: Marcus Hennix
+*/
+
+
+#include "btConeTwistConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btTransformUtil.h"
+#include "LinearMath/btMinMax.h"
+#include <new>
+
+
+
+//#define CONETWIST_USE_OBSOLETE_SOLVER true
+#define CONETWIST_USE_OBSOLETE_SOLVER false
+#define CONETWIST_DEF_FIX_THRESH btScalar(.05f)
+
+
+SIMD_FORCE_INLINE btScalar computeAngularImpulseDenominator(const btVector3& axis, const btMatrix3x3& invInertiaWorld)
+{
+	btVector3 vec = axis * invInertiaWorld;
+	return axis.dot(vec);
+}
+
+
+
+
+btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA,btRigidBody& rbB, 
+											 const btTransform& rbAFrame,const btTransform& rbBFrame)
+											 :btTypedConstraint(CONETWIST_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame),
+											 m_angularOnly(false),
+											 m_useSolveConstraintObsolete(CONETWIST_USE_OBSOLETE_SOLVER)
+{
+	init();
+}
+
+btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame)
+											:btTypedConstraint(CONETWIST_CONSTRAINT_TYPE,rbA),m_rbAFrame(rbAFrame),
+											 m_angularOnly(false),
+											 m_useSolveConstraintObsolete(CONETWIST_USE_OBSOLETE_SOLVER)
+{
+	m_rbBFrame = m_rbAFrame;
+	init();	
+}
+
+
+void btConeTwistConstraint::init()
+{
+	m_angularOnly = false;
+	m_solveTwistLimit = false;
+	m_solveSwingLimit = false;
+	m_bMotorEnabled = false;
+	m_maxMotorImpulse = btScalar(-1);
+
+	setLimit(btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT));
+	m_damping = btScalar(0.01);
+	m_fixThresh = CONETWIST_DEF_FIX_THRESH;
+	m_flags = 0;
+	m_linCFM = btScalar(0.f);
+	m_linERP = btScalar(0.7f);
+	m_angCFM = btScalar(0.f);
+}
+
+
+void btConeTwistConstraint::getInfo1 (btConstraintInfo1* info)
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		info->m_numConstraintRows = 0;
+		info->nub = 0;
+	} 
+	else
+	{
+		info->m_numConstraintRows = 3;
+		info->nub = 3;
+		calcAngleInfo2(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getInvInertiaTensorWorld(),m_rbB.getInvInertiaTensorWorld());
+		if(m_solveSwingLimit)
+		{
+			info->m_numConstraintRows++;
+			info->nub--;
+			if((m_swingSpan1 < m_fixThresh) && (m_swingSpan2 < m_fixThresh))
+			{
+				info->m_numConstraintRows++;
+				info->nub--;
+			}
+		}
+		if(m_solveTwistLimit)
+		{
+			info->m_numConstraintRows++;
+			info->nub--;
+		}
+	}
+}
+
+void btConeTwistConstraint::getInfo1NonVirtual (btConstraintInfo1* info)
+{
+	//always reserve 6 rows: object transform is not available on SPU
+	info->m_numConstraintRows = 6;
+	info->nub = 0;
+		
+}
+	
+
+void btConeTwistConstraint::getInfo2 (btConstraintInfo2* info)
+{
+	getInfo2NonVirtual(info,m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getInvInertiaTensorWorld(),m_rbB.getInvInertiaTensorWorld());
+}
+
+void btConeTwistConstraint::getInfo2NonVirtual (btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB)
+{
+	calcAngleInfo2(transA,transB,invInertiaWorldA,invInertiaWorldB);
+	
+	btAssert(!m_useSolveConstraintObsolete);
+    // set jacobian
+    info->m_J1linearAxis[0] = 1;
+    info->m_J1linearAxis[info->rowskip+1] = 1;
+    info->m_J1linearAxis[2*info->rowskip+2] = 1;
+	btVector3 a1 = transA.getBasis() * m_rbAFrame.getOrigin();
+	{
+		btVector3* angular0 = (btVector3*)(info->m_J1angularAxis);
+		btVector3* angular1 = (btVector3*)(info->m_J1angularAxis+info->rowskip);
+		btVector3* angular2 = (btVector3*)(info->m_J1angularAxis+2*info->rowskip);
+		btVector3 a1neg = -a1;
+		a1neg.getSkewSymmetricMatrix(angular0,angular1,angular2);
+	}
+	btVector3 a2 = transB.getBasis() * m_rbBFrame.getOrigin();
+	{
+		btVector3* angular0 = (btVector3*)(info->m_J2angularAxis);
+		btVector3* angular1 = (btVector3*)(info->m_J2angularAxis+info->rowskip);
+		btVector3* angular2 = (btVector3*)(info->m_J2angularAxis+2*info->rowskip);
+		a2.getSkewSymmetricMatrix(angular0,angular1,angular2);
+	}
+    // set right hand side
+	btScalar linERP = (m_flags & BT_CONETWIST_FLAGS_LIN_ERP) ? m_linERP : info->erp;
+    btScalar k = info->fps * linERP;
+    int j;
+	for (j=0; j<3; j++)
+    {
+        info->m_constraintError[j*info->rowskip] = k * (a2[j] + transB.getOrigin()[j] - a1[j] - transA.getOrigin()[j]);
+		info->m_lowerLimit[j*info->rowskip] = -SIMD_INFINITY;
+		info->m_upperLimit[j*info->rowskip] = SIMD_INFINITY;
+		if(m_flags & BT_CONETWIST_FLAGS_LIN_CFM)
+		{
+			info->cfm[j*info->rowskip] = m_linCFM;
+		}
+    }
+	int row = 3;
+    int srow = row * info->rowskip;
+	btVector3 ax1;
+	// angular limits
+	if(m_solveSwingLimit)
+	{
+		btScalar *J1 = info->m_J1angularAxis;
+		btScalar *J2 = info->m_J2angularAxis;
+		if((m_swingSpan1 < m_fixThresh) && (m_swingSpan2 < m_fixThresh))
+		{
+			btTransform trA = transA*m_rbAFrame;
+			btVector3 p = trA.getBasis().getColumn(1);
+			btVector3 q = trA.getBasis().getColumn(2);
+			int srow1 = srow + info->rowskip;
+			J1[srow+0] = p[0];
+			J1[srow+1] = p[1];
+			J1[srow+2] = p[2];
+			J1[srow1+0] = q[0];
+			J1[srow1+1] = q[1];
+			J1[srow1+2] = q[2];
+			J2[srow+0] = -p[0];
+			J2[srow+1] = -p[1];
+			J2[srow+2] = -p[2];
+			J2[srow1+0] = -q[0];
+			J2[srow1+1] = -q[1];
+			J2[srow1+2] = -q[2];
+			btScalar fact = info->fps * m_relaxationFactor;
+			info->m_constraintError[srow] =   fact * m_swingAxis.dot(p);
+			info->m_constraintError[srow1] =  fact * m_swingAxis.dot(q);
+			info->m_lowerLimit[srow] = -SIMD_INFINITY;
+			info->m_upperLimit[srow] = SIMD_INFINITY;
+			info->m_lowerLimit[srow1] = -SIMD_INFINITY;
+			info->m_upperLimit[srow1] = SIMD_INFINITY;
+			srow = srow1 + info->rowskip;
+		}
+		else
+		{
+			ax1 = m_swingAxis * m_relaxationFactor * m_relaxationFactor;
+			J1[srow+0] = ax1[0];
+			J1[srow+1] = ax1[1];
+			J1[srow+2] = ax1[2];
+			J2[srow+0] = -ax1[0];
+			J2[srow+1] = -ax1[1];
+			J2[srow+2] = -ax1[2];
+			btScalar k = info->fps * m_biasFactor;
+
+			info->m_constraintError[srow] = k * m_swingCorrection;
+			if(m_flags & BT_CONETWIST_FLAGS_ANG_CFM)
+			{
+				info->cfm[srow] = m_angCFM;
+			}
+			// m_swingCorrection is always positive or 0
+			info->m_lowerLimit[srow] = 0;
+			info->m_upperLimit[srow] = SIMD_INFINITY;
+			srow += info->rowskip;
+		}
+	}
+	if(m_solveTwistLimit)
+	{
+		ax1 = m_twistAxis * m_relaxationFactor * m_relaxationFactor;
+		btScalar *J1 = info->m_J1angularAxis;
+		btScalar *J2 = info->m_J2angularAxis;
+		J1[srow+0] = ax1[0];
+		J1[srow+1] = ax1[1];
+		J1[srow+2] = ax1[2];
+		J2[srow+0] = -ax1[0];
+		J2[srow+1] = -ax1[1];
+		J2[srow+2] = -ax1[2];
+		btScalar k = info->fps * m_biasFactor;
+		info->m_constraintError[srow] = k * m_twistCorrection;
+		if(m_flags & BT_CONETWIST_FLAGS_ANG_CFM)
+		{
+			info->cfm[srow] = m_angCFM;
+		}
+		if(m_twistSpan > 0.0f)
+		{
+
+			if(m_twistCorrection > 0.0f)
+			{
+				info->m_lowerLimit[srow] = 0;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			} 
+			else
+			{
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = 0;
+			} 
+		}
+		else
+		{
+			info->m_lowerLimit[srow] = -SIMD_INFINITY;
+			info->m_upperLimit[srow] = SIMD_INFINITY;
+		}
+		srow += info->rowskip;
+	}
+}
+	
+
+
+void	btConeTwistConstraint::buildJacobian()
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		m_appliedImpulse = btScalar(0.);
+		m_accTwistLimitImpulse = btScalar(0.);
+		m_accSwingLimitImpulse = btScalar(0.);
+		m_accMotorImpulse = btVector3(0.,0.,0.);
+
+		if (!m_angularOnly)
+		{
+			btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin();
+			btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin();
+			btVector3 relPos = pivotBInW - pivotAInW;
+
+			btVector3 normal[3];
+			if (relPos.length2() > SIMD_EPSILON)
+			{
+				normal[0] = relPos.normalized();
+			}
+			else
+			{
+				normal[0].setValue(btScalar(1.0),0,0);
+			}
+
+			btPlaneSpace1(normal[0], normal[1], normal[2]);
+
+			for (int i=0;i<3;i++)
+			{
+				new (&m_jac[i]) btJacobianEntry(
+				m_rbA.getCenterOfMassTransform().getBasis().transpose(),
+				m_rbB.getCenterOfMassTransform().getBasis().transpose(),
+				pivotAInW - m_rbA.getCenterOfMassPosition(),
+				pivotBInW - m_rbB.getCenterOfMassPosition(),
+				normal[i],
+				m_rbA.getInvInertiaDiagLocal(),
+				m_rbA.getInvMass(),
+				m_rbB.getInvInertiaDiagLocal(),
+				m_rbB.getInvMass());
+			}
+		}
+
+		calcAngleInfo2(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getInvInertiaTensorWorld(),m_rbB.getInvInertiaTensorWorld());
+	}
+}
+
+
+
+void	btConeTwistConstraint::solveConstraintObsolete(btRigidBody& bodyA,btRigidBody& bodyB,btScalar	timeStep)
+{
+	#ifndef __SPU__
+	if (m_useSolveConstraintObsolete)
+	{
+		btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin();
+		btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin();
+
+		btScalar tau = btScalar(0.3);
+
+		//linear part
+		if (!m_angularOnly)
+		{
+			btVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition(); 
+			btVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition();
+
+			btVector3 vel1;
+			bodyA.internalGetVelocityInLocalPointObsolete(rel_pos1,vel1);
+			btVector3 vel2;
+			bodyB.internalGetVelocityInLocalPointObsolete(rel_pos2,vel2);
+			btVector3 vel = vel1 - vel2;
+
+			for (int i=0;i<3;i++)
+			{		
+				const btVector3& normal = m_jac[i].m_linearJointAxis;
+				btScalar jacDiagABInv = btScalar(1.) / m_jac[i].getDiagonal();
+
+				btScalar rel_vel;
+				rel_vel = normal.dot(vel);
+				//positional error (zeroth order error)
+				btScalar depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal
+				btScalar impulse = depth*tau/timeStep  * jacDiagABInv -  rel_vel * jacDiagABInv;
+				m_appliedImpulse += impulse;
+				
+				btVector3 ftorqueAxis1 = rel_pos1.cross(normal);
+				btVector3 ftorqueAxis2 = rel_pos2.cross(normal);
+				bodyA.internalApplyImpulse(normal*m_rbA.getInvMass(), m_rbA.getInvInertiaTensorWorld()*ftorqueAxis1,impulse);
+				bodyB.internalApplyImpulse(normal*m_rbB.getInvMass(), m_rbB.getInvInertiaTensorWorld()*ftorqueAxis2,-impulse);
+		
+			}
+		}
+
+		// apply motor
+		if (m_bMotorEnabled)
+		{
+			// compute current and predicted transforms
+			btTransform trACur = m_rbA.getCenterOfMassTransform();
+			btTransform trBCur = m_rbB.getCenterOfMassTransform();
+			btVector3 omegaA; bodyA.internalGetAngularVelocity(omegaA);
+			btVector3 omegaB; bodyB.internalGetAngularVelocity(omegaB);
+			btTransform trAPred; trAPred.setIdentity(); 
+			btVector3 zerovec(0,0,0);
+			btTransformUtil::integrateTransform(
+				trACur, zerovec, omegaA, timeStep, trAPred);
+			btTransform trBPred; trBPred.setIdentity(); 
+			btTransformUtil::integrateTransform(
+				trBCur, zerovec, omegaB, timeStep, trBPred);
+
+			// compute desired transforms in world
+			btTransform trPose(m_qTarget);
+			btTransform trABDes = m_rbBFrame * trPose * m_rbAFrame.inverse();
+			btTransform trADes = trBPred * trABDes;
+			btTransform trBDes = trAPred * trABDes.inverse();
+
+			// compute desired omegas in world
+			btVector3 omegaADes, omegaBDes;
+			
+			btTransformUtil::calculateVelocity(trACur, trADes, timeStep, zerovec, omegaADes);
+			btTransformUtil::calculateVelocity(trBCur, trBDes, timeStep, zerovec, omegaBDes);
+
+			// compute delta omegas
+			btVector3 dOmegaA = omegaADes - omegaA;
+			btVector3 dOmegaB = omegaBDes - omegaB;
+
+			// compute weighted avg axis of dOmega (weighting based on inertias)
+			btVector3 axisA, axisB;
+			btScalar kAxisAInv = 0, kAxisBInv = 0;
+
+			if (dOmegaA.length2() > SIMD_EPSILON)
+			{
+				axisA = dOmegaA.normalized();
+				kAxisAInv = getRigidBodyA().computeAngularImpulseDenominator(axisA);
+			}
+
+			if (dOmegaB.length2() > SIMD_EPSILON)
+			{
+				axisB = dOmegaB.normalized();
+				kAxisBInv = getRigidBodyB().computeAngularImpulseDenominator(axisB);
+			}
+
+			btVector3 avgAxis = kAxisAInv * axisA + kAxisBInv * axisB;
+
+			static bool bDoTorque = true;
+			if (bDoTorque && avgAxis.length2() > SIMD_EPSILON)
+			{
+				avgAxis.normalize();
+				kAxisAInv = getRigidBodyA().computeAngularImpulseDenominator(avgAxis);
+				kAxisBInv = getRigidBodyB().computeAngularImpulseDenominator(avgAxis);
+				btScalar kInvCombined = kAxisAInv + kAxisBInv;
+
+				btVector3 impulse = (kAxisAInv * dOmegaA - kAxisBInv * dOmegaB) /
+									(kInvCombined * kInvCombined);
+
+				if (m_maxMotorImpulse >= 0)
+				{
+					btScalar fMaxImpulse = m_maxMotorImpulse;
+					if (m_bNormalizedMotorStrength)
+						fMaxImpulse = fMaxImpulse/kAxisAInv;
+
+					btVector3 newUnclampedAccImpulse = m_accMotorImpulse + impulse;
+					btScalar  newUnclampedMag = newUnclampedAccImpulse.length();
+					if (newUnclampedMag > fMaxImpulse)
+					{
+						newUnclampedAccImpulse.normalize();
+						newUnclampedAccImpulse *= fMaxImpulse;
+						impulse = newUnclampedAccImpulse - m_accMotorImpulse;
+					}
+					m_accMotorImpulse += impulse;
+				}
+
+				btScalar  impulseMag  = impulse.length();
+				btVector3 impulseAxis =  impulse / impulseMag;
+
+				bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*impulseAxis, impulseMag);
+				bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*impulseAxis, -impulseMag);
+
+			}
+		}
+		else if (m_damping > SIMD_EPSILON) // no motor: do a little damping
+		{
+			btVector3 angVelA; bodyA.internalGetAngularVelocity(angVelA);
+			btVector3 angVelB; bodyB.internalGetAngularVelocity(angVelB);
+			btVector3 relVel = angVelB - angVelA;
+			if (relVel.length2() > SIMD_EPSILON)
+			{
+				btVector3 relVelAxis = relVel.normalized();
+				btScalar m_kDamping =  btScalar(1.) /
+					(getRigidBodyA().computeAngularImpulseDenominator(relVelAxis) +
+					 getRigidBodyB().computeAngularImpulseDenominator(relVelAxis));
+				btVector3 impulse = m_damping * m_kDamping * relVel;
+
+				btScalar  impulseMag  = impulse.length();
+				btVector3 impulseAxis = impulse / impulseMag;
+				bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*impulseAxis, impulseMag);
+				bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*impulseAxis, -impulseMag);
+			}
+		}
+
+		// joint limits
+		{
+			///solve angular part
+			btVector3 angVelA;
+			bodyA.internalGetAngularVelocity(angVelA);
+			btVector3 angVelB;
+			bodyB.internalGetAngularVelocity(angVelB);
+
+			// solve swing limit
+			if (m_solveSwingLimit)
+			{
+				btScalar amplitude = m_swingLimitRatio * m_swingCorrection*m_biasFactor/timeStep;
+				btScalar relSwingVel = (angVelB - angVelA).dot(m_swingAxis);
+				if (relSwingVel > 0)
+					amplitude += m_swingLimitRatio * relSwingVel * m_relaxationFactor;
+				btScalar impulseMag = amplitude * m_kSwing;
+
+				// Clamp the accumulated impulse
+				btScalar temp = m_accSwingLimitImpulse;
+				m_accSwingLimitImpulse = btMax(m_accSwingLimitImpulse + impulseMag, btScalar(0.0) );
+				impulseMag = m_accSwingLimitImpulse - temp;
+
+				btVector3 impulse = m_swingAxis * impulseMag;
+
+				// don't let cone response affect twist
+				// (this can happen since body A's twist doesn't match body B's AND we use an elliptical cone limit)
+				{
+					btVector3 impulseTwistCouple = impulse.dot(m_twistAxisA) * m_twistAxisA;
+					btVector3 impulseNoTwistCouple = impulse - impulseTwistCouple;
+					impulse = impulseNoTwistCouple;
+				}
+
+				impulseMag = impulse.length();
+				btVector3 noTwistSwingAxis = impulse / impulseMag;
+
+				bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*noTwistSwingAxis, impulseMag);
+				bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*noTwistSwingAxis, -impulseMag);
+			}
+
+
+			// solve twist limit
+			if (m_solveTwistLimit)
+			{
+				btScalar amplitude = m_twistLimitRatio * m_twistCorrection*m_biasFactor/timeStep;
+				btScalar relTwistVel = (angVelB - angVelA).dot( m_twistAxis );
+				if (relTwistVel > 0) // only damp when moving towards limit (m_twistAxis flipping is important)
+					amplitude += m_twistLimitRatio * relTwistVel * m_relaxationFactor;
+				btScalar impulseMag = amplitude * m_kTwist;
+
+				// Clamp the accumulated impulse
+				btScalar temp = m_accTwistLimitImpulse;
+				m_accTwistLimitImpulse = btMax(m_accTwistLimitImpulse + impulseMag, btScalar(0.0) );
+				impulseMag = m_accTwistLimitImpulse - temp;
+
+				btVector3 impulse = m_twistAxis * impulseMag;
+
+				bodyA.internalApplyImpulse(btVector3(0,0,0), m_rbA.getInvInertiaTensorWorld()*m_twistAxis,impulseMag);
+				bodyB.internalApplyImpulse(btVector3(0,0,0), m_rbB.getInvInertiaTensorWorld()*m_twistAxis,-impulseMag);
+			}		
+		}
+	}
+#else
+btAssert(0);
+#endif //__SPU__
+}
+
+
+
+
+void	btConeTwistConstraint::updateRHS(btScalar	timeStep)
+{
+	(void)timeStep;
+
+}
+
+
+#ifndef __SPU__
+void btConeTwistConstraint::calcAngleInfo()
+{
+	m_swingCorrection = btScalar(0.);
+	m_twistLimitSign = btScalar(0.);
+	m_solveTwistLimit = false;
+	m_solveSwingLimit = false;
+
+	btVector3 b1Axis1,b1Axis2,b1Axis3;
+	btVector3 b2Axis1,b2Axis2;
+
+	b1Axis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(0);
+	b2Axis1 = getRigidBodyB().getCenterOfMassTransform().getBasis() * this->m_rbBFrame.getBasis().getColumn(0);
+
+	btScalar swing1=btScalar(0.),swing2 = btScalar(0.);
+
+	btScalar swx=btScalar(0.),swy = btScalar(0.);
+	btScalar thresh = btScalar(10.);
+	btScalar fact;
+
+	// Get Frame into world space
+	if (m_swingSpan1 >= btScalar(0.05f))
+	{
+		b1Axis2 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(1);
+		swx = b2Axis1.dot(b1Axis1);
+		swy = b2Axis1.dot(b1Axis2);
+		swing1  = btAtan2Fast(swy, swx);
+		fact = (swy*swy + swx*swx) * thresh * thresh;
+		fact = fact / (fact + btScalar(1.0));
+		swing1 *= fact; 
+	}
+
+	if (m_swingSpan2 >= btScalar(0.05f))
+	{
+		b1Axis3 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(2);			
+		swx = b2Axis1.dot(b1Axis1);
+		swy = b2Axis1.dot(b1Axis3);
+		swing2  = btAtan2Fast(swy, swx);
+		fact = (swy*swy + swx*swx) * thresh * thresh;
+		fact = fact / (fact + btScalar(1.0));
+		swing2 *= fact; 
+	}
+
+	btScalar RMaxAngle1Sq = 1.0f / (m_swingSpan1*m_swingSpan1);		
+	btScalar RMaxAngle2Sq = 1.0f / (m_swingSpan2*m_swingSpan2);	
+	btScalar EllipseAngle = btFabs(swing1*swing1)* RMaxAngle1Sq + btFabs(swing2*swing2) * RMaxAngle2Sq;
+
+	if (EllipseAngle > 1.0f)
+	{
+		m_swingCorrection = EllipseAngle-1.0f;
+		m_solveSwingLimit = true;
+		// Calculate necessary axis & factors
+		m_swingAxis = b2Axis1.cross(b1Axis2* b2Axis1.dot(b1Axis2) + b1Axis3* b2Axis1.dot(b1Axis3));
+		m_swingAxis.normalize();
+		btScalar swingAxisSign = (b2Axis1.dot(b1Axis1) >= 0.0f) ? 1.0f : -1.0f;
+		m_swingAxis *= swingAxisSign;
+	}
+
+	// Twist limits
+	if (m_twistSpan >= btScalar(0.))
+	{
+		btVector3 b2Axis2 = getRigidBodyB().getCenterOfMassTransform().getBasis() * this->m_rbBFrame.getBasis().getColumn(1);
+		btQuaternion rotationArc = shortestArcQuat(b2Axis1,b1Axis1);
+		btVector3 TwistRef = quatRotate(rotationArc,b2Axis2); 
+		btScalar twist = btAtan2Fast( TwistRef.dot(b1Axis3), TwistRef.dot(b1Axis2) );
+		m_twistAngle = twist;
+
+//		btScalar lockedFreeFactor = (m_twistSpan > btScalar(0.05f)) ? m_limitSoftness : btScalar(0.);
+		btScalar lockedFreeFactor = (m_twistSpan > btScalar(0.05f)) ? btScalar(1.0f) : btScalar(0.);
+		if (twist <= -m_twistSpan*lockedFreeFactor)
+		{
+			m_twistCorrection = -(twist + m_twistSpan);
+			m_solveTwistLimit = true;
+			m_twistAxis = (b2Axis1 + b1Axis1) * 0.5f;
+			m_twistAxis.normalize();
+			m_twistAxis *= -1.0f;
+		}
+		else if (twist >  m_twistSpan*lockedFreeFactor)
+		{
+			m_twistCorrection = (twist - m_twistSpan);
+			m_solveTwistLimit = true;
+			m_twistAxis = (b2Axis1 + b1Axis1) * 0.5f;
+			m_twistAxis.normalize();
+		}
+	}
+}
+#endif //__SPU__
+
+static btVector3 vTwist(1,0,0); // twist axis in constraint's space
+
+
+
+void btConeTwistConstraint::calcAngleInfo2(const btTransform& transA, const btTransform& transB, const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB)
+{
+	m_swingCorrection = btScalar(0.);
+	m_twistLimitSign = btScalar(0.);
+	m_solveTwistLimit = false;
+	m_solveSwingLimit = false;
+	// compute rotation of A wrt B (in constraint space)
+	if (m_bMotorEnabled && (!m_useSolveConstraintObsolete))
+	{	// it is assumed that setMotorTarget() was alredy called 
+		// and motor target m_qTarget is within constraint limits
+		// TODO : split rotation to pure swing and pure twist
+		// compute desired transforms in world
+		btTransform trPose(m_qTarget);
+		btTransform trA = transA * m_rbAFrame;
+		btTransform trB = transB * m_rbBFrame;
+		btTransform trDeltaAB = trB * trPose * trA.inverse();
+		btQuaternion qDeltaAB = trDeltaAB.getRotation();
+		btVector3 swingAxis = 	btVector3(qDeltaAB.x(), qDeltaAB.y(), qDeltaAB.z());
+		m_swingAxis = swingAxis;
+		m_swingAxis.normalize();
+		m_swingCorrection = qDeltaAB.getAngle();
+		if(!btFuzzyZero(m_swingCorrection))
+		{
+			m_solveSwingLimit = true;
+		}
+		return;
+	}
+
+
+	{
+		// compute rotation of A wrt B (in constraint space)
+		btQuaternion qA = transA.getRotation() * m_rbAFrame.getRotation();
+		btQuaternion qB = transB.getRotation() * m_rbBFrame.getRotation();
+		btQuaternion qAB = qB.inverse() * qA;
+		// split rotation into cone and twist
+		// (all this is done from B's perspective. Maybe I should be averaging axes...)
+		btVector3 vConeNoTwist = quatRotate(qAB, vTwist); vConeNoTwist.normalize();
+		btQuaternion qABCone  = shortestArcQuat(vTwist, vConeNoTwist); qABCone.normalize();
+		btQuaternion qABTwist = qABCone.inverse() * qAB; qABTwist.normalize();
+
+		if (m_swingSpan1 >= m_fixThresh && m_swingSpan2 >= m_fixThresh)
+		{
+			btScalar swingAngle, swingLimit = 0; btVector3 swingAxis;
+			computeConeLimitInfo(qABCone, swingAngle, swingAxis, swingLimit);
+
+			if (swingAngle > swingLimit * m_limitSoftness)
+			{
+				m_solveSwingLimit = true;
+
+				// compute limit ratio: 0->1, where
+				// 0 == beginning of soft limit
+				// 1 == hard/real limit
+				m_swingLimitRatio = 1.f;
+				if (swingAngle < swingLimit && m_limitSoftness < 1.f - SIMD_EPSILON)
+				{
+					m_swingLimitRatio = (swingAngle - swingLimit * m_limitSoftness)/
+										(swingLimit - swingLimit * m_limitSoftness);
+				}				
+
+				// swing correction tries to get back to soft limit
+				m_swingCorrection = swingAngle - (swingLimit * m_limitSoftness);
+
+				// adjustment of swing axis (based on ellipse normal)
+				adjustSwingAxisToUseEllipseNormal(swingAxis);
+
+				// Calculate necessary axis & factors		
+				m_swingAxis = quatRotate(qB, -swingAxis);
+
+				m_twistAxisA.setValue(0,0,0);
+
+				m_kSwing =  btScalar(1.) /
+					(computeAngularImpulseDenominator(m_swingAxis,invInertiaWorldA) +
+					 computeAngularImpulseDenominator(m_swingAxis,invInertiaWorldB));
+			}
+		}
+		else
+		{
+			// you haven't set any limits;
+			// or you're trying to set at least one of the swing limits too small. (if so, do you really want a conetwist constraint?)
+			// anyway, we have either hinge or fixed joint
+			btVector3 ivA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(0);
+			btVector3 jvA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(1);
+			btVector3 kvA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(2);
+			btVector3 ivB = transB.getBasis() * m_rbBFrame.getBasis().getColumn(0);
+			btVector3 target;
+			btScalar x = ivB.dot(ivA);
+			btScalar y = ivB.dot(jvA);
+			btScalar z = ivB.dot(kvA);
+			if((m_swingSpan1 < m_fixThresh) && (m_swingSpan2 < m_fixThresh))
+			{ // fixed. We'll need to add one more row to constraint
+				if((!btFuzzyZero(y)) || (!(btFuzzyZero(z))))
+				{
+					m_solveSwingLimit = true;
+					m_swingAxis = -ivB.cross(ivA);
+				}
+			}
+			else
+			{
+				if(m_swingSpan1 < m_fixThresh)
+				{ // hinge around Y axis
+					if(!(btFuzzyZero(y)))
+					{
+						m_solveSwingLimit = true;
+						if(m_swingSpan2 >= m_fixThresh)
+						{
+							y = btScalar(0.f);
+							btScalar span2 = btAtan2(z, x);
+							if(span2 > m_swingSpan2)
+							{
+								x = btCos(m_swingSpan2);
+								z = btSin(m_swingSpan2);
+							}
+							else if(span2 < -m_swingSpan2)
+							{
+								x =  btCos(m_swingSpan2);
+								z = -btSin(m_swingSpan2);
+							}
+						}
+					}
+				}
+				else
+				{ // hinge around Z axis
+					if(!btFuzzyZero(z))
+					{
+						m_solveSwingLimit = true;
+						if(m_swingSpan1 >= m_fixThresh)
+						{
+							z = btScalar(0.f);
+							btScalar span1 = btAtan2(y, x);
+							if(span1 > m_swingSpan1)
+							{
+								x = btCos(m_swingSpan1);
+								y = btSin(m_swingSpan1);
+							}
+							else if(span1 < -m_swingSpan1)
+							{
+								x =  btCos(m_swingSpan1);
+								y = -btSin(m_swingSpan1);
+							}
+						}
+					}
+				}
+				target[0] = x * ivA[0] + y * jvA[0] + z * kvA[0];
+				target[1] = x * ivA[1] + y * jvA[1] + z * kvA[1];
+				target[2] = x * ivA[2] + y * jvA[2] + z * kvA[2];
+				target.normalize();
+				m_swingAxis = -ivB.cross(target);
+				m_swingCorrection = m_swingAxis.length();
+				m_swingAxis.normalize();
+			}
+		}
+
+		if (m_twistSpan >= btScalar(0.f))
+		{
+			btVector3 twistAxis;
+			computeTwistLimitInfo(qABTwist, m_twistAngle, twistAxis);
+
+			if (m_twistAngle > m_twistSpan*m_limitSoftness)
+			{
+				m_solveTwistLimit = true;
+
+				m_twistLimitRatio = 1.f;
+				if (m_twistAngle < m_twistSpan && m_limitSoftness < 1.f - SIMD_EPSILON)
+				{
+					m_twistLimitRatio = (m_twistAngle - m_twistSpan * m_limitSoftness)/
+										(m_twistSpan  - m_twistSpan * m_limitSoftness);
+				}
+
+				// twist correction tries to get back to soft limit
+				m_twistCorrection = m_twistAngle - (m_twistSpan * m_limitSoftness);
+
+				m_twistAxis = quatRotate(qB, -twistAxis);
+
+				m_kTwist = btScalar(1.) /
+					(computeAngularImpulseDenominator(m_twistAxis,invInertiaWorldA) +
+					 computeAngularImpulseDenominator(m_twistAxis,invInertiaWorldB));
+			}
+
+			if (m_solveSwingLimit)
+				m_twistAxisA = quatRotate(qA, -twistAxis);
+		}
+		else
+		{
+			m_twistAngle = btScalar(0.f);
+		}
+	}
+}
+
+
+
+// given a cone rotation in constraint space, (pre: twist must already be removed)
+// this method computes its corresponding swing angle and axis.
+// more interestingly, it computes the cone/swing limit (angle) for this cone "pose".
+void btConeTwistConstraint::computeConeLimitInfo(const btQuaternion& qCone,
+												 btScalar& swingAngle, // out
+												 btVector3& vSwingAxis, // out
+												 btScalar& swingLimit) // out
+{
+	swingAngle = qCone.getAngle();
+	if (swingAngle > SIMD_EPSILON)
+	{
+		vSwingAxis = btVector3(qCone.x(), qCone.y(), qCone.z());
+		vSwingAxis.normalize();
+		if (fabs(vSwingAxis.x()) > SIMD_EPSILON)
+		{
+			// non-zero twist?! this should never happen.
+			int wtf = 0; wtf = wtf;
+		}
+
+		// Compute limit for given swing. tricky:
+		// Given a swing axis, we're looking for the intersection with the bounding cone ellipse.
+		// (Since we're dealing with angles, this ellipse is embedded on the surface of a sphere.)
+
+		// For starters, compute the direction from center to surface of ellipse.
+		// This is just the perpendicular (ie. rotate 2D vector by PI/2) of the swing axis.
+		// (vSwingAxis is the cone rotation (in z,y); change vars and rotate to (x,y) coords.)
+		btScalar xEllipse =  vSwingAxis.y();
+		btScalar yEllipse = -vSwingAxis.z();
+
+		// Now, we use the slope of the vector (using x/yEllipse) and find the length
+		// of the line that intersects the ellipse:
+		//  x^2   y^2
+		//  --- + --- = 1, where a and b are semi-major axes 2 and 1 respectively (ie. the limits)
+		//  a^2   b^2
+		// Do the math and it should be clear.
+
+		swingLimit = m_swingSpan1; // if xEllipse == 0, we have a pure vSwingAxis.z rotation: just use swingspan1
+		if (fabs(xEllipse) > SIMD_EPSILON)
+		{
+			btScalar surfaceSlope2 = (yEllipse*yEllipse)/(xEllipse*xEllipse);
+			btScalar norm = 1 / (m_swingSpan2 * m_swingSpan2);
+			norm += surfaceSlope2 / (m_swingSpan1 * m_swingSpan1);
+			btScalar swingLimit2 = (1 + surfaceSlope2) / norm;
+			swingLimit = sqrt(swingLimit2);
+		}
+
+		// test!
+		/*swingLimit = m_swingSpan2;
+		if (fabs(vSwingAxis.z()) > SIMD_EPSILON)
+		{
+		btScalar mag_2 = m_swingSpan1*m_swingSpan1 + m_swingSpan2*m_swingSpan2;
+		btScalar sinphi = m_swingSpan2 / sqrt(mag_2);
+		btScalar phi = asin(sinphi);
+		btScalar theta = atan2(fabs(vSwingAxis.y()),fabs(vSwingAxis.z()));
+		btScalar alpha = 3.14159f - theta - phi;
+		btScalar sinalpha = sin(alpha);
+		swingLimit = m_swingSpan1 * sinphi/sinalpha;
+		}*/
+	}
+	else if (swingAngle < 0)
+	{
+		// this should never happen!
+		int wtf = 0; wtf = wtf;
+	}
+}
+
+btVector3 btConeTwistConstraint::GetPointForAngle(btScalar fAngleInRadians, btScalar fLength) const
+{
+	// compute x/y in ellipse using cone angle (0 -> 2*PI along surface of cone)
+	btScalar xEllipse = btCos(fAngleInRadians);
+	btScalar yEllipse = btSin(fAngleInRadians);
+
+	// Use the slope of the vector (using x/yEllipse) and find the length
+	// of the line that intersects the ellipse:
+	//  x^2   y^2
+	//  --- + --- = 1, where a and b are semi-major axes 2 and 1 respectively (ie. the limits)
+	//  a^2   b^2
+	// Do the math and it should be clear.
+
+	float swingLimit = m_swingSpan1; // if xEllipse == 0, just use axis b (1)
+	if (fabs(xEllipse) > SIMD_EPSILON)
+	{
+		btScalar surfaceSlope2 = (yEllipse*yEllipse)/(xEllipse*xEllipse);
+		btScalar norm = 1 / (m_swingSpan2 * m_swingSpan2);
+		norm += surfaceSlope2 / (m_swingSpan1 * m_swingSpan1);
+		btScalar swingLimit2 = (1 + surfaceSlope2) / norm;
+		swingLimit = sqrt(swingLimit2);
+	}
+
+	// convert into point in constraint space:
+	// note: twist is x-axis, swing 1 and 2 are along the z and y axes respectively
+	btVector3 vSwingAxis(0, xEllipse, -yEllipse);
+	btQuaternion qSwing(vSwingAxis, swingLimit);
+	btVector3 vPointInConstraintSpace(fLength,0,0);
+	return quatRotate(qSwing, vPointInConstraintSpace);
+}
+
+// given a twist rotation in constraint space, (pre: cone must already be removed)
+// this method computes its corresponding angle and axis.
+void btConeTwistConstraint::computeTwistLimitInfo(const btQuaternion& qTwist,
+												  btScalar& twistAngle, // out
+												  btVector3& vTwistAxis) // out
+{
+	btQuaternion qMinTwist = qTwist;
+	twistAngle = qTwist.getAngle();
+
+	if (twistAngle > SIMD_PI) // long way around. flip quat and recalculate.
+	{
+		qMinTwist = operator-(qTwist);
+		twistAngle = qMinTwist.getAngle();
+	}
+	if (twistAngle < 0)
+	{
+		// this should never happen
+		int wtf = 0; wtf = wtf;			
+	}
+
+	vTwistAxis = btVector3(qMinTwist.x(), qMinTwist.y(), qMinTwist.z());
+	if (twistAngle > SIMD_EPSILON)
+		vTwistAxis.normalize();
+}
+
+
+void btConeTwistConstraint::adjustSwingAxisToUseEllipseNormal(btVector3& vSwingAxis) const
+{
+	// the swing axis is computed as the "twist-free" cone rotation,
+	// but the cone limit is not circular, but elliptical (if swingspan1 != swingspan2).
+	// so, if we're outside the limits, the closest way back inside the cone isn't 
+	// along the vector back to the center. better (and more stable) to use the ellipse normal.
+
+	// convert swing axis to direction from center to surface of ellipse
+	// (ie. rotate 2D vector by PI/2)
+	btScalar y = -vSwingAxis.z();
+	btScalar z =  vSwingAxis.y();
+
+	// do the math...
+	if (fabs(z) > SIMD_EPSILON) // avoid division by 0. and we don't need an update if z == 0.
+	{
+		// compute gradient/normal of ellipse surface at current "point"
+		btScalar grad = y/z;
+		grad *= m_swingSpan2 / m_swingSpan1;
+
+		// adjust y/z to represent normal at point (instead of vector to point)
+		if (y > 0)
+			y =  fabs(grad * z);
+		else
+			y = -fabs(grad * z);
+
+		// convert ellipse direction back to swing axis
+		vSwingAxis.setZ(-y);
+		vSwingAxis.setY( z);
+		vSwingAxis.normalize();
+	}
+}
+
+
+
+void btConeTwistConstraint::setMotorTarget(const btQuaternion &q)
+{
+	btTransform trACur = m_rbA.getCenterOfMassTransform();
+	btTransform trBCur = m_rbB.getCenterOfMassTransform();
+	btTransform trABCur = trBCur.inverse() * trACur;
+	btQuaternion qABCur = trABCur.getRotation();
+	btTransform trConstraintCur = (trBCur * m_rbBFrame).inverse() * (trACur * m_rbAFrame);
+	btQuaternion qConstraintCur = trConstraintCur.getRotation();
+
+	btQuaternion qConstraint = m_rbBFrame.getRotation().inverse() * q * m_rbAFrame.getRotation();
+	setMotorTargetInConstraintSpace(qConstraint);
+}
+
+
+void btConeTwistConstraint::setMotorTargetInConstraintSpace(const btQuaternion &q)
+{
+	m_qTarget = q;
+
+	// clamp motor target to within limits
+	{
+		btScalar softness = 1.f;//m_limitSoftness;
+
+		// split into twist and cone
+		btVector3 vTwisted = quatRotate(m_qTarget, vTwist);
+		btQuaternion qTargetCone  = shortestArcQuat(vTwist, vTwisted); qTargetCone.normalize();
+		btQuaternion qTargetTwist = qTargetCone.inverse() * m_qTarget; qTargetTwist.normalize();
+
+		// clamp cone
+		if (m_swingSpan1 >= btScalar(0.05f) && m_swingSpan2 >= btScalar(0.05f))
+		{
+			btScalar swingAngle, swingLimit; btVector3 swingAxis;
+			computeConeLimitInfo(qTargetCone, swingAngle, swingAxis, swingLimit);
+
+			if (fabs(swingAngle) > SIMD_EPSILON)
+			{
+				if (swingAngle > swingLimit*softness)
+					swingAngle = swingLimit*softness;
+				else if (swingAngle < -swingLimit*softness)
+					swingAngle = -swingLimit*softness;
+				qTargetCone = btQuaternion(swingAxis, swingAngle);
+			}
+		}
+
+		// clamp twist
+		if (m_twistSpan >= btScalar(0.05f))
+		{
+			btScalar twistAngle; btVector3 twistAxis;
+			computeTwistLimitInfo(qTargetTwist, twistAngle, twistAxis);
+
+			if (fabs(twistAngle) > SIMD_EPSILON)
+			{
+				// eddy todo: limitSoftness used here???
+				if (twistAngle > m_twistSpan*softness)
+					twistAngle = m_twistSpan*softness;
+				else if (twistAngle < -m_twistSpan*softness)
+					twistAngle = -m_twistSpan*softness;
+				qTargetTwist = btQuaternion(twistAxis, twistAngle);
+			}
+		}
+
+		m_qTarget = qTargetCone * qTargetTwist;
+	}
+}
+
+///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+///If no axis is provided, it uses the default axis for this constraint.
+void btConeTwistConstraint::setParam(int num, btScalar value, int axis)
+{
+	switch(num)
+	{
+		case BT_CONSTRAINT_ERP :
+		case BT_CONSTRAINT_STOP_ERP :
+			if((axis >= 0) && (axis < 3)) 
+			{
+				m_linERP = value;
+				m_flags |= BT_CONETWIST_FLAGS_LIN_ERP;
+			}
+			else
+			{
+				m_biasFactor = value;
+			}
+			break;
+		case BT_CONSTRAINT_CFM :
+		case BT_CONSTRAINT_STOP_CFM :
+			if((axis >= 0) && (axis < 3)) 
+			{
+				m_linCFM = value;
+				m_flags |= BT_CONETWIST_FLAGS_LIN_CFM;
+			}
+			else
+			{
+				m_angCFM = value;
+				m_flags |= BT_CONETWIST_FLAGS_ANG_CFM;
+			}
+			break;
+		default:
+			btAssertConstrParams(0);
+			break;
+	}
+}
+
+///return the local value of parameter
+btScalar btConeTwistConstraint::getParam(int num, int axis) const 
+{
+	btScalar retVal = 0;
+	switch(num)
+	{
+		case BT_CONSTRAINT_ERP :
+		case BT_CONSTRAINT_STOP_ERP :
+			if((axis >= 0) && (axis < 3)) 
+			{
+				btAssertConstrParams(m_flags & BT_CONETWIST_FLAGS_LIN_ERP);
+				retVal = m_linERP;
+			}
+			else if((axis >= 3) && (axis < 6)) 
+			{
+				retVal = m_biasFactor;
+			}
+			else
+			{
+				btAssertConstrParams(0);
+			}
+			break;
+		case BT_CONSTRAINT_CFM :
+		case BT_CONSTRAINT_STOP_CFM :
+			if((axis >= 0) && (axis < 3)) 
+			{
+				btAssertConstrParams(m_flags & BT_CONETWIST_FLAGS_LIN_CFM);
+				retVal = m_linCFM;
+			}
+			else if((axis >= 3) && (axis < 6)) 
+			{
+				btAssertConstrParams(m_flags & BT_CONETWIST_FLAGS_ANG_CFM);
+				retVal = m_angCFM;
+			}
+			else
+			{
+				btAssertConstrParams(0);
+			}
+			break;
+		default : 
+			btAssertConstrParams(0);
+	}
+	return retVal;
+}
+
+
+void btConeTwistConstraint::setFrames(const btTransform & frameA, const btTransform & frameB)
+{
+	m_rbAFrame = frameA;
+	m_rbBFrame = frameB;
+	buildJacobian();
+	//calculateTransforms();
+}
+
+ 
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
new file mode 100644
index 0000000..868e62f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
@@ -0,0 +1,346 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+btConeTwistConstraint is Copyright (c) 2007 Starbreeze Studios
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Written by: Marcus Hennix
+*/
+
+
+
+/*
+Overview:
+
+btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc).
+It is a fixed translation, 3 degree-of-freedom (DOF) rotational "joint".
+It divides the 3 rotational DOFs into swing (movement within a cone) and twist.
+Swing is divided into swing1 and swing2 which can have different limits, giving an elliptical shape.
+(Note: the cone's base isn't flat, so this ellipse is "embedded" on the surface of a sphere.)
+
+In the contraint's frame of reference:
+twist is along the x-axis,
+and swing 1 and 2 are along the z and y axes respectively.
+*/
+
+
+
+#ifndef BT_CONETWISTCONSTRAINT_H
+#define BT_CONETWISTCONSTRAINT_H
+
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+#include "btTypedConstraint.h"
+
+class btRigidBody;
+
+enum btConeTwistFlags
+{
+	BT_CONETWIST_FLAGS_LIN_CFM = 1,
+	BT_CONETWIST_FLAGS_LIN_ERP = 2,
+	BT_CONETWIST_FLAGS_ANG_CFM = 4
+};
+
+///btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc)
+class btConeTwistConstraint : public btTypedConstraint
+{
+#ifdef IN_PARALLELL_SOLVER
+public:
+#endif
+	btJacobianEntry	m_jac[3]; //3 orthogonal linear constraints
+
+	btTransform m_rbAFrame; 
+	btTransform m_rbBFrame;
+
+	btScalar	m_limitSoftness;
+	btScalar	m_biasFactor;
+	btScalar	m_relaxationFactor;
+
+	btScalar	m_damping;
+
+	btScalar	m_swingSpan1;
+	btScalar	m_swingSpan2;
+	btScalar	m_twistSpan;
+
+	btScalar	m_fixThresh;
+
+	btVector3   m_swingAxis;
+	btVector3	m_twistAxis;
+
+	btScalar	m_kSwing;
+	btScalar	m_kTwist;
+
+	btScalar	m_twistLimitSign;
+	btScalar	m_swingCorrection;
+	btScalar	m_twistCorrection;
+
+	btScalar	m_twistAngle;
+
+	btScalar	m_accSwingLimitImpulse;
+	btScalar	m_accTwistLimitImpulse;
+
+	bool		m_angularOnly;
+	bool		m_solveTwistLimit;
+	bool		m_solveSwingLimit;
+
+	bool	m_useSolveConstraintObsolete;
+
+	// not yet used...
+	btScalar	m_swingLimitRatio;
+	btScalar	m_twistLimitRatio;
+	btVector3   m_twistAxisA;
+
+	// motor
+	bool		 m_bMotorEnabled;
+	bool		 m_bNormalizedMotorStrength;
+	btQuaternion m_qTarget;
+	btScalar	 m_maxMotorImpulse;
+	btVector3	 m_accMotorImpulse;
+	
+	// parameters
+	int			m_flags;
+	btScalar	m_linCFM;
+	btScalar	m_linERP;
+	btScalar	m_angCFM;
+	
+protected:
+
+	void init();
+
+	void computeConeLimitInfo(const btQuaternion& qCone, // in
+		btScalar& swingAngle, btVector3& vSwingAxis, btScalar& swingLimit); // all outs
+
+	void computeTwistLimitInfo(const btQuaternion& qTwist, // in
+		btScalar& twistAngle, btVector3& vTwistAxis); // all outs
+
+	void adjustSwingAxisToUseEllipseNormal(btVector3& vSwingAxis) const;
+
+
+public:
+
+	btConeTwistConstraint(btRigidBody& rbA,btRigidBody& rbB,const btTransform& rbAFrame, const btTransform& rbBFrame);
+	
+	btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame);
+
+	virtual void	buildJacobian();
+
+	virtual void getInfo1 (btConstraintInfo1* info);
+
+	void	getInfo1NonVirtual(btConstraintInfo1* info);
+	
+	virtual void getInfo2 (btConstraintInfo2* info);
+	
+	void	getInfo2NonVirtual(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB);
+
+	virtual	void	solveConstraintObsolete(btRigidBody& bodyA,btRigidBody& bodyB,btScalar	timeStep);
+
+	void	updateRHS(btScalar	timeStep);
+
+
+	const btRigidBody& getRigidBodyA() const
+	{
+		return m_rbA;
+	}
+	const btRigidBody& getRigidBodyB() const
+	{
+		return m_rbB;
+	}
+
+	void	setAngularOnly(bool angularOnly)
+	{
+		m_angularOnly = angularOnly;
+	}
+
+	void	setLimit(int limitIndex,btScalar limitValue)
+	{
+		switch (limitIndex)
+		{
+		case 3:
+			{
+				m_twistSpan = limitValue;
+				break;
+			}
+		case 4:
+			{
+				m_swingSpan2 = limitValue;
+				break;
+			}
+		case 5:
+			{
+				m_swingSpan1 = limitValue;
+				break;
+			}
+		default:
+			{
+			}
+		};
+	}
+
+	// setLimit(), a few notes:
+	// _softness:
+	//		0->1, recommend ~0.8->1.
+	//		describes % of limits where movement is free.
+	//		beyond this softness %, the limit is gradually enforced until the "hard" (1.0) limit is reached.
+	// _biasFactor:
+	//		0->1?, recommend 0.3 +/-0.3 or so.
+	//		strength with which constraint resists zeroth order (angular, not angular velocity) limit violation.
+	// __relaxationFactor:
+	//		0->1, recommend to stay near 1.
+	//		the lower the value, the less the constraint will fight velocities which violate the angular limits.
+	void	setLimit(btScalar _swingSpan1,btScalar _swingSpan2,btScalar _twistSpan, btScalar _softness = 1.f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
+	{
+		m_swingSpan1 = _swingSpan1;
+		m_swingSpan2 = _swingSpan2;
+		m_twistSpan  = _twistSpan;
+
+		m_limitSoftness =  _softness;
+		m_biasFactor = _biasFactor;
+		m_relaxationFactor = _relaxationFactor;
+	}
+
+	const btTransform& getAFrame() { return m_rbAFrame; };	
+	const btTransform& getBFrame() { return m_rbBFrame; };
+
+	inline int getSolveTwistLimit()
+	{
+		return m_solveTwistLimit;
+	}
+
+	inline int getSolveSwingLimit()
+	{
+		return m_solveTwistLimit;
+	}
+
+	inline btScalar getTwistLimitSign()
+	{
+		return m_twistLimitSign;
+	}
+
+	void calcAngleInfo();
+	void calcAngleInfo2(const btTransform& transA, const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB);
+
+	inline btScalar getSwingSpan1()
+	{
+		return m_swingSpan1;
+	}
+	inline btScalar getSwingSpan2()
+	{
+		return m_swingSpan2;
+	}
+	inline btScalar getTwistSpan()
+	{
+		return m_twistSpan;
+	}
+	inline btScalar getTwistAngle()
+	{
+		return m_twistAngle;
+	}
+	bool isPastSwingLimit() { return m_solveSwingLimit; }
+
+	void setDamping(btScalar damping) { m_damping = damping; }
+
+	void enableMotor(bool b) { m_bMotorEnabled = b; }
+	void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = false; }
+	void setMaxMotorImpulseNormalized(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; m_bNormalizedMotorStrength = true; }
+
+	btScalar getFixThresh() { return m_fixThresh; }
+	void setFixThresh(btScalar fixThresh) { m_fixThresh = fixThresh; }
+
+	// setMotorTarget:
+	// q: the desired rotation of bodyA wrt bodyB.
+	// note: if q violates the joint limits, the internal target is clamped to avoid conflicting impulses (very bad for stability)
+	// note: don't forget to enableMotor()
+	void setMotorTarget(const btQuaternion &q);
+
+	// same as above, but q is the desired rotation of frameA wrt frameB in constraint space
+	void setMotorTargetInConstraintSpace(const btQuaternion &q);
+
+	btVector3 GetPointForAngle(btScalar fAngleInRadians, btScalar fLength) const;
+
+	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+	///If no axis is provided, it uses the default axis for this constraint.
+	virtual	void setParam(int num, btScalar value, int axis = -1);
+
+	virtual void setFrames(const btTransform& frameA, const btTransform& frameB);
+
+	const btTransform& getFrameOffsetA() const
+	{
+		return m_rbAFrame;
+	}
+
+	const btTransform& getFrameOffsetB() const
+	{
+		return m_rbBFrame;
+	}
+
+
+	///return the local value of parameter
+	virtual	btScalar getParam(int num, int axis = -1) const;
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btConeTwistConstraintData
+{
+	btTypedConstraintData	m_typeConstraintData;
+	btTransformFloatData m_rbAFrame;
+	btTransformFloatData m_rbBFrame;
+
+	//limits
+	float	m_swingSpan1;
+	float	m_swingSpan2;
+	float	m_twistSpan;
+	float	m_limitSoftness;
+	float	m_biasFactor;
+	float	m_relaxationFactor;
+
+	float	m_damping;
+		
+	char m_pad[4];
+
+};
+	
+
+
+SIMD_FORCE_INLINE int	btConeTwistConstraint::calculateSerializeBufferSize() const
+{
+	return sizeof(btConeTwistConstraintData);
+
+}
+
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE const char*	btConeTwistConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btConeTwistConstraintData* cone = (btConeTwistConstraintData*) dataBuffer;
+	btTypedConstraint::serialize(&cone->m_typeConstraintData,serializer);
+
+	m_rbAFrame.serializeFloat(cone->m_rbAFrame);
+	m_rbBFrame.serializeFloat(cone->m_rbBFrame);
+	
+	cone->m_swingSpan1 = float(m_swingSpan1);
+	cone->m_swingSpan2 = float(m_swingSpan2);
+	cone->m_twistSpan = float(m_twistSpan);
+	cone->m_limitSoftness = float(m_limitSoftness);
+	cone->m_biasFactor = float(m_biasFactor);
+	cone->m_relaxationFactor = float(m_relaxationFactor);
+	cone->m_damping = float(m_damping);
+
+	return "btConeTwistConstraintData";
+}
+
+
+#endif //BT_CONETWISTCONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
new file mode 100644
index 0000000..6f67310
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
@@ -0,0 +1,52 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONSTRAINT_SOLVER_H
+#define BT_CONSTRAINT_SOLVER_H
+
+#include "LinearMath/btScalar.h"
+
+class btPersistentManifold;
+class btRigidBody;
+class btCollisionObject;
+class btTypedConstraint;
+struct btContactSolverInfo;
+struct btBroadphaseProxy;
+class btIDebugDraw;
+class btStackAlloc;
+class	btDispatcher;
+/// btConstraintSolver provides solver interface
+class btConstraintSolver
+{
+
+public:
+
+	virtual ~btConstraintSolver() {}
+	
+	virtual void prepareSolve (int /* numBodies */, int /* numManifolds */) {;}
+
+	///solve a group of constraints
+	virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints, const btContactSolverInfo& info,class btIDebugDraw* debugDrawer, btStackAlloc* stackAlloc,btDispatcher* dispatcher) = 0;
+
+	virtual void allSolved (const btContactSolverInfo& /* info */,class btIDebugDraw* /* debugDrawer */, btStackAlloc* /* stackAlloc */) {;}
+
+	///clear internal cached data and reset random seed
+	virtual	void	reset() = 0;
+};
+
+
+
+
+#endif //BT_CONSTRAINT_SOLVER_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp
new file mode 100644
index 0000000..8885918
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp
@@ -0,0 +1,178 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btContactConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+#include "btContactSolverInfo.h"
+#include "LinearMath/btMinMax.h"
+#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
+
+
+
+btContactConstraint::btContactConstraint(btPersistentManifold* contactManifold,btRigidBody& rbA,btRigidBody& rbB)
+:btTypedConstraint(CONTACT_CONSTRAINT_TYPE,rbA,rbB),
+	m_contactManifold(*contactManifold)
+{
+
+}
+
+btContactConstraint::~btContactConstraint()
+{
+
+}
+
+void	btContactConstraint::setContactManifold(btPersistentManifold* contactManifold)
+{
+	m_contactManifold = *contactManifold;
+}
+
+void btContactConstraint::getInfo1 (btConstraintInfo1* info)
+{
+
+}
+
+void btContactConstraint::getInfo2 (btConstraintInfo2* info)
+{
+
+}
+
+void	btContactConstraint::buildJacobian()
+{
+
+}
+
+
+
+
+
+#include "btContactConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+#include "btContactSolverInfo.h"
+#include "LinearMath/btMinMax.h"
+#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
+
+
+
+//response  between two dynamic objects without friction, assuming 0 penetration depth
+btScalar resolveSingleCollision(
+        btRigidBody* body1,
+        btCollisionObject* colObj2,
+		const btVector3& contactPositionWorld,
+		const btVector3& contactNormalOnB,
+        const btContactSolverInfo& solverInfo,
+		btScalar distance)
+{
+	btRigidBody* body2 = btRigidBody::upcast(colObj2);
+    
+	
+    const btVector3& normal = contactNormalOnB;
+
+    btVector3 rel_pos1 = contactPositionWorld - body1->getWorldTransform().getOrigin(); 
+    btVector3 rel_pos2 = contactPositionWorld - colObj2->getWorldTransform().getOrigin();
+    
+    btVector3 vel1 = body1->getVelocityInLocalPoint(rel_pos1);
+	btVector3 vel2 = body2? body2->getVelocityInLocalPoint(rel_pos2) : btVector3(0,0,0);
+    btVector3 vel = vel1 - vel2;
+    btScalar rel_vel;
+    rel_vel = normal.dot(vel);
+    
+    btScalar combinedRestitution = body1->getRestitution() * colObj2->getRestitution();
+    btScalar restitution = combinedRestitution* -rel_vel;
+
+    btScalar positionalError = solverInfo.m_erp *-distance /solverInfo.m_timeStep ;
+    btScalar velocityError = -(1.0f + restitution) * rel_vel;// * damping;
+	btScalar denom0 = body1->computeImpulseDenominator(contactPositionWorld,normal);
+	btScalar denom1 = body2? body2->computeImpulseDenominator(contactPositionWorld,normal) : 0.f;
+	btScalar relaxation = 1.f;
+	btScalar jacDiagABInv = relaxation/(denom0+denom1);
+
+    btScalar penetrationImpulse = positionalError * jacDiagABInv;
+    btScalar velocityImpulse = velocityError * jacDiagABInv;
+
+    btScalar normalImpulse = penetrationImpulse+velocityImpulse;
+    normalImpulse = 0.f > normalImpulse ? 0.f: normalImpulse;
+
+	body1->applyImpulse(normal*(normalImpulse), rel_pos1);
+    if (body2)
+		body2->applyImpulse(-normal*(normalImpulse), rel_pos2);
+    
+    return normalImpulse;
+}
+
+
+//bilateral constraint between two dynamic objects
+void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1,
+                      btRigidBody& body2, const btVector3& pos2,
+                      btScalar distance, const btVector3& normal,btScalar& impulse ,btScalar timeStep)
+{
+	(void)timeStep;
+	(void)distance;
+
+
+	btScalar normalLenSqr = normal.length2();
+	btAssert(btFabs(normalLenSqr) < btScalar(1.1));
+	if (normalLenSqr > btScalar(1.1))
+	{
+		impulse = btScalar(0.);
+		return;
+	}
+	btVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition(); 
+	btVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition();
+	//this jacobian entry could be re-used for all iterations
+	
+	btVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1);
+	btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2);
+	btVector3 vel = vel1 - vel2;
+	
+
+	   btJacobianEntry jac(body1.getCenterOfMassTransform().getBasis().transpose(),
+		body2.getCenterOfMassTransform().getBasis().transpose(),
+		rel_pos1,rel_pos2,normal,body1.getInvInertiaDiagLocal(),body1.getInvMass(),
+		body2.getInvInertiaDiagLocal(),body2.getInvMass());
+
+	btScalar jacDiagAB = jac.getDiagonal();
+	btScalar jacDiagABInv = btScalar(1.) / jacDiagAB;
+	
+	  btScalar rel_vel = jac.getRelativeVelocity(
+		body1.getLinearVelocity(),
+		body1.getCenterOfMassTransform().getBasis().transpose() * body1.getAngularVelocity(),
+		body2.getLinearVelocity(),
+		body2.getCenterOfMassTransform().getBasis().transpose() * body2.getAngularVelocity()); 
+	btScalar a;
+	a=jacDiagABInv;
+
+
+	rel_vel = normal.dot(vel);
+	
+	//todo: move this into proper structure
+	btScalar contactDamping = btScalar(0.2);
+
+#ifdef ONLY_USE_LINEAR_MASS
+	btScalar massTerm = btScalar(1.) / (body1.getInvMass() + body2.getInvMass());
+	impulse = - contactDamping * rel_vel * massTerm;
+#else	
+	btScalar velocityImpulse = -contactDamping * rel_vel * jacDiagABInv;
+	impulse = velocityImpulse;
+#endif
+}
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h
new file mode 100644
index 0000000..477c79d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactConstraint.h
@@ -0,0 +1,71 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONTACT_CONSTRAINT_H
+#define BT_CONTACT_CONSTRAINT_H
+
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+#include "btTypedConstraint.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+
+///btContactConstraint can be automatically created to solve contact constraints using the unified btTypedConstraint interface
+ATTRIBUTE_ALIGNED16(class) btContactConstraint : public btTypedConstraint
+{
+protected:
+
+	btPersistentManifold m_contactManifold;
+
+public:
+
+
+	btContactConstraint(btPersistentManifold* contactManifold,btRigidBody& rbA,btRigidBody& rbB);
+
+	void	setContactManifold(btPersistentManifold* contactManifold);
+
+	btPersistentManifold* getContactManifold()
+	{
+		return &m_contactManifold;
+	}
+
+	const btPersistentManifold* getContactManifold() const
+	{
+		return &m_contactManifold;
+	}
+
+	virtual ~btContactConstraint();
+
+	virtual void getInfo1 (btConstraintInfo1* info);
+
+	virtual void getInfo2 (btConstraintInfo2* info);
+
+	///obsolete methods
+	virtual void	buildJacobian();
+
+
+};
+
+///very basic collision resolution without friction
+btScalar resolveSingleCollision(btRigidBody* body1, class btCollisionObject* colObj2, const btVector3& contactPositionWorld,const btVector3& contactNormalOnB, const struct btContactSolverInfo& solverInfo,btScalar distance);
+
+
+///resolveSingleBilateral is an obsolete methods used for vehicle friction between two dynamic objects
+void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1,
+                      btRigidBody& body2, const btVector3& pos2,
+                      btScalar distance, const btVector3& normal,btScalar& impulse ,btScalar timeStep);
+
+
+
+#endif //BT_CONTACT_CONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h
new file mode 100644
index 0000000..6204cb3
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h
@@ -0,0 +1,87 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONTACT_SOLVER_INFO
+#define BT_CONTACT_SOLVER_INFO
+
+enum	btSolverMode
+{
+	SOLVER_RANDMIZE_ORDER = 1,
+	SOLVER_FRICTION_SEPARATE = 2,
+	SOLVER_USE_WARMSTARTING = 4,
+	SOLVER_USE_FRICTION_WARMSTARTING = 8,
+	SOLVER_USE_2_FRICTION_DIRECTIONS = 16,
+	SOLVER_ENABLE_FRICTION_DIRECTION_CACHING = 32,
+	SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION = 64,
+	SOLVER_CACHE_FRIENDLY = 128,
+	SOLVER_SIMD = 256,	//enabled for Windows, the solver innerloop is branchless SIMD, 40% faster than FPU/scalar version
+	SOLVER_CUDA = 512	//will be open sourced during Game Developers Conference 2009. Much faster.
+};
+
+struct btContactSolverInfoData
+{
+	
+
+	btScalar	m_tau;
+	btScalar	m_damping;//global non-contact constraint damping, can be locally overridden by constraints during 'getInfo2'.
+	btScalar	m_friction;
+	btScalar	m_timeStep;
+	btScalar	m_restitution;
+	int		m_numIterations;
+	btScalar	m_maxErrorReduction;
+	btScalar	m_sor;
+	btScalar	m_erp;//used as Baumgarte factor
+	btScalar	m_erp2;//used in Split Impulse
+	btScalar	m_globalCfm;//constraint force mixing
+	int			m_splitImpulse;
+	btScalar	m_splitImpulsePenetrationThreshold;
+	btScalar	m_linearSlop;
+	btScalar	m_warmstartingFactor;
+
+	int			m_solverMode;
+	int	m_restingContactRestitutionThreshold;
+	int			m_minimumSolverBatchSize;
+
+
+};
+
+struct btContactSolverInfo : public btContactSolverInfoData
+{
+
+	
+
+	inline btContactSolverInfo()
+	{
+		m_tau = btScalar(0.6);
+		m_damping = btScalar(1.0);
+		m_friction = btScalar(0.3);
+		m_restitution = btScalar(0.);
+		m_maxErrorReduction = btScalar(20.);
+		m_numIterations = 10;
+		m_erp = btScalar(0.2);
+		m_erp2 = btScalar(0.1);
+		m_globalCfm = btScalar(0.);
+		m_sor = btScalar(1.);
+		m_splitImpulse = false;
+		m_splitImpulsePenetrationThreshold = -0.02f;
+		m_linearSlop = btScalar(0.0);
+		m_warmstartingFactor=btScalar(0.85);
+		m_solverMode = SOLVER_USE_WARMSTARTING | SOLVER_SIMD;// | SOLVER_RANDMIZE_ORDER;
+		m_restingContactRestitutionThreshold = 2;//resting contact lifetime threshold to disable restitution
+		m_minimumSolverBatchSize = 128; //try to combine islands until the amount of constraints reaches this limit
+	}
+};
+
+#endif //BT_CONTACT_SOLVER_INFO
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
new file mode 100644
index 0000000..7c5e4f6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
@@ -0,0 +1,1070 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+/*
+2007-09-09
+Refactored by Francisco Le?n
+email: projectileman at yahoo.com
+http://gimpact.sf.net
+*/
+
+#include "btGeneric6DofConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btTransformUtil.h"
+#include "LinearMath/btTransformUtil.h"
+#include <new>
+
+
+
+#define D6_USE_OBSOLETE_METHOD false
+#define D6_USE_FRAME_OFFSET true
+
+
+
+
+
+
+btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
+: btTypedConstraint(D6_CONSTRAINT_TYPE, rbA, rbB)
+, m_frameInA(frameInA)
+, m_frameInB(frameInB),
+m_useLinearReferenceFrameA(useLinearReferenceFrameA),
+m_useOffsetForConstraintFrame(D6_USE_FRAME_OFFSET),
+m_flags(0),
+m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD)
+{
+	calculateTransforms();
+}
+
+
+
+btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
+        : btTypedConstraint(D6_CONSTRAINT_TYPE, getFixedBody(), rbB),
+		m_frameInB(frameInB),
+		m_useLinearReferenceFrameA(useLinearReferenceFrameB),
+		m_useOffsetForConstraintFrame(D6_USE_FRAME_OFFSET),
+		m_flags(0),
+		m_useSolveConstraintObsolete(false)
+{
+	///not providing rigidbody A means implicitly using worldspace for body A
+	m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB;
+	calculateTransforms();
+}
+
+
+
+
+#define GENERIC_D6_DISABLE_WARMSTARTING 1
+
+
+
+btScalar btGetMatrixElem(const btMatrix3x3& mat, int index);
+btScalar btGetMatrixElem(const btMatrix3x3& mat, int index)
+{
+	int i = index%3;
+	int j = index/3;
+	return mat[i][j];
+}
+
+
+
+///MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3.inl.html
+bool	matrixToEulerXYZ(const btMatrix3x3& mat,btVector3& xyz);
+bool	matrixToEulerXYZ(const btMatrix3x3& mat,btVector3& xyz)
+{
+	//	// rot =  cy*cz          -cy*sz           sy
+	//	//        cz*sx*sy+cx*sz  cx*cz-sx*sy*sz -cy*sx
+	//	//       -cx*cz*sy+sx*sz  cz*sx+cx*sy*sz  cx*cy
+	//
+
+	btScalar fi = btGetMatrixElem(mat,2);
+	if (fi < btScalar(1.0f))
+	{
+		if (fi > btScalar(-1.0f))
+		{
+			xyz[0] = btAtan2(-btGetMatrixElem(mat,5),btGetMatrixElem(mat,8));
+			xyz[1] = btAsin(btGetMatrixElem(mat,2));
+			xyz[2] = btAtan2(-btGetMatrixElem(mat,1),btGetMatrixElem(mat,0));
+			return true;
+		}
+		else
+		{
+			// WARNING.  Not unique.  XA - ZA = -atan2(r10,r11)
+			xyz[0] = -btAtan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4));
+			xyz[1] = -SIMD_HALF_PI;
+			xyz[2] = btScalar(0.0);
+			return false;
+		}
+	}
+	else
+	{
+		// WARNING.  Not unique.  XAngle + ZAngle = atan2(r10,r11)
+		xyz[0] = btAtan2(btGetMatrixElem(mat,3),btGetMatrixElem(mat,4));
+		xyz[1] = SIMD_HALF_PI;
+		xyz[2] = 0.0;
+	}
+	return false;
+}
+
+//////////////////////////// btRotationalLimitMotor ////////////////////////////////////
+
+int btRotationalLimitMotor::testLimitValue(btScalar test_value)
+{
+	if(m_loLimit>m_hiLimit)
+	{
+		m_currentLimit = 0;//Free from violation
+		return 0;
+	}
+	if (test_value < m_loLimit)
+	{
+		m_currentLimit = 1;//low limit violation
+		m_currentLimitError =  test_value - m_loLimit;
+		return 1;
+	}
+	else if (test_value> m_hiLimit)
+	{
+		m_currentLimit = 2;//High limit violation
+		m_currentLimitError = test_value - m_hiLimit;
+		return 2;
+	};
+
+	m_currentLimit = 0;//Free from violation
+	return 0;
+
+}
+
+
+
+btScalar btRotationalLimitMotor::solveAngularLimits(
+	btScalar timeStep,btVector3& axis,btScalar jacDiagABInv,
+	btRigidBody * body0, btRigidBody * body1 )
+{
+	if (needApplyTorques()==false) return 0.0f;
+
+	btScalar target_velocity = m_targetVelocity;
+	btScalar maxMotorForce = m_maxMotorForce;
+
+	//current error correction
+	if (m_currentLimit!=0)
+	{
+		target_velocity = -m_stopERP*m_currentLimitError/(timeStep);
+		maxMotorForce = m_maxLimitForce;
+	}
+
+	maxMotorForce *= timeStep;
+
+	// current velocity difference
+
+	btVector3 angVelA;
+	body0->internalGetAngularVelocity(angVelA);
+	btVector3 angVelB;
+	body1->internalGetAngularVelocity(angVelB);
+
+	btVector3 vel_diff;
+	vel_diff = angVelA-angVelB;
+
+
+
+	btScalar rel_vel = axis.dot(vel_diff);
+
+	// correction velocity
+	btScalar motor_relvel = m_limitSoftness*(target_velocity  - m_damping*rel_vel);
+
+
+	if ( motor_relvel < SIMD_EPSILON && motor_relvel > -SIMD_EPSILON  )
+	{
+		return 0.0f;//no need for applying force
+	}
+
+
+	// correction impulse
+	btScalar unclippedMotorImpulse = (1+m_bounce)*motor_relvel*jacDiagABInv;
+
+	// clip correction impulse
+	btScalar clippedMotorImpulse;
+
+	///@todo: should clip against accumulated impulse
+	if (unclippedMotorImpulse>0.0f)
+	{
+		clippedMotorImpulse =  unclippedMotorImpulse > maxMotorForce? maxMotorForce: unclippedMotorImpulse;
+	}
+	else
+	{
+		clippedMotorImpulse =  unclippedMotorImpulse < -maxMotorForce ? -maxMotorForce: unclippedMotorImpulse;
+	}
+
+
+	// sort with accumulated impulses
+	btScalar	lo = btScalar(-BT_LARGE_FLOAT);
+	btScalar	hi = btScalar(BT_LARGE_FLOAT);
+
+	btScalar oldaccumImpulse = m_accumulatedImpulse;
+	btScalar sum = oldaccumImpulse + clippedMotorImpulse;
+	m_accumulatedImpulse = sum > hi ? btScalar(0.) : sum < lo ? btScalar(0.) : sum;
+
+	clippedMotorImpulse = m_accumulatedImpulse - oldaccumImpulse;
+
+	btVector3 motorImp = clippedMotorImpulse * axis;
+
+	//body0->applyTorqueImpulse(motorImp);
+	//body1->applyTorqueImpulse(-motorImp);
+
+	body0->internalApplyImpulse(btVector3(0,0,0), body0->getInvInertiaTensorWorld()*axis,clippedMotorImpulse);
+	body1->internalApplyImpulse(btVector3(0,0,0), body1->getInvInertiaTensorWorld()*axis,-clippedMotorImpulse);
+
+
+	return clippedMotorImpulse;
+
+
+}
+
+//////////////////////////// End btRotationalLimitMotor ////////////////////////////////////
+
+
+
+
+//////////////////////////// btTranslationalLimitMotor ////////////////////////////////////
+
+
+int btTranslationalLimitMotor::testLimitValue(int limitIndex, btScalar test_value)
+{
+	btScalar loLimit = m_lowerLimit[limitIndex];
+	btScalar hiLimit = m_upperLimit[limitIndex];
+	if(loLimit > hiLimit)
+	{
+		m_currentLimit[limitIndex] = 0;//Free from violation
+		m_currentLimitError[limitIndex] = btScalar(0.f);
+		return 0;
+	}
+
+	if (test_value < loLimit)
+	{
+		m_currentLimit[limitIndex] = 2;//low limit violation
+		m_currentLimitError[limitIndex] =  test_value - loLimit;
+		return 2;
+	}
+	else if (test_value> hiLimit)
+	{
+		m_currentLimit[limitIndex] = 1;//High limit violation
+		m_currentLimitError[limitIndex] = test_value - hiLimit;
+		return 1;
+	};
+
+	m_currentLimit[limitIndex] = 0;//Free from violation
+	m_currentLimitError[limitIndex] = btScalar(0.f);
+	return 0;
+}
+
+
+
+btScalar btTranslationalLimitMotor::solveLinearAxis(
+	btScalar timeStep,
+	btScalar jacDiagABInv,
+	btRigidBody& body1,const btVector3 &pointInA,
+	btRigidBody& body2,const btVector3 &pointInB,
+	int limit_index,
+	const btVector3 & axis_normal_on_a,
+	const btVector3 & anchorPos)
+{
+
+	///find relative velocity
+	//    btVector3 rel_pos1 = pointInA - body1.getCenterOfMassPosition();
+	//    btVector3 rel_pos2 = pointInB - body2.getCenterOfMassPosition();
+	btVector3 rel_pos1 = anchorPos - body1.getCenterOfMassPosition();
+	btVector3 rel_pos2 = anchorPos - body2.getCenterOfMassPosition();
+
+	btVector3 vel1;
+	body1.internalGetVelocityInLocalPointObsolete(rel_pos1,vel1);
+	btVector3 vel2;
+	body2.internalGetVelocityInLocalPointObsolete(rel_pos2,vel2);
+	btVector3 vel = vel1 - vel2;
+
+	btScalar rel_vel = axis_normal_on_a.dot(vel);
+
+
+
+	/// apply displacement correction
+
+	//positional error (zeroth order error)
+	btScalar depth = -(pointInA - pointInB).dot(axis_normal_on_a);
+	btScalar	lo = btScalar(-BT_LARGE_FLOAT);
+	btScalar	hi = btScalar(BT_LARGE_FLOAT);
+
+	btScalar minLimit = m_lowerLimit[limit_index];
+	btScalar maxLimit = m_upperLimit[limit_index];
+
+	//handle the limits
+	if (minLimit < maxLimit)
+	{
+		{
+			if (depth > maxLimit)
+			{
+				depth -= maxLimit;
+				lo = btScalar(0.);
+
+			}
+			else
+			{
+				if (depth < minLimit)
+				{
+					depth -= minLimit;
+					hi = btScalar(0.);
+				}
+				else
+				{
+					return 0.0f;
+				}
+			}
+		}
+	}
+
+	btScalar normalImpulse= m_limitSoftness*(m_restitution*depth/timeStep - m_damping*rel_vel) * jacDiagABInv;
+
+
+
+
+	btScalar oldNormalImpulse = m_accumulatedImpulse[limit_index];
+	btScalar sum = oldNormalImpulse + normalImpulse;
+	m_accumulatedImpulse[limit_index] = sum > hi ? btScalar(0.) : sum < lo ? btScalar(0.) : sum;
+	normalImpulse = m_accumulatedImpulse[limit_index] - oldNormalImpulse;
+
+	btVector3 impulse_vector = axis_normal_on_a * normalImpulse;
+	//body1.applyImpulse( impulse_vector, rel_pos1);
+	//body2.applyImpulse(-impulse_vector, rel_pos2);
+
+	btVector3 ftorqueAxis1 = rel_pos1.cross(axis_normal_on_a);
+	btVector3 ftorqueAxis2 = rel_pos2.cross(axis_normal_on_a);
+	body1.internalApplyImpulse(axis_normal_on_a*body1.getInvMass(), body1.getInvInertiaTensorWorld()*ftorqueAxis1,normalImpulse);
+	body2.internalApplyImpulse(axis_normal_on_a*body2.getInvMass(), body2.getInvInertiaTensorWorld()*ftorqueAxis2,-normalImpulse);
+
+
+
+
+	return normalImpulse;
+}
+
+//////////////////////////// btTranslationalLimitMotor ////////////////////////////////////
+
+void btGeneric6DofConstraint::calculateAngleInfo()
+{
+	btMatrix3x3 relative_frame = m_calculatedTransformA.getBasis().inverse()*m_calculatedTransformB.getBasis();
+	matrixToEulerXYZ(relative_frame,m_calculatedAxisAngleDiff);
+	// in euler angle mode we do not actually constrain the angular velocity
+	// along the axes axis[0] and axis[2] (although we do use axis[1]) :
+	//
+	//    to get			constrain w2-w1 along		...not
+	//    ------			---------------------		------
+	//    d(angle[0])/dt = 0	ax[1] x ax[2]			ax[0]
+	//    d(angle[1])/dt = 0	ax[1]
+	//    d(angle[2])/dt = 0	ax[0] x ax[1]			ax[2]
+	//
+	// constraining w2-w1 along an axis 'a' means that a'*(w2-w1)=0.
+	// to prove the result for angle[0], write the expression for angle[0] from
+	// GetInfo1 then take the derivative. to prove this for angle[2] it is
+	// easier to take the euler rate expression for d(angle[2])/dt with respect
+	// to the components of w and set that to 0.
+	btVector3 axis0 = m_calculatedTransformB.getBasis().getColumn(0);
+	btVector3 axis2 = m_calculatedTransformA.getBasis().getColumn(2);
+
+	m_calculatedAxis[1] = axis2.cross(axis0);
+	m_calculatedAxis[0] = m_calculatedAxis[1].cross(axis2);
+	m_calculatedAxis[2] = axis0.cross(m_calculatedAxis[1]);
+
+	m_calculatedAxis[0].normalize();
+	m_calculatedAxis[1].normalize();
+	m_calculatedAxis[2].normalize();
+
+}
+
+void btGeneric6DofConstraint::calculateTransforms()
+{
+	calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+}
+
+void btGeneric6DofConstraint::calculateTransforms(const btTransform& transA,const btTransform& transB)
+{
+	m_calculatedTransformA = transA * m_frameInA;
+	m_calculatedTransformB = transB * m_frameInB;
+	calculateLinearInfo();
+	calculateAngleInfo();
+	if(m_useOffsetForConstraintFrame)
+	{	//  get weight factors depending on masses
+		btScalar miA = getRigidBodyA().getInvMass();
+		btScalar miB = getRigidBodyB().getInvMass();
+		m_hasStaticBody = (miA < SIMD_EPSILON) || (miB < SIMD_EPSILON);
+		btScalar miS = miA + miB;
+		if(miS > btScalar(0.f))
+		{
+			m_factA = miB / miS;
+		}
+		else 
+		{
+			m_factA = btScalar(0.5f);
+		}
+		m_factB = btScalar(1.0f) - m_factA;
+	}
+}
+
+
+
+void btGeneric6DofConstraint::buildLinearJacobian(
+	btJacobianEntry & jacLinear,const btVector3 & normalWorld,
+	const btVector3 & pivotAInW,const btVector3 & pivotBInW)
+{
+	new (&jacLinear) btJacobianEntry(
+        m_rbA.getCenterOfMassTransform().getBasis().transpose(),
+        m_rbB.getCenterOfMassTransform().getBasis().transpose(),
+        pivotAInW - m_rbA.getCenterOfMassPosition(),
+        pivotBInW - m_rbB.getCenterOfMassPosition(),
+        normalWorld,
+        m_rbA.getInvInertiaDiagLocal(),
+        m_rbA.getInvMass(),
+        m_rbB.getInvInertiaDiagLocal(),
+        m_rbB.getInvMass());
+}
+
+
+
+void btGeneric6DofConstraint::buildAngularJacobian(
+	btJacobianEntry & jacAngular,const btVector3 & jointAxisW)
+{
+	 new (&jacAngular)	btJacobianEntry(jointAxisW,
+                                      m_rbA.getCenterOfMassTransform().getBasis().transpose(),
+                                      m_rbB.getCenterOfMassTransform().getBasis().transpose(),
+                                      m_rbA.getInvInertiaDiagLocal(),
+                                      m_rbB.getInvInertiaDiagLocal());
+
+}
+
+
+
+bool btGeneric6DofConstraint::testAngularLimitMotor(int axis_index)
+{
+	btScalar angle = m_calculatedAxisAngleDiff[axis_index];
+	angle = btAdjustAngleToLimits(angle, m_angularLimits[axis_index].m_loLimit, m_angularLimits[axis_index].m_hiLimit);
+	m_angularLimits[axis_index].m_currentPosition = angle;
+	//test limits
+	m_angularLimits[axis_index].testLimitValue(angle);
+	return m_angularLimits[axis_index].needApplyTorques();
+}
+
+
+
+void btGeneric6DofConstraint::buildJacobian()
+{
+#ifndef __SPU__
+	if (m_useSolveConstraintObsolete)
+	{
+
+		// Clear accumulated impulses for the next simulation step
+		m_linearLimits.m_accumulatedImpulse.setValue(btScalar(0.), btScalar(0.), btScalar(0.));
+		int i;
+		for(i = 0; i < 3; i++)
+		{
+			m_angularLimits[i].m_accumulatedImpulse = btScalar(0.);
+		}
+		//calculates transform
+		calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+
+		//  const btVector3& pivotAInW = m_calculatedTransformA.getOrigin();
+		//  const btVector3& pivotBInW = m_calculatedTransformB.getOrigin();
+		calcAnchorPos();
+		btVector3 pivotAInW = m_AnchorPos;
+		btVector3 pivotBInW = m_AnchorPos;
+
+		// not used here
+		//    btVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition();
+		//    btVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition();
+
+		btVector3 normalWorld;
+		//linear part
+		for (i=0;i<3;i++)
+		{
+			if (m_linearLimits.isLimited(i))
+			{
+				if (m_useLinearReferenceFrameA)
+					normalWorld = m_calculatedTransformA.getBasis().getColumn(i);
+				else
+					normalWorld = m_calculatedTransformB.getBasis().getColumn(i);
+
+				buildLinearJacobian(
+					m_jacLinear[i],normalWorld ,
+					pivotAInW,pivotBInW);
+
+			}
+		}
+
+		// angular part
+		for (i=0;i<3;i++)
+		{
+			//calculates error angle
+			if (testAngularLimitMotor(i))
+			{
+				normalWorld = this->getAxis(i);
+				// Create angular atom
+				buildAngularJacobian(m_jacAng[i],normalWorld);
+			}
+		}
+
+	}
+#endif //__SPU__
+
+}
+
+
+void btGeneric6DofConstraint::getInfo1 (btConstraintInfo1* info)
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		info->m_numConstraintRows = 0;
+		info->nub = 0;
+	} else
+	{
+		//prepare constraint
+		calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+		info->m_numConstraintRows = 0;
+		info->nub = 6;
+		int i;
+		//test linear limits
+		for(i = 0; i < 3; i++)
+		{
+			if(m_linearLimits.needApplyForce(i))
+			{
+				info->m_numConstraintRows++;
+				info->nub--;
+			}
+		}
+		//test angular limits
+		for (i=0;i<3 ;i++ )
+		{
+			if(testAngularLimitMotor(i))
+			{
+				info->m_numConstraintRows++;
+				info->nub--;
+			}
+		}
+	}
+}
+
+void btGeneric6DofConstraint::getInfo1NonVirtual (btConstraintInfo1* info)
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		info->m_numConstraintRows = 0;
+		info->nub = 0;
+	} else
+	{
+		//pre-allocate all 6
+		info->m_numConstraintRows = 6;
+		info->nub = 0;
+	}
+}
+
+
+void btGeneric6DofConstraint::getInfo2 (btConstraintInfo2* info)
+{
+	btAssert(!m_useSolveConstraintObsolete);
+
+	const btTransform& transA = m_rbA.getCenterOfMassTransform();
+	const btTransform& transB = m_rbB.getCenterOfMassTransform();
+	const btVector3& linVelA = m_rbA.getLinearVelocity();
+	const btVector3& linVelB = m_rbB.getLinearVelocity();
+	const btVector3& angVelA = m_rbA.getAngularVelocity();
+	const btVector3& angVelB = m_rbB.getAngularVelocity();
+
+	if(m_useOffsetForConstraintFrame)
+	{ // for stability better to solve angular limits first
+		int row = setAngularLimits(info, 0,transA,transB,linVelA,linVelB,angVelA,angVelB);
+		setLinearLimits(info, row, transA,transB,linVelA,linVelB,angVelA,angVelB);
+	}
+	else
+	{ // leave old version for compatibility
+		int row = setLinearLimits(info, 0, transA,transB,linVelA,linVelB,angVelA,angVelB);
+		setAngularLimits(info, row,transA,transB,linVelA,linVelB,angVelA,angVelB);
+	}
+
+}
+
+
+void btGeneric6DofConstraint::getInfo2NonVirtual (btConstraintInfo2* info, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB)
+{
+	
+	btAssert(!m_useSolveConstraintObsolete);
+	//prepare constraint
+	calculateTransforms(transA,transB);
+
+	int i;
+	for (i=0;i<3 ;i++ )
+	{
+		testAngularLimitMotor(i);
+	}
+
+	if(m_useOffsetForConstraintFrame)
+	{ // for stability better to solve angular limits first
+		int row = setAngularLimits(info, 0,transA,transB,linVelA,linVelB,angVelA,angVelB);
+		setLinearLimits(info, row, transA,transB,linVelA,linVelB,angVelA,angVelB);
+	}
+	else
+	{ // leave old version for compatibility
+		int row = setLinearLimits(info, 0, transA,transB,linVelA,linVelB,angVelA,angVelB);
+		setAngularLimits(info, row,transA,transB,linVelA,linVelB,angVelA,angVelB);
+	}
+}
+
+
+
+int btGeneric6DofConstraint::setLinearLimits(btConstraintInfo2* info, int row, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB)
+{
+//	int row = 0;
+	//solve linear limits
+	btRotationalLimitMotor limot;
+	for (int i=0;i<3 ;i++ )
+	{
+		if(m_linearLimits.needApplyForce(i))
+		{ // re-use rotational motor code
+			limot.m_bounce = btScalar(0.f);
+			limot.m_currentLimit = m_linearLimits.m_currentLimit[i];
+			limot.m_currentPosition = m_linearLimits.m_currentLinearDiff[i];
+			limot.m_currentLimitError  = m_linearLimits.m_currentLimitError[i];
+			limot.m_damping  = m_linearLimits.m_damping;
+			limot.m_enableMotor  = m_linearLimits.m_enableMotor[i];
+			limot.m_hiLimit  = m_linearLimits.m_upperLimit[i];
+			limot.m_limitSoftness  = m_linearLimits.m_limitSoftness;
+			limot.m_loLimit  = m_linearLimits.m_lowerLimit[i];
+			limot.m_maxLimitForce  = btScalar(0.f);
+			limot.m_maxMotorForce  = m_linearLimits.m_maxMotorForce[i];
+			limot.m_targetVelocity  = m_linearLimits.m_targetVelocity[i];
+			btVector3 axis = m_calculatedTransformA.getBasis().getColumn(i);
+			int flags = m_flags >> (i * BT_6DOF_FLAGS_AXIS_SHIFT);
+			limot.m_normalCFM	= (flags & BT_6DOF_FLAGS_CFM_NORM) ? m_linearLimits.m_normalCFM[i] : info->cfm[0];
+			limot.m_stopCFM		= (flags & BT_6DOF_FLAGS_CFM_STOP) ? m_linearLimits.m_stopCFM[i] : info->cfm[0];
+			limot.m_stopERP		= (flags & BT_6DOF_FLAGS_ERP_STOP) ? m_linearLimits.m_stopERP[i] : info->erp;
+			if(m_useOffsetForConstraintFrame)
+			{
+				int indx1 = (i + 1) % 3;
+				int indx2 = (i + 2) % 3;
+				int rotAllowed = 1; // rotations around orthos to current axis
+				if(m_angularLimits[indx1].m_currentLimit && m_angularLimits[indx2].m_currentLimit)
+				{
+					rotAllowed = 0;
+				}
+				row += get_limit_motor_info2(&limot, transA,transB,linVelA,linVelB,angVelA,angVelB, info, row, axis, 0, rotAllowed);
+			}
+			else
+			{
+				row += get_limit_motor_info2(&limot, transA,transB,linVelA,linVelB,angVelA,angVelB, info, row, axis, 0);
+			}
+		}
+	}
+	return row;
+}
+
+
+
+int btGeneric6DofConstraint::setAngularLimits(btConstraintInfo2 *info, int row_offset, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB)
+{
+	btGeneric6DofConstraint * d6constraint = this;
+	int row = row_offset;
+	//solve angular limits
+	for (int i=0;i<3 ;i++ )
+	{
+		if(d6constraint->getRotationalLimitMotor(i)->needApplyTorques())
+		{
+			btVector3 axis = d6constraint->getAxis(i);
+			int flags = m_flags >> ((i + 3) * BT_6DOF_FLAGS_AXIS_SHIFT);
+			if(!(flags & BT_6DOF_FLAGS_CFM_NORM))
+			{
+				m_angularLimits[i].m_normalCFM = info->cfm[0];
+			}
+			if(!(flags & BT_6DOF_FLAGS_CFM_STOP))
+			{
+				m_angularLimits[i].m_stopCFM = info->cfm[0];
+			}
+			if(!(flags & BT_6DOF_FLAGS_ERP_STOP))
+			{
+				m_angularLimits[i].m_stopERP = info->erp;
+			}
+			row += get_limit_motor_info2(d6constraint->getRotationalLimitMotor(i),
+												transA,transB,linVelA,linVelB,angVelA,angVelB, info,row,axis,1);
+		}
+	}
+
+	return row;
+}
+
+
+
+
+void	btGeneric6DofConstraint::updateRHS(btScalar	timeStep)
+{
+	(void)timeStep;
+
+}
+
+
+void btGeneric6DofConstraint::setFrames(const btTransform& frameA, const btTransform& frameB)
+{
+	m_frameInA = frameA;
+	m_frameInB = frameB;
+	buildJacobian();
+	calculateTransforms();
+}
+
+
+
+btVector3 btGeneric6DofConstraint::getAxis(int axis_index) const
+{
+	return m_calculatedAxis[axis_index];
+}
+
+
+btScalar	btGeneric6DofConstraint::getRelativePivotPosition(int axisIndex) const
+{
+	return m_calculatedLinearDiff[axisIndex];
+}
+
+
+btScalar btGeneric6DofConstraint::getAngle(int axisIndex) const
+{
+	return m_calculatedAxisAngleDiff[axisIndex];
+}
+
+
+
+void btGeneric6DofConstraint::calcAnchorPos(void)
+{
+	btScalar imA = m_rbA.getInvMass();
+	btScalar imB = m_rbB.getInvMass();
+	btScalar weight;
+	if(imB == btScalar(0.0))
+	{
+		weight = btScalar(1.0);
+	}
+	else
+	{
+		weight = imA / (imA + imB);
+	}
+	const btVector3& pA = m_calculatedTransformA.getOrigin();
+	const btVector3& pB = m_calculatedTransformB.getOrigin();
+	m_AnchorPos = pA * weight + pB * (btScalar(1.0) - weight);
+	return;
+}
+
+
+
+void btGeneric6DofConstraint::calculateLinearInfo()
+{
+	m_calculatedLinearDiff = m_calculatedTransformB.getOrigin() - m_calculatedTransformA.getOrigin();
+	m_calculatedLinearDiff = m_calculatedTransformA.getBasis().inverse() * m_calculatedLinearDiff;
+	for(int i = 0; i < 3; i++)
+	{
+		m_linearLimits.m_currentLinearDiff[i] = m_calculatedLinearDiff[i];
+		m_linearLimits.testLimitValue(i, m_calculatedLinearDiff[i]);
+	}
+}
+
+
+
+int btGeneric6DofConstraint::get_limit_motor_info2(
+	btRotationalLimitMotor * limot,
+	const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB,
+	btConstraintInfo2 *info, int row, btVector3& ax1, int rotational,int rotAllowed)
+{
+    int srow = row * info->rowskip;
+    int powered = limot->m_enableMotor;
+    int limit = limot->m_currentLimit;
+    if (powered || limit)
+    {   // if the joint is powered, or has joint limits, add in the extra row
+        btScalar *J1 = rotational ? info->m_J1angularAxis : info->m_J1linearAxis;
+        btScalar *J2 = rotational ? info->m_J2angularAxis : 0;
+        J1[srow+0] = ax1[0];
+        J1[srow+1] = ax1[1];
+        J1[srow+2] = ax1[2];
+        if(rotational)
+        {
+            J2[srow+0] = -ax1[0];
+            J2[srow+1] = -ax1[1];
+            J2[srow+2] = -ax1[2];
+        }
+        if((!rotational))
+        {
+			if (m_useOffsetForConstraintFrame)
+			{
+				btVector3 tmpA, tmpB, relA, relB;
+				// get vector from bodyB to frameB in WCS
+				relB = m_calculatedTransformB.getOrigin() - transB.getOrigin();
+				// get its projection to constraint axis
+				btVector3 projB = ax1 * relB.dot(ax1);
+				// get vector directed from bodyB to constraint axis (and orthogonal to it)
+				btVector3 orthoB = relB - projB;
+				// same for bodyA
+				relA = m_calculatedTransformA.getOrigin() - transA.getOrigin();
+				btVector3 projA = ax1 * relA.dot(ax1);
+				btVector3 orthoA = relA - projA;
+				// get desired offset between frames A and B along constraint axis
+				btScalar desiredOffs = limot->m_currentPosition - limot->m_currentLimitError;
+				// desired vector from projection of center of bodyA to projection of center of bodyB to constraint axis
+				btVector3 totalDist = projA + ax1 * desiredOffs - projB;
+				// get offset vectors relA and relB
+				relA = orthoA + totalDist * m_factA;
+				relB = orthoB - totalDist * m_factB;
+				tmpA = relA.cross(ax1);
+				tmpB = relB.cross(ax1);
+				if(m_hasStaticBody && (!rotAllowed))
+				{
+					tmpA *= m_factA;
+					tmpB *= m_factB;
+				}
+				int i;
+				for (i=0; i<3; i++) info->m_J1angularAxis[srow+i] = tmpA[i];
+				for (i=0; i<3; i++) info->m_J2angularAxis[srow+i] = -tmpB[i];
+			} else
+			{
+				btVector3 ltd;	// Linear Torque Decoupling vector
+				btVector3 c = m_calculatedTransformB.getOrigin() - transA.getOrigin();
+				ltd = c.cross(ax1);
+				info->m_J1angularAxis[srow+0] = ltd[0];
+				info->m_J1angularAxis[srow+1] = ltd[1];
+				info->m_J1angularAxis[srow+2] = ltd[2];
+
+				c = m_calculatedTransformB.getOrigin() - transB.getOrigin();
+				ltd = -c.cross(ax1);
+				info->m_J2angularAxis[srow+0] = ltd[0];
+				info->m_J2angularAxis[srow+1] = ltd[1];
+				info->m_J2angularAxis[srow+2] = ltd[2];
+			}
+        }
+        // if we're limited low and high simultaneously, the joint motor is
+        // ineffective
+        if (limit && (limot->m_loLimit == limot->m_hiLimit)) powered = 0;
+        info->m_constraintError[srow] = btScalar(0.f);
+        if (powered)
+        {
+			info->cfm[srow] = limot->m_normalCFM;
+            if(!limit)
+            {
+				btScalar tag_vel = rotational ? limot->m_targetVelocity : -limot->m_targetVelocity;
+
+				btScalar mot_fact = getMotorFactor(	limot->m_currentPosition, 
+													limot->m_loLimit,
+													limot->m_hiLimit, 
+													tag_vel, 
+													info->fps * limot->m_stopERP);
+				info->m_constraintError[srow] += mot_fact * limot->m_targetVelocity;
+                info->m_lowerLimit[srow] = -limot->m_maxMotorForce;
+                info->m_upperLimit[srow] = limot->m_maxMotorForce;
+            }
+        }
+        if(limit)
+        {
+            btScalar k = info->fps * limot->m_stopERP;
+			if(!rotational)
+			{
+				info->m_constraintError[srow] += k * limot->m_currentLimitError;
+			}
+			else
+			{
+				info->m_constraintError[srow] += -k * limot->m_currentLimitError;
+			}
+			info->cfm[srow] = limot->m_stopCFM;
+            if (limot->m_loLimit == limot->m_hiLimit)
+            {   // limited low and high simultaneously
+                info->m_lowerLimit[srow] = -SIMD_INFINITY;
+                info->m_upperLimit[srow] = SIMD_INFINITY;
+            }
+            else
+            {
+                if (limit == 1)
+                {
+                    info->m_lowerLimit[srow] = 0;
+                    info->m_upperLimit[srow] = SIMD_INFINITY;
+                }
+                else
+                {
+                    info->m_lowerLimit[srow] = -SIMD_INFINITY;
+                    info->m_upperLimit[srow] = 0;
+                }
+                // deal with bounce
+                if (limot->m_bounce > 0)
+                {
+                    // calculate joint velocity
+                    btScalar vel;
+                    if (rotational)
+                    {
+                        vel = angVelA.dot(ax1);
+//make sure that if no body -> angVelB == zero vec
+//                        if (body1)
+                            vel -= angVelB.dot(ax1);
+                    }
+                    else
+                    {
+                        vel = linVelA.dot(ax1);
+//make sure that if no body -> angVelB == zero vec
+//                        if (body1)
+                            vel -= linVelB.dot(ax1);
+                    }
+                    // only apply bounce if the velocity is incoming, and if the
+                    // resulting c[] exceeds what we already have.
+                    if (limit == 1)
+                    {
+                        if (vel < 0)
+                        {
+                            btScalar newc = -limot->m_bounce* vel;
+                            if (newc > info->m_constraintError[srow]) 
+								info->m_constraintError[srow] = newc;
+                        }
+                    }
+                    else
+                    {
+                        if (vel > 0)
+                        {
+                            btScalar newc = -limot->m_bounce * vel;
+                            if (newc < info->m_constraintError[srow]) 
+								info->m_constraintError[srow] = newc;
+                        }
+                    }
+                }
+            }
+        }
+        return 1;
+    }
+    else return 0;
+}
+
+
+
+
+
+
+	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+	///If no axis is provided, it uses the default axis for this constraint.
+void btGeneric6DofConstraint::setParam(int num, btScalar value, int axis)
+{
+	if((axis >= 0) && (axis < 3))
+	{
+		switch(num)
+		{
+			case BT_CONSTRAINT_STOP_ERP : 
+				m_linearLimits.m_stopERP[axis] = value;
+				m_flags |= BT_6DOF_FLAGS_ERP_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
+				break;
+			case BT_CONSTRAINT_STOP_CFM : 
+				m_linearLimits.m_stopCFM[axis] = value;
+				m_flags |= BT_6DOF_FLAGS_CFM_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
+				break;
+			case BT_CONSTRAINT_CFM : 
+				m_linearLimits.m_normalCFM[axis] = value;
+				m_flags |= BT_6DOF_FLAGS_CFM_NORM << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
+				break;
+			default : 
+				btAssertConstrParams(0);
+		}
+	}
+	else if((axis >=3) && (axis < 6))
+	{
+		switch(num)
+		{
+			case BT_CONSTRAINT_STOP_ERP : 
+				m_angularLimits[axis - 3].m_stopERP = value;
+				m_flags |= BT_6DOF_FLAGS_ERP_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
+				break;
+			case BT_CONSTRAINT_STOP_CFM : 
+				m_angularLimits[axis - 3].m_stopCFM = value;
+				m_flags |= BT_6DOF_FLAGS_CFM_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
+				break;
+			case BT_CONSTRAINT_CFM : 
+				m_angularLimits[axis - 3].m_normalCFM = value;
+				m_flags |= BT_6DOF_FLAGS_CFM_NORM << (axis * BT_6DOF_FLAGS_AXIS_SHIFT);
+				break;
+			default : 
+				btAssertConstrParams(0);
+		}
+	}
+	else
+	{
+		btAssertConstrParams(0);
+	}
+}
+
+	///return the local value of parameter
+btScalar btGeneric6DofConstraint::getParam(int num, int axis) const 
+{
+	btScalar retVal = 0;
+	if((axis >= 0) && (axis < 3))
+	{
+		switch(num)
+		{
+			case BT_CONSTRAINT_STOP_ERP : 
+				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_ERP_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
+				retVal = m_linearLimits.m_stopERP[axis];
+				break;
+			case BT_CONSTRAINT_STOP_CFM : 
+				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_CFM_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
+				retVal = m_linearLimits.m_stopCFM[axis];
+				break;
+			case BT_CONSTRAINT_CFM : 
+				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_CFM_NORM << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
+				retVal = m_linearLimits.m_normalCFM[axis];
+				break;
+			default : 
+				btAssertConstrParams(0);
+		}
+	}
+	else if((axis >=3) && (axis < 6))
+	{
+		switch(num)
+		{
+			case BT_CONSTRAINT_STOP_ERP : 
+				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_ERP_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
+				retVal = m_angularLimits[axis - 3].m_stopERP;
+				break;
+			case BT_CONSTRAINT_STOP_CFM : 
+				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_CFM_STOP << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
+				retVal = m_angularLimits[axis - 3].m_stopCFM;
+				break;
+			case BT_CONSTRAINT_CFM : 
+				btAssertConstrParams(m_flags & (BT_6DOF_FLAGS_CFM_NORM << (axis * BT_6DOF_FLAGS_AXIS_SHIFT)));
+				retVal = m_angularLimits[axis - 3].m_normalCFM;
+				break;
+			default : 
+				btAssertConstrParams(0);
+		}
+	}
+	else
+	{
+		btAssertConstrParams(0);
+	}
+	return retVal;
+}
+
+ 
+
+void btGeneric6DofConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
+{
+	btVector3 zAxis = axis1.normalized();
+	btVector3 yAxis = axis2.normalized();
+	btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
+	
+	btTransform frameInW;
+	frameInW.setIdentity();
+	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
+	                                xAxis[1], yAxis[1], zAxis[1],
+	                               xAxis[2], yAxis[2], zAxis[2]);
+	
+	// now get constraint frame in local coordinate systems
+	m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
+	m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
+	
+	calculateTransforms();
+}
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
new file mode 100644
index 0000000..b441081
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
@@ -0,0 +1,614 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/// 2009 March: btGeneric6DofConstraint refactored by Roman Ponomarev
+/// Added support for generic constraint solver through getInfo1/getInfo2 methods
+
+/*
+2007-09-09
+btGeneric6DofConstraint Refactored by Francisco Le?n
+email: projectileman at yahoo.com
+http://gimpact.sf.net
+*/
+
+
+#ifndef BT_GENERIC_6DOF_CONSTRAINT_H
+#define BT_GENERIC_6DOF_CONSTRAINT_H
+
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+#include "btTypedConstraint.h"
+
+class btRigidBody;
+
+
+
+
+//! Rotation Limit structure for generic joints
+class btRotationalLimitMotor
+{
+public:
+    //! limit_parameters
+    //!@{
+    btScalar m_loLimit;//!< joint limit
+    btScalar m_hiLimit;//!< joint limit
+    btScalar m_targetVelocity;//!< target motor velocity
+    btScalar m_maxMotorForce;//!< max force on motor
+    btScalar m_maxLimitForce;//!< max force on limit
+    btScalar m_damping;//!< Damping.
+    btScalar m_limitSoftness;//! Relaxation factor
+    btScalar m_normalCFM;//!< Constraint force mixing factor
+    btScalar m_stopERP;//!< Error tolerance factor when joint is at limit
+    btScalar m_stopCFM;//!< Constraint force mixing factor when joint is at limit
+    btScalar m_bounce;//!< restitution factor
+    bool m_enableMotor;
+
+    //!@}
+
+    //! temp_variables
+    //!@{
+    btScalar m_currentLimitError;//!  How much is violated this limit
+    btScalar m_currentPosition;     //!  current value of angle 
+    int m_currentLimit;//!< 0=free, 1=at lo limit, 2=at hi limit
+    btScalar m_accumulatedImpulse;
+    //!@}
+
+    btRotationalLimitMotor()
+    {
+    	m_accumulatedImpulse = 0.f;
+        m_targetVelocity = 0;
+        m_maxMotorForce = 0.1f;
+        m_maxLimitForce = 300.0f;
+        m_loLimit = 1.0f;
+        m_hiLimit = -1.0f;
+		m_normalCFM = 0.f;
+		m_stopERP = 0.2f;
+		m_stopCFM = 0.f;
+        m_bounce = 0.0f;
+        m_damping = 1.0f;
+        m_limitSoftness = 0.5f;
+        m_currentLimit = 0;
+        m_currentLimitError = 0;
+        m_enableMotor = false;
+    }
+
+    btRotationalLimitMotor(const btRotationalLimitMotor & limot)
+    {
+        m_targetVelocity = limot.m_targetVelocity;
+        m_maxMotorForce = limot.m_maxMotorForce;
+        m_limitSoftness = limot.m_limitSoftness;
+        m_loLimit = limot.m_loLimit;
+        m_hiLimit = limot.m_hiLimit;
+		m_normalCFM = limot.m_normalCFM;
+		m_stopERP = limot.m_stopERP;
+		m_stopCFM =	limot.m_stopCFM;
+        m_bounce = limot.m_bounce;
+        m_currentLimit = limot.m_currentLimit;
+        m_currentLimitError = limot.m_currentLimitError;
+        m_enableMotor = limot.m_enableMotor;
+    }
+
+
+
+	//! Is limited
+    bool isLimited()
+    {
+    	if(m_loLimit > m_hiLimit) return false;
+    	return true;
+    }
+
+	//! Need apply correction
+    bool needApplyTorques()
+    {
+    	if(m_currentLimit == 0 && m_enableMotor == false) return false;
+    	return true;
+    }
+
+	//! calculates  error
+	/*!
+	calculates m_currentLimit and m_currentLimitError.
+	*/
+	int testLimitValue(btScalar test_value);
+
+	//! apply the correction impulses for two bodies
+    btScalar solveAngularLimits(btScalar timeStep,btVector3& axis, btScalar jacDiagABInv,btRigidBody * body0, btRigidBody * body1);
+
+};
+
+
+
+class btTranslationalLimitMotor
+{
+public:
+	btVector3 m_lowerLimit;//!< the constraint lower limits
+    btVector3 m_upperLimit;//!< the constraint upper limits
+    btVector3 m_accumulatedImpulse;
+    //! Linear_Limit_parameters
+    //!@{
+    btScalar	m_limitSoftness;//!< Softness for linear limit
+    btScalar	m_damping;//!< Damping for linear limit
+    btScalar	m_restitution;//! Bounce parameter for linear limit
+	btVector3	m_normalCFM;//!< Constraint force mixing factor
+    btVector3	m_stopERP;//!< Error tolerance factor when joint is at limit
+	btVector3	m_stopCFM;//!< Constraint force mixing factor when joint is at limit
+    //!@}
+	bool		m_enableMotor[3];
+    btVector3	m_targetVelocity;//!< target motor velocity
+    btVector3	m_maxMotorForce;//!< max force on motor
+    btVector3	m_currentLimitError;//!  How much is violated this limit
+    btVector3	m_currentLinearDiff;//!  Current relative offset of constraint frames
+    int			m_currentLimit[3];//!< 0=free, 1=at lower limit, 2=at upper limit
+
+    btTranslationalLimitMotor()
+    {
+    	m_lowerLimit.setValue(0.f,0.f,0.f);
+    	m_upperLimit.setValue(0.f,0.f,0.f);
+    	m_accumulatedImpulse.setValue(0.f,0.f,0.f);
+		m_normalCFM.setValue(0.f, 0.f, 0.f);
+		m_stopERP.setValue(0.2f, 0.2f, 0.2f);
+		m_stopCFM.setValue(0.f, 0.f, 0.f);
+
+    	m_limitSoftness = 0.7f;
+    	m_damping = btScalar(1.0f);
+    	m_restitution = btScalar(0.5f);
+		for(int i=0; i < 3; i++) 
+		{
+			m_enableMotor[i] = false;
+			m_targetVelocity[i] = btScalar(0.f);
+			m_maxMotorForce[i] = btScalar(0.f);
+		}
+    }
+
+    btTranslationalLimitMotor(const btTranslationalLimitMotor & other )
+    {
+    	m_lowerLimit = other.m_lowerLimit;
+    	m_upperLimit = other.m_upperLimit;
+    	m_accumulatedImpulse = other.m_accumulatedImpulse;
+
+    	m_limitSoftness = other.m_limitSoftness ;
+    	m_damping = other.m_damping;
+    	m_restitution = other.m_restitution;
+		m_normalCFM = other.m_normalCFM;
+		m_stopERP = other.m_stopERP;
+		m_stopCFM = other.m_stopCFM;
+
+		for(int i=0; i < 3; i++) 
+		{
+			m_enableMotor[i] = other.m_enableMotor[i];
+			m_targetVelocity[i] = other.m_targetVelocity[i];
+			m_maxMotorForce[i] = other.m_maxMotorForce[i];
+		}
+    }
+
+    //! Test limit
+	/*!
+    - free means upper < lower,
+    - locked means upper == lower
+    - limited means upper > lower
+    - limitIndex: first 3 are linear, next 3 are angular
+    */
+    inline bool	isLimited(int limitIndex)
+    {
+       return (m_upperLimit[limitIndex] >= m_lowerLimit[limitIndex]);
+    }
+    inline bool needApplyForce(int limitIndex)
+    {
+    	if(m_currentLimit[limitIndex] == 0 && m_enableMotor[limitIndex] == false) return false;
+    	return true;
+    }
+	int testLimitValue(int limitIndex, btScalar test_value);
+
+
+    btScalar solveLinearAxis(
+    	btScalar timeStep,
+        btScalar jacDiagABInv,
+        btRigidBody& body1,const btVector3 &pointInA,
+        btRigidBody& body2,const btVector3 &pointInB,
+        int limit_index,
+        const btVector3 & axis_normal_on_a,
+		const btVector3 & anchorPos);
+
+
+};
+
+enum bt6DofFlags
+{
+	BT_6DOF_FLAGS_CFM_NORM = 1,
+	BT_6DOF_FLAGS_CFM_STOP = 2,
+	BT_6DOF_FLAGS_ERP_STOP = 4
+};
+#define BT_6DOF_FLAGS_AXIS_SHIFT 3 // bits per axis
+
+
+/// btGeneric6DofConstraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space
+/*!
+btGeneric6DofConstraint can leave any of the 6 degree of freedom 'free' or 'locked'.
+currently this limit supports rotational motors<br>
+<ul>
+<li> For Linear limits, use btGeneric6DofConstraint.setLinearUpperLimit, btGeneric6DofConstraint.setLinearLowerLimit. You can set the parameters with the btTranslationalLimitMotor structure accsesible through the btGeneric6DofConstraint.getTranslationalLimitMotor method.
+At this moment translational motors are not supported. May be in the future. </li>
+
+<li> For Angular limits, use the btRotationalLimitMotor structure for configuring the limit.
+This is accessible through btGeneric6DofConstraint.getLimitMotor method,
+This brings support for limit parameters and motors. </li>
+
+<li> Angulars limits have these possible ranges:
+<table border=1 >
+<tr>
+	<td><b>AXIS</b></td>
+	<td><b>MIN ANGLE</b></td>
+	<td><b>MAX ANGLE</b></td>
+</tr><tr>
+	<td>X</td>
+	<td>-PI</td>
+	<td>PI</td>
+</tr><tr>
+	<td>Y</td>
+	<td>-PI/2</td>
+	<td>PI/2</td>
+</tr><tr>
+	<td>Z</td>
+	<td>-PI</td>
+	<td>PI</td>
+</tr>
+</table>
+</li>
+</ul>
+
+*/
+class btGeneric6DofConstraint : public btTypedConstraint
+{
+protected:
+
+	//! relative_frames
+    //!@{
+	btTransform	m_frameInA;//!< the constraint space w.r.t body A
+    btTransform	m_frameInB;//!< the constraint space w.r.t body B
+    //!@}
+
+    //! Jacobians
+    //!@{
+    btJacobianEntry	m_jacLinear[3];//!< 3 orthogonal linear constraints
+    btJacobianEntry	m_jacAng[3];//!< 3 orthogonal angular constraints
+    //!@}
+
+	//! Linear_Limit_parameters
+    //!@{
+    btTranslationalLimitMotor m_linearLimits;
+    //!@}
+
+
+    //! hinge_parameters
+    //!@{
+    btRotationalLimitMotor m_angularLimits[3];
+	//!@}
+
+
+protected:
+    //! temporal variables
+    //!@{
+    btScalar m_timeStep;
+    btTransform m_calculatedTransformA;
+    btTransform m_calculatedTransformB;
+    btVector3 m_calculatedAxisAngleDiff;
+    btVector3 m_calculatedAxis[3];
+    btVector3 m_calculatedLinearDiff;
+	btScalar	m_factA;
+	btScalar	m_factB;
+	bool		m_hasStaticBody;
+    
+	btVector3 m_AnchorPos; // point betwen pivots of bodies A and B to solve linear axes
+
+    bool	m_useLinearReferenceFrameA;
+	bool	m_useOffsetForConstraintFrame;
+    
+	int		m_flags;
+
+    //!@}
+
+    btGeneric6DofConstraint&	operator=(btGeneric6DofConstraint&	other)
+    {
+        btAssert(0);
+        (void) other;
+        return *this;
+    }
+
+
+	int setAngularLimits(btConstraintInfo2 *info, int row_offset,const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB);
+
+	int setLinearLimits(btConstraintInfo2 *info, int row, const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB);
+
+    void buildLinearJacobian(
+        btJacobianEntry & jacLinear,const btVector3 & normalWorld,
+        const btVector3 & pivotAInW,const btVector3 & pivotBInW);
+
+    void buildAngularJacobian(btJacobianEntry & jacAngular,const btVector3 & jointAxisW);
+
+	// tests linear limits
+	void calculateLinearInfo();
+
+	//! calcs the euler angles between the two bodies.
+    void calculateAngleInfo();
+
+
+
+public:
+
+	///for backwards compatibility during the transition to 'getInfo/getInfo2'
+	bool		m_useSolveConstraintObsolete;
+
+    btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
+    btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
+    
+	//! Calcs global transform of the offsets
+	/*!
+	Calcs the global transform for the joint offset for body A an B, and also calcs the agle differences between the bodies.
+	\sa btGeneric6DofConstraint.getCalculatedTransformA , btGeneric6DofConstraint.getCalculatedTransformB, btGeneric6DofConstraint.calculateAngleInfo
+	*/
+    void calculateTransforms(const btTransform& transA,const btTransform& transB);
+
+	void calculateTransforms();
+
+	//! Gets the global transform of the offset for body A
+    /*!
+    \sa btGeneric6DofConstraint.getFrameOffsetA, btGeneric6DofConstraint.getFrameOffsetB, btGeneric6DofConstraint.calculateAngleInfo.
+    */
+    const btTransform & getCalculatedTransformA() const
+    {
+    	return m_calculatedTransformA;
+    }
+
+    //! Gets the global transform of the offset for body B
+    /*!
+    \sa btGeneric6DofConstraint.getFrameOffsetA, btGeneric6DofConstraint.getFrameOffsetB, btGeneric6DofConstraint.calculateAngleInfo.
+    */
+    const btTransform & getCalculatedTransformB() const
+    {
+    	return m_calculatedTransformB;
+    }
+
+    const btTransform & getFrameOffsetA() const
+    {
+    	return m_frameInA;
+    }
+
+    const btTransform & getFrameOffsetB() const
+    {
+    	return m_frameInB;
+    }
+
+
+    btTransform & getFrameOffsetA()
+    {
+    	return m_frameInA;
+    }
+
+    btTransform & getFrameOffsetB()
+    {
+    	return m_frameInB;
+    }
+
+
+	//! performs Jacobian calculation, and also calculates angle differences and axis
+    virtual void	buildJacobian();
+
+	virtual void getInfo1 (btConstraintInfo1* info);
+
+	void getInfo1NonVirtual (btConstraintInfo1* info);
+
+	virtual void getInfo2 (btConstraintInfo2* info);
+
+	void getInfo2NonVirtual (btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB);
+
+
+    void	updateRHS(btScalar	timeStep);
+
+	//! Get the rotation axis in global coordinates
+	/*!
+	\pre btGeneric6DofConstraint.buildJacobian must be called previously.
+	*/
+    btVector3 getAxis(int axis_index) const;
+
+    //! Get the relative Euler angle
+    /*!
+	\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
+	*/
+    btScalar getAngle(int axis_index) const;
+
+	//! Get the relative position of the constraint pivot
+    /*!
+	\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
+	*/
+	btScalar getRelativePivotPosition(int axis_index) const;
+
+	void setFrames(const btTransform & frameA, const btTransform & frameB);
+
+	//! Test angular limit.
+	/*!
+	Calculates angular correction and returns true if limit needs to be corrected.
+	\pre btGeneric6DofConstraint::calculateTransforms() must be called previously.
+	*/
+    bool testAngularLimitMotor(int axis_index);
+
+    void	setLinearLowerLimit(const btVector3& linearLower)
+    {
+    	m_linearLimits.m_lowerLimit = linearLower;
+    }
+
+	void	getLinearLowerLimit(btVector3& linearLower)
+	{
+		linearLower = m_linearLimits.m_lowerLimit;
+	}
+
+	void	setLinearUpperLimit(const btVector3& linearUpper)
+	{
+		m_linearLimits.m_upperLimit = linearUpper;
+	}
+
+	void	getLinearUpperLimit(btVector3& linearUpper)
+	{
+		linearUpper = m_linearLimits.m_upperLimit;
+	}
+
+    void	setAngularLowerLimit(const btVector3& angularLower)
+    {
+		for(int i = 0; i < 3; i++) 
+			m_angularLimits[i].m_loLimit = btNormalizeAngle(angularLower[i]);
+    }
+
+	void	getAngularLowerLimit(btVector3& angularLower)
+	{
+		for(int i = 0; i < 3; i++) 
+			angularLower[i] = m_angularLimits[i].m_loLimit;
+	}
+
+    void	setAngularUpperLimit(const btVector3& angularUpper)
+    {
+		for(int i = 0; i < 3; i++)
+			m_angularLimits[i].m_hiLimit = btNormalizeAngle(angularUpper[i]);
+    }
+
+	void	getAngularUpperLimit(btVector3& angularUpper)
+	{
+		for(int i = 0; i < 3; i++)
+			angularUpper[i] = m_angularLimits[i].m_hiLimit;
+	}
+
+	//! Retrieves the angular limit informacion
+    btRotationalLimitMotor * getRotationalLimitMotor(int index)
+    {
+    	return &m_angularLimits[index];
+    }
+
+    //! Retrieves the  limit informacion
+    btTranslationalLimitMotor * getTranslationalLimitMotor()
+    {
+    	return &m_linearLimits;
+    }
+
+    //first 3 are linear, next 3 are angular
+    void setLimit(int axis, btScalar lo, btScalar hi)
+    {
+    	if(axis<3)
+    	{
+    		m_linearLimits.m_lowerLimit[axis] = lo;
+    		m_linearLimits.m_upperLimit[axis] = hi;
+    	}
+    	else
+    	{
+			lo = btNormalizeAngle(lo);
+			hi = btNormalizeAngle(hi);
+    		m_angularLimits[axis-3].m_loLimit = lo;
+    		m_angularLimits[axis-3].m_hiLimit = hi;
+    	}
+    }
+
+	//! Test limit
+	/*!
+    - free means upper < lower,
+    - locked means upper == lower
+    - limited means upper > lower
+    - limitIndex: first 3 are linear, next 3 are angular
+    */
+    bool	isLimited(int limitIndex)
+    {
+    	if(limitIndex<3)
+    	{
+			return m_linearLimits.isLimited(limitIndex);
+
+    	}
+        return m_angularLimits[limitIndex-3].isLimited();
+    }
+
+	virtual void calcAnchorPos(void); // overridable
+
+	int get_limit_motor_info2(	btRotationalLimitMotor * limot,
+								const btTransform& transA,const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB,const btVector3& angVelA,const btVector3& angVelB,
+								btConstraintInfo2 *info, int row, btVector3& ax1, int rotational, int rotAllowed = false);
+
+	// access for UseFrameOffset
+	bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
+	void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
+
+	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+	///If no axis is provided, it uses the default axis for this constraint.
+	virtual	void setParam(int num, btScalar value, int axis = -1);
+	///return the local value of parameter
+	virtual	btScalar getParam(int num, int axis = -1) const;
+
+	void setAxis( const btVector3& axis1, const btVector3& axis2);
+
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+	
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct btGeneric6DofConstraintData
+{
+	btTypedConstraintData	m_typeConstraintData;
+	btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
+	btTransformFloatData m_rbBFrame;
+	
+	btVector3FloatData	m_linearUpperLimit;
+	btVector3FloatData	m_linearLowerLimit;
+
+	btVector3FloatData	m_angularUpperLimit;
+	btVector3FloatData	m_angularLowerLimit;
+	
+	int	m_useLinearReferenceFrameA;
+	int m_useOffsetForConstraintFrame;
+};
+
+SIMD_FORCE_INLINE	int	btGeneric6DofConstraint::calculateSerializeBufferSize() const
+{
+	return sizeof(btGeneric6DofConstraintData);
+}
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btGeneric6DofConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+
+	btGeneric6DofConstraintData* dof = (btGeneric6DofConstraintData*)dataBuffer;
+	btTypedConstraint::serialize(&dof->m_typeConstraintData,serializer);
+
+	m_frameInA.serializeFloat(dof->m_rbAFrame);
+	m_frameInB.serializeFloat(dof->m_rbBFrame);
+
+		
+	int i;
+	for (i=0;i<3;i++)
+	{
+		dof->m_angularLowerLimit.m_floats[i] =  float(m_angularLimits[i].m_loLimit);
+		dof->m_angularUpperLimit.m_floats[i] =  float(m_angularLimits[i].m_hiLimit);
+		dof->m_linearLowerLimit.m_floats[i] = float(m_linearLimits.m_lowerLimit[i]);
+		dof->m_linearUpperLimit.m_floats[i] = float(m_linearLimits.m_upperLimit[i]);
+	}
+	
+	dof->m_useLinearReferenceFrameA = m_useLinearReferenceFrameA? 1 : 0;
+	dof->m_useOffsetForConstraintFrame = m_useOffsetForConstraintFrame ? 1 : 0;
+
+	return "btGeneric6DofConstraintData";
+}
+
+
+
+
+
+#endif //BT_GENERIC_6DOF_CONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
new file mode 100644
index 0000000..d350345
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
@@ -0,0 +1,172 @@
+/*
+Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
+Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btGeneric6DofSpringConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btTransformUtil.h"
+
+
+btGeneric6DofSpringConstraint::btGeneric6DofSpringConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA)
+	: btGeneric6DofConstraint(rbA, rbB, frameInA, frameInB, useLinearReferenceFrameA)
+{
+	m_objectType = D6_SPRING_CONSTRAINT_TYPE;
+
+	for(int i = 0; i < 6; i++)
+	{
+		m_springEnabled[i] = false;
+		m_equilibriumPoint[i] = btScalar(0.f);
+		m_springStiffness[i] = btScalar(0.f);
+		m_springDamping[i] = btScalar(1.f);
+	}
+}
+
+
+void btGeneric6DofSpringConstraint::enableSpring(int index, bool onOff)
+{
+	btAssert((index >= 0) && (index < 6));
+	m_springEnabled[index] = onOff;
+	if(index < 3)
+	{
+		m_linearLimits.m_enableMotor[index] = onOff;
+	}
+	else
+	{
+		m_angularLimits[index - 3].m_enableMotor = onOff;
+	}
+}
+
+
+
+void btGeneric6DofSpringConstraint::setStiffness(int index, btScalar stiffness)
+{
+	btAssert((index >= 0) && (index < 6));
+	m_springStiffness[index] = stiffness;
+}
+
+
+void btGeneric6DofSpringConstraint::setDamping(int index, btScalar damping)
+{
+	btAssert((index >= 0) && (index < 6));
+	m_springDamping[index] = damping;
+}
+
+
+void btGeneric6DofSpringConstraint::setEquilibriumPoint()
+{
+	calculateTransforms();
+	int i;
+
+	for( i = 0; i < 3; i++)
+	{
+		m_equilibriumPoint[i] = m_calculatedLinearDiff[i];
+	}
+	for(i = 0; i < 3; i++)
+	{
+		m_equilibriumPoint[i + 3] = m_calculatedAxisAngleDiff[i];
+	}
+}
+
+
+
+void btGeneric6DofSpringConstraint::setEquilibriumPoint(int index)
+{
+	btAssert((index >= 0) && (index < 6));
+	calculateTransforms();
+	if(index < 3)
+	{
+		m_equilibriumPoint[index] = m_calculatedLinearDiff[index];
+	}
+	else
+	{
+		m_equilibriumPoint[index] = m_calculatedAxisAngleDiff[index - 3];
+	}
+}
+
+void btGeneric6DofSpringConstraint::setEquilibriumPoint(int index, btScalar val)
+{
+	btAssert((index >= 0) && (index < 6));
+	m_equilibriumPoint[index] = val;
+}
+
+
+void btGeneric6DofSpringConstraint::internalUpdateSprings(btConstraintInfo2* info)
+{
+	// it is assumed that calculateTransforms() have been called before this call
+	int i;
+	btVector3 relVel = m_rbB.getLinearVelocity() - m_rbA.getLinearVelocity();
+	for(i = 0; i < 3; i++)
+	{
+		if(m_springEnabled[i])
+		{
+			// get current position of constraint
+			btScalar currPos = m_calculatedLinearDiff[i];
+			// calculate difference
+			btScalar delta = currPos - m_equilibriumPoint[i];
+			// spring force is (delta * m_stiffness) according to Hooke's Law
+			btScalar force = delta * m_springStiffness[i];
+			btScalar velFactor = info->fps * m_springDamping[i] / btScalar(info->m_numIterations);
+			m_linearLimits.m_targetVelocity[i] =  velFactor * force;
+			m_linearLimits.m_maxMotorForce[i] =  btFabs(force) / info->fps;
+		}
+	}
+	for(i = 0; i < 3; i++)
+	{
+		if(m_springEnabled[i + 3])
+		{
+			// get current position of constraint
+			btScalar currPos = m_calculatedAxisAngleDiff[i];
+			// calculate difference
+			btScalar delta = currPos - m_equilibriumPoint[i+3];
+			// spring force is (-delta * m_stiffness) according to Hooke's Law
+			btScalar force = -delta * m_springStiffness[i+3];
+			btScalar velFactor = info->fps * m_springDamping[i+3] / btScalar(info->m_numIterations);
+			m_angularLimits[i].m_targetVelocity = velFactor * force;
+			m_angularLimits[i].m_maxMotorForce = btFabs(force) / info->fps;
+		}
+	}
+}
+
+
+void btGeneric6DofSpringConstraint::getInfo2(btConstraintInfo2* info)
+{
+	// this will be called by constraint solver at the constraint setup stage
+	// set current motor parameters
+	internalUpdateSprings(info);
+	// do the rest of job for constraint setup
+	btGeneric6DofConstraint::getInfo2(info);
+}
+
+
+void btGeneric6DofSpringConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
+{
+	btVector3 zAxis = axis1.normalized();
+	btVector3 yAxis = axis2.normalized();
+	btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
+
+	btTransform frameInW;
+	frameInW.setIdentity();
+	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
+                                xAxis[1], yAxis[1], zAxis[1],
+                                xAxis[2], yAxis[2], zAxis[2]);
+
+	// now get constraint frame in local coordinate systems
+	m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
+	m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
+
+  calculateTransforms();
+}
+
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h
new file mode 100644
index 0000000..b3f2ef8
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h
@@ -0,0 +1,97 @@
+/*
+Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
+Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
+#define BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
+
+
+#include "LinearMath/btVector3.h"
+#include "btTypedConstraint.h"
+#include "btGeneric6DofConstraint.h"
+
+
+/// Generic 6 DOF constraint that allows to set spring motors to any translational and rotational DOF
+
+/// DOF index used in enableSpring() and setStiffness() means:
+/// 0 : translation X
+/// 1 : translation Y
+/// 2 : translation Z
+/// 3 : rotation X (3rd Euler rotational around new position of X axis, range [-PI+epsilon, PI-epsilon] )
+/// 4 : rotation Y (2nd Euler rotational around new position of Y axis, range [-PI/2+epsilon, PI/2-epsilon] )
+/// 5 : rotation Z (1st Euler rotational around Z axis, range [-PI+epsilon, PI-epsilon] )
+
+class btGeneric6DofSpringConstraint : public btGeneric6DofConstraint
+{
+protected:
+	bool		m_springEnabled[6];
+	btScalar	m_equilibriumPoint[6];
+	btScalar	m_springStiffness[6];
+	btScalar	m_springDamping[6]; // between 0 and 1 (1 == no damping)
+	void internalUpdateSprings(btConstraintInfo2* info);
+public: 
+    btGeneric6DofSpringConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
+	void enableSpring(int index, bool onOff);
+	void setStiffness(int index, btScalar stiffness);
+	void setDamping(int index, btScalar damping);
+	void setEquilibriumPoint(); // set the current constraint position/orientation as an equilibrium point for all DOF
+	void setEquilibriumPoint(int index);  // set the current constraint position/orientation as an equilibrium point for given DOF
+	void setEquilibriumPoint(int index, btScalar val);
+
+	virtual void setAxis( const btVector3& axis1, const btVector3& axis2);
+
+	virtual void getInfo2 (btConstraintInfo2* info);
+
+	virtual	int	calculateSerializeBufferSize() const;
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+};
+
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct btGeneric6DofSpringConstraintData
+{
+	btGeneric6DofConstraintData	m_6dofData;
+	
+	int			m_springEnabled[6];
+	float		m_equilibriumPoint[6];
+	float		m_springStiffness[6];
+	float		m_springDamping[6];
+};
+
+SIMD_FORCE_INLINE	int	btGeneric6DofSpringConstraint::calculateSerializeBufferSize() const
+{
+	return sizeof(btGeneric6DofSpringConstraintData);
+}
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btGeneric6DofSpringConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btGeneric6DofSpringConstraintData* dof = (btGeneric6DofSpringConstraintData*)dataBuffer;
+	btGeneric6DofConstraint::serialize(&dof->m_6dofData,serializer);
+
+	int i;
+	for (i=0;i<6;i++)
+	{
+		dof->m_equilibriumPoint[i] = m_equilibriumPoint[i];
+		dof->m_springDamping[i] = m_springDamping[i];
+		dof->m_springEnabled[i] = m_springEnabled[i]? 1 : 0;
+		dof->m_springStiffness[i] = m_springStiffness[i];
+	}
+	return "btGeneric6DofConstraintData";
+}
+
+#endif // BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
new file mode 100644
index 0000000..29123d5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
@@ -0,0 +1,66 @@
+/*
+Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
+Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#include "btHinge2Constraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btTransformUtil.h"
+
+
+
+// constructor
+// anchor, axis1 and axis2 are in world coordinate system
+// axis1 must be orthogonal to axis2
+btHinge2Constraint::btHinge2Constraint(btRigidBody& rbA, btRigidBody& rbB, btVector3& anchor, btVector3& axis1, btVector3& axis2)
+: btGeneric6DofSpringConstraint(rbA, rbB, btTransform::getIdentity(), btTransform::getIdentity(), true),
+ m_anchor(anchor),
+ m_axis1(axis1),
+ m_axis2(axis2)
+{
+	// build frame basis
+	// 6DOF constraint uses Euler angles and to define limits
+	// it is assumed that rotational order is :
+	// Z - first, allowed limits are (-PI,PI);
+	// new position of Y - second (allowed limits are (-PI/2 + epsilon, PI/2 - epsilon), where epsilon is a small positive number 
+	// used to prevent constraint from instability on poles;
+	// new position of X, allowed limits are (-PI,PI);
+	// So to simulate ODE Universal joint we should use parent axis as Z, child axis as Y and limit all other DOFs
+	// Build the frame in world coordinate system first
+	btVector3 zAxis = axis1.normalize();
+	btVector3 xAxis = axis2.normalize();
+	btVector3 yAxis = zAxis.cross(xAxis); // we want right coordinate system
+	btTransform frameInW;
+	frameInW.setIdentity();
+	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
+									xAxis[1], yAxis[1], zAxis[1],
+									xAxis[2], yAxis[2], zAxis[2]);
+	frameInW.setOrigin(anchor);
+	// now get constraint frame in local coordinate systems
+	m_frameInA = rbA.getCenterOfMassTransform().inverse() * frameInW;
+	m_frameInB = rbB.getCenterOfMassTransform().inverse() * frameInW;
+	// sei limits
+	setLinearLowerLimit(btVector3(0.f, 0.f, -1.f));
+	setLinearUpperLimit(btVector3(0.f, 0.f,  1.f));
+	// like front wheels of a car
+	setAngularLowerLimit(btVector3(1.f,  0.f, -SIMD_HALF_PI * 0.5f)); 
+	setAngularUpperLimit(btVector3(-1.f, 0.f,  SIMD_HALF_PI * 0.5f));
+	// enable suspension
+	enableSpring(2, true);
+	setStiffness(2, SIMD_PI * SIMD_PI * 4.f); // period 1 sec for 1 kilogramm weel :-)
+	setDamping(2, 0.01f);
+	setEquilibriumPoint();
+}
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h
new file mode 100644
index 0000000..a76452d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h
@@ -0,0 +1,58 @@
+/*
+Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
+Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_HINGE2_CONSTRAINT_H
+#define BT_HINGE2_CONSTRAINT_H
+
+
+
+#include "LinearMath/btVector3.h"
+#include "btTypedConstraint.h"
+#include "btGeneric6DofSpringConstraint.h"
+
+
+
+// Constraint similar to ODE Hinge2 Joint
+// has 3 degrees of frredom:
+// 2 rotational degrees of freedom, similar to Euler rotations around Z (axis 1) and X (axis 2)
+// 1 translational (along axis Z) with suspension spring
+
+class btHinge2Constraint : public btGeneric6DofSpringConstraint
+{
+protected:
+	btVector3	m_anchor;
+	btVector3	m_axis1;
+	btVector3	m_axis2;
+public:
+	// constructor
+	// anchor, axis1 and axis2 are in world coordinate system
+	// axis1 must be orthogonal to axis2
+    btHinge2Constraint(btRigidBody& rbA, btRigidBody& rbB, btVector3& anchor, btVector3& axis1, btVector3& axis2);
+	// access
+	const btVector3& getAnchor() { return m_calculatedTransformA.getOrigin(); }
+	const btVector3& getAnchor2() { return m_calculatedTransformB.getOrigin(); }
+	const btVector3& getAxis1() { return m_axis1; }
+	const btVector3& getAxis2() { return m_axis2; }
+	btScalar getAngle1() { return getAngle(2); }
+	btScalar getAngle2() { return getAngle(0); }
+	// limits
+	void setUpperLimit(btScalar ang1max) { setAngularUpperLimit(btVector3(-1.f, 0.f, ang1max)); }
+	void setLowerLimit(btScalar ang1min) { setAngularLowerLimit(btVector3( 1.f, 0.f, ang1min)); }
+};
+
+
+
+#endif // BT_HINGE2_CONSTRAINT_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
new file mode 100644
index 0000000..144beef
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
@@ -0,0 +1,1033 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btHingeConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btTransformUtil.h"
+#include "LinearMath/btMinMax.h"
+#include <new>
+#include "btSolverBody.h"
+
+
+
+//#define HINGE_USE_OBSOLETE_SOLVER false
+#define HINGE_USE_OBSOLETE_SOLVER false
+
+#define HINGE_USE_FRAME_OFFSET true
+
+#ifndef __SPU__
+
+
+
+
+
+btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB,
+									 const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA)
+									 :btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),
+									 m_angularOnly(false),
+									 m_enableAngularMotor(false),
+									 m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
+									 m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
+									 m_useReferenceFrameA(useReferenceFrameA),
+									 m_flags(0)
+#ifdef _BT_USE_CENTER_LIMIT_
+									,m_limit()
+#endif
+{
+	m_rbAFrame.getOrigin() = pivotInA;
+	
+	// since no frame is given, assume this to be zero angle and just pick rb transform axis
+	btVector3 rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(0);
+
+	btVector3 rbAxisA2;
+	btScalar projection = axisInA.dot(rbAxisA1);
+	if (projection >= 1.0f - SIMD_EPSILON) {
+		rbAxisA1 = -rbA.getCenterOfMassTransform().getBasis().getColumn(2);
+		rbAxisA2 = rbA.getCenterOfMassTransform().getBasis().getColumn(1);
+	} else if (projection <= -1.0f + SIMD_EPSILON) {
+		rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(2);
+		rbAxisA2 = rbA.getCenterOfMassTransform().getBasis().getColumn(1);      
+	} else {
+		rbAxisA2 = axisInA.cross(rbAxisA1);
+		rbAxisA1 = rbAxisA2.cross(axisInA);
+	}
+
+	m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(),
+									rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(),
+									rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() );
+
+	btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB);
+	btVector3 rbAxisB1 =  quatRotate(rotationArc,rbAxisA1);
+	btVector3 rbAxisB2 =  axisInB.cross(rbAxisB1);	
+	
+	m_rbBFrame.getOrigin() = pivotInB;
+	m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
+									rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
+									rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
+	
+#ifndef	_BT_USE_CENTER_LIMIT_
+	//start with free
+	m_lowerLimit = btScalar(1.0f);
+	m_upperLimit = btScalar(-1.0f);
+	m_biasFactor = 0.3f;
+	m_relaxationFactor = 1.0f;
+	m_limitSoftness = 0.9f;
+	m_solveLimit = false;
+#endif
+	m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
+}
+
+
+
+btHingeConstraint::btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA)
+:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA), m_angularOnly(false), m_enableAngularMotor(false), 
+m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
+m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
+m_useReferenceFrameA(useReferenceFrameA),
+m_flags(0)
+#ifdef	_BT_USE_CENTER_LIMIT_
+,m_limit()
+#endif
+{
+
+	// since no frame is given, assume this to be zero angle and just pick rb transform axis
+	// fixed axis in worldspace
+	btVector3 rbAxisA1, rbAxisA2;
+	btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2);
+
+	m_rbAFrame.getOrigin() = pivotInA;
+	m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(),
+									rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(),
+									rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() );
+
+	btVector3 axisInB = rbA.getCenterOfMassTransform().getBasis() * axisInA;
+
+	btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB);
+	btVector3 rbAxisB1 =  quatRotate(rotationArc,rbAxisA1);
+	btVector3 rbAxisB2 = axisInB.cross(rbAxisB1);
+
+
+	m_rbBFrame.getOrigin() = rbA.getCenterOfMassTransform()(pivotInA);
+	m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
+									rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
+									rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
+	
+#ifndef	_BT_USE_CENTER_LIMIT_
+	//start with free
+	m_lowerLimit = btScalar(1.0f);
+	m_upperLimit = btScalar(-1.0f);
+	m_biasFactor = 0.3f;
+	m_relaxationFactor = 1.0f;
+	m_limitSoftness = 0.9f;
+	m_solveLimit = false;
+#endif
+	m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
+}
+
+
+
+btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, 
+								     const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA)
+:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame),
+m_angularOnly(false),
+m_enableAngularMotor(false),
+m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
+m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
+m_useReferenceFrameA(useReferenceFrameA),
+m_flags(0)
+#ifdef	_BT_USE_CENTER_LIMIT_
+,m_limit()
+#endif
+{
+#ifndef	_BT_USE_CENTER_LIMIT_
+	//start with free
+	m_lowerLimit = btScalar(1.0f);
+	m_upperLimit = btScalar(-1.0f);
+	m_biasFactor = 0.3f;
+	m_relaxationFactor = 1.0f;
+	m_limitSoftness = 0.9f;
+	m_solveLimit = false;
+#endif
+	m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
+}			
+
+
+
+btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btTransform& rbAFrame, bool useReferenceFrameA)
+:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),m_rbAFrame(rbAFrame),m_rbBFrame(rbAFrame),
+m_angularOnly(false),
+m_enableAngularMotor(false),
+m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
+m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
+m_useReferenceFrameA(useReferenceFrameA),
+m_flags(0)
+#ifdef	_BT_USE_CENTER_LIMIT_
+,m_limit()
+#endif
+{
+	///not providing rigidbody B means implicitly using worldspace for body B
+
+	m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(m_rbAFrame.getOrigin());
+#ifndef	_BT_USE_CENTER_LIMIT_
+	//start with free
+	m_lowerLimit = btScalar(1.0f);
+	m_upperLimit = btScalar(-1.0f);
+	m_biasFactor = 0.3f;
+	m_relaxationFactor = 1.0f;
+	m_limitSoftness = 0.9f;
+	m_solveLimit = false;
+#endif
+	m_referenceSign = m_useReferenceFrameA ? btScalar(-1.f) : btScalar(1.f);
+}
+
+
+
+void	btHingeConstraint::buildJacobian()
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		m_appliedImpulse = btScalar(0.);
+		m_accMotorImpulse = btScalar(0.);
+
+		if (!m_angularOnly)
+		{
+			btVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_rbAFrame.getOrigin();
+			btVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_rbBFrame.getOrigin();
+			btVector3 relPos = pivotBInW - pivotAInW;
+
+			btVector3 normal[3];
+			if (relPos.length2() > SIMD_EPSILON)
+			{
+				normal[0] = relPos.normalized();
+			}
+			else
+			{
+				normal[0].setValue(btScalar(1.0),0,0);
+			}
+
+			btPlaneSpace1(normal[0], normal[1], normal[2]);
+
+			for (int i=0;i<3;i++)
+			{
+				new (&m_jac[i]) btJacobianEntry(
+				m_rbA.getCenterOfMassTransform().getBasis().transpose(),
+				m_rbB.getCenterOfMassTransform().getBasis().transpose(),
+				pivotAInW - m_rbA.getCenterOfMassPosition(),
+				pivotBInW - m_rbB.getCenterOfMassPosition(),
+				normal[i],
+				m_rbA.getInvInertiaDiagLocal(),
+				m_rbA.getInvMass(),
+				m_rbB.getInvInertiaDiagLocal(),
+				m_rbB.getInvMass());
+			}
+		}
+
+		//calculate two perpendicular jointAxis, orthogonal to hingeAxis
+		//these two jointAxis require equal angular velocities for both bodies
+
+		//this is unused for now, it's a todo
+		btVector3 jointAxis0local;
+		btVector3 jointAxis1local;
+		
+		btPlaneSpace1(m_rbAFrame.getBasis().getColumn(2),jointAxis0local,jointAxis1local);
+
+		btVector3 jointAxis0 = getRigidBodyA().getCenterOfMassTransform().getBasis() * jointAxis0local;
+		btVector3 jointAxis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * jointAxis1local;
+		btVector3 hingeAxisWorld = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(2);
+			
+		new (&m_jacAng[0])	btJacobianEntry(jointAxis0,
+			m_rbA.getCenterOfMassTransform().getBasis().transpose(),
+			m_rbB.getCenterOfMassTransform().getBasis().transpose(),
+			m_rbA.getInvInertiaDiagLocal(),
+			m_rbB.getInvInertiaDiagLocal());
+
+		new (&m_jacAng[1])	btJacobianEntry(jointAxis1,
+			m_rbA.getCenterOfMassTransform().getBasis().transpose(),
+			m_rbB.getCenterOfMassTransform().getBasis().transpose(),
+			m_rbA.getInvInertiaDiagLocal(),
+			m_rbB.getInvInertiaDiagLocal());
+
+		new (&m_jacAng[2])	btJacobianEntry(hingeAxisWorld,
+			m_rbA.getCenterOfMassTransform().getBasis().transpose(),
+			m_rbB.getCenterOfMassTransform().getBasis().transpose(),
+			m_rbA.getInvInertiaDiagLocal(),
+			m_rbB.getInvInertiaDiagLocal());
+
+			// clear accumulator
+			m_accLimitImpulse = btScalar(0.);
+
+			// test angular limit
+			testLimit(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+
+		//Compute K = J*W*J' for hinge axis
+		btVector3 axisA =  getRigidBodyA().getCenterOfMassTransform().getBasis() *  m_rbAFrame.getBasis().getColumn(2);
+		m_kHinge =   1.0f / (getRigidBodyA().computeAngularImpulseDenominator(axisA) +
+							 getRigidBodyB().computeAngularImpulseDenominator(axisA));
+
+	}
+}
+
+
+#endif //__SPU__
+
+
+void btHingeConstraint::getInfo1(btConstraintInfo1* info)
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		info->m_numConstraintRows = 0;
+		info->nub = 0;
+	}
+	else
+	{
+		info->m_numConstraintRows = 5; // Fixed 3 linear + 2 angular
+		info->nub = 1; 
+		//always add the row, to avoid computation (data is not available yet)
+		//prepare constraint
+		testLimit(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+		if(getSolveLimit() || getEnableAngularMotor())
+		{
+			info->m_numConstraintRows++; // limit 3rd anguar as well
+			info->nub--; 
+		}
+
+	}
+}
+
+void btHingeConstraint::getInfo1NonVirtual(btConstraintInfo1* info)
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		info->m_numConstraintRows = 0;
+		info->nub = 0;
+	}
+	else
+	{
+		//always add the 'limit' row, to avoid computation (data is not available yet)
+		info->m_numConstraintRows = 6; // Fixed 3 linear + 2 angular
+		info->nub = 0; 
+	}
+}
+
+void btHingeConstraint::getInfo2 (btConstraintInfo2* info)
+{
+	if(m_useOffsetForConstraintFrame)
+	{
+		getInfo2InternalUsingFrameOffset(info, m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getAngularVelocity(),m_rbB.getAngularVelocity());
+	}
+	else
+	{
+		getInfo2Internal(info, m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(),m_rbA.getAngularVelocity(),m_rbB.getAngularVelocity());
+	}
+}
+
+
+void	btHingeConstraint::getInfo2NonVirtual (btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB)
+{
+	///the regular (virtual) implementation getInfo2 already performs 'testLimit' during getInfo1, so we need to do it now
+	testLimit(transA,transB);
+
+	getInfo2Internal(info,transA,transB,angVelA,angVelB);
+}
+
+
+void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB)
+{
+
+	btAssert(!m_useSolveConstraintObsolete);
+	int i, skip = info->rowskip;
+	// transforms in world space
+	btTransform trA = transA*m_rbAFrame;
+	btTransform trB = transB*m_rbBFrame;
+	// pivot point
+	btVector3 pivotAInW = trA.getOrigin();
+	btVector3 pivotBInW = trB.getOrigin();
+#if 0
+	if (0)
+	{
+		for (i=0;i<6;i++)
+		{
+			info->m_J1linearAxis[i*skip]=0;
+			info->m_J1linearAxis[i*skip+1]=0;
+			info->m_J1linearAxis[i*skip+2]=0;
+
+			info->m_J1angularAxis[i*skip]=0;
+			info->m_J1angularAxis[i*skip+1]=0;
+			info->m_J1angularAxis[i*skip+2]=0;
+
+			info->m_J2angularAxis[i*skip]=0;
+			info->m_J2angularAxis[i*skip+1]=0;
+			info->m_J2angularAxis[i*skip+2]=0;
+
+			info->m_constraintError[i*skip]=0.f;
+		}
+	}
+#endif //#if 0
+	// linear (all fixed)
+
+	if (!m_angularOnly)
+	{
+		info->m_J1linearAxis[0] = 1;
+		info->m_J1linearAxis[skip + 1] = 1;
+		info->m_J1linearAxis[2 * skip + 2] = 1;
+	}	
+
+
+
+
+	btVector3 a1 = pivotAInW - transA.getOrigin();
+	{
+		btVector3* angular0 = (btVector3*)(info->m_J1angularAxis);
+		btVector3* angular1 = (btVector3*)(info->m_J1angularAxis + skip);
+		btVector3* angular2 = (btVector3*)(info->m_J1angularAxis + 2 * skip);
+		btVector3 a1neg = -a1;
+		a1neg.getSkewSymmetricMatrix(angular0,angular1,angular2);
+	}
+	btVector3 a2 = pivotBInW - transB.getOrigin();
+	{
+		btVector3* angular0 = (btVector3*)(info->m_J2angularAxis);
+		btVector3* angular1 = (btVector3*)(info->m_J2angularAxis + skip);
+		btVector3* angular2 = (btVector3*)(info->m_J2angularAxis + 2 * skip);
+		a2.getSkewSymmetricMatrix(angular0,angular1,angular2);
+	}
+	// linear RHS
+    btScalar k = info->fps * info->erp;
+	if (!m_angularOnly)
+	{
+		for(i = 0; i < 3; i++)
+		{
+			info->m_constraintError[i * skip] = k * (pivotBInW[i] - pivotAInW[i]);
+		}
+	}
+	// make rotations around X and Y equal
+	// the hinge axis should be the only unconstrained
+	// rotational axis, the angular velocity of the two bodies perpendicular to
+	// the hinge axis should be equal. thus the constraint equations are
+	//    p*w1 - p*w2 = 0
+	//    q*w1 - q*w2 = 0
+	// where p and q are unit vectors normal to the hinge axis, and w1 and w2
+	// are the angular velocity vectors of the two bodies.
+	// get hinge axis (Z)
+	btVector3 ax1 = trA.getBasis().getColumn(2);
+	// get 2 orthos to hinge axis (X, Y)
+	btVector3 p = trA.getBasis().getColumn(0);
+	btVector3 q = trA.getBasis().getColumn(1);
+	// set the two hinge angular rows 
+    int s3 = 3 * info->rowskip;
+    int s4 = 4 * info->rowskip;
+
+	info->m_J1angularAxis[s3 + 0] = p[0];
+	info->m_J1angularAxis[s3 + 1] = p[1];
+	info->m_J1angularAxis[s3 + 2] = p[2];
+	info->m_J1angularAxis[s4 + 0] = q[0];
+	info->m_J1angularAxis[s4 + 1] = q[1];
+	info->m_J1angularAxis[s4 + 2] = q[2];
+
+	info->m_J2angularAxis[s3 + 0] = -p[0];
+	info->m_J2angularAxis[s3 + 1] = -p[1];
+	info->m_J2angularAxis[s3 + 2] = -p[2];
+	info->m_J2angularAxis[s4 + 0] = -q[0];
+	info->m_J2angularAxis[s4 + 1] = -q[1];
+	info->m_J2angularAxis[s4 + 2] = -q[2];
+    // compute the right hand side of the constraint equation. set relative
+    // body velocities along p and q to bring the hinge back into alignment.
+    // if ax1,ax2 are the unit length hinge axes as computed from body1 and
+    // body2, we need to rotate both bodies along the axis u = (ax1 x ax2).
+    // if `theta' is the angle between ax1 and ax2, we need an angular velocity
+    // along u to cover angle erp*theta in one step :
+    //   |angular_velocity| = angle/time = erp*theta / stepsize
+    //                      = (erp*fps) * theta
+    //    angular_velocity  = |angular_velocity| * (ax1 x ax2) / |ax1 x ax2|
+    //                      = (erp*fps) * theta * (ax1 x ax2) / sin(theta)
+    // ...as ax1 and ax2 are unit length. if theta is smallish,
+    // theta ~= sin(theta), so
+    //    angular_velocity  = (erp*fps) * (ax1 x ax2)
+    // ax1 x ax2 is in the plane space of ax1, so we project the angular
+    // velocity to p and q to find the right hand side.
+    btVector3 ax2 = trB.getBasis().getColumn(2);
+	btVector3 u = ax1.cross(ax2);
+	info->m_constraintError[s3] = k * u.dot(p);
+	info->m_constraintError[s4] = k * u.dot(q);
+	// check angular limits
+	int nrow = 4; // last filled row
+	int srow;
+	btScalar limit_err = btScalar(0.0);
+	int limit = 0;
+	if(getSolveLimit())
+	{
+#ifdef	_BT_USE_CENTER_LIMIT_
+	limit_err = m_limit.getCorrection() * m_referenceSign;
+#else
+	limit_err = m_correction * m_referenceSign;
+#endif
+	limit = (limit_err > btScalar(0.0)) ? 1 : 2;
+
+	}
+	// if the hinge has joint limits or motor, add in the extra row
+	int powered = 0;
+	if(getEnableAngularMotor())
+	{
+		powered = 1;
+	}
+	if(limit || powered) 
+	{
+		nrow++;
+		srow = nrow * info->rowskip;
+		info->m_J1angularAxis[srow+0] = ax1[0];
+		info->m_J1angularAxis[srow+1] = ax1[1];
+		info->m_J1angularAxis[srow+2] = ax1[2];
+
+		info->m_J2angularAxis[srow+0] = -ax1[0];
+		info->m_J2angularAxis[srow+1] = -ax1[1];
+		info->m_J2angularAxis[srow+2] = -ax1[2];
+
+		btScalar lostop = getLowerLimit();
+		btScalar histop = getUpperLimit();
+		if(limit && (lostop == histop))
+		{  // the joint motor is ineffective
+			powered = 0;
+		}
+		info->m_constraintError[srow] = btScalar(0.0f);
+		btScalar currERP = (m_flags & BT_HINGE_FLAGS_ERP_STOP) ? m_stopERP : info->erp;
+		if(powered)
+		{
+			if(m_flags & BT_HINGE_FLAGS_CFM_NORM)
+			{
+				info->cfm[srow] = m_normalCFM;
+			}
+			btScalar mot_fact = getMotorFactor(m_hingeAngle, lostop, histop, m_motorTargetVelocity, info->fps * currERP);
+			info->m_constraintError[srow] += mot_fact * m_motorTargetVelocity * m_referenceSign;
+			info->m_lowerLimit[srow] = - m_maxMotorImpulse;
+			info->m_upperLimit[srow] =   m_maxMotorImpulse;
+		}
+		if(limit)
+		{
+			k = info->fps * currERP;
+			info->m_constraintError[srow] += k * limit_err;
+			if(m_flags & BT_HINGE_FLAGS_CFM_STOP)
+			{
+				info->cfm[srow] = m_stopCFM;
+			}
+			if(lostop == histop) 
+			{
+				// limited low and high simultaneously
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			}
+			else if(limit == 1) 
+			{ // low limit
+				info->m_lowerLimit[srow] = 0;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			}
+			else 
+			{ // high limit
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = 0;
+			}
+			// bounce (we'll use slider parameter abs(1.0 - m_dampingLimAng) for that)
+#ifdef	_BT_USE_CENTER_LIMIT_
+			btScalar bounce = m_limit.getRelaxationFactor();
+#else
+			btScalar bounce = m_relaxationFactor;
+#endif
+			if(bounce > btScalar(0.0))
+			{
+				btScalar vel = angVelA.dot(ax1);
+				vel -= angVelB.dot(ax1);
+				// only apply bounce if the velocity is incoming, and if the
+				// resulting c[] exceeds what we already have.
+				if(limit == 1)
+				{	// low limit
+					if(vel < 0)
+					{
+						btScalar newc = -bounce * vel;
+						if(newc > info->m_constraintError[srow])
+						{
+							info->m_constraintError[srow] = newc;
+						}
+					}
+				}
+				else
+				{	// high limit - all those computations are reversed
+					if(vel > 0)
+					{
+						btScalar newc = -bounce * vel;
+						if(newc < info->m_constraintError[srow])
+						{
+							info->m_constraintError[srow] = newc;
+						}
+					}
+				}
+			}
+#ifdef	_BT_USE_CENTER_LIMIT_
+			info->m_constraintError[srow] *= m_limit.getBiasFactor();
+#else
+			info->m_constraintError[srow] *= m_biasFactor;
+#endif
+		} // if(limit)
+	} // if angular limit or powered
+}
+
+
+void btHingeConstraint::setFrames(const btTransform & frameA, const btTransform & frameB)
+{
+	m_rbAFrame = frameA;
+	m_rbBFrame = frameB;
+	buildJacobian();
+}
+
+
+void	btHingeConstraint::updateRHS(btScalar	timeStep)
+{
+	(void)timeStep;
+
+}
+
+
+btScalar btHingeConstraint::getHingeAngle()
+{
+	return getHingeAngle(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+}
+
+btScalar btHingeConstraint::getHingeAngle(const btTransform& transA,const btTransform& transB)
+{
+	const btVector3 refAxis0  = transA.getBasis() * m_rbAFrame.getBasis().getColumn(0);
+	const btVector3 refAxis1  = transA.getBasis() * m_rbAFrame.getBasis().getColumn(1);
+	const btVector3 swingAxis = transB.getBasis() * m_rbBFrame.getBasis().getColumn(1);
+//	btScalar angle = btAtan2Fast(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1));
+	btScalar angle = btAtan2(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1));
+	return m_referenceSign * angle;
+}
+
+
+
+void btHingeConstraint::testLimit(const btTransform& transA,const btTransform& transB)
+{
+	// Compute limit information
+	m_hingeAngle = getHingeAngle(transA,transB);
+#ifdef	_BT_USE_CENTER_LIMIT_
+	m_limit.test(m_hingeAngle);
+#else
+	m_correction = btScalar(0.);
+	m_limitSign = btScalar(0.);
+	m_solveLimit = false;
+	if (m_lowerLimit <= m_upperLimit)
+	{
+		m_hingeAngle = btAdjustAngleToLimits(m_hingeAngle, m_lowerLimit, m_upperLimit);
+		if (m_hingeAngle <= m_lowerLimit)
+		{
+			m_correction = (m_lowerLimit - m_hingeAngle);
+			m_limitSign = 1.0f;
+			m_solveLimit = true;
+		} 
+		else if (m_hingeAngle >= m_upperLimit)
+		{
+			m_correction = m_upperLimit - m_hingeAngle;
+			m_limitSign = -1.0f;
+			m_solveLimit = true;
+		}
+	}
+#endif
+	return;
+}
+
+
+static btVector3 vHinge(0, 0, btScalar(1));
+
+void btHingeConstraint::setMotorTarget(const btQuaternion& qAinB, btScalar dt)
+{
+	// convert target from body to constraint space
+	btQuaternion qConstraint = m_rbBFrame.getRotation().inverse() * qAinB * m_rbAFrame.getRotation();
+	qConstraint.normalize();
+
+	// extract "pure" hinge component
+	btVector3 vNoHinge = quatRotate(qConstraint, vHinge); vNoHinge.normalize();
+	btQuaternion qNoHinge = shortestArcQuat(vHinge, vNoHinge);
+	btQuaternion qHinge = qNoHinge.inverse() * qConstraint;
+	qHinge.normalize();
+
+	// compute angular target, clamped to limits
+	btScalar targetAngle = qHinge.getAngle();
+	if (targetAngle > SIMD_PI) // long way around. flip quat and recalculate.
+	{
+		qHinge = operator-(qHinge);
+		targetAngle = qHinge.getAngle();
+	}
+	if (qHinge.getZ() < 0)
+		targetAngle = -targetAngle;
+
+	setMotorTarget(targetAngle, dt);
+}
+
+void btHingeConstraint::setMotorTarget(btScalar targetAngle, btScalar dt)
+{
+#ifdef	_BT_USE_CENTER_LIMIT_
+	m_limit.fit(targetAngle);
+#else
+	if (m_lowerLimit < m_upperLimit)
+	{
+		if (targetAngle < m_lowerLimit)
+			targetAngle = m_lowerLimit;
+		else if (targetAngle > m_upperLimit)
+			targetAngle = m_upperLimit;
+	}
+#endif
+	// compute angular velocity
+	btScalar curAngle  = getHingeAngle(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+	btScalar dAngle = targetAngle - curAngle;
+	m_motorTargetVelocity = dAngle / dt;
+}
+
+
+
+void btHingeConstraint::getInfo2InternalUsingFrameOffset(btConstraintInfo2* info, const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB)
+{
+	btAssert(!m_useSolveConstraintObsolete);
+	int i, s = info->rowskip;
+	// transforms in world space
+	btTransform trA = transA*m_rbAFrame;
+	btTransform trB = transB*m_rbBFrame;
+	// pivot point
+	btVector3 pivotAInW = trA.getOrigin();
+	btVector3 pivotBInW = trB.getOrigin();
+#if 1
+	// difference between frames in WCS
+	btVector3 ofs = trB.getOrigin() - trA.getOrigin();
+	// now get weight factors depending on masses
+	btScalar miA = getRigidBodyA().getInvMass();
+	btScalar miB = getRigidBodyB().getInvMass();
+	bool hasStaticBody = (miA < SIMD_EPSILON) || (miB < SIMD_EPSILON);
+	btScalar miS = miA + miB;
+	btScalar factA, factB;
+	if(miS > btScalar(0.f))
+	{
+		factA = miB / miS;
+	}
+	else 
+	{
+		factA = btScalar(0.5f);
+	}
+	factB = btScalar(1.0f) - factA;
+	// get the desired direction of hinge axis
+	// as weighted sum of Z-orthos of frameA and frameB in WCS
+	btVector3 ax1A = trA.getBasis().getColumn(2);
+	btVector3 ax1B = trB.getBasis().getColumn(2);
+	btVector3 ax1 = ax1A * factA + ax1B * factB;
+	ax1.normalize();
+	// fill first 3 rows 
+	// we want: velA + wA x relA == velB + wB x relB
+	btTransform bodyA_trans = transA;
+	btTransform bodyB_trans = transB;
+	int s0 = 0;
+	int s1 = s;
+	int s2 = s * 2;
+	int nrow = 2; // last filled row
+	btVector3 tmpA, tmpB, relA, relB, p, q;
+	// get vector from bodyB to frameB in WCS
+	relB = trB.getOrigin() - bodyB_trans.getOrigin();
+	// get its projection to hinge axis
+	btVector3 projB = ax1 * relB.dot(ax1);
+	// get vector directed from bodyB to hinge axis (and orthogonal to it)
+	btVector3 orthoB = relB - projB;
+	// same for bodyA
+	relA = trA.getOrigin() - bodyA_trans.getOrigin();
+	btVector3 projA = ax1 * relA.dot(ax1);
+	btVector3 orthoA = relA - projA;
+	btVector3 totalDist = projA - projB;
+	// get offset vectors relA and relB
+	relA = orthoA + totalDist * factA;
+	relB = orthoB - totalDist * factB;
+	// now choose average ortho to hinge axis
+	p = orthoB * factA + orthoA * factB;
+	btScalar len2 = p.length2();
+	if(len2 > SIMD_EPSILON)
+	{
+		p /= btSqrt(len2);
+	}
+	else
+	{
+		p = trA.getBasis().getColumn(1);
+	}
+	// make one more ortho
+	q = ax1.cross(p);
+	// fill three rows
+	tmpA = relA.cross(p);
+	tmpB = relB.cross(p);
+    for (i=0; i<3; i++) info->m_J1angularAxis[s0+i] = tmpA[i];
+    for (i=0; i<3; i++) info->m_J2angularAxis[s0+i] = -tmpB[i];
+	tmpA = relA.cross(q);
+	tmpB = relB.cross(q);
+	if(hasStaticBody && getSolveLimit())
+	{ // to make constraint between static and dynamic objects more rigid
+		// remove wA (or wB) from equation if angular limit is hit
+		tmpB *= factB;
+		tmpA *= factA;
+	}
+	for (i=0; i<3; i++) info->m_J1angularAxis[s1+i] = tmpA[i];
+    for (i=0; i<3; i++) info->m_J2angularAxis[s1+i] = -tmpB[i];
+	tmpA = relA.cross(ax1);
+	tmpB = relB.cross(ax1);
+	if(hasStaticBody)
+	{ // to make constraint between static and dynamic objects more rigid
+		// remove wA (or wB) from equation
+		tmpB *= factB;
+		tmpA *= factA;
+	}
+	for (i=0; i<3; i++) info->m_J1angularAxis[s2+i] = tmpA[i];
+    for (i=0; i<3; i++) info->m_J2angularAxis[s2+i] = -tmpB[i];
+
+	btScalar k = info->fps * info->erp;
+
+	if (!m_angularOnly)
+	{
+		for (i=0; i<3; i++) info->m_J1linearAxis[s0+i] = p[i];
+		for (i=0; i<3; i++) info->m_J1linearAxis[s1+i] = q[i];
+		for (i=0; i<3; i++) info->m_J1linearAxis[s2+i] = ax1[i];
+	
+	// compute three elements of right hand side
+	
+		btScalar rhs = k * p.dot(ofs);
+		info->m_constraintError[s0] = rhs;
+		rhs = k * q.dot(ofs);
+		info->m_constraintError[s1] = rhs;
+		rhs = k * ax1.dot(ofs);
+		info->m_constraintError[s2] = rhs;
+	}
+	// the hinge axis should be the only unconstrained
+	// rotational axis, the angular velocity of the two bodies perpendicular to
+	// the hinge axis should be equal. thus the constraint equations are
+	//    p*w1 - p*w2 = 0
+	//    q*w1 - q*w2 = 0
+	// where p and q are unit vectors normal to the hinge axis, and w1 and w2
+	// are the angular velocity vectors of the two bodies.
+	int s3 = 3 * s;
+	int s4 = 4 * s;
+	info->m_J1angularAxis[s3 + 0] = p[0];
+	info->m_J1angularAxis[s3 + 1] = p[1];
+	info->m_J1angularAxis[s3 + 2] = p[2];
+	info->m_J1angularAxis[s4 + 0] = q[0];
+	info->m_J1angularAxis[s4 + 1] = q[1];
+	info->m_J1angularAxis[s4 + 2] = q[2];
+
+	info->m_J2angularAxis[s3 + 0] = -p[0];
+	info->m_J2angularAxis[s3 + 1] = -p[1];
+	info->m_J2angularAxis[s3 + 2] = -p[2];
+	info->m_J2angularAxis[s4 + 0] = -q[0];
+	info->m_J2angularAxis[s4 + 1] = -q[1];
+	info->m_J2angularAxis[s4 + 2] = -q[2];
+	// compute the right hand side of the constraint equation. set relative
+	// body velocities along p and q to bring the hinge back into alignment.
+	// if ax1A,ax1B are the unit length hinge axes as computed from bodyA and
+	// bodyB, we need to rotate both bodies along the axis u = (ax1 x ax2).
+	// if "theta" is the angle between ax1 and ax2, we need an angular velocity
+	// along u to cover angle erp*theta in one step :
+	//   |angular_velocity| = angle/time = erp*theta / stepsize
+	//                      = (erp*fps) * theta
+	//    angular_velocity  = |angular_velocity| * (ax1 x ax2) / |ax1 x ax2|
+	//                      = (erp*fps) * theta * (ax1 x ax2) / sin(theta)
+	// ...as ax1 and ax2 are unit length. if theta is smallish,
+	// theta ~= sin(theta), so
+	//    angular_velocity  = (erp*fps) * (ax1 x ax2)
+	// ax1 x ax2 is in the plane space of ax1, so we project the angular
+	// velocity to p and q to find the right hand side.
+	k = info->fps * info->erp;
+	btVector3 u = ax1A.cross(ax1B);
+	info->m_constraintError[s3] = k * u.dot(p);
+	info->m_constraintError[s4] = k * u.dot(q);
+#endif
+	// check angular limits
+	nrow = 4; // last filled row
+	int srow;
+	btScalar limit_err = btScalar(0.0);
+	int limit = 0;
+	if(getSolveLimit())
+	{
+#ifdef	_BT_USE_CENTER_LIMIT_
+	limit_err = m_limit.getCorrection() * m_referenceSign;
+#else
+	limit_err = m_correction * m_referenceSign;
+#endif
+	limit = (limit_err > btScalar(0.0)) ? 1 : 2;
+
+	}
+	// if the hinge has joint limits or motor, add in the extra row
+	int powered = 0;
+	if(getEnableAngularMotor())
+	{
+		powered = 1;
+	}
+	if(limit || powered) 
+	{
+		nrow++;
+		srow = nrow * info->rowskip;
+		info->m_J1angularAxis[srow+0] = ax1[0];
+		info->m_J1angularAxis[srow+1] = ax1[1];
+		info->m_J1angularAxis[srow+2] = ax1[2];
+
+		info->m_J2angularAxis[srow+0] = -ax1[0];
+		info->m_J2angularAxis[srow+1] = -ax1[1];
+		info->m_J2angularAxis[srow+2] = -ax1[2];
+
+		btScalar lostop = getLowerLimit();
+		btScalar histop = getUpperLimit();
+		if(limit && (lostop == histop))
+		{  // the joint motor is ineffective
+			powered = 0;
+		}
+		info->m_constraintError[srow] = btScalar(0.0f);
+		btScalar currERP = (m_flags & BT_HINGE_FLAGS_ERP_STOP) ? m_stopERP : info->erp;
+		if(powered)
+		{
+			if(m_flags & BT_HINGE_FLAGS_CFM_NORM)
+			{
+				info->cfm[srow] = m_normalCFM;
+			}
+			btScalar mot_fact = getMotorFactor(m_hingeAngle, lostop, histop, m_motorTargetVelocity, info->fps * currERP);
+			info->m_constraintError[srow] += mot_fact * m_motorTargetVelocity * m_referenceSign;
+			info->m_lowerLimit[srow] = - m_maxMotorImpulse;
+			info->m_upperLimit[srow] =   m_maxMotorImpulse;
+		}
+		if(limit)
+		{
+			k = info->fps * currERP;
+			info->m_constraintError[srow] += k * limit_err;
+			if(m_flags & BT_HINGE_FLAGS_CFM_STOP)
+			{
+				info->cfm[srow] = m_stopCFM;
+			}
+			if(lostop == histop) 
+			{
+				// limited low and high simultaneously
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			}
+			else if(limit == 1) 
+			{ // low limit
+				info->m_lowerLimit[srow] = 0;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			}
+			else 
+			{ // high limit
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = 0;
+			}
+			// bounce (we'll use slider parameter abs(1.0 - m_dampingLimAng) for that)
+#ifdef	_BT_USE_CENTER_LIMIT_
+			btScalar bounce = m_limit.getRelaxationFactor();
+#else
+			btScalar bounce = m_relaxationFactor;
+#endif
+			if(bounce > btScalar(0.0))
+			{
+				btScalar vel = angVelA.dot(ax1);
+				vel -= angVelB.dot(ax1);
+				// only apply bounce if the velocity is incoming, and if the
+				// resulting c[] exceeds what we already have.
+				if(limit == 1)
+				{	// low limit
+					if(vel < 0)
+					{
+						btScalar newc = -bounce * vel;
+						if(newc > info->m_constraintError[srow])
+						{
+							info->m_constraintError[srow] = newc;
+						}
+					}
+				}
+				else
+				{	// high limit - all those computations are reversed
+					if(vel > 0)
+					{
+						btScalar newc = -bounce * vel;
+						if(newc < info->m_constraintError[srow])
+						{
+							info->m_constraintError[srow] = newc;
+						}
+					}
+				}
+			}
+#ifdef	_BT_USE_CENTER_LIMIT_
+			info->m_constraintError[srow] *= m_limit.getBiasFactor();
+#else
+			info->m_constraintError[srow] *= m_biasFactor;
+#endif
+		} // if(limit)
+	} // if angular limit or powered
+}
+
+
+///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+///If no axis is provided, it uses the default axis for this constraint.
+void btHingeConstraint::setParam(int num, btScalar value, int axis)
+{
+	if((axis == -1) || (axis == 5))
+	{
+		switch(num)
+		{	
+			case BT_CONSTRAINT_STOP_ERP :
+				m_stopERP = value;
+				m_flags |= BT_HINGE_FLAGS_ERP_STOP;
+				break;
+			case BT_CONSTRAINT_STOP_CFM :
+				m_stopCFM = value;
+				m_flags |= BT_HINGE_FLAGS_CFM_STOP;
+				break;
+			case BT_CONSTRAINT_CFM :
+				m_normalCFM = value;
+				m_flags |= BT_HINGE_FLAGS_CFM_NORM;
+				break;
+			default : 
+				btAssertConstrParams(0);
+		}
+	}
+	else
+	{
+		btAssertConstrParams(0);
+	}
+}
+
+///return the local value of parameter
+btScalar btHingeConstraint::getParam(int num, int axis) const 
+{
+	btScalar retVal = 0;
+	if((axis == -1) || (axis == 5))
+	{
+		switch(num)
+		{	
+			case BT_CONSTRAINT_STOP_ERP :
+				btAssertConstrParams(m_flags & BT_HINGE_FLAGS_ERP_STOP);
+				retVal = m_stopERP;
+				break;
+			case BT_CONSTRAINT_STOP_CFM :
+				btAssertConstrParams(m_flags & BT_HINGE_FLAGS_CFM_STOP);
+				retVal = m_stopCFM;
+				break;
+			case BT_CONSTRAINT_CFM :
+				btAssertConstrParams(m_flags & BT_HINGE_FLAGS_CFM_NORM);
+				retVal = m_normalCFM;
+				break;
+			default : 
+				btAssertConstrParams(0);
+		}
+	}
+	else
+	{
+		btAssertConstrParams(0);
+	}
+	return retVal;
+}
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h
new file mode 100644
index 0000000..cb2973e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h
@@ -0,0 +1,381 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/* Hinge Constraint by Dirk Gregorius. Limits added by Marcus Hennix at Starbreeze Studios */
+
+#ifndef BT_HINGECONSTRAINT_H
+#define BT_HINGECONSTRAINT_H
+
+#define _BT_USE_CENTER_LIMIT_ 1
+
+
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+#include "btTypedConstraint.h"
+
+class btRigidBody;
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btHingeConstraintData	btHingeConstraintDoubleData
+#define btHingeConstraintDataName	"btHingeConstraintDoubleData"
+#else
+#define btHingeConstraintData	btHingeConstraintFloatData
+#define btHingeConstraintDataName	"btHingeConstraintFloatData"
+#endif //BT_USE_DOUBLE_PRECISION
+
+
+
+enum btHingeFlags
+{
+	BT_HINGE_FLAGS_CFM_STOP = 1,
+	BT_HINGE_FLAGS_ERP_STOP = 2,
+	BT_HINGE_FLAGS_CFM_NORM = 4
+};
+
+
+/// hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space
+/// axis defines the orientation of the hinge axis
+ATTRIBUTE_ALIGNED16(class) btHingeConstraint : public btTypedConstraint
+{
+#ifdef IN_PARALLELL_SOLVER
+public:
+#endif
+	btJacobianEntry	m_jac[3]; //3 orthogonal linear constraints
+	btJacobianEntry	m_jacAng[3]; //2 orthogonal angular constraints+ 1 for limit/motor
+
+	btTransform m_rbAFrame; // constraint axii. Assumes z is hinge axis.
+	btTransform m_rbBFrame;
+
+	btScalar	m_motorTargetVelocity;
+	btScalar	m_maxMotorImpulse;
+
+
+#ifdef	_BT_USE_CENTER_LIMIT_
+	btAngularLimit	m_limit;
+#else
+	btScalar	m_lowerLimit;	
+	btScalar	m_upperLimit;	
+	btScalar	m_limitSign;
+	btScalar	m_correction;
+
+	btScalar	m_limitSoftness; 
+	btScalar	m_biasFactor; 
+	btScalar	m_relaxationFactor; 
+
+	bool		m_solveLimit;
+#endif
+
+	btScalar	m_kHinge;
+
+
+	btScalar	m_accLimitImpulse;
+	btScalar	m_hingeAngle;
+	btScalar	m_referenceSign;
+
+	bool		m_angularOnly;
+	bool		m_enableAngularMotor;
+	bool		m_useSolveConstraintObsolete;
+	bool		m_useOffsetForConstraintFrame;
+	bool		m_useReferenceFrameA;
+
+	btScalar	m_accMotorImpulse;
+
+	int			m_flags;
+	btScalar	m_normalCFM;
+	btScalar	m_stopCFM;
+	btScalar	m_stopERP;
+
+	
+public:
+
+	btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA = false);
+
+	btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA = false);
+	
+	btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA = false);
+
+	btHingeConstraint(btRigidBody& rbA,const btTransform& rbAFrame, bool useReferenceFrameA = false);
+
+
+	virtual void	buildJacobian();
+
+	virtual void getInfo1 (btConstraintInfo1* info);
+
+	void getInfo1NonVirtual(btConstraintInfo1* info);
+
+	virtual void getInfo2 (btConstraintInfo2* info);
+
+	void	getInfo2NonVirtual(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
+
+	void	getInfo2Internal(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
+	void	getInfo2InternalUsingFrameOffset(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
+		
+
+	void	updateRHS(btScalar	timeStep);
+
+	const btRigidBody& getRigidBodyA() const
+	{
+		return m_rbA;
+	}
+	const btRigidBody& getRigidBodyB() const
+	{
+		return m_rbB;
+	}
+
+	btRigidBody& getRigidBodyA()	
+	{		
+		return m_rbA;	
+	}	
+
+	btRigidBody& getRigidBodyB()	
+	{		
+		return m_rbB;	
+	}
+
+	btTransform& getFrameOffsetA()
+	{
+	return m_rbAFrame;
+	}
+
+	btTransform& getFrameOffsetB()
+	{
+		return m_rbBFrame;
+	}
+
+	void setFrames(const btTransform& frameA, const btTransform& frameB);
+	
+	void	setAngularOnly(bool angularOnly)
+	{
+		m_angularOnly = angularOnly;
+	}
+
+	void	enableAngularMotor(bool enableMotor,btScalar targetVelocity,btScalar maxMotorImpulse)
+	{
+		m_enableAngularMotor  = enableMotor;
+		m_motorTargetVelocity = targetVelocity;
+		m_maxMotorImpulse = maxMotorImpulse;
+	}
+
+	// extra motor API, including ability to set a target rotation (as opposed to angular velocity)
+	// note: setMotorTarget sets angular velocity under the hood, so you must call it every tick to
+	//       maintain a given angular target.
+	void enableMotor(bool enableMotor) 	{ m_enableAngularMotor = enableMotor; }
+	void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; }
+	void setMotorTarget(const btQuaternion& qAinB, btScalar dt); // qAinB is rotation of body A wrt body B.
+	void setMotorTarget(btScalar targetAngle, btScalar dt);
+
+
+	void	setLimit(btScalar low,btScalar high,btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
+	{
+#ifdef	_BT_USE_CENTER_LIMIT_
+		m_limit.set(low, high, _softness, _biasFactor, _relaxationFactor);
+#else
+		m_lowerLimit = btNormalizeAngle(low);
+		m_upperLimit = btNormalizeAngle(high);
+		m_limitSoftness =  _softness;
+		m_biasFactor = _biasFactor;
+		m_relaxationFactor = _relaxationFactor;
+#endif
+	}
+
+	void	setAxis(btVector3& axisInA)
+	{
+		btVector3 rbAxisA1, rbAxisA2;
+		btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2);
+		btVector3 pivotInA = m_rbAFrame.getOrigin();
+//		m_rbAFrame.getOrigin() = pivotInA;
+		m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(),
+										rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(),
+										rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() );
+
+		btVector3 axisInB = m_rbA.getCenterOfMassTransform().getBasis() * axisInA;
+
+		btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB);
+		btVector3 rbAxisB1 =  quatRotate(rotationArc,rbAxisA1);
+		btVector3 rbAxisB2 = axisInB.cross(rbAxisB1);
+
+		m_rbBFrame.getOrigin() = m_rbB.getCenterOfMassTransform().inverse()(m_rbA.getCenterOfMassTransform()(pivotInA));
+
+		m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
+										rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
+										rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
+		m_rbBFrame.getBasis() = m_rbB.getCenterOfMassTransform().getBasis().inverse() * m_rbBFrame.getBasis();
+
+	}
+
+	btScalar	getLowerLimit() const
+	{
+#ifdef	_BT_USE_CENTER_LIMIT_
+	return m_limit.getLow();
+#else
+	return m_lowerLimit;
+#endif
+	}
+
+	btScalar	getUpperLimit() const
+	{
+#ifdef	_BT_USE_CENTER_LIMIT_
+	return m_limit.getHigh();
+#else		
+	return m_upperLimit;
+#endif
+	}
+
+
+	btScalar getHingeAngle();
+
+	btScalar getHingeAngle(const btTransform& transA,const btTransform& transB);
+
+	void testLimit(const btTransform& transA,const btTransform& transB);
+
+
+	const btTransform& getAFrame() const { return m_rbAFrame; };	
+	const btTransform& getBFrame() const { return m_rbBFrame; };
+
+	btTransform& getAFrame() { return m_rbAFrame; };	
+	btTransform& getBFrame() { return m_rbBFrame; };
+
+	inline int getSolveLimit()
+	{
+#ifdef	_BT_USE_CENTER_LIMIT_
+	return m_limit.isLimit();
+#else
+	return m_solveLimit;
+#endif
+	}
+
+	inline btScalar getLimitSign()
+	{
+#ifdef	_BT_USE_CENTER_LIMIT_
+	return m_limit.getSign();
+#else
+		return m_limitSign;
+#endif
+	}
+
+	inline bool getAngularOnly() 
+	{ 
+		return m_angularOnly; 
+	}
+	inline bool getEnableAngularMotor() 
+	{ 
+		return m_enableAngularMotor; 
+	}
+	inline btScalar getMotorTargetVelosity() 
+	{ 
+		return m_motorTargetVelocity; 
+	}
+	inline btScalar getMaxMotorImpulse() 
+	{ 
+		return m_maxMotorImpulse; 
+	}
+	// access for UseFrameOffset
+	bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
+	void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
+
+
+	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+	///If no axis is provided, it uses the default axis for this constraint.
+	virtual	void	setParam(int num, btScalar value, int axis = -1);
+	///return the local value of parameter
+	virtual	btScalar getParam(int num, int axis = -1) const;
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btHingeConstraintDoubleData
+{
+	btTypedConstraintData	m_typeConstraintData;
+	btTransformDoubleData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
+	btTransformDoubleData m_rbBFrame;
+	int			m_useReferenceFrameA;
+	int			m_angularOnly;
+	int			m_enableAngularMotor;
+	float	m_motorTargetVelocity;
+	float	m_maxMotorImpulse;
+
+	float	m_lowerLimit;
+	float	m_upperLimit;
+	float	m_limitSoftness;
+	float	m_biasFactor;
+	float	m_relaxationFactor;
+
+};
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btHingeConstraintFloatData
+{
+	btTypedConstraintData	m_typeConstraintData;
+	btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
+	btTransformFloatData m_rbBFrame;
+	int			m_useReferenceFrameA;
+	int			m_angularOnly;
+	
+	int			m_enableAngularMotor;
+	float	m_motorTargetVelocity;
+	float	m_maxMotorImpulse;
+
+	float	m_lowerLimit;
+	float	m_upperLimit;
+	float	m_limitSoftness;
+	float	m_biasFactor;
+	float	m_relaxationFactor;
+
+};
+
+
+
+SIMD_FORCE_INLINE	int	btHingeConstraint::calculateSerializeBufferSize() const
+{
+	return sizeof(btHingeConstraintData);
+}
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btHingeConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btHingeConstraintData* hingeData = (btHingeConstraintData*)dataBuffer;
+	btTypedConstraint::serialize(&hingeData->m_typeConstraintData,serializer);
+
+	m_rbAFrame.serialize(hingeData->m_rbAFrame);
+	m_rbBFrame.serialize(hingeData->m_rbBFrame);
+
+	hingeData->m_angularOnly = m_angularOnly;
+	hingeData->m_enableAngularMotor = m_enableAngularMotor;
+	hingeData->m_maxMotorImpulse = float(m_maxMotorImpulse);
+	hingeData->m_motorTargetVelocity = float(m_motorTargetVelocity);
+	hingeData->m_useReferenceFrameA = m_useReferenceFrameA;
+#ifdef	_BT_USE_CENTER_LIMIT_
+	hingeData->m_lowerLimit = float(m_limit.getLow());
+	hingeData->m_upperLimit = float(m_limit.getHigh());
+	hingeData->m_limitSoftness = float(m_limit.getSoftness());
+	hingeData->m_biasFactor = float(m_limit.getBiasFactor());
+	hingeData->m_relaxationFactor = float(m_limit.getRelaxationFactor());
+#else
+	hingeData->m_lowerLimit = float(m_lowerLimit);
+	hingeData->m_upperLimit = float(m_upperLimit);
+	hingeData->m_limitSoftness = float(m_limitSoftness);
+	hingeData->m_biasFactor = float(m_biasFactor);
+	hingeData->m_relaxationFactor = float(m_relaxationFactor);
+#endif
+
+	return btHingeConstraintDataName;
+}
+
+#endif //BT_HINGECONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h
new file mode 100644
index 0000000..f1994a2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h
@@ -0,0 +1,156 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_JACOBIAN_ENTRY_H
+#define BT_JACOBIAN_ENTRY_H
+
+#include "LinearMath/btVector3.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+
+
+//notes:
+// Another memory optimization would be to store m_1MinvJt in the remaining 3 w components
+// which makes the btJacobianEntry memory layout 16 bytes
+// if you only are interested in angular part, just feed massInvA and massInvB zero
+
+/// Jacobian entry is an abstraction that allows to describe constraints
+/// it can be used in combination with a constraint solver
+/// Can be used to relate the effect of an impulse to the constraint error
+ATTRIBUTE_ALIGNED16(class) btJacobianEntry
+{
+public:
+	btJacobianEntry() {};
+	//constraint between two different rigidbodies
+	btJacobianEntry(
+		const btMatrix3x3& world2A,
+		const btMatrix3x3& world2B,
+		const btVector3& rel_pos1,const btVector3& rel_pos2,
+		const btVector3& jointAxis,
+		const btVector3& inertiaInvA, 
+		const btScalar massInvA,
+		const btVector3& inertiaInvB,
+		const btScalar massInvB)
+		:m_linearJointAxis(jointAxis)
+	{
+		m_aJ = world2A*(rel_pos1.cross(m_linearJointAxis));
+		m_bJ = world2B*(rel_pos2.cross(-m_linearJointAxis));
+		m_0MinvJt	= inertiaInvA * m_aJ;
+		m_1MinvJt = inertiaInvB * m_bJ;
+		m_Adiag = massInvA + m_0MinvJt.dot(m_aJ) + massInvB + m_1MinvJt.dot(m_bJ);
+
+		btAssert(m_Adiag > btScalar(0.0));
+	}
+
+	//angular constraint between two different rigidbodies
+	btJacobianEntry(const btVector3& jointAxis,
+		const btMatrix3x3& world2A,
+		const btMatrix3x3& world2B,
+		const btVector3& inertiaInvA,
+		const btVector3& inertiaInvB)
+		:m_linearJointAxis(btVector3(btScalar(0.),btScalar(0.),btScalar(0.)))
+	{
+		m_aJ= world2A*jointAxis;
+		m_bJ = world2B*-jointAxis;
+		m_0MinvJt	= inertiaInvA * m_aJ;
+		m_1MinvJt = inertiaInvB * m_bJ;
+		m_Adiag =  m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ);
+
+		btAssert(m_Adiag > btScalar(0.0));
+	}
+
+	//angular constraint between two different rigidbodies
+	btJacobianEntry(const btVector3& axisInA,
+		const btVector3& axisInB,
+		const btVector3& inertiaInvA,
+		const btVector3& inertiaInvB)
+		: m_linearJointAxis(btVector3(btScalar(0.),btScalar(0.),btScalar(0.)))
+		, m_aJ(axisInA)
+		, m_bJ(-axisInB)
+	{
+		m_0MinvJt	= inertiaInvA * m_aJ;
+		m_1MinvJt = inertiaInvB * m_bJ;
+		m_Adiag =  m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ);
+
+		btAssert(m_Adiag > btScalar(0.0));
+	}
+
+	//constraint on one rigidbody
+	btJacobianEntry(
+		const btMatrix3x3& world2A,
+		const btVector3& rel_pos1,const btVector3& rel_pos2,
+		const btVector3& jointAxis,
+		const btVector3& inertiaInvA, 
+		const btScalar massInvA)
+		:m_linearJointAxis(jointAxis)
+	{
+		m_aJ= world2A*(rel_pos1.cross(jointAxis));
+		m_bJ = world2A*(rel_pos2.cross(-jointAxis));
+		m_0MinvJt	= inertiaInvA * m_aJ;
+		m_1MinvJt = btVector3(btScalar(0.),btScalar(0.),btScalar(0.));
+		m_Adiag = massInvA + m_0MinvJt.dot(m_aJ);
+
+		btAssert(m_Adiag > btScalar(0.0));
+	}
+
+	btScalar	getDiagonal() const { return m_Adiag; }
+
+	// for two constraints on the same rigidbody (for example vehicle friction)
+	btScalar	getNonDiagonal(const btJacobianEntry& jacB, const btScalar massInvA) const
+	{
+		const btJacobianEntry& jacA = *this;
+		btScalar lin = massInvA * jacA.m_linearJointAxis.dot(jacB.m_linearJointAxis);
+		btScalar ang = jacA.m_0MinvJt.dot(jacB.m_aJ);
+		return lin + ang;
+	}
+
+	
+
+	// for two constraints on sharing two same rigidbodies (for example two contact points between two rigidbodies)
+	btScalar	getNonDiagonal(const btJacobianEntry& jacB,const btScalar massInvA,const btScalar massInvB) const
+	{
+		const btJacobianEntry& jacA = *this;
+		btVector3 lin = jacA.m_linearJointAxis * jacB.m_linearJointAxis;
+		btVector3 ang0 = jacA.m_0MinvJt * jacB.m_aJ;
+		btVector3 ang1 = jacA.m_1MinvJt * jacB.m_bJ;
+		btVector3 lin0 = massInvA * lin ;
+		btVector3 lin1 = massInvB * lin;
+		btVector3 sum = ang0+ang1+lin0+lin1;
+		return sum[0]+sum[1]+sum[2];
+	}
+
+	btScalar getRelativeVelocity(const btVector3& linvelA,const btVector3& angvelA,const btVector3& linvelB,const btVector3& angvelB)
+	{
+		btVector3 linrel = linvelA - linvelB;
+		btVector3 angvela  = angvelA * m_aJ;
+		btVector3 angvelb  = angvelB * m_bJ;
+		linrel *= m_linearJointAxis;
+		angvela += angvelb;
+		angvela += linrel;
+		btScalar rel_vel2 = angvela[0]+angvela[1]+angvela[2];
+		return rel_vel2 + SIMD_EPSILON;
+	}
+//private:
+
+	btVector3	m_linearJointAxis;
+	btVector3	m_aJ;
+	btVector3	m_bJ;
+	btVector3	m_0MinvJt;
+	btVector3	m_1MinvJt;
+	//Optimization: can be stored in the w/last component of one of the vectors
+	btScalar	m_Adiag;
+
+};
+
+#endif //BT_JACOBIAN_ENTRY_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
new file mode 100644
index 0000000..7e0d93b
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
@@ -0,0 +1,230 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btPoint2PointConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include <new>
+
+
+
+
+
+btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB)
+:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE,rbA,rbB),m_pivotInA(pivotInA),m_pivotInB(pivotInB),
+m_flags(0),
+m_useSolveConstraintObsolete(false)
+{
+
+}
+
+
+btPoint2PointConstraint::btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA)
+:btTypedConstraint(POINT2POINT_CONSTRAINT_TYPE,rbA),m_pivotInA(pivotInA),m_pivotInB(rbA.getCenterOfMassTransform()(pivotInA)),
+m_flags(0),
+m_useSolveConstraintObsolete(false)
+{
+	
+}
+
+void	btPoint2PointConstraint::buildJacobian()
+{
+
+	///we need it for both methods
+	{
+		m_appliedImpulse = btScalar(0.);
+
+		btVector3	normal(0,0,0);
+
+		for (int i=0;i<3;i++)
+		{
+			normal[i] = 1;
+			new (&m_jac[i]) btJacobianEntry(
+			m_rbA.getCenterOfMassTransform().getBasis().transpose(),
+			m_rbB.getCenterOfMassTransform().getBasis().transpose(),
+			m_rbA.getCenterOfMassTransform()*m_pivotInA - m_rbA.getCenterOfMassPosition(),
+			m_rbB.getCenterOfMassTransform()*m_pivotInB - m_rbB.getCenterOfMassPosition(),
+			normal,
+			m_rbA.getInvInertiaDiagLocal(),
+			m_rbA.getInvMass(),
+			m_rbB.getInvInertiaDiagLocal(),
+			m_rbB.getInvMass());
+		normal[i] = 0;
+		}
+	}
+
+
+}
+
+void btPoint2PointConstraint::getInfo1 (btConstraintInfo1* info)
+{
+	getInfo1NonVirtual(info);
+}
+
+void btPoint2PointConstraint::getInfo1NonVirtual (btConstraintInfo1* info)
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		info->m_numConstraintRows = 0;
+		info->nub = 0;
+	} else
+	{
+		info->m_numConstraintRows = 3;
+		info->nub = 3;
+	}
+}
+
+
+
+
+void btPoint2PointConstraint::getInfo2 (btConstraintInfo2* info)
+{
+	getInfo2NonVirtual(info, m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+}
+
+void btPoint2PointConstraint::getInfo2NonVirtual (btConstraintInfo2* info, const btTransform& body0_trans, const btTransform& body1_trans)
+{
+	btAssert(!m_useSolveConstraintObsolete);
+
+	 //retrieve matrices
+
+	// anchor points in global coordinates with respect to body PORs.
+   
+    // set jacobian
+    info->m_J1linearAxis[0] = 1;
+	info->m_J1linearAxis[info->rowskip+1] = 1;
+	info->m_J1linearAxis[2*info->rowskip+2] = 1;
+
+	btVector3 a1 = body0_trans.getBasis()*getPivotInA();
+	{
+		btVector3* angular0 = (btVector3*)(info->m_J1angularAxis);
+		btVector3* angular1 = (btVector3*)(info->m_J1angularAxis+info->rowskip);
+		btVector3* angular2 = (btVector3*)(info->m_J1angularAxis+2*info->rowskip);
+		btVector3 a1neg = -a1;
+		a1neg.getSkewSymmetricMatrix(angular0,angular1,angular2);
+	}
+    
+	/*info->m_J2linearAxis[0] = -1;
+    info->m_J2linearAxis[s+1] = -1;
+    info->m_J2linearAxis[2*s+2] = -1;
+	*/
+	
+	btVector3 a2 = body1_trans.getBasis()*getPivotInB();
+   
+	{
+		btVector3 a2n = -a2;
+		btVector3* angular0 = (btVector3*)(info->m_J2angularAxis);
+		btVector3* angular1 = (btVector3*)(info->m_J2angularAxis+info->rowskip);
+		btVector3* angular2 = (btVector3*)(info->m_J2angularAxis+2*info->rowskip);
+		a2.getSkewSymmetricMatrix(angular0,angular1,angular2);
+	}
+    
+
+
+    // set right hand side
+	btScalar currERP = (m_flags & BT_P2P_FLAGS_ERP) ? m_erp : info->erp;
+    btScalar k = info->fps * currERP;
+    int j;
+	for (j=0; j<3; j++)
+    {
+        info->m_constraintError[j*info->rowskip] = k * (a2[j] + body1_trans.getOrigin()[j] - a1[j] - body0_trans.getOrigin()[j]);
+		//printf("info->m_constraintError[%d]=%f\n",j,info->m_constraintError[j]);
+    }
+	if(m_flags & BT_P2P_FLAGS_CFM)
+	{
+		for (j=0; j<3; j++)
+		{
+			info->cfm[j*info->rowskip] = m_cfm;
+		}
+	}
+
+	btScalar impulseClamp = m_setting.m_impulseClamp;//
+	for (j=0; j<3; j++)
+    {
+		if (m_setting.m_impulseClamp > 0)
+		{
+			info->m_lowerLimit[j*info->rowskip] = -impulseClamp;
+			info->m_upperLimit[j*info->rowskip] = impulseClamp;
+		}
+	}
+	info->m_damping = m_setting.m_damping;
+	
+}
+
+
+
+void	btPoint2PointConstraint::updateRHS(btScalar	timeStep)
+{
+	(void)timeStep;
+
+}
+
+///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+///If no axis is provided, it uses the default axis for this constraint.
+void btPoint2PointConstraint::setParam(int num, btScalar value, int axis)
+{
+	if(axis != -1)
+	{
+		btAssertConstrParams(0);
+	}
+	else
+	{
+		switch(num)
+		{
+			case BT_CONSTRAINT_ERP :
+			case BT_CONSTRAINT_STOP_ERP :
+				m_erp = value; 
+				m_flags |= BT_P2P_FLAGS_ERP;
+				break;
+			case BT_CONSTRAINT_CFM :
+			case BT_CONSTRAINT_STOP_CFM :
+				m_cfm = value; 
+				m_flags |= BT_P2P_FLAGS_CFM;
+				break;
+			default: 
+				btAssertConstrParams(0);
+		}
+	}
+}
+
+///return the local value of parameter
+btScalar btPoint2PointConstraint::getParam(int num, int axis) const 
+{
+	btScalar retVal(SIMD_INFINITY);
+	if(axis != -1)
+	{
+		btAssertConstrParams(0);
+	}
+	else
+	{
+		switch(num)
+		{
+			case BT_CONSTRAINT_ERP :
+			case BT_CONSTRAINT_STOP_ERP :
+				btAssertConstrParams(m_flags & BT_P2P_FLAGS_ERP);
+				retVal = m_erp; 
+				break;
+			case BT_CONSTRAINT_CFM :
+			case BT_CONSTRAINT_STOP_CFM :
+				btAssertConstrParams(m_flags & BT_P2P_FLAGS_CFM);
+				retVal = m_cfm; 
+				break;
+			default: 
+				btAssertConstrParams(0);
+		}
+	}
+	return retVal;
+}
+	
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h
new file mode 100644
index 0000000..b3bda03
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h
@@ -0,0 +1,161 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_POINT2POINTCONSTRAINT_H
+#define BT_POINT2POINTCONSTRAINT_H
+
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+#include "btTypedConstraint.h"
+
+class btRigidBody;
+
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btPoint2PointConstraintData	btPoint2PointConstraintDoubleData
+#define btPoint2PointConstraintDataName	"btPoint2PointConstraintDoubleData"
+#else
+#define btPoint2PointConstraintData	btPoint2PointConstraintFloatData
+#define btPoint2PointConstraintDataName	"btPoint2PointConstraintFloatData"
+#endif //BT_USE_DOUBLE_PRECISION
+
+struct	btConstraintSetting
+{
+	btConstraintSetting()	:
+		m_tau(btScalar(0.3)),
+		m_damping(btScalar(1.)),
+		m_impulseClamp(btScalar(0.))
+	{
+	}
+	btScalar		m_tau;
+	btScalar		m_damping;
+	btScalar		m_impulseClamp;
+};
+
+enum btPoint2PointFlags
+{
+	BT_P2P_FLAGS_ERP = 1,
+	BT_P2P_FLAGS_CFM = 2
+};
+
+/// point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space
+ATTRIBUTE_ALIGNED16(class) btPoint2PointConstraint : public btTypedConstraint
+{
+#ifdef IN_PARALLELL_SOLVER
+public:
+#endif
+	btJacobianEntry	m_jac[3]; //3 orthogonal linear constraints
+	
+	btVector3	m_pivotInA;
+	btVector3	m_pivotInB;
+	
+	int			m_flags;
+	btScalar	m_erp;
+	btScalar	m_cfm;
+	
+public:
+
+	///for backwards compatibility during the transition to 'getInfo/getInfo2'
+	bool		m_useSolveConstraintObsolete;
+
+	btConstraintSetting	m_setting;
+
+	btPoint2PointConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB);
+
+	btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA);
+
+
+	virtual void	buildJacobian();
+
+	virtual void getInfo1 (btConstraintInfo1* info);
+
+	void getInfo1NonVirtual (btConstraintInfo1* info);
+
+	virtual void getInfo2 (btConstraintInfo2* info);
+
+	void getInfo2NonVirtual (btConstraintInfo2* info, const btTransform& body0_trans, const btTransform& body1_trans);
+
+	void	updateRHS(btScalar	timeStep);
+
+	void	setPivotA(const btVector3& pivotA)
+	{
+		m_pivotInA = pivotA;
+	}
+
+	void	setPivotB(const btVector3& pivotB)
+	{
+		m_pivotInB = pivotB;
+	}
+
+	const btVector3& getPivotInA() const
+	{
+		return m_pivotInA;
+	}
+
+	const btVector3& getPivotInB() const
+	{
+		return m_pivotInB;
+	}
+
+	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+	///If no axis is provided, it uses the default axis for this constraint.
+	virtual	void	setParam(int num, btScalar value, int axis = -1);
+	///return the local value of parameter
+	virtual	btScalar getParam(int num, int axis = -1) const;
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btPoint2PointConstraintFloatData
+{
+	btTypedConstraintData	m_typeConstraintData;
+	btVector3FloatData	m_pivotInA;
+	btVector3FloatData	m_pivotInB;
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btPoint2PointConstraintDoubleData
+{
+	btTypedConstraintData	m_typeConstraintData;
+	btVector3DoubleData	m_pivotInA;
+	btVector3DoubleData	m_pivotInB;
+};
+
+
+SIMD_FORCE_INLINE	int	btPoint2PointConstraint::calculateSerializeBufferSize() const
+{
+	return sizeof(btPoint2PointConstraintData);
+
+}
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btPoint2PointConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btPoint2PointConstraintData* p2pData = (btPoint2PointConstraintData*)dataBuffer;
+
+	btTypedConstraint::serialize(&p2pData->m_typeConstraintData,serializer);
+	m_pivotInA.serialize(p2pData->m_pivotInA);
+	m_pivotInB.serialize(p2pData->m_pivotInB);
+
+	return btPoint2PointConstraintDataName;
+}
+
+#endif //BT_POINT2POINTCONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
new file mode 100644
index 0000000..c05e22f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
@@ -0,0 +1,1239 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+//#define COMPUTE_IMPULSE_DENOM 1
+//It is not necessary (redundant) to refresh contact manifolds, this refresh has been moved to the collision algorithms.
+
+#include "btSequentialImpulseConstraintSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "btContactConstraint.h"
+#include "btSolve2LinearConstraint.h"
+#include "btContactSolverInfo.h"
+#include "LinearMath/btIDebugDraw.h"
+#include "btJacobianEntry.h"
+#include "LinearMath/btMinMax.h"
+#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
+#include <new>
+#include "LinearMath/btStackAlloc.h"
+#include "LinearMath/btQuickprof.h"
+#include "btSolverBody.h"
+#include "btSolverConstraint.h"
+#include "LinearMath/btAlignedObjectArray.h"
+#include <string.h> //for memset
+
+int		gNumSplitImpulseRecoveries = 0;
+
+btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver()
+:m_btSeed2(0)
+{
+
+}
+
+btSequentialImpulseConstraintSolver::~btSequentialImpulseConstraintSolver()
+{
+}
+
+#ifdef USE_SIMD
+#include <emmintrin.h>
+#define btVecSplat(x, e) _mm_shuffle_ps(x, x, _MM_SHUFFLE(e,e,e,e))
+static inline __m128 btSimdDot3( __m128 vec0, __m128 vec1 )
+{
+	__m128 result = _mm_mul_ps( vec0, vec1);
+	return _mm_add_ps( btVecSplat( result, 0 ), _mm_add_ps( btVecSplat( result, 1 ), btVecSplat( result, 2 ) ) );
+}
+#endif//USE_SIMD
+
+// Project Gauss Seidel or the equivalent Sequential Impulse
+void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGenericSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
+{
+#ifdef USE_SIMD
+	__m128 cpAppliedImp = _mm_set1_ps(c.m_appliedImpulse);
+	__m128	lowerLimit1 = _mm_set1_ps(c.m_lowerLimit);
+	__m128	upperLimit1 = _mm_set1_ps(c.m_upperLimit);
+	__m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhs), _mm_mul_ps(_mm_set1_ps(c.m_appliedImpulse),_mm_set1_ps(c.m_cfm)));
+	__m128 deltaVel1Dotn	=	_mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetDeltaLinearVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetDeltaAngularVelocity().mVec128));
+	__m128 deltaVel2Dotn	=	_mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetDeltaAngularVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetDeltaLinearVelocity().mVec128));
+	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
+	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
+	btSimdScalar sum = _mm_add_ps(cpAppliedImp,deltaImpulse);
+	btSimdScalar resultLowerLess,resultUpperLess;
+	resultLowerLess = _mm_cmplt_ps(sum,lowerLimit1);
+	resultUpperLess = _mm_cmplt_ps(sum,upperLimit1);
+	__m128 lowMinApplied = _mm_sub_ps(lowerLimit1,cpAppliedImp);
+	deltaImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowMinApplied), _mm_andnot_ps(resultLowerLess, deltaImpulse) );
+	c.m_appliedImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowerLimit1), _mm_andnot_ps(resultLowerLess, sum) );
+	__m128 upperMinApplied = _mm_sub_ps(upperLimit1,cpAppliedImp);
+	deltaImpulse = _mm_or_ps( _mm_and_ps(resultUpperLess, deltaImpulse), _mm_andnot_ps(resultUpperLess, upperMinApplied) );
+	c.m_appliedImpulse = _mm_or_ps( _mm_and_ps(resultUpperLess, c.m_appliedImpulse), _mm_andnot_ps(resultUpperLess, upperLimit1) );
+	__m128	linearComponentA = _mm_mul_ps(c.m_contactNormal.mVec128,body1.internalGetInvMass().mVec128);
+	__m128	linearComponentB = _mm_mul_ps((c.m_contactNormal).mVec128,body2.internalGetInvMass().mVec128);
+	__m128 impulseMagnitude = deltaImpulse;
+	body1.internalGetDeltaLinearVelocity().mVec128 = _mm_add_ps(body1.internalGetDeltaLinearVelocity().mVec128,_mm_mul_ps(linearComponentA,impulseMagnitude));
+	body1.internalGetDeltaAngularVelocity().mVec128 = _mm_add_ps(body1.internalGetDeltaAngularVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentA.mVec128,impulseMagnitude));
+	body2.internalGetDeltaLinearVelocity().mVec128 = _mm_sub_ps(body2.internalGetDeltaLinearVelocity().mVec128,_mm_mul_ps(linearComponentB,impulseMagnitude));
+	body2.internalGetDeltaAngularVelocity().mVec128 = _mm_add_ps(body2.internalGetDeltaAngularVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentB.mVec128,impulseMagnitude));
+#else
+	resolveSingleConstraintRowGeneric(body1,body2,c);
+#endif
+}
+
+// Project Gauss Seidel or the equivalent Sequential Impulse
+ void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowGeneric(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
+{
+	btScalar deltaImpulse = c.m_rhs-btScalar(c.m_appliedImpulse)*c.m_cfm;
+	const btScalar deltaVel1Dotn	=	c.m_contactNormal.dot(body1.internalGetDeltaLinearVelocity()) 	+ c.m_relpos1CrossNormal.dot(body1.internalGetDeltaAngularVelocity());
+	const btScalar deltaVel2Dotn	=	-c.m_contactNormal.dot(body2.internalGetDeltaLinearVelocity()) + c.m_relpos2CrossNormal.dot(body2.internalGetDeltaAngularVelocity());
+
+//	const btScalar delta_rel_vel	=	deltaVel1Dotn-deltaVel2Dotn;
+	deltaImpulse	-=	deltaVel1Dotn*c.m_jacDiagABInv;
+	deltaImpulse	-=	deltaVel2Dotn*c.m_jacDiagABInv;
+
+	const btScalar sum = btScalar(c.m_appliedImpulse) + deltaImpulse;
+	if (sum < c.m_lowerLimit)
+	{
+		deltaImpulse = c.m_lowerLimit-c.m_appliedImpulse;
+		c.m_appliedImpulse = c.m_lowerLimit;
+	}
+	else if (sum > c.m_upperLimit) 
+	{
+		deltaImpulse = c.m_upperLimit-c.m_appliedImpulse;
+		c.m_appliedImpulse = c.m_upperLimit;
+	}
+	else
+	{
+		c.m_appliedImpulse = sum;
+	}
+		body1.internalApplyImpulse(c.m_contactNormal*body1.internalGetInvMass(),c.m_angularComponentA,deltaImpulse);
+		body2.internalApplyImpulse(-c.m_contactNormal*body2.internalGetInvMass(),c.m_angularComponentB,deltaImpulse);
+}
+
+ void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimitSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
+{
+#ifdef USE_SIMD
+	__m128 cpAppliedImp = _mm_set1_ps(c.m_appliedImpulse);
+	__m128	lowerLimit1 = _mm_set1_ps(c.m_lowerLimit);
+	__m128	upperLimit1 = _mm_set1_ps(c.m_upperLimit);
+	__m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhs), _mm_mul_ps(_mm_set1_ps(c.m_appliedImpulse),_mm_set1_ps(c.m_cfm)));
+	__m128 deltaVel1Dotn	=	_mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetDeltaLinearVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetDeltaAngularVelocity().mVec128));
+	__m128 deltaVel2Dotn	=	_mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetDeltaAngularVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetDeltaLinearVelocity().mVec128));
+	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
+	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
+	btSimdScalar sum = _mm_add_ps(cpAppliedImp,deltaImpulse);
+	btSimdScalar resultLowerLess,resultUpperLess;
+	resultLowerLess = _mm_cmplt_ps(sum,lowerLimit1);
+	resultUpperLess = _mm_cmplt_ps(sum,upperLimit1);
+	__m128 lowMinApplied = _mm_sub_ps(lowerLimit1,cpAppliedImp);
+	deltaImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowMinApplied), _mm_andnot_ps(resultLowerLess, deltaImpulse) );
+	c.m_appliedImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowerLimit1), _mm_andnot_ps(resultLowerLess, sum) );
+	__m128	linearComponentA = _mm_mul_ps(c.m_contactNormal.mVec128,body1.internalGetInvMass().mVec128);
+	__m128	linearComponentB = _mm_mul_ps((c.m_contactNormal).mVec128,body2.internalGetInvMass().mVec128);
+	__m128 impulseMagnitude = deltaImpulse;
+	body1.internalGetDeltaLinearVelocity().mVec128 = _mm_add_ps(body1.internalGetDeltaLinearVelocity().mVec128,_mm_mul_ps(linearComponentA,impulseMagnitude));
+	body1.internalGetDeltaAngularVelocity().mVec128 = _mm_add_ps(body1.internalGetDeltaAngularVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentA.mVec128,impulseMagnitude));
+	body2.internalGetDeltaLinearVelocity().mVec128 = _mm_sub_ps(body2.internalGetDeltaLinearVelocity().mVec128,_mm_mul_ps(linearComponentB,impulseMagnitude));
+	body2.internalGetDeltaAngularVelocity().mVec128 = _mm_add_ps(body2.internalGetDeltaAngularVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentB.mVec128,impulseMagnitude));
+#else
+	resolveSingleConstraintRowLowerLimit(body1,body2,c);
+#endif
+}
+
+// Project Gauss Seidel or the equivalent Sequential Impulse
+ void btSequentialImpulseConstraintSolver::resolveSingleConstraintRowLowerLimit(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
+{
+	btScalar deltaImpulse = c.m_rhs-btScalar(c.m_appliedImpulse)*c.m_cfm;
+	const btScalar deltaVel1Dotn	=	c.m_contactNormal.dot(body1.internalGetDeltaLinearVelocity()) 	+ c.m_relpos1CrossNormal.dot(body1.internalGetDeltaAngularVelocity());
+	const btScalar deltaVel2Dotn	=	-c.m_contactNormal.dot(body2.internalGetDeltaLinearVelocity()) + c.m_relpos2CrossNormal.dot(body2.internalGetDeltaAngularVelocity());
+
+	deltaImpulse	-=	deltaVel1Dotn*c.m_jacDiagABInv;
+	deltaImpulse	-=	deltaVel2Dotn*c.m_jacDiagABInv;
+	const btScalar sum = btScalar(c.m_appliedImpulse) + deltaImpulse;
+	if (sum < c.m_lowerLimit)
+	{
+		deltaImpulse = c.m_lowerLimit-c.m_appliedImpulse;
+		c.m_appliedImpulse = c.m_lowerLimit;
+	}
+	else
+	{
+		c.m_appliedImpulse = sum;
+	}
+	body1.internalApplyImpulse(c.m_contactNormal*body1.internalGetInvMass(),c.m_angularComponentA,deltaImpulse);
+	body2.internalApplyImpulse(-c.m_contactNormal*body2.internalGetInvMass(),c.m_angularComponentB,deltaImpulse);
+}
+
+
+void	btSequentialImpulseConstraintSolver::resolveSplitPenetrationImpulseCacheFriendly(
+        btRigidBody& body1,
+        btRigidBody& body2,
+        const btSolverConstraint& c)
+{
+		if (c.m_rhsPenetration)
+        {
+			gNumSplitImpulseRecoveries++;
+			btScalar deltaImpulse = c.m_rhsPenetration-btScalar(c.m_appliedPushImpulse)*c.m_cfm;
+			const btScalar deltaVel1Dotn	=	c.m_contactNormal.dot(body1.internalGetPushVelocity()) 	+ c.m_relpos1CrossNormal.dot(body1.internalGetTurnVelocity());
+			const btScalar deltaVel2Dotn	=	-c.m_contactNormal.dot(body2.internalGetPushVelocity()) + c.m_relpos2CrossNormal.dot(body2.internalGetTurnVelocity());
+
+			deltaImpulse	-=	deltaVel1Dotn*c.m_jacDiagABInv;
+			deltaImpulse	-=	deltaVel2Dotn*c.m_jacDiagABInv;
+			const btScalar sum = btScalar(c.m_appliedPushImpulse) + deltaImpulse;
+			if (sum < c.m_lowerLimit)
+			{
+				deltaImpulse = c.m_lowerLimit-c.m_appliedPushImpulse;
+				c.m_appliedPushImpulse = c.m_lowerLimit;
+			}
+			else
+			{
+				c.m_appliedPushImpulse = sum;
+			}
+			body1.internalApplyPushImpulse(c.m_contactNormal*body1.internalGetInvMass(),c.m_angularComponentA,deltaImpulse);
+			body2.internalApplyPushImpulse(-c.m_contactNormal*body2.internalGetInvMass(),c.m_angularComponentB,deltaImpulse);
+        }
+}
+
+ void btSequentialImpulseConstraintSolver::resolveSplitPenetrationSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& c)
+{
+#ifdef USE_SIMD
+	if (!c.m_rhsPenetration)
+		return;
+
+	gNumSplitImpulseRecoveries++;
+
+	__m128 cpAppliedImp = _mm_set1_ps(c.m_appliedPushImpulse);
+	__m128	lowerLimit1 = _mm_set1_ps(c.m_lowerLimit);
+	__m128	upperLimit1 = _mm_set1_ps(c.m_upperLimit);
+	__m128 deltaImpulse = _mm_sub_ps(_mm_set1_ps(c.m_rhsPenetration), _mm_mul_ps(_mm_set1_ps(c.m_appliedPushImpulse),_mm_set1_ps(c.m_cfm)));
+	__m128 deltaVel1Dotn	=	_mm_add_ps(btSimdDot3(c.m_contactNormal.mVec128,body1.internalGetPushVelocity().mVec128), btSimdDot3(c.m_relpos1CrossNormal.mVec128,body1.internalGetTurnVelocity().mVec128));
+	__m128 deltaVel2Dotn	=	_mm_sub_ps(btSimdDot3(c.m_relpos2CrossNormal.mVec128,body2.internalGetTurnVelocity().mVec128),btSimdDot3((c.m_contactNormal).mVec128,body2.internalGetPushVelocity().mVec128));
+	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel1Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
+	deltaImpulse	=	_mm_sub_ps(deltaImpulse,_mm_mul_ps(deltaVel2Dotn,_mm_set1_ps(c.m_jacDiagABInv)));
+	btSimdScalar sum = _mm_add_ps(cpAppliedImp,deltaImpulse);
+	btSimdScalar resultLowerLess,resultUpperLess;
+	resultLowerLess = _mm_cmplt_ps(sum,lowerLimit1);
+	resultUpperLess = _mm_cmplt_ps(sum,upperLimit1);
+	__m128 lowMinApplied = _mm_sub_ps(lowerLimit1,cpAppliedImp);
+	deltaImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowMinApplied), _mm_andnot_ps(resultLowerLess, deltaImpulse) );
+	c.m_appliedImpulse = _mm_or_ps( _mm_and_ps(resultLowerLess, lowerLimit1), _mm_andnot_ps(resultLowerLess, sum) );
+	__m128	linearComponentA = _mm_mul_ps(c.m_contactNormal.mVec128,body1.internalGetInvMass().mVec128);
+	__m128	linearComponentB = _mm_mul_ps((c.m_contactNormal).mVec128,body2.internalGetInvMass().mVec128);
+	__m128 impulseMagnitude = deltaImpulse;
+	body1.internalGetPushVelocity().mVec128 = _mm_add_ps(body1.internalGetPushVelocity().mVec128,_mm_mul_ps(linearComponentA,impulseMagnitude));
+	body1.internalGetTurnVelocity().mVec128 = _mm_add_ps(body1.internalGetTurnVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentA.mVec128,impulseMagnitude));
+	body2.internalGetPushVelocity().mVec128 = _mm_sub_ps(body2.internalGetPushVelocity().mVec128,_mm_mul_ps(linearComponentB,impulseMagnitude));
+	body2.internalGetTurnVelocity().mVec128 = _mm_add_ps(body2.internalGetTurnVelocity().mVec128 ,_mm_mul_ps(c.m_angularComponentB.mVec128,impulseMagnitude));
+#else
+	resolveSplitPenetrationImpulseCacheFriendly(body1,body2,c);
+#endif
+}
+
+
+
+unsigned long btSequentialImpulseConstraintSolver::btRand2()
+{
+	m_btSeed2 = (1664525L*m_btSeed2 + 1013904223L) & 0xffffffff;
+	return m_btSeed2;
+}
+
+
+
+//See ODE: adam's all-int straightforward(?) dRandInt (0..n-1)
+int btSequentialImpulseConstraintSolver::btRandInt2 (int n)
+{
+	// seems good; xor-fold and modulus
+	const unsigned long un = static_cast<unsigned long>(n);
+	unsigned long r = btRand2();
+
+	// note: probably more aggressive than it needs to be -- might be
+	//       able to get away without one or two of the innermost branches.
+	if (un <= 0x00010000UL) {
+		r ^= (r >> 16);
+		if (un <= 0x00000100UL) {
+			r ^= (r >> 8);
+			if (un <= 0x00000010UL) {
+				r ^= (r >> 4);
+				if (un <= 0x00000004UL) {
+					r ^= (r >> 2);
+					if (un <= 0x00000002UL) {
+						r ^= (r >> 1);
+					}
+				}
+			}
+		}
+	}
+
+	return (int) (r % un);
+}
+
+
+#if 0
+void	btSequentialImpulseConstraintSolver::initSolverBody(btSolverBody* solverBody, btCollisionObject* collisionObject)
+{
+	btRigidBody* rb = collisionObject? btRigidBody::upcast(collisionObject) : 0;
+
+	solverBody->internalGetDeltaLinearVelocity().setValue(0.f,0.f,0.f);
+	solverBody->internalGetDeltaAngularVelocity().setValue(0.f,0.f,0.f);
+	solverBody->internalGetPushVelocity().setValue(0.f,0.f,0.f);
+	solverBody->internalGetTurnVelocity().setValue(0.f,0.f,0.f);
+
+	if (rb)
+	{
+		solverBody->internalGetInvMass() = btVector3(rb->getInvMass(),rb->getInvMass(),rb->getInvMass())*rb->getLinearFactor();
+		solverBody->m_originalBody = rb;
+		solverBody->m_angularFactor = rb->getAngularFactor();
+	} else
+	{
+		solverBody->internalGetInvMass().setValue(0,0,0);
+		solverBody->m_originalBody = 0;
+		solverBody->m_angularFactor.setValue(1,1,1);
+	}
+}
+#endif
+
+
+
+
+
+btScalar btSequentialImpulseConstraintSolver::restitutionCurve(btScalar rel_vel, btScalar restitution)
+{
+	btScalar rest = restitution * -rel_vel;
+	return rest;
+}
+
+
+
+void	applyAnisotropicFriction(btCollisionObject* colObj,btVector3& frictionDirection);
+void	applyAnisotropicFriction(btCollisionObject* colObj,btVector3& frictionDirection)
+{
+	if (colObj && colObj->hasAnisotropicFriction())
+	{
+		// transform to local coordinates
+		btVector3 loc_lateral = frictionDirection * colObj->getWorldTransform().getBasis();
+		const btVector3& friction_scaling = colObj->getAnisotropicFriction();
+		//apply anisotropic friction
+		loc_lateral *= friction_scaling;
+		// ... and transform it back to global coordinates
+		frictionDirection = colObj->getWorldTransform().getBasis() * loc_lateral;
+	}
+}
+
+
+void btSequentialImpulseConstraintSolver::setupFrictionConstraint(btSolverConstraint& solverConstraint, const btVector3& normalAxis,btRigidBody* solverBodyA,btRigidBody* solverBodyB,btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, btScalar desiredVelocity, btScalar cfmSlip)
+{
+
+
+	btRigidBody* body0=btRigidBody::upcast(colObj0);
+	btRigidBody* body1=btRigidBody::upcast(colObj1);
+
+	solverConstraint.m_contactNormal = normalAxis;
+
+	solverConstraint.m_solverBodyA = body0 ? body0 : &getFixedBody();
+	solverConstraint.m_solverBodyB = body1 ? body1 : &getFixedBody();
+
+	solverConstraint.m_friction = cp.m_combinedFriction;
+	solverConstraint.m_originalContactPoint = 0;
+
+	solverConstraint.m_appliedImpulse = 0.f;
+	solverConstraint.m_appliedPushImpulse = 0.f;
+
+	{
+		btVector3 ftorqueAxis1 = rel_pos1.cross(solverConstraint.m_contactNormal);
+		solverConstraint.m_relpos1CrossNormal = ftorqueAxis1;
+		solverConstraint.m_angularComponentA = body0 ? body0->getInvInertiaTensorWorld()*ftorqueAxis1*body0->getAngularFactor() : btVector3(0,0,0);
+	}
+	{
+		btVector3 ftorqueAxis1 = rel_pos2.cross(-solverConstraint.m_contactNormal);
+		solverConstraint.m_relpos2CrossNormal = ftorqueAxis1;
+		solverConstraint.m_angularComponentB = body1 ? body1->getInvInertiaTensorWorld()*ftorqueAxis1*body1->getAngularFactor() : btVector3(0,0,0);
+	}
+
+#ifdef COMPUTE_IMPULSE_DENOM
+	btScalar denom0 = rb0->computeImpulseDenominator(pos1,solverConstraint.m_contactNormal);
+	btScalar denom1 = rb1->computeImpulseDenominator(pos2,solverConstraint.m_contactNormal);
+#else
+	btVector3 vec;
+	btScalar denom0 = 0.f;
+	btScalar denom1 = 0.f;
+	if (body0)
+	{
+		vec = ( solverConstraint.m_angularComponentA).cross(rel_pos1);
+		denom0 = body0->getInvMass() + normalAxis.dot(vec);
+	}
+	if (body1)
+	{
+		vec = ( -solverConstraint.m_angularComponentB).cross(rel_pos2);
+		denom1 = body1->getInvMass() + normalAxis.dot(vec);
+	}
+
+
+#endif //COMPUTE_IMPULSE_DENOM
+	btScalar denom = relaxation/(denom0+denom1);
+	solverConstraint.m_jacDiagABInv = denom;
+
+#ifdef _USE_JACOBIAN
+	solverConstraint.m_jac =  btJacobianEntry (
+		rel_pos1,rel_pos2,solverConstraint.m_contactNormal,
+		body0->getInvInertiaDiagLocal(),
+		body0->getInvMass(),
+		body1->getInvInertiaDiagLocal(),
+		body1->getInvMass());
+#endif //_USE_JACOBIAN
+
+
+	{
+		btScalar rel_vel;
+		btScalar vel1Dotn = solverConstraint.m_contactNormal.dot(body0?body0->getLinearVelocity():btVector3(0,0,0)) 
+			+ solverConstraint.m_relpos1CrossNormal.dot(body0?body0->getAngularVelocity():btVector3(0,0,0));
+		btScalar vel2Dotn = -solverConstraint.m_contactNormal.dot(body1?body1->getLinearVelocity():btVector3(0,0,0)) 
+			+ solverConstraint.m_relpos2CrossNormal.dot(body1?body1->getAngularVelocity():btVector3(0,0,0));
+
+		rel_vel = vel1Dotn+vel2Dotn;
+
+//		btScalar positionalError = 0.f;
+
+		btSimdScalar velocityError =  desiredVelocity - rel_vel;
+		btSimdScalar	velocityImpulse = velocityError * btSimdScalar(solverConstraint.m_jacDiagABInv);
+		solverConstraint.m_rhs = velocityImpulse;
+		solverConstraint.m_cfm = cfmSlip;
+		solverConstraint.m_lowerLimit = 0;
+		solverConstraint.m_upperLimit = 1e10f;
+	}
+}
+
+
+
+btSolverConstraint&	btSequentialImpulseConstraintSolver::addFrictionConstraint(const btVector3& normalAxis,btRigidBody* solverBodyA,btRigidBody* solverBodyB,int frictionIndex,btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, btScalar desiredVelocity, btScalar cfmSlip)
+{
+	btSolverConstraint& solverConstraint = m_tmpSolverContactFrictionConstraintPool.expandNonInitializing();
+	solverConstraint.m_frictionIndex = frictionIndex;
+	setupFrictionConstraint(solverConstraint, normalAxis, solverBodyA, solverBodyB, cp, rel_pos1, rel_pos2, 
+							colObj0, colObj1, relaxation, desiredVelocity, cfmSlip);
+	return solverConstraint;
+}
+
+int	btSequentialImpulseConstraintSolver::getOrInitSolverBody(btCollisionObject& body)
+{
+#if 0
+	int solverBodyIdA = -1;
+
+	if (body.getCompanionId() >= 0)
+	{
+		//body has already been converted
+		solverBodyIdA = body.getCompanionId();
+	} else
+	{
+		btRigidBody* rb = btRigidBody::upcast(&body);
+		if (rb && rb->getInvMass())
+		{
+			solverBodyIdA = m_tmpSolverBodyPool.size();
+			btSolverBody& solverBody = m_tmpSolverBodyPool.expand();
+			initSolverBody(&solverBody,&body);
+			body.setCompanionId(solverBodyIdA);
+		} else
+		{
+			return 0;//assume first one is a fixed solver body
+		}
+	}
+	return solverBodyIdA;
+#endif
+	return 0;
+}
+#include <stdio.h>
+
+
+void btSequentialImpulseConstraintSolver::setupContactConstraint(btSolverConstraint& solverConstraint, 
+																 btCollisionObject* colObj0, btCollisionObject* colObj1,
+																 btManifoldPoint& cp, const btContactSolverInfo& infoGlobal,
+																 btVector3& vel, btScalar& rel_vel, btScalar& relaxation,
+																 btVector3& rel_pos1, btVector3& rel_pos2)
+{
+			btRigidBody* rb0 = btRigidBody::upcast(colObj0);
+			btRigidBody* rb1 = btRigidBody::upcast(colObj1);
+
+			const btVector3& pos1 = cp.getPositionWorldOnA();
+			const btVector3& pos2 = cp.getPositionWorldOnB();
+
+//			btVector3 rel_pos1 = pos1 - colObj0->getWorldTransform().getOrigin(); 
+//			btVector3 rel_pos2 = pos2 - colObj1->getWorldTransform().getOrigin();
+			rel_pos1 = pos1 - colObj0->getWorldTransform().getOrigin(); 
+			rel_pos2 = pos2 - colObj1->getWorldTransform().getOrigin();
+
+			relaxation = 1.f;
+
+			btVector3 torqueAxis0 = rel_pos1.cross(cp.m_normalWorldOnB);
+			solverConstraint.m_angularComponentA = rb0 ? rb0->getInvInertiaTensorWorld()*torqueAxis0*rb0->getAngularFactor() : btVector3(0,0,0);
+			btVector3 torqueAxis1 = rel_pos2.cross(cp.m_normalWorldOnB);		
+			solverConstraint.m_angularComponentB = rb1 ? rb1->getInvInertiaTensorWorld()*-torqueAxis1*rb1->getAngularFactor() : btVector3(0,0,0);
+
+				{
+#ifdef COMPUTE_IMPULSE_DENOM
+					btScalar denom0 = rb0->computeImpulseDenominator(pos1,cp.m_normalWorldOnB);
+					btScalar denom1 = rb1->computeImpulseDenominator(pos2,cp.m_normalWorldOnB);
+#else							
+					btVector3 vec;
+					btScalar denom0 = 0.f;
+					btScalar denom1 = 0.f;
+					if (rb0)
+					{
+						vec = ( solverConstraint.m_angularComponentA).cross(rel_pos1);
+						denom0 = rb0->getInvMass() + cp.m_normalWorldOnB.dot(vec);
+					}
+					if (rb1)
+					{
+						vec = ( -solverConstraint.m_angularComponentB).cross(rel_pos2);
+						denom1 = rb1->getInvMass() + cp.m_normalWorldOnB.dot(vec);
+					}
+#endif //COMPUTE_IMPULSE_DENOM		
+
+					btScalar denom = relaxation/(denom0+denom1);
+					solverConstraint.m_jacDiagABInv = denom;
+				}
+
+				solverConstraint.m_contactNormal = cp.m_normalWorldOnB;
+				solverConstraint.m_relpos1CrossNormal = rel_pos1.cross(cp.m_normalWorldOnB);
+				solverConstraint.m_relpos2CrossNormal = rel_pos2.cross(-cp.m_normalWorldOnB);
+
+
+
+
+			btVector3 vel1 = rb0 ? rb0->getVelocityInLocalPoint(rel_pos1) : btVector3(0,0,0);
+			btVector3 vel2 = rb1 ? rb1->getVelocityInLocalPoint(rel_pos2) : btVector3(0,0,0);
+			vel  = vel1 - vel2;
+			rel_vel = cp.m_normalWorldOnB.dot(vel);
+
+				btScalar penetration = cp.getDistance()+infoGlobal.m_linearSlop;
+
+
+				solverConstraint.m_friction = cp.m_combinedFriction;
+
+				btScalar restitution = 0.f;
+				
+				if (cp.m_lifeTime>infoGlobal.m_restingContactRestitutionThreshold)
+				{
+					restitution = 0.f;
+				} else
+				{
+					restitution =  restitutionCurve(rel_vel, cp.m_combinedRestitution);
+					if (restitution <= btScalar(0.))
+					{
+						restitution = 0.f;
+					};
+				}
+
+
+				///warm starting (or zero if disabled)
+				if (infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
+				{
+					solverConstraint.m_appliedImpulse = cp.m_appliedImpulse * infoGlobal.m_warmstartingFactor;
+					if (rb0)
+						rb0->internalApplyImpulse(solverConstraint.m_contactNormal*rb0->getInvMass()*rb0->getLinearFactor(),solverConstraint.m_angularComponentA,solverConstraint.m_appliedImpulse);
+					if (rb1)
+						rb1->internalApplyImpulse(solverConstraint.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-solverConstraint.m_angularComponentB,-(btScalar)solverConstraint.m_appliedImpulse);
+				} else
+				{
+					solverConstraint.m_appliedImpulse = 0.f;
+				}
+
+				solverConstraint.m_appliedPushImpulse = 0.f;
+
+				{
+					btScalar rel_vel;
+					btScalar vel1Dotn = solverConstraint.m_contactNormal.dot(rb0?rb0->getLinearVelocity():btVector3(0,0,0)) 
+						+ solverConstraint.m_relpos1CrossNormal.dot(rb0?rb0->getAngularVelocity():btVector3(0,0,0));
+					btScalar vel2Dotn = -solverConstraint.m_contactNormal.dot(rb1?rb1->getLinearVelocity():btVector3(0,0,0)) 
+						+ solverConstraint.m_relpos2CrossNormal.dot(rb1?rb1->getAngularVelocity():btVector3(0,0,0));
+
+					rel_vel = vel1Dotn+vel2Dotn;
+
+					btScalar positionalError = 0.f;
+					btScalar	velocityError = restitution - rel_vel;// * damping;
+
+					if (penetration>0)
+					{
+						positionalError = 0;
+						velocityError -= penetration / infoGlobal.m_timeStep;
+					} else
+					{
+						positionalError = -penetration * infoGlobal.m_erp/infoGlobal.m_timeStep;
+					}
+
+					btScalar  penetrationImpulse = positionalError*solverConstraint.m_jacDiagABInv;
+					btScalar velocityImpulse = velocityError *solverConstraint.m_jacDiagABInv;
+					if (!infoGlobal.m_splitImpulse || (penetration > infoGlobal.m_splitImpulsePenetrationThreshold))
+					{
+						//combine position and velocity into rhs
+						solverConstraint.m_rhs = penetrationImpulse+velocityImpulse;
+						solverConstraint.m_rhsPenetration = 0.f;
+					} else
+					{
+						//split position and velocity into rhs and m_rhsPenetration
+						solverConstraint.m_rhs = velocityImpulse;
+						solverConstraint.m_rhsPenetration = penetrationImpulse;
+					}
+					solverConstraint.m_cfm = 0.f;
+					solverConstraint.m_lowerLimit = 0;
+					solverConstraint.m_upperLimit = 1e10f;
+				}
+
+
+
+
+}
+
+
+
+void btSequentialImpulseConstraintSolver::setFrictionConstraintImpulse( btSolverConstraint& solverConstraint, 
+																		btRigidBody* rb0, btRigidBody* rb1, 
+																 btManifoldPoint& cp, const btContactSolverInfo& infoGlobal)
+{
+					if (infoGlobal.m_solverMode & SOLVER_USE_FRICTION_WARMSTARTING)
+					{
+						{
+							btSolverConstraint& frictionConstraint1 = m_tmpSolverContactFrictionConstraintPool[solverConstraint.m_frictionIndex];
+							if (infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
+							{
+								frictionConstraint1.m_appliedImpulse = cp.m_appliedImpulseLateral1 * infoGlobal.m_warmstartingFactor;
+								if (rb0)
+									rb0->internalApplyImpulse(frictionConstraint1.m_contactNormal*rb0->getInvMass()*rb0->getLinearFactor(),frictionConstraint1.m_angularComponentA,frictionConstraint1.m_appliedImpulse);
+								if (rb1)
+									rb1->internalApplyImpulse(frictionConstraint1.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-frictionConstraint1.m_angularComponentB,-(btScalar)frictionConstraint1.m_appliedImpulse);
+							} else
+							{
+								frictionConstraint1.m_appliedImpulse = 0.f;
+							}
+						}
+
+						if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
+						{
+							btSolverConstraint& frictionConstraint2 = m_tmpSolverContactFrictionConstraintPool[solverConstraint.m_frictionIndex+1];
+							if (infoGlobal.m_solverMode & SOLVER_USE_WARMSTARTING)
+							{
+								frictionConstraint2.m_appliedImpulse = cp.m_appliedImpulseLateral2 * infoGlobal.m_warmstartingFactor;
+								if (rb0)
+									rb0->internalApplyImpulse(frictionConstraint2.m_contactNormal*rb0->getInvMass(),frictionConstraint2.m_angularComponentA,frictionConstraint2.m_appliedImpulse);
+								if (rb1)
+									rb1->internalApplyImpulse(frictionConstraint2.m_contactNormal*rb1->getInvMass(),-frictionConstraint2.m_angularComponentB,-(btScalar)frictionConstraint2.m_appliedImpulse);
+							} else
+							{
+								frictionConstraint2.m_appliedImpulse = 0.f;
+							}
+						}
+					} else
+					{
+						btSolverConstraint& frictionConstraint1 = m_tmpSolverContactFrictionConstraintPool[solverConstraint.m_frictionIndex];
+						frictionConstraint1.m_appliedImpulse = 0.f;
+						if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
+						{
+							btSolverConstraint& frictionConstraint2 = m_tmpSolverContactFrictionConstraintPool[solverConstraint.m_frictionIndex+1];
+							frictionConstraint2.m_appliedImpulse = 0.f;
+						}
+					}
+}
+
+
+
+
+void	btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* manifold,const btContactSolverInfo& infoGlobal)
+{
+	btCollisionObject* colObj0=0,*colObj1=0;
+
+	colObj0 = (btCollisionObject*)manifold->getBody0();
+	colObj1 = (btCollisionObject*)manifold->getBody1();
+
+
+	btRigidBody* solverBodyA = btRigidBody::upcast(colObj0);
+	btRigidBody* solverBodyB = btRigidBody::upcast(colObj1);
+
+	///avoid collision response between two static objects
+	if ((!solverBodyA || !solverBodyA->getInvMass()) && (!solverBodyB || !solverBodyB->getInvMass()))
+		return;
+
+	for (int j=0;j<manifold->getNumContacts();j++)
+	{
+
+		btManifoldPoint& cp = manifold->getContactPoint(j);
+
+		if (cp.getDistance() <= manifold->getContactProcessingThreshold())
+		{
+			btVector3 rel_pos1;
+			btVector3 rel_pos2;
+			btScalar relaxation;
+			btScalar rel_vel;
+			btVector3 vel;
+
+			int frictionIndex = m_tmpSolverContactConstraintPool.size();
+			btSolverConstraint& solverConstraint = m_tmpSolverContactConstraintPool.expandNonInitializing();
+			btRigidBody* rb0 = btRigidBody::upcast(colObj0);
+			btRigidBody* rb1 = btRigidBody::upcast(colObj1);
+			solverConstraint.m_solverBodyA = rb0? rb0 : &getFixedBody();
+			solverConstraint.m_solverBodyB = rb1? rb1 : &getFixedBody();
+			solverConstraint.m_originalContactPoint = &cp;
+
+			setupContactConstraint(solverConstraint, colObj0, colObj1, cp, infoGlobal, vel, rel_vel, relaxation, rel_pos1, rel_pos2);
+
+//			const btVector3& pos1 = cp.getPositionWorldOnA();
+//			const btVector3& pos2 = cp.getPositionWorldOnB();
+
+			/////setup the friction constraints
+
+			solverConstraint.m_frictionIndex = m_tmpSolverContactFrictionConstraintPool.size();
+
+			if (!(infoGlobal.m_solverMode & SOLVER_ENABLE_FRICTION_DIRECTION_CACHING) || !cp.m_lateralFrictionInitialized)
+			{
+				cp.m_lateralFrictionDir1 = vel - cp.m_normalWorldOnB * rel_vel;
+				btScalar lat_rel_vel = cp.m_lateralFrictionDir1.length2();
+				if (!(infoGlobal.m_solverMode & SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION) && lat_rel_vel > SIMD_EPSILON)
+				{
+					cp.m_lateralFrictionDir1 /= btSqrt(lat_rel_vel);
+					if((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
+					{
+						cp.m_lateralFrictionDir2 = cp.m_lateralFrictionDir1.cross(cp.m_normalWorldOnB);
+						cp.m_lateralFrictionDir2.normalize();//??
+						applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir2);
+						applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir2);
+						addFrictionConstraint(cp.m_lateralFrictionDir2,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
+					}
+
+					applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir1);
+					applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir1);
+					addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
+					cp.m_lateralFrictionInitialized = true;
+				} else
+				{
+					//re-calculate friction direction every frame, todo: check if this is really needed
+					btPlaneSpace1(cp.m_normalWorldOnB,cp.m_lateralFrictionDir1,cp.m_lateralFrictionDir2);
+					if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
+					{
+						applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir2);
+						applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir2);
+						addFrictionConstraint(cp.m_lateralFrictionDir2,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
+					}
+
+					applyAnisotropicFriction(colObj0,cp.m_lateralFrictionDir1);
+					applyAnisotropicFriction(colObj1,cp.m_lateralFrictionDir1);
+					addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);
+
+					cp.m_lateralFrictionInitialized = true;
+				}
+
+			} else
+			{
+				addFrictionConstraint(cp.m_lateralFrictionDir1,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation,cp.m_contactMotion1, cp.m_contactCFM1);
+				if ((infoGlobal.m_solverMode & SOLVER_USE_2_FRICTION_DIRECTIONS))
+					addFrictionConstraint(cp.m_lateralFrictionDir2,solverBodyA,solverBodyB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation, cp.m_contactMotion2, cp.m_contactCFM2);
+			}
+			
+			setFrictionConstraintImpulse( solverConstraint, rb0, rb1, cp, infoGlobal);
+
+		}
+	}
+}
+
+
+btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCollisionObject** bodies, int numBodies, btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
+{
+	BT_PROFILE("solveGroupCacheFriendlySetup");
+	(void)stackAlloc;
+	(void)debugDrawer;
+
+
+	if (!(numConstraints + numManifolds))
+	{
+		//		printf("empty\n");
+		return 0.f;
+	}
+
+	if (infoGlobal.m_splitImpulse)
+	{
+		for (int i = 0; i < numBodies; i++)
+		{
+			btRigidBody* body = btRigidBody::upcast(bodies[i]);
+			if (body)
+			{	
+				body->internalGetDeltaLinearVelocity().setZero();
+				body->internalGetDeltaAngularVelocity().setZero();
+				body->internalGetPushVelocity().setZero();
+				body->internalGetTurnVelocity().setZero();
+			}
+		}
+	}
+	else
+	{
+		for (int i = 0; i < numBodies; i++)
+		{
+			btRigidBody* body = btRigidBody::upcast(bodies[i]);
+			if (body)
+			{	
+				body->internalGetDeltaLinearVelocity().setZero();
+				body->internalGetDeltaAngularVelocity().setZero();
+			}
+		}
+	}
+
+	if (1)
+	{
+		int j;
+		for (j=0;j<numConstraints;j++)
+		{
+			btTypedConstraint* constraint = constraints[j];
+			constraint->buildJacobian();
+			constraint->internalSetAppliedImpulse(0.0f);
+		}
+	}
+	//btRigidBody* rb0=0,*rb1=0;
+
+	//if (1)
+	{
+		{
+
+			int totalNumRows = 0;
+			int i;
+			
+			m_tmpConstraintSizesPool.resize(numConstraints);
+			//calculate the total number of contraint rows
+			for (i=0;i<numConstraints;i++)
+			{
+				btTypedConstraint::btConstraintInfo1& info1 = m_tmpConstraintSizesPool[i];
+				if (constraints[i]->isEnabled())
+				{
+					constraints[i]->getInfo1(&info1);
+				} else
+				{
+					info1.m_numConstraintRows = 0;
+					info1.nub = 0;
+				}
+				totalNumRows += info1.m_numConstraintRows;
+			}
+			m_tmpSolverNonContactConstraintPool.resize(totalNumRows);
+
+			
+			///setup the btSolverConstraints
+			int currentRow = 0;
+
+			for (i=0;i<numConstraints;i++)
+			{
+				const btTypedConstraint::btConstraintInfo1& info1 = m_tmpConstraintSizesPool[i];
+				
+				if (info1.m_numConstraintRows)
+				{
+					btAssert(currentRow<totalNumRows);
+
+					btSolverConstraint* currentConstraintRow = &m_tmpSolverNonContactConstraintPool[currentRow];
+					btTypedConstraint* constraint = constraints[i];
+
+
+					btRigidBody& rbA = constraint->getRigidBodyA();
+					btRigidBody& rbB = constraint->getRigidBodyB();
+
+					
+					int j;
+					for ( j=0;j<info1.m_numConstraintRows;j++)
+					{
+						memset(&currentConstraintRow[j],0,sizeof(btSolverConstraint));
+						currentConstraintRow[j].m_lowerLimit = -SIMD_INFINITY;
+						currentConstraintRow[j].m_upperLimit = SIMD_INFINITY;
+						currentConstraintRow[j].m_appliedImpulse = 0.f;
+						currentConstraintRow[j].m_appliedPushImpulse = 0.f;
+						currentConstraintRow[j].m_solverBodyA = &rbA;
+						currentConstraintRow[j].m_solverBodyB = &rbB;
+					}
+
+					rbA.internalGetDeltaLinearVelocity().setValue(0.f,0.f,0.f);
+					rbA.internalGetDeltaAngularVelocity().setValue(0.f,0.f,0.f);
+					rbB.internalGetDeltaLinearVelocity().setValue(0.f,0.f,0.f);
+					rbB.internalGetDeltaAngularVelocity().setValue(0.f,0.f,0.f);
+
+
+
+					btTypedConstraint::btConstraintInfo2 info2;
+					info2.fps = 1.f/infoGlobal.m_timeStep;
+					info2.erp = infoGlobal.m_erp;
+					info2.m_J1linearAxis = currentConstraintRow->m_contactNormal;
+					info2.m_J1angularAxis = currentConstraintRow->m_relpos1CrossNormal;
+					info2.m_J2linearAxis = 0;
+					info2.m_J2angularAxis = currentConstraintRow->m_relpos2CrossNormal;
+					info2.rowskip = sizeof(btSolverConstraint)/sizeof(btScalar);//check this
+					///the size of btSolverConstraint needs be a multiple of btScalar
+					btAssert(info2.rowskip*sizeof(btScalar)== sizeof(btSolverConstraint));
+					info2.m_constraintError = &currentConstraintRow->m_rhs;
+					currentConstraintRow->m_cfm = infoGlobal.m_globalCfm;
+					info2.m_damping = infoGlobal.m_damping;
+					info2.cfm = &currentConstraintRow->m_cfm;
+					info2.m_lowerLimit = &currentConstraintRow->m_lowerLimit;
+					info2.m_upperLimit = &currentConstraintRow->m_upperLimit;
+					info2.m_numIterations = infoGlobal.m_numIterations;
+					constraints[i]->getInfo2(&info2);
+
+					if (currentConstraintRow->m_upperLimit>constraints[i]->getBreakingImpulseThreshold())
+					{
+						currentConstraintRow->m_upperLimit = constraints[i]->getBreakingImpulseThreshold();
+					}
+
+					if (currentConstraintRow->m_lowerLimit<-constraints[i]->getBreakingImpulseThreshold())
+					{
+						currentConstraintRow->m_lowerLimit = -constraints[i]->getBreakingImpulseThreshold();
+					}
+
+
+
+					///finalize the constraint setup
+					for ( j=0;j<info1.m_numConstraintRows;j++)
+					{
+						btSolverConstraint& solverConstraint = currentConstraintRow[j];
+						solverConstraint.m_originalContactPoint = constraint;
+
+						{
+							const btVector3& ftorqueAxis1 = solverConstraint.m_relpos1CrossNormal;
+							solverConstraint.m_angularComponentA = constraint->getRigidBodyA().getInvInertiaTensorWorld()*ftorqueAxis1*constraint->getRigidBodyA().getAngularFactor();
+						}
+						{
+							const btVector3& ftorqueAxis2 = solverConstraint.m_relpos2CrossNormal;
+							solverConstraint.m_angularComponentB = constraint->getRigidBodyB().getInvInertiaTensorWorld()*ftorqueAxis2*constraint->getRigidBodyB().getAngularFactor();
+						}
+
+						{
+							btVector3 iMJlA = solverConstraint.m_contactNormal*rbA.getInvMass();
+							btVector3 iMJaA = rbA.getInvInertiaTensorWorld()*solverConstraint.m_relpos1CrossNormal;
+							btVector3 iMJlB = solverConstraint.m_contactNormal*rbB.getInvMass();//sign of normal?
+							btVector3 iMJaB = rbB.getInvInertiaTensorWorld()*solverConstraint.m_relpos2CrossNormal;
+
+							btScalar sum = iMJlA.dot(solverConstraint.m_contactNormal);
+							sum += iMJaA.dot(solverConstraint.m_relpos1CrossNormal);
+							sum += iMJlB.dot(solverConstraint.m_contactNormal);
+							sum += iMJaB.dot(solverConstraint.m_relpos2CrossNormal);
+
+							solverConstraint.m_jacDiagABInv = btScalar(1.)/sum;
+						}
+
+
+						///fix rhs
+						///todo: add force/torque accelerators
+						{
+							btScalar rel_vel;
+							btScalar vel1Dotn = solverConstraint.m_contactNormal.dot(rbA.getLinearVelocity()) + solverConstraint.m_relpos1CrossNormal.dot(rbA.getAngularVelocity());
+							btScalar vel2Dotn = -solverConstraint.m_contactNormal.dot(rbB.getLinearVelocity()) + solverConstraint.m_relpos2CrossNormal.dot(rbB.getAngularVelocity());
+
+							rel_vel = vel1Dotn+vel2Dotn;
+
+							btScalar restitution = 0.f;
+							btScalar positionalError = solverConstraint.m_rhs;//already filled in by getConstraintInfo2
+							btScalar	velocityError = restitution - rel_vel * info2.m_damping;
+							btScalar	penetrationImpulse = positionalError*solverConstraint.m_jacDiagABInv;
+							btScalar	velocityImpulse = velocityError *solverConstraint.m_jacDiagABInv;
+							solverConstraint.m_rhs = penetrationImpulse+velocityImpulse;
+							solverConstraint.m_appliedImpulse = 0.f;
+
+						}
+					}
+				}
+				currentRow+=m_tmpConstraintSizesPool[i].m_numConstraintRows;
+			}
+		}
+
+		{
+			int i;
+			btPersistentManifold* manifold = 0;
+//			btCollisionObject* colObj0=0,*colObj1=0;
+
+
+			for (i=0;i<numManifolds;i++)
+			{
+				manifold = manifoldPtr[i];
+				convertContact(manifold,infoGlobal);
+			}
+		}
+	}
+
+	btContactSolverInfo info = infoGlobal;
+
+
+
+	int numConstraintPool = m_tmpSolverContactConstraintPool.size();
+	int numFrictionPool = m_tmpSolverContactFrictionConstraintPool.size();
+
+	///@todo: use stack allocator for such temporarily memory, same for solver bodies/constraints
+	m_orderTmpConstraintPool.resize(numConstraintPool);
+	m_orderFrictionConstraintPool.resize(numFrictionPool);
+	{
+		int i;
+		for (i=0;i<numConstraintPool;i++)
+		{
+			m_orderTmpConstraintPool[i] = i;
+		}
+		for (i=0;i<numFrictionPool;i++)
+		{
+			m_orderFrictionConstraintPool[i] = i;
+		}
+	}
+
+	return 0.f;
+
+}
+
+btScalar btSequentialImpulseConstraintSolver::solveSingleIteration(int iteration, btCollisionObject** /*bodies */,int /*numBodies*/,btPersistentManifold** /*manifoldPtr*/, int /*numManifolds*/,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* /*debugDrawer*/,btStackAlloc* /*stackAlloc*/)
+{
+
+	int numConstraintPool = m_tmpSolverContactConstraintPool.size();
+	int numFrictionPool = m_tmpSolverContactFrictionConstraintPool.size();
+
+	int j;
+
+	if (infoGlobal.m_solverMode & SOLVER_RANDMIZE_ORDER)
+	{
+		if ((iteration & 7) == 0) {
+			for (j=0; j<numConstraintPool; ++j) {
+				int tmp = m_orderTmpConstraintPool[j];
+				int swapi = btRandInt2(j+1);
+				m_orderTmpConstraintPool[j] = m_orderTmpConstraintPool[swapi];
+				m_orderTmpConstraintPool[swapi] = tmp;
+			}
+
+			for (j=0; j<numFrictionPool; ++j) {
+				int tmp = m_orderFrictionConstraintPool[j];
+				int swapi = btRandInt2(j+1);
+				m_orderFrictionConstraintPool[j] = m_orderFrictionConstraintPool[swapi];
+				m_orderFrictionConstraintPool[swapi] = tmp;
+			}
+		}
+	}
+
+	if (infoGlobal.m_solverMode & SOLVER_SIMD)
+	{
+		///solve all joint constraints, using SIMD, if available
+		for (j=0;j<m_tmpSolverNonContactConstraintPool.size();j++)
+		{
+			btSolverConstraint& constraint = m_tmpSolverNonContactConstraintPool[j];
+			resolveSingleConstraintRowGenericSIMD(*constraint.m_solverBodyA,*constraint.m_solverBodyB,constraint);
+		}
+
+		for (j=0;j<numConstraints;j++)
+		{
+			constraints[j]->solveConstraintObsolete(constraints[j]->getRigidBodyA(),constraints[j]->getRigidBodyB(),infoGlobal.m_timeStep);
+		}
+
+		///solve all contact constraints using SIMD, if available
+		int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
+		for (j=0;j<numPoolConstraints;j++)
+		{
+			const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
+			resolveSingleConstraintRowLowerLimitSIMD(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
+
+		}
+		///solve all friction constraints, using SIMD, if available
+		int numFrictionPoolConstraints = m_tmpSolverContactFrictionConstraintPool.size();
+		for (j=0;j<numFrictionPoolConstraints;j++)
+		{
+			btSolverConstraint& solveManifold = m_tmpSolverContactFrictionConstraintPool[m_orderFrictionConstraintPool[j]];
+			btScalar totalImpulse = m_tmpSolverContactConstraintPool[solveManifold.m_frictionIndex].m_appliedImpulse;
+
+			if (totalImpulse>btScalar(0))
+			{
+				solveManifold.m_lowerLimit = -(solveManifold.m_friction*totalImpulse);
+				solveManifold.m_upperLimit = solveManifold.m_friction*totalImpulse;
+
+				resolveSingleConstraintRowGenericSIMD(*solveManifold.m_solverBodyA,	*solveManifold.m_solverBodyB,solveManifold);
+			}
+		}
+	} else
+	{
+
+		///solve all joint constraints
+		for (j=0;j<m_tmpSolverNonContactConstraintPool.size();j++)
+		{
+			btSolverConstraint& constraint = m_tmpSolverNonContactConstraintPool[j];
+			resolveSingleConstraintRowGeneric(*constraint.m_solverBodyA,*constraint.m_solverBodyB,constraint);
+		}
+
+		for (j=0;j<numConstraints;j++)
+		{
+			constraints[j]->solveConstraintObsolete(constraints[j]->getRigidBodyA(),constraints[j]->getRigidBodyB(),infoGlobal.m_timeStep);
+		}
+		///solve all contact constraints
+		int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
+		for (j=0;j<numPoolConstraints;j++)
+		{
+			const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
+			resolveSingleConstraintRowLowerLimit(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
+		}
+		///solve all friction constraints
+		int numFrictionPoolConstraints = m_tmpSolverContactFrictionConstraintPool.size();
+		for (j=0;j<numFrictionPoolConstraints;j++)
+		{
+			btSolverConstraint& solveManifold = m_tmpSolverContactFrictionConstraintPool[m_orderFrictionConstraintPool[j]];
+			btScalar totalImpulse = m_tmpSolverContactConstraintPool[solveManifold.m_frictionIndex].m_appliedImpulse;
+
+			if (totalImpulse>btScalar(0))
+			{
+				solveManifold.m_lowerLimit = -(solveManifold.m_friction*totalImpulse);
+				solveManifold.m_upperLimit = solveManifold.m_friction*totalImpulse;
+
+				resolveSingleConstraintRowGeneric(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
+			}
+		}
+	}
+	return 0.f;
+}
+
+
+void btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySplitImpulseIterations(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
+{
+	int iteration;
+	if (infoGlobal.m_splitImpulse)
+	{
+		if (infoGlobal.m_solverMode & SOLVER_SIMD)
+		{
+			for ( iteration = 0;iteration<infoGlobal.m_numIterations;iteration++)
+			{
+				{
+					int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
+					int j;
+					for (j=0;j<numPoolConstraints;j++)
+					{
+						const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
+
+						resolveSplitPenetrationSIMD(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
+					}
+				}
+			}
+		}
+		else
+		{
+			for ( iteration = 0;iteration<infoGlobal.m_numIterations;iteration++)
+			{
+				{
+					int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
+					int j;
+					for (j=0;j<numPoolConstraints;j++)
+					{
+						const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[m_orderTmpConstraintPool[j]];
+
+						resolveSplitPenetrationImpulseCacheFriendly(*solveManifold.m_solverBodyA,*solveManifold.m_solverBodyB,solveManifold);
+					}
+				}
+			}
+		}
+	}
+}
+
+btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyIterations(btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
+{
+	BT_PROFILE("solveGroupCacheFriendlyIterations");
+
+	
+	//should traverse the contacts random order...
+	int iteration;
+	{
+		solveGroupCacheFriendlySplitImpulseIterations(bodies ,numBodies,manifoldPtr, numManifolds,constraints,numConstraints,infoGlobal,debugDrawer,stackAlloc);
+
+		for ( iteration = 0;iteration<infoGlobal.m_numIterations;iteration++)
+		{			
+			solveSingleIteration(iteration, bodies ,numBodies,manifoldPtr, numManifolds,constraints,numConstraints,infoGlobal,debugDrawer,stackAlloc);
+		}
+		
+	}
+	return 0.f;
+}
+
+btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlyFinish(btCollisionObject** bodies ,int numBodies,btPersistentManifold** /*manifoldPtr*/, int /*numManifolds*/,btTypedConstraint** /*constraints*/,int /* numConstraints*/,const btContactSolverInfo& infoGlobal,btIDebugDraw* /*debugDrawer*/,btStackAlloc* /*stackAlloc*/)
+{
+	int numPoolConstraints = m_tmpSolverContactConstraintPool.size();
+	int i,j;
+
+	for (j=0;j<numPoolConstraints;j++)
+	{
+
+		const btSolverConstraint& solveManifold = m_tmpSolverContactConstraintPool[j];
+		btManifoldPoint* pt = (btManifoldPoint*) solveManifold.m_originalContactPoint;
+		btAssert(pt);
+		pt->m_appliedImpulse = solveManifold.m_appliedImpulse;
+		if (infoGlobal.m_solverMode & SOLVER_USE_FRICTION_WARMSTARTING)
+		{
+			pt->m_appliedImpulseLateral1 = m_tmpSolverContactFrictionConstraintPool[solveManifold.m_frictionIndex].m_appliedImpulse;
+			pt->m_appliedImpulseLateral2 = m_tmpSolverContactFrictionConstraintPool[solveManifold.m_frictionIndex+1].m_appliedImpulse;
+		}
+
+		//do a callback here?
+	}
+
+	numPoolConstraints = m_tmpSolverNonContactConstraintPool.size();
+	for (j=0;j<numPoolConstraints;j++)
+	{
+		const btSolverConstraint& solverConstr = m_tmpSolverNonContactConstraintPool[j];
+		btTypedConstraint* constr = (btTypedConstraint*)solverConstr.m_originalContactPoint;
+		constr->internalSetAppliedImpulse(solverConstr.m_appliedImpulse);
+		if (solverConstr.m_appliedImpulse>constr->getBreakingImpulseThreshold())
+		{
+			constr->setEnabled(false);
+		}
+	}
+
+
+	if (infoGlobal.m_splitImpulse)
+	{		
+		for ( i=0;i<numBodies;i++)
+		{
+			btRigidBody* body = btRigidBody::upcast(bodies[i]);
+			if (body)
+				body->internalWritebackVelocity(infoGlobal.m_timeStep);
+		}
+	} else
+	{
+		for ( i=0;i<numBodies;i++)
+		{
+			btRigidBody* body = btRigidBody::upcast(bodies[i]);
+			if (body)
+				body->internalWritebackVelocity();
+		}
+	}
+
+
+	m_tmpSolverContactConstraintPool.resize(0);
+	m_tmpSolverNonContactConstraintPool.resize(0);
+	m_tmpSolverContactFrictionConstraintPool.resize(0);
+
+	return 0.f;
+}
+
+
+
+/// btSequentialImpulseConstraintSolver Sequentially applies impulses
+btScalar btSequentialImpulseConstraintSolver::solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc,btDispatcher* /*dispatcher*/)
+{
+
+	BT_PROFILE("solveGroup");
+	//you need to provide at least some bodies
+	btAssert(bodies);
+	btAssert(numBodies);
+
+	solveGroupCacheFriendlySetup( bodies, numBodies, manifoldPtr,  numManifolds,constraints, numConstraints,infoGlobal,debugDrawer, stackAlloc);
+
+	solveGroupCacheFriendlyIterations(bodies, numBodies, manifoldPtr,  numManifolds,constraints, numConstraints,infoGlobal,debugDrawer, stackAlloc);
+
+	solveGroupCacheFriendlyFinish(bodies, numBodies, manifoldPtr,  numManifolds,constraints, numConstraints,infoGlobal,debugDrawer, stackAlloc);
+	
+	return 0.f;
+}
+
+void	btSequentialImpulseConstraintSolver::reset()
+{
+	m_btSeed2 = 0;
+}
+
+btRigidBody& btSequentialImpulseConstraintSolver::getFixedBody()
+{
+	static btRigidBody s_fixed(0, 0,0);
+	s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
+	return s_fixed;
+}
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
new file mode 100644
index 0000000..d738478
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
@@ -0,0 +1,128 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
+#define BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
+
+#include "btConstraintSolver.h"
+class btIDebugDraw;
+#include "btContactConstraint.h"
+#include "btSolverBody.h"
+#include "btSolverConstraint.h"
+#include "btTypedConstraint.h"
+#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
+
+///The btSequentialImpulseConstraintSolver is a fast SIMD implementation of the Projected Gauss Seidel (iterative LCP) method.
+class btSequentialImpulseConstraintSolver : public btConstraintSolver
+{
+protected:
+
+	btConstraintArray			m_tmpSolverContactConstraintPool;
+	btConstraintArray			m_tmpSolverNonContactConstraintPool;
+	btConstraintArray			m_tmpSolverContactFrictionConstraintPool;
+	btAlignedObjectArray<int>	m_orderTmpConstraintPool;
+	btAlignedObjectArray<int>	m_orderFrictionConstraintPool;
+	btAlignedObjectArray<btTypedConstraint::btConstraintInfo1> m_tmpConstraintSizesPool;
+
+	void setupFrictionConstraint(	btSolverConstraint& solverConstraint, const btVector3& normalAxis,btRigidBody* solverBodyA,btRigidBody* solverBodyIdB,
+									btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,
+									btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, 
+									btScalar desiredVelocity=0., btScalar cfmSlip=0.);
+
+	btSolverConstraint&	addFrictionConstraint(const btVector3& normalAxis,btRigidBody* solverBodyA,btRigidBody* solverBodyB,int frictionIndex,btManifoldPoint& cp,const btVector3& rel_pos1,const btVector3& rel_pos2,btCollisionObject* colObj0,btCollisionObject* colObj1, btScalar relaxation, btScalar desiredVelocity=0., btScalar cfmSlip=0.);
+	
+	void setupContactConstraint(btSolverConstraint& solverConstraint, btCollisionObject* colObj0, btCollisionObject* colObj1, btManifoldPoint& cp, 
+								const btContactSolverInfo& infoGlobal, btVector3& vel, btScalar& rel_vel, btScalar& relaxation, 
+								btVector3& rel_pos1, btVector3& rel_pos2);
+
+	void setFrictionConstraintImpulse( btSolverConstraint& solverConstraint, btRigidBody* rb0, btRigidBody* rb1, 
+										 btManifoldPoint& cp, const btContactSolverInfo& infoGlobal);
+
+	///m_btSeed2 is used for re-arranging the constraint rows. improves convergence/quality of friction
+	unsigned long	m_btSeed2;
+
+//	void	initSolverBody(btSolverBody* solverBody, btCollisionObject* collisionObject);
+	btScalar restitutionCurve(btScalar rel_vel, btScalar restitution);
+
+	void	convertContact(btPersistentManifold* manifold,const btContactSolverInfo& infoGlobal);
+
+
+	void	resolveSplitPenetrationSIMD(
+        btRigidBody& body1,
+        btRigidBody& body2,
+        const btSolverConstraint& contactConstraint);
+
+	void	resolveSplitPenetrationImpulseCacheFriendly(
+        btRigidBody& body1,
+        btRigidBody& body2,
+        const btSolverConstraint& contactConstraint);
+
+	//internal method
+	int	getOrInitSolverBody(btCollisionObject& body);
+
+	void	resolveSingleConstraintRowGeneric(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& contactConstraint);
+
+	void	resolveSingleConstraintRowGenericSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& contactConstraint);
+	
+	void	resolveSingleConstraintRowLowerLimit(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& contactConstraint);
+	
+	void	resolveSingleConstraintRowLowerLimitSIMD(btRigidBody& body1,btRigidBody& body2,const btSolverConstraint& contactConstraint);
+		
+protected:
+	static btRigidBody& getFixedBody();
+	
+	virtual void solveGroupCacheFriendlySplitImpulseIterations(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
+	virtual btScalar solveGroupCacheFriendlyFinish(btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
+	btScalar solveSingleIteration(int iteration, btCollisionObject** bodies ,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
+
+	virtual btScalar solveGroupCacheFriendlySetup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
+	virtual btScalar solveGroupCacheFriendlyIterations(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc);
+
+
+public:
+
+	
+	btSequentialImpulseConstraintSolver();
+	virtual ~btSequentialImpulseConstraintSolver();
+
+	virtual btScalar solveGroup(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifold,int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& info, btIDebugDraw* debugDrawer, btStackAlloc* stackAlloc,btDispatcher* dispatcher);
+	
+
+	
+	///clear internal cached data and reset random seed
+	virtual	void	reset();
+	
+	unsigned long btRand2();
+
+	int btRandInt2 (int n);
+
+	void	setRandSeed(unsigned long seed)
+	{
+		m_btSeed2 = seed;
+	}
+	unsigned long	getRandSeed() const
+	{
+		return m_btSeed2;
+	}
+
+};
+
+#ifndef BT_PREFER_SIMD
+typedef btSequentialImpulseConstraintSolver btSequentialImpulseConstraintSolverPrefered;
+#endif
+
+
+#endif //BT_SEQUENTIAL_IMPULSE_CONSTRAINT_SOLVER_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
new file mode 100755
index 0000000..b69f46d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
@@ -0,0 +1,857 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+Added by Roman Ponomarev (rponom at gmail.com)
+April 04, 2008
+*/
+
+
+
+#include "btSliderConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btTransformUtil.h"
+#include <new>
+
+#define USE_OFFSET_FOR_CONSTANT_FRAME true
+
+void btSliderConstraint::initParams()
+{
+    m_lowerLinLimit = btScalar(1.0);
+    m_upperLinLimit = btScalar(-1.0);
+    m_lowerAngLimit = btScalar(0.);
+    m_upperAngLimit = btScalar(0.);
+	m_softnessDirLin = SLIDER_CONSTRAINT_DEF_SOFTNESS;
+	m_restitutionDirLin = SLIDER_CONSTRAINT_DEF_RESTITUTION;
+	m_dampingDirLin = btScalar(0.);
+	m_cfmDirLin = SLIDER_CONSTRAINT_DEF_CFM;
+	m_softnessDirAng = SLIDER_CONSTRAINT_DEF_SOFTNESS;
+	m_restitutionDirAng = SLIDER_CONSTRAINT_DEF_RESTITUTION;
+	m_dampingDirAng = btScalar(0.);
+	m_cfmDirAng = SLIDER_CONSTRAINT_DEF_CFM;
+	m_softnessOrthoLin = SLIDER_CONSTRAINT_DEF_SOFTNESS;
+	m_restitutionOrthoLin = SLIDER_CONSTRAINT_DEF_RESTITUTION;
+	m_dampingOrthoLin = SLIDER_CONSTRAINT_DEF_DAMPING;
+	m_cfmOrthoLin = SLIDER_CONSTRAINT_DEF_CFM;
+	m_softnessOrthoAng = SLIDER_CONSTRAINT_DEF_SOFTNESS;
+	m_restitutionOrthoAng = SLIDER_CONSTRAINT_DEF_RESTITUTION;
+	m_dampingOrthoAng = SLIDER_CONSTRAINT_DEF_DAMPING;
+	m_cfmOrthoAng = SLIDER_CONSTRAINT_DEF_CFM;
+	m_softnessLimLin = SLIDER_CONSTRAINT_DEF_SOFTNESS;
+	m_restitutionLimLin = SLIDER_CONSTRAINT_DEF_RESTITUTION;
+	m_dampingLimLin = SLIDER_CONSTRAINT_DEF_DAMPING;
+	m_cfmLimLin = SLIDER_CONSTRAINT_DEF_CFM;
+	m_softnessLimAng = SLIDER_CONSTRAINT_DEF_SOFTNESS;
+	m_restitutionLimAng = SLIDER_CONSTRAINT_DEF_RESTITUTION;
+	m_dampingLimAng = SLIDER_CONSTRAINT_DEF_DAMPING;
+	m_cfmLimAng = SLIDER_CONSTRAINT_DEF_CFM;
+
+	m_poweredLinMotor = false;
+    m_targetLinMotorVelocity = btScalar(0.);
+    m_maxLinMotorForce = btScalar(0.);
+	m_accumulatedLinMotorImpulse = btScalar(0.0);
+
+	m_poweredAngMotor = false;
+    m_targetAngMotorVelocity = btScalar(0.);
+    m_maxAngMotorForce = btScalar(0.);
+	m_accumulatedAngMotorImpulse = btScalar(0.0);
+
+	m_flags = 0;
+	m_flags = 0;
+
+	m_useOffsetForConstraintFrame = USE_OFFSET_FOR_CONSTANT_FRAME;
+
+	calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+}
+
+
+
+
+
+btSliderConstraint::btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB, bool useLinearReferenceFrameA)
+        : btTypedConstraint(SLIDER_CONSTRAINT_TYPE, rbA, rbB),
+		m_useSolveConstraintObsolete(false),
+		m_frameInA(frameInA),
+        m_frameInB(frameInB),
+		m_useLinearReferenceFrameA(useLinearReferenceFrameA)
+{
+	initParams();
+}
+
+
+
+btSliderConstraint::btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameA)
+        : btTypedConstraint(SLIDER_CONSTRAINT_TYPE, getFixedBody(), rbB),
+		m_useSolveConstraintObsolete(false),
+		m_frameInB(frameInB),
+		m_useLinearReferenceFrameA(useLinearReferenceFrameA)
+{
+	///not providing rigidbody A means implicitly using worldspace for body A
+	m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB;
+//	m_frameInA.getOrigin() = m_rbA.getCenterOfMassTransform()(m_frameInA.getOrigin());
+
+	initParams();
+}
+
+
+
+
+
+
+void btSliderConstraint::getInfo1(btConstraintInfo1* info)
+{
+	if (m_useSolveConstraintObsolete)
+	{
+		info->m_numConstraintRows = 0;
+		info->nub = 0;
+	}
+	else
+	{
+		info->m_numConstraintRows = 4; // Fixed 2 linear + 2 angular
+		info->nub = 2; 
+		//prepare constraint
+		calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+		testAngLimits();
+		testLinLimits();
+		if(getSolveLinLimit() || getPoweredLinMotor())
+		{
+			info->m_numConstraintRows++; // limit 3rd linear as well
+			info->nub--; 
+		}
+		if(getSolveAngLimit() || getPoweredAngMotor())
+		{
+			info->m_numConstraintRows++; // limit 3rd angular as well
+			info->nub--; 
+		}
+	}
+}
+
+void btSliderConstraint::getInfo1NonVirtual(btConstraintInfo1* info)
+{
+
+	info->m_numConstraintRows = 6; // Fixed 2 linear + 2 angular + 1 limit (even if not used)
+	info->nub = 0; 
+}
+
+void btSliderConstraint::getInfo2(btConstraintInfo2* info)
+{
+	getInfo2NonVirtual(info,m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform(), m_rbA.getLinearVelocity(),m_rbB.getLinearVelocity(), m_rbA.getInvMass(),m_rbB.getInvMass());
+}
+
+
+
+
+
+
+
+void btSliderConstraint::calculateTransforms(const btTransform& transA,const btTransform& transB)
+{
+	if(m_useLinearReferenceFrameA || (!m_useSolveConstraintObsolete))
+	{
+		m_calculatedTransformA = transA * m_frameInA;
+		m_calculatedTransformB = transB * m_frameInB;
+	}
+	else
+	{
+		m_calculatedTransformA = transB * m_frameInB;
+		m_calculatedTransformB = transA * m_frameInA;
+	}
+	m_realPivotAInW = m_calculatedTransformA.getOrigin();
+	m_realPivotBInW = m_calculatedTransformB.getOrigin();
+	m_sliderAxis = m_calculatedTransformA.getBasis().getColumn(0); // along X
+	if(m_useLinearReferenceFrameA || m_useSolveConstraintObsolete)
+	{
+		m_delta = m_realPivotBInW - m_realPivotAInW;
+	}
+	else
+	{
+		m_delta = m_realPivotAInW - m_realPivotBInW;
+	}
+	m_projPivotInW = m_realPivotAInW + m_sliderAxis.dot(m_delta) * m_sliderAxis;
+    btVector3 normalWorld;
+    int i;
+    //linear part
+    for(i = 0; i < 3; i++)
+    {
+		normalWorld = m_calculatedTransformA.getBasis().getColumn(i);
+		m_depth[i] = m_delta.dot(normalWorld);
+    }
+}
+ 
+
+
+void btSliderConstraint::testLinLimits(void)
+{
+	m_solveLinLim = false;
+	m_linPos = m_depth[0];
+	if(m_lowerLinLimit <= m_upperLinLimit)
+	{
+		if(m_depth[0] > m_upperLinLimit)
+		{
+			m_depth[0] -= m_upperLinLimit;
+			m_solveLinLim = true;
+		}
+		else if(m_depth[0] < m_lowerLinLimit)
+		{
+			m_depth[0] -= m_lowerLinLimit;
+			m_solveLinLim = true;
+		}
+		else
+		{
+			m_depth[0] = btScalar(0.);
+		}
+	}
+	else
+	{
+		m_depth[0] = btScalar(0.);
+	}
+}
+
+
+
+void btSliderConstraint::testAngLimits(void)
+{
+	m_angDepth = btScalar(0.);
+	m_solveAngLim = false;
+	if(m_lowerAngLimit <= m_upperAngLimit)
+	{
+		const btVector3 axisA0 = m_calculatedTransformA.getBasis().getColumn(1);
+		const btVector3 axisA1 = m_calculatedTransformA.getBasis().getColumn(2);
+		const btVector3 axisB0 = m_calculatedTransformB.getBasis().getColumn(1);
+//		btScalar rot = btAtan2Fast(axisB0.dot(axisA1), axisB0.dot(axisA0));  
+		btScalar rot = btAtan2(axisB0.dot(axisA1), axisB0.dot(axisA0));  
+		rot = btAdjustAngleToLimits(rot, m_lowerAngLimit, m_upperAngLimit);
+		m_angPos = rot;
+		if(rot < m_lowerAngLimit)
+		{
+			m_angDepth = rot - m_lowerAngLimit;
+			m_solveAngLim = true;
+		} 
+		else if(rot > m_upperAngLimit)
+		{
+			m_angDepth = rot - m_upperAngLimit;
+			m_solveAngLim = true;
+		}
+	}
+}
+
+btVector3 btSliderConstraint::getAncorInA(void)
+{
+	btVector3 ancorInA;
+	ancorInA = m_realPivotAInW + (m_lowerLinLimit + m_upperLinLimit) * btScalar(0.5) * m_sliderAxis;
+	ancorInA = m_rbA.getCenterOfMassTransform().inverse() * ancorInA;
+	return ancorInA;
+}
+
+
+
+btVector3 btSliderConstraint::getAncorInB(void)
+{
+	btVector3 ancorInB;
+	ancorInB = m_frameInB.getOrigin();
+	return ancorInB;
+}
+
+
+void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTransform& transA,const btTransform& transB, const btVector3& linVelA,const btVector3& linVelB, btScalar rbAinvMass,btScalar rbBinvMass  )
+{
+	const btTransform& trA = getCalculatedTransformA();
+	const btTransform& trB = getCalculatedTransformB();
+	
+	btAssert(!m_useSolveConstraintObsolete);
+	int i, s = info->rowskip;
+	
+	btScalar signFact = m_useLinearReferenceFrameA ? btScalar(1.0f) : btScalar(-1.0f);
+	
+	// difference between frames in WCS
+	btVector3 ofs = trB.getOrigin() - trA.getOrigin();
+	// now get weight factors depending on masses
+	btScalar miA = rbAinvMass;
+	btScalar miB = rbBinvMass;
+	bool hasStaticBody = (miA < SIMD_EPSILON) || (miB < SIMD_EPSILON);
+	btScalar miS = miA + miB;
+	btScalar factA, factB;
+	if(miS > btScalar(0.f))
+	{
+		factA = miB / miS;
+	}
+	else 
+	{
+		factA = btScalar(0.5f);
+	}
+	factB = btScalar(1.0f) - factA;
+	btVector3 ax1, p, q;
+	btVector3 ax1A = trA.getBasis().getColumn(0);
+	btVector3 ax1B = trB.getBasis().getColumn(0);
+	if(m_useOffsetForConstraintFrame)
+	{
+		// get the desired direction of slider axis
+		// as weighted sum of X-orthos of frameA and frameB in WCS
+		ax1 = ax1A * factA + ax1B * factB;
+		ax1.normalize();
+		// construct two orthos to slider axis
+		btPlaneSpace1 (ax1, p, q);
+	}
+	else
+	{ // old way - use frameA
+		ax1 = trA.getBasis().getColumn(0);
+		// get 2 orthos to slider axis (Y, Z)
+		p = trA.getBasis().getColumn(1);
+		q = trA.getBasis().getColumn(2);
+	}
+	// make rotations around these orthos equal
+	// the slider axis should be the only unconstrained
+	// rotational axis, the angular velocity of the two bodies perpendicular to
+	// the slider axis should be equal. thus the constraint equations are
+	//    p*w1 - p*w2 = 0
+	//    q*w1 - q*w2 = 0
+	// where p and q are unit vectors normal to the slider axis, and w1 and w2
+	// are the angular velocity vectors of the two bodies.
+	info->m_J1angularAxis[0] = p[0];
+	info->m_J1angularAxis[1] = p[1];
+	info->m_J1angularAxis[2] = p[2];
+	info->m_J1angularAxis[s+0] = q[0];
+	info->m_J1angularAxis[s+1] = q[1];
+	info->m_J1angularAxis[s+2] = q[2];
+
+	info->m_J2angularAxis[0] = -p[0];
+	info->m_J2angularAxis[1] = -p[1];
+	info->m_J2angularAxis[2] = -p[2];
+	info->m_J2angularAxis[s+0] = -q[0];
+	info->m_J2angularAxis[s+1] = -q[1];
+	info->m_J2angularAxis[s+2] = -q[2];
+	// compute the right hand side of the constraint equation. set relative
+	// body velocities along p and q to bring the slider back into alignment.
+	// if ax1A,ax1B are the unit length slider axes as computed from bodyA and
+	// bodyB, we need to rotate both bodies along the axis u = (ax1 x ax2).
+	// if "theta" is the angle between ax1 and ax2, we need an angular velocity
+	// along u to cover angle erp*theta in one step :
+	//   |angular_velocity| = angle/time = erp*theta / stepsize
+	//                      = (erp*fps) * theta
+	//    angular_velocity  = |angular_velocity| * (ax1 x ax2) / |ax1 x ax2|
+	//                      = (erp*fps) * theta * (ax1 x ax2) / sin(theta)
+	// ...as ax1 and ax2 are unit length. if theta is smallish,
+	// theta ~= sin(theta), so
+	//    angular_velocity  = (erp*fps) * (ax1 x ax2)
+	// ax1 x ax2 is in the plane space of ax1, so we project the angular
+	// velocity to p and q to find the right hand side.
+//	btScalar k = info->fps * info->erp * getSoftnessOrthoAng();
+	btScalar currERP = (m_flags & BT_SLIDER_FLAGS_ERP_ORTANG) ? m_softnessOrthoAng : m_softnessOrthoAng * info->erp;
+	btScalar k = info->fps * currERP;
+
+	btVector3 u = ax1A.cross(ax1B);
+	info->m_constraintError[0] = k * u.dot(p);
+	info->m_constraintError[s] = k * u.dot(q);
+	if(m_flags & BT_SLIDER_FLAGS_CFM_ORTANG)
+	{
+		info->cfm[0] = m_cfmOrthoAng;
+		info->cfm[s] = m_cfmOrthoAng;
+	}
+
+	int nrow = 1; // last filled row
+	int srow;
+	btScalar limit_err;
+	int limit;
+	int powered;
+
+	// next two rows. 
+	// we want: velA + wA x relA == velB + wB x relB ... but this would
+	// result in three equations, so we project along two orthos to the slider axis
+
+	btTransform bodyA_trans = transA;
+	btTransform bodyB_trans = transB;
+	nrow++;
+	int s2 = nrow * s;
+	nrow++;
+	int s3 = nrow * s;
+	btVector3 tmpA(0,0,0), tmpB(0,0,0), relA(0,0,0), relB(0,0,0), c(0,0,0);
+	if(m_useOffsetForConstraintFrame)
+	{
+		// get vector from bodyB to frameB in WCS
+		relB = trB.getOrigin() - bodyB_trans.getOrigin();
+		// get its projection to slider axis
+		btVector3 projB = ax1 * relB.dot(ax1);
+		// get vector directed from bodyB to slider axis (and orthogonal to it)
+		btVector3 orthoB = relB - projB;
+		// same for bodyA
+		relA = trA.getOrigin() - bodyA_trans.getOrigin();
+		btVector3 projA = ax1 * relA.dot(ax1);
+		btVector3 orthoA = relA - projA;
+		// get desired offset between frames A and B along slider axis
+		btScalar sliderOffs = m_linPos - m_depth[0];
+		// desired vector from projection of center of bodyA to projection of center of bodyB to slider axis
+		btVector3 totalDist = projA + ax1 * sliderOffs - projB;
+		// get offset vectors relA and relB
+		relA = orthoA + totalDist * factA;
+		relB = orthoB - totalDist * factB;
+		// now choose average ortho to slider axis
+		p = orthoB * factA + orthoA * factB;
+		btScalar len2 = p.length2();
+		if(len2 > SIMD_EPSILON)
+		{
+			p /= btSqrt(len2);
+		}
+		else
+		{
+			p = trA.getBasis().getColumn(1);
+		}
+		// make one more ortho
+		q = ax1.cross(p);
+		// fill two rows
+		tmpA = relA.cross(p);
+		tmpB = relB.cross(p);
+		for (i=0; i<3; i++) info->m_J1angularAxis[s2+i] = tmpA[i];
+		for (i=0; i<3; i++) info->m_J2angularAxis[s2+i] = -tmpB[i];
+		tmpA = relA.cross(q);
+		tmpB = relB.cross(q);
+		if(hasStaticBody && getSolveAngLimit())
+		{ // to make constraint between static and dynamic objects more rigid
+			// remove wA (or wB) from equation if angular limit is hit
+			tmpB *= factB;
+			tmpA *= factA;
+		}
+		for (i=0; i<3; i++) info->m_J1angularAxis[s3+i] = tmpA[i];
+		for (i=0; i<3; i++) info->m_J2angularAxis[s3+i] = -tmpB[i];
+		for (i=0; i<3; i++) info->m_J1linearAxis[s2+i] = p[i];
+		for (i=0; i<3; i++) info->m_J1linearAxis[s3+i] = q[i];
+	}
+	else
+	{	// old way - maybe incorrect if bodies are not on the slider axis
+		// see discussion "Bug in slider constraint" http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=4024&start=0
+		c = bodyB_trans.getOrigin() - bodyA_trans.getOrigin();
+		btVector3 tmp = c.cross(p);
+		for (i=0; i<3; i++) info->m_J1angularAxis[s2+i] = factA*tmp[i];
+		for (i=0; i<3; i++) info->m_J2angularAxis[s2+i] = factB*tmp[i];
+		tmp = c.cross(q);
+		for (i=0; i<3; i++) info->m_J1angularAxis[s3+i] = factA*tmp[i];
+		for (i=0; i<3; i++) info->m_J2angularAxis[s3+i] = factB*tmp[i];
+
+		for (i=0; i<3; i++) info->m_J1linearAxis[s2+i] = p[i];
+		for (i=0; i<3; i++) info->m_J1linearAxis[s3+i] = q[i];
+	}
+	// compute two elements of right hand side
+
+	//	k = info->fps * info->erp * getSoftnessOrthoLin();
+	currERP = (m_flags & BT_SLIDER_FLAGS_ERP_ORTLIN) ? m_softnessOrthoLin : m_softnessOrthoLin * info->erp;
+	k = info->fps * currERP;
+
+	btScalar rhs = k * p.dot(ofs);
+	info->m_constraintError[s2] = rhs;
+	rhs = k * q.dot(ofs);
+	info->m_constraintError[s3] = rhs;
+	if(m_flags & BT_SLIDER_FLAGS_CFM_ORTLIN)
+	{
+		info->cfm[s2] = m_cfmOrthoLin;
+		info->cfm[s3] = m_cfmOrthoLin;
+	}
+
+
+	// check linear limits
+	limit_err = btScalar(0.0);
+	limit = 0;
+	if(getSolveLinLimit())
+	{
+		limit_err = getLinDepth() *  signFact;
+		limit = (limit_err > btScalar(0.0)) ? 2 : 1;
+	}
+	powered = 0;
+	if(getPoweredLinMotor())
+	{
+		powered = 1;
+	}
+	// if the slider has joint limits or motor, add in the extra row
+	if (limit || powered) 
+	{
+		nrow++;
+		srow = nrow * info->rowskip;
+		info->m_J1linearAxis[srow+0] = ax1[0];
+		info->m_J1linearAxis[srow+1] = ax1[1];
+		info->m_J1linearAxis[srow+2] = ax1[2];
+		// linear torque decoupling step:
+		//
+		// we have to be careful that the linear constraint forces (+/- ax1) applied to the two bodies
+		// do not create a torque couple. in other words, the points that the
+		// constraint force is applied at must lie along the same ax1 axis.
+		// a torque couple will result in limited slider-jointed free
+		// bodies from gaining angular momentum.
+		if(m_useOffsetForConstraintFrame)
+		{
+			// this is needed only when bodyA and bodyB are both dynamic.
+			if(!hasStaticBody)
+			{
+				tmpA = relA.cross(ax1);
+				tmpB = relB.cross(ax1);
+				info->m_J1angularAxis[srow+0] = tmpA[0];
+				info->m_J1angularAxis[srow+1] = tmpA[1];
+				info->m_J1angularAxis[srow+2] = tmpA[2];
+				info->m_J2angularAxis[srow+0] = -tmpB[0];
+				info->m_J2angularAxis[srow+1] = -tmpB[1];
+				info->m_J2angularAxis[srow+2] = -tmpB[2];
+			}
+		}
+		else
+		{ // The old way. May be incorrect if bodies are not on the slider axis
+			btVector3 ltd;	// Linear Torque Decoupling vector (a torque)
+			ltd = c.cross(ax1);
+			info->m_J1angularAxis[srow+0] = factA*ltd[0];
+			info->m_J1angularAxis[srow+1] = factA*ltd[1];
+			info->m_J1angularAxis[srow+2] = factA*ltd[2];
+			info->m_J2angularAxis[srow+0] = factB*ltd[0];
+			info->m_J2angularAxis[srow+1] = factB*ltd[1];
+			info->m_J2angularAxis[srow+2] = factB*ltd[2];
+		}
+		// right-hand part
+		btScalar lostop = getLowerLinLimit();
+		btScalar histop = getUpperLinLimit();
+		if(limit && (lostop == histop))
+		{  // the joint motor is ineffective
+			powered = 0;
+		}
+		info->m_constraintError[srow] = 0.;
+		info->m_lowerLimit[srow] = 0.;
+		info->m_upperLimit[srow] = 0.;
+		currERP = (m_flags & BT_SLIDER_FLAGS_ERP_LIMLIN) ? m_softnessLimLin : info->erp;
+		if(powered)
+		{
+			if(m_flags & BT_SLIDER_FLAGS_CFM_DIRLIN)
+			{
+				info->cfm[srow] = m_cfmDirLin;
+			}
+			btScalar tag_vel = getTargetLinMotorVelocity();
+			btScalar mot_fact = getMotorFactor(m_linPos, m_lowerLinLimit, m_upperLinLimit, tag_vel, info->fps * currERP);
+			info->m_constraintError[srow] -= signFact * mot_fact * getTargetLinMotorVelocity();
+			info->m_lowerLimit[srow] += -getMaxLinMotorForce() * info->fps;
+			info->m_upperLimit[srow] += getMaxLinMotorForce() * info->fps;
+		}
+		if(limit)
+		{
+			k = info->fps * currERP;
+			info->m_constraintError[srow] += k * limit_err;
+			if(m_flags & BT_SLIDER_FLAGS_CFM_LIMLIN)
+			{
+				info->cfm[srow] = m_cfmLimLin;
+			}
+			if(lostop == histop) 
+			{	// limited low and high simultaneously
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			}
+			else if(limit == 1) 
+			{ // low limit
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = 0;
+			}
+			else 
+			{ // high limit
+				info->m_lowerLimit[srow] = 0;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			}
+			// bounce (we'll use slider parameter abs(1.0 - m_dampingLimLin) for that)
+			btScalar bounce = btFabs(btScalar(1.0) - getDampingLimLin());
+			if(bounce > btScalar(0.0))
+			{
+				btScalar vel = linVelA.dot(ax1);
+				vel -= linVelB.dot(ax1);
+				vel *= signFact;
+				// only apply bounce if the velocity is incoming, and if the
+				// resulting c[] exceeds what we already have.
+				if(limit == 1)
+				{	// low limit
+					if(vel < 0)
+					{
+						btScalar newc = -bounce * vel;
+						if (newc > info->m_constraintError[srow])
+						{
+							info->m_constraintError[srow] = newc;
+						}
+					}
+				}
+				else
+				{ // high limit - all those computations are reversed
+					if(vel > 0)
+					{
+						btScalar newc = -bounce * vel;
+						if(newc < info->m_constraintError[srow]) 
+						{
+							info->m_constraintError[srow] = newc;
+						}
+					}
+				}
+			}
+			info->m_constraintError[srow] *= getSoftnessLimLin();
+		} // if(limit)
+	} // if linear limit
+	// check angular limits
+	limit_err = btScalar(0.0);
+	limit = 0;
+	if(getSolveAngLimit())
+	{
+		limit_err = getAngDepth();
+		limit = (limit_err > btScalar(0.0)) ? 1 : 2;
+	}
+	// if the slider has joint limits, add in the extra row
+	powered = 0;
+	if(getPoweredAngMotor())
+	{
+		powered = 1;
+	}
+	if(limit || powered) 
+	{
+		nrow++;
+		srow = nrow * info->rowskip;
+		info->m_J1angularAxis[srow+0] = ax1[0];
+		info->m_J1angularAxis[srow+1] = ax1[1];
+		info->m_J1angularAxis[srow+2] = ax1[2];
+
+		info->m_J2angularAxis[srow+0] = -ax1[0];
+		info->m_J2angularAxis[srow+1] = -ax1[1];
+		info->m_J2angularAxis[srow+2] = -ax1[2];
+
+		btScalar lostop = getLowerAngLimit();
+		btScalar histop = getUpperAngLimit();
+		if(limit && (lostop == histop))
+		{  // the joint motor is ineffective
+			powered = 0;
+		}
+		currERP = (m_flags & BT_SLIDER_FLAGS_ERP_LIMANG) ? m_softnessLimAng : info->erp;
+		if(powered)
+		{
+			if(m_flags & BT_SLIDER_FLAGS_CFM_DIRANG)
+			{
+				info->cfm[srow] = m_cfmDirAng;
+			}
+			btScalar mot_fact = getMotorFactor(m_angPos, m_lowerAngLimit, m_upperAngLimit, getTargetAngMotorVelocity(), info->fps * currERP);
+			info->m_constraintError[srow] = mot_fact * getTargetAngMotorVelocity();
+			info->m_lowerLimit[srow] = -getMaxAngMotorForce() * info->fps;
+			info->m_upperLimit[srow] = getMaxAngMotorForce() * info->fps;
+		}
+		if(limit)
+		{
+			k = info->fps * currERP;
+			info->m_constraintError[srow] += k * limit_err;
+			if(m_flags & BT_SLIDER_FLAGS_CFM_LIMANG)
+			{
+				info->cfm[srow] = m_cfmLimAng;
+			}
+			if(lostop == histop) 
+			{
+				// limited low and high simultaneously
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			}
+			else if(limit == 1) 
+			{ // low limit
+				info->m_lowerLimit[srow] = 0;
+				info->m_upperLimit[srow] = SIMD_INFINITY;
+			}
+			else 
+			{ // high limit
+				info->m_lowerLimit[srow] = -SIMD_INFINITY;
+				info->m_upperLimit[srow] = 0;
+			}
+			// bounce (we'll use slider parameter abs(1.0 - m_dampingLimAng) for that)
+			btScalar bounce = btFabs(btScalar(1.0) - getDampingLimAng());
+			if(bounce > btScalar(0.0))
+			{
+				btScalar vel = m_rbA.getAngularVelocity().dot(ax1);
+				vel -= m_rbB.getAngularVelocity().dot(ax1);
+				// only apply bounce if the velocity is incoming, and if the
+				// resulting c[] exceeds what we already have.
+				if(limit == 1)
+				{	// low limit
+					if(vel < 0)
+					{
+						btScalar newc = -bounce * vel;
+						if(newc > info->m_constraintError[srow])
+						{
+							info->m_constraintError[srow] = newc;
+						}
+					}
+				}
+				else
+				{	// high limit - all those computations are reversed
+					if(vel > 0)
+					{
+						btScalar newc = -bounce * vel;
+						if(newc < info->m_constraintError[srow])
+						{
+							info->m_constraintError[srow] = newc;
+						}
+					}
+				}
+			}
+			info->m_constraintError[srow] *= getSoftnessLimAng();
+		} // if(limit)
+	} // if angular limit or powered
+}
+
+
+///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+///If no axis is provided, it uses the default axis for this constraint.
+void btSliderConstraint::setParam(int num, btScalar value, int axis)
+{
+	switch(num)
+	{
+	case BT_CONSTRAINT_STOP_ERP :
+		if(axis < 1)
+		{
+			m_softnessLimLin = value;
+			m_flags |= BT_SLIDER_FLAGS_ERP_LIMLIN;
+		}
+		else if(axis < 3)
+		{
+			m_softnessOrthoLin = value;
+			m_flags |= BT_SLIDER_FLAGS_ERP_ORTLIN;
+		}
+		else if(axis == 3)
+		{
+			m_softnessLimAng = value;
+			m_flags |= BT_SLIDER_FLAGS_ERP_LIMANG;
+		}
+		else if(axis < 6)
+		{
+			m_softnessOrthoAng = value;
+			m_flags |= BT_SLIDER_FLAGS_ERP_ORTANG;
+		}
+		else
+		{
+			btAssertConstrParams(0);
+		}
+		break;
+	case BT_CONSTRAINT_CFM :
+		if(axis < 1)
+		{
+			m_cfmDirLin = value;
+			m_flags |= BT_SLIDER_FLAGS_CFM_DIRLIN;
+		}
+		else if(axis == 3)
+		{
+			m_cfmDirAng = value;
+			m_flags |= BT_SLIDER_FLAGS_CFM_DIRANG;
+		}
+		else
+		{
+			btAssertConstrParams(0);
+		}
+		break;
+	case BT_CONSTRAINT_STOP_CFM :
+		if(axis < 1)
+		{
+			m_cfmLimLin = value;
+			m_flags |= BT_SLIDER_FLAGS_CFM_LIMLIN;
+		}
+		else if(axis < 3)
+		{
+			m_cfmOrthoLin = value;
+			m_flags |= BT_SLIDER_FLAGS_CFM_ORTLIN;
+		}
+		else if(axis == 3)
+		{
+			m_cfmLimAng = value;
+			m_flags |= BT_SLIDER_FLAGS_CFM_LIMANG;
+		}
+		else if(axis < 6)
+		{
+			m_cfmOrthoAng = value;
+			m_flags |= BT_SLIDER_FLAGS_CFM_ORTANG;
+		}
+		else
+		{
+			btAssertConstrParams(0);
+		}
+		break;
+	}
+}
+
+///return the local value of parameter
+btScalar btSliderConstraint::getParam(int num, int axis) const 
+{
+	btScalar retVal(SIMD_INFINITY);
+	switch(num)
+	{
+	case BT_CONSTRAINT_STOP_ERP :
+		if(axis < 1)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_ERP_LIMLIN);
+			retVal = m_softnessLimLin;
+		}
+		else if(axis < 3)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_ERP_ORTLIN);
+			retVal = m_softnessOrthoLin;
+		}
+		else if(axis == 3)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_ERP_LIMANG);
+			retVal = m_softnessLimAng;
+		}
+		else if(axis < 6)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_ERP_ORTANG);
+			retVal = m_softnessOrthoAng;
+		}
+		else
+		{
+			btAssertConstrParams(0);
+		}
+		break;
+	case BT_CONSTRAINT_CFM :
+		if(axis < 1)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_DIRLIN);
+			retVal = m_cfmDirLin;
+		}
+		else if(axis == 3)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_DIRANG);
+			retVal = m_cfmDirAng;
+		}
+		else
+		{
+			btAssertConstrParams(0);
+		}
+		break;
+	case BT_CONSTRAINT_STOP_CFM :
+		if(axis < 1)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_LIMLIN);
+			retVal = m_cfmLimLin;
+		}
+		else if(axis < 3)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_ORTLIN);
+			retVal = m_cfmOrthoLin;
+		}
+		else if(axis == 3)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_LIMANG);
+			retVal = m_cfmLimAng;
+		}
+		else if(axis < 6)
+		{
+			btAssertConstrParams(m_flags & BT_SLIDER_FLAGS_CFM_ORTANG);
+			retVal = m_cfmOrthoAng;
+		}
+		else
+		{
+			btAssertConstrParams(0);
+		}
+		break;
+	}
+	return retVal;
+}
+
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h
new file mode 100755
index 0000000..2edc8d2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h
@@ -0,0 +1,333 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+Added by Roman Ponomarev (rponom at gmail.com)
+April 04, 2008
+
+TODO:
+ - add clamping od accumulated impulse to improve stability
+ - add conversion for ODE constraint solver
+*/
+
+#ifndef BT_SLIDER_CONSTRAINT_H
+#define BT_SLIDER_CONSTRAINT_H
+
+
+
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+#include "btTypedConstraint.h"
+
+
+
+class btRigidBody;
+
+
+
+#define SLIDER_CONSTRAINT_DEF_SOFTNESS		(btScalar(1.0))
+#define SLIDER_CONSTRAINT_DEF_DAMPING		(btScalar(1.0))
+#define SLIDER_CONSTRAINT_DEF_RESTITUTION	(btScalar(0.7))
+#define SLIDER_CONSTRAINT_DEF_CFM			(btScalar(0.f))
+
+
+enum btSliderFlags
+{
+	BT_SLIDER_FLAGS_CFM_DIRLIN = (1 << 0),
+	BT_SLIDER_FLAGS_ERP_DIRLIN = (1 << 1),
+	BT_SLIDER_FLAGS_CFM_DIRANG = (1 << 2),
+	BT_SLIDER_FLAGS_ERP_DIRANG = (1 << 3),
+	BT_SLIDER_FLAGS_CFM_ORTLIN = (1 << 4),
+	BT_SLIDER_FLAGS_ERP_ORTLIN = (1 << 5),
+	BT_SLIDER_FLAGS_CFM_ORTANG = (1 << 6),
+	BT_SLIDER_FLAGS_ERP_ORTANG = (1 << 7),
+	BT_SLIDER_FLAGS_CFM_LIMLIN = (1 << 8),
+	BT_SLIDER_FLAGS_ERP_LIMLIN = (1 << 9),
+	BT_SLIDER_FLAGS_CFM_LIMANG = (1 << 10),
+	BT_SLIDER_FLAGS_ERP_LIMANG = (1 << 11)
+};
+
+
+class btSliderConstraint : public btTypedConstraint
+{
+protected:
+	///for backwards compatibility during the transition to 'getInfo/getInfo2'
+	bool		m_useSolveConstraintObsolete;
+	bool		m_useOffsetForConstraintFrame;
+	btTransform	m_frameInA;
+    btTransform	m_frameInB;
+	// use frameA fo define limits, if true
+	bool m_useLinearReferenceFrameA;
+	// linear limits
+	btScalar m_lowerLinLimit;
+	btScalar m_upperLinLimit;
+	// angular limits
+	btScalar m_lowerAngLimit;
+	btScalar m_upperAngLimit;
+	// softness, restitution and damping for different cases
+	// DirLin - moving inside linear limits
+	// LimLin - hitting linear limit
+	// DirAng - moving inside angular limits
+	// LimAng - hitting angular limit
+	// OrthoLin, OrthoAng - against constraint axis
+	btScalar m_softnessDirLin;
+	btScalar m_restitutionDirLin;
+	btScalar m_dampingDirLin;
+	btScalar m_cfmDirLin;
+
+	btScalar m_softnessDirAng;
+	btScalar m_restitutionDirAng;
+	btScalar m_dampingDirAng;
+	btScalar m_cfmDirAng;
+
+	btScalar m_softnessLimLin;
+	btScalar m_restitutionLimLin;
+	btScalar m_dampingLimLin;
+	btScalar m_cfmLimLin;
+
+	btScalar m_softnessLimAng;
+	btScalar m_restitutionLimAng;
+	btScalar m_dampingLimAng;
+	btScalar m_cfmLimAng;
+
+	btScalar m_softnessOrthoLin;
+	btScalar m_restitutionOrthoLin;
+	btScalar m_dampingOrthoLin;
+	btScalar m_cfmOrthoLin;
+
+	btScalar m_softnessOrthoAng;
+	btScalar m_restitutionOrthoAng;
+	btScalar m_dampingOrthoAng;
+	btScalar m_cfmOrthoAng;
+	
+	// for interlal use
+	bool m_solveLinLim;
+	bool m_solveAngLim;
+
+	int m_flags;
+
+	btJacobianEntry	m_jacLin[3];
+	btScalar		m_jacLinDiagABInv[3];
+
+    btJacobianEntry	m_jacAng[3];
+
+	btScalar m_timeStep;
+    btTransform m_calculatedTransformA;
+    btTransform m_calculatedTransformB;
+
+	btVector3 m_sliderAxis;
+	btVector3 m_realPivotAInW;
+	btVector3 m_realPivotBInW;
+	btVector3 m_projPivotInW;
+	btVector3 m_delta;
+	btVector3 m_depth;
+	btVector3 m_relPosA;
+	btVector3 m_relPosB;
+
+	btScalar m_linPos;
+	btScalar m_angPos;
+
+	btScalar m_angDepth;
+	btScalar m_kAngle;
+
+	bool	 m_poweredLinMotor;
+    btScalar m_targetLinMotorVelocity;
+    btScalar m_maxLinMotorForce;
+    btScalar m_accumulatedLinMotorImpulse;
+	
+	bool	 m_poweredAngMotor;
+    btScalar m_targetAngMotorVelocity;
+    btScalar m_maxAngMotorForce;
+    btScalar m_accumulatedAngMotorImpulse;
+
+	//------------------------    
+	void initParams();
+public:
+	// constructors
+    btSliderConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
+    btSliderConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameA);
+
+	// overrides
+
+    virtual void getInfo1 (btConstraintInfo1* info);
+
+	void getInfo1NonVirtual(btConstraintInfo1* info);
+	
+	virtual void getInfo2 (btConstraintInfo2* info);
+
+	void getInfo2NonVirtual(btConstraintInfo2* info, const btTransform& transA, const btTransform& transB,const btVector3& linVelA,const btVector3& linVelB, btScalar rbAinvMass,btScalar rbBinvMass);
+
+
+	// access
+    const btRigidBody& getRigidBodyA() const { return m_rbA; }
+    const btRigidBody& getRigidBodyB() const { return m_rbB; }
+    const btTransform & getCalculatedTransformA() const { return m_calculatedTransformA; }
+    const btTransform & getCalculatedTransformB() const { return m_calculatedTransformB; }
+    const btTransform & getFrameOffsetA() const { return m_frameInA; }
+    const btTransform & getFrameOffsetB() const { return m_frameInB; }
+    btTransform & getFrameOffsetA() { return m_frameInA; }
+    btTransform & getFrameOffsetB() { return m_frameInB; }
+    btScalar getLowerLinLimit() { return m_lowerLinLimit; }
+    void setLowerLinLimit(btScalar lowerLimit) { m_lowerLinLimit = lowerLimit; }
+    btScalar getUpperLinLimit() { return m_upperLinLimit; }
+    void setUpperLinLimit(btScalar upperLimit) { m_upperLinLimit = upperLimit; }
+    btScalar getLowerAngLimit() { return m_lowerAngLimit; }
+    void setLowerAngLimit(btScalar lowerLimit) { m_lowerAngLimit = btNormalizeAngle(lowerLimit); }
+    btScalar getUpperAngLimit() { return m_upperAngLimit; }
+    void setUpperAngLimit(btScalar upperLimit) { m_upperAngLimit = btNormalizeAngle(upperLimit); }
+	bool getUseLinearReferenceFrameA() { return m_useLinearReferenceFrameA; }
+	btScalar getSoftnessDirLin() { return m_softnessDirLin; }
+	btScalar getRestitutionDirLin() { return m_restitutionDirLin; }
+	btScalar getDampingDirLin() { return m_dampingDirLin ; }
+	btScalar getSoftnessDirAng() { return m_softnessDirAng; }
+	btScalar getRestitutionDirAng() { return m_restitutionDirAng; }
+	btScalar getDampingDirAng() { return m_dampingDirAng; }
+	btScalar getSoftnessLimLin() { return m_softnessLimLin; }
+	btScalar getRestitutionLimLin() { return m_restitutionLimLin; }
+	btScalar getDampingLimLin() { return m_dampingLimLin; }
+	btScalar getSoftnessLimAng() { return m_softnessLimAng; }
+	btScalar getRestitutionLimAng() { return m_restitutionLimAng; }
+	btScalar getDampingLimAng() { return m_dampingLimAng; }
+	btScalar getSoftnessOrthoLin() { return m_softnessOrthoLin; }
+	btScalar getRestitutionOrthoLin() { return m_restitutionOrthoLin; }
+	btScalar getDampingOrthoLin() { return m_dampingOrthoLin; }
+	btScalar getSoftnessOrthoAng() { return m_softnessOrthoAng; }
+	btScalar getRestitutionOrthoAng() { return m_restitutionOrthoAng; }
+	btScalar getDampingOrthoAng() { return m_dampingOrthoAng; }
+	void setSoftnessDirLin(btScalar softnessDirLin) { m_softnessDirLin = softnessDirLin; }
+	void setRestitutionDirLin(btScalar restitutionDirLin) { m_restitutionDirLin = restitutionDirLin; }
+	void setDampingDirLin(btScalar dampingDirLin) { m_dampingDirLin = dampingDirLin; }
+	void setSoftnessDirAng(btScalar softnessDirAng) { m_softnessDirAng = softnessDirAng; }
+	void setRestitutionDirAng(btScalar restitutionDirAng) { m_restitutionDirAng = restitutionDirAng; }
+	void setDampingDirAng(btScalar dampingDirAng) { m_dampingDirAng = dampingDirAng; }
+	void setSoftnessLimLin(btScalar softnessLimLin) { m_softnessLimLin = softnessLimLin; }
+	void setRestitutionLimLin(btScalar restitutionLimLin) { m_restitutionLimLin = restitutionLimLin; }
+	void setDampingLimLin(btScalar dampingLimLin) { m_dampingLimLin = dampingLimLin; }
+	void setSoftnessLimAng(btScalar softnessLimAng) { m_softnessLimAng = softnessLimAng; }
+	void setRestitutionLimAng(btScalar restitutionLimAng) { m_restitutionLimAng = restitutionLimAng; }
+	void setDampingLimAng(btScalar dampingLimAng) { m_dampingLimAng = dampingLimAng; }
+	void setSoftnessOrthoLin(btScalar softnessOrthoLin) { m_softnessOrthoLin = softnessOrthoLin; }
+	void setRestitutionOrthoLin(btScalar restitutionOrthoLin) { m_restitutionOrthoLin = restitutionOrthoLin; }
+	void setDampingOrthoLin(btScalar dampingOrthoLin) { m_dampingOrthoLin = dampingOrthoLin; }
+	void setSoftnessOrthoAng(btScalar softnessOrthoAng) { m_softnessOrthoAng = softnessOrthoAng; }
+	void setRestitutionOrthoAng(btScalar restitutionOrthoAng) { m_restitutionOrthoAng = restitutionOrthoAng; }
+	void setDampingOrthoAng(btScalar dampingOrthoAng) { m_dampingOrthoAng = dampingOrthoAng; }
+	void setPoweredLinMotor(bool onOff) { m_poweredLinMotor = onOff; }
+	bool getPoweredLinMotor() { return m_poweredLinMotor; }
+	void setTargetLinMotorVelocity(btScalar targetLinMotorVelocity) { m_targetLinMotorVelocity = targetLinMotorVelocity; }
+	btScalar getTargetLinMotorVelocity() { return m_targetLinMotorVelocity; }
+	void setMaxLinMotorForce(btScalar maxLinMotorForce) { m_maxLinMotorForce = maxLinMotorForce; }
+	btScalar getMaxLinMotorForce() { return m_maxLinMotorForce; }
+	void setPoweredAngMotor(bool onOff) { m_poweredAngMotor = onOff; }
+	bool getPoweredAngMotor() { return m_poweredAngMotor; }
+	void setTargetAngMotorVelocity(btScalar targetAngMotorVelocity) { m_targetAngMotorVelocity = targetAngMotorVelocity; }
+	btScalar getTargetAngMotorVelocity() { return m_targetAngMotorVelocity; }
+	void setMaxAngMotorForce(btScalar maxAngMotorForce) { m_maxAngMotorForce = maxAngMotorForce; }
+	btScalar getMaxAngMotorForce() { return m_maxAngMotorForce; }
+
+	btScalar getLinearPos() const { return m_linPos; }
+	btScalar getAngularPos() const { return m_angPos; }
+	
+	
+
+	// access for ODE solver
+	bool getSolveLinLimit() { return m_solveLinLim; }
+	btScalar getLinDepth() { return m_depth[0]; }
+	bool getSolveAngLimit() { return m_solveAngLim; }
+	btScalar getAngDepth() { return m_angDepth; }
+	// shared code used by ODE solver
+	void	calculateTransforms(const btTransform& transA,const btTransform& transB);
+	void	testLinLimits();
+	void	testAngLimits();
+	// access for PE Solver
+	btVector3 getAncorInA();
+	btVector3 getAncorInB();
+	// access for UseFrameOffset
+	bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
+	void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
+
+	void setFrames(const btTransform& frameA, const btTransform& frameB) 
+	{ 
+		m_frameInA=frameA; 
+		m_frameInB=frameB;
+		calculateTransforms(m_rbA.getCenterOfMassTransform(),m_rbB.getCenterOfMassTransform());
+		buildJacobian();
+	} 
+
+
+	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+	///If no axis is provided, it uses the default axis for this constraint.
+	virtual	void	setParam(int num, btScalar value, int axis = -1);
+	///return the local value of parameter
+	virtual	btScalar getParam(int num, int axis = -1) const;
+
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct btSliderConstraintData
+{
+	btTypedConstraintData	m_typeConstraintData;
+	btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
+	btTransformFloatData m_rbBFrame;
+	
+	float	m_linearUpperLimit;
+	float	m_linearLowerLimit;
+
+	float	m_angularUpperLimit;
+	float	m_angularLowerLimit;
+
+	int	m_useLinearReferenceFrameA;
+	int m_useOffsetForConstraintFrame;
+
+};
+
+
+SIMD_FORCE_INLINE		int	btSliderConstraint::calculateSerializeBufferSize() const
+{
+	return sizeof(btSliderConstraintData);
+}
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+SIMD_FORCE_INLINE	const char*	btSliderConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+
+	btSliderConstraintData* sliderData = (btSliderConstraintData*) dataBuffer;
+	btTypedConstraint::serialize(&sliderData->m_typeConstraintData,serializer);
+
+	m_frameInA.serializeFloat(sliderData->m_rbAFrame);
+	m_frameInB.serializeFloat(sliderData->m_rbBFrame);
+
+	sliderData->m_linearUpperLimit = float(m_upperLinLimit);
+	sliderData->m_linearLowerLimit = float(m_lowerLinLimit);
+
+	sliderData->m_angularUpperLimit = float(m_upperAngLimit);
+	sliderData->m_angularLowerLimit = float(m_lowerAngLimit);
+
+	sliderData->m_useLinearReferenceFrameA = m_useLinearReferenceFrameA;
+	sliderData->m_useOffsetForConstraintFrame = m_useOffsetForConstraintFrame;
+
+	return "btSliderConstraintData";
+}
+
+
+
+#endif //BT_SLIDER_CONSTRAINT_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
new file mode 100644
index 0000000..0c7dbd6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
@@ -0,0 +1,255 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#include "btSolve2LinearConstraint.h"
+
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btVector3.h"
+#include "btJacobianEntry.h"
+
+
+void btSolve2LinearConstraint::resolveUnilateralPairConstraint(
+												   btRigidBody* body1,
+		btRigidBody* body2,
+
+						const btMatrix3x3& world2A,
+						const btMatrix3x3& world2B,
+						
+						const btVector3& invInertiaADiag,
+						const btScalar invMassA,
+						const btVector3& linvelA,const btVector3& angvelA,
+						const btVector3& rel_posA1,
+						const btVector3& invInertiaBDiag,
+						const btScalar invMassB,
+						const btVector3& linvelB,const btVector3& angvelB,
+						const btVector3& rel_posA2,
+
+					  btScalar depthA, const btVector3& normalA, 
+					  const btVector3& rel_posB1,const btVector3& rel_posB2,
+					  btScalar depthB, const btVector3& normalB, 
+					  btScalar& imp0,btScalar& imp1)
+{
+	(void)linvelA;
+	(void)linvelB;
+	(void)angvelB;
+	(void)angvelA;
+
+
+
+	imp0 = btScalar(0.);
+	imp1 = btScalar(0.);
+
+	btScalar len = btFabs(normalA.length()) - btScalar(1.);
+	if (btFabs(len) >= SIMD_EPSILON)
+		return;
+
+	btAssert(len < SIMD_EPSILON);
+
+
+	//this jacobian entry could be re-used for all iterations
+	btJacobianEntry jacA(world2A,world2B,rel_posA1,rel_posA2,normalA,invInertiaADiag,invMassA,
+		invInertiaBDiag,invMassB);
+	btJacobianEntry jacB(world2A,world2B,rel_posB1,rel_posB2,normalB,invInertiaADiag,invMassA,
+		invInertiaBDiag,invMassB);
+	
+	//const btScalar vel0 = jacA.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
+	//const btScalar vel1 = jacB.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
+
+	const btScalar vel0 = normalA.dot(body1->getVelocityInLocalPoint(rel_posA1)-body2->getVelocityInLocalPoint(rel_posA1));
+	const btScalar vel1 = normalB.dot(body1->getVelocityInLocalPoint(rel_posB1)-body2->getVelocityInLocalPoint(rel_posB1));
+
+//	btScalar penetrationImpulse = (depth*contactTau*timeCorrection)  * massTerm;//jacDiagABInv
+	btScalar massTerm = btScalar(1.) / (invMassA + invMassB);
+
+
+	// calculate rhs (or error) terms
+	const btScalar dv0 = depthA  * m_tau * massTerm - vel0 * m_damping;
+	const btScalar dv1 = depthB  * m_tau * massTerm - vel1 * m_damping;
+
+
+	// dC/dv * dv = -C
+	
+	// jacobian * impulse = -error
+	//
+
+	//impulse = jacobianInverse * -error
+
+	// inverting 2x2 symmetric system (offdiagonal are equal!)
+	// 
+
+
+	btScalar nonDiag = jacA.getNonDiagonal(jacB,invMassA,invMassB);
+	btScalar	invDet = btScalar(1.0) / (jacA.getDiagonal() * jacB.getDiagonal() - nonDiag * nonDiag );
+	
+	//imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
+	//imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
+
+	imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
+	imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
+
+	//[a b]								  [d -c]
+	//[c d] inverse = (1 / determinant) * [-b a] where determinant is (ad - bc)
+
+	//[jA nD] * [imp0] = [dv0]
+	//[nD jB]   [imp1]   [dv1]
+
+}
+
+
+
+void btSolve2LinearConstraint::resolveBilateralPairConstraint(
+						btRigidBody* body1,
+						btRigidBody* body2,
+						const btMatrix3x3& world2A,
+						const btMatrix3x3& world2B,
+						
+						const btVector3& invInertiaADiag,
+						const btScalar invMassA,
+						const btVector3& linvelA,const btVector3& angvelA,
+						const btVector3& rel_posA1,
+						const btVector3& invInertiaBDiag,
+						const btScalar invMassB,
+						const btVector3& linvelB,const btVector3& angvelB,
+						const btVector3& rel_posA2,
+
+					  btScalar depthA, const btVector3& normalA, 
+					  const btVector3& rel_posB1,const btVector3& rel_posB2,
+					  btScalar depthB, const btVector3& normalB, 
+					  btScalar& imp0,btScalar& imp1)
+{
+
+	(void)linvelA;
+	(void)linvelB;
+	(void)angvelA;
+	(void)angvelB;
+
+
+
+	imp0 = btScalar(0.);
+	imp1 = btScalar(0.);
+
+	btScalar len = btFabs(normalA.length()) - btScalar(1.);
+	if (btFabs(len) >= SIMD_EPSILON)
+		return;
+
+	btAssert(len < SIMD_EPSILON);
+
+
+	//this jacobian entry could be re-used for all iterations
+	btJacobianEntry jacA(world2A,world2B,rel_posA1,rel_posA2,normalA,invInertiaADiag,invMassA,
+		invInertiaBDiag,invMassB);
+	btJacobianEntry jacB(world2A,world2B,rel_posB1,rel_posB2,normalB,invInertiaADiag,invMassA,
+		invInertiaBDiag,invMassB);
+	
+	//const btScalar vel0 = jacA.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
+	//const btScalar vel1 = jacB.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
+
+	const btScalar vel0 = normalA.dot(body1->getVelocityInLocalPoint(rel_posA1)-body2->getVelocityInLocalPoint(rel_posA1));
+	const btScalar vel1 = normalB.dot(body1->getVelocityInLocalPoint(rel_posB1)-body2->getVelocityInLocalPoint(rel_posB1));
+
+	// calculate rhs (or error) terms
+	const btScalar dv0 = depthA  * m_tau - vel0 * m_damping;
+	const btScalar dv1 = depthB  * m_tau - vel1 * m_damping;
+
+	// dC/dv * dv = -C
+	
+	// jacobian * impulse = -error
+	//
+
+	//impulse = jacobianInverse * -error
+
+	// inverting 2x2 symmetric system (offdiagonal are equal!)
+	// 
+
+
+	btScalar nonDiag = jacA.getNonDiagonal(jacB,invMassA,invMassB);
+	btScalar	invDet = btScalar(1.0) / (jacA.getDiagonal() * jacB.getDiagonal() - nonDiag * nonDiag );
+	
+	//imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
+	//imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
+
+	imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
+	imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
+
+	//[a b]								  [d -c]
+	//[c d] inverse = (1 / determinant) * [-b a] where determinant is (ad - bc)
+
+	//[jA nD] * [imp0] = [dv0]
+	//[nD jB]   [imp1]   [dv1]
+
+	if ( imp0 > btScalar(0.0))
+	{
+		if ( imp1 > btScalar(0.0) )
+		{
+			//both positive
+		}
+		else
+		{
+			imp1 = btScalar(0.);
+
+			// now imp0>0 imp1<0
+			imp0 = dv0 / jacA.getDiagonal();
+			if ( imp0 > btScalar(0.0) )
+			{
+			} else
+			{
+				imp0 = btScalar(0.);
+			}
+		}
+	}
+	else
+	{
+		imp0 = btScalar(0.);
+
+		imp1 = dv1 / jacB.getDiagonal();
+		if ( imp1 <= btScalar(0.0) )
+		{
+			imp1 = btScalar(0.);
+			// now imp0>0 imp1<0
+			imp0 = dv0 / jacA.getDiagonal();
+			if ( imp0 > btScalar(0.0) )
+			{
+			} else
+			{
+				imp0 = btScalar(0.);
+			}
+		} else
+		{
+		}
+	}
+}
+
+
+/*
+void btSolve2LinearConstraint::resolveAngularConstraint(	const btMatrix3x3& invInertiaAWS,
+											const btScalar invMassA,
+											const btVector3& linvelA,const btVector3& angvelA,
+											const btVector3& rel_posA1,
+											const btMatrix3x3& invInertiaBWS,
+											const btScalar invMassB,
+											const btVector3& linvelB,const btVector3& angvelB,
+											const btVector3& rel_posA2,
+
+											btScalar depthA, const btVector3& normalA, 
+											const btVector3& rel_posB1,const btVector3& rel_posB2,
+											btScalar depthB, const btVector3& normalB, 
+											btScalar& imp0,btScalar& imp1)
+{
+
+}
+*/
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h
new file mode 100644
index 0000000..e8bfabf
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h
@@ -0,0 +1,107 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SOLVE_2LINEAR_CONSTRAINT_H
+#define BT_SOLVE_2LINEAR_CONSTRAINT_H
+
+#include "LinearMath/btMatrix3x3.h"
+#include "LinearMath/btVector3.h"
+
+
+class btRigidBody;
+
+
+
+/// constraint class used for lateral tyre friction.
+class	btSolve2LinearConstraint
+{
+	btScalar	m_tau;
+	btScalar	m_damping;
+
+public:
+
+	btSolve2LinearConstraint(btScalar tau,btScalar damping)
+	{
+		m_tau = tau;
+		m_damping = damping;
+	}
+	//
+	// solve unilateral constraint (equality, direct method)
+	//
+	void resolveUnilateralPairConstraint(		
+														   btRigidBody* body0,
+		btRigidBody* body1,
+
+		const btMatrix3x3& world2A,
+						const btMatrix3x3& world2B,
+						
+						const btVector3& invInertiaADiag,
+						const btScalar invMassA,
+						const btVector3& linvelA,const btVector3& angvelA,
+						const btVector3& rel_posA1,
+						const btVector3& invInertiaBDiag,
+						const btScalar invMassB,
+						const btVector3& linvelB,const btVector3& angvelB,
+						const btVector3& rel_posA2,
+
+					  btScalar depthA, const btVector3& normalA, 
+					  const btVector3& rel_posB1,const btVector3& rel_posB2,
+					  btScalar depthB, const btVector3& normalB, 
+					  btScalar& imp0,btScalar& imp1);
+
+
+	//
+	// solving 2x2 lcp problem (inequality, direct solution )
+	//
+	void resolveBilateralPairConstraint(
+			btRigidBody* body0,
+						btRigidBody* body1,
+		const btMatrix3x3& world2A,
+						const btMatrix3x3& world2B,
+						
+						const btVector3& invInertiaADiag,
+						const btScalar invMassA,
+						const btVector3& linvelA,const btVector3& angvelA,
+						const btVector3& rel_posA1,
+						const btVector3& invInertiaBDiag,
+						const btScalar invMassB,
+						const btVector3& linvelB,const btVector3& angvelB,
+						const btVector3& rel_posA2,
+
+					  btScalar depthA, const btVector3& normalA, 
+					  const btVector3& rel_posB1,const btVector3& rel_posB2,
+					  btScalar depthB, const btVector3& normalB, 
+					  btScalar& imp0,btScalar& imp1);
+
+/*
+	void resolveAngularConstraint(	const btMatrix3x3& invInertiaAWS,
+						const btScalar invMassA,
+						const btVector3& linvelA,const btVector3& angvelA,
+						const btVector3& rel_posA1,
+						const btMatrix3x3& invInertiaBWS,
+						const btScalar invMassB,
+						const btVector3& linvelB,const btVector3& angvelB,
+						const btVector3& rel_posA2,
+
+					  btScalar depthA, const btVector3& normalA, 
+					  const btVector3& rel_posB1,const btVector3& rel_posB2,
+					  btScalar depthB, const btVector3& normalB, 
+					  btScalar& imp0,btScalar& imp1);
+
+*/
+
+};
+
+#endif //BT_SOLVE_2LINEAR_CONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h
new file mode 100644
index 0000000..8de5158
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h
@@ -0,0 +1,191 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SOLVER_BODY_H
+#define BT_SOLVER_BODY_H
+
+class	btRigidBody;
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btAlignedAllocator.h"
+#include "LinearMath/btTransformUtil.h"
+
+///Until we get other contributions, only use SIMD on Windows, when using Visual Studio 2008 or later, and not double precision
+#ifdef BT_USE_SSE
+#define USE_SIMD 1
+#endif //
+
+
+#ifdef USE_SIMD
+
+struct	btSimdScalar
+{
+	SIMD_FORCE_INLINE	btSimdScalar()
+	{
+
+	}
+
+	SIMD_FORCE_INLINE	btSimdScalar(float	fl)
+	:m_vec128 (_mm_set1_ps(fl))
+	{
+	}
+
+	SIMD_FORCE_INLINE	btSimdScalar(__m128 v128)
+		:m_vec128(v128)
+	{
+	}
+	union
+	{
+		__m128		m_vec128;
+		float		m_floats[4];
+		int			m_ints[4];
+		btScalar	m_unusedPadding;
+	};
+	SIMD_FORCE_INLINE	__m128	get128()
+	{
+		return m_vec128;
+	}
+
+	SIMD_FORCE_INLINE	const __m128	get128() const
+	{
+		return m_vec128;
+	}
+
+	SIMD_FORCE_INLINE	void	set128(__m128 v128)
+	{
+		m_vec128 = v128;
+	}
+
+	SIMD_FORCE_INLINE	operator       __m128()       
+	{ 
+		return m_vec128; 
+	}
+	SIMD_FORCE_INLINE	operator const __m128() const 
+	{ 
+		return m_vec128; 
+	}
+	
+	SIMD_FORCE_INLINE	operator float() const 
+	{ 
+		return m_floats[0]; 
+	}
+
+};
+
+///@brief Return the elementwise product of two btSimdScalar
+SIMD_FORCE_INLINE btSimdScalar 
+operator*(const btSimdScalar& v1, const btSimdScalar& v2) 
+{
+	return btSimdScalar(_mm_mul_ps(v1.get128(),v2.get128()));
+}
+
+///@brief Return the elementwise product of two btSimdScalar
+SIMD_FORCE_INLINE btSimdScalar 
+operator+(const btSimdScalar& v1, const btSimdScalar& v2) 
+{
+	return btSimdScalar(_mm_add_ps(v1.get128(),v2.get128()));
+}
+
+
+#else
+#define btSimdScalar btScalar
+#endif
+
+///The btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packed to increase cache coherence/performance.
+ATTRIBUTE_ALIGNED64 (struct)	btSolverBodyObsolete
+{
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+	btVector3		m_deltaLinearVelocity;
+	btVector3		m_deltaAngularVelocity;
+	btVector3		m_angularFactor;
+	btVector3		m_invMass;
+	btRigidBody*	m_originalBody;
+	btVector3		m_pushVelocity;
+	btVector3		m_turnVelocity;
+
+	
+	SIMD_FORCE_INLINE void	getVelocityInLocalPointObsolete(const btVector3& rel_pos, btVector3& velocity ) const
+	{
+		if (m_originalBody)
+			velocity = m_originalBody->getLinearVelocity()+m_deltaLinearVelocity + (m_originalBody->getAngularVelocity()+m_deltaAngularVelocity).cross(rel_pos);
+		else
+			velocity.setValue(0,0,0);
+	}
+
+	SIMD_FORCE_INLINE void	getAngularVelocity(btVector3& angVel) const
+	{
+		if (m_originalBody)
+			angVel = m_originalBody->getAngularVelocity()+m_deltaAngularVelocity;
+		else
+			angVel.setValue(0,0,0);
+	}
+
+
+	//Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
+	SIMD_FORCE_INLINE void applyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,const btScalar impulseMagnitude)
+	{
+		//if (m_invMass)
+		{
+			m_deltaLinearVelocity += linearComponent*impulseMagnitude;
+			m_deltaAngularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
+		}
+	}
+
+	SIMD_FORCE_INLINE void internalApplyPushImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude)
+	{
+		if (m_originalBody)
+		{
+			m_pushVelocity += linearComponent*impulseMagnitude;
+			m_turnVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
+		}
+	}
+	
+	void	writebackVelocity()
+	{
+		if (m_originalBody)
+		{
+			m_originalBody->setLinearVelocity(m_originalBody->getLinearVelocity()+ m_deltaLinearVelocity);
+			m_originalBody->setAngularVelocity(m_originalBody->getAngularVelocity()+m_deltaAngularVelocity);
+			
+			//m_originalBody->setCompanionId(-1);
+		}
+	}
+
+
+	void	writebackVelocity(btScalar timeStep)
+	{
+        (void) timeStep;
+		if (m_originalBody)
+		{
+			m_originalBody->setLinearVelocity(m_originalBody->getLinearVelocity()+ m_deltaLinearVelocity);
+			m_originalBody->setAngularVelocity(m_originalBody->getAngularVelocity()+m_deltaAngularVelocity);
+			
+			//correct the position/orientation based on push/turn recovery
+			btTransform newTransform;
+			btTransformUtil::integrateTransform(m_originalBody->getWorldTransform(),m_pushVelocity,m_turnVelocity,timeStep,newTransform);
+			m_originalBody->setWorldTransform(newTransform);
+			
+			//m_originalBody->setCompanionId(-1);
+		}
+	}
+	
+
+
+};
+
+#endif //BT_SOLVER_BODY_H
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h
new file mode 100644
index 0000000..79e45a4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h
@@ -0,0 +1,96 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SOLVER_CONSTRAINT_H
+#define BT_SOLVER_CONSTRAINT_H
+
+class	btRigidBody;
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btMatrix3x3.h"
+#include "btJacobianEntry.h"
+
+//#define NO_FRICTION_TANGENTIALS 1
+#include "btSolverBody.h"
+
+
+///1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and friction constraints.
+ATTRIBUTE_ALIGNED64 (struct)	btSolverConstraint
+{
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	btVector3		m_relpos1CrossNormal;
+	btVector3		m_contactNormal;
+
+	btVector3		m_relpos2CrossNormal;
+	//btVector3		m_contactNormal2;//usually m_contactNormal2 == -m_contactNormal
+
+	btVector3		m_angularComponentA;
+	btVector3		m_angularComponentB;
+	
+	mutable btSimdScalar	m_appliedPushImpulse;
+	mutable btSimdScalar	m_appliedImpulse;
+	
+	
+	btScalar	m_friction;
+	btScalar	m_jacDiagABInv;
+	union
+	{
+		int	m_numConsecutiveRowsPerKernel;
+		btScalar	m_unusedPadding0;
+	};
+
+	union
+	{
+		int			m_frictionIndex;
+		btScalar	m_unusedPadding1;
+	};
+	union
+	{
+		btRigidBody*	m_solverBodyA;
+		int				m_companionIdA;
+	};
+	union
+	{
+		btRigidBody*	m_solverBodyB;
+		int				m_companionIdB;
+	};
+	
+	union
+	{
+		void*		m_originalContactPoint;
+		btScalar	m_unusedPadding4;
+	};
+
+	btScalar		m_rhs;
+	btScalar		m_cfm;
+	btScalar		m_lowerLimit;
+	btScalar		m_upperLimit;
+
+	btScalar		m_rhsPenetration;
+
+	enum		btSolverConstraintType
+	{
+		BT_SOLVER_CONTACT_1D = 0,
+		BT_SOLVER_FRICTION_1D
+	};
+};
+
+typedef btAlignedObjectArray<btSolverConstraint>	btConstraintArray;
+
+
+#endif //BT_SOLVER_CONSTRAINT_H
+
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
new file mode 100644
index 0000000..fb77b1c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
@@ -0,0 +1,214 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btTypedConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btSerializer.h"
+
+
+#define DEFAULT_DEBUGDRAW_SIZE btScalar(0.3f)
+
+btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA)
+:btTypedObject(type),
+m_userConstraintType(-1),
+m_userConstraintId(-1),
+m_needsFeedback(false),
+m_rbA(rbA),
+m_rbB(getFixedBody()),
+m_appliedImpulse(btScalar(0.)),
+m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
+m_breakingImpulseThreshold(SIMD_INFINITY),
+m_isEnabled(true)
+{
+}
+
+
+btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB)
+:btTypedObject(type),
+m_userConstraintType(-1),
+m_userConstraintId(-1),
+m_needsFeedback(false),
+m_rbA(rbA),
+m_rbB(rbB),
+m_appliedImpulse(btScalar(0.)),
+m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
+m_breakingImpulseThreshold(SIMD_INFINITY),
+m_isEnabled(true)
+{
+}
+
+
+
+
+btScalar btTypedConstraint::getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact)
+{
+	if(lowLim > uppLim)
+	{
+		return btScalar(1.0f);
+	}
+	else if(lowLim == uppLim)
+	{
+		return btScalar(0.0f);
+	}
+	btScalar lim_fact = btScalar(1.0f);
+	btScalar delta_max = vel / timeFact;
+	if(delta_max < btScalar(0.0f))
+	{
+		if((pos >= lowLim) && (pos < (lowLim - delta_max)))
+		{
+			lim_fact = (lowLim - pos) / delta_max;
+		}
+		else if(pos  < lowLim)
+		{
+			lim_fact = btScalar(0.0f);
+		}
+		else
+		{
+			lim_fact = btScalar(1.0f);
+		}
+	}
+	else if(delta_max > btScalar(0.0f))
+	{
+		if((pos <= uppLim) && (pos > (uppLim - delta_max)))
+		{
+			lim_fact = (uppLim - pos) / delta_max;
+		}
+		else if(pos  > uppLim)
+		{
+			lim_fact = btScalar(0.0f);
+		}
+		else
+		{
+			lim_fact = btScalar(1.0f);
+		}
+	}
+	else
+	{
+			lim_fact = btScalar(0.0f);
+	}
+	return lim_fact;
+}
+
+///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btTypedConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
+{
+	btTypedConstraintData* tcd = (btTypedConstraintData*) dataBuffer;
+
+	tcd->m_rbA = (btRigidBodyData*)serializer->getUniquePointer(&m_rbA);
+	tcd->m_rbB = (btRigidBodyData*)serializer->getUniquePointer(&m_rbB);
+	char* name = (char*) serializer->findNameForPointer(this);
+	tcd->m_name = (char*)serializer->getUniquePointer(name);
+	if (tcd->m_name)
+	{
+		serializer->serializeName(name);
+	}
+
+	tcd->m_objectType = m_objectType;
+	tcd->m_needsFeedback = m_needsFeedback;
+	tcd->m_userConstraintId =m_userConstraintId;
+	tcd->m_userConstraintType =m_userConstraintType;
+
+	tcd->m_appliedImpulse = float(m_appliedImpulse);
+	tcd->m_dbgDrawSize = float(m_dbgDrawSize );
+
+	tcd->m_disableCollisionsBetweenLinkedBodies = false;
+
+	int i;
+	for (i=0;i<m_rbA.getNumConstraintRefs();i++)
+		if (m_rbA.getConstraintRef(i) == this)
+			tcd->m_disableCollisionsBetweenLinkedBodies = true;
+	for (i=0;i<m_rbB.getNumConstraintRefs();i++)
+		if (m_rbB.getConstraintRef(i) == this)
+			tcd->m_disableCollisionsBetweenLinkedBodies = true;
+
+	return "btTypedConstraintData";
+}
+
+btRigidBody& btTypedConstraint::getFixedBody()
+{
+	static btRigidBody s_fixed(0, 0,0);
+	s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
+	return s_fixed;
+}
+
+
+void btAngularLimit::set(btScalar low, btScalar high, btScalar _softness, btScalar _biasFactor, btScalar _relaxationFactor)
+{
+	m_halfRange = (high - low) / 2.0f;
+	m_center = btNormalizeAngle(low + m_halfRange);
+	m_softness =  _softness;
+	m_biasFactor = _biasFactor;
+	m_relaxationFactor = _relaxationFactor;
+}
+
+void btAngularLimit::test(const btScalar angle)
+{
+	m_correction = 0.0f;
+	m_sign = 0.0f;
+	m_solveLimit = false;
+
+	if (m_halfRange >= 0.0f)
+	{
+		btScalar deviation = btNormalizeAngle(angle - m_center);
+		if (deviation < -m_halfRange)
+		{
+			m_solveLimit = true;
+			m_correction = - (deviation + m_halfRange);
+			m_sign = +1.0f;
+		}
+		else if (deviation > m_halfRange)
+		{
+			m_solveLimit = true;
+			m_correction = m_halfRange - deviation;
+			m_sign = -1.0f;
+		}
+	}
+}
+
+
+btScalar btAngularLimit::getError() const
+{
+	return m_correction * m_sign;
+}
+
+void btAngularLimit::fit(btScalar& angle) const
+{
+	if (m_halfRange > 0.0f)
+	{
+		btScalar relativeAngle = btNormalizeAngle(angle - m_center);
+		if (!btEqual(relativeAngle, m_halfRange))
+		{
+			if (relativeAngle > 0.0f)
+			{
+				angle = getHigh();
+			}
+			else
+			{
+				angle = getLow();
+			}
+		}
+	}
+}
+
+btScalar btAngularLimit::getLow() const
+{
+	return btNormalizeAngle(m_center - m_halfRange);
+}
+
+btScalar btAngularLimit::getHigh() const
+{
+	return btNormalizeAngle(m_center + m_halfRange);
+}
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h
new file mode 100644
index 0000000..20df8e5
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h
@@ -0,0 +1,436 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2010 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_TYPED_CONSTRAINT_H
+#define BT_TYPED_CONSTRAINT_H
+
+class btRigidBody;
+#include "LinearMath/btScalar.h"
+#include "btSolverConstraint.h"
+
+class btSerializer;
+
+//Don't change any of the existing enum values, so add enum types at the end for serialization compatibility
+enum btTypedConstraintType
+{
+	POINT2POINT_CONSTRAINT_TYPE=3,
+	HINGE_CONSTRAINT_TYPE,
+	CONETWIST_CONSTRAINT_TYPE,
+	D6_CONSTRAINT_TYPE,
+	SLIDER_CONSTRAINT_TYPE,
+	CONTACT_CONSTRAINT_TYPE,
+	D6_SPRING_CONSTRAINT_TYPE,
+	MAX_CONSTRAINT_TYPE
+};
+
+
+enum btConstraintParams
+{
+	BT_CONSTRAINT_ERP=1,
+	BT_CONSTRAINT_STOP_ERP,
+	BT_CONSTRAINT_CFM,
+	BT_CONSTRAINT_STOP_CFM
+};
+
+#if 1
+	#define btAssertConstrParams(_par) btAssert(_par) 
+#else
+	#define btAssertConstrParams(_par)
+#endif
+
+
+///TypedConstraint is the baseclass for Bullet constraints and vehicles
+class btTypedConstraint : public btTypedObject
+{
+	int	m_userConstraintType;
+
+	union
+	{
+		int	m_userConstraintId;
+		void* m_userConstraintPtr;
+	};
+
+	btScalar	m_breakingImpulseThreshold;
+	bool		m_isEnabled;
+
+
+	bool m_needsFeedback;
+
+	btTypedConstraint&	operator=(btTypedConstraint&	other)
+	{
+		btAssert(0);
+		(void) other;
+		return *this;
+	}
+
+protected:
+	btRigidBody&	m_rbA;
+	btRigidBody&	m_rbB;
+	btScalar	m_appliedImpulse;
+	btScalar	m_dbgDrawSize;
+
+	///internal method used by the constraint solver, don't use them directly
+	btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact);
+	
+	static btRigidBody& getFixedBody();
+
+public:
+
+	virtual ~btTypedConstraint() {};
+	btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA);
+	btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB);
+
+	struct btConstraintInfo1 {
+		int m_numConstraintRows,nub;
+	};
+
+	struct btConstraintInfo2 {
+		// integrator parameters: frames per second (1/stepsize), default error
+		// reduction parameter (0..1).
+		btScalar fps,erp;
+
+		// for the first and second body, pointers to two (linear and angular)
+		// n*3 jacobian sub matrices, stored by rows. these matrices will have
+		// been initialized to 0 on entry. if the second body is zero then the
+		// J2xx pointers may be 0.
+		btScalar *m_J1linearAxis,*m_J1angularAxis,*m_J2linearAxis,*m_J2angularAxis;
+
+		// elements to jump from one row to the next in J's
+		int rowskip;
+
+		// right hand sides of the equation J*v = c + cfm * lambda. cfm is the
+		// "constraint force mixing" vector. c is set to zero on entry, cfm is
+		// set to a constant value (typically very small or zero) value on entry.
+		btScalar *m_constraintError,*cfm;
+
+		// lo and hi limits for variables (set to -/+ infinity on entry).
+		btScalar *m_lowerLimit,*m_upperLimit;
+
+		// findex vector for variables. see the LCP solver interface for a
+		// description of what this does. this is set to -1 on entry.
+		// note that the returned indexes are relative to the first index of
+		// the constraint.
+		int *findex;
+		// number of solver iterations
+		int m_numIterations;
+
+		//damping of the velocity
+		btScalar	m_damping;
+	};
+
+	///internal method used by the constraint solver, don't use them directly
+	virtual void	buildJacobian() {};
+
+	///internal method used by the constraint solver, don't use them directly
+	virtual	void	setupSolverConstraint(btConstraintArray& ca, int solverBodyA,int solverBodyB, btScalar timeStep)
+	{
+        (void)ca;
+        (void)solverBodyA;
+        (void)solverBodyB;
+        (void)timeStep;
+	}
+	
+	///internal method used by the constraint solver, don't use them directly
+	virtual void getInfo1 (btConstraintInfo1* info)=0;
+
+	///internal method used by the constraint solver, don't use them directly
+	virtual void getInfo2 (btConstraintInfo2* info)=0;
+
+	///internal method used by the constraint solver, don't use them directly
+	void	internalSetAppliedImpulse(btScalar appliedImpulse)
+	{
+		m_appliedImpulse = appliedImpulse;
+	}
+	///internal method used by the constraint solver, don't use them directly
+	btScalar	internalGetAppliedImpulse()
+	{
+		return m_appliedImpulse;
+	}
+
+
+	btScalar	getBreakingImpulseThreshold() const
+	{
+		return 	m_breakingImpulseThreshold;
+	}
+
+	void	setBreakingImpulseThreshold(btScalar threshold)
+	{
+		m_breakingImpulseThreshold = threshold;
+	}
+
+	bool	isEnabled() const
+	{
+		return m_isEnabled;
+	}
+
+	void	setEnabled(bool enabled)
+	{
+		m_isEnabled=enabled;
+	}
+
+
+	///internal method used by the constraint solver, don't use them directly
+	virtual	void	solveConstraintObsolete(btRigidBody& /*bodyA*/,btRigidBody& /*bodyB*/,btScalar	/*timeStep*/) {};
+
+	
+	const btRigidBody& getRigidBodyA() const
+	{
+		return m_rbA;
+	}
+	const btRigidBody& getRigidBodyB() const
+	{
+		return m_rbB;
+	}
+
+	btRigidBody& getRigidBodyA() 
+	{
+		return m_rbA;
+	}
+	btRigidBody& getRigidBodyB()
+	{
+		return m_rbB;
+	}
+
+	int getUserConstraintType() const
+	{
+		return m_userConstraintType ;
+	}
+
+	void	setUserConstraintType(int userConstraintType)
+	{
+		m_userConstraintType = userConstraintType;
+	};
+
+	void	setUserConstraintId(int uid)
+	{
+		m_userConstraintId = uid;
+	}
+
+	int getUserConstraintId() const
+	{
+		return m_userConstraintId;
+	}
+
+	void	setUserConstraintPtr(void* ptr)
+	{
+		m_userConstraintPtr = ptr;
+	}
+
+	void*	getUserConstraintPtr()
+	{
+		return m_userConstraintPtr;
+	}
+
+	int getUid() const
+	{
+		return m_userConstraintId;   
+	} 
+
+	bool	needsFeedback() const
+	{
+		return m_needsFeedback;
+	}
+
+	///enableFeedback will allow to read the applied linear and angular impulse
+	///use getAppliedImpulse, getAppliedLinearImpulse and getAppliedAngularImpulse to read feedback information
+	void	enableFeedback(bool needsFeedback)
+	{
+		m_needsFeedback = needsFeedback;
+	}
+
+	///getAppliedImpulse is an estimated total applied impulse. 
+	///This feedback could be used to determine breaking constraints or playing sounds.
+	btScalar	getAppliedImpulse() const
+	{
+		btAssert(m_needsFeedback);
+		return m_appliedImpulse;
+	}
+
+	btTypedConstraintType getConstraintType () const
+	{
+		return btTypedConstraintType(m_objectType);
+	}
+	
+	void setDbgDrawSize(btScalar dbgDrawSize)
+	{
+		m_dbgDrawSize = dbgDrawSize;
+	}
+	btScalar getDbgDrawSize()
+	{
+		return m_dbgDrawSize;
+	}
+
+	///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
+	///If no axis is provided, it uses the default axis for this constraint.
+	virtual	void	setParam(int num, btScalar value, int axis = -1) = 0;
+
+	///return the local value of parameter
+	virtual	btScalar getParam(int num, int axis = -1) const = 0;
+	
+	virtual	int	calculateSerializeBufferSize() const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;
+
+};
+
+// returns angle in range [-SIMD_2_PI, SIMD_2_PI], closest to one of the limits 
+// all arguments should be normalized angles (i.e. in range [-SIMD_PI, SIMD_PI])
+SIMD_FORCE_INLINE btScalar btAdjustAngleToLimits(btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
+{
+	if(angleLowerLimitInRadians >= angleUpperLimitInRadians)
+	{
+		return angleInRadians;
+	}
+	else if(angleInRadians < angleLowerLimitInRadians)
+	{
+		btScalar diffLo = btFabs(btNormalizeAngle(angleLowerLimitInRadians - angleInRadians));
+		btScalar diffHi = btFabs(btNormalizeAngle(angleUpperLimitInRadians - angleInRadians));
+		return (diffLo < diffHi) ? angleInRadians : (angleInRadians + SIMD_2_PI);
+	}
+	else if(angleInRadians > angleUpperLimitInRadians)
+	{
+		btScalar diffHi = btFabs(btNormalizeAngle(angleInRadians - angleUpperLimitInRadians));
+		btScalar diffLo = btFabs(btNormalizeAngle(angleInRadians - angleLowerLimitInRadians));
+		return (diffLo < diffHi) ? (angleInRadians - SIMD_2_PI) : angleInRadians;
+	}
+	else
+	{
+		return angleInRadians;
+	}
+}
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btTypedConstraintData
+{
+	btRigidBodyData		*m_rbA;
+	btRigidBodyData		*m_rbB;
+	char	*m_name;
+
+	int	m_objectType;
+	int	m_userConstraintType;
+	int	m_userConstraintId;
+	int	m_needsFeedback;
+
+	float	m_appliedImpulse;
+	float	m_dbgDrawSize;
+
+	int	m_disableCollisionsBetweenLinkedBodies;
+	char	m_pad4[4];
+	
+};
+
+SIMD_FORCE_INLINE	int	btTypedConstraint::calculateSerializeBufferSize() const
+{
+	return sizeof(btTypedConstraintData);
+}
+
+
+
+class btAngularLimit
+{
+private:
+	btScalar 
+		m_center,
+		m_halfRange,
+		m_softness,
+		m_biasFactor,
+		m_relaxationFactor,
+		m_correction,
+		m_sign;
+
+	bool
+		m_solveLimit;
+
+public:
+	/// Default constructor initializes limit as inactive, allowing free constraint movement
+	btAngularLimit()
+		:m_center(0.0f),
+		m_halfRange(-1.0f),
+		m_softness(0.9f),
+		m_biasFactor(0.3f),
+		m_relaxationFactor(1.0f),
+		m_correction(0.0f),
+		m_sign(0.0f),
+		m_solveLimit(false)
+	{}
+
+	/// Sets all limit's parameters.
+	/// When low > high limit becomes inactive.
+	/// When high - low > 2PI limit is ineffective too becouse no angle can exceed the limit
+	void set(btScalar low, btScalar high, btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f);
+
+	/// Checks conastaint angle against limit. If limit is active and the angle violates the limit
+	/// correction is calculated.
+	void test(const btScalar angle);
+
+	/// Returns limit's softness
+	inline btScalar getSoftness() const
+	{
+		return m_softness;
+	}
+
+	/// Returns limit's bias factor
+	inline btScalar getBiasFactor() const
+	{
+		return m_biasFactor;
+	}
+
+	/// Returns limit's relaxation factor
+	inline btScalar getRelaxationFactor() const
+	{
+		return m_relaxationFactor;
+	}
+
+	/// Returns correction value evaluated when test() was invoked 
+	inline btScalar getCorrection() const
+	{
+		return m_correction;
+	}
+
+	/// Returns sign value evaluated when test() was invoked 
+	inline btScalar getSign() const
+	{
+		return m_sign;
+	}
+
+	/// Gives half of the distance between min and max limit angle
+	inline btScalar getHalfRange() const
+	{
+		return m_halfRange;
+	}
+
+	/// Returns true when the last test() invocation recognized limit violation
+	inline bool isLimit() const
+	{
+		return m_solveLimit;
+	}
+
+	/// Checks given angle against limit. If limit is active and angle doesn't fit it, the angle
+	/// returned is modified so it equals to the limit closest to given angle.
+	void fit(btScalar& angle) const;
+
+	/// Returns correction value multiplied by sign value
+	btScalar getError() const;
+
+	btScalar getLow() const;
+
+	btScalar getHigh() const;
+
+};
+
+
+
+#endif //BT_TYPED_CONSTRAINT_H
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
new file mode 100644
index 0000000..40c56e7
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
@@ -0,0 +1,87 @@
+/*
+Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
+Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#include "btUniversalConstraint.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "LinearMath/btTransformUtil.h"
+
+
+
+#define UNIV_EPS btScalar(0.01f)
+
+
+// constructor
+// anchor, axis1 and axis2 are in world coordinate system
+// axis1 must be orthogonal to axis2
+btUniversalConstraint::btUniversalConstraint(btRigidBody& rbA, btRigidBody& rbB, btVector3& anchor, btVector3& axis1, btVector3& axis2)
+: btGeneric6DofConstraint(rbA, rbB, btTransform::getIdentity(), btTransform::getIdentity(), true),
+ m_anchor(anchor),
+ m_axis1(axis1),
+ m_axis2(axis2)
+{
+	// build frame basis
+	// 6DOF constraint uses Euler angles and to define limits
+	// it is assumed that rotational order is :
+	// Z - first, allowed limits are (-PI,PI);
+	// new position of Y - second (allowed limits are (-PI/2 + epsilon, PI/2 - epsilon), where epsilon is a small positive number 
+	// used to prevent constraint from instability on poles;
+	// new position of X, allowed limits are (-PI,PI);
+	// So to simulate ODE Universal joint we should use parent axis as Z, child axis as Y and limit all other DOFs
+	// Build the frame in world coordinate system first
+	btVector3 zAxis = axis1.normalize();
+	btVector3 yAxis = axis2.normalize();
+	btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
+	btTransform frameInW;
+	frameInW.setIdentity();
+	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
+									xAxis[1], yAxis[1], zAxis[1],
+									xAxis[2], yAxis[2], zAxis[2]);
+	frameInW.setOrigin(anchor);
+	// now get constraint frame in local coordinate systems
+	m_frameInA = rbA.getCenterOfMassTransform().inverse() * frameInW;
+	m_frameInB = rbB.getCenterOfMassTransform().inverse() * frameInW;
+	// sei limits
+	setLinearLowerLimit(btVector3(0., 0., 0.));
+	setLinearUpperLimit(btVector3(0., 0., 0.));
+	setAngularLowerLimit(btVector3(0.f, -SIMD_HALF_PI + UNIV_EPS, -SIMD_PI + UNIV_EPS));
+	setAngularUpperLimit(btVector3(0.f,  SIMD_HALF_PI - UNIV_EPS,  SIMD_PI - UNIV_EPS));
+}
+
+void btUniversalConstraint::setAxis(const btVector3& axis1,const btVector3& axis2)
+{
+  m_axis1 = axis1;
+  m_axis2 = axis2;
+
+	btVector3 zAxis = axis1.normalized();
+	btVector3 yAxis = axis2.normalized();
+	btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system
+
+	btTransform frameInW;
+	frameInW.setIdentity();
+	frameInW.getBasis().setValue(	xAxis[0], yAxis[0], zAxis[0],	
+                                xAxis[1], yAxis[1], zAxis[1],
+                                xAxis[2], yAxis[2], zAxis[2]);
+	frameInW.setOrigin(m_anchor);
+
+	// now get constraint frame in local coordinate systems
+	m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW;
+	m_frameInB = m_rbB.getCenterOfMassTransform().inverse() * frameInW;
+
+  calculateTransforms();
+}
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h
new file mode 100644
index 0000000..bfa48f4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h
@@ -0,0 +1,62 @@
+/*
+Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
+Copyright (C) 2006, 2007 Sony Computer Entertainment Inc. 
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_UNIVERSAL_CONSTRAINT_H
+#define BT_UNIVERSAL_CONSTRAINT_H
+
+
+
+#include "LinearMath/btVector3.h"
+#include "btTypedConstraint.h"
+#include "btGeneric6DofConstraint.h"
+
+
+
+/// Constraint similar to ODE Universal Joint
+/// has 2 rotatioonal degrees of freedom, similar to Euler rotations around Z (axis 1)
+/// and Y (axis 2)
+/// Description from ODE manual : 
+/// "Given axis 1 on body 1, and axis 2 on body 2 that is perpendicular to axis 1, it keeps them perpendicular. 
+/// In other words, rotation of the two bodies about the direction perpendicular to the two axes will be equal."
+
+class btUniversalConstraint : public btGeneric6DofConstraint
+{
+protected:
+	btVector3	m_anchor;
+	btVector3	m_axis1;
+	btVector3	m_axis2;
+public:
+	// constructor
+	// anchor, axis1 and axis2 are in world coordinate system
+	// axis1 must be orthogonal to axis2
+    btUniversalConstraint(btRigidBody& rbA, btRigidBody& rbB, btVector3& anchor, btVector3& axis1, btVector3& axis2);
+	// access
+	const btVector3& getAnchor() { return m_calculatedTransformA.getOrigin(); }
+	const btVector3& getAnchor2() { return m_calculatedTransformB.getOrigin(); }
+	const btVector3& getAxis1() { return m_axis1; }
+	const btVector3& getAxis2() { return m_axis2; }
+	btScalar getAngle1() { return getAngle(2); }
+	btScalar getAngle2() { return getAngle(1); }
+	// limits
+	void setUpperLimit(btScalar ang1max, btScalar ang2max) { setAngularUpperLimit(btVector3(0.f, ang1max, ang2max)); }
+	void setLowerLimit(btScalar ang1min, btScalar ang2min) { setAngularLowerLimit(btVector3(0.f, ang1min, ang2min)); }
+
+	void setAxis( const btVector3& axis1, const btVector3& axis2);
+};
+
+
+
+#endif // BT_UNIVERSAL_CONSTRAINT_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp
new file mode 100644
index 0000000..bd8e274
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/Bullet-C-API.cpp
@@ -0,0 +1,405 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+	Draft high-level generic physics C-API. For low-level access, use the physics SDK native API's.
+	Work in progress, functionality will be added on demand.
+
+	If possible, use the richer Bullet C++ API, by including <src/btBulletDynamicsCommon.h>
+*/
+
+#include "Bullet-C-Api.h"
+#include "btBulletDynamicsCommon.h"
+#include "LinearMath/btAlignedAllocator.h"
+
+
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btScalar.h"	
+#include "LinearMath/btMatrix3x3.h"
+#include "LinearMath/btTransform.h"
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+
+#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
+#include "BulletCollision/NarrowPhaseCollision/btPointCollector.h"
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpa2.h"
+#include "BulletCollision/CollisionShapes/btMinkowskiSumShape.h"
+#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
+#include "BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h"
+#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
+
+
+/*
+	Create and Delete a Physics SDK	
+*/
+
+struct	btPhysicsSdk
+{
+
+//	btDispatcher*				m_dispatcher;
+//	btOverlappingPairCache*		m_pairCache;
+//	btConstraintSolver*			m_constraintSolver
+
+	btVector3	m_worldAabbMin;
+	btVector3	m_worldAabbMax;
+
+
+	//todo: version, hardware/optimization settings etc?
+	btPhysicsSdk()
+		:m_worldAabbMin(-1000,-1000,-1000),
+		m_worldAabbMax(1000,1000,1000)
+	{
+
+	}
+
+	
+};
+
+plPhysicsSdkHandle	plNewBulletSdk()
+{
+	void* mem = btAlignedAlloc(sizeof(btPhysicsSdk),16);
+	return (plPhysicsSdkHandle)new (mem)btPhysicsSdk;
+}
+
+void		plDeletePhysicsSdk(plPhysicsSdkHandle	physicsSdk)
+{
+	btPhysicsSdk* phys = reinterpret_cast<btPhysicsSdk*>(physicsSdk);
+	btAlignedFree(phys);	
+}
+
+
+/* Dynamics World */
+plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdkHandle)
+{
+	btPhysicsSdk* physicsSdk = reinterpret_cast<btPhysicsSdk*>(physicsSdkHandle);
+	void* mem = btAlignedAlloc(sizeof(btDefaultCollisionConfiguration),16);
+	btDefaultCollisionConfiguration* collisionConfiguration = new (mem)btDefaultCollisionConfiguration();
+	mem = btAlignedAlloc(sizeof(btCollisionDispatcher),16);
+	btDispatcher*				dispatcher = new (mem)btCollisionDispatcher(collisionConfiguration);
+	mem = btAlignedAlloc(sizeof(btAxisSweep3),16);
+	btBroadphaseInterface*		pairCache = new (mem)btAxisSweep3(physicsSdk->m_worldAabbMin,physicsSdk->m_worldAabbMax);
+	mem = btAlignedAlloc(sizeof(btSequentialImpulseConstraintSolver),16);
+	btConstraintSolver*			constraintSolver = new(mem) btSequentialImpulseConstraintSolver();
+
+	mem = btAlignedAlloc(sizeof(btDiscreteDynamicsWorld),16);
+	return (plDynamicsWorldHandle) new (mem)btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration);
+}
+void           plDeleteDynamicsWorld(plDynamicsWorldHandle world)
+{
+	//todo: also clean up the other allocations, axisSweep, pairCache,dispatcher,constraintSolver,collisionConfiguration
+	btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world);
+	btAlignedFree(dynamicsWorld);
+}
+
+void	plStepSimulation(plDynamicsWorldHandle world,	plReal	timeStep)
+{
+	btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world);
+	btAssert(dynamicsWorld);
+	dynamicsWorld->stepSimulation(timeStep);
+}
+
+void plAddRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object)
+{
+	btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world);
+	btAssert(dynamicsWorld);
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
+	btAssert(body);
+
+	dynamicsWorld->addRigidBody(body);
+}
+
+void plRemoveRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object)
+{
+	btDynamicsWorld* dynamicsWorld = reinterpret_cast< btDynamicsWorld* >(world);
+	btAssert(dynamicsWorld);
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
+	btAssert(body);
+
+	dynamicsWorld->removeRigidBody(body);
+}
+
+/* Rigid Body  */
+
+plRigidBodyHandle plCreateRigidBody(	void* user_data,  float mass, plCollisionShapeHandle cshape )
+{
+	btTransform trans;
+	trans.setIdentity();
+	btVector3 localInertia(0,0,0);
+	btCollisionShape* shape = reinterpret_cast<btCollisionShape*>( cshape);
+	btAssert(shape);
+	if (mass)
+	{
+		shape->calculateLocalInertia(mass,localInertia);
+	}
+	void* mem = btAlignedAlloc(sizeof(btRigidBody),16);
+	btRigidBody::btRigidBodyConstructionInfo rbci(mass, 0,shape,localInertia);
+	btRigidBody* body = new (mem)btRigidBody(rbci);
+	body->setWorldTransform(trans);
+	body->setUserPointer(user_data);
+	return (plRigidBodyHandle) body;
+}
+
+void plDeleteRigidBody(plRigidBodyHandle cbody)
+{
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(cbody);
+	btAssert(body);
+	btAlignedFree( body);
+}
+
+
+/* Collision Shape definition */
+
+plCollisionShapeHandle plNewSphereShape(plReal radius)
+{
+	void* mem = btAlignedAlloc(sizeof(btSphereShape),16);
+	return (plCollisionShapeHandle) new (mem)btSphereShape(radius);
+	
+}
+	
+plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z)
+{
+	void* mem = btAlignedAlloc(sizeof(btBoxShape),16);
+	return (plCollisionShapeHandle) new (mem)btBoxShape(btVector3(x,y,z));
+}
+
+plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height)
+{
+	//capsule is convex hull of 2 spheres, so use btMultiSphereShape
+	
+	const int numSpheres = 2;
+	btVector3 positions[numSpheres] = {btVector3(0,height,0),btVector3(0,-height,0)};
+	btScalar radi[numSpheres] = {radius,radius};
+	void* mem = btAlignedAlloc(sizeof(btMultiSphereShape),16);
+	return (plCollisionShapeHandle) new (mem)btMultiSphereShape(positions,radi,numSpheres);
+}
+plCollisionShapeHandle plNewConeShape(plReal radius, plReal height)
+{
+	void* mem = btAlignedAlloc(sizeof(btConeShape),16);
+	return (plCollisionShapeHandle) new (mem)btConeShape(radius,height);
+}
+
+plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height)
+{
+	void* mem = btAlignedAlloc(sizeof(btCylinderShape),16);
+	return (plCollisionShapeHandle) new (mem)btCylinderShape(btVector3(radius,height,radius));
+}
+
+/* Convex Meshes */
+plCollisionShapeHandle plNewConvexHullShape()
+{
+	void* mem = btAlignedAlloc(sizeof(btConvexHullShape),16);
+	return (plCollisionShapeHandle) new (mem)btConvexHullShape();
+}
+
+
+/* Concave static triangle meshes */
+plMeshInterfaceHandle		   plNewMeshInterface()
+{
+	return 0;
+}
+
+plCollisionShapeHandle plNewCompoundShape()
+{
+	void* mem = btAlignedAlloc(sizeof(btCompoundShape),16);
+	return (plCollisionShapeHandle) new (mem)btCompoundShape();
+}
+
+void	plAddChildShape(plCollisionShapeHandle compoundShapeHandle,plCollisionShapeHandle childShapeHandle, plVector3 childPos,plQuaternion childOrn)
+{
+	btCollisionShape* colShape = reinterpret_cast<btCollisionShape*>(compoundShapeHandle);
+	btAssert(colShape->getShapeType() == COMPOUND_SHAPE_PROXYTYPE);
+	btCompoundShape* compoundShape = reinterpret_cast<btCompoundShape*>(colShape);
+	btCollisionShape* childShape = reinterpret_cast<btCollisionShape*>(childShapeHandle);
+	btTransform	localTrans;
+	localTrans.setIdentity();
+	localTrans.setOrigin(btVector3(childPos[0],childPos[1],childPos[2]));
+	localTrans.setRotation(btQuaternion(childOrn[0],childOrn[1],childOrn[2],childOrn[3]));
+	compoundShape->addChildShape(localTrans,childShape);
+}
+
+void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient)
+{
+	btQuaternion orn;
+	orn.setEuler(yaw,pitch,roll);
+	orient[0] = orn.getX();
+	orient[1] = orn.getY();
+	orient[2] = orn.getZ();
+	orient[3] = orn.getW();
+
+}
+
+
+//	extern  void		plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2);
+//	extern  plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle);
+
+
+void		plAddVertex(plCollisionShapeHandle cshape, plReal x,plReal y,plReal z)
+{
+	btCollisionShape* colShape = reinterpret_cast<btCollisionShape*>( cshape);
+	(void)colShape;
+	btAssert(colShape->getShapeType()==CONVEX_HULL_SHAPE_PROXYTYPE);
+	btConvexHullShape* convexHullShape = reinterpret_cast<btConvexHullShape*>( cshape);
+	convexHullShape->addPoint(btVector3(x,y,z));
+
+}
+
+void plDeleteShape(plCollisionShapeHandle cshape)
+{
+	btCollisionShape* shape = reinterpret_cast<btCollisionShape*>( cshape);
+	btAssert(shape);
+	btAlignedFree(shape);
+}
+void plSetScaling(plCollisionShapeHandle cshape, plVector3 cscaling)
+{
+	btCollisionShape* shape = reinterpret_cast<btCollisionShape*>( cshape);
+	btAssert(shape);
+	btVector3 scaling(cscaling[0],cscaling[1],cscaling[2]);
+	shape->setLocalScaling(scaling);	
+}
+
+
+
+void plSetPosition(plRigidBodyHandle object, const plVector3 position)
+{
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
+	btAssert(body);
+	btVector3 pos(position[0],position[1],position[2]);
+	btTransform worldTrans = body->getWorldTransform();
+	worldTrans.setOrigin(pos);
+	body->setWorldTransform(worldTrans);
+}
+
+void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation)
+{
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
+	btAssert(body);
+	btQuaternion orn(orientation[0],orientation[1],orientation[2],orientation[3]);
+	btTransform worldTrans = body->getWorldTransform();
+	worldTrans.setRotation(orn);
+	body->setWorldTransform(worldTrans);
+}
+
+void	plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix)
+{
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
+	btAssert(body);
+	btTransform& worldTrans = body->getWorldTransform();
+	worldTrans.setFromOpenGLMatrix(matrix);
+}
+
+void	plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix)
+{
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
+	btAssert(body);
+	body->getWorldTransform().getOpenGLMatrix(matrix);
+
+}
+
+void	plGetPosition(plRigidBodyHandle object,plVector3 position)
+{
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
+	btAssert(body);
+	const btVector3& pos = body->getWorldTransform().getOrigin();
+	position[0] = pos.getX();
+	position[1] = pos.getY();
+	position[2] = pos.getZ();
+}
+
+void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation)
+{
+	btRigidBody* body = reinterpret_cast< btRigidBody* >(object);
+	btAssert(body);
+	const btQuaternion& orn = body->getWorldTransform().getRotation();
+	orientation[0] = orn.getX();
+	orientation[1] = orn.getY();
+	orientation[2] = orn.getZ();
+	orientation[3] = orn.getW();
+}
+
+
+
+//plRigidBodyHandle plRayCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal);
+
+//	extern  plRigidBodyHandle plObjectCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal);
+
+double plNearestPoints(float p1[3], float p2[3], float p3[3], float q1[3], float q2[3], float q3[3], float *pa, float *pb, float normal[3])
+{
+	btVector3 vp(p1[0], p1[1], p1[2]);
+	btTriangleShape trishapeA(vp, 
+				  btVector3(p2[0], p2[1], p2[2]), 
+				  btVector3(p3[0], p3[1], p3[2]));
+	trishapeA.setMargin(0.000001f);
+	btVector3 vq(q1[0], q1[1], q1[2]);
+	btTriangleShape trishapeB(vq, 
+				  btVector3(q2[0], q2[1], q2[2]), 
+				  btVector3(q3[0], q3[1], q3[2]));
+	trishapeB.setMargin(0.000001f);
+	
+	// btVoronoiSimplexSolver sGjkSimplexSolver;
+	// btGjkEpaPenetrationDepthSolver penSolverPtr;	
+	
+	static btSimplexSolverInterface sGjkSimplexSolver;
+	sGjkSimplexSolver.reset();
+	
+	static btGjkEpaPenetrationDepthSolver Solver0;
+	static btMinkowskiPenetrationDepthSolver Solver1;
+		
+	btConvexPenetrationDepthSolver* Solver = NULL;
+	
+	Solver = &Solver1;	
+		
+	btGjkPairDetector convexConvex(&trishapeA ,&trishapeB,&sGjkSimplexSolver,Solver);
+	
+	convexConvex.m_catchDegeneracies = 1;
+	
+	// btGjkPairDetector convexConvex(&trishapeA ,&trishapeB,&sGjkSimplexSolver,0);
+	
+	btPointCollector gjkOutput;
+	btGjkPairDetector::ClosestPointInput input;
+	
+		
+	btTransform tr;
+	tr.setIdentity();
+	
+	input.m_transformA = tr;
+	input.m_transformB = tr;
+	
+	convexConvex.getClosestPoints(input, gjkOutput, 0);
+	
+	
+	if (gjkOutput.m_hasResult)
+	{
+		
+		pb[0] = pa[0] = gjkOutput.m_pointInWorld[0];
+		pb[1] = pa[1] = gjkOutput.m_pointInWorld[1];
+		pb[2] = pa[2] = gjkOutput.m_pointInWorld[2];
+
+		pb[0]+= gjkOutput.m_normalOnBInWorld[0] * gjkOutput.m_distance;
+		pb[1]+= gjkOutput.m_normalOnBInWorld[1] * gjkOutput.m_distance;
+		pb[2]+= gjkOutput.m_normalOnBInWorld[2] * gjkOutput.m_distance;
+		
+		normal[0] = gjkOutput.m_normalOnBInWorld[0];
+		normal[1] = gjkOutput.m_normalOnBInWorld[1];
+		normal[2] = gjkOutput.m_normalOnBInWorld[2];
+
+		return gjkOutput.m_distance;
+	}
+	return -1.0f;	
+}
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btActionInterface.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btActionInterface.h
new file mode 100644
index 0000000..e1fea3a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btActionInterface.h
@@ -0,0 +1,46 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef _BT_ACTION_INTERFACE_H
+#define _BT_ACTION_INTERFACE_H
+
+class btIDebugDraw;
+class btCollisionWorld;
+
+#include "LinearMath/btScalar.h"
+#include "btRigidBody.h"
+
+///Basic interface to allow actions such as vehicles and characters to be updated inside a btDynamicsWorld
+class btActionInterface
+{
+protected:
+
+	static btRigidBody& getFixedBody();
+	
+	
+public:
+
+	virtual ~btActionInterface()
+	{
+	}
+
+	virtual void updateAction( btCollisionWorld* collisionWorld, btScalar deltaTimeStep)=0;
+
+	virtual void debugDraw(btIDebugDraw* debugDrawer) = 0;
+
+};
+
+#endif //_BT_ACTION_INTERFACE_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
new file mode 100644
index 0000000..23501c4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
@@ -0,0 +1,196 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btContinuousDynamicsWorld.h"
+#include "LinearMath/btQuickprof.h"
+
+//collision detection
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
+
+//rigidbody & constraints
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
+#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
+#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
+
+
+
+#include <stdio.h>
+
+btContinuousDynamicsWorld::btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration)
+:btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration)
+{
+}
+
+btContinuousDynamicsWorld::~btContinuousDynamicsWorld()
+{
+}
+
+	
+void	btContinuousDynamicsWorld::internalSingleStepSimulation( btScalar timeStep)
+{
+	
+	startProfiling(timeStep);
+	
+	if(0 != m_internalPreTickCallback) {
+		(*m_internalPreTickCallback)(this, timeStep);
+	}
+
+
+	///update aabbs information
+	updateAabbs();
+	//static int frame=0;
+//	printf("frame %d\n",frame++);
+
+	///apply gravity, predict motion
+	predictUnconstraintMotion(timeStep);
+
+	btDispatcherInfo& dispatchInfo = getDispatchInfo();
+
+	dispatchInfo.m_timeStep = timeStep;
+	dispatchInfo.m_stepCount = 0;
+	dispatchInfo.m_debugDraw = getDebugDrawer();
+
+	///perform collision detection
+	performDiscreteCollisionDetection();
+
+	calculateSimulationIslands();
+
+	
+	getSolverInfo().m_timeStep = timeStep;
+	
+
+
+	///solve contact and other joint constraints
+	solveConstraints(getSolverInfo());
+	
+	///CallbackTriggers();
+	calculateTimeOfImpacts(timeStep);
+
+	btScalar toi = dispatchInfo.m_timeOfImpact;
+//	if (toi < 1.f)
+//		printf("toi = %f\n",toi);
+	if (toi < 0.f)
+		printf("toi = %f\n",toi);
+
+
+	///integrate transforms
+	integrateTransforms(timeStep * toi);
+
+	///update vehicle simulation
+	updateActions(timeStep);
+
+	updateActivationState( timeStep );
+	
+	if(0 != m_internalTickCallback) {
+		(*m_internalTickCallback)(this, timeStep);
+	}
+}
+
+void	btContinuousDynamicsWorld::calculateTimeOfImpacts(btScalar timeStep)
+{
+		///these should be 'temporal' aabbs!
+		updateTemporalAabbs(timeStep);
+		
+		///'toi' is the global smallest time of impact. However, we just calculate the time of impact for each object individually.
+		///so we handle the case moving versus static properly, and we cheat for moving versus moving
+		btScalar toi = 1.f;
+		
+	
+		btDispatcherInfo& dispatchInfo = getDispatchInfo();
+		dispatchInfo.m_timeStep = timeStep;
+		dispatchInfo.m_timeOfImpact = 1.f;
+		dispatchInfo.m_stepCount = 0;
+		dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_CONTINUOUS;
+
+		///calculate time of impact for overlapping pairs
+
+
+		btDispatcher* dispatcher = getDispatcher();
+		if (dispatcher)
+			dispatcher->dispatchAllCollisionPairs(m_broadphasePairCache->getOverlappingPairCache(),dispatchInfo,m_dispatcher1);
+
+		toi = dispatchInfo.m_timeOfImpact;
+
+		dispatchInfo.m_dispatchFunc = btDispatcherInfo::DISPATCH_DISCRETE;
+
+}
+
+void	btContinuousDynamicsWorld::updateTemporalAabbs(btScalar timeStep)
+{
+
+	btVector3 temporalAabbMin,temporalAabbMax;
+
+	for ( int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		
+		btRigidBody* body = btRigidBody::upcast(colObj);
+		if (body)
+		{
+			body->getCollisionShape()->getAabb(m_collisionObjects[i]->getWorldTransform(),temporalAabbMin,temporalAabbMax);
+			const btVector3& linvel = body->getLinearVelocity();
+
+			//make the AABB temporal
+			btScalar temporalAabbMaxx = temporalAabbMax.getX();
+			btScalar temporalAabbMaxy = temporalAabbMax.getY();
+			btScalar temporalAabbMaxz = temporalAabbMax.getZ();
+			btScalar temporalAabbMinx = temporalAabbMin.getX();
+			btScalar temporalAabbMiny = temporalAabbMin.getY();
+			btScalar temporalAabbMinz = temporalAabbMin.getZ();
+
+			// add linear motion
+			btVector3 linMotion = linvel*timeStep;
+		
+			if (linMotion.x() > 0.f)
+				temporalAabbMaxx += linMotion.x(); 
+			else
+				temporalAabbMinx += linMotion.x();
+			if (linMotion.y() > 0.f)
+				temporalAabbMaxy += linMotion.y(); 
+			else
+				temporalAabbMiny += linMotion.y();
+			if (linMotion.z() > 0.f)
+				temporalAabbMaxz += linMotion.z(); 
+			else
+				temporalAabbMinz += linMotion.z();
+
+			//add conservative angular motion
+			btScalar angularMotion(0);// = angvel.length() * GetAngularMotionDisc() * timeStep;
+			btVector3 angularMotion3d(angularMotion,angularMotion,angularMotion);
+			temporalAabbMin = btVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz);
+			temporalAabbMax = btVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz);
+
+			temporalAabbMin -= angularMotion3d;
+			temporalAabbMax += angularMotion3d;
+
+			m_broadphasePairCache->setAabb(body->getBroadphaseHandle(),temporalAabbMin,temporalAabbMax,m_dispatcher1);
+		}
+	}
+
+	//update aabb (of all moved objects)
+
+	m_broadphasePairCache->calculateOverlappingPairs(m_dispatcher1);
+	
+
+
+}
+
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h
new file mode 100644
index 0000000..61c8dea
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h
@@ -0,0 +1,46 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONTINUOUS_DYNAMICS_WORLD_H
+#define BT_CONTINUOUS_DYNAMICS_WORLD_H
+
+#include "btDiscreteDynamicsWorld.h"
+
+///btContinuousDynamicsWorld adds optional (per object) continuous collision detection for fast moving objects to the btDiscreteDynamicsWorld.
+///This copes with fast moving objects that otherwise would tunnel/miss collisions.
+///Under construction, don't use yet! Please use btDiscreteDynamicsWorld instead.
+class btContinuousDynamicsWorld : public btDiscreteDynamicsWorld
+{
+
+	void	updateTemporalAabbs(btScalar timeStep);
+
+	public:
+
+		btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
+		virtual ~btContinuousDynamicsWorld();
+		
+		///time stepping with calculation of time of impact for selected fast moving objects
+		virtual void	internalSingleStepSimulation( btScalar timeStep);
+
+		virtual void	calculateTimeOfImpacts(btScalar timeStep);
+
+		virtual btDynamicsWorldType	getWorldType() const
+		{
+			return BT_CONTINUOUS_DYNAMICS_WORLD;
+		}
+
+};
+
+#endif //BT_CONTINUOUS_DYNAMICS_WORLD_H
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
new file mode 100644
index 0000000..b08dcf0
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
@@ -0,0 +1,1348 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "btDiscreteDynamicsWorld.h"
+
+//collision detection
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
+#include "LinearMath/btTransformUtil.h"
+#include "LinearMath/btQuickprof.h"
+
+//rigidbody & constraints
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
+#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
+#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btHingeConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btConeTwistConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btSliderConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
+
+
+#include "LinearMath/btIDebugDraw.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+
+
+#include "BulletDynamics/Dynamics/btActionInterface.h"
+#include "LinearMath/btQuickprof.h"
+#include "LinearMath/btMotionState.h"
+
+#include "LinearMath/btSerializer.h"
+
+#if 0
+btAlignedObjectArray<btVector3> debugContacts;
+btAlignedObjectArray<btVector3> debugNormals;
+int startHit=2;
+int firstHit=startHit;
+#endif
+
+
+
+btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration)
+:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration),
+m_constraintSolver(constraintSolver),
+m_gravity(0,-10,0),
+m_localTime(0),
+m_synchronizeAllMotionStates(false),
+m_profileTimings(0)
+{
+	if (!m_constraintSolver)
+	{
+		void* mem = btAlignedAlloc(sizeof(btSequentialImpulseConstraintSolver),16);
+		m_constraintSolver = new (mem) btSequentialImpulseConstraintSolver;
+		m_ownsConstraintSolver = true;
+	} else
+	{
+		m_ownsConstraintSolver = false;
+	}
+
+	{
+		void* mem = btAlignedAlloc(sizeof(btSimulationIslandManager),16);
+		m_islandManager = new (mem) btSimulationIslandManager();
+	}
+
+	m_ownsIslandManager = true;
+}
+
+
+btDiscreteDynamicsWorld::~btDiscreteDynamicsWorld()
+{
+	//only delete it when we created it
+	if (m_ownsIslandManager)
+	{
+		m_islandManager->~btSimulationIslandManager();
+		btAlignedFree( m_islandManager);
+	}
+	if (m_ownsConstraintSolver)
+	{
+
+		m_constraintSolver->~btConstraintSolver();
+		btAlignedFree(m_constraintSolver);
+	}
+}
+
+void	btDiscreteDynamicsWorld::saveKinematicState(btScalar timeStep)
+{
+///would like to iterate over m_nonStaticRigidBodies, but unfortunately old API allows
+///to switch status _after_ adding kinematic objects to the world
+///fix it for Bullet 3.x release
+	for (int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		btRigidBody* body = btRigidBody::upcast(colObj);
+		if (body && body->getActivationState() != ISLAND_SLEEPING)
+		{
+			if (body->isKinematicObject())
+			{
+				//to calculate velocities next frame
+				body->saveKinematicState(timeStep);
+			}
+		}
+	}
+
+}
+
+void	btDiscreteDynamicsWorld::debugDrawWorld()
+{
+	BT_PROFILE("debugDrawWorld");
+
+	btCollisionWorld::debugDrawWorld();
+
+	bool drawConstraints = false;
+	if (getDebugDrawer())
+	{
+		int mode = getDebugDrawer()->getDebugMode();
+		if(mode  & (btIDebugDraw::DBG_DrawConstraints | btIDebugDraw::DBG_DrawConstraintLimits))
+		{
+			drawConstraints = true;
+		}
+	}
+	if(drawConstraints)
+	{
+		for(int i = getNumConstraints()-1; i>=0 ;i--)
+		{
+			btTypedConstraint* constraint = getConstraint(i);
+			debugDrawConstraint(constraint);
+		}
+	}
+
+
+
+	if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb))
+	{
+		int i;
+
+		if (getDebugDrawer() && getDebugDrawer()->getDebugMode())
+		{
+			for (i=0;i<m_actions.size();i++)
+			{
+				m_actions[i]->debugDraw(m_debugDrawer);
+			}
+		}
+	}
+}
+
+void	btDiscreteDynamicsWorld::clearForces()
+{
+	///@todo: iterate over awake simulation islands!
+	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
+	{
+		btRigidBody* body = m_nonStaticRigidBodies[i];
+		//need to check if next line is ok
+		//it might break backward compatibility (people applying forces on sleeping objects get never cleared and accumulate on wake-up
+		body->clearForces();
+	}
+}	
+
+///apply gravity, call this once per timestep
+void	btDiscreteDynamicsWorld::applyGravity()
+{
+	///@todo: iterate over awake simulation islands!
+	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
+	{
+		btRigidBody* body = m_nonStaticRigidBodies[i];
+		if (body->isActive())
+		{
+			body->applyGravity();
+		}
+	}
+}
+
+
+void	btDiscreteDynamicsWorld::synchronizeSingleMotionState(btRigidBody* body)
+{
+	btAssert(body);
+
+	if (body->getMotionState() && !body->isStaticOrKinematicObject())
+	{
+		//we need to call the update at least once, even for sleeping objects
+		//otherwise the 'graphics' transform never updates properly
+		///@todo: add 'dirty' flag
+		//if (body->getActivationState() != ISLAND_SLEEPING)
+		{
+			btTransform interpolatedTransform;
+			btTransformUtil::integrateTransform(body->getInterpolationWorldTransform(),
+				body->getInterpolationLinearVelocity(),body->getInterpolationAngularVelocity(),m_localTime*body->getHitFraction(),interpolatedTransform);
+			body->getMotionState()->setWorldTransform(interpolatedTransform);
+		}
+	}
+}
+
+
+void	btDiscreteDynamicsWorld::synchronizeMotionStates()
+{
+	BT_PROFILE("synchronizeMotionStates");
+	if (m_synchronizeAllMotionStates)
+	{
+		//iterate  over all collision objects
+		for ( int i=0;i<m_collisionObjects.size();i++)
+		{
+			btCollisionObject* colObj = m_collisionObjects[i];
+			btRigidBody* body = btRigidBody::upcast(colObj);
+			if (body)
+				synchronizeSingleMotionState(body);
+		}
+	} else
+	{
+		//iterate over all active rigid bodies
+		for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
+		{
+			btRigidBody* body = m_nonStaticRigidBodies[i];
+			if (body->isActive())
+				synchronizeSingleMotionState(body);
+		}
+	}
+}
+
+
+int	btDiscreteDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep)
+{
+	startProfiling(timeStep);
+
+	BT_PROFILE("stepSimulation");
+
+	int numSimulationSubSteps = 0;
+
+	if (maxSubSteps)
+	{
+		//fixed timestep with interpolation
+		m_localTime += timeStep;
+		if (m_localTime >= fixedTimeStep)
+		{
+			numSimulationSubSteps = int( m_localTime / fixedTimeStep);
+			m_localTime -= numSimulationSubSteps * fixedTimeStep;
+		}
+	} else
+	{
+		//variable timestep
+		fixedTimeStep = timeStep;
+		m_localTime = timeStep;
+		if (btFuzzyZero(timeStep))
+		{
+			numSimulationSubSteps = 0;
+			maxSubSteps = 0;
+		} else
+		{
+			numSimulationSubSteps = 1;
+			maxSubSteps = 1;
+		}
+	}
+
+	//process some debugging flags
+	if (getDebugDrawer())
+	{
+		btIDebugDraw* debugDrawer = getDebugDrawer ();
+		gDisableDeactivation = (debugDrawer->getDebugMode() & btIDebugDraw::DBG_NoDeactivation) != 0;
+	}
+	if (numSimulationSubSteps)
+	{
+
+		//clamp the number of substeps, to prevent simulation grinding spiralling down to a halt
+		int clampedSimulationSteps = (numSimulationSubSteps > maxSubSteps)? maxSubSteps : numSimulationSubSteps;
+
+		saveKinematicState(fixedTimeStep*clampedSimulationSteps);
+
+		applyGravity();
+
+		
+
+		for (int i=0;i<clampedSimulationSteps;i++)
+		{
+			internalSingleStepSimulation(fixedTimeStep);
+			synchronizeMotionStates();
+		}
+
+	} else
+	{
+		synchronizeMotionStates();
+	}
+
+	clearForces();
+
+#ifndef BT_NO_PROFILE
+	CProfileManager::Increment_Frame_Counter();
+#endif //BT_NO_PROFILE
+	
+	return numSimulationSubSteps;
+}
+
+void	btDiscreteDynamicsWorld::internalSingleStepSimulation(btScalar timeStep)
+{
+	
+	BT_PROFILE("internalSingleStepSimulation");
+
+	if(0 != m_internalPreTickCallback) {
+		(*m_internalPreTickCallback)(this, timeStep);
+	}	
+
+	///apply gravity, predict motion
+	predictUnconstraintMotion(timeStep);
+
+	btDispatcherInfo& dispatchInfo = getDispatchInfo();
+
+	dispatchInfo.m_timeStep = timeStep;
+	dispatchInfo.m_stepCount = 0;
+	dispatchInfo.m_debugDraw = getDebugDrawer();
+
+
+	///perform collision detection
+	performDiscreteCollisionDetection();
+
+	if (getDispatchInfo().m_useContinuous)
+		addSpeculativeContacts(timeStep);
+
+
+	calculateSimulationIslands();
+
+	
+	getSolverInfo().m_timeStep = timeStep;
+	
+
+
+	///solve contact and other joint constraints
+	solveConstraints(getSolverInfo());
+	
+	///CallbackTriggers();
+
+	///integrate transforms
+	integrateTransforms(timeStep);
+
+	///update vehicle simulation
+	updateActions(timeStep);
+	
+	updateActivationState( timeStep );
+
+	if(0 != m_internalTickCallback) {
+		(*m_internalTickCallback)(this, timeStep);
+	}	
+}
+
+void	btDiscreteDynamicsWorld::setGravity(const btVector3& gravity)
+{
+	m_gravity = gravity;
+	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
+	{
+		btRigidBody* body = m_nonStaticRigidBodies[i];
+		if (body->isActive() && !(body->getFlags() &BT_DISABLE_WORLD_GRAVITY))
+		{
+			body->setGravity(gravity);
+		}
+	}
+}
+
+btVector3 btDiscreteDynamicsWorld::getGravity () const
+{
+	return m_gravity;
+}
+
+void	btDiscreteDynamicsWorld::addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup,short int collisionFilterMask)
+{
+	btCollisionWorld::addCollisionObject(collisionObject,collisionFilterGroup,collisionFilterMask);
+}
+
+void	btDiscreteDynamicsWorld::removeCollisionObject(btCollisionObject* collisionObject)
+{
+	btRigidBody* body = btRigidBody::upcast(collisionObject);
+	if (body)
+		removeRigidBody(body);
+	else
+		btCollisionWorld::removeCollisionObject(collisionObject);
+}
+
+void	btDiscreteDynamicsWorld::removeRigidBody(btRigidBody* body)
+{
+	m_nonStaticRigidBodies.remove(body);
+	btCollisionWorld::removeCollisionObject(body);
+}
+
+
+void	btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body)
+{
+	if (!body->isStaticOrKinematicObject() && !(body->getFlags() &BT_DISABLE_WORLD_GRAVITY))
+	{
+		body->setGravity(m_gravity);
+	}
+
+	if (body->getCollisionShape())
+	{
+		if (!body->isStaticObject())
+		{
+			m_nonStaticRigidBodies.push_back(body);
+		} else
+		{
+			body->setActivationState(ISLAND_SLEEPING);
+		}
+
+		bool isDynamic = !(body->isStaticObject() || body->isKinematicObject());
+		short collisionFilterGroup = isDynamic? short(btBroadphaseProxy::DefaultFilter) : short(btBroadphaseProxy::StaticFilter);
+		short collisionFilterMask = isDynamic? 	short(btBroadphaseProxy::AllFilter) : 	short(btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter);
+
+		addCollisionObject(body,collisionFilterGroup,collisionFilterMask);
+	}
+}
+
+void	btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body, short group, short mask)
+{
+	if (!body->isStaticOrKinematicObject() && !(body->getFlags() &BT_DISABLE_WORLD_GRAVITY))
+	{
+		body->setGravity(m_gravity);
+	}
+
+	if (body->getCollisionShape())
+	{
+		if (!body->isStaticObject())
+		{
+			m_nonStaticRigidBodies.push_back(body);
+		}
+		 else
+		{
+			body->setActivationState(ISLAND_SLEEPING);
+		}
+		addCollisionObject(body,group,mask);
+	}
+}
+
+
+void	btDiscreteDynamicsWorld::updateActions(btScalar timeStep)
+{
+	BT_PROFILE("updateActions");
+	
+	for ( int i=0;i<m_actions.size();i++)
+	{
+		m_actions[i]->updateAction( this, timeStep);
+	}
+}
+	
+	
+void	btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep)
+{
+	BT_PROFILE("updateActivationState");
+
+	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
+	{
+		btRigidBody* body = m_nonStaticRigidBodies[i];
+		if (body)
+		{
+			body->updateDeactivation(timeStep);
+
+			if (body->wantsSleeping())
+			{
+				if (body->isStaticOrKinematicObject())
+				{
+					body->setActivationState(ISLAND_SLEEPING);
+				} else
+				{
+					if (body->getActivationState() == ACTIVE_TAG)
+						body->setActivationState( WANTS_DEACTIVATION );
+					if (body->getActivationState() == ISLAND_SLEEPING) 
+					{
+						body->setAngularVelocity(btVector3(0,0,0));
+						body->setLinearVelocity(btVector3(0,0,0));
+					}
+
+				}
+			} else
+			{
+				if (body->getActivationState() != DISABLE_DEACTIVATION)
+					body->setActivationState( ACTIVE_TAG );
+			}
+		}
+	}
+}
+
+void	btDiscreteDynamicsWorld::addConstraint(btTypedConstraint* constraint,bool disableCollisionsBetweenLinkedBodies)
+{
+	m_constraints.push_back(constraint);
+	if (disableCollisionsBetweenLinkedBodies)
+	{
+		constraint->getRigidBodyA().addConstraintRef(constraint);
+		constraint->getRigidBodyB().addConstraintRef(constraint);
+	}
+}
+
+void	btDiscreteDynamicsWorld::removeConstraint(btTypedConstraint* constraint)
+{
+	m_constraints.remove(constraint);
+	constraint->getRigidBodyA().removeConstraintRef(constraint);
+	constraint->getRigidBodyB().removeConstraintRef(constraint);
+}
+
+void	btDiscreteDynamicsWorld::addAction(btActionInterface* action)
+{
+	m_actions.push_back(action);
+}
+
+void	btDiscreteDynamicsWorld::removeAction(btActionInterface* action)
+{
+	m_actions.remove(action);
+}
+
+
+void	btDiscreteDynamicsWorld::addVehicle(btActionInterface* vehicle)
+{
+	addAction(vehicle);
+}
+
+void	btDiscreteDynamicsWorld::removeVehicle(btActionInterface* vehicle)
+{
+	removeAction(vehicle);
+}
+
+void	btDiscreteDynamicsWorld::addCharacter(btActionInterface* character)
+{
+	addAction(character);
+}
+
+void	btDiscreteDynamicsWorld::removeCharacter(btActionInterface* character)
+{
+	removeAction(character);
+}
+
+
+SIMD_FORCE_INLINE	int	btGetConstraintIslandId(const btTypedConstraint* lhs)
+{
+	int islandId;
+	
+	const btCollisionObject& rcolObj0 = lhs->getRigidBodyA();
+	const btCollisionObject& rcolObj1 = lhs->getRigidBodyB();
+	islandId= rcolObj0.getIslandTag()>=0?rcolObj0.getIslandTag():rcolObj1.getIslandTag();
+	return islandId;
+
+}
+
+
+class btSortConstraintOnIslandPredicate
+{
+	public:
+
+		bool operator() ( const btTypedConstraint* lhs, const btTypedConstraint* rhs )
+		{
+			int rIslandId0,lIslandId0;
+			rIslandId0 = btGetConstraintIslandId(rhs);
+			lIslandId0 = btGetConstraintIslandId(lhs);
+			return lIslandId0 < rIslandId0;
+		}
+};
+
+
+
+void	btDiscreteDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo)
+{
+	BT_PROFILE("solveConstraints");
+	
+	struct InplaceSolverIslandCallback : public btSimulationIslandManager::IslandCallback
+	{
+
+		btContactSolverInfo&	m_solverInfo;
+		btConstraintSolver*		m_solver;
+		btTypedConstraint**		m_sortedConstraints;
+		int						m_numConstraints;
+		btIDebugDraw*			m_debugDrawer;
+		btStackAlloc*			m_stackAlloc;
+		btDispatcher*			m_dispatcher;
+		
+		btAlignedObjectArray<btCollisionObject*> m_bodies;
+		btAlignedObjectArray<btPersistentManifold*> m_manifolds;
+		btAlignedObjectArray<btTypedConstraint*> m_constraints;
+
+
+		InplaceSolverIslandCallback(
+			btContactSolverInfo& solverInfo,
+			btConstraintSolver*	solver,
+			btTypedConstraint** sortedConstraints,
+			int	numConstraints,
+			btIDebugDraw*	debugDrawer,
+			btStackAlloc*			stackAlloc,
+			btDispatcher* dispatcher)
+			:m_solverInfo(solverInfo),
+			m_solver(solver),
+			m_sortedConstraints(sortedConstraints),
+			m_numConstraints(numConstraints),
+			m_debugDrawer(debugDrawer),
+			m_stackAlloc(stackAlloc),
+			m_dispatcher(dispatcher)
+		{
+
+		}
+
+
+		InplaceSolverIslandCallback& operator=(InplaceSolverIslandCallback& other)
+		{
+			btAssert(0);
+			(void)other;
+			return *this;
+		}
+		virtual	void	ProcessIsland(btCollisionObject** bodies,int numBodies,btPersistentManifold**	manifolds,int numManifolds, int islandId)
+		{
+			if (islandId<0)
+			{
+				if (numManifolds + m_numConstraints)
+				{
+					///we don't split islands, so all constraints/contact manifolds/bodies are passed into the solver regardless the island id
+					m_solver->solveGroup( bodies,numBodies,manifolds, numManifolds,&m_sortedConstraints[0],m_numConstraints,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher);
+				}
+			} else
+			{
+					//also add all non-contact constraints/joints for this island
+				btTypedConstraint** startConstraint = 0;
+				int numCurConstraints = 0;
+				int i;
+				
+				//find the first constraint for this island
+				for (i=0;i<m_numConstraints;i++)
+				{
+					if (btGetConstraintIslandId(m_sortedConstraints[i]) == islandId)
+					{
+						startConstraint = &m_sortedConstraints[i];
+						break;
+					}
+				}
+				//count the number of constraints in this island
+				for (;i<m_numConstraints;i++)
+				{
+					if (btGetConstraintIslandId(m_sortedConstraints[i]) == islandId)
+					{
+						numCurConstraints++;
+					}
+				}
+
+				if (m_solverInfo.m_minimumSolverBatchSize<=1)
+				{
+					///only call solveGroup if there is some work: avoid virtual function call, its overhead can be excessive
+					if (numManifolds + numCurConstraints)
+					{
+						m_solver->solveGroup( bodies,numBodies,manifolds, numManifolds,startConstraint,numCurConstraints,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher);
+					}
+				} else
+				{
+					
+					for (i=0;i<numBodies;i++)
+						m_bodies.push_back(bodies[i]);
+					for (i=0;i<numManifolds;i++)
+						m_manifolds.push_back(manifolds[i]);
+					for (i=0;i<numCurConstraints;i++)
+						m_constraints.push_back(startConstraint[i]);
+					if ((m_constraints.size()+m_manifolds.size())>m_solverInfo.m_minimumSolverBatchSize)
+					{
+						processConstraints();
+					} else
+					{
+						//printf("deferred\n");
+					}
+				}
+			}
+		}
+		void	processConstraints()
+		{
+			if (m_manifolds.size() + m_constraints.size()>0)
+			{
+				m_solver->solveGroup( &m_bodies[0],m_bodies.size(), &m_manifolds[0], m_manifolds.size(), &m_constraints[0], m_constraints.size() ,m_solverInfo,m_debugDrawer,m_stackAlloc,m_dispatcher);
+			}
+			m_bodies.resize(0);
+			m_manifolds.resize(0);
+			m_constraints.resize(0);
+
+		}
+
+	};
+
+	
+
+	//sorted version of all btTypedConstraint, based on islandId
+	btAlignedObjectArray<btTypedConstraint*>	sortedConstraints;
+	sortedConstraints.resize( m_constraints.size());
+	int i; 
+	for (i=0;i<getNumConstraints();i++)
+	{
+		sortedConstraints[i] = m_constraints[i];
+	}
+
+//	btAssert(0);
+		
+	
+
+	sortedConstraints.quickSort(btSortConstraintOnIslandPredicate());
+	
+	btTypedConstraint** constraintsPtr = getNumConstraints() ? &sortedConstraints[0] : 0;
+	
+	InplaceSolverIslandCallback	solverCallback(	solverInfo,	m_constraintSolver, constraintsPtr,sortedConstraints.size(),	m_debugDrawer,m_stackAlloc,m_dispatcher1);
+	
+	m_constraintSolver->prepareSolve(getCollisionWorld()->getNumCollisionObjects(), getCollisionWorld()->getDispatcher()->getNumManifolds());
+	
+	/// solve all the constraints for this island
+	m_islandManager->buildAndProcessIslands(getCollisionWorld()->getDispatcher(),getCollisionWorld(),&solverCallback);
+
+	solverCallback.processConstraints();
+
+	m_constraintSolver->allSolved(solverInfo, m_debugDrawer, m_stackAlloc);
+}
+
+
+
+
+void	btDiscreteDynamicsWorld::calculateSimulationIslands()
+{
+	BT_PROFILE("calculateSimulationIslands");
+
+	getSimulationIslandManager()->updateActivationState(getCollisionWorld(),getCollisionWorld()->getDispatcher());
+
+	{
+		int i;
+		int numConstraints = int(m_constraints.size());
+		for (i=0;i< numConstraints ; i++ )
+		{
+			btTypedConstraint* constraint = m_constraints[i];
+
+			const btRigidBody* colObj0 = &constraint->getRigidBodyA();
+			const btRigidBody* colObj1 = &constraint->getRigidBodyB();
+
+			if (((colObj0) && (!(colObj0)->isStaticOrKinematicObject())) &&
+				((colObj1) && (!(colObj1)->isStaticOrKinematicObject())))
+			{
+				if (colObj0->isActive() || colObj1->isActive())
+				{
+
+					getSimulationIslandManager()->getUnionFind().unite((colObj0)->getIslandTag(),
+						(colObj1)->getIslandTag());
+				}
+			}
+		}
+	}
+
+	//Store the island id in each body
+	getSimulationIslandManager()->storeIslandActivationState(getCollisionWorld());
+
+	
+}
+
+
+
+
+class btClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConvexResultCallback
+{
+public:
+
+	btCollisionObject* m_me;
+	btScalar m_allowedPenetration;
+	btOverlappingPairCache* m_pairCache;
+	btDispatcher* m_dispatcher;
+
+public:
+	btClosestNotMeConvexResultCallback (btCollisionObject* me,const btVector3& fromA,const btVector3& toA,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) : 
+	  btCollisionWorld::ClosestConvexResultCallback(fromA,toA),
+		m_me(me),
+		m_allowedPenetration(0.0f),
+		m_pairCache(pairCache),
+		m_dispatcher(dispatcher)
+	{
+	}
+
+	virtual btScalar addSingleResult(btCollisionWorld::LocalConvexResult& convexResult,bool normalInWorldSpace)
+	{
+		if (convexResult.m_hitCollisionObject == m_me)
+			return 1.0f;
+
+		//ignore result if there is no contact response
+		if(!convexResult.m_hitCollisionObject->hasContactResponse())
+			return 1.0f;
+
+		btVector3 linVelA,linVelB;
+		linVelA = m_convexToWorld-m_convexFromWorld;
+		linVelB = btVector3(0,0,0);//toB.getOrigin()-fromB.getOrigin();
+
+		btVector3 relativeVelocity = (linVelA-linVelB);
+		//don't report time of impact for motion away from the contact normal (or causes minor penetration)
+		if (convexResult.m_hitNormalLocal.dot(relativeVelocity)>=-m_allowedPenetration)
+			return 1.f;
+
+		return ClosestConvexResultCallback::addSingleResult (convexResult, normalInWorldSpace);
+	}
+
+	virtual bool needsCollision(btBroadphaseProxy* proxy0) const
+	{
+		//don't collide with itself
+		if (proxy0->m_clientObject == m_me)
+			return false;
+
+		///don't do CCD when the collision filters are not matching
+		if (!ClosestConvexResultCallback::needsCollision(proxy0))
+			return false;
+
+		btCollisionObject* otherObj = (btCollisionObject*) proxy0->m_clientObject;
+
+		//call needsResponse, see http://code.google.com/p/bullet/issues/detail?id=179
+		if (m_dispatcher->needsResponse(m_me,otherObj))
+		{
+#if 0
+			///don't do CCD when there are already contact points (touching contact/penetration)
+			btAlignedObjectArray<btPersistentManifold*> manifoldArray;
+			btBroadphasePair* collisionPair = m_pairCache->findPair(m_me->getBroadphaseHandle(),proxy0);
+			if (collisionPair)
+			{
+				if (collisionPair->m_algorithm)
+				{
+					manifoldArray.resize(0);
+					collisionPair->m_algorithm->getAllContactManifolds(manifoldArray);
+					for (int j=0;j<manifoldArray.size();j++)
+					{
+						btPersistentManifold* manifold = manifoldArray[j];
+						if (manifold->getNumContacts()>0)
+							return false;
+					}
+				}
+			}
+#endif
+			return true;
+		}
+
+		return false;
+	}
+
+
+};
+
+///internal debugging variable. this value shouldn't be too high
+int gNumClampedCcdMotions=0;
+
+void	btDiscreteDynamicsWorld::integrateTransforms(btScalar timeStep)
+{
+	BT_PROFILE("integrateTransforms");
+	btTransform predictedTrans;
+	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
+	{
+		btRigidBody* body = m_nonStaticRigidBodies[i];
+		body->setHitFraction(1.f);
+
+		if (body->isActive() && (!body->isStaticOrKinematicObject()))
+		{
+
+			body->predictIntegratedTransform(timeStep, predictedTrans);
+			
+			btScalar squareMotion = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
+
+			
+
+			if (getDispatchInfo().m_useContinuous && body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion)
+			{
+				BT_PROFILE("CCD motion clamping");
+				if (body->getCollisionShape()->isConvex())
+				{
+					gNumClampedCcdMotions++;
+#ifdef USE_STATIC_ONLY
+					class StaticOnlyCallback : public btClosestNotMeConvexResultCallback
+					{
+					public:
+
+						StaticOnlyCallback (btCollisionObject* me,const btVector3& fromA,const btVector3& toA,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) : 
+						  btClosestNotMeConvexResultCallback(me,fromA,toA,pairCache,dispatcher)
+						{
+						}
+
+					  	virtual bool needsCollision(btBroadphaseProxy* proxy0) const
+						{
+							btCollisionObject* otherObj = (btCollisionObject*) proxy0->m_clientObject;
+							if (!otherObj->isStaticOrKinematicObject())
+								return false;
+							return btClosestNotMeConvexResultCallback::needsCollision(proxy0);
+						}
+					};
+
+					StaticOnlyCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
+#else
+					btClosestNotMeConvexResultCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
+#endif
+					//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
+					btSphereShape tmpSphere(body->getCcdSweptSphereRadius());//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
+					sweepResults.m_allowedPenetration=getDispatchInfo().m_allowedCcdPenetration;
+
+					sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup;
+					sweepResults.m_collisionFilterMask  = body->getBroadphaseProxy()->m_collisionFilterMask;
+					btTransform modifiedPredictedTrans = predictedTrans;
+					modifiedPredictedTrans.setBasis(body->getWorldTransform().getBasis());
+
+					convexSweepTest(&tmpSphere,body->getWorldTransform(),modifiedPredictedTrans,sweepResults);
+					if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f))
+					{
+						
+						//printf("clamped integration to hit fraction = %f\n",fraction);
+						body->setHitFraction(sweepResults.m_closestHitFraction);
+						body->predictIntegratedTransform(timeStep*body->getHitFraction(), predictedTrans);
+						body->setHitFraction(0.f);
+						body->proceedToTransform( predictedTrans);
+
+#if 0
+						btVector3 linVel = body->getLinearVelocity();
+
+						btScalar maxSpeed = body->getCcdMotionThreshold()/getSolverInfo().m_timeStep;
+						btScalar maxSpeedSqr = maxSpeed*maxSpeed;
+						if (linVel.length2()>maxSpeedSqr)
+						{
+							linVel.normalize();
+							linVel*= maxSpeed;
+							body->setLinearVelocity(linVel);
+							btScalar ms2 = body->getLinearVelocity().length2();
+							body->predictIntegratedTransform(timeStep, predictedTrans);
+
+							btScalar sm2 = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
+							btScalar smt = body->getCcdSquareMotionThreshold();
+							printf("sm2=%f\n",sm2);
+						}
+#else
+						//response  between two dynamic objects without friction, assuming 0 penetration depth
+						btScalar appliedImpulse = 0.f;
+						btScalar depth = 0.f;
+						appliedImpulse = resolveSingleCollision(body,sweepResults.m_hitCollisionObject,sweepResults.m_hitPointWorld,sweepResults.m_hitNormalWorld,getSolverInfo(), depth);
+						
+
+#endif
+
+        				continue;
+					}
+				}
+			}
+			
+
+			body->proceedToTransform( predictedTrans);
+		}
+	}
+}
+
+void	btDiscreteDynamicsWorld::addSpeculativeContacts(btScalar timeStep)
+{
+	BT_PROFILE("addSpeculativeContacts");
+	btTransform predictedTrans;
+	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
+	{
+		btRigidBody* body = m_nonStaticRigidBodies[i];
+		body->setHitFraction(1.f);
+
+		if (body->isActive() && (!body->isStaticOrKinematicObject()))
+		{
+			body->predictIntegratedTransform(timeStep, predictedTrans);
+			btScalar squareMotion = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2();
+
+			if (body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion)
+			{
+				BT_PROFILE("search speculative contacts");
+				if (body->getCollisionShape()->isConvex())
+				{
+					gNumClampedCcdMotions++;
+					
+					btClosestNotMeConvexResultCallback sweepResults(body,body->getWorldTransform().getOrigin(),predictedTrans.getOrigin(),getBroadphase()->getOverlappingPairCache(),getDispatcher());
+					//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
+					btSphereShape tmpSphere(body->getCcdSweptSphereRadius());//btConvexShape* convexShape = static_cast<btConvexShape*>(body->getCollisionShape());
+
+					sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup;
+					sweepResults.m_collisionFilterMask  = body->getBroadphaseProxy()->m_collisionFilterMask;
+					btTransform modifiedPredictedTrans;
+					modifiedPredictedTrans = predictedTrans;
+					modifiedPredictedTrans.setBasis(body->getWorldTransform().getBasis());
+
+					convexSweepTest(&tmpSphere,body->getWorldTransform(),modifiedPredictedTrans,sweepResults);
+					if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f))
+					{
+						btBroadphaseProxy* proxy0 = body->getBroadphaseHandle();
+						btBroadphaseProxy* proxy1 = sweepResults.m_hitCollisionObject->getBroadphaseHandle();
+						btBroadphasePair* pair = sweepResults.m_pairCache->findPair(proxy0,proxy1);
+						if (pair)
+						{
+							if (pair->m_algorithm)
+							{
+								btManifoldArray contacts;
+								pair->m_algorithm->getAllContactManifolds(contacts);
+								if (contacts.size())
+								{
+									btManifoldResult result(body,sweepResults.m_hitCollisionObject);
+									result.setPersistentManifold(contacts[0]);
+
+									btVector3 vec = (modifiedPredictedTrans.getOrigin()-body->getWorldTransform().getOrigin());
+									vec*=sweepResults.m_closestHitFraction;
+									
+									btScalar lenSqr = vec.length2();
+									btScalar depth = 0.f;
+									btVector3 pointWorld = sweepResults.m_hitPointWorld;
+									if (lenSqr>SIMD_EPSILON)
+									{
+										depth = btSqrt(lenSqr);
+										pointWorld -= vec;
+										vec /= depth;
+									}
+
+									if (contacts[0]->getBody0()==body)
+									{
+										result.addContactPoint(sweepResults.m_hitNormalWorld,pointWorld,depth);
+#if 0
+										debugContacts.push_back(sweepResults.m_hitPointWorld);//sweepResults.m_hitPointWorld);
+										debugNormals.push_back(sweepResults.m_hitNormalWorld);
+#endif
+									} else
+									{
+										//swapped
+										result.addContactPoint(-sweepResults.m_hitNormalWorld,pointWorld,depth);
+										//sweepResults.m_hitPointWorld,depth);
+										
+#if 0
+										if (1)//firstHit==1)
+										{
+											firstHit=0;
+											debugNormals.push_back(sweepResults.m_hitNormalWorld);
+											debugContacts.push_back(pointWorld);//sweepResults.m_hitPointWorld);
+											debugNormals.push_back(sweepResults.m_hitNormalWorld);
+											debugContacts.push_back(sweepResults.m_hitPointWorld);
+										}
+										firstHit--;
+#endif
+									}
+								}
+
+							} else
+							{
+								//no algorithm, use dispatcher to create one
+
+							}
+
+
+						} else
+						{
+							//add an overlapping pair
+							//printf("pair missing\n");
+
+						}
+					}
+				}
+			}
+			
+		}
+	}
+}
+
+
+
+
+
+void	btDiscreteDynamicsWorld::predictUnconstraintMotion(btScalar timeStep)
+{
+	BT_PROFILE("predictUnconstraintMotion");
+	for ( int i=0;i<m_nonStaticRigidBodies.size();i++)
+	{
+		btRigidBody* body = m_nonStaticRigidBodies[i];
+		if (!body->isStaticOrKinematicObject())
+		{
+			body->integrateVelocities( timeStep);
+			//damping
+			body->applyDamping(timeStep);
+
+			body->predictIntegratedTransform(timeStep,body->getInterpolationWorldTransform());
+		}
+	}
+}
+
+
+void	btDiscreteDynamicsWorld::startProfiling(btScalar timeStep)
+{
+	(void)timeStep;
+
+#ifndef BT_NO_PROFILE
+	CProfileManager::Reset();
+#endif //BT_NO_PROFILE
+
+}
+
+
+
+
+	
+
+void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint)
+{
+	bool drawFrames = (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawConstraints) != 0;
+	bool drawLimits = (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawConstraintLimits) != 0;
+	btScalar dbgDrawSize = constraint->getDbgDrawSize();
+	if(dbgDrawSize <= btScalar(0.f))
+	{
+		return;
+	}
+
+	switch(constraint->getConstraintType())
+	{
+		case POINT2POINT_CONSTRAINT_TYPE:
+			{
+				btPoint2PointConstraint* p2pC = (btPoint2PointConstraint*)constraint;
+				btTransform tr;
+				tr.setIdentity();
+				btVector3 pivot = p2pC->getPivotInA();
+				pivot = p2pC->getRigidBodyA().getCenterOfMassTransform() * pivot; 
+				tr.setOrigin(pivot);
+				getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				// that ideally should draw the same frame	
+				pivot = p2pC->getPivotInB();
+				pivot = p2pC->getRigidBodyB().getCenterOfMassTransform() * pivot; 
+				tr.setOrigin(pivot);
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+			}
+			break;
+		case HINGE_CONSTRAINT_TYPE:
+			{
+				btHingeConstraint* pHinge = (btHingeConstraint*)constraint;
+				btTransform tr = pHinge->getRigidBodyA().getCenterOfMassTransform() * pHinge->getAFrame();
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				tr = pHinge->getRigidBodyB().getCenterOfMassTransform() * pHinge->getBFrame();
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				btScalar minAng = pHinge->getLowerLimit();
+				btScalar maxAng = pHinge->getUpperLimit();
+				if(minAng == maxAng)
+				{
+					break;
+				}
+				bool drawSect = true;
+				if(minAng > maxAng)
+				{
+					minAng = btScalar(0.f);
+					maxAng = SIMD_2_PI;
+					drawSect = false;
+				}
+				if(drawLimits) 
+				{
+					btVector3& center = tr.getOrigin();
+					btVector3 normal = tr.getBasis().getColumn(2);
+					btVector3 axis = tr.getBasis().getColumn(0);
+					getDebugDrawer()->drawArc(center, normal, axis, dbgDrawSize, dbgDrawSize, minAng, maxAng, btVector3(0,0,0), drawSect);
+				}
+			}
+			break;
+		case CONETWIST_CONSTRAINT_TYPE:
+			{
+				btConeTwistConstraint* pCT = (btConeTwistConstraint*)constraint;
+				btTransform tr = pCT->getRigidBodyA().getCenterOfMassTransform() * pCT->getAFrame();
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				tr = pCT->getRigidBodyB().getCenterOfMassTransform() * pCT->getBFrame();
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				if(drawLimits)
+				{
+					//const btScalar length = btScalar(5);
+					const btScalar length = dbgDrawSize;
+					static int nSegments = 8*4;
+					btScalar fAngleInRadians = btScalar(2.*3.1415926) * (btScalar)(nSegments-1)/btScalar(nSegments);
+					btVector3 pPrev = pCT->GetPointForAngle(fAngleInRadians, length);
+					pPrev = tr * pPrev;
+					for (int i=0; i<nSegments; i++)
+					{
+						fAngleInRadians = btScalar(2.*3.1415926) * (btScalar)i/btScalar(nSegments);
+						btVector3 pCur = pCT->GetPointForAngle(fAngleInRadians, length);
+						pCur = tr * pCur;
+						getDebugDrawer()->drawLine(pPrev, pCur, btVector3(0,0,0));
+
+						if (i%(nSegments/8) == 0)
+							getDebugDrawer()->drawLine(tr.getOrigin(), pCur, btVector3(0,0,0));
+
+						pPrev = pCur;
+					}						
+					btScalar tws = pCT->getTwistSpan();
+					btScalar twa = pCT->getTwistAngle();
+					bool useFrameB = (pCT->getRigidBodyB().getInvMass() > btScalar(0.f));
+					if(useFrameB)
+					{
+						tr = pCT->getRigidBodyB().getCenterOfMassTransform() * pCT->getBFrame();
+					}
+					else
+					{
+						tr = pCT->getRigidBodyA().getCenterOfMassTransform() * pCT->getAFrame();
+					}
+					btVector3 pivot = tr.getOrigin();
+					btVector3 normal = tr.getBasis().getColumn(0);
+					btVector3 axis1 = tr.getBasis().getColumn(1);
+					getDebugDrawer()->drawArc(pivot, normal, axis1, dbgDrawSize, dbgDrawSize, -twa-tws, -twa+tws, btVector3(0,0,0), true);
+
+				}
+			}
+			break;
+		case D6_SPRING_CONSTRAINT_TYPE:
+		case D6_CONSTRAINT_TYPE:
+			{
+				btGeneric6DofConstraint* p6DOF = (btGeneric6DofConstraint*)constraint;
+				btTransform tr = p6DOF->getCalculatedTransformA();
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				tr = p6DOF->getCalculatedTransformB();
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				if(drawLimits) 
+				{
+					tr = p6DOF->getCalculatedTransformA();
+					const btVector3& center = p6DOF->getCalculatedTransformB().getOrigin();
+					btVector3 up = tr.getBasis().getColumn(2);
+					btVector3 axis = tr.getBasis().getColumn(0);
+					btScalar minTh = p6DOF->getRotationalLimitMotor(1)->m_loLimit;
+					btScalar maxTh = p6DOF->getRotationalLimitMotor(1)->m_hiLimit;
+					btScalar minPs = p6DOF->getRotationalLimitMotor(2)->m_loLimit;
+					btScalar maxPs = p6DOF->getRotationalLimitMotor(2)->m_hiLimit;
+					getDebugDrawer()->drawSpherePatch(center, up, axis, dbgDrawSize * btScalar(.9f), minTh, maxTh, minPs, maxPs, btVector3(0,0,0));
+					axis = tr.getBasis().getColumn(1);
+					btScalar ay = p6DOF->getAngle(1);
+					btScalar az = p6DOF->getAngle(2);
+					btScalar cy = btCos(ay);
+					btScalar sy = btSin(ay);
+					btScalar cz = btCos(az);
+					btScalar sz = btSin(az);
+					btVector3 ref;
+					ref[0] = cy*cz*axis[0] + cy*sz*axis[1] - sy*axis[2];
+					ref[1] = -sz*axis[0] + cz*axis[1];
+					ref[2] = cz*sy*axis[0] + sz*sy*axis[1] + cy*axis[2];
+					tr = p6DOF->getCalculatedTransformB();
+					btVector3 normal = -tr.getBasis().getColumn(0);
+					btScalar minFi = p6DOF->getRotationalLimitMotor(0)->m_loLimit;
+					btScalar maxFi = p6DOF->getRotationalLimitMotor(0)->m_hiLimit;
+					if(minFi > maxFi)
+					{
+						getDebugDrawer()->drawArc(center, normal, ref, dbgDrawSize, dbgDrawSize, -SIMD_PI, SIMD_PI, btVector3(0,0,0), false);
+					}
+					else if(minFi < maxFi)
+					{
+						getDebugDrawer()->drawArc(center, normal, ref, dbgDrawSize, dbgDrawSize, minFi, maxFi, btVector3(0,0,0), true);
+					}
+					tr = p6DOF->getCalculatedTransformA();
+					btVector3 bbMin = p6DOF->getTranslationalLimitMotor()->m_lowerLimit;
+					btVector3 bbMax = p6DOF->getTranslationalLimitMotor()->m_upperLimit;
+					getDebugDrawer()->drawBox(bbMin, bbMax, tr, btVector3(0,0,0));
+				}
+			}
+			break;
+		case SLIDER_CONSTRAINT_TYPE:
+			{
+				btSliderConstraint* pSlider = (btSliderConstraint*)constraint;
+				btTransform tr = pSlider->getCalculatedTransformA();
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				tr = pSlider->getCalculatedTransformB();
+				if(drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize);
+				if(drawLimits)
+				{
+					btTransform tr = pSlider->getUseLinearReferenceFrameA() ? pSlider->getCalculatedTransformA() : pSlider->getCalculatedTransformB();
+					btVector3 li_min = tr * btVector3(pSlider->getLowerLinLimit(), 0.f, 0.f);
+					btVector3 li_max = tr * btVector3(pSlider->getUpperLinLimit(), 0.f, 0.f);
+					getDebugDrawer()->drawLine(li_min, li_max, btVector3(0, 0, 0));
+					btVector3 normal = tr.getBasis().getColumn(0);
+					btVector3 axis = tr.getBasis().getColumn(1);
+					btScalar a_min = pSlider->getLowerAngLimit();
+					btScalar a_max = pSlider->getUpperAngLimit();
+					const btVector3& center = pSlider->getCalculatedTransformB().getOrigin();
+					getDebugDrawer()->drawArc(center, normal, axis, dbgDrawSize, dbgDrawSize, a_min, a_max, btVector3(0,0,0), true);
+				}
+			}
+			break;
+		default : 
+			break;
+	}
+	return;
+}
+
+
+
+
+
+void	btDiscreteDynamicsWorld::setConstraintSolver(btConstraintSolver* solver)
+{
+	if (m_ownsConstraintSolver)
+	{
+		btAlignedFree( m_constraintSolver);
+	}
+	m_ownsConstraintSolver = false;
+	m_constraintSolver = solver;
+}
+
+btConstraintSolver* btDiscreteDynamicsWorld::getConstraintSolver()
+{
+	return m_constraintSolver;
+}
+
+
+int		btDiscreteDynamicsWorld::getNumConstraints() const
+{
+	return int(m_constraints.size());
+}
+btTypedConstraint* btDiscreteDynamicsWorld::getConstraint(int index)
+{
+	return m_constraints[index];
+}
+const btTypedConstraint* btDiscreteDynamicsWorld::getConstraint(int index) const
+{
+	return m_constraints[index];
+}
+
+
+
+void	btDiscreteDynamicsWorld::serializeRigidBodies(btSerializer* serializer)
+{
+	int i;
+	//serialize all collision objects
+	for (i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		if (colObj->getInternalType() & btCollisionObject::CO_RIGID_BODY)
+		{
+			int len = colObj->calculateSerializeBufferSize();
+			btChunk* chunk = serializer->allocate(len,1);
+			const char* structType = colObj->serialize(chunk->m_oldPtr, serializer);
+			serializer->finalizeChunk(chunk,structType,BT_RIGIDBODY_CODE,colObj);
+		}
+	}
+
+	for (i=0;i<m_constraints.size();i++)
+	{
+		btTypedConstraint* constraint = m_constraints[i];
+		int size = constraint->calculateSerializeBufferSize();
+		btChunk* chunk = serializer->allocate(size,1);
+		const char* structType = constraint->serialize(chunk->m_oldPtr,serializer);
+		serializer->finalizeChunk(chunk,structType,BT_CONSTRAINT_CODE,constraint);
+	}
+}
+
+
+void	btDiscreteDynamicsWorld::serialize(btSerializer* serializer)
+{
+
+	serializer->startSerialization();
+
+	serializeRigidBodies(serializer);
+
+	serializeCollisionObjects(serializer);
+
+	serializer->finishSerialization();
+}
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h
new file mode 100644
index 0000000..3ba39a1
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h
@@ -0,0 +1,200 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_DISCRETE_DYNAMICS_WORLD_H
+#define BT_DISCRETE_DYNAMICS_WORLD_H
+
+#include "btDynamicsWorld.h"
+
+class btDispatcher;
+class btOverlappingPairCache;
+class btConstraintSolver;
+class btSimulationIslandManager;
+class btTypedConstraint;
+class btActionInterface;
+
+class btIDebugDraw;
+#include "LinearMath/btAlignedObjectArray.h"
+
+
+///btDiscreteDynamicsWorld provides discrete rigid body simulation
+///those classes replace the obsolete CcdPhysicsEnvironment/CcdPhysicsController
+class btDiscreteDynamicsWorld : public btDynamicsWorld
+{
+protected:
+
+	btConstraintSolver*	m_constraintSolver;
+
+	btSimulationIslandManager*	m_islandManager;
+
+	btAlignedObjectArray<btTypedConstraint*> m_constraints;
+
+	btAlignedObjectArray<btRigidBody*> m_nonStaticRigidBodies;
+
+	btVector3	m_gravity;
+
+	//for variable timesteps
+	btScalar	m_localTime;
+	//for variable timesteps
+
+	bool	m_ownsIslandManager;
+	bool	m_ownsConstraintSolver;
+	bool	m_synchronizeAllMotionStates;
+
+	btAlignedObjectArray<btActionInterface*>	m_actions;
+	
+	int	m_profileTimings;
+
+	virtual void	predictUnconstraintMotion(btScalar timeStep);
+	
+	virtual void	integrateTransforms(btScalar timeStep);
+		
+	virtual void	addSpeculativeContacts(btScalar timeStep);
+
+	virtual void	calculateSimulationIslands();
+
+	virtual void	solveConstraints(btContactSolverInfo& solverInfo);
+	
+	void	updateActivationState(btScalar timeStep);
+
+	void	updateActions(btScalar timeStep);
+
+	void	startProfiling(btScalar timeStep);
+
+	virtual void	internalSingleStepSimulation( btScalar timeStep);
+
+
+	virtual void	saveKinematicState(btScalar timeStep);
+
+	void	serializeRigidBodies(btSerializer* serializer);
+
+public:
+
+
+	///this btDiscreteDynamicsWorld constructor gets created objects from the user, and will not delete those
+	btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
+
+	virtual ~btDiscreteDynamicsWorld();
+
+	///if maxSubSteps > 0, it will interpolate motion between fixedTimeStep's
+	virtual int	stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.));
+
+
+	virtual void	synchronizeMotionStates();
+
+	///this can be useful to synchronize a single rigid body -> graphics object
+	void	synchronizeSingleMotionState(btRigidBody* body);
+
+	virtual void	addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false);
+
+	virtual void	removeConstraint(btTypedConstraint* constraint);
+
+	virtual void	addAction(btActionInterface*);
+
+	virtual void	removeAction(btActionInterface*);
+	
+	btSimulationIslandManager*	getSimulationIslandManager()
+	{
+		return m_islandManager;
+	}
+
+	const btSimulationIslandManager*	getSimulationIslandManager() const 
+	{
+		return m_islandManager;
+	}
+
+	btCollisionWorld*	getCollisionWorld()
+	{
+		return this;
+	}
+
+	virtual void	setGravity(const btVector3& gravity);
+
+	virtual btVector3 getGravity () const;
+
+	virtual void	addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=btBroadphaseProxy::StaticFilter,short int collisionFilterMask=btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter);
+
+	virtual void	addRigidBody(btRigidBody* body);
+
+	virtual void	addRigidBody(btRigidBody* body, short group, short mask);
+
+	virtual void	removeRigidBody(btRigidBody* body);
+
+	///removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject
+	virtual void	removeCollisionObject(btCollisionObject* collisionObject);
+
+
+	void	debugDrawConstraint(btTypedConstraint* constraint);
+
+	virtual void	debugDrawWorld();
+
+	virtual void	setConstraintSolver(btConstraintSolver* solver);
+
+	virtual btConstraintSolver* getConstraintSolver();
+	
+	virtual	int		getNumConstraints() const;
+
+	virtual btTypedConstraint* getConstraint(int index)	;
+
+	virtual const btTypedConstraint* getConstraint(int index) const;
+
+	
+	virtual btDynamicsWorldType	getWorldType() const
+	{
+		return BT_DISCRETE_DYNAMICS_WORLD;
+	}
+	
+	///the forces on each rigidbody is accumulating together with gravity. clear this after each timestep.
+	virtual void	clearForces();
+
+	///apply gravity, call this once per timestep
+	virtual void	applyGravity();
+
+	virtual void	setNumTasks(int numTasks)
+	{
+        (void) numTasks;
+	}
+
+	///obsolete, use updateActions instead
+	virtual void updateVehicles(btScalar timeStep)
+	{
+		updateActions(timeStep);
+	}
+
+	///obsolete, use addAction instead
+	virtual void	addVehicle(btActionInterface* vehicle);
+	///obsolete, use removeAction instead
+	virtual void	removeVehicle(btActionInterface* vehicle);
+	///obsolete, use addAction instead
+	virtual void	addCharacter(btActionInterface* character);
+	///obsolete, use removeAction instead
+	virtual void	removeCharacter(btActionInterface* character);
+
+	void	setSynchronizeAllMotionStates(bool synchronizeAll)
+	{
+		m_synchronizeAllMotionStates = synchronizeAll;
+	}
+	bool getSynchronizeAllMotionStates() const
+	{
+		return m_synchronizeAllMotionStates;
+	}
+
+	///Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see Bullet/Demos/SerializeDemo)
+	virtual	void	serialize(btSerializer* serializer);
+
+};
+
+#endif //BT_DISCRETE_DYNAMICS_WORLD_H
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h
new file mode 100644
index 0000000..6b00933
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btDynamicsWorld.h
@@ -0,0 +1,151 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_DYNAMICS_WORLD_H
+#define BT_DYNAMICS_WORLD_H
+
+#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
+#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
+
+class btTypedConstraint;
+class btActionInterface;
+class btConstraintSolver;
+class btDynamicsWorld;
+
+
+/// Type for the callback for each tick
+typedef void (*btInternalTickCallback)(btDynamicsWorld *world, btScalar timeStep);
+
+enum btDynamicsWorldType
+{
+	BT_SIMPLE_DYNAMICS_WORLD=1,
+	BT_DISCRETE_DYNAMICS_WORLD=2,
+	BT_CONTINUOUS_DYNAMICS_WORLD=3,
+	BT_SOFT_RIGID_DYNAMICS_WORLD=4
+};
+
+///The btDynamicsWorld is the interface class for several dynamics implementation, basic, discrete, parallel, and continuous etc.
+class btDynamicsWorld : public btCollisionWorld
+{
+
+protected:
+		btInternalTickCallback m_internalTickCallback;
+		btInternalTickCallback m_internalPreTickCallback;
+		void*	m_worldUserInfo;
+
+		btContactSolverInfo	m_solverInfo;
+
+public:
+		
+
+		btDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphase,btCollisionConfiguration* collisionConfiguration)
+		:btCollisionWorld(dispatcher,broadphase,collisionConfiguration), m_internalTickCallback(0),m_internalPreTickCallback(0), m_worldUserInfo(0)
+		{
+		}
+
+		virtual ~btDynamicsWorld()
+		{
+		}
+		
+		///stepSimulation proceeds the simulation over 'timeStep', units in preferably in seconds.
+		///By default, Bullet will subdivide the timestep in constant substeps of each 'fixedTimeStep'.
+		///in order to keep the simulation real-time, the maximum number of substeps can be clamped to 'maxSubSteps'.
+		///You can disable subdividing the timestep/substepping by passing maxSubSteps=0 as second argument to stepSimulation, but in that case you have to keep the timeStep constant.
+		virtual int		stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.))=0;
+			
+		virtual void	debugDrawWorld() = 0;
+				
+		virtual void	addConstraint(btTypedConstraint* constraint, bool disableCollisionsBetweenLinkedBodies=false) 
+		{ 
+			(void)constraint; (void)disableCollisionsBetweenLinkedBodies;
+		}
+
+		virtual void	removeConstraint(btTypedConstraint* constraint) {(void)constraint;}
+
+		virtual void	addAction(btActionInterface* action) = 0;
+
+		virtual void	removeAction(btActionInterface* action) = 0;
+
+		//once a rigidbody is added to the dynamics world, it will get this gravity assigned
+		//existing rigidbodies in the world get gravity assigned too, during this method
+		virtual void	setGravity(const btVector3& gravity) = 0;
+		virtual btVector3 getGravity () const = 0;
+
+		virtual void	synchronizeMotionStates() = 0;
+
+		virtual void	addRigidBody(btRigidBody* body) = 0;
+
+		virtual void	addRigidBody(btRigidBody* body, short group, short mask) = 0;
+
+		virtual void	removeRigidBody(btRigidBody* body) = 0;
+
+		virtual void	setConstraintSolver(btConstraintSolver* solver) = 0;
+
+		virtual btConstraintSolver* getConstraintSolver() = 0;
+		
+		virtual	int		getNumConstraints() const {	return 0;		}
+		
+		virtual btTypedConstraint* getConstraint(int index)		{	(void)index;		return 0;		}
+		
+		virtual const btTypedConstraint* getConstraint(int index) const	{	(void)index;	return 0;	}
+
+		virtual btDynamicsWorldType	getWorldType() const=0;
+
+		virtual void	clearForces() = 0;
+
+		/// Set the callback for when an internal tick (simulation substep) happens, optional user info
+		void setInternalTickCallback(btInternalTickCallback cb,	void* worldUserInfo=0,bool isPreTick=false) 
+		{ 
+			if (isPreTick)
+			{
+				m_internalPreTickCallback = cb;
+			} else
+			{
+				m_internalTickCallback = cb; 
+			}
+			m_worldUserInfo = worldUserInfo;
+		}
+
+		void	setWorldUserInfo(void* worldUserInfo)
+		{
+			m_worldUserInfo = worldUserInfo;
+		}
+
+		void*	getWorldUserInfo() const
+		{
+			return m_worldUserInfo;
+		}
+
+		btContactSolverInfo& getSolverInfo()
+		{
+			return m_solverInfo;
+		}
+
+
+		///obsolete, use addAction instead.
+		virtual void	addVehicle(btActionInterface* vehicle) {(void)vehicle;}
+		///obsolete, use removeAction instead
+		virtual void	removeVehicle(btActionInterface* vehicle) {(void)vehicle;}
+		///obsolete, use addAction instead.
+		virtual void	addCharacter(btActionInterface* character) {(void)character;}
+		///obsolete, use removeAction instead
+		virtual void	removeCharacter(btActionInterface* character) {(void)character;}
+
+
+};
+
+#endif //BT_DYNAMICS_WORLD_H
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp
new file mode 100644
index 0000000..aefb26a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp
@@ -0,0 +1,402 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btRigidBody.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "LinearMath/btMinMax.h"
+#include "LinearMath/btTransformUtil.h"
+#include "LinearMath/btMotionState.h"
+#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
+#include "LinearMath/btSerializer.h"
+
+//'temporarily' global variables
+btScalar	gDeactivationTime = btScalar(2.);
+bool	gDisableDeactivation = false;
+static int uniqueId = 0;
+
+
+btRigidBody::btRigidBody(const btRigidBody::btRigidBodyConstructionInfo& constructionInfo)
+{
+	setupRigidBody(constructionInfo);
+}
+
+btRigidBody::btRigidBody(btScalar mass, btMotionState *motionState, btCollisionShape *collisionShape, const btVector3 &localInertia)
+{
+	btRigidBodyConstructionInfo cinfo(mass,motionState,collisionShape,localInertia);
+	setupRigidBody(cinfo);
+}
+
+void	btRigidBody::setupRigidBody(const btRigidBody::btRigidBodyConstructionInfo& constructionInfo)
+{
+
+	m_internalType=CO_RIGID_BODY;
+
+	m_linearVelocity.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
+	m_angularVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+	m_angularFactor.setValue(1,1,1);
+	m_linearFactor.setValue(1,1,1);
+	m_gravity.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
+	m_gravity_acceleration.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
+	m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
+	m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)),
+    setDamping(constructionInfo.m_linearDamping, constructionInfo.m_angularDamping);
+
+	m_linearSleepingThreshold = constructionInfo.m_linearSleepingThreshold;
+	m_angularSleepingThreshold = constructionInfo.m_angularSleepingThreshold;
+	m_optionalMotionState = constructionInfo.m_motionState;
+	m_contactSolverType = 0;
+	m_frictionSolverType = 0;
+	m_additionalDamping = constructionInfo.m_additionalDamping;
+	m_additionalDampingFactor = constructionInfo.m_additionalDampingFactor;
+	m_additionalLinearDampingThresholdSqr = constructionInfo.m_additionalLinearDampingThresholdSqr;
+	m_additionalAngularDampingThresholdSqr = constructionInfo.m_additionalAngularDampingThresholdSqr;
+	m_additionalAngularDampingFactor = constructionInfo.m_additionalAngularDampingFactor;
+
+	if (m_optionalMotionState)
+	{
+		m_optionalMotionState->getWorldTransform(m_worldTransform);
+	} else
+	{
+		m_worldTransform = constructionInfo.m_startWorldTransform;
+	}
+
+	m_interpolationWorldTransform = m_worldTransform;
+	m_interpolationLinearVelocity.setValue(0,0,0);
+	m_interpolationAngularVelocity.setValue(0,0,0);
+	
+	//moved to btCollisionObject
+	m_friction = constructionInfo.m_friction;
+	m_restitution = constructionInfo.m_restitution;
+
+	setCollisionShape( constructionInfo.m_collisionShape );
+	m_debugBodyId = uniqueId++;
+	
+	setMassProps(constructionInfo.m_mass, constructionInfo.m_localInertia);
+	updateInertiaTensor();
+
+	m_rigidbodyFlags = 0;
+
+
+	m_deltaLinearVelocity.setZero();
+	m_deltaAngularVelocity.setZero();
+	m_invMass = m_inverseMass*m_linearFactor;
+	m_pushVelocity.setZero();
+	m_turnVelocity.setZero();
+
+	
+
+}
+
+
+void btRigidBody::predictIntegratedTransform(btScalar timeStep,btTransform& predictedTransform) 
+{
+	btTransformUtil::integrateTransform(m_worldTransform,m_linearVelocity,m_angularVelocity,timeStep,predictedTransform);
+}
+
+void			btRigidBody::saveKinematicState(btScalar timeStep)
+{
+	//todo: clamp to some (user definable) safe minimum timestep, to limit maximum angular/linear velocities
+	if (timeStep != btScalar(0.))
+	{
+		//if we use motionstate to synchronize world transforms, get the new kinematic/animated world transform
+		if (getMotionState())
+			getMotionState()->getWorldTransform(m_worldTransform);
+		btVector3 linVel,angVel;
+		
+		btTransformUtil::calculateVelocity(m_interpolationWorldTransform,m_worldTransform,timeStep,m_linearVelocity,m_angularVelocity);
+		m_interpolationLinearVelocity = m_linearVelocity;
+		m_interpolationAngularVelocity = m_angularVelocity;
+		m_interpolationWorldTransform = m_worldTransform;
+		//printf("angular = %f %f %f\n",m_angularVelocity.getX(),m_angularVelocity.getY(),m_angularVelocity.getZ());
+	}
+}
+	
+void	btRigidBody::getAabb(btVector3& aabbMin,btVector3& aabbMax) const
+{
+	getCollisionShape()->getAabb(m_worldTransform,aabbMin,aabbMax);
+}
+
+
+
+
+void btRigidBody::setGravity(const btVector3& acceleration) 
+{
+	if (m_inverseMass != btScalar(0.0))
+	{
+		m_gravity = acceleration * (btScalar(1.0) / m_inverseMass);
+	}
+	m_gravity_acceleration = acceleration;
+}
+
+
+
+
+
+
+void btRigidBody::setDamping(btScalar lin_damping, btScalar ang_damping)
+{
+	m_linearDamping = btClamped(lin_damping, (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
+	m_angularDamping = btClamped(ang_damping, (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
+}
+
+
+
+
+///applyDamping damps the velocity, using the given m_linearDamping and m_angularDamping
+void			btRigidBody::applyDamping(btScalar timeStep)
+{
+	//On new damping: see discussion/issue report here: http://code.google.com/p/bullet/issues/detail?id=74
+	//todo: do some performance comparisons (but other parts of the engine are probably bottleneck anyway
+
+//#define USE_OLD_DAMPING_METHOD 1
+#ifdef USE_OLD_DAMPING_METHOD
+	m_linearVelocity *= GEN_clamped((btScalar(1.) - timeStep * m_linearDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
+	m_angularVelocity *= GEN_clamped((btScalar(1.) - timeStep * m_angularDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
+#else
+	m_linearVelocity *= btPow(btScalar(1)-m_linearDamping, timeStep);
+	m_angularVelocity *= btPow(btScalar(1)-m_angularDamping, timeStep);
+#endif
+
+	if (m_additionalDamping)
+	{
+		//Additional damping can help avoiding lowpass jitter motion, help stability for ragdolls etc.
+		//Such damping is undesirable, so once the overall simulation quality of the rigid body dynamics system has improved, this should become obsolete
+		if ((m_angularVelocity.length2() < m_additionalAngularDampingThresholdSqr) &&
+			(m_linearVelocity.length2() < m_additionalLinearDampingThresholdSqr))
+		{
+			m_angularVelocity *= m_additionalDampingFactor;
+			m_linearVelocity *= m_additionalDampingFactor;
+		}
+	
+
+		btScalar speed = m_linearVelocity.length();
+		if (speed < m_linearDamping)
+		{
+			btScalar dampVel = btScalar(0.005);
+			if (speed > dampVel)
+			{
+				btVector3 dir = m_linearVelocity.normalized();
+				m_linearVelocity -=  dir * dampVel;
+			} else
+			{
+				m_linearVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+			}
+		}
+
+		btScalar angSpeed = m_angularVelocity.length();
+		if (angSpeed < m_angularDamping)
+		{
+			btScalar angDampVel = btScalar(0.005);
+			if (angSpeed > angDampVel)
+			{
+				btVector3 dir = m_angularVelocity.normalized();
+				m_angularVelocity -=  dir * angDampVel;
+			} else
+			{
+				m_angularVelocity.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+			}
+		}
+	}
+}
+
+
+void btRigidBody::applyGravity()
+{
+	if (isStaticOrKinematicObject())
+		return;
+	
+	applyCentralForce(m_gravity);	
+
+}
+
+void btRigidBody::proceedToTransform(const btTransform& newTrans)
+{
+	setCenterOfMassTransform( newTrans );
+}
+	
+
+void btRigidBody::setMassProps(btScalar mass, const btVector3& inertia)
+{
+	if (mass == btScalar(0.))
+	{
+		m_collisionFlags |= btCollisionObject::CF_STATIC_OBJECT;
+		m_inverseMass = btScalar(0.);
+	} else
+	{
+		m_collisionFlags &= (~btCollisionObject::CF_STATIC_OBJECT);
+		m_inverseMass = btScalar(1.0) / mass;
+	}
+
+	//Fg = m * a
+	m_gravity = mass * m_gravity_acceleration;
+	
+	m_invInertiaLocal.setValue(inertia.x() != btScalar(0.0) ? btScalar(1.0) / inertia.x(): btScalar(0.0),
+				   inertia.y() != btScalar(0.0) ? btScalar(1.0) / inertia.y(): btScalar(0.0),
+				   inertia.z() != btScalar(0.0) ? btScalar(1.0) / inertia.z(): btScalar(0.0));
+
+	m_invMass = m_linearFactor*m_inverseMass;
+}
+
+	
+
+void btRigidBody::updateInertiaTensor() 
+{
+	m_invInertiaTensorWorld = m_worldTransform.getBasis().scaled(m_invInertiaLocal) * m_worldTransform.getBasis().transpose();
+}
+
+
+void btRigidBody::integrateVelocities(btScalar step) 
+{
+	if (isStaticOrKinematicObject())
+		return;
+
+	m_linearVelocity += m_totalForce * (m_inverseMass * step);
+	m_angularVelocity += m_invInertiaTensorWorld * m_totalTorque * step;
+
+#define MAX_ANGVEL SIMD_HALF_PI
+	/// clamp angular velocity. collision calculations will fail on higher angular velocities	
+	btScalar angvel = m_angularVelocity.length();
+	if (angvel*step > MAX_ANGVEL)
+	{
+		m_angularVelocity *= (MAX_ANGVEL/step) /angvel;
+	}
+
+}
+
+btQuaternion btRigidBody::getOrientation() const
+{
+		btQuaternion orn;
+		m_worldTransform.getBasis().getRotation(orn);
+		return orn;
+}
+	
+	
+void btRigidBody::setCenterOfMassTransform(const btTransform& xform)
+{
+
+	if (isStaticOrKinematicObject())
+	{
+		m_interpolationWorldTransform = m_worldTransform;
+	} else
+	{
+		m_interpolationWorldTransform = xform;
+	}
+	m_interpolationLinearVelocity = getLinearVelocity();
+	m_interpolationAngularVelocity = getAngularVelocity();
+	m_worldTransform = xform;
+	updateInertiaTensor();
+}
+
+
+bool btRigidBody::checkCollideWithOverride(btCollisionObject* co)
+{
+	btRigidBody* otherRb = btRigidBody::upcast(co);
+	if (!otherRb)
+		return true;
+
+	for (int i = 0; i < m_constraintRefs.size(); ++i)
+	{
+		btTypedConstraint* c = m_constraintRefs[i];
+		if (&c->getRigidBodyA() == otherRb || &c->getRigidBodyB() == otherRb)
+			return false;
+	}
+
+	return true;
+}
+
+void	btRigidBody::internalWritebackVelocity(btScalar timeStep)
+{
+    (void) timeStep;
+	if (m_inverseMass)
+	{
+		setLinearVelocity(getLinearVelocity()+ m_deltaLinearVelocity);
+		setAngularVelocity(getAngularVelocity()+m_deltaAngularVelocity);
+		
+		//correct the position/orientation based on push/turn recovery
+		btTransform newTransform;
+		btTransformUtil::integrateTransform(getWorldTransform(),m_pushVelocity,m_turnVelocity,timeStep,newTransform);
+		setWorldTransform(newTransform);
+		//m_originalBody->setCompanionId(-1);
+	}
+//	m_deltaLinearVelocity.setZero();
+//	m_deltaAngularVelocity .setZero();
+//	m_pushVelocity.setZero();
+//	m_turnVelocity.setZero();
+}
+
+
+
+void btRigidBody::addConstraintRef(btTypedConstraint* c)
+{
+	int index = m_constraintRefs.findLinearSearch(c);
+	if (index == m_constraintRefs.size())
+		m_constraintRefs.push_back(c); 
+
+	m_checkCollideWith = true;
+}
+
+void btRigidBody::removeConstraintRef(btTypedConstraint* c)
+{
+	m_constraintRefs.remove(c);
+	m_checkCollideWith = m_constraintRefs.size() > 0;
+}
+
+int	btRigidBody::calculateSerializeBufferSize()	const
+{
+	int sz = sizeof(btRigidBodyData);
+	return sz;
+}
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+const char*	btRigidBody::serialize(void* dataBuffer, class btSerializer* serializer) const
+{
+	btRigidBodyData* rbd = (btRigidBodyData*) dataBuffer;
+
+	btCollisionObject::serialize(&rbd->m_collisionObjectData, serializer);
+
+	m_invInertiaTensorWorld.serialize(rbd->m_invInertiaTensorWorld);
+	m_linearVelocity.serialize(rbd->m_linearVelocity);
+	m_angularVelocity.serialize(rbd->m_angularVelocity);
+	rbd->m_inverseMass = m_inverseMass;
+	m_angularFactor.serialize(rbd->m_angularFactor);
+	m_linearFactor.serialize(rbd->m_linearFactor);
+	m_gravity.serialize(rbd->m_gravity);
+	m_gravity_acceleration.serialize(rbd->m_gravity_acceleration);
+	m_invInertiaLocal.serialize(rbd->m_invInertiaLocal);
+	m_totalForce.serialize(rbd->m_totalForce);
+	m_totalTorque.serialize(rbd->m_totalTorque);
+	rbd->m_linearDamping = m_linearDamping;
+	rbd->m_angularDamping = m_angularDamping;
+	rbd->m_additionalDamping = m_additionalDamping;
+	rbd->m_additionalDampingFactor = m_additionalDampingFactor;
+	rbd->m_additionalLinearDampingThresholdSqr = m_additionalLinearDampingThresholdSqr;
+	rbd->m_additionalAngularDampingThresholdSqr = m_additionalAngularDampingThresholdSqr;
+	rbd->m_additionalAngularDampingFactor = m_additionalAngularDampingFactor;
+	rbd->m_linearSleepingThreshold=m_linearSleepingThreshold;
+	rbd->m_angularSleepingThreshold = m_angularSleepingThreshold;
+
+	return btRigidBodyDataName;
+}
+
+
+
+void btRigidBody::serializeSingleObject(class btSerializer* serializer) const
+{
+	btChunk* chunk = serializer->allocate(calculateSerializeBufferSize(),1);
+	const char* structType = serialize(chunk->m_oldPtr, serializer);
+	serializer->finalizeChunk(chunk,structType,BT_RIGIDBODY_CODE,(void*)this);
+}
+
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.h
new file mode 100644
index 0000000..7c121e6
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btRigidBody.h
@@ -0,0 +1,691 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_RIGIDBODY_H
+#define BT_RIGIDBODY_H
+
+#include "LinearMath/btAlignedObjectArray.h"
+#include "LinearMath/btTransform.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+
+class btCollisionShape;
+class btMotionState;
+class btTypedConstraint;
+
+
+extern btScalar gDeactivationTime;
+extern bool gDisableDeactivation;
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btRigidBodyData	btRigidBodyDoubleData
+#define btRigidBodyDataName	"btRigidBodyDoubleData"
+#else
+#define btRigidBodyData	btRigidBodyFloatData
+#define btRigidBodyDataName	"btRigidBodyFloatData"
+#endif //BT_USE_DOUBLE_PRECISION
+
+
+enum	btRigidBodyFlags
+{
+	BT_DISABLE_WORLD_GRAVITY = 1
+};
+
+
+///The btRigidBody is the main class for rigid body objects. It is derived from btCollisionObject, so it keeps a pointer to a btCollisionShape.
+///It is recommended for performance and memory use to share btCollisionShape objects whenever possible.
+///There are 3 types of rigid bodies: 
+///- A) Dynamic rigid bodies, with positive mass. Motion is controlled by rigid body dynamics.
+///- B) Fixed objects with zero mass. They are not moving (basically collision objects)
+///- C) Kinematic objects, which are objects without mass, but the user can move them. There is on-way interaction, and Bullet calculates a velocity based on the timestep and previous and current world transform.
+///Bullet automatically deactivates dynamic rigid bodies, when the velocity is below a threshold for a given time.
+///Deactivated (sleeping) rigid bodies don't take any processing time, except a minor broadphase collision detection impact (to allow active objects to activate/wake up sleeping objects)
+class btRigidBody  : public btCollisionObject
+{
+
+	btMatrix3x3	m_invInertiaTensorWorld;
+	btVector3		m_linearVelocity;
+	btVector3		m_angularVelocity;
+	btScalar		m_inverseMass;
+	btVector3		m_linearFactor;
+
+	btVector3		m_gravity;	
+	btVector3		m_gravity_acceleration;
+	btVector3		m_invInertiaLocal;
+	btVector3		m_totalForce;
+	btVector3		m_totalTorque;
+	
+	btScalar		m_linearDamping;
+	btScalar		m_angularDamping;
+
+	bool			m_additionalDamping;
+	btScalar		m_additionalDampingFactor;
+	btScalar		m_additionalLinearDampingThresholdSqr;
+	btScalar		m_additionalAngularDampingThresholdSqr;
+	btScalar		m_additionalAngularDampingFactor;
+
+
+	btScalar		m_linearSleepingThreshold;
+	btScalar		m_angularSleepingThreshold;
+
+	//m_optionalMotionState allows to automatic synchronize the world transform for active objects
+	btMotionState*	m_optionalMotionState;
+
+	//keep track of typed constraints referencing this rigid body
+	btAlignedObjectArray<btTypedConstraint*> m_constraintRefs;
+
+	int				m_rigidbodyFlags;
+	
+	int				m_debugBodyId;
+	
+
+protected:
+
+	ATTRIBUTE_ALIGNED64(btVector3		m_deltaLinearVelocity);
+	btVector3		m_deltaAngularVelocity;
+	btVector3		m_angularFactor;
+	btVector3		m_invMass;
+	btVector3		m_pushVelocity;
+	btVector3		m_turnVelocity;
+
+
+public:
+
+
+	///The btRigidBodyConstructionInfo structure provides information to create a rigid body. Setting mass to zero creates a fixed (non-dynamic) rigid body.
+	///For dynamic objects, you can use the collision shape to approximate the local inertia tensor, otherwise use the zero vector (default argument)
+	///You can use the motion state to synchronize the world transform between physics and graphics objects. 
+	///And if the motion state is provided, the rigid body will initialize its initial world transform from the motion state,
+	///m_startWorldTransform is only used when you don't provide a motion state.
+	struct	btRigidBodyConstructionInfo
+	{
+		btScalar			m_mass;
+
+		///When a motionState is provided, the rigid body will initialize its world transform from the motion state
+		///In this case, m_startWorldTransform is ignored.
+		btMotionState*		m_motionState;
+		btTransform	m_startWorldTransform;
+
+		btCollisionShape*	m_collisionShape;
+		btVector3			m_localInertia;
+		btScalar			m_linearDamping;
+		btScalar			m_angularDamping;
+
+		///best simulation results when friction is non-zero
+		btScalar			m_friction;
+		///best simulation results using zero restitution.
+		btScalar			m_restitution;
+
+		btScalar			m_linearSleepingThreshold;
+		btScalar			m_angularSleepingThreshold;
+
+		//Additional damping can help avoiding lowpass jitter motion, help stability for ragdolls etc.
+		//Such damping is undesirable, so once the overall simulation quality of the rigid body dynamics system has improved, this should become obsolete
+		bool				m_additionalDamping;
+		btScalar			m_additionalDampingFactor;
+		btScalar			m_additionalLinearDampingThresholdSqr;
+		btScalar			m_additionalAngularDampingThresholdSqr;
+		btScalar			m_additionalAngularDampingFactor;
+
+		btRigidBodyConstructionInfo(	btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0)):
+		m_mass(mass),
+			m_motionState(motionState),
+			m_collisionShape(collisionShape),
+			m_localInertia(localInertia),
+			m_linearDamping(btScalar(0.)),
+			m_angularDamping(btScalar(0.)),
+			m_friction(btScalar(0.5)),
+			m_restitution(btScalar(0.)),
+			m_linearSleepingThreshold(btScalar(0.8)),
+			m_angularSleepingThreshold(btScalar(1.f)),
+			m_additionalDamping(false),
+			m_additionalDampingFactor(btScalar(0.005)),
+			m_additionalLinearDampingThresholdSqr(btScalar(0.01)),
+			m_additionalAngularDampingThresholdSqr(btScalar(0.01)),
+			m_additionalAngularDampingFactor(btScalar(0.01))
+		{
+			m_startWorldTransform.setIdentity();
+		}
+	};
+
+	///btRigidBody constructor using construction info
+	btRigidBody(	const btRigidBodyConstructionInfo& constructionInfo);
+
+	///btRigidBody constructor for backwards compatibility. 
+	///To specify friction (etc) during rigid body construction, please use the other constructor (using btRigidBodyConstructionInfo)
+	btRigidBody(	btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0));
+
+
+	virtual ~btRigidBody()
+        { 
+                //No constraints should point to this rigidbody
+		//Remove constraints from the dynamics world before you delete the related rigidbodies. 
+                btAssert(m_constraintRefs.size()==0); 
+        }
+
+protected:
+
+	///setupRigidBody is only used internally by the constructor
+	void	setupRigidBody(const btRigidBodyConstructionInfo& constructionInfo);
+
+public:
+
+	void			proceedToTransform(const btTransform& newTrans); 
+	
+	///to keep collision detection and dynamics separate we don't store a rigidbody pointer
+	///but a rigidbody is derived from btCollisionObject, so we can safely perform an upcast
+	static const btRigidBody*	upcast(const btCollisionObject* colObj)
+	{
+		if (colObj->getInternalType()&btCollisionObject::CO_RIGID_BODY)
+			return (const btRigidBody*)colObj;
+		return 0;
+	}
+	static btRigidBody*	upcast(btCollisionObject* colObj)
+	{
+		if (colObj->getInternalType()&btCollisionObject::CO_RIGID_BODY)
+			return (btRigidBody*)colObj;
+		return 0;
+	}
+	
+	/// continuous collision detection needs prediction
+	void			predictIntegratedTransform(btScalar step, btTransform& predictedTransform) ;
+	
+	void			saveKinematicState(btScalar step);
+	
+	void			applyGravity();
+	
+	void			setGravity(const btVector3& acceleration);  
+
+	const btVector3&	getGravity() const
+	{
+		return m_gravity_acceleration;
+	}
+
+	void			setDamping(btScalar lin_damping, btScalar ang_damping);
+
+	btScalar getLinearDamping() const
+	{
+		return m_linearDamping;
+	}
+
+	btScalar getAngularDamping() const
+	{
+		return m_angularDamping;
+	}
+
+	btScalar getLinearSleepingThreshold() const
+	{
+		return m_linearSleepingThreshold;
+	}
+
+	btScalar getAngularSleepingThreshold() const
+	{
+		return m_angularSleepingThreshold;
+	}
+
+	void			applyDamping(btScalar timeStep);
+
+	SIMD_FORCE_INLINE const btCollisionShape*	getCollisionShape() const {
+		return m_collisionShape;
+	}
+
+	SIMD_FORCE_INLINE btCollisionShape*	getCollisionShape() {
+			return m_collisionShape;
+	}
+	
+	void			setMassProps(btScalar mass, const btVector3& inertia);
+	
+	const btVector3& getLinearFactor() const
+	{
+		return m_linearFactor;
+	}
+	void setLinearFactor(const btVector3& linearFactor)
+	{
+		m_linearFactor = linearFactor;
+		m_invMass = m_linearFactor*m_inverseMass;
+	}
+	btScalar		getInvMass() const { return m_inverseMass; }
+	const btMatrix3x3& getInvInertiaTensorWorld() const { 
+		return m_invInertiaTensorWorld; 
+	}
+		
+	void			integrateVelocities(btScalar step);
+
+	void			setCenterOfMassTransform(const btTransform& xform);
+
+	void			applyCentralForce(const btVector3& force)
+	{
+		m_totalForce += force*m_linearFactor;
+	}
+
+	const btVector3& getTotalForce() const
+	{
+		return m_totalForce;
+	};
+
+	const btVector3& getTotalTorque() const
+	{
+		return m_totalTorque;
+	};
+    
+	const btVector3& getInvInertiaDiagLocal() const
+	{
+		return m_invInertiaLocal;
+	};
+
+	void	setInvInertiaDiagLocal(const btVector3& diagInvInertia)
+	{
+		m_invInertiaLocal = diagInvInertia;
+	}
+
+	void	setSleepingThresholds(btScalar linear,btScalar angular)
+	{
+		m_linearSleepingThreshold = linear;
+		m_angularSleepingThreshold = angular;
+	}
+
+	void	applyTorque(const btVector3& torque)
+	{
+		m_totalTorque += torque*m_angularFactor;
+	}
+	
+	void	applyForce(const btVector3& force, const btVector3& rel_pos) 
+	{
+		applyCentralForce(force);
+		applyTorque(rel_pos.cross(force*m_linearFactor));
+	}
+	
+	void applyCentralImpulse(const btVector3& impulse)
+	{
+		m_linearVelocity += impulse *m_linearFactor * m_inverseMass;
+	}
+	
+  	void applyTorqueImpulse(const btVector3& torque)
+	{
+			m_angularVelocity += m_invInertiaTensorWorld * torque * m_angularFactor;
+	}
+	
+	void applyImpulse(const btVector3& impulse, const btVector3& rel_pos) 
+	{
+		if (m_inverseMass != btScalar(0.))
+		{
+			applyCentralImpulse(impulse);
+			if (m_angularFactor)
+			{
+				applyTorqueImpulse(rel_pos.cross(impulse*m_linearFactor));
+			}
+		}
+	}
+
+	void clearForces() 
+	{
+		m_totalForce.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
+		m_totalTorque.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
+	}
+	
+	void updateInertiaTensor();    
+	
+	const btVector3&     getCenterOfMassPosition() const { 
+		return m_worldTransform.getOrigin(); 
+	}
+	btQuaternion getOrientation() const;
+	
+	const btTransform&  getCenterOfMassTransform() const { 
+		return m_worldTransform; 
+	}
+	const btVector3&   getLinearVelocity() const { 
+		return m_linearVelocity; 
+	}
+	const btVector3&    getAngularVelocity() const { 
+		return m_angularVelocity; 
+	}
+	
+
+	inline void setLinearVelocity(const btVector3& lin_vel)
+	{ 
+		m_linearVelocity = lin_vel; 
+	}
+
+	inline void setAngularVelocity(const btVector3& ang_vel) 
+	{ 
+		m_angularVelocity = ang_vel; 
+	}
+
+	btVector3 getVelocityInLocalPoint(const btVector3& rel_pos) const
+	{
+		//we also calculate lin/ang velocity for kinematic objects
+		return m_linearVelocity + m_angularVelocity.cross(rel_pos);
+
+		//for kinematic objects, we could also use use:
+		//		return 	(m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;
+	}
+
+	void translate(const btVector3& v) 
+	{
+		m_worldTransform.getOrigin() += v; 
+	}
+
+	
+	void	getAabb(btVector3& aabbMin,btVector3& aabbMax) const;
+
+
+
+
+	
+	SIMD_FORCE_INLINE btScalar computeImpulseDenominator(const btVector3& pos, const btVector3& normal) const
+	{
+		btVector3 r0 = pos - getCenterOfMassPosition();
+
+		btVector3 c0 = (r0).cross(normal);
+
+		btVector3 vec = (c0 * getInvInertiaTensorWorld()).cross(r0);
+
+		return m_inverseMass + normal.dot(vec);
+
+	}
+
+	SIMD_FORCE_INLINE btScalar computeAngularImpulseDenominator(const btVector3& axis) const
+	{
+		btVector3 vec = axis * getInvInertiaTensorWorld();
+		return axis.dot(vec);
+	}
+
+	SIMD_FORCE_INLINE void	updateDeactivation(btScalar timeStep)
+	{
+		if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == DISABLE_DEACTIVATION))
+			return;
+
+		if ((getLinearVelocity().length2() < m_linearSleepingThreshold*m_linearSleepingThreshold) &&
+			(getAngularVelocity().length2() < m_angularSleepingThreshold*m_angularSleepingThreshold))
+		{
+			m_deactivationTime += timeStep;
+		} else
+		{
+			m_deactivationTime=btScalar(0.);
+			setActivationState(0);
+		}
+
+	}
+
+	SIMD_FORCE_INLINE bool	wantsSleeping()
+	{
+
+		if (getActivationState() == DISABLE_DEACTIVATION)
+			return false;
+
+		//disable deactivation
+		if (gDisableDeactivation || (gDeactivationTime == btScalar(0.)))
+			return false;
+
+		if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == WANTS_DEACTIVATION))
+			return true;
+
+		if (m_deactivationTime> gDeactivationTime)
+		{
+			return true;
+		}
+		return false;
+	}
+
+
+	
+	const btBroadphaseProxy*	getBroadphaseProxy() const
+	{
+		return m_broadphaseHandle;
+	}
+	btBroadphaseProxy*	getBroadphaseProxy() 
+	{
+		return m_broadphaseHandle;
+	}
+	void	setNewBroadphaseProxy(btBroadphaseProxy* broadphaseProxy)
+	{
+		m_broadphaseHandle = broadphaseProxy;
+	}
+
+	//btMotionState allows to automatic synchronize the world transform for active objects
+	btMotionState*	getMotionState()
+	{
+		return m_optionalMotionState;
+	}
+	const btMotionState*	getMotionState() const
+	{
+		return m_optionalMotionState;
+	}
+	void	setMotionState(btMotionState* motionState)
+	{
+		m_optionalMotionState = motionState;
+		if (m_optionalMotionState)
+			motionState->getWorldTransform(m_worldTransform);
+	}
+
+	//for experimental overriding of friction/contact solver func
+	int	m_contactSolverType;
+	int	m_frictionSolverType;
+
+	void	setAngularFactor(const btVector3& angFac)
+	{
+		m_angularFactor = angFac;
+	}
+
+	void	setAngularFactor(btScalar angFac)
+	{
+		m_angularFactor.setValue(angFac,angFac,angFac);
+	}
+	const btVector3&	getAngularFactor() const
+	{
+		return m_angularFactor;
+	}
+
+	//is this rigidbody added to a btCollisionWorld/btDynamicsWorld/btBroadphase?
+	bool	isInWorld() const
+	{
+		return (getBroadphaseProxy() != 0);
+	}
+
+	virtual bool checkCollideWithOverride(btCollisionObject* co);
+
+	void addConstraintRef(btTypedConstraint* c);
+	void removeConstraintRef(btTypedConstraint* c);
+
+	btTypedConstraint* getConstraintRef(int index)
+	{
+		return m_constraintRefs[index];
+	}
+
+	int getNumConstraintRefs() const
+	{
+		return m_constraintRefs.size();
+	}
+
+	void	setFlags(int flags)
+	{
+		m_rigidbodyFlags = flags;
+	}
+
+	int getFlags() const
+	{
+		return m_rigidbodyFlags;
+	}
+
+	const btVector3& getDeltaLinearVelocity() const
+	{
+		return m_deltaLinearVelocity;
+	}
+
+	const btVector3& getDeltaAngularVelocity() const
+	{
+		return m_deltaAngularVelocity;
+	}
+
+	const btVector3& getPushVelocity() const 
+	{
+		return m_pushVelocity;
+	}
+
+	const btVector3& getTurnVelocity() const 
+	{
+		return m_turnVelocity;
+	}
+
+
+	////////////////////////////////////////////////
+	///some internal methods, don't use them
+		
+	btVector3& internalGetDeltaLinearVelocity()
+	{
+		return m_deltaLinearVelocity;
+	}
+
+	btVector3& internalGetDeltaAngularVelocity()
+	{
+		return m_deltaAngularVelocity;
+	}
+
+	const btVector3& internalGetAngularFactor() const
+	{
+		return m_angularFactor;
+	}
+
+	const btVector3& internalGetInvMass() const
+	{
+		return m_invMass;
+	}
+	
+	btVector3& internalGetPushVelocity()
+	{
+		return m_pushVelocity;
+	}
+
+	btVector3& internalGetTurnVelocity()
+	{
+		return m_turnVelocity;
+	}
+
+	SIMD_FORCE_INLINE void	internalGetVelocityInLocalPointObsolete(const btVector3& rel_pos, btVector3& velocity ) const
+	{
+		velocity = getLinearVelocity()+m_deltaLinearVelocity + (getAngularVelocity()+m_deltaAngularVelocity).cross(rel_pos);
+	}
+
+	SIMD_FORCE_INLINE void	internalGetAngularVelocity(btVector3& angVel) const
+	{
+		angVel = getAngularVelocity()+m_deltaAngularVelocity;
+	}
+
+
+	//Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
+	SIMD_FORCE_INLINE void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,const btScalar impulseMagnitude)
+	{
+		if (m_inverseMass)
+		{
+			m_deltaLinearVelocity += linearComponent*impulseMagnitude;
+			m_deltaAngularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
+		}
+	}
+
+	SIMD_FORCE_INLINE void internalApplyPushImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude)
+	{
+		if (m_inverseMass)
+		{
+			m_pushVelocity += linearComponent*impulseMagnitude;
+			m_turnVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
+		}
+	}
+	
+	void	internalWritebackVelocity()
+	{
+		if (m_inverseMass)
+		{
+			setLinearVelocity(getLinearVelocity()+ m_deltaLinearVelocity);
+			setAngularVelocity(getAngularVelocity()+m_deltaAngularVelocity);
+			//m_deltaLinearVelocity.setZero();
+			//m_deltaAngularVelocity .setZero();
+			//m_originalBody->setCompanionId(-1);
+		}
+	}
+
+
+	void	internalWritebackVelocity(btScalar timeStep);
+
+	
+
+	///////////////////////////////////////////////
+
+	virtual	int	calculateSerializeBufferSize()	const;
+
+	///fills the dataBuffer and returns the struct name (and 0 on failure)
+	virtual	const char*	serialize(void* dataBuffer,  class btSerializer* serializer) const;
+
+	virtual void serializeSingleObject(class btSerializer* serializer) const;
+
+};
+
+//@todo add m_optionalMotionState and m_constraintRefs to btRigidBodyData
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btRigidBodyFloatData
+{
+	btCollisionObjectFloatData	m_collisionObjectData;
+	btMatrix3x3FloatData		m_invInertiaTensorWorld;
+	btVector3FloatData		m_linearVelocity;
+	btVector3FloatData		m_angularVelocity;
+	btVector3FloatData		m_angularFactor;
+	btVector3FloatData		m_linearFactor;
+	btVector3FloatData		m_gravity;	
+	btVector3FloatData		m_gravity_acceleration;
+	btVector3FloatData		m_invInertiaLocal;
+	btVector3FloatData		m_totalForce;
+	btVector3FloatData		m_totalTorque;
+	float					m_inverseMass;
+	float					m_linearDamping;
+	float					m_angularDamping;
+	float					m_additionalDampingFactor;
+	float					m_additionalLinearDampingThresholdSqr;
+	float					m_additionalAngularDampingThresholdSqr;
+	float					m_additionalAngularDampingFactor;
+	float					m_linearSleepingThreshold;
+	float					m_angularSleepingThreshold;
+	int						m_additionalDamping;
+};
+
+///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
+struct	btRigidBodyDoubleData
+{
+	btCollisionObjectDoubleData	m_collisionObjectData;
+	btMatrix3x3DoubleData		m_invInertiaTensorWorld;
+	btVector3DoubleData		m_linearVelocity;
+	btVector3DoubleData		m_angularVelocity;
+	btVector3DoubleData		m_angularFactor;
+	btVector3DoubleData		m_linearFactor;
+	btVector3DoubleData		m_gravity;	
+	btVector3DoubleData		m_gravity_acceleration;
+	btVector3DoubleData		m_invInertiaLocal;
+	btVector3DoubleData		m_totalForce;
+	btVector3DoubleData		m_totalTorque;
+	double					m_inverseMass;
+	double					m_linearDamping;
+	double					m_angularDamping;
+	double					m_additionalDampingFactor;
+	double					m_additionalLinearDampingThresholdSqr;
+	double					m_additionalAngularDampingThresholdSqr;
+	double					m_additionalAngularDampingFactor;
+	double					m_linearSleepingThreshold;
+	double					m_angularSleepingThreshold;
+	int						m_additionalDamping;
+	char	m_padding[4];
+};
+
+
+
+#endif //BT_RIGIDBODY_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp b/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
new file mode 100644
index 0000000..5fc2f3c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
@@ -0,0 +1,280 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btSimpleDynamicsWorld.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
+#include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h"
+
+
+/*
+  Make sure this dummy function never changes so that it
+  can be used by probes that are checking whether the
+  library is actually installed.
+*/
+extern "C" 
+{
+	void btBulletDynamicsProbe ();
+	void btBulletDynamicsProbe () {}
+}
+
+
+
+
+btSimpleDynamicsWorld::btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration)
+:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration),
+m_constraintSolver(constraintSolver),
+m_ownsConstraintSolver(false),
+m_gravity(0,0,-10)
+{
+
+}
+
+
+btSimpleDynamicsWorld::~btSimpleDynamicsWorld()
+{
+	if (m_ownsConstraintSolver)
+		btAlignedFree( m_constraintSolver);
+}
+
+int		btSimpleDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep)
+{
+	(void)fixedTimeStep;
+	(void)maxSubSteps;
+
+
+	///apply gravity, predict motion
+	predictUnconstraintMotion(timeStep);
+
+	btDispatcherInfo&	dispatchInfo = getDispatchInfo();
+	dispatchInfo.m_timeStep = timeStep;
+	dispatchInfo.m_stepCount = 0;
+	dispatchInfo.m_debugDraw = getDebugDrawer();
+
+	///perform collision detection
+	performDiscreteCollisionDetection();
+
+	///solve contact constraints
+	int numManifolds = m_dispatcher1->getNumManifolds();
+	if (numManifolds)
+	{
+		btPersistentManifold** manifoldPtr = ((btCollisionDispatcher*)m_dispatcher1)->getInternalManifoldPointer();
+		
+		btContactSolverInfo infoGlobal;
+		infoGlobal.m_timeStep = timeStep;
+		m_constraintSolver->prepareSolve(0,numManifolds);
+		m_constraintSolver->solveGroup(&getCollisionObjectArray()[0],getNumCollisionObjects(),manifoldPtr, numManifolds,0,0,infoGlobal,m_debugDrawer, m_stackAlloc,m_dispatcher1);
+		m_constraintSolver->allSolved(infoGlobal,m_debugDrawer, m_stackAlloc);
+	}
+
+	///integrate transforms
+	integrateTransforms(timeStep);
+		
+	updateAabbs();
+
+	synchronizeMotionStates();
+
+	clearForces();
+
+	return 1;
+
+}
+
+void	btSimpleDynamicsWorld::clearForces()
+{
+	///@todo: iterate over awake simulation islands!
+	for ( int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		
+		btRigidBody* body = btRigidBody::upcast(colObj);
+		if (body)
+		{
+			body->clearForces();
+		}
+	}
+}	
+
+
+void	btSimpleDynamicsWorld::setGravity(const btVector3& gravity)
+{
+	m_gravity = gravity;
+	for ( int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		btRigidBody* body = btRigidBody::upcast(colObj);
+		if (body)
+		{
+			body->setGravity(gravity);
+		}
+	}
+}
+
+btVector3 btSimpleDynamicsWorld::getGravity () const
+{
+	return m_gravity;
+}
+
+void	btSimpleDynamicsWorld::removeRigidBody(btRigidBody* body)
+{
+	btCollisionWorld::removeCollisionObject(body);
+}
+
+void	btSimpleDynamicsWorld::removeCollisionObject(btCollisionObject* collisionObject)
+{
+	btRigidBody* body = btRigidBody::upcast(collisionObject);
+	if (body)
+		removeRigidBody(body);
+	else
+		btCollisionWorld::removeCollisionObject(collisionObject);
+}
+
+
+void	btSimpleDynamicsWorld::addRigidBody(btRigidBody* body)
+{
+	body->setGravity(m_gravity);
+
+	if (body->getCollisionShape())
+	{
+		addCollisionObject(body);
+	}
+}
+
+void	btSimpleDynamicsWorld::addRigidBody(btRigidBody* body, short group, short mask)
+{
+	body->setGravity(m_gravity);
+
+	if (body->getCollisionShape())
+	{
+		addCollisionObject(body,group,mask);
+	}
+}
+
+
+void	btSimpleDynamicsWorld::debugDrawWorld()
+{
+
+}
+				
+void	btSimpleDynamicsWorld::addAction(btActionInterface* action)
+{
+
+}
+
+void	btSimpleDynamicsWorld::removeAction(btActionInterface* action)
+{
+
+}
+
+
+void	btSimpleDynamicsWorld::updateAabbs()
+{
+	btTransform predictedTrans;
+	for ( int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		btRigidBody* body = btRigidBody::upcast(colObj);
+		if (body)
+		{
+			if (body->isActive() && (!body->isStaticObject()))
+			{
+				btVector3 minAabb,maxAabb;
+				colObj->getCollisionShape()->getAabb(colObj->getWorldTransform(), minAabb,maxAabb);
+				btBroadphaseInterface* bp = getBroadphase();
+				bp->setAabb(body->getBroadphaseHandle(),minAabb,maxAabb, m_dispatcher1);
+			}
+		}
+	}
+}
+
+void	btSimpleDynamicsWorld::integrateTransforms(btScalar timeStep)
+{
+	btTransform predictedTrans;
+	for ( int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		btRigidBody* body = btRigidBody::upcast(colObj);
+		if (body)
+		{
+			if (body->isActive() && (!body->isStaticObject()))
+			{
+				body->predictIntegratedTransform(timeStep, predictedTrans);
+				body->proceedToTransform( predictedTrans);
+			}
+		}
+	}
+}
+
+
+
+void	btSimpleDynamicsWorld::predictUnconstraintMotion(btScalar timeStep)
+{
+	for ( int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		btRigidBody* body = btRigidBody::upcast(colObj);
+		if (body)
+		{
+			if (!body->isStaticObject())
+			{
+				if (body->isActive())
+				{
+					body->applyGravity();
+					body->integrateVelocities( timeStep);
+					body->applyDamping(timeStep);
+					body->predictIntegratedTransform(timeStep,body->getInterpolationWorldTransform());
+				}
+			}
+		}
+	}
+}
+
+
+void	btSimpleDynamicsWorld::synchronizeMotionStates()
+{
+	///@todo: iterate over awake simulation islands!
+	for ( int i=0;i<m_collisionObjects.size();i++)
+	{
+		btCollisionObject* colObj = m_collisionObjects[i];
+		btRigidBody* body = btRigidBody::upcast(colObj);
+		if (body && body->getMotionState())
+		{
+			if (body->getActivationState() != ISLAND_SLEEPING)
+			{
+				body->getMotionState()->setWorldTransform(body->getWorldTransform());
+			}
+		}
+	}
+
+}
+
+
+void	btSimpleDynamicsWorld::setConstraintSolver(btConstraintSolver* solver)
+{
+	if (m_ownsConstraintSolver)
+	{
+		btAlignedFree(m_constraintSolver);
+	}
+	m_ownsConstraintSolver = false;
+	m_constraintSolver = solver;
+}
+
+btConstraintSolver* btSimpleDynamicsWorld::getConstraintSolver()
+{
+	return m_constraintSolver;
+}
diff --git a/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h b/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h
new file mode 100644
index 0000000..07a727e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h
@@ -0,0 +1,89 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SIMPLE_DYNAMICS_WORLD_H
+#define BT_SIMPLE_DYNAMICS_WORLD_H
+
+#include "btDynamicsWorld.h"
+
+class btDispatcher;
+class btOverlappingPairCache;
+class btConstraintSolver;
+
+///The btSimpleDynamicsWorld serves as unit-test and to verify more complicated and optimized dynamics worlds.
+///Please use btDiscreteDynamicsWorld instead (or btContinuousDynamicsWorld once it is finished).
+class btSimpleDynamicsWorld : public btDynamicsWorld
+{
+protected:
+
+	btConstraintSolver*	m_constraintSolver;
+
+	bool	m_ownsConstraintSolver;
+
+	void	predictUnconstraintMotion(btScalar timeStep);
+	
+	void	integrateTransforms(btScalar timeStep);
+		
+	btVector3	m_gravity;
+	
+public:
+
+
+
+	///this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver
+	btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
+
+	virtual ~btSimpleDynamicsWorld();
+		
+	///maxSubSteps/fixedTimeStep for interpolation is currently ignored for btSimpleDynamicsWorld, use btDiscreteDynamicsWorld instead
+	virtual int	stepSimulation( btScalar timeStep,int maxSubSteps=1, btScalar fixedTimeStep=btScalar(1.)/btScalar(60.));
+
+	virtual void	setGravity(const btVector3& gravity);
+
+	virtual btVector3 getGravity () const;
+
+	virtual void	addRigidBody(btRigidBody* body);
+
+	virtual void	addRigidBody(btRigidBody* body, short group, short mask);
+
+	virtual void	removeRigidBody(btRigidBody* body);
+
+	virtual void	debugDrawWorld();
+				
+	virtual void	addAction(btActionInterface* action);
+
+	virtual void	removeAction(btActionInterface* action);
+
+	///removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btCollisionWorld::removeCollisionObject
+	virtual void	removeCollisionObject(btCollisionObject* collisionObject);
+	
+	virtual void	updateAabbs();
+
+	virtual void	synchronizeMotionStates();
+
+	virtual void	setConstraintSolver(btConstraintSolver* solver);
+
+	virtual btConstraintSolver* getConstraintSolver();
+
+	virtual btDynamicsWorldType	getWorldType() const
+	{
+		return BT_SIMPLE_DYNAMICS_WORLD;
+	}
+
+	virtual void	clearForces();
+
+};
+
+#endif //BT_SIMPLE_DYNAMICS_WORLD_H
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp b/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp
new file mode 100644
index 0000000..5b46788
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp
@@ -0,0 +1,771 @@
+/*
+ * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies.
+ * Erwin Coumans makes no representations about the suitability 
+ * of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+*/
+
+#include "LinearMath/btVector3.h"
+#include "btRaycastVehicle.h"
+
+#include "BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btJacobianEntry.h"
+#include "LinearMath/btQuaternion.h"
+#include "BulletDynamics/Dynamics/btDynamicsWorld.h"
+#include "btVehicleRaycaster.h"
+#include "btWheelInfo.h"
+#include "LinearMath/btMinMax.h"
+#include "LinearMath/btIDebugDraw.h"
+#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
+
+#define ROLLING_INFLUENCE_FIX
+
+
+btRigidBody& btActionInterface::getFixedBody()
+{
+	static btRigidBody s_fixed(0, 0,0);
+	s_fixed.setMassProps(btScalar(0.),btVector3(btScalar(0.),btScalar(0.),btScalar(0.)));
+	return s_fixed;
+}
+
+btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis,	btVehicleRaycaster* raycaster )
+:m_vehicleRaycaster(raycaster),
+m_pitchControl(btScalar(0.))
+{
+	m_chassisBody = chassis;
+	m_indexRightAxis = 0;
+	m_indexUpAxis = 2;
+	m_indexForwardAxis = 1;
+	defaultInit(tuning);
+}
+
+
+void btRaycastVehicle::defaultInit(const btVehicleTuning& tuning)
+{
+	(void)tuning;
+	m_currentVehicleSpeedKmHour = btScalar(0.);
+	m_steeringValue = btScalar(0.);
+	
+}
+
+	
+
+btRaycastVehicle::~btRaycastVehicle()
+{
+}
+
+
+//
+// basically most of the code is general for 2 or 4 wheel vehicles, but some of it needs to be reviewed
+//
+btWheelInfo&	btRaycastVehicle::addWheel( const btVector3& connectionPointCS, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS, btScalar suspensionRestLength, btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel)
+{
+
+	btWheelInfoConstructionInfo ci;
+
+	ci.m_chassisConnectionCS = connectionPointCS;
+	ci.m_wheelDirectionCS = wheelDirectionCS0;
+	ci.m_wheelAxleCS = wheelAxleCS;
+	ci.m_suspensionRestLength = suspensionRestLength;
+	ci.m_wheelRadius = wheelRadius;
+	ci.m_suspensionStiffness = tuning.m_suspensionStiffness;
+	ci.m_wheelsDampingCompression = tuning.m_suspensionCompression;
+	ci.m_wheelsDampingRelaxation = tuning.m_suspensionDamping;
+	ci.m_frictionSlip = tuning.m_frictionSlip;
+	ci.m_bIsFrontWheel = isFrontWheel;
+	ci.m_maxSuspensionTravelCm = tuning.m_maxSuspensionTravelCm;
+	ci.m_maxSuspensionForce = tuning.m_maxSuspensionForce;
+
+	m_wheelInfo.push_back( btWheelInfo(ci));
+	
+	btWheelInfo& wheel = m_wheelInfo[getNumWheels()-1];
+	
+	updateWheelTransformsWS( wheel , false );
+	updateWheelTransform(getNumWheels()-1,false);
+	return wheel;
+}
+
+
+
+
+const btTransform&	btRaycastVehicle::getWheelTransformWS( int wheelIndex ) const
+{
+	btAssert(wheelIndex < getNumWheels());
+	const btWheelInfo& wheel = m_wheelInfo[wheelIndex];
+	return wheel.m_worldTransform;
+
+}
+
+void	btRaycastVehicle::updateWheelTransform( int wheelIndex , bool interpolatedTransform)
+{
+	
+	btWheelInfo& wheel = m_wheelInfo[ wheelIndex ];
+	updateWheelTransformsWS(wheel,interpolatedTransform);
+	btVector3 up = -wheel.m_raycastInfo.m_wheelDirectionWS;
+	const btVector3& right = wheel.m_raycastInfo.m_wheelAxleWS;
+	btVector3 fwd = up.cross(right);
+	fwd = fwd.normalize();
+//	up = right.cross(fwd);
+//	up.normalize();
+
+	//rotate around steering over de wheelAxleWS
+	btScalar steering = wheel.m_steering;
+	
+	btQuaternion steeringOrn(up,steering);//wheel.m_steering);
+	btMatrix3x3 steeringMat(steeringOrn);
+
+	btQuaternion rotatingOrn(right,-wheel.m_rotation);
+	btMatrix3x3 rotatingMat(rotatingOrn);
+
+	btMatrix3x3 basis2(
+		right[0],fwd[0],up[0],
+		right[1],fwd[1],up[1],
+		right[2],fwd[2],up[2]
+	);
+	
+	wheel.m_worldTransform.setBasis(steeringMat * rotatingMat * basis2);
+	wheel.m_worldTransform.setOrigin(
+		wheel.m_raycastInfo.m_hardPointWS + wheel.m_raycastInfo.m_wheelDirectionWS * wheel.m_raycastInfo.m_suspensionLength
+	);
+}
+
+void btRaycastVehicle::resetSuspension()
+{
+
+	int i;
+	for (i=0;i<m_wheelInfo.size();	i++)
+	{
+			btWheelInfo& wheel = m_wheelInfo[i];
+			wheel.m_raycastInfo.m_suspensionLength = wheel.getSuspensionRestLength();
+			wheel.m_suspensionRelativeVelocity = btScalar(0.0);
+			
+			wheel.m_raycastInfo.m_contactNormalWS = - wheel.m_raycastInfo.m_wheelDirectionWS;
+			//wheel_info.setContactFriction(btScalar(0.0));
+			wheel.m_clippedInvContactDotSuspension = btScalar(1.0);
+	}
+}
+
+void	btRaycastVehicle::updateWheelTransformsWS(btWheelInfo& wheel , bool interpolatedTransform)
+{
+	wheel.m_raycastInfo.m_isInContact = false;
+
+	btTransform chassisTrans = getChassisWorldTransform();
+	if (interpolatedTransform && (getRigidBody()->getMotionState()))
+	{
+		getRigidBody()->getMotionState()->getWorldTransform(chassisTrans);
+	}
+
+	wheel.m_raycastInfo.m_hardPointWS = chassisTrans( wheel.m_chassisConnectionPointCS );
+	wheel.m_raycastInfo.m_wheelDirectionWS = chassisTrans.getBasis() *  wheel.m_wheelDirectionCS ;
+	wheel.m_raycastInfo.m_wheelAxleWS = chassisTrans.getBasis() * wheel.m_wheelAxleCS;
+}
+
+btScalar btRaycastVehicle::rayCast(btWheelInfo& wheel)
+{
+	updateWheelTransformsWS( wheel,false);
+
+	
+	btScalar depth = -1;
+	
+	btScalar raylen = wheel.getSuspensionRestLength()+wheel.m_wheelsRadius;
+
+	btVector3 rayvector = wheel.m_raycastInfo.m_wheelDirectionWS * (raylen);
+	const btVector3& source = wheel.m_raycastInfo.m_hardPointWS;
+	wheel.m_raycastInfo.m_contactPointWS = source + rayvector;
+	const btVector3& target = wheel.m_raycastInfo.m_contactPointWS;
+
+	btScalar param = btScalar(0.);
+	
+	btVehicleRaycaster::btVehicleRaycasterResult	rayResults;
+
+	btAssert(m_vehicleRaycaster);
+
+	void* object = m_vehicleRaycaster->castRay(source,target,rayResults);
+
+	wheel.m_raycastInfo.m_groundObject = 0;
+
+	if (object)
+	{
+		param = rayResults.m_distFraction;
+		depth = raylen * rayResults.m_distFraction;
+		wheel.m_raycastInfo.m_contactNormalWS  = rayResults.m_hitNormalInWorld;
+		wheel.m_raycastInfo.m_isInContact = true;
+		
+		wheel.m_raycastInfo.m_groundObject = &getFixedBody();///@todo for driving on dynamic/movable objects!;
+		//wheel.m_raycastInfo.m_groundObject = object;
+
+
+		btScalar hitDistance = param*raylen;
+		wheel.m_raycastInfo.m_suspensionLength = hitDistance - wheel.m_wheelsRadius;
+		//clamp on max suspension travel
+
+		btScalar  minSuspensionLength = wheel.getSuspensionRestLength() - wheel.m_maxSuspensionTravelCm*btScalar(0.01);
+		btScalar maxSuspensionLength = wheel.getSuspensionRestLength()+ wheel.m_maxSuspensionTravelCm*btScalar(0.01);
+		if (wheel.m_raycastInfo.m_suspensionLength < minSuspensionLength)
+		{
+			wheel.m_raycastInfo.m_suspensionLength = minSuspensionLength;
+		}
+		if (wheel.m_raycastInfo.m_suspensionLength > maxSuspensionLength)
+		{
+			wheel.m_raycastInfo.m_suspensionLength = maxSuspensionLength;
+		}
+
+		wheel.m_raycastInfo.m_contactPointWS = rayResults.m_hitPointInWorld;
+
+		btScalar denominator= wheel.m_raycastInfo.m_contactNormalWS.dot( wheel.m_raycastInfo.m_wheelDirectionWS );
+
+		btVector3 chassis_velocity_at_contactPoint;
+		btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS-getRigidBody()->getCenterOfMassPosition();
+
+		chassis_velocity_at_contactPoint = getRigidBody()->getVelocityInLocalPoint(relpos);
+
+		btScalar projVel = wheel.m_raycastInfo.m_contactNormalWS.dot( chassis_velocity_at_contactPoint );
+
+		if ( denominator >= btScalar(-0.1))
+		{
+			wheel.m_suspensionRelativeVelocity = btScalar(0.0);
+			wheel.m_clippedInvContactDotSuspension = btScalar(1.0) / btScalar(0.1);
+		}
+		else
+		{
+			btScalar inv = btScalar(-1.) / denominator;
+			wheel.m_suspensionRelativeVelocity = projVel * inv;
+			wheel.m_clippedInvContactDotSuspension = inv;
+		}
+			
+	} else
+	{
+		//put wheel info as in rest position
+		wheel.m_raycastInfo.m_suspensionLength = wheel.getSuspensionRestLength();
+		wheel.m_suspensionRelativeVelocity = btScalar(0.0);
+		wheel.m_raycastInfo.m_contactNormalWS = - wheel.m_raycastInfo.m_wheelDirectionWS;
+		wheel.m_clippedInvContactDotSuspension = btScalar(1.0);
+	}
+
+	return depth;
+}
+
+
+const btTransform& btRaycastVehicle::getChassisWorldTransform() const
+{
+	/*if (getRigidBody()->getMotionState())
+	{
+		btTransform chassisWorldTrans;
+		getRigidBody()->getMotionState()->getWorldTransform(chassisWorldTrans);
+		return chassisWorldTrans;
+	}
+	*/
+
+	
+	return getRigidBody()->getCenterOfMassTransform();
+}
+
+
+void btRaycastVehicle::updateVehicle( btScalar step )
+{
+	{
+		for (int i=0;i<getNumWheels();i++)
+		{
+			updateWheelTransform(i,false);
+		}
+	}
+
+
+	m_currentVehicleSpeedKmHour = btScalar(3.6) * getRigidBody()->getLinearVelocity().length();
+	
+	const btTransform& chassisTrans = getChassisWorldTransform();
+
+	btVector3 forwardW (
+		chassisTrans.getBasis()[0][m_indexForwardAxis],
+		chassisTrans.getBasis()[1][m_indexForwardAxis],
+		chassisTrans.getBasis()[2][m_indexForwardAxis]);
+
+	if (forwardW.dot(getRigidBody()->getLinearVelocity()) < btScalar(0.))
+	{
+		m_currentVehicleSpeedKmHour *= btScalar(-1.);
+	}
+
+	//
+	// simulate suspension
+	//
+	
+	int i=0;
+	for (i=0;i<m_wheelInfo.size();i++)
+	{
+		btScalar depth; 
+		depth = rayCast( m_wheelInfo[i]);
+	}
+
+	updateSuspension(step);
+
+	
+	for (i=0;i<m_wheelInfo.size();i++)
+	{
+		//apply suspension force
+		btWheelInfo& wheel = m_wheelInfo[i];
+		
+		btScalar suspensionForce = wheel.m_wheelsSuspensionForce;
+		
+		if (suspensionForce > wheel.m_maxSuspensionForce)
+		{
+			suspensionForce = wheel.m_maxSuspensionForce;
+		}
+		btVector3 impulse = wheel.m_raycastInfo.m_contactNormalWS * suspensionForce * step;
+		btVector3 relpos = wheel.m_raycastInfo.m_contactPointWS - getRigidBody()->getCenterOfMassPosition();
+		
+		getRigidBody()->applyImpulse(impulse, relpos);
+	
+	}
+	
+
+	
+	updateFriction( step);
+
+	
+	for (i=0;i<m_wheelInfo.size();i++)
+	{
+		btWheelInfo& wheel = m_wheelInfo[i];
+		btVector3 relpos = wheel.m_raycastInfo.m_hardPointWS - getRigidBody()->getCenterOfMassPosition();
+		btVector3 vel = getRigidBody()->getVelocityInLocalPoint( relpos );
+
+		if (wheel.m_raycastInfo.m_isInContact)
+		{
+			const btTransform&	chassisWorldTransform = getChassisWorldTransform();
+
+			btVector3 fwd (
+				chassisWorldTransform.getBasis()[0][m_indexForwardAxis],
+				chassisWorldTransform.getBasis()[1][m_indexForwardAxis],
+				chassisWorldTransform.getBasis()[2][m_indexForwardAxis]);
+
+			btScalar proj = fwd.dot(wheel.m_raycastInfo.m_contactNormalWS);
+			fwd -= wheel.m_raycastInfo.m_contactNormalWS * proj;
+
+			btScalar proj2 = fwd.dot(vel);
+			
+			wheel.m_deltaRotation = (proj2 * step) / (wheel.m_wheelsRadius);
+			wheel.m_rotation += wheel.m_deltaRotation;
+
+		} else
+		{
+			wheel.m_rotation += wheel.m_deltaRotation;
+		}
+		
+		wheel.m_deltaRotation *= btScalar(0.99);//damping of rotation when not in contact
+
+	}
+
+
+
+}
+
+
+void	btRaycastVehicle::setSteeringValue(btScalar steering,int wheel)
+{
+	btAssert(wheel>=0 && wheel < getNumWheels());
+
+	btWheelInfo& wheelInfo = getWheelInfo(wheel);
+	wheelInfo.m_steering = steering;
+}
+
+
+
+btScalar	btRaycastVehicle::getSteeringValue(int wheel) const
+{
+	return getWheelInfo(wheel).m_steering;
+}
+
+
+void	btRaycastVehicle::applyEngineForce(btScalar force, int wheel)
+{
+	btAssert(wheel>=0 && wheel < getNumWheels());
+	btWheelInfo& wheelInfo = getWheelInfo(wheel);
+	wheelInfo.m_engineForce = force;
+}
+
+
+const btWheelInfo&	btRaycastVehicle::getWheelInfo(int index) const
+{
+	btAssert((index >= 0) && (index < 	getNumWheels()));
+	
+	return m_wheelInfo[index];
+}
+
+btWheelInfo&	btRaycastVehicle::getWheelInfo(int index) 
+{
+	btAssert((index >= 0) && (index < 	getNumWheels()));
+	
+	return m_wheelInfo[index];
+}
+
+void btRaycastVehicle::setBrake(btScalar brake,int wheelIndex)
+{
+	btAssert((wheelIndex >= 0) && (wheelIndex < 	getNumWheels()));
+	getWheelInfo(wheelIndex).m_brake = brake;
+}
+
+
+void	btRaycastVehicle::updateSuspension(btScalar deltaTime)
+{
+	(void)deltaTime;
+
+	btScalar chassisMass = btScalar(1.) / m_chassisBody->getInvMass();
+	
+	for (int w_it=0; w_it<getNumWheels(); w_it++)
+	{
+		btWheelInfo &wheel_info = m_wheelInfo[w_it];
+		
+		if ( wheel_info.m_raycastInfo.m_isInContact )
+		{
+			btScalar force;
+			//	Spring
+			{
+				btScalar	susp_length			= wheel_info.getSuspensionRestLength();
+				btScalar	current_length = wheel_info.m_raycastInfo.m_suspensionLength;
+
+				btScalar length_diff = (susp_length - current_length);
+
+				force = wheel_info.m_suspensionStiffness
+					* length_diff * wheel_info.m_clippedInvContactDotSuspension;
+			}
+		
+			// Damper
+			{
+				btScalar projected_rel_vel = wheel_info.m_suspensionRelativeVelocity;
+				{
+					btScalar	susp_damping;
+					if ( projected_rel_vel < btScalar(0.0) )
+					{
+						susp_damping = wheel_info.m_wheelsDampingCompression;
+					}
+					else
+					{
+						susp_damping = wheel_info.m_wheelsDampingRelaxation;
+					}
+					force -= susp_damping * projected_rel_vel;
+				}
+			}
+
+			// RESULT
+			wheel_info.m_wheelsSuspensionForce = force * chassisMass;
+			if (wheel_info.m_wheelsSuspensionForce < btScalar(0.))
+			{
+				wheel_info.m_wheelsSuspensionForce = btScalar(0.);
+			}
+		}
+		else
+		{
+			wheel_info.m_wheelsSuspensionForce = btScalar(0.0);
+		}
+	}
+
+}
+
+
+struct btWheelContactPoint
+{
+	btRigidBody* m_body0;
+	btRigidBody* m_body1;
+	btVector3	m_frictionPositionWorld;
+	btVector3	m_frictionDirectionWorld;
+	btScalar	m_jacDiagABInv;
+	btScalar	m_maxImpulse;
+
+
+	btWheelContactPoint(btRigidBody* body0,btRigidBody* body1,const btVector3& frictionPosWorld,const btVector3& frictionDirectionWorld, btScalar maxImpulse)
+		:m_body0(body0),
+		m_body1(body1),
+		m_frictionPositionWorld(frictionPosWorld),
+		m_frictionDirectionWorld(frictionDirectionWorld),
+		m_maxImpulse(maxImpulse)
+	{
+		btScalar denom0 = body0->computeImpulseDenominator(frictionPosWorld,frictionDirectionWorld);
+		btScalar denom1 = body1->computeImpulseDenominator(frictionPosWorld,frictionDirectionWorld);
+		btScalar	relaxation = 1.f;
+		m_jacDiagABInv = relaxation/(denom0+denom1);
+	}
+
+
+
+};
+
+btScalar calcRollingFriction(btWheelContactPoint& contactPoint);
+btScalar calcRollingFriction(btWheelContactPoint& contactPoint)
+{
+
+	btScalar j1=0.f;
+
+	const btVector3& contactPosWorld = contactPoint.m_frictionPositionWorld;
+
+	btVector3 rel_pos1 = contactPosWorld - contactPoint.m_body0->getCenterOfMassPosition(); 
+	btVector3 rel_pos2 = contactPosWorld - contactPoint.m_body1->getCenterOfMassPosition();
+	
+	btScalar maxImpulse  = contactPoint.m_maxImpulse;
+	
+	btVector3 vel1 = contactPoint.m_body0->getVelocityInLocalPoint(rel_pos1);
+	btVector3 vel2 = contactPoint.m_body1->getVelocityInLocalPoint(rel_pos2);
+	btVector3 vel = vel1 - vel2;
+
+	btScalar vrel = contactPoint.m_frictionDirectionWorld.dot(vel);
+
+	// calculate j that moves us to zero relative velocity
+	j1 = -vrel * contactPoint.m_jacDiagABInv;
+	btSetMin(j1, maxImpulse);
+	btSetMax(j1, -maxImpulse);
+
+	return j1;
+}
+
+
+
+
+btScalar sideFrictionStiffness2 = btScalar(1.0);
+void	btRaycastVehicle::updateFriction(btScalar	timeStep)
+{
+
+		//calculate the impulse, so that the wheels don't move sidewards
+		int numWheel = getNumWheels();
+		if (!numWheel)
+			return;
+
+		m_forwardWS.resize(numWheel);
+		m_axle.resize(numWheel);
+		m_forwardImpulse.resize(numWheel);
+		m_sideImpulse.resize(numWheel);
+		
+		int numWheelsOnGround = 0;
+	
+
+		//collapse all those loops into one!
+		for (int i=0;i<getNumWheels();i++)
+		{
+			btWheelInfo& wheelInfo = m_wheelInfo[i];
+			class btRigidBody* groundObject = (class btRigidBody*) wheelInfo.m_raycastInfo.m_groundObject;
+			if (groundObject)
+				numWheelsOnGround++;
+			m_sideImpulse[i] = btScalar(0.);
+			m_forwardImpulse[i] = btScalar(0.);
+
+		}
+	
+		{
+	
+			for (int i=0;i<getNumWheels();i++)
+			{
+
+				btWheelInfo& wheelInfo = m_wheelInfo[i];
+					
+				class btRigidBody* groundObject = (class btRigidBody*) wheelInfo.m_raycastInfo.m_groundObject;
+
+				if (groundObject)
+				{
+
+					const btTransform& wheelTrans = getWheelTransformWS( i );
+
+					btMatrix3x3 wheelBasis0 = wheelTrans.getBasis();
+					m_axle[i] = btVector3(	
+						wheelBasis0[0][m_indexRightAxis],
+						wheelBasis0[1][m_indexRightAxis],
+						wheelBasis0[2][m_indexRightAxis]);
+					
+					const btVector3& surfNormalWS = wheelInfo.m_raycastInfo.m_contactNormalWS;
+					btScalar proj = m_axle[i].dot(surfNormalWS);
+					m_axle[i] -= surfNormalWS * proj;
+					m_axle[i] = m_axle[i].normalize();
+					
+					m_forwardWS[i] = surfNormalWS.cross(m_axle[i]);
+					m_forwardWS[i].normalize();
+
+				
+					resolveSingleBilateral(*m_chassisBody, wheelInfo.m_raycastInfo.m_contactPointWS,
+							  *groundObject, wheelInfo.m_raycastInfo.m_contactPointWS,
+							  btScalar(0.), m_axle[i],m_sideImpulse[i],timeStep);
+
+					m_sideImpulse[i] *= sideFrictionStiffness2;
+						
+				}
+				
+
+			}
+		}
+
+	btScalar sideFactor = btScalar(1.);
+	btScalar fwdFactor = 0.5;
+
+	bool sliding = false;
+	{
+		for (int wheel =0;wheel <getNumWheels();wheel++)
+		{
+			btWheelInfo& wheelInfo = m_wheelInfo[wheel];
+			class btRigidBody* groundObject = (class btRigidBody*) wheelInfo.m_raycastInfo.m_groundObject;
+
+			btScalar	rollingFriction = 0.f;
+
+			if (groundObject)
+			{
+				if (wheelInfo.m_engineForce != 0.f)
+				{
+					rollingFriction = wheelInfo.m_engineForce* timeStep;
+				} else
+				{
+					btScalar defaultRollingFrictionImpulse = 0.f;
+					btScalar maxImpulse = wheelInfo.m_brake ? wheelInfo.m_brake : defaultRollingFrictionImpulse;
+					btWheelContactPoint contactPt(m_chassisBody,groundObject,wheelInfo.m_raycastInfo.m_contactPointWS,m_forwardWS[wheel],maxImpulse);
+					rollingFriction = calcRollingFriction(contactPt);
+				}
+			}
+
+			//switch between active rolling (throttle), braking and non-active rolling friction (no throttle/break)
+			
+
+
+
+			m_forwardImpulse[wheel] = btScalar(0.);
+			m_wheelInfo[wheel].m_skidInfo= btScalar(1.);
+
+			if (groundObject)
+			{
+				m_wheelInfo[wheel].m_skidInfo= btScalar(1.);
+				
+				btScalar maximp = wheelInfo.m_wheelsSuspensionForce * timeStep * wheelInfo.m_frictionSlip;
+				btScalar maximpSide = maximp;
+
+				btScalar maximpSquared = maximp * maximpSide;
+			
+
+				m_forwardImpulse[wheel] = rollingFriction;//wheelInfo.m_engineForce* timeStep;
+
+				btScalar x = (m_forwardImpulse[wheel] ) * fwdFactor;
+				btScalar y = (m_sideImpulse[wheel] ) * sideFactor;
+				
+				btScalar impulseSquared = (x*x + y*y);
+
+				if (impulseSquared > maximpSquared)
+				{
+					sliding = true;
+					
+					btScalar factor = maximp / btSqrt(impulseSquared);
+					
+					m_wheelInfo[wheel].m_skidInfo *= factor;
+				}
+			} 
+
+		}
+	}
+
+	
+
+
+		if (sliding)
+		{
+			for (int wheel = 0;wheel < getNumWheels(); wheel++)
+			{
+				if (m_sideImpulse[wheel] != btScalar(0.))
+				{
+					if (m_wheelInfo[wheel].m_skidInfo< btScalar(1.))
+					{
+						m_forwardImpulse[wheel] *=	m_wheelInfo[wheel].m_skidInfo;
+						m_sideImpulse[wheel] *= m_wheelInfo[wheel].m_skidInfo;
+					}
+				}
+			}
+		}
+
+		// apply the impulses
+		{
+			for (int wheel = 0;wheel<getNumWheels() ; wheel++)
+			{
+				btWheelInfo& wheelInfo = m_wheelInfo[wheel];
+
+				btVector3 rel_pos = wheelInfo.m_raycastInfo.m_contactPointWS - 
+						m_chassisBody->getCenterOfMassPosition();
+
+				if (m_forwardImpulse[wheel] != btScalar(0.))
+				{
+					m_chassisBody->applyImpulse(m_forwardWS[wheel]*(m_forwardImpulse[wheel]),rel_pos);
+				}
+				if (m_sideImpulse[wheel] != btScalar(0.))
+				{
+					class btRigidBody* groundObject = (class btRigidBody*) m_wheelInfo[wheel].m_raycastInfo.m_groundObject;
+
+					btVector3 rel_pos2 = wheelInfo.m_raycastInfo.m_contactPointWS - 
+						groundObject->getCenterOfMassPosition();
+
+					
+					btVector3 sideImp = m_axle[wheel] * m_sideImpulse[wheel];
+
+#if defined ROLLING_INFLUENCE_FIX // fix. It only worked if car's up was along Y - VT.
+					btVector3 vChassisWorldUp = getRigidBody()->getCenterOfMassTransform().getBasis().getColumn(m_indexUpAxis);
+					rel_pos -= vChassisWorldUp * (vChassisWorldUp.dot(rel_pos) * (1.f-wheelInfo.m_rollInfluence));
+#else
+					rel_pos[m_indexUpAxis] *= wheelInfo.m_rollInfluence;
+#endif
+					m_chassisBody->applyImpulse(sideImp,rel_pos);
+
+					//apply friction impulse on the ground
+					groundObject->applyImpulse(-sideImp,rel_pos2);
+				}
+			}
+		}
+
+	
+}
+
+
+
+void	btRaycastVehicle::debugDraw(btIDebugDraw* debugDrawer)
+{
+
+	for (int v=0;v<this->getNumWheels();v++)
+	{
+		btVector3 wheelColor(0,1,1);
+		if (getWheelInfo(v).m_raycastInfo.m_isInContact)
+		{
+			wheelColor.setValue(0,0,1);
+		} else
+		{
+			wheelColor.setValue(1,0,1);
+		}
+
+		btVector3 wheelPosWS = getWheelInfo(v).m_worldTransform.getOrigin();
+
+		btVector3 axle = btVector3(	
+			getWheelInfo(v).m_worldTransform.getBasis()[0][getRightAxis()],
+			getWheelInfo(v).m_worldTransform.getBasis()[1][getRightAxis()],
+			getWheelInfo(v).m_worldTransform.getBasis()[2][getRightAxis()]);
+
+		//debug wheels (cylinders)
+		debugDrawer->drawLine(wheelPosWS,wheelPosWS+axle,wheelColor);
+		debugDrawer->drawLine(wheelPosWS,getWheelInfo(v).m_raycastInfo.m_contactPointWS,wheelColor);
+
+	}
+}
+
+
+void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result)
+{
+//	RayResultCallback& resultCallback;
+
+	btCollisionWorld::ClosestRayResultCallback rayCallback(from,to);
+
+	m_dynamicsWorld->rayTest(from, to, rayCallback);
+
+	if (rayCallback.hasHit())
+	{
+		
+		btRigidBody* body = btRigidBody::upcast(rayCallback.m_collisionObject);
+        if (body && body->hasContactResponse())
+		{
+			result.m_hitPointInWorld = rayCallback.m_hitPointWorld;
+			result.m_hitNormalInWorld = rayCallback.m_hitNormalWorld;
+			result.m_hitNormalInWorld.normalize();
+			result.m_distFraction = rayCallback.m_closestHitFraction;
+			return body;
+		}
+	}
+	return 0;
+}
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h b/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h
new file mode 100644
index 0000000..f59555f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Vehicle/btRaycastVehicle.h
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies.
+ * Erwin Coumans makes no representations about the suitability 
+ * of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+*/
+#ifndef BT_RAYCASTVEHICLE_H
+#define BT_RAYCASTVEHICLE_H
+
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
+#include "btVehicleRaycaster.h"
+class btDynamicsWorld;
+#include "LinearMath/btAlignedObjectArray.h"
+#include "btWheelInfo.h"
+#include "BulletDynamics/Dynamics/btActionInterface.h"
+
+class btVehicleTuning;
+
+///rayCast vehicle, very special constraint that turn a rigidbody into a vehicle.
+class btRaycastVehicle : public btActionInterface
+{
+
+		btAlignedObjectArray<btVector3>	m_forwardWS;
+		btAlignedObjectArray<btVector3>	m_axle;
+		btAlignedObjectArray<btScalar>	m_forwardImpulse;
+		btAlignedObjectArray<btScalar>	m_sideImpulse;
+	
+		///backwards compatibility
+		int	m_userConstraintType;
+		int	m_userConstraintId;
+
+public:
+	class btVehicleTuning
+		{
+			public:
+
+			btVehicleTuning()
+				:m_suspensionStiffness(btScalar(5.88)),
+				m_suspensionCompression(btScalar(0.83)),
+				m_suspensionDamping(btScalar(0.88)),
+				m_maxSuspensionTravelCm(btScalar(500.)),
+				m_frictionSlip(btScalar(10.5)),
+				m_maxSuspensionForce(btScalar(6000.))
+			{
+			}
+			btScalar	m_suspensionStiffness;
+			btScalar	m_suspensionCompression;
+			btScalar	m_suspensionDamping;
+			btScalar	m_maxSuspensionTravelCm;
+			btScalar	m_frictionSlip;
+			btScalar	m_maxSuspensionForce;
+
+		};
+private:
+
+	btScalar	m_tau;
+	btScalar	m_damping;
+	btVehicleRaycaster*	m_vehicleRaycaster;
+	btScalar		m_pitchControl;
+	btScalar	m_steeringValue; 
+	btScalar m_currentVehicleSpeedKmHour;
+
+	btRigidBody* m_chassisBody;
+
+	int m_indexRightAxis;
+	int m_indexUpAxis;
+	int	m_indexForwardAxis;
+
+	void defaultInit(const btVehicleTuning& tuning);
+
+public:
+
+	//constructor to create a car from an existing rigidbody
+	btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis,	btVehicleRaycaster* raycaster );
+
+	virtual ~btRaycastVehicle() ;
+
+
+	///btActionInterface interface
+	virtual void updateAction( btCollisionWorld* collisionWorld, btScalar step)
+	{
+        (void) collisionWorld;
+		updateVehicle(step);
+	}
+	
+
+	///btActionInterface interface
+	void	debugDraw(btIDebugDraw* debugDrawer);
+			
+	const btTransform& getChassisWorldTransform() const;
+	
+	btScalar rayCast(btWheelInfo& wheel);
+
+	virtual void updateVehicle(btScalar step);
+	
+	
+	void resetSuspension();
+
+	btScalar	getSteeringValue(int wheel) const;
+
+	void	setSteeringValue(btScalar steering,int wheel);
+
+
+	void	applyEngineForce(btScalar force, int wheel);
+
+	const btTransform&	getWheelTransformWS( int wheelIndex ) const;
+
+	void	updateWheelTransform( int wheelIndex, bool interpolatedTransform = true );
+	
+//	void	setRaycastWheelInfo( int wheelIndex , bool isInContact, const btVector3& hitPoint, const btVector3& hitNormal,btScalar depth);
+
+	btWheelInfo&	addWheel( const btVector3& connectionPointCS0, const btVector3& wheelDirectionCS0,const btVector3& wheelAxleCS,btScalar suspensionRestLength,btScalar wheelRadius,const btVehicleTuning& tuning, bool isFrontWheel);
+
+	inline int		getNumWheels() const {
+		return int (m_wheelInfo.size());
+	}
+	
+	btAlignedObjectArray<btWheelInfo>	m_wheelInfo;
+
+
+	const btWheelInfo&	getWheelInfo(int index) const;
+
+	btWheelInfo&	getWheelInfo(int index);
+
+	void	updateWheelTransformsWS(btWheelInfo& wheel , bool interpolatedTransform = true);
+
+	
+	void setBrake(btScalar brake,int wheelIndex);
+
+	void	setPitchControl(btScalar pitch)
+	{
+		m_pitchControl = pitch;
+	}
+	
+	void	updateSuspension(btScalar deltaTime);
+
+	virtual void	updateFriction(btScalar	timeStep);
+
+
+
+	inline btRigidBody* getRigidBody()
+	{
+		return m_chassisBody;
+	}
+
+	const btRigidBody* getRigidBody() const
+	{
+		return m_chassisBody;
+	}
+
+	inline int	getRightAxis() const
+	{
+		return m_indexRightAxis;
+	}
+	inline int getUpAxis() const
+	{
+		return m_indexUpAxis;
+	}
+
+	inline int getForwardAxis() const
+	{
+		return m_indexForwardAxis;
+	}
+
+	
+	///Worldspace forward vector
+	btVector3 getForwardVector() const
+	{
+		const btTransform& chassisTrans = getChassisWorldTransform(); 
+
+		btVector3 forwardW ( 
+			  chassisTrans.getBasis()[0][m_indexForwardAxis], 
+			  chassisTrans.getBasis()[1][m_indexForwardAxis], 
+			  chassisTrans.getBasis()[2][m_indexForwardAxis]); 
+
+		return forwardW;
+	}
+
+	///Velocity of vehicle (positive if velocity vector has same direction as foward vector)
+	btScalar	getCurrentSpeedKmHour() const
+	{
+		return m_currentVehicleSpeedKmHour;
+	}
+
+	virtual void	setCoordinateSystem(int rightIndex,int upIndex,int forwardIndex)
+	{
+		m_indexRightAxis = rightIndex;
+		m_indexUpAxis = upIndex;
+		m_indexForwardAxis = forwardIndex;
+	}
+
+
+	///backwards compatibility
+	int getUserConstraintType() const
+	{
+		return m_userConstraintType ;
+	}
+
+	void	setUserConstraintType(int userConstraintType)
+	{
+		m_userConstraintType = userConstraintType;
+	};
+
+	void	setUserConstraintId(int uid)
+	{
+		m_userConstraintId = uid;
+	}
+
+	int getUserConstraintId() const
+	{
+		return m_userConstraintId;
+	}
+
+};
+
+class btDefaultVehicleRaycaster : public btVehicleRaycaster
+{
+	btDynamicsWorld*	m_dynamicsWorld;
+public:
+	btDefaultVehicleRaycaster(btDynamicsWorld* world)
+		:m_dynamicsWorld(world)
+	{
+	}
+
+	virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result);
+
+};
+
+
+#endif //BT_RAYCASTVEHICLE_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h b/hkl3d/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h
new file mode 100644
index 0000000..3cc909c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Vehicle/btVehicleRaycaster.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2005 Erwin Coumans http://bulletphysics.org
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies.
+ * Erwin Coumans makes no representations about the suitability 
+ * of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+*/
+#ifndef BT_VEHICLE_RAYCASTER_H
+#define BT_VEHICLE_RAYCASTER_H
+
+#include "LinearMath/btVector3.h"
+
+/// btVehicleRaycaster is provides interface for between vehicle simulation and raycasting
+struct btVehicleRaycaster
+{
+virtual ~btVehicleRaycaster()
+{
+}
+	struct btVehicleRaycasterResult
+	{
+		btVehicleRaycasterResult() :m_distFraction(btScalar(-1.)){};
+		btVector3	m_hitPointInWorld;
+		btVector3	m_hitNormalInWorld;
+		btScalar	m_distFraction;
+	};
+
+	virtual void* castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) = 0;
+
+};
+
+#endif //BT_VEHICLE_RAYCASTER_H
+
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp b/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp
new file mode 100644
index 0000000..ef93c16
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies.
+ * Erwin Coumans makes no representations about the suitability 
+ * of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+*/
+#include "btWheelInfo.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h" // for pointvelocity
+
+
+btScalar btWheelInfo::getSuspensionRestLength() const
+{
+
+	return m_suspensionRestLength1;
+
+}
+
+void	btWheelInfo::updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo)
+{
+	(void)raycastInfo;
+
+	
+	if (m_raycastInfo.m_isInContact)
+
+	{
+		btScalar	project= m_raycastInfo.m_contactNormalWS.dot( m_raycastInfo.m_wheelDirectionWS );
+		btVector3	 chassis_velocity_at_contactPoint;
+		btVector3 relpos = m_raycastInfo.m_contactPointWS - chassis.getCenterOfMassPosition();
+		chassis_velocity_at_contactPoint = chassis.getVelocityInLocalPoint( relpos );
+		btScalar projVel = m_raycastInfo.m_contactNormalWS.dot( chassis_velocity_at_contactPoint );
+		if ( project >= btScalar(-0.1))
+		{
+			m_suspensionRelativeVelocity = btScalar(0.0);
+			m_clippedInvContactDotSuspension = btScalar(1.0) / btScalar(0.1);
+		}
+		else
+		{
+			btScalar inv = btScalar(-1.) / project;
+			m_suspensionRelativeVelocity = projVel * inv;
+			m_clippedInvContactDotSuspension = inv;
+		}
+		
+	}
+
+	else	// Not in contact : position wheel in a nice (rest length) position
+	{
+		m_raycastInfo.m_suspensionLength = this->getSuspensionRestLength();
+		m_suspensionRelativeVelocity = btScalar(0.0);
+		m_raycastInfo.m_contactNormalWS = -m_raycastInfo.m_wheelDirectionWS;
+		m_clippedInvContactDotSuspension = btScalar(1.0);
+	}
+}
diff --git a/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h b/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h
new file mode 100644
index 0000000..f916053
--- /dev/null
+++ b/hkl3d/bullet/src/BulletDynamics/Vehicle/btWheelInfo.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2005 Erwin Coumans http://continuousphysics.com/Bullet/
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies.
+ * Erwin Coumans makes no representations about the suitability 
+ * of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+*/
+#ifndef BT_WHEEL_INFO_H
+#define BT_WHEEL_INFO_H
+
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btTransform.h"
+
+class btRigidBody;
+
+struct btWheelInfoConstructionInfo
+{
+	btVector3	m_chassisConnectionCS;
+	btVector3	m_wheelDirectionCS;
+	btVector3	m_wheelAxleCS;
+	btScalar	m_suspensionRestLength;
+	btScalar	m_maxSuspensionTravelCm;
+	btScalar	m_wheelRadius;
+	
+	btScalar		m_suspensionStiffness;
+	btScalar		m_wheelsDampingCompression;
+	btScalar		m_wheelsDampingRelaxation;
+	btScalar		m_frictionSlip;
+	btScalar		m_maxSuspensionForce;
+	bool m_bIsFrontWheel;
+	
+};
+
+/// btWheelInfo contains information per wheel about friction and suspension.
+struct btWheelInfo
+{
+	struct RaycastInfo
+	{
+		//set by raycaster
+		btVector3	m_contactNormalWS;//contactnormal
+		btVector3	m_contactPointWS;//raycast hitpoint
+		btScalar	m_suspensionLength;
+		btVector3	m_hardPointWS;//raycast starting point
+		btVector3	m_wheelDirectionWS; //direction in worldspace
+		btVector3	m_wheelAxleWS; // axle in worldspace
+		bool		m_isInContact;
+		void*		m_groundObject; //could be general void* ptr
+	};
+
+	RaycastInfo	m_raycastInfo;
+
+	btTransform	m_worldTransform;
+	
+	btVector3	m_chassisConnectionPointCS; //const
+	btVector3	m_wheelDirectionCS;//const
+	btVector3	m_wheelAxleCS; // const or modified by steering
+	btScalar	m_suspensionRestLength1;//const
+	btScalar	m_maxSuspensionTravelCm;
+	btScalar getSuspensionRestLength() const;
+	btScalar	m_wheelsRadius;//const
+	btScalar	m_suspensionStiffness;//const
+	btScalar	m_wheelsDampingCompression;//const
+	btScalar	m_wheelsDampingRelaxation;//const
+	btScalar	m_frictionSlip;
+	btScalar	m_steering;
+	btScalar	m_rotation;
+	btScalar	m_deltaRotation;
+	btScalar	m_rollInfluence;
+	btScalar	m_maxSuspensionForce;
+
+	btScalar	m_engineForce;
+
+	btScalar	m_brake;
+	
+	bool m_bIsFrontWheel;
+	
+	void*		m_clientInfo;//can be used to store pointer to sync transforms...
+
+	btWheelInfo(btWheelInfoConstructionInfo& ci)
+
+	{
+
+		m_suspensionRestLength1 = ci.m_suspensionRestLength;
+		m_maxSuspensionTravelCm = ci.m_maxSuspensionTravelCm;
+
+		m_wheelsRadius = ci.m_wheelRadius;
+		m_suspensionStiffness = ci.m_suspensionStiffness;
+		m_wheelsDampingCompression = ci.m_wheelsDampingCompression;
+		m_wheelsDampingRelaxation = ci.m_wheelsDampingRelaxation;
+		m_chassisConnectionPointCS = ci.m_chassisConnectionCS;
+		m_wheelDirectionCS = ci.m_wheelDirectionCS;
+		m_wheelAxleCS = ci.m_wheelAxleCS;
+		m_frictionSlip = ci.m_frictionSlip;
+		m_steering = btScalar(0.);
+		m_engineForce = btScalar(0.);
+		m_rotation = btScalar(0.);
+		m_deltaRotation = btScalar(0.);
+		m_brake = btScalar(0.);
+		m_rollInfluence = btScalar(0.1);
+		m_bIsFrontWheel = ci.m_bIsFrontWheel;
+		m_maxSuspensionForce = ci.m_maxSuspensionForce;
+
+	}
+
+	void	updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo);
+
+	btScalar	m_clippedInvContactDotSuspension;
+	btScalar	m_suspensionRelativeVelocity;
+	//calculated by suspension
+	btScalar	m_wheelsSuspensionForce;
+	btScalar	m_skidInfo;
+
+};
+
+#endif //BT_WHEEL_INFO_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h
new file mode 100644
index 0000000..eb4e98b
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h
@@ -0,0 +1,744 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SOFT_BODY_SOLVER_DATA_H
+#define BT_SOFT_BODY_SOLVER_DATA_H
+
+#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
+#include "vectormath/vmInclude.h"
+
+
+class btSoftBodyLinkData
+{
+public:
+	/**
+	 * Class representing a link as a set of three indices into the vertex array.
+	 */
+	class LinkNodePair
+	{
+	public:
+		int vertex0;
+		int vertex1;
+
+		LinkNodePair()
+		{
+			vertex0 = 0;
+			vertex1 = 0;
+		}
+
+		LinkNodePair( int v0, int v1 )
+		{
+			vertex0 = v0;
+			vertex1 = v1;
+		}
+	};
+
+	/**
+	 * Class describing a link for input into the system.
+	 */
+	class LinkDescription
+	{
+	protected:
+		int m_vertex0;
+		int m_vertex1;
+		float m_linkLinearStiffness;
+		float m_linkStrength;
+
+	public:
+
+		LinkDescription()
+		{
+			m_vertex0 = 0;
+			m_vertex1 = 0;
+			m_linkLinearStiffness = 1.0;
+			m_linkStrength = 1.0;
+		}
+
+		LinkDescription( int newVertex0, int newVertex1, float linkLinearStiffness )
+		{
+			m_vertex0 = newVertex0;
+			m_vertex1 = newVertex1;
+			m_linkLinearStiffness = linkLinearStiffness;
+			m_linkStrength = 1.0;
+		}
+
+		LinkNodePair getVertexPair() const
+		{
+			LinkNodePair nodes;
+			nodes.vertex0 = m_vertex0;
+			nodes.vertex1 = m_vertex1;
+			return nodes;
+		}
+
+		void setVertex0( int vertex )
+		{
+			m_vertex0 = vertex;
+		}
+
+		void setVertex1( int vertex )
+		{
+			m_vertex1 = vertex;
+		}
+
+		void setLinkLinearStiffness( float linearStiffness )
+		{
+			m_linkLinearStiffness = linearStiffness;
+		}
+
+		void setLinkStrength( float strength )
+		{
+			m_linkStrength = strength;
+		}
+
+		int getVertex0() const
+		{
+			return m_vertex0;
+		}
+
+		int getVertex1() const
+		{
+			return m_vertex1;
+		}
+
+		float getLinkStrength() const
+		{
+			return m_linkStrength;
+		}
+
+		float getLinkLinearStiffness() const
+		{
+			return m_linkLinearStiffness;
+		}
+	};
+
+
+protected:
+	// NOTE:
+	// Vertex reference data is stored relative to global array, not relative to individual cloth.
+	// Values must be correct if being passed into single-cloth VBOs or when migrating from one solver
+	// to another.
+
+	btAlignedObjectArray< LinkNodePair > m_links; // Vertex pair for the link
+	btAlignedObjectArray< float >								m_linkStrength; // Strength of each link
+	// (inverseMassA + inverseMassB)/ linear stiffness coefficient
+	btAlignedObjectArray< float >								m_linksMassLSC; 
+	btAlignedObjectArray< float >								m_linksRestLengthSquared; 
+	// Current vector length of link
+	btAlignedObjectArray< Vectormath::Aos::Vector3 >			m_linksCLength;
+	// 1/(current length * current length * massLSC)
+	btAlignedObjectArray< float >								m_linksLengthRatio; 
+	btAlignedObjectArray< float >								m_linksRestLength;
+	btAlignedObjectArray< float >								m_linksMaterialLinearStiffnessCoefficient;
+
+public:
+	btSoftBodyLinkData()
+	{
+	}
+
+	virtual ~btSoftBodyLinkData()
+	{
+	}
+
+	virtual void clear()
+	{
+		m_links.resize(0);
+		m_linkStrength.resize(0);
+		m_linksMassLSC.resize(0);
+		m_linksRestLengthSquared.resize(0);
+		m_linksLengthRatio.resize(0);
+		m_linksRestLength.resize(0);
+		m_linksMaterialLinearStiffnessCoefficient.resize(0);
+	}
+
+	int getNumLinks()
+	{
+		return m_links.size();
+	}
+
+	/** Allocate enough space in all link-related arrays to fit numLinks links */
+	virtual void createLinks( int numLinks )
+	{
+		int previousSize = m_links.size();
+		int newSize = previousSize + numLinks;
+
+		// Resize all the arrays that store link data
+		m_links.resize( newSize );
+		m_linkStrength.resize( newSize );
+		m_linksMassLSC.resize( newSize );
+		m_linksRestLengthSquared.resize( newSize );
+		m_linksCLength.resize( newSize );
+		m_linksLengthRatio.resize( newSize );
+		m_linksRestLength.resize( newSize );
+		m_linksMaterialLinearStiffnessCoefficient.resize( newSize );
+	}
+	
+	/** Insert the link described into the correct data structures assuming space has already been allocated by a call to createLinks */
+	virtual void setLinkAt( const LinkDescription &link, int linkIndex )
+	{
+		m_links[linkIndex] = link.getVertexPair();
+		m_linkStrength[linkIndex] = link.getLinkStrength();
+		m_linksMassLSC[linkIndex] = 0.f;
+		m_linksRestLengthSquared[linkIndex] = 0.f;
+		m_linksCLength[linkIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
+		m_linksLengthRatio[linkIndex] = 0.f;
+		m_linksRestLength[linkIndex] = 0.f;
+		m_linksMaterialLinearStiffnessCoefficient[linkIndex] = link.getLinkLinearStiffness();
+	}
+
+
+	/**
+	 * Return true if data is on the accelerator.
+	 * The CPU version of this class will return true here because
+	 * the CPU is the same as the accelerator.
+	 */
+	virtual bool onAccelerator()
+	{
+		return true;
+	}
+	
+	/**
+	 * Move data from host memory to the accelerator.
+	 * The CPU version will always return that it has moved it.
+	 */
+	virtual bool moveToAccelerator()
+	{
+		return true;
+	}
+
+	/**
+	 * Move data from host memory from the accelerator.
+	 * The CPU version will always return that it has moved it.
+	 */
+	virtual bool moveFromAccelerator()
+	{
+		return true;
+	}
+
+
+
+	/**
+	 * Return reference to the vertex index pair for link linkIndex as stored on the host.
+	 */
+	LinkNodePair &getVertexPair( int linkIndex )
+	{
+		return m_links[linkIndex];
+	}
+
+	/** 
+	 * Return reference to strength of link linkIndex as stored on the host.
+	 */
+	float &getStrength( int linkIndex )
+	{
+		return m_linkStrength[linkIndex];
+	}
+
+	/**
+	 * Return a reference to the strength of the link corrected for link sorting.
+	 * This is important if we are using data on an accelerator which has the data sorted in some fashion.
+	 */
+	virtual float &getStrengthCorrected( int linkIndex )
+	{
+		return getStrength( linkIndex );
+	}
+
+	/**
+	 * Return reference to the rest length of link linkIndex as stored on the host.
+	 */
+	float &getRestLength( int linkIndex )
+	{
+		return m_linksRestLength[linkIndex];
+	}
+
+	/**
+	 * Return reference to linear stiffness coefficient for link linkIndex as stored on the host.
+	 */
+	float &getLinearStiffnessCoefficient( int linkIndex )
+	{
+		return m_linksMaterialLinearStiffnessCoefficient[linkIndex];
+	}
+
+	/**
+	 * Return reference to the MassLSC value for link linkIndex as stored on the host.
+	 */
+	float &getMassLSC( int linkIndex )
+	{
+		return m_linksMassLSC[linkIndex];
+	}
+
+	/**
+	 * Return reference to rest length squared for link linkIndex as stored on the host.
+	 */
+	float &getRestLengthSquared( int linkIndex )
+	{
+		return m_linksRestLengthSquared[linkIndex];
+	}
+
+	/**
+	 * Return reference to current length of link linkIndex as stored on the host.
+	 */
+	Vectormath::Aos::Vector3 &getCurrentLength( int linkIndex )
+	{
+		return m_linksCLength[linkIndex];
+	}
+
+	 /**
+	  * Return the link length ratio from for link linkIndex as stored on the host.
+	  */
+	 float &getLinkLengthRatio( int linkIndex )
+	 {
+		 return m_linksLengthRatio[linkIndex];
+	 }
+};
+
+
+
+/**
+ * Wrapper for vertex data information.
+ * By wrapping it like this we stand a good chance of being able to optimise for storage format easily.
+ * It should also help us make sure all the data structures remain consistent.
+ */
+class btSoftBodyVertexData
+{
+public:
+	/**
+	 * Class describing a vertex for input into the system.
+	 */
+	class VertexDescription
+	{
+	private:
+		Vectormath::Aos::Point3 m_position;
+		/** Inverse mass. If this is 0f then the mass was 0 because that simplifies calculations. */
+		float m_inverseMass;
+
+	public:
+		VertexDescription()
+		{	
+			m_position = Vectormath::Aos::Point3( 0.f, 0.f, 0.f );
+			m_inverseMass = 0.f;
+		}
+
+		VertexDescription( const Vectormath::Aos::Point3 &position, float mass )
+		{
+			m_position = position;
+			if( mass > 0.f )
+				m_inverseMass = 1.0f/mass;
+			else
+				m_inverseMass = 0.f;
+		}
+
+		void setPosition( const Vectormath::Aos::Point3 &position )
+		{
+			m_position = position;
+		}
+
+		void setInverseMass( float inverseMass )
+		{
+			m_inverseMass = inverseMass;
+		}
+
+		void setMass( float mass )
+		{
+			if( mass > 0.f )
+				m_inverseMass = 1.0f/mass;
+			else
+				m_inverseMass = 0.f;
+		}
+
+		Vectormath::Aos::Point3 getPosition() const
+		{
+			return m_position;
+		}
+
+		float getInverseMass() const
+		{
+			return m_inverseMass;
+		}
+
+		float getMass() const
+		{
+			if( m_inverseMass == 0.f )
+				return 0.f;
+			else
+				return 1.0f/m_inverseMass;
+		}
+	};
+protected:
+
+	// identifier for the individual cloth
+	// For the CPU we don't really need this as we can grab the cloths and iterate over only their vertices
+	// For a parallel accelerator knowing on a per-vertex basis which cloth we're part of will help for obtaining
+	// per-cloth data
+	// For sorting etc it might also be helpful to be able to use in-array data such as this.
+	btAlignedObjectArray< int >							m_clothIdentifier;
+	btAlignedObjectArray< Vectormath::Aos::Point3 >		m_vertexPosition;			// vertex positions
+	btAlignedObjectArray< Vectormath::Aos::Point3 >		m_vertexPreviousPosition;	// vertex positions
+	btAlignedObjectArray< Vectormath::Aos::Vector3 >	m_vertexVelocity;			// Velocity
+	btAlignedObjectArray< Vectormath::Aos::Vector3 >	m_vertexForceAccumulator;	// Force accumulator
+	btAlignedObjectArray< Vectormath::Aos::Vector3 >	m_vertexNormal;				// Normals
+	btAlignedObjectArray< float >						m_vertexInverseMass;		// Inverse mass
+	btAlignedObjectArray< float >						m_vertexArea;				// Area controlled by the vertex
+	btAlignedObjectArray< int >							m_vertexTriangleCount;		// Number of triangles touching this vertex
+
+public:
+	btSoftBodyVertexData()
+	{
+	}
+
+	virtual ~btSoftBodyVertexData()
+	{
+	}
+
+	virtual void clear()
+	{
+		m_clothIdentifier.resize(0);
+		m_vertexPosition.resize(0);
+		m_vertexPreviousPosition.resize(0);
+		m_vertexVelocity.resize(0);
+		m_vertexForceAccumulator.resize(0);
+		m_vertexNormal.resize(0);
+		m_vertexInverseMass.resize(0);
+		m_vertexArea.resize(0);
+		m_vertexTriangleCount.resize(0);
+	}
+
+	int getNumVertices()
+	{
+		return m_vertexPosition.size();
+	}
+
+	int getClothIdentifier( int vertexIndex )
+	{
+		return m_clothIdentifier[vertexIndex];
+	}
+
+	void setVertexAt( const VertexDescription &vertex, int vertexIndex )
+	{
+		m_vertexPosition[vertexIndex] = vertex.getPosition();
+		m_vertexPreviousPosition[vertexIndex] = vertex.getPosition();
+		m_vertexVelocity[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
+		m_vertexForceAccumulator[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
+		m_vertexNormal[vertexIndex] = Vectormath::Aos::Vector3(0.f, 0.f, 0.f);
+		m_vertexInverseMass[vertexIndex] = vertex.getInverseMass();
+		m_vertexArea[vertexIndex] = 0.f;
+		m_vertexTriangleCount[vertexIndex] = 0;
+	}
+
+	/** 
+	 * Create numVertices new vertices for cloth clothIdentifier 
+	 * maxVertices allows a buffer zone of extra vertices for alignment or tearing reasons.
+	 */
+	void createVertices( int numVertices, int clothIdentifier, int maxVertices = 0 )
+	{
+		int previousSize = m_vertexPosition.size();
+		if( maxVertices == 0 )
+			maxVertices = numVertices;
+		int newSize = previousSize + maxVertices;
+
+		// Resize all the arrays that store vertex data
+		m_clothIdentifier.resize( newSize );
+		m_vertexPosition.resize( newSize );
+		m_vertexPreviousPosition.resize( newSize );
+		m_vertexVelocity.resize( newSize );
+		m_vertexForceAccumulator.resize( newSize );
+		m_vertexNormal.resize( newSize );
+		m_vertexInverseMass.resize( newSize );
+		m_vertexArea.resize( newSize );
+		m_vertexTriangleCount.resize( newSize );
+
+		for( int vertexIndex = previousSize; vertexIndex < newSize; ++vertexIndex )
+			m_clothIdentifier[vertexIndex] = clothIdentifier;
+		for( int vertexIndex = (previousSize + numVertices); vertexIndex < newSize; ++vertexIndex )
+			m_clothIdentifier[vertexIndex] = -1;
+	}
+
+	// Get and set methods in header so they can be inlined
+
+	/**
+	 * Return a reference to the position of vertex vertexIndex as stored on the host.
+	 */
+	Vectormath::Aos::Point3 &getPosition( int vertexIndex )
+	{
+		return m_vertexPosition[vertexIndex];
+	}
+
+	Vectormath::Aos::Point3 getPosition( int vertexIndex ) const
+	{
+		return m_vertexPosition[vertexIndex];
+	}
+
+	/**
+	 * Return a reference to the previous position of vertex vertexIndex as stored on the host.
+	 */
+	Vectormath::Aos::Point3 &getPreviousPosition( int vertexIndex )
+	{
+		return m_vertexPreviousPosition[vertexIndex];
+	}
+
+	/**
+	 * Return a reference to the velocity of vertex vertexIndex as stored on the host.
+	 */
+	Vectormath::Aos::Vector3 &getVelocity( int vertexIndex )
+	{
+		return m_vertexVelocity[vertexIndex];
+	}
+
+	/**
+	 * Return a reference to the force accumulator of vertex vertexIndex as stored on the host.
+	 */
+	Vectormath::Aos::Vector3 &getForceAccumulator( int vertexIndex )
+	{
+		return m_vertexForceAccumulator[vertexIndex];
+	}
+
+	/**
+	 * Return a reference to the normal of vertex vertexIndex as stored on the host.
+	 */
+	Vectormath::Aos::Vector3 &getNormal( int vertexIndex )
+	{
+		return m_vertexNormal[vertexIndex];
+	}
+
+	Vectormath::Aos::Vector3 getNormal( int vertexIndex ) const
+	{
+		return m_vertexNormal[vertexIndex];
+	}
+
+	/**
+	 * Return a reference to the inverse mass of vertex vertexIndex as stored on the host.
+	 */
+	float &getInverseMass( int vertexIndex )
+	{
+		return m_vertexInverseMass[vertexIndex];
+	}
+
+	/**
+	 * Get access to the area controlled by this vertex.
+	 */
+	float &getArea( int vertexIndex )
+	{
+		return m_vertexArea[vertexIndex];
+	}
+
+	/**
+	 * Get access to the array of how many triangles touch each vertex.
+	 */
+	int &getTriangleCount( int vertexIndex )
+	{
+		return m_vertexTriangleCount[vertexIndex];
+	}
+
+
+
+	/**
+	 * Return true if data is on the accelerator.
+	 * The CPU version of this class will return true here because
+	 * the CPU is the same as the accelerator.
+	 */
+	virtual bool onAccelerator()
+	{
+		return true;
+	}
+	
+	/**
+	 * Move data from host memory to the accelerator.
+	 * The CPU version will always return that it has moved it.
+	 */
+	virtual bool moveToAccelerator()
+	{
+		return true;
+	}
+
+	/**
+	 * Move data from host memory from the accelerator.
+	 * The CPU version will always return that it has moved it.
+	 */
+	virtual bool moveFromAccelerator()
+	{
+		return true;
+	}
+
+	btAlignedObjectArray< Vectormath::Aos::Point3 >	&getVertexPositions()
+	{
+		return m_vertexPosition;
+	}
+};
+
+
+class btSoftBodyTriangleData
+{
+public:
+	/**
+	 * Class representing a triangle as a set of three indices into the
+	 * vertex array.
+	 */
+	class TriangleNodeSet
+	{
+	public:
+		int vertex0;
+		int vertex1;
+		int vertex2;
+		int _padding;
+
+		TriangleNodeSet( )
+		{
+			vertex0 = 0;
+			vertex1 = 0;
+			vertex2 = 0;
+			_padding = -1;
+		}
+
+		TriangleNodeSet( int newVertex0, int newVertex1, int newVertex2 )
+		{
+			vertex0 = newVertex0;
+			vertex1 = newVertex1;
+			vertex2 = newVertex2;
+		}
+	};
+
+	class TriangleDescription
+	{
+	protected:
+		int m_vertex0;
+		int m_vertex1;
+		int m_vertex2;
+
+	public:
+		TriangleDescription()
+		{
+			m_vertex0 = 0;
+			m_vertex1 = 0;
+			m_vertex2 = 0;
+		}
+
+		TriangleDescription( int newVertex0, int newVertex1, int newVertex2 )
+		{
+			m_vertex0 = newVertex0;
+			m_vertex1 = newVertex1;
+			m_vertex2 = newVertex2;
+		}
+
+		TriangleNodeSet getVertexSet() const
+		{
+			btSoftBodyTriangleData::TriangleNodeSet nodes;
+			nodes.vertex0 = m_vertex0;
+			nodes.vertex1 = m_vertex1;
+			nodes.vertex2 = m_vertex2;
+			return nodes;
+		}
+	};
+
+protected:
+	// NOTE:
+	// Vertex reference data is stored relative to global array, not relative to individual cloth.
+	// Values must be correct if being passed into single-cloth VBOs or when migrating from one solver
+	// to another.
+	btAlignedObjectArray< TriangleNodeSet > m_vertexIndices;
+	btAlignedObjectArray< float > m_area;
+	btAlignedObjectArray< Vectormath::Aos::Vector3 > m_normal;
+
+public:
+	btSoftBodyTriangleData()
+	{
+	}
+
+	virtual ~btSoftBodyTriangleData()
+	{
+
+	}
+
+	virtual void clear()
+	{
+		m_vertexIndices.resize(0);
+		m_area.resize(0);
+		m_normal.resize(0);
+	}
+
+	int getNumTriangles()
+	{
+		return m_vertexIndices.size();
+	}
+
+	virtual void setTriangleAt( const TriangleDescription &triangle, int triangleIndex )
+	{
+		m_vertexIndices[triangleIndex] = triangle.getVertexSet();
+	}
+
+	virtual void createTriangles( int numTriangles )		
+	{
+		int previousSize = m_vertexIndices.size();
+		int newSize = previousSize + numTriangles;
+
+		// Resize all the arrays that store triangle data
+		m_vertexIndices.resize( newSize );
+		m_area.resize( newSize );
+		m_normal.resize( newSize );
+	}
+
+	/**
+	 * Return the vertex index set for triangle triangleIndex as stored on the host.
+	 */
+	const TriangleNodeSet &getVertexSet( int triangleIndex )
+	{
+		return m_vertexIndices[triangleIndex];
+	}
+
+	/**
+	 * Get access to the triangle area.
+	 */
+	float &getTriangleArea( int triangleIndex )
+	{
+		return m_area[triangleIndex];
+	}
+
+	/**
+	 * Get access to the normal vector for this triangle.
+	 */
+	Vectormath::Aos::Vector3 &getNormal( int triangleIndex )
+	{
+		return m_normal[triangleIndex];
+	}
+
+	/**
+	 * Return true if data is on the accelerator.
+	 * The CPU version of this class will return true here because
+	 * the CPU is the same as the accelerator.
+	 */
+	virtual bool onAccelerator()
+	{
+		return true;
+	}
+	
+	/**
+	 * Move data from host memory to the accelerator.
+	 * The CPU version will always return that it has moved it.
+	 */
+	virtual bool moveToAccelerator()
+	{
+		return true;
+	}
+
+	/**
+	 * Move data from host memory from the accelerator.
+	 * The CPU version will always return that it has moved it.
+	 */
+	virtual bool moveFromAccelerator()
+	{
+		return true;
+	}
+};
+
+
+#endif // #ifndef BT_SOFT_BODY_SOLVER_DATA_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp
new file mode 100644
index 0000000..51a24ba
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp
@@ -0,0 +1,979 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "vectormath/vmInclude.h"
+
+#include "BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h"
+#include "BulletSoftBody/btSoftBody.h"
+#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
+
+
+btCPUSoftBodySolver::btCPUSoftBodySolver()
+{
+	// Initial we will clearly need to update solver constants
+	// For now this is global for the cloths linked with this solver - we should probably make this body specific 
+	// for performance in future once we understand more clearly when constants need to be updated
+	m_updateSolverConstants = true;
+}
+
+btCPUSoftBodySolver::~btCPUSoftBodySolver()
+{
+}
+
+
+
+
+btSoftBodyLinkData &btCPUSoftBodySolver::getLinkData()
+{
+	return m_linkData;
+}
+
+btSoftBodyVertexData &btCPUSoftBodySolver::getVertexData()
+{
+	return m_vertexData;
+}
+
+btSoftBodyTriangleData &btCPUSoftBodySolver::getTriangleData()
+{
+	return m_triangleData;
+}
+
+
+
+
+
+
+static Vectormath::Aos::Vector3 toVector3( const btVector3 &vec )
+{
+	Vectormath::Aos::Vector3 outVec( vec.getX(), vec.getY(), vec.getZ() );
+	return outVec;
+}
+
+static Vectormath::Aos::Transform3 toTransform3( const btTransform &transform )
+{
+	Vectormath::Aos::Transform3 outTransform;
+	outTransform.setCol(0, toVector3(transform.getBasis().getColumn(0)));
+	outTransform.setCol(1, toVector3(transform.getBasis().getColumn(1)));
+	outTransform.setCol(2, toVector3(transform.getBasis().getColumn(2)));
+	outTransform.setCol(3, toVector3(transform.getOrigin()));
+	return outTransform;	
+}
+
+void btCPUSoftBodySolver::btAcceleratedSoftBodyInterface::updateBounds( const btVector3 &lowerBound, const btVector3 &upperBound )
+{
+	float scalarMargin = this->getSoftBody()->getCollisionShape()->getMargin();
+	btVector3 vectorMargin( scalarMargin, scalarMargin, scalarMargin );
+	m_softBody->m_bounds[0] = lowerBound - vectorMargin;
+	m_softBody->m_bounds[1] = upperBound + vectorMargin;
+}
+
+
+void btCPUSoftBodySolver::copyBackToSoftBodies()
+{
+	// Loop over soft bodies, copying all the vertex positions back for each body in turn
+	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
+	{
+		btAcceleratedSoftBodyInterface *softBodyInterface = m_softBodySet[ softBodyIndex ];
+		btSoftBody *softBody = softBodyInterface->getSoftBody();
+
+		int firstVertex = softBodyInterface->getFirstVertex();
+		int numVertices = softBodyInterface->getNumVertices();
+
+		// Copy vertices from solver back into the softbody
+		for( int vertex = 0; vertex < numVertices; ++vertex )
+		{
+			using Vectormath::Aos::Point3;
+			Point3 vertexPosition( getVertexData().getVertexPositions()[firstVertex + vertex] );
+
+			softBody->m_nodes[vertex].m_x.setX( vertexPosition.getX() );
+			softBody->m_nodes[vertex].m_x.setY( vertexPosition.getY() );
+			softBody->m_nodes[vertex].m_x.setZ( vertexPosition.getZ() );
+			
+			softBody->m_nodes[vertex].m_n.setX( vertexPosition.getX() );
+			softBody->m_nodes[vertex].m_n.setY( vertexPosition.getY() );
+			softBody->m_nodes[vertex].m_n.setZ( vertexPosition.getZ() );
+		}
+	}
+} // btCPUSoftBodySolver::copyBackToSoftBodies
+
+void btCPUSoftBodySolver::optimize( btAlignedObjectArray< btSoftBody * > &softBodies , bool forceUpdate )
+{
+	if( forceUpdate || m_softBodySet.size() != softBodies.size() )
+	{
+		// Have a change in the soft body set so update, reloading all the data
+		getVertexData().clear();
+		getTriangleData().clear();
+		getLinkData().clear();
+		m_softBodySet.resize(0);
+
+
+		for( int softBodyIndex = 0; softBodyIndex < softBodies.size(); ++softBodyIndex )
+		{
+			btSoftBody *softBody = softBodies[ softBodyIndex ];
+			using Vectormath::Aos::Matrix3;
+			using Vectormath::Aos::Point3;
+
+			// Create SoftBody that will store the information within the solver
+			btAcceleratedSoftBodyInterface *newSoftBody = new btAcceleratedSoftBodyInterface( softBody );
+			m_softBodySet.push_back( newSoftBody );
+
+			m_perClothAcceleration.push_back( toVector3(softBody->getWorldInfo()->m_gravity) );
+			m_perClothDampingFactor.push_back(softBody->m_cfg.kDP);
+			m_perClothVelocityCorrectionCoefficient.push_back( softBody->m_cfg.kVCF );
+			m_perClothLiftFactor.push_back( softBody->m_cfg.kLF );
+			m_perClothDragFactor.push_back( softBody->m_cfg.kDG );
+			m_perClothMediumDensity.push_back(softBody->getWorldInfo()->air_density);
+			m_perClothCollisionObjects.push_back( CollisionObjectIndices(-1, -1) );
+
+			// Add space for new vertices and triangles in the default solver for now
+			// TODO: Include space here for tearing too later
+			int firstVertex = getVertexData().getNumVertices();
+			int numVertices = softBody->m_nodes.size();
+			int maxVertices = numVertices;
+			// Allocate space for new vertices in all the vertex arrays
+			getVertexData().createVertices( maxVertices, softBodyIndex );
+
+			int firstTriangle = getTriangleData().getNumTriangles();
+			int numTriangles = softBody->m_faces.size();
+			int maxTriangles = numTriangles;
+			getTriangleData().createTriangles( maxTriangles );
+
+			// Copy vertices from softbody into the solver
+			for( int vertex = 0; vertex < numVertices; ++vertex )
+			{
+				Point3 multPoint(softBody->m_nodes[vertex].m_x.getX(), softBody->m_nodes[vertex].m_x.getY(), softBody->m_nodes[vertex].m_x.getZ());
+				btSoftBodyVertexData::VertexDescription desc;
+
+				// TODO: Position in the softbody might be pre-transformed
+				// or we may need to adapt for the pose.
+				//desc.setPosition( cloth.getMeshTransform()*multPoint );
+				desc.setPosition( multPoint );
+
+				float vertexInverseMass = softBody->m_nodes[vertex].m_im;
+				desc.setInverseMass(vertexInverseMass);
+				getVertexData().setVertexAt( desc, firstVertex + vertex );
+			}
+
+			// Copy triangles similarly
+			// We're assuming here that vertex indices are based on the firstVertex rather than the entire scene
+			for( int triangle = 0; triangle < numTriangles; ++triangle )
+			{
+				// Note that large array storage is relative to the array not to the cloth
+				// So we need to add firstVertex to each value
+				int vertexIndex0 = (softBody->m_faces[triangle].m_n[0] - &(softBody->m_nodes[0]));
+				int vertexIndex1 = (softBody->m_faces[triangle].m_n[1] - &(softBody->m_nodes[0]));
+				int vertexIndex2 = (softBody->m_faces[triangle].m_n[2] - &(softBody->m_nodes[0]));
+				btSoftBodyTriangleData::TriangleDescription newTriangle(vertexIndex0 + firstVertex, vertexIndex1 + firstVertex, vertexIndex2 + firstVertex);
+				getTriangleData().setTriangleAt( newTriangle, firstTriangle + triangle );
+				
+				// Increase vertex triangle counts for this triangle		
+				getVertexData().getTriangleCount(newTriangle.getVertexSet().vertex0)++;
+				getVertexData().getTriangleCount(newTriangle.getVertexSet().vertex1)++;
+				getVertexData().getTriangleCount(newTriangle.getVertexSet().vertex2)++;
+			}
+
+			int firstLink = getLinkData().getNumLinks();
+			int numLinks = softBody->m_links.size();
+			int maxLinks = numLinks;
+			
+			// Allocate space for the links
+			getLinkData().createLinks( numLinks );
+
+			// Add the links
+			for( int link = 0; link < numLinks; ++link )
+			{
+				int vertexIndex0 = softBody->m_links[link].m_n[0] - &(softBody->m_nodes[0]);
+				int vertexIndex1 = softBody->m_links[link].m_n[1] - &(softBody->m_nodes[0]);
+
+				btSoftBodyLinkData::LinkDescription newLink(vertexIndex0 + firstVertex, vertexIndex1 + firstVertex, softBody->m_links[link].m_material->m_kLST);
+				newLink.setLinkStrength(1.f);
+				getLinkData().setLinkAt(newLink, firstLink + link);
+			}
+			
+			newSoftBody->setFirstVertex( firstVertex );
+			newSoftBody->setFirstTriangle( firstTriangle );
+			newSoftBody->setNumVertices( numVertices );
+			newSoftBody->setMaxVertices( maxVertices );
+			newSoftBody->setNumTriangles( numTriangles );
+			newSoftBody->setMaxTriangles( maxTriangles );
+			newSoftBody->setFirstLink( firstLink );
+			newSoftBody->setNumLinks( numLinks );
+		}
+
+
+
+		updateConstants(0.f);
+	}
+}
+
+
+
+
+void btCPUSoftBodySolver::updateSoftBodies()
+{
+	using namespace Vectormath::Aos;
+
+	int numVertices = m_vertexData.getNumVertices();
+	int numTriangles = m_triangleData.getNumTriangles();
+
+	// Initialise normal and vertex counts
+	for( int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex )
+	{
+		m_vertexData.getArea(vertexIndex) = 0.f;
+		m_vertexData.getNormal(vertexIndex) = Vector3(0.f, 0.f, 0.f);
+	}
+
+	// Update the areas for the triangles and vertices.
+	for( int triangleIndex = 0; triangleIndex < numTriangles; ++triangleIndex )
+	{
+		float &triangleArea( m_triangleData.getTriangleArea( triangleIndex ) );
+		const btSoftBodyTriangleData::TriangleNodeSet &vertices( m_triangleData.getVertexSet(triangleIndex) );
+
+		Point3 &vertexPosition0( m_vertexData.getPosition( vertices.vertex0 ) );
+		Point3 &vertexPosition1( m_vertexData.getPosition( vertices.vertex1 ) );
+		Point3 &vertexPosition2( m_vertexData.getPosition( vertices.vertex2 ) );
+
+		triangleArea = computeTriangleArea( vertexPosition0, vertexPosition1, vertexPosition2 );
+
+		// Add to areas for vertices and increase the count of the number of triangles affecting the vertex
+		m_vertexData.getArea(vertices.vertex0) += triangleArea;
+		m_vertexData.getArea(vertices.vertex1) += triangleArea;
+		m_vertexData.getArea(vertices.vertex2) += triangleArea;
+
+		Point3 &vertex0( m_vertexData.getPosition(vertices.vertex0) );
+		Point3 &vertex1( m_vertexData.getPosition(vertices.vertex1) );
+		Point3 &vertex2( m_vertexData.getPosition(vertices.vertex2) );
+		
+		Vector3 triangleNormal = cross( vertex1-vertex0, vertex2 - vertex0 );
+
+		m_triangleData.getNormal(triangleIndex) = normalize(triangleNormal);
+
+		m_vertexData.getNormal(vertices.vertex0) += triangleNormal;
+		m_vertexData.getNormal(vertices.vertex1) += triangleNormal;
+		m_vertexData.getNormal(vertices.vertex2) += triangleNormal;
+
+	}
+
+	// Normalise the area and normals
+	for( int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex )
+	{
+		m_vertexData.getArea(vertexIndex) /= m_vertexData.getTriangleCount(vertexIndex);
+		m_vertexData.getNormal(vertexIndex) = normalize( m_vertexData.getNormal(vertexIndex) );
+	}
+
+
+	// Clear the collision shape array for the next frame
+	m_collisionObjectDetails.clear();
+
+} // updateSoftBodies
+
+
+Vectormath::Aos::Vector3 btCPUSoftBodySolver::ProjectOnAxis( const Vectormath::Aos::Vector3 &v, const Vectormath::Aos::Vector3 &a )
+{
+	return a*Vectormath::Aos::dot(v, a);
+}
+
+void btCPUSoftBodySolver::ApplyClampedForce( float solverdt, const Vectormath::Aos::Vector3 &force, const Vectormath::Aos::Vector3 &vertexVelocity, float inverseMass, Vectormath::Aos::Vector3 &vertexForce )
+{
+	float dtInverseMass = solverdt*inverseMass;
+	if( Vectormath::Aos::lengthSqr(force * dtInverseMass) > Vectormath::Aos::lengthSqr(vertexVelocity) )
+	{
+		vertexForce -= ProjectOnAxis( vertexVelocity, normalize( force ) )/dtInverseMass;
+	} else {
+		vertexForce += force;
+	}
+}
+
+bool btCPUSoftBodySolver::checkInitialized()
+{
+	return true;
+}
+
+void btCPUSoftBodySolver::applyForces( float solverdt )
+{		
+	using namespace Vectormath::Aos;
+
+	int numVertices = m_vertexData.getNumVertices();			
+	for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
+	{
+		btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
+		const int startVertex = currentCloth->getFirstVertex();
+		const int numVertices = currentCloth->getNumVertices();
+
+		Vector3 velocityChange = m_perClothAcceleration[clothIndex]*solverdt;
+		for( int vertexIndex = startVertex; vertexIndex < (startVertex + numVertices); ++vertexIndex )
+		{
+			float inverseMass = m_vertexData.getInverseMass( vertexIndex );
+			Vector3 &vertexVelocity( m_vertexData.getVelocity( vertexIndex ) );
+
+			// First apply the global acceleration to all vertices
+			if( inverseMass > 0 )
+				vertexVelocity += velocityChange;
+
+			// If it's a non-static vertex
+			if( m_vertexData.getInverseMass(vertexIndex) > 0 )
+			{
+				// Wind effects on a wind-per-cloth basis
+				float liftFactor = m_perClothLiftFactor[clothIndex];
+				float dragFactor = m_perClothDragFactor[clothIndex];
+				if( (liftFactor > 0.f) || (dragFactor > 0.f) )
+				{
+					Vector3 normal = m_vertexData.getNormal(vertexIndex);
+					Vector3 relativeWindVelocity = m_vertexData.getVelocity(vertexIndex) - m_perClothWindVelocity[clothIndex];
+					float relativeSpeedSquared = lengthSqr(relativeWindVelocity);
+					if( relativeSpeedSquared > FLT_EPSILON )
+					{
+						normal = normal * (dot(normal, relativeWindVelocity) < 0 ? -1.f : +1.f);
+						float dvNormal = dot(normal, relativeWindVelocity);
+						if( dvNormal > 0 )
+						{
+							Vector3 force( 0.f, 0.f, 0.f );
+							float c0 = m_vertexData.getArea(vertexIndex) * dvNormal * relativeSpeedSquared / 2;
+							float c1 = c0 * m_perClothMediumDensity[clothIndex];
+							force += normal * (-c1 * liftFactor);
+							force += normalize(relativeWindVelocity)*(-c1 * dragFactor);
+
+							Vectormath::Aos::Vector3 &vertexForce( m_vertexData.getForceAccumulator(vertexIndex) );
+							ApplyClampedForce( solverdt, force, vertexVelocity, inverseMass, vertexForce );
+						}
+					}
+				}
+			}
+		}
+	}
+} // btCPUSoftBodySolver::applyForces
+
+/**
+ * Integrate motion on the solver.
+ */
+void btCPUSoftBodySolver::integrate( float solverdt )
+{
+	using namespace Vectormath::Aos;
+	int numVertices = m_vertexData.getNumVertices();
+	for( int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex )
+	{
+		Point3 &position( m_vertexData.getPosition(vertexIndex) );
+		Point3 &previousPosition( m_vertexData.getPreviousPosition(vertexIndex) );
+		Vector3 &forceAccumulator( m_vertexData.getForceAccumulator(vertexIndex) );
+		Vector3 &velocity( m_vertexData.getVelocity(vertexIndex) );
+		float inverseMass = m_vertexData.getInverseMass(vertexIndex);
+
+		previousPosition = position;
+		velocity += forceAccumulator * inverseMass * solverdt;
+		position += velocity * solverdt;
+		forceAccumulator = Vector3(0.f, 0.f, 0.f);
+	}	
+} // btCPUSoftBodySolver::integrate
+
+float btCPUSoftBodySolver::computeTriangleArea( 
+	const Vectormath::Aos::Point3 &vertex0,
+	const Vectormath::Aos::Point3 &vertex1,
+	const Vectormath::Aos::Point3 &vertex2 )
+{
+	Vectormath::Aos::Vector3 a = vertex1 - vertex0;
+	Vectormath::Aos::Vector3 b = vertex2 - vertex0;
+	Vectormath::Aos::Vector3 crossProduct = cross(a, b);
+	float area = length( crossProduct );
+	return area;
+}
+
+void btCPUSoftBodySolver::updateConstants( float timeStep )
+{
+	using namespace Vectormath::Aos;
+
+	if( m_updateSolverConstants )
+	{
+		m_updateSolverConstants = false;
+
+		// Will have to redo this if we change the structure (tear, maybe) or various other possible changes
+
+		// Initialise link constants
+		const int numLinks = m_linkData.getNumLinks();
+		for( int linkIndex = 0; linkIndex < numLinks; ++linkIndex )
+		{
+			btSoftBodyLinkData::LinkNodePair &vertices( m_linkData.getVertexPair(linkIndex) );
+			m_linkData.getRestLength(linkIndex) = length((m_vertexData.getPosition( vertices.vertex0 ) - m_vertexData.getPosition( vertices.vertex1 )));
+			float invMass0 = m_vertexData.getInverseMass(vertices.vertex0);
+			float invMass1 = m_vertexData.getInverseMass(vertices.vertex1);
+			float linearStiffness = m_linkData.getLinearStiffnessCoefficient(linkIndex);
+			float massLSC = (invMass0 + invMass1)/linearStiffness;
+			m_linkData.getMassLSC(linkIndex) = massLSC;
+			float restLength = m_linkData.getRestLength(linkIndex);
+			float restLengthSquared = restLength*restLength;
+			m_linkData.getRestLengthSquared(linkIndex) = restLengthSquared;
+		}
+	}
+} // btCPUSoftBodySolver::updateConstants
+
+
+
+
+void btCPUSoftBodySolver::updateBounds()
+{	
+	using Vectormath::Aos::Point3;
+
+	for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
+	{
+		btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
+		btVector3 startBound(FLT_MAX, FLT_MAX, FLT_MAX);
+		btVector3 endBound(FLT_MIN, FLT_MIN, FLT_MIN);
+
+		const int startVertex = currentCloth->getFirstVertex();
+		const int numVertices = currentCloth->getNumVertices();
+
+		int endVertex = startVertex + numVertices;
+		for(int vertexIndex = startVertex; vertexIndex < endVertex; ++vertexIndex)
+		{		
+			btVector3 vertexPosition( m_vertexData.getVertexPositions()[vertexIndex].getX(), m_vertexData.getVertexPositions()[vertexIndex].getY(), m_vertexData.getVertexPositions()[vertexIndex].getZ() );
+			startBound.setX( btMin( startBound.getX(), vertexPosition.getX() ) );
+			startBound.setY( btMin( startBound.getY(), vertexPosition.getY() ) );
+			startBound.setZ( btMin( startBound.getZ(), vertexPosition.getZ() ) );
+
+			endBound.setX( btMax( endBound.getX(), vertexPosition.getX() ) );
+			endBound.setY( btMax( endBound.getY(), vertexPosition.getY() ) );
+			endBound.setZ( btMax( endBound.getZ(), vertexPosition.getZ() ) );
+		}
+
+		m_softBodySet[clothIndex]->updateBounds( startBound, endBound );
+	}
+}
+
+
+class btCPUSB_QuickSortCompare
+{
+	public:
+
+	bool operator() ( const btCPUCollisionShapeDescription& a, const btCPUCollisionShapeDescription& b )
+	{
+		return ( a.softBodyIdentifier < b.softBodyIdentifier );
+	}
+};
+
+/**
+ * Sort the collision object details array and generate indexing into it for the per-cloth collision object array.
+ */
+void btCPUSoftBodySolver::prepareCollisionConstraints()
+{
+	// First do a simple sort on the collision objects
+	btAlignedObjectArray<int> numObjectsPerClothPrefixSum;
+	btAlignedObjectArray<int> numObjectsPerCloth;
+	numObjectsPerCloth.resize( m_softBodySet.size(), 0 );
+	numObjectsPerClothPrefixSum.resize( m_softBodySet.size(), 0 );
+
+	if (!m_perClothCollisionObjects.size())
+		return;
+
+	m_collisionObjectDetails.quickSort( btCPUSB_QuickSortCompare() );
+
+	// Generating indexing for perClothCollisionObjects
+	// First clear the previous values with the "no collision object for cloth" constant
+	for( int clothIndex = 0; clothIndex < m_perClothCollisionObjects.size(); ++clothIndex )
+	{
+		m_perClothCollisionObjects[clothIndex].firstObject = -1;
+		m_perClothCollisionObjects[clothIndex].endObject = -1;
+	}
+	int currentCloth = 0;
+	int startIndex = 0;
+	for( int collisionObject = 0; collisionObject < m_collisionObjectDetails.size(); ++collisionObject )
+	{
+		int nextCloth = m_collisionObjectDetails[collisionObject].softBodyIdentifier;
+		if( nextCloth != currentCloth )
+		{	
+			// Changed cloth in the array
+			// Set the end index and the range is what we need for currentCloth
+			m_perClothCollisionObjects[currentCloth].firstObject = startIndex;
+			m_perClothCollisionObjects[currentCloth].endObject = collisionObject;
+			currentCloth = nextCloth;
+			startIndex = collisionObject;
+		}
+	}
+
+	// And update last cloth	
+	m_perClothCollisionObjects[currentCloth].firstObject = startIndex;
+	m_perClothCollisionObjects[currentCloth].endObject =  m_collisionObjectDetails.size();
+	
+} // prepareCollisionConstraints
+
+
+void btCPUSoftBodySolver::solveConstraints( float solverdt )
+{
+	using Vectormath::Aos::Vector3;
+	using Vectormath::Aos::Point3;
+	using Vectormath::Aos::lengthSqr;
+	using Vectormath::Aos::dot;
+
+	// Prepare links
+	int numLinks = m_linkData.getNumLinks();
+	int numVertices = m_vertexData.getNumVertices();
+
+	float kst = 1.f;
+
+	for( int linkIndex = 0; linkIndex < numLinks; ++linkIndex )
+	{			
+		btSoftBodyLinkData::LinkNodePair &nodePair( m_linkData.getVertexPair(linkIndex) );
+		Vector3 currentLength = m_vertexData.getPreviousPosition( nodePair.vertex1 ) - m_vertexData.getPreviousPosition( nodePair.vertex0 );
+		m_linkData.getCurrentLength(linkIndex) = currentLength;
+
+		// If mass at both ends of links is 0 (both static points) then we don't want this information.
+		// In reality this would be a fairly pointless link, but it could have been inserted
+		float linkLengthRatio = 0;
+		if( m_linkData.getMassLSC(linkIndex) > 0 )
+			linkLengthRatio = 1.f/(lengthSqr(currentLength) * m_linkData.getMassLSC(linkIndex));
+		m_linkData.getLinkLengthRatio(linkIndex) = linkLengthRatio;
+
+	}
+
+
+	prepareCollisionConstraints();
+
+
+	for( int iteration = 0; iteration < m_numberOfVelocityIterations ; ++iteration )
+	{
+		// Solve velocity
+		for(int linkIndex = 0; linkIndex < numLinks; ++linkIndex)
+		{				
+
+			int vertexIndex0 = m_linkData.getVertexPair(linkIndex).vertex0;
+			int vertexIndex1 = m_linkData.getVertexPair(linkIndex).vertex1;
+
+			float j = -dot(m_linkData.getCurrentLength(linkIndex), m_vertexData.getVelocity(vertexIndex0) - m_vertexData.getVelocity(vertexIndex1)) * m_linkData.getLinkLengthRatio(linkIndex)*kst;
+			
+			// If both ends of the link have no mass then this will be zero. Catch that case.
+			// TODO: Should really catch the /0 in the link setup, too
+			//if(psb->m_linksc0[i]>0)
+			{
+				m_vertexData.getVelocity(vertexIndex0) = m_vertexData.getVelocity(vertexIndex0) + m_linkData.getCurrentLength(linkIndex)*j*m_vertexData.getInverseMass(vertexIndex0);
+				m_vertexData.getVelocity(vertexIndex1) = m_vertexData.getVelocity(vertexIndex1) - m_linkData.getCurrentLength(linkIndex)*j*m_vertexData.getInverseMass(vertexIndex1);
+			}
+		}
+	}
+
+	// Compute new positions from velocity
+	// Also update the previous position so that our position computation is now based on the new position from the velocity solution
+	// rather than based directly on the original positions
+	if( m_numberOfVelocityIterations > 0 )
+	{
+		for(int vertexIndex = 0; vertexIndex < numVertices; ++vertexIndex)
+		{				
+			m_vertexData.getPosition(vertexIndex) = m_vertexData.getPreviousPosition(vertexIndex) + m_vertexData.getVelocity(vertexIndex) * solverdt;
+			m_vertexData.getPreviousPosition(vertexIndex) = m_vertexData.getPosition(vertexIndex);
+		}
+	}
+
+	// Solve drift
+	for( int iteration = 0; iteration < m_numberOfPositionIterations ; ++iteration )
+	{
+		for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
+		{
+			btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
+
+			const int startLink = currentCloth->getFirstLink();
+			const int numLinks = currentCloth->getNumLinks();
+
+			int endLink = startLink + numLinks;
+			for(int linkIndex = startLink; linkIndex < endLink; ++linkIndex)
+			{			
+				int vertexIndex0 = m_linkData.getVertexPair(linkIndex).vertex0;
+				int vertexIndex1 = m_linkData.getVertexPair(linkIndex).vertex1;
+
+				float massLSC = m_linkData.getMassLSC(linkIndex);
+				if( massLSC > 0.f )
+				{
+					Point3 &vertexPosition0( m_vertexData.getPosition( vertexIndex0 ) );
+					Point3 &vertexPosition1( m_vertexData.getPosition( vertexIndex1 ) );
+
+					Vector3 del = vertexPosition1 - vertexPosition0;
+					float len = lengthSqr(del);
+					float restLength2 = m_linkData.getRestLengthSquared(linkIndex);
+					float k = ((restLength2 - len) / (massLSC * (restLength2 + len) ) )*kst;
+
+					vertexPosition0 -= del*(k*m_vertexData.getInverseMass(vertexIndex0));
+					vertexPosition1 += del*(k*m_vertexData.getInverseMass(vertexIndex1));
+				}
+			}
+		}
+	}
+
+	// Clear forces so that friction is applied correctly
+	for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
+	{
+		btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
+
+		const int startLink = currentCloth->getFirstLink();
+		const int numLinks = currentCloth->getNumLinks();
+		const int startVertex = currentCloth->getFirstVertex();
+		const int numVertices = currentCloth->getNumVertices();
+		const int lastVertex = startVertex + numVertices;
+		// Update the velocities based on the change in position
+		// TODO: Damping should only be applied to the action of link constraints so the cloth still falls but then moves stiffly once it hits something
+		float velocityCoefficient = (1.f - m_perClothDampingFactor[clothIndex]);
+		float velocityCorrectionCoefficient = m_perClothVelocityCorrectionCoefficient[clothIndex];
+		float isolverDt = 1.f/solverdt;
+
+		for(int vertexIndex = startVertex; vertexIndex < lastVertex; ++vertexIndex)
+		{
+			m_vertexData.getForceAccumulator( vertexIndex ) = Vector3(0.f, 0.f, 0.f);
+		}
+	}
+	 
+
+	
+
+	// Solve collision constraints
+	// Very simple solver that pushes the vertex out of collision imposters for now
+	// to test integration with the broad phase code.
+	// May also want to put this into position solver loop every n iterations depending on
+	// how it behaves
+	for( int clothIndex = 0; clothIndex < m_softBodySet.size(); ++clothIndex )
+	{
+		btAcceleratedSoftBodyInterface *currentCloth = m_softBodySet[clothIndex];
+		
+		float clothFriction = currentCloth->getSoftBody()->getFriction();
+
+		const int startVertex = currentCloth->getFirstVertex();
+		const int numVertices = currentCloth->getNumVertices();
+		int endVertex = startVertex + numVertices;		
+
+		float velocityCoefficient = (1.f - m_perClothDampingFactor[clothIndex]);
+		float velocityCorrectionCoefficient = m_perClothVelocityCorrectionCoefficient[clothIndex];
+		float isolverDt = 1.f/solverdt;
+
+		int startObject = m_perClothCollisionObjects[clothIndex].firstObject;
+		int endObject = m_perClothCollisionObjects[clothIndex].endObject;
+
+		if( endObject == startObject )
+		{
+			// No collisions so just do the force update
+			for(int vertexIndex = startVertex; vertexIndex < endVertex; ++vertexIndex)
+			{
+				m_vertexData.getForceAccumulator( vertexIndex ) = Vector3(0.f, 0.f, 0.f);
+			}
+
+			// Recompute velocity based on updated position inclusive of drift
+			for(int vertexIndex = startVertex; vertexIndex < endVertex; ++vertexIndex)
+			{
+				m_vertexData.getVelocity(vertexIndex) = (m_vertexData.getPosition(vertexIndex) - m_vertexData.getPreviousPosition(vertexIndex)) * velocityCoefficient * isolverDt;
+			}
+		} else {
+
+			for( int collisionObject = startObject; collisionObject < endObject; ++collisionObject )
+			{
+				btCPUCollisionShapeDescription &shapeDescription( m_collisionObjectDetails[collisionObject] );
+
+				float colliderFriction = shapeDescription.friction;
+
+				if( shapeDescription.collisionShapeType == CAPSULE_SHAPE_PROXYTYPE )
+				{
+					using namespace Vectormath::Aos;
+
+					float capsuleHalfHeight = shapeDescription.shapeInformation.capsule.halfHeight;
+					float capsuleRadius = shapeDescription.shapeInformation.capsule.radius;
+					int capsuleUpAxis = shapeDescription.shapeInformation.capsule.upAxis;
+					float capsuleMargin = shapeDescription.margin;
+					
+					Transform3 worldTransform = shapeDescription.shapeTransform;
+
+					// As this is a GPU comparison solver just iterate over the vertices
+					for( int vertexIndex = startVertex; vertexIndex < endVertex; ++vertexIndex )
+					{		
+						// Clear force for vertex first
+						m_vertexData.getForceAccumulator( vertexIndex ) = Vector3(0.f, 0.f, 0.f);
+
+						Point3 vertex( m_vertexData.getPosition( vertexIndex ) );
+
+						// Correctly define the centerline depending on the upAxis
+						Point3 c1(0.f, 0.f, 0.f); 
+						Point3 c2(0.f, 0.f, 0.f);
+						if( capsuleUpAxis == 0 ) {
+							c1.setX(-capsuleHalfHeight);
+							c2.setX(capsuleHalfHeight);
+						} else if( capsuleUpAxis == 1 ) {							
+							c1.setY(-capsuleHalfHeight);
+							c2.setY(capsuleHalfHeight);
+						} else {
+							c1.setZ(-capsuleHalfHeight);
+							c2.setZ(capsuleHalfHeight);						
+						}
+
+						Point3 worldC1 = worldTransform * c1;
+						Point3 worldC2 = worldTransform * c2;
+						Vector3 segment = worldC2 - worldC1;
+
+						// compute distance of tangent to vertex along line segment in capsule
+						float distanceAlongSegment = -( dot( worldC1 - vertex, segment ) / lengthSqr(segment) );
+
+						Point3 closestPoint = (worldC1 + segment * distanceAlongSegment);
+						float distanceFromLine = length(vertex - closestPoint);
+						float distanceFromC1 = length(worldC1 - vertex);
+						float distanceFromC2 = length(worldC2 - vertex);
+					
+						// Final distance from collision, point to push from, direction to push in
+						// for impulse force
+						float distance;
+						Point3 sourcePoint;
+						Vector3 normalVector;
+						if( distanceAlongSegment < 0 )
+						{
+							distance = distanceFromC1;
+							sourcePoint = worldC1;
+							normalVector = normalize(vertex - worldC1);
+						} else if( distanceAlongSegment > 1.f ) {
+							distance = distanceFromC2;
+							sourcePoint = worldC2;
+							normalVector = normalize(vertex - worldC2);	
+						} else {
+							distance = distanceFromLine;
+							sourcePoint = closestPoint;
+							normalVector = normalize(vertex - closestPoint);
+						}
+						
+						Vector3 colliderLinearVelocity( shapeDescription.linearVelocity );
+						Vector3 colliderAngularVelocity( shapeDescription.angularVelocity );
+						Vector3 velocityOfSurfacePoint = colliderLinearVelocity + cross(colliderAngularVelocity, Vector3(vertex) - worldTransform.getTranslation());
+
+						float minDistance = capsuleRadius + capsuleMargin;
+						bool collided = false;
+
+						if( distance < minDistance )
+						{
+							// Project back to surface along normal
+							Vectormath::Aos::Point3 sourcePos = m_vertexData.getPosition( vertexIndex );
+							Vectormath::Aos::Vector3 posChange = (minDistance - distance)*normalVector*0.9;
+							//if( length(posChange) > 1 )
+							//	std::cerr << "Poschange: " << length(posChange) << "\n";
+							
+							Vectormath::Aos::Point3 newPos = sourcePos + posChange;
+							m_vertexData.getPosition( vertexIndex ) = newPos;
+							//m_vertexData.getPosition( vertexIndex ) = m_vertexData.getPosition( vertexIndex )  + (minDistance - distance)*normalVector*0.9;
+
+							// Experiment with moving back along source vector.
+							// Removes all ability to slide because it projects back along the vector length so it would undo lateral movement.
+							// TODO: This isn't quite right because we should take the movement of the collider into account as well
+							/*Vector3 incomingMoveVector( normalize(m_vertexData.getPreviousPosition(vertexIndex) - m_vertexData.getPosition(vertexIndex)) );
+							Vector3 normalDirectionMoveOut( (minDistance - distance)*normalVector*0.9 );
+							float distanceOnIncomingVector = dot(normalDirectionMoveOut, incomingMoveVector);
+							Vector3 vectorCorrection( distanceOnIncomingVector*incomingMoveVector );
+							m_vertexData.getPosition( vertexIndex ) = m_vertexData.getPosition( vertexIndex ) + vectorCorrection;*/
+
+
+							collided = true;
+						}
+
+						// Update velocity of vertex based on position
+						m_vertexData.getVelocity(vertexIndex) = (m_vertexData.getPosition(vertexIndex) - m_vertexData.getPreviousPosition(vertexIndex)) * velocityCoefficient * isolverDt;
+
+						// If we collided before we are on the surface so have friction
+						if( collided )
+						{
+							// Compute friction
+
+							// TODO: Just vertex velocity not enough, really we need the velocity 
+							// relative to closest point on the surface of the collider
+							Vector3 vertexVelocity( m_vertexData.getVelocity(vertexIndex) );
+							Vector3 relativeVelocity( vertexVelocity - velocityOfSurfacePoint );
+
+
+							// First compute vectors for plane perpendicular to normal vector
+							// Cross any vector with normal vector first then cross the normal with it again
+							Vector3 p1(normalize(cross(normalVector, segment)));
+							Vector3 p2(normalize(cross(p1, normalVector)));
+							// Full friction is sum of velocities in each direction of plane.
+							Vector3 frictionVector(p1*dot(relativeVelocity, p1) + p2*dot(relativeVelocity, p2));
+
+							// Real friction is peak friction corrected by friction coefficients.
+							frictionVector = frictionVector*(colliderFriction*clothFriction);
+
+							float approachSpeed = dot( relativeVelocity, normalVector );						
+		
+							// For now just update vertex position by moving to radius distance along the push vector
+							// Could use this as the basis for simple vector distance constraint for the point later, possibly?
+							// That way in the main solver loop all shape types could be the same... though when
+							// we need to apply bi-directionally it becomes more complicated
+					
+							// Add friction vector to the force accumulator
+							Vector3 &currentForce( m_vertexData.getForceAccumulator( vertexIndex ) );
+						
+							// Only apply if the vertex is moving towards the object to reduce jitter error
+							if( approachSpeed <= 0.0 )
+								currentForce -= frictionVector;
+						}
+					}
+				}
+			} // for( int collisionObject = startObject; collisionObject < endObject; ++collisionObject )
+		} // if( endObject == startObject )
+	}
+
+			
+
+
+} // btCPUSoftBodySolver::solveConstraints
+
+
+btCPUSoftBodySolver::btAcceleratedSoftBodyInterface *btCPUSoftBodySolver::findSoftBodyInterface( const btSoftBody* const softBody )
+{
+	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
+	{
+		btAcceleratedSoftBodyInterface *softBodyInterface = m_softBodySet[softBodyIndex];
+		if( softBodyInterface->getSoftBody() == softBody )
+			return softBodyInterface;
+	}
+	return 0;
+}
+
+const btCPUSoftBodySolver::btAcceleratedSoftBodyInterface * const btCPUSoftBodySolver::findSoftBodyInterface( const btSoftBody* const softBody ) const
+{
+	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
+	{
+		const btAcceleratedSoftBodyInterface *const softBodyInterface = m_softBodySet[softBodyIndex];
+		if( softBodyInterface->getSoftBody() == softBody )
+			return softBodyInterface;
+	}
+	return 0;
+}
+
+int btCPUSoftBodySolver::findSoftBodyIndex( const btSoftBody* const softBody )
+{
+	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
+	{
+		btAcceleratedSoftBodyInterface *softBodyInterface = m_softBodySet[softBodyIndex];
+		if( softBodyInterface->getSoftBody() == softBody )
+			return softBodyIndex;
+	}
+	return 1;
+}
+
+void btSoftBodySolverOutputCPUtoCPU::copySoftBodyToVertexBuffer( const btSoftBody * const softBody, btVertexBufferDescriptor *vertexBuffer )
+{
+	// Currently only support CPU output buffers
+	
+	const btSoftBodySolver *solver = softBody->getSoftBodySolver();
+	btAssert( solver->getSolverType() == btSoftBodySolver::CPU_SOLVER );
+	const btCPUSoftBodySolver *cpuSolver = static_cast< const btCPUSoftBodySolver * >( solver );
+	const btCPUSoftBodySolver::btAcceleratedSoftBodyInterface * const currentCloth = cpuSolver->findSoftBodyInterface( softBody );
+	const btSoftBodyVertexData &vertexData( cpuSolver->m_vertexData );
+
+	if( vertexBuffer->getBufferType() == btVertexBufferDescriptor::CPU_BUFFER )
+	{		
+		const int firstVertex = currentCloth->getFirstVertex();
+		const int lastVertex = firstVertex + currentCloth->getNumVertices();
+		const btCPUVertexBufferDescriptor *cpuVertexBuffer = static_cast< btCPUVertexBufferDescriptor* >(vertexBuffer);						
+		float *basePointer = cpuVertexBuffer->getBasePointer();						
+
+		if( vertexBuffer->hasVertexPositions() )
+		{
+			const int vertexOffset = cpuVertexBuffer->getVertexOffset();
+			const int vertexStride = cpuVertexBuffer->getVertexStride();
+			float *vertexPointer = basePointer + vertexOffset;
+
+			for( int vertexIndex = firstVertex; vertexIndex < lastVertex; ++vertexIndex )
+			{
+				Vectormath::Aos::Point3 position = vertexData.getPosition(vertexIndex);
+				*(vertexPointer + 0) = position.getX();
+				*(vertexPointer + 1) = position.getY();
+				*(vertexPointer + 2) = position.getZ();
+				vertexPointer += vertexStride;
+			}
+		}
+		if( vertexBuffer->hasNormals() )
+		{
+			const int normalOffset = cpuVertexBuffer->getNormalOffset();
+			const int normalStride = cpuVertexBuffer->getNormalStride();
+			float *normalPointer = basePointer + normalOffset;
+
+			for( int vertexIndex = firstVertex; vertexIndex < lastVertex; ++vertexIndex )
+			{
+				Vectormath::Aos::Vector3 normal = vertexData.getNormal(vertexIndex);
+				*(normalPointer + 0) = normal.getX();
+				*(normalPointer + 1) = normal.getY();
+				*(normalPointer + 2) = normal.getZ();
+				normalPointer += normalStride;
+			}
+		}
+	} else {
+		btAssert( 0=="Invalid vertex buffer descriptor used in CPU output." );
+	}
+} // btCPUSoftBodySolver::outputToVertexBuffers
+
+void btCPUSoftBodySolver::processCollision( btSoftBody*, btSoftBody *)
+{
+
+}
+
+// Add the collision object to the set to deal with for a particular soft body
+void btCPUSoftBodySolver::processCollision( btSoftBody *softBody, btCollisionObject* collisionObject )
+{
+	int softBodyIndex = findSoftBodyIndex( softBody );
+
+	if( softBodyIndex >= 0 )
+	{
+		btCollisionShape *collisionShape = collisionObject->getCollisionShape();
+		float friction = collisionObject->getFriction();
+		int shapeType = collisionShape->getShapeType();
+		if( shapeType == CAPSULE_SHAPE_PROXYTYPE )
+		{
+			// Add to the list of expected collision objects
+			btCPUCollisionShapeDescription newCollisionShapeDescription;
+			newCollisionShapeDescription.softBodyIdentifier = softBodyIndex;
+			newCollisionShapeDescription.collisionShapeType = shapeType;
+			newCollisionShapeDescription.shapeTransform = toTransform3(collisionObject->getWorldTransform());
+			btCapsuleShape *capsule = static_cast<btCapsuleShape*>( collisionShape );
+			newCollisionShapeDescription.shapeInformation.capsule.radius = capsule->getRadius();
+			newCollisionShapeDescription.shapeInformation.capsule.halfHeight = capsule->getHalfHeight();
+			newCollisionShapeDescription.shapeInformation.capsule.upAxis = capsule->getUpAxis();
+			newCollisionShapeDescription.margin = capsule->getMargin();
+			newCollisionShapeDescription.friction = friction;
+			btRigidBody* body = static_cast< btRigidBody* >( collisionObject );
+			newCollisionShapeDescription.linearVelocity = toVector3(body->getLinearVelocity());
+			newCollisionShapeDescription.angularVelocity = toVector3(body->getAngularVelocity());
+			m_collisionObjectDetails.push_back( newCollisionShapeDescription );
+		} else {
+			btAssert("Unsupported collision shape type\n");
+		}
+	} else {
+		btAssert("Unknown soft body");
+	}
+} // btCPUSoftBodySolver::processCollision
+
+
+void btCPUSoftBodySolver::predictMotion( float timeStep )
+{
+	// Fill the force arrays with current acceleration data etc
+	m_perClothWindVelocity.resize( m_softBodySet.size() );
+	for( int softBodyIndex = 0; softBodyIndex < m_softBodySet.size(); ++softBodyIndex )
+	{
+		btSoftBody *softBody = m_softBodySet[softBodyIndex]->getSoftBody();
+		
+		m_perClothWindVelocity[softBodyIndex] = toVector3(softBody->getWindVelocity());
+	}
+
+
+	// Apply forces that we know about to the cloths
+	applyForces(  timeStep * getTimeScale() );
+
+	// Itegrate motion for all soft bodies dealt with by the solver
+	integrate( timeStep * getTimeScale() );
+
+	// Update bounds
+	// Will update the bounds for all softBodies being dealt with by the solver and 
+	// set the values in the btSoftBody object
+	updateBounds();
+
+	// End prediction work for solvers
+}
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h
new file mode 100644
index 0000000..25d04cd
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h
@@ -0,0 +1,370 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_ACCELERATED_SOFT_BODY_CPU_SOLVER_H
+#define BT_ACCELERATED_SOFT_BODY_CPU_SOLVER_H
+
+#include "vectormath/vmInclude.h"
+#include "BulletSoftBody/btSoftBodySolvers.h"
+#include "BulletSoftBody/btSoftBodySolverVertexBuffer.h"
+#include "BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h"
+
+struct btCPUCollisionShapeDescription
+{
+	int softBodyIdentifier;
+	int collisionShapeType;
+	Vectormath::Aos::Transform3 shapeTransform;
+	union
+	{
+		struct Sphere
+		{
+			float radius;
+		} sphere;
+		struct Capsule
+		{
+			float radius;
+			float halfHeight;
+			int upAxis;
+		} capsule;
+	} shapeInformation;
+	
+	float margin;
+	float friction;
+	Vectormath::Aos::Vector3 linearVelocity;
+	Vectormath::Aos::Vector3 angularVelocity;
+
+	btCPUCollisionShapeDescription()
+	{
+		collisionShapeType = 0;
+		margin = 0;
+		friction = 0;
+	}
+};
+
+class btCPUSoftBodySolver : public btSoftBodySolver
+{
+protected:
+	/**
+	 * Entry in the collision shape array.
+	 * Specifies the shape type, the transform matrix and the necessary details of the collisionShape.
+	 */
+
+
+	// Public because output classes need it. This is a better encapsulation to break in the short term
+	// Than having the solvers themselves need dependencies on DX, CL etc unnecessarily
+public:
+	
+	struct CollisionObjectIndices
+	{
+		CollisionObjectIndices( int f, int e )
+		{
+			firstObject = f;
+			endObject = e;
+		}
+
+		int firstObject;
+		int endObject;
+	};
+
+	/**
+	 * SoftBody class to maintain information about a soft body instance
+	 * within a solver.
+	 * This data addresses the main solver arrays.
+	 */
+	class btAcceleratedSoftBodyInterface
+	{
+	protected:
+		/** Current number of vertices that are part of this cloth */
+		int m_numVertices;
+		/** Maximum number of vertices allocated to be part of this cloth */
+		int m_maxVertices;
+		/** Current number of triangles that are part of this cloth */
+		int m_numTriangles;
+		/** Maximum number of triangles allocated to be part of this cloth */
+		int m_maxTriangles;
+		/** Index of first vertex in the world allocated to this cloth */
+		int m_firstVertex;
+		/** Index of first triangle in the world allocated to this cloth */
+		int m_firstTriangle;
+		/** Index of first link in the world allocated to this cloth */
+		int m_firstLink;
+		/** Maximum number of links allocated to this cloth */
+		int m_maxLinks;
+		/** Current number of links allocated to this cloth */
+		int m_numLinks;
+
+		/** The actual soft body this data represents */
+		btSoftBody *m_softBody;
+
+
+	public:
+		btAcceleratedSoftBodyInterface( btSoftBody *softBody ) :
+		  m_softBody( softBody )
+		{
+			m_numVertices = 0;
+			m_maxVertices = 0;
+			m_numTriangles = 0;
+			m_maxTriangles = 0;
+			m_firstVertex = 0;
+			m_firstTriangle = 0;
+			m_firstLink = 0;
+			m_maxLinks = 0;
+			m_numLinks = 0;
+		}
+		int getNumVertices() const
+		{
+			return m_numVertices;
+		}
+
+		int getNumTriangles() const
+		{
+			return m_numTriangles;
+		}
+
+		int getMaxVertices() const
+		{
+			return m_maxVertices;
+		}
+
+		int getMaxTriangles() const
+		{
+			return m_maxTriangles;
+		}
+
+		int getFirstVertex() const
+		{
+			return m_firstVertex;
+		}
+
+		int getFirstTriangle() const
+		{
+			return m_firstTriangle;
+		}
+
+		/**
+		 * Update the bounds in the btSoftBody object
+		 */
+		void updateBounds( const btVector3 &lowerBound, const btVector3 &upperBound );
+
+		// TODO: All of these set functions will have to do checks and
+		// update the world because restructuring of the arrays will be necessary
+		// Reasonable use of "friend"?
+		void setNumVertices( int numVertices )
+		{
+			m_numVertices = numVertices;
+		}	
+		
+		void setNumTriangles( int numTriangles )
+		{
+			m_numTriangles = numTriangles;
+		}
+
+		void setMaxVertices( int maxVertices )
+		{
+			m_maxVertices = maxVertices;
+		}
+
+		void setMaxTriangles( int maxTriangles )
+		{
+			m_maxTriangles = maxTriangles;
+		}
+
+		void setFirstVertex( int firstVertex )
+		{
+			m_firstVertex = firstVertex;
+		}
+
+		void setFirstTriangle( int firstTriangle )
+		{
+			m_firstTriangle = firstTriangle;
+		}
+
+		void setMaxLinks( int maxLinks )
+		{
+			m_maxLinks = maxLinks;
+		}
+
+		void setNumLinks( int numLinks )
+		{
+			m_numLinks = numLinks;
+		}
+
+		void setFirstLink( int firstLink )
+		{
+			m_firstLink = firstLink;
+		}
+
+		int getMaxLinks() const
+		{
+			return m_maxLinks;
+		}
+
+		int getNumLinks() const
+		{
+			return m_numLinks;
+		}
+
+		int getFirstLink() const
+		{
+			return m_firstLink;
+		}
+
+		btSoftBody* getSoftBody()
+		{
+			return m_softBody;
+		}
+
+		const btSoftBody* const getSoftBody() const
+		{
+			return m_softBody;
+		}
+	};
+	
+	btSoftBodyLinkData m_linkData;
+	btSoftBodyVertexData m_vertexData;
+	btSoftBodyTriangleData m_triangleData;
+
+protected:
+
+
+
+		
+	/** Variable to define whether we need to update solver constants on the next iteration */
+	bool m_updateSolverConstants;
+
+	/** 
+	 * Cloths owned by this solver.
+	 * Only our cloths are in this array.
+	 */
+	btAlignedObjectArray< btAcceleratedSoftBodyInterface * > m_softBodySet;
+	
+	/** Acceleration value to be applied to all non-static vertices in the solver. 
+	 * Index n is cloth n, array sized by number of cloths in the world not the solver. 
+	 */
+	btAlignedObjectArray< Vectormath::Aos::Vector3 > m_perClothAcceleration;
+
+	/** Wind velocity to be applied normal to all non-static vertices in the solver. 
+	 * Index n is cloth n, array sized by number of cloths in the world not the solver. 
+	 */
+	btAlignedObjectArray< Vectormath::Aos::Vector3 > m_perClothWindVelocity;
+
+	/** Velocity damping factor */
+	btAlignedObjectArray< float > m_perClothDampingFactor;
+
+	/** Velocity correction coefficient */
+	btAlignedObjectArray< float > m_perClothVelocityCorrectionCoefficient;
+
+	/** Lift parameter for wind effect on cloth. */
+	btAlignedObjectArray< float > m_perClothLiftFactor;
+	
+	/** Drag parameter for wind effect on cloth. */
+	btAlignedObjectArray< float > m_perClothDragFactor;
+
+	/** Density of the medium in which each cloth sits */
+	btAlignedObjectArray< float > m_perClothMediumDensity;
+
+	/** 
+	 * Collision shape details: pair of index of first collision shape for the cloth and number of collision objects.
+	 */
+	btAlignedObjectArray< CollisionObjectIndices > m_perClothCollisionObjects;
+
+	/** 
+	 * Collision shapes being passed across to the cloths in this solver.
+	 */
+	btAlignedObjectArray< btCPUCollisionShapeDescription > m_collisionObjectDetails;
+
+
+	void prepareCollisionConstraints();
+
+	Vectormath::Aos::Vector3 ProjectOnAxis( const Vectormath::Aos::Vector3 &v, const Vectormath::Aos::Vector3 &a );
+
+	void ApplyClampedForce( float solverdt, const Vectormath::Aos::Vector3 &force, const Vectormath::Aos::Vector3 &vertexVelocity, float inverseMass, Vectormath::Aos::Vector3 &vertexForce );
+	
+	float computeTriangleArea( 
+		const Vectormath::Aos::Point3 &vertex0,
+		const Vectormath::Aos::Point3 &vertex1,
+		const Vectormath::Aos::Point3 &vertex2 );
+
+	void applyForces( float solverdt );
+	void integrate( float solverdt );
+	void updateConstants( float timeStep );
+	int findSoftBodyIndex( const btSoftBody* const softBody );
+	
+	/** Update the bounds of the soft body objects in the solver */
+	void updateBounds();
+
+
+public:
+	btCPUSoftBodySolver();
+	
+	virtual ~btCPUSoftBodySolver();
+
+	
+	virtual SolverTypes getSolverType() const
+	{
+		return CPU_SOLVER;
+	}
+
+
+	virtual btSoftBodyLinkData &getLinkData();
+
+	virtual btSoftBodyVertexData &getVertexData();
+
+	virtual btSoftBodyTriangleData &getTriangleData();
+
+
+
+	btAcceleratedSoftBodyInterface *findSoftBodyInterface( const btSoftBody* const softBody );
+	const btAcceleratedSoftBodyInterface * const findSoftBodyInterface( const btSoftBody* const softBody ) const;
+
+
+
+	virtual bool checkInitialized();
+
+	virtual void updateSoftBodies( );
+
+	virtual void optimize( btAlignedObjectArray< btSoftBody * > &softBodies , bool forceUpdate=false);
+
+	virtual void copyBackToSoftBodies();
+
+	virtual void solveConstraints( float solverdt );
+
+	virtual void predictMotion( float solverdt );
+
+	virtual void processCollision( btSoftBody *, btCollisionObject* );
+
+	virtual void processCollision( btSoftBody*, btSoftBody *);
+
+};
+
+
+/** 
+ * Class to manage movement of data from a solver to a given target.
+ * This version is the CPU to CPU generic version.
+ */
+class btSoftBodySolverOutputCPUtoCPU : public btSoftBodySolverOutput
+{
+protected:
+
+public:
+	btSoftBodySolverOutputCPUtoCPU()
+	{
+	}
+
+	/** Output current computed vertex data to the vertex buffers for all cloths in the solver. */
+	virtual void copySoftBodyToVertexBuffer( const btSoftBody * const softBody, btVertexBufferDescriptor *vertexBuffer );
+};
+
+#endif // #ifndef BT_ACCELERATED_SOFT_BODY_CPU_SOLVER_H
\ No newline at end of file
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h b/hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h
new file mode 100644
index 0000000..b2da4ef
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/HeapManager.h
@@ -0,0 +1,117 @@
+/*
+   Copyright (C) 2009 Sony Computer Entertainment Inc.
+   All rights reserved.
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+*/
+
+#ifndef BT_HEAP_MANAGER_H__
+#define BT_HEAP_MANAGER_H__
+
+#ifdef __SPU__
+	#define HEAP_STACK_SIZE 32
+#else
+	#define HEAP_STACK_SIZE 64
+#endif
+
+#define MIN_ALLOC_SIZE 16
+
+
+class HeapManager
+{
+private:
+	ATTRIBUTE_ALIGNED16(unsigned char *mHeap);
+	ATTRIBUTE_ALIGNED16(unsigned int mHeapBytes);
+	ATTRIBUTE_ALIGNED16(unsigned char *mPoolStack[HEAP_STACK_SIZE]);
+	ATTRIBUTE_ALIGNED16(unsigned int mCurStack);
+	
+public:
+	enum {ALIGN16,ALIGN128};
+
+	HeapManager(unsigned char *buf,int bytes)
+	{
+		mHeap = buf;
+		mHeapBytes = bytes;
+		clear();
+	}
+	
+	~HeapManager()
+	{
+	}
+	
+	int getAllocated()
+	{
+		return (int)(mPoolStack[mCurStack]-mHeap);
+	}
+	
+	int getRest()
+	{
+		return mHeapBytes-getAllocated();
+	}
+
+	void *allocate(size_t bytes,int alignment = ALIGN16)
+	{
+		if(bytes <= 0) bytes = MIN_ALLOC_SIZE;
+		btAssert(mCurStack < (HEAP_STACK_SIZE-1));
+
+		
+#if defined(_WIN64) || defined(__LP64__) || defined(__x86_64__)
+		unsigned long long p = (unsigned long long )mPoolStack[mCurStack];
+		if(alignment == ALIGN128) {
+			p = ((p+127) & 0xffffffffffffff80);
+			bytes = (bytes+127) & 0xffffffffffffff80;
+		}
+		else {
+			bytes = (bytes+15) & 0xfffffffffffffff0;
+		}
+
+		btAssert(bytes <=(mHeapBytes-(p-(unsigned long long )mHeap)) );
+		
+#else
+		unsigned long p = (unsigned long )mPoolStack[mCurStack];
+		if(alignment == ALIGN128) {
+			p = ((p+127) & 0xffffff80);
+			bytes = (bytes+127) & 0xffffff80;
+		}
+		else {
+			bytes = (bytes+15) & 0xfffffff0;
+		}
+		btAssert(bytes <=(mHeapBytes-(p-(unsigned long)mHeap)) );
+#endif
+		unsigned char * bla = (unsigned char *)(p + bytes);
+		mPoolStack[++mCurStack] = bla;
+		return (void*)p;
+	}
+
+	void deallocate(void *p)
+	{
+		(void) p;
+		mCurStack--;
+	}
+	
+	void clear()
+	{
+		mPoolStack[0] = mHeap;
+		mCurStack = 0;
+	}
+
+//	void printStack()
+//	{
+//		for(unsigned int i=0;i<=mCurStack;i++) {
+//			PRINTF("memStack %2d 0x%x\n",i,(uint32_t)mPoolStack[i]);
+//		}
+//	}
+
+};
+
+#endif //BT_HEAP_MANAGER_H__
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/PlatformDefinitions.h b/hkl3d/bullet/src/BulletMultiThreaded/PlatformDefinitions.h
new file mode 100644
index 0000000..142103a
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/PlatformDefinitions.h
@@ -0,0 +1,99 @@
+#ifndef BT_TYPE_DEFINITIONS_H
+#define BT_TYPE_DEFINITIONS_H
+
+///This file provides some platform/compiler checks for common definitions
+#include "LinearMath/btScalar.h"
+#include "LinearMath/btMinMax.h"
+
+#ifdef PFX_USE_FREE_VECTORMATH
+#include "physics_effects/base_level/base/pfx_vectormath_include.win32.h"
+typedef Vectormath::Aos::Vector3    vmVector3;
+typedef Vectormath::Aos::Quat       vmQuat;
+typedef Vectormath::Aos::Matrix3    vmMatrix3;
+typedef Vectormath::Aos::Transform3 vmTransform3;
+typedef Vectormath::Aos::Point3     vmPoint3;
+#else
+#include "vectormath/vmInclude.h"
+#endif//PFX_USE_FREE_VECTORMATH
+
+
+
+
+
+#ifdef _WIN32
+
+typedef union
+{
+  unsigned int u;
+  void *p;
+} addr64;
+
+#define USE_WIN32_THREADING 1
+
+		#if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300)
+		#else
+		#endif //__MINGW32__
+
+		typedef unsigned char     uint8_t;
+#ifndef __PHYSICS_COMMON_H__
+#ifndef PFX_USE_FREE_VECTORMATH
+#ifndef __BT_SKIP_UINT64_H
+		typedef unsigned long int uint64_t;
+#endif //__BT_SKIP_UINT64_H
+#endif //PFX_USE_FREE_VECTORMATH
+		typedef unsigned int      uint32_t;
+#endif //__PHYSICS_COMMON_H__
+		typedef unsigned short    uint16_t;
+
+		#include <malloc.h>
+		#define memalign(alignment, size) malloc(size);
+			
+#include <string.h> //memcpy
+
+		
+
+		#include <stdio.h>		
+		#define spu_printf printf
+		
+#else
+		#include <stdint.h>
+		#include <stdlib.h>
+		#include <string.h> //for memcpy
+
+#if defined	(__CELLOS_LV2__)
+	// Playstation 3 Cell SDK
+#include <spu_printf.h>
+		
+#else
+	// posix system
+
+#define USE_PTHREADS    (1)
+
+#ifdef USE_LIBSPE2
+#include <stdio.h>		
+#define spu_printf printf	
+#define DWORD unsigned int
+			typedef union
+			{
+			  unsigned long long ull;
+			  unsigned int ui[2];
+			  void *p;
+			} addr64;
+#endif // USE_LIBSPE2
+
+#endif	//__CELLOS_LV2__
+	
+#endif
+
+#ifdef __SPU__
+#include <stdio.h>		
+#define printf spu_printf
+#endif
+
+/* Included here because we need uint*_t typedefs */
+#include "PpuAddressSpace.h"
+
+#endif //BT_TYPE_DEFINITIONS_H
+
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.cpp b/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.cpp
new file mode 100644
index 0000000..c8b49ee
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.cpp
@@ -0,0 +1,399 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include <stdio.h>
+#include "PosixThreadSupport.h"
+#ifdef USE_PTHREADS
+#include <errno.h>
+#include <unistd.h>
+
+#include "SpuCollisionTaskProcess.h"
+#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
+
+#define checkPThreadFunction(returnValue) \
+    if(0 != returnValue) { \
+        printf("PThread problem at line %i in file %s: %i %d\n", __LINE__, __FILE__, returnValue, errno); \
+    }
+
+// The number of threads should be equal to the number of available cores
+// Todo: each worker should be linked to a single core, using SetThreadIdealProcessor.
+
+// PosixThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
+// Setup and initialize SPU/CELL/Libspe2
+PosixThreadSupport::PosixThreadSupport(ThreadConstructionInfo& threadConstructionInfo)
+{
+	startThreads(threadConstructionInfo);
+}
+
+// cleanup/shutdown Libspe2
+PosixThreadSupport::~PosixThreadSupport()
+{
+	stopSPU();
+}
+
+#if (defined (__APPLE__))
+#define NAMED_SEMAPHORES
+#endif
+
+// this semaphore will signal, if and how many threads are finished with their work
+static sem_t* mainSemaphore=0;
+
+static sem_t* createSem(const char* baseName)
+{
+	static int semCount = 0;
+#ifdef NAMED_SEMAPHORES
+        /// Named semaphore begin
+        char name[32];
+        snprintf(name, 32, "/%s-%d-%4.4d", baseName, getpid(), semCount++); 
+        sem_t* tempSem = sem_open(name, O_CREAT, 0600, 0);
+
+        if (tempSem != reinterpret_cast<sem_t *>(SEM_FAILED))
+        {
+//        printf("Created \"%s\" Semaphore %p\n", name, tempSem);
+        }
+        else
+	{
+		//printf("Error creating Semaphore %d\n", errno);
+		exit(-1);
+	}
+        /// Named semaphore end
+#else
+	sem_t* tempSem = new sem_t;
+	checkPThreadFunction(sem_init(tempSem, 0, 0));
+#endif
+	return tempSem;
+}
+
+static void destroySem(sem_t* semaphore)
+{
+#ifdef NAMED_SEMAPHORES
+	checkPThreadFunction(sem_close(semaphore));
+#else
+	checkPThreadFunction(sem_destroy(semaphore));
+	delete semaphore;
+#endif	
+}
+
+static void *threadFunction(void *argument) 
+{
+
+	PosixThreadSupport::btSpuStatus* status = (PosixThreadSupport::btSpuStatus*)argument;
+
+	
+	while (1)
+	{
+            checkPThreadFunction(sem_wait(status->startSemaphore));
+		
+		void* userPtr = status->m_userPtr;
+
+		if (userPtr)
+		{
+			btAssert(status->m_status);
+			status->m_userThreadFunc(userPtr,status->m_lsMemory);
+			status->m_status = 2;
+			checkPThreadFunction(sem_post(mainSemaphore));
+	                status->threadUsed++;
+		} else {
+			//exit Thread
+			status->m_status = 3;
+			checkPThreadFunction(sem_post(mainSemaphore));
+			printf("Thread with taskId %i exiting\n",status->m_taskId);
+			break;
+		}
+		
+	}
+
+	printf("Thread TERMINATED\n");
+	return 0;
+
+}
+
+///send messages to SPUs
+void PosixThreadSupport::sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t taskId)
+{
+	///	gMidphaseSPU.sendRequest(CMD_GATHER_AND_PROCESS_PAIRLIST, (uint32_t) &taskDesc);
+	
+	///we should spawn an SPU task here, and in 'waitForResponse' it should wait for response of the (one of) the first tasks that finished
+	
+
+
+	switch (uiCommand)
+	{
+	case 	CMD_GATHER_AND_PROCESS_PAIRLIST:
+		{
+			btSpuStatus&	spuStatus = m_activeSpuStatus[taskId];
+			btAssert(taskId >= 0);
+			btAssert(taskId < m_activeSpuStatus.size());
+
+			spuStatus.m_commandId = uiCommand;
+			spuStatus.m_status = 1;
+			spuStatus.m_userPtr = (void*)uiArgument0;
+
+			// fire event to start new task
+			checkPThreadFunction(sem_post(spuStatus.startSemaphore));
+			break;
+		}
+	default:
+		{
+			///not implemented
+			btAssert(0);
+		}
+
+	};
+
+
+}
+
+
+///check for messages from SPUs
+void PosixThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
+{
+	///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
+	
+	///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
+
+
+	btAssert(m_activeSpuStatus.size());
+
+        // wait for any of the threads to finish
+	checkPThreadFunction(sem_wait(mainSemaphore));
+        
+	// get at least one thread which has finished
+        size_t last = -1;
+        
+        for(size_t t=0; t < size_t(m_activeSpuStatus.size()); ++t) {
+            if(2 == m_activeSpuStatus[t].m_status) {
+                last = t;
+                break;
+            }
+        }
+
+	btSpuStatus& spuStatus = m_activeSpuStatus[last];
+
+	btAssert(spuStatus.m_status > 1);
+	spuStatus.m_status = 0;
+
+	// need to find an active spu
+	btAssert(last >= 0);
+
+	*puiArgument0 = spuStatus.m_taskId;
+	*puiArgument1 = spuStatus.m_status;
+}
+
+
+
+void PosixThreadSupport::startThreads(ThreadConstructionInfo& threadConstructionInfo)
+{
+        printf("%s creating %i threads.\n", __FUNCTION__, threadConstructionInfo.m_numThreads);
+	m_activeSpuStatus.resize(threadConstructionInfo.m_numThreads);
+        
+	mainSemaphore = createSem("main");                
+	//checkPThreadFunction(sem_wait(mainSemaphore));
+   
+	for (int i=0;i < threadConstructionInfo.m_numThreads;i++)
+	{
+		printf("starting thread %d\n",i);
+
+		btSpuStatus&	spuStatus = m_activeSpuStatus[i];
+
+		spuStatus.startSemaphore = createSem("threadLocal");                
+                
+                checkPThreadFunction(pthread_create(&spuStatus.thread, NULL, &threadFunction, (void*)&spuStatus));
+
+		spuStatus.m_userPtr=0;
+
+		spuStatus.m_taskId = i;
+		spuStatus.m_commandId = 0;
+		spuStatus.m_status = 0;
+		spuStatus.m_lsMemory = threadConstructionInfo.m_lsMemoryFunc();
+		spuStatus.m_userThreadFunc = threadConstructionInfo.m_userThreadFunc;
+        spuStatus.threadUsed = 0;
+
+		printf("started thread %d \n",i);
+		
+	}
+
+}
+
+void PosixThreadSupport::startSPU()
+{
+}
+
+
+///tell the task scheduler we are done with the SPU tasks
+void PosixThreadSupport::stopSPU()
+{
+	for(size_t t=0; t < size_t(m_activeSpuStatus.size()); ++t) 
+	{
+            btSpuStatus&	spuStatus = m_activeSpuStatus[t];
+            printf("%s: Thread %i used: %ld\n", __FUNCTION__, int(t), spuStatus.threadUsed);
+
+	spuStatus.m_userPtr = 0;       
+ 	checkPThreadFunction(sem_post(spuStatus.startSemaphore));
+	checkPThreadFunction(sem_wait(mainSemaphore));
+
+	printf("destroy semaphore\n"); 
+            destroySem(spuStatus.startSemaphore);
+            printf("semaphore destroyed\n");
+		checkPThreadFunction(pthread_join(spuStatus.thread,0));
+        }
+	printf("destroy main semaphore\n");
+        destroySem(mainSemaphore);
+	printf("main semaphore destroyed\n");
+	m_activeSpuStatus.clear();
+}
+
+class PosixCriticalSection : public btCriticalSection 
+{
+	pthread_mutex_t m_mutex;
+	
+public:
+	PosixCriticalSection() 
+	{
+		pthread_mutex_init(&m_mutex, NULL);
+	}
+	virtual ~PosixCriticalSection() 
+	{
+		pthread_mutex_destroy(&m_mutex);
+	}
+	
+	ATTRIBUTE_ALIGNED16(unsigned int mCommonBuff[32]);
+	
+	virtual unsigned int getSharedParam(int i)
+	{
+		return mCommonBuff[i];
+	}
+	virtual void setSharedParam(int i,unsigned int p)
+	{
+		mCommonBuff[i] = p;
+	}
+	
+	virtual void lock()
+	{
+		pthread_mutex_lock(&m_mutex);
+	}
+	virtual void unlock()
+	{
+		pthread_mutex_unlock(&m_mutex);
+	}
+};
+
+
+#if defined(_POSIX_BARRIERS) && (_POSIX_BARRIERS - 20012L) >= 0
+/* OK to use barriers on this platform */
+class PosixBarrier : public btBarrier 
+{
+	pthread_barrier_t m_barr;
+	int m_numThreads;
+public:
+	PosixBarrier()
+	:m_numThreads(0)	{	}
+	virtual ~PosixBarrier()	{
+		pthread_barrier_destroy(&m_barr);
+	}
+	
+	virtual void sync()
+	{
+		int rc = pthread_barrier_wait(&m_barr);
+		if(rc != 0 && rc != PTHREAD_BARRIER_SERIAL_THREAD)
+		{
+			printf("Could not wait on barrier\n");
+			exit(-1);
+		}
+	}
+	virtual void setMaxCount(int numThreads)
+	{
+		int result = pthread_barrier_init(&m_barr, NULL, numThreads);
+		m_numThreads = numThreads;
+		btAssert(result==0);
+	}
+	virtual int  getMaxCount()
+	{
+		return m_numThreads;
+	}
+};
+#else
+/* Not OK to use barriers on this platform - insert alternate code here */
+class PosixBarrier : public btBarrier 
+{
+	pthread_mutex_t m_mutex;
+	pthread_cond_t m_cond;
+	
+	int m_numThreads;
+	int	m_called;
+	
+public:
+	PosixBarrier()
+	:m_numThreads(0)
+	{
+	}
+	virtual ~PosixBarrier() 
+	{
+		if (m_numThreads>0)
+		{
+			pthread_mutex_destroy(&m_mutex);
+			pthread_cond_destroy(&m_cond);
+		}
+	}
+	
+	virtual void sync()
+	{		
+		pthread_mutex_lock(&m_mutex);
+		m_called++;
+		if (m_called == m_numThreads) {
+			m_called = 0;
+			pthread_cond_broadcast(&m_cond);
+		} else {
+			pthread_cond_wait(&m_cond,&m_mutex);
+		}
+		pthread_mutex_unlock(&m_mutex);
+		
+	}
+	virtual void setMaxCount(int numThreads)
+	{
+		if (m_numThreads>0)
+		{
+			pthread_mutex_destroy(&m_mutex);
+			pthread_cond_destroy(&m_cond);
+		}
+		m_called = 0;
+		pthread_mutex_init(&m_mutex,NULL);
+		pthread_cond_init(&m_cond,NULL);
+		m_numThreads = numThreads;
+	}
+	virtual int  getMaxCount()
+	{
+		return m_numThreads;
+	}
+};
+
+#endif//_POSIX_BARRIERS
+
+
+
+btBarrier* PosixThreadSupport::createBarrier()
+{
+	PosixBarrier* barrier = new PosixBarrier();
+	barrier->setMaxCount(getNumTasks());
+	return barrier;
+}
+
+btCriticalSection* PosixThreadSupport::createCriticalSection()
+{
+	return new PosixCriticalSection();
+}
+
+#endif // USE_PTHREADS
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.h b/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.h
new file mode 100644
index 0000000..2df3f0e
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/PosixThreadSupport.h
@@ -0,0 +1,142 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_POSIX_THREAD_SUPPORT_H
+#define BT_POSIX_THREAD_SUPPORT_H
+
+
+#include "LinearMath/btScalar.h"
+#include "PlatformDefinitions.h"
+
+#ifdef USE_PTHREADS //platform specifc defines are defined in PlatformDefinitions.h
+
+#ifndef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600 //for definition of pthread_barrier_t, see http://pages.cs.wisc.edu/~travitch/pthreads_primer.html
+#endif //_XOPEN_SOURCE
+#include <pthread.h>
+#include <semaphore.h>
+
+
+
+#include "LinearMath/btAlignedObjectArray.h"
+
+#include "btThreadSupportInterface.h"
+
+
+typedef void (*PosixThreadFunc)(void* userPtr,void* lsMemory);
+typedef void* (*PosixlsMemorySetupFunc)();
+
+// PosixThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
+class PosixThreadSupport : public btThreadSupportInterface 
+{
+public:
+    typedef enum sStatus {
+        STATUS_BUSY,
+        STATUS_READY,
+        STATUS_FINISHED
+    } Status;
+
+	// placeholder, until libspe2 support is there
+	struct	btSpuStatus
+	{
+		uint32_t	m_taskId;
+		uint32_t	m_commandId;
+		uint32_t	m_status;
+
+		PosixThreadFunc	m_userThreadFunc;
+		void*	m_userPtr; //for taskDesc etc
+		void*	m_lsMemory; //initialized using PosixLocalStoreMemorySetupFunc
+
+                pthread_t thread;
+                sem_t* startSemaphore;
+
+        unsigned long threadUsed;
+	};
+private:
+
+	btAlignedObjectArray<btSpuStatus>	m_activeSpuStatus;
+public:
+	///Setup and initialize SPU/CELL/Libspe2
+
+	
+
+	struct	ThreadConstructionInfo
+	{
+		ThreadConstructionInfo(char* uniqueName,
+									PosixThreadFunc userThreadFunc,
+									PosixlsMemorySetupFunc	lsMemoryFunc,
+									int numThreads=1,
+									int threadStackSize=65535
+									)
+									:m_uniqueName(uniqueName),
+									m_userThreadFunc(userThreadFunc),
+									m_lsMemoryFunc(lsMemoryFunc),
+									m_numThreads(numThreads),
+									m_threadStackSize(threadStackSize)
+		{
+
+		}
+
+		char*					m_uniqueName;
+		PosixThreadFunc			m_userThreadFunc;
+		PosixlsMemorySetupFunc	m_lsMemoryFunc;
+		int						m_numThreads;
+		int						m_threadStackSize;
+
+	};
+
+	PosixThreadSupport(ThreadConstructionInfo& threadConstructionInfo);
+
+///cleanup/shutdown Libspe2
+	virtual	~PosixThreadSupport();
+
+	void	startThreads(ThreadConstructionInfo&	threadInfo);
+
+
+///send messages to SPUs
+	virtual	void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1);
+
+///check for messages from SPUs
+	virtual	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
+
+///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
+	virtual	void startSPU();
+
+///tell the task scheduler we are done with the SPU tasks
+	virtual	void stopSPU();
+
+	virtual void setNumTasks(int numTasks) {}
+
+	virtual int getNumTasks() const
+	{
+		return m_activeSpuStatus.size();
+	}
+
+	virtual btBarrier* createBarrier();
+
+	virtual btCriticalSection* createCriticalSection();
+	
+	virtual void*	getThreadLocalMemory(int taskId)
+	{
+		return m_activeSpuStatus[taskId].m_lsMemory;
+	}
+
+};
+
+#endif // USE_PTHREADS
+
+#endif // BT_POSIX_THREAD_SUPPORT_H
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/PpuAddressSpace.h b/hkl3d/bullet/src/BulletMultiThreaded/PpuAddressSpace.h
new file mode 100644
index 0000000..6f22827
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/PpuAddressSpace.h
@@ -0,0 +1,37 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2010 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_PPU_ADDRESS_SPACE_H
+#define BT_PPU_ADDRESS_SPACE_H
+
+
+#ifdef _WIN32
+//stop those casting warnings until we have a better solution for ppu_address_t / void* / uint64 conversions
+#pragma warning (disable: 4311)
+#pragma warning (disable: 4312)
+#endif //_WIN32
+
+
+#if defined(_WIN64)
+	typedef unsigned __int64 ppu_address_t;
+#elif defined(__LP64__) || defined(__x86_64__)
+	typedef uint64_t ppu_address_t;
+#else
+	typedef uint32_t ppu_address_t;
+#endif //defined(_WIN64)
+
+#endif //BT_PPU_ADDRESS_SPACE_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.cpp
new file mode 100644
index 0000000..8cc7241
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.cpp
@@ -0,0 +1,169 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "SequentialThreadSupport.h"
+
+
+#include "SpuCollisionTaskProcess.h"
+#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
+
+SequentialThreadSupport::SequentialThreadSupport(SequentialThreadConstructionInfo& threadConstructionInfo)
+{
+	startThreads(threadConstructionInfo);
+}
+
+///cleanup/shutdown Libspe2
+SequentialThreadSupport::~SequentialThreadSupport()
+{
+	stopSPU();
+}
+
+#include <stdio.h>
+
+///send messages to SPUs
+void SequentialThreadSupport::sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t taskId)
+{
+	switch (uiCommand)
+	{
+	case 	CMD_GATHER_AND_PROCESS_PAIRLIST:
+		{
+			btSpuStatus&	spuStatus = m_activeSpuStatus[0];
+			spuStatus.m_userPtr=(void*)uiArgument0;
+			spuStatus.m_userThreadFunc(spuStatus.m_userPtr,spuStatus.m_lsMemory);
+		}
+	break;
+	default:
+		{
+			///not implemented
+			btAssert(0 && "Not implemented");
+		}
+
+	};
+
+
+}
+
+///check for messages from SPUs
+void SequentialThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
+{
+	btAssert(m_activeSpuStatus.size());
+	btSpuStatus& spuStatus = m_activeSpuStatus[0];
+	*puiArgument0 = spuStatus.m_taskId;
+	*puiArgument1 = spuStatus.m_status;
+}
+
+void SequentialThreadSupport::startThreads(SequentialThreadConstructionInfo& threadConstructionInfo)
+{
+	m_activeSpuStatus.resize(1);
+	printf("STS: Not starting any threads\n");
+	btSpuStatus& spuStatus = m_activeSpuStatus[0];
+	spuStatus.m_userPtr = 0;
+	spuStatus.m_taskId = 0;
+	spuStatus.m_commandId = 0;
+	spuStatus.m_status = 0;
+	spuStatus.m_lsMemory = threadConstructionInfo.m_lsMemoryFunc();
+	spuStatus.m_userThreadFunc = threadConstructionInfo.m_userThreadFunc;
+	printf("STS: Created local store at %p for task %s\n", spuStatus.m_lsMemory, threadConstructionInfo.m_uniqueName);
+}
+
+void SequentialThreadSupport::startSPU()
+{
+}
+
+void SequentialThreadSupport::stopSPU()
+{
+	m_activeSpuStatus.clear();
+}
+
+void SequentialThreadSupport::setNumTasks(int numTasks)
+{
+	printf("SequentialThreadSupport::setNumTasks(%d) is not implemented and has no effect\n",numTasks);
+}
+
+
+
+
+class btDummyBarrier : public btBarrier
+{
+private:
+		
+public:
+	btDummyBarrier()
+	{
+	}
+	
+	virtual ~btDummyBarrier()
+	{
+	}
+	
+	void sync()
+	{
+	}
+	
+	virtual void setMaxCount(int n) {}
+	virtual int  getMaxCount() {return 1;}
+};
+
+class btDummyCriticalSection : public btCriticalSection
+{
+	
+public:
+	btDummyCriticalSection()
+	{
+	}
+	
+	virtual ~btDummyCriticalSection()
+	{
+	}
+	
+	unsigned int getSharedParam(int i)
+	{
+		btAssert(i>=0&&i<31);
+		return mCommonBuff[i+1];
+	}
+	
+	void setSharedParam(int i,unsigned int p)
+	{
+		btAssert(i>=0&&i<31);
+		mCommonBuff[i+1] = p;
+	}
+	
+	void lock()
+	{
+		mCommonBuff[0] = 1;
+	}
+	
+	void unlock()
+	{
+		mCommonBuff[0] = 0;
+	}
+};
+
+
+
+
+btBarrier*	SequentialThreadSupport::createBarrier()
+{
+	return new btDummyBarrier();
+}
+
+btCriticalSection* SequentialThreadSupport::createCriticalSection()
+{
+	return new btDummyCriticalSection();
+	
+}
+
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.h b/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.h
new file mode 100644
index 0000000..c750f7f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SequentialThreadSupport.h
@@ -0,0 +1,96 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "LinearMath/btScalar.h"
+#include "PlatformDefinitions.h"
+
+
+#ifndef BT_SEQUENTIAL_THREAD_SUPPORT_H
+#define BT_SEQUENTIAL_THREAD_SUPPORT_H
+
+#include "LinearMath/btAlignedObjectArray.h"
+
+#include "btThreadSupportInterface.h"
+
+typedef void (*SequentialThreadFunc)(void* userPtr,void* lsMemory);
+typedef void* (*SequentiallsMemorySetupFunc)();
+
+
+
+///The SequentialThreadSupport is a portable non-parallel implementation of the btThreadSupportInterface
+///This is useful for debugging and porting SPU Tasks to other platforms.
+class SequentialThreadSupport : public btThreadSupportInterface 
+{
+public:
+	struct	btSpuStatus
+	{
+		uint32_t	m_taskId;
+		uint32_t	m_commandId;
+		uint32_t	m_status;
+
+		SequentialThreadFunc	m_userThreadFunc;
+
+		void*	m_userPtr; //for taskDesc etc
+		void*	m_lsMemory; //initialized using SequentiallsMemorySetupFunc
+	};
+private:
+	btAlignedObjectArray<btSpuStatus>	m_activeSpuStatus;
+	btAlignedObjectArray<void*>			m_completeHandles;	
+public:
+	struct	SequentialThreadConstructionInfo
+	{
+		SequentialThreadConstructionInfo (char* uniqueName,
+									SequentialThreadFunc userThreadFunc,
+									SequentiallsMemorySetupFunc	lsMemoryFunc
+									)
+									:m_uniqueName(uniqueName),
+									m_userThreadFunc(userThreadFunc),
+									m_lsMemoryFunc(lsMemoryFunc)
+		{
+
+		}
+
+		char*						m_uniqueName;
+		SequentialThreadFunc		m_userThreadFunc;
+		SequentiallsMemorySetupFunc	m_lsMemoryFunc;
+	};
+
+	SequentialThreadSupport(SequentialThreadConstructionInfo& threadConstructionInfo);
+	virtual	~SequentialThreadSupport();
+	void	startThreads(SequentialThreadConstructionInfo&	threadInfo);
+///send messages to SPUs
+	virtual	void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1);
+///check for messages from SPUs
+	virtual	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
+///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
+	virtual	void startSPU();
+///tell the task scheduler we are done with the SPU tasks
+	virtual	void stopSPU();
+
+	virtual void setNumTasks(int numTasks);
+
+	virtual int getNumTasks() const
+	{
+		return 1;
+	}
+	virtual btBarrier*	createBarrier();
+
+	virtual btCriticalSection* createCriticalSection();
+	
+
+};
+
+#endif //BT_SEQUENTIAL_THREAD_SUPPORT_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.cpp
new file mode 100644
index 0000000..182aa26
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.cpp
@@ -0,0 +1,48 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "SpuCollisionObjectWrapper.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+
+SpuCollisionObjectWrapper::SpuCollisionObjectWrapper ()
+{
+}
+
+#ifndef __SPU__
+SpuCollisionObjectWrapper::SpuCollisionObjectWrapper (const btCollisionObject* collisionObject)
+{
+	m_shapeType = collisionObject->getCollisionShape()->getShapeType ();
+	m_collisionObjectPtr = (ppu_address_t)collisionObject;
+	m_margin = collisionObject->getCollisionShape()->getMargin ();
+}
+#endif
+
+int
+SpuCollisionObjectWrapper::getShapeType () const
+{
+	return m_shapeType;
+}
+
+float
+SpuCollisionObjectWrapper::getCollisionMargin () const
+{
+	return m_margin;
+}
+
+ppu_address_t
+SpuCollisionObjectWrapper::getCollisionObjectPtr () const
+{
+	return m_collisionObjectPtr;
+}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.h
new file mode 100644
index 0000000..f90da27
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionObjectWrapper.h
@@ -0,0 +1,40 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SPU_COLLISION_OBJECT_WRAPPER_H
+#define BT_SPU_COLLISION_OBJECT_WRAPPER_H
+
+#include "PlatformDefinitions.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+
+ATTRIBUTE_ALIGNED16(class) SpuCollisionObjectWrapper
+{
+protected:
+	int m_shapeType;
+	float m_margin;
+	ppu_address_t m_collisionObjectPtr;
+
+public:
+	SpuCollisionObjectWrapper ();
+
+	SpuCollisionObjectWrapper (const btCollisionObject* collisionObject);
+
+	int           getShapeType () const;
+	float         getCollisionMargin () const;
+	ppu_address_t getCollisionObjectPtr () const;
+};
+
+
+#endif //BT_SPU_COLLISION_OBJECT_WRAPPER_H
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp
new file mode 100644
index 0000000..f606d13
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.cpp
@@ -0,0 +1,317 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+//#define DEBUG_SPU_TASK_SCHEDULING 1
+
+
+//class OptimizedBvhNode;
+
+#include "SpuCollisionTaskProcess.h"
+
+
+
+
+void	SpuCollisionTaskProcess::setNumTasks(int maxNumTasks)
+{
+	if (int(m_maxNumOutstandingTasks) != maxNumTasks)
+	{
+		m_maxNumOutstandingTasks = maxNumTasks;
+		m_taskBusy.resize(m_maxNumOutstandingTasks);
+		m_spuGatherTaskDesc.resize(m_maxNumOutstandingTasks);
+
+		for (int i = 0; i < m_taskBusy.size(); i++)
+		{
+			m_taskBusy[i] = false;
+		}
+
+		///re-allocate task memory buffers
+		if (m_workUnitTaskBuffers != 0)
+		{
+			btAlignedFree(m_workUnitTaskBuffers);
+		}
+		
+		m_workUnitTaskBuffers = (unsigned char *)btAlignedAlloc(MIDPHASE_WORKUNIT_TASK_SIZE*m_maxNumOutstandingTasks, 128);
+	}
+	
+}
+
+
+
+SpuCollisionTaskProcess::SpuCollisionTaskProcess(class	btThreadSupportInterface*	threadInterface, unsigned int	maxNumOutstandingTasks)
+:m_threadInterface(threadInterface),
+m_maxNumOutstandingTasks(0)
+{
+	m_workUnitTaskBuffers = (unsigned char *)0;
+	setNumTasks(maxNumOutstandingTasks);
+	m_numBusyTasks = 0;
+	m_currentTask = 0;
+	m_currentPage = 0;
+	m_currentPageEntry = 0;
+
+#ifdef DEBUG_SpuCollisionTaskProcess
+	m_initialized = false;
+#endif
+
+	m_threadInterface->startSPU();
+
+	//printf("sizeof vec_float4: %d\n", sizeof(vec_float4));
+	printf("sizeof SpuGatherAndProcessWorkUnitInput: %d\n", int(sizeof(SpuGatherAndProcessWorkUnitInput)));
+
+}
+
+SpuCollisionTaskProcess::~SpuCollisionTaskProcess()
+{
+	
+	if (m_workUnitTaskBuffers != 0)
+	{
+		btAlignedFree(m_workUnitTaskBuffers);
+		m_workUnitTaskBuffers = 0;
+	}
+	
+
+
+	m_threadInterface->stopSPU();
+	
+}
+
+
+
+void SpuCollisionTaskProcess::initialize2(bool useEpa)
+{
+
+#ifdef DEBUG_SPU_TASK_SCHEDULING
+	printf("SpuCollisionTaskProcess::initialize()\n");
+#endif //DEBUG_SPU_TASK_SCHEDULING
+	
+	for (int i = 0; i < int (m_maxNumOutstandingTasks); i++)
+	{
+		m_taskBusy[i] = false;
+	}
+	m_numBusyTasks = 0;
+	m_currentTask = 0;
+	m_currentPage = 0;
+	m_currentPageEntry = 0;
+	m_useEpa = useEpa;
+
+#ifdef DEBUG_SpuCollisionTaskProcess
+	m_initialized = true;
+	btAssert(MIDPHASE_NUM_WORKUNITS_PER_TASK*sizeof(SpuGatherAndProcessWorkUnitInput) <= MIDPHASE_WORKUNIT_TASK_SIZE);
+#endif
+}
+
+
+void SpuCollisionTaskProcess::issueTask2()
+{
+
+#ifdef DEBUG_SPU_TASK_SCHEDULING
+	printf("SpuCollisionTaskProcess::issueTask (m_currentTask= %d\n)", m_currentTask);
+#endif //DEBUG_SPU_TASK_SCHEDULING
+
+	m_taskBusy[m_currentTask] = true;
+	m_numBusyTasks++;
+
+
+	SpuGatherAndProcessPairsTaskDesc& taskDesc = m_spuGatherTaskDesc[m_currentTask];
+	taskDesc.m_useEpa = m_useEpa;
+
+	{
+		// send task description in event message
+		// no error checking here...
+		// but, currently, event queue can be no larger than NUM_WORKUNIT_TASKS.
+	
+		taskDesc.m_inPairPtr = reinterpret_cast<uint64_t>(MIDPHASE_TASK_PTR(m_currentTask));
+	
+		taskDesc.taskId = m_currentTask;
+		taskDesc.numPages = m_currentPage+1;
+		taskDesc.numOnLastPage = m_currentPageEntry;
+	}
+
+
+
+	m_threadInterface->sendRequest(CMD_GATHER_AND_PROCESS_PAIRLIST, (ppu_address_t) &taskDesc,m_currentTask);
+
+	// if all tasks busy, wait for spu event to clear the task.
+	
+
+	if (m_numBusyTasks >= m_maxNumOutstandingTasks)
+	{
+		unsigned int taskId;
+		unsigned int outputSize;
+
+		
+		for (int i=0;i<int (m_maxNumOutstandingTasks);i++)
+		  {
+			  if (m_taskBusy[i])
+			  {
+				  taskId = i;
+				  break;
+			  }
+		  }
+
+	  btAssert(taskId>=0);
+
+	  
+		m_threadInterface->waitForResponse(&taskId, &outputSize);
+
+//		printf("issueTask taskId %d completed, numBusy=%d\n",taskId,m_numBusyTasks);
+
+		//printf("PPU: after issue, received event: %u %d\n", taskId, outputSize);
+
+		//postProcess(taskId, outputSize);
+
+		m_taskBusy[taskId] = false;
+
+		m_numBusyTasks--;
+	}
+	
+}
+
+void SpuCollisionTaskProcess::addWorkToTask(void* pairArrayPtr,int startIndex,int endIndex)
+{
+#ifdef DEBUG_SPU_TASK_SCHEDULING
+	printf("#");
+#endif //DEBUG_SPU_TASK_SCHEDULING
+	
+#ifdef DEBUG_SpuCollisionTaskProcess
+	btAssert(m_initialized);
+	btAssert(m_workUnitTaskBuffers);
+
+#endif
+
+	bool batch = true;
+
+	if (batch)
+	{
+		if (m_currentPageEntry == MIDPHASE_NUM_WORKUNITS_PER_PAGE)
+		{
+			if (m_currentPage == MIDPHASE_NUM_WORKUNIT_PAGES-1)
+			{
+				// task buffer is full, issue current task.
+				// if all task buffers busy, this waits until SPU is done.
+				issueTask2();
+
+				// find new task buffer
+				for (unsigned int i = 0; i < m_maxNumOutstandingTasks; i++)
+				{
+					if (!m_taskBusy[i])
+					{
+						m_currentTask = i;
+						//init the task data
+
+						break;
+					}
+				}
+
+				m_currentPage = 0;
+			}
+			else
+			{
+				m_currentPage++;
+			}
+
+			m_currentPageEntry = 0;
+		}
+	}
+
+	{
+
+
+
+		SpuGatherAndProcessWorkUnitInput &wuInput = 
+			*(reinterpret_cast<SpuGatherAndProcessWorkUnitInput*>
+			(MIDPHASE_ENTRY_PTR(m_currentTask, m_currentPage, m_currentPageEntry)));
+		
+		wuInput.m_pairArrayPtr = reinterpret_cast<uint64_t>(pairArrayPtr);
+		wuInput.m_startIndex = startIndex;
+		wuInput.m_endIndex = endIndex;
+
+		
+	
+		m_currentPageEntry++;
+
+		if (!batch)
+		{
+			issueTask2();
+
+			// find new task buffer
+			for (unsigned int i = 0; i < m_maxNumOutstandingTasks; i++)
+			{
+				if (!m_taskBusy[i])
+				{
+					m_currentTask = i;
+					//init the task data
+
+					break;
+				}
+			}
+
+			m_currentPage = 0;
+			m_currentPageEntry =0;
+		}
+	}
+}
+
+
+void 
+SpuCollisionTaskProcess::flush2()
+{
+#ifdef DEBUG_SPU_TASK_SCHEDULING
+	printf("\nSpuCollisionTaskProcess::flush()\n");
+#endif //DEBUG_SPU_TASK_SCHEDULING
+	
+	// if there's a partially filled task buffer, submit that task
+	if (m_currentPage > 0 || m_currentPageEntry > 0)
+	{
+		issueTask2();
+	}
+
+
+	// all tasks are issued, wait for all tasks to be complete
+	while(m_numBusyTasks > 0)
+	{
+	  // Consolidating SPU code
+	  unsigned int taskId=-1;
+	  unsigned int outputSize;
+	  
+	  for (int i=0;i<int (m_maxNumOutstandingTasks);i++)
+	  {
+		  if (m_taskBusy[i])
+		  {
+			  taskId = i;
+			  break;
+		  }
+	  }
+
+	  btAssert(taskId>=0);
+
+	
+	  {
+			
+		// SPURS support.
+		  m_threadInterface->waitForResponse(&taskId, &outputSize);
+	  }
+//		 printf("flush2 taskId %d completed, numBusy =%d \n",taskId,m_numBusyTasks);
+		//printf("PPU: flushing, received event: %u %d\n", taskId, outputSize);
+
+		//postProcess(taskId, outputSize);
+
+		m_taskBusy[taskId] = false;
+
+		m_numBusyTasks--;
+	}
+
+
+}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.h
new file mode 100644
index 0000000..23b5b05
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuCollisionTaskProcess.h
@@ -0,0 +1,163 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SPU_COLLISION_TASK_PROCESS_H
+#define BT_SPU_COLLISION_TASK_PROCESS_H
+
+#include <assert.h>
+
+#include "LinearMath/btScalar.h"
+
+#include "PlatformDefinitions.h"
+#include "LinearMath/btAlignedObjectArray.h"
+#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h" // for definitions processCollisionTask and createCollisionLocalStoreMemory
+
+#include "btThreadSupportInterface.h"
+
+
+//#include "SPUAssert.h"
+#include <string.h>
+
+
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+
+#include "LinearMath/btAlignedAllocator.h"
+
+#include <stdio.h>
+
+
+#define DEBUG_SpuCollisionTaskProcess 1
+
+
+#define CMD_GATHER_AND_PROCESS_PAIRLIST	1
+
+class btCollisionObject;
+class btPersistentManifold;
+class btDispatcher;
+
+
+/////Task Description for SPU collision detection
+//struct SpuGatherAndProcessPairsTaskDesc
+//{
+//	uint64_t	inPtr;//m_pairArrayPtr;
+//	//mutex variable
+//	uint32_t	m_someMutexVariableInMainMemory;
+//
+//	uint64_t	m_dispatcher;
+//
+//	uint32_t	numOnLastPage;
+//
+//	uint16_t numPages;
+//	uint16_t taskId;
+//
+//	struct	CollisionTask_LocalStoreMemory*	m_lsMemory; 
+//}
+//
+//#if  defined(__CELLOS_LV2__) || defined(USE_LIBSPE2)
+//__attribute__ ((aligned (16)))
+//#endif
+//;
+
+
+///MidphaseWorkUnitInput stores individual primitive versus mesh collision detection input, to be processed by the SPU.
+ATTRIBUTE_ALIGNED16(struct) SpuGatherAndProcessWorkUnitInput
+{
+	uint64_t m_pairArrayPtr;
+	int		m_startIndex;
+	int		m_endIndex;
+};
+
+
+
+
+/// SpuCollisionTaskProcess handles SPU processing of collision pairs.
+/// Maintains a set of task buffers.
+/// When the task is full, the task is issued for SPUs to process.  Contact output goes into btPersistentManifold
+/// associated with each task.
+/// When PPU issues a task, it will look for completed task buffers
+/// PPU will do postprocessing, dependent on workunit output (not likely)
+class SpuCollisionTaskProcess
+{
+
+  unsigned char  *m_workUnitTaskBuffers;
+
+
+	// track task buffers that are being used, and total busy tasks
+	btAlignedObjectArray<bool>	m_taskBusy;
+	btAlignedObjectArray<SpuGatherAndProcessPairsTaskDesc>	m_spuGatherTaskDesc;
+
+	class	btThreadSupportInterface*	m_threadInterface;
+
+	unsigned int	m_maxNumOutstandingTasks;
+
+	unsigned int   m_numBusyTasks;
+
+	// the current task and the current entry to insert a new work unit
+	unsigned int   m_currentTask;
+	unsigned int   m_currentPage;
+	unsigned int   m_currentPageEntry;
+
+	bool m_useEpa;
+
+#ifdef DEBUG_SpuCollisionTaskProcess
+	bool m_initialized;
+#endif
+	void issueTask2();
+	//void postProcess(unsigned int taskId, int outputSize);
+
+public:
+	SpuCollisionTaskProcess(btThreadSupportInterface*	threadInterface, unsigned int maxNumOutstandingTasks);
+	
+	~SpuCollisionTaskProcess();
+	
+	///call initialize in the beginning of the frame, before addCollisionPairToTask
+	void initialize2(bool useEpa = false);
+
+	///batch up additional work to a current task for SPU processing. When batch is full, it issues the task.
+	void addWorkToTask(void* pairArrayPtr,int startIndex,int endIndex);
+
+	///call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished
+	void flush2();
+
+	/// set the maximum number of SPU tasks allocated
+	void	setNumTasks(int maxNumTasks);
+
+	int		getNumTasks() const
+	{
+		return m_maxNumOutstandingTasks;
+	}
+};
+
+
+
+#define MIDPHASE_TASK_PTR(task) (&m_workUnitTaskBuffers[0] + MIDPHASE_WORKUNIT_TASK_SIZE*task)
+#define MIDPHASE_ENTRY_PTR(task,page,entry) (MIDPHASE_TASK_PTR(task) + MIDPHASE_WORKUNIT_PAGE_SIZE*page + sizeof(SpuGatherAndProcessWorkUnitInput)*entry)
+#define MIDPHASE_OUTPUT_PTR(task) (&m_contactOutputBuffers[0] + MIDPHASE_MAX_CONTACT_BUFFER_SIZE*task)
+#define MIDPHASE_TREENODES_PTR(task) (&m_complexShapeBuffers[0] + MIDPHASE_COMPLEX_SHAPE_BUFFER_SIZE*task)
+
+
+#define MIDPHASE_WORKUNIT_PAGE_SIZE (16)
+//#define MIDPHASE_WORKUNIT_PAGE_SIZE (128)
+
+#define MIDPHASE_NUM_WORKUNIT_PAGES 1
+#define MIDPHASE_WORKUNIT_TASK_SIZE (MIDPHASE_WORKUNIT_PAGE_SIZE*MIDPHASE_NUM_WORKUNIT_PAGES)
+#define MIDPHASE_NUM_WORKUNITS_PER_PAGE (MIDPHASE_WORKUNIT_PAGE_SIZE / sizeof(SpuGatherAndProcessWorkUnitInput))
+#define MIDPHASE_NUM_WORKUNITS_PER_TASK (MIDPHASE_NUM_WORKUNITS_PER_PAGE*MIDPHASE_NUM_WORKUNIT_PAGES)
+
+
+#endif // BT_SPU_COLLISION_TASK_PROCESS_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp
new file mode 100644
index 0000000..286b631
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp
@@ -0,0 +1,69 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "SpuContactManifoldCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
+
+
+
+
+void SpuContactManifoldCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	btAssert(0);
+}
+
+btScalar SpuContactManifoldCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
+{
+	btAssert(0);
+	return 1.f;
+}
+
+#ifndef __SPU__
+SpuContactManifoldCollisionAlgorithm::SpuContactManifoldCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1)
+:btCollisionAlgorithm(ci)
+#ifdef USE_SEPDISTANCE_UTIL
+,m_sepDistance(body0->getCollisionShape()->getAngularMotionDisc(),body1->getCollisionShape()->getAngularMotionDisc())
+#endif //USE_SEPDISTANCE_UTIL
+{
+	m_manifoldPtr = m_dispatcher->getNewManifold(body0,body1);
+	m_shapeType0 = body0->getCollisionShape()->getShapeType();
+	m_shapeType1 = body1->getCollisionShape()->getShapeType();
+	m_collisionMargin0 = body0->getCollisionShape()->getMargin();
+	m_collisionMargin1 = body1->getCollisionShape()->getMargin();
+	m_collisionObject0 = body0;
+	m_collisionObject1 = body1;
+
+	if (body0->getCollisionShape()->isPolyhedral())
+	{
+		btPolyhedralConvexShape* convex0 = (btPolyhedralConvexShape*)body0->getCollisionShape();
+		m_shapeDimensions0 = convex0->getImplicitShapeDimensions();
+	}
+	if (body1->getCollisionShape()->isPolyhedral())
+	{
+		btPolyhedralConvexShape* convex1 = (btPolyhedralConvexShape*)body1->getCollisionShape();
+		m_shapeDimensions1 = convex1->getImplicitShapeDimensions();
+	}
+}
+#endif //__SPU__
+
+
+SpuContactManifoldCollisionAlgorithm::~SpuContactManifoldCollisionAlgorithm()
+{
+	if (m_manifoldPtr)
+			m_dispatcher->releaseManifold(m_manifoldPtr);
+}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h
new file mode 100644
index 0000000..d28d4db
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h
@@ -0,0 +1,120 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
+#define BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
+
+#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"
+#include "BulletCollision/BroadphaseCollision/btDispatcher.h"
+#include "LinearMath/btTransformUtil.h"
+
+class btPersistentManifold;
+
+//#define USE_SEPDISTANCE_UTIL 1
+
+/// SpuContactManifoldCollisionAlgorithm  provides contact manifold and should be processed on SPU.
+ATTRIBUTE_ALIGNED16(class) SpuContactManifoldCollisionAlgorithm : public btCollisionAlgorithm
+{
+	btVector3	m_shapeDimensions0;
+	btVector3	m_shapeDimensions1;
+	btPersistentManifold*	m_manifoldPtr;
+	int		m_shapeType0;
+	int		m_shapeType1;
+	float	m_collisionMargin0;
+	float	m_collisionMargin1;
+
+	btCollisionObject*	m_collisionObject0;
+	btCollisionObject*	m_collisionObject1;
+	
+	
+
+	
+public:
+	
+	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);
+
+	
+	SpuContactManifoldCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);
+#ifdef USE_SEPDISTANCE_UTIL
+	btConvexSeparatingDistanceUtil	m_sepDistance;
+#endif //USE_SEPDISTANCE_UTIL
+
+	virtual ~SpuContactManifoldCollisionAlgorithm();
+
+	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)
+	{
+		if (m_manifoldPtr)
+			manifoldArray.push_back(m_manifoldPtr);
+	}
+
+	btPersistentManifold*	getContactManifoldPtr()
+	{
+		return m_manifoldPtr;
+	}
+
+	btCollisionObject*	getCollisionObject0()
+	{
+		return m_collisionObject0;
+	}
+	
+	btCollisionObject*	getCollisionObject1()
+	{
+		return m_collisionObject1;
+	}
+
+	int		getShapeType0() const
+	{
+		return m_shapeType0;
+	}
+
+	int		getShapeType1() const
+	{
+		return m_shapeType1;
+	}
+	float	getCollisionMargin0() const
+	{
+		return m_collisionMargin0;
+	}
+	float	getCollisionMargin1() const
+	{
+		return m_collisionMargin1;
+	}
+
+	const btVector3&	getShapeDimensions0() const
+	{
+		return m_shapeDimensions0;
+	}
+
+	const btVector3&	getShapeDimensions1() const
+	{
+		return m_shapeDimensions1;
+	}
+
+	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc
+	{
+		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
+		{
+			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(SpuContactManifoldCollisionAlgorithm));
+			return new(mem) SpuContactManifoldCollisionAlgorithm(ci,body0,body1);
+		}
+	};
+
+};
+
+#endif //BT_SPU_CONTACTMANIFOLD_COLLISION_ALGORITHM_H
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuDoubleBuffer.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuDoubleBuffer.h
new file mode 100644
index 0000000..558d615
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuDoubleBuffer.h
@@ -0,0 +1,126 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_DOUBLE_BUFFER_H
+#define BT_DOUBLE_BUFFER_H
+
+#include "SpuFakeDma.h"
+#include "LinearMath/btScalar.h"
+
+
+///DoubleBuffer
+template<class T, int size>
+class DoubleBuffer
+{
+#if defined(__SPU__) || defined(USE_LIBSPE2)
+	ATTRIBUTE_ALIGNED128( T m_buffer0[size] ) ;
+	ATTRIBUTE_ALIGNED128( T m_buffer1[size] ) ;
+#else
+	T m_buffer0[size];
+	T m_buffer1[size];
+#endif
+	
+	T *m_frontBuffer;
+	T *m_backBuffer;
+
+	unsigned int m_dmaTag;
+	bool m_dmaPending;
+public:
+	bool	isPending() const { return m_dmaPending;}
+	DoubleBuffer();
+
+	void init ();
+
+	// dma get and put commands
+	void backBufferDmaGet(uint64_t ea, unsigned int numBytes, unsigned int tag);
+	void backBufferDmaPut(uint64_t ea, unsigned int numBytes, unsigned int tag);
+
+	// gets pointer to a buffer
+	T *getFront();
+	T *getBack();
+
+	// if back buffer dma was started, wait for it to complete
+	// then move back to front and vice versa
+	T *swapBuffers();
+};
+
+template<class T, int size>
+DoubleBuffer<T,size>::DoubleBuffer()
+{
+	init ();
+}
+
+template<class T, int size>
+void DoubleBuffer<T,size>::init()
+{
+	this->m_dmaPending = false;
+	this->m_frontBuffer = &this->m_buffer0[0];
+	this->m_backBuffer = &this->m_buffer1[0];
+}
+
+template<class T, int size>
+void
+DoubleBuffer<T,size>::backBufferDmaGet(uint64_t ea, unsigned int numBytes, unsigned int tag)
+{
+	m_dmaPending = true;
+	m_dmaTag = tag;
+	if (numBytes)
+	{
+		m_backBuffer = (T*)cellDmaLargeGetReadOnly(m_backBuffer, ea, numBytes, tag, 0, 0);
+	}
+}
+
+template<class T, int size>
+void
+DoubleBuffer<T,size>::backBufferDmaPut(uint64_t ea, unsigned int numBytes, unsigned int tag)
+{
+	m_dmaPending = true;
+	m_dmaTag = tag;
+	cellDmaLargePut(m_backBuffer, ea, numBytes, tag, 0, 0);
+}
+
+template<class T, int size>
+T *
+DoubleBuffer<T,size>::getFront()
+{
+	return m_frontBuffer;
+}
+
+template<class T, int size>
+T *
+DoubleBuffer<T,size>::getBack()
+{
+	return m_backBuffer;
+}
+
+template<class T, int size>
+T *
+DoubleBuffer<T,size>::swapBuffers()
+{
+	if (m_dmaPending)
+	{
+		cellDmaWaitTagStatusAll(1<<m_dmaTag);
+		m_dmaPending = false;
+	}
+
+	T *tmp = m_backBuffer;
+	m_backBuffer = m_frontBuffer;
+	m_frontBuffer = tmp;
+
+	return m_frontBuffer;
+}
+
+#endif
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.cpp
new file mode 100644
index 0000000..b776a12
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.cpp
@@ -0,0 +1,215 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "SpuFakeDma.h"
+#include <LinearMath/btScalar.h> //for btAssert
+//Disabling memcpy sometimes helps debugging DMA
+
+#define USE_MEMCPY 1
+#ifdef USE_MEMCPY
+
+#endif
+
+
+void*	cellDmaLargeGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
+{
+
+#if defined (__SPU__) || defined (USE_LIBSPE2)
+	cellDmaLargeGet(ls,ea,size,tag,tid,rid);
+	return ls;
+#else
+	return (void*)(ppu_address_t)ea;
+#endif
+}
+
+void*	cellDmaSmallGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
+{
+#if defined (__SPU__) || defined (USE_LIBSPE2)
+	mfc_get(ls,ea,size,tag,0,0);
+	return ls;
+#else
+	return (void*)(ppu_address_t)ea;
+#endif
+}
+
+
+
+
+void*	cellDmaGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
+{
+#if defined (__SPU__) || defined (USE_LIBSPE2)
+	cellDmaGet(ls,ea,size,tag,tid,rid);
+	return ls;
+#else
+	return (void*)(ppu_address_t)ea;
+#endif
+}
+
+
+///this unalignedDma should not be frequently used, only for small data. It handles alignment and performs check on size (<16 bytes)
+int stallingUnalignedDmaSmallGet(void *ls, uint64_t ea, uint32_t size)
+{
+	
+	btAssert(size<32);
+	
+	ATTRIBUTE_ALIGNED16(char	tmpBuffer[32]);
+
+
+	char* localStore = (char*)ls;
+	uint32_t i;
+	
+
+	///make sure last 4 bits are the same, for cellDmaSmallGet
+	uint32_t last4BitsOffset = ea & 0x0f;
+	char* tmpTarget = tmpBuffer + last4BitsOffset;
+	
+#if defined (__SPU__) || defined (USE_LIBSPE2)
+	
+	int remainingSize = size;
+
+//#define FORCE_cellDmaUnalignedGet 1
+#ifdef FORCE_cellDmaUnalignedGet
+	cellDmaUnalignedGet(tmpTarget,ea,size,DMA_TAG(1),0,0);
+#else
+	char* remainingTmpTarget = tmpTarget;
+	uint64_t remainingEa = ea;
+
+	while (remainingSize)
+	{
+		switch (remainingSize)
+		{
+		case 1:
+		case 2:
+		case 4:
+		case 8:
+		case 16:
+			{
+				mfc_get(remainingTmpTarget,remainingEa,remainingSize,DMA_TAG(1),0,0);
+				remainingSize=0;
+				break;
+			}
+		default:
+			{
+				//spu_printf("unaligned DMA with non-natural size:%d\n",remainingSize);
+				int actualSize = 0;
+
+				if (remainingSize > 16)
+					actualSize = 16;
+				else
+					if (remainingSize >8)
+						actualSize=8;
+					else
+						if (remainingSize >4)
+							actualSize=4;
+						else
+							if (remainingSize >2)
+								actualSize=2;
+				mfc_get(remainingTmpTarget,remainingEa,actualSize,DMA_TAG(1),0,0);
+				remainingSize-=actualSize;
+				remainingTmpTarget+=actualSize;
+				remainingEa += actualSize;
+			}
+		}
+	}
+#endif//FORCE_cellDmaUnalignedGet
+
+#else
+	char* mainMem = (char*)ea;
+	//copy into final destination
+#ifdef USE_MEMCPY
+		
+		memcpy(tmpTarget,mainMem,size);
+#else
+		for ( i=0;i<size;i++)
+		{
+			tmpTarget[i] = mainMem[i];
+		}
+#endif //USE_MEMCPY
+
+#endif
+
+	cellDmaWaitTagStatusAll(DMA_MASK(1));
+
+	//this is slowish, perhaps memcpy on SPU is smarter?
+	for (i=0; btLikely( i<size );i++)
+	{
+		localStore[i] = tmpTarget[i];
+	}
+
+	return 0;
+}
+
+#if defined (__SPU__) || defined (USE_LIBSPE2)
+#else
+
+int	cellDmaLargeGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
+{
+	char* mainMem = (char*)ea;
+	char* localStore = (char*)ls;
+
+#ifdef USE_MEMCPY
+	memcpy(localStore,mainMem,size);
+#else
+	for (uint32_t i=0;i<size;i++)
+	{
+		localStore[i] = mainMem[i];
+	}
+#endif
+	return 0;
+}
+
+int	cellDmaGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
+{
+	char* mainMem = (char*)ea;
+	char* localStore = (char*)ls;
+
+//	printf("mainMem=%x, localStore=%x",mainMem,localStore);
+
+#ifdef USE_MEMCPY
+	memcpy(localStore,mainMem,size);
+#else
+	for (uint32_t i=0;i<size;i++)
+	{
+		localStore[i] = mainMem[i];
+	}	
+#endif //#ifdef USE_MEMCPY
+//	printf(" finished\n");
+	return 0;
+}
+
+int cellDmaLargePut(const void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
+{
+	char* mainMem = (char*)ea;
+	const char* localStore = (const char*)ls;
+#ifdef USE_MEMCPY
+	memcpy(mainMem,localStore,size);
+#else
+	for (uint32_t i=0;i<size;i++)
+	{
+		mainMem[i] = localStore[i];
+	}	
+#endif //#ifdef USE_MEMCPY
+
+	return 0;
+}
+
+
+
+void	cellDmaWaitTagStatusAll(int ignore)
+{
+
+}
+
+#endif
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h
new file mode 100644
index 0000000..40e2039
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuFakeDma.h
@@ -0,0 +1,135 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_FAKE_DMA_H
+#define BT_FAKE_DMA_H
+
+
+#include "PlatformDefinitions.h"
+#include "LinearMath/btScalar.h"
+
+
+#ifdef __SPU__
+
+#ifndef USE_LIBSPE2
+
+#include <cell/dma.h>
+#include <stdint.h>
+
+#define DMA_TAG(xfer) (xfer + 1)
+#define DMA_MASK(xfer) (1 << DMA_TAG(xfer))
+
+#else // !USE_LIBSPE2
+
+#define DMA_TAG(xfer) (xfer + 1)
+#define DMA_MASK(xfer) (1 << DMA_TAG(xfer))
+		
+#include <spu_mfcio.h>		
+		
+#define DEBUG_DMA		
+#ifdef DEBUG_DMA
+#define dUASSERT(a,b) if (!(a)) { printf(b);}
+#define uintsize ppu_address_t
+		
+#define cellDmaLargeGet(ls, ea, size, tag, tid, rid) if (  (((uintsize)ls%16) != ((uintsize)ea%16)) || ((((uintsize)ea%16) || ((uintsize)ls%16)) && (( ((uintsize)ls%16) != ((uintsize)size%16) ) || ( ((uintsize)ea%16) != ((uintsize)size%16) ) ) ) || ( ((uintsize)size%16) && ((uintsize)size!=1) && ((uintsize)size!=2) && ((uintsize)size!=4) && ((uintsize)size!=8) ) || (size >= 16384) || !(uintsize)ls || !(uintsize)ea) { \
+															dUASSERT( (((uintsize)ea % 16) == 0) || (size < 16), "XDR Address not aligned: "); \
+															dUASSERT( (((uintsize)ls % 16) == 0) || (size < 16), "LS Address not aligned: "); \
+															dUASSERT( ((((uintsize)ls % size) == 0) && (((uintsize)ea % size) == 0))  || (size > 16), "Not naturally aligned: "); \
+															dUASSERT((size == 1) || (size == 2) || (size == 4) || (size == 8) || ((size % 16) == 0), "size not a multiple of 16byte: "); \
+															dUASSERT(size < 16384, "size too big: "); \
+															dUASSERT( ((uintsize)ea%16)==((uintsize)ls%16), "wrong Quadword alignment of LS and EA: "); \
+	    													dUASSERT(ea != 0, "Nullpointer EA: "); dUASSERT(ls != 0, "Nullpointer LS: ");\
+															printf("GET %s:%d from: 0x%x, to: 0x%x - %d bytes\n", __FILE__, __LINE__, (unsigned int)ea,(unsigned int)ls,(unsigned int)size);\
+															} \
+															mfc_get(ls, ea, size, tag, tid, rid)
+#define cellDmaGet(ls, ea, size, tag, tid, rid) if (  (((uintsize)ls%16) != ((uintsize)ea%16)) || ((((uintsize)ea%16) || ((uintsize)ls%16)) && (( ((uintsize)ls%16) != ((uintsize)size%16) ) || ( ((uintsize)ea%16) != ((uintsize)size%16) ) ) ) || ( ((uintsize)size%16) && ((uintsize)size!=1) && ((uintsize)size!=2) && ((uintsize)size!=4) && ((uintsize)size!=8) ) || (size >= 16384) || !(uintsize)ls || !(uintsize)ea) { \
+														dUASSERT( (((uintsize)ea % 16) == 0) || (size < 16), "XDR Address not aligned: "); \
+														dUASSERT( (((uintsize)ls % 16) == 0) || (size < 16), "LS Address not aligned: "); \
+														dUASSERT( ((((uintsize)ls % size) == 0) && (((uintsize)ea % size) == 0))  || (size > 16), "Not naturally aligned: "); \
+														dUASSERT((size == 1) || (size == 2) || (size == 4) || (size == 8) || ((size % 16) == 0), "size not a multiple of 16byte: "); \
+    													dUASSERT(size < 16384, "size too big: "); \
+														dUASSERT( ((uintsize)ea%16)==((uintsize)ls%16), "wrong Quadword alignment of LS and EA: "); \
+    													dUASSERT(ea != 0, "Nullpointer EA: "); dUASSERT(ls != 0, "Nullpointer LS: ");\
+    													printf("GET %s:%d from: 0x%x, to: 0x%x - %d bytes\n", __FILE__, __LINE__, (unsigned int)ea,(unsigned int)ls,(unsigned int)size);\
+														} \
+														mfc_get(ls, ea, size, tag, tid, rid)
+#define cellDmaLargePut(ls, ea, size, tag, tid, rid) if (  (((uintsize)ls%16) != ((uintsize)ea%16)) || ((((uintsize)ea%16) || ((uintsize)ls%16)) && (( ((uintsize)ls%16) != ((uintsize)size%16) ) || ( ((uintsize)ea%16) != ((uintsize)size%16) ) ) ) || ( ((uintsize)size%16) && ((uintsize)size!=1) && ((uintsize)size!=2) && ((uintsize)size!=4) && ((uintsize)size!=8) ) || (size >= 16384) || !(uintsize)ls || !(uintsize)ea) { \
+															dUASSERT( (((uintsize)ea % 16) == 0) || (size < 16), "XDR Address not aligned: "); \
+															dUASSERT( (((uintsize)ls % 16) == 0) || (size < 16), "LS Address not aligned: "); \
+															dUASSERT( ((((uintsize)ls % size) == 0) && (((uintsize)ea % size) == 0))  || (size > 16), "Not naturally aligned: "); \
+															dUASSERT((size == 1) || (size == 2) || (size == 4) || (size == 8) || ((size % 16) == 0), "size not a multiple of 16byte: "); \
+        													dUASSERT(size < 16384, "size too big: "); \
+															dUASSERT( ((uintsize)ea%16)==((uintsize)ls%16), "wrong Quadword alignment of LS and EA: "); \
+        													dUASSERT(ea != 0, "Nullpointer EA: "); dUASSERT(ls != 0, "Nullpointer LS: ");\
+    														printf("PUT %s:%d from: 0x%x, to: 0x%x - %d bytes\n", __FILE__, __LINE__, (unsigned int)ls,(unsigned int)ea,(unsigned int)size); \
+															} \
+															mfc_put(ls, ea, size, tag, tid, rid)
+#define cellDmaSmallGet(ls, ea, size, tag, tid, rid) if (  (((uintsize)ls%16) != ((uintsize)ea%16)) || ((((uintsize)ea%16) || ((uintsize)ls%16)) && (( ((uintsize)ls%16) != ((uintsize)size%16) ) || ( ((uintsize)ea%16) != ((uintsize)size%16) ) ) ) || ( ((uintsize)size%16) && ((uintsize)size!=1) && ((uintsize)size!=2) && ((uintsize)size!=4) && ((uintsize)size!=8) ) || (size >= 16384) || !(uintsize)ls || !(uintsize)ea) { \
+																dUASSERT( (((uintsize)ea % 16) == 0) || (size < 16), "XDR Address not aligned: "); \
+																dUASSERT( (((uintsize)ls % 16) == 0) || (size < 16), "LS Address not aligned: "); \
+																dUASSERT( ((((uintsize)ls % size) == 0) && (((uintsize)ea % size) == 0))  || (size > 16), "Not naturally aligned: "); \
+    															dUASSERT((size == 1) || (size == 2) || (size == 4) || (size == 8) || ((size % 16) == 0), "size not a multiple of 16byte: "); \
+    															dUASSERT(size < 16384, "size too big: "); \
+    															dUASSERT( ((uintsize)ea%16)==((uintsize)ls%16), "wrong Quadword alignment of LS and EA: "); \
+    	    													dUASSERT(ea != 0, "Nullpointer EA: "); dUASSERT(ls != 0, "Nullpointer LS: ");\
+    															printf("GET %s:%d from: 0x%x, to: 0x%x - %d bytes\n", __FILE__, __LINE__, (unsigned int)ea,(unsigned int)ls,(unsigned int)size);\
+																} \
+																mfc_get(ls, ea, size, tag, tid, rid)
+#define cellDmaWaitTagStatusAll(ignore) mfc_write_tag_mask(ignore) ; mfc_read_tag_status_all()
+
+#else
+#define cellDmaLargeGet(ls, ea, size, tag, tid, rid) mfc_get(ls, ea, size, tag, tid, rid)
+#define cellDmaGet(ls, ea, size, tag, tid, rid) mfc_get(ls, ea, size, tag, tid, rid)
+#define cellDmaLargePut(ls, ea, size, tag, tid, rid) mfc_put(ls, ea, size, tag, tid, rid)
+#define cellDmaSmallGet(ls, ea, size, tag, tid, rid) mfc_get(ls, ea, size, tag, tid, rid)
+#define cellDmaWaitTagStatusAll(ignore) mfc_write_tag_mask(ignore) ; mfc_read_tag_status_all()
+#endif // DEBUG_DMA
+
+		
+		
+		
+		
+		
+		
+		
+#endif // USE_LIBSPE2
+#else // !__SPU__
+//Simulate DMA using memcpy or direct access on non-CELL platforms that don't have DMAs and SPUs (Win32, Mac, Linux etc)
+//Potential to add networked simulation using this interface
+
+#define DMA_TAG(a) (a)
+#define DMA_MASK(a) (a)
+
+		/// cellDmaLargeGet Win32 replacements for Cell DMA to allow simulating most of the SPU code (just memcpy)
+		int	cellDmaLargeGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
+		int	cellDmaGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
+		/// cellDmaLargePut Win32 replacements for Cell DMA to allow simulating most of the SPU code (just memcpy)
+		int cellDmaLargePut(const void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
+		/// cellDmaWaitTagStatusAll Win32 replacements for Cell DMA to allow simulating most of the SPU code (just memcpy)
+		void	cellDmaWaitTagStatusAll(int ignore);
+
+
+#endif //__CELLOS_LV2__
+
+///stallingUnalignedDmaSmallGet internally uses DMA_TAG(1)
+int	stallingUnalignedDmaSmallGet(void *ls, uint64_t ea, uint32_t size);
+
+
+void*	cellDmaLargeGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
+void*	cellDmaGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
+void*	cellDmaSmallGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid);
+
+
+#endif //BT_FAKE_DMA_H
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp
new file mode 100644
index 0000000..420f15f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp
@@ -0,0 +1,275 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "SpuGatheringCollisionDispatcher.h"
+#include "SpuCollisionTaskProcess.h"
+
+
+#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
+#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
+#include "SpuContactManifoldCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "BulletCollision/CollisionShapes/btCollisionShape.h"
+#include "LinearMath/btQuickprof.h"
+#include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h"
+
+
+
+
+
+SpuGatheringCollisionDispatcher::SpuGatheringCollisionDispatcher(class	btThreadSupportInterface*	threadInterface, unsigned int	maxNumOutstandingTasks,btCollisionConfiguration* collisionConfiguration)
+:btCollisionDispatcher(collisionConfiguration),
+m_spuCollisionTaskProcess(0),
+m_threadInterface(threadInterface),
+m_maxNumOutstandingTasks(maxNumOutstandingTasks)
+{
+	
+}
+
+
+bool	SpuGatheringCollisionDispatcher::supportsDispatchPairOnSpu(int proxyType0,int proxyType1)
+{
+	bool supported0 = (
+		(proxyType0 == BOX_SHAPE_PROXYTYPE) ||
+		(proxyType0 == TRIANGLE_SHAPE_PROXYTYPE) ||
+		(proxyType0 == SPHERE_SHAPE_PROXYTYPE) ||
+		(proxyType0 == CAPSULE_SHAPE_PROXYTYPE) ||
+		(proxyType0 == CYLINDER_SHAPE_PROXYTYPE) ||
+//		(proxyType0 == CONE_SHAPE_PROXYTYPE) ||
+		(proxyType0 == TRIANGLE_MESH_SHAPE_PROXYTYPE) ||
+		(proxyType0 == CONVEX_HULL_SHAPE_PROXYTYPE)||
+		(proxyType0 == STATIC_PLANE_PROXYTYPE)||
+		(proxyType0 == COMPOUND_SHAPE_PROXYTYPE)
+		);
+
+	bool supported1 = (
+		(proxyType1 == BOX_SHAPE_PROXYTYPE) ||
+		(proxyType1 == TRIANGLE_SHAPE_PROXYTYPE) ||
+		(proxyType1 == SPHERE_SHAPE_PROXYTYPE) ||
+		(proxyType1 == CAPSULE_SHAPE_PROXYTYPE) ||
+		(proxyType1 == CYLINDER_SHAPE_PROXYTYPE) ||
+//		(proxyType1 == CONE_SHAPE_PROXYTYPE) ||
+		(proxyType1 == TRIANGLE_MESH_SHAPE_PROXYTYPE) ||
+		(proxyType1 == CONVEX_HULL_SHAPE_PROXYTYPE) ||
+		(proxyType1 == STATIC_PLANE_PROXYTYPE) ||
+		(proxyType1 == COMPOUND_SHAPE_PROXYTYPE)
+		);
+
+	
+	return supported0 && supported1;
+}
+
+
+
+SpuGatheringCollisionDispatcher::~SpuGatheringCollisionDispatcher()
+{
+	if (m_spuCollisionTaskProcess)
+		delete m_spuCollisionTaskProcess;
+	
+}
+
+#include "stdio.h"
+
+
+
+///interface for iterating all overlapping collision pairs, no matter how those pairs are stored (array, set, map etc)
+///this is useful for the collision dispatcher.
+class btSpuCollisionPairCallback : public btOverlapCallback
+{
+	const btDispatcherInfo& m_dispatchInfo;
+	SpuGatheringCollisionDispatcher*	m_dispatcher;
+
+public:
+
+	btSpuCollisionPairCallback(const btDispatcherInfo& dispatchInfo, SpuGatheringCollisionDispatcher*	dispatcher)
+	:m_dispatchInfo(dispatchInfo),
+	m_dispatcher(dispatcher)
+	{
+	}
+
+	virtual bool	processOverlap(btBroadphasePair& collisionPair)
+	{
+
+
+		//PPU version
+		//(*m_dispatcher->getNearCallback())(collisionPair,*m_dispatcher,m_dispatchInfo);
+
+		//only support discrete collision detection for now, we could fallback on PPU/unoptimized version for TOI/CCD
+		btAssert(m_dispatchInfo.m_dispatchFunc == btDispatcherInfo::DISPATCH_DISCRETE);
+
+		//by default, Bullet will use this near callback
+		{
+			///userInfo is used to determine if the SPU has to handle this case or not (skip PPU tasks)
+			if (!collisionPair.m_internalTmpValue)
+			{
+				collisionPair.m_internalTmpValue = 1;
+			}
+			if (!collisionPair.m_algorithm)
+			{
+				btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
+				btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
+
+				btCollisionAlgorithmConstructionInfo ci;
+				ci.m_dispatcher1 = m_dispatcher;
+				ci.m_manifold = 0;
+
+				if (m_dispatcher->needsCollision(colObj0,colObj1))
+				{
+					int	proxyType0 = colObj0->getCollisionShape()->getShapeType();
+					int	proxyType1 = colObj1->getCollisionShape()->getShapeType();
+					bool supportsSpuDispatch = m_dispatcher->supportsDispatchPairOnSpu(proxyType0,proxyType1) 
+						&& ((colObj0->getCollisionFlags() & btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING) == 0)
+						&& ((colObj1->getCollisionFlags() & btCollisionObject::CF_DISABLE_SPU_COLLISION_PROCESSING) == 0);
+
+					if (proxyType0 == COMPOUND_SHAPE_PROXYTYPE)
+					{
+						btCompoundShape* compound = (btCompoundShape*)colObj0->getCollisionShape();
+						if (compound->getNumChildShapes()>MAX_SPU_COMPOUND_SUBSHAPES)
+						{
+							//printf("PPU fallback, compound->getNumChildShapes(%d)>%d\n",compound->getNumChildShapes(),MAX_SPU_COMPOUND_SUBSHAPES);
+							supportsSpuDispatch = false;
+						}
+					}
+
+					if (proxyType1 == COMPOUND_SHAPE_PROXYTYPE)
+					{
+						btCompoundShape* compound = (btCompoundShape*)colObj1->getCollisionShape();
+						if (compound->getNumChildShapes()>MAX_SPU_COMPOUND_SUBSHAPES)
+						{
+							//printf("PPU fallback, compound->getNumChildShapes(%d)>%d\n",compound->getNumChildShapes(),MAX_SPU_COMPOUND_SUBSHAPES);
+							supportsSpuDispatch = false;
+						}
+					}
+
+					if (supportsSpuDispatch)
+					{
+
+						int so = sizeof(SpuContactManifoldCollisionAlgorithm);
+#ifdef ALLOCATE_SEPARATELY
+						void* mem = btAlignedAlloc(so,16);//m_dispatcher->allocateCollisionAlgorithm(so);
+#else
+						void* mem = m_dispatcher->allocateCollisionAlgorithm(so);
+#endif
+						collisionPair.m_algorithm = new(mem) SpuContactManifoldCollisionAlgorithm(ci,colObj0,colObj1);
+						collisionPair.m_internalTmpValue =  2;
+					} else
+					{
+						collisionPair.m_algorithm = m_dispatcher->findAlgorithm(colObj0,colObj1);
+						collisionPair.m_internalTmpValue = 3;
+					}
+				} 
+			}
+		}
+		return false;
+	}
+};
+
+void	SpuGatheringCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo, btDispatcher* dispatcher) 
+{
+
+	if (dispatchInfo.m_enableSPU)
+	{
+		m_maxNumOutstandingTasks = m_threadInterface->getNumTasks();
+
+		{
+			BT_PROFILE("processAllOverlappingPairs");
+
+			if (!m_spuCollisionTaskProcess)
+				m_spuCollisionTaskProcess = new SpuCollisionTaskProcess(m_threadInterface,m_maxNumOutstandingTasks);
+		
+			m_spuCollisionTaskProcess->setNumTasks(m_maxNumOutstandingTasks);
+	//		printf("m_maxNumOutstandingTasks =%d\n",m_maxNumOutstandingTasks);
+
+			m_spuCollisionTaskProcess->initialize2(dispatchInfo.m_useEpa);
+			
+		
+			///modified version of btCollisionDispatcher::dispatchAllCollisionPairs:
+			{
+				btSpuCollisionPairCallback	collisionCallback(dispatchInfo,this);
+
+				pairCache->processAllOverlappingPairs(&collisionCallback,dispatcher);
+			}
+		}
+
+		//send one big batch
+		int numTotalPairs = pairCache->getNumOverlappingPairs();
+		
+		btBroadphasePair* pairPtr = pairCache->getOverlappingPairArrayPtr();
+		int i;
+		{
+			int pairRange =	SPU_BATCHSIZE_BROADPHASE_PAIRS;
+			if (numTotalPairs < (m_spuCollisionTaskProcess->getNumTasks()*SPU_BATCHSIZE_BROADPHASE_PAIRS))
+			{
+				pairRange = (numTotalPairs/m_spuCollisionTaskProcess->getNumTasks())+1;
+			}
+
+			BT_PROFILE("addWorkToTask");
+			for (i=0;i<numTotalPairs;)
+			{
+				//Performance Hint: tweak this number during benchmarking
+				
+				int endIndex = (i+pairRange) < numTotalPairs ? i+pairRange : numTotalPairs;
+				m_spuCollisionTaskProcess->addWorkToTask(pairPtr,i,endIndex);
+				i = endIndex;
+			}
+		}
+
+		{
+			BT_PROFILE("PPU fallback");
+			//handle PPU fallback pairs
+			for (i=0;i<numTotalPairs;i++)
+			{
+				btBroadphasePair& collisionPair = pairPtr[i];
+				if (collisionPair.m_internalTmpValue == 3)
+				{
+					if (collisionPair.m_algorithm)
+					{
+						btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
+						btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
+
+						if (dispatcher->needsCollision(colObj0,colObj1))
+						{
+							btManifoldResult contactPointResult(colObj0,colObj1);
+							
+							if (dispatchInfo.m_dispatchFunc == 		btDispatcherInfo::DISPATCH_DISCRETE)
+							{
+								//discrete collision detection query
+								collisionPair.m_algorithm->processCollision(colObj0,colObj1,dispatchInfo,&contactPointResult);
+							} else
+							{
+								//continuous collision detection query, time of impact (toi)
+								btScalar toi = collisionPair.m_algorithm->calculateTimeOfImpact(colObj0,colObj1,dispatchInfo,&contactPointResult);
+								if (dispatchInfo.m_timeOfImpact > toi)
+									dispatchInfo.m_timeOfImpact = toi;
+
+							}
+						}
+					}
+				}
+			}
+		}
+		{
+			BT_PROFILE("flush2");
+			//make sure all SPU work is done
+			m_spuCollisionTaskProcess->flush2();
+		}
+
+	} else
+	{
+		///PPU fallback
+		///!Need to make sure to clear all 'algorithms' when switching between SPU and PPU
+		btCollisionDispatcher::dispatchAllCollisionPairs(pairCache,dispatchInfo,dispatcher);
+	}
+}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h
new file mode 100644
index 0000000..f8bc7da
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h
@@ -0,0 +1,72 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef BT_SPU_GATHERING_COLLISION__DISPATCHER_H
+#define BT_SPU_GATHERING_COLLISION__DISPATCHER_H
+
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+
+
+///Tuning value to optimized SPU utilization 
+///Too small value means Task overhead is large compared to computation (too fine granularity)
+///Too big value might render some SPUs are idle, while a few other SPUs are doing all work.
+//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 8
+//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 16
+//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 64
+#define SPU_BATCHSIZE_BROADPHASE_PAIRS 128
+//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 256
+//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 512
+//#define SPU_BATCHSIZE_BROADPHASE_PAIRS 1024
+
+
+
+class SpuCollisionTaskProcess;
+
+///SpuGatheringCollisionDispatcher can use SPU to gather and calculate collision detection
+///Time of Impact, Closest Points and Penetration Depth.
+class SpuGatheringCollisionDispatcher : public btCollisionDispatcher
+{
+	
+	SpuCollisionTaskProcess*	m_spuCollisionTaskProcess;
+	
+protected:
+
+	class	btThreadSupportInterface*	m_threadInterface;
+
+	unsigned int	m_maxNumOutstandingTasks;
+	
+
+public:
+
+	//can be used by SPU collision algorithms	
+	SpuCollisionTaskProcess*	getSpuCollisionTaskProcess()
+	{
+			return m_spuCollisionTaskProcess;
+	}
+	
+	SpuGatheringCollisionDispatcher (class	btThreadSupportInterface*	threadInterface, unsigned int	maxNumOutstandingTasks,btCollisionConfiguration* collisionConfiguration);
+	
+	virtual ~SpuGatheringCollisionDispatcher();
+
+	bool	supportsDispatchPairOnSpu(int proxyType0,int proxyType1);
+
+	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ;
+
+};
+
+
+
+#endif //BT_SPU_GATHERING_COLLISION__DISPATCHER_H
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.cpp
new file mode 100644
index 0000000..a312450
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.cpp
@@ -0,0 +1,257 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifdef USE_LIBSPE2
+
+#include "SpuLibspe2Support.h"
+
+
+
+
+//SpuLibspe2Support helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
+///Setup and initialize SPU/CELL/Libspe2
+SpuLibspe2Support::SpuLibspe2Support(spe_program_handle_t *speprog, int numThreads)
+{
+	this->program = speprog;
+	this->numThreads =  ((numThreads <= spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, -1)) ? numThreads : spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, -1));
+}
+
+///cleanup/shutdown Libspe2
+SpuLibspe2Support::~SpuLibspe2Support()
+{
+	
+	stopSPU();
+}
+
+
+
+///send messages to SPUs
+void SpuLibspe2Support::sendRequest(uint32_t uiCommand, uint32_t uiArgument0, uint32_t uiArgument1)
+{
+	spe_context_ptr_t context;
+	
+	switch (uiCommand)
+	{
+	case CMD_SAMPLE_TASK_COMMAND:
+	{
+		//get taskdescription
+		SpuSampleTaskDesc* taskDesc = (SpuSampleTaskDesc*) uiArgument0;
+
+		btAssert(taskDesc->m_taskId<m_activeSpuStatus.size());
+
+		//get status of SPU on which task should run
+		btSpuStatus&	spuStatus = m_activeSpuStatus[taskDesc->m_taskId];
+
+		//set data for spuStatus
+		spuStatus.m_commandId = uiCommand;
+		spuStatus.m_status = Spu_Status_Occupied; //set SPU as "occupied"
+		spuStatus.m_taskDesc.p = taskDesc; 
+		
+		//get context
+		context = data[taskDesc->m_taskId].context;
+		
+		
+		taskDesc->m_mainMemoryPtr = reinterpret_cast<uint64_t> (spuStatus.m_lsMemory.p);
+		
+
+		break;
+	}
+	case CMD_GATHER_AND_PROCESS_PAIRLIST:
+		{
+			//get taskdescription
+			SpuGatherAndProcessPairsTaskDesc* taskDesc = (SpuGatherAndProcessPairsTaskDesc*) uiArgument0;
+
+			btAssert(taskDesc->taskId<m_activeSpuStatus.size());
+
+			//get status of SPU on which task should run
+			btSpuStatus&	spuStatus = m_activeSpuStatus[taskDesc->taskId];
+
+			//set data for spuStatus
+			spuStatus.m_commandId = uiCommand;
+			spuStatus.m_status = Spu_Status_Occupied; //set SPU as "occupied"
+			spuStatus.m_taskDesc.p = taskDesc; 
+			
+			//get context
+			context = data[taskDesc->taskId].context;
+			
+			
+			taskDesc->m_lsMemory = (CollisionTask_LocalStoreMemory*)spuStatus.m_lsMemory.p;
+			
+			break;
+		}
+	default:
+		{
+			///not implemented
+			btAssert(0);
+		}
+
+	};
+
+	
+	//write taskdescription in mailbox
+	unsigned int event = Spu_Mailbox_Event_Task;
+	spe_in_mbox_write(context, &event, 1, SPE_MBOX_ANY_NONBLOCKING);
+
+}
+
+///check for messages from SPUs
+void SpuLibspe2Support::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
+{
+	///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
+	
+	///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
+	
+	btAssert(m_activeSpuStatus.size());
+
+	
+	int last = -1;
+	
+	//find an active spu/thread
+	while(last < 0)
+	{
+		for (int i=0;i<m_activeSpuStatus.size();i++)
+		{
+			if ( m_activeSpuStatus[i].m_status == Spu_Status_Free)
+			{
+				last = i;
+				break;
+			}
+		}
+		if(last < 0)
+			sched_yield();
+	}
+
+
+
+	btSpuStatus& spuStatus = m_activeSpuStatus[last];
+
+	///need to find an active spu
+	btAssert(last>=0);
+
+	
+
+	*puiArgument0 = spuStatus.m_taskId;
+	*puiArgument1 = spuStatus.m_status;
+
+
+}
+
+
+void SpuLibspe2Support::startSPU()
+{
+	this->internal_startSPU();
+}
+
+
+
+///start the spus group (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
+void SpuLibspe2Support::internal_startSPU()
+{
+	m_activeSpuStatus.resize(numThreads);
+	
+	
+	for (int i=0; i < numThreads; i++)
+	{
+		
+		if(data[i].context == NULL) 
+		{
+					
+			 /* Create context */
+			if ((data[i].context = spe_context_create(0, NULL)) == NULL)
+			{
+			      perror ("Failed creating context");
+		          exit(1);
+			}
+	
+			/* Load program into context */
+			if(spe_program_load(data[i].context, this->program))
+			{
+			      perror ("Failed loading program");
+		          exit(1);
+			}
+			
+			m_activeSpuStatus[i].m_status = Spu_Status_Startup; 
+			m_activeSpuStatus[i].m_taskId = i; 
+			m_activeSpuStatus[i].m_commandId = 0; 
+			m_activeSpuStatus[i].m_lsMemory.p = NULL; 
+			
+			
+			data[i].entry = SPE_DEFAULT_ENTRY;
+			data[i].flags = 0;
+			data[i].argp.p = &m_activeSpuStatus[i];
+			data[i].envp.p = NULL;
+			
+		    /* Create thread for each SPE context */
+			if (pthread_create(&data[i].pthread, NULL, &ppu_pthread_function, &(data[i]) ))
+			{
+			      perror ("Failed creating thread");
+		          exit(1);
+			}
+			/*
+			else
+			{
+				printf("started thread %d\n",i);
+			}*/
+		}		
+	}
+	
+	
+	for (int i=0; i < numThreads; i++)
+	{
+		if(data[i].context != NULL) 
+		{
+			while( m_activeSpuStatus[i].m_status == Spu_Status_Startup)
+			{
+				// wait for spu to set up
+				sched_yield();
+			}
+			printf("Spu %d is ready\n", i);
+		}
+	}
+}
+
+///tell the task scheduler we are done with the SPU tasks
+void SpuLibspe2Support::stopSPU()
+{
+	// wait for all threads to finish 
+	int i;
+	for ( i = 0; i < this->numThreads; i++ ) 
+	{ 
+		
+		unsigned int event = Spu_Mailbox_Event_Shutdown;
+		spe_context_ptr_t context = data[i].context;
+		spe_in_mbox_write(context, &event, 1, SPE_MBOX_ALL_BLOCKING);
+		pthread_join (data[i].pthread, NULL); 
+		
+	} 
+	// close SPE program 
+	spe_image_close(program); 
+	// destroy SPE contexts 
+	for ( i = 0; i < this->numThreads; i++ ) 
+	{ 
+		if(data[i].context != NULL)
+		{
+			spe_context_destroy (data[i].context);
+		}
+	} 
+	
+	m_activeSpuStatus.clear();
+	
+}
+
+
+
+#endif //USE_LIBSPE2
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.h
new file mode 100644
index 0000000..37a5e79
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuLibspe2Support.h
@@ -0,0 +1,180 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_SPU_LIBSPE2_SUPPORT_H
+#define BT_SPU_LIBSPE2_SUPPORT_H
+
+#include <LinearMath/btScalar.h> //for uint32_t etc.
+
+#ifdef USE_LIBSPE2
+
+#include <stdlib.h>
+#include <stdio.h>
+//#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
+#include "PlatformDefinitions.h"
+
+
+//extern struct SpuGatherAndProcessPairsTaskDesc;
+
+enum
+{
+	Spu_Mailbox_Event_Nothing = 0,
+	Spu_Mailbox_Event_Task = 1,
+	Spu_Mailbox_Event_Shutdown = 2,
+	
+	Spu_Mailbox_Event_ForceDword = 0xFFFFFFFF
+	
+};
+
+enum
+{
+	Spu_Status_Free = 0,
+	Spu_Status_Occupied = 1,
+	Spu_Status_Startup = 2,
+	
+	Spu_Status_ForceDword = 0xFFFFFFFF
+	
+};
+
+
+struct btSpuStatus
+{
+	uint32_t	m_taskId;
+	uint32_t	m_commandId;
+	uint32_t	m_status;
+
+	addr64 m_taskDesc;
+	addr64 m_lsMemory;
+	
+}
+__attribute__ ((aligned (128)))
+;
+
+
+
+#ifndef __SPU__
+
+#include "LinearMath/btAlignedObjectArray.h"
+#include "SpuCollisionTaskProcess.h"
+#include "SpuSampleTaskProcess.h"
+#include "btThreadSupportInterface.h"
+#include <libspe2.h>
+#include <pthread.h>
+#include <sched.h>
+
+#define MAX_SPUS 4 
+
+typedef struct ppu_pthread_data 
+{
+	spe_context_ptr_t context;
+	pthread_t pthread;
+	unsigned int entry;
+	unsigned int flags;
+	addr64 argp;
+	addr64 envp;
+	spe_stop_info_t stopinfo;
+} ppu_pthread_data_t;
+
+
+static void *ppu_pthread_function(void *arg)
+{
+    ppu_pthread_data_t * datap = (ppu_pthread_data_t *)arg;
+    /*
+    int rc;
+    do 
+    {*/
+        spe_context_run(datap->context, &datap->entry, datap->flags, datap->argp.p, datap->envp.p, &datap->stopinfo);
+        if (datap->stopinfo.stop_reason == SPE_EXIT) 
+        {
+           if (datap->stopinfo.result.spe_exit_code != 0) 
+           {
+             perror("FAILED: SPE returned a non-zero exit status: \n");
+             exit(1);
+           }
+         } 
+        else 
+         {
+           perror("FAILED: SPE abnormally terminated\n");
+           exit(1);
+         }
+        
+        
+    //} while (rc > 0); // loop until exit or error, and while any stop & signal
+    pthread_exit(NULL);
+}
+
+
+
+
+
+
+///SpuLibspe2Support helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
+class SpuLibspe2Support : public btThreadSupportInterface
+{
+
+	btAlignedObjectArray<btSpuStatus>	m_activeSpuStatus;
+	
+public:
+	//Setup and initialize SPU/CELL/Libspe2
+	SpuLibspe2Support(spe_program_handle_t *speprog,int numThreads);
+	
+	// SPE program handle ptr.
+	spe_program_handle_t *program;
+	
+	// SPE program data
+	ppu_pthread_data_t data[MAX_SPUS];
+	
+	//cleanup/shutdown Libspe2
+	~SpuLibspe2Support();
+
+	///send messages to SPUs
+	void sendRequest(uint32_t uiCommand, uint32_t uiArgument0, uint32_t uiArgument1=0);
+
+	//check for messages from SPUs
+	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
+
+	//start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
+	virtual void startSPU();
+
+	//tell the task scheduler we are done with the SPU tasks
+	virtual void stopSPU();
+
+	virtual void setNumTasks(int numTasks)
+	{
+		//changing the number of tasks after initialization is not implemented (yet)
+	}
+
+private:
+	
+	///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
+	void internal_startSPU();
+
+
+	
+	
+	int numThreads;
+
+};
+
+#endif // NOT __SPU__
+
+#endif //USE_LIBSPE2
+
+#endif //BT_SPU_LIBSPE2_SUPPORT_H
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
new file mode 100644
index 0000000..e517961
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
@@ -0,0 +1,167 @@
+/*
+   Copyright (C) 2006, 2008 Sony Computer Entertainment Inc.
+   All rights reserved.
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+*/
+
+#ifndef __BOX_H__
+#define __BOX_H__
+
+
+#ifndef PE_REF
+#define PE_REF(a) a&
+#endif
+
+#include <math.h>
+
+
+#include "../PlatformDefinitions.h"
+
+
+
+
+enum FeatureType { F, E, V };
+
+//----------------------------------------------------------------------------
+// Box
+//----------------------------------------------------------------------------
+///The Box is an internal class used by the boxBoxDistance calculation.
+class Box
+{
+public:
+	vmVector3 mHalf;
+
+	inline Box()
+	{}
+	inline Box(PE_REF(vmVector3) half_);
+	inline Box(float hx, float hy, float hz);
+
+	inline void Set(PE_REF(vmVector3) half_);
+	inline void Set(float hx, float hy, float hz);
+
+	inline vmVector3 GetAABB(const vmMatrix3& rotation) const;
+};
+
+inline
+Box::Box(PE_REF(vmVector3) half_)
+{
+	Set(half_);
+}
+
+inline
+Box::Box(float hx, float hy, float hz)
+{
+	Set(hx, hy, hz);
+}
+
+inline
+void
+Box::Set(PE_REF(vmVector3) half_)
+{
+	mHalf = half_;
+}
+
+inline
+void
+Box::Set(float hx, float hy, float hz)
+{
+	mHalf = vmVector3(hx, hy, hz);
+}
+
+inline
+vmVector3
+Box::GetAABB(const vmMatrix3& rotation) const
+{
+	return absPerElem(rotation) * mHalf;
+}
+
+//-------------------------------------------------------------------------------------------------
+// BoxPoint
+//-------------------------------------------------------------------------------------------------
+
+///The BoxPoint class is an internally used class to contain feature information for boxBoxDistance calculation.
+class BoxPoint
+{
+public:
+	BoxPoint() : localPoint(0.0f) {}
+
+	vmPoint3      localPoint;
+	FeatureType featureType;
+	int         featureIdx;
+
+	inline void setVertexFeature(int plusX, int plusY, int plusZ);
+	inline void setEdgeFeature(int dim0, int plus0, int dim1, int plus1);
+	inline void setFaceFeature(int dim, int plus);
+
+	inline void getVertexFeature(int & plusX, int & plusY, int & plusZ) const;
+	inline void getEdgeFeature(int & dim0, int & plus0, int & dim1, int & plus1) const;
+	inline void getFaceFeature(int & dim, int & plus) const;
+};
+
+inline
+void
+BoxPoint::setVertexFeature(int plusX, int plusY, int plusZ)
+{
+	featureType = V;
+	featureIdx = plusX << 2 | plusY << 1 | plusZ;
+}
+
+inline
+void
+BoxPoint::setEdgeFeature(int dim0, int plus0, int dim1, int plus1)
+{
+	featureType = E;
+
+	if (dim0 > dim1) {
+		featureIdx = plus1 << 5 | dim1 << 3 | plus0 << 2 | dim0;
+	} else {
+		featureIdx = plus0 << 5 | dim0 << 3 | plus1 << 2 | dim1;
+	}
+}
+
+inline
+void
+BoxPoint::setFaceFeature(int dim, int plus)
+{
+	featureType = F;
+	featureIdx = plus << 2 | dim;
+}
+
+inline
+void
+BoxPoint::getVertexFeature(int & plusX, int & plusY, int & plusZ) const
+{
+	plusX = featureIdx >> 2;
+	plusY = featureIdx >> 1 & 1;
+	plusZ = featureIdx & 1;
+}
+
+inline
+void
+BoxPoint::getEdgeFeature(int & dim0, int & plus0, int & dim1, int & plus1) const
+{
+	plus0 = featureIdx >> 5;
+	dim0 = featureIdx >> 3 & 3;
+	plus1 = featureIdx >> 2 & 1;
+	dim1 = featureIdx & 3;
+}
+
+inline
+void
+BoxPoint::getFaceFeature(int & dim, int & plus) const
+{
+	plus = featureIdx >> 2;
+	dim = featureIdx & 3;
+}
+
+#endif /* __BOX_H__ */
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp
new file mode 100644
index 0000000..dfcd842
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp
@@ -0,0 +1,302 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#include "SpuCollisionShapes.h"
+
+///not supported on IBM SDK, until we fix the alignment of btVector3
+#if defined (__CELLOS_LV2__) && defined (__SPU__)
+#include <spu_intrinsics.h>
+static inline vec_float4 vec_dot3( vec_float4 vec0, vec_float4 vec1 )
+{
+    vec_float4 result;
+    result = spu_mul( vec0, vec1 );
+    result = spu_madd( spu_rlqwbyte( vec0, 4 ), spu_rlqwbyte( vec1, 4 ), result );
+    return spu_madd( spu_rlqwbyte( vec0, 8 ), spu_rlqwbyte( vec1, 8 ), result );
+}
+#endif //__SPU__
+
+
+void computeAabb (btVector3& aabbMin, btVector3& aabbMax, btConvexInternalShape* convexShape, ppu_address_t convexShapePtr, int shapeType, const btTransform& xform)
+{
+	//calculate the aabb, given the types...
+	switch (shapeType)
+	{
+	case CYLINDER_SHAPE_PROXYTYPE:
+		/* fall through */
+	case BOX_SHAPE_PROXYTYPE:
+	{
+		btScalar margin=convexShape->getMarginNV();
+		btVector3 halfExtents = convexShape->getImplicitShapeDimensions();
+		halfExtents += btVector3(margin,margin,margin);
+		const btTransform& t = xform;
+		btMatrix3x3 abs_b = t.getBasis().absolute();  
+		btVector3 center = t.getOrigin();
+		btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
+		
+		aabbMin = center - extent;
+		aabbMax = center + extent;
+		break;
+	}
+	case CAPSULE_SHAPE_PROXYTYPE:
+	{
+		btScalar margin=convexShape->getMarginNV();
+		btVector3 halfExtents = convexShape->getImplicitShapeDimensions();
+		//add the radius to y-axis to get full height
+		btScalar radius = halfExtents[0];
+		halfExtents[1] += radius;
+		halfExtents += btVector3(margin,margin,margin);
+#if 0
+		int capsuleUpAxis = convexShape->getUpAxis();
+		btScalar halfHeight = convexShape->getHalfHeight();
+		btScalar radius = convexShape->getRadius();
+		halfExtents[capsuleUpAxis] = radius + halfHeight;
+#endif
+		const btTransform& t = xform;
+		btMatrix3x3 abs_b = t.getBasis().absolute();  
+		btVector3 center = t.getOrigin();
+		btVector3 extent = btVector3(abs_b[0].dot(halfExtents),abs_b[1].dot(halfExtents),abs_b[2].dot(halfExtents));
+		
+		aabbMin = center - extent;
+		aabbMax = center + extent;
+		break;
+	}
+	case SPHERE_SHAPE_PROXYTYPE:
+	{
+		btScalar radius = convexShape->getImplicitShapeDimensions().getX();// * convexShape->getLocalScaling().getX();
+		btScalar margin = radius + convexShape->getMarginNV();
+		const btTransform& t = xform;
+		const btVector3& center = t.getOrigin();
+		btVector3 extent(margin,margin,margin);
+		aabbMin = center - extent;
+		aabbMax = center + extent;
+		break;
+	}
+	case CONVEX_HULL_SHAPE_PROXYTYPE:
+	{
+		ATTRIBUTE_ALIGNED16(char convexHullShape0[sizeof(btConvexHullShape)]);
+		cellDmaGet(&convexHullShape0, convexShapePtr  , sizeof(btConvexHullShape), DMA_TAG(1), 0, 0);
+		cellDmaWaitTagStatusAll(DMA_MASK(1));
+		btConvexHullShape* localPtr = (btConvexHullShape*)&convexHullShape0;
+		const btTransform& t = xform;
+		btScalar margin = convexShape->getMarginNV();
+		localPtr->getNonvirtualAabb(t,aabbMin,aabbMax,margin);
+		//spu_printf("SPU convex aabbMin=%f,%f,%f=\n",aabbMin.getX(),aabbMin.getY(),aabbMin.getZ());
+		//spu_printf("SPU convex aabbMax=%f,%f,%f=\n",aabbMax.getX(),aabbMax.getY(),aabbMax.getZ());
+		break;
+	}
+	default:
+		{
+	//	spu_printf("SPU: unsupported shapetype %d in AABB calculation\n");
+		}
+	};
+}
+
+void dmaBvhShapeData (bvhMeshShape_LocalStoreMemory* bvhMeshShape, btBvhTriangleMeshShape* triMeshShape)
+{
+	register int dmaSize;
+	register ppu_address_t	dmaPpuAddress2;
+
+	dmaSize = sizeof(btTriangleIndexVertexArray);
+	dmaPpuAddress2 = reinterpret_cast<ppu_address_t>(triMeshShape->getMeshInterface());
+	//	spu_printf("trimeshShape->getMeshInterface() == %llx\n",dmaPpuAddress2);
+#ifdef __SPU__
+	cellDmaGet(&bvhMeshShape->gTriangleMeshInterfaceStorage, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+	bvhMeshShape->gTriangleMeshInterfacePtr = &bvhMeshShape->gTriangleMeshInterfaceStorage;
+#else
+	bvhMeshShape->gTriangleMeshInterfacePtr = (btTriangleIndexVertexArray*)cellDmaGetReadOnly(&bvhMeshShape->gTriangleMeshInterfaceStorage, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+#endif
+
+	//cellDmaWaitTagStatusAll(DMA_MASK(1));
+	
+	///now DMA over the BVH
+	
+	dmaSize = sizeof(btOptimizedBvh);
+	dmaPpuAddress2 = reinterpret_cast<ppu_address_t>(triMeshShape->getOptimizedBvh());
+	//spu_printf("trimeshShape->getOptimizedBvh() == %llx\n",dmaPpuAddress2);
+	cellDmaGet(&bvhMeshShape->gOptimizedBvh, dmaPpuAddress2  , dmaSize, DMA_TAG(2), 0, 0);
+	//cellDmaWaitTagStatusAll(DMA_MASK(2));
+	cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
+}
+
+void dmaBvhIndexedMesh (btIndexedMesh* IndexMesh, IndexedMeshArray& indexArray, int index, uint32_t dmaTag)
+{		
+	cellDmaGet(IndexMesh, (ppu_address_t)&indexArray[index]  , sizeof(btIndexedMesh), DMA_TAG(dmaTag), 0, 0);
+	
+}
+
+void dmaBvhSubTreeHeaders (btBvhSubtreeInfo* subTreeHeaders, ppu_address_t subTreePtr, int batchSize, uint32_t dmaTag)
+{
+	cellDmaGet(subTreeHeaders, subTreePtr, batchSize * sizeof(btBvhSubtreeInfo), DMA_TAG(dmaTag), 0, 0);
+}
+
+void dmaBvhSubTreeNodes (btQuantizedBvhNode* nodes, const btBvhSubtreeInfo& subtree, QuantizedNodeArray&	nodeArray, int dmaTag)
+{
+	cellDmaGet(nodes, reinterpret_cast<ppu_address_t>(&nodeArray[subtree.m_rootNodeIndex]) , subtree.m_subtreeSize* sizeof(btQuantizedBvhNode), DMA_TAG(2), 0, 0);
+}
+
+///getShapeTypeSize could easily be optimized, but it is not likely a bottleneck
+int		getShapeTypeSize(int shapeType)
+{
+
+
+	switch (shapeType)
+	{
+	case CYLINDER_SHAPE_PROXYTYPE:
+		{
+			int shapeSize = sizeof(btCylinderShape);
+			btAssert(shapeSize < MAX_SHAPE_SIZE);
+			return shapeSize;
+		}
+	case BOX_SHAPE_PROXYTYPE:
+		{
+			int shapeSize = sizeof(btBoxShape);
+			btAssert(shapeSize < MAX_SHAPE_SIZE);
+			return shapeSize;
+		}
+	case SPHERE_SHAPE_PROXYTYPE:
+		{
+			int shapeSize = sizeof(btSphereShape);
+			btAssert(shapeSize < MAX_SHAPE_SIZE);
+			return shapeSize;
+		}
+	case TRIANGLE_MESH_SHAPE_PROXYTYPE:
+		{
+			int shapeSize = sizeof(btBvhTriangleMeshShape);
+			btAssert(shapeSize < MAX_SHAPE_SIZE);
+			return shapeSize;
+		}
+	case CAPSULE_SHAPE_PROXYTYPE:
+		{
+			int shapeSize = sizeof(btCapsuleShape);
+			btAssert(shapeSize < MAX_SHAPE_SIZE);
+			return shapeSize;
+		}
+
+	case CONVEX_HULL_SHAPE_PROXYTYPE:
+		{
+			int shapeSize = sizeof(btConvexHullShape);
+			btAssert(shapeSize < MAX_SHAPE_SIZE);
+			return shapeSize;
+		}
+
+	case COMPOUND_SHAPE_PROXYTYPE:
+		{
+			int shapeSize = sizeof(btCompoundShape);
+			btAssert(shapeSize < MAX_SHAPE_SIZE);
+			return shapeSize;
+		}
+	case STATIC_PLANE_PROXYTYPE:
+		{
+			int shapeSize = sizeof(btStaticPlaneShape);
+			btAssert(shapeSize < MAX_SHAPE_SIZE);
+			return shapeSize;
+		}
+
+	default:
+		btAssert(0);
+		//unsupported shapetype, please add here
+		return 0;
+	}
+}
+
+void dmaConvexVertexData (SpuConvexPolyhedronVertexData* convexVertexData, btConvexHullShape* convexShapeSPU)
+{
+	convexVertexData->gNumConvexPoints = convexShapeSPU->getNumPoints();
+	if (convexVertexData->gNumConvexPoints>MAX_NUM_SPU_CONVEX_POINTS)
+	{
+		btAssert(0);
+	//	spu_printf("SPU: Error: MAX_NUM_SPU_CONVEX_POINTS(%d) exceeded: %d\n",MAX_NUM_SPU_CONVEX_POINTS,convexVertexData->gNumConvexPoints);
+		return;
+	}
+			
+	register int dmaSize = convexVertexData->gNumConvexPoints*sizeof(btVector3);
+	ppu_address_t pointsPPU = (ppu_address_t) convexShapeSPU->getUnscaledPoints();
+	cellDmaGet(&convexVertexData->g_convexPointBuffer[0], pointsPPU  , dmaSize, DMA_TAG(2), 0, 0);
+}
+
+void dmaCollisionShape (void* collisionShapeLocation, ppu_address_t collisionShapePtr, uint32_t dmaTag, int shapeType)
+{
+	register int dmaSize = getShapeTypeSize(shapeType);
+	cellDmaGet(collisionShapeLocation, collisionShapePtr  , dmaSize, DMA_TAG(dmaTag), 0, 0);
+	//cellDmaGetReadOnly(collisionShapeLocation, collisionShapePtr  , dmaSize, DMA_TAG(dmaTag), 0, 0);
+	//cellDmaWaitTagStatusAll(DMA_MASK(dmaTag));
+}
+
+void dmaCompoundShapeInfo (CompoundShape_LocalStoreMemory* compoundShapeLocation, btCompoundShape* spuCompoundShape, uint32_t dmaTag)
+{
+	register int dmaSize;
+	register	ppu_address_t	dmaPpuAddress2;
+	int childShapeCount = spuCompoundShape->getNumChildShapes();
+	dmaSize = childShapeCount * sizeof(btCompoundShapeChild);
+	dmaPpuAddress2 = (ppu_address_t)spuCompoundShape->getChildList();
+	cellDmaGet(&compoundShapeLocation->gSubshapes[0], dmaPpuAddress2, dmaSize, DMA_TAG(dmaTag), 0, 0);
+}
+
+void dmaCompoundSubShapes (CompoundShape_LocalStoreMemory* compoundShapeLocation, btCompoundShape* spuCompoundShape, uint32_t dmaTag)
+{
+	int childShapeCount = spuCompoundShape->getNumChildShapes();
+	int i;
+	// DMA all the subshapes 
+	for ( i = 0; i < childShapeCount; ++i)
+	{
+		btCompoundShapeChild& childShape = compoundShapeLocation->gSubshapes[i];
+		dmaCollisionShape (&compoundShapeLocation->gSubshapeShape[i],(ppu_address_t)childShape.m_childShape, dmaTag, childShape.m_childShapeType);
+	}
+}
+
+
+void	spuWalkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,const btQuantizedBvhNode* rootNode,int startNodeIndex,int endNodeIndex)
+{
+
+	int curIndex = startNodeIndex;
+	int walkIterations = 0;
+#ifdef BT_DEBUG
+	int subTreeSize = endNodeIndex - startNodeIndex;
+#endif
+
+	int escapeIndex;
+
+	unsigned int aabbOverlap, isLeafNode;
+
+	while (curIndex < endNodeIndex)
+	{
+		//catch bugs in tree data
+		btAssert (walkIterations < subTreeSize);
+
+		walkIterations++;
+		aabbOverlap = spuTestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
+		isLeafNode = rootNode->isLeafNode();
+
+		if (isLeafNode && aabbOverlap)
+		{
+			//printf("overlap with node %d\n",rootNode->getTriangleIndex());
+			nodeCallback->processNode(0,rootNode->getTriangleIndex());
+			//			spu_printf("SPU: overlap detected with triangleIndex:%d\n",rootNode->getTriangleIndex());
+		} 
+
+		if (aabbOverlap || isLeafNode)
+		{
+			rootNode++;
+			curIndex++;
+		} else
+		{
+			escapeIndex = rootNode->getEscapeIndex();
+			rootNode += escapeIndex;
+			curIndex += escapeIndex;
+		}
+	}
+
+}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h
new file mode 100644
index 0000000..aa8a291
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h
@@ -0,0 +1,128 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+#ifndef __SPU_COLLISION_SHAPES_H
+#define __SPU_COLLISION_SHAPES_H
+
+#include "../SpuDoubleBuffer.h"
+
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "BulletCollision/CollisionShapes/btConvexInternalShape.h"
+#include "BulletCollision/CollisionShapes/btCylinderShape.h"
+#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
+
+#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
+#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+
+#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
+
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
+#include "BulletCollision/CollisionShapes/btCompoundShape.h"
+
+#define MAX_NUM_SPU_CONVEX_POINTS 128 //@fallback to PPU if a btConvexHullShape has more than MAX_NUM_SPU_CONVEX_POINTS points
+#define MAX_SPU_COMPOUND_SUBSHAPES 16 //@fallback on PPU if compound has more than MAX_SPU_COMPOUND_SUBSHAPES child shapes
+#define MAX_SHAPE_SIZE 256 //@todo: assert on this
+
+ATTRIBUTE_ALIGNED16(struct)	SpuConvexPolyhedronVertexData
+{
+	void*	gSpuConvexShapePtr;
+	btVector3* gConvexPoints;
+	int gNumConvexPoints;
+	int unused;
+	ATTRIBUTE_ALIGNED16(btVector3 g_convexPointBuffer[MAX_NUM_SPU_CONVEX_POINTS]);
+};
+
+
+
+ATTRIBUTE_ALIGNED16(struct) CollisionShape_LocalStoreMemory
+{
+	ATTRIBUTE_ALIGNED16(char collisionShape[MAX_SHAPE_SIZE]);
+};
+
+ATTRIBUTE_ALIGNED16(struct) CompoundShape_LocalStoreMemory
+{
+	// Compound data
+
+	ATTRIBUTE_ALIGNED16(btCompoundShapeChild gSubshapes[MAX_SPU_COMPOUND_SUBSHAPES]);
+	ATTRIBUTE_ALIGNED16(char gSubshapeShape[MAX_SPU_COMPOUND_SUBSHAPES][MAX_SHAPE_SIZE]);
+};
+
+ATTRIBUTE_ALIGNED16(struct) bvhMeshShape_LocalStoreMemory
+{
+	//ATTRIBUTE_ALIGNED16(btOptimizedBvh	gOptimizedBvh);
+	ATTRIBUTE_ALIGNED16(char gOptimizedBvh[sizeof(btOptimizedBvh)+16]);
+	btOptimizedBvh*	getOptimizedBvh()
+	{
+		return (btOptimizedBvh*) gOptimizedBvh;
+	}
+
+	ATTRIBUTE_ALIGNED16(btTriangleIndexVertexArray	gTriangleMeshInterfaceStorage);
+	btTriangleIndexVertexArray*	gTriangleMeshInterfacePtr;
+	///only a single mesh part for now, we can add support for multiple parts, but quantized trees don't support this at the moment 
+	ATTRIBUTE_ALIGNED16(btIndexedMesh	gIndexMesh);
+	#define MAX_SPU_SUBTREE_HEADERS 32
+	//1024
+	ATTRIBUTE_ALIGNED16(btBvhSubtreeInfo	gSubtreeHeaders[MAX_SPU_SUBTREE_HEADERS]);
+	ATTRIBUTE_ALIGNED16(btQuantizedBvhNode	gSubtreeNodes[MAX_SUBTREE_SIZE_IN_BYTES/sizeof(btQuantizedBvhNode)]);
+};
+
+
+void computeAabb (btVector3& aabbMin, btVector3& aabbMax, btConvexInternalShape* convexShape, ppu_address_t convexShapePtr, int shapeType, const btTransform& xform);
+void dmaBvhShapeData (bvhMeshShape_LocalStoreMemory* bvhMeshShape, btBvhTriangleMeshShape* triMeshShape);
+void dmaBvhIndexedMesh (btIndexedMesh* IndexMesh, IndexedMeshArray& indexArray, int index, uint32_t dmaTag);
+void dmaBvhSubTreeHeaders (btBvhSubtreeInfo* subTreeHeaders, ppu_address_t subTreePtr, int batchSize, uint32_t dmaTag);
+void dmaBvhSubTreeNodes (btQuantizedBvhNode* nodes, const btBvhSubtreeInfo& subtree, QuantizedNodeArray&	nodeArray, int dmaTag);
+
+int  getShapeTypeSize(int shapeType);
+void dmaConvexVertexData (SpuConvexPolyhedronVertexData* convexVertexData, btConvexHullShape* convexShapeSPU);
+void dmaCollisionShape (void* collisionShapeLocation, ppu_address_t collisionShapePtr, uint32_t dmaTag, int shapeType);
+void dmaCompoundShapeInfo (CompoundShape_LocalStoreMemory* compoundShapeLocation, btCompoundShape* spuCompoundShape, uint32_t dmaTag);
+void dmaCompoundSubShapes (CompoundShape_LocalStoreMemory* compoundShapeLocation, btCompoundShape* spuCompoundShape, uint32_t dmaTag);
+
+
+#define USE_BRANCHFREE_TEST 1
+#ifdef USE_BRANCHFREE_TEST
+SIMD_FORCE_INLINE unsigned int spuTestQuantizedAabbAgainstQuantizedAabb(unsigned short int* aabbMin1,unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2)
+{		
+#if defined(__CELLOS_LV2__) && defined (__SPU__)
+	vec_ushort8 vecMin = {aabbMin1[0],aabbMin2[0],aabbMin1[2],aabbMin2[2],aabbMin1[1],aabbMin2[1],0,0};
+	vec_ushort8 vecMax = {aabbMax2[0],aabbMax1[0],aabbMax2[2],aabbMax1[2],aabbMax2[1],aabbMax1[1],0,0};
+	vec_ushort8 isGt = spu_cmpgt(vecMin,vecMax);
+	return spu_extract(spu_gather(isGt),0)==0;
+
+#else
+	return btSelect((unsigned)((aabbMin1[0] <= aabbMax2[0]) & (aabbMax1[0] >= aabbMin2[0])
+		& (aabbMin1[2] <= aabbMax2[2]) & (aabbMax1[2] >= aabbMin2[2])
+		& (aabbMin1[1] <= aabbMax2[1]) & (aabbMax1[1] >= aabbMin2[1])),
+		1, 0);
+#endif
+}
+#else
+
+SIMD_FORCE_INLINE unsigned int spuTestQuantizedAabbAgainstQuantizedAabb(const unsigned short int* aabbMin1,const unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int*  aabbMax2)
+{
+	unsigned int overlap = 1;
+	overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? 0 : overlap;
+	overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? 0 : overlap;
+	overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? 0 : overlap;
+	return overlap;
+}
+#endif
+
+void	spuWalkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,const btQuantizedBvhNode* rootNode,int startNodeIndex,int endNodeIndex);
+
+#endif
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp
new file mode 100644
index 0000000..bd71373
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp
@@ -0,0 +1,248 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "SpuContactResult.h"
+
+//#define DEBUG_SPU_COLLISION_DETECTION 1
+
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+#ifndef __SPU__
+#include <stdio.h>
+#define spu_printf printf
+#endif
+#endif //DEBUG_SPU_COLLISION_DETECTION
+
+SpuContactResult::SpuContactResult()
+{
+	m_manifoldAddress = 0;
+	m_spuManifold = NULL;
+	m_RequiresWriteBack = false;
+}
+
+ SpuContactResult::~SpuContactResult()
+{
+	g_manifoldDmaExport.swapBuffers();
+}
+
+ 	///User can override this material combiner by implementing gContactAddedCallback and setting body0->m_collisionFlags |= btCollisionObject::customMaterialCallback;
+inline btScalar	calculateCombinedFriction(btScalar friction0,btScalar friction1)
+{
+	btScalar friction = friction0*friction1;
+
+	const btScalar MAX_FRICTION  = btScalar(10.);
+
+	if (friction < -MAX_FRICTION)
+		friction = -MAX_FRICTION;
+	if (friction > MAX_FRICTION)
+		friction = MAX_FRICTION;
+	return friction;
+
+}
+
+inline btScalar	calculateCombinedRestitution(btScalar restitution0,btScalar restitution1)
+{
+	return restitution0*restitution1;
+}
+
+
+
+ void	SpuContactResult::setContactInfo(btPersistentManifold* spuManifold, ppu_address_t	manifoldAddress,const btTransform& worldTrans0,const btTransform& worldTrans1, btScalar restitution0,btScalar restitution1, btScalar friction0,btScalar friction1, bool isSwapped)
+ {
+	//spu_printf("SpuContactResult::setContactInfo ManifoldAddress: %lu\n", manifoldAddress);
+	m_rootWorldTransform0 = worldTrans0;
+	m_rootWorldTransform1 = worldTrans1;
+	m_manifoldAddress = manifoldAddress;    
+	m_spuManifold = spuManifold;
+
+	m_combinedFriction = calculateCombinedFriction(friction0,friction1);
+	m_combinedRestitution = calculateCombinedRestitution(restitution0,restitution1);
+	m_isSwapped = isSwapped;
+ }
+
+ void SpuContactResult::setShapeIdentifiersA(int partId0,int index0)
+ {
+	
+ }
+
+ void SpuContactResult::setShapeIdentifiersB(int partId1,int index1)
+ {
+	
+ }
+
+
+
+ ///return true if it requires a dma transfer back
+bool ManifoldResultAddContactPoint(const btVector3& normalOnBInWorld,
+								   const btVector3& pointInWorld,
+								   float depth,
+								   btPersistentManifold* manifoldPtr,
+								   btTransform& transA,
+								   btTransform& transB,
+									btScalar	combinedFriction,
+									btScalar	combinedRestitution,
+								   bool isSwapped)
+{
+	
+//	float contactTreshold = manifoldPtr->getContactBreakingThreshold();
+
+	//spu_printf("SPU: add contactpoint, depth:%f, contactTreshold %f, manifoldPtr %llx\n",depth,contactTreshold,manifoldPtr);
+
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+	spu_printf("SPU: contactTreshold %f\n",contactTreshold);
+#endif //DEBUG_SPU_COLLISION_DETECTION
+	//if (depth > manifoldPtr->getContactBreakingThreshold())
+	//	return false;
+
+	if (depth > manifoldPtr->getContactProcessingThreshold())
+		return false;
+
+
+
+	btVector3 pointA;
+	btVector3 localA;
+	btVector3 localB;
+	btVector3 normal;
+
+
+	if (isSwapped)
+	{
+		normal = normalOnBInWorld * -1;
+		pointA = pointInWorld + normal * depth;
+		localA = transA.invXform(pointA );
+		localB = transB.invXform(pointInWorld);
+	}
+	else
+	{
+		normal = normalOnBInWorld;
+		pointA = pointInWorld + normal * depth;
+		localA = transA.invXform(pointA );
+		localB = transB.invXform(pointInWorld);
+	}
+
+	btManifoldPoint newPt(localA,localB,normal,depth);
+	newPt.m_positionWorldOnA = pointA;
+	newPt.m_positionWorldOnB = pointInWorld;
+
+	newPt.m_combinedFriction = combinedFriction;
+	newPt.m_combinedRestitution = combinedRestitution;
+
+
+	int insertIndex = manifoldPtr->getCacheEntry(newPt);
+	if (insertIndex >= 0)
+	{
+		// we need to replace the current contact point, otherwise small errors will accumulate (spheres start rolling etc)
+		manifoldPtr->replaceContactPoint(newPt,insertIndex);
+		return true;
+		
+	} else
+	{
+
+		/*
+		///@todo: SPU callbacks, either immediate (local on the SPU), or deferred
+		//User can override friction and/or restitution
+		if (gContactAddedCallback &&
+			//and if either of the two bodies requires custom material
+			 ((m_body0->m_collisionFlags & btCollisionObject::customMaterialCallback) ||
+			   (m_body1->m_collisionFlags & btCollisionObject::customMaterialCallback)))
+		{
+			//experimental feature info, for per-triangle material etc.
+			(*gContactAddedCallback)(newPt,m_body0,m_partId0,m_index0,m_body1,m_partId1,m_index1);
+		}
+		*/
+
+		manifoldPtr->addManifoldPoint(newPt);
+		return true;
+
+	}
+	return false;
+	
+}
+
+
+void SpuContactResult::writeDoubleBufferedManifold(btPersistentManifold* lsManifold, btPersistentManifold* mmManifold)
+{
+	///only write back the contact information on SPU. Other platforms avoid copying, and use the data in-place
+	///see SpuFakeDma.cpp 'cellDmaLargeGetReadOnly'
+#if defined (__SPU__) || defined (USE_LIBSPE2)
+    memcpy(g_manifoldDmaExport.getFront(),lsManifold,sizeof(btPersistentManifold));
+
+    g_manifoldDmaExport.swapBuffers();
+    ppu_address_t mmAddr = (ppu_address_t)mmManifold;
+    g_manifoldDmaExport.backBufferDmaPut(mmAddr, sizeof(btPersistentManifold), DMA_TAG(9));
+	// Should there be any kind of wait here?  What if somebody tries to use this tag again?  What if we call this function again really soon?
+	//no, the swapBuffers does the wait
+#endif
+}
+
+void SpuContactResult::addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
+{
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+	spu_printf("*** SpuContactResult::addContactPoint: depth = %f\n",depth);
+	spu_printf("*** normal = %f,%f,%f\n",normalOnBInWorld.getX(),normalOnBInWorld.getY(),normalOnBInWorld.getZ());
+	spu_printf("*** position = %f,%f,%f\n",pointInWorld.getX(),pointInWorld.getY(),pointInWorld.getZ());
+#endif //DEBUG_SPU_COLLISION_DETECTION
+	
+
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+ //   int sman = sizeof(rage::phManifold);
+//	spu_printf("sizeof_manifold = %i\n",sman);
+#endif //DEBUG_SPU_COLLISION_DETECTION
+
+	btPersistentManifold* localManifold = m_spuManifold;
+
+	btVector3	normalB(normalOnBInWorld.getX(),normalOnBInWorld.getY(),normalOnBInWorld.getZ());
+	btVector3	pointWrld(pointInWorld.getX(),pointInWorld.getY(),pointInWorld.getZ());
+
+	//process the contact point
+	const bool retVal = ManifoldResultAddContactPoint(normalB,
+		pointWrld,
+		depth,
+		localManifold,
+		m_rootWorldTransform0,
+		m_rootWorldTransform1,
+		m_combinedFriction,
+		m_combinedRestitution,
+		m_isSwapped);
+	m_RequiresWriteBack = m_RequiresWriteBack || retVal;
+}
+
+void SpuContactResult::flush()
+{
+
+	if (m_spuManifold && m_spuManifold->getNumContacts())
+	{
+		m_spuManifold->refreshContactPoints(m_rootWorldTransform0,m_rootWorldTransform1);
+		m_RequiresWriteBack = true;
+	}
+
+
+	if (m_RequiresWriteBack)
+	{
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+		spu_printf("SPU: Start SpuContactResult::flush (Put) DMA\n");
+		spu_printf("Num contacts:%d\n", m_spuManifold->getNumContacts());
+		spu_printf("Manifold address: %llu\n", m_manifoldAddress);
+#endif //DEBUG_SPU_COLLISION_DETECTION
+	//	spu_printf("writeDoubleBufferedManifold\n");
+		writeDoubleBufferedManifold(m_spuManifold, (btPersistentManifold*)m_manifoldAddress);
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+		spu_printf("SPU: Finished (Put) DMA\n");
+#endif //DEBUG_SPU_COLLISION_DETECTION
+	}
+	m_spuManifold = NULL;
+	m_RequiresWriteBack = false;
+}
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h
new file mode 100644
index 0000000..394f56d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h
@@ -0,0 +1,106 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef SPU_CONTACT_RESULT2_H
+#define SPU_CONTACT_RESULT2_H
+
+
+#ifndef _WIN32
+#include <stdint.h>
+#endif
+
+
+
+#include "../SpuDoubleBuffer.h"
+
+
+#include "LinearMath/btTransform.h"
+
+
+#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
+#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
+
+class btCollisionShape;
+
+
+struct SpuCollisionPairInput
+{
+	ppu_address_t m_collisionShapes[2];
+	btCollisionShape*	m_spuCollisionShapes[2];
+
+	ppu_address_t m_persistentManifoldPtr;
+	btVector3	m_primitiveDimensions0;
+	btVector3	m_primitiveDimensions1;
+	int		m_shapeType0;
+	int		m_shapeType1;	
+	float	m_collisionMargin0;
+	float	m_collisionMargin1;
+
+	btTransform	m_worldTransform0;
+	btTransform m_worldTransform1;
+	
+	bool	m_isSwapped;
+	bool    m_useEpa;
+};
+
+
+struct SpuClosestPointInput : public btDiscreteCollisionDetectorInterface::ClosestPointInput
+{
+	struct SpuConvexPolyhedronVertexData* m_convexVertexData[2];
+};
+
+///SpuContactResult exports the contact points using double-buffered DMA transfers, only when needed
+///So when an existing contact point is duplicated, no transfer/refresh is performed.
+class SpuContactResult : public btDiscreteCollisionDetectorInterface::Result
+{
+    btTransform		m_rootWorldTransform0;
+	btTransform		m_rootWorldTransform1;
+	ppu_address_t	m_manifoldAddress;
+
+    btPersistentManifold* m_spuManifold;
+	bool m_RequiresWriteBack;
+	btScalar	m_combinedFriction;
+	btScalar	m_combinedRestitution;
+	
+	bool m_isSwapped;
+
+	DoubleBuffer<btPersistentManifold, 1> g_manifoldDmaExport;
+
+	public:
+		SpuContactResult();
+		virtual ~SpuContactResult();
+
+		btPersistentManifold*	GetSpuManifold() const
+		{
+			return m_spuManifold;
+		}
+
+		virtual void setShapeIdentifiersA(int partId0,int index0);
+		virtual void setShapeIdentifiersB(int partId1,int index1);
+
+		void	setContactInfo(btPersistentManifold* spuManifold, ppu_address_t	manifoldAddress,const btTransform& worldTrans0,const btTransform& worldTrans1, btScalar restitution0,btScalar restitution1, btScalar friction0,btScalar friction01, bool isSwapped);
+
+
+        void writeDoubleBufferedManifold(btPersistentManifold* lsManifold, btPersistentManifold* mmManifold);
+
+        virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth);
+
+		void flush();
+};
+
+
+
+#endif //SPU_CONTACT_RESULT2_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h
new file mode 100644
index 0000000..449f192
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h
@@ -0,0 +1,51 @@
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef SPU_CONVEX_PENETRATION_DEPTH_H
+#define SPU_CONVEX_PENETRATION_DEPTH_H
+
+
+
+class btStackAlloc;
+class btIDebugDraw;
+#include "BulletCollision/NarrowphaseCollision/btConvexPenetrationDepthSolver.h"
+
+#include "LinearMath/btTransform.h"
+
+
+///ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.
+class SpuConvexPenetrationDepthSolver : public btConvexPenetrationDepthSolver
+{
+public:	
+	
+	virtual ~SpuConvexPenetrationDepthSolver() {};
+	virtual bool calcPenDepth( SpuVoronoiSimplexSolver& simplexSolver,
+	        void* convexA,void* convexB,int shapeTypeA, int shapeTypeB, float marginA, float marginB,
+            btTransform& transA,const btTransform& transB,
+			btVector3& v, btVector3& pa, btVector3& pb,
+			class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc,
+			struct SpuConvexPolyhedronVertexData* convexVertexDataA,
+			struct SpuConvexPolyhedronVertexData* convexVertexDataB
+			) const = 0;
+
+
+};
+
+
+
+#endif //SPU_CONVEX_PENETRATION_DEPTH_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp
new file mode 100644
index 0000000..e5e263c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp
@@ -0,0 +1,1412 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "SpuGatheringCollisionTask.h"
+
+//#define DEBUG_SPU_COLLISION_DETECTION 1
+#include "../SpuDoubleBuffer.h"
+
+#include "../SpuCollisionTaskProcess.h"
+#include "../SpuGatheringCollisionDispatcher.h" //for SPU_BATCHSIZE_BROADPHASE_PAIRS
+
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+#include "../SpuContactManifoldCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+#include "SpuContactResult.h"
+#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
+#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "BulletCollision/CollisionShapes/btConvexPointCloudShape.h"
+
+#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
+
+#include "BulletCollision/CollisionShapes/btConvexShape.h"
+#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
+#include "BulletCollision/CollisionShapes/btCompoundShape.h"
+
+#include "SpuMinkowskiPenetrationDepthSolver.h"
+//#include "SpuEpaPenetrationDepthSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
+
+
+#include "boxBoxDistance.h"
+#include "BulletMultiThreaded/vectormath2bullet.h"
+#include "SpuCollisionShapes.h" //definition of SpuConvexPolyhedronVertexData
+#include "BulletCollision/CollisionDispatch/btBoxBoxDetector.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h"
+#include "BulletCollision/CollisionShapes/btTriangleShape.h"
+
+#ifdef __SPU__
+///Software caching from the IBM Cell SDK, it reduces 25% SPU time for our test cases
+#ifndef USE_LIBSPE2
+//#define USE_SOFTWARE_CACHE 1
+#endif
+#endif //__SPU__
+
+int gSkippedCol = 0;
+int gProcessedCol = 0;
+
+////////////////////////////////////////////////
+/// software caching
+#if USE_SOFTWARE_CACHE
+#include <spu_intrinsics.h>
+#include <sys/spu_thread.h>
+#include <sys/spu_event.h>
+#include <stdint.h>
+#define SPE_CACHE_NWAY   		4
+//#define SPE_CACHE_NSETS 		32, 16
+#define SPE_CACHE_NSETS 		8
+//#define SPE_CACHELINE_SIZE 		512
+#define SPE_CACHELINE_SIZE 		128
+#define SPE_CACHE_SET_TAGID(set) 	15
+///make sure that spe_cache.h is below those defines!
+#include "../Extras/software_cache/cache/include/spe_cache.h"
+
+
+int g_CacheMisses=0;
+int g_CacheHits=0;
+
+#if 0 // Added to allow cache misses and hits to be tracked, change this to 1 to restore unmodified version
+#define spe_cache_read(ea)		_spe_cache_lookup_xfer_wait_(ea, 0, 1)
+#else
+#define spe_cache_read(ea)		\
+({								\
+    int set, idx, line, byte;					\
+    _spe_cache_nway_lookup_(ea, set, idx);			\
+								\
+    if (btUnlikely(idx < 0)) {					\
+        ++g_CacheMisses;                        \
+	    idx = _spe_cache_miss_(ea, set, -1);			\
+        spu_writech(22, SPE_CACHE_SET_TAGMASK(set));		\
+        spu_mfcstat(MFC_TAG_UPDATE_ALL);			\
+    } 								\
+    else                            \
+    {                               \
+        ++g_CacheHits;              \
+    }                               \
+    line = _spe_cacheline_num_(set, idx);			\
+    byte = _spe_cacheline_byte_offset_(ea);			\
+    (void *) &spe_cache_mem[line + byte];			\
+})
+
+#endif
+
+#endif // USE_SOFTWARE_CACHE
+
+bool gUseEpa = false;
+
+#ifdef USE_SN_TUNER
+#include <LibSN_SPU.h>
+#endif //USE_SN_TUNER
+
+#if defined (__SPU__) && !defined (USE_LIBSPE2)
+#include <spu_printf.h>
+#elif defined (USE_LIBSPE2)
+#define spu_printf(a)
+#else
+#define IGNORE_ALIGNMENT 1
+#include <stdio.h>
+#include <stdlib.h>
+#define spu_printf printf
+
+#endif
+
+//int gNumConvexPoints0=0;
+
+///Make sure no destructors are called on this memory
+struct	CollisionTask_LocalStoreMemory
+{
+	///This CollisionTask_LocalStoreMemory is mainly used for the SPU version, using explicit DMA
+	///Other platforms can use other memory programming models.
+
+	ATTRIBUTE_ALIGNED16(btBroadphasePair	gBroadphasePairsBuffer[SPU_BATCHSIZE_BROADPHASE_PAIRS]);
+	DoubleBuffer<unsigned char, MIDPHASE_WORKUNIT_PAGE_SIZE> g_workUnitTaskBuffers;
+	ATTRIBUTE_ALIGNED16(char gSpuContactManifoldAlgoBuffer [sizeof(SpuContactManifoldCollisionAlgorithm)+16]);
+	ATTRIBUTE_ALIGNED16(char gColObj0Buffer [sizeof(btCollisionObject)+16]);
+	ATTRIBUTE_ALIGNED16(char gColObj1Buffer [sizeof(btCollisionObject)+16]);
+	///we reserve 32bit integer indices, even though they might be 16bit
+	ATTRIBUTE_ALIGNED16(int	spuIndices[16]);
+	btPersistentManifold	gPersistentManifoldBuffer;
+	CollisionShape_LocalStoreMemory gCollisionShapes[2];
+	bvhMeshShape_LocalStoreMemory bvhShapeData;
+	SpuConvexPolyhedronVertexData convexVertexData[2];
+	CompoundShape_LocalStoreMemory compoundShapeData[2];
+		
+	///The following pointers might either point into this local store memory, or to the original/other memory locations.
+	///See SpuFakeDma for implementation of cellDmaSmallGetReadOnly.
+	btCollisionObject*	m_lsColObj0Ptr;
+	btCollisionObject*	m_lsColObj1Ptr;
+	btBroadphasePair* m_pairsPointer;
+	btPersistentManifold*	m_lsManifoldPtr;
+	SpuContactManifoldCollisionAlgorithm*	m_lsCollisionAlgorithmPtr;
+
+	bool	needsDmaPutContactManifoldAlgo;
+
+	btCollisionObject* getColObj0()
+	{
+		return m_lsColObj0Ptr;
+	}
+	btCollisionObject* getColObj1()
+	{
+		return m_lsColObj1Ptr;
+	}
+
+
+	btBroadphasePair* getBroadphasePairPtr()
+	{
+		return m_pairsPointer;
+	}
+
+	SpuContactManifoldCollisionAlgorithm*	getlocalCollisionAlgorithm()
+	{
+		return m_lsCollisionAlgorithmPtr;
+	}
+	
+	btPersistentManifold*	getContactManifoldPtr()
+	{
+		return m_lsManifoldPtr;
+	}
+};
+
+
+#if defined(__CELLOS_LV2__) || defined(USE_LIBSPE2) 
+
+ATTRIBUTE_ALIGNED16(CollisionTask_LocalStoreMemory	gLocalStoreMemory);
+
+void* createCollisionLocalStoreMemory()
+{
+	return &gLocalStoreMemory;
+}
+#else
+void* createCollisionLocalStoreMemory()
+{
+        return new CollisionTask_LocalStoreMemory;
+}
+
+#endif
+
+void	ProcessSpuConvexConvexCollision(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory* lsMemPtr, SpuContactResult& spuContacts);
+
+
+SIMD_FORCE_INLINE void small_cache_read(void* buffer, ppu_address_t ea, size_t size)
+{
+#if USE_SOFTWARE_CACHE
+	// Check for alignment requirements. We need to make sure the entire request fits within one cache line,
+	// so the first and last bytes should fall on the same cache line
+	btAssert((ea & ~SPE_CACHELINE_MASK) == ((ea + size - 1) & ~SPE_CACHELINE_MASK));
+
+	void* ls = spe_cache_read(ea);
+	memcpy(buffer, ls, size);
+#else
+	stallingUnalignedDmaSmallGet(buffer,ea,size);
+#endif
+}
+
+SIMD_FORCE_INLINE void small_cache_read_triple(	void* ls0, ppu_address_t ea0,
+												void* ls1, ppu_address_t ea1,
+												void* ls2, ppu_address_t ea2,
+												size_t size)
+{
+		btAssert(size<16);
+		ATTRIBUTE_ALIGNED16(char	tmpBuffer0[32]);
+		ATTRIBUTE_ALIGNED16(char	tmpBuffer1[32]);
+		ATTRIBUTE_ALIGNED16(char	tmpBuffer2[32]);
+
+		uint32_t i;
+		
+
+		///make sure last 4 bits are the same, for cellDmaSmallGet
+		char* localStore0 = (char*)ls0;
+		uint32_t last4BitsOffset = ea0 & 0x0f;
+		char* tmpTarget0 = tmpBuffer0 + last4BitsOffset;
+#ifdef __SPU__
+		cellDmaSmallGet(tmpTarget0,ea0,size,DMA_TAG(1),0,0);
+#else
+		tmpTarget0 = (char*)cellDmaSmallGetReadOnly(tmpTarget0,ea0,size,DMA_TAG(1),0,0);
+#endif
+
+
+		char* localStore1 = (char*)ls1;
+		last4BitsOffset = ea1 & 0x0f;
+		char* tmpTarget1 = tmpBuffer1 + last4BitsOffset;
+#ifdef __SPU__
+		cellDmaSmallGet(tmpTarget1,ea1,size,DMA_TAG(1),0,0);
+#else
+		tmpTarget1 = (char*)cellDmaSmallGetReadOnly(tmpTarget1,ea1,size,DMA_TAG(1),0,0);
+#endif
+		
+		char* localStore2 = (char*)ls2;
+		last4BitsOffset = ea2 & 0x0f;
+		char* tmpTarget2 = tmpBuffer2 + last4BitsOffset;
+#ifdef __SPU__
+		cellDmaSmallGet(tmpTarget2,ea2,size,DMA_TAG(1),0,0);
+#else
+		tmpTarget2 = (char*)cellDmaSmallGetReadOnly(tmpTarget2,ea2,size,DMA_TAG(1),0,0);
+#endif
+		
+		
+		cellDmaWaitTagStatusAll( DMA_MASK(1) );
+
+		//this is slowish, perhaps memcpy on SPU is smarter?
+		for (i=0; btLikely( i<size );i++)
+		{
+			localStore0[i] = tmpTarget0[i];
+			localStore1[i] = tmpTarget1[i];
+			localStore2[i] = tmpTarget2[i];
+		}
+
+		
+}
+
+
+
+
+class spuNodeCallback : public btNodeOverlapCallback
+{
+	SpuCollisionPairInput* m_wuInput;
+	SpuContactResult&		m_spuContacts;
+	CollisionTask_LocalStoreMemory*	m_lsMemPtr;
+	ATTRIBUTE_ALIGNED16(btTriangleShape)	m_tmpTriangleShape;
+
+	ATTRIBUTE_ALIGNED16(btVector3	spuTriangleVertices[3]);
+	ATTRIBUTE_ALIGNED16(btScalar	spuUnscaledVertex[4]);
+	
+
+
+public:
+	spuNodeCallback(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory*	lsMemPtr,SpuContactResult& spuContacts)
+		:	m_wuInput(wuInput),
+		m_spuContacts(spuContacts),
+		m_lsMemPtr(lsMemPtr)
+	{
+	}
+
+	virtual void processNode(int subPart, int triangleIndex)
+	{
+		///Create a triangle on the stack, call process collision, with GJK
+		///DMA the vertices, can benefit from software caching
+
+		//		spu_printf("processNode with triangleIndex %d\n",triangleIndex);
+
+		if (m_lsMemPtr->bvhShapeData.gIndexMesh.m_indexType == PHY_SHORT)
+		{
+			unsigned short int* indexBasePtr = (unsigned short int*)(m_lsMemPtr->bvhShapeData.gIndexMesh.m_triangleIndexBase+triangleIndex*m_lsMemPtr->bvhShapeData.gIndexMesh.m_triangleIndexStride);
+			ATTRIBUTE_ALIGNED16(unsigned short int tmpIndices[3]);
+
+			small_cache_read_triple(&tmpIndices[0],(ppu_address_t)&indexBasePtr[0],
+									&tmpIndices[1],(ppu_address_t)&indexBasePtr[1],
+									&tmpIndices[2],(ppu_address_t)&indexBasePtr[2],
+									sizeof(unsigned short int));
+
+			m_lsMemPtr->spuIndices[0] = int(tmpIndices[0]);
+			m_lsMemPtr->spuIndices[1] = int(tmpIndices[1]);
+			m_lsMemPtr->spuIndices[2] = int(tmpIndices[2]);
+		} else
+		{
+			unsigned int* indexBasePtr = (unsigned int*)(m_lsMemPtr->bvhShapeData.gIndexMesh.m_triangleIndexBase+triangleIndex*m_lsMemPtr->bvhShapeData.gIndexMesh.m_triangleIndexStride);
+
+			small_cache_read_triple(&m_lsMemPtr->spuIndices[0],(ppu_address_t)&indexBasePtr[0],
+								&m_lsMemPtr->spuIndices[1],(ppu_address_t)&indexBasePtr[1],
+								&m_lsMemPtr->spuIndices[2],(ppu_address_t)&indexBasePtr[2],
+								sizeof(int));
+		}
+		
+		//		spu_printf("SPU index0=%d ,",spuIndices[0]);
+		//		spu_printf("SPU index1=%d ,",spuIndices[1]);
+		//		spu_printf("SPU index2=%d ,",spuIndices[2]);
+		//		spu_printf("SPU: indexBasePtr=%llx\n",indexBasePtr);
+
+		const btVector3& meshScaling = m_lsMemPtr->bvhShapeData.gTriangleMeshInterfacePtr->getScaling();
+		for (int j=2;btLikely( j>=0 );j--)
+		{
+			int graphicsindex = m_lsMemPtr->spuIndices[j];
+
+			//			spu_printf("SPU index=%d ,",graphicsindex);
+			btScalar* graphicsbasePtr = (btScalar*)(m_lsMemPtr->bvhShapeData.gIndexMesh.m_vertexBase+graphicsindex*m_lsMemPtr->bvhShapeData.gIndexMesh.m_vertexStride);
+			//			spu_printf("SPU graphicsbasePtr=%llx\n",graphicsbasePtr);
+
+
+			///handle un-aligned vertices...
+
+			//another DMA for each vertex
+			small_cache_read_triple(&spuUnscaledVertex[0],(ppu_address_t)&graphicsbasePtr[0],
+									&spuUnscaledVertex[1],(ppu_address_t)&graphicsbasePtr[1],
+									&spuUnscaledVertex[2],(ppu_address_t)&graphicsbasePtr[2],
+									sizeof(btScalar));
+			
+			m_tmpTriangleShape.getVertexPtr(j).setValue(spuUnscaledVertex[0]*meshScaling.getX(),
+				spuUnscaledVertex[1]*meshScaling.getY(),
+				spuUnscaledVertex[2]*meshScaling.getZ());
+
+			//			spu_printf("SPU:triangle vertices:%f,%f,%f\n",spuTriangleVertices[j].x(),spuTriangleVertices[j].y(),spuTriangleVertices[j].z());
+		}
+
+
+		SpuCollisionPairInput triangleConcaveInput(*m_wuInput);
+//		triangleConcaveInput.m_spuCollisionShapes[1] = &spuTriangleVertices[0];
+		triangleConcaveInput.m_spuCollisionShapes[1] = &m_tmpTriangleShape;
+		triangleConcaveInput.m_shapeType1 = TRIANGLE_SHAPE_PROXYTYPE;
+
+		m_spuContacts.setShapeIdentifiersB(subPart,triangleIndex);
+
+		//		m_spuContacts.flush();
+
+		ProcessSpuConvexConvexCollision(&triangleConcaveInput, m_lsMemPtr,m_spuContacts);
+		///this flush should be automatic
+		//	m_spuContacts.flush();
+	}
+
+};
+
+
+
+void btConvexPlaneCollideSingleContact (SpuCollisionPairInput* wuInput,CollisionTask_LocalStoreMemory* lsMemPtr,SpuContactResult&  spuContacts)
+{
+	
+	btConvexShape* convexShape = (btConvexShape*) wuInput->m_spuCollisionShapes[0];
+	btStaticPlaneShape* planeShape = (btStaticPlaneShape*) wuInput->m_spuCollisionShapes[1];
+
+    bool hasCollision = false;
+	const btVector3& planeNormal = planeShape->getPlaneNormal();
+	const btScalar& planeConstant = planeShape->getPlaneConstant();
+	
+	
+	btTransform convexWorldTransform = wuInput->m_worldTransform0;
+	btTransform convexInPlaneTrans;
+	convexInPlaneTrans= wuInput->m_worldTransform1.inverse() * convexWorldTransform;
+	btTransform planeInConvex;
+	planeInConvex= convexWorldTransform.inverse() * wuInput->m_worldTransform1;
+	
+	//btVector3 vtx = convexShape->localGetSupportVertexWithoutMarginNonVirtual(planeInConvex.getBasis()*-planeNormal);
+	btVector3 vtx = convexShape->localGetSupportVertexNonVirtual(planeInConvex.getBasis()*-planeNormal);
+
+	btVector3 vtxInPlane = convexInPlaneTrans(vtx);
+	btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant);
+
+	btVector3 vtxInPlaneProjected = vtxInPlane - distance*planeNormal;
+	btVector3 vtxInPlaneWorld = wuInput->m_worldTransform1 * vtxInPlaneProjected;
+
+	hasCollision = distance < lsMemPtr->getContactManifoldPtr()->getContactBreakingThreshold();
+	//resultOut->setPersistentManifold(m_manifoldPtr);
+	if (hasCollision)
+	{
+		/// report a contact. internally this will be kept persistent, and contact reduction is done
+		btVector3 normalOnSurfaceB =wuInput->m_worldTransform1.getBasis() * planeNormal;
+		btVector3 pOnB = vtxInPlaneWorld;
+		spuContacts.addContactPoint(normalOnSurfaceB,pOnB,distance);
+	}
+}
+
+void	ProcessConvexPlaneSpuCollision(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory* lsMemPtr, SpuContactResult& spuContacts)
+{
+
+		register	int dmaSize = 0;
+		register ppu_address_t	dmaPpuAddress2;
+		btPersistentManifold* manifold = (btPersistentManifold*)wuInput->m_persistentManifoldPtr;
+
+		///DMA in the vertices for convex shapes
+		ATTRIBUTE_ALIGNED16(char convexHullShape0[sizeof(btConvexHullShape)]);
+		ATTRIBUTE_ALIGNED16(char convexHullShape1[sizeof(btConvexHullShape)]);
+
+		if ( btLikely( wuInput->m_shapeType0== CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			//	spu_printf("SPU: DMA btConvexHullShape\n");
+			
+			dmaSize = sizeof(btConvexHullShape);
+			dmaPpuAddress2 = wuInput->m_collisionShapes[0];
+
+			cellDmaGet(&convexHullShape0, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+			//cellDmaWaitTagStatusAll(DMA_MASK(1));
+		}
+
+		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			//	spu_printf("SPU: DMA btConvexHullShape\n");
+			dmaSize = sizeof(btConvexHullShape);
+			dmaPpuAddress2 = wuInput->m_collisionShapes[1];
+			cellDmaGet(&convexHullShape1, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+			//cellDmaWaitTagStatusAll(DMA_MASK(1));
+		}
+		
+		if ( btLikely( wuInput->m_shapeType0 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{		
+			cellDmaWaitTagStatusAll(DMA_MASK(1));
+			dmaConvexVertexData (&lsMemPtr->convexVertexData[0], (btConvexHullShape*)&convexHullShape0);
+			lsMemPtr->convexVertexData[0].gSpuConvexShapePtr = wuInput->m_spuCollisionShapes[0];
+		}
+
+			
+		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			cellDmaWaitTagStatusAll(DMA_MASK(1));
+			dmaConvexVertexData (&lsMemPtr->convexVertexData[1], (btConvexHullShape*)&convexHullShape1);
+			lsMemPtr->convexVertexData[1].gSpuConvexShapePtr = wuInput->m_spuCollisionShapes[1];
+		}
+
+		
+		btConvexPointCloudShape cpc0,cpc1;
+
+		if ( btLikely( wuInput->m_shapeType0 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			cellDmaWaitTagStatusAll(DMA_MASK(2));
+			lsMemPtr->convexVertexData[0].gConvexPoints = &lsMemPtr->convexVertexData[0].g_convexPointBuffer[0];
+			btConvexHullShape* ch = (btConvexHullShape*)wuInput->m_spuCollisionShapes[0];
+			const btVector3& localScaling = ch->getLocalScalingNV();
+			cpc0.setPoints(lsMemPtr->convexVertexData[0].gConvexPoints,lsMemPtr->convexVertexData[0].gNumConvexPoints,false,localScaling);
+			wuInput->m_spuCollisionShapes[0] = &cpc0;
+		}
+
+		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			cellDmaWaitTagStatusAll(DMA_MASK(2));		
+			lsMemPtr->convexVertexData[1].gConvexPoints = &lsMemPtr->convexVertexData[1].g_convexPointBuffer[0];
+			btConvexHullShape* ch = (btConvexHullShape*)wuInput->m_spuCollisionShapes[1];
+			const btVector3& localScaling = ch->getLocalScalingNV();
+			cpc1.setPoints(lsMemPtr->convexVertexData[1].gConvexPoints,lsMemPtr->convexVertexData[1].gNumConvexPoints,false,localScaling);
+			wuInput->m_spuCollisionShapes[1] = &cpc1;
+
+		}
+
+
+//		const btConvexShape* shape0Ptr = (const btConvexShape*)wuInput->m_spuCollisionShapes[0];
+//		const btConvexShape* shape1Ptr = (const btConvexShape*)wuInput->m_spuCollisionShapes[1];
+//		int shapeType0 = wuInput->m_shapeType0;
+//		int shapeType1 = wuInput->m_shapeType1;
+		float marginA = wuInput->m_collisionMargin0;
+		float marginB = wuInput->m_collisionMargin1;
+
+		SpuClosestPointInput	cpInput;
+		cpInput.m_convexVertexData[0] = &lsMemPtr->convexVertexData[0];
+		cpInput.m_convexVertexData[1] = &lsMemPtr->convexVertexData[1];
+		cpInput.m_transformA = wuInput->m_worldTransform0;
+		cpInput.m_transformB = wuInput->m_worldTransform1;
+		float sumMargin = (marginA+marginB+lsMemPtr->getContactManifoldPtr()->getContactBreakingThreshold());
+		cpInput.m_maximumDistanceSquared = sumMargin * sumMargin;
+
+		ppu_address_t manifoldAddress = (ppu_address_t)manifold;
+
+		btPersistentManifold* spuManifold=lsMemPtr->getContactManifoldPtr();
+		//spuContacts.setContactInfo(spuManifold,manifoldAddress,wuInput->m_worldTransform0,wuInput->m_worldTransform1,wuInput->m_isSwapped);
+		spuContacts.setContactInfo(spuManifold,manifoldAddress,lsMemPtr->getColObj0()->getWorldTransform(),
+			lsMemPtr->getColObj1()->getWorldTransform(),
+			lsMemPtr->getColObj0()->getRestitution(),lsMemPtr->getColObj1()->getRestitution(),
+			lsMemPtr->getColObj0()->getFriction(),lsMemPtr->getColObj1()->getFriction(),
+			wuInput->m_isSwapped);
+
+
+		btConvexPlaneCollideSingleContact(wuInput,lsMemPtr,spuContacts);
+
+
+		
+	
+}
+
+
+
+
+////////////////////////
+/// Convex versus Concave triangle mesh collision detection (handles concave triangle mesh versus sphere, box, cylinder, triangle, cone, convex polyhedron etc)
+///////////////////
+void	ProcessConvexConcaveSpuCollision(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory* lsMemPtr, SpuContactResult& spuContacts)
+{
+	//order: first collision shape is convex, second concave. m_isSwapped is true, if the original order was opposite
+	
+	btBvhTriangleMeshShape*	trimeshShape = (btBvhTriangleMeshShape*)wuInput->m_spuCollisionShapes[1];
+	//need the mesh interface, for access to triangle vertices
+	dmaBvhShapeData (&lsMemPtr->bvhShapeData, trimeshShape);
+
+	btVector3 aabbMin(-1,-400,-1);
+	btVector3 aabbMax(1,400,1);
+
+
+	//recalc aabbs
+	btTransform convexInTriangleSpace;
+	convexInTriangleSpace = wuInput->m_worldTransform1.inverse() * wuInput->m_worldTransform0;
+	btConvexInternalShape* convexShape = (btConvexInternalShape*)wuInput->m_spuCollisionShapes[0];
+
+	computeAabb (aabbMin, aabbMax, convexShape, wuInput->m_collisionShapes[0], wuInput->m_shapeType0, convexInTriangleSpace);
+
+
+	//CollisionShape* triangleShape = static_cast<btCollisionShape*>(triBody->m_collisionShape);
+	//convexShape->getAabb(convexInTriangleSpace,m_aabbMin,m_aabbMax);
+
+	//	btScalar extraMargin = collisionMarginTriangle;
+	//	btVector3 extra(extraMargin,extraMargin,extraMargin);
+	//	aabbMax += extra;
+	//	aabbMin -= extra;
+
+	///quantize query AABB
+	unsigned short int quantizedQueryAabbMin[3];
+	unsigned short int quantizedQueryAabbMax[3];
+	lsMemPtr->bvhShapeData.getOptimizedBvh()->quantizeWithClamp(quantizedQueryAabbMin,aabbMin,0);
+	lsMemPtr->bvhShapeData.getOptimizedBvh()->quantizeWithClamp(quantizedQueryAabbMax,aabbMax,1);
+
+	QuantizedNodeArray&	nodeArray = lsMemPtr->bvhShapeData.getOptimizedBvh()->getQuantizedNodeArray();
+	//spu_printf("SPU: numNodes = %d\n",nodeArray.size());
+
+	BvhSubtreeInfoArray& subTrees = lsMemPtr->bvhShapeData.getOptimizedBvh()->getSubtreeInfoArray();
+
+
+	spuNodeCallback	nodeCallback(wuInput,lsMemPtr,spuContacts);
+	IndexedMeshArray&	indexArray = lsMemPtr->bvhShapeData.gTriangleMeshInterfacePtr->getIndexedMeshArray();
+	//spu_printf("SPU:indexArray.size() = %d\n",indexArray.size());
+
+	//	spu_printf("SPU: numSubTrees = %d\n",subTrees.size());
+	//not likely to happen
+	if (subTrees.size() && indexArray.size() == 1)
+	{
+		///DMA in the index info
+		dmaBvhIndexedMesh (&lsMemPtr->bvhShapeData.gIndexMesh, indexArray, 0 /* index into indexArray */, 1 /* dmaTag */);
+		cellDmaWaitTagStatusAll(DMA_MASK(1));
+		
+		//display the headers
+		int numBatch = subTrees.size();
+		for (int i=0;i<numBatch;)
+		{
+			//@todo- can reorder DMA transfers for less stall
+			int remaining = subTrees.size() - i;
+			int nextBatch = remaining < MAX_SPU_SUBTREE_HEADERS ? remaining : MAX_SPU_SUBTREE_HEADERS;
+			
+			dmaBvhSubTreeHeaders (&lsMemPtr->bvhShapeData.gSubtreeHeaders[0], (ppu_address_t)(&subTrees[i]), nextBatch, 1);
+			cellDmaWaitTagStatusAll(DMA_MASK(1));
+			
+
+			//			spu_printf("nextBatch = %d\n",nextBatch);
+
+			for (int j=0;j<nextBatch;j++)
+			{
+				const btBvhSubtreeInfo& subtree = lsMemPtr->bvhShapeData.gSubtreeHeaders[j];
+
+				unsigned int overlap = spuTestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
+				if (overlap)
+				{
+					btAssert(subtree.m_subtreeSize);
+
+					//dma the actual nodes of this subtree
+					dmaBvhSubTreeNodes (&lsMemPtr->bvhShapeData.gSubtreeNodes[0], subtree, nodeArray, 2);
+					cellDmaWaitTagStatusAll(DMA_MASK(2));
+
+					/* Walk this subtree */
+					spuWalkStacklessQuantizedTree(&nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax,
+						&lsMemPtr->bvhShapeData.gSubtreeNodes[0],
+						0,
+						subtree.m_subtreeSize);
+				}
+				//				spu_printf("subtreeSize = %d\n",gSubtreeHeaders[j].m_subtreeSize);
+			}
+
+			//	unsigned short int	m_quantizedAabbMin[3];
+			//	unsigned short int	m_quantizedAabbMax[3];
+			//	int			m_rootNodeIndex;
+			//	int			m_subtreeSize;
+			i+=nextBatch;
+		}
+
+		//pre-fetch first tree, then loop and double buffer
+	}
+
+}
+
+
+int stats[11]={0,0,0,0,0,0,0,0,0,0,0};
+int degenerateStats[11]={0,0,0,0,0,0,0,0,0,0,0};
+
+
+////////////////////////
+/// Convex versus Convex collision detection (handles collision between sphere, box, cylinder, triangle, cone, convex polyhedron etc)
+///////////////////
+void	ProcessSpuConvexConvexCollision(SpuCollisionPairInput* wuInput, CollisionTask_LocalStoreMemory* lsMemPtr, SpuContactResult& spuContacts)
+{
+	register int dmaSize;
+	register ppu_address_t	dmaPpuAddress2;
+	
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+	//spu_printf("SPU: ProcessSpuConvexConvexCollision\n");
+#endif //DEBUG_SPU_COLLISION_DETECTION
+	//CollisionShape* shape0 = (CollisionShape*)wuInput->m_collisionShapes[0];
+	//CollisionShape* shape1 = (CollisionShape*)wuInput->m_collisionShapes[1];
+	btPersistentManifold* manifold = (btPersistentManifold*)wuInput->m_persistentManifoldPtr;
+
+	bool genericGjk = true;
+
+	if (genericGjk)
+	{
+		//try generic GJK
+
+		
+		
+		//SpuConvexPenetrationDepthSolver* penetrationSolver=0;
+		btVoronoiSimplexSolver simplexSolver;
+		btGjkEpaPenetrationDepthSolver	epaPenetrationSolver2;
+		
+		btConvexPenetrationDepthSolver* penetrationSolver = &epaPenetrationSolver2;
+		
+		//SpuMinkowskiPenetrationDepthSolver	minkowskiPenetrationSolver;
+#ifdef ENABLE_EPA
+		if (gUseEpa)
+		{
+			penetrationSolver = &epaPenetrationSolver2;
+		} else
+#endif
+		{
+			//penetrationSolver = &minkowskiPenetrationSolver;
+		}
+
+
+		///DMA in the vertices for convex shapes
+		ATTRIBUTE_ALIGNED16(char convexHullShape0[sizeof(btConvexHullShape)]);
+		ATTRIBUTE_ALIGNED16(char convexHullShape1[sizeof(btConvexHullShape)]);
+
+		if ( btLikely( wuInput->m_shapeType0== CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			//	spu_printf("SPU: DMA btConvexHullShape\n");
+			
+			dmaSize = sizeof(btConvexHullShape);
+			dmaPpuAddress2 = wuInput->m_collisionShapes[0];
+
+			cellDmaGet(&convexHullShape0, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+			//cellDmaWaitTagStatusAll(DMA_MASK(1));
+		}
+
+		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			//	spu_printf("SPU: DMA btConvexHullShape\n");
+			dmaSize = sizeof(btConvexHullShape);
+			dmaPpuAddress2 = wuInput->m_collisionShapes[1];
+			cellDmaGet(&convexHullShape1, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+			//cellDmaWaitTagStatusAll(DMA_MASK(1));
+		}
+		
+		if ( btLikely( wuInput->m_shapeType0 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{		
+			cellDmaWaitTagStatusAll(DMA_MASK(1));
+			dmaConvexVertexData (&lsMemPtr->convexVertexData[0], (btConvexHullShape*)&convexHullShape0);
+			lsMemPtr->convexVertexData[0].gSpuConvexShapePtr = wuInput->m_spuCollisionShapes[0];
+		}
+
+			
+		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			cellDmaWaitTagStatusAll(DMA_MASK(1));
+			dmaConvexVertexData (&lsMemPtr->convexVertexData[1], (btConvexHullShape*)&convexHullShape1);
+			lsMemPtr->convexVertexData[1].gSpuConvexShapePtr = wuInput->m_spuCollisionShapes[1];
+		}
+
+		
+		btConvexPointCloudShape cpc0,cpc1;
+
+		if ( btLikely( wuInput->m_shapeType0 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			cellDmaWaitTagStatusAll(DMA_MASK(2));
+			lsMemPtr->convexVertexData[0].gConvexPoints = &lsMemPtr->convexVertexData[0].g_convexPointBuffer[0];
+			btConvexHullShape* ch = (btConvexHullShape*)wuInput->m_spuCollisionShapes[0];
+			const btVector3& localScaling = ch->getLocalScalingNV();
+			cpc0.setPoints(lsMemPtr->convexVertexData[0].gConvexPoints,lsMemPtr->convexVertexData[0].gNumConvexPoints,false,localScaling);
+			wuInput->m_spuCollisionShapes[0] = &cpc0;
+		}
+
+		if ( btLikely( wuInput->m_shapeType1 == CONVEX_HULL_SHAPE_PROXYTYPE ) )
+		{
+			cellDmaWaitTagStatusAll(DMA_MASK(2));		
+			lsMemPtr->convexVertexData[1].gConvexPoints = &lsMemPtr->convexVertexData[1].g_convexPointBuffer[0];
+			btConvexHullShape* ch = (btConvexHullShape*)wuInput->m_spuCollisionShapes[1];
+			const btVector3& localScaling = ch->getLocalScalingNV();
+			cpc1.setPoints(lsMemPtr->convexVertexData[1].gConvexPoints,lsMemPtr->convexVertexData[1].gNumConvexPoints,false,localScaling);
+			wuInput->m_spuCollisionShapes[1] = &cpc1;
+
+		}
+
+
+		const btConvexShape* shape0Ptr = (const btConvexShape*)wuInput->m_spuCollisionShapes[0];
+		const btConvexShape* shape1Ptr = (const btConvexShape*)wuInput->m_spuCollisionShapes[1];
+		int shapeType0 = wuInput->m_shapeType0;
+		int shapeType1 = wuInput->m_shapeType1;
+		float marginA = wuInput->m_collisionMargin0;
+		float marginB = wuInput->m_collisionMargin1;
+
+		SpuClosestPointInput	cpInput;
+		cpInput.m_convexVertexData[0] = &lsMemPtr->convexVertexData[0];
+		cpInput.m_convexVertexData[1] = &lsMemPtr->convexVertexData[1];
+		cpInput.m_transformA = wuInput->m_worldTransform0;
+		cpInput.m_transformB = wuInput->m_worldTransform1;
+		float sumMargin = (marginA+marginB+lsMemPtr->getContactManifoldPtr()->getContactBreakingThreshold());
+		cpInput.m_maximumDistanceSquared = sumMargin * sumMargin;
+
+		ppu_address_t manifoldAddress = (ppu_address_t)manifold;
+
+		btPersistentManifold* spuManifold=lsMemPtr->getContactManifoldPtr();
+		//spuContacts.setContactInfo(spuManifold,manifoldAddress,wuInput->m_worldTransform0,wuInput->m_worldTransform1,wuInput->m_isSwapped);
+		spuContacts.setContactInfo(spuManifold,manifoldAddress,lsMemPtr->getColObj0()->getWorldTransform(),
+			lsMemPtr->getColObj1()->getWorldTransform(),
+			lsMemPtr->getColObj0()->getRestitution(),lsMemPtr->getColObj1()->getRestitution(),
+			lsMemPtr->getColObj0()->getFriction(),lsMemPtr->getColObj1()->getFriction(),
+			wuInput->m_isSwapped);
+
+		{
+			btGjkPairDetector gjk(shape0Ptr,shape1Ptr,shapeType0,shapeType1,marginA,marginB,&simplexSolver,penetrationSolver);//&vsSolver,penetrationSolver);
+			gjk.getClosestPoints(cpInput,spuContacts,0);//,debugDraw);
+			
+			stats[gjk.m_lastUsedMethod]++;
+			degenerateStats[gjk.m_degenerateSimplex]++;
+
+#ifdef USE_SEPDISTANCE_UTIL			
+			btScalar sepDist = gjk.getCachedSeparatingDistance()+spuManifold->getContactBreakingThreshold();
+			lsMemPtr->getlocalCollisionAlgorithm()->m_sepDistance.initSeparatingDistance(gjk.getCachedSeparatingAxis(),sepDist,wuInput->m_worldTransform0,wuInput->m_worldTransform1);
+			lsMemPtr->needsDmaPutContactManifoldAlgo = true;
+#endif //USE_SEPDISTANCE_UTIL
+
+		}
+
+	}
+
+
+}
+
+
+template<typename T> void DoSwap(T& a, T& b)
+{
+	char tmp[sizeof(T)];
+	memcpy(tmp, &a, sizeof(T));
+	memcpy(&a, &b, sizeof(T));
+	memcpy(&b, tmp, sizeof(T));
+}
+
+SIMD_FORCE_INLINE void	dmaAndSetupCollisionObjects(SpuCollisionPairInput& collisionPairInput, CollisionTask_LocalStoreMemory& lsMem)
+{
+	register int dmaSize;
+	register ppu_address_t	dmaPpuAddress2;
+		
+	dmaSize = sizeof(btCollisionObject);//btTransform);
+	dmaPpuAddress2 = /*collisionPairInput.m_isSwapped ? (ppu_address_t)lsMem.gProxyPtr1->m_clientObject :*/ (ppu_address_t)lsMem.getlocalCollisionAlgorithm()->getCollisionObject0();
+	lsMem.m_lsColObj0Ptr = (btCollisionObject*)cellDmaGetReadOnly(&lsMem.gColObj0Buffer, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);		
+
+	dmaSize = sizeof(btCollisionObject);//btTransform);
+	dmaPpuAddress2 = /*collisionPairInput.m_isSwapped ? (ppu_address_t)lsMem.gProxyPtr0->m_clientObject :*/ (ppu_address_t)lsMem.getlocalCollisionAlgorithm()->getCollisionObject1();
+	lsMem.m_lsColObj1Ptr = (btCollisionObject*)cellDmaGetReadOnly(&lsMem.gColObj1Buffer, dmaPpuAddress2  , dmaSize, DMA_TAG(2), 0, 0);		
+	
+	cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
+
+	btCollisionObject* ob0 = lsMem.getColObj0();
+	btCollisionObject* ob1 = lsMem.getColObj1();
+
+	collisionPairInput.m_worldTransform0 = ob0->getWorldTransform();
+	collisionPairInput.m_worldTransform1 = ob1->getWorldTransform();
+}
+
+
+
+void	handleCollisionPair(SpuCollisionPairInput& collisionPairInput, CollisionTask_LocalStoreMemory& lsMem,
+							SpuContactResult &spuContacts,
+							ppu_address_t collisionShape0Ptr, void* collisionShape0Loc,
+							ppu_address_t collisionShape1Ptr, void* collisionShape1Loc, bool dmaShapes = true)
+{
+	
+	if (btBroadphaseProxy::isConvex(collisionPairInput.m_shapeType0) 
+		&& btBroadphaseProxy::isConvex(collisionPairInput.m_shapeType1))
+	{
+		if (dmaShapes)
+		{
+			dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
+			dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
+			cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
+		}
+
+		btConvexInternalShape* spuConvexShape0 = (btConvexInternalShape*)collisionShape0Loc;
+		btConvexInternalShape* spuConvexShape1 = (btConvexInternalShape*)collisionShape1Loc;
+
+		btVector3 dim0 = spuConvexShape0->getImplicitShapeDimensions();
+		btVector3 dim1 = spuConvexShape1->getImplicitShapeDimensions();
+
+		collisionPairInput.m_primitiveDimensions0 = dim0;
+		collisionPairInput.m_primitiveDimensions1 = dim1;
+		collisionPairInput.m_collisionShapes[0] = collisionShape0Ptr;
+		collisionPairInput.m_collisionShapes[1] = collisionShape1Ptr;
+		collisionPairInput.m_spuCollisionShapes[0] = spuConvexShape0;
+		collisionPairInput.m_spuCollisionShapes[1] = spuConvexShape1;
+		ProcessSpuConvexConvexCollision(&collisionPairInput,&lsMem,spuContacts);
+	} 
+	else if (btBroadphaseProxy::isCompound(collisionPairInput.m_shapeType0) && 
+			btBroadphaseProxy::isCompound(collisionPairInput.m_shapeType1))
+	{
+		//snPause();
+
+		dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
+		dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
+		cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
+
+		// Both are compounds, do N^2 CD for now
+		///@todo: add some AABB-based pruning (probably not -> slower)
+	
+		btCompoundShape* spuCompoundShape0 = (btCompoundShape*)collisionShape0Loc;
+		btCompoundShape* spuCompoundShape1 = (btCompoundShape*)collisionShape1Loc;
+
+		dmaCompoundShapeInfo (&lsMem.compoundShapeData[0], spuCompoundShape0, 1);
+		dmaCompoundShapeInfo (&lsMem.compoundShapeData[1], spuCompoundShape1, 2);
+		cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
+		
+
+		dmaCompoundSubShapes (&lsMem.compoundShapeData[0], spuCompoundShape0, 1);
+		cellDmaWaitTagStatusAll(DMA_MASK(1));
+		dmaCompoundSubShapes (&lsMem.compoundShapeData[1], spuCompoundShape1, 1);
+		cellDmaWaitTagStatusAll(DMA_MASK(1));
+
+		int childShapeCount0 = spuCompoundShape0->getNumChildShapes();
+		btAssert(childShapeCount0< MAX_SPU_COMPOUND_SUBSHAPES);
+		int childShapeCount1 = spuCompoundShape1->getNumChildShapes();
+		btAssert(childShapeCount1< MAX_SPU_COMPOUND_SUBSHAPES);
+
+		// Start the N^2
+		for (int i = 0; i < childShapeCount0; ++i)
+		{
+			btCompoundShapeChild& childShape0 = lsMem.compoundShapeData[0].gSubshapes[i];
+			btAssert(!btBroadphaseProxy::isCompound(childShape0.m_childShapeType));
+
+			for (int j = 0; j < childShapeCount1; ++j)
+			{
+				btCompoundShapeChild& childShape1 = lsMem.compoundShapeData[1].gSubshapes[j];
+				btAssert(!btBroadphaseProxy::isCompound(childShape1.m_childShapeType));
+
+
+				/* Create a new collision pair input struct using the two child shapes */
+				SpuCollisionPairInput cinput (collisionPairInput);
+
+				cinput.m_worldTransform0 = collisionPairInput.m_worldTransform0 * childShape0.m_transform;
+				cinput.m_shapeType0 = childShape0.m_childShapeType;
+				cinput.m_collisionMargin0 = childShape0.m_childMargin;
+
+				cinput.m_worldTransform1 = collisionPairInput.m_worldTransform1 * childShape1.m_transform;
+				cinput.m_shapeType1 = childShape1.m_childShapeType;
+				cinput.m_collisionMargin1 = childShape1.m_childMargin;
+				/* Recursively call handleCollisionPair () with new collision pair input */
+				
+				handleCollisionPair(cinput, lsMem, spuContacts,			
+					(ppu_address_t)childShape0.m_childShape, lsMem.compoundShapeData[0].gSubshapeShape[i], 
+					(ppu_address_t)childShape1.m_childShape, lsMem.compoundShapeData[1].gSubshapeShape[j], false);
+			}
+		}
+	}
+	else if (btBroadphaseProxy::isCompound(collisionPairInput.m_shapeType0) )
+	{
+		//snPause();
+		
+		dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
+		dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
+		cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
+
+		// object 0 compound, object 1 non-compound
+		btCompoundShape* spuCompoundShape = (btCompoundShape*)collisionShape0Loc;
+		dmaCompoundShapeInfo (&lsMem.compoundShapeData[0], spuCompoundShape, 1);
+		cellDmaWaitTagStatusAll(DMA_MASK(1));
+
+		int childShapeCount = spuCompoundShape->getNumChildShapes();
+		btAssert(childShapeCount< MAX_SPU_COMPOUND_SUBSHAPES);
+
+		for (int i = 0; i < childShapeCount; ++i)
+		{
+			btCompoundShapeChild& childShape = lsMem.compoundShapeData[0].gSubshapes[i];
+			btAssert(!btBroadphaseProxy::isCompound(childShape.m_childShapeType));
+			// Dma the child shape
+			dmaCollisionShape (&lsMem.compoundShapeData[0].gSubshapeShape[i], (ppu_address_t)childShape.m_childShape, 1, childShape.m_childShapeType);
+			cellDmaWaitTagStatusAll(DMA_MASK(1));
+			
+			SpuCollisionPairInput cinput (collisionPairInput);
+			cinput.m_worldTransform0 = collisionPairInput.m_worldTransform0 * childShape.m_transform;
+			cinput.m_shapeType0 = childShape.m_childShapeType;
+			cinput.m_collisionMargin0 = childShape.m_childMargin;
+
+			handleCollisionPair(cinput, lsMem, spuContacts,			
+				(ppu_address_t)childShape.m_childShape, lsMem.compoundShapeData[0].gSubshapeShape[i], 
+				collisionShape1Ptr, collisionShape1Loc, false);
+		}
+	}
+	else if (btBroadphaseProxy::isCompound(collisionPairInput.m_shapeType1) )
+	{
+		//snPause();
+		
+		dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
+		dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
+		cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
+		// object 0 non-compound, object 1 compound
+		btCompoundShape* spuCompoundShape = (btCompoundShape*)collisionShape1Loc;
+		dmaCompoundShapeInfo (&lsMem.compoundShapeData[0], spuCompoundShape, 1);
+		cellDmaWaitTagStatusAll(DMA_MASK(1));
+		
+		int childShapeCount = spuCompoundShape->getNumChildShapes();
+		btAssert(childShapeCount< MAX_SPU_COMPOUND_SUBSHAPES);
+
+
+		for (int i = 0; i < childShapeCount; ++i)
+		{
+			btCompoundShapeChild& childShape = lsMem.compoundShapeData[0].gSubshapes[i];
+			btAssert(!btBroadphaseProxy::isCompound(childShape.m_childShapeType));
+			// Dma the child shape
+			dmaCollisionShape (&lsMem.compoundShapeData[0].gSubshapeShape[i], (ppu_address_t)childShape.m_childShape, 1, childShape.m_childShapeType);
+			cellDmaWaitTagStatusAll(DMA_MASK(1));
+
+			SpuCollisionPairInput cinput (collisionPairInput);
+			cinput.m_worldTransform1 = collisionPairInput.m_worldTransform1 * childShape.m_transform;
+			cinput.m_shapeType1 = childShape.m_childShapeType;
+			cinput.m_collisionMargin1 = childShape.m_childMargin;
+			handleCollisionPair(cinput, lsMem, spuContacts,
+				collisionShape0Ptr, collisionShape0Loc, 
+				(ppu_address_t)childShape.m_childShape, lsMem.compoundShapeData[0].gSubshapeShape[i], false);
+		}
+		
+	}
+	else
+	{
+		//a non-convex shape is involved									
+		bool handleConvexConcave = false;
+
+		//snPause();
+
+		if (btBroadphaseProxy::isConcave(collisionPairInput.m_shapeType0) &&
+			btBroadphaseProxy::isConvex(collisionPairInput.m_shapeType1))
+		{
+			// Swap stuff
+			DoSwap(collisionShape0Ptr, collisionShape1Ptr);
+			DoSwap(collisionShape0Loc, collisionShape1Loc);
+			DoSwap(collisionPairInput.m_shapeType0, collisionPairInput.m_shapeType1);
+			DoSwap(collisionPairInput.m_worldTransform0, collisionPairInput.m_worldTransform1);
+			DoSwap(collisionPairInput.m_collisionMargin0, collisionPairInput.m_collisionMargin1);
+			
+			collisionPairInput.m_isSwapped = true;
+		}
+		
+		if (btBroadphaseProxy::isConvex(collisionPairInput.m_shapeType0)&&
+			btBroadphaseProxy::isConcave(collisionPairInput.m_shapeType1))
+		{
+			handleConvexConcave = true;
+		}
+		if (handleConvexConcave)
+		{
+			if (dmaShapes)
+			{
+				dmaCollisionShape (collisionShape0Loc, collisionShape0Ptr, 1, collisionPairInput.m_shapeType0);
+				dmaCollisionShape (collisionShape1Loc, collisionShape1Ptr, 2, collisionPairInput.m_shapeType1);
+				cellDmaWaitTagStatusAll(DMA_MASK(1) | DMA_MASK(2));
+			}
+			
+			if (collisionPairInput.m_shapeType1 == STATIC_PLANE_PROXYTYPE)
+			{
+				btConvexInternalShape* spuConvexShape0 = (btConvexInternalShape*)collisionShape0Loc;
+				btStaticPlaneShape* planeShape= (btStaticPlaneShape*)collisionShape1Loc;
+
+				btVector3 dim0 = spuConvexShape0->getImplicitShapeDimensions();
+				collisionPairInput.m_primitiveDimensions0 = dim0;
+				collisionPairInput.m_collisionShapes[0] = collisionShape0Ptr;
+				collisionPairInput.m_collisionShapes[1] = collisionShape1Ptr;
+				collisionPairInput.m_spuCollisionShapes[0] = spuConvexShape0;
+				collisionPairInput.m_spuCollisionShapes[1] = planeShape;
+
+				ProcessConvexPlaneSpuCollision(&collisionPairInput,&lsMem,spuContacts);
+			} else
+			{
+				btConvexInternalShape* spuConvexShape0 = (btConvexInternalShape*)collisionShape0Loc;
+				btBvhTriangleMeshShape* trimeshShape = (btBvhTriangleMeshShape*)collisionShape1Loc;
+
+				btVector3 dim0 = spuConvexShape0->getImplicitShapeDimensions();
+				collisionPairInput.m_primitiveDimensions0 = dim0;
+				collisionPairInput.m_collisionShapes[0] = collisionShape0Ptr;
+				collisionPairInput.m_collisionShapes[1] = collisionShape1Ptr;
+				collisionPairInput.m_spuCollisionShapes[0] = spuConvexShape0;
+				collisionPairInput.m_spuCollisionShapes[1] = trimeshShape;
+
+				ProcessConvexConcaveSpuCollision(&collisionPairInput,&lsMem,spuContacts);
+			}
+		}
+
+	}
+	
+	spuContacts.flush();
+
+}
+
+
+void	processCollisionTask(void* userPtr, void* lsMemPtr)
+{
+
+	SpuGatherAndProcessPairsTaskDesc* taskDescPtr = (SpuGatherAndProcessPairsTaskDesc*)userPtr;
+	SpuGatherAndProcessPairsTaskDesc& taskDesc = *taskDescPtr;
+	CollisionTask_LocalStoreMemory*	colMemPtr = (CollisionTask_LocalStoreMemory*)lsMemPtr;
+	CollisionTask_LocalStoreMemory& lsMem = *(colMemPtr);
+
+	gUseEpa = taskDesc.m_useEpa;
+
+	//	spu_printf("taskDescPtr=%llx\n",taskDescPtr);
+
+	SpuContactResult spuContacts;
+
+	////////////////////
+
+	ppu_address_t dmaInPtr = taskDesc.m_inPairPtr;
+	unsigned int numPages = taskDesc.numPages;
+	unsigned int numOnLastPage = taskDesc.numOnLastPage;
+
+	// prefetch first set of inputs and wait
+	lsMem.g_workUnitTaskBuffers.init();
+
+	unsigned int nextNumOnPage = (numPages > 1)? MIDPHASE_NUM_WORKUNITS_PER_PAGE : numOnLastPage;
+	lsMem.g_workUnitTaskBuffers.backBufferDmaGet(dmaInPtr, nextNumOnPage*sizeof(SpuGatherAndProcessWorkUnitInput), DMA_TAG(3));
+	dmaInPtr += MIDPHASE_WORKUNIT_PAGE_SIZE;
+
+	
+	register unsigned char *inputPtr;
+	register unsigned int numOnPage;
+	register unsigned int j;
+	SpuGatherAndProcessWorkUnitInput* wuInputs;	
+	register int dmaSize;
+	register ppu_address_t	dmaPpuAddress;
+	register ppu_address_t	dmaPpuAddress2;
+
+	int numPairs;
+	register int p;
+	SpuCollisionPairInput collisionPairInput;
+	
+	for (unsigned int i = 0; btLikely(i < numPages); i++)
+	{
+
+		// wait for back buffer dma and swap buffers
+		inputPtr = lsMem.g_workUnitTaskBuffers.swapBuffers();
+
+		// number on current page is number prefetched last iteration
+		numOnPage = nextNumOnPage;
+
+
+		// prefetch next set of inputs
+#if MIDPHASE_NUM_WORKUNIT_PAGES > 2
+		if ( btLikely( i < numPages-1 ) )
+#else
+		if ( btUnlikely( i < numPages-1 ) )
+#endif
+		{
+			nextNumOnPage = (i == numPages-2)? numOnLastPage : MIDPHASE_NUM_WORKUNITS_PER_PAGE;
+			lsMem.g_workUnitTaskBuffers.backBufferDmaGet(dmaInPtr, nextNumOnPage*sizeof(SpuGatherAndProcessWorkUnitInput), DMA_TAG(3));
+			dmaInPtr += MIDPHASE_WORKUNIT_PAGE_SIZE;
+		}
+
+		wuInputs = reinterpret_cast<SpuGatherAndProcessWorkUnitInput *>(inputPtr);
+		
+		
+		for (j = 0; btLikely( j < numOnPage ); j++)
+		{
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+		//	printMidphaseInput(&wuInputs[j]);
+#endif //DEBUG_SPU_COLLISION_DETECTION
+
+
+			numPairs = wuInputs[j].m_endIndex - wuInputs[j].m_startIndex;
+			
+			if ( btLikely( numPairs ) )
+			{
+					dmaSize = numPairs*sizeof(btBroadphasePair);
+					dmaPpuAddress = wuInputs[j].m_pairArrayPtr+wuInputs[j].m_startIndex * sizeof(btBroadphasePair);
+					lsMem.m_pairsPointer = (btBroadphasePair*)cellDmaGetReadOnly(&lsMem.gBroadphasePairsBuffer, dmaPpuAddress  , dmaSize, DMA_TAG(1), 0, 0);
+					cellDmaWaitTagStatusAll(DMA_MASK(1));
+				
+
+				for (p=0;p<numPairs;p++)
+				{
+
+					//for each broadphase pair, do something
+
+					btBroadphasePair& pair = lsMem.getBroadphasePairPtr()[p];
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+					spu_printf("pair->m_userInfo = %d\n",pair.m_userInfo);
+					spu_printf("pair->m_algorithm = %d\n",pair.m_algorithm);
+					spu_printf("pair->m_pProxy0 = %d\n",pair.m_pProxy0);
+					spu_printf("pair->m_pProxy1 = %d\n",pair.m_pProxy1);
+#endif //DEBUG_SPU_COLLISION_DETECTION
+
+					if (pair.m_internalTmpValue == 2 && pair.m_algorithm && pair.m_pProxy0 && pair.m_pProxy1)
+					{
+						dmaSize = sizeof(SpuContactManifoldCollisionAlgorithm);
+						dmaPpuAddress2 = (ppu_address_t)pair.m_algorithm;
+						lsMem.m_lsCollisionAlgorithmPtr = (SpuContactManifoldCollisionAlgorithm*)cellDmaGetReadOnly(&lsMem.gSpuContactManifoldAlgoBuffer, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+
+						cellDmaWaitTagStatusAll(DMA_MASK(1));
+
+						lsMem.needsDmaPutContactManifoldAlgo = false;
+
+						collisionPairInput.m_persistentManifoldPtr = (ppu_address_t) lsMem.getlocalCollisionAlgorithm()->getContactManifoldPtr();
+						collisionPairInput.m_isSwapped = false;
+
+						if (1)
+						{
+
+							///can wait on the combined DMA_MASK, or dma on the same tag
+
+
+#ifdef DEBUG_SPU_COLLISION_DETECTION
+					//		spu_printf("SPU collisionPairInput->m_shapeType0 = %d\n",collisionPairInput->m_shapeType0);
+					//		spu_printf("SPU collisionPairInput->m_shapeType1 = %d\n",collisionPairInput->m_shapeType1);
+#endif //DEBUG_SPU_COLLISION_DETECTION
+
+							
+							dmaSize = sizeof(btPersistentManifold);
+
+							dmaPpuAddress2 = collisionPairInput.m_persistentManifoldPtr;
+							lsMem.m_lsManifoldPtr = (btPersistentManifold*)cellDmaGetReadOnly(&lsMem.gPersistentManifoldBuffer, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+
+							collisionPairInput.m_shapeType0 = lsMem.getlocalCollisionAlgorithm()->getShapeType0();
+							collisionPairInput.m_shapeType1 = lsMem.getlocalCollisionAlgorithm()->getShapeType1();
+							collisionPairInput.m_collisionMargin0 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin0();
+							collisionPairInput.m_collisionMargin1 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin1();
+							
+							
+							
+							//??cellDmaWaitTagStatusAll(DMA_MASK(1));
+							
+
+							if (1)
+							{
+								//snPause();
+
+								// Get the collision objects
+								dmaAndSetupCollisionObjects(collisionPairInput, lsMem);
+
+								if (lsMem.getColObj0()->isActive() || lsMem.getColObj1()->isActive())
+								{
+
+									lsMem.needsDmaPutContactManifoldAlgo = true;
+#ifdef USE_SEPDISTANCE_UTIL
+									lsMem.getlocalCollisionAlgorithm()->m_sepDistance.updateSeparatingDistance(collisionPairInput.m_worldTransform0,collisionPairInput.m_worldTransform1);
+#endif //USE_SEPDISTANCE_UTIL
+							
+#define USE_DEDICATED_BOX_BOX 1
+#ifdef USE_DEDICATED_BOX_BOX
+									bool boxbox = ((lsMem.getlocalCollisionAlgorithm()->getShapeType0()==BOX_SHAPE_PROXYTYPE)&&
+										(lsMem.getlocalCollisionAlgorithm()->getShapeType1()==BOX_SHAPE_PROXYTYPE));
+									if (boxbox)
+									{
+										//spu_printf("boxbox dist = %f\n",distance);
+										btPersistentManifold* spuManifold=lsMem.getContactManifoldPtr();
+										btPersistentManifold* manifold = (btPersistentManifold*)collisionPairInput.m_persistentManifoldPtr;
+										ppu_address_t manifoldAddress = (ppu_address_t)manifold;
+
+										spuContacts.setContactInfo(spuManifold,manifoldAddress,lsMem.getColObj0()->getWorldTransform(),
+											lsMem.getColObj1()->getWorldTransform(),
+											lsMem.getColObj0()->getRestitution(),lsMem.getColObj1()->getRestitution(),
+											lsMem.getColObj0()->getFriction(),lsMem.getColObj1()->getFriction(),
+											collisionPairInput.m_isSwapped);
+
+						
+									//float distance=0.f;
+									btVector3 normalInB;
+
+
+									if (//!gUseEpa &&
+#ifdef USE_SEPDISTANCE_UTIL
+										lsMem.getlocalCollisionAlgorithm()->m_sepDistance.getConservativeSeparatingDistance()<=0.f
+#else
+										1
+#endif											
+										)
+										{
+//#define USE_PE_BOX_BOX 1
+#ifdef USE_PE_BOX_BOX
+											{
+
+												//getCollisionMargin0
+												btScalar margin0 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin0();
+												btScalar margin1 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin1();
+												btVector3 shapeDim0 = lsMem.getlocalCollisionAlgorithm()->getShapeDimensions0()+btVector3(margin0,margin0,margin0);
+												btVector3 shapeDim1 = lsMem.getlocalCollisionAlgorithm()->getShapeDimensions1()+btVector3(margin1,margin1,margin1);
+/*
+												//Box boxA(shapeDim0.getX(),shapeDim0.getY(),shapeDim0.getZ());
+												vmVector3 vmPos0 = getVmVector3(collisionPairInput.m_worldTransform0.getOrigin());
+												vmVector3 vmPos1 = getVmVector3(collisionPairInput.m_worldTransform1.getOrigin());
+												vmMatrix3 vmMatrix0 = getVmMatrix3(collisionPairInput.m_worldTransform0.getBasis());
+												vmMatrix3 vmMatrix1 = getVmMatrix3(collisionPairInput.m_worldTransform1.getBasis());
+
+												vmTransform3 transformA(vmMatrix0,vmPos0);
+												Box boxB(shapeDim1.getX(),shapeDim1.getY(),shapeDim1.getZ());
+												vmTransform3 transformB(vmMatrix1,vmPos1);
+												BoxPoint resultClosestBoxPointA;
+												BoxPoint resultClosestBoxPointB;
+												vmVector3 resultNormal;
+												*/
+
+#ifdef USE_SEPDISTANCE_UTIL
+												float distanceThreshold = FLT_MAX
+#else
+												//float distanceThreshold = 0.f;
+#endif
+
+
+												vmVector3 n;
+												Box boxA;
+												vmVector3 hA(shapeDim0.getX(),shapeDim0.getY(),shapeDim0.getZ());
+												vmVector3 hB(shapeDim1.getX(),shapeDim1.getY(),shapeDim1.getZ());
+												boxA.mHalf= hA;
+												vmTransform3 trA;
+												trA.setTranslation(getVmVector3(collisionPairInput.m_worldTransform0.getOrigin()));
+												trA.setUpper3x3(getVmMatrix3(collisionPairInput.m_worldTransform0.getBasis()));
+												Box boxB;
+												boxB.mHalf = hB;
+												vmTransform3 trB;
+												trB.setTranslation(getVmVector3(collisionPairInput.m_worldTransform1.getOrigin()));
+												trB.setUpper3x3(getVmMatrix3(collisionPairInput.m_worldTransform1.getBasis()));
+												
+												float distanceThreshold = spuManifold->getContactBreakingThreshold();//0.001f;
+
+
+												BoxPoint ptA,ptB;
+												float dist = boxBoxDistance(n, ptA, ptB,
+														   boxA, trA, boxB,	   trB,
+															distanceThreshold );
+
+
+//												float distance = boxBoxDistance(resultNormal,resultClosestBoxPointA,resultClosestBoxPointB,  boxA, transformA, boxB,transformB,distanceThreshold);
+												
+												normalInB = -getBtVector3(n);//resultNormal);
+
+												//if(dist < distanceThreshold)//spuManifold->getContactBreakingThreshold())
+												if(dist < spuManifold->getContactBreakingThreshold())
+												{
+													btVector3 pointOnB = collisionPairInput.m_worldTransform1(getBtVector3(ptB.localPoint));
+
+													spuContacts.addContactPoint(
+														normalInB,
+														pointOnB,
+														dist);
+												}
+											} 
+#else									
+											{
+
+												btScalar margin0 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin0();
+												btScalar margin1 = lsMem.getlocalCollisionAlgorithm()->getCollisionMargin1();
+												btVector3 shapeDim0 = lsMem.getlocalCollisionAlgorithm()->getShapeDimensions0()+btVector3(margin0,margin0,margin0);
+												btVector3 shapeDim1 = lsMem.getlocalCollisionAlgorithm()->getShapeDimensions1()+btVector3(margin1,margin1,margin1);
+
+
+												btBoxShape box0(shapeDim0);
+												btBoxShape box1(shapeDim1);
+
+												struct SpuBridgeContactCollector : public btDiscreteCollisionDetectorInterface::Result
+												{
+													SpuContactResult&	m_spuContacts;
+
+													virtual void setShapeIdentifiersA(int partId0,int index0)
+													{
+														m_spuContacts.setShapeIdentifiersA(partId0,index0);
+													}
+													virtual void setShapeIdentifiersB(int partId1,int index1)
+													{
+														m_spuContacts.setShapeIdentifiersB(partId1,index1);
+													}
+													virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
+													{
+														m_spuContacts.addContactPoint(normalOnBInWorld,pointInWorld,depth);
+													}
+
+													SpuBridgeContactCollector(SpuContactResult& spuContacts)
+														:m_spuContacts(spuContacts)
+													{
+
+													}
+												};
+												
+												SpuBridgeContactCollector  bridgeOutput(spuContacts);
+
+												btDiscreteCollisionDetectorInterface::ClosestPointInput input;
+												input.m_maximumDistanceSquared = BT_LARGE_FLOAT;
+												input.m_transformA = collisionPairInput.m_worldTransform0;
+												input.m_transformB = collisionPairInput.m_worldTransform1;
+
+												btBoxBoxDetector detector(&box0,&box1);
+												
+												detector.getClosestPoints(input,bridgeOutput,0);
+
+											}
+#endif //USE_PE_BOX_BOX
+											
+											lsMem.needsDmaPutContactManifoldAlgo = true;
+#ifdef USE_SEPDISTANCE_UTIL
+											btScalar sepDist2 = distance+spuManifold->getContactBreakingThreshold();
+											lsMem.getlocalCollisionAlgorithm()->m_sepDistance.initSeparatingDistance(normalInB,sepDist2,collisionPairInput.m_worldTransform0,collisionPairInput.m_worldTransform1);
+#endif //USE_SEPDISTANCE_UTIL
+											gProcessedCol++;
+										} else
+										{
+											gSkippedCol++;
+										}
+
+										spuContacts.flush();
+											
+
+									} else
+#endif //USE_DEDICATED_BOX_BOX
+									{
+										if (
+#ifdef USE_SEPDISTANCE_UTIL
+											lsMem.getlocalCollisionAlgorithm()->m_sepDistance.getConservativeSeparatingDistance()<=0.f
+#else
+											1
+#endif //USE_SEPDISTANCE_UTIL
+											)
+										{
+											handleCollisionPair(collisionPairInput, lsMem, spuContacts,
+												(ppu_address_t)lsMem.getColObj0()->getRootCollisionShape(), &lsMem.gCollisionShapes[0].collisionShape,
+												(ppu_address_t)lsMem.getColObj1()->getRootCollisionShape(), &lsMem.gCollisionShapes[1].collisionShape);
+										} else
+										{
+												//spu_printf("boxbox dist = %f\n",distance);
+											btPersistentManifold* spuManifold=lsMem.getContactManifoldPtr();
+											btPersistentManifold* manifold = (btPersistentManifold*)collisionPairInput.m_persistentManifoldPtr;
+											ppu_address_t manifoldAddress = (ppu_address_t)manifold;
+
+											spuContacts.setContactInfo(spuManifold,manifoldAddress,lsMem.getColObj0()->getWorldTransform(),
+												lsMem.getColObj1()->getWorldTransform(),
+												lsMem.getColObj0()->getRestitution(),lsMem.getColObj1()->getRestitution(),
+												lsMem.getColObj0()->getFriction(),lsMem.getColObj1()->getFriction(),
+												collisionPairInput.m_isSwapped);
+
+											spuContacts.flush();
+										}
+									}
+								
+								}
+
+							}
+						}
+
+#ifdef USE_SEPDISTANCE_UTIL
+#if defined (__SPU__) || defined (USE_LIBSPE2)
+						if (lsMem.needsDmaPutContactManifoldAlgo)
+						{
+							dmaSize = sizeof(SpuContactManifoldCollisionAlgorithm);
+							dmaPpuAddress2 = (ppu_address_t)pair.m_algorithm;
+							cellDmaLargePut(&lsMem.gSpuContactManifoldAlgoBuffer, dmaPpuAddress2  , dmaSize, DMA_TAG(1), 0, 0);
+							cellDmaWaitTagStatusAll(DMA_MASK(1));
+						}
+#endif
+#endif //#ifdef USE_SEPDISTANCE_UTIL
+
+					}
+				}
+			}
+		} //end for (j = 0; j < numOnPage; j++)
+
+	}//	for 
+
+
+
+	return;
+}
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h
new file mode 100644
index 0000000..bbaa555
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h
@@ -0,0 +1,140 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef SPU_GATHERING_COLLISION_TASK_H
+#define SPU_GATHERING_COLLISION_TASK_H
+
+#include "../PlatformDefinitions.h"
+//#define DEBUG_SPU_COLLISION_DETECTION 1
+
+
+///Task Description for SPU collision detection
+struct SpuGatherAndProcessPairsTaskDesc 
+{
+	ppu_address_t	m_inPairPtr;//m_pairArrayPtr;
+	//mutex variable
+	uint32_t	m_someMutexVariableInMainMemory;
+
+	ppu_address_t	m_dispatcher;
+
+	uint32_t	numOnLastPage;
+
+	uint16_t numPages;
+	uint16_t taskId;
+	bool m_useEpa;
+
+	struct	CollisionTask_LocalStoreMemory*	m_lsMemory; 
+}
+
+#if  defined(__CELLOS_LV2__) || defined(USE_LIBSPE2)
+__attribute__ ((aligned (128)))
+#endif
+;
+
+
+void	processCollisionTask(void* userPtr, void* lsMemory);
+
+void*	createCollisionLocalStoreMemory();
+
+
+#if defined(USE_LIBSPE2) && defined(__SPU__)
+#include "../SpuLibspe2Support.h"
+#include <spu_intrinsics.h>
+#include <spu_mfcio.h>
+#include <SpuFakeDma.h>
+
+//#define DEBUG_LIBSPE2_SPU_TASK
+
+
+
+int main(unsigned long long speid, addr64 argp, addr64 envp)
+{
+	printf("SPU: hello \n");
+	
+	ATTRIBUTE_ALIGNED128(btSpuStatus status);
+	ATTRIBUTE_ALIGNED16( SpuGatherAndProcessPairsTaskDesc taskDesc ) ;
+	unsigned int received_message = Spu_Mailbox_Event_Nothing;
+    bool shutdown = false;
+
+	cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
+	cellDmaWaitTagStatusAll(DMA_MASK(3));
+
+	status.m_status = Spu_Status_Free;
+	status.m_lsMemory.p = createCollisionLocalStoreMemory();
+
+	cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
+	cellDmaWaitTagStatusAll(DMA_MASK(3));
+	
+	
+	while ( btLikely( !shutdown ) )
+	{
+		
+		received_message = spu_read_in_mbox();
+		
+		if( btLikely( received_message == Spu_Mailbox_Event_Task ))
+		{
+#ifdef DEBUG_LIBSPE2_SPU_TASK
+			printf("SPU: received Spu_Mailbox_Event_Task\n");
+#endif //DEBUG_LIBSPE2_SPU_TASK
+
+			// refresh the status
+			cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
+			cellDmaWaitTagStatusAll(DMA_MASK(3));
+		
+			btAssert(status.m_status==Spu_Status_Occupied);
+			
+			cellDmaGet(&taskDesc, status.m_taskDesc.p, sizeof(SpuGatherAndProcessPairsTaskDesc), DMA_TAG(3), 0, 0);
+			cellDmaWaitTagStatusAll(DMA_MASK(3));
+#ifdef DEBUG_LIBSPE2_SPU_TASK		
+			printf("SPU:processCollisionTask\n");	
+#endif //DEBUG_LIBSPE2_SPU_TASK
+			processCollisionTask((void*)&taskDesc, taskDesc.m_lsMemory);
+			
+#ifdef DEBUG_LIBSPE2_SPU_TASK
+			printf("SPU:finished processCollisionTask\n");
+#endif //DEBUG_LIBSPE2_SPU_TASK
+		}
+		else
+		{
+#ifdef DEBUG_LIBSPE2_SPU_TASK
+			printf("SPU: received ShutDown\n");
+#endif //DEBUG_LIBSPE2_SPU_TASK
+			if( btLikely( received_message == Spu_Mailbox_Event_Shutdown ) )
+			{
+				shutdown = true;
+			}
+			else
+			{
+				//printf("SPU - Sth. recieved\n");
+			}
+		}
+
+		// set to status free and wait for next task
+		status.m_status = Spu_Status_Free;
+		cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
+		cellDmaWaitTagStatusAll(DMA_MASK(3));		
+				
+		
+  	}
+
+	printf("SPU: shutdown\n");
+  	return 0;
+}
+#endif // USE_LIBSPE2
+
+
+#endif //SPU_GATHERING_COLLISION_TASK_H
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h
new file mode 100644
index 0000000..8b89de0
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h
@@ -0,0 +1,19 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp
new file mode 100644
index 0000000..9f7e64d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp
@@ -0,0 +1,348 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "SpuMinkowskiPenetrationDepthSolver.h"
+#include "SpuContactResult.h"
+#include "SpuPreferredPenetrationDirections.h"
+#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
+#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"
+#include "SpuCollisionShapes.h"
+
+#define NUM_UNITSPHERE_POINTS 42
+static btVector3	sPenetrationDirections[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2] = 
+{
+btVector3(btScalar(0.000000) , btScalar(-0.000000),btScalar(-1.000000)),
+btVector3(btScalar(0.723608) , btScalar(-0.525725),btScalar(-0.447219)),
+btVector3(btScalar(-0.276388) , btScalar(-0.850649),btScalar(-0.447219)),
+btVector3(btScalar(-0.894426) , btScalar(-0.000000),btScalar(-0.447216)),
+btVector3(btScalar(-0.276388) , btScalar(0.850649),btScalar(-0.447220)),
+btVector3(btScalar(0.723608) , btScalar(0.525725),btScalar(-0.447219)),
+btVector3(btScalar(0.276388) , btScalar(-0.850649),btScalar(0.447220)),
+btVector3(btScalar(-0.723608) , btScalar(-0.525725),btScalar(0.447219)),
+btVector3(btScalar(-0.723608) , btScalar(0.525725),btScalar(0.447219)),
+btVector3(btScalar(0.276388) , btScalar(0.850649),btScalar(0.447219)),
+btVector3(btScalar(0.894426) , btScalar(0.000000),btScalar(0.447216)),
+btVector3(btScalar(-0.000000) , btScalar(0.000000),btScalar(1.000000)),
+btVector3(btScalar(0.425323) , btScalar(-0.309011),btScalar(-0.850654)),
+btVector3(btScalar(-0.162456) , btScalar(-0.499995),btScalar(-0.850654)),
+btVector3(btScalar(0.262869) , btScalar(-0.809012),btScalar(-0.525738)),
+btVector3(btScalar(0.425323) , btScalar(0.309011),btScalar(-0.850654)),
+btVector3(btScalar(0.850648) , btScalar(-0.000000),btScalar(-0.525736)),
+btVector3(btScalar(-0.525730) , btScalar(-0.000000),btScalar(-0.850652)),
+btVector3(btScalar(-0.688190) , btScalar(-0.499997),btScalar(-0.525736)),
+btVector3(btScalar(-0.162456) , btScalar(0.499995),btScalar(-0.850654)),
+btVector3(btScalar(-0.688190) , btScalar(0.499997),btScalar(-0.525736)),
+btVector3(btScalar(0.262869) , btScalar(0.809012),btScalar(-0.525738)),
+btVector3(btScalar(0.951058) , btScalar(0.309013),btScalar(0.000000)),
+btVector3(btScalar(0.951058) , btScalar(-0.309013),btScalar(0.000000)),
+btVector3(btScalar(0.587786) , btScalar(-0.809017),btScalar(0.000000)),
+btVector3(btScalar(0.000000) , btScalar(-1.000000),btScalar(0.000000)),
+btVector3(btScalar(-0.587786) , btScalar(-0.809017),btScalar(0.000000)),
+btVector3(btScalar(-0.951058) , btScalar(-0.309013),btScalar(-0.000000)),
+btVector3(btScalar(-0.951058) , btScalar(0.309013),btScalar(-0.000000)),
+btVector3(btScalar(-0.587786) , btScalar(0.809017),btScalar(-0.000000)),
+btVector3(btScalar(-0.000000) , btScalar(1.000000),btScalar(-0.000000)),
+btVector3(btScalar(0.587786) , btScalar(0.809017),btScalar(-0.000000)),
+btVector3(btScalar(0.688190) , btScalar(-0.499997),btScalar(0.525736)),
+btVector3(btScalar(-0.262869) , btScalar(-0.809012),btScalar(0.525738)),
+btVector3(btScalar(-0.850648) , btScalar(0.000000),btScalar(0.525736)),
+btVector3(btScalar(-0.262869) , btScalar(0.809012),btScalar(0.525738)),
+btVector3(btScalar(0.688190) , btScalar(0.499997),btScalar(0.525736)),
+btVector3(btScalar(0.525730) , btScalar(0.000000),btScalar(0.850652)),
+btVector3(btScalar(0.162456) , btScalar(-0.499995),btScalar(0.850654)),
+btVector3(btScalar(-0.425323) , btScalar(-0.309011),btScalar(0.850654)),
+btVector3(btScalar(-0.425323) , btScalar(0.309011),btScalar(0.850654)),
+btVector3(btScalar(0.162456) , btScalar(0.499995),btScalar(0.850654))
+};
+
+
+bool SpuMinkowskiPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& simplexSolver,
+		const btConvexShape* convexA,const btConvexShape* convexB,
+					const btTransform& transA,const btTransform& transB,
+				btVector3& v, btVector3& pa, btVector3& pb,
+				class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc)
+{
+#if 0
+	(void)stackAlloc;
+	(void)v;
+	
+
+	struct btIntermediateResult : public SpuContactResult
+	{
+
+		btIntermediateResult():m_hasResult(false)
+		{
+		}
+		
+		btVector3 m_normalOnBInWorld;
+		btVector3 m_pointInWorld;
+		btScalar m_depth;
+		bool	m_hasResult;
+
+		virtual void setShapeIdentifiersA(int partId0,int index0)
+		{
+			(void)partId0;
+			(void)index0;
+		}
+
+		virtual void setShapeIdentifiersB(int partId1,int index1)
+		{
+			(void)partId1;
+			(void)index1;
+		}
+		void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
+		{
+			m_normalOnBInWorld = normalOnBInWorld;
+			m_pointInWorld = pointInWorld;
+			m_depth = depth;
+			m_hasResult = true;
+		}
+	};
+
+	//just take fixed number of orientation, and sample the penetration depth in that direction
+	btScalar minProj = btScalar(BT_LARGE_FLOAT);
+	btVector3 minNorm(0.f,0.f,0.f);
+	btVector3 minVertex;
+	btVector3 minA,minB;
+	btVector3 seperatingAxisInA,seperatingAxisInB;
+	btVector3 pInA,qInB,pWorld,qWorld,w;
+
+//#define USE_BATCHED_SUPPORT 1
+#ifdef USE_BATCHED_SUPPORT
+
+	btVector3	supportVerticesABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	btVector3	supportVerticesBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	btVector3	seperatingAxisInABatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	btVector3	seperatingAxisInBBatch[NUM_UNITSPHERE_POINTS+MAX_PREFERRED_PENETRATION_DIRECTIONS*2];
+	int i;
+
+	int numSampleDirections = NUM_UNITSPHERE_POINTS;
+
+	for (i=0;i<numSampleDirections;i++)
+	{
+		const btVector3& norm = sPenetrationDirections[i];
+		seperatingAxisInABatch[i] =  (-norm) * transA.getBasis() ;
+		seperatingAxisInBBatch[i] =  norm   * transB.getBasis() ;
+	}
+
+	{
+		int numPDA = convexA->getNumPreferredPenetrationDirections();
+		if (numPDA)
+		{
+			for (int i=0;i<numPDA;i++)
+			{
+				btVector3 norm;
+				convexA->getPreferredPenetrationDirection(i,norm);
+				norm  = transA.getBasis() * norm;
+				sPenetrationDirections[numSampleDirections] = norm;
+				seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis();
+				seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis();
+				numSampleDirections++;
+			}
+		}
+	}
+
+	{
+		int numPDB = convexB->getNumPreferredPenetrationDirections();
+		if (numPDB)
+		{
+			for (int i=0;i<numPDB;i++)
+			{
+				btVector3 norm;
+				convexB->getPreferredPenetrationDirection(i,norm);
+				norm  = transB.getBasis() * norm;
+				sPenetrationDirections[numSampleDirections] = norm;
+				seperatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis();
+				seperatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis();
+				numSampleDirections++;
+			}
+		}
+	}
+
+
+
+	convexA->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch,supportVerticesABatch,numSampleDirections);
+	convexB->batchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch,supportVerticesBBatch,numSampleDirections);
+
+	for (i=0;i<numSampleDirections;i++)
+	{
+		const btVector3& norm = sPenetrationDirections[i];
+		seperatingAxisInA = seperatingAxisInABatch[i];
+		seperatingAxisInB = seperatingAxisInBBatch[i];
+
+		pInA = supportVerticesABatch[i];
+		qInB = supportVerticesBBatch[i];
+
+		pWorld = transA(pInA);	
+		qWorld = transB(qInB);
+		w	= qWorld - pWorld;
+		btScalar delta = norm.dot(w);
+		//find smallest delta
+		if (delta < minProj)
+		{
+			minProj = delta;
+			minNorm = norm;
+			minA = pWorld;
+			minB = qWorld;
+		}
+	}	
+#else
+
+	int numSampleDirections = NUM_UNITSPHERE_POINTS;
+
+///this is necessary, otherwise the normal is not correct, and sphere will rotate forever on a sloped triangle mesh
+#define DO_PREFERRED_DIRECTIONS 1
+#ifdef DO_PREFERRED_DIRECTIONS
+	{
+		int numPDA = spuGetNumPreferredPenetrationDirections(shapeTypeA,convexA);
+		if (numPDA)
+		{
+			for (int i=0;i<numPDA;i++)
+			{
+				btVector3 norm;
+				spuGetPreferredPenetrationDirection(shapeTypeA,convexA,i,norm);
+				norm  = transA.getBasis() * norm;
+				sPenetrationDirections[numSampleDirections] = norm;
+				numSampleDirections++;
+			}
+		}
+	}
+
+	{
+		int numPDB = spuGetNumPreferredPenetrationDirections(shapeTypeB,convexB);
+		if (numPDB)
+		{
+			for (int i=0;i<numPDB;i++)
+			{
+				btVector3 norm;
+				spuGetPreferredPenetrationDirection(shapeTypeB,convexB,i,norm);
+				norm  = transB.getBasis() * norm;
+				sPenetrationDirections[numSampleDirections] = norm;
+				numSampleDirections++;
+			}
+		}
+	}
+#endif //DO_PREFERRED_DIRECTIONS
+
+	for (int i=0;i<numSampleDirections;i++)
+	{
+		const btVector3& norm = sPenetrationDirections[i];
+		seperatingAxisInA = (-norm)* transA.getBasis();
+		seperatingAxisInB = norm* transB.getBasis();
+
+		pInA = convexA->localGetSupportVertexWithoutMarginNonVirtual( seperatingAxisInA);//, NULL);
+		qInB = convexB->localGetSupportVertexWithoutMarginNonVirtual(seperatingAxisInB);//, NULL);
+
+	//	pInA = convexA->localGetSupportingVertexWithoutMargin(seperatingAxisInA);
+	//	qInB = convexB->localGetSupportingVertexWithoutMargin(seperatingAxisInB);
+
+		pWorld = transA(pInA);	
+		qWorld = transB(qInB);
+		w	= qWorld - pWorld;
+		btScalar delta = norm.dot(w);
+		//find smallest delta
+		if (delta < minProj)
+		{
+			minProj = delta;
+			minNorm = norm;
+			minA = pWorld;
+			minB = qWorld;
+		}
+	}
+#endif //USE_BATCHED_SUPPORT
+
+	//add the margins
+
+	minA += minNorm*marginA;
+	minB -= minNorm*marginB;
+	//no penetration
+	if (minProj < btScalar(0.))
+		return false;
+
+	minProj += (marginA + marginB) + btScalar(1.00);
+
+
+
+
+
+//#define DEBUG_DRAW 1
+#ifdef DEBUG_DRAW
+	if (debugDraw)
+	{
+		btVector3 color(0,1,0);
+		debugDraw->drawLine(minA,minB,color);
+		color = btVector3 (1,1,1);
+		btVector3 vec = minB-minA;
+		btScalar prj2 = minNorm.dot(vec);
+		debugDraw->drawLine(minA,minA+(minNorm*minProj),color);
+
+	}
+#endif //DEBUG_DRAW
+
+	
+	btGjkPairDetector gjkdet(convexA,convexB,&simplexSolver,0);
+
+	btScalar offsetDist = minProj;
+	btVector3 offset = minNorm * offsetDist;
+	
+
+	SpuClosestPointInput input;
+	input.m_convexVertexData[0] = convexVertexDataA;
+	input.m_convexVertexData[1] = convexVertexDataB;
+	btVector3 newOrg = transA.getOrigin() + offset;
+
+	btTransform displacedTrans = transA;
+	displacedTrans.setOrigin(newOrg);
+
+	input.m_transformA = displacedTrans;
+	input.m_transformB = transB;
+	input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);//minProj;
+	
+	btIntermediateResult res;
+	gjkdet.getClosestPoints(input,res,0);
+
+	btScalar correctedMinNorm = minProj - res.m_depth;
+
+
+	//the penetration depth is over-estimated, relax it
+	btScalar penetration_relaxation= btScalar(1.);
+	minNorm*=penetration_relaxation;
+
+	if (res.m_hasResult)
+	{
+
+		pa = res.m_pointInWorld - minNorm * correctedMinNorm;
+		pb = res.m_pointInWorld;
+		
+#ifdef DEBUG_DRAW
+		if (debugDraw)
+		{
+			btVector3 color(1,0,0);
+			debugDraw->drawLine(pa,pb,color);
+		}
+#endif//DEBUG_DRAW
+
+
+	} else {
+		// could not seperate shapes
+		//btAssert (false);
+	}
+	return res.m_hasResult;
+#endif
+	return false;
+}
+
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h
new file mode 100644
index 0000000..18ad223
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h
@@ -0,0 +1,48 @@
+
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
+#define MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
+
+
+#include "BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h"
+
+class btStackAlloc;
+class btIDebugDraw;
+class btVoronoiSimplexSolver;
+class btConvexShape;
+
+///MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation.
+///Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points.
+class SpuMinkowskiPenetrationDepthSolver : public btConvexPenetrationDepthSolver
+{
+public:
+	SpuMinkowskiPenetrationDepthSolver() {}
+	virtual ~SpuMinkowskiPenetrationDepthSolver() {};
+
+		virtual bool calcPenDepth( btSimplexSolverInterface& simplexSolver,
+		const btConvexShape* convexA,const btConvexShape* convexB,
+					const btTransform& transA,const btTransform& transB,
+				btVector3& v, btVector3& pa, btVector3& pb,
+				class btIDebugDraw* debugDraw,btStackAlloc* stackAlloc
+				);
+
+
+};
+
+
+#endif //MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h
new file mode 100644
index 0000000..774a0cb
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h
@@ -0,0 +1,70 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef _SPU_PREFERRED_PENETRATION_DIRECTIONS_H
+#define _SPU_PREFERRED_PENETRATION_DIRECTIONS_H
+
+
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
+
+int		spuGetNumPreferredPenetrationDirections(int shapeType, void* shape)
+{
+	switch (shapeType)
+    {
+		case TRIANGLE_SHAPE_PROXYTYPE:
+		{
+			return 2;
+			//spu_printf("2\n");
+			break;
+		}
+		default:
+			{
+#if __ASSERT
+        spu_printf("spuGetNumPreferredPenetrationDirections() - Unsupported bound type: %d.\n", shapeType);
+#endif // __ASSERT
+			}
+	}
+
+	return 0;	
+}	
+
+void	spuGetPreferredPenetrationDirection(int shapeType, void* shape, int index, btVector3& penetrationVector)
+{
+
+
+	switch (shapeType)
+    {
+		case TRIANGLE_SHAPE_PROXYTYPE:
+		{
+			btVector3* vertices = (btVector3*)shape;
+			///calcNormal
+			penetrationVector = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]);
+			penetrationVector.normalize();
+			if (index)
+				penetrationVector *= btScalar(-1.);
+			break;
+		}
+		default:
+			{
+					
+#if __ASSERT
+        spu_printf("spuGetNumPreferredPenetrationDirections() - Unsupported bound type: %d.\n", shapeType);
+#endif // __ASSERT
+			}
+	}
+		
+}
+
+#endif //_SPU_PREFERRED_PENETRATION_DIRECTIONS_H
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
new file mode 100644
index 0000000..5e1202c
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
@@ -0,0 +1,1160 @@
+/*
+   Copyright (C) 2006, 2008 Sony Computer Entertainment Inc.
+   All rights reserved.
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+*/
+
+
+//#include "PfxContactBoxBox.h"
+
+#include <math.h>
+#include "../PlatformDefinitions.h"
+#include "boxBoxDistance.h"
+
+static inline float sqr( float a )
+{
+	return (a * a);
+}
+
+enum BoxSepAxisType
+{
+	A_AXIS, B_AXIS, CROSS_AXIS
+};
+
+//-------------------------------------------------------------------------------------------------
+// voronoiTol: bevels Voronoi planes slightly which helps when features are parallel.
+//-------------------------------------------------------------------------------------------------
+
+static const float voronoiTol = -1.0e-5f;
+
+//-------------------------------------------------------------------------------------------------
+// separating axis tests: gaps along each axis are computed, and the axis with the maximum
+// gap is stored.  cross product axes are normalized.
+//-------------------------------------------------------------------------------------------------
+
+#define AaxisTest( dim, letter, first )                                                         \
+{                                                                                               \
+   if ( first )                                                                                 \
+   {                                                                                            \
+      maxGap = gap = gapsA.get##letter();                                                      \
+      if ( gap > distanceThreshold ) return gap;                                                \
+      axisType = A_AXIS;                                                                        \
+      faceDimA = dim;                                                                           \
+      axisA = identity.getCol##dim();                                                          \
+   }                                                                                            \
+   else                                                                                         \
+   {                                                                                            \
+      gap = gapsA.get##letter();                                                               \
+      if ( gap > distanceThreshold ) return gap;                                                \
+      else if ( gap > maxGap )                                                                  \
+      {                                                                                         \
+         maxGap = gap;                                                                          \
+         axisType = A_AXIS;                                                                     \
+         faceDimA = dim;                                                                        \
+         axisA = identity.getCol##dim();                                                       \
+      }                                                                                         \
+   }                                                                                            \
+}
+
+
+#define BaxisTest( dim, letter )                                                                \
+{                                                                                               \
+   gap = gapsB.get##letter();                                                                  \
+   if ( gap > distanceThreshold ) return gap;                                                   \
+   else if ( gap > maxGap )                                                                     \
+   {                                                                                            \
+      maxGap = gap;                                                                             \
+      axisType = B_AXIS;                                                                        \
+      faceDimB = dim;                                                                           \
+      axisB = identity.getCol##dim();                                                          \
+   }                                                                                            \
+}
+
+#define CrossAxisTest( dima, dimb, letterb )                                                    \
+{                                                                                               \
+   const float lsqr_tolerance = 1.0e-30f;                                                       \
+   float lsqr;                                                                                  \
+                                                                                                \
+   lsqr = lsqrs.getCol##dima().get##letterb();                                                \
+                                                                                                \
+   if ( lsqr > lsqr_tolerance )                                                                 \
+   {                                                                                            \
+      float l_recip = 1.0f / sqrtf( lsqr );                                                     \
+      gap = float(gapsAxB.getCol##dima().get##letterb()) * l_recip;                           \
+                                                                                                \
+      if ( gap > distanceThreshold )                                                            \
+      {                                                                                         \
+         return gap;                                                                            \
+      }                                                                                         \
+                                                                                                \
+      if ( gap > maxGap )                                                                       \
+      {                                                                                         \
+         maxGap = gap;                                                                          \
+         axisType = CROSS_AXIS;                                                                 \
+         edgeDimA = dima;                                                                       \
+         edgeDimB = dimb;                                                                       \
+         axisA = cross(identity.getCol##dima(),matrixAB.getCol##dimb()) * l_recip;            \
+      }                                                                                         \
+   }                                                                                            \
+}
+
+//-------------------------------------------------------------------------------------------------
+// tests whether a vertex of box B and a face of box A are the closest features
+//-------------------------------------------------------------------------------------------------
+
+inline
+float
+VertexBFaceATest(
+	bool & inVoronoi,
+	float & t0,
+	float & t1,
+	const vmVector3 & hA,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsB,
+	PE_REF(vmVector3) scalesB )
+{
+	// compute a corner of box B in A's coordinate system
+
+	vmVector3 corner =
+		vmVector3( faceOffsetAB + matrixAB.getCol0() * scalesB.getX() + matrixAB.getCol1() * scalesB.getY() );
+
+	// compute the parameters of the point on A, closest to this corner
+
+	t0 = corner[0];
+	t1 = corner[1];
+
+	if ( t0 > hA[0] )
+		t0 = hA[0];
+	else if ( t0 < -hA[0] )
+		t0 = -hA[0];
+	if ( t1 > hA[1] )
+		t1 = hA[1];
+	else if ( t1 < -hA[1] )
+		t1 = -hA[1];
+
+	// do the Voronoi test: already know the point on B is in the Voronoi region of the
+	// point on A, check the reverse.
+
+	vmVector3 facePointB =
+		vmVector3( mulPerElem( faceOffsetBA + matrixBA.getCol0() * t0 + matrixBA.getCol1() * t1 - scalesB, signsB ) );
+
+	inVoronoi = ( ( facePointB[0] >= voronoiTol * facePointB[2] ) &&
+				  ( facePointB[1] >= voronoiTol * facePointB[0] ) &&
+				  ( facePointB[2] >= voronoiTol * facePointB[1] ) );
+
+	return (sqr( corner[0] - t0 ) + sqr( corner[1] - t1 ) + sqr( corner[2] ));
+}
+
+#define VertexBFaceA_SetNewMin()                \
+{                                               \
+   minDistSqr = distSqr;                        \
+   localPointA.setX(t0);                        \
+   localPointA.setY(t1);                        \
+   localPointB.setX( scalesB.getX() );          \
+   localPointB.setY( scalesB.getY() );          \
+   featureA = F;                                \
+   featureB = V;                                \
+}
+
+void
+VertexBFaceATests(
+	bool & done,
+	float & minDistSqr,
+	vmPoint3 & localPointA,
+	vmPoint3 & localPointB,
+	FeatureType & featureA,
+	FeatureType & featureB,
+	const vmVector3 & hA,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsB,
+	PE_REF(vmVector3) scalesB,
+	bool first )
+{
+		
+	float t0, t1;
+	float distSqr;
+
+	distSqr = VertexBFaceATest( done, t0, t1, hA, faceOffsetAB, faceOffsetBA,
+								matrixAB, matrixBA, signsB, scalesB );
+
+	if ( first ) {
+		VertexBFaceA_SetNewMin();
+	} else {
+		if ( distSqr < minDistSqr ) {
+			VertexBFaceA_SetNewMin();
+		}
+	}
+
+	if ( done )
+		return;
+
+	signsB.setX( -signsB.getX() );
+	scalesB.setX( -scalesB.getX() );
+
+	distSqr = VertexBFaceATest( done, t0, t1, hA, faceOffsetAB, faceOffsetBA,
+								matrixAB, matrixBA, signsB, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		VertexBFaceA_SetNewMin();
+	}
+
+	if ( done )
+		return;
+
+	signsB.setY( -signsB.getY() );
+	scalesB.setY( -scalesB.getY() );
+
+	distSqr = VertexBFaceATest( done, t0, t1, hA, faceOffsetAB, faceOffsetBA,
+								matrixAB, matrixBA, signsB, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		VertexBFaceA_SetNewMin();
+	}
+
+	if ( done )
+		return;
+
+	signsB.setX( -signsB.getX() );
+	scalesB.setX( -scalesB.getX() );
+
+	distSqr = VertexBFaceATest( done, t0, t1, hA, faceOffsetAB, faceOffsetBA,
+								matrixAB, matrixBA, signsB, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		VertexBFaceA_SetNewMin();
+	}
+}
+
+//-------------------------------------------------------------------------------------------------
+// VertexAFaceBTest: tests whether a vertex of box A and a face of box B are the closest features
+//-------------------------------------------------------------------------------------------------
+
+inline
+float
+VertexAFaceBTest(
+	bool & inVoronoi,
+	float & t0,
+	float & t1,
+	const vmVector3 & hB,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsA,
+	PE_REF(vmVector3) scalesA )
+{
+	vmVector3 corner =
+		vmVector3( faceOffsetBA + matrixBA.getCol0() * scalesA.getX() + matrixBA.getCol1() * scalesA.getY() );
+
+	t0 = corner[0];
+	t1 = corner[1];
+
+	if ( t0 > hB[0] )
+		t0 = hB[0];
+	else if ( t0 < -hB[0] )
+		t0 = -hB[0];
+	if ( t1 > hB[1] )
+		t1 = hB[1];
+	else if ( t1 < -hB[1] )
+		t1 = -hB[1];
+
+	vmVector3 facePointA =
+		vmVector3( mulPerElem( faceOffsetAB + matrixAB.getCol0() * t0 + matrixAB.getCol1() * t1 - scalesA, signsA ) );
+
+	inVoronoi = ( ( facePointA[0] >= voronoiTol * facePointA[2] ) &&
+				  ( facePointA[1] >= voronoiTol * facePointA[0] ) &&
+				  ( facePointA[2] >= voronoiTol * facePointA[1] ) );
+
+	return (sqr( corner[0] - t0 ) + sqr( corner[1] - t1 ) + sqr( corner[2] ));
+}
+
+#define VertexAFaceB_SetNewMin()                \
+{                                               \
+   minDistSqr = distSqr;                        \
+   localPointB.setX(t0);                        \
+   localPointB.setY(t1);                        \
+   localPointA.setX( scalesA.getX() );          \
+   localPointA.setY( scalesA.getY() );          \
+   featureA = V;                                \
+   featureB = F;                                \
+}
+
+void
+VertexAFaceBTests(
+	bool & done,
+	float & minDistSqr,
+	vmPoint3 & localPointA,
+	vmPoint3 & localPointB,
+	FeatureType & featureA,
+	FeatureType & featureB,
+	const vmVector3 & hB,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsA,
+	PE_REF(vmVector3) scalesA,
+	bool first )
+{
+	float t0, t1;
+	float distSqr;
+
+	distSqr = VertexAFaceBTest( done, t0, t1, hB, faceOffsetAB, faceOffsetBA,
+								matrixAB, matrixBA, signsA, scalesA );
+
+	if ( first ) {
+		VertexAFaceB_SetNewMin();
+	} else {
+		if ( distSqr < minDistSqr ) {
+			VertexAFaceB_SetNewMin();
+		}
+	}
+
+	if ( done )
+		return;
+
+	signsA.setX( -signsA.getX() );
+	scalesA.setX( -scalesA.getX() );
+
+	distSqr = VertexAFaceBTest( done, t0, t1, hB, faceOffsetAB, faceOffsetBA,
+								matrixAB, matrixBA, signsA, scalesA );
+
+	if ( distSqr < minDistSqr ) {
+		VertexAFaceB_SetNewMin();
+	}
+
+	if ( done )
+		return;
+
+	signsA.setY( -signsA.getY() );
+	scalesA.setY( -scalesA.getY() );
+
+	distSqr = VertexAFaceBTest( done, t0, t1, hB, faceOffsetAB, faceOffsetBA,
+								matrixAB, matrixBA, signsA, scalesA );
+
+	if ( distSqr < minDistSqr ) {
+		VertexAFaceB_SetNewMin();
+	}
+
+	if ( done )
+		return;
+
+	signsA.setX( -signsA.getX() );
+	scalesA.setX( -scalesA.getX() );
+
+	distSqr = VertexAFaceBTest( done, t0, t1, hB, faceOffsetAB, faceOffsetBA,
+								matrixAB, matrixBA, signsA, scalesA );
+
+	if ( distSqr < minDistSqr ) {
+		VertexAFaceB_SetNewMin();
+	}
+}
+
+//-------------------------------------------------------------------------------------------------
+// CustomEdgeEdgeTest:
+//
+// tests whether a pair of edges are the closest features
+//
+// note on the shorthand:
+// 'a' & 'b' refer to the edges.
+// 'c' is the dimension of the axis that points from the face center to the edge Center
+// 'd' is the dimension of the edge Direction
+// the dimension of the face normal is 2
+//-------------------------------------------------------------------------------------------------
+
+#define CustomEdgeEdgeTest( ac, ac_letter, ad, ad_letter, bc, bc_letter, bd, bd_letter )              \
+{                                                                                               \
+   vmVector3 edgeOffsetAB;                                                                          \
+   vmVector3 edgeOffsetBA;                                                                          \
+                                                                                                \
+   edgeOffsetAB = faceOffsetAB + matrixAB.getCol##bc() * scalesB.get##bc_letter();            \
+   edgeOffsetAB.set##ac_letter( edgeOffsetAB.get##ac_letter() - scalesA.get##ac_letter() );  \
+                                                                                                \
+   edgeOffsetBA = faceOffsetBA + matrixBA.getCol##ac() * scalesA.get##ac_letter();            \
+   edgeOffsetBA.set##bc_letter( edgeOffsetBA.get##bc_letter() - scalesB.get##bc_letter() );  \
+                                                                                                \
+   float dirDot = matrixAB.getCol##bd().get##ad_letter();                                     \
+   float denom = 1.0f - dirDot*dirDot;                                                          \
+   float edgeOffsetAB_ad = edgeOffsetAB.get##ad_letter();                                      \
+   float edgeOffsetBA_bd = edgeOffsetBA.get##bd_letter();                                      \
+                                                                                                \
+   if ( denom == 0.0f )                                                                         \
+   {                                                                                            \
+      tA = 0.0f;                                                                                \
+   }                                                                                            \
+   else                                                                                         \
+   {                                                                                            \
+      tA = ( edgeOffsetAB_ad + edgeOffsetBA_bd * dirDot ) / denom;                              \
+   }                                                                                            \
+                                                                                                \
+   if ( tA < -hA[ad] ) tA = -hA[ad];                                                            \
+   else if ( tA > hA[ad] ) tA = hA[ad];                                                         \
+                                                                                                \
+   tB = tA * dirDot + edgeOffsetBA_bd;                                                          \
+                                                                                                \
+   if ( tB < -hB[bd] )                                                                          \
+   {                                                                                            \
+      tB = -hB[bd];                                                                             \
+      tA = tB * dirDot + edgeOffsetAB_ad;                                                       \
+                                                                                                \
+      if ( tA < -hA[ad] ) tA = -hA[ad];                                                         \
+      else if ( tA > hA[ad] ) tA = hA[ad];                                                      \
+   }                                                                                            \
+   else if ( tB > hB[bd] )                                                                      \
+   {                                                                                            \
+      tB = hB[bd];                                                                              \
+      tA = tB * dirDot + edgeOffsetAB_ad;                                                       \
+                                                                                                \
+      if ( tA < -hA[ad] ) tA = -hA[ad];                                                         \
+      else if ( tA > hA[ad] ) tA = hA[ad];                                                      \
+   }                                                                                            \
+                                                                                                \
+   vmVector3 edgeOffAB = vmVector3( mulPerElem( edgeOffsetAB + matrixAB.getCol##bd() * tB, signsA ) );\
+   vmVector3 edgeOffBA = vmVector3( mulPerElem( edgeOffsetBA + matrixBA.getCol##ad() * tA, signsB ) );\
+                                                                                                \
+   inVoronoi = ( edgeOffAB[ac] >= voronoiTol * edgeOffAB[2] ) &&                                \
+               ( edgeOffAB[2] >= voronoiTol * edgeOffAB[ac] ) &&                                \
+               ( edgeOffBA[bc] >= voronoiTol * edgeOffBA[2] ) &&                                \
+               ( edgeOffBA[2] >= voronoiTol * edgeOffBA[bc] );                                  \
+                                                                                                \
+   edgeOffAB[ad] -= tA;                                                                         \
+   edgeOffBA[bd] -= tB;                                                                         \
+                                                                                                \
+   return dot(edgeOffAB,edgeOffAB);                                                             \
+}
+
+float
+CustomEdgeEdgeTest_0101(
+	bool & inVoronoi,
+	float & tA,
+	float & tB,
+	const vmVector3 & hA,
+	const vmVector3 & hB,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsA,
+	PE_REF(vmVector3) signsB,
+	PE_REF(vmVector3) scalesA,
+	PE_REF(vmVector3) scalesB )
+{
+	CustomEdgeEdgeTest( 0, X, 1, Y, 0, X, 1, Y );
+}
+
+float
+CustomEdgeEdgeTest_0110(
+	bool & inVoronoi,
+	float & tA,
+	float & tB,
+	const vmVector3 & hA,
+	const vmVector3 & hB,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsA,
+	PE_REF(vmVector3) signsB,
+	PE_REF(vmVector3) scalesA,
+	PE_REF(vmVector3) scalesB )
+{
+	CustomEdgeEdgeTest( 0, X, 1, Y, 1, Y, 0, X );
+}
+
+float
+CustomEdgeEdgeTest_1001(
+	bool & inVoronoi,
+	float & tA,
+	float & tB,
+	const vmVector3 & hA,
+	const vmVector3 & hB,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsA,
+	PE_REF(vmVector3) signsB,
+	PE_REF(vmVector3) scalesA,
+	PE_REF(vmVector3) scalesB )
+{
+	CustomEdgeEdgeTest( 1, Y, 0, X, 0, X, 1, Y );
+}
+
+float
+CustomEdgeEdgeTest_1010(
+	bool & inVoronoi,
+	float & tA,
+	float & tB,
+	const vmVector3 & hA,
+	const vmVector3 & hB,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsA,
+	PE_REF(vmVector3) signsB,
+	PE_REF(vmVector3) scalesA,
+	PE_REF(vmVector3) scalesB )
+{
+	CustomEdgeEdgeTest( 1, Y, 0, X, 1, Y, 0, X );
+}
+
+#define EdgeEdge_SetNewMin( ac_letter, ad_letter, bc_letter, bd_letter )   \
+{                                                                          \
+   minDistSqr = distSqr;                                                   \
+   localPointA.set##ac_letter(scalesA.get##ac_letter());                 \
+   localPointA.set##ad_letter(tA);                                        \
+   localPointB.set##bc_letter(scalesB.get##bc_letter());                 \
+   localPointB.set##bd_letter(tB);                                        \
+   otherFaceDimA = testOtherFaceDimA;                                      \
+   otherFaceDimB = testOtherFaceDimB;                                      \
+   featureA = E;                                                           \
+   featureB = E;                                                           \
+}
+
+void
+EdgeEdgeTests(
+	bool & done,
+	float & minDistSqr,
+	vmPoint3 & localPointA,
+	vmPoint3 & localPointB,
+	int & otherFaceDimA,
+	int & otherFaceDimB,
+	FeatureType & featureA,
+	FeatureType & featureB,
+	const vmVector3 & hA,
+	const vmVector3 & hB,
+	PE_REF(vmVector3) faceOffsetAB,
+	PE_REF(vmVector3) faceOffsetBA,
+	const vmMatrix3 & matrixAB,
+	const vmMatrix3 & matrixBA,
+	PE_REF(vmVector3) signsA,
+	PE_REF(vmVector3) signsB,
+	PE_REF(vmVector3) scalesA,
+	PE_REF(vmVector3) scalesB,
+	bool first )
+{
+
+	float distSqr;
+	float tA, tB;
+
+	int testOtherFaceDimA, testOtherFaceDimB;
+
+	testOtherFaceDimA = 0;
+	testOtherFaceDimB = 0;
+
+	distSqr = CustomEdgeEdgeTest_0101( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( first ) {
+		EdgeEdge_SetNewMin( X, Y, X, Y );
+	} else {
+		if ( distSqr < minDistSqr ) {
+			EdgeEdge_SetNewMin( X, Y, X, Y );
+		}
+	}
+
+	if ( done )
+		return;
+
+	signsA.setX( -signsA.getX() );
+	scalesA.setX( -scalesA.getX() );
+
+	distSqr = CustomEdgeEdgeTest_0101( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( X, Y, X, Y );
+	}
+
+	if ( done )
+		return;
+
+	signsB.setX( -signsB.getX() );
+	scalesB.setX( -scalesB.getX() );
+
+	distSqr = CustomEdgeEdgeTest_0101( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( X, Y, X, Y );
+	}
+
+	if ( done )
+		return;
+
+	signsA.setX( -signsA.getX() );
+	scalesA.setX( -scalesA.getX() );
+
+	distSqr = CustomEdgeEdgeTest_0101( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( X, Y, X, Y );
+	}
+
+	if ( done )
+		return;
+
+	testOtherFaceDimA = 1;
+	testOtherFaceDimB = 0;
+	signsB.setX( -signsB.getX() );
+	scalesB.setX( -scalesB.getX() );
+
+	distSqr = CustomEdgeEdgeTest_1001( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( Y, X, X, Y );
+	}
+
+	if ( done )
+		return;
+
+	signsA.setY( -signsA.getY() );
+	scalesA.setY( -scalesA.getY() );
+
+	distSqr = CustomEdgeEdgeTest_1001( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( Y, X, X, Y );
+	}
+
+	if ( done )
+		return;
+
+	signsB.setX( -signsB.getX() );
+	scalesB.setX( -scalesB.getX() );
+
+	distSqr = CustomEdgeEdgeTest_1001( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( Y, X, X, Y );
+	}
+
+	if ( done )
+		return;
+
+	signsA.setY( -signsA.getY() );
+	scalesA.setY( -scalesA.getY() );
+
+	distSqr = CustomEdgeEdgeTest_1001( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( Y, X, X, Y );
+	}
+
+	if ( done )
+		return;
+
+	testOtherFaceDimA = 0;
+	testOtherFaceDimB = 1;
+	signsB.setX( -signsB.getX() );
+	scalesB.setX( -scalesB.getX() );
+
+	distSqr = CustomEdgeEdgeTest_0110( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( X, Y, Y, X );
+	}
+
+	if ( done )
+		return;
+
+	signsA.setX( -signsA.getX() );
+	scalesA.setX( -scalesA.getX() );
+
+	distSqr = CustomEdgeEdgeTest_0110( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( X, Y, Y, X );
+	}
+
+	if ( done )
+		return;
+
+	signsB.setY( -signsB.getY() );
+	scalesB.setY( -scalesB.getY() );
+
+	distSqr = CustomEdgeEdgeTest_0110( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( X, Y, Y, X );
+	}
+
+	if ( done )
+		return;
+
+	signsA.setX( -signsA.getX() );
+	scalesA.setX( -scalesA.getX() );
+
+	distSqr = CustomEdgeEdgeTest_0110( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( X, Y, Y, X );
+	}
+
+	if ( done )
+		return;
+
+	testOtherFaceDimA = 1;
+	testOtherFaceDimB = 1;
+	signsB.setY( -signsB.getY() );
+	scalesB.setY( -scalesB.getY() );
+
+	distSqr = CustomEdgeEdgeTest_1010( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( Y, X, Y, X );
+	}
+
+	if ( done )
+		return;
+
+	signsA.setY( -signsA.getY() );
+	scalesA.setY( -scalesA.getY() );
+
+	distSqr = CustomEdgeEdgeTest_1010( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( Y, X, Y, X );
+	}
+
+	if ( done )
+		return;
+
+	signsB.setY( -signsB.getY() );
+	scalesB.setY( -scalesB.getY() );
+
+	distSqr = CustomEdgeEdgeTest_1010( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( Y, X, Y, X );
+	}
+
+	if ( done )
+		return;
+
+	signsA.setY( -signsA.getY() );
+	scalesA.setY( -scalesA.getY() );
+
+	distSqr = CustomEdgeEdgeTest_1010( done, tA, tB, hA, hB, faceOffsetAB, faceOffsetBA,
+								 matrixAB, matrixBA, signsA, signsB, scalesA, scalesB );
+
+	if ( distSqr < minDistSqr ) {
+		EdgeEdge_SetNewMin( Y, X, Y, X );
+	}
+}
+
+
+float
+boxBoxDistance(vmVector3& normal, BoxPoint& boxPointA, BoxPoint& boxPointB,
+			   PE_REF(Box) boxA, const vmTransform3 & transformA, PE_REF(Box) boxB,
+			   const vmTransform3 & transformB,
+			   float distanceThreshold)
+{
+	vmMatrix3 identity;
+	identity = vmMatrix3::identity();
+	vmVector3 ident[3];
+	ident[0] = identity.getCol0();
+	ident[1] = identity.getCol1();
+	ident[2] = identity.getCol2();
+
+	// get relative transformations
+
+	vmTransform3 transformAB, transformBA;
+	vmMatrix3 matrixAB, matrixBA;
+	vmVector3 offsetAB, offsetBA;
+
+	transformAB = orthoInverse(transformA) * transformB;
+	transformBA = orthoInverse(transformAB);
+
+	matrixAB = transformAB.getUpper3x3();
+	offsetAB = transformAB.getTranslation();
+	matrixBA = transformBA.getUpper3x3();
+	offsetBA = transformBA.getTranslation();
+
+	vmMatrix3 absMatrixAB = absPerElem(matrixAB);
+	vmMatrix3 absMatrixBA = absPerElem(matrixBA);
+
+	// find separating axis with largest gap between projections
+
+	BoxSepAxisType axisType;
+	vmVector3 axisA(0.0f), axisB(0.0f);
+	float gap, maxGap;
+	int faceDimA = 0, faceDimB = 0, edgeDimA = 0, edgeDimB = 0;
+
+	// face axes
+
+	vmVector3  gapsA   = absPerElem(offsetAB) - boxA.mHalf - absMatrixAB * boxB.mHalf;
+
+	AaxisTest(0,X,true);
+	AaxisTest(1,Y,false);
+	AaxisTest(2,Z,false);
+
+	vmVector3  gapsB   = absPerElem(offsetBA) - boxB.mHalf - absMatrixBA * boxA.mHalf;
+
+	BaxisTest(0,X);
+	BaxisTest(1,Y);
+	BaxisTest(2,Z);
+
+	// cross product axes
+
+	// �O�ς��O�̂Ƃ��̑΍�
+	absMatrixAB += vmMatrix3(1.0e-5f);
+	absMatrixBA += vmMatrix3(1.0e-5f);
+
+	vmMatrix3 lsqrs, projOffset, projAhalf, projBhalf;
+
+	lsqrs.setCol0( mulPerElem( matrixBA.getCol2(), matrixBA.getCol2() ) +
+				   mulPerElem( matrixBA.getCol1(), matrixBA.getCol1() ) );
+	lsqrs.setCol1( mulPerElem( matrixBA.getCol2(), matrixBA.getCol2() ) +
+				   mulPerElem( matrixBA.getCol0(), matrixBA.getCol0() ) );
+	lsqrs.setCol2( mulPerElem( matrixBA.getCol1(), matrixBA.getCol1() ) +
+				   mulPerElem( matrixBA.getCol0(), matrixBA.getCol0() ) );
+
+	projOffset.setCol0(matrixBA.getCol1() * offsetAB.getZ() - matrixBA.getCol2() * offsetAB.getY());
+	projOffset.setCol1(matrixBA.getCol2() * offsetAB.getX() - matrixBA.getCol0() * offsetAB.getZ());
+	projOffset.setCol2(matrixBA.getCol0() * offsetAB.getY() - matrixBA.getCol1() * offsetAB.getX());
+
+	projAhalf.setCol0(absMatrixBA.getCol1() * boxA.mHalf.getZ() + absMatrixBA.getCol2() * boxA.mHalf.getY());
+	projAhalf.setCol1(absMatrixBA.getCol2() * boxA.mHalf.getX() + absMatrixBA.getCol0() * boxA.mHalf.getZ());
+	projAhalf.setCol2(absMatrixBA.getCol0() * boxA.mHalf.getY() + absMatrixBA.getCol1() * boxA.mHalf.getX());
+
+	projBhalf.setCol0(absMatrixAB.getCol1() * boxB.mHalf.getZ() + absMatrixAB.getCol2() * boxB.mHalf.getY());
+	projBhalf.setCol1(absMatrixAB.getCol2() * boxB.mHalf.getX() + absMatrixAB.getCol0() * boxB.mHalf.getZ());
+	projBhalf.setCol2(absMatrixAB.getCol0() * boxB.mHalf.getY() + absMatrixAB.getCol1() * boxB.mHalf.getX());
+
+	vmMatrix3 gapsAxB = absPerElem(projOffset) - projAhalf - transpose(projBhalf);
+
+	CrossAxisTest(0,0,X);
+	CrossAxisTest(0,1,Y);
+	CrossAxisTest(0,2,Z);
+	CrossAxisTest(1,0,X);
+	CrossAxisTest(1,1,Y);
+	CrossAxisTest(1,2,Z);
+	CrossAxisTest(2,0,X);
+	CrossAxisTest(2,1,Y);
+	CrossAxisTest(2,2,Z);
+
+	// need to pick the face on each box whose normal best matches the separating axis.
+	// will transform vectors to be in the coordinate system of this face to simplify things later.
+	// for this, a permutation matrix can be used, which the next section computes.
+
+	int dimA[3], dimB[3];
+
+	if ( axisType == A_AXIS ) {
+		if ( dot(axisA,offsetAB) < 0.0f )
+			axisA = -axisA;
+		axisB = matrixBA * -axisA;
+
+		vmVector3 absAxisB = vmVector3(absPerElem(axisB));
+
+		if ( ( absAxisB[0] > absAxisB[1] ) && ( absAxisB[0] > absAxisB[2] ) )
+			faceDimB = 0;
+		else if ( absAxisB[1] > absAxisB[2] )
+			faceDimB = 1;
+		else
+			faceDimB = 2;
+	} else if ( axisType == B_AXIS ) {
+		if ( dot(axisB,offsetBA) < 0.0f )
+			axisB = -axisB;
+		axisA = matrixAB * -axisB;
+
+		vmVector3 absAxisA = vmVector3(absPerElem(axisA));
+
+		if ( ( absAxisA[0] > absAxisA[1] ) && ( absAxisA[0] > absAxisA[2] ) )
+			faceDimA = 0;
+		else if ( absAxisA[1] > absAxisA[2] )
+			faceDimA = 1;
+		else
+			faceDimA = 2;
+	}
+
+	if ( axisType == CROSS_AXIS ) {
+		if ( dot(axisA,offsetAB) < 0.0f )
+			axisA = -axisA;
+		axisB = matrixBA * -axisA;
+
+		vmVector3 absAxisA = vmVector3(absPerElem(axisA));
+		vmVector3 absAxisB = vmVector3(absPerElem(axisB));
+
+		dimA[1] = edgeDimA;
+		dimB[1] = edgeDimB;
+
+		if ( edgeDimA == 0 ) {
+			if ( absAxisA[1] > absAxisA[2] ) {
+				dimA[0] = 2;
+				dimA[2] = 1;
+			} else                             {
+				dimA[0] = 1;
+				dimA[2] = 2;
+			}
+		} else if ( edgeDimA == 1 ) {
+			if ( absAxisA[2] > absAxisA[0] ) {
+				dimA[0] = 0;
+				dimA[2] = 2;
+			} else                             {
+				dimA[0] = 2;
+				dimA[2] = 0;
+			}
+		} else {
+			if ( absAxisA[0] > absAxisA[1] ) {
+				dimA[0] = 1;
+				dimA[2] = 0;
+			} else                             {
+				dimA[0] = 0;
+				dimA[2] = 1;
+			}
+		}
+
+		if ( edgeDimB == 0 ) {
+			if ( absAxisB[1] > absAxisB[2] ) {
+				dimB[0] = 2;
+				dimB[2] = 1;
+			} else                             {
+				dimB[0] = 1;
+				dimB[2] = 2;
+			}
+		} else if ( edgeDimB == 1 ) {
+			if ( absAxisB[2] > absAxisB[0] ) {
+				dimB[0] = 0;
+				dimB[2] = 2;
+			} else                             {
+				dimB[0] = 2;
+				dimB[2] = 0;
+			}
+		} else {
+			if ( absAxisB[0] > absAxisB[1] ) {
+				dimB[0] = 1;
+				dimB[2] = 0;
+			} else                             {
+				dimB[0] = 0;
+				dimB[2] = 1;
+			}
+		}
+	} else {
+		dimA[2] = faceDimA;
+		dimA[0] = (faceDimA+1)%3;
+		dimA[1] = (faceDimA+2)%3;
+		dimB[2] = faceDimB;
+		dimB[0] = (faceDimB+1)%3;
+		dimB[1] = (faceDimB+2)%3;
+	}
+
+	vmMatrix3 aperm_col, bperm_col;
+
+	aperm_col.setCol0(ident[dimA[0]]);
+	aperm_col.setCol1(ident[dimA[1]]);
+	aperm_col.setCol2(ident[dimA[2]]);
+
+	bperm_col.setCol0(ident[dimB[0]]);
+	bperm_col.setCol1(ident[dimB[1]]);
+	bperm_col.setCol2(ident[dimB[2]]);
+
+	vmMatrix3 aperm_row, bperm_row;
+
+	aperm_row = transpose(aperm_col);
+	bperm_row = transpose(bperm_col);
+
+	// permute all box parameters to be in the face coordinate systems
+
+	vmMatrix3 matrixAB_perm = aperm_row * matrixAB * bperm_col;
+	vmMatrix3 matrixBA_perm = transpose(matrixAB_perm);
+
+	vmVector3 offsetAB_perm, offsetBA_perm;
+
+	offsetAB_perm = aperm_row * offsetAB;
+	offsetBA_perm = bperm_row * offsetBA;
+
+	vmVector3 halfA_perm, halfB_perm;
+
+	halfA_perm = aperm_row * boxA.mHalf;
+	halfB_perm = bperm_row * boxB.mHalf;
+
+	// compute the vector between the centers of each face, in each face's coordinate frame
+
+	vmVector3 signsA_perm, signsB_perm, scalesA_perm, scalesB_perm, faceOffsetAB_perm, faceOffsetBA_perm;
+
+	signsA_perm = copySignPerElem(vmVector3(1.0f),aperm_row * axisA);
+	signsB_perm = copySignPerElem(vmVector3(1.0f),bperm_row * axisB);
+	scalesA_perm = mulPerElem( signsA_perm, halfA_perm );
+	scalesB_perm = mulPerElem( signsB_perm, halfB_perm );
+
+	faceOffsetAB_perm = offsetAB_perm + matrixAB_perm.getCol2() * scalesB_perm.getZ();
+	faceOffsetAB_perm.setZ( faceOffsetAB_perm.getZ() - scalesA_perm.getZ() );
+
+	faceOffsetBA_perm = offsetBA_perm + matrixBA_perm.getCol2() * scalesA_perm.getZ();
+	faceOffsetBA_perm.setZ( faceOffsetBA_perm.getZ() - scalesB_perm.getZ() );
+
+	if ( maxGap < 0.0f ) {
+		// if boxes overlap, this will separate the faces for finding points of penetration.
+
+		faceOffsetAB_perm -= aperm_row * axisA * maxGap * 1.01f;
+		faceOffsetBA_perm -= bperm_row * axisB * maxGap * 1.01f;
+	}
+
+	// for each vertex/face or edge/edge pair of the two faces, find the closest points.
+	//
+	// these points each have an associated box feature (vertex, edge, or face).  if each
+	// point is in the external Voronoi region of the other's feature, they are the
+	// closest points of the boxes, and the algorithm can exit.
+	//
+	// the feature pairs are arranged so that in the general case, the first test will
+	// succeed.  degenerate cases (parallel faces) may require up to all tests in the
+	// worst case.
+	//
+	// if for some reason no case passes the Voronoi test, the features with the minimum
+	// distance are returned.
+
+	vmPoint3 localPointA_perm, localPointB_perm;
+	float minDistSqr;
+	bool done;
+
+	vmVector3 hA_perm( halfA_perm ), hB_perm( halfB_perm );
+
+	localPointA_perm.setZ( scalesA_perm.getZ() );
+	localPointB_perm.setZ( scalesB_perm.getZ() );
+	scalesA_perm.setZ(0.0f);
+	scalesB_perm.setZ(0.0f);
+
+	int otherFaceDimA, otherFaceDimB;
+	FeatureType featureA, featureB;
+
+	if ( axisType == CROSS_AXIS ) {
+		EdgeEdgeTests( done, minDistSqr, localPointA_perm, localPointB_perm,
+					   otherFaceDimA, otherFaceDimB, featureA, featureB,
+					   hA_perm, hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+					   matrixAB_perm, matrixBA_perm, signsA_perm, signsB_perm,
+					   scalesA_perm, scalesB_perm, true );
+
+		if ( !done ) {
+			VertexBFaceATests( done, minDistSqr, localPointA_perm, localPointB_perm,
+							   featureA, featureB,
+							   hA_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+							   matrixAB_perm, matrixBA_perm, signsB_perm, scalesB_perm, false );
+
+			if ( !done ) {
+				VertexAFaceBTests( done, minDistSqr, localPointA_perm, localPointB_perm,
+								   featureA, featureB,
+								   hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+								   matrixAB_perm, matrixBA_perm, signsA_perm, scalesA_perm, false );
+			}
+		}
+	} else if ( axisType == B_AXIS ) {
+		VertexAFaceBTests( done, minDistSqr, localPointA_perm, localPointB_perm,
+						   featureA, featureB,
+						   hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+						   matrixAB_perm, matrixBA_perm, signsA_perm, scalesA_perm, true );
+
+		if ( !done ) {
+			VertexBFaceATests( done, minDistSqr, localPointA_perm, localPointB_perm,
+							   featureA, featureB,
+							   hA_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+							   matrixAB_perm, matrixBA_perm, signsB_perm, scalesB_perm, false );
+
+			if ( !done ) {
+				EdgeEdgeTests( done, minDistSqr, localPointA_perm, localPointB_perm,
+							   otherFaceDimA, otherFaceDimB, featureA, featureB,
+							   hA_perm, hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+							   matrixAB_perm, matrixBA_perm, signsA_perm, signsB_perm,
+							   scalesA_perm, scalesB_perm, false );
+			}
+		}
+	} else {
+		VertexBFaceATests( done, minDistSqr, localPointA_perm, localPointB_perm,
+						   featureA, featureB,
+						   hA_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+						   matrixAB_perm, matrixBA_perm, signsB_perm, scalesB_perm, true );
+
+		if ( !done ) {
+			VertexAFaceBTests( done, minDistSqr, localPointA_perm, localPointB_perm,
+							   featureA, featureB,
+							   hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+							   matrixAB_perm, matrixBA_perm, signsA_perm, scalesA_perm, false );
+
+			if ( !done ) {
+				EdgeEdgeTests( done, minDistSqr, localPointA_perm, localPointB_perm,
+							   otherFaceDimA, otherFaceDimB, featureA, featureB,
+							   hA_perm, hB_perm, faceOffsetAB_perm, faceOffsetBA_perm,
+							   matrixAB_perm, matrixBA_perm, signsA_perm, signsB_perm,
+							   scalesA_perm, scalesB_perm, false );
+			}
+		}
+	}
+
+	// convert local points from face-local to box-local coordinate system
+
+	
+	boxPointA.localPoint = vmPoint3( aperm_col * vmVector3( localPointA_perm )) ;
+	boxPointB.localPoint = vmPoint3( bperm_col * vmVector3( localPointB_perm )) ;
+
+#if 0
+	// find which features of the boxes are involved.
+	// the only feature pairs which occur in this function are VF, FV, and EE, even though the
+	// closest points might actually lie on sub-features, as in a VF contact might be used for
+	// what's actually a VV contact.  this means some feature pairs could possibly seem distinct
+	// from others, although their contact positions are the same.  don't know yet whether this
+	// matters.
+
+	int sA[3], sB[3];
+
+	sA[0] = boxPointA.localPoint.getX() > 0.0f;
+	sA[1] = boxPointA.localPoint.getY() > 0.0f;
+	sA[2] = boxPointA.localPoint.getZ() > 0.0f;
+
+	sB[0] = boxPointB.localPoint.getX() > 0.0f;
+	sB[1] = boxPointB.localPoint.getY() > 0.0f;
+	sB[2] = boxPointB.localPoint.getZ() > 0.0f;
+
+	if ( featureA == F ) {
+		boxPointA.setFaceFeature( dimA[2], sA[dimA[2]] );
+	} else if ( featureA == E ) {
+		boxPointA.setEdgeFeature( dimA[2], sA[dimA[2]], dimA[otherFaceDimA], sA[dimA[otherFaceDimA]] );
+	} else {
+		boxPointA.setVertexFeature( sA[0], sA[1], sA[2] );
+	}
+
+	if ( featureB == F ) {
+		boxPointB.setFaceFeature( dimB[2], sB[dimB[2]] );
+	} else if ( featureB == E ) {
+		boxPointB.setEdgeFeature( dimB[2], sB[dimB[2]], dimB[otherFaceDimB], sB[dimB[otherFaceDimB]] );
+	} else {
+		boxPointB.setVertexFeature( sB[0], sB[1], sB[2] );
+	}
+#endif
+
+	normal = transformA * axisA;
+
+	if ( maxGap < 0.0f ) {
+		return (maxGap);
+	} else {
+		return (sqrtf( minDistSqr ));
+	}
+}
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h
new file mode 100644
index 0000000..0d4957d
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h
@@ -0,0 +1,65 @@
+/*
+   Copyright (C) 2006, 2008 Sony Computer Entertainment Inc.
+   All rights reserved.
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+*/
+
+
+#ifndef __BOXBOXDISTANCE_H__
+#define __BOXBOXDISTANCE_H__
+
+
+#include "Box.h"
+
+
+//---------------------------------------------------------------------------
+// boxBoxDistance:
+//
+// description:
+//    this computes info that can be used for the collision response of two boxes.  when the boxes
+//    do not overlap, the points are set to the closest points of the boxes, and a positive
+//    distance between them is returned.  if the boxes do overlap, a negative distance is returned
+//    and the points are set to two points that would touch after the boxes are translated apart.
+//    the contact normal gives the direction to repel or separate the boxes when they touch or
+//    overlap (it's being approximated here as one of the 15 "separating axis" directions).
+//
+// returns:
+//    positive or negative distance between two boxes.
+//
+// args:
+//    vmVector3& normal: set to a unit contact normal pointing from box A to box B.
+//
+//    BoxPoint& boxPointA, BoxPoint& boxPointB:
+//       set to a closest point or point of penetration on each box.
+//
+//    Box boxA, Box boxB:
+//       boxes, represented as 3 half-widths
+//
+//    const vmTransform3& transformA, const vmTransform3& transformB:
+//       box transformations, in world coordinates
+//
+//    float distanceThreshold:
+//       the algorithm will exit early if it finds that the boxes are more distant than this
+//       threshold, and not compute a contact normal or points.  if this distance returned
+//       exceeds the threshold, all the other output data may not have been computed.  by
+//       default, this is set to MAX_FLOAT so it will have no effect.
+//
+//---------------------------------------------------------------------------
+
+float
+boxBoxDistance(vmVector3& normal, BoxPoint& boxPointA, BoxPoint& boxPointB,
+			   PE_REF(Box) boxA, const vmTransform3 & transformA, PE_REF(Box) boxB,
+			   const vmTransform3 & transformB,
+			   float distanceThreshold = FLT_MAX );
+
+#endif /* __BOXBOXDISTANCE_H__ */
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp
new file mode 100644
index 0000000..fe61955
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp
@@ -0,0 +1,214 @@
+/*
+Bullet Continuous Collision Detection and Physics Library, Copyright (c) 2007 Erwin Coumans
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+*/
+
+
+#include "SpuSampleTask.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+#include "../PlatformDefinitions.h"
+#include "../SpuFakeDma.h"
+#include "LinearMath/btMinMax.h"
+
+#ifdef __SPU__
+#include <spu_printf.h>
+#else
+#include <stdio.h>
+#define spu_printf printf
+#endif
+
+#define MAX_NUM_BODIES 8192
+
+struct SampleTask_LocalStoreMemory
+{
+	ATTRIBUTE_ALIGNED16(char gLocalRigidBody [sizeof(btRigidBody)+16]);
+	ATTRIBUTE_ALIGNED16(void* gPointerArray[MAX_NUM_BODIES]);
+
+};
+
+
+
+
+//-- MAIN METHOD
+void processSampleTask(void* userPtr, void* lsMemory)
+{
+	//	BT_PROFILE("processSampleTask");
+
+	SampleTask_LocalStoreMemory* localMemory = (SampleTask_LocalStoreMemory*)lsMemory;
+
+	SpuSampleTaskDesc* taskDescPtr = (SpuSampleTaskDesc*)userPtr;
+	SpuSampleTaskDesc& taskDesc = *taskDescPtr;
+
+	switch (taskDesc.m_sampleCommand)
+	{
+	case CMD_SAMPLE_INTEGRATE_BODIES:
+		{
+			btTransform predictedTrans;
+			btCollisionObject** eaPtr = (btCollisionObject**)taskDesc.m_mainMemoryPtr;
+
+			int batchSize = taskDesc.m_sampleValue;
+			if (batchSize>MAX_NUM_BODIES)
+			{
+				spu_printf("SPU Error: exceed number of bodies, see MAX_NUM_BODIES in SpuSampleTask.cpp\n");
+				break;
+			}
+			int dmaArraySize = batchSize*sizeof(void*);
+
+			uint64_t ppuArrayAddress = reinterpret_cast<uint64_t>(eaPtr);
+
+			//			spu_printf("array location is at %llx, batchSize = %d, DMA size = %d\n",ppuArrayAddress,batchSize,dmaArraySize);
+
+			if (dmaArraySize>=16)
+			{
+				cellDmaLargeGet((void*)&localMemory->gPointerArray[0], ppuArrayAddress  , dmaArraySize, DMA_TAG(1), 0, 0);	
+				cellDmaWaitTagStatusAll(DMA_MASK(1));
+			} else
+			{
+				stallingUnalignedDmaSmallGet((void*)&localMemory->gPointerArray[0], ppuArrayAddress  , dmaArraySize);
+			}
+
+
+			for ( int i=0;i<batchSize;i++)
+			{
+				///DMA rigid body
+
+				void* localPtr = &localMemory->gLocalRigidBody[0];
+				void* shortAdd = localMemory->gPointerArray[i];
+				uint64_t ppuRigidBodyAddress = reinterpret_cast<uint64_t>(shortAdd);
+
+				//	spu_printf("cellDmaGet at CMD_SAMPLE_INTEGRATE_BODIES from %llx to %llx\n",ppuRigidBodyAddress,localPtr);
+
+				int dmaBodySize = sizeof(btRigidBody);
+
+				cellDmaGet((void*)localPtr, ppuRigidBodyAddress  , dmaBodySize, DMA_TAG(1), 0, 0);	
+				cellDmaWaitTagStatusAll(DMA_MASK(1));
+
+
+				float timeStep = 1.f/60.f;
+
+				btRigidBody* body = (btRigidBody*) localPtr;//btRigidBody::upcast(colObj);
+				if (body)
+				{
+					if (body->isActive() && (!body->isStaticOrKinematicObject()))
+					{
+						body->predictIntegratedTransform(timeStep, predictedTrans);
+						body->proceedToTransform( predictedTrans);
+						void* ptr = (void*)localPtr;
+						//	spu_printf("cellDmaLargePut from %llx to LS %llx\n",ptr,ppuRigidBodyAddress);
+
+						cellDmaLargePut(ptr, ppuRigidBodyAddress  , dmaBodySize, DMA_TAG(1), 0, 0);
+						cellDmaWaitTagStatusAll(DMA_MASK(1));
+
+					}
+				}
+
+			}
+			break;
+		}
+
+
+	case CMD_SAMPLE_PREDICT_MOTION_BODIES:
+		{
+			btTransform predictedTrans;
+			btCollisionObject** eaPtr = (btCollisionObject**)taskDesc.m_mainMemoryPtr;
+
+			int batchSize = taskDesc.m_sampleValue;
+			int dmaArraySize = batchSize*sizeof(void*);
+
+			if (batchSize>MAX_NUM_BODIES)
+			{
+				spu_printf("SPU Error: exceed number of bodies, see MAX_NUM_BODIES in SpuSampleTask.cpp\n");
+				break;
+			}
+
+			uint64_t ppuArrayAddress = reinterpret_cast<uint64_t>(eaPtr);
+
+			//			spu_printf("array location is at %llx, batchSize = %d, DMA size = %d\n",ppuArrayAddress,batchSize,dmaArraySize);
+
+			if (dmaArraySize>=16)
+			{
+				cellDmaLargeGet((void*)&localMemory->gPointerArray[0], ppuArrayAddress  , dmaArraySize, DMA_TAG(1), 0, 0);	
+				cellDmaWaitTagStatusAll(DMA_MASK(1));
+			} else
+			{
+				stallingUnalignedDmaSmallGet((void*)&localMemory->gPointerArray[0], ppuArrayAddress  , dmaArraySize);
+			}
+
+
+			for ( int i=0;i<batchSize;i++)
+			{
+				///DMA rigid body
+
+				void* localPtr = &localMemory->gLocalRigidBody[0];
+				void* shortAdd = localMemory->gPointerArray[i];
+				uint64_t ppuRigidBodyAddress = reinterpret_cast<uint64_t>(shortAdd);
+
+				//	spu_printf("cellDmaGet at CMD_SAMPLE_INTEGRATE_BODIES from %llx to %llx\n",ppuRigidBodyAddress,localPtr);
+
+				int dmaBodySize = sizeof(btRigidBody);
+
+				cellDmaGet((void*)localPtr, ppuRigidBodyAddress  , dmaBodySize, DMA_TAG(1), 0, 0);	
+				cellDmaWaitTagStatusAll(DMA_MASK(1));
+
+
+				float timeStep = 1.f/60.f;
+
+				btRigidBody* body = (btRigidBody*) localPtr;//btRigidBody::upcast(colObj);
+				if (body)
+				{
+					if (!body->isStaticOrKinematicObject())
+					{
+						if (body->isActive())
+						{
+							body->integrateVelocities( timeStep);
+							//damping
+							body->applyDamping(timeStep);
+
+							body->predictIntegratedTransform(timeStep,body->getInterpolationWorldTransform());
+
+							void* ptr = (void*)localPtr;
+							cellDmaLargePut(ptr, ppuRigidBodyAddress  , dmaBodySize, DMA_TAG(1), 0, 0);
+							cellDmaWaitTagStatusAll(DMA_MASK(1));
+						}
+					}
+				}
+
+			}
+			break;
+		}
+	
+
+
+	default:
+		{
+
+		}
+	};
+}
+
+
+#if defined(__CELLOS_LV2__) || defined (LIBSPE2)
+
+ATTRIBUTE_ALIGNED16(SampleTask_LocalStoreMemory	gLocalStoreMemory);
+
+void* createSampleLocalStoreMemory()
+{
+	return &gLocalStoreMemory;
+}
+#else
+void* createSampleLocalStoreMemory()
+{
+	return new SampleTask_LocalStoreMemory;
+};
+
+#endif
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h
new file mode 100644
index 0000000..c8ebdfd
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h
@@ -0,0 +1,54 @@
+/*
+Bullet Continuous Collision Detection and Physics Library, Copyright (c) 2007 Erwin Coumans
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+*/
+
+#ifndef SPU_SAMPLE_TASK_H
+#define SPU_SAMPLE_TASK_H
+
+#include "../PlatformDefinitions.h"
+#include "LinearMath/btScalar.h"
+#include "LinearMath/btVector3.h"
+#include "LinearMath/btMatrix3x3.h"
+
+#include "LinearMath/btAlignedAllocator.h"
+
+
+enum
+{
+	CMD_SAMPLE_INTEGRATE_BODIES = 1,
+	CMD_SAMPLE_PREDICT_MOTION_BODIES
+};
+
+
+
+ATTRIBUTE_ALIGNED16(struct) SpuSampleTaskDesc
+{
+	BT_DECLARE_ALIGNED_ALLOCATOR();
+
+	uint32_t						m_sampleCommand;
+	uint32_t						m_taskId;
+
+	uint64_t 	m_mainMemoryPtr;
+	int			m_sampleValue;
+	
+
+};
+
+
+void	processSampleTask(void* userPtr, void* lsMemory);
+void*	createSampleLocalStoreMemory();
+
+
+#endif //SPU_SAMPLE_TASK_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.cpp b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.cpp
new file mode 100644
index 0000000..11cb9e7
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.cpp
@@ -0,0 +1,222 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+//#define __CELLOS_LV2__ 1
+
+#define USE_SAMPLE_PROCESS 1
+#ifdef USE_SAMPLE_PROCESS
+
+
+#include "SpuSampleTaskProcess.h"
+#include <stdio.h>
+
+#ifdef __SPU__
+
+
+
+void	SampleThreadFunc(void* userPtr,void* lsMemory)
+{
+	//do nothing
+	printf("hello world\n");
+}
+
+
+void*	SamplelsMemoryFunc()
+{
+	//don't create local store memory, just return 0
+	return 0;
+}
+
+
+#else
+
+
+#include "btThreadSupportInterface.h"
+
+//#	include "SPUAssert.h"
+#include <string.h>
+
+
+
+extern "C" {
+	extern char SPU_SAMPLE_ELF_SYMBOL[];
+}
+
+
+
+
+
+SpuSampleTaskProcess::SpuSampleTaskProcess(btThreadSupportInterface*	threadInterface,  int maxNumOutstandingTasks)
+:m_threadInterface(threadInterface),
+m_maxNumOutstandingTasks(maxNumOutstandingTasks)
+{
+
+	m_taskBusy.resize(m_maxNumOutstandingTasks);
+	m_spuSampleTaskDesc.resize(m_maxNumOutstandingTasks);
+
+	for (int i = 0; i < m_maxNumOutstandingTasks; i++)
+	{
+		m_taskBusy[i] = false;
+	}
+	m_numBusyTasks = 0;
+	m_currentTask = 0;
+
+	m_initialized = false;
+
+	m_threadInterface->startSPU();
+
+
+}
+
+SpuSampleTaskProcess::~SpuSampleTaskProcess()
+{
+	m_threadInterface->stopSPU();
+	
+}
+
+
+
+void	SpuSampleTaskProcess::initialize()
+{
+#ifdef DEBUG_SPU_TASK_SCHEDULING
+	printf("SpuSampleTaskProcess::initialize()\n");
+#endif //DEBUG_SPU_TASK_SCHEDULING
+	
+	for (int i = 0; i < m_maxNumOutstandingTasks; i++)
+	{
+		m_taskBusy[i] = false;
+	}
+	m_numBusyTasks = 0;
+	m_currentTask = 0;
+	m_initialized = true;
+
+}
+
+
+void SpuSampleTaskProcess::issueTask(void* sampleMainMemPtr,int sampleValue,int sampleCommand)
+{
+
+#ifdef DEBUG_SPU_TASK_SCHEDULING
+	printf("SpuSampleTaskProcess::issueTask (m_currentTask= %d\)n", m_currentTask);
+#endif //DEBUG_SPU_TASK_SCHEDULING
+
+	m_taskBusy[m_currentTask] = true;
+	m_numBusyTasks++;
+
+	SpuSampleTaskDesc& taskDesc = m_spuSampleTaskDesc[m_currentTask];
+	{
+		// send task description in event message
+		// no error checking here...
+		// but, currently, event queue can be no larger than NUM_WORKUNIT_TASKS.
+	
+		taskDesc.m_mainMemoryPtr = reinterpret_cast<uint64_t>(sampleMainMemPtr);
+		taskDesc.m_sampleValue = sampleValue;
+		taskDesc.m_sampleCommand = sampleCommand;
+
+		//some bookkeeping to recognize finished tasks
+		taskDesc.m_taskId = m_currentTask;
+	}
+
+
+	m_threadInterface->sendRequest(1, (ppu_address_t) &taskDesc, m_currentTask);
+
+	// if all tasks busy, wait for spu event to clear the task.
+	
+	if (m_numBusyTasks >= m_maxNumOutstandingTasks)
+	{
+		unsigned int taskId;
+		unsigned int outputSize;
+
+		for (int i=0;i<m_maxNumOutstandingTasks;i++)
+	  {
+		  if (m_taskBusy[i])
+		  {
+			  taskId = i;
+			  break;
+		  }
+	  }
+		m_threadInterface->waitForResponse(&taskId, &outputSize);
+
+		//printf("PPU: after issue, received event: %u %d\n", taskId, outputSize);
+
+		postProcess(taskId, outputSize);
+
+		m_taskBusy[taskId] = false;
+
+		m_numBusyTasks--;
+	}
+
+	// find new task buffer
+	for (int i = 0; i < m_maxNumOutstandingTasks; i++)
+	{
+		if (!m_taskBusy[i])
+		{
+			m_currentTask = i;
+			break;
+		}
+	}
+}
+
+
+///Optional PPU-size post processing for each task
+void SpuSampleTaskProcess::postProcess(int taskId, int outputSize)
+{
+
+}
+
+
+void SpuSampleTaskProcess::flush()
+{
+#ifdef DEBUG_SPU_TASK_SCHEDULING
+	printf("\nSpuCollisionTaskProcess::flush()\n");
+#endif //DEBUG_SPU_TASK_SCHEDULING
+	
+
+	// all tasks are issued, wait for all tasks to be complete
+	while(m_numBusyTasks > 0)
+	{
+// Consolidating SPU code
+	  unsigned int taskId;
+	  unsigned int outputSize;
+	  
+	  for (int i=0;i<m_maxNumOutstandingTasks;i++)
+	  {
+		  if (m_taskBusy[i])
+		  {
+			  taskId = i;
+			  break;
+		  }
+	  }
+	  {
+			
+		  m_threadInterface->waitForResponse(&taskId, &outputSize);
+	  }
+
+		//printf("PPU: flushing, received event: %u %d\n", taskId, outputSize);
+
+		postProcess(taskId, outputSize);
+
+		m_taskBusy[taskId] = false;
+
+		m_numBusyTasks--;
+	}
+
+
+}
+
+#endif
+
+
+#endif //USE_SAMPLE_PROCESS
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.h
new file mode 100644
index 0000000..6173225
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuSampleTaskProcess.h
@@ -0,0 +1,153 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SPU_SAMPLE_TASK_PROCESS_H
+#define BT_SPU_SAMPLE_TASK_PROCESS_H
+
+#include <assert.h>
+
+
+#include "PlatformDefinitions.h"
+
+#include <stdlib.h>
+
+#include "LinearMath/btAlignedObjectArray.h"
+
+
+#include "SpuSampleTask/SpuSampleTask.h"
+
+
+//just add your commands here, try to keep them globally unique for debugging purposes
+#define CMD_SAMPLE_TASK_COMMAND 10
+
+
+
+/// SpuSampleTaskProcess handles SPU processing of collision pairs.
+/// When PPU issues a task, it will look for completed task buffers
+/// PPU will do postprocessing, dependent on workunit output (not likely)
+class SpuSampleTaskProcess
+{
+	// track task buffers that are being used, and total busy tasks
+	btAlignedObjectArray<bool>	m_taskBusy;
+	btAlignedObjectArray<SpuSampleTaskDesc>m_spuSampleTaskDesc;
+	
+	int   m_numBusyTasks;
+
+	// the current task and the current entry to insert a new work unit
+	int   m_currentTask;
+
+	bool m_initialized;
+
+	void postProcess(int taskId, int outputSize);
+	
+	class	btThreadSupportInterface*	m_threadInterface;
+
+	int	m_maxNumOutstandingTasks;
+
+
+
+public:
+	SpuSampleTaskProcess(btThreadSupportInterface*	threadInterface, int maxNumOutstandingTasks);
+	
+	~SpuSampleTaskProcess();
+	
+	///call initialize in the beginning of the frame, before addCollisionPairToTask
+	void initialize();
+
+	void issueTask(void* sampleMainMemPtr,int sampleValue,int sampleCommand);
+
+	///call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished
+	void flush();
+};
+
+
+#if defined(USE_LIBSPE2) && defined(__SPU__)
+////////////////////MAIN/////////////////////////////
+#include "../SpuLibspe2Support.h"
+#include <spu_intrinsics.h>
+#include <spu_mfcio.h>
+#include <SpuFakeDma.h>
+
+void * SamplelsMemoryFunc();
+void SampleThreadFunc(void* userPtr,void* lsMemory);
+
+//#define DEBUG_LIBSPE2_MAINLOOP
+
+int main(unsigned long long speid, addr64 argp, addr64 envp)
+{
+	printf("SPU is up \n");
+	
+	ATTRIBUTE_ALIGNED128(btSpuStatus status);
+	ATTRIBUTE_ALIGNED16( SpuSampleTaskDesc taskDesc ) ;
+	unsigned int received_message = Spu_Mailbox_Event_Nothing;
+        bool shutdown = false;
+
+	cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
+	cellDmaWaitTagStatusAll(DMA_MASK(3));
+
+	status.m_status = Spu_Status_Free;
+	status.m_lsMemory.p = SamplelsMemoryFunc();
+
+	cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
+	cellDmaWaitTagStatusAll(DMA_MASK(3));
+	
+	
+	while (!shutdown)
+	{
+		received_message = spu_read_in_mbox();
+		
+
+		
+		switch(received_message)
+		{
+		case Spu_Mailbox_Event_Shutdown:
+			shutdown = true;
+			break; 
+		case Spu_Mailbox_Event_Task:
+			// refresh the status
+#ifdef DEBUG_LIBSPE2_MAINLOOP
+			printf("SPU recieved Task \n");
+#endif //DEBUG_LIBSPE2_MAINLOOP
+			cellDmaGet(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
+			cellDmaWaitTagStatusAll(DMA_MASK(3));
+		
+			btAssert(status.m_status==Spu_Status_Occupied);
+			
+			cellDmaGet(&taskDesc, status.m_taskDesc.p, sizeof(SpuSampleTaskDesc), DMA_TAG(3), 0, 0);
+			cellDmaWaitTagStatusAll(DMA_MASK(3));
+			
+			SampleThreadFunc((void*)&taskDesc, reinterpret_cast<void*> (taskDesc.m_mainMemoryPtr) );
+			break;
+		case Spu_Mailbox_Event_Nothing:
+		default:
+			break;
+		}
+
+		// set to status free and wait for next task
+		status.m_status = Spu_Status_Free;
+		cellDmaLargePut(&status, argp.ull, sizeof(btSpuStatus), DMA_TAG(3), 0, 0);
+		cellDmaWaitTagStatusAll(DMA_MASK(3));		
+				
+		
+  	}
+  	return 0;
+}
+//////////////////////////////////////////////////////
+#endif
+
+
+
+#endif // BT_SPU_SAMPLE_TASK_PROCESS_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h b/hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h
new file mode 100644
index 0000000..4157b8f
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/SpuSync.h
@@ -0,0 +1,149 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2007 Starbreeze Studios
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Written by: Marten Svanfeldt
+*/
+
+#ifndef BT_SPU_SYNC_H
+#define	BT_SPU_SYNC_H
+
+
+#include "PlatformDefinitions.h"
+
+
+#if defined(WIN32)
+
+#define WIN32_LEAN_AND_MEAN
+#ifdef _XBOX
+#include <Xtl.h>
+#else
+#include <Windows.h>
+#endif
+
+///The btSpinlock is a structure to allow multi-platform synchronization. This allows to port the SPU tasks to other platforms.
+class btSpinlock
+{
+public:
+	//typedef volatile LONG SpinVariable;
+	typedef CRITICAL_SECTION SpinVariable;
+
+	btSpinlock (SpinVariable* var)
+		: spinVariable (var)
+	{}
+
+	void Init ()
+	{
+		//*spinVariable = 0;
+		InitializeCriticalSection(spinVariable);
+	}
+
+	void Lock ()
+	{
+		EnterCriticalSection(spinVariable);
+	}
+
+	void Unlock ()
+	{
+		LeaveCriticalSection(spinVariable);
+	}
+
+private:
+	SpinVariable* spinVariable;
+};
+
+
+#elif defined (__CELLOS_LV2__)
+
+//#include <cell/atomic.h>
+#include <cell/sync/mutex.h>
+
+///The btSpinlock is a structure to allow multi-platform synchronization. This allows to port the SPU tasks to other platforms.
+class btSpinlock
+{
+public:
+	typedef CellSyncMutex SpinVariable;
+
+	btSpinlock (SpinVariable* var)
+		: spinVariable (var)
+	{}
+
+	void Init ()
+	{
+#ifndef __SPU__
+		//*spinVariable = 1;
+		cellSyncMutexInitialize(spinVariable);
+#endif
+	}
+
+
+
+	void Lock ()
+	{
+#ifdef __SPU__
+		// lock semaphore
+		/*while (cellAtomicTestAndDecr32(atomic_buf, (uint64_t)spinVariable) == 0) 
+		{
+
+		};*/
+		cellSyncMutexLock((uint64_t)spinVariable);
+#endif
+	}
+
+	void Unlock ()
+	{
+#ifdef __SPU__
+		//cellAtomicIncr32(atomic_buf, (uint64_t)spinVariable);
+		cellSyncMutexUnlock((uint64_t)spinVariable);
+#endif 
+	}
+
+
+private:
+	SpinVariable*	spinVariable;
+	ATTRIBUTE_ALIGNED128(uint32_t		atomic_buf[32]);
+};
+
+#else
+//create a dummy implementation (without any locking) useful for serial processing
+class btSpinlock
+{
+public:
+	typedef int  SpinVariable;
+
+	btSpinlock (SpinVariable* var)
+		: spinVariable (var)
+	{}
+
+	void Init ()
+	{
+	}
+
+	void Lock ()
+	{
+	}
+
+	void Unlock ()
+	{
+	}
+
+private:
+	SpinVariable* spinVariable;
+};
+
+
+#endif
+
+
+#endif //BT_SPU_SYNC_H
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h b/hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h
new file mode 100644
index 0000000..4d14212
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/TrbDynBody.h
@@ -0,0 +1,79 @@
+/*
+   Copyright (C) 2009 Sony Computer Entertainment Inc.
+   All rights reserved.
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+*/
+
+#ifndef BT_RB_DYN_BODY_H__
+#define BT_RB_DYN_BODY_H__
+
+#include "vectormath/vmInclude.h"
+using namespace Vectormath::Aos;
+
+#include "TrbStateVec.h"
+
+class CollObject;
+
+class TrbDynBody
+{
+public:
+	TrbDynBody()
+	{
+		fMass   = 0.0f;
+		fCollObject = NULL;
+		fElasticity = 0.2f;
+		fFriction = 0.8f;
+	}
+
+	// Get methods
+	float          getMass() const {return fMass;};
+	float          getElasticity() const {return fElasticity;}
+	float          getFriction() const {return fFriction;}
+	CollObject*    getCollObject() const {return fCollObject;}
+	const Matrix3 &getBodyInertia() const {return fIBody;}
+	const Matrix3 &getBodyInertiaInv() const {return fIBodyInv;}
+	float          getMassInv() const {return fMassInv;}
+
+	// Set methods
+	void           setMass(float mass) {fMass=mass;fMassInv=mass>0.0f?1.0f/mass:0.0f;}
+	void           setBodyInertia(const Matrix3 bodyInertia) {fIBody = bodyInertia;fIBodyInv = inverse(bodyInertia);}
+	void           setElasticity(float elasticity) {fElasticity = elasticity;}
+	void           setFriction(float friction) {fFriction = friction;}
+	void           setCollObject(CollObject *collObj) {fCollObject = collObj;}
+	
+	void           setBodyInertiaInv(const Matrix3 bodyInertiaInv) 
+	{
+		fIBody = inverse(bodyInertiaInv);
+		fIBodyInv = bodyInertiaInv;
+	}
+	void           setMassInv(float invMass) {
+		fMass= invMass>0.0f ? 1.0f/invMass :0.0f;
+		fMassInv=invMass;
+	}
+
+
+private:
+	// Rigid Body constants
+	float          fMass;        // Rigid Body mass
+	float          fMassInv;     // Inverse of mass
+	Matrix3        fIBody;       // Inertia matrix in body's coords
+	Matrix3        fIBodyInv;    // Inertia matrix inverse in body's coords
+	float          fElasticity;  // Coefficient of restitution
+	float          fFriction;    // Coefficient of friction
+
+public:
+	CollObject*    fCollObject;  // Collision object corresponding the RB
+} __attribute__ ((aligned(16)));
+
+#endif //BT_RB_DYN_BODY_H__
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h b/hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h
new file mode 100644
index 0000000..46d1904
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/TrbStateVec.h
@@ -0,0 +1,339 @@
+/*
+   Copyright (C) 2009 Sony Computer Entertainment Inc.
+   All rights reserved.
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+*/
+
+#ifndef BT_TRBSTATEVEC_H__
+#define BT_TRBSTATEVEC_H__
+
+#include <stdlib.h>
+#ifdef PFX_USE_FREE_VECTORMATH
+#include "vecmath/vmInclude.h"
+#else
+#include "vectormath/vmInclude.h"
+#endif //PFX_USE_FREE_VECTORMATH
+
+
+#include "PlatformDefinitions.h"
+
+
+static inline vmVector3 read_Vector3(const float* p)
+{
+	vmVector3 v;
+	loadXYZ(v, p);
+	return v;
+}
+
+static inline vmQuat read_Quat(const float* p)
+{
+	vmQuat vq;
+	loadXYZW(vq, p);
+	return vq;
+}
+
+static inline void store_Vector3(const vmVector3 &src, float* p)
+{
+	vmVector3 v = src;
+	storeXYZ(v, p);
+}
+
+static inline void store_Quat(const vmQuat &src, float* p)
+{
+	vmQuat vq = src;
+	storeXYZW(vq, p);
+}
+
+// Motion Type
+enum {
+	PfxMotionTypeFixed = 0,
+	PfxMotionTypeActive,
+	PfxMotionTypeKeyframe,
+	PfxMotionTypeOneWay,
+	PfxMotionTypeTrigger,
+	PfxMotionTypeCount
+};
+
+#define PFX_MOTION_MASK_DYNAMIC 0x0a // Active,OneWay
+#define PFX_MOTION_MASK_STATIC  0x95 // Fixed,Keyframe,Trigger,Sleeping
+#define PFX_MOTION_MASK_SLEEP   0x0e // Can sleep
+#define PFX_MOTION_MASK_TYPE    0x7f
+
+//
+// Rigid Body state
+//
+
+#ifdef __CELLOS_LV2__
+ATTRIBUTE_ALIGNED128(class) TrbState
+#else
+ATTRIBUTE_ALIGNED16(class) TrbState
+#endif
+
+{
+public:
+	TrbState()
+	{
+		setMotionType(PfxMotionTypeActive);
+		contactFilterSelf=contactFilterTarget=0xffffffff;
+		deleted = 0;
+		mSleeping = 0;
+		useSleep = 1;
+		trbBodyIdx=0;
+		mSleepCount=0;
+		useCcd = 0;
+		useContactCallback = 0;
+		useSleepCallback = 0;
+		linearDamping = 1.0f;
+		angularDamping = 0.99f;
+	}
+
+	TrbState(const uint8_t m, const vmVector3& x, const vmQuat& q, const vmVector3& v, const vmVector3& omega );
+	
+	uint16_t	mSleepCount;
+	uint8_t		mMotionType;
+	uint8_t		deleted            : 1;
+	uint8_t		mSleeping           : 1;
+	uint8_t		useSleep           : 1;
+	uint8_t		useCcd		       : 1;
+	uint8_t		useContactCallback : 1;
+	uint8_t		useSleepCallback   : 1;
+
+	uint16_t	trbBodyIdx;
+	uint32_t	contactFilterSelf;
+	uint32_t	contactFilterTarget;
+
+	float		center[3];		// AABB center(World)
+	float		half[3];		// AABB half(World)
+
+	float		linearDamping;
+	float		angularDamping;
+	
+	float		deltaLinearVelocity[3];
+	float		deltaAngularVelocity[3];
+
+	float     fX[3];				// position
+	float     fQ[4];				// orientation
+	float     fV[3];				// velocity
+	float     fOmega[3];			// angular velocity
+
+	inline void setZero();      // Zeroes out the elements
+	inline void setIdentity();  // Sets the rotation to identity and zeroes out the other elements
+
+	bool		isDeleted() const {return deleted==1;}
+
+	uint16_t	getRigidBodyId() const {return trbBodyIdx;}
+	void		setRigidBodyId(uint16_t i) {trbBodyIdx = i;}
+
+
+	uint32_t	getContactFilterSelf() const {return contactFilterSelf;}
+	void		setContactFilterSelf(uint32_t filter) {contactFilterSelf = filter;}
+
+	uint32_t	getContactFilterTarget() const {return contactFilterTarget;}
+	void		setContactFilterTarget(uint32_t filter) {contactFilterTarget = filter;}
+
+	float getLinearDamping() const {return linearDamping;}
+	float getAngularDamping() const {return angularDamping;}
+
+	void setLinearDamping(float damping) {linearDamping=damping;}
+	void setAngularDamping(float damping) {angularDamping=damping;}
+
+
+	uint8_t		getMotionType() const {return mMotionType;}
+	void		setMotionType(uint8_t t) {mMotionType = t;mSleeping=0;mSleepCount=0;}
+
+	uint8_t		getMotionMask() const {return (1<<mMotionType)|(mSleeping<<7);}
+
+	bool		isAsleep() const {return mSleeping==1;}
+	bool		isAwake() const {return mSleeping==0;}
+
+	void		wakeup() {mSleeping=0;mSleepCount=0;}
+	void		sleep() {if(useSleep) {mSleeping=1;mSleepCount=0;}}
+
+	uint8_t		getUseSleep() const {return useSleep;}
+	void		setUseSleep(uint8_t b) {useSleep=b;}
+
+	uint8_t		getUseCcd() const {return useCcd;}
+	void		setUseCcd(uint8_t b) {useCcd=b;}
+
+	uint8_t		getUseContactCallback() const {return useContactCallback;}
+	void		setUseContactCallback(uint8_t b) {useContactCallback=b;}
+
+	uint8_t		getUseSleepCallback() const {return useSleepCallback;}
+	void		setUseSleepCallback(uint8_t b) {useSleepCallback=b;}
+
+	void	 	incrementSleepCount() {mSleepCount++;}
+	void		resetSleepCount() {mSleepCount=0;}
+	uint16_t	getSleepCount() const {return mSleepCount;}
+
+	vmVector3 getPosition() const {return read_Vector3(fX);}
+	vmQuat    getOrientation() const {return read_Quat(fQ);}
+	vmVector3 getLinearVelocity() const {return read_Vector3(fV);}
+	vmVector3 getAngularVelocity() const {return read_Vector3(fOmega);}
+	vmVector3 getDeltaLinearVelocity() const {return read_Vector3(deltaLinearVelocity);}
+	vmVector3 getDeltaAngularVelocity() const {return read_Vector3(deltaAngularVelocity);}
+
+	void setPosition(const vmVector3 &pos) {store_Vector3(pos, fX);}
+	void setLinearVelocity(const vmVector3 &vel) {store_Vector3(vel, fV);}
+	void setAngularVelocity(const vmVector3 &vel) {store_Vector3(vel, fOmega);}
+	void setDeltaLinearVelocity(const vmVector3 &vel) {store_Vector3(vel, deltaLinearVelocity);}
+	void setDeltaAngularVelocity(const vmVector3 &vel) {store_Vector3(vel, deltaAngularVelocity);}
+	void setOrientation(const vmQuat &rot) {store_Quat(rot, fQ);}
+
+	inline void setAuxils(const vmVector3 &centerLocal,const vmVector3 &halfLocal);
+	inline void	setAuxilsCcd(const vmVector3 &centerLocal,const vmVector3 &halfLocal,float timeStep);
+	inline	void reset();
+};
+
+inline
+TrbState::TrbState(const uint8_t m, const vmVector3& x, const vmQuat& q, const vmVector3& v, const vmVector3& omega)
+{
+	setMotionType(m);
+	fX[0] = x[0];
+	fX[1] = x[1];
+	fX[2] = x[2];
+	fQ[0] = q[0];
+	fQ[1] = q[1];
+	fQ[2] = q[2];
+	fQ[3] = q[3];
+	fV[0] = v[0];
+	fV[1] = v[1];
+	fV[2] = v[2];
+	fOmega[0] = omega[0];
+	fOmega[1] = omega[1];
+	fOmega[2] = omega[2];
+	contactFilterSelf=contactFilterTarget=0xffff;
+	trbBodyIdx=0;
+	mSleeping = 0;
+	deleted = 0;
+	useSleep = 1;
+	useCcd = 0;
+	useContactCallback = 0;
+	useSleepCallback = 0;
+	mSleepCount=0;
+	linearDamping = 1.0f;
+	angularDamping = 0.99f;
+}
+
+inline void
+TrbState::setIdentity()
+{
+	fX[0] = 0.0f;
+	fX[1] = 0.0f;
+	fX[2] = 0.0f;
+	fQ[0] = 0.0f;
+	fQ[1] = 0.0f;
+	fQ[2] = 0.0f;
+	fQ[3] = 1.0f;
+	fV[0] = 0.0f;
+	fV[1] = 0.0f;
+	fV[2] = 0.0f;
+	fOmega[0] = 0.0f;
+	fOmega[1] = 0.0f;
+	fOmega[2] = 0.0f;
+}
+
+inline void
+TrbState::setZero()
+{
+	fX[0] = 0.0f;
+	fX[1] = 0.0f;
+	fX[2] = 0.0f;
+	fQ[0] = 0.0f;
+	fQ[1] = 0.0f;
+	fQ[2] = 0.0f;
+	fQ[3] = 0.0f;
+	fV[0] = 0.0f;
+	fV[1] = 0.0f;
+	fV[2] = 0.0f;
+	fOmega[0] = 0.0f;
+	fOmega[1] = 0.0f;
+	fOmega[2] = 0.0f;
+}
+
+inline void
+TrbState::setAuxils(const vmVector3 &centerLocal,const vmVector3 &halfLocal)
+{
+	vmVector3 centerW = getPosition() + rotate(getOrientation(),centerLocal);
+	vmVector3 halfW = absPerElem(vmMatrix3(getOrientation())) * halfLocal;
+	center[0] = centerW[0];
+	center[1] = centerW[1];
+	center[2] = centerW[2];
+	half[0] = halfW[0];
+	half[1] = halfW[1];
+	half[2] = halfW[2];
+}
+
+inline void
+TrbState::setAuxilsCcd(const vmVector3 &centerLocal,const vmVector3 &halfLocal,float timeStep)
+{
+	vmVector3 centerW = getPosition() + rotate(getOrientation(),centerLocal);
+	vmVector3 halfW = absPerElem(vmMatrix3(getOrientation())) * halfLocal;
+
+	vmVector3 diffvec = getLinearVelocity()*timeStep;
+
+	vmVector3 newCenter = centerW + diffvec;
+	vmVector3 aabbMin = minPerElem(newCenter - halfW,centerW - halfW);
+	vmVector3 aabbMax = maxPerElem(newCenter + halfW,centerW + halfW);
+	
+	centerW = 0.5f * (aabbMin + aabbMax);
+	halfW =0.5f * (aabbMax - aabbMin);
+
+	center[0] = centerW[0];
+	center[1] = centerW[1];
+	center[2] = centerW[2];
+
+	half[0] = halfW[0];
+	half[1] = halfW[1];
+	half[2] = halfW[2];
+}
+
+inline
+void TrbState::reset()
+{
+#if 0
+	mSleepCount = 0;
+	mMotionType = PfxMotionTypeActive;
+	mDeleted = 0;
+	mSleeping = 0;
+	mUseSleep = 1;
+	mUseCcd = 0;
+	mUseContactCallback = 0;
+	mUseSleepCallback = 0;
+	mRigidBodyId = 0;
+	mContactFilterSelf = 0xffffffff;
+	mContactFilterTarget = 0xffffffff;
+	mLinearDamping = 1.0f;
+	mAngularDamping = 0.99f;
+	mPosition = vmVector3(0.0f);
+	mOrientation = vmQuat::identity();
+	mLinearVelocity = vmVector3(0.0f);
+	mAngularVelocity = vmVector3(0.0f);
+#endif
+
+	setMotionType(PfxMotionTypeActive);
+	contactFilterSelf=contactFilterTarget=0xffffffff;
+	deleted = 0;
+	mSleeping = 0;
+	useSleep = 1;
+	trbBodyIdx=0;
+	mSleepCount=0;
+	useCcd = 0;
+	useContactCallback = 0;
+	useSleepCallback = 0;
+	linearDamping = 1.0f;
+	angularDamping = 0.99f;
+}
+
+#endif //BT_TRBSTATEVEC_H__
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.cpp b/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.cpp
new file mode 100644
index 0000000..1197bbe
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.cpp
@@ -0,0 +1,446 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "Win32ThreadSupport.h"
+
+#ifdef USE_WIN32_THREADING
+
+#include <windows.h>
+
+#include "SpuCollisionTaskProcess.h"
+
+#include "SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
+
+
+
+///The number of threads should be equal to the number of available cores
+///@todo: each worker should be linked to a single core, using SetThreadIdealProcessor.
+
+///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
+///Setup and initialize SPU/CELL/Libspe2
+Win32ThreadSupport::Win32ThreadSupport(const Win32ThreadConstructionInfo & threadConstructionInfo)
+{
+	m_maxNumTasks = threadConstructionInfo.m_numThreads;
+	startThreads(threadConstructionInfo);
+}
+
+///cleanup/shutdown Libspe2
+Win32ThreadSupport::~Win32ThreadSupport()
+{
+	stopSPU();
+}
+
+
+
+
+#include <stdio.h>
+
+DWORD WINAPI Thread_no_1( LPVOID lpParam ) 
+{
+
+	Win32ThreadSupport::btSpuStatus* status = (Win32ThreadSupport::btSpuStatus*)lpParam;
+
+	
+	while (1)
+	{
+		WaitForSingleObject(status->m_eventStartHandle,INFINITE);
+		
+		void* userPtr = status->m_userPtr;
+
+		if (userPtr)
+		{
+			btAssert(status->m_status);
+			status->m_userThreadFunc(userPtr,status->m_lsMemory);
+			status->m_status = 2;
+			SetEvent(status->m_eventCompletetHandle);
+		} else
+		{
+			//exit Thread
+			status->m_status = 3;
+			printf("Thread with taskId %i with handle %p exiting\n",status->m_taskId, status->m_threadHandle);
+			SetEvent(status->m_eventCompletetHandle);
+			break;
+		}
+		
+	}
+
+	printf("Thread TERMINATED\n");
+	return 0;
+
+}
+
+///send messages to SPUs
+void Win32ThreadSupport::sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t taskId)
+{
+	///	gMidphaseSPU.sendRequest(CMD_GATHER_AND_PROCESS_PAIRLIST, (ppu_address_t) &taskDesc);
+	
+	///we should spawn an SPU task here, and in 'waitForResponse' it should wait for response of the (one of) the first tasks that finished
+	
+
+
+	switch (uiCommand)
+	{
+	case 	CMD_GATHER_AND_PROCESS_PAIRLIST:
+		{
+
+
+//#define SINGLE_THREADED 1
+#ifdef SINGLE_THREADED
+
+			btSpuStatus&	spuStatus = m_activeSpuStatus[0];
+			spuStatus.m_userPtr=(void*)uiArgument0;
+			spuStatus.m_userThreadFunc(spuStatus.m_userPtr,spuStatus.m_lsMemory);
+			HANDLE handle =0;
+#else
+
+
+			btSpuStatus&	spuStatus = m_activeSpuStatus[taskId];
+			btAssert(taskId>=0);
+			btAssert(int(taskId)<m_activeSpuStatus.size());
+
+			spuStatus.m_commandId = uiCommand;
+			spuStatus.m_status = 1;
+			spuStatus.m_userPtr = (void*)uiArgument0;
+
+			///fire event to start new task
+			SetEvent(spuStatus.m_eventStartHandle);
+
+#endif //CollisionTask_LocalStoreMemory
+
+			
+
+			break;
+		}
+	default:
+		{
+			///not implemented
+			btAssert(0);
+		}
+
+	};
+
+
+}
+
+
+///check for messages from SPUs
+void Win32ThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)
+{
+	///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
+	
+	///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
+
+
+	btAssert(m_activeSpuStatus.size());
+
+	int last = -1;
+#ifndef SINGLE_THREADED
+	DWORD res = WaitForMultipleObjects(m_completeHandles.size(), &m_completeHandles[0], FALSE, INFINITE);
+	btAssert(res != WAIT_FAILED);
+	last = res - WAIT_OBJECT_0;
+
+	btSpuStatus& spuStatus = m_activeSpuStatus[last];
+	btAssert(spuStatus.m_threadHandle);
+	btAssert(spuStatus.m_eventCompletetHandle);
+
+	//WaitForSingleObject(spuStatus.m_eventCompletetHandle, INFINITE);
+	btAssert(spuStatus.m_status > 1);
+	spuStatus.m_status = 0;
+
+	///need to find an active spu
+	btAssert(last>=0);
+
+#else
+	last=0;
+	btSpuStatus& spuStatus = m_activeSpuStatus[last];
+#endif //SINGLE_THREADED
+
+	
+
+	*puiArgument0 = spuStatus.m_taskId;
+	*puiArgument1 = spuStatus.m_status;
+
+
+}
+
+
+///check for messages from SPUs
+bool Win32ThreadSupport::isTaskCompleted(unsigned int *puiArgument0, unsigned int *puiArgument1, int timeOutInMilliseconds)
+{
+	///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
+	
+	///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
+
+
+	btAssert(m_activeSpuStatus.size());
+
+	int last = -1;
+#ifndef SINGLE_THREADED
+	DWORD res = WaitForMultipleObjects(m_completeHandles.size(), &m_completeHandles[0], FALSE, timeOutInMilliseconds);
+	
+	if ((res != STATUS_TIMEOUT) && (res != WAIT_FAILED))
+	{
+		
+		btAssert(res != WAIT_FAILED);
+		last = res - WAIT_OBJECT_0;
+
+		btSpuStatus& spuStatus = m_activeSpuStatus[last];
+		btAssert(spuStatus.m_threadHandle);
+		btAssert(spuStatus.m_eventCompletetHandle);
+
+		//WaitForSingleObject(spuStatus.m_eventCompletetHandle, INFINITE);
+		btAssert(spuStatus.m_status > 1);
+		spuStatus.m_status = 0;
+
+		///need to find an active spu
+		btAssert(last>=0);
+
+	#else
+		last=0;
+		btSpuStatus& spuStatus = m_activeSpuStatus[last];
+	#endif //SINGLE_THREADED
+
+		
+
+		*puiArgument0 = spuStatus.m_taskId;
+		*puiArgument1 = spuStatus.m_status;
+
+		return true;
+	} 
+
+	return false;
+}
+
+
+void Win32ThreadSupport::startThreads(const Win32ThreadConstructionInfo& threadConstructionInfo)
+{
+
+	m_activeSpuStatus.resize(threadConstructionInfo.m_numThreads);
+	m_completeHandles.resize(threadConstructionInfo.m_numThreads);
+
+	m_maxNumTasks = threadConstructionInfo.m_numThreads;
+
+	for (int i=0;i<threadConstructionInfo.m_numThreads;i++)
+	{
+		printf("starting thread %d\n",i);
+
+		btSpuStatus&	spuStatus = m_activeSpuStatus[i];
+
+		LPSECURITY_ATTRIBUTES lpThreadAttributes=NULL;
+		SIZE_T dwStackSize=threadConstructionInfo.m_threadStackSize;
+		LPTHREAD_START_ROUTINE lpStartAddress=&Thread_no_1;
+		LPVOID lpParameter=&spuStatus;
+		DWORD dwCreationFlags=0;
+		LPDWORD lpThreadId=0;
+
+		spuStatus.m_userPtr=0;
+
+		sprintf(spuStatus.m_eventStartHandleName,"eventStart%s%d",threadConstructionInfo.m_uniqueName,i);
+		spuStatus.m_eventStartHandle = CreateEventA (0,false,false,spuStatus.m_eventStartHandleName);
+
+		sprintf(spuStatus.m_eventCompletetHandleName,"eventComplete%s%d",threadConstructionInfo.m_uniqueName,i);
+		spuStatus.m_eventCompletetHandle = CreateEventA (0,false,false,spuStatus.m_eventCompletetHandleName);
+
+		m_completeHandles[i] = spuStatus.m_eventCompletetHandle;
+
+		HANDLE handle = CreateThread(lpThreadAttributes,dwStackSize,lpStartAddress,lpParameter,	dwCreationFlags,lpThreadId);
+		SetThreadPriority(handle,THREAD_PRIORITY_HIGHEST);
+		//SetThreadPriority(handle,THREAD_PRIORITY_TIME_CRITICAL);
+
+		SetThreadAffinityMask(handle, 1<<i);
+
+		spuStatus.m_taskId = i;
+		spuStatus.m_commandId = 0;
+		spuStatus.m_status = 0;
+		spuStatus.m_threadHandle = handle;
+		spuStatus.m_lsMemory = threadConstructionInfo.m_lsMemoryFunc();
+		spuStatus.m_userThreadFunc = threadConstructionInfo.m_userThreadFunc;
+
+		printf("started thread %d with threadHandle %p\n",i,handle);
+		
+	}
+
+}
+
+void Win32ThreadSupport::startSPU()
+{
+}
+
+
+///tell the task scheduler we are done with the SPU tasks
+void Win32ThreadSupport::stopSPU()
+{
+	int i;
+	for (i=0;i<m_activeSpuStatus.size();i++)
+	{
+		btSpuStatus& spuStatus = m_activeSpuStatus[i];
+		if (spuStatus.m_status>0)
+		{
+			WaitForSingleObject(spuStatus.m_eventCompletetHandle, INFINITE);
+		}
+		
+
+		spuStatus.m_userPtr = 0;
+		SetEvent(spuStatus.m_eventStartHandle);
+		WaitForSingleObject(spuStatus.m_eventCompletetHandle, INFINITE);
+
+		CloseHandle(spuStatus.m_eventCompletetHandle);
+		CloseHandle(spuStatus.m_eventStartHandle);
+		CloseHandle(spuStatus.m_threadHandle);
+	}
+
+	m_activeSpuStatus.clear();
+	m_completeHandles.clear();
+
+}
+
+
+
+class btWin32Barrier : public btBarrier
+{
+private:
+	CRITICAL_SECTION mExternalCriticalSection;
+	CRITICAL_SECTION mLocalCriticalSection;
+	HANDLE mRunEvent,mNotifyEvent;
+	int mCounter,mEnableCounter;
+	int mMaxCount;
+
+public:
+	btWin32Barrier()
+	{
+		mCounter = 0;
+		mMaxCount = 1;
+		mEnableCounter = 0;
+		InitializeCriticalSection(&mExternalCriticalSection);
+		InitializeCriticalSection(&mLocalCriticalSection);
+		mRunEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
+		mNotifyEvent = CreateEvent(NULL,TRUE,FALSE,NULL);
+	}
+
+	virtual ~btWin32Barrier()
+	{
+		DeleteCriticalSection(&mExternalCriticalSection);
+		DeleteCriticalSection(&mLocalCriticalSection);
+		CloseHandle(mRunEvent);
+		CloseHandle(mNotifyEvent);
+	}
+
+	void sync()
+	{
+		int eventId;
+
+		EnterCriticalSection(&mExternalCriticalSection);
+
+		//PFX_PRINTF("enter taskId %d count %d stage %d phase %d mEnableCounter %d\n",taskId,mCounter,debug&0xff,debug>>16,mEnableCounter);
+
+		if(mEnableCounter > 0) {
+			ResetEvent(mNotifyEvent);
+			LeaveCriticalSection(&mExternalCriticalSection);
+			WaitForSingleObject(mNotifyEvent,INFINITE); 
+			EnterCriticalSection(&mExternalCriticalSection);
+		}
+
+		eventId = mCounter;
+		mCounter++;
+
+		if(eventId == mMaxCount-1) {
+			SetEvent(mRunEvent);
+
+			mEnableCounter = mCounter-1;
+			mCounter = 0;
+		}
+		else {
+			ResetEvent(mRunEvent);
+			LeaveCriticalSection(&mExternalCriticalSection);
+			WaitForSingleObject(mRunEvent,INFINITE); 
+			EnterCriticalSection(&mExternalCriticalSection);
+			mEnableCounter--;
+		}
+
+		if(mEnableCounter == 0) {
+			SetEvent(mNotifyEvent);
+		}
+
+		//PFX_PRINTF("leave taskId %d count %d stage %d phase %d mEnableCounter %d\n",taskId,mCounter,debug&0xff,debug>>16,mEnableCounter);
+
+		LeaveCriticalSection(&mExternalCriticalSection);
+	}
+
+	virtual void setMaxCount(int n) {mMaxCount = n;}
+	virtual int  getMaxCount() {return mMaxCount;}
+};
+
+class btWin32CriticalSection : public btCriticalSection
+{
+private:
+	CRITICAL_SECTION mCriticalSection;
+
+public:
+	btWin32CriticalSection()
+	{
+		InitializeCriticalSection(&mCriticalSection);
+	}
+
+	~btWin32CriticalSection()
+	{
+		DeleteCriticalSection(&mCriticalSection);
+	}
+
+	unsigned int getSharedParam(int i)
+	{
+		btAssert(i>=0&&i<31);
+		return mCommonBuff[i+1];
+	}
+
+	void setSharedParam(int i,unsigned int p)
+	{
+		btAssert(i>=0&&i<31);
+		mCommonBuff[i+1] = p;
+	}
+
+	void lock()
+	{
+		EnterCriticalSection(&mCriticalSection);
+		mCommonBuff[0] = 1;
+	}
+
+	void unlock()
+	{
+		mCommonBuff[0] = 0;
+		LeaveCriticalSection(&mCriticalSection);
+	}
+};
+
+
+btBarrier*	Win32ThreadSupport::createBarrier()
+{
+	unsigned char* mem = (unsigned char*)btAlignedAlloc(sizeof(btWin32Barrier),16);
+	btWin32Barrier* barrier = new(mem) btWin32Barrier();
+	barrier->setMaxCount(getNumTasks());
+	return barrier;
+}
+
+btCriticalSection* Win32ThreadSupport::createCriticalSection()
+{
+	unsigned char* mem = (unsigned char*) btAlignedAlloc(sizeof(btWin32CriticalSection),16);
+	btWin32CriticalSection* cs = new(mem) btWin32CriticalSection();
+	return cs;
+}
+
+
+
+#endif //USE_WIN32_THREADING
+
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.h b/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.h
new file mode 100644
index 0000000..4370c00
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/Win32ThreadSupport.h
@@ -0,0 +1,138 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "LinearMath/btScalar.h"
+#include "PlatformDefinitions.h"
+
+#ifdef USE_WIN32_THREADING  //platform specific defines are defined in PlatformDefinitions.h
+
+#ifndef BT_WIN32_THREAD_SUPPORT_H
+#define BT_WIN32_THREAD_SUPPORT_H
+
+#include "LinearMath/btAlignedObjectArray.h"
+
+#include "btThreadSupportInterface.h"
+
+
+typedef void (*Win32ThreadFunc)(void* userPtr,void* lsMemory);
+typedef void* (*Win32lsMemorySetupFunc)();
+
+
+///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication
+class Win32ThreadSupport : public btThreadSupportInterface 
+{
+public:
+	///placeholder, until libspe2 support is there
+	struct	btSpuStatus
+	{
+		uint32_t	m_taskId;
+		uint32_t	m_commandId;
+		uint32_t	m_status;
+
+		Win32ThreadFunc	m_userThreadFunc;
+		void*	m_userPtr; //for taskDesc etc
+		void*	m_lsMemory; //initialized using Win32LocalStoreMemorySetupFunc
+
+		void*	m_threadHandle; //this one is calling 'Win32ThreadFunc'
+
+		void*	m_eventStartHandle;
+		char	m_eventStartHandleName[32];
+
+		void*	m_eventCompletetHandle;
+		char	m_eventCompletetHandleName[32];
+		
+
+	};
+private:
+
+	btAlignedObjectArray<btSpuStatus>	m_activeSpuStatus;
+	btAlignedObjectArray<void*>			m_completeHandles;
+	
+	int m_maxNumTasks;
+public:
+	///Setup and initialize SPU/CELL/Libspe2
+
+	struct	Win32ThreadConstructionInfo
+	{
+		Win32ThreadConstructionInfo(char* uniqueName,
+									Win32ThreadFunc userThreadFunc,
+									Win32lsMemorySetupFunc	lsMemoryFunc,
+									int numThreads=1,
+									int threadStackSize=65535
+									)
+									:m_uniqueName(uniqueName),
+									m_userThreadFunc(userThreadFunc),
+									m_lsMemoryFunc(lsMemoryFunc),
+									m_numThreads(numThreads),
+									m_threadStackSize(threadStackSize)
+		{
+
+		}
+
+		char*					m_uniqueName;
+		Win32ThreadFunc			m_userThreadFunc;
+		Win32lsMemorySetupFunc	m_lsMemoryFunc;
+		int						m_numThreads;
+		int						m_threadStackSize;
+
+	};
+
+
+
+	Win32ThreadSupport(const Win32ThreadConstructionInfo& threadConstructionInfo);
+
+///cleanup/shutdown Libspe2
+	virtual	~Win32ThreadSupport();
+
+	void	startThreads(const Win32ThreadConstructionInfo&	threadInfo);
+
+
+///send messages to SPUs
+	virtual	void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1);
+
+///check for messages from SPUs
+	virtual	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1);
+
+	virtual bool isTaskCompleted(unsigned int *puiArgument0, unsigned int *puiArgument1, int timeOutInMilliseconds);
+
+///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
+	virtual	void startSPU();
+
+///tell the task scheduler we are done with the SPU tasks
+	virtual	void stopSPU();
+
+	virtual	void	setNumTasks(int numTasks)
+	{
+		m_maxNumTasks = numTasks;
+	}
+
+	virtual int getNumTasks() const
+	{
+		return m_maxNumTasks;
+	}
+
+	virtual void*	getThreadLocalMemory(int taskId)
+	{
+		return m_activeSpuStatus[taskId].m_lsMemory;
+	}
+	virtual btBarrier*	createBarrier();
+
+	virtual btCriticalSection* createCriticalSection();
+
+};
+
+#endif //BT_WIN32_THREAD_SUPPORT_H
+
+#endif //USE_WIN32_THREADING
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.cpp b/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.cpp
new file mode 100644
index 0000000..8192aa4
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.cpp
@@ -0,0 +1,22 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btThreadSupportInterface.h"
+
+btThreadSupportInterface::~btThreadSupportInterface()
+{
+
+}
+
diff --git a/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.h b/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.h
new file mode 100644
index 0000000..16850e2
--- /dev/null
+++ b/hkl3d/bullet/src/BulletMultiThreaded/btThreadSupportInterface.h
@@ -0,0 +1,85 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2007 Erwin Coumans  http://bulletphysics.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_THREAD_SUPPORT_INTERFACE_H
+#define BT_THREAD_SUPPORT_INTERFACE_H
+
+
+#include <LinearMath/btScalar.h> //for ATTRIBUTE_ALIGNED16
+#include "PlatformDefinitions.h"
+#include "PpuAddressSpace.h"
+
+class btBarrier {
+public:
+	btBarrier() {}
+	virtual ~btBarrier() {}
+
+	virtual void sync() = 0;
+	virtual void setMaxCount(int n) = 0;
+	virtual int  getMaxCount() = 0;
+};
+
+class btCriticalSection {
+public:
+	btCriticalSection() {}
+	virtual ~btCriticalSection() {}
+
+	ATTRIBUTE_ALIGNED16(unsigned int mCommonBuff[32]);
+
+	virtual unsigned int getSharedParam(int i) = 0;
+	virtual void setSharedParam(int i,unsigned int p) = 0;
+
+	virtual void lock() = 0;
+	virtual void unlock() = 0;
+};
+
+
+class btThreadSupportInterface
+{
+public:
+
+	virtual ~btThreadSupportInterface();
+
+///send messages to SPUs
+	virtual void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1) =0;
+
+///check for messages from SPUs
+	virtual	void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1) =0;
+
+
+	///non-blocking test if a task is completed. First implement all versions, and then enable this API
+	///virtual bool isTaskCompleted(unsigned int *puiArgument0, unsigned int *puiArgument1, int timeOutInMilliseconds)=0;
+
+///start the spus (can be called at the beginning of each frame, to make sure that the right SPU program is loaded)
+	virtual	void startSPU() =0;
+
+///tell the task scheduler we are done with the SPU tasks
+	virtual	void stopSPU()=0;
+
+	///tell the task scheduler to use no more than numTasks tasks
+	virtual void	setNumTasks(int numTasks)=0;
+
+	virtual int		getNumTasks() const = 0;
+
+	virtual btBarrier*	createBarrier() = 0;
+
+	virtual btCriticalSection* createCriticalSection() = 0;
+	
+	virtual void*	getThreadLocalMemory(int taskId) { return 0; }
+
+};
+
+#endif //BT_THREAD_SUPPORT_INTERFACE_H
+
diff --git a/hkl3d/bullet/src/LinearMath/btAabbUtil2.h b/hkl3d/bullet/src/LinearMath/btAabbUtil2.h
new file mode 100644
index 0000000..42b721d
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btAabbUtil2.h
@@ -0,0 +1,236 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_AABB_UTIL2
+#define BT_AABB_UTIL2
+
+#include "btTransform.h"
+#include "btVector3.h"
+#include "btMinMax.h"
+
+
+
+SIMD_FORCE_INLINE void AabbExpand (btVector3& aabbMin,
+								   btVector3& aabbMax,
+								   const btVector3& expansionMin,
+								   const btVector3& expansionMax)
+{
+	aabbMin = aabbMin + expansionMin;
+	aabbMax = aabbMax + expansionMax;
+}
+
+/// conservative test for overlap between two aabbs
+SIMD_FORCE_INLINE bool TestPointAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1,
+								const btVector3 &point)
+{
+	bool overlap = true;
+	overlap = (aabbMin1.getX() > point.getX() || aabbMax1.getX() < point.getX()) ? false : overlap;
+	overlap = (aabbMin1.getZ() > point.getZ() || aabbMax1.getZ() < point.getZ()) ? false : overlap;
+	overlap = (aabbMin1.getY() > point.getY() || aabbMax1.getY() < point.getY()) ? false : overlap;
+	return overlap;
+}
+
+
+/// conservative test for overlap between two aabbs
+SIMD_FORCE_INLINE bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1,
+								const btVector3 &aabbMin2, const btVector3 &aabbMax2)
+{
+	bool overlap = true;
+	overlap = (aabbMin1.getX() > aabbMax2.getX() || aabbMax1.getX() < aabbMin2.getX()) ? false : overlap;
+	overlap = (aabbMin1.getZ() > aabbMax2.getZ() || aabbMax1.getZ() < aabbMin2.getZ()) ? false : overlap;
+	overlap = (aabbMin1.getY() > aabbMax2.getY() || aabbMax1.getY() < aabbMin2.getY()) ? false : overlap;
+	return overlap;
+}
+
+/// conservative test for overlap between triangle and aabb
+SIMD_FORCE_INLINE bool TestTriangleAgainstAabb2(const btVector3 *vertices,
+									const btVector3 &aabbMin, const btVector3 &aabbMax)
+{
+	const btVector3 &p1 = vertices[0];
+	const btVector3 &p2 = vertices[1];
+	const btVector3 &p3 = vertices[2];
+
+	if (btMin(btMin(p1[0], p2[0]), p3[0]) > aabbMax[0]) return false;
+	if (btMax(btMax(p1[0], p2[0]), p3[0]) < aabbMin[0]) return false;
+
+	if (btMin(btMin(p1[2], p2[2]), p3[2]) > aabbMax[2]) return false;
+	if (btMax(btMax(p1[2], p2[2]), p3[2]) < aabbMin[2]) return false;
+  
+	if (btMin(btMin(p1[1], p2[1]), p3[1]) > aabbMax[1]) return false;
+	if (btMax(btMax(p1[1], p2[1]), p3[1]) < aabbMin[1]) return false;
+	return true;
+}
+
+
+SIMD_FORCE_INLINE int	btOutcode(const btVector3& p,const btVector3& halfExtent) 
+{
+	return (p.getX()  < -halfExtent.getX() ? 0x01 : 0x0) |    
+		   (p.getX() >  halfExtent.getX() ? 0x08 : 0x0) |
+		   (p.getY() < -halfExtent.getY() ? 0x02 : 0x0) |    
+		   (p.getY() >  halfExtent.getY() ? 0x10 : 0x0) |
+		   (p.getZ() < -halfExtent.getZ() ? 0x4 : 0x0) |    
+		   (p.getZ() >  halfExtent.getZ() ? 0x20 : 0x0);
+}
+
+
+
+SIMD_FORCE_INLINE bool btRayAabb2(const btVector3& rayFrom,
+								  const btVector3& rayInvDirection,
+								  const unsigned int raySign[3],
+								  const btVector3 bounds[2],
+								  btScalar& tmin,
+								  btScalar lambda_min,
+								  btScalar lambda_max)
+{
+	btScalar tmax, tymin, tymax, tzmin, tzmax;
+	tmin = (bounds[raySign[0]].getX() - rayFrom.getX()) * rayInvDirection.getX();
+	tmax = (bounds[1-raySign[0]].getX() - rayFrom.getX()) * rayInvDirection.getX();
+	tymin = (bounds[raySign[1]].getY() - rayFrom.getY()) * rayInvDirection.getY();
+	tymax = (bounds[1-raySign[1]].getY() - rayFrom.getY()) * rayInvDirection.getY();
+
+	if ( (tmin > tymax) || (tymin > tmax) )
+		return false;
+
+	if (tymin > tmin)
+		tmin = tymin;
+
+	if (tymax < tmax)
+		tmax = tymax;
+
+	tzmin = (bounds[raySign[2]].getZ() - rayFrom.getZ()) * rayInvDirection.getZ();
+	tzmax = (bounds[1-raySign[2]].getZ() - rayFrom.getZ()) * rayInvDirection.getZ();
+
+	if ( (tmin > tzmax) || (tzmin > tmax) )
+		return false;
+	if (tzmin > tmin)
+		tmin = tzmin;
+	if (tzmax < tmax)
+		tmax = tzmax;
+	return ( (tmin < lambda_max) && (tmax > lambda_min) );
+}
+
+SIMD_FORCE_INLINE bool btRayAabb(const btVector3& rayFrom, 
+								 const btVector3& rayTo, 
+								 const btVector3& aabbMin, 
+								 const btVector3& aabbMax,
+					  btScalar& param, btVector3& normal) 
+{
+	btVector3 aabbHalfExtent = (aabbMax-aabbMin)* btScalar(0.5);
+	btVector3 aabbCenter = (aabbMax+aabbMin)* btScalar(0.5);
+	btVector3	source = rayFrom - aabbCenter;
+	btVector3	target = rayTo - aabbCenter;
+	int	sourceOutcode = btOutcode(source,aabbHalfExtent);
+	int targetOutcode = btOutcode(target,aabbHalfExtent);
+	if ((sourceOutcode & targetOutcode) == 0x0)
+	{
+		btScalar lambda_enter = btScalar(0.0);
+		btScalar lambda_exit  = param;
+		btVector3 r = target - source;
+		int i;
+		btScalar	normSign = 1;
+		btVector3	hitNormal(0,0,0);
+		int bit=1;
+
+		for (int j=0;j<2;j++)
+		{
+			for (i = 0; i != 3; ++i)
+			{
+				if (sourceOutcode & bit)
+				{
+					btScalar lambda = (-source[i] - aabbHalfExtent[i]*normSign) / r[i];
+					if (lambda_enter <= lambda)
+					{
+						lambda_enter = lambda;
+						hitNormal.setValue(0,0,0);
+						hitNormal[i] = normSign;
+					}
+				}
+				else if (targetOutcode & bit) 
+				{
+					btScalar lambda = (-source[i] - aabbHalfExtent[i]*normSign) / r[i];
+					btSetMin(lambda_exit, lambda);
+				}
+				bit<<=1;
+			}
+			normSign = btScalar(-1.);
+		}
+		if (lambda_enter <= lambda_exit)
+		{
+			param = lambda_enter;
+			normal = hitNormal;
+			return true;
+		}
+	}
+	return false;
+}
+
+
+
+SIMD_FORCE_INLINE	void btTransformAabb(const btVector3& halfExtents, btScalar margin,const btTransform& t,btVector3& aabbMinOut,btVector3& aabbMaxOut)
+{
+	btVector3 halfExtentsWithMargin = halfExtents+btVector3(margin,margin,margin);
+	btMatrix3x3 abs_b = t.getBasis().absolute();  
+	btVector3 center = t.getOrigin();
+	btVector3 extent = btVector3(abs_b[0].dot(halfExtentsWithMargin),
+		   abs_b[1].dot(halfExtentsWithMargin),
+		  abs_b[2].dot(halfExtentsWithMargin));
+	aabbMinOut = center - extent;
+	aabbMaxOut = center + extent;
+}
+
+
+SIMD_FORCE_INLINE	void btTransformAabb(const btVector3& localAabbMin,const btVector3& localAabbMax, btScalar margin,const btTransform& trans,btVector3& aabbMinOut,btVector3& aabbMaxOut)
+{
+		btAssert(localAabbMin.getX() <= localAabbMax.getX());
+		btAssert(localAabbMin.getY() <= localAabbMax.getY());
+		btAssert(localAabbMin.getZ() <= localAabbMax.getZ());
+		btVector3 localHalfExtents = btScalar(0.5)*(localAabbMax-localAabbMin);
+		localHalfExtents+=btVector3(margin,margin,margin);
+
+		btVector3 localCenter = btScalar(0.5)*(localAabbMax+localAabbMin);
+		btMatrix3x3 abs_b = trans.getBasis().absolute();  
+		btVector3 center = trans(localCenter);
+		btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
+			   abs_b[1].dot(localHalfExtents),
+			  abs_b[2].dot(localHalfExtents));
+		aabbMinOut = center-extent;
+		aabbMaxOut = center+extent;
+}
+
+#define USE_BANCHLESS 1
+#ifdef USE_BANCHLESS
+	//This block replaces the block below and uses no branches, and replaces the 8 bit return with a 32 bit return for improved performance (~3x on XBox 360)
+	SIMD_FORCE_INLINE unsigned testQuantizedAabbAgainstQuantizedAabb(const unsigned short int* aabbMin1,const unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2)
+	{		
+		return static_cast<unsigned int>(btSelect((unsigned)((aabbMin1[0] <= aabbMax2[0]) & (aabbMax1[0] >= aabbMin2[0])
+			& (aabbMin1[2] <= aabbMax2[2]) & (aabbMax1[2] >= aabbMin2[2])
+			& (aabbMin1[1] <= aabbMax2[1]) & (aabbMax1[1] >= aabbMin2[1])),
+			1, 0));
+	}
+#else
+	SIMD_FORCE_INLINE bool testQuantizedAabbAgainstQuantizedAabb(const unsigned short int* aabbMin1,const unsigned short int* aabbMax1,const unsigned short int* aabbMin2,const unsigned short int* aabbMax2)
+	{
+		bool overlap = true;
+		overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? false : overlap;
+		overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? false : overlap;
+		overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? false : overlap;
+		return overlap;
+	}
+#endif //USE_BANCHLESS
+
+#endif //BT_AABB_UTIL2
+
+
diff --git a/hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp b/hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp
new file mode 100644
index 0000000..189b759
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btAlignedAllocator.cpp
@@ -0,0 +1,182 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include "btAlignedAllocator.h"
+
+int gNumAlignedAllocs = 0;
+int gNumAlignedFree = 0;
+int gTotalBytesAlignedAllocs = 0;//detect memory leaks
+
+static void *btAllocDefault(size_t size)
+{
+	return malloc(size);
+}
+
+static void btFreeDefault(void *ptr)
+{
+	free(ptr);
+}
+
+static btAllocFunc *sAllocFunc = btAllocDefault;
+static btFreeFunc *sFreeFunc = btFreeDefault;
+
+
+
+#if defined (BT_HAS_ALIGNED_ALLOCATOR)
+#include <malloc.h>
+static void *btAlignedAllocDefault(size_t size, int alignment)
+{
+	return _aligned_malloc(size, (size_t)alignment);
+}
+
+static void btAlignedFreeDefault(void *ptr)
+{
+	_aligned_free(ptr);
+}
+#elif defined(__CELLOS_LV2__)
+#include <stdlib.h>
+
+static inline void *btAlignedAllocDefault(size_t size, int alignment)
+{
+	return memalign(alignment, size);
+}
+
+static inline void btAlignedFreeDefault(void *ptr)
+{
+	free(ptr);
+}
+#else
+static inline void *btAlignedAllocDefault(size_t size, int alignment)
+{
+  void *ret;
+  char *real;
+  unsigned long offset;
+
+  real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
+  if (real) {
+    offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
+    ret = (void *)((real + sizeof(void *)) + offset);
+    *((void **)(ret)-1) = (void *)(real);
+  } else {
+    ret = (void *)(real);
+  }
+  return (ret);
+}
+
+static inline void btAlignedFreeDefault(void *ptr)
+{
+  void* real;
+
+  if (ptr) {
+    real = *((void **)(ptr)-1);
+    sFreeFunc(real);
+  }
+}
+#endif
+
+
+static btAlignedAllocFunc *sAlignedAllocFunc = btAlignedAllocDefault;
+static btAlignedFreeFunc *sAlignedFreeFunc = btAlignedFreeDefault;
+
+void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc)
+{
+  sAlignedAllocFunc = allocFunc ? allocFunc : btAlignedAllocDefault;
+  sAlignedFreeFunc = freeFunc ? freeFunc : btAlignedFreeDefault;
+}
+
+void btAlignedAllocSetCustom(btAllocFunc *allocFunc, btFreeFunc *freeFunc)
+{
+  sAllocFunc = allocFunc ? allocFunc : btAllocDefault;
+  sFreeFunc = freeFunc ? freeFunc : btFreeDefault;
+}
+
+#ifdef BT_DEBUG_MEMORY_ALLOCATIONS
+//this generic allocator provides the total allocated number of bytes
+#include <stdio.h>
+
+void*   btAlignedAllocInternal  (size_t size, int alignment,int line,char* filename)
+{
+ void *ret;
+ char *real;
+ unsigned long offset;
+
+ gTotalBytesAlignedAllocs += size;
+ gNumAlignedAllocs++;
+
+ 
+ real = (char *)sAllocFunc(size + 2*sizeof(void *) + (alignment-1));
+ if (real) {
+   offset = (alignment - (unsigned long)(real + 2*sizeof(void *))) &
+(alignment-1);
+   ret = (void *)((real + 2*sizeof(void *)) + offset);
+   *((void **)(ret)-1) = (void *)(real);
+       *((int*)(ret)-2) = size;
+
+ } else {
+   ret = (void *)(real);//??
+ }
+
+ printf("allocation#%d at address %x, from %s,line %d, size %d\n",gNumAlignedAllocs,real, filename,line,size);
+
+ int* ptr = (int*)ret;
+ *ptr = 12;
+ return (ret);
+}
+
+void    btAlignedFreeInternal   (void* ptr,int line,char* filename)
+{
+
+ void* real;
+ gNumAlignedFree++;
+
+ if (ptr) {
+   real = *((void **)(ptr)-1);
+       int size = *((int*)(ptr)-2);
+       gTotalBytesAlignedAllocs -= size;
+
+	   printf("free #%d at address %x, from %s,line %d, size %d\n",gNumAlignedFree,real, filename,line,size);
+
+   sFreeFunc(real);
+ } else
+ {
+	 printf("NULL ptr\n");
+ }
+}
+
+#else //BT_DEBUG_MEMORY_ALLOCATIONS
+
+void*	btAlignedAllocInternal	(size_t size, int alignment)
+{
+	gNumAlignedAllocs++;
+	void* ptr;
+	ptr = sAlignedAllocFunc(size, alignment);
+//	printf("btAlignedAllocInternal %d, %x\n",size,ptr);
+	return ptr;
+}
+
+void	btAlignedFreeInternal	(void* ptr)
+{
+	if (!ptr)
+	{
+		return;
+	}
+
+	gNumAlignedFree++;
+//	printf("btAlignedFreeInternal %x\n",ptr);
+	sAlignedFreeFunc(ptr);
+}
+
+#endif //BT_DEBUG_MEMORY_ALLOCATIONS
+
diff --git a/hkl3d/bullet/src/LinearMath/btAlignedAllocator.h b/hkl3d/bullet/src/LinearMath/btAlignedAllocator.h
new file mode 100644
index 0000000..f168f3c
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btAlignedAllocator.h
@@ -0,0 +1,107 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_ALIGNED_ALLOCATOR
+#define BT_ALIGNED_ALLOCATOR
+
+///we probably replace this with our own aligned memory allocator
+///so we replace _aligned_malloc and _aligned_free with our own
+///that is better portable and more predictable
+
+#include "btScalar.h"
+//#define BT_DEBUG_MEMORY_ALLOCATIONS 1
+#ifdef BT_DEBUG_MEMORY_ALLOCATIONS
+
+#define btAlignedAlloc(a,b) \
+		btAlignedAllocInternal(a,b,__LINE__,__FILE__)
+
+#define btAlignedFree(ptr) \
+		btAlignedFreeInternal(ptr,__LINE__,__FILE__)
+
+void*	btAlignedAllocInternal	(size_t size, int alignment,int line,char* filename);
+
+void	btAlignedFreeInternal	(void* ptr,int line,char* filename);
+
+#else
+	void*	btAlignedAllocInternal	(size_t size, int alignment);
+	void	btAlignedFreeInternal	(void* ptr);
+
+	#define btAlignedAlloc(size,alignment) btAlignedAllocInternal(size,alignment)
+	#define btAlignedFree(ptr) btAlignedFreeInternal(ptr)
+
+#endif
+typedef int	size_type;
+
+typedef void *(btAlignedAllocFunc)(size_t size, int alignment);
+typedef void (btAlignedFreeFunc)(void *memblock);
+typedef void *(btAllocFunc)(size_t size);
+typedef void (btFreeFunc)(void *memblock);
+
+///The developer can let all Bullet memory allocations go through a custom memory allocator, using btAlignedAllocSetCustom
+void btAlignedAllocSetCustom(btAllocFunc *allocFunc, btFreeFunc *freeFunc);
+///If the developer has already an custom aligned allocator, then btAlignedAllocSetCustomAligned can be used. The default aligned allocator pre-allocates extra memory using the non-aligned allocator, and instruments it.
+void btAlignedAllocSetCustomAligned(btAlignedAllocFunc *allocFunc, btAlignedFreeFunc *freeFunc);
+
+
+///The btAlignedAllocator is a portable class for aligned memory allocations.
+///Default implementations for unaligned and aligned allocations can be overridden by a custom allocator using btAlignedAllocSetCustom and btAlignedAllocSetCustomAligned.
+template < typename T , unsigned Alignment >
+class btAlignedAllocator {
+	
+	typedef btAlignedAllocator< T , Alignment > self_type;
+	
+public:
+
+	//just going down a list:
+	btAlignedAllocator() {}
+	/*
+	btAlignedAllocator( const self_type & ) {}
+	*/
+
+	template < typename Other >
+	btAlignedAllocator( const btAlignedAllocator< Other , Alignment > & ) {}
+
+	typedef const T*         const_pointer;
+	typedef const T&         const_reference;
+	typedef T*               pointer;
+	typedef T&               reference;
+	typedef T                value_type;
+
+	pointer       address   ( reference        ref ) const                           { return &ref; }
+	const_pointer address   ( const_reference  ref ) const                           { return &ref; }
+	pointer       allocate  ( size_type        n   , const_pointer *      hint = 0 ) {
+		(void)hint;
+		return reinterpret_cast< pointer >(btAlignedAlloc( sizeof(value_type) * n , Alignment ));
+	}
+	void          construct ( pointer          ptr , const value_type &   value    ) { new (ptr) value_type( value ); }
+	void          deallocate( pointer          ptr ) {
+		btAlignedFree( reinterpret_cast< void * >( ptr ) );
+	}
+	void          destroy   ( pointer          ptr )                                 { ptr->~value_type(); }
+	
+
+	template < typename O > struct rebind {
+		typedef btAlignedAllocator< O , Alignment > other;
+	};
+	template < typename O >
+	self_type & operator=( const btAlignedAllocator< O , Alignment > & ) { return *this; }
+
+	friend bool operator==( const self_type & , const self_type & ) { return true; }
+};
+
+
+
+#endif //BT_ALIGNED_ALLOCATOR
+
diff --git a/hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h b/hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h
new file mode 100644
index 0000000..955bb12
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btAlignedObjectArray.h
@@ -0,0 +1,471 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_OBJECT_ARRAY__
+#define BT_OBJECT_ARRAY__
+
+#include "btScalar.h" // has definitions like SIMD_FORCE_INLINE
+#include "btAlignedAllocator.h"
+
+///If the platform doesn't support placement new, you can disable BT_USE_PLACEMENT_NEW
+///then the btAlignedObjectArray doesn't support objects with virtual methods, and non-trivial constructors/destructors
+///You can enable BT_USE_MEMCPY, then swapping elements in the array will use memcpy instead of operator=
+///see discussion here: http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1231 and
+///http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1240
+
+#define BT_USE_PLACEMENT_NEW 1
+//#define BT_USE_MEMCPY 1 //disable, because it is cumbersome to find out for each platform where memcpy is defined. It can be in <memory.h> or <string.h> or otherwise...
+
+#ifdef BT_USE_MEMCPY
+#include <memory.h>
+#include <string.h>
+#endif //BT_USE_MEMCPY
+
+#ifdef BT_USE_PLACEMENT_NEW
+#include <new> //for placement new
+#endif //BT_USE_PLACEMENT_NEW
+
+
+///The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods
+///It is developed to replace stl::vector to avoid portability issues, including STL alignment issues to add SIMD/SSE data
+template <typename T> 
+//template <class T> 
+class btAlignedObjectArray
+{
+	btAlignedAllocator<T , 16>	m_allocator;
+
+	int					m_size;
+	int					m_capacity;
+	T*					m_data;
+	//PCK: added this line
+	bool				m_ownsMemory;
+
+	protected:
+		SIMD_FORCE_INLINE	int	allocSize(int size)
+		{
+			return (size ? size*2 : 1);
+		}
+		SIMD_FORCE_INLINE	void	copy(int start,int end, T* dest) const
+		{
+			int i;
+			for (i=start;i<end;++i)
+#ifdef BT_USE_PLACEMENT_NEW
+				new (&dest[i]) T(m_data[i]);
+#else
+				dest[i] = m_data[i];
+#endif //BT_USE_PLACEMENT_NEW
+		}
+
+		SIMD_FORCE_INLINE	void	init()
+		{
+			//PCK: added this line
+			m_ownsMemory = true;
+			m_data = 0;
+			m_size = 0;
+			m_capacity = 0;
+		}
+		SIMD_FORCE_INLINE	void	destroy(int first,int last)
+		{
+			int i;
+			for (i=first; i<last;i++)
+			{
+				m_data[i].~T();
+			}
+		}
+
+		SIMD_FORCE_INLINE	void* allocate(int size)
+		{
+			if (size)
+				return m_allocator.allocate(size);
+			return 0;
+		}
+
+		SIMD_FORCE_INLINE	void	deallocate()
+		{
+			if(m_data)	{
+				//PCK: enclosed the deallocation in this block
+				if (m_ownsMemory)
+				{
+					m_allocator.deallocate(m_data);
+				}
+				m_data = 0;
+			}
+		}
+
+	
+
+
+	public:
+		
+		btAlignedObjectArray()
+		{
+			init();
+		}
+
+		~btAlignedObjectArray()
+		{
+			clear();
+		}
+
+		///Generally it is best to avoid using the copy constructor of an btAlignedObjectArray, and use a (const) reference to the array instead.
+		btAlignedObjectArray(const btAlignedObjectArray& otherArray)
+		{
+			init();
+
+			int otherSize = otherArray.size();
+			resize (otherSize);
+			otherArray.copy(0, otherSize, m_data);
+		}
+
+		
+		
+		/// return the number of elements in the array
+		SIMD_FORCE_INLINE	int size() const
+		{	
+			return m_size;
+		}
+		
+		SIMD_FORCE_INLINE const T& at(int n) const
+		{
+			return m_data[n];
+		}
+
+		SIMD_FORCE_INLINE T& at(int n)
+		{
+			return m_data[n];
+		}
+
+		SIMD_FORCE_INLINE const T& operator[](int n) const
+		{
+			return m_data[n];
+		}
+
+		SIMD_FORCE_INLINE T& operator[](int n)
+		{
+			return m_data[n];
+		}
+		
+
+		///clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations.
+		SIMD_FORCE_INLINE	void	clear()
+		{
+			destroy(0,size());
+			
+			deallocate();
+			
+			init();
+		}
+
+		SIMD_FORCE_INLINE	void	pop_back()
+		{
+			m_size--;
+			m_data[m_size].~T();
+		}
+
+		///resize changes the number of elements in the array. If the new size is larger, the new elements will be constructed using the optional second argument.
+		///when the new number of elements is smaller, the destructor will be called, but memory will not be freed, to reduce performance overhead of run-time memory (de)allocations.
+		SIMD_FORCE_INLINE	void	resize(int newsize, const T& fillData=T())
+		{
+			int curSize = size();
+
+			if (newsize < curSize)
+			{
+				for(int i = newsize; i < curSize; i++)
+				{
+					m_data[i].~T();
+				}
+			} else
+			{
+				if (newsize > size())
+				{
+					reserve(newsize);
+				}
+#ifdef BT_USE_PLACEMENT_NEW
+				for (int i=curSize;i<newsize;i++)
+				{
+					new ( &m_data[i]) T(fillData);
+				}
+#endif //BT_USE_PLACEMENT_NEW
+
+			}
+
+			m_size = newsize;
+		}
+	
+		SIMD_FORCE_INLINE	T&  expandNonInitializing( )
+		{	
+			int sz = size();
+			if( sz == capacity() )
+			{
+				reserve( allocSize(size()) );
+			}
+			m_size++;
+
+			return m_data[sz];		
+		}
+
+
+		SIMD_FORCE_INLINE	T&  expand( const T& fillValue=T())
+		{	
+			int sz = size();
+			if( sz == capacity() )
+			{
+				reserve( allocSize(size()) );
+			}
+			m_size++;
+#ifdef BT_USE_PLACEMENT_NEW
+			new (&m_data[sz]) T(fillValue); //use the in-place new (not really allocating heap memory)
+#endif
+
+			return m_data[sz];		
+		}
+
+
+		SIMD_FORCE_INLINE	void push_back(const T& _Val)
+		{	
+			int sz = size();
+			if( sz == capacity() )
+			{
+				reserve( allocSize(size()) );
+			}
+			
+#ifdef BT_USE_PLACEMENT_NEW
+			new ( &m_data[m_size] ) T(_Val);
+#else
+			m_data[size()] = _Val;			
+#endif //BT_USE_PLACEMENT_NEW
+
+			m_size++;
+		}
+
+	
+		/// return the pre-allocated (reserved) elements, this is at least as large as the total number of elements,see size() and reserve()
+		SIMD_FORCE_INLINE	int capacity() const
+		{	
+			return m_capacity;
+		}
+		
+		SIMD_FORCE_INLINE	void reserve(int _Count)
+		{	// determine new minimum length of allocated storage
+			if (capacity() < _Count)
+			{	// not enough room, reallocate
+				T*	s = (T*)allocate(_Count);
+
+				copy(0, size(), s);
+
+				destroy(0,size());
+
+				deallocate();
+				
+				//PCK: added this line
+				m_ownsMemory = true;
+
+				m_data = s;
+				
+				m_capacity = _Count;
+
+			}
+		}
+
+
+		class less
+		{
+			public:
+
+				bool operator() ( const T& a, const T& b )
+				{
+					return ( a < b );
+				}
+		};
+	
+		template <typename L>
+		void quickSortInternal(L CompareFunc,int lo, int hi)
+		{
+		//  lo is the lower index, hi is the upper index
+		//  of the region of array a that is to be sorted
+			int i=lo, j=hi;
+			T x=m_data[(lo+hi)/2];
+
+			//  partition
+			do
+			{    
+				while (CompareFunc(m_data[i],x)) 
+					i++; 
+				while (CompareFunc(x,m_data[j])) 
+					j--;
+				if (i<=j)
+				{
+					swap(i,j);
+					i++; j--;
+				}
+			} while (i<=j);
+
+			//  recursion
+			if (lo<j) 
+				quickSortInternal( CompareFunc, lo, j);
+			if (i<hi) 
+				quickSortInternal( CompareFunc, i, hi);
+		}
+
+
+		template <typename L>
+		void quickSort(L CompareFunc)
+		{
+			//don't sort 0 or 1 elements
+			if (size()>1)
+			{
+				quickSortInternal(CompareFunc,0,size()-1);
+			}
+		}
+
+
+		///heap sort from http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Sort/Heap/
+		template <typename L>
+		void downHeap(T *pArr, int k, int n,L CompareFunc)
+		{
+			/*  PRE: a[k+1..N] is a heap */
+			/* POST:  a[k..N]  is a heap */
+			
+			T temp = pArr[k - 1];
+			/* k has child(s) */
+			while (k <= n/2) 
+			{
+				int child = 2*k;
+				
+				if ((child < n) && CompareFunc(pArr[child - 1] , pArr[child]))
+				{
+					child++;
+				}
+				/* pick larger child */
+				if (CompareFunc(temp , pArr[child - 1]))
+				{
+					/* move child up */
+					pArr[k - 1] = pArr[child - 1];
+					k = child;
+				}
+				else
+				{
+					break;
+				}
+			}
+			pArr[k - 1] = temp;
+		} /*downHeap*/
+
+		void	swap(int index0,int index1)
+		{
+#ifdef BT_USE_MEMCPY
+			char	temp[sizeof(T)];
+			memcpy(temp,&m_data[index0],sizeof(T));
+			memcpy(&m_data[index0],&m_data[index1],sizeof(T));
+			memcpy(&m_data[index1],temp,sizeof(T));
+#else
+			T temp = m_data[index0];
+			m_data[index0] = m_data[index1];
+			m_data[index1] = temp;
+#endif //BT_USE_PLACEMENT_NEW
+
+		}
+
+	template <typename L>
+	void heapSort(L CompareFunc)
+	{
+		/* sort a[0..N-1],  N.B. 0 to N-1 */
+		int k;
+		int n = m_size;
+		for (k = n/2; k > 0; k--) 
+		{
+			downHeap(m_data, k, n, CompareFunc);
+		}
+
+		/* a[1..N] is now a heap */
+		while ( n>=1 ) 
+		{
+			swap(0,n-1); /* largest of a[0..n-1] */
+
+
+			n = n - 1;
+			/* restore a[1..i-1] heap */
+			downHeap(m_data, 1, n, CompareFunc);
+		} 
+	}
+
+	///non-recursive binary search, assumes sorted array
+	int	findBinarySearch(const T& key) const
+	{
+		int first = 0;
+		int last = size()-1;
+
+		//assume sorted array
+		while (first <= last) {
+			int mid = (first + last) / 2;  // compute mid point.
+			if (key > m_data[mid]) 
+				first = mid + 1;  // repeat search in top half.
+			else if (key < m_data[mid]) 
+				last = mid - 1; // repeat search in bottom half.
+			else
+				return mid;     // found it. return position /////
+		}
+		return size();    // failed to find key
+	}
+
+
+	int	findLinearSearch(const T& key) const
+	{
+		int index=size();
+		int i;
+
+		for (i=0;i<size();i++)
+		{
+			if (m_data[i] == key)
+			{
+				index = i;
+				break;
+			}
+		}
+		return index;
+	}
+
+	void	remove(const T& key)
+	{
+
+		int findIndex = findLinearSearch(key);
+		if (findIndex<size())
+		{
+			swap( findIndex,size()-1);
+			pop_back();
+		}
+	}
+
+	//PCK: whole function
+	void initializeFromBuffer(void *buffer, int size, int capacity)
+	{
+		clear();
+		m_ownsMemory = false;
+		m_data = (T*)buffer;
+		m_size = size;
+		m_capacity = capacity;
+	}
+
+	void copyFromArray(const btAlignedObjectArray& otherArray)
+	{
+		int otherSize = otherArray.size();
+		resize (otherSize);
+		otherArray.copy(0, otherSize, m_data);
+	}
+
+};
+
+#endif //BT_OBJECT_ARRAY__
diff --git a/hkl3d/bullet/src/LinearMath/btConvexHull.cpp b/hkl3d/bullet/src/LinearMath/btConvexHull.cpp
new file mode 100644
index 0000000..532d76d
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btConvexHull.cpp
@@ -0,0 +1,1174 @@
+/*
+Stan Melax Convex Hull Computation
+Copyright (c) 2003-2006 Stan Melax http://www.melax.com/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include <string.h>
+
+#include "btConvexHull.h"
+#include "btAlignedObjectArray.h"
+#include "btMinMax.h"
+#include "btVector3.h"
+
+
+
+template <class T>
+void Swap(T &a,T &b)
+{
+	T tmp = a;
+	a=b;
+	b=tmp;
+}
+
+
+//----------------------------------
+
+class int3  
+{
+public:
+	int x,y,z;
+	int3(){};
+	int3(int _x,int _y, int _z){x=_x;y=_y;z=_z;}
+	const int& operator[](int i) const {return (&x)[i];}
+	int& operator[](int i) {return (&x)[i];}
+};
+
+
+//------- btPlane ----------
+
+
+inline btPlane PlaneFlip(const btPlane &plane){return btPlane(-plane.normal,-plane.dist);}
+inline int operator==( const btPlane &a, const btPlane &b ) { return (a.normal==b.normal && a.dist==b.dist); }
+inline int coplanar( const btPlane &a, const btPlane &b ) { return (a==b || a==PlaneFlip(b)); }
+
+
+//--------- Utility Functions ------
+
+btVector3  PlaneLineIntersection(const btPlane &plane, const btVector3 &p0, const btVector3 &p1);
+btVector3  PlaneProject(const btPlane &plane, const btVector3 &point);
+
+btVector3  ThreePlaneIntersection(const btPlane &p0,const btPlane &p1, const btPlane &p2);
+btVector3  ThreePlaneIntersection(const btPlane &p0,const btPlane &p1, const btPlane &p2)
+{
+	btVector3 N1 = p0.normal;
+	btVector3 N2 = p1.normal;
+	btVector3 N3 = p2.normal;
+
+	btVector3 n2n3; n2n3 = N2.cross(N3);
+	btVector3 n3n1; n3n1 = N3.cross(N1);
+	btVector3 n1n2; n1n2 = N1.cross(N2);
+
+	btScalar quotient = (N1.dot(n2n3));
+
+	btAssert(btFabs(quotient) > btScalar(0.000001));
+	
+	quotient = btScalar(-1.) / quotient;
+	n2n3 *= p0.dist;
+	n3n1 *= p1.dist;
+	n1n2 *= p2.dist;
+	btVector3 potentialVertex = n2n3;
+	potentialVertex += n3n1;
+	potentialVertex += n1n2;
+	potentialVertex *= quotient;
+
+	btVector3 result(potentialVertex.getX(),potentialVertex.getY(),potentialVertex.getZ());
+	return result;
+
+}
+
+btScalar   DistanceBetweenLines(const btVector3 &ustart, const btVector3 &udir, const btVector3 &vstart, const btVector3 &vdir, btVector3 *upoint=NULL, btVector3 *vpoint=NULL);
+btVector3  TriNormal(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2);
+btVector3  NormalOf(const btVector3 *vert, const int n);
+
+
+btVector3 PlaneLineIntersection(const btPlane &plane, const btVector3 &p0, const btVector3 &p1)
+{
+	// returns the point where the line p0-p1 intersects the plane n&d
+				static btVector3 dif;
+		dif = p1-p0;
+				btScalar dn= btDot(plane.normal,dif);
+				btScalar t = -(plane.dist+btDot(plane.normal,p0) )/dn;
+				return p0 + (dif*t);
+}
+
+btVector3 PlaneProject(const btPlane &plane, const btVector3 &point)
+{
+	return point - plane.normal * (btDot(point,plane.normal)+plane.dist);
+}
+
+btVector3 TriNormal(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2)
+{
+	// return the normal of the triangle
+	// inscribed by v0, v1, and v2
+	btVector3 cp=btCross(v1-v0,v2-v1);
+	btScalar m=cp.length();
+	if(m==0) return btVector3(1,0,0);
+	return cp*(btScalar(1.0)/m);
+}
+
+
+btScalar DistanceBetweenLines(const btVector3 &ustart, const btVector3 &udir, const btVector3 &vstart, const btVector3 &vdir, btVector3 *upoint, btVector3 *vpoint)
+{
+	static btVector3 cp;
+	cp = btCross(udir,vdir).normalized();
+
+	btScalar distu = -btDot(cp,ustart);
+	btScalar distv = -btDot(cp,vstart);
+	btScalar dist = (btScalar)fabs(distu-distv);
+	if(upoint) 
+		{
+		btPlane plane;
+		plane.normal = btCross(vdir,cp).normalized();
+		plane.dist = -btDot(plane.normal,vstart);
+		*upoint = PlaneLineIntersection(plane,ustart,ustart+udir);
+	}
+	if(vpoint) 
+		{
+		btPlane plane;
+		plane.normal = btCross(udir,cp).normalized();
+		plane.dist = -btDot(plane.normal,ustart);
+		*vpoint = PlaneLineIntersection(plane,vstart,vstart+vdir);
+	}
+	return dist;
+}
+
+
+
+
+
+
+
+#define COPLANAR   (0)
+#define UNDER      (1)
+#define OVER       (2)
+#define SPLIT      (OVER|UNDER)
+#define PAPERWIDTH (btScalar(0.001))
+
+btScalar planetestepsilon = PAPERWIDTH;
+
+
+
+typedef ConvexH::HalfEdge HalfEdge;
+
+ConvexH::ConvexH(int vertices_size,int edges_size,int facets_size)
+{
+	vertices.resize(vertices_size);
+	edges.resize(edges_size);
+	facets.resize(facets_size);
+}
+
+
+int PlaneTest(const btPlane &p, const btVector3 &v);
+int PlaneTest(const btPlane &p, const btVector3 &v) {
+	btScalar a  = btDot(v,p.normal)+p.dist;
+	int   flag = (a>planetestepsilon)?OVER:((a<-planetestepsilon)?UNDER:COPLANAR);
+	return flag;
+}
+
+int SplitTest(ConvexH &convex,const btPlane &plane);
+int SplitTest(ConvexH &convex,const btPlane &plane) {
+	int flag=0;
+	for(int i=0;i<convex.vertices.size();i++) {
+		flag |= PlaneTest(plane,convex.vertices[i]);
+	}
+	return flag;
+}
+
+class VertFlag
+{
+public:
+	unsigned char planetest;
+	unsigned char junk;
+	unsigned char undermap;
+	unsigned char overmap;
+};
+class EdgeFlag 
+{
+public:
+	unsigned char planetest;
+	unsigned char fixes;
+	short undermap;
+	short overmap;
+};
+class PlaneFlag
+{
+public:
+	unsigned char undermap;
+	unsigned char overmap;
+};
+class Coplanar{
+public:
+	unsigned short ea;
+	unsigned char v0;
+	unsigned char v1;
+};
+
+
+
+
+
+
+
+
+template<class T>
+int maxdirfiltered(const T *p,int count,const T &dir,btAlignedObjectArray<int> &allow)
+{
+	btAssert(count);
+	int m=-1;
+	for(int i=0;i<count;i++) 
+		if(allow[i])
+		{
+			if(m==-1 || btDot(p[i],dir)>btDot(p[m],dir))
+				m=i;
+		}
+	btAssert(m!=-1);
+	return m;
+} 
+
+btVector3 orth(const btVector3 &v);
+btVector3 orth(const btVector3 &v)
+{
+	btVector3 a=btCross(v,btVector3(0,0,1));
+	btVector3 b=btCross(v,btVector3(0,1,0));
+	if (a.length() > b.length())
+	{
+		return a.normalized();
+	} else {
+		return b.normalized();
+	}
+}
+
+
+template<class T>
+int maxdirsterid(const T *p,int count,const T &dir,btAlignedObjectArray<int> &allow)
+{
+	int m=-1;
+	while(m==-1)
+	{
+		m = maxdirfiltered(p,count,dir,allow);
+		if(allow[m]==3) return m;
+		T u = orth(dir);
+		T v = btCross(u,dir);
+		int ma=-1;
+		for(btScalar x = btScalar(0.0) ; x<= btScalar(360.0) ; x+= btScalar(45.0))
+		{
+			btScalar s = btSin(SIMD_RADS_PER_DEG*(x));
+			btScalar c = btCos(SIMD_RADS_PER_DEG*(x));
+			int mb = maxdirfiltered(p,count,dir+(u*s+v*c)*btScalar(0.025),allow);
+			if(ma==m && mb==m)
+			{
+				allow[m]=3;
+				return m;
+			}
+			if(ma!=-1 && ma!=mb)  // Yuck - this is really ugly
+			{
+				int mc = ma;
+				for(btScalar xx = x-btScalar(40.0) ; xx <= x ; xx+= btScalar(5.0))
+				{
+					btScalar s = btSin(SIMD_RADS_PER_DEG*(xx));
+					btScalar c = btCos(SIMD_RADS_PER_DEG*(xx));
+					int md = maxdirfiltered(p,count,dir+(u*s+v*c)*btScalar(0.025),allow);
+					if(mc==m && md==m)
+					{
+						allow[m]=3;
+						return m;
+					}
+					mc=md;
+				}
+			}
+			ma=mb;
+		}
+		allow[m]=0;
+		m=-1;
+	}
+	btAssert(0);
+	return m;
+} 
+
+
+
+
+int operator ==(const int3 &a,const int3 &b);
+int operator ==(const int3 &a,const int3 &b) 
+{
+	for(int i=0;i<3;i++) 
+	{
+		if(a[i]!=b[i]) return 0;
+	}
+	return 1;
+}
+
+
+int above(btVector3* vertices,const int3& t, const btVector3 &p, btScalar epsilon);
+int above(btVector3* vertices,const int3& t, const btVector3 &p, btScalar epsilon) 
+{
+	btVector3 n=TriNormal(vertices[t[0]],vertices[t[1]],vertices[t[2]]);
+	return (btDot(n,p-vertices[t[0]]) > epsilon); // EPSILON???
+}
+int hasedge(const int3 &t, int a,int b);
+int hasedge(const int3 &t, int a,int b)
+{
+	for(int i=0;i<3;i++)
+	{
+		int i1= (i+1)%3;
+		if(t[i]==a && t[i1]==b) return 1;
+	}
+	return 0;
+}
+int hasvert(const int3 &t, int v);
+int hasvert(const int3 &t, int v)
+{
+	return (t[0]==v || t[1]==v || t[2]==v) ;
+}
+int shareedge(const int3 &a,const int3 &b);
+int shareedge(const int3 &a,const int3 &b)
+{
+	int i;
+	for(i=0;i<3;i++)
+	{
+		int i1= (i+1)%3;
+		if(hasedge(a,b[i1],b[i])) return 1;
+	}
+	return 0;
+}
+
+class btHullTriangle;
+
+
+
+class btHullTriangle : public int3
+{
+public:
+	int3 n;
+	int id;
+	int vmax;
+	btScalar rise;
+	btHullTriangle(int a,int b,int c):int3(a,b,c),n(-1,-1,-1)
+	{
+		vmax=-1;
+		rise = btScalar(0.0);
+	}
+	~btHullTriangle()
+	{
+	}
+	int &neib(int a,int b);
+};
+
+
+int &btHullTriangle::neib(int a,int b)
+{
+	static int er=-1;
+	int i;
+	for(i=0;i<3;i++) 
+	{
+		int i1=(i+1)%3;
+		int i2=(i+2)%3;
+		if((*this)[i]==a && (*this)[i1]==b) return n[i2];
+		if((*this)[i]==b && (*this)[i1]==a) return n[i2];
+	}
+	btAssert(0);
+	return er;
+}
+void HullLibrary::b2bfix(btHullTriangle* s,btHullTriangle*t)
+{
+	int i;
+	for(i=0;i<3;i++) 
+	{
+		int i1=(i+1)%3;
+		int i2=(i+2)%3;
+		int a = (*s)[i1];
+		int b = (*s)[i2];
+		btAssert(m_tris[s->neib(a,b)]->neib(b,a) == s->id);
+		btAssert(m_tris[t->neib(a,b)]->neib(b,a) == t->id);
+		m_tris[s->neib(a,b)]->neib(b,a) = t->neib(b,a);
+		m_tris[t->neib(b,a)]->neib(a,b) = s->neib(a,b);
+	}
+}
+
+void HullLibrary::removeb2b(btHullTriangle* s,btHullTriangle*t)
+{
+	b2bfix(s,t);
+	deAllocateTriangle(s);
+
+	deAllocateTriangle(t);
+}
+
+void HullLibrary::checkit(btHullTriangle *t)
+{
+	(void)t;
+
+	int i;
+	btAssert(m_tris[t->id]==t);
+	for(i=0;i<3;i++)
+	{
+		int i1=(i+1)%3;
+		int i2=(i+2)%3;
+		int a = (*t)[i1];
+		int b = (*t)[i2];
+
+		// release compile fix
+		(void)i1;
+		(void)i2;
+		(void)a;
+		(void)b;
+
+		btAssert(a!=b);
+		btAssert( m_tris[t->n[i]]->neib(b,a) == t->id);
+	}
+}
+
+btHullTriangle*	HullLibrary::allocateTriangle(int a,int b,int c)
+{
+	void* mem = btAlignedAlloc(sizeof(btHullTriangle),16);
+	btHullTriangle* tr = new (mem)btHullTriangle(a,b,c);
+	tr->id = m_tris.size();
+	m_tris.push_back(tr);
+
+	return tr;
+}
+
+void	HullLibrary::deAllocateTriangle(btHullTriangle* tri)
+{
+	btAssert(m_tris[tri->id]==tri);
+	m_tris[tri->id]=NULL;
+	tri->~btHullTriangle();
+	btAlignedFree(tri);
+}
+
+
+void HullLibrary::extrude(btHullTriangle *t0,int v)
+{
+	int3 t= *t0;
+	int n = m_tris.size();
+	btHullTriangle* ta = allocateTriangle(v,t[1],t[2]);
+	ta->n = int3(t0->n[0],n+1,n+2);
+	m_tris[t0->n[0]]->neib(t[1],t[2]) = n+0;
+	btHullTriangle* tb = allocateTriangle(v,t[2],t[0]);
+	tb->n = int3(t0->n[1],n+2,n+0);
+	m_tris[t0->n[1]]->neib(t[2],t[0]) = n+1;
+	btHullTriangle* tc = allocateTriangle(v,t[0],t[1]);
+	tc->n = int3(t0->n[2],n+0,n+1);
+	m_tris[t0->n[2]]->neib(t[0],t[1]) = n+2;
+	checkit(ta);
+	checkit(tb);
+	checkit(tc);
+	if(hasvert(*m_tris[ta->n[0]],v)) removeb2b(ta,m_tris[ta->n[0]]);
+	if(hasvert(*m_tris[tb->n[0]],v)) removeb2b(tb,m_tris[tb->n[0]]);
+	if(hasvert(*m_tris[tc->n[0]],v)) removeb2b(tc,m_tris[tc->n[0]]);
+	deAllocateTriangle(t0);
+
+}
+
+btHullTriangle* HullLibrary::extrudable(btScalar epsilon)
+{
+	int i;
+	btHullTriangle *t=NULL;
+	for(i=0;i<m_tris.size();i++)
+	{
+		if(!t || (m_tris[i] && t->rise<m_tris[i]->rise))
+		{
+			t = m_tris[i];
+		}
+	}
+	return (t->rise >epsilon)?t:NULL ;
+}
+
+
+
+
+int4 HullLibrary::FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow)
+{
+	btVector3 basis[3];
+	basis[0] = btVector3( btScalar(0.01), btScalar(0.02), btScalar(1.0) );      
+	int p0 = maxdirsterid(verts,verts_count, basis[0],allow);   
+	int	p1 = maxdirsterid(verts,verts_count,-basis[0],allow);
+	basis[0] = verts[p0]-verts[p1];
+	if(p0==p1 || basis[0]==btVector3(0,0,0)) 
+		return int4(-1,-1,-1,-1);
+	basis[1] = btCross(btVector3(     btScalar(1),btScalar(0.02), btScalar(0)),basis[0]);
+	basis[2] = btCross(btVector3(btScalar(-0.02),     btScalar(1), btScalar(0)),basis[0]);
+	if (basis[1].length() > basis[2].length())
+	{
+		basis[1].normalize();
+	} else {
+		basis[1] = basis[2];
+		basis[1].normalize ();
+	}
+	int p2 = maxdirsterid(verts,verts_count,basis[1],allow);
+	if(p2 == p0 || p2 == p1)
+	{
+		p2 = maxdirsterid(verts,verts_count,-basis[1],allow);
+	}
+	if(p2 == p0 || p2 == p1) 
+		return int4(-1,-1,-1,-1);
+	basis[1] = verts[p2] - verts[p0];
+	basis[2] = btCross(basis[1],basis[0]).normalized();
+	int p3 = maxdirsterid(verts,verts_count,basis[2],allow);
+	if(p3==p0||p3==p1||p3==p2) p3 = maxdirsterid(verts,verts_count,-basis[2],allow);
+	if(p3==p0||p3==p1||p3==p2) 
+		return int4(-1,-1,-1,-1);
+	btAssert(!(p0==p1||p0==p2||p0==p3||p1==p2||p1==p3||p2==p3));
+	if(btDot(verts[p3]-verts[p0],btCross(verts[p1]-verts[p0],verts[p2]-verts[p0])) <0) {Swap(p2,p3);}
+	return int4(p0,p1,p2,p3);
+}
+
+int HullLibrary::calchullgen(btVector3 *verts,int verts_count, int vlimit)
+{
+	if(verts_count <4) return 0;
+	if(vlimit==0) vlimit=1000000000;
+	int j;
+	btVector3 bmin(*verts),bmax(*verts);
+	btAlignedObjectArray<int> isextreme;
+	isextreme.reserve(verts_count);
+	btAlignedObjectArray<int> allow;
+	allow.reserve(verts_count);
+
+	for(j=0;j<verts_count;j++) 
+	{
+		allow.push_back(1);
+		isextreme.push_back(0);
+		bmin.setMin (verts[j]);
+		bmax.setMax (verts[j]);
+	}
+	btScalar epsilon = (bmax-bmin).length() * btScalar(0.001);
+	btAssert (epsilon != 0.0);
+
+
+	int4 p = FindSimplex(verts,verts_count,allow);
+	if(p.x==-1) return 0; // simplex failed
+
+
+
+	btVector3 center = (verts[p[0]]+verts[p[1]]+verts[p[2]]+verts[p[3]]) / btScalar(4.0);  // a valid interior point
+	btHullTriangle *t0 = allocateTriangle(p[2],p[3],p[1]); t0->n=int3(2,3,1);
+	btHullTriangle *t1 = allocateTriangle(p[3],p[2],p[0]); t1->n=int3(3,2,0);
+	btHullTriangle *t2 = allocateTriangle(p[0],p[1],p[3]); t2->n=int3(0,1,3);
+	btHullTriangle *t3 = allocateTriangle(p[1],p[0],p[2]); t3->n=int3(1,0,2);
+	isextreme[p[0]]=isextreme[p[1]]=isextreme[p[2]]=isextreme[p[3]]=1;
+	checkit(t0);checkit(t1);checkit(t2);checkit(t3);
+
+	for(j=0;j<m_tris.size();j++)
+	{
+		btHullTriangle *t=m_tris[j];
+		btAssert(t);
+		btAssert(t->vmax<0);
+		btVector3 n=TriNormal(verts[(*t)[0]],verts[(*t)[1]],verts[(*t)[2]]);
+		t->vmax = maxdirsterid(verts,verts_count,n,allow);
+		t->rise = btDot(n,verts[t->vmax]-verts[(*t)[0]]);
+	}
+	btHullTriangle *te;
+	vlimit-=4;
+	while(vlimit >0 && ((te=extrudable(epsilon)) != 0))
+	{
+		int3 ti=*te;
+		int v=te->vmax;
+		btAssert(v != -1);
+		btAssert(!isextreme[v]);  // wtf we've already done this vertex
+		isextreme[v]=1;
+		//if(v==p0 || v==p1 || v==p2 || v==p3) continue; // done these already
+		j=m_tris.size();
+		while(j--) {
+			if(!m_tris[j]) continue;
+			int3 t=*m_tris[j];
+			if(above(verts,t,verts[v],btScalar(0.01)*epsilon)) 
+			{
+				extrude(m_tris[j],v);
+			}
+		}
+		// now check for those degenerate cases where we have a flipped triangle or a really skinny triangle
+		j=m_tris.size();
+		while(j--)
+		{
+			if(!m_tris[j]) continue;
+			if(!hasvert(*m_tris[j],v)) break;
+			int3 nt=*m_tris[j];
+			if(above(verts,nt,center,btScalar(0.01)*epsilon)  || btCross(verts[nt[1]]-verts[nt[0]],verts[nt[2]]-verts[nt[1]]).length()< epsilon*epsilon*btScalar(0.1) )
+			{
+				btHullTriangle *nb = m_tris[m_tris[j]->n[0]];
+				btAssert(nb);btAssert(!hasvert(*nb,v));btAssert(nb->id<j);
+				extrude(nb,v);
+				j=m_tris.size(); 
+			}
+		} 
+		j=m_tris.size();
+		while(j--)
+		{
+			btHullTriangle *t=m_tris[j];
+			if(!t) continue;
+			if(t->vmax>=0) break;
+			btVector3 n=TriNormal(verts[(*t)[0]],verts[(*t)[1]],verts[(*t)[2]]);
+			t->vmax = maxdirsterid(verts,verts_count,n,allow);
+			if(isextreme[t->vmax]) 
+			{
+				t->vmax=-1; // already done that vertex - algorithm needs to be able to terminate.
+			}
+			else
+			{
+				t->rise = btDot(n,verts[t->vmax]-verts[(*t)[0]]);
+			}
+		}
+		vlimit --;
+	}
+	return 1;
+}
+
+int HullLibrary::calchull(btVector3 *verts,int verts_count, TUIntArray& tris_out, int &tris_count,int vlimit) 
+{
+	int rc=calchullgen(verts,verts_count,  vlimit) ;
+	if(!rc) return 0;
+	btAlignedObjectArray<int> ts;
+	int i;
+
+	for(i=0;i<m_tris.size();i++)
+	{
+		if(m_tris[i])
+		{
+			for(int j=0;j<3;j++)
+				ts.push_back((*m_tris[i])[j]);
+			deAllocateTriangle(m_tris[i]);
+		}
+	}
+	tris_count = ts.size()/3;
+	tris_out.resize(ts.size());
+	
+	for (i=0;i<ts.size();i++)
+	{
+		tris_out[i] = static_cast<unsigned int>(ts[i]);
+	}
+	m_tris.resize(0);
+
+	return 1;
+}
+
+
+
+
+
+bool HullLibrary::ComputeHull(unsigned int vcount,const btVector3 *vertices,PHullResult &result,unsigned int vlimit)
+{
+	
+	int    tris_count;
+	int ret = calchull( (btVector3 *) vertices, (int) vcount, result.m_Indices, tris_count, static_cast<int>(vlimit) );
+	if(!ret) return false;
+	result.mIndexCount = (unsigned int) (tris_count*3);
+	result.mFaceCount  = (unsigned int) tris_count;
+	result.mVertices   = (btVector3*) vertices;
+	result.mVcount     = (unsigned int) vcount;
+	return true;
+
+}
+
+
+void ReleaseHull(PHullResult &result);
+void ReleaseHull(PHullResult &result)
+{
+	if ( result.m_Indices.size() )
+	{
+		result.m_Indices.clear();
+	}
+
+	result.mVcount = 0;
+	result.mIndexCount = 0;
+	result.mVertices = 0;
+}
+
+
+//*********************************************************************
+//*********************************************************************
+//********  HullLib header
+//*********************************************************************
+//*********************************************************************
+
+//*********************************************************************
+//*********************************************************************
+//********  HullLib implementation
+//*********************************************************************
+//*********************************************************************
+
+HullError HullLibrary::CreateConvexHull(const HullDesc       &desc,           // describes the input request
+																					HullResult           &result)         // contains the resulst
+{
+	HullError ret = QE_FAIL;
+
+
+	PHullResult hr;
+
+	unsigned int vcount = desc.mVcount;
+	if ( vcount < 8 ) vcount = 8;
+
+	btAlignedObjectArray<btVector3> vertexSource;
+	vertexSource.resize(static_cast<int>(vcount));
+
+	btVector3 scale;
+
+	unsigned int ovcount;
+
+	bool ok = CleanupVertices(desc.mVcount,desc.mVertices, desc.mVertexStride, ovcount, &vertexSource[0], desc.mNormalEpsilon, scale ); // normalize point cloud, remove duplicates!
+
+	if ( ok )
+	{
+
+
+//		if ( 1 ) // scale vertices back to their original size.
+		{
+			for (unsigned int i=0; i<ovcount; i++)
+			{
+				btVector3& v = vertexSource[static_cast<int>(i)];
+				v[0]*=scale[0];
+				v[1]*=scale[1];
+				v[2]*=scale[2];
+			}
+		}
+
+		ok = ComputeHull(ovcount,&vertexSource[0],hr,desc.mMaxVertices);
+
+		if ( ok )
+		{
+
+			// re-index triangle mesh so it refers to only used vertices, rebuild a new vertex table.
+			btAlignedObjectArray<btVector3>	vertexScratch;
+			vertexScratch.resize(static_cast<int>(hr.mVcount));
+
+			BringOutYourDead(hr.mVertices,hr.mVcount, &vertexScratch[0], ovcount, &hr.m_Indices[0], hr.mIndexCount );
+
+			ret = QE_OK;
+
+			if ( desc.HasHullFlag(QF_TRIANGLES) ) // if he wants the results as triangle!
+			{
+				result.mPolygons          = false;
+				result.mNumOutputVertices = ovcount;
+				result.m_OutputVertices.resize(static_cast<int>(ovcount));
+				result.mNumFaces          = hr.mFaceCount;
+				result.mNumIndices        = hr.mIndexCount;
+
+				result.m_Indices.resize(static_cast<int>(hr.mIndexCount));
+
+				memcpy(&result.m_OutputVertices[0], &vertexScratch[0], sizeof(btVector3)*ovcount );
+
+  			if ( desc.HasHullFlag(QF_REVERSE_ORDER) )
+				{
+
+					const unsigned int *source = &hr.m_Indices[0];
+					unsigned int *dest   = &result.m_Indices[0];
+
+					for (unsigned int i=0; i<hr.mFaceCount; i++)
+					{
+						dest[0] = source[2];
+						dest[1] = source[1];
+						dest[2] = source[0];
+						dest+=3;
+						source+=3;
+					}
+
+				}
+				else
+				{
+					memcpy(&result.m_Indices[0], &hr.m_Indices[0], sizeof(unsigned int)*hr.mIndexCount);
+				}
+			}
+			else
+			{
+				result.mPolygons          = true;
+				result.mNumOutputVertices = ovcount;
+				result.m_OutputVertices.resize(static_cast<int>(ovcount));
+				result.mNumFaces          = hr.mFaceCount;
+				result.mNumIndices        = hr.mIndexCount+hr.mFaceCount;
+				result.m_Indices.resize(static_cast<int>(result.mNumIndices));
+				memcpy(&result.m_OutputVertices[0], &vertexScratch[0], sizeof(btVector3)*ovcount );
+
+//				if ( 1 )
+				{
+					const unsigned int *source = &hr.m_Indices[0];
+					unsigned int *dest   = &result.m_Indices[0];
+					for (unsigned int i=0; i<hr.mFaceCount; i++)
+					{
+						dest[0] = 3;
+						if ( desc.HasHullFlag(QF_REVERSE_ORDER) )
+						{
+							dest[1] = source[2];
+							dest[2] = source[1];
+							dest[3] = source[0];
+						}
+						else
+						{
+							dest[1] = source[0];
+							dest[2] = source[1];
+							dest[3] = source[2];
+						}
+
+						dest+=4;
+						source+=3;
+					}
+				}
+			}
+			ReleaseHull(hr);
+		}
+	}
+
+	return ret;
+}
+
+
+
+HullError HullLibrary::ReleaseResult(HullResult &result) // release memory allocated for this result, we are done with it.
+{
+	if ( result.m_OutputVertices.size())
+	{
+		result.mNumOutputVertices=0;
+		result.m_OutputVertices.clear();
+	}
+	if ( result.m_Indices.size() )
+	{
+		result.mNumIndices=0;
+		result.m_Indices.clear();
+	}
+	return QE_OK;
+}
+
+
+static void addPoint(unsigned int &vcount,btVector3 *p,btScalar x,btScalar y,btScalar z)
+{
+	// XXX, might be broken
+	btVector3& dest = p[vcount];
+	dest[0] = x;
+	dest[1] = y;
+	dest[2] = z;
+	vcount++;
+}
+
+btScalar GetDist(btScalar px,btScalar py,btScalar pz,const btScalar *p2);
+btScalar GetDist(btScalar px,btScalar py,btScalar pz,const btScalar *p2)
+{
+
+	btScalar dx = px - p2[0];
+	btScalar dy = py - p2[1];
+	btScalar dz = pz - p2[2];
+
+	return dx*dx+dy*dy+dz*dz;
+}
+
+
+
+bool  HullLibrary::CleanupVertices(unsigned int svcount,
+				   const btVector3 *svertices,
+				   unsigned int stride,
+				   unsigned int &vcount,       // output number of vertices
+				   btVector3 *vertices,                 // location to store the results.
+				   btScalar  normalepsilon,
+				   btVector3& scale)
+{
+	if ( svcount == 0 ) return false;
+
+	m_vertexIndexMapping.resize(0);
+
+
+#define EPSILON btScalar(0.000001) /* close enough to consider two btScalaring point numbers to be 'the same'. */
+
+	vcount = 0;
+
+	btScalar recip[3]={0.f,0.f,0.f};
+
+	if ( scale )
+	{
+		scale[0] = 1;
+		scale[1] = 1;
+		scale[2] = 1;
+	}
+
+	btScalar bmin[3] = {  FLT_MAX,  FLT_MAX,  FLT_MAX };
+	btScalar bmax[3] = { -FLT_MAX, -FLT_MAX, -FLT_MAX };
+
+	const char *vtx = (const char *) svertices;
+
+//	if ( 1 )
+	{
+		for (unsigned int i=0; i<svcount; i++)
+		{
+			const btScalar *p = (const btScalar *) vtx;
+
+			vtx+=stride;
+
+			for (int j=0; j<3; j++)
+			{
+				if ( p[j] < bmin[j] ) bmin[j] = p[j];
+				if ( p[j] > bmax[j] ) bmax[j] = p[j];
+			}
+		}
+	}
+
+	btScalar dx = bmax[0] - bmin[0];
+	btScalar dy = bmax[1] - bmin[1];
+	btScalar dz = bmax[2] - bmin[2];
+
+	btVector3 center;
+
+	center[0] = dx*btScalar(0.5) + bmin[0];
+	center[1] = dy*btScalar(0.5) + bmin[1];
+	center[2] = dz*btScalar(0.5) + bmin[2];
+
+	if ( dx < EPSILON || dy < EPSILON || dz < EPSILON || svcount < 3 )
+	{
+
+		btScalar len = FLT_MAX;
+
+		if ( dx > EPSILON && dx < len ) len = dx;
+		if ( dy > EPSILON && dy < len ) len = dy;
+		if ( dz > EPSILON && dz < len ) len = dz;
+
+		if ( len == FLT_MAX )
+		{
+			dx = dy = dz = btScalar(0.01); // one centimeter
+		}
+		else
+		{
+			if ( dx < EPSILON ) dx = len * btScalar(0.05); // 1/5th the shortest non-zero edge.
+			if ( dy < EPSILON ) dy = len * btScalar(0.05);
+			if ( dz < EPSILON ) dz = len * btScalar(0.05);
+		}
+
+		btScalar x1 = center[0] - dx;
+		btScalar x2 = center[0] + dx;
+
+		btScalar y1 = center[1] - dy;
+		btScalar y2 = center[1] + dy;
+
+		btScalar z1 = center[2] - dz;
+		btScalar z2 = center[2] + dz;
+
+		addPoint(vcount,vertices,x1,y1,z1);
+		addPoint(vcount,vertices,x2,y1,z1);
+		addPoint(vcount,vertices,x2,y2,z1);
+		addPoint(vcount,vertices,x1,y2,z1);
+		addPoint(vcount,vertices,x1,y1,z2);
+		addPoint(vcount,vertices,x2,y1,z2);
+		addPoint(vcount,vertices,x2,y2,z2);
+		addPoint(vcount,vertices,x1,y2,z2);
+
+		return true; // return cube
+
+
+	}
+	else
+	{
+		if ( scale )
+		{
+			scale[0] = dx;
+			scale[1] = dy;
+			scale[2] = dz;
+
+			recip[0] = 1 / dx;
+			recip[1] = 1 / dy;
+			recip[2] = 1 / dz;
+
+			center[0]*=recip[0];
+			center[1]*=recip[1];
+			center[2]*=recip[2];
+
+		}
+
+	}
+
+
+
+	vtx = (const char *) svertices;
+
+	for (unsigned int i=0; i<svcount; i++)
+	{
+		const btVector3 *p = (const btVector3 *)vtx;
+		vtx+=stride;
+
+		btScalar px = p->getX();
+		btScalar py = p->getY();
+		btScalar pz = p->getZ();
+
+		if ( scale )
+		{
+			px = px*recip[0]; // normalize
+			py = py*recip[1]; // normalize
+			pz = pz*recip[2]; // normalize
+		}
+
+//		if ( 1 )
+		{
+			unsigned int j;
+
+			for (j=0; j<vcount; j++)
+			{
+				/// XXX might be broken
+				btVector3& v = vertices[j];
+
+				btScalar x = v[0];
+				btScalar y = v[1];
+				btScalar z = v[2];
+
+				btScalar dx = btFabs(x - px );
+				btScalar dy = btFabs(y - py );
+				btScalar dz = btFabs(z - pz );
+
+				if ( dx < normalepsilon && dy < normalepsilon && dz < normalepsilon )
+				{
+					// ok, it is close enough to the old one
+					// now let us see if it is further from the center of the point cloud than the one we already recorded.
+					// in which case we keep this one instead.
+
+					btScalar dist1 = GetDist(px,py,pz,center);
+					btScalar dist2 = GetDist(v[0],v[1],v[2],center);
+
+					if ( dist1 > dist2 )
+					{
+						v[0] = px;
+						v[1] = py;
+						v[2] = pz;
+						
+					}
+
+					break;
+				}
+			}
+
+			if ( j == vcount )
+			{
+				btVector3& dest = vertices[vcount];
+				dest[0] = px;
+				dest[1] = py;
+				dest[2] = pz;
+				vcount++;
+			}
+			m_vertexIndexMapping.push_back(j);
+		}
+	}
+
+	// ok..now make sure we didn't prune so many vertices it is now invalid.
+//	if ( 1 )
+	{
+		btScalar bmin[3] = {  FLT_MAX,  FLT_MAX,  FLT_MAX };
+		btScalar bmax[3] = { -FLT_MAX, -FLT_MAX, -FLT_MAX };
+
+		for (unsigned int i=0; i<vcount; i++)
+		{
+			const btVector3& p = vertices[i];
+			for (int j=0; j<3; j++)
+			{
+				if ( p[j] < bmin[j] ) bmin[j] = p[j];
+				if ( p[j] > bmax[j] ) bmax[j] = p[j];
+			}
+		}
+
+		btScalar dx = bmax[0] - bmin[0];
+		btScalar dy = bmax[1] - bmin[1];
+		btScalar dz = bmax[2] - bmin[2];
+
+		if ( dx < EPSILON || dy < EPSILON || dz < EPSILON || vcount < 3)
+		{
+			btScalar cx = dx*btScalar(0.5) + bmin[0];
+			btScalar cy = dy*btScalar(0.5) + bmin[1];
+			btScalar cz = dz*btScalar(0.5) + bmin[2];
+
+			btScalar len = FLT_MAX;
+
+			if ( dx >= EPSILON && dx < len ) len = dx;
+			if ( dy >= EPSILON && dy < len ) len = dy;
+			if ( dz >= EPSILON && dz < len ) len = dz;
+
+			if ( len == FLT_MAX )
+			{
+				dx = dy = dz = btScalar(0.01); // one centimeter
+			}
+			else
+			{
+				if ( dx < EPSILON ) dx = len * btScalar(0.05); // 1/5th the shortest non-zero edge.
+				if ( dy < EPSILON ) dy = len * btScalar(0.05);
+				if ( dz < EPSILON ) dz = len * btScalar(0.05);
+			}
+
+			btScalar x1 = cx - dx;
+			btScalar x2 = cx + dx;
+
+			btScalar y1 = cy - dy;
+			btScalar y2 = cy + dy;
+
+			btScalar z1 = cz - dz;
+			btScalar z2 = cz + dz;
+
+			vcount = 0; // add box
+
+			addPoint(vcount,vertices,x1,y1,z1);
+			addPoint(vcount,vertices,x2,y1,z1);
+			addPoint(vcount,vertices,x2,y2,z1);
+			addPoint(vcount,vertices,x1,y2,z1);
+			addPoint(vcount,vertices,x1,y1,z2);
+			addPoint(vcount,vertices,x2,y1,z2);
+			addPoint(vcount,vertices,x2,y2,z2);
+			addPoint(vcount,vertices,x1,y2,z2);
+
+			return true;
+		}
+	}
+
+	return true;
+}
+
+void HullLibrary::BringOutYourDead(const btVector3* verts,unsigned int vcount, btVector3* overts,unsigned int &ocount,unsigned int *indices,unsigned indexcount)
+{
+	btAlignedObjectArray<int>tmpIndices;
+	tmpIndices.resize(m_vertexIndexMapping.size());
+	int i;
+
+	for (i=0;i<m_vertexIndexMapping.size();i++)
+	{
+		tmpIndices[i] = m_vertexIndexMapping[i];
+	}
+
+	TUIntArray usedIndices;
+	usedIndices.resize(static_cast<int>(vcount));
+	memset(&usedIndices[0],0,sizeof(unsigned int)*vcount);
+
+	ocount = 0;
+
+	for (i=0; i<int (indexcount); i++)
+	{
+		unsigned int v = indices[i]; // original array index
+
+		btAssert( v >= 0 && v < vcount );
+
+		if ( usedIndices[static_cast<int>(v)] ) // if already remapped
+		{
+			indices[i] = usedIndices[static_cast<int>(v)]-1; // index to new array
+		}
+		else
+		{
+
+			indices[i] = ocount;      // new index mapping
+
+			overts[ocount][0] = verts[v][0]; // copy old vert to new vert array
+			overts[ocount][1] = verts[v][1];
+			overts[ocount][2] = verts[v][2];
+
+			for (int k=0;k<m_vertexIndexMapping.size();k++)
+			{
+				if (tmpIndices[k]==int(v))
+					m_vertexIndexMapping[k]=ocount;
+			}
+
+			ocount++; // increment output vert count
+
+			btAssert( ocount >=0 && ocount <= vcount );
+
+			usedIndices[static_cast<int>(v)] = ocount; // assign new index remapping
+
+		
+		}
+	}
+
+	
+}
diff --git a/hkl3d/bullet/src/LinearMath/btConvexHull.h b/hkl3d/bullet/src/LinearMath/btConvexHull.h
new file mode 100644
index 0000000..69c52bc
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btConvexHull.h
@@ -0,0 +1,241 @@
+
+/*
+Stan Melax Convex Hull Computation
+Copyright (c) 2008 Stan Melax http://www.melax.com/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+///includes modifications/improvements by John Ratcliff, see BringOutYourDead below.
+
+#ifndef BT_CD_HULL_H
+#define BT_CD_HULL_H
+
+#include "btVector3.h"
+#include "btAlignedObjectArray.h"
+
+typedef btAlignedObjectArray<unsigned int> TUIntArray;
+
+class HullResult
+{
+public:
+	HullResult(void)
+	{
+		mPolygons = true;
+		mNumOutputVertices = 0;
+		mNumFaces = 0;
+		mNumIndices = 0;
+	}
+	bool                    mPolygons;                  // true if indices represents polygons, false indices are triangles
+	unsigned int            mNumOutputVertices;         // number of vertices in the output hull
+	btAlignedObjectArray<btVector3>	m_OutputVertices;            // array of vertices
+	unsigned int            mNumFaces;                  // the number of faces produced
+	unsigned int            mNumIndices;                // the total number of indices
+	btAlignedObjectArray<unsigned int>    m_Indices;                   // pointer to indices.
+
+// If triangles, then indices are array indexes into the vertex list.
+// If polygons, indices are in the form (number of points in face) (p1, p2, p3, ..) etc..
+};
+
+enum HullFlag
+{
+	QF_TRIANGLES         = (1<<0),             // report results as triangles, not polygons.
+	QF_REVERSE_ORDER     = (1<<1),             // reverse order of the triangle indices.
+	QF_DEFAULT           = QF_TRIANGLES
+};
+
+
+class HullDesc
+{
+public:
+	HullDesc(void)
+	{
+		mFlags          = QF_DEFAULT;
+		mVcount         = 0;
+		mVertices       = 0;
+		mVertexStride   = sizeof(btVector3);
+		mNormalEpsilon  = 0.001f;
+		mMaxVertices	= 4096; // maximum number of points to be considered for a convex hull.
+		mMaxFaces	= 4096;
+	};
+
+	HullDesc(HullFlag flag,
+		 unsigned int vcount,
+		 const btVector3 *vertices,
+		 unsigned int stride = sizeof(btVector3))
+	{
+		mFlags          = flag;
+		mVcount         = vcount;
+		mVertices       = vertices;
+		mVertexStride   = stride;
+		mNormalEpsilon  = btScalar(0.001);
+		mMaxVertices    = 4096;
+	}
+
+	bool HasHullFlag(HullFlag flag) const
+	{
+		if ( mFlags & flag ) return true;
+		return false;
+	}
+
+	void SetHullFlag(HullFlag flag)
+	{
+		mFlags|=flag;
+	}
+
+	void ClearHullFlag(HullFlag flag)
+	{
+		mFlags&=~flag;
+	}
+
+	unsigned int      mFlags;           // flags to use when generating the convex hull.
+	unsigned int      mVcount;          // number of vertices in the input point cloud
+	const btVector3  *mVertices;        // the array of vertices.
+	unsigned int      mVertexStride;    // the stride of each vertex, in bytes.
+	btScalar             mNormalEpsilon;   // the epsilon for removing duplicates.  This is a normalized value, if normalized bit is on.
+	unsigned int      mMaxVertices;     // maximum number of vertices to be considered for the hull!
+	unsigned int      mMaxFaces;
+};
+
+enum HullError
+{
+	QE_OK,            // success!
+	QE_FAIL           // failed.
+};
+
+class btPlane
+{
+	public:
+	btVector3	normal;
+	btScalar	dist;   // distance below origin - the D from plane equasion Ax+By+Cz+D=0
+			btPlane(const btVector3 &n,btScalar d):normal(n),dist(d){}
+			btPlane():normal(),dist(0){}
+	
+};
+
+
+
+class ConvexH 
+{
+  public:
+	class HalfEdge
+	{
+	  public:
+		short ea;         // the other half of the edge (index into edges list)
+		unsigned char v;  // the vertex at the start of this edge (index into vertices list)
+		unsigned char p;  // the facet on which this edge lies (index into facets list)
+		HalfEdge(){}
+		HalfEdge(short _ea,unsigned char _v, unsigned char _p):ea(_ea),v(_v),p(_p){}
+	};
+	ConvexH()
+	{
+	}
+	~ConvexH()
+	{
+	}
+	btAlignedObjectArray<btVector3> vertices;
+	btAlignedObjectArray<HalfEdge> edges;
+	btAlignedObjectArray<btPlane>  facets;
+	ConvexH(int vertices_size,int edges_size,int facets_size);
+};
+
+
+class int4
+{
+public:
+	int x,y,z,w;
+	int4(){};
+	int4(int _x,int _y, int _z,int _w){x=_x;y=_y;z=_z;w=_w;}
+	const int& operator[](int i) const {return (&x)[i];}
+	int& operator[](int i) {return (&x)[i];}
+};
+
+class PHullResult
+{
+public:
+
+	PHullResult(void)
+	{
+		mVcount = 0;
+		mIndexCount = 0;
+		mFaceCount = 0;
+		mVertices = 0;
+	}
+
+	unsigned int mVcount;
+	unsigned int mIndexCount;
+	unsigned int mFaceCount;
+	btVector3*   mVertices;
+	TUIntArray m_Indices;
+};
+
+
+
+///The HullLibrary class can create a convex hull from a collection of vertices, using the ComputeHull method.
+///The btShapeHull class uses this HullLibrary to create a approximate convex mesh given a general (non-polyhedral) convex shape.
+class HullLibrary
+{
+
+	btAlignedObjectArray<class btHullTriangle*> m_tris;
+
+public:
+
+	btAlignedObjectArray<int> m_vertexIndexMapping;
+
+
+	HullError CreateConvexHull(const HullDesc& desc, // describes the input request
+				   HullResult&     result);        // contains the resulst
+	HullError ReleaseResult(HullResult &result); // release memory allocated for this result, we are done with it.
+
+private:
+
+	bool ComputeHull(unsigned int vcount,const btVector3 *vertices,PHullResult &result,unsigned int vlimit);
+
+	class btHullTriangle*	allocateTriangle(int a,int b,int c);
+	void	deAllocateTriangle(btHullTriangle*);
+	void b2bfix(btHullTriangle* s,btHullTriangle*t);
+
+	void removeb2b(btHullTriangle* s,btHullTriangle*t);
+
+	void checkit(btHullTriangle *t);
+
+	btHullTriangle* extrudable(btScalar epsilon);
+
+	int calchull(btVector3 *verts,int verts_count, TUIntArray& tris_out, int &tris_count,int vlimit);
+
+	int calchullgen(btVector3 *verts,int verts_count, int vlimit);
+
+	int4 FindSimplex(btVector3 *verts,int verts_count,btAlignedObjectArray<int> &allow);
+
+	class ConvexH* ConvexHCrop(ConvexH& convex,const btPlane& slice);
+
+	void extrude(class btHullTriangle* t0,int v);
+
+	ConvexH* test_cube();
+
+	//BringOutYourDead (John Ratcliff): When you create a convex hull you hand it a large input set of vertices forming a 'point cloud'. 
+	//After the hull is generated it give you back a set of polygon faces which index the *original* point cloud.
+	//The thing is, often times, there are many 'dead vertices' in the point cloud that are on longer referenced by the hull.
+	//The routine 'BringOutYourDead' find only the referenced vertices, copies them to an new buffer, and re-indexes the hull so that it is a minimal representation.
+	void BringOutYourDead(const btVector3* verts,unsigned int vcount, btVector3* overts,unsigned int &ocount,unsigned int* indices,unsigned indexcount);
+
+	bool CleanupVertices(unsigned int svcount,
+			     const btVector3* svertices,
+			     unsigned int stride,
+			     unsigned int &vcount, // output number of vertices
+			     btVector3* vertices, // location to store the results.
+			     btScalar  normalepsilon,
+			     btVector3& scale);
+};
+
+
+#endif //BT_CD_HULL_H
+
diff --git a/hkl3d/bullet/src/LinearMath/btConvexHullComputer.cpp b/hkl3d/bullet/src/LinearMath/btConvexHullComputer.cpp
new file mode 100644
index 0000000..10316b4
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btConvexHullComputer.cpp
@@ -0,0 +1,2749 @@
+/*
+Copyright (c) 2011 Ole Kniemeyer, MAXON, www.maxon.net
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include <string.h>
+
+#include "btConvexHullComputer.h"
+#include "btAlignedObjectArray.h"
+#include "btMinMax.h"
+#include "btVector3.h"
+
+#ifdef __GNUC__
+	#include <stdint.h>
+#elif defined(_MSC_VER)
+	typedef __int32 int32_t;
+	typedef __int64 int64_t;
+	typedef unsigned __int32 uint32_t;
+	typedef unsigned __int64 uint64_t;
+#else
+	typedef int int32_t;
+	typedef long long int int64_t;
+	typedef unsigned int uint32_t;
+	typedef unsigned long long int uint64_t;
+#endif
+
+
+//The definition of USE_X86_64_ASM is moved into the build system. You can enable it manually by commenting out the following lines
+//#if (defined(__GNUC__) && defined(__x86_64__) && !defined(__ICL))  // || (defined(__ICL) && defined(_M_X64))   bug in Intel compiler, disable inline assembly
+//	#define USE_X86_64_ASM
+//#endif
+
+
+//#define DEBUG_CONVEX_HULL
+//#define SHOW_ITERATIONS
+
+#if defined(DEBUG_CONVEX_HULL) || defined(SHOW_ITERATIONS)
+	#include <stdio.h>
+#endif
+
+// Convex hull implementation based on Preparata and Hong
+// Ole Kniemeyer, MAXON Computer GmbH
+class btConvexHullInternal
+{
+	public:
+		
+		class Point64
+		{
+			public:
+				int64_t x;
+				int64_t y;
+				int64_t z;
+				
+				Point64(int64_t x, int64_t y, int64_t z): x(x), y(y), z(z)
+				{
+				}
+
+				bool isZero()
+				{
+					return (x == 0) && (y == 0) && (z == 0);
+				}
+
+				int64_t dot(const Point64& b) const
+				{
+					return x * b.x + y * b.y + z * b.z;
+				}
+		};
+		
+		class Point32
+		{
+			public:
+				int32_t x;
+				int32_t y;
+				int32_t z;
+				int index;
+				
+				Point32()
+				{
+				}
+				
+				Point32(int32_t x, int32_t y, int32_t z): x(x), y(y), z(z), index(-1)
+				{
+				}
+				
+				bool operator==(const Point32& b) const
+				{
+					return (x == b.x) && (y == b.y) && (z == b.z);
+				}
+
+				bool operator!=(const Point32& b) const
+				{
+					return (x != b.x) || (y != b.y) || (z != b.z);
+				}
+
+				bool isZero()
+				{
+					return (x == 0) && (y == 0) && (z == 0);
+				}
+
+				Point64 cross(const Point32& b) const
+				{
+					return Point64(y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x);
+				}
+
+				Point64 cross(const Point64& b) const
+				{
+					return Point64(y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x);
+				}
+
+				int64_t dot(const Point32& b) const
+				{
+					return x * b.x + y * b.y + z * b.z;
+				}
+
+				int64_t dot(const Point64& b) const
+				{
+					return x * b.x + y * b.y + z * b.z;
+				}
+
+				Point32 operator+(const Point32& b) const
+				{
+					return Point32(x + b.x, y + b.y, z + b.z);
+				}
+
+				Point32 operator-(const Point32& b) const
+				{
+					return Point32(x - b.x, y - b.y, z - b.z);
+				}
+		};
+
+		class Int128
+		{
+			public:
+				uint64_t low;
+				uint64_t high;
+
+				Int128()
+				{
+				}
+
+				Int128(uint64_t low, uint64_t high): low(low), high(high)
+				{
+				}
+
+				Int128(uint64_t low): low(low), high(0)
+				{
+				}
+
+				Int128(int64_t value): low(value), high((value >= 0) ? 0 : (uint64_t) -1LL)
+				{
+				}
+
+				static Int128 mul(int64_t a, int64_t b);
+
+				static Int128 mul(uint64_t a, uint64_t b);
+
+				Int128 operator-() const
+				{
+					return Int128((uint64_t) -(int64_t)low, ~high + (low == 0));
+				}
+
+				Int128 operator+(const Int128& b) const
+				{
+#ifdef USE_X86_64_ASM
+					Int128 result;
+					__asm__ ("addq %[bl], %[rl]\n\t"
+									 "adcq %[bh], %[rh]\n\t"
+									 : [rl] "=r" (result.low), [rh] "=r" (result.high)
+									 : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
+									 : "cc" );
+					return result;
+#else
+					uint64_t lo = low + b.low;
+					return Int128(lo, high + b.high + (lo < low));
+#endif
+				}
+
+				Int128 operator-(const Int128& b) const
+				{
+#ifdef USE_X86_64_ASM
+					Int128 result;
+					__asm__ ("subq %[bl], %[rl]\n\t"
+									 "sbbq %[bh], %[rh]\n\t"
+									 : [rl] "=r" (result.low), [rh] "=r" (result.high)
+									 : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
+									 : "cc" );
+					return result;
+#else
+					return *this + -b;
+#endif
+				}
+
+				Int128& operator+=(const Int128& b)
+				{
+#ifdef USE_X86_64_ASM
+					__asm__ ("addq %[bl], %[rl]\n\t"
+									 "adcq %[bh], %[rh]\n\t"
+									 : [rl] "=r" (low), [rh] "=r" (high)
+									 : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
+									 : "cc" );
+#else
+					uint64_t lo = low + b.low;
+					if (lo < low)
+					{
+						++high;
+					}
+					low = lo;
+					high += b.high;
+#endif
+					return *this;
+				}
+
+				Int128& operator++()
+				{
+					if (++low == 0)
+					{
+						++high;
+					}
+					return *this;
+				}
+
+				Int128 operator*(int64_t b) const;
+
+				btScalar toScalar() const
+				{
+					return ((int64_t) high >= 0) ? btScalar(high) * (btScalar(0x100000000LL) * btScalar(0x100000000LL)) + btScalar(low)
+						: -(-*this).toScalar();
+				}
+
+				int getSign() const
+				{
+					return ((int64_t) high < 0) ? -1 : (high || low) ? 1 : 0;
+				}
+
+				bool operator<(const Int128& b) const
+				{
+					return (high < b.high) || ((high == b.high) && (low < b.low));
+				}
+
+				int ucmp(const Int128&b) const
+				{
+					if (high < b.high)
+					{
+						return -1;
+					}
+					if (high > b.high)
+					{
+						return 1;
+					}
+					if (low < b.low)
+					{
+						return -1;
+					}
+					if (low > b.low)
+					{
+						return 1;
+					}
+					return 0;
+				}
+		};
+
+
+		class Rational64
+		{
+			private:
+				uint64_t numerator;
+				uint64_t denominator;
+				int sign;
+				
+			public:
+				Rational64(int64_t numerator, int64_t denominator)
+				{
+					if (numerator > 0)
+					{
+						sign = 1;
+						this->numerator = (uint64_t) numerator;
+					}
+					else if (numerator < 0)
+					{
+						sign = -1;
+						this->numerator = (uint64_t) -numerator;
+					}
+					else
+					{
+						sign = 0;
+						this->numerator = 0;
+					}
+					if (denominator > 0)
+					{
+						this->denominator = (uint64_t) denominator;
+					}
+					else if (denominator < 0)
+					{
+						sign = -sign;
+						this->denominator = (uint64_t) -denominator;
+					}
+					else
+					{
+						this->denominator = 0;
+					}
+				}
+				
+				bool isNegativeInfinity() const
+				{
+					return (sign < 0) && (denominator == 0);
+				}
+				
+				bool isNaN() const
+				{
+					return (sign == 0) && (denominator == 0);
+				}
+				
+				int compare(const Rational64& b) const;
+				
+				btScalar toScalar() const
+				{
+					return sign * ((denominator == 0) ? SIMD_INFINITY : (btScalar) numerator / denominator);
+				}
+		};
+
+
+		class Rational128
+		{
+			private:
+				Int128 numerator;
+				Int128 denominator;
+				int sign;
+				bool isInt64;
+
+			public:
+				Rational128(int64_t value)
+				{
+					if (value > 0)
+					{
+						sign = 1;
+						this->numerator = value;
+					}
+					else if (value < 0)
+					{
+						sign = -1;
+						this->numerator = -value;
+					}
+					else
+					{
+						sign = 0;
+						this->numerator = (uint64_t) 0;
+					}
+					this->denominator = (uint64_t) 1;
+					isInt64 = true;
+				}
+
+				Rational128(const Int128& numerator, const Int128& denominator)
+				{
+					sign = numerator.getSign();
+					if (sign >= 0)
+					{
+						this->numerator = numerator;
+					}
+					else
+					{
+						this->numerator = -numerator;
+					}
+					int dsign = denominator.getSign();
+					if (dsign >= 0)
+					{
+						this->denominator = denominator;
+					}
+					else
+					{
+						sign = -sign;
+						this->denominator = -denominator;
+					}
+					isInt64 = false;
+				}
+
+				int compare(const Rational128& b) const;
+
+				int compare(int64_t b) const;
+
+				btScalar toScalar() const
+				{
+					return sign * ((denominator.getSign() == 0) ? SIMD_INFINITY : numerator.toScalar() / denominator.toScalar());
+				}
+		};
+
+		class PointR128
+		{
+			public:
+				Int128 x;
+				Int128 y;
+				Int128 z;
+				Int128 denominator;
+
+				PointR128()
+				{
+				}
+
+				PointR128(Int128 x, Int128 y, Int128 z, Int128 denominator): x(x), y(y), z(z), denominator(denominator)
+				{
+				}
+
+				btScalar xvalue() const
+				{
+					return x.toScalar() / denominator.toScalar();
+				}
+
+				btScalar yvalue() const
+				{
+					return y.toScalar() / denominator.toScalar();
+				}
+
+				btScalar zvalue() const
+				{
+					return z.toScalar() / denominator.toScalar();
+				}
+		};
+
+
+		class Edge;
+		class Face;
+
+		class Vertex
+		{
+			public:
+				Vertex* next;
+				Vertex* prev;
+				Edge* edges;
+				Face* firstNearbyFace;
+				Face* lastNearbyFace;
+				PointR128 point128;
+				Point32 point;
+				int copy;
+				
+				Vertex(): next(NULL), prev(NULL), edges(NULL), firstNearbyFace(NULL), lastNearbyFace(NULL), copy(-1)
+				{
+				}
+
+#ifdef DEBUG_CONVEX_HULL
+				void print()
+				{
+					printf("V%d (%d, %d, %d)", point.index, point.x, point.y, point.z);
+				}
+
+				void printGraph();
+#endif
+
+				Point32 operator-(const Vertex& b) const
+				{
+					return point - b.point;
+				}
+
+				Rational128 dot(const Point64& b) const
+				{
+					return (point.index >= 0) ? Rational128(point.dot(b))
+						: Rational128(point128.x * b.x + point128.y * b.y + point128.z * b.z, point128.denominator);
+				}
+
+				btScalar xvalue() const
+				{
+					return (point.index >= 0) ? btScalar(point.x) : point128.xvalue();
+				}
+
+				btScalar yvalue() const
+				{
+					return (point.index >= 0) ? btScalar(point.y) : point128.yvalue();
+				}
+
+				btScalar zvalue() const
+				{
+					return (point.index >= 0) ? btScalar(point.z) : point128.zvalue();
+				}
+
+				void receiveNearbyFaces(Vertex* src)
+				{
+					if (lastNearbyFace)
+					{
+						lastNearbyFace->nextWithSameNearbyVertex = src->firstNearbyFace;
+					}
+					else
+					{
+						firstNearbyFace = src->firstNearbyFace;
+					}
+					if (src->lastNearbyFace)
+					{
+						lastNearbyFace = src->lastNearbyFace;
+					}
+					for (Face* f = src->firstNearbyFace; f; f = f->nextWithSameNearbyVertex)
+					{
+						btAssert(f->nearbyVertex == src);
+						f->nearbyVertex = this;
+					}
+					src->firstNearbyFace = NULL;
+					src->lastNearbyFace = NULL;
+				}
+		};
+
+
+		class Edge
+		{
+			public:
+				Edge* next;
+				Edge* prev;
+				Edge* reverse;
+				Vertex* target;
+				Face* face;
+				int copy;
+
+				~Edge()
+				{
+					next = NULL;
+					prev = NULL;
+					reverse = NULL;
+					target = NULL;
+					face = NULL;
+				}
+
+				void link(Edge* n)
+				{
+					btAssert(reverse->target == n->reverse->target);
+					next = n;
+					n->prev = this;
+				}
+
+#ifdef DEBUG_CONVEX_HULL
+				void print()
+				{
+					printf("E%p : %d -> %d,  n=%p p=%p   (0 %d\t%d\t%d) -> (%d %d %d)", this, reverse->target->point.index, target->point.index, next, prev,
+								 reverse->target->point.x, reverse->target->point.y, reverse->target->point.z, target->point.x, target->point.y, target->point.z);
+				}
+#endif
+		};
+
+		class Face
+		{
+			public:
+				Face* next;
+				Vertex* nearbyVertex;
+				Face* nextWithSameNearbyVertex;
+				Point32 origin;
+				Point32 dir0;
+				Point32 dir1;
+
+				Face(): next(NULL), nearbyVertex(NULL), nextWithSameNearbyVertex(NULL)
+				{
+				}
+
+				void init(Vertex* a, Vertex* b, Vertex* c)
+				{
+					nearbyVertex = a;
+					origin = a->point;
+					dir0 = *b - *a;
+					dir1 = *c - *a;
+					if (a->lastNearbyFace)
+					{
+						a->lastNearbyFace->nextWithSameNearbyVertex = this;
+					}
+					else
+					{
+						a->firstNearbyFace = this;
+					}
+					a->lastNearbyFace = this;
+				}
+
+				Point64 getNormal()
+				{
+					return dir0.cross(dir1);
+				}
+		};
+
+		template<typename UWord, typename UHWord> class DMul
+		{
+			private:
+				static uint32_t high(uint64_t value)
+				{
+					return (uint32_t) (value >> 32);
+				}
+				
+				static uint32_t low(uint64_t value)
+				{
+					return (uint32_t) value;
+				}
+				
+				static uint64_t mul(uint32_t a, uint32_t b)
+				{
+					return (uint64_t) a * (uint64_t) b;
+				}
+				
+				static void shlHalf(uint64_t& value)
+				{
+					value <<= 32;
+				}
+				
+				static uint64_t high(Int128 value)
+				{
+					return value.high;
+				}
+				
+				static uint64_t low(Int128 value)
+				{
+					return value.low;
+				}
+				
+				static Int128 mul(uint64_t a, uint64_t b)
+				{
+					return Int128::mul(a, b);
+				}
+				
+				static void shlHalf(Int128& value)
+				{
+					value.high = value.low;
+					value.low = 0;
+				}
+				
+			public:
+				
+				static void mul(UWord a, UWord b, UWord& resLow, UWord& resHigh)
+				{
+					UWord p00 = mul(low(a), low(b));
+					UWord p01 = mul(low(a), high(b));
+					UWord p10 = mul(high(a), low(b));
+					UWord p11 = mul(high(a), high(b));
+					UWord p0110 = UWord(low(p01)) + UWord(low(p10));
+					p11 += high(p01);
+					p11 += high(p10);
+					p11 += high(p0110);
+					shlHalf(p0110);
+					p00 += p0110;
+					if (p00 < p0110)
+					{
+						++p11;
+					}
+					resLow = p00;
+					resHigh = p11;
+				}
+		};
+	
+	private:
+
+		class IntermediateHull
+		{
+			public:
+				Vertex* minXy;
+				Vertex* maxXy;
+				Vertex* minYx;
+				Vertex* maxYx;
+				
+				IntermediateHull(): minXy(NULL), maxXy(NULL), minYx(NULL), maxYx(NULL)
+				{
+				}
+				
+				void print();
+		};
+	
+		enum Orientation {NONE, CLOCKWISE, COUNTER_CLOCKWISE};
+
+		template <typename T> class PoolArray
+		{
+			private:
+				T* array;
+				int size;
+
+			public:
+				PoolArray<T>* next;
+
+				PoolArray(int size): size(size), next(NULL)
+				{
+					array = (T*) btAlignedAlloc(sizeof(T) * size, 16);
+				}
+
+				~PoolArray()
+				{
+					btAlignedFree(array);
+				}
+
+				T* init()
+				{
+					T* o = array;
+					for (int i = 0; i < size; i++, o++)
+					{
+						o->next = (i+1 < size) ? o + 1 : NULL;
+					}
+					return array;
+				}
+		};
+
+		template <typename T> class Pool
+		{
+			private:
+				PoolArray<T>* arrays;
+				PoolArray<T>* nextArray;
+				T* freeObjects;
+				int arraySize;
+
+			public:
+				Pool(): arrays(NULL), nextArray(NULL), freeObjects(NULL), arraySize(256)
+				{
+				}
+
+				~Pool()
+				{
+					while (arrays)
+					{
+						PoolArray<T>* p = arrays;
+						arrays = p->next;
+						p->~PoolArray<T>();
+						btAlignedFree(p);
+					}
+				}
+
+				void reset()
+				{
+					nextArray = arrays;
+					freeObjects = NULL;
+				}
+
+				void setArraySize(int arraySize)
+				{
+					this->arraySize = arraySize;
+				}
+
+				T* newObject()
+				{
+					T* o = freeObjects;
+					if (!o)
+					{
+						PoolArray<T>* p = nextArray;
+						if (p)
+						{
+							nextArray = p->next;
+						}
+						else
+						{
+							p = new(btAlignedAlloc(sizeof(PoolArray<T>), 16)) PoolArray<T>(arraySize);
+							p->next = arrays;
+							arrays = p;
+						}
+						o = p->init();
+					}
+					freeObjects = o->next;
+					return new(o) T();
+				};
+
+				void freeObject(T* object)
+				{
+					object->~T();
+					object->next = freeObjects;
+					freeObjects = object;
+				}
+		};
+
+		btVector3 scaling;
+		btVector3 center;
+		Pool<Vertex> vertexPool;
+		Pool<Edge> edgePool;
+		Pool<Face> facePool;
+		btAlignedObjectArray<Vertex*> originalVertices;
+		int mergeStamp;
+		int minAxis;
+		int medAxis;
+		int maxAxis;
+		int usedEdgePairs;
+		int maxUsedEdgePairs;
+
+		static Orientation getOrientation(const Edge* prev, const Edge* next, const Point32& s, const Point32& t);
+		Edge* findMaxAngle(bool ccw, const Vertex* start, const Point32& s, const Point64& rxs, const Point64& sxrxs, Rational64& minCot);
+		void findEdgeForCoplanarFaces(Vertex* c0, Vertex* c1, Edge*& e0, Edge*& e1, Vertex* stop0, Vertex* stop1);
+
+		Edge* newEdgePair(Vertex* from, Vertex* to);
+
+		void removeEdgePair(Edge* edge)
+		{
+			Edge* n = edge->next;
+			Edge* r = edge->reverse;
+
+			btAssert(edge->target && r->target);
+
+			if (n != edge)
+			{
+				n->prev = edge->prev;
+				edge->prev->next = n;
+				r->target->edges = n;
+			}
+			else
+			{
+				r->target->edges = NULL;
+			}
+			
+			n = r->next;
+			
+			if (n != r)
+			{
+				n->prev = r->prev;
+				r->prev->next = n;
+				edge->target->edges = n;
+			}
+			else
+			{
+				edge->target->edges = NULL;
+			}
+
+			edgePool.freeObject(edge);
+			edgePool.freeObject(r);
+			usedEdgePairs--;
+		}
+		
+		void computeInternal(int start, int end, IntermediateHull& result);
+		
+		bool mergeProjection(IntermediateHull& h0, IntermediateHull& h1, Vertex*& c0, Vertex*& c1);
+		
+		void merge(IntermediateHull& h0, IntermediateHull& h1);
+
+		btVector3 toBtVector(const Point32& v);
+
+		btVector3 getBtNormal(Face* face);
+
+		bool shiftFace(Face* face, btScalar amount, btAlignedObjectArray<Vertex*> stack);
+
+	public:
+		Vertex* vertexList;
+
+		void compute(const void* coords, bool doubleCoords, int stride, int count);
+
+		btVector3 getCoordinates(const Vertex* v);
+
+		btScalar shrink(btScalar amount, btScalar clampAmount);
+};
+
+
+btConvexHullInternal::Int128 btConvexHullInternal::Int128::operator*(int64_t b) const
+{
+	bool negative = (int64_t) high < 0;
+	Int128 a = negative ? -*this : *this;
+	if (b < 0)
+	{
+		negative = !negative;
+		b = -b;
+	}
+	Int128 result = mul(a.low, (uint64_t) b);
+	result.high += a.high * (uint64_t) b;
+	return negative ? -result : result;
+}
+
+btConvexHullInternal::Int128 btConvexHullInternal::Int128::mul(int64_t a, int64_t b)
+{
+	Int128 result;
+	
+#ifdef USE_X86_64_ASM
+	__asm__ ("imulq %[b]"
+					 : "=a" (result.low), "=d" (result.high)
+					 : "0"(a), [b] "r"(b)
+					 : "cc" );
+	return result;
+	
+#else
+	bool negative = a < 0;
+	if (negative)
+	{
+		a = -a;
+	}
+	if (b < 0)
+	{
+		negative = !negative;
+		b = -b;
+	}
+	DMul<uint64_t, uint32_t>::mul((uint64_t) a, (uint64_t) b, result.low, result.high);
+	return negative ? -result : result;
+#endif
+}
+
+btConvexHullInternal::Int128 btConvexHullInternal::Int128::mul(uint64_t a, uint64_t b)
+{
+	Int128 result;
+
+#ifdef USE_X86_64_ASM
+	__asm__ ("mulq %[b]"
+					 : "=a" (result.low), "=d" (result.high)
+					 : "0"(a), [b] "r"(b)
+					 : "cc" );
+
+#else
+	DMul<uint64_t, uint32_t>::mul(a, b, result.low, result.high);
+#endif
+
+	return result;
+}
+
+int btConvexHullInternal::Rational64::compare(const Rational64& b) const
+{
+	if (sign != b.sign)
+	{
+		return sign - b.sign;
+	}
+	else if (sign == 0)
+	{
+		return 0;
+	}
+
+	//	return (numerator * b.denominator > b.numerator * denominator) ? sign : (numerator * b.denominator < b.numerator * denominator) ? -sign : 0;
+
+#ifdef USE_X86_64_ASM
+
+	int result;
+	int64_t tmp;
+	int64_t dummy;
+	__asm__ ("mulq %[bn]\n\t"
+					 "movq %%rax, %[tmp]\n\t"
+					 "movq %%rdx, %%rbx\n\t"
+					 "movq %[tn], %%rax\n\t"
+					 "mulq %[bd]\n\t"
+					 "subq %[tmp], %%rax\n\t"
+					 "sbbq %%rbx, %%rdx\n\t" // rdx:rax contains 128-bit-difference "numerator*b.denominator - b.numerator*denominator"
+					 "setnsb %%bh\n\t" // bh=1 if difference is non-negative, bh=0 otherwise
+					 "orq %%rdx, %%rax\n\t"
+					 "setnzb %%bl\n\t" // bl=1 if difference if non-zero, bl=0 if it is zero
+					 "decb %%bh\n\t" // now bx=0x0000 if difference is zero, 0xff01 if it is negative, 0x0001 if it is positive (i.e., same sign as difference)
+					 "shll $16, %%ebx\n\t" // ebx has same sign as difference
+					 : "=&b"(result), [tmp] "=&r"(tmp), "=a"(dummy)
+					 : "a"(denominator), [bn] "g"(b.numerator), [tn] "g"(numerator), [bd] "g"(b.denominator)
+					 : "%rdx", "cc" );
+	return result ? result ^ sign // if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero)
+																// if sign is -1, all bits of result are inverted, which changes the sign of result (and again cannot result in zero)
+								: 0;
+
+#else
+
+	return sign * Int128::mul(numerator, b.denominator).ucmp(Int128::mul(denominator, b.numerator));
+
+#endif
+}
+
+int btConvexHullInternal::Rational128::compare(const Rational128& b) const
+{
+	if (sign != b.sign)
+	{
+		return sign - b.sign;
+	}
+	else if (sign == 0)
+	{
+		return 0;
+	}
+	if (isInt64)
+	{
+		return -b.compare(sign * (int64_t) numerator.low);
+	}
+
+	Int128 nbdLow, nbdHigh, dbnLow, dbnHigh;
+	DMul<Int128, uint64_t>::mul(numerator, b.denominator, nbdLow, nbdHigh);
+	DMul<Int128, uint64_t>::mul(denominator, b.numerator, dbnLow, dbnHigh);
+
+	int cmp = nbdHigh.ucmp(dbnHigh);
+	if (cmp)
+	{
+		return cmp * sign;
+	}
+	return nbdLow.ucmp(dbnLow) * sign;
+}
+
+int btConvexHullInternal::Rational128::compare(int64_t b) const
+{
+	if (isInt64)
+	{
+		int64_t a = sign * (int64_t) numerator.low;
+		return (a > b) ? 1 : (a < b) ? -1 : 0;
+	}
+	if (b > 0)
+	{
+		if (sign <= 0)
+		{
+			return -1;
+		}
+	}
+	else if (b < 0)
+	{
+		if (sign >= 0)
+		{
+			return 1;
+		}
+		b = -b;
+	}
+	else
+	{
+		return sign;
+	}
+
+	return numerator.ucmp(denominator * b) * sign;
+}
+
+
+btConvexHullInternal::Edge* btConvexHullInternal::newEdgePair(Vertex* from, Vertex* to)
+{
+	btAssert(from && to);
+	Edge* e = edgePool.newObject();
+	Edge* r = edgePool.newObject();
+	e->reverse = r;
+	r->reverse = e;
+	e->copy = mergeStamp;
+	r->copy = mergeStamp;
+	e->target = to;
+	r->target = from;
+	e->face = NULL;
+	r->face = NULL;
+	usedEdgePairs++;
+	if (usedEdgePairs > maxUsedEdgePairs)
+	{
+		maxUsedEdgePairs = usedEdgePairs;
+	}
+	return e;
+}
+
+bool btConvexHullInternal::mergeProjection(IntermediateHull& h0, IntermediateHull& h1, Vertex*& c0, Vertex*& c1)
+{
+	Vertex* v0 = h0.maxYx;
+	Vertex* v1 = h1.minYx;
+	if ((v0->point.x == v1->point.x) && (v0->point.y == v1->point.y))
+	{
+		btAssert(v0->point.z < v1->point.z);
+		Vertex* v1p = v1->prev;
+		if (v1p == v1)
+		{
+			c0 = v0;
+			if (v1->edges)
+			{
+				btAssert(v1->edges->next == v1->edges);
+				v1 = v1->edges->target;
+				btAssert(v1->edges->next == v1->edges);
+			}
+			c1 = v1;
+			return false;
+		}
+		Vertex* v1n = v1->next;
+		v1p->next = v1n;
+		v1n->prev = v1p;
+		if (v1 == h1.minXy)
+		{
+			if ((v1n->point.x < v1p->point.x) || ((v1n->point.x == v1p->point.x) && (v1n->point.y < v1p->point.y)))
+			{
+				h1.minXy = v1n;
+			}
+			else
+			{
+				h1.minXy = v1p;
+			}
+		}
+		if (v1 == h1.maxXy)
+		{
+			if ((v1n->point.x > v1p->point.x) || ((v1n->point.x == v1p->point.x) && (v1n->point.y > v1p->point.y)))
+			{
+				h1.maxXy = v1n;
+			}
+			else
+			{
+				h1.maxXy = v1p;
+			}
+		}
+	}
+	
+	v0 = h0.maxXy;
+	v1 = h1.maxXy;
+	Vertex* v00 = NULL;
+	Vertex* v10 = NULL;
+	int32_t sign = 1;
+
+	for (int side = 0; side <= 1; side++)
+	{		
+		int32_t dx = (v1->point.x - v0->point.x) * sign;
+		if (dx > 0)
+		{
+			while (true)
+			{
+				int32_t dy = v1->point.y - v0->point.y;
+
+				Vertex* w0 = side ? v0->next : v0->prev;
+				if (w0 != v0)
+				{
+					int32_t dx0 = (w0->point.x - v0->point.x) * sign;
+					int32_t dy0 = w0->point.y - v0->point.y;
+					if ((dy0 <= 0) && ((dx0 == 0) || ((dx0 < 0) && (dy0 * dx <= dy * dx0))))
+					{
+						v0 = w0;
+						dx = (v1->point.x - v0->point.x) * sign;
+						continue;
+					}
+				}
+
+				Vertex* w1 = side ? v1->next : v1->prev;
+				if (w1 != v1)
+				{
+					int32_t dx1 = (w1->point.x - v1->point.x) * sign;
+					int32_t dy1 = w1->point.y - v1->point.y;
+					int32_t dxn = (w1->point.x - v0->point.x) * sign;
+					if ((dxn > 0) && (dy1 < 0) && ((dx1 == 0) || ((dx1 < 0) && (dy1 * dx < dy * dx1))))
+					{
+						v1 = w1;
+						dx = dxn;
+						continue;
+					}
+				}
+
+				break;
+			}
+		}
+		else if (dx < 0)
+		{
+			while (true)
+			{
+				int32_t dy = v1->point.y - v0->point.y;
+				
+				Vertex* w1 = side ? v1->prev : v1->next;
+				if (w1 != v1)
+				{
+					int32_t dx1 = (w1->point.x - v1->point.x) * sign;
+					int32_t dy1 = w1->point.y - v1->point.y;
+					if ((dy1 >= 0) && ((dx1 == 0) || ((dx1 < 0) && (dy1 * dx <= dy * dx1))))
+					{
+						v1 = w1;
+						dx = (v1->point.x - v0->point.x) * sign;
+						continue;
+					}
+				}
+				
+				Vertex* w0 = side ? v0->prev : v0->next;
+				if (w0 != v0)
+				{
+					int32_t dx0 = (w0->point.x - v0->point.x) * sign;
+					int32_t dy0 = w0->point.y - v0->point.y;
+					int32_t dxn = (v1->point.x - w0->point.x) * sign;
+					if ((dxn < 0) && (dy0 > 0) && ((dx0 == 0) || ((dx0 < 0) && (dy0 * dx < dy * dx0))))
+					{
+						v0 = w0;
+						dx = dxn;
+						continue;
+					}
+				}
+				
+				break;
+			}
+		}
+		else
+		{
+			int32_t x = v0->point.x;
+			int32_t y0 = v0->point.y;
+			Vertex* w0 = v0;
+			Vertex* t;
+			while (((t = side ? w0->next : w0->prev) != v0) && (t->point.x == x) && (t->point.y <= y0))
+			{
+				w0 = t;
+				y0 = t->point.y;
+			}
+			v0 = w0;
+
+			int32_t y1 = v1->point.y;
+			Vertex* w1 = v1;
+			while (((t = side ? w1->prev : w1->next) != v1) && (t->point.x == x) && (t->point.y >= y1))
+			{
+				w1 = t;
+				y1 = t->point.y;
+			}
+			v1 = w1;
+		}
+		
+		if (side == 0)
+		{
+			v00 = v0;
+			v10 = v1;
+
+			v0 = h0.minXy;
+			v1 = h1.minXy;
+			sign = -1;
+		}
+	}
+
+	v0->prev = v1;
+	v1->next = v0;
+
+	v00->next = v10;
+	v10->prev = v00;
+
+	if (h1.minXy->point.x < h0.minXy->point.x)
+	{
+		h0.minXy = h1.minXy;
+	}
+	if (h1.maxXy->point.x >= h0.maxXy->point.x)
+	{
+		h0.maxXy = h1.maxXy;
+	}
+	
+	h0.maxYx = h1.maxYx;
+
+	c0 = v00;
+	c1 = v10;
+
+	return true;
+}
+
+void btConvexHullInternal::computeInternal(int start, int end, IntermediateHull& result)
+{
+	int n = end - start;
+	switch (n)
+	{
+		case 0:
+			result.minXy = NULL;
+			result.maxXy = NULL;
+			result.minYx = NULL;
+			result.maxYx = NULL;
+			return;
+		case 2:
+		{
+			Vertex* v = originalVertices[start];
+			Vertex* w = v + 1;
+			if (v->point != w->point)
+			{
+				int32_t dx = v->point.x - w->point.x;
+				int32_t dy = v->point.y - w->point.y;
+
+				if ((dx == 0) && (dy == 0))
+				{
+					if (v->point.z > w->point.z)
+					{
+						Vertex* t = w;
+						w = v;
+						v = t;
+					}
+					btAssert(v->point.z < w->point.z);
+					v->next = v;
+					v->prev = v;
+					result.minXy = v;
+					result.maxXy = v;
+					result.minYx = v;
+					result.maxYx = v;
+				}
+				else
+				{
+					v->next = w;
+					v->prev = w;
+					w->next = v;
+					w->prev = v;
+
+					if ((dx < 0) || ((dx == 0) && (dy < 0)))
+					{
+						result.minXy = v;
+						result.maxXy = w;
+					}
+					else
+					{
+						result.minXy = w;
+						result.maxXy = v;
+					}
+
+					if ((dy < 0) || ((dy == 0) && (dx < 0)))
+					{
+						result.minYx = v;
+						result.maxYx = w;
+					}
+					else
+					{
+						result.minYx = w;
+						result.maxYx = v;
+					}
+				}
+
+				Edge* e = newEdgePair(v, w);
+				e->link(e);
+				v->edges = e;
+
+				e = e->reverse;
+				e->link(e);
+				w->edges = e;
+
+				return;
+			}
+		}
+		// lint -fallthrough
+		case 1:
+		{
+			Vertex* v = originalVertices[start];
+			v->edges = NULL;
+			v->next = v;
+			v->prev = v;
+
+			result.minXy = v;
+			result.maxXy = v;
+			result.minYx = v;
+			result.maxYx = v;
+
+			return;
+		}
+	}
+
+	int split0 = start + n / 2;
+	Point32 p = originalVertices[split0-1]->point;
+	int split1 = split0;
+	while ((split1 < end) && (originalVertices[split1]->point == p))
+	{
+		split1++;
+	}
+	computeInternal(start, split0, result);
+	IntermediateHull hull1;
+	computeInternal(split1, end, hull1);
+#ifdef DEBUG_CONVEX_HULL
+	printf("\n\nMerge\n");
+	result.print();
+	hull1.print();
+#endif
+	merge(result, hull1);
+#ifdef DEBUG_CONVEX_HULL
+	printf("\n  Result\n");
+	result.print();
+#endif
+}
+
+#ifdef DEBUG_CONVEX_HULL
+void btConvexHullInternal::IntermediateHull::print()
+{
+	printf("    Hull\n");
+	for (Vertex* v = minXy; v; )
+	{
+		printf("      ");
+		v->print();
+		if (v == maxXy)
+		{
+			printf(" maxXy");
+		}
+		if (v == minYx)
+		{
+			printf(" minYx");
+		}
+		if (v == maxYx)
+		{
+			printf(" maxYx");
+		}
+		if (v->next->prev != v)
+		{
+			printf(" Inconsistency");
+		}
+		printf("\n");
+		v = v->next;
+		if (v == minXy)
+		{
+			break;
+		}
+	}
+	if (minXy)
+	{		
+		minXy->copy = (minXy->copy == -1) ? -2 : -1;
+		minXy->printGraph();
+	}
+}
+
+void btConvexHullInternal::Vertex::printGraph()
+{
+	print();
+	printf("\nEdges\n");
+	Edge* e = edges;
+	if (e)
+	{
+		do
+		{
+			e->print();
+			printf("\n");
+			e = e->next;
+		} while (e != edges);
+		do
+		{
+			Vertex* v = e->target;
+			if (v->copy != copy)
+			{
+				v->copy = copy;
+				v->printGraph();
+			}
+			e = e->next;
+		} while (e != edges);
+	}
+}
+#endif
+
+btConvexHullInternal::Orientation btConvexHullInternal::getOrientation(const Edge* prev, const Edge* next, const Point32& s, const Point32& t)
+{
+	btAssert(prev->reverse->target == next->reverse->target);
+	if (prev->next == next)
+	{
+		if (prev->prev == next)
+		{
+			Point64 n = t.cross(s);
+			Point64 m = (*prev->target - *next->reverse->target).cross(*next->target - *next->reverse->target);
+			btAssert(!m.isZero());
+			int64_t dot = n.dot(m);
+			btAssert(dot != 0);
+			return (dot > 0) ? COUNTER_CLOCKWISE : CLOCKWISE;
+		}
+		return COUNTER_CLOCKWISE;
+	}
+	else if (prev->prev == next)
+	{
+		return CLOCKWISE;
+	}
+	else
+	{
+		return NONE;
+	}
+}
+
+btConvexHullInternal::Edge* btConvexHullInternal::findMaxAngle(bool ccw, const Vertex* start, const Point32& s, const Point64& rxs, const Point64& sxrxs, Rational64& minCot)
+{
+	Edge* minEdge = NULL;
+
+#ifdef DEBUG_CONVEX_HULL
+	printf("find max edge for %d\n", start->point.index);
+#endif
+	Edge* e = start->edges;
+	if (e)
+	{
+		do
+		{
+			if (e->copy > mergeStamp)
+			{
+				Point32 t = *e->target - *start;
+				Rational64 cot(t.dot(sxrxs), t.dot(rxs));
+#ifdef DEBUG_CONVEX_HULL
+				printf("      Angle is %f (%d) for ", (float) btAtan(cot.toScalar()), (int) cot.isNaN());
+				e->print();
+#endif
+				if (cot.isNaN())
+				{
+					btAssert(ccw ? (t.dot(s) < 0) : (t.dot(s) > 0));
+				}
+				else
+				{
+					int cmp;
+					if (minEdge == NULL)
+					{
+						minCot = cot;
+						minEdge = e;
+					}
+					else if ((cmp = cot.compare(minCot)) < 0)
+					{
+						minCot = cot;
+						minEdge = e;
+					}
+					else if ((cmp == 0) && (ccw == (getOrientation(minEdge, e, s, t) == COUNTER_CLOCKWISE)))
+					{
+						minEdge = e;
+					}
+				}
+#ifdef DEBUG_CONVEX_HULL
+				printf("\n");
+#endif
+			}
+			e = e->next;
+		} while (e != start->edges);
+	}
+	return minEdge;
+}
+
+void btConvexHullInternal::findEdgeForCoplanarFaces(Vertex* c0, Vertex* c1, Edge*& e0, Edge*& e1, Vertex* stop0, Vertex* stop1)
+{
+	Edge* start0 = e0;
+	Edge* start1 = e1;
+	Point32 et0 = start0 ? start0->target->point : c0->point;
+	Point32 et1 = start1 ? start1->target->point : c1->point;
+	Point32 s = c1->point - c0->point;
+	Point64 normal = ((start0 ? start0 : start1)->target->point - c0->point).cross(s);
+	int64_t dist = c0->point.dot(normal);
+	btAssert(!start1 || (start1->target->point.dot(normal) == dist));
+	Point64 perp = s.cross(normal);
+	btAssert(!perp.isZero());
+	
+#ifdef DEBUG_CONVEX_HULL
+	printf("   Advancing %d %d  (%p %p, %d %d)\n", c0->point.index, c1->point.index, start0, start1, start0 ? start0->target->point.index : -1, start1 ? start1->target->point.index : -1);
+#endif
+
+	int64_t maxDot0 = et0.dot(perp);
+	if (e0)
+	{
+		while (e0->target != stop0)
+		{
+			Edge* e = e0->reverse->prev;
+			if (e->target->point.dot(normal) < dist)
+			{
+				break;
+			}
+			btAssert(e->target->point.dot(normal) == dist);
+			if (e->copy == mergeStamp)
+			{
+				break;
+			}
+			int64_t dot = e->target->point.dot(perp);
+			if (dot <= maxDot0)
+			{
+				break;
+			}
+			maxDot0 = dot;
+			e0 = e;
+			et0 = e->target->point;
+		}
+	}
+	
+	int64_t maxDot1 = et1.dot(perp);
+	if (e1)
+	{
+		while (e1->target != stop1)
+		{
+			Edge* e = e1->reverse->next;
+			if (e->target->point.dot(normal) < dist)
+			{
+				break;
+			}
+			btAssert(e->target->point.dot(normal) == dist);
+			if (e->copy == mergeStamp)
+			{
+				break;
+			}
+			int64_t dot = e->target->point.dot(perp);
+			if (dot <= maxDot1)
+			{
+				break;
+			}
+			maxDot1 = dot;
+			e1 = e;
+			et1 = e->target->point;
+		}
+	}
+
+#ifdef DEBUG_CONVEX_HULL
+	printf("   Starting at %d %d\n", et0.index, et1.index);
+#endif
+
+	int64_t dx = maxDot1 - maxDot0;
+	if (dx > 0)
+	{
+		while (true)
+		{
+			int64_t dy = (et1 - et0).dot(s);
+			
+			if (e0 && (e0->target != stop0))
+			{
+				Edge* f0 = e0->next->reverse;
+				if (f0->copy > mergeStamp)
+				{
+					int64_t dx0 = (f0->target->point - et0).dot(perp);
+					int64_t dy0 = (f0->target->point - et0).dot(s);
+					if ((dx0 == 0) ? (dy0 < 0) : ((dx0 < 0) && (Rational64(dy0, dx0).compare(Rational64(dy, dx)) >= 0)))
+					{
+						et0 = f0->target->point;
+						dx = (et1 - et0).dot(perp);
+						e0 = (e0 == start0) ? NULL : f0;
+						continue;
+					}
+				}
+			}
+			
+			if (e1 && (e1->target != stop1))
+			{
+				Edge* f1 = e1->reverse->next;
+				if (f1->copy > mergeStamp)
+				{
+					Point32 d1 = f1->target->point - et1;
+					if (d1.dot(normal) == 0)
+					{
+						int64_t dx1 = d1.dot(perp);
+						int64_t dy1 = d1.dot(s);
+						int64_t dxn = (f1->target->point - et0).dot(perp);
+						if ((dxn > 0) && ((dx1 == 0) ? (dy1 < 0) : ((dx1 < 0) && (Rational64(dy1, dx1).compare(Rational64(dy, dx)) > 0))))
+						{
+							e1 = f1;
+							et1 = e1->target->point;
+							dx = dxn;
+							continue;
+						}
+					}
+					else
+					{
+						btAssert((e1 == start1) && (d1.dot(normal) < 0));
+					}
+				}
+			}
+
+			break;
+		}
+	}
+	else if (dx < 0)
+	{
+		while (true)
+		{
+			int64_t dy = (et1 - et0).dot(s);
+			
+			if (e1 && (e1->target != stop1))
+			{
+				Edge* f1 = e1->prev->reverse;
+				if (f1->copy > mergeStamp)
+				{
+					int64_t dx1 = (f1->target->point - et1).dot(perp);
+					int64_t dy1 = (f1->target->point - et1).dot(s);
+					if ((dx1 == 0) ? (dy1 > 0) : ((dx1 < 0) && (Rational64(dy1, dx1).compare(Rational64(dy, dx)) <= 0)))
+					{
+						et1 = f1->target->point;
+						dx = (et1 - et0).dot(perp);
+						e1 = (e1 == start1) ? NULL : f1;
+						continue;
+					}
+				}
+			}
+			
+			if (e0 && (e0->target != stop0))
+			{
+				Edge* f0 = e0->reverse->prev;
+				if (f0->copy > mergeStamp)
+				{
+					Point32 d0 = f0->target->point - et0;
+					if (d0.dot(normal) == 0)
+					{
+						int64_t dx0 = d0.dot(perp);
+						int64_t dy0 = d0.dot(s);
+						int64_t dxn = (et1 - f0->target->point).dot(perp);
+						if ((dxn < 0) && ((dx0 == 0) ? (dy0 > 0) : ((dx0 < 0) && (Rational64(dy0, dx0).compare(Rational64(dy, dx)) < 0))))
+						{
+							e0 = f0;
+							et0 = e0->target->point;
+							dx = dxn;
+							continue;
+						}
+					}
+					else
+					{
+						btAssert((e0 == start0) && (d0.dot(normal) < 0));
+					}
+				}
+			}
+
+			break;
+		}
+	}
+#ifdef DEBUG_CONVEX_HULL
+	printf("   Advanced edges to %d %d\n", et0.index, et1.index);
+#endif
+}
+
+
+void btConvexHullInternal::merge(IntermediateHull& h0, IntermediateHull& h1)
+{
+	if (!h1.maxXy)
+	{
+		return;
+	}
+	if (!h0.maxXy)
+	{
+		h0 = h1;
+		return;
+	}
+	
+	mergeStamp--;
+
+	Vertex* c0 = NULL;
+	Edge* toPrev0 = NULL;
+	Edge* firstNew0 = NULL;
+	Edge* pendingHead0 = NULL;
+	Edge* pendingTail0 = NULL;
+	Vertex* c1 = NULL;
+	Edge* toPrev1 = NULL;
+	Edge* firstNew1 = NULL;
+	Edge* pendingHead1 = NULL;
+	Edge* pendingTail1 = NULL;
+	Point32 prevPoint;
+
+	if (mergeProjection(h0, h1, c0, c1))
+	{
+		Point32 s = *c1 - *c0;
+		Point64 normal = Point32(0, 0, -1).cross(s);
+		Point64 t = s.cross(normal);
+		btAssert(!t.isZero());
+
+		Edge* e = c0->edges;
+		Edge* start0 = NULL;
+		if (e)
+		{
+			do
+			{
+				int64_t dot = (*e->target - *c0).dot(normal);
+				btAssert(dot <= 0);
+				if ((dot == 0) && ((*e->target - *c0).dot(t) > 0))
+				{
+					if (!start0 || (getOrientation(start0, e, s, Point32(0, 0, -1)) == CLOCKWISE))
+					{
+						start0 = e;
+					}
+				}
+				e = e->next;
+			} while (e != c0->edges);
+		}
+		
+		e = c1->edges;
+		Edge* start1 = NULL;
+		if (e)
+		{
+			do
+			{
+				int64_t dot = (*e->target - *c1).dot(normal);
+				btAssert(dot <= 0);
+				if ((dot == 0) && ((*e->target - *c1).dot(t) > 0))
+				{
+					if (!start1 || (getOrientation(start1, e, s, Point32(0, 0, -1)) == COUNTER_CLOCKWISE))
+					{
+						start1 = e;
+					}
+				}
+				e = e->next;
+			} while (e != c1->edges);
+		}
+
+		if (start0 || start1)
+		{
+			findEdgeForCoplanarFaces(c0, c1, start0, start1, NULL, NULL);
+			if (start0)
+			{
+				c0 = start0->target;
+			}
+			if (start1)
+			{
+				c1 = start1->target;
+			}
+		}
+
+		prevPoint = c1->point;
+		prevPoint.z++;
+	}
+	else
+	{
+		prevPoint = c1->point;
+		prevPoint.x++;
+	}
+
+	Vertex* first0 = c0;
+	Vertex* first1 = c1;
+	bool firstRun = true;
+
+	while (true)
+	{
+		Point32 s = *c1 - *c0;
+		Point32 r = prevPoint - c0->point;
+		Point64 rxs = r.cross(s);
+		Point64 sxrxs = s.cross(rxs);
+		
+#ifdef DEBUG_CONVEX_HULL
+		printf("\n  Checking %d %d\n", c0->point.index, c1->point.index);
+#endif
+		Rational64 minCot0(0, 0);
+		Edge* min0 = findMaxAngle(false, c0, s, rxs, sxrxs, minCot0);
+		Rational64 minCot1(0, 0);
+		Edge* min1 = findMaxAngle(true, c1, s, rxs, sxrxs, minCot1);
+		if (!min0 && !min1)
+		{
+			Edge* e = newEdgePair(c0, c1);
+			e->link(e);
+			c0->edges = e;
+
+			e = e->reverse;
+			e->link(e);
+			c1->edges = e;
+			return;
+		}
+		else
+		{
+			int cmp = !min0 ? 1 : !min1 ? -1 : minCot0.compare(minCot1);
+#ifdef DEBUG_CONVEX_HULL
+			printf("    -> Result %d\n", cmp);
+#endif
+			if (firstRun || ((cmp >= 0) ? !minCot1.isNegativeInfinity() : !minCot0.isNegativeInfinity()))
+			{
+				Edge* e = newEdgePair(c0, c1);
+				if (pendingTail0)
+				{
+					pendingTail0->prev = e;
+				}
+				else
+				{
+					pendingHead0 = e;
+				}
+				e->next = pendingTail0;
+				pendingTail0 = e;
+
+				e = e->reverse;
+				if (pendingTail1)
+				{
+					pendingTail1->next = e;
+				}
+				else
+				{
+					pendingHead1 = e;
+				}
+				e->prev = pendingTail1;
+				pendingTail1 = e;
+			}
+			
+			Edge* e0 = min0;
+			Edge* e1 = min1;
+
+#ifdef DEBUG_CONVEX_HULL
+			printf("   Found min edges to %d %d\n", e0 ? e0->target->point.index : -1, e1 ? e1->target->point.index : -1);
+#endif
+
+			if (cmp == 0)
+			{
+				findEdgeForCoplanarFaces(c0, c1, e0, e1, NULL, NULL);
+			}
+
+			if ((cmp >= 0) && e1)
+			{
+				if (toPrev1)
+				{
+					for (Edge* e = toPrev1->next, *n = NULL; e != min1; e = n)
+					{
+						n = e->next;
+						removeEdgePair(e);
+					}
+				}
+
+				if (pendingTail1)
+				{
+					if (toPrev1)
+					{
+						toPrev1->link(pendingHead1);
+					}
+					else
+					{
+						min1->prev->link(pendingHead1);
+						firstNew1 = pendingHead1;
+					}
+					pendingTail1->link(min1);
+					pendingHead1 = NULL;
+					pendingTail1 = NULL;
+				}
+				else if (!toPrev1)
+				{
+					firstNew1 = min1;
+				}
+
+				prevPoint = c1->point;
+				c1 = e1->target;
+				toPrev1 = e1->reverse;
+			}
+
+			if ((cmp <= 0) && e0)
+			{
+				if (toPrev0)
+				{
+					for (Edge* e = toPrev0->prev, *n = NULL; e != min0; e = n)
+					{
+						n = e->prev;
+						removeEdgePair(e);
+					}
+				}
+
+				if (pendingTail0)
+				{
+					if (toPrev0)
+					{
+						pendingHead0->link(toPrev0);
+					}
+					else
+					{
+						pendingHead0->link(min0->next);
+						firstNew0 = pendingHead0;
+					}
+					min0->link(pendingTail0);
+					pendingHead0 = NULL;
+					pendingTail0 = NULL;
+				}
+				else if (!toPrev0)
+				{
+					firstNew0 = min0;
+				}
+
+				prevPoint = c0->point;
+				c0 = e0->target;
+				toPrev0 = e0->reverse;
+			}
+		}
+
+		if ((c0 == first0) && (c1 == first1))
+		{
+			if (toPrev0 == NULL)
+			{
+				pendingHead0->link(pendingTail0);
+				c0->edges = pendingTail0;
+			}
+			else
+			{
+				for (Edge* e = toPrev0->prev, *n = NULL; e != firstNew0; e = n)
+				{
+					n = e->prev;
+					removeEdgePair(e);
+				}
+				if (pendingTail0)
+				{
+					pendingHead0->link(toPrev0);
+					firstNew0->link(pendingTail0);
+				}
+			}
+
+			if (toPrev1 == NULL)
+			{
+				pendingTail1->link(pendingHead1);
+				c1->edges = pendingTail1;
+			}
+			else
+			{
+				for (Edge* e = toPrev1->next, *n = NULL; e != firstNew1; e = n)
+				{
+					n = e->next;
+					removeEdgePair(e);
+				}
+				if (pendingTail1)
+				{
+					toPrev1->link(pendingHead1);
+					pendingTail1->link(firstNew1);
+				}
+			}
+			
+			return;
+		}
+
+		firstRun = false;
+	}
+}
+
+
+static bool pointCmp(const btConvexHullInternal::Point32& p, const btConvexHullInternal::Point32& q)
+{
+	return (p.y < q.y) || ((p.y == q.y) && ((p.x < q.x) || ((p.x == q.x) && (p.z < q.z))));
+}
+
+void btConvexHullInternal::compute(const void* coords, bool doubleCoords, int stride, int count)
+{
+	btVector3 min(btScalar(1e30), btScalar(1e30), btScalar(1e30)), max(btScalar(-1e30), btScalar(-1e30), btScalar(-1e30));
+	const char* ptr = (const char*) coords;
+	if (doubleCoords)
+	{
+		for (int i = 0; i < count; i++)
+		{
+			const double* v = (const double*) ptr;
+			btVector3 p((btScalar) v[0], (btScalar) v[1], (btScalar) v[2]);
+			ptr += stride;
+			min.setMin(p);
+			max.setMax(p);
+		}
+	}
+	else
+	{
+		for (int i = 0; i < count; i++)
+		{
+			const float* v = (const float*) ptr;
+			btVector3 p(v[0], v[1], v[2]);
+			ptr += stride;
+			min.setMin(p);
+			max.setMax(p);
+		}
+	}
+
+	btVector3 s = max - min;
+	maxAxis = s.maxAxis();
+	minAxis = s.minAxis();
+	if (minAxis == maxAxis)
+	{
+		minAxis = (maxAxis + 1) % 3;
+	}
+	medAxis = 3 - maxAxis - minAxis;
+
+	s /= btScalar(10216);
+
+	scaling = s;
+	if (s[0] > 0)
+	{
+		s[0] = btScalar(1) / s[0];
+	}
+	if (s[1] > 0)
+	{
+		s[1] = btScalar(1) / s[1];
+	}
+	if (s[2] > 0)
+	{
+		s[2] = btScalar(1) / s[2];
+	}
+
+	center = (min + max) * btScalar(0.5);
+
+	btAlignedObjectArray<Point32> points;
+	points.resize(count);
+	ptr = (const char*) coords;
+	if (doubleCoords)
+	{
+		for (int i = 0; i < count; i++)
+		{
+			const double* v = (const double*) ptr;
+			btVector3 p((btScalar) v[0], (btScalar) v[1], (btScalar) v[2]);
+			ptr += stride;
+			p = (p - center) * s;
+			points[i].x = (int32_t) p[medAxis];
+			points[i].y = (int32_t) p[maxAxis];
+			points[i].z = (int32_t) p[minAxis];
+			points[i].index = i;
+		}
+	}
+	else
+	{
+		for (int i = 0; i < count; i++)
+		{
+			const float* v = (const float*) ptr;
+			btVector3 p(v[0], v[1], v[2]);
+			ptr += stride;
+			p = (p - center) * s;
+			points[i].x = (int32_t) p[medAxis];
+			points[i].y = (int32_t) p[maxAxis];
+			points[i].z = (int32_t) p[minAxis];
+			points[i].index = i;
+		}
+	}
+	points.quickSort(pointCmp);
+
+	vertexPool.reset();
+	vertexPool.setArraySize(count);
+	originalVertices.resize(count);
+	for (int i = 0; i < count; i++)
+	{
+		Vertex* v = vertexPool.newObject();
+		v->edges = NULL;
+		v->point = points[i];
+		v->copy = -1;
+		originalVertices[i] = v;
+	}
+
+	points.clear();
+
+	edgePool.reset();
+	edgePool.setArraySize(6 * count);
+
+	usedEdgePairs = 0;
+	maxUsedEdgePairs = 0;
+
+	mergeStamp = -3;
+
+	IntermediateHull hull;
+	computeInternal(0, count, hull);
+	vertexList = hull.minXy;
+#ifdef DEBUG_CONVEX_HULL
+	printf("max. edges %d (3v = %d)", maxUsedEdgePairs, 3 * count);
+#endif
+}
+
+btVector3 btConvexHullInternal::toBtVector(const Point32& v)
+{
+	btVector3 p;
+	p[medAxis] = btScalar(v.x);
+	p[maxAxis] = btScalar(v.y);
+	p[minAxis] = btScalar(v.z);
+	return p * scaling;
+}
+
+btVector3 btConvexHullInternal::getBtNormal(Face* face)
+{
+	btVector3 normal = toBtVector(face->dir0).cross(toBtVector(face->dir1));
+	normal /= ((medAxis + 1 == maxAxis) || (medAxis - 2 == maxAxis)) ? normal.length() : -normal.length();
+	return normal;
+}
+
+btVector3 btConvexHullInternal::getCoordinates(const Vertex* v)
+{
+	btVector3 p;
+	p[medAxis] = v->xvalue();
+	p[maxAxis] = v->yvalue();
+	p[minAxis] = v->zvalue();
+	return p * scaling + center;
+}
+
+btScalar btConvexHullInternal::shrink(btScalar amount, btScalar clampAmount)
+{
+	if (!vertexList)
+	{
+		return 0;
+	}
+	int stamp = --mergeStamp;
+	btAlignedObjectArray<Vertex*> stack;
+	vertexList->copy = stamp;
+	stack.push_back(vertexList);
+	btAlignedObjectArray<Face*> faces;
+
+	Point32 ref = vertexList->point;
+	Int128 hullCenterX(0, 0);
+	Int128 hullCenterY(0, 0);
+	Int128 hullCenterZ(0, 0);
+	Int128 volume(0, 0);
+
+	while (stack.size() > 0)
+	{
+		Vertex* v = stack[stack.size() - 1];
+		stack.pop_back();
+		Edge* e = v->edges;
+		if (e)
+		{
+			do
+			{
+				if (e->target->copy != stamp)
+				{
+					e->target->copy = stamp;
+					stack.push_back(e->target);
+				}
+				if (e->copy != stamp)
+				{
+					Face* face = facePool.newObject();
+					face->init(e->target, e->reverse->prev->target, v);
+					faces.push_back(face);
+					Edge* f = e;
+
+					Vertex* a = NULL;
+					Vertex* b = NULL;
+					do
+					{
+						if (a && b)
+						{
+							int64_t vol = (v->point - ref).dot((a->point - ref).cross(b->point - ref));
+							btAssert(vol >= 0);
+							Point32 c = v->point + a->point + b->point + ref;
+							hullCenterX += vol * c.x;
+							hullCenterY += vol * c.y;
+							hullCenterZ += vol * c.z;
+							volume += vol;
+						}
+
+						btAssert(f->copy != stamp);
+						f->copy = stamp;
+						f->face = face;
+
+						a = b;
+						b = f->target;
+
+						f = f->reverse->prev;
+					} while (f != e);
+				}
+				e = e->next;
+			} while (e != v->edges);
+		}
+	}
+
+	if (volume.getSign() <= 0)
+	{
+		return 0;
+	}
+
+	btVector3 hullCenter;
+	hullCenter[medAxis] = hullCenterX.toScalar();
+	hullCenter[maxAxis] = hullCenterY.toScalar();
+	hullCenter[minAxis] = hullCenterZ.toScalar();
+	hullCenter /= 4 * volume.toScalar();
+	hullCenter *= scaling;
+
+	int faceCount = faces.size();
+
+	if (clampAmount > 0)
+	{
+		btScalar minDist = SIMD_INFINITY;
+		for (int i = 0; i < faceCount; i++)
+		{
+			btVector3 normal = getBtNormal(faces[i]);
+			btScalar dist = normal.dot(toBtVector(faces[i]->origin) - hullCenter);
+			if (dist < minDist)
+			{
+				minDist = dist;
+			}
+		}
+		
+		if (minDist <= 0)
+		{
+			return 0;
+		}
+
+		amount = btMin(amount, minDist * clampAmount);
+	}
+
+	unsigned int seed = 243703;
+	for (int i = 0; i < faceCount; i++, seed = 1664525 * seed + 1013904223)
+	{
+		btSwap(faces[i], faces[seed % faceCount]);
+	}
+
+	for (int i = 0; i < faceCount; i++)
+	{
+		if (!shiftFace(faces[i], amount, stack))
+		{
+			return -amount;
+		}
+	}
+
+	return amount;
+}
+
+bool btConvexHullInternal::shiftFace(Face* face, btScalar amount, btAlignedObjectArray<Vertex*> stack)
+{
+	btVector3 origShift = getBtNormal(face) * -amount;
+	if (scaling[0] > 0)
+	{
+		origShift[0] /= scaling[0];
+	}
+	if (scaling[1] > 0)
+	{
+		origShift[1] /= scaling[1];
+	}
+	if (scaling[2] > 0)
+	{
+		origShift[2] /= scaling[2];
+	}
+	Point32 shift((int32_t) origShift[medAxis], (int32_t) origShift[maxAxis], (int32_t) origShift[minAxis]);
+	if (shift.isZero())
+	{
+		return true;
+	}
+	Point64 normal = face->getNormal();
+#ifdef DEBUG_CONVEX_HULL
+	printf("\nShrinking face (%d %d %d) (%d %d %d) (%d %d %d) by (%d %d %d)\n",
+				 face->origin.x, face->origin.y, face->origin.z, face->dir0.x, face->dir0.y, face->dir0.z, face->dir1.x, face->dir1.y, face->dir1.z, shift.x, shift.y, shift.z);
+#endif
+	int64_t origDot = face->origin.dot(normal);
+	Point32 shiftedOrigin = face->origin + shift;
+	int64_t shiftedDot = shiftedOrigin.dot(normal);
+	btAssert(shiftedDot <= origDot);
+	if (shiftedDot >= origDot)
+	{
+		return false;
+	}
+
+	Edge* intersection = NULL;
+
+	Edge* startEdge = face->nearbyVertex->edges;
+#ifdef DEBUG_CONVEX_HULL
+	printf("Start edge is ");
+	startEdge->print();
+	printf(", normal is (%lld %lld %lld), shifted dot is %lld\n", normal.x, normal.y, normal.z, shiftedDot);
+#endif
+	Rational128 optDot = face->nearbyVertex->dot(normal);
+	int cmp = optDot.compare(shiftedDot);
+#ifdef SHOW_ITERATIONS
+	int n = 0;
+#endif
+	if (cmp >= 0)
+	{
+		Edge* e = startEdge;
+		do
+		{
+#ifdef SHOW_ITERATIONS
+			n++;
+#endif
+			Rational128 dot = e->target->dot(normal);
+			btAssert(dot.compare(origDot) <= 0);
+#ifdef DEBUG_CONVEX_HULL
+			printf("Moving downwards, edge is ");
+			e->print();
+			printf(", dot is %f (%f %lld)\n", (float) dot.toScalar(), (float) optDot.toScalar(), shiftedDot);
+#endif
+			if (dot.compare(optDot) < 0)
+			{
+				int c = dot.compare(shiftedDot);
+				optDot = dot;
+				e = e->reverse;
+				startEdge = e;
+				if (c < 0)
+				{
+					intersection = e;
+					break;
+				}
+				cmp = c;
+			}
+			e = e->prev;
+		} while (e != startEdge);
+
+		if (!intersection)
+		{
+			return false;
+		}
+	}
+	else
+	{
+		Edge* e = startEdge;
+		do
+		{
+#ifdef SHOW_ITERATIONS
+			n++;
+#endif
+			Rational128 dot = e->target->dot(normal);
+			btAssert(dot.compare(origDot) <= 0);
+#ifdef DEBUG_CONVEX_HULL
+			printf("Moving upwards, edge is ");
+			e->print();
+			printf(", dot is %f (%f %lld)\n", (float) dot.toScalar(), (float) optDot.toScalar(), shiftedDot);
+#endif
+			if (dot.compare(optDot) > 0)
+			{
+				cmp = dot.compare(shiftedDot);
+				if (cmp >= 0)
+				{
+					intersection = e;
+					break;
+				}
+				optDot = dot;
+				e = e->reverse;
+				startEdge = e;
+			}
+			e = e->prev;
+		} while (e != startEdge);
+		
+		if (!intersection)
+		{
+			return true;
+		}
+	}
+
+#ifdef SHOW_ITERATIONS
+	printf("Needed %d iterations to find initial intersection\n", n);
+#endif
+
+	if (cmp == 0)
+	{
+		Edge* e = intersection->reverse->next;
+#ifdef SHOW_ITERATIONS
+		n = 0;
+#endif
+		while (e->target->dot(normal).compare(shiftedDot) <= 0)
+		{
+#ifdef SHOW_ITERATIONS
+			n++;
+#endif
+			e = e->next;
+			if (e == intersection->reverse)
+			{
+				return true;
+			}
+#ifdef DEBUG_CONVEX_HULL
+			printf("Checking for outwards edge, current edge is ");
+			e->print();
+			printf("\n");
+#endif
+		}
+#ifdef SHOW_ITERATIONS
+		printf("Needed %d iterations to check for complete containment\n", n);
+#endif
+	}
+	
+	Edge* firstIntersection = NULL;
+	Edge* faceEdge = NULL;
+	Edge* firstFaceEdge = NULL;
+
+#ifdef SHOW_ITERATIONS
+	int m = 0;
+#endif
+	while (true)
+	{
+#ifdef SHOW_ITERATIONS
+		m++;
+#endif
+#ifdef DEBUG_CONVEX_HULL
+		printf("Intersecting edge is ");
+		intersection->print();
+		printf("\n");
+#endif
+		if (cmp == 0)
+		{
+			Edge* e = intersection->reverse->next;
+			startEdge = e;
+#ifdef SHOW_ITERATIONS
+			n = 0;
+#endif
+			while (true)
+			{
+#ifdef SHOW_ITERATIONS
+				n++;
+#endif
+				if (e->target->dot(normal).compare(shiftedDot) >= 0)
+				{
+					break;
+				}
+				intersection = e->reverse;
+				e = e->next;
+				if (e == startEdge)
+				{
+					return true;
+				}
+			}
+#ifdef SHOW_ITERATIONS
+			printf("Needed %d iterations to advance intersection\n", n);
+#endif
+		}
+
+#ifdef DEBUG_CONVEX_HULL
+		printf("Advanced intersecting edge to ");
+		intersection->print();
+		printf(", cmp = %d\n", cmp);
+#endif
+
+		if (!firstIntersection)
+		{
+			firstIntersection = intersection;
+		}
+		else if (intersection == firstIntersection)
+		{
+			break;
+		}
+
+		int prevCmp = cmp;
+		Edge* prevIntersection = intersection;
+		Edge* prevFaceEdge = faceEdge;
+
+		Edge* e = intersection->reverse;
+#ifdef SHOW_ITERATIONS
+		n = 0;
+#endif
+		while (true)
+		{
+#ifdef SHOW_ITERATIONS
+			n++;
+#endif
+			e = e->reverse->prev;
+			btAssert(e != intersection->reverse);
+			cmp = e->target->dot(normal).compare(shiftedDot);
+#ifdef DEBUG_CONVEX_HULL
+			printf("Testing edge ");
+			e->print();
+			printf(" -> cmp = %d\n", cmp);
+#endif
+			if (cmp >= 0)
+			{
+				intersection = e;
+				break;
+			}
+		}
+#ifdef SHOW_ITERATIONS
+		printf("Needed %d iterations to find other intersection of face\n", n);
+#endif
+
+		if (cmp > 0)
+		{
+			Vertex* removed = intersection->target;
+			e = intersection->reverse;
+			if (e->prev == e)
+			{
+				removed->edges = NULL;
+			}
+			else
+			{
+				removed->edges = e->prev;
+				e->prev->link(e->next);
+				e->link(e);
+			}
+#ifdef DEBUG_CONVEX_HULL
+			printf("1: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
+#endif
+			
+			Point64 n0 = intersection->face->getNormal();
+			Point64 n1 = intersection->reverse->face->getNormal();
+			int64_t m00 = face->dir0.dot(n0);
+			int64_t m01 = face->dir1.dot(n0);
+			int64_t m10 = face->dir0.dot(n1);
+			int64_t m11 = face->dir1.dot(n1);
+			int64_t r0 = (intersection->face->origin - shiftedOrigin).dot(n0);
+			int64_t r1 = (intersection->reverse->face->origin - shiftedOrigin).dot(n1);
+			Int128 det = Int128::mul(m00, m11) - Int128::mul(m01, m10);
+			btAssert(det.getSign() != 0);
+			Vertex* v = vertexPool.newObject();
+			v->point.index = -1;
+			v->copy = -1;
+			v->point128 = PointR128(Int128::mul(face->dir0.x * r0, m11) - Int128::mul(face->dir0.x * r1, m01)
+															+ Int128::mul(face->dir1.x * r1, m00) - Int128::mul(face->dir1.x * r0, m10) + det * shiftedOrigin.x,
+															Int128::mul(face->dir0.y * r0, m11) - Int128::mul(face->dir0.y * r1, m01)
+															+ Int128::mul(face->dir1.y * r1, m00) - Int128::mul(face->dir1.y * r0, m10) + det * shiftedOrigin.y,
+															Int128::mul(face->dir0.z * r0, m11) - Int128::mul(face->dir0.z * r1, m01)
+															+ Int128::mul(face->dir1.z * r1, m00) - Int128::mul(face->dir1.z * r0, m10) + det * shiftedOrigin.z,
+															det);
+			v->point.x = (int32_t) v->point128.xvalue();
+			v->point.y = (int32_t) v->point128.yvalue();
+			v->point.z = (int32_t) v->point128.zvalue();
+			intersection->target = v;
+			v->edges = e;
+
+			stack.push_back(v);
+			stack.push_back(removed);
+			stack.push_back(NULL);
+		}
+
+		if (cmp || prevCmp || (prevIntersection->reverse->next->target != intersection->target))
+		{
+			faceEdge = newEdgePair(prevIntersection->target, intersection->target);
+			if (prevCmp == 0)
+			{
+				faceEdge->link(prevIntersection->reverse->next);
+			}
+			if ((prevCmp == 0) || prevFaceEdge)
+			{
+				prevIntersection->reverse->link(faceEdge);
+			}
+			if (cmp == 0)
+			{
+				intersection->reverse->prev->link(faceEdge->reverse);
+			}
+			faceEdge->reverse->link(intersection->reverse);
+		}
+		else
+		{
+			faceEdge = prevIntersection->reverse->next;
+		}
+
+		if (prevFaceEdge)
+		{
+			if (prevCmp > 0)
+			{
+				faceEdge->link(prevFaceEdge->reverse);
+			}
+			else if (faceEdge != prevFaceEdge->reverse)
+			{
+				stack.push_back(prevFaceEdge->target);
+				while (faceEdge->next != prevFaceEdge->reverse)
+				{
+					Vertex* removed = faceEdge->next->target;
+					removeEdgePair(faceEdge->next);
+					stack.push_back(removed);
+#ifdef DEBUG_CONVEX_HULL
+					printf("2: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
+#endif
+				}
+				stack.push_back(NULL);
+			}
+		}
+		faceEdge->face = face;
+		faceEdge->reverse->face = intersection->face;
+
+		if (!firstFaceEdge)
+		{
+			firstFaceEdge = faceEdge;
+		}
+	}
+#ifdef SHOW_ITERATIONS
+	printf("Needed %d iterations to process all intersections\n", m);
+#endif
+
+	if (cmp > 0)
+	{
+		firstFaceEdge->reverse->target = faceEdge->target;
+		firstIntersection->reverse->link(firstFaceEdge);
+		firstFaceEdge->link(faceEdge->reverse);
+	}
+	else if (firstFaceEdge != faceEdge->reverse)
+	{
+		stack.push_back(faceEdge->target);
+		while (firstFaceEdge->next != faceEdge->reverse)
+		{
+			Vertex* removed = firstFaceEdge->next->target;
+			removeEdgePair(firstFaceEdge->next);
+			stack.push_back(removed);
+#ifdef DEBUG_CONVEX_HULL
+			printf("3: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
+#endif
+		}
+		stack.push_back(NULL);
+	}
+
+	btAssert(stack.size() > 0);
+	vertexList = stack[0];
+
+#ifdef DEBUG_CONVEX_HULL
+	printf("Removing part\n");
+#endif
+#ifdef SHOW_ITERATIONS
+	n = 0;
+#endif
+	int pos = 0;
+	while (pos < stack.size())
+	{
+		int end = stack.size();
+		while (pos < end)
+		{
+			Vertex* kept = stack[pos++];
+#ifdef DEBUG_CONVEX_HULL
+			kept->print();
+#endif
+			bool deeper = false;
+			Vertex* removed;
+			while ((removed = stack[pos++]) != NULL)
+			{
+#ifdef SHOW_ITERATIONS
+				n++;
+#endif
+				kept->receiveNearbyFaces(removed);
+				while (removed->edges)
+				{
+					if (!deeper)
+					{
+						deeper = true;
+						stack.push_back(kept);
+					}
+					stack.push_back(removed->edges->target);
+					removeEdgePair(removed->edges);
+				}
+			}
+			if (deeper)
+			{
+				stack.push_back(NULL);
+			}
+		}
+	}
+#ifdef SHOW_ITERATIONS
+	printf("Needed %d iterations to remove part\n", n);
+#endif
+
+	stack.resize(0);
+	face->origin = shiftedOrigin;
+
+	return true;
+}
+
+
+static int getVertexCopy(btConvexHullInternal::Vertex* vertex, btAlignedObjectArray<btConvexHullInternal::Vertex*>& vertices)
+{
+	int index = vertex->copy;
+	if (index < 0)
+	{
+		index = vertices.size();
+		vertex->copy = index;
+		vertices.push_back(vertex);
+#ifdef DEBUG_CONVEX_HULL
+		printf("Vertex %d gets index *%d\n", vertex->point.index, index);
+#endif
+	}
+	return index;
+}
+
+btScalar btConvexHullComputer::compute(const void* coords, bool doubleCoords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
+{
+	if (count <= 0)
+	{
+		vertices.clear();
+		edges.clear();
+		faces.clear();
+		return 0;
+	}
+
+	btConvexHullInternal hull;
+	hull.compute(coords, doubleCoords, stride, count);
+
+	btScalar shift = 0;
+	if ((shrink > 0) && ((shift = hull.shrink(shrink, shrinkClamp)) < 0))
+	{
+		vertices.clear();
+		edges.clear();
+		faces.clear();
+		return shift;
+	}
+
+	vertices.resize(0);
+	edges.resize(0);
+	faces.resize(0);
+
+	btAlignedObjectArray<btConvexHullInternal::Vertex*> oldVertices;
+	getVertexCopy(hull.vertexList, oldVertices);
+	int copied = 0;
+	while (copied < oldVertices.size())
+	{
+		btConvexHullInternal::Vertex* v = oldVertices[copied];
+		vertices.push_back(hull.getCoordinates(v));
+		btConvexHullInternal::Edge* firstEdge = v->edges;
+		if (firstEdge)
+		{
+			int firstCopy = -1;
+			int prevCopy = -1;
+			btConvexHullInternal::Edge* e = firstEdge;
+			do
+			{
+				if (e->copy < 0)
+				{
+					int s = edges.size();
+					edges.push_back(Edge());
+					edges.push_back(Edge());
+					Edge* c = &edges[s];
+					Edge* r = &edges[s + 1];
+					e->copy = s;
+					e->reverse->copy = s + 1;
+					c->reverse = 1;
+					r->reverse = -1;
+					c->targetVertex = getVertexCopy(e->target, oldVertices);
+					r->targetVertex = copied;
+#ifdef DEBUG_CONVEX_HULL
+					printf("      CREATE: Vertex *%d has edge to *%d\n", copied, c->getTargetVertex());
+#endif
+				}
+				if (prevCopy >= 0)
+				{
+					edges[e->copy].next = prevCopy - e->copy;
+				}
+				else
+				{
+					firstCopy = e->copy;
+				}
+				prevCopy = e->copy;
+				e = e->next;
+			} while (e != firstEdge);
+			edges[firstCopy].next = prevCopy - firstCopy;
+		}
+		copied++;
+	}
+
+	for (int i = 0; i < copied; i++)
+	{
+		btConvexHullInternal::Vertex* v = oldVertices[i];
+		btConvexHullInternal::Edge* firstEdge = v->edges;
+		if (firstEdge)
+		{
+			btConvexHullInternal::Edge* e = firstEdge;
+			do
+			{
+				if (e->copy >= 0)
+				{
+#ifdef DEBUG_CONVEX_HULL
+					printf("Vertex *%d has edge to *%d\n", i, edges[e->copy].getTargetVertex());
+#endif
+					faces.push_back(e->copy);
+					btConvexHullInternal::Edge* f = e;
+					do
+					{
+#ifdef DEBUG_CONVEX_HULL
+						printf("   Face *%d\n", edges[f->copy].getTargetVertex());
+#endif
+						f->copy = -1;
+						f = f->reverse->prev;
+					} while (f != e);
+				}
+				e = e->next;
+			} while (e != firstEdge);
+		}
+	}
+
+	return shift;
+}
+
+
+
+
+
diff --git a/hkl3d/bullet/src/LinearMath/btConvexHullComputer.h b/hkl3d/bullet/src/LinearMath/btConvexHullComputer.h
new file mode 100644
index 0000000..f1d2630
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btConvexHullComputer.h
@@ -0,0 +1,103 @@
+/*
+Copyright (c) 2011 Ole Kniemeyer, MAXON, www.maxon.net
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_HULL_COMPUTER_H
+#define BT_CONVEX_HULL_COMPUTER_H
+
+#include "btVector3.h"
+#include "btAlignedObjectArray.h"
+
+/// Convex hull implementation based on Preparata and Hong
+/// See http://code.google.com/p/bullet/issues/detail?id=275
+/// Ole Kniemeyer, MAXON Computer GmbH
+class btConvexHullComputer
+{
+	private:
+		btScalar compute(const void* coords, bool doubleCoords, int stride, int count, btScalar shrink, btScalar shrinkClamp);
+
+	public:
+
+		class Edge
+		{
+			private:
+				int next;
+				int reverse;
+				int targetVertex;
+
+				friend class btConvexHullComputer;
+
+			public:
+				int getSourceVertex() const
+				{
+					return (this + reverse)->targetVertex;
+				}
+
+				int getTargetVertex() const
+				{
+					return targetVertex;
+				}
+
+				const Edge* getNextEdgeOfVertex() const // counter-clockwise list of all edges of a vertex
+				{
+					return this + next;
+				}
+
+				const Edge* getNextEdgeOfFace() const // clockwise list of all edges of a face
+				{
+					return (this + reverse)->getNextEdgeOfVertex();
+				}
+
+				const Edge* getReverseEdge() const
+				{
+					return this + reverse;
+				}
+		};
+
+
+		// Vertices of the output hull
+		btAlignedObjectArray<btVector3> vertices;
+
+		// Edges of the output hull
+		btAlignedObjectArray<Edge> edges;
+
+		// Faces of the convex hull. Each entry is an index into the "edges" array pointing to an edge of the face. Faces are planar n-gons
+		btAlignedObjectArray<int> faces;
+
+		/*
+		Compute convex hull of "count" vertices stored in "coords". "stride" is the difference in bytes
+		between the addresses of consecutive vertices. If "shrink" is positive, the convex hull is shrunken
+		by that amount (each face is moved by "shrink" length units towards the center along its normal).
+		If "shrinkClamp" is positive, "shrink" is clamped to not exceed "shrinkClamp * innerRadius", where "innerRadius"
+		is the minimum distance of a face to the center of the convex hull.
+
+		The returned value is the amount by which the hull has been shrunken. If it is negative, the amount was so large
+		that the resulting convex hull is empty.
+
+		The output convex hull can be found in the member variables "vertices", "edges", "faces".
+		*/
+		btScalar compute(const float* coords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
+		{
+			return compute(coords, false, stride, count, shrink, shrinkClamp);
+		}
+
+		// same as above, but double precision
+		btScalar compute(const double* coords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
+		{
+			return compute(coords, true, stride, count, shrink, shrinkClamp);
+		}
+};
+
+
+#endif //BT_CONVEX_HULL_COMPUTER_H
+
diff --git a/hkl3d/bullet/src/LinearMath/btDefaultMotionState.h b/hkl3d/bullet/src/LinearMath/btDefaultMotionState.h
new file mode 100644
index 0000000..a6b7ef1
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btDefaultMotionState.h
@@ -0,0 +1,40 @@
+#ifndef BT_DEFAULT_MOTION_STATE_H
+#define BT_DEFAULT_MOTION_STATE_H
+
+#include "btMotionState.h"
+
+///The btDefaultMotionState provides a common implementation to synchronize world transforms with offsets.
+struct	btDefaultMotionState : public btMotionState
+{
+	btTransform m_graphicsWorldTrans;
+	btTransform	m_centerOfMassOffset;
+	btTransform m_startWorldTrans;
+	void*		m_userPointer;
+
+	btDefaultMotionState(const btTransform& startTrans = btTransform::getIdentity(),const btTransform& centerOfMassOffset = btTransform::getIdentity())
+		: m_graphicsWorldTrans(startTrans),
+		m_centerOfMassOffset(centerOfMassOffset),
+		m_startWorldTrans(startTrans),
+		m_userPointer(0)
+
+	{
+	}
+
+	///synchronizes world transform from user to physics
+	virtual void	getWorldTransform(btTransform& centerOfMassWorldTrans ) const 
+	{
+			centerOfMassWorldTrans = 	m_centerOfMassOffset.inverse() * m_graphicsWorldTrans ;
+	}
+
+	///synchronizes world transform from physics to user
+	///Bullet only calls the update of worldtransform for active objects
+	virtual void	setWorldTransform(const btTransform& centerOfMassWorldTrans)
+	{
+			m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset ;
+	}
+
+	
+
+};
+
+#endif //BT_DEFAULT_MOTION_STATE_H
diff --git a/hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp b/hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp
new file mode 100644
index 0000000..5ac230f
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btGeometryUtil.cpp
@@ -0,0 +1,185 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#include "btGeometryUtil.h"
+
+
+/*
+  Make sure this dummy function never changes so that it
+  can be used by probes that are checking whether the
+  library is actually installed.
+*/
+extern "C"
+{	
+	void btBulletMathProbe ();
+
+	void btBulletMathProbe () {}
+}
+
+
+bool	btGeometryUtil::isPointInsidePlanes(const btAlignedObjectArray<btVector3>& planeEquations, const btVector3& point, btScalar	margin)
+{
+	int numbrushes = planeEquations.size();
+	for (int i=0;i<numbrushes;i++)
+	{
+		const btVector3& N1 = planeEquations[i];
+		btScalar dist = btScalar(N1.dot(point))+btScalar(N1[3])-margin;
+		if (dist>btScalar(0.))
+		{
+			return false;
+		}
+	}
+	return true;
+		
+}
+
+
+bool	btGeometryUtil::areVerticesBehindPlane(const btVector3& planeNormal, const btAlignedObjectArray<btVector3>& vertices, btScalar	margin)
+{
+	int numvertices = vertices.size();
+	for (int i=0;i<numvertices;i++)
+	{
+		const btVector3& N1 = vertices[i];
+		btScalar dist = btScalar(planeNormal.dot(N1))+btScalar(planeNormal[3])-margin;
+		if (dist>btScalar(0.))
+		{
+			return false;
+		}
+	}
+	return true;
+}
+
+bool notExist(const btVector3& planeEquation,const btAlignedObjectArray<btVector3>& planeEquations);
+
+bool notExist(const btVector3& planeEquation,const btAlignedObjectArray<btVector3>& planeEquations)
+{
+	int numbrushes = planeEquations.size();
+	for (int i=0;i<numbrushes;i++)
+	{
+		const btVector3& N1 = planeEquations[i];
+		if (planeEquation.dot(N1) > btScalar(0.999))
+		{
+			return false;
+		} 
+	}
+	return true;
+}
+
+void	btGeometryUtil::getPlaneEquationsFromVertices(btAlignedObjectArray<btVector3>& vertices, btAlignedObjectArray<btVector3>& planeEquationsOut )
+{
+		const int numvertices = vertices.size();
+	// brute force:
+	for (int i=0;i<numvertices;i++)
+	{
+		const btVector3& N1 = vertices[i];
+		
+
+		for (int j=i+1;j<numvertices;j++)
+		{
+			const btVector3& N2 = vertices[j];
+				
+			for (int k=j+1;k<numvertices;k++)
+			{
+
+				const btVector3& N3 = vertices[k];
+
+				btVector3 planeEquation,edge0,edge1;
+				edge0 = N2-N1;
+				edge1 = N3-N1;
+				btScalar normalSign = btScalar(1.);
+				for (int ww=0;ww<2;ww++)
+				{
+					planeEquation = normalSign * edge0.cross(edge1);
+					if (planeEquation.length2() > btScalar(0.0001))
+					{
+						planeEquation.normalize();
+						if (notExist(planeEquation,planeEquationsOut))
+						{
+							planeEquation[3] = -planeEquation.dot(N1);
+							
+								//check if inside, and replace supportingVertexOut if needed
+								if (areVerticesBehindPlane(planeEquation,vertices,btScalar(0.01)))
+								{
+									planeEquationsOut.push_back(planeEquation);
+								}
+						}
+					}
+					normalSign = btScalar(-1.);
+				}
+			
+			}
+		}
+	}
+
+}
+
+void	btGeometryUtil::getVerticesFromPlaneEquations(const btAlignedObjectArray<btVector3>& planeEquations , btAlignedObjectArray<btVector3>& verticesOut )
+{
+	const int numbrushes = planeEquations.size();
+	// brute force:
+	for (int i=0;i<numbrushes;i++)
+	{
+		const btVector3& N1 = planeEquations[i];
+		
+
+		for (int j=i+1;j<numbrushes;j++)
+		{
+			const btVector3& N2 = planeEquations[j];
+				
+			for (int k=j+1;k<numbrushes;k++)
+			{
+
+				const btVector3& N3 = planeEquations[k];
+
+				btVector3 n2n3; n2n3 = N2.cross(N3);
+				btVector3 n3n1; n3n1 = N3.cross(N1);
+				btVector3 n1n2; n1n2 = N1.cross(N2);
+				
+				if ( ( n2n3.length2() > btScalar(0.0001) ) &&
+					 ( n3n1.length2() > btScalar(0.0001) ) &&
+					 ( n1n2.length2() > btScalar(0.0001) ) )
+				{
+					//point P out of 3 plane equations:
+
+					//	d1 ( N2 * N3 ) + d2 ( N3 * N1 ) + d3 ( N1 * N2 )  
+					//P =  -------------------------------------------------------------------------  
+					//   N1 . ( N2 * N3 )  
+
+
+					btScalar quotient = (N1.dot(n2n3));
+					if (btFabs(quotient) > btScalar(0.000001))
+					{
+						quotient = btScalar(-1.) / quotient;
+						n2n3 *= N1[3];
+						n3n1 *= N2[3];
+						n1n2 *= N3[3];
+						btVector3 potentialVertex = n2n3;
+						potentialVertex += n3n1;
+						potentialVertex += n1n2;
+						potentialVertex *= quotient;
+
+						//check if inside, and replace supportingVertexOut if needed
+						if (isPointInsidePlanes(planeEquations,potentialVertex,btScalar(0.01)))
+						{
+							verticesOut.push_back(potentialVertex);
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
diff --git a/hkl3d/bullet/src/LinearMath/btGeometryUtil.h b/hkl3d/bullet/src/LinearMath/btGeometryUtil.h
new file mode 100644
index 0000000..a4b13b4
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btGeometryUtil.h
@@ -0,0 +1,42 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_GEOMETRY_UTIL_H
+#define BT_GEOMETRY_UTIL_H
+
+#include "btVector3.h"
+#include "btAlignedObjectArray.h"
+
+///The btGeometryUtil helper class provides a few methods to convert between plane equations and vertices.
+class btGeometryUtil
+{
+	public:
+	
+	
+		static void	getPlaneEquationsFromVertices(btAlignedObjectArray<btVector3>& vertices, btAlignedObjectArray<btVector3>& planeEquationsOut );
+
+		static void	getVerticesFromPlaneEquations(const btAlignedObjectArray<btVector3>& planeEquations , btAlignedObjectArray<btVector3>& verticesOut );
+	
+		static bool	isInside(const btAlignedObjectArray<btVector3>& vertices, const btVector3& planeNormal, btScalar	margin);
+		
+		static bool	isPointInsidePlanes(const btAlignedObjectArray<btVector3>& planeEquations, const btVector3& point, btScalar	margin);
+
+		static bool	areVerticesBehindPlane(const btVector3& planeNormal, const btAlignedObjectArray<btVector3>& vertices, btScalar	margin);
+
+};
+
+
+#endif //BT_GEOMETRY_UTIL_H
+
diff --git a/hkl3d/bullet/src/LinearMath/btHashMap.h b/hkl3d/bullet/src/LinearMath/btHashMap.h
new file mode 100644
index 0000000..ce07db3
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btHashMap.h
@@ -0,0 +1,450 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_HASH_MAP_H
+#define BT_HASH_MAP_H
+
+#include "btAlignedObjectArray.h"
+
+///very basic hashable string implementation, compatible with btHashMap
+struct btHashString
+{
+	const char* m_string;
+	unsigned int	m_hash;
+
+	SIMD_FORCE_INLINE	unsigned int getHash()const
+	{
+		return m_hash;
+	}
+
+	btHashString(const char* name)
+		:m_string(name)
+	{
+		/* magic numbers from http://www.isthe.com/chongo/tech/comp/fnv/ */
+		static const unsigned int  InitialFNV = 2166136261u;
+		static const unsigned int FNVMultiple = 16777619u;
+
+		/* Fowler / Noll / Vo (FNV) Hash */
+		unsigned int hash = InitialFNV;
+		
+		for(int i = 0; m_string[i]; i++)
+		{
+			hash = hash ^ (m_string[i]);       /* xor  the low 8 bits */
+			hash = hash * FNVMultiple;  /* multiply by the magic number */
+		}
+		m_hash = hash;
+	}
+
+	int portableStringCompare(const char* src,	const char* dst) const
+	{
+			int ret = 0 ;
+
+			while( ! (ret = *(unsigned char *)src - *(unsigned char *)dst) && *dst)
+					++src, ++dst;
+
+			if ( ret < 0 )
+					ret = -1 ;
+			else if ( ret > 0 )
+					ret = 1 ;
+
+			return( ret );
+	}
+
+	bool equals(const btHashString& other) const
+	{
+		return (m_string == other.m_string) ||
+			(0==portableStringCompare(m_string,other.m_string));
+
+	}
+
+};
+
+const int BT_HASH_NULL=0xffffffff;
+
+
+class btHashInt
+{
+	int	m_uid;
+public:
+	btHashInt(int uid)	:m_uid(uid)
+	{
+	}
+
+	int	getUid1() const
+	{
+		return m_uid;
+	}
+
+	void	setUid1(int uid)
+	{
+		m_uid = uid;
+	}
+
+	bool equals(const btHashInt& other) const
+	{
+		return getUid1() == other.getUid1();
+	}
+	//to our success
+	SIMD_FORCE_INLINE	unsigned int getHash()const
+	{
+		int key = m_uid;
+		// Thomas Wang's hash
+		key += ~(key << 15);	key ^=  (key >> 10);	key +=  (key << 3);	key ^=  (key >> 6);	key += ~(key << 11);	key ^=  (key >> 16);
+		return key;
+	}
+};
+
+
+
+class btHashPtr
+{
+
+	union
+	{
+		const void*	m_pointer;
+		int	m_hashValues[2];
+	};
+
+public:
+
+	btHashPtr(const void* ptr)
+		:m_pointer(ptr)
+	{
+	}
+
+	const void*	getPointer() const
+	{
+		return m_pointer;
+	}
+
+	bool equals(const btHashPtr& other) const
+	{
+		return getPointer() == other.getPointer();
+	}
+
+	//to our success
+	SIMD_FORCE_INLINE	unsigned int getHash()const
+	{
+		const bool VOID_IS_8 = ((sizeof(void*)==8));
+		
+		int key = VOID_IS_8? m_hashValues[0]+m_hashValues[1] : m_hashValues[0];
+	
+		// Thomas Wang's hash
+		key += ~(key << 15);	key ^=  (key >> 10);	key +=  (key << 3);	key ^=  (key >> 6);	key += ~(key << 11);	key ^=  (key >> 16);
+		return key;
+	}
+
+	
+};
+
+
+template <class Value>
+class btHashKeyPtr
+{
+        int     m_uid;
+public:
+
+        btHashKeyPtr(int uid)    :m_uid(uid)
+        {
+        }
+
+        int     getUid1() const
+        {
+                return m_uid;
+        }
+
+        bool equals(const btHashKeyPtr<Value>& other) const
+        {
+                return getUid1() == other.getUid1();
+        }
+
+        //to our success
+        SIMD_FORCE_INLINE       unsigned int getHash()const
+        {
+                int key = m_uid;
+                // Thomas Wang's hash
+                key += ~(key << 15);	key ^=  (key >> 10);	key +=  (key << 3);	key ^=  (key >> 6);	key += ~(key << 11);	key ^=  (key >> 16);
+                return key;
+        }
+
+        
+};
+
+
+template <class Value>
+class btHashKey
+{
+	int	m_uid;
+public:
+
+	btHashKey(int uid)	:m_uid(uid)
+	{
+	}
+
+	int	getUid1() const
+	{
+		return m_uid;
+	}
+
+	bool equals(const btHashKey<Value>& other) const
+	{
+		return getUid1() == other.getUid1();
+	}
+	//to our success
+	SIMD_FORCE_INLINE	unsigned int getHash()const
+	{
+		int key = m_uid;
+		// Thomas Wang's hash
+		key += ~(key << 15);	key ^=  (key >> 10);	key +=  (key << 3);	key ^=  (key >> 6);	key += ~(key << 11);	key ^=  (key >> 16);
+		return key;
+	}
+};
+
+
+///The btHashMap template class implements a generic and lightweight hashmap.
+///A basic sample of how to use btHashMap is located in Demos\BasicDemo\main.cpp
+template <class Key, class Value>
+class btHashMap
+{
+
+protected:
+	btAlignedObjectArray<int>		m_hashTable;
+	btAlignedObjectArray<int>		m_next;
+	
+	btAlignedObjectArray<Value>		m_valueArray;
+	btAlignedObjectArray<Key>		m_keyArray;
+
+	void	growTables(const Key& /*key*/)
+	{
+		int newCapacity = m_valueArray.capacity();
+
+		if (m_hashTable.size() < newCapacity)
+		{
+			//grow hashtable and next table
+			int curHashtableSize = m_hashTable.size();
+
+			m_hashTable.resize(newCapacity);
+			m_next.resize(newCapacity);
+
+			int i;
+
+			for (i= 0; i < newCapacity; ++i)
+			{
+				m_hashTable[i] = BT_HASH_NULL;
+			}
+			for (i = 0; i < newCapacity; ++i)
+			{
+				m_next[i] = BT_HASH_NULL;
+			}
+
+			for(i=0;i<curHashtableSize;i++)
+			{
+				//const Value& value = m_valueArray[i];
+				//const Key& key = m_keyArray[i];
+
+				int	hashValue = m_keyArray[i].getHash() & (m_valueArray.capacity()-1);	// New hash value with new mask
+				m_next[i] = m_hashTable[hashValue];
+				m_hashTable[hashValue] = i;
+			}
+
+
+		}
+	}
+
+	public:
+
+	void insert(const Key& key, const Value& value) {
+		int hash = key.getHash() & (m_valueArray.capacity()-1);
+
+		//replace value if the key is already there
+		int index = findIndex(key);
+		if (index != BT_HASH_NULL)
+		{
+			m_valueArray[index]=value;
+			return;
+		}
+
+		int count = m_valueArray.size();
+		int oldCapacity = m_valueArray.capacity();
+		m_valueArray.push_back(value);
+		m_keyArray.push_back(key);
+
+		int newCapacity = m_valueArray.capacity();
+		if (oldCapacity < newCapacity)
+		{
+			growTables(key);
+			//hash with new capacity
+			hash = key.getHash() & (m_valueArray.capacity()-1);
+		}
+		m_next[count] = m_hashTable[hash];
+		m_hashTable[hash] = count;
+	}
+
+	void remove(const Key& key) {
+
+		int hash = key.getHash() & (m_valueArray.capacity()-1);
+
+		int pairIndex = findIndex(key);
+		
+		if (pairIndex ==BT_HASH_NULL)
+		{
+			return;
+		}
+
+		// Remove the pair from the hash table.
+		int index = m_hashTable[hash];
+		btAssert(index != BT_HASH_NULL);
+
+		int previous = BT_HASH_NULL;
+		while (index != pairIndex)
+		{
+			previous = index;
+			index = m_next[index];
+		}
+
+		if (previous != BT_HASH_NULL)
+		{
+			btAssert(m_next[previous] == pairIndex);
+			m_next[previous] = m_next[pairIndex];
+		}
+		else
+		{
+			m_hashTable[hash] = m_next[pairIndex];
+		}
+
+		// We now move the last pair into spot of the
+		// pair being removed. We need to fix the hash
+		// table indices to support the move.
+
+		int lastPairIndex = m_valueArray.size() - 1;
+
+		// If the removed pair is the last pair, we are done.
+		if (lastPairIndex == pairIndex)
+		{
+			m_valueArray.pop_back();
+			m_keyArray.pop_back();
+			return;
+		}
+
+		// Remove the last pair from the hash table.
+		int lastHash = m_keyArray[lastPairIndex].getHash() & (m_valueArray.capacity()-1);
+
+		index = m_hashTable[lastHash];
+		btAssert(index != BT_HASH_NULL);
+
+		previous = BT_HASH_NULL;
+		while (index != lastPairIndex)
+		{
+			previous = index;
+			index = m_next[index];
+		}
+
+		if (previous != BT_HASH_NULL)
+		{
+			btAssert(m_next[previous] == lastPairIndex);
+			m_next[previous] = m_next[lastPairIndex];
+		}
+		else
+		{
+			m_hashTable[lastHash] = m_next[lastPairIndex];
+		}
+
+		// Copy the last pair into the remove pair's spot.
+		m_valueArray[pairIndex] = m_valueArray[lastPairIndex];
+		m_keyArray[pairIndex] = m_keyArray[lastPairIndex];
+
+		// Insert the last pair into the hash table
+		m_next[pairIndex] = m_hashTable[lastHash];
+		m_hashTable[lastHash] = pairIndex;
+
+		m_valueArray.pop_back();
+		m_keyArray.pop_back();
+
+	}
+
+
+	int size() const
+	{
+		return m_valueArray.size();
+	}
+
+	const Value* getAtIndex(int index) const
+	{
+		btAssert(index < m_valueArray.size());
+
+		return &m_valueArray[index];
+	}
+
+	Value* getAtIndex(int index)
+	{
+		btAssert(index < m_valueArray.size());
+
+		return &m_valueArray[index];
+	}
+
+	Value* operator[](const Key& key) {
+		return find(key);
+	}
+
+	const Value*	find(const Key& key) const
+	{
+		int index = findIndex(key);
+		if (index == BT_HASH_NULL)
+		{
+			return NULL;
+		}
+		return &m_valueArray[index];
+	}
+
+	Value*	find(const Key& key)
+	{
+		int index = findIndex(key);
+		if (index == BT_HASH_NULL)
+		{
+			return NULL;
+		}
+		return &m_valueArray[index];
+	}
+
+
+	int	findIndex(const Key& key) const
+	{
+		unsigned int hash = key.getHash() & (m_valueArray.capacity()-1);
+
+		if (hash >= (unsigned int)m_hashTable.size())
+		{
+			return BT_HASH_NULL;
+		}
+
+		int index = m_hashTable[hash];
+		while ((index != BT_HASH_NULL) && key.equals(m_keyArray[index]) == false)
+		{
+			index = m_next[index];
+		}
+		return index;
+	}
+
+	void	clear()
+	{
+		m_hashTable.clear();
+		m_next.clear();
+		m_valueArray.clear();
+		m_keyArray.clear();
+	}
+
+};
+
+#endif //BT_HASH_MAP_H
diff --git a/hkl3d/bullet/src/LinearMath/btIDebugDraw.h b/hkl3d/bullet/src/LinearMath/btIDebugDraw.h
new file mode 100644
index 0000000..882514e
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btIDebugDraw.h
@@ -0,0 +1,417 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_IDEBUG_DRAW__H
+#define BT_IDEBUG_DRAW__H
+
+#include "btVector3.h"
+#include "btTransform.h"
+
+
+///The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
+///Typical use case: create a debug drawer object, and assign it to a btCollisionWorld or btDynamicsWorld using setDebugDrawer and call debugDrawWorld.
+///A class that implements the btIDebugDraw interface has to implement the drawLine method at a minimum.
+///For color arguments the X,Y,Z components refer to Red, Green and Blue each in the range [0..1]
+class	btIDebugDraw
+{
+	public:
+
+	enum	DebugDrawModes
+	{
+		DBG_NoDebug=0,
+		DBG_DrawWireframe = 1,
+		DBG_DrawAabb=2,
+		DBG_DrawFeaturesText=4,
+		DBG_DrawContactPoints=8,
+		DBG_NoDeactivation=16,
+		DBG_NoHelpText = 32,
+		DBG_DrawText=64,
+		DBG_ProfileTimings = 128,
+		DBG_EnableSatComparison = 256,
+		DBG_DisableBulletLCP = 512,
+		DBG_EnableCCD = 1024,
+		DBG_DrawConstraints = (1 << 11),
+		DBG_DrawConstraintLimits = (1 << 12),
+		DBG_FastWireframe = (1<<13),
+		DBG_MAX_DEBUG_DRAW_MODE
+	};
+
+	virtual ~btIDebugDraw() {};
+
+	virtual void	drawLine(const btVector3& from,const btVector3& to,const btVector3& color)=0;
+		
+	virtual void    drawLine(const btVector3& from,const btVector3& to, const btVector3& fromColor, const btVector3& toColor)
+	{
+        (void) toColor;
+		drawLine (from, to, fromColor);
+	}
+
+	virtual void	drawSphere(btScalar radius, const btTransform& transform, const btVector3& color)
+	{
+		btVector3 start = transform.getOrigin();
+
+		const btVector3 xoffs = transform.getBasis() * btVector3(radius,0,0);
+		const btVector3 yoffs = transform.getBasis() * btVector3(0,radius,0);
+		const btVector3 zoffs = transform.getBasis() * btVector3(0,0,radius);
+
+		// XY 
+		drawLine(start-xoffs, start+yoffs, color);
+		drawLine(start+yoffs, start+xoffs, color);
+		drawLine(start+xoffs, start-yoffs, color);
+		drawLine(start-yoffs, start-xoffs, color);
+
+		// XZ
+		drawLine(start-xoffs, start+zoffs, color);
+		drawLine(start+zoffs, start+xoffs, color);
+		drawLine(start+xoffs, start-zoffs, color);
+		drawLine(start-zoffs, start-xoffs, color);
+
+		// YZ
+		drawLine(start-yoffs, start+zoffs, color);
+		drawLine(start+zoffs, start+yoffs, color);
+		drawLine(start+yoffs, start-zoffs, color);
+		drawLine(start-zoffs, start-yoffs, color);
+	}
+	
+	virtual void	drawSphere (const btVector3& p, btScalar radius, const btVector3& color)
+	{
+		btTransform tr;
+		tr.setIdentity();
+		tr.setOrigin(p);
+		drawSphere(radius,tr,color);
+	}
+	
+	virtual	void	drawTriangle(const btVector3& v0,const btVector3& v1,const btVector3& v2,const btVector3& /*n0*/,const btVector3& /*n1*/,const btVector3& /*n2*/,const btVector3& color, btScalar alpha)
+	{
+		drawTriangle(v0,v1,v2,color,alpha);
+	}
+	virtual	void	drawTriangle(const btVector3& v0,const btVector3& v1,const btVector3& v2,const btVector3& color, btScalar /*alpha*/)
+	{
+		drawLine(v0,v1,color);
+		drawLine(v1,v2,color);
+		drawLine(v2,v0,color);
+	}
+
+	virtual void	drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color)=0;
+
+	virtual void	reportErrorWarning(const char* warningString) = 0;
+
+	virtual void	draw3dText(const btVector3& location,const char* textString) = 0;
+	
+	virtual void	setDebugMode(int debugMode) =0;
+	
+	virtual int		getDebugMode() const = 0;
+
+	virtual void drawAabb(const btVector3& from,const btVector3& to,const btVector3& color)
+	{
+
+		btVector3 halfExtents = (to-from)* 0.5f;
+		btVector3 center = (to+from) *0.5f;
+		int i,j;
+
+		btVector3 edgecoord(1.f,1.f,1.f),pa,pb;
+		for (i=0;i<4;i++)
+		{
+			for (j=0;j<3;j++)
+			{
+				pa = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],		
+					edgecoord[2]*halfExtents[2]);
+				pa+=center;
+
+				int othercoord = j%3;
+				edgecoord[othercoord]*=-1.f;
+				pb = btVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],	
+					edgecoord[2]*halfExtents[2]);
+				pb+=center;
+
+				drawLine(pa,pb,color);
+			}
+			edgecoord = btVector3(-1.f,-1.f,-1.f);
+			if (i<3)
+				edgecoord[i]*=-1.f;
+		}
+	}
+	virtual void drawTransform(const btTransform& transform, btScalar orthoLen)
+	{
+		btVector3 start = transform.getOrigin();
+		drawLine(start, start+transform.getBasis() * btVector3(orthoLen, 0, 0), btVector3(0.7f,0,0));
+		drawLine(start, start+transform.getBasis() * btVector3(0, orthoLen, 0), btVector3(0,0.7f,0));
+		drawLine(start, start+transform.getBasis() * btVector3(0, 0, orthoLen), btVector3(0,0,0.7f));
+	}
+
+	virtual void drawArc(const btVector3& center, const btVector3& normal, const btVector3& axis, btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle, 
+				const btVector3& color, bool drawSect, btScalar stepDegrees = btScalar(10.f))
+	{
+		const btVector3& vx = axis;
+		btVector3 vy = normal.cross(axis);
+		btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
+		int nSteps = (int)((maxAngle - minAngle) / step);
+		if(!nSteps) nSteps = 1;
+		btVector3 prev = center + radiusA * vx * btCos(minAngle) + radiusB * vy * btSin(minAngle);
+		if(drawSect)
+		{
+			drawLine(center, prev, color);
+		}
+		for(int i = 1; i <= nSteps; i++)
+		{
+			btScalar angle = minAngle + (maxAngle - minAngle) * btScalar(i) / btScalar(nSteps);
+			btVector3 next = center + radiusA * vx * btCos(angle) + radiusB * vy * btSin(angle);
+			drawLine(prev, next, color);
+			prev = next;
+		}
+		if(drawSect)
+		{
+			drawLine(center, prev, color);
+		}
+	}
+	virtual void drawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius, 
+		btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color, btScalar stepDegrees = btScalar(10.f))
+	{
+		btVector3 vA[74];
+		btVector3 vB[74];
+		btVector3 *pvA = vA, *pvB = vB, *pT;
+		btVector3 npole = center + up * radius;
+		btVector3 spole = center - up * radius;
+		btVector3 arcStart;
+		btScalar step = stepDegrees * SIMD_RADS_PER_DEG;
+		const btVector3& kv = up;
+		const btVector3& iv = axis;
+		btVector3 jv = kv.cross(iv);
+		bool drawN = false;
+		bool drawS = false;
+		if(minTh <= -SIMD_HALF_PI)
+		{
+			minTh = -SIMD_HALF_PI + step;
+			drawN = true;
+		}
+		if(maxTh >= SIMD_HALF_PI)
+		{
+			maxTh = SIMD_HALF_PI - step;
+			drawS = true;
+		}
+		if(minTh > maxTh)
+		{
+			minTh = -SIMD_HALF_PI + step;
+			maxTh =  SIMD_HALF_PI - step;
+			drawN = drawS = true;
+		}
+		int n_hor = (int)((maxTh - minTh) / step) + 1;
+		if(n_hor < 2) n_hor = 2;
+		btScalar step_h = (maxTh - minTh) / btScalar(n_hor - 1);
+		bool isClosed = false;
+		if(minPs > maxPs)
+		{
+			minPs = -SIMD_PI + step;
+			maxPs =  SIMD_PI;
+			isClosed = true;
+		}
+		else if((maxPs - minPs) >= SIMD_PI * btScalar(2.f))
+		{
+			isClosed = true;
+		}
+		else
+		{
+			isClosed = false;
+		}
+		int n_vert = (int)((maxPs - minPs) / step) + 1;
+		if(n_vert < 2) n_vert = 2;
+		btScalar step_v = (maxPs - minPs) / btScalar(n_vert - 1);
+		for(int i = 0; i < n_hor; i++)
+		{
+			btScalar th = minTh + btScalar(i) * step_h;
+			btScalar sth = radius * btSin(th);
+			btScalar cth = radius * btCos(th);
+			for(int j = 0; j < n_vert; j++)
+			{
+				btScalar psi = minPs + btScalar(j) * step_v;
+				btScalar sps = btSin(psi);
+				btScalar cps = btCos(psi);
+				pvB[j] = center + cth * cps * iv + cth * sps * jv + sth * kv;
+				if(i)
+				{
+					drawLine(pvA[j], pvB[j], color);
+				}
+				else if(drawS)
+				{
+					drawLine(spole, pvB[j], color);
+				}
+				if(j)
+				{
+					drawLine(pvB[j-1], pvB[j], color);
+				}
+				else
+				{
+					arcStart = pvB[j];
+				}
+				if((i == (n_hor - 1)) && drawN)
+				{
+					drawLine(npole, pvB[j], color);
+				}
+				if(isClosed)
+				{
+					if(j == (n_vert-1))
+					{
+						drawLine(arcStart, pvB[j], color);
+					}
+				}
+				else
+				{
+					if(((!i) || (i == (n_hor-1))) && ((!j) || (j == (n_vert-1))))
+					{
+						drawLine(center, pvB[j], color);
+					}
+				}
+			}
+			pT = pvA; pvA = pvB; pvB = pT;
+		}
+	}
+	
+	virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btVector3& color)
+	{
+		drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMin[2]), color);
+		drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMin[2]), color);
+		drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMin[2]), color);
+		drawLine(btVector3(bbMin[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMin[1], bbMin[2]), color);
+		drawLine(btVector3(bbMin[0], bbMin[1], bbMin[2]), btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
+		drawLine(btVector3(bbMax[0], bbMin[1], bbMin[2]), btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
+		drawLine(btVector3(bbMax[0], bbMax[1], bbMin[2]), btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
+		drawLine(btVector3(bbMin[0], bbMax[1], bbMin[2]), btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
+		drawLine(btVector3(bbMin[0], bbMin[1], bbMax[2]), btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
+		drawLine(btVector3(bbMax[0], bbMin[1], bbMax[2]), btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
+		drawLine(btVector3(bbMax[0], bbMax[1], bbMax[2]), btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
+		drawLine(btVector3(bbMin[0], bbMax[1], bbMax[2]), btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
+	}
+	virtual void drawBox(const btVector3& bbMin, const btVector3& bbMax, const btTransform& trans, const btVector3& color)
+	{
+		drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), color);
+		drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), color);
+		drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), color);
+		drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), color);
+		drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMin[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
+		drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMin[2]), trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
+		drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMin[2]), trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
+		drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMin[2]), trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
+		drawLine(trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), color);
+		drawLine(trans * btVector3(bbMax[0], bbMin[1], bbMax[2]), trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), color);
+		drawLine(trans * btVector3(bbMax[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), color);
+		drawLine(trans * btVector3(bbMin[0], bbMax[1], bbMax[2]), trans * btVector3(bbMin[0], bbMin[1], bbMax[2]), color);
+	}
+
+	virtual void drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
+	{
+		btVector3 capStart(0.f,0.f,0.f);
+		capStart[upAxis] = -halfHeight;
+
+		btVector3 capEnd(0.f,0.f,0.f);
+		capEnd[upAxis] = halfHeight;
+
+		// Draw the ends
+		{
+
+			btTransform childTransform = transform;
+			childTransform.getOrigin() = transform * capStart;
+			drawSphere(radius, childTransform, color);
+		}
+
+		{
+			btTransform childTransform = transform;
+			childTransform.getOrigin() = transform * capEnd;
+			drawSphere(radius, childTransform, color);
+		}
+
+		// Draw some additional lines
+		btVector3 start = transform.getOrigin();
+
+		capStart[(upAxis+1)%3] = radius;
+		capEnd[(upAxis+1)%3] = radius;
+		drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
+		capStart[(upAxis+1)%3] = -radius;
+		capEnd[(upAxis+1)%3] = -radius;
+		drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
+
+		capStart[(upAxis+1)%3] = 0.f;
+		capEnd[(upAxis+1)%3] = 0.f;
+
+		capStart[(upAxis+2)%3] = radius;
+		capEnd[(upAxis+2)%3] = radius;
+		drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
+		capStart[(upAxis+2)%3] = -radius;
+		capEnd[(upAxis+2)%3] = -radius;
+		drawLine(start+transform.getBasis() * capStart,start+transform.getBasis() * capEnd, color);
+	}
+
+	virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
+	{
+		btVector3 start = transform.getOrigin();
+		btVector3	offsetHeight(0,0,0);
+		offsetHeight[upAxis] = halfHeight;
+		btVector3	offsetRadius(0,0,0);
+		offsetRadius[(upAxis+1)%3] = radius;
+		drawLine(start+transform.getBasis() * (offsetHeight+offsetRadius),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
+		drawLine(start+transform.getBasis() * (offsetHeight-offsetRadius),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
+
+		// Drawing top and bottom caps of the cylinder
+		btVector3 yaxis(0,0,0);
+		yaxis[upAxis] = btScalar(1.0);
+		btVector3 xaxis(0,0,0);
+		xaxis[(upAxis+1)%3] = btScalar(1.0);
+		drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
+		drawArc(start+transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,btScalar(10.0));
+	}
+
+	virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color)
+	{
+
+		btVector3 start = transform.getOrigin();
+
+		btVector3	offsetHeight(0,0,0);
+		offsetHeight[upAxis] = height * btScalar(0.5);
+		btVector3	offsetRadius(0,0,0);
+		offsetRadius[(upAxis+1)%3] = radius;
+		btVector3	offset2Radius(0,0,0);
+		offset2Radius[(upAxis+2)%3] = radius;
+
+		drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offsetRadius),color);
+		drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offsetRadius),color);
+		drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight+offset2Radius),color);
+		drawLine(start+transform.getBasis() * (offsetHeight),start+transform.getBasis() * (-offsetHeight-offset2Radius),color);
+
+		// Drawing the base of the cone
+		btVector3 yaxis(0,0,0);
+		yaxis[upAxis] = btScalar(1.0);
+		btVector3 xaxis(0,0,0);
+		xaxis[(upAxis+1)%3] = btScalar(1.0);
+		drawArc(start-transform.getBasis()*(offsetHeight),transform.getBasis()*yaxis,transform.getBasis()*xaxis,radius,radius,0,SIMD_2_PI,color,false,10.0);
+	}
+
+	virtual void drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color)
+	{
+		btVector3 planeOrigin = planeNormal * planeConst;
+		btVector3 vec0,vec1;
+		btPlaneSpace1(planeNormal,vec0,vec1);
+		btScalar vecLen = 100.f;
+		btVector3 pt0 = planeOrigin + vec0*vecLen;
+		btVector3 pt1 = planeOrigin - vec0*vecLen;
+		btVector3 pt2 = planeOrigin + vec1*vecLen;
+		btVector3 pt3 = planeOrigin - vec1*vecLen;
+		drawLine(transform*pt0,transform*pt1,color);
+		drawLine(transform*pt2,transform*pt3,color);
+	}
+};
+
+
+#endif //BT_IDEBUG_DRAW__H
+
diff --git a/hkl3d/bullet/src/LinearMath/btList.h b/hkl3d/bullet/src/LinearMath/btList.h
new file mode 100644
index 0000000..eec80a7
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btList.h
@@ -0,0 +1,73 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_GEN_LIST_H
+#define BT_GEN_LIST_H
+
+class btGEN_Link {
+public:
+    btGEN_Link() : m_next(0), m_prev(0) {}
+    btGEN_Link(btGEN_Link *next, btGEN_Link *prev) : m_next(next), m_prev(prev) {}
+    
+    btGEN_Link *getNext() const { return m_next; }  
+    btGEN_Link *getPrev() const { return m_prev; }  
+
+    bool isHead() const { return m_prev == 0; }
+    bool isTail() const { return m_next == 0; }
+
+    void insertBefore(btGEN_Link *link) {
+        m_next         = link;
+        m_prev         = link->m_prev;
+        m_next->m_prev = this;
+        m_prev->m_next = this;
+    } 
+
+    void insertAfter(btGEN_Link *link) {
+        m_next         = link->m_next;
+        m_prev         = link;
+        m_next->m_prev = this;
+        m_prev->m_next = this;
+    } 
+
+    void remove() { 
+        m_next->m_prev = m_prev; 
+        m_prev->m_next = m_next;
+    }
+
+private:  
+    btGEN_Link  *m_next;
+    btGEN_Link  *m_prev;
+};
+
+class btGEN_List {
+public:
+    btGEN_List() : m_head(&m_tail, 0), m_tail(0, &m_head) {}
+
+    btGEN_Link *getHead() const { return m_head.getNext(); } 
+    btGEN_Link *getTail() const { return m_tail.getPrev(); } 
+
+    void addHead(btGEN_Link *link) { link->insertAfter(&m_head); }
+    void addTail(btGEN_Link *link) { link->insertBefore(&m_tail); }
+    
+private:
+    btGEN_Link m_head;
+    btGEN_Link m_tail;
+};
+
+#endif //BT_GEN_LIST_H
+
+
+
diff --git a/hkl3d/bullet/src/LinearMath/btMatrix3x3.h b/hkl3d/bullet/src/LinearMath/btMatrix3x3.h
new file mode 100644
index 0000000..d0234a0
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btMatrix3x3.h
@@ -0,0 +1,771 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef	BT_MATRIX3x3_H
+#define BT_MATRIX3x3_H
+
+#include "btVector3.h"
+#include "btQuaternion.h"
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btMatrix3x3Data	btMatrix3x3DoubleData 
+#else
+#define btMatrix3x3Data	btMatrix3x3FloatData
+#endif //BT_USE_DOUBLE_PRECISION
+
+
+/**@brief The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with btQuaternion, btTransform and btVector3.
+* Make sure to only include a pure orthogonal matrix without scaling. */
+class btMatrix3x3 {
+
+	///Data storage for the matrix, each vector is a row of the matrix
+	btVector3 m_el[3];
+
+public:
+	/** @brief No initializaion constructor */
+	btMatrix3x3 () {}
+
+	//		explicit btMatrix3x3(const btScalar *m) { setFromOpenGLSubMatrix(m); }
+
+	/**@brief Constructor from Quaternion */
+	explicit btMatrix3x3(const btQuaternion& q) { setRotation(q); }
+	/*
+	template <typename btScalar>
+	Matrix3x3(const btScalar& yaw, const btScalar& pitch, const btScalar& roll)
+	{ 
+	setEulerYPR(yaw, pitch, roll);
+	}
+	*/
+	/** @brief Constructor with row major formatting */
+	btMatrix3x3(const btScalar& xx, const btScalar& xy, const btScalar& xz,
+		const btScalar& yx, const btScalar& yy, const btScalar& yz,
+		const btScalar& zx, const btScalar& zy, const btScalar& zz)
+	{ 
+		setValue(xx, xy, xz, 
+			yx, yy, yz, 
+			zx, zy, zz);
+	}
+	/** @brief Copy constructor */
+	SIMD_FORCE_INLINE btMatrix3x3 (const btMatrix3x3& other)
+	{
+		m_el[0] = other.m_el[0];
+		m_el[1] = other.m_el[1];
+		m_el[2] = other.m_el[2];
+	}
+	/** @brief Assignment Operator */
+	SIMD_FORCE_INLINE btMatrix3x3& operator=(const btMatrix3x3& other)
+	{
+		m_el[0] = other.m_el[0];
+		m_el[1] = other.m_el[1];
+		m_el[2] = other.m_el[2];
+		return *this;
+	}
+
+	/** @brief Get a column of the matrix as a vector 
+	*  @param i Column number 0 indexed */
+	SIMD_FORCE_INLINE btVector3 getColumn(int i) const
+	{
+		return btVector3(m_el[0][i],m_el[1][i],m_el[2][i]);
+	}
+
+
+	/** @brief Get a row of the matrix as a vector 
+	*  @param i Row number 0 indexed */
+	SIMD_FORCE_INLINE const btVector3& getRow(int i) const
+	{
+		btFullAssert(0 <= i && i < 3);
+		return m_el[i];
+	}
+
+	/** @brief Get a mutable reference to a row of the matrix as a vector 
+	*  @param i Row number 0 indexed */
+	SIMD_FORCE_INLINE btVector3&  operator[](int i)
+	{ 
+		btFullAssert(0 <= i && i < 3);
+		return m_el[i]; 
+	}
+
+	/** @brief Get a const reference to a row of the matrix as a vector 
+	*  @param i Row number 0 indexed */
+	SIMD_FORCE_INLINE const btVector3& operator[](int i) const
+	{
+		btFullAssert(0 <= i && i < 3);
+		return m_el[i]; 
+	}
+
+	/** @brief Multiply by the target matrix on the right
+	*  @param m Rotation matrix to be applied 
+	* Equivilant to this = this * m */
+	btMatrix3x3& operator*=(const btMatrix3x3& m); 
+
+	/** @brief Adds by the target matrix on the right
+	*  @param m matrix to be applied 
+	* Equivilant to this = this + m */
+	btMatrix3x3& operator+=(const btMatrix3x3& m); 
+
+	/** @brief Substractss by the target matrix on the right
+	*  @param m matrix to be applied 
+	* Equivilant to this = this - m */
+	btMatrix3x3& operator-=(const btMatrix3x3& m); 
+
+	/** @brief Set from the rotational part of a 4x4 OpenGL matrix
+	*  @param m A pointer to the beginning of the array of scalars*/
+	void setFromOpenGLSubMatrix(const btScalar *m)
+	{
+		m_el[0].setValue(m[0],m[4],m[8]);
+		m_el[1].setValue(m[1],m[5],m[9]);
+		m_el[2].setValue(m[2],m[6],m[10]);
+
+	}
+	/** @brief Set the values of the matrix explicitly (row major)
+	*  @param xx Top left
+	*  @param xy Top Middle
+	*  @param xz Top Right
+	*  @param yx Middle Left
+	*  @param yy Middle Middle
+	*  @param yz Middle Right
+	*  @param zx Bottom Left
+	*  @param zy Bottom Middle
+	*  @param zz Bottom Right*/
+	void setValue(const btScalar& xx, const btScalar& xy, const btScalar& xz, 
+		const btScalar& yx, const btScalar& yy, const btScalar& yz, 
+		const btScalar& zx, const btScalar& zy, const btScalar& zz)
+	{
+		m_el[0].setValue(xx,xy,xz);
+		m_el[1].setValue(yx,yy,yz);
+		m_el[2].setValue(zx,zy,zz);
+	}
+
+	/** @brief Set the matrix from a quaternion
+	*  @param q The Quaternion to match */  
+	void setRotation(const btQuaternion& q) 
+	{
+		btScalar d = q.length2();
+		btFullAssert(d != btScalar(0.0));
+		btScalar s = btScalar(2.0) / d;
+		btScalar xs = q.x() * s,   ys = q.y() * s,   zs = q.z() * s;
+		btScalar wx = q.w() * xs,  wy = q.w() * ys,  wz = q.w() * zs;
+		btScalar xx = q.x() * xs,  xy = q.x() * ys,  xz = q.x() * zs;
+		btScalar yy = q.y() * ys,  yz = q.y() * zs,  zz = q.z() * zs;
+		setValue(btScalar(1.0) - (yy + zz), xy - wz, xz + wy,
+			xy + wz, btScalar(1.0) - (xx + zz), yz - wx,
+			xz - wy, yz + wx, btScalar(1.0) - (xx + yy));
+	}
+
+
+	/** @brief Set the matrix from euler angles using YPR around YXZ respectively
+	*  @param yaw Yaw about Y axis
+	*  @param pitch Pitch about X axis
+	*  @param roll Roll about Z axis 
+	*/
+	void setEulerYPR(const btScalar& yaw, const btScalar& pitch, const btScalar& roll) 
+	{
+		setEulerZYX(roll, pitch, yaw);
+	}
+
+	/** @brief Set the matrix from euler angles YPR around ZYX axes
+	* @param eulerX Roll about X axis
+	* @param eulerY Pitch around Y axis
+	* @param eulerZ Yaw aboud Z axis
+	* 
+	* These angles are used to produce a rotation matrix. The euler
+	* angles are applied in ZYX order. I.e a vector is first rotated 
+	* about X then Y and then Z
+	**/
+	void setEulerZYX(btScalar eulerX,btScalar eulerY,btScalar eulerZ) { 
+		///@todo proposed to reverse this since it's labeled zyx but takes arguments xyz and it will match all other parts of the code
+		btScalar ci ( btCos(eulerX)); 
+		btScalar cj ( btCos(eulerY)); 
+		btScalar ch ( btCos(eulerZ)); 
+		btScalar si ( btSin(eulerX)); 
+		btScalar sj ( btSin(eulerY)); 
+		btScalar sh ( btSin(eulerZ)); 
+		btScalar cc = ci * ch; 
+		btScalar cs = ci * sh; 
+		btScalar sc = si * ch; 
+		btScalar ss = si * sh;
+
+		setValue(cj * ch, sj * sc - cs, sj * cc + ss,
+			cj * sh, sj * ss + cc, sj * cs - sc, 
+			-sj,      cj * si,      cj * ci);
+	}
+
+	/**@brief Set the matrix to the identity */
+	void setIdentity()
+	{ 
+		setValue(btScalar(1.0), btScalar(0.0), btScalar(0.0), 
+			btScalar(0.0), btScalar(1.0), btScalar(0.0), 
+			btScalar(0.0), btScalar(0.0), btScalar(1.0)); 
+	}
+
+	static const btMatrix3x3&	getIdentity()
+	{
+		static const btMatrix3x3 identityMatrix(btScalar(1.0), btScalar(0.0), btScalar(0.0), 
+			btScalar(0.0), btScalar(1.0), btScalar(0.0), 
+			btScalar(0.0), btScalar(0.0), btScalar(1.0));
+		return identityMatrix;
+	}
+
+	/**@brief Fill the rotational part of an OpenGL matrix and clear the shear/perspective
+	* @param m The array to be filled */
+	void getOpenGLSubMatrix(btScalar *m) const 
+	{
+		m[0]  = btScalar(m_el[0].x()); 
+		m[1]  = btScalar(m_el[1].x());
+		m[2]  = btScalar(m_el[2].x());
+		m[3]  = btScalar(0.0); 
+		m[4]  = btScalar(m_el[0].y());
+		m[5]  = btScalar(m_el[1].y());
+		m[6]  = btScalar(m_el[2].y());
+		m[7]  = btScalar(0.0); 
+		m[8]  = btScalar(m_el[0].z()); 
+		m[9]  = btScalar(m_el[1].z());
+		m[10] = btScalar(m_el[2].z());
+		m[11] = btScalar(0.0); 
+	}
+
+	/**@brief Get the matrix represented as a quaternion 
+	* @param q The quaternion which will be set */
+	void getRotation(btQuaternion& q) const
+	{
+		btScalar trace = m_el[0].x() + m_el[1].y() + m_el[2].z();
+		btScalar temp[4];
+
+		if (trace > btScalar(0.0)) 
+		{
+			btScalar s = btSqrt(trace + btScalar(1.0));
+			temp[3]=(s * btScalar(0.5));
+			s = btScalar(0.5) / s;
+
+			temp[0]=((m_el[2].y() - m_el[1].z()) * s);
+			temp[1]=((m_el[0].z() - m_el[2].x()) * s);
+			temp[2]=((m_el[1].x() - m_el[0].y()) * s);
+		} 
+		else 
+		{
+			int i = m_el[0].x() < m_el[1].y() ? 
+				(m_el[1].y() < m_el[2].z() ? 2 : 1) :
+				(m_el[0].x() < m_el[2].z() ? 2 : 0); 
+			int j = (i + 1) % 3;  
+			int k = (i + 2) % 3;
+
+			btScalar s = btSqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + btScalar(1.0));
+			temp[i] = s * btScalar(0.5);
+			s = btScalar(0.5) / s;
+
+			temp[3] = (m_el[k][j] - m_el[j][k]) * s;
+			temp[j] = (m_el[j][i] + m_el[i][j]) * s;
+			temp[k] = (m_el[k][i] + m_el[i][k]) * s;
+		}
+		q.setValue(temp[0],temp[1],temp[2],temp[3]);
+	}
+
+	/**@brief Get the matrix represented as euler angles around YXZ, roundtrip with setEulerYPR
+	* @param yaw Yaw around Y axis
+	* @param pitch Pitch around X axis
+	* @param roll around Z axis */	
+	void getEulerYPR(btScalar& yaw, btScalar& pitch, btScalar& roll) const
+	{
+
+		// first use the normal calculus
+		yaw = btScalar(btAtan2(m_el[1].x(), m_el[0].x()));
+		pitch = btScalar(btAsin(-m_el[2].x()));
+		roll = btScalar(btAtan2(m_el[2].y(), m_el[2].z()));
+
+		// on pitch = +/-HalfPI
+		if (btFabs(pitch)==SIMD_HALF_PI)
+		{
+			if (yaw>0)
+				yaw-=SIMD_PI;
+			else
+				yaw+=SIMD_PI;
+
+			if (roll>0)
+				roll-=SIMD_PI;
+			else
+				roll+=SIMD_PI;
+		}
+	};
+
+
+	/**@brief Get the matrix represented as euler angles around ZYX
+	* @param yaw Yaw around X axis
+	* @param pitch Pitch around Y axis
+	* @param roll around X axis 
+	* @param solution_number Which solution of two possible solutions ( 1 or 2) are possible values*/	
+	void getEulerZYX(btScalar& yaw, btScalar& pitch, btScalar& roll, unsigned int solution_number = 1) const
+	{
+		struct Euler
+		{
+			btScalar yaw;
+			btScalar pitch;
+			btScalar roll;
+		};
+
+		Euler euler_out;
+		Euler euler_out2; //second solution
+		//get the pointer to the raw data
+
+		// Check that pitch is not at a singularity
+		if (btFabs(m_el[2].x()) >= 1)
+		{
+			euler_out.yaw = 0;
+			euler_out2.yaw = 0;
+
+			// From difference of angles formula
+			btScalar delta = btAtan2(m_el[0].x(),m_el[0].z());
+			if (m_el[2].x() > 0)  //gimbal locked up
+			{
+				euler_out.pitch = SIMD_PI / btScalar(2.0);
+				euler_out2.pitch = SIMD_PI / btScalar(2.0);
+				euler_out.roll = euler_out.pitch + delta;
+				euler_out2.roll = euler_out.pitch + delta;
+			}
+			else // gimbal locked down
+			{
+				euler_out.pitch = -SIMD_PI / btScalar(2.0);
+				euler_out2.pitch = -SIMD_PI / btScalar(2.0);
+				euler_out.roll = -euler_out.pitch + delta;
+				euler_out2.roll = -euler_out.pitch + delta;
+			}
+		}
+		else
+		{
+			euler_out.pitch = - btAsin(m_el[2].x());
+			euler_out2.pitch = SIMD_PI - euler_out.pitch;
+
+			euler_out.roll = btAtan2(m_el[2].y()/btCos(euler_out.pitch), 
+				m_el[2].z()/btCos(euler_out.pitch));
+			euler_out2.roll = btAtan2(m_el[2].y()/btCos(euler_out2.pitch), 
+				m_el[2].z()/btCos(euler_out2.pitch));
+
+			euler_out.yaw = btAtan2(m_el[1].x()/btCos(euler_out.pitch), 
+				m_el[0].x()/btCos(euler_out.pitch));
+			euler_out2.yaw = btAtan2(m_el[1].x()/btCos(euler_out2.pitch), 
+				m_el[0].x()/btCos(euler_out2.pitch));
+		}
+
+		if (solution_number == 1)
+		{ 
+			yaw = euler_out.yaw; 
+			pitch = euler_out.pitch;
+			roll = euler_out.roll;
+		}
+		else
+		{ 
+			yaw = euler_out2.yaw; 
+			pitch = euler_out2.pitch;
+			roll = euler_out2.roll;
+		}
+	}
+
+	/**@brief Create a scaled copy of the matrix 
+	* @param s Scaling vector The elements of the vector will scale each column */
+
+	btMatrix3x3 scaled(const btVector3& s) const
+	{
+		return btMatrix3x3(m_el[0].x() * s.x(), m_el[0].y() * s.y(), m_el[0].z() * s.z(),
+			m_el[1].x() * s.x(), m_el[1].y() * s.y(), m_el[1].z() * s.z(),
+			m_el[2].x() * s.x(), m_el[2].y() * s.y(), m_el[2].z() * s.z());
+	}
+
+	/**@brief Return the determinant of the matrix */
+	btScalar            determinant() const;
+	/**@brief Return the adjoint of the matrix */
+	btMatrix3x3 adjoint() const;
+	/**@brief Return the matrix with all values non negative */
+	btMatrix3x3 absolute() const;
+	/**@brief Return the transpose of the matrix */
+	btMatrix3x3 transpose() const;
+	/**@brief Return the inverse of the matrix */
+	btMatrix3x3 inverse() const; 
+
+	btMatrix3x3 transposeTimes(const btMatrix3x3& m) const;
+	btMatrix3x3 timesTranspose(const btMatrix3x3& m) const;
+
+	SIMD_FORCE_INLINE btScalar tdotx(const btVector3& v) const 
+	{
+		return m_el[0].x() * v.x() + m_el[1].x() * v.y() + m_el[2].x() * v.z();
+	}
+	SIMD_FORCE_INLINE btScalar tdoty(const btVector3& v) const 
+	{
+		return m_el[0].y() * v.x() + m_el[1].y() * v.y() + m_el[2].y() * v.z();
+	}
+	SIMD_FORCE_INLINE btScalar tdotz(const btVector3& v) const 
+	{
+		return m_el[0].z() * v.x() + m_el[1].z() * v.y() + m_el[2].z() * v.z();
+	}
+
+
+	/**@brief diagonalizes this matrix by the Jacobi method.
+	* @param rot stores the rotation from the coordinate system in which the matrix is diagonal to the original
+	* coordinate system, i.e., old_this = rot * new_this * rot^T. 
+	* @param threshold See iteration
+	* @param iteration The iteration stops when all off-diagonal elements are less than the threshold multiplied 
+	* by the sum of the absolute values of the diagonal, or when maxSteps have been executed. 
+	* 
+	* Note that this matrix is assumed to be symmetric. 
+	*/
+	void diagonalize(btMatrix3x3& rot, btScalar threshold, int maxSteps)
+	{
+		rot.setIdentity();
+		for (int step = maxSteps; step > 0; step--)
+		{
+			// find off-diagonal element [p][q] with largest magnitude
+			int p = 0;
+			int q = 1;
+			int r = 2;
+			btScalar max = btFabs(m_el[0][1]);
+			btScalar v = btFabs(m_el[0][2]);
+			if (v > max)
+			{
+				q = 2;
+				r = 1;
+				max = v;
+			}
+			v = btFabs(m_el[1][2]);
+			if (v > max)
+			{
+				p = 1;
+				q = 2;
+				r = 0;
+				max = v;
+			}
+
+			btScalar t = threshold * (btFabs(m_el[0][0]) + btFabs(m_el[1][1]) + btFabs(m_el[2][2]));
+			if (max <= t)
+			{
+				if (max <= SIMD_EPSILON * t)
+				{
+					return;
+				}
+				step = 1;
+			}
+
+			// compute Jacobi rotation J which leads to a zero for element [p][q] 
+			btScalar mpq = m_el[p][q];
+			btScalar theta = (m_el[q][q] - m_el[p][p]) / (2 * mpq);
+			btScalar theta2 = theta * theta;
+			btScalar cos;
+			btScalar sin;
+			if (theta2 * theta2 < btScalar(10 / SIMD_EPSILON))
+			{
+				t = (theta >= 0) ? 1 / (theta + btSqrt(1 + theta2))
+					: 1 / (theta - btSqrt(1 + theta2));
+				cos = 1 / btSqrt(1 + t * t);
+				sin = cos * t;
+			}
+			else
+			{
+				// approximation for large theta-value, i.e., a nearly diagonal matrix
+				t = 1 / (theta * (2 + btScalar(0.5) / theta2));
+				cos = 1 - btScalar(0.5) * t * t;
+				sin = cos * t;
+			}
+
+			// apply rotation to matrix (this = J^T * this * J)
+			m_el[p][q] = m_el[q][p] = 0;
+			m_el[p][p] -= t * mpq;
+			m_el[q][q] += t * mpq;
+			btScalar mrp = m_el[r][p];
+			btScalar mrq = m_el[r][q];
+			m_el[r][p] = m_el[p][r] = cos * mrp - sin * mrq;
+			m_el[r][q] = m_el[q][r] = cos * mrq + sin * mrp;
+
+			// apply rotation to rot (rot = rot * J)
+			for (int i = 0; i < 3; i++)
+			{
+				btVector3& row = rot[i];
+				mrp = row[p];
+				mrq = row[q];
+				row[p] = cos * mrp - sin * mrq;
+				row[q] = cos * mrq + sin * mrp;
+			}
+		}
+	}
+
+
+
+
+	/**@brief Calculate the matrix cofactor 
+	* @param r1 The first row to use for calculating the cofactor
+	* @param c1 The first column to use for calculating the cofactor
+	* @param r1 The second row to use for calculating the cofactor
+	* @param c1 The second column to use for calculating the cofactor
+	* See http://en.wikipedia.org/wiki/Cofactor_(linear_algebra) for more details
+	*/
+	btScalar cofac(int r1, int c1, int r2, int c2) const 
+	{
+		return m_el[r1][c1] * m_el[r2][c2] - m_el[r1][c2] * m_el[r2][c1];
+	}
+
+	void	serialize(struct	btMatrix3x3Data& dataOut) const;
+
+	void	serializeFloat(struct	btMatrix3x3FloatData& dataOut) const;
+
+	void	deSerialize(const struct	btMatrix3x3Data& dataIn);
+
+	void	deSerializeFloat(const struct	btMatrix3x3FloatData& dataIn);
+
+	void	deSerializeDouble(const struct	btMatrix3x3DoubleData& dataIn);
+
+};
+
+
+SIMD_FORCE_INLINE btMatrix3x3& 
+btMatrix3x3::operator*=(const btMatrix3x3& m)
+{
+	setValue(m.tdotx(m_el[0]), m.tdoty(m_el[0]), m.tdotz(m_el[0]),
+		m.tdotx(m_el[1]), m.tdoty(m_el[1]), m.tdotz(m_el[1]),
+		m.tdotx(m_el[2]), m.tdoty(m_el[2]), m.tdotz(m_el[2]));
+	return *this;
+}
+
+SIMD_FORCE_INLINE btMatrix3x3& 
+btMatrix3x3::operator+=(const btMatrix3x3& m)
+{
+	setValue(
+		m_el[0][0]+m.m_el[0][0], 
+		m_el[0][1]+m.m_el[0][1],
+		m_el[0][2]+m.m_el[0][2],
+		m_el[1][0]+m.m_el[1][0], 
+		m_el[1][1]+m.m_el[1][1],
+		m_el[1][2]+m.m_el[1][2],
+		m_el[2][0]+m.m_el[2][0], 
+		m_el[2][1]+m.m_el[2][1],
+		m_el[2][2]+m.m_el[2][2]);
+	return *this;
+}
+
+SIMD_FORCE_INLINE btMatrix3x3
+operator*(const btMatrix3x3& m, const btScalar & k)
+{
+	return btMatrix3x3(
+		m[0].x()*k,m[0].y()*k,m[0].z()*k,
+		m[1].x()*k,m[1].y()*k,m[1].z()*k,
+		m[2].x()*k,m[2].y()*k,m[2].z()*k);
+}
+
+ SIMD_FORCE_INLINE btMatrix3x3 
+operator+(const btMatrix3x3& m1, const btMatrix3x3& m2)
+{
+	return btMatrix3x3(
+	m1[0][0]+m2[0][0], 
+	m1[0][1]+m2[0][1],
+	m1[0][2]+m2[0][2],
+	m1[1][0]+m2[1][0], 
+	m1[1][1]+m2[1][1],
+	m1[1][2]+m2[1][2],
+	m1[2][0]+m2[2][0], 
+	m1[2][1]+m2[2][1],
+	m1[2][2]+m2[2][2]);
+}
+
+SIMD_FORCE_INLINE btMatrix3x3 
+operator-(const btMatrix3x3& m1, const btMatrix3x3& m2)
+{
+	return btMatrix3x3(
+	m1[0][0]-m2[0][0], 
+	m1[0][1]-m2[0][1],
+	m1[0][2]-m2[0][2],
+	m1[1][0]-m2[1][0], 
+	m1[1][1]-m2[1][1],
+	m1[1][2]-m2[1][2],
+	m1[2][0]-m2[2][0], 
+	m1[2][1]-m2[2][1],
+	m1[2][2]-m2[2][2]);
+}
+
+
+SIMD_FORCE_INLINE btMatrix3x3& 
+btMatrix3x3::operator-=(const btMatrix3x3& m)
+{
+	setValue(
+	m_el[0][0]-m.m_el[0][0], 
+	m_el[0][1]-m.m_el[0][1],
+	m_el[0][2]-m.m_el[0][2],
+	m_el[1][0]-m.m_el[1][0], 
+	m_el[1][1]-m.m_el[1][1],
+	m_el[1][2]-m.m_el[1][2],
+	m_el[2][0]-m.m_el[2][0], 
+	m_el[2][1]-m.m_el[2][1],
+	m_el[2][2]-m.m_el[2][2]);
+	return *this;
+}
+
+
+SIMD_FORCE_INLINE btScalar 
+btMatrix3x3::determinant() const
+{ 
+	return btTriple((*this)[0], (*this)[1], (*this)[2]);
+}
+
+
+SIMD_FORCE_INLINE btMatrix3x3 
+btMatrix3x3::absolute() const
+{
+	return btMatrix3x3(
+		btFabs(m_el[0].x()), btFabs(m_el[0].y()), btFabs(m_el[0].z()),
+		btFabs(m_el[1].x()), btFabs(m_el[1].y()), btFabs(m_el[1].z()),
+		btFabs(m_el[2].x()), btFabs(m_el[2].y()), btFabs(m_el[2].z()));
+}
+
+SIMD_FORCE_INLINE btMatrix3x3 
+btMatrix3x3::transpose() const 
+{
+	return btMatrix3x3(m_el[0].x(), m_el[1].x(), m_el[2].x(),
+		m_el[0].y(), m_el[1].y(), m_el[2].y(),
+		m_el[0].z(), m_el[1].z(), m_el[2].z());
+}
+
+SIMD_FORCE_INLINE btMatrix3x3 
+btMatrix3x3::adjoint() const 
+{
+	return btMatrix3x3(cofac(1, 1, 2, 2), cofac(0, 2, 2, 1), cofac(0, 1, 1, 2),
+		cofac(1, 2, 2, 0), cofac(0, 0, 2, 2), cofac(0, 2, 1, 0),
+		cofac(1, 0, 2, 1), cofac(0, 1, 2, 0), cofac(0, 0, 1, 1));
+}
+
+SIMD_FORCE_INLINE btMatrix3x3 
+btMatrix3x3::inverse() const
+{
+	btVector3 co(cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1));
+	btScalar det = (*this)[0].dot(co);
+	btFullAssert(det != btScalar(0.0));
+	btScalar s = btScalar(1.0) / det;
+	return btMatrix3x3(co.x() * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s,
+		co.y() * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s,
+		co.z() * s, cofac(0, 1, 2, 0) * s, cofac(0, 0, 1, 1) * s);
+}
+
+SIMD_FORCE_INLINE btMatrix3x3 
+btMatrix3x3::transposeTimes(const btMatrix3x3& m) const
+{
+	return btMatrix3x3(
+		m_el[0].x() * m[0].x() + m_el[1].x() * m[1].x() + m_el[2].x() * m[2].x(),
+		m_el[0].x() * m[0].y() + m_el[1].x() * m[1].y() + m_el[2].x() * m[2].y(),
+		m_el[0].x() * m[0].z() + m_el[1].x() * m[1].z() + m_el[2].x() * m[2].z(),
+		m_el[0].y() * m[0].x() + m_el[1].y() * m[1].x() + m_el[2].y() * m[2].x(),
+		m_el[0].y() * m[0].y() + m_el[1].y() * m[1].y() + m_el[2].y() * m[2].y(),
+		m_el[0].y() * m[0].z() + m_el[1].y() * m[1].z() + m_el[2].y() * m[2].z(),
+		m_el[0].z() * m[0].x() + m_el[1].z() * m[1].x() + m_el[2].z() * m[2].x(),
+		m_el[0].z() * m[0].y() + m_el[1].z() * m[1].y() + m_el[2].z() * m[2].y(),
+		m_el[0].z() * m[0].z() + m_el[1].z() * m[1].z() + m_el[2].z() * m[2].z());
+}
+
+SIMD_FORCE_INLINE btMatrix3x3 
+btMatrix3x3::timesTranspose(const btMatrix3x3& m) const
+{
+	return btMatrix3x3(
+		m_el[0].dot(m[0]), m_el[0].dot(m[1]), m_el[0].dot(m[2]),
+		m_el[1].dot(m[0]), m_el[1].dot(m[1]), m_el[1].dot(m[2]),
+		m_el[2].dot(m[0]), m_el[2].dot(m[1]), m_el[2].dot(m[2]));
+
+}
+
+SIMD_FORCE_INLINE btVector3 
+operator*(const btMatrix3x3& m, const btVector3& v) 
+{
+	return btVector3(m[0].dot(v), m[1].dot(v), m[2].dot(v));
+}
+
+
+SIMD_FORCE_INLINE btVector3
+operator*(const btVector3& v, const btMatrix3x3& m)
+{
+	return btVector3(m.tdotx(v), m.tdoty(v), m.tdotz(v));
+}
+
+SIMD_FORCE_INLINE btMatrix3x3 
+operator*(const btMatrix3x3& m1, const btMatrix3x3& m2)
+{
+	return btMatrix3x3(
+		m2.tdotx( m1[0]), m2.tdoty( m1[0]), m2.tdotz( m1[0]),
+		m2.tdotx( m1[1]), m2.tdoty( m1[1]), m2.tdotz( m1[1]),
+		m2.tdotx( m1[2]), m2.tdoty( m1[2]), m2.tdotz( m1[2]));
+}
+
+/*
+SIMD_FORCE_INLINE btMatrix3x3 btMultTransposeLeft(const btMatrix3x3& m1, const btMatrix3x3& m2) {
+return btMatrix3x3(
+m1[0][0] * m2[0][0] + m1[1][0] * m2[1][0] + m1[2][0] * m2[2][0],
+m1[0][0] * m2[0][1] + m1[1][0] * m2[1][1] + m1[2][0] * m2[2][1],
+m1[0][0] * m2[0][2] + m1[1][0] * m2[1][2] + m1[2][0] * m2[2][2],
+m1[0][1] * m2[0][0] + m1[1][1] * m2[1][0] + m1[2][1] * m2[2][0],
+m1[0][1] * m2[0][1] + m1[1][1] * m2[1][1] + m1[2][1] * m2[2][1],
+m1[0][1] * m2[0][2] + m1[1][1] * m2[1][2] + m1[2][1] * m2[2][2],
+m1[0][2] * m2[0][0] + m1[1][2] * m2[1][0] + m1[2][2] * m2[2][0],
+m1[0][2] * m2[0][1] + m1[1][2] * m2[1][1] + m1[2][2] * m2[2][1],
+m1[0][2] * m2[0][2] + m1[1][2] * m2[1][2] + m1[2][2] * m2[2][2]);
+}
+*/
+
+/**@brief Equality operator between two matrices
+* It will test all elements are equal.  */
+SIMD_FORCE_INLINE bool operator==(const btMatrix3x3& m1, const btMatrix3x3& m2)
+{
+	return ( m1[0][0] == m2[0][0] && m1[1][0] == m2[1][0] && m1[2][0] == m2[2][0] &&
+		m1[0][1] == m2[0][1] && m1[1][1] == m2[1][1] && m1[2][1] == m2[2][1] &&
+		m1[0][2] == m2[0][2] && m1[1][2] == m2[1][2] && m1[2][2] == m2[2][2] );
+}
+
+///for serialization
+struct	btMatrix3x3FloatData
+{
+	btVector3FloatData m_el[3];
+};
+
+///for serialization
+struct	btMatrix3x3DoubleData
+{
+	btVector3DoubleData m_el[3];
+};
+
+
+	
+
+SIMD_FORCE_INLINE	void	btMatrix3x3::serialize(struct	btMatrix3x3Data& dataOut) const
+{
+	for (int i=0;i<3;i++)
+		m_el[i].serialize(dataOut.m_el[i]);
+}
+
+SIMD_FORCE_INLINE	void	btMatrix3x3::serializeFloat(struct	btMatrix3x3FloatData& dataOut) const
+{
+	for (int i=0;i<3;i++)
+		m_el[i].serializeFloat(dataOut.m_el[i]);
+}
+
+
+SIMD_FORCE_INLINE	void	btMatrix3x3::deSerialize(const struct	btMatrix3x3Data& dataIn)
+{
+	for (int i=0;i<3;i++)
+		m_el[i].deSerialize(dataIn.m_el[i]);
+}
+
+SIMD_FORCE_INLINE	void	btMatrix3x3::deSerializeFloat(const struct	btMatrix3x3FloatData& dataIn)
+{
+	for (int i=0;i<3;i++)
+		m_el[i].deSerializeFloat(dataIn.m_el[i]);
+}
+
+SIMD_FORCE_INLINE	void	btMatrix3x3::deSerializeDouble(const struct	btMatrix3x3DoubleData& dataIn)
+{
+	for (int i=0;i<3;i++)
+		m_el[i].deSerializeDouble(dataIn.m_el[i]);
+}
+
+#endif //BT_MATRIX3x3_H
+
diff --git a/hkl3d/bullet/src/LinearMath/btMinMax.h b/hkl3d/bullet/src/LinearMath/btMinMax.h
new file mode 100644
index 0000000..bd5d731
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btMinMax.h
@@ -0,0 +1,71 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_GEN_MINMAX_H
+#define BT_GEN_MINMAX_H
+
+#include "LinearMath/btScalar.h"
+
+template <class T>
+SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b) 
+{
+  return a < b ? a : b ;
+}
+
+template <class T>
+SIMD_FORCE_INLINE const T& btMax(const T& a, const T& b) 
+{
+  return  a > b ? a : b;
+}
+
+template <class T>
+SIMD_FORCE_INLINE const T& btClamped(const T& a, const T& lb, const T& ub) 
+{
+	return a < lb ? lb : (ub < a ? ub : a); 
+}
+
+template <class T>
+SIMD_FORCE_INLINE void btSetMin(T& a, const T& b) 
+{
+    if (b < a) 
+	{
+		a = b;
+	}
+}
+
+template <class T>
+SIMD_FORCE_INLINE void btSetMax(T& a, const T& b) 
+{
+    if (a < b) 
+	{
+		a = b;
+	}
+}
+
+template <class T>
+SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub) 
+{
+	if (a < lb) 
+	{
+		a = lb; 
+	}
+	else if (ub < a) 
+	{
+		a = ub;
+	}
+}
+
+#endif //BT_GEN_MINMAX_H
diff --git a/hkl3d/bullet/src/LinearMath/btMotionState.h b/hkl3d/bullet/src/LinearMath/btMotionState.h
new file mode 100644
index 0000000..9431814
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btMotionState.h
@@ -0,0 +1,40 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_MOTIONSTATE_H
+#define BT_MOTIONSTATE_H
+
+#include "btTransform.h"
+
+///The btMotionState interface class allows the dynamics world to synchronize and interpolate the updated world transforms with graphics
+///For optimizations, potentially only moving objects get synchronized (using setWorldPosition/setWorldOrientation)
+class	btMotionState
+{
+	public:
+		
+		virtual ~btMotionState()
+		{
+			
+		}
+		
+		virtual void	getWorldTransform(btTransform& worldTrans ) const =0;
+
+		//Bullet only calls the update of worldtransform for active objects
+		virtual void	setWorldTransform(const btTransform& worldTrans)=0;
+		
+	
+};
+
+#endif //BT_MOTIONSTATE_H
diff --git a/hkl3d/bullet/src/LinearMath/btPoolAllocator.h b/hkl3d/bullet/src/LinearMath/btPoolAllocator.h
new file mode 100755
index 0000000..ef20845
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btPoolAllocator.h
@@ -0,0 +1,121 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef _BT_POOL_ALLOCATOR_H
+#define _BT_POOL_ALLOCATOR_H
+
+#include "btScalar.h"
+#include "btAlignedAllocator.h"
+
+///The btPoolAllocator class allows to efficiently allocate a large pool of objects, instead of dynamically allocating them separately.
+class btPoolAllocator
+{
+	int				m_elemSize;
+	int				m_maxElements;
+	int				m_freeCount;
+	void*			m_firstFree;
+	unsigned char*	m_pool;
+
+public:
+
+	btPoolAllocator(int elemSize, int maxElements)
+		:m_elemSize(elemSize),
+		m_maxElements(maxElements)
+	{
+		m_pool = (unsigned char*) btAlignedAlloc( static_cast<unsigned int>(m_elemSize*m_maxElements),16);
+
+		unsigned char* p = m_pool;
+        m_firstFree = p;
+        m_freeCount = m_maxElements;
+        int count = m_maxElements;
+        while (--count) {
+            *(void**)p = (p + m_elemSize);
+            p += m_elemSize;
+        }
+        *(void**)p = 0;
+    }
+
+	~btPoolAllocator()
+	{
+		btAlignedFree( m_pool);
+	}
+
+	int	getFreeCount() const
+	{
+		return m_freeCount;
+	}
+
+	int getUsedCount() const
+	{
+		return m_maxElements - m_freeCount;
+	}
+
+	int getMaxCount() const
+	{
+		return m_maxElements;
+	}
+
+	void*	allocate(int size)
+	{
+		// release mode fix
+		(void)size;
+		btAssert(!size || size<=m_elemSize);
+		btAssert(m_freeCount>0);
+        void* result = m_firstFree;
+        m_firstFree = *(void**)m_firstFree;
+        --m_freeCount;
+        return result;
+	}
+
+	bool validPtr(void* ptr)
+	{
+		if (ptr) {
+			if (((unsigned char*)ptr >= m_pool && (unsigned char*)ptr < m_pool + m_maxElements * m_elemSize))
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+
+	void	freeMemory(void* ptr)
+	{
+		 if (ptr) {
+            btAssert((unsigned char*)ptr >= m_pool && (unsigned char*)ptr < m_pool + m_maxElements * m_elemSize);
+
+            *(void**)ptr = m_firstFree;
+            m_firstFree = ptr;
+            ++m_freeCount;
+        }
+	}
+
+	int	getElementSize() const
+	{
+		return m_elemSize;
+	}
+
+	unsigned char*	getPoolAddress()
+	{
+		return m_pool;
+	}
+
+	const unsigned char*	getPoolAddress() const
+	{
+		return m_pool;
+	}
+
+};
+
+#endif //_BT_POOL_ALLOCATOR_H
diff --git a/hkl3d/bullet/src/LinearMath/btQuadWord.h b/hkl3d/bullet/src/LinearMath/btQuadWord.h
new file mode 100644
index 0000000..d5e9daa
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btQuadWord.h
@@ -0,0 +1,180 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_SIMD_QUADWORD_H
+#define BT_SIMD_QUADWORD_H
+
+#include "btScalar.h"
+#include "btMinMax.h"
+
+
+#if defined (__CELLOS_LV2) && defined (__SPU__)
+#include <altivec.h>
+#endif
+
+/**@brief The btQuadWord class is base class for btVector3 and btQuaternion. 
+ * Some issues under PS3 Linux with IBM 2.1 SDK, gcc compiler prevent from using aligned quadword.
+ */
+#ifndef USE_LIBSPE2
+ATTRIBUTE_ALIGNED16(class) btQuadWord
+#else
+class btQuadWord
+#endif
+{
+protected:
+
+#if defined (__SPU__) && defined (__CELLOS_LV2__)
+	union {
+		vec_float4 mVec128;
+		btScalar	m_floats[4];
+	};
+public:
+	vec_float4	get128() const
+	{
+		return mVec128;
+	}
+protected:
+#else //__CELLOS_LV2__ __SPU__
+	btScalar	m_floats[4];
+#endif //__CELLOS_LV2__ __SPU__
+
+	public:
+  
+
+  /**@brief Return the x value */
+		SIMD_FORCE_INLINE const btScalar& getX() const { return m_floats[0]; }
+  /**@brief Return the y value */
+		SIMD_FORCE_INLINE const btScalar& getY() const { return m_floats[1]; }
+  /**@brief Return the z value */
+		SIMD_FORCE_INLINE const btScalar& getZ() const { return m_floats[2]; }
+  /**@brief Set the x value */
+		SIMD_FORCE_INLINE void	setX(btScalar x) { m_floats[0] = x;};
+  /**@brief Set the y value */
+		SIMD_FORCE_INLINE void	setY(btScalar y) { m_floats[1] = y;};
+  /**@brief Set the z value */
+		SIMD_FORCE_INLINE void	setZ(btScalar z) { m_floats[2] = z;};
+  /**@brief Set the w value */
+		SIMD_FORCE_INLINE void	setW(btScalar w) { m_floats[3] = w;};
+  /**@brief Return the x value */
+		SIMD_FORCE_INLINE const btScalar& x() const { return m_floats[0]; }
+  /**@brief Return the y value */
+		SIMD_FORCE_INLINE const btScalar& y() const { return m_floats[1]; }
+  /**@brief Return the z value */
+		SIMD_FORCE_INLINE const btScalar& z() const { return m_floats[2]; }
+  /**@brief Return the w value */
+		SIMD_FORCE_INLINE const btScalar& w() const { return m_floats[3]; }
+
+	//SIMD_FORCE_INLINE btScalar&       operator[](int i)       { return (&m_floats[0])[i];	}      
+	//SIMD_FORCE_INLINE const btScalar& operator[](int i) const { return (&m_floats[0])[i]; }
+	///operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons.
+	SIMD_FORCE_INLINE	operator       btScalar *()       { return &m_floats[0]; }
+	SIMD_FORCE_INLINE	operator const btScalar *() const { return &m_floats[0]; }
+
+	SIMD_FORCE_INLINE	bool	operator==(const btQuadWord& other) const
+	{
+		return ((m_floats[3]==other.m_floats[3]) && (m_floats[2]==other.m_floats[2]) && (m_floats[1]==other.m_floats[1]) && (m_floats[0]==other.m_floats[0]));
+	}
+
+	SIMD_FORCE_INLINE	bool	operator!=(const btQuadWord& other) const
+	{
+		return !(*this == other);
+	}
+
+  /**@brief Set x,y,z and zero w 
+   * @param x Value of x
+   * @param y Value of y
+   * @param z Value of z
+   */
+		SIMD_FORCE_INLINE void 	setValue(const btScalar& x, const btScalar& y, const btScalar& z)
+		{
+			m_floats[0]=x;
+			m_floats[1]=y;
+			m_floats[2]=z;
+			m_floats[3] = 0.f;
+		}
+
+/*		void getValue(btScalar *m) const 
+		{
+			m[0] = m_floats[0];
+			m[1] = m_floats[1];
+			m[2] = m_floats[2];
+		}
+*/
+/**@brief Set the values 
+   * @param x Value of x
+   * @param y Value of y
+   * @param z Value of z
+   * @param w Value of w
+   */
+		SIMD_FORCE_INLINE void	setValue(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w)
+		{
+			m_floats[0]=x;
+			m_floats[1]=y;
+			m_floats[2]=z;
+			m_floats[3]=w;
+		}
+  /**@brief No initialization constructor */
+		SIMD_FORCE_INLINE btQuadWord()
+		//	:m_floats[0](btScalar(0.)),m_floats[1](btScalar(0.)),m_floats[2](btScalar(0.)),m_floats[3](btScalar(0.))
+		{
+		}
+ 
+  /**@brief Three argument constructor (zeros w)
+   * @param x Value of x
+   * @param y Value of y
+   * @param z Value of z
+   */
+		SIMD_FORCE_INLINE btQuadWord(const btScalar& x, const btScalar& y, const btScalar& z)		
+		{
+			m_floats[0] = x, m_floats[1] = y, m_floats[2] = z, m_floats[3] = 0.0f;
+		}
+
+/**@brief Initializing constructor
+   * @param x Value of x
+   * @param y Value of y
+   * @param z Value of z
+   * @param w Value of w
+   */
+		SIMD_FORCE_INLINE btQuadWord(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w) 
+		{
+			m_floats[0] = x, m_floats[1] = y, m_floats[2] = z, m_floats[3] = w;
+		}
+
+  /**@brief Set each element to the max of the current values and the values of another btQuadWord
+   * @param other The other btQuadWord to compare with 
+   */
+		SIMD_FORCE_INLINE void	setMax(const btQuadWord& other)
+		{
+			btSetMax(m_floats[0], other.m_floats[0]);
+			btSetMax(m_floats[1], other.m_floats[1]);
+			btSetMax(m_floats[2], other.m_floats[2]);
+			btSetMax(m_floats[3], other.m_floats[3]);
+		}
+  /**@brief Set each element to the min of the current values and the values of another btQuadWord
+   * @param other The other btQuadWord to compare with 
+   */
+		SIMD_FORCE_INLINE void	setMin(const btQuadWord& other)
+		{
+			btSetMin(m_floats[0], other.m_floats[0]);
+			btSetMin(m_floats[1], other.m_floats[1]);
+			btSetMin(m_floats[2], other.m_floats[2]);
+			btSetMin(m_floats[3], other.m_floats[3]);
+		}
+
+
+
+};
+
+#endif //BT_SIMD_QUADWORD_H
diff --git a/hkl3d/bullet/src/LinearMath/btQuaternion.h b/hkl3d/bullet/src/LinearMath/btQuaternion.h
new file mode 100644
index 0000000..42e968d
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btQuaternion.h
@@ -0,0 +1,433 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_SIMD__QUATERNION_H_
+#define BT_SIMD__QUATERNION_H_
+
+
+#include "btVector3.h"
+#include "btQuadWord.h"
+
+/**@brief The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatrix3x3, btVector3 and btTransform. */
+class btQuaternion : public btQuadWord {
+public:
+  /**@brief No initialization constructor */
+	btQuaternion() {}
+
+	//		template <typename btScalar>
+	//		explicit Quaternion(const btScalar *v) : Tuple4<btScalar>(v) {}
+  /**@brief Constructor from scalars */
+	btQuaternion(const btScalar& x, const btScalar& y, const btScalar& z, const btScalar& w) 
+		: btQuadWord(x, y, z, w) 
+	{}
+  /**@brief Axis angle Constructor
+   * @param axis The axis which the rotation is around
+   * @param angle The magnitude of the rotation around the angle (Radians) */
+	btQuaternion(const btVector3& axis, const btScalar& angle) 
+	{ 
+		setRotation(axis, angle); 
+	}
+  /**@brief Constructor from Euler angles
+   * @param yaw Angle around Y unless BT_EULER_DEFAULT_ZYX defined then Z
+   * @param pitch Angle around X unless BT_EULER_DEFAULT_ZYX defined then Y
+   * @param roll Angle around Z unless BT_EULER_DEFAULT_ZYX defined then X */
+	btQuaternion(const btScalar& yaw, const btScalar& pitch, const btScalar& roll)
+	{ 
+#ifndef BT_EULER_DEFAULT_ZYX
+		setEuler(yaw, pitch, roll); 
+#else
+		setEulerZYX(yaw, pitch, roll); 
+#endif 
+	}
+  /**@brief Set the rotation using axis angle notation 
+   * @param axis The axis around which to rotate
+   * @param angle The magnitude of the rotation in Radians */
+	void setRotation(const btVector3& axis, const btScalar& angle)
+	{
+		btScalar d = axis.length();
+		btAssert(d != btScalar(0.0));
+		btScalar s = btSin(angle * btScalar(0.5)) / d;
+		setValue(axis.x() * s, axis.y() * s, axis.z() * s, 
+			btCos(angle * btScalar(0.5)));
+	}
+  /**@brief Set the quaternion using Euler angles
+   * @param yaw Angle around Y
+   * @param pitch Angle around X
+   * @param roll Angle around Z */
+	void setEuler(const btScalar& yaw, const btScalar& pitch, const btScalar& roll)
+	{
+		btScalar halfYaw = btScalar(yaw) * btScalar(0.5);  
+		btScalar halfPitch = btScalar(pitch) * btScalar(0.5);  
+		btScalar halfRoll = btScalar(roll) * btScalar(0.5);  
+		btScalar cosYaw = btCos(halfYaw);
+		btScalar sinYaw = btSin(halfYaw);
+		btScalar cosPitch = btCos(halfPitch);
+		btScalar sinPitch = btSin(halfPitch);
+		btScalar cosRoll = btCos(halfRoll);
+		btScalar sinRoll = btSin(halfRoll);
+		setValue(cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw,
+			cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw,
+			sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw,
+			cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw);
+	}
+  /**@brief Set the quaternion using euler angles 
+   * @param yaw Angle around Z
+   * @param pitch Angle around Y
+   * @param roll Angle around X */
+	void setEulerZYX(const btScalar& yaw, const btScalar& pitch, const btScalar& roll)
+	{
+		btScalar halfYaw = btScalar(yaw) * btScalar(0.5);  
+		btScalar halfPitch = btScalar(pitch) * btScalar(0.5);  
+		btScalar halfRoll = btScalar(roll) * btScalar(0.5);  
+		btScalar cosYaw = btCos(halfYaw);
+		btScalar sinYaw = btSin(halfYaw);
+		btScalar cosPitch = btCos(halfPitch);
+		btScalar sinPitch = btSin(halfPitch);
+		btScalar cosRoll = btCos(halfRoll);
+		btScalar sinRoll = btSin(halfRoll);
+		setValue(sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw, //x
+                         cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw, //y
+                         cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw, //z
+                         cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw); //formerly yzx
+	}
+  /**@brief Add two quaternions
+   * @param q The quaternion to add to this one */
+	SIMD_FORCE_INLINE	btQuaternion& operator+=(const btQuaternion& q)
+	{
+		m_floats[0] += q.x(); m_floats[1] += q.y(); m_floats[2] += q.z(); m_floats[3] += q.m_floats[3];
+		return *this;
+	}
+
+  /**@brief Subtract out a quaternion
+   * @param q The quaternion to subtract from this one */
+	btQuaternion& operator-=(const btQuaternion& q) 
+	{
+		m_floats[0] -= q.x(); m_floats[1] -= q.y(); m_floats[2] -= q.z(); m_floats[3] -= q.m_floats[3];
+		return *this;
+	}
+
+  /**@brief Scale this quaternion
+   * @param s The scalar to scale by */
+	btQuaternion& operator*=(const btScalar& s)
+	{
+		m_floats[0] *= s; m_floats[1] *= s; m_floats[2] *= s; m_floats[3] *= s;
+		return *this;
+	}
+
+  /**@brief Multiply this quaternion by q on the right
+   * @param q The other quaternion 
+   * Equivilant to this = this * q */
+	btQuaternion& operator*=(const btQuaternion& q)
+	{
+		setValue(m_floats[3] * q.x() + m_floats[0] * q.m_floats[3] + m_floats[1] * q.z() - m_floats[2] * q.y(),
+			m_floats[3] * q.y() + m_floats[1] * q.m_floats[3] + m_floats[2] * q.x() - m_floats[0] * q.z(),
+			m_floats[3] * q.z() + m_floats[2] * q.m_floats[3] + m_floats[0] * q.y() - m_floats[1] * q.x(),
+			m_floats[3] * q.m_floats[3] - m_floats[0] * q.x() - m_floats[1] * q.y() - m_floats[2] * q.z());
+		return *this;
+	}
+  /**@brief Return the dot product between this quaternion and another
+   * @param q The other quaternion */
+	btScalar dot(const btQuaternion& q) const
+	{
+		return m_floats[0] * q.x() + m_floats[1] * q.y() + m_floats[2] * q.z() + m_floats[3] * q.m_floats[3];
+	}
+
+  /**@brief Return the length squared of the quaternion */
+	btScalar length2() const
+	{
+		return dot(*this);
+	}
+
+  /**@brief Return the length of the quaternion */
+	btScalar length() const
+	{
+		return btSqrt(length2());
+	}
+
+  /**@brief Normalize the quaternion 
+   * Such that x^2 + y^2 + z^2 +w^2 = 1 */
+	btQuaternion& normalize() 
+	{
+		return *this /= length();
+	}
+
+  /**@brief Return a scaled version of this quaternion
+   * @param s The scale factor */
+	SIMD_FORCE_INLINE btQuaternion
+	operator*(const btScalar& s) const
+	{
+		return btQuaternion(x() * s, y() * s, z() * s, m_floats[3] * s);
+	}
+
+
+  /**@brief Return an inversely scaled versionof this quaternion
+   * @param s The inverse scale factor */
+	btQuaternion operator/(const btScalar& s) const
+	{
+		btAssert(s != btScalar(0.0));
+		return *this * (btScalar(1.0) / s);
+	}
+
+  /**@brief Inversely scale this quaternion
+   * @param s The scale factor */
+	btQuaternion& operator/=(const btScalar& s) 
+	{
+		btAssert(s != btScalar(0.0));
+		return *this *= btScalar(1.0) / s;
+	}
+
+  /**@brief Return a normalized version of this quaternion */
+	btQuaternion normalized() const 
+	{
+		return *this / length();
+	} 
+  /**@brief Return the angle between this quaternion and the other 
+   * @param q The other quaternion */
+	btScalar angle(const btQuaternion& q) const 
+	{
+		btScalar s = btSqrt(length2() * q.length2());
+		btAssert(s != btScalar(0.0));
+		return btAcos(dot(q) / s);
+	}
+  /**@brief Return the angle of rotation represented by this quaternion */
+	btScalar getAngle() const 
+	{
+		btScalar s = btScalar(2.) * btAcos(m_floats[3]);
+		return s;
+	}
+
+	/**@brief Return the axis of the rotation represented by this quaternion */
+	btVector3 getAxis() const
+	{
+		btScalar s_squared = btScalar(1.) - btPow(m_floats[3], btScalar(2.));
+		if (s_squared < btScalar(10.) * SIMD_EPSILON) //Check for divide by zero
+			return btVector3(1.0, 0.0, 0.0);  // Arbitrary
+		btScalar s = btSqrt(s_squared);
+		return btVector3(m_floats[0] / s, m_floats[1] / s, m_floats[2] / s);
+	}
+
+	/**@brief Return the inverse of this quaternion */
+	btQuaternion inverse() const
+	{
+		return btQuaternion(-m_floats[0], -m_floats[1], -m_floats[2], m_floats[3]);
+	}
+
+  /**@brief Return the sum of this quaternion and the other 
+   * @param q2 The other quaternion */
+	SIMD_FORCE_INLINE btQuaternion
+	operator+(const btQuaternion& q2) const
+	{
+		const btQuaternion& q1 = *this;
+		return btQuaternion(q1.x() + q2.x(), q1.y() + q2.y(), q1.z() + q2.z(), q1.m_floats[3] + q2.m_floats[3]);
+	}
+
+  /**@brief Return the difference between this quaternion and the other 
+   * @param q2 The other quaternion */
+	SIMD_FORCE_INLINE btQuaternion
+	operator-(const btQuaternion& q2) const
+	{
+		const btQuaternion& q1 = *this;
+		return btQuaternion(q1.x() - q2.x(), q1.y() - q2.y(), q1.z() - q2.z(), q1.m_floats[3] - q2.m_floats[3]);
+	}
+
+  /**@brief Return the negative of this quaternion 
+   * This simply negates each element */
+	SIMD_FORCE_INLINE btQuaternion operator-() const
+	{
+		const btQuaternion& q2 = *this;
+		return btQuaternion( - q2.x(), - q2.y(),  - q2.z(),  - q2.m_floats[3]);
+	}
+  /**@todo document this and it's use */
+	SIMD_FORCE_INLINE btQuaternion farthest( const btQuaternion& qd) const 
+	{
+		btQuaternion diff,sum;
+		diff = *this - qd;
+		sum = *this + qd;
+		if( diff.dot(diff) > sum.dot(sum) )
+			return qd;
+		return (-qd);
+	}
+
+	/**@todo document this and it's use */
+	SIMD_FORCE_INLINE btQuaternion nearest( const btQuaternion& qd) const 
+	{
+		btQuaternion diff,sum;
+		diff = *this - qd;
+		sum = *this + qd;
+		if( diff.dot(diff) < sum.dot(sum) )
+			return qd;
+		return (-qd);
+	}
+
+
+  /**@brief Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion
+   * @param q The other quaternion to interpolate with 
+   * @param t The ratio between this and q to interpolate.  If t = 0 the result is this, if t=1 the result is q.
+   * Slerp interpolates assuming constant velocity.  */
+	btQuaternion slerp(const btQuaternion& q, const btScalar& t) const
+	{
+		btScalar theta = angle(q);
+		if (theta != btScalar(0.0))
+		{
+			btScalar d = btScalar(1.0) / btSin(theta);
+			btScalar s0 = btSin((btScalar(1.0) - t) * theta);
+			btScalar s1 = btSin(t * theta);   
+                        if (dot(q) < 0) // Take care of long angle case see http://en.wikipedia.org/wiki/Slerp
+                          return btQuaternion((m_floats[0] * s0 + -q.x() * s1) * d,
+                                              (m_floats[1] * s0 + -q.y() * s1) * d,
+                                              (m_floats[2] * s0 + -q.z() * s1) * d,
+                                              (m_floats[3] * s0 + -q.m_floats[3] * s1) * d);
+                        else
+                          return btQuaternion((m_floats[0] * s0 + q.x() * s1) * d,
+                                              (m_floats[1] * s0 + q.y() * s1) * d,
+                                              (m_floats[2] * s0 + q.z() * s1) * d,
+                                              (m_floats[3] * s0 + q.m_floats[3] * s1) * d);
+                        
+		}
+		else
+		{
+			return *this;
+		}
+	}
+
+	static const btQuaternion&	getIdentity()
+	{
+		static const btQuaternion identityQuat(btScalar(0.),btScalar(0.),btScalar(0.),btScalar(1.));
+		return identityQuat;
+	}
+
+	SIMD_FORCE_INLINE const btScalar& getW() const { return m_floats[3]; }
+
+	
+};
+
+
+/**@brief Return the negative of a quaternion */
+SIMD_FORCE_INLINE btQuaternion
+operator-(const btQuaternion& q)
+{
+	return btQuaternion(-q.x(), -q.y(), -q.z(), -q.w());
+}
+
+
+
+/**@brief Return the product of two quaternions */
+SIMD_FORCE_INLINE btQuaternion
+operator*(const btQuaternion& q1, const btQuaternion& q2) {
+	return btQuaternion(q1.w() * q2.x() + q1.x() * q2.w() + q1.y() * q2.z() - q1.z() * q2.y(),
+		q1.w() * q2.y() + q1.y() * q2.w() + q1.z() * q2.x() - q1.x() * q2.z(),
+		q1.w() * q2.z() + q1.z() * q2.w() + q1.x() * q2.y() - q1.y() * q2.x(),
+		q1.w() * q2.w() - q1.x() * q2.x() - q1.y() * q2.y() - q1.z() * q2.z()); 
+}
+
+SIMD_FORCE_INLINE btQuaternion
+operator*(const btQuaternion& q, const btVector3& w)
+{
+	return btQuaternion( q.w() * w.x() + q.y() * w.z() - q.z() * w.y(),
+		q.w() * w.y() + q.z() * w.x() - q.x() * w.z(),
+		q.w() * w.z() + q.x() * w.y() - q.y() * w.x(),
+		-q.x() * w.x() - q.y() * w.y() - q.z() * w.z()); 
+}
+
+SIMD_FORCE_INLINE btQuaternion
+operator*(const btVector3& w, const btQuaternion& q)
+{
+	return btQuaternion( w.x() * q.w() + w.y() * q.z() - w.z() * q.y(),
+		w.y() * q.w() + w.z() * q.x() - w.x() * q.z(),
+		w.z() * q.w() + w.x() * q.y() - w.y() * q.x(),
+		-w.x() * q.x() - w.y() * q.y() - w.z() * q.z()); 
+}
+
+/**@brief Calculate the dot product between two quaternions */
+SIMD_FORCE_INLINE btScalar 
+dot(const btQuaternion& q1, const btQuaternion& q2) 
+{ 
+	return q1.dot(q2); 
+}
+
+
+/**@brief Return the length of a quaternion */
+SIMD_FORCE_INLINE btScalar
+length(const btQuaternion& q) 
+{ 
+	return q.length(); 
+}
+
+/**@brief Return the angle between two quaternions*/
+SIMD_FORCE_INLINE btScalar
+angle(const btQuaternion& q1, const btQuaternion& q2) 
+{ 
+	return q1.angle(q2); 
+}
+
+/**@brief Return the inverse of a quaternion*/
+SIMD_FORCE_INLINE btQuaternion
+inverse(const btQuaternion& q) 
+{
+	return q.inverse();
+}
+
+/**@brief Return the result of spherical linear interpolation betwen two quaternions 
+ * @param q1 The first quaternion
+ * @param q2 The second quaternion 
+ * @param t The ration between q1 and q2.  t = 0 return q1, t=1 returns q2 
+ * Slerp assumes constant velocity between positions. */
+SIMD_FORCE_INLINE btQuaternion
+slerp(const btQuaternion& q1, const btQuaternion& q2, const btScalar& t) 
+{
+	return q1.slerp(q2, t);
+}
+
+SIMD_FORCE_INLINE btVector3 
+quatRotate(const btQuaternion& rotation, const btVector3& v) 
+{
+	btQuaternion q = rotation * v;
+	q *= rotation.inverse();
+	return btVector3(q.getX(),q.getY(),q.getZ());
+}
+
+SIMD_FORCE_INLINE btQuaternion 
+shortestArcQuat(const btVector3& v0, const btVector3& v1) // Game Programming Gems 2.10. make sure v0,v1 are normalized
+{
+	btVector3 c = v0.cross(v1);
+	btScalar  d = v0.dot(v1);
+
+	if (d < -1.0 + SIMD_EPSILON)
+	{
+		btVector3 n,unused;
+		btPlaneSpace1(v0,n,unused);
+		return btQuaternion(n.x(),n.y(),n.z(),0.0f); // just pick any vector that is orthogonal to v0
+	}
+
+	btScalar  s = btSqrt((1.0f + d) * 2.0f);
+	btScalar rs = 1.0f / s;
+
+	return btQuaternion(c.getX()*rs,c.getY()*rs,c.getZ()*rs,s * 0.5f);
+}
+
+SIMD_FORCE_INLINE btQuaternion 
+shortestArcQuatNormalize2(btVector3& v0,btVector3& v1)
+{
+	v0.normalize();
+	v1.normalize();
+	return shortestArcQuat(v0,v1);
+}
+
+#endif //BT_SIMD__QUATERNION_H_
+
+
+
+
diff --git a/hkl3d/bullet/src/LinearMath/btQuickprof.cpp b/hkl3d/bullet/src/LinearMath/btQuickprof.cpp
new file mode 100644
index 0000000..1453406
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btQuickprof.cpp
@@ -0,0 +1,565 @@
+/*
+
+***************************************************************************************************
+**
+** profile.cpp
+**
+** Real-Time Hierarchical Profiling for Game Programming Gems 3
+**
+** by Greg Hjelstrom & Byon Garrabrant
+**
+***************************************************************************************************/
+
+// Credits: The Clock class was inspired by the Timer classes in 
+// Ogre (www.ogre3d.org).
+
+#include "btQuickprof.h"
+
+#ifndef BT_NO_PROFILE
+
+
+static btClock gProfileClock;
+
+
+#ifdef __CELLOS_LV2__
+#include <sys/sys_time.h>
+#include <sys/time_util.h>
+#include <stdio.h>
+#endif
+
+#if defined (SUNOS) || defined (__SUNOS__) 
+#include <stdio.h> 
+#endif
+
+#if defined(WIN32) || defined(_WIN32)
+
+#define BT_USE_WINDOWS_TIMERS
+#define WIN32_LEAN_AND_MEAN
+#define NOWINRES
+#define NOMCX
+#define NOIME 
+
+#ifdef _XBOX
+	#include <Xtl.h>
+#else //_XBOX
+	#include <windows.h>
+#endif //_XBOX
+
+#include <time.h>
+
+
+#else //_WIN32
+#include <sys/time.h>
+#endif //_WIN32
+
+#define mymin(a,b) (a > b ? a : b)
+
+struct btClockData
+{
+
+#ifdef BT_USE_WINDOWS_TIMERS
+	LARGE_INTEGER mClockFrequency;
+	DWORD mStartTick;
+	LONGLONG mPrevElapsedTime;
+	LARGE_INTEGER mStartTime;
+#else
+#ifdef __CELLOS_LV2__
+	uint64_t	mStartTime;
+#else
+	struct timeval mStartTime;
+#endif
+#endif //__CELLOS_LV2__
+
+};
+
+///The btClock is a portable basic clock that measures accurate time in seconds, use for profiling.
+btClock::btClock()
+{
+	m_data = new btClockData;
+#ifdef BT_USE_WINDOWS_TIMERS
+	QueryPerformanceFrequency(&m_data->mClockFrequency);
+#endif
+	reset();
+}
+
+btClock::~btClock()
+{
+	delete m_data;
+}
+
+btClock::btClock(const btClock& other)
+{
+	m_data = new btClockData;
+	*m_data = *other.m_data;
+}
+
+btClock& btClock::operator=(const btClock& other)
+{
+	*m_data = *other.m_data;
+	return *this;
+}
+
+
+	/// Resets the initial reference time.
+void btClock::reset()
+{
+#ifdef BT_USE_WINDOWS_TIMERS
+	QueryPerformanceCounter(&m_data->mStartTime);
+	m_data->mStartTick = GetTickCount();
+	m_data->mPrevElapsedTime = 0;
+#else
+#ifdef __CELLOS_LV2__
+
+	typedef uint64_t  ClockSize;
+	ClockSize newTime;
+	//__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
+	SYS_TIMEBASE_GET( newTime );
+	m_data->mStartTime = newTime;
+#else
+	gettimeofday(&m_data->mStartTime, 0);
+#endif
+#endif
+}
+
+/// Returns the time in ms since the last call to reset or since 
+/// the btClock was created.
+unsigned long int btClock::getTimeMilliseconds()
+{
+#ifdef BT_USE_WINDOWS_TIMERS
+	LARGE_INTEGER currentTime;
+	QueryPerformanceCounter(&currentTime);
+	LONGLONG elapsedTime = currentTime.QuadPart - 
+		m_data->mStartTime.QuadPart;
+		// Compute the number of millisecond ticks elapsed.
+	unsigned long msecTicks = (unsigned long)(1000 * elapsedTime / 
+		m_data->mClockFrequency.QuadPart);
+		// Check for unexpected leaps in the Win32 performance counter.  
+	// (This is caused by unexpected data across the PCI to ISA 
+		// bridge, aka south bridge.  See Microsoft KB274323.)
+		unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick;
+		signed long msecOff = (signed long)(msecTicks - elapsedTicks);
+		if (msecOff < -100 || msecOff > 100)
+		{
+			// Adjust the starting time forwards.
+			LONGLONG msecAdjustment = mymin(msecOff * 
+				m_data->mClockFrequency.QuadPart / 1000, elapsedTime - 
+				m_data->mPrevElapsedTime);
+			m_data->mStartTime.QuadPart += msecAdjustment;
+			elapsedTime -= msecAdjustment;
+
+			// Recompute the number of millisecond ticks elapsed.
+			msecTicks = (unsigned long)(1000 * elapsedTime / 
+				m_data->mClockFrequency.QuadPart);
+		}
+
+		// Store the current elapsed time for adjustments next time.
+		m_data->mPrevElapsedTime = elapsedTime;
+
+		return msecTicks;
+#else
+
+#ifdef __CELLOS_LV2__
+		uint64_t freq=sys_time_get_timebase_frequency();
+		double dFreq=((double) freq) / 1000.0;
+		typedef uint64_t  ClockSize;
+		ClockSize newTime;
+		SYS_TIMEBASE_GET( newTime );
+		//__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
+
+		return (unsigned long int)((double(newTime-m_data->mStartTime)) / dFreq);
+#else
+
+		struct timeval currentTime;
+		gettimeofday(&currentTime, 0);
+		return (currentTime.tv_sec - m_data->mStartTime.tv_sec) * 1000 + 
+			(currentTime.tv_usec - m_data->mStartTime.tv_usec) / 1000;
+#endif //__CELLOS_LV2__
+#endif
+}
+
+	/// Returns the time in us since the last call to reset or since 
+	/// the Clock was created.
+unsigned long int btClock::getTimeMicroseconds()
+{
+#ifdef BT_USE_WINDOWS_TIMERS
+		LARGE_INTEGER currentTime;
+		QueryPerformanceCounter(&currentTime);
+		LONGLONG elapsedTime = currentTime.QuadPart - 
+			m_data->mStartTime.QuadPart;
+
+		// Compute the number of millisecond ticks elapsed.
+		unsigned long msecTicks = (unsigned long)(1000 * elapsedTime / 
+			m_data->mClockFrequency.QuadPart);
+
+		// Check for unexpected leaps in the Win32 performance counter.  
+		// (This is caused by unexpected data across the PCI to ISA 
+		// bridge, aka south bridge.  See Microsoft KB274323.)
+		unsigned long elapsedTicks = GetTickCount() - m_data->mStartTick;
+		signed long msecOff = (signed long)(msecTicks - elapsedTicks);
+		if (msecOff < -100 || msecOff > 100)
+		{
+			// Adjust the starting time forwards.
+			LONGLONG msecAdjustment = mymin(msecOff * 
+				m_data->mClockFrequency.QuadPart / 1000, elapsedTime - 
+				m_data->mPrevElapsedTime);
+			m_data->mStartTime.QuadPart += msecAdjustment;
+			elapsedTime -= msecAdjustment;
+		}
+
+		// Store the current elapsed time for adjustments next time.
+		m_data->mPrevElapsedTime = elapsedTime;
+
+		// Convert to microseconds.
+		unsigned long usecTicks = (unsigned long)(1000000 * elapsedTime / 
+			m_data->mClockFrequency.QuadPart);
+
+		return usecTicks;
+#else
+
+#ifdef __CELLOS_LV2__
+		uint64_t freq=sys_time_get_timebase_frequency();
+		double dFreq=((double) freq)/ 1000000.0;
+		typedef uint64_t  ClockSize;
+		ClockSize newTime;
+		//__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
+		SYS_TIMEBASE_GET( newTime );
+
+		return (unsigned long int)((double(newTime-m_data->mStartTime)) / dFreq);
+#else
+
+		struct timeval currentTime;
+		gettimeofday(&currentTime, 0);
+		return (currentTime.tv_sec - m_data->mStartTime.tv_sec) * 1000000 + 
+			(currentTime.tv_usec - m_data->mStartTime.tv_usec);
+#endif//__CELLOS_LV2__
+#endif 
+}
+
+
+
+
+
+inline void Profile_Get_Ticks(unsigned long int * ticks)
+{
+	*ticks = gProfileClock.getTimeMicroseconds();
+}
+
+inline float Profile_Get_Tick_Rate(void)
+{
+//	return 1000000.f;
+	return 1000.f;
+
+}
+
+
+
+/***************************************************************************************************
+**
+** CProfileNode
+**
+***************************************************************************************************/
+
+/***********************************************************************************************
+ * INPUT:                                                                                      *
+ * name - pointer to a static string which is the name of this profile node                    *
+ * parent - parent pointer                                                                     *
+ *                                                                                             *
+ * WARNINGS:                                                                                   *
+ * The name is assumed to be a static pointer, only the pointer is stored and compared for     *
+ * efficiency reasons.                                                                         *
+ *=============================================================================================*/
+CProfileNode::CProfileNode( const char * name, CProfileNode * parent ) :
+	Name( name ),
+	TotalCalls( 0 ),
+	TotalTime( 0 ),
+	StartTime( 0 ),
+	RecursionCounter( 0 ),
+	Parent( parent ),
+	Child( NULL ),
+	Sibling( NULL )
+{
+	Reset();
+}
+
+
+void	CProfileNode::CleanupMemory()
+{
+	delete ( Child);
+	Child = NULL;
+	delete ( Sibling);
+	Sibling = NULL;
+}
+
+CProfileNode::~CProfileNode( void )
+{
+	delete ( Child);
+	delete ( Sibling);
+}
+
+
+/***********************************************************************************************
+ * INPUT:                                                                                      *
+ * name - static string pointer to the name of the node we are searching for                   *
+ *                                                                                             *
+ * WARNINGS:                                                                                   *
+ * All profile names are assumed to be static strings so this function uses pointer compares   *
+ * to find the named node.                                                                     *
+ *=============================================================================================*/
+CProfileNode * CProfileNode::Get_Sub_Node( const char * name )
+{
+	// Try to find this sub node
+	CProfileNode * child = Child;
+	while ( child ) {
+		if ( child->Name == name ) {
+			return child;
+		}
+		child = child->Sibling;
+	}
+
+	// We didn't find it, so add it
+	
+	CProfileNode * node = new CProfileNode( name, this );
+	node->Sibling = Child;
+	Child = node;
+	return node;
+}
+
+
+void	CProfileNode::Reset( void )
+{
+	TotalCalls = 0;
+	TotalTime = 0.0f;
+	
+
+	if ( Child ) {
+		Child->Reset();
+	}
+	if ( Sibling ) {
+		Sibling->Reset();
+	}
+}
+
+
+void	CProfileNode::Call( void )
+{
+	TotalCalls++;
+	if (RecursionCounter++ == 0) {
+		Profile_Get_Ticks(&StartTime);
+	}
+}
+
+
+bool	CProfileNode::Return( void )
+{
+	if ( --RecursionCounter == 0 && TotalCalls != 0 ) { 
+		unsigned long int time;
+		Profile_Get_Ticks(&time);
+		time-=StartTime;
+		TotalTime += (float)time / Profile_Get_Tick_Rate();
+	}
+	return ( RecursionCounter == 0 );
+}
+
+
+/***************************************************************************************************
+**
+** CProfileIterator
+**
+***************************************************************************************************/
+CProfileIterator::CProfileIterator( CProfileNode * start )
+{
+	CurrentParent = start;
+	CurrentChild = CurrentParent->Get_Child();
+}
+
+
+void	CProfileIterator::First(void)
+{
+	CurrentChild = CurrentParent->Get_Child();
+}
+
+
+void	CProfileIterator::Next(void)
+{
+	CurrentChild = CurrentChild->Get_Sibling();
+}
+
+
+bool	CProfileIterator::Is_Done(void)
+{
+	return CurrentChild == NULL;
+}
+
+
+void	CProfileIterator::Enter_Child( int index )
+{
+	CurrentChild = CurrentParent->Get_Child();
+	while ( (CurrentChild != NULL) && (index != 0) ) {
+		index--;
+		CurrentChild = CurrentChild->Get_Sibling();
+	}
+
+	if ( CurrentChild != NULL ) {
+		CurrentParent = CurrentChild;
+		CurrentChild = CurrentParent->Get_Child();
+	}
+}
+
+
+void	CProfileIterator::Enter_Parent( void )
+{
+	if ( CurrentParent->Get_Parent() != NULL ) {
+		CurrentParent = CurrentParent->Get_Parent();
+	}
+	CurrentChild = CurrentParent->Get_Child();
+}
+
+
+/***************************************************************************************************
+**
+** CProfileManager
+**
+***************************************************************************************************/
+
+CProfileNode	CProfileManager::Root( "Root", NULL );
+CProfileNode *	CProfileManager::CurrentNode = &CProfileManager::Root;
+int				CProfileManager::FrameCounter = 0;
+unsigned long int			CProfileManager::ResetTime = 0;
+
+
+/***********************************************************************************************
+ * CProfileManager::Start_Profile -- Begin a named profile                                    *
+ *                                                                                             *
+ * Steps one level deeper into the tree, if a child already exists with the specified name     *
+ * then it accumulates the profiling; otherwise a new child node is added to the profile tree. *
+ *                                                                                             *
+ * INPUT:                                                                                      *
+ * name - name of this profiling record                                                        *
+ *                                                                                             *
+ * WARNINGS:                                                                                   *
+ * The string used is assumed to be a static string; pointer compares are used throughout      *
+ * the profiling code for efficiency.                                                          *
+ *=============================================================================================*/
+void	CProfileManager::Start_Profile( const char * name )
+{
+	if (name != CurrentNode->Get_Name()) {
+		CurrentNode = CurrentNode->Get_Sub_Node( name );
+	} 
+	
+	CurrentNode->Call();
+}
+
+
+/***********************************************************************************************
+ * CProfileManager::Stop_Profile -- Stop timing and record the results.                       *
+ *=============================================================================================*/
+void	CProfileManager::Stop_Profile( void )
+{
+	// Return will indicate whether we should back up to our parent (we may
+	// be profiling a recursive function)
+	if (CurrentNode->Return()) {
+		CurrentNode = CurrentNode->Get_Parent();
+	}
+}
+
+
+/***********************************************************************************************
+ * CProfileManager::Reset -- Reset the contents of the profiling system                       *
+ *                                                                                             *
+ *    This resets everything except for the tree structure.  All of the timing data is reset.  *
+ *=============================================================================================*/
+void	CProfileManager::Reset( void )
+{ 
+	gProfileClock.reset();
+	Root.Reset();
+    Root.Call();
+	FrameCounter = 0;
+	Profile_Get_Ticks(&ResetTime);
+}
+
+
+/***********************************************************************************************
+ * CProfileManager::Increment_Frame_Counter -- Increment the frame counter                    *
+ *=============================================================================================*/
+void CProfileManager::Increment_Frame_Counter( void )
+{
+	FrameCounter++;
+}
+
+
+/***********************************************************************************************
+ * CProfileManager::Get_Time_Since_Reset -- returns the elapsed time since last reset         *
+ *=============================================================================================*/
+float CProfileManager::Get_Time_Since_Reset( void )
+{
+	unsigned long int time;
+	Profile_Get_Ticks(&time);
+	time -= ResetTime;
+	return (float)time / Profile_Get_Tick_Rate();
+}
+
+#include <stdio.h>
+
+void	CProfileManager::dumpRecursive(CProfileIterator* profileIterator, int spacing)
+{
+	profileIterator->First();
+	if (profileIterator->Is_Done())
+		return;
+
+	float accumulated_time=0,parent_time = profileIterator->Is_Root() ? CProfileManager::Get_Time_Since_Reset() : profileIterator->Get_Current_Parent_Total_Time();
+	int i;
+	int frames_since_reset = CProfileManager::Get_Frame_Count_Since_Reset();
+	for (i=0;i<spacing;i++)	printf(".");
+	printf("----------------------------------\n");
+	for (i=0;i<spacing;i++)	printf(".");
+	printf("Profiling: %s (total running time: %.3f ms) ---\n",	profileIterator->Get_Current_Parent_Name(), parent_time );
+	float totalTime = 0.f;
+
+	
+	int numChildren = 0;
+	
+	for (i = 0; !profileIterator->Is_Done(); i++,profileIterator->Next())
+	{
+		numChildren++;
+		float current_total_time = profileIterator->Get_Current_Total_Time();
+		accumulated_time += current_total_time;
+		float fraction = parent_time > SIMD_EPSILON ? (current_total_time / parent_time) * 100 : 0.f;
+		{
+			int i;	for (i=0;i<spacing;i++)	printf(".");
+		}
+		printf("%d -- %s (%.2f %%) :: %.3f ms / frame (%d calls)\n",i, profileIterator->Get_Current_Name(), fraction,(current_total_time / (double)frames_since_reset),profileIterator->Get_Current_Total_Calls());
+		totalTime += current_total_time;
+		//recurse into children
+	}
+
+	if (parent_time < accumulated_time)
+	{
+		printf("what's wrong\n");
+	}
+	for (i=0;i<spacing;i++)	printf(".");
+	printf("%s (%.3f %%) :: %.3f ms\n", "Unaccounted:",parent_time > SIMD_EPSILON ? ((parent_time - accumulated_time) / parent_time) * 100 : 0.f, parent_time - accumulated_time);
+	
+	for (i=0;i<numChildren;i++)
+	{
+		profileIterator->Enter_Child(i);
+		dumpRecursive(profileIterator,spacing+3);
+		profileIterator->Enter_Parent();
+	}
+}
+
+
+
+void	CProfileManager::dumpAll()
+{
+	CProfileIterator* profileIterator = 0;
+	profileIterator = CProfileManager::Get_Iterator();
+
+	dumpRecursive(profileIterator,0);
+
+	CProfileManager::Release_Iterator(profileIterator);
+}
+
+
+
+
+#endif //BT_NO_PROFILE
diff --git a/hkl3d/bullet/src/LinearMath/btQuickprof.h b/hkl3d/bullet/src/LinearMath/btQuickprof.h
new file mode 100644
index 0000000..0da13ab
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btQuickprof.h
@@ -0,0 +1,196 @@
+
+/***************************************************************************************************
+**
+** Real-Time Hierarchical Profiling for Game Programming Gems 3
+**
+** by Greg Hjelstrom & Byon Garrabrant
+**
+***************************************************************************************************/
+
+// Credits: The Clock class was inspired by the Timer classes in 
+// Ogre (www.ogre3d.org).
+
+
+
+#ifndef BT_QUICK_PROF_H
+#define BT_QUICK_PROF_H
+
+//To disable built-in profiling, please comment out next line
+//#define BT_NO_PROFILE 1
+#ifndef BT_NO_PROFILE
+#include <stdio.h>//@todo remove this, backwards compatibility
+#include "btScalar.h"
+#include "btAlignedAllocator.h"
+#include <new>
+
+
+
+
+
+#define USE_BT_CLOCK 1
+
+#ifdef USE_BT_CLOCK
+
+///The btClock is a portable basic clock that measures accurate time in seconds, use for profiling.
+class btClock
+{
+public:
+	btClock();
+
+	btClock(const btClock& other);
+	btClock& operator=(const btClock& other);
+
+	~btClock();
+
+	/// Resets the initial reference time.
+	void reset();
+
+	/// Returns the time in ms since the last call to reset or since 
+	/// the btClock was created.
+	unsigned long int getTimeMilliseconds();
+
+	/// Returns the time in us since the last call to reset or since 
+	/// the Clock was created.
+	unsigned long int getTimeMicroseconds();
+private:
+	struct btClockData* m_data;
+};
+
+#endif //USE_BT_CLOCK
+
+
+
+
+///A node in the Profile Hierarchy Tree
+class	CProfileNode {
+
+public:
+	CProfileNode( const char * name, CProfileNode * parent );
+	~CProfileNode( void );
+
+	CProfileNode * Get_Sub_Node( const char * name );
+
+	CProfileNode * Get_Parent( void )		{ return Parent; }
+	CProfileNode * Get_Sibling( void )		{ return Sibling; }
+	CProfileNode * Get_Child( void )			{ return Child; }
+
+	void				CleanupMemory();
+	void				Reset( void );
+	void				Call( void );
+	bool				Return( void );
+
+	const char *	Get_Name( void )				{ return Name; }
+	int				Get_Total_Calls( void )		{ return TotalCalls; }
+	float				Get_Total_Time( void )		{ return TotalTime; }
+
+protected:
+
+	const char *	Name;
+	int				TotalCalls;
+	float				TotalTime;
+	unsigned long int			StartTime;
+	int				RecursionCounter;
+
+	CProfileNode *	Parent;
+	CProfileNode *	Child;
+	CProfileNode *	Sibling;
+};
+
+///An iterator to navigate through the tree
+class CProfileIterator
+{
+public:
+	// Access all the children of the current parent
+	void				First(void);
+	void				Next(void);
+	bool				Is_Done(void);
+	bool                Is_Root(void) { return (CurrentParent->Get_Parent() == 0); }
+
+	void				Enter_Child( int index );		// Make the given child the new parent
+	void				Enter_Largest_Child( void );	// Make the largest child the new parent
+	void				Enter_Parent( void );			// Make the current parent's parent the new parent
+
+	// Access the current child
+	const char *	Get_Current_Name( void )			{ return CurrentChild->Get_Name(); }
+	int				Get_Current_Total_Calls( void )	{ return CurrentChild->Get_Total_Calls(); }
+	float				Get_Current_Total_Time( void )	{ return CurrentChild->Get_Total_Time(); }
+
+	// Access the current parent
+	const char *	Get_Current_Parent_Name( void )			{ return CurrentParent->Get_Name(); }
+	int				Get_Current_Parent_Total_Calls( void )	{ return CurrentParent->Get_Total_Calls(); }
+	float				Get_Current_Parent_Total_Time( void )	{ return CurrentParent->Get_Total_Time(); }
+
+protected:
+
+	CProfileNode *	CurrentParent;
+	CProfileNode *	CurrentChild;
+
+	CProfileIterator( CProfileNode * start );
+	friend	class		CProfileManager;
+};
+
+
+///The Manager for the Profile system
+class	CProfileManager {
+public:
+	static	void						Start_Profile( const char * name );
+	static	void						Stop_Profile( void );
+
+	static	void						CleanupMemory(void)
+	{
+		Root.CleanupMemory();
+	}
+
+	static	void						Reset( void );
+	static	void						Increment_Frame_Counter( void );
+	static	int						Get_Frame_Count_Since_Reset( void )		{ return FrameCounter; }
+	static	float						Get_Time_Since_Reset( void );
+
+	static	CProfileIterator *	Get_Iterator( void )	
+	{ 
+		
+		return new CProfileIterator( &Root ); 
+	}
+	static	void						Release_Iterator( CProfileIterator * iterator ) { delete ( iterator); }
+
+	static void	dumpRecursive(CProfileIterator* profileIterator, int spacing);
+
+	static void	dumpAll();
+
+private:
+	static	CProfileNode			Root;
+	static	CProfileNode *			CurrentNode;
+	static	int						FrameCounter;
+	static	unsigned long int					ResetTime;
+};
+
+
+///ProfileSampleClass is a simple way to profile a function's scope
+///Use the BT_PROFILE macro at the start of scope to time
+class	CProfileSample {
+public:
+	CProfileSample( const char * name )
+	{ 
+		CProfileManager::Start_Profile( name ); 
+	}
+
+	~CProfileSample( void )					
+	{ 
+		CProfileManager::Stop_Profile(); 
+	}
+};
+
+
+#define	BT_PROFILE( name )			CProfileSample __profile( name )
+
+#else
+
+#define	BT_PROFILE( name )
+
+#endif //#ifndef BT_NO_PROFILE
+
+
+
+#endif //BT_QUICK_PROF_H
+
+
diff --git a/hkl3d/bullet/src/LinearMath/btRandom.h b/hkl3d/bullet/src/LinearMath/btRandom.h
new file mode 100644
index 0000000..4cbfc6b
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btRandom.h
@@ -0,0 +1,42 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_GEN_RANDOM_H
+#define BT_GEN_RANDOM_H
+
+#ifdef MT19937
+
+#include <limits.h>
+#include <mt19937.h>
+
+#define GEN_RAND_MAX UINT_MAX
+
+SIMD_FORCE_INLINE void         GEN_srand(unsigned int seed) { init_genrand(seed); }
+SIMD_FORCE_INLINE unsigned int GEN_rand()                   { return genrand_int32(); }
+
+#else
+
+#include <stdlib.h>
+
+#define GEN_RAND_MAX RAND_MAX
+
+SIMD_FORCE_INLINE void         GEN_srand(unsigned int seed) { srand(seed); } 
+SIMD_FORCE_INLINE unsigned int GEN_rand()                   { return rand(); }
+
+#endif
+
+#endif //BT_GEN_RANDOM_H
+
diff --git a/hkl3d/bullet/src/LinearMath/btScalar.h b/hkl3d/bullet/src/LinearMath/btScalar.h
new file mode 100644
index 0000000..d36af1e
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btScalar.h
@@ -0,0 +1,522 @@
+/*
+Copyright (c) 2003-2009 Erwin Coumans  http://bullet.googlecode.com
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_SCALAR_H
+#define BT_SCALAR_H
+
+#ifdef BT_MANAGED_CODE
+//Aligned data types not supported in managed code
+#pragma unmanaged
+#endif
+
+
+#include <math.h>
+#include <stdlib.h>//size_t for MSVC 6.0
+#include <float.h>
+
+/* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/
+#define BT_BULLET_VERSION 278
+
+inline int	btGetVersion()
+{
+	return BT_BULLET_VERSION;
+}
+
+#if defined(DEBUG) || defined (_DEBUG)
+#define BT_DEBUG
+#endif
+
+
+#ifdef _WIN32
+
+		#if defined(__MINGW32__) || defined(__CYGWIN__) || (defined (_MSC_VER) && _MSC_VER < 1300)
+
+			#define SIMD_FORCE_INLINE inline
+			#define ATTRIBUTE_ALIGNED16(a) a
+			#define ATTRIBUTE_ALIGNED64(a) a
+			#define ATTRIBUTE_ALIGNED128(a) a
+		#else
+			//#define BT_HAS_ALIGNED_ALLOCATOR
+			#pragma warning(disable : 4324) // disable padding warning
+//			#pragma warning(disable:4530) // Disable the exception disable but used in MSCV Stl warning.
+//			#pragma warning(disable:4996) //Turn off warnings about deprecated C routines
+//			#pragma warning(disable:4786) // Disable the "debug name too long" warning
+
+			#define SIMD_FORCE_INLINE __forceinline
+			#define ATTRIBUTE_ALIGNED16(a) __declspec(align(16)) a
+			#define ATTRIBUTE_ALIGNED64(a) __declspec(align(64)) a
+			#define ATTRIBUTE_ALIGNED128(a) __declspec (align(128)) a
+		#ifdef _XBOX
+			#define BT_USE_VMX128
+
+			#include <ppcintrinsics.h>
+ 			#define BT_HAVE_NATIVE_FSEL
+ 			#define btFsel(a,b,c) __fsel((a),(b),(c))
+		#else
+
+#if (defined (_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined (BT_USE_DOUBLE_PRECISION))
+			#define BT_USE_SSE
+			#include <emmintrin.h>
+#endif
+
+		#endif//_XBOX
+
+		#endif //__MINGW32__
+
+		#include <assert.h>
+#ifdef BT_DEBUG
+		#define btAssert assert
+#else
+		#define btAssert(x)
+#endif
+		//btFullAssert is optional, slows down a lot
+		#define btFullAssert(x)
+
+		#define btLikely(_c)  _c
+		#define btUnlikely(_c) _c
+
+#else
+	
+#if defined	(__CELLOS_LV2__)
+		#define SIMD_FORCE_INLINE inline __attribute__((always_inline))
+		#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
+		#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
+		#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
+		#ifndef assert
+		#include <assert.h>
+		#endif
+#ifdef BT_DEBUG
+#ifdef __SPU__
+#include <spu_printf.h>
+#define printf spu_printf
+	#define btAssert(x) {if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
+#else
+	#define btAssert assert
+#endif
+	
+#else
+		#define btAssert(x)
+#endif
+		//btFullAssert is optional, slows down a lot
+		#define btFullAssert(x)
+
+		#define btLikely(_c)  _c
+		#define btUnlikely(_c) _c
+
+#else
+
+#ifdef USE_LIBSPE2
+
+		#define SIMD_FORCE_INLINE __inline
+		#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
+		#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
+		#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
+		#ifndef assert
+		#include <assert.h>
+		#endif
+#ifdef BT_DEBUG
+		#define btAssert assert
+#else
+		#define btAssert(x)
+#endif
+		//btFullAssert is optional, slows down a lot
+		#define btFullAssert(x)
+
+
+		#define btLikely(_c)   __builtin_expect((_c), 1)
+		#define btUnlikely(_c) __builtin_expect((_c), 0)
+		
+
+#else
+	//non-windows systems
+
+#if (defined (__APPLE__) && defined (__i386__) && (!defined (BT_USE_DOUBLE_PRECISION)))
+	#define BT_USE_SSE
+	#include <emmintrin.h>
+
+	#define SIMD_FORCE_INLINE inline
+///@todo: check out alignment methods for other platforms/compilers
+	#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
+	#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
+	#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
+	#ifndef assert
+	#include <assert.h>
+	#endif
+
+	#if defined(DEBUG) || defined (_DEBUG)
+		#define btAssert assert
+	#else
+		#define btAssert(x)
+	#endif
+
+	//btFullAssert is optional, slows down a lot
+	#define btFullAssert(x)
+	#define btLikely(_c)  _c
+	#define btUnlikely(_c) _c
+
+#else
+
+		#define SIMD_FORCE_INLINE inline
+		///@todo: check out alignment methods for other platforms/compilers
+		///#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
+		///#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
+		///#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
+		#define ATTRIBUTE_ALIGNED16(a) a
+		#define ATTRIBUTE_ALIGNED64(a) a
+		#define ATTRIBUTE_ALIGNED128(a) a
+		#ifndef assert
+		#include <assert.h>
+		#endif
+
+#if defined(DEBUG) || defined (_DEBUG)
+		#define btAssert assert
+#else
+		#define btAssert(x)
+#endif
+
+		//btFullAssert is optional, slows down a lot
+		#define btFullAssert(x)
+		#define btLikely(_c)  _c
+		#define btUnlikely(_c) _c
+#endif //__APPLE__ 
+
+#endif // LIBSPE2
+
+#endif	//__CELLOS_LV2__
+#endif
+
+
+///The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.
+#if defined(BT_USE_DOUBLE_PRECISION)
+typedef double btScalar;
+//this number could be bigger in double precision
+#define BT_LARGE_FLOAT 1e30
+#else
+typedef float btScalar;
+//keep BT_LARGE_FLOAT*BT_LARGE_FLOAT < FLT_MAX
+#define BT_LARGE_FLOAT 1e18f
+#endif
+
+
+
+#define BT_DECLARE_ALIGNED_ALLOCATOR() \
+   SIMD_FORCE_INLINE void* operator new(size_t sizeInBytes)   { return btAlignedAlloc(sizeInBytes,16); }   \
+   SIMD_FORCE_INLINE void  operator delete(void* ptr)         { btAlignedFree(ptr); }   \
+   SIMD_FORCE_INLINE void* operator new(size_t, void* ptr)   { return ptr; }   \
+   SIMD_FORCE_INLINE void  operator delete(void*, void*)      { }   \
+   SIMD_FORCE_INLINE void* operator new[](size_t sizeInBytes)   { return btAlignedAlloc(sizeInBytes,16); }   \
+   SIMD_FORCE_INLINE void  operator delete[](void* ptr)         { btAlignedFree(ptr); }   \
+   SIMD_FORCE_INLINE void* operator new[](size_t, void* ptr)   { return ptr; }   \
+   SIMD_FORCE_INLINE void  operator delete[](void*, void*)      { }   \
+
+
+
+#if defined(BT_USE_DOUBLE_PRECISION) || defined(BT_FORCE_DOUBLE_FUNCTIONS)
+		
+SIMD_FORCE_INLINE btScalar btSqrt(btScalar x) { return sqrt(x); }
+SIMD_FORCE_INLINE btScalar btFabs(btScalar x) { return fabs(x); }
+SIMD_FORCE_INLINE btScalar btCos(btScalar x) { return cos(x); }
+SIMD_FORCE_INLINE btScalar btSin(btScalar x) { return sin(x); }
+SIMD_FORCE_INLINE btScalar btTan(btScalar x) { return tan(x); }
+SIMD_FORCE_INLINE btScalar btAcos(btScalar x) { if (x<btScalar(-1))	x=btScalar(-1); if (x>btScalar(1))	x=btScalar(1); return acos(x); }
+SIMD_FORCE_INLINE btScalar btAsin(btScalar x) { if (x<btScalar(-1))	x=btScalar(-1); if (x>btScalar(1))	x=btScalar(1); return asin(x); }
+SIMD_FORCE_INLINE btScalar btAtan(btScalar x) { return atan(x); }
+SIMD_FORCE_INLINE btScalar btAtan2(btScalar x, btScalar y) { return atan2(x, y); }
+SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return exp(x); }
+SIMD_FORCE_INLINE btScalar btLog(btScalar x) { return log(x); }
+SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return pow(x,y); }
+SIMD_FORCE_INLINE btScalar btFmod(btScalar x,btScalar y) { return fmod(x,y); }
+
+#else
+		
+SIMD_FORCE_INLINE btScalar btSqrt(btScalar y) 
+{ 
+#ifdef USE_APPROXIMATION
+    double x, z, tempf;
+    unsigned long *tfptr = ((unsigned long *)&tempf) + 1;
+
+	tempf = y;
+	*tfptr = (0xbfcdd90a - *tfptr)>>1; /* estimate of 1/sqrt(y) */
+	x =  tempf;
+	z =  y*btScalar(0.5);
+	x = (btScalar(1.5)*x)-(x*x)*(x*z);         /* iteration formula     */
+	x = (btScalar(1.5)*x)-(x*x)*(x*z);
+	x = (btScalar(1.5)*x)-(x*x)*(x*z);
+	x = (btScalar(1.5)*x)-(x*x)*(x*z);
+	x = (btScalar(1.5)*x)-(x*x)*(x*z);
+	return x*y;
+#else
+	return sqrtf(y); 
+#endif
+}
+SIMD_FORCE_INLINE btScalar btFabs(btScalar x) { return fabsf(x); }
+SIMD_FORCE_INLINE btScalar btCos(btScalar x) { return cosf(x); }
+SIMD_FORCE_INLINE btScalar btSin(btScalar x) { return sinf(x); }
+SIMD_FORCE_INLINE btScalar btTan(btScalar x) { return tanf(x); }
+SIMD_FORCE_INLINE btScalar btAcos(btScalar x) { 
+	if (x<btScalar(-1))	
+		x=btScalar(-1); 
+	if (x>btScalar(1))	
+		x=btScalar(1);
+	return acosf(x); 
+}
+SIMD_FORCE_INLINE btScalar btAsin(btScalar x) { 
+	if (x<btScalar(-1))	
+		x=btScalar(-1); 
+	if (x>btScalar(1))	
+		x=btScalar(1);
+	return asinf(x); 
+}
+SIMD_FORCE_INLINE btScalar btAtan(btScalar x) { return atanf(x); }
+SIMD_FORCE_INLINE btScalar btAtan2(btScalar x, btScalar y) { return atan2f(x, y); }
+SIMD_FORCE_INLINE btScalar btExp(btScalar x) { return expf(x); }
+SIMD_FORCE_INLINE btScalar btLog(btScalar x) { return logf(x); }
+SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); }
+SIMD_FORCE_INLINE btScalar btFmod(btScalar x,btScalar y) { return fmodf(x,y); }
+	
+#endif
+
+#define SIMD_2_PI         btScalar(6.283185307179586232)
+#define SIMD_PI           (SIMD_2_PI * btScalar(0.5))
+#define SIMD_HALF_PI      (SIMD_2_PI * btScalar(0.25))
+#define SIMD_RADS_PER_DEG (SIMD_2_PI / btScalar(360.0))
+#define SIMD_DEGS_PER_RAD  (btScalar(360.0) / SIMD_2_PI)
+#define SIMDSQRT12 btScalar(0.7071067811865475244008443621048490)
+
+#define btRecipSqrt(x) ((btScalar)(btScalar(1.0)/btSqrt(btScalar(x))))		/* reciprocal square root */
+
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define SIMD_EPSILON      DBL_EPSILON
+#define SIMD_INFINITY     DBL_MAX
+#else
+#define SIMD_EPSILON      FLT_EPSILON
+#define SIMD_INFINITY     FLT_MAX
+#endif
+
+SIMD_FORCE_INLINE btScalar btAtan2Fast(btScalar y, btScalar x) 
+{
+	btScalar coeff_1 = SIMD_PI / 4.0f;
+	btScalar coeff_2 = 3.0f * coeff_1;
+	btScalar abs_y = btFabs(y);
+	btScalar angle;
+	if (x >= 0.0f) {
+		btScalar r = (x - abs_y) / (x + abs_y);
+		angle = coeff_1 - coeff_1 * r;
+	} else {
+		btScalar r = (x + abs_y) / (abs_y - x);
+		angle = coeff_2 - coeff_1 * r;
+	}
+	return (y < 0.0f) ? -angle : angle;
+}
+
+SIMD_FORCE_INLINE bool      btFuzzyZero(btScalar x) { return btFabs(x) < SIMD_EPSILON; }
+
+SIMD_FORCE_INLINE bool	btEqual(btScalar a, btScalar eps) {
+	return (((a) <= eps) && !((a) < -eps));
+}
+SIMD_FORCE_INLINE bool	btGreaterEqual (btScalar a, btScalar eps) {
+	return (!((a) <= eps));
+}
+
+
+SIMD_FORCE_INLINE int       btIsNegative(btScalar x) {
+    return x < btScalar(0.0) ? 1 : 0;
+}
+
+SIMD_FORCE_INLINE btScalar btRadians(btScalar x) { return x * SIMD_RADS_PER_DEG; }
+SIMD_FORCE_INLINE btScalar btDegrees(btScalar x) { return x * SIMD_DEGS_PER_RAD; }
+
+#define BT_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name
+
+#ifndef btFsel
+SIMD_FORCE_INLINE btScalar btFsel(btScalar a, btScalar b, btScalar c)
+{
+	return a >= 0 ? b : c;
+}
+#endif
+#define btFsels(a,b,c) (btScalar)btFsel(a,b,c)
+
+
+SIMD_FORCE_INLINE bool btMachineIsLittleEndian()
+{
+   long int i = 1;
+   const char *p = (const char *) &i;
+   if (p[0] == 1)  // Lowest address contains the least significant byte
+	   return true;
+   else
+	   return false;
+}
+
+
+
+///btSelect avoids branches, which makes performance much better for consoles like Playstation 3 and XBox 360
+///Thanks Phil Knight. See also http://www.cellperformance.com/articles/2006/04/more_techniques_for_eliminatin_1.html
+SIMD_FORCE_INLINE unsigned btSelect(unsigned condition, unsigned valueIfConditionNonZero, unsigned valueIfConditionZero) 
+{
+    // Set testNz to 0xFFFFFFFF if condition is nonzero, 0x00000000 if condition is zero
+    // Rely on positive value or'ed with its negative having sign bit on
+    // and zero value or'ed with its negative (which is still zero) having sign bit off 
+    // Use arithmetic shift right, shifting the sign bit through all 32 bits
+    unsigned testNz = (unsigned)(((int)condition | -(int)condition) >> 31);
+    unsigned testEqz = ~testNz;
+    return ((valueIfConditionNonZero & testNz) | (valueIfConditionZero & testEqz)); 
+}
+SIMD_FORCE_INLINE int btSelect(unsigned condition, int valueIfConditionNonZero, int valueIfConditionZero)
+{
+    unsigned testNz = (unsigned)(((int)condition | -(int)condition) >> 31);
+    unsigned testEqz = ~testNz; 
+    return static_cast<int>((valueIfConditionNonZero & testNz) | (valueIfConditionZero & testEqz));
+}
+SIMD_FORCE_INLINE float btSelect(unsigned condition, float valueIfConditionNonZero, float valueIfConditionZero)
+{
+#ifdef BT_HAVE_NATIVE_FSEL
+    return (float)btFsel((btScalar)condition - btScalar(1.0f), valueIfConditionNonZero, valueIfConditionZero);
+#else
+    return (condition != 0) ? valueIfConditionNonZero : valueIfConditionZero; 
+#endif
+}
+
+template<typename T> SIMD_FORCE_INLINE void btSwap(T& a, T& b)
+{
+	T tmp = a;
+	a = b;
+	b = tmp;
+}
+
+
+//PCK: endian swapping functions
+SIMD_FORCE_INLINE unsigned btSwapEndian(unsigned val)
+{
+	return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) | ((val & 0x0000ff00) << 8)  | ((val & 0x000000ff) << 24));
+}
+
+SIMD_FORCE_INLINE unsigned short btSwapEndian(unsigned short val)
+{
+	return static_cast<unsigned short>(((val & 0xff00) >> 8) | ((val & 0x00ff) << 8));
+}
+
+SIMD_FORCE_INLINE unsigned btSwapEndian(int val)
+{
+	return btSwapEndian((unsigned)val);
+}
+
+SIMD_FORCE_INLINE unsigned short btSwapEndian(short val)
+{
+	return btSwapEndian((unsigned short) val);
+}
+
+///btSwapFloat uses using char pointers to swap the endianness
+////btSwapFloat/btSwapDouble will NOT return a float, because the machine might 'correct' invalid floating point values
+///Not all values of sign/exponent/mantissa are valid floating point numbers according to IEEE 754. 
+///When a floating point unit is faced with an invalid value, it may actually change the value, or worse, throw an exception. 
+///In most systems, running user mode code, you wouldn't get an exception, but instead the hardware/os/runtime will 'fix' the number for you. 
+///so instead of returning a float/double, we return integer/long long integer
+SIMD_FORCE_INLINE unsigned int  btSwapEndianFloat(float d)
+{
+    unsigned int a = 0;
+    unsigned char *dst = (unsigned char *)&a;
+    unsigned char *src = (unsigned char *)&d;
+
+    dst[0] = src[3];
+    dst[1] = src[2];
+    dst[2] = src[1];
+    dst[3] = src[0];
+    return a;
+}
+
+// unswap using char pointers
+SIMD_FORCE_INLINE float btUnswapEndianFloat(unsigned int a) 
+{
+    float d = 0.0f;
+    unsigned char *src = (unsigned char *)&a;
+    unsigned char *dst = (unsigned char *)&d;
+
+    dst[0] = src[3];
+    dst[1] = src[2];
+    dst[2] = src[1];
+    dst[3] = src[0];
+
+    return d;
+}
+
+
+// swap using char pointers
+SIMD_FORCE_INLINE void  btSwapEndianDouble(double d, unsigned char* dst)
+{
+    unsigned char *src = (unsigned char *)&d;
+
+    dst[0] = src[7];
+    dst[1] = src[6];
+    dst[2] = src[5];
+    dst[3] = src[4];
+    dst[4] = src[3];
+    dst[5] = src[2];
+    dst[6] = src[1];
+    dst[7] = src[0];
+
+}
+
+// unswap using char pointers
+SIMD_FORCE_INLINE double btUnswapEndianDouble(const unsigned char *src) 
+{
+    double d = 0.0;
+    unsigned char *dst = (unsigned char *)&d;
+
+    dst[0] = src[7];
+    dst[1] = src[6];
+    dst[2] = src[5];
+    dst[3] = src[4];
+    dst[4] = src[3];
+    dst[5] = src[2];
+    dst[6] = src[1];
+    dst[7] = src[0];
+
+	return d;
+}
+
+// returns normalized value in range [-SIMD_PI, SIMD_PI]
+SIMD_FORCE_INLINE btScalar btNormalizeAngle(btScalar angleInRadians) 
+{
+	angleInRadians = btFmod(angleInRadians, SIMD_2_PI);
+	if(angleInRadians < -SIMD_PI)
+	{
+		return angleInRadians + SIMD_2_PI;
+	}
+	else if(angleInRadians > SIMD_PI)
+	{
+		return angleInRadians - SIMD_2_PI;
+	}
+	else
+	{
+		return angleInRadians;
+	}
+}
+
+///rudimentary class to provide type info
+struct btTypedObject
+{
+	btTypedObject(int objectType)
+		:m_objectType(objectType)
+	{
+	}
+	int	m_objectType;
+	inline int getObjectType() const
+	{
+		return m_objectType;
+	}
+};
+#endif //BT_SCALAR_H
diff --git a/hkl3d/bullet/src/LinearMath/btSerializer.cpp b/hkl3d/bullet/src/LinearMath/btSerializer.cpp
new file mode 100644
index 0000000..c6d387e
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btSerializer.cpp
@@ -0,0 +1,832 @@
+unsigned char sBulletDNAstr[]= {
+83,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109,
+95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
+99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
+108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
+115,116,114,97,105,110,116,115,0,42,102,105,114,115,116,0,42,108,97,115,
+116,0,109,95,102,108,111,97,116,115,91,52,93,0,109,95,101,108,91,51,
+93,0,109,95,98,97,115,105,115,0,109,95,111,114,105,103,105,110,0,109,
+95,114,111,111,116,78,111,100,101,73,110,100,101,120,0,109,95,115,117,98,
+116,114,101,101,83,105,122,101,0,109,95,113,117,97,110,116,105,122,101,100,
+65,97,98,98,77,105,110,91,51,93,0,109,95,113,117,97,110,116,105,122,
+101,100,65,97,98,98,77,97,120,91,51,93,0,109,95,97,97,98,98,77,
+105,110,79,114,103,0,109,95,97,97,98,98,77,97,120,79,114,103,0,109,
+95,101,115,99,97,112,101,73,110,100,101,120,0,109,95,115,117,98,80,97,
+114,116,0,109,95,116,114,105,97,110,103,108,101,73,110,100,101,120,0,109,
+95,112,97,100,91,52,93,0,109,95,101,115,99,97,112,101,73,110,100,101,
+120,79,114,84,114,105,97,110,103,108,101,73,110,100,101,120,0,109,95,98,
+118,104,65,97,98,98,77,105,110,0,109,95,98,118,104,65,97,98,98,77,
+97,120,0,109,95,98,118,104,81,117,97,110,116,105,122,97,116,105,111,110,
+0,109,95,99,117,114,78,111,100,101,73,110,100,101,120,0,109,95,117,115,
+101,81,117,97,110,116,105,122,97,116,105,111,110,0,109,95,110,117,109,67,
+111,110,116,105,103,117,111,117,115,76,101,97,102,78,111,100,101,115,0,109,
+95,110,117,109,81,117,97,110,116,105,122,101,100,67,111,110,116,105,103,117,
+111,117,115,78,111,100,101,115,0,42,109,95,99,111,110,116,105,103,117,111,
+117,115,78,111,100,101,115,80,116,114,0,42,109,95,113,117,97,110,116,105,
+122,101,100,67,111,110,116,105,103,117,111,117,115,78,111,100,101,115,80,116,
+114,0,42,109,95,115,117,98,84,114,101,101,73,110,102,111,80,116,114,0,
+109,95,116,114,97,118,101,114,115,97,108,77,111,100,101,0,109,95,110,117,
+109,83,117,98,116,114,101,101,72,101,97,100,101,114,115,0,42,109,95,110,
+97,109,101,0,109,95,115,104,97,112,101,84,121,112,101,0,109,95,112,97,
+100,100,105,110,103,91,52,93,0,109,95,99,111,108,108,105,115,105,111,110,
+83,104,97,112,101,68,97,116,97,0,109,95,108,111,99,97,108,83,99,97,
+108,105,110,103,0,109,95,112,108,97,110,101,78,111,114,109,97,108,0,109,
+95,112,108,97,110,101,67,111,110,115,116,97,110,116,0,109,95,105,109,112,
+108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
+0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
+95,112,97,100,100,105,110,103,0,109,95,112,111,115,0,109,95,114,97,100,
+105,117,115,0,109,95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,
+83,104,97,112,101,68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,
+115,105,116,105,111,110,65,114,114,97,121,80,116,114,0,109,95,108,111,99,
+97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
+109,95,118,97,108,117,101,0,109,95,112,97,100,91,50,93,0,109,95,118,
+97,108,117,101,115,91,51,93,0,109,95,112,97,100,0,42,109,95,118,101,
+114,116,105,99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,
+51,100,0,42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,51,
+105,110,100,105,99,101,115,49,54,0,42,109,95,51,105,110,100,105,99,101,
+115,56,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117,
+109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116,
+105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114,
+0,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,104,
+80,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,99,
+101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,66,
+118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,108,
+101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,111,
+77,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,105,109,
+101,115,104,83,104,97,112,101,68,97,116,97,0,109,95,116,114,97,110,115,
+102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,0,109,
+95,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,99,104,
+105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,83,104,
+97,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,104,97,
+112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,103,115,
+0,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,95,101,
+100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,101,86,
+50,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,98,108,
+101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,95,118,
+97,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,121,65,
+114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,115,105,
+108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,110,0,
+109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,104,111,
+108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,104,114,
+101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,104,114,
+101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,109,95,
+104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,109,86,
+97,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,103,105,
+109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,115,99,
+97,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,
+109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,
+108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,
+111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,
+42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,
+42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,
+95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,
+109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
+110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
+110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
+111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
+110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
+101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
+99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
+114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
+95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
+102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
+111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
+99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
+109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
+0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
+99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
+103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
+109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
+111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
+121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
+116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
+68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
+115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
+111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
+105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
+109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
+118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
+101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
+76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
+95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
+115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
+110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
+109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
+97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
+110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
+83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
+108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
+113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
+97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
+110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
+100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
+104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
+108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,116,114,
+97,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,65,0,
+42,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,101,0,
+109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,112,101,
+0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,100,0,
+109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,97,112,
+112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114,
+97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108,
+105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66,
+111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121,
+112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,
+105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,
+95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,
+0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,
+65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,
+97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,
+111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,
+95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,
+111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,
+105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,
+95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,
+116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,
+97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,
+119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,
+95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,
+108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,
+110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,
+110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,
+115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,
+109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,
+110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,
+68,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,
+91,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,
+110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,
+101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,
+110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,
+101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,
+115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,
+0,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,
+105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,
+111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,
+109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,
+108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,
+110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,
+116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,
+95,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,
+115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,
+101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,
+108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,
+109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,
+100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,
+97,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,
+101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,
+101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,
+110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,
+77,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,
+72,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,
+110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
+67,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,
+99,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,
+105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,
+109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,
+72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,
+108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,
+116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,
+83,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,
+108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,
+95,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,
+108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,
+0,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,
+105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,
+116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,
+102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,
+101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,
+95,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,
+109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,
+116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,
+110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,
+109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,
+109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,
+118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,
+108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,
+95,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,
+100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,
+109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,
+115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,
+115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,
+115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,
+100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,
+95,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,
+0,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,
+109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,
+111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,
+110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,
+100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,
+95,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,
+102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,
+115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,
+80,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,
+121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,
+105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,
+109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,
+109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,
+116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,
+115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,
+110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,
+95,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,
+0,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,
+117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,
+101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,
+110,102,105,103,0,0,0,0,84,89,80,69,72,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,80,111,105,110,116,101,114,
+65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,
+109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,
+70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,
+111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,
+51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,
+120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,
+102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,
+115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,
+104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,
+112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,
+68,97,116,97,0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,
+111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,
+116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,
+117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,
+0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,
+101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
+112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,
+83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,
+116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,
+115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,
+108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,
+116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
+116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
+116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,
+0,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,
+97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,
+116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,
+99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,
+104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,
+101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,
+100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,
+116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,
+105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,
+97,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,
+97,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,
+112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,
+111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,
+104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,
+108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,
+111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,
+116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,
+116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,
+97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,
+117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,
+116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,
+97,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
+68,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,
+110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,
+80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,
+116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,
+111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,
+98,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,
+97,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,
+110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,
+105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,
+0,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,
+67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,
+100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,
+102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,
+111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,
+66,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,
+121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,
+116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,
+104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,
+105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,
+97,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,
+97,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,
+97,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,
+97,116,97,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,12,0,36,0,8,0,16,0,32,0,48,0,
+96,0,64,0,-128,0,20,0,48,0,80,0,16,0,84,0,-124,0,12,0,
+52,0,52,0,20,0,64,0,4,0,4,0,8,0,4,0,32,0,28,0,
+60,0,56,0,76,0,76,0,24,0,60,0,60,0,16,0,64,0,68,0,
+-56,1,-8,0,-32,1,-104,3,8,0,44,0,0,0,76,0,108,0,84,1,
+-44,0,-52,0,-12,0,84,1,-60,0,16,0,100,0,20,0,36,0,100,0,
+92,0,104,0,-64,0,92,1,104,0,-92,1,83,84,82,67,61,0,0,0,
+10,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,
+10,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,
+9,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,
+15,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,
+15,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,
+19,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,
+20,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,
+4,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,
+4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,
+2,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,
+13,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
+4,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,
+4,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,
+4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,
+22,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,
+0,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,
+13,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,
+25,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,
+28,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,
+28,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,
+31,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,
+0,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,
+13,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,
+31,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,
+13,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,
+35,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,
+0,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,
+17,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,
+25,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,
+27,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,
+4,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,
+7,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,
+43,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,
+7,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,
+4,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,
+13,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,
+13,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,
+9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,
+18,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,
+8,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,
+8,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
+4,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,
+9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,
+17,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,
+7,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,
+7,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
+4,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,
+15,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,
+13,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,
+7,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,
+7,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,
+49,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,
+14,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,
+14,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,
+8,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,
+8,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,
+4,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0,
+4,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,
+7,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0,
+13,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0,
+14,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0,
+4,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,
+7,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,
+56,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0,
+4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,
+7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0,
+51,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0,
+7,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0,
+0,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,
+13,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0,
+4,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0,
+7,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0,
+17,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0,
+4,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0,
+7,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0,
+13,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0,
+7,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0,
+4,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0,
+61,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0,
+61,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0,
+4,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0,
+52,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0,
+7,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0,
+7,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,
+7,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,
+7,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,
+4,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0,
+68,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0,
+13,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0,
+4,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0,
+15,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0,
+13,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0,
+4,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1,
+4,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1,
+7,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1,
+4,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1,
+7,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1,
+4,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0,
+47,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1,
+64,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1,
+4,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1,
+4,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,};
+int sBulletDNAlen= sizeof(sBulletDNAstr);
+unsigned char sBulletDNAstr64[]= {
+83,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109,
+95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
+99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
+108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
+115,116,114,97,105,110,116,115,0,42,102,105,114,115,116,0,42,108,97,115,
+116,0,109,95,102,108,111,97,116,115,91,52,93,0,109,95,101,108,91,51,
+93,0,109,95,98,97,115,105,115,0,109,95,111,114,105,103,105,110,0,109,
+95,114,111,111,116,78,111,100,101,73,110,100,101,120,0,109,95,115,117,98,
+116,114,101,101,83,105,122,101,0,109,95,113,117,97,110,116,105,122,101,100,
+65,97,98,98,77,105,110,91,51,93,0,109,95,113,117,97,110,116,105,122,
+101,100,65,97,98,98,77,97,120,91,51,93,0,109,95,97,97,98,98,77,
+105,110,79,114,103,0,109,95,97,97,98,98,77,97,120,79,114,103,0,109,
+95,101,115,99,97,112,101,73,110,100,101,120,0,109,95,115,117,98,80,97,
+114,116,0,109,95,116,114,105,97,110,103,108,101,73,110,100,101,120,0,109,
+95,112,97,100,91,52,93,0,109,95,101,115,99,97,112,101,73,110,100,101,
+120,79,114,84,114,105,97,110,103,108,101,73,110,100,101,120,0,109,95,98,
+118,104,65,97,98,98,77,105,110,0,109,95,98,118,104,65,97,98,98,77,
+97,120,0,109,95,98,118,104,81,117,97,110,116,105,122,97,116,105,111,110,
+0,109,95,99,117,114,78,111,100,101,73,110,100,101,120,0,109,95,117,115,
+101,81,117,97,110,116,105,122,97,116,105,111,110,0,109,95,110,117,109,67,
+111,110,116,105,103,117,111,117,115,76,101,97,102,78,111,100,101,115,0,109,
+95,110,117,109,81,117,97,110,116,105,122,101,100,67,111,110,116,105,103,117,
+111,117,115,78,111,100,101,115,0,42,109,95,99,111,110,116,105,103,117,111,
+117,115,78,111,100,101,115,80,116,114,0,42,109,95,113,117,97,110,116,105,
+122,101,100,67,111,110,116,105,103,117,111,117,115,78,111,100,101,115,80,116,
+114,0,42,109,95,115,117,98,84,114,101,101,73,110,102,111,80,116,114,0,
+109,95,116,114,97,118,101,114,115,97,108,77,111,100,101,0,109,95,110,117,
+109,83,117,98,116,114,101,101,72,101,97,100,101,114,115,0,42,109,95,110,
+97,109,101,0,109,95,115,104,97,112,101,84,121,112,101,0,109,95,112,97,
+100,100,105,110,103,91,52,93,0,109,95,99,111,108,108,105,115,105,111,110,
+83,104,97,112,101,68,97,116,97,0,109,95,108,111,99,97,108,83,99,97,
+108,105,110,103,0,109,95,112,108,97,110,101,78,111,114,109,97,108,0,109,
+95,112,108,97,110,101,67,111,110,115,116,97,110,116,0,109,95,105,109,112,
+108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
+0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
+95,112,97,100,100,105,110,103,0,109,95,112,111,115,0,109,95,114,97,100,
+105,117,115,0,109,95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,
+83,104,97,112,101,68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,
+115,105,116,105,111,110,65,114,114,97,121,80,116,114,0,109,95,108,111,99,
+97,108,80,111,115,105,116,105,111,110,65,114,114,97,121,83,105,122,101,0,
+109,95,118,97,108,117,101,0,109,95,112,97,100,91,50,93,0,109,95,118,
+97,108,117,101,115,91,51,93,0,109,95,112,97,100,0,42,109,95,118,101,
+114,116,105,99,101,115,51,102,0,42,109,95,118,101,114,116,105,99,101,115,
+51,100,0,42,109,95,105,110,100,105,99,101,115,51,50,0,42,109,95,51,
+105,110,100,105,99,101,115,49,54,0,42,109,95,51,105,110,100,105,99,101,
+115,56,0,42,109,95,105,110,100,105,99,101,115,49,54,0,109,95,110,117,
+109,84,114,105,97,110,103,108,101,115,0,109,95,110,117,109,86,101,114,116,
+105,99,101,115,0,42,109,95,109,101,115,104,80,97,114,116,115,80,116,114,
+0,109,95,115,99,97,108,105,110,103,0,109,95,110,117,109,77,101,115,104,
+80,97,114,116,115,0,109,95,109,101,115,104,73,110,116,101,114,102,97,99,
+101,0,42,109,95,113,117,97,110,116,105,122,101,100,70,108,111,97,116,66,
+118,104,0,42,109,95,113,117,97,110,116,105,122,101,100,68,111,117,98,108,
+101,66,118,104,0,42,109,95,116,114,105,97,110,103,108,101,73,110,102,111,
+77,97,112,0,109,95,112,97,100,51,91,52,93,0,109,95,116,114,105,109,
+101,115,104,83,104,97,112,101,68,97,116,97,0,109,95,116,114,97,110,115,
+102,111,114,109,0,42,109,95,99,104,105,108,100,83,104,97,112,101,0,109,
+95,99,104,105,108,100,83,104,97,112,101,84,121,112,101,0,109,95,99,104,
+105,108,100,77,97,114,103,105,110,0,42,109,95,99,104,105,108,100,83,104,
+97,112,101,80,116,114,0,109,95,110,117,109,67,104,105,108,100,83,104,97,
+112,101,115,0,109,95,117,112,65,120,105,115,0,109,95,102,108,97,103,115,
+0,109,95,101,100,103,101,86,48,86,49,65,110,103,108,101,0,109,95,101,
+100,103,101,86,49,86,50,65,110,103,108,101,0,109,95,101,100,103,101,86,
+50,86,48,65,110,103,108,101,0,42,109,95,104,97,115,104,84,97,98,108,
+101,80,116,114,0,42,109,95,110,101,120,116,80,116,114,0,42,109,95,118,
+97,108,117,101,65,114,114,97,121,80,116,114,0,42,109,95,107,101,121,65,
+114,114,97,121,80,116,114,0,109,95,99,111,110,118,101,120,69,112,115,105,
+108,111,110,0,109,95,112,108,97,110,97,114,69,112,115,105,108,111,110,0,
+109,95,101,113,117,97,108,86,101,114,116,101,120,84,104,114,101,115,104,111,
+108,100,0,109,95,101,100,103,101,68,105,115,116,97,110,99,101,84,104,114,
+101,115,104,111,108,100,0,109,95,122,101,114,111,65,114,101,97,84,104,114,
+101,115,104,111,108,100,0,109,95,110,101,120,116,83,105,122,101,0,109,95,
+104,97,115,104,84,97,98,108,101,83,105,122,101,0,109,95,110,117,109,86,
+97,108,117,101,115,0,109,95,110,117,109,75,101,121,115,0,109,95,103,105,
+109,112,97,99,116,83,117,98,84,121,112,101,0,42,109,95,117,110,115,99,
+97,108,101,100,80,111,105,110,116,115,70,108,111,97,116,80,116,114,0,42,
+109,95,117,110,115,99,97,108,101,100,80,111,105,110,116,115,68,111,117,98,
+108,101,80,116,114,0,109,95,110,117,109,85,110,115,99,97,108,101,100,80,
+111,105,110,116,115,0,109,95,112,97,100,100,105,110,103,51,91,52,93,0,
+42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,108,101,0,
+42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,0,42,109,
+95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,0,
+109,95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,
+110,116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,
+110,115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,
+111,110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,
+110,116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,
+101,108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,
+99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,97,99,116,80,
+114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,108,100,0,109,
+95,100,101,97,99,116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,
+102,114,105,99,116,105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,
+111,110,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,109,95,99,
+99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,117,115,0,
+109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,111,108,100,
+0,109,95,104,97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,
+99,116,105,111,110,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,
+103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,
+109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,
+111,110,83,116,97,116,101,49,0,109,95,105,110,116,101,114,110,97,108,84,
+121,112,101,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
+116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
+68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
+115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
+111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
+105,116,121,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,114,0,
+109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,114,97,
+118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,101,108,
+101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,105,97,
+76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,0,109,
+95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,105,110,118,101,114,
+115,101,77,97,115,115,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
+110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
+109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
+97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
+110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
+83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
+108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
+113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
+97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
+110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
+100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
+104,114,101,115,104,111,108,100,0,109,95,97,100,100,105,116,105,111,110,97,
+108,68,97,109,112,105,110,103,0,109,95,110,117,109,67,111,110,115,116,114,
+97,105,110,116,82,111,119,115,0,110,117,98,0,42,109,95,114,98,65,0,
+42,109,95,114,98,66,0,109,95,111,98,106,101,99,116,84,121,112,101,0,
+109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,84,121,112,101,
+0,109,95,117,115,101,114,67,111,110,115,116,114,97,105,110,116,73,100,0,
+109,95,110,101,101,100,115,70,101,101,100,98,97,99,107,0,109,95,97,112,
+112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114,
+97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108,
+105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66,
+111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121,
+112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,
+105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,
+95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,
+0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,
+65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,
+97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,
+111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,
+95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,
+111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,
+105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,
+95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,
+116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,
+97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,
+119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,
+95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,
+108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,
+110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,
+110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,
+115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,
+109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,
+110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,
+68,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,
+91,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,
+110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,
+101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,
+110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,
+101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,
+115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,
+0,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,
+105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,
+111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,
+109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,
+108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,
+110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,
+116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,
+95,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,
+115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,
+101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,
+108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,
+109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,
+100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,
+97,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,
+101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,
+101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,
+110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,
+77,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,
+72,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,
+110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
+67,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,
+99,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,
+105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,
+109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,
+72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,
+108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,
+116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,
+83,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,
+108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,
+95,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,
+108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,
+0,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,
+105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,
+116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,
+102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,
+101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,
+95,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,
+109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,
+116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,
+110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,
+109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,
+109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,
+118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,
+108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,
+95,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,
+100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,
+109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,
+115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,
+115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,
+115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,
+100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,
+95,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,
+0,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,
+109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,
+111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,
+110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,
+100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,
+95,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,
+102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,
+115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,
+80,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,
+121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,
+105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,
+109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,
+109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,
+116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,
+115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,
+110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,
+95,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,
+0,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,
+117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,
+101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,
+110,102,105,103,0,0,0,0,84,89,80,69,72,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,80,111,105,110,116,101,114,
+65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,
+109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,
+70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,
+111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,
+51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,
+120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,
+102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,
+115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,
+104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,
+112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,
+68,97,116,97,0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,
+111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,
+116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,
+117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,
+0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,
+101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
+112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,
+83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,
+116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,
+115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,
+108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,
+116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
+116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
+116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,
+0,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,
+97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,
+116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,
+99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,
+104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,
+101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,
+100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,
+116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,
+105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,
+97,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,
+97,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,
+112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,
+111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,
+104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,
+108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,
+111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,
+116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,
+116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,
+97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,
+117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,
+116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,
+97,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
+68,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,
+110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,
+80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,
+116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,
+111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,
+98,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,
+97,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,
+110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,
+105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,
+0,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,
+67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,
+100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,
+102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,
+111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,
+66,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,
+121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,
+116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,
+104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,
+105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,
+97,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,
+97,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,
+97,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,
+97,116,97,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,48,0,16,0,16,0,32,0,48,0,
+96,0,64,0,-128,0,20,0,48,0,80,0,16,0,96,0,-112,0,16,0,
+56,0,56,0,20,0,72,0,4,0,4,0,8,0,4,0,56,0,32,0,
+80,0,72,0,96,0,80,0,32,0,64,0,64,0,16,0,72,0,80,0,
+-40,1,8,1,-16,1,-88,3,8,0,56,0,0,0,88,0,120,0,96,1,
+-32,0,-40,0,0,1,96,1,-48,0,16,0,104,0,24,0,40,0,104,0,
+96,0,104,0,-56,0,104,1,112,0,-40,1,83,84,82,67,61,0,0,0,
+10,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,
+10,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,
+9,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,
+15,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,
+15,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,
+19,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,
+20,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,
+4,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,
+4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,
+2,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,
+13,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
+4,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,
+4,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,
+4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,
+22,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,
+0,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,
+13,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,
+25,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,
+28,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,
+28,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,
+31,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,
+0,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,
+13,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,
+31,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,
+13,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,
+35,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,
+0,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,
+17,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,
+25,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,
+27,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,
+4,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,
+7,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,
+43,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,
+7,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,
+4,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,
+13,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,
+13,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,
+9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,
+18,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,
+8,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,
+8,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
+4,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,
+9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,
+17,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,
+7,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,
+7,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
+4,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,
+15,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,
+13,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,
+7,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,
+7,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,
+49,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,
+14,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,
+14,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,
+8,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,
+8,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,
+4,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0,
+4,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,
+7,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0,
+13,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0,
+14,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0,
+4,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,
+7,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,
+56,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0,
+4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,
+7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0,
+51,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0,
+7,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0,
+0,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,
+13,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0,
+4,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0,
+7,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0,
+17,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0,
+4,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0,
+7,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0,
+13,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0,
+7,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0,
+4,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0,
+61,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0,
+61,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0,
+4,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0,
+52,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0,
+7,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0,
+7,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,
+7,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,
+7,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,
+4,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0,
+68,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0,
+13,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0,
+4,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0,
+15,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0,
+13,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0,
+4,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1,
+4,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1,
+7,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1,
+4,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1,
+7,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1,
+4,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0,
+47,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1,
+64,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1,
+4,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1,
+4,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,};
+int sBulletDNAlen64= sizeof(sBulletDNAstr64);
diff --git a/hkl3d/bullet/src/LinearMath/btSerializer.h b/hkl3d/bullet/src/LinearMath/btSerializer.h
new file mode 100644
index 0000000..8a89374
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btSerializer.h
@@ -0,0 +1,655 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_SERIALIZER_H
+#define BT_SERIALIZER_H
+
+#include "btScalar.h" // has definitions like SIMD_FORCE_INLINE
+#include "btStackAlloc.h"
+#include "btHashMap.h"
+
+#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)
+#include <memory.h>
+#endif
+#include <string.h>
+
+
+
+///only the 32bit versions for now
+extern unsigned char sBulletDNAstr[];
+extern int sBulletDNAlen;
+extern unsigned char sBulletDNAstr64[];
+extern int sBulletDNAlen64;
+
+SIMD_FORCE_INLINE	int btStrLen(const char* str) 
+{
+    if (!str) 
+		return(0);
+	int len = 0;
+    
+	while (*str != 0)
+	{
+        str++;
+        len++;
+    }
+
+    return len;
+}
+
+
+class btChunk
+{
+public:
+	int		m_chunkCode;
+	int		m_length;
+	void	*m_oldPtr;
+	int		m_dna_nr;
+	int		m_number;
+};
+
+enum	btSerializationFlags
+{
+	BT_SERIALIZE_NO_BVH = 1,
+	BT_SERIALIZE_NO_TRIANGLEINFOMAP = 2,
+	BT_SERIALIZE_NO_DUPLICATE_ASSERT = 4
+};
+
+class	btSerializer
+{
+
+public:
+
+	virtual ~btSerializer() {}
+
+	virtual	const unsigned char*		getBufferPointer() const = 0;
+
+	virtual	int		getCurrentBufferSize() const = 0;
+
+	virtual	btChunk*	allocate(size_t size, int numElements) = 0;
+
+	virtual	void	finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr)= 0;
+
+	virtual	 void*	findPointer(void* oldPtr)  = 0;
+
+	virtual	void*	getUniquePointer(void*oldPtr) = 0;
+
+	virtual	void	startSerialization() = 0;
+	
+	virtual	void	finishSerialization() = 0;
+
+	virtual	const char*	findNameForPointer(const void* ptr) const = 0;
+
+	virtual	void	registerNameForPointer(const void* ptr, const char* name) = 0;
+
+	virtual void	serializeName(const char* ptr) = 0;
+
+	virtual int		getSerializationFlags() const = 0;
+
+	virtual void	setSerializationFlags(int flags) = 0;
+
+
+};
+
+
+
+#define BT_HEADER_LENGTH 12
+#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
+#	define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) )
+#else
+#	define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) )
+#endif
+
+#define BT_SOFTBODY_CODE		MAKE_ID('S','B','D','Y')
+#define BT_COLLISIONOBJECT_CODE MAKE_ID('C','O','B','J')
+#define BT_RIGIDBODY_CODE		MAKE_ID('R','B','D','Y')
+#define BT_CONSTRAINT_CODE		MAKE_ID('C','O','N','S')
+#define BT_BOXSHAPE_CODE		MAKE_ID('B','O','X','S')
+#define BT_QUANTIZED_BVH_CODE	MAKE_ID('Q','B','V','H')
+#define BT_TRIANLGE_INFO_MAP	MAKE_ID('T','M','A','P')
+#define BT_SHAPE_CODE			MAKE_ID('S','H','A','P')
+#define BT_ARRAY_CODE			MAKE_ID('A','R','A','Y')
+#define BT_SBMATERIAL_CODE		MAKE_ID('S','B','M','T')
+#define BT_SBNODE_CODE			MAKE_ID('S','B','N','D')
+#define BT_DNA_CODE				MAKE_ID('D','N','A','1')
+
+
+struct	btPointerUid
+{
+	union
+	{
+		void*	m_ptr;
+		int		m_uniqueIds[2];
+	};
+};
+
+///The btDefaultSerializer is the main Bullet serialization class.
+///The constructor takes an optional argument for backwards compatibility, it is recommended to leave this empty/zero.
+class btDefaultSerializer	:	public btSerializer
+{
+
+
+	btAlignedObjectArray<char*>			mTypes;
+	btAlignedObjectArray<short*>			mStructs;
+	btAlignedObjectArray<short>			mTlens;
+	btHashMap<btHashInt, int>			mStructReverse;
+	btHashMap<btHashString,int>	mTypeLookup;
+
+	
+	btHashMap<btHashPtr,void*>	m_chunkP;
+	
+	btHashMap<btHashPtr,const char*>	m_nameMap;
+
+	btHashMap<btHashPtr,btPointerUid>	m_uniquePointers;
+	int	m_uniqueIdGenerator;
+
+	int					m_totalSize;
+	unsigned char*		m_buffer;
+	int					m_currentSize;
+	void*				m_dna;
+	int					m_dnaLength;
+
+	int					m_serializationFlags;
+
+
+	btAlignedObjectArray<btChunk*>	m_chunkPtrs;
+	
+protected:
+
+	virtual	void*	findPointer(void* oldPtr) 
+	{
+		void** ptr = m_chunkP.find(oldPtr);
+		if (ptr && *ptr)
+			return *ptr;
+		return 0;
+	}
+
+	
+
+
+
+		void	writeDNA()
+		{
+			btChunk* dnaChunk = allocate(m_dnaLength,1);
+			memcpy(dnaChunk->m_oldPtr,m_dna,m_dnaLength);
+			finalizeChunk(dnaChunk,"DNA1",BT_DNA_CODE, m_dna);
+		}
+
+		int getReverseType(const char *type) const
+		{
+
+			btHashString key(type);
+			const int* valuePtr = mTypeLookup.find(key);
+			if (valuePtr)
+				return *valuePtr;
+			
+			return -1;
+		}
+
+		void initDNA(const char* bdnaOrg,int dnalen)
+		{
+			///was already initialized
+			if (m_dna)
+				return;
+
+			int littleEndian= 1;
+			littleEndian= ((char*)&littleEndian)[0];
+			
+
+			m_dna = btAlignedAlloc(dnalen,16);
+			memcpy(m_dna,bdnaOrg,dnalen);
+			m_dnaLength = dnalen;
+
+			int *intPtr=0;
+			short *shtPtr=0;
+			char *cp = 0;int dataLen =0;long nr=0;
+			intPtr = (int*)m_dna;
+
+			/*
+				SDNA (4 bytes) (magic number)
+				NAME (4 bytes)
+				<nr> (4 bytes) amount of names (int)
+				<string>
+				<string>
+			*/
+
+			if (strncmp((const char*)m_dna, "SDNA", 4)==0)
+			{
+				// skip ++ NAME
+				intPtr++; intPtr++;
+			}
+
+			// Parse names
+			if (!littleEndian)
+				*intPtr = btSwapEndian(*intPtr);
+				
+			dataLen = *intPtr;
+			
+			intPtr++;
+
+			cp = (char*)intPtr;
+			int i;
+			for ( i=0; i<dataLen; i++)
+			{
+				
+				while (*cp)cp++;
+				cp++;
+			}
+			{
+				nr= (long)cp;
+			//	long mask=3;
+				nr= ((nr+3)&~3)-nr;
+				while (nr--)
+				{
+					cp++;
+				}
+			}
+
+			/*
+				TYPE (4 bytes)
+				<nr> amount of types (int)
+				<string>
+				<string>
+			*/
+
+			intPtr = (int*)cp;
+			assert(strncmp(cp, "TYPE", 4)==0); intPtr++;
+
+			if (!littleEndian)
+				*intPtr =  btSwapEndian(*intPtr);
+			
+			dataLen = *intPtr;
+			intPtr++;
+
+			
+			cp = (char*)intPtr;
+			for (i=0; i<dataLen; i++)
+			{
+				mTypes.push_back(cp);
+				while (*cp)cp++;
+				cp++;
+			}
+
+		{
+				nr= (long)cp;
+			//	long mask=3;
+				nr= ((nr+3)&~3)-nr;
+				while (nr--)
+				{
+					cp++;
+				}
+			}
+
+
+			/*
+				TLEN (4 bytes)
+				<len> (short) the lengths of types
+				<len>
+			*/
+
+			// Parse type lens
+			intPtr = (int*)cp;
+			assert(strncmp(cp, "TLEN", 4)==0); intPtr++;
+
+			dataLen = (int)mTypes.size();
+
+			shtPtr = (short*)intPtr;
+			for (i=0; i<dataLen; i++, shtPtr++)
+			{
+				if (!littleEndian)
+					shtPtr[0] = btSwapEndian(shtPtr[0]);
+				mTlens.push_back(shtPtr[0]);
+			}
+
+			if (dataLen & 1) shtPtr++;
+
+			/*
+				STRC (4 bytes)
+				<nr> amount of structs (int)
+				<typenr>
+				<nr_of_elems>
+				<typenr>
+				<namenr>
+				<typenr>
+				<namenr>
+			*/
+
+			intPtr = (int*)shtPtr;
+			cp = (char*)intPtr;
+			assert(strncmp(cp, "STRC", 4)==0); intPtr++;
+
+			if (!littleEndian)
+				*intPtr = btSwapEndian(*intPtr);
+			dataLen = *intPtr ; 
+			intPtr++;
+
+
+			shtPtr = (short*)intPtr;
+			for (i=0; i<dataLen; i++)
+			{
+				mStructs.push_back (shtPtr);
+				
+				if (!littleEndian)
+				{
+					shtPtr[0]= btSwapEndian(shtPtr[0]);
+					shtPtr[1]= btSwapEndian(shtPtr[1]);
+
+					int len = shtPtr[1];
+					shtPtr+= 2;
+
+					for (int a=0; a<len; a++, shtPtr+=2)
+					{
+							shtPtr[0]= btSwapEndian(shtPtr[0]);
+							shtPtr[1]= btSwapEndian(shtPtr[1]);
+					}
+
+				} else
+				{
+					shtPtr+= (2*shtPtr[1])+2;
+				}
+			}
+
+			// build reverse lookups
+			for (i=0; i<(int)mStructs.size(); i++)
+			{
+				short *strc = mStructs.at(i);
+				mStructReverse.insert(strc[0], i);
+				mTypeLookup.insert(btHashString(mTypes[strc[0]]),i);
+			}
+		}
+
+public:	
+	
+
+	
+
+		btDefaultSerializer(int totalSize=0)
+			:m_totalSize(totalSize),
+			m_currentSize(0),
+			m_dna(0),
+			m_dnaLength(0),
+			m_serializationFlags(0)
+		{
+			m_buffer = m_totalSize?(unsigned char*)btAlignedAlloc(totalSize,16):0;
+			
+			const bool VOID_IS_8 = ((sizeof(void*)==8));
+
+#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+			if (VOID_IS_8)
+			{
+#if _WIN64
+				initDNA((const char*)sBulletDNAstr64,sBulletDNAlen64);
+#else
+				btAssert(0);
+#endif
+			} else
+			{
+#ifndef _WIN64
+				initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
+#else
+				btAssert(0);
+#endif
+			}
+	
+#else //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+			if (VOID_IS_8)
+			{
+				initDNA((const char*)sBulletDNAstr64,sBulletDNAlen64);
+			} else
+			{
+				initDNA((const char*)sBulletDNAstr,sBulletDNAlen);
+			}
+#endif //BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
+	
+		}
+
+		virtual ~btDefaultSerializer() 
+		{
+			if (m_buffer)
+				btAlignedFree(m_buffer);
+			if (m_dna)
+				btAlignedFree(m_dna);
+		}
+
+		void	writeHeader(unsigned char* buffer) const
+		{
+			
+
+#ifdef  BT_USE_DOUBLE_PRECISION
+			memcpy(buffer, "BULLETd", 7);
+#else
+			memcpy(buffer, "BULLETf", 7);
+#endif //BT_USE_DOUBLE_PRECISION
+	
+			int littleEndian= 1;
+			littleEndian= ((char*)&littleEndian)[0];
+
+			if (sizeof(void*)==8)
+			{
+				buffer[7] = '-';
+			} else
+			{
+				buffer[7] = '_';
+			}
+
+			if (littleEndian)
+			{
+				buffer[8]='v';				
+			} else
+			{
+				buffer[8]='V';
+			}
+
+
+			buffer[9] = '2';
+			buffer[10] = '7';
+			buffer[11] = '8';
+
+		}
+
+		virtual	void	startSerialization()
+		{
+			m_uniqueIdGenerator= 1;
+			if (m_totalSize)
+			{
+				unsigned char* buffer = internalAlloc(BT_HEADER_LENGTH);
+				writeHeader(buffer);
+			}
+			
+		}
+
+		virtual	void	finishSerialization()
+		{
+			writeDNA();
+
+			//if we didn't pre-allocate a buffer, we need to create a contiguous buffer now
+			int mysize = 0;
+			if (!m_totalSize)
+			{
+				if (m_buffer)
+					btAlignedFree(m_buffer);
+
+				m_currentSize += BT_HEADER_LENGTH;
+				m_buffer = (unsigned char*)btAlignedAlloc(m_currentSize,16);
+
+				unsigned char* currentPtr = m_buffer;
+				writeHeader(m_buffer);
+				currentPtr += BT_HEADER_LENGTH;
+				mysize+=BT_HEADER_LENGTH;
+				for (int i=0;i<	m_chunkPtrs.size();i++)
+				{
+					int curLength = sizeof(btChunk)+m_chunkPtrs[i]->m_length;
+					memcpy(currentPtr,m_chunkPtrs[i], curLength);
+					btAlignedFree(m_chunkPtrs[i]);
+					currentPtr+=curLength;
+					mysize+=curLength;
+				}
+			}
+
+			mTypes.clear();
+			mStructs.clear();
+			mTlens.clear();
+			mStructReverse.clear();
+			mTypeLookup.clear();
+			m_chunkP.clear();
+			m_nameMap.clear();
+			m_uniquePointers.clear();
+			m_chunkPtrs.clear();
+		}
+
+		virtual	void*	getUniquePointer(void*oldPtr)
+		{
+			if (!oldPtr)
+				return 0;
+
+			btPointerUid* uptr = (btPointerUid*)m_uniquePointers.find(oldPtr);
+			if (uptr)
+			{
+				return uptr->m_ptr;
+			}
+			m_uniqueIdGenerator++;
+			
+			btPointerUid uid;
+			uid.m_uniqueIds[0] = m_uniqueIdGenerator;
+			uid.m_uniqueIds[1] = m_uniqueIdGenerator;
+			m_uniquePointers.insert(oldPtr,uid);
+			return uid.m_ptr;
+
+		}
+
+		virtual	const unsigned char*		getBufferPointer() const
+		{
+			return m_buffer;
+		}
+
+		virtual	int					getCurrentBufferSize() const
+		{
+			return	m_currentSize;
+		}
+
+		virtual	void	finalizeChunk(btChunk* chunk, const char* structType, int chunkCode,void* oldPtr)
+		{
+			if (!(m_serializationFlags&BT_SERIALIZE_NO_DUPLICATE_ASSERT))
+			{
+				btAssert(!findPointer(oldPtr));
+			}
+
+			chunk->m_dna_nr = getReverseType(structType);
+			
+			chunk->m_chunkCode = chunkCode;
+			
+			void* uniquePtr = getUniquePointer(oldPtr);
+			
+			m_chunkP.insert(oldPtr,uniquePtr);//chunk->m_oldPtr);
+			chunk->m_oldPtr = uniquePtr;//oldPtr;
+			
+		}
+
+		
+		virtual unsigned char* internalAlloc(size_t size)
+		{
+			unsigned char* ptr = 0;
+
+			if (m_totalSize)
+			{
+				ptr = m_buffer+m_currentSize;
+				m_currentSize += int(size);
+				btAssert(m_currentSize<m_totalSize);
+			} else
+			{
+				ptr = (unsigned char*)btAlignedAlloc(size,16);
+				m_currentSize += int(size);
+			}
+			return ptr;
+		}
+
+		
+
+		virtual	btChunk*	allocate(size_t size, int numElements)
+		{
+
+			unsigned char* ptr = internalAlloc(int(size)*numElements+sizeof(btChunk));
+
+			unsigned char* data = ptr + sizeof(btChunk);
+			
+			btChunk* chunk = (btChunk*)ptr;
+			chunk->m_chunkCode = 0;
+			chunk->m_oldPtr = data;
+			chunk->m_length = int(size)*numElements;
+			chunk->m_number = numElements;
+			
+			m_chunkPtrs.push_back(chunk);
+			
+
+			return chunk;
+		}
+
+		virtual	const char*	findNameForPointer(const void* ptr) const
+		{
+			const char*const * namePtr = m_nameMap.find(ptr);
+			if (namePtr && *namePtr)
+				return *namePtr;
+			return 0;
+
+		}
+
+		virtual	void	registerNameForPointer(const void* ptr, const char* name)
+		{
+			m_nameMap.insert(ptr,name);
+		}
+
+		virtual void	serializeName(const char* name)
+		{
+			if (name)
+			{
+				//don't serialize name twice
+				if (findPointer((void*)name))
+					return;
+
+				int len = btStrLen(name);
+				if (len)
+				{
+
+					int newLen = len+1;
+					int padding = ((newLen+3)&~3)-newLen;
+					newLen += padding;
+
+					//serialize name string now
+					btChunk* chunk = allocate(sizeof(char),newLen);
+					char* destinationName = (char*)chunk->m_oldPtr;
+					for (int i=0;i<len;i++)
+					{
+						destinationName[i] = name[i];
+					}
+					destinationName[len] = 0;
+					finalizeChunk(chunk,"char",BT_ARRAY_CODE,(void*)name);
+				}
+			}
+		}
+
+		virtual int		getSerializationFlags() const
+		{
+			return m_serializationFlags;
+		}
+
+		virtual void	setSerializationFlags(int flags)
+		{
+			m_serializationFlags = flags;
+		}
+
+};
+
+
+#endif //BT_SERIALIZER_H
+
diff --git a/hkl3d/bullet/src/LinearMath/btStackAlloc.h b/hkl3d/bullet/src/LinearMath/btStackAlloc.h
new file mode 100644
index 0000000..397b084
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btStackAlloc.h
@@ -0,0 +1,116 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+/*
+StackAlloc extracted from GJK-EPA collision solver by Nathanael Presson
+Nov.2006
+*/
+
+#ifndef BT_STACK_ALLOC
+#define BT_STACK_ALLOC
+
+#include "btScalar.h" //for btAssert
+#include "btAlignedAllocator.h"
+
+///The btBlock class is an internal structure for the btStackAlloc memory allocator.
+struct btBlock
+{
+	btBlock*			previous;
+	unsigned char*		address;
+};
+
+///The StackAlloc class provides some fast stack-based memory allocator (LIFO last-in first-out)
+class btStackAlloc
+{
+public:
+
+	btStackAlloc(unsigned int size)	{ ctor();create(size); }
+	~btStackAlloc()		{ destroy(); }
+	
+	inline void		create(unsigned int size)
+	{
+		destroy();
+		data		=  (unsigned char*) btAlignedAlloc(size,16);
+		totalsize	=	size;
+	}
+	inline void		destroy()
+	{
+		btAssert(usedsize==0);
+		//Raise(L"StackAlloc is still in use");
+
+		if(usedsize==0)
+		{
+			if(!ischild && data)		
+				btAlignedFree(data);
+
+			data				=	0;
+			usedsize			=	0;
+		}
+		
+	}
+
+	int	getAvailableMemory() const
+	{
+		return static_cast<int>(totalsize - usedsize);
+	}
+
+	unsigned char*			allocate(unsigned int size)
+	{
+		const unsigned int	nus(usedsize+size);
+		if(nus<totalsize)
+		{
+			usedsize=nus;
+			return(data+(usedsize-size));
+		}
+		btAssert(0);
+		//&& (L"Not enough memory"));
+		
+		return(0);
+	}
+	SIMD_FORCE_INLINE btBlock*		beginBlock()
+	{
+		btBlock*	pb = (btBlock*)allocate(sizeof(btBlock));
+		pb->previous	=	current;
+		pb->address		=	data+usedsize;
+		current			=	pb;
+		return(pb);
+	}
+	SIMD_FORCE_INLINE void		endBlock(btBlock* block)
+	{
+		btAssert(block==current);
+		//Raise(L"Unmatched blocks");
+		if(block==current)
+		{
+			current		=	block->previous;
+			usedsize	=	(unsigned int)((block->address-data)-sizeof(btBlock));
+		}
+	}
+
+private:
+	void		ctor()
+	{
+		data		=	0;
+		totalsize	=	0;
+		usedsize	=	0;
+		current		=	0;
+		ischild		=	false;
+	}
+	unsigned char*		data;
+	unsigned int		totalsize;
+	unsigned int		usedsize;
+	btBlock*	current;
+	bool		ischild;
+};
+
+#endif //BT_STACK_ALLOC
diff --git a/hkl3d/bullet/src/LinearMath/btTransform.h b/hkl3d/bullet/src/LinearMath/btTransform.h
new file mode 100644
index 0000000..5e52d18
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btTransform.h
@@ -0,0 +1,307 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_TRANSFORM_H
+#define BT_TRANSFORM_H
+
+
+#include "btMatrix3x3.h"
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btTransformData btTransformDoubleData
+#else
+#define btTransformData btTransformFloatData
+#endif
+
+
+
+
+/**@brief The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear.
+ *It can be used in combination with btVector3, btQuaternion and btMatrix3x3 linear algebra classes. */
+class btTransform {
+	
+  ///Storage for the rotation
+	btMatrix3x3 m_basis;
+  ///Storage for the translation
+	btVector3   m_origin;
+
+public:
+	
+  /**@brief No initialization constructor */
+	btTransform() {}
+  /**@brief Constructor from btQuaternion (optional btVector3 )
+   * @param q Rotation from quaternion 
+   * @param c Translation from Vector (default 0,0,0) */
+	explicit SIMD_FORCE_INLINE btTransform(const btQuaternion& q, 
+		const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0))) 
+		: m_basis(q),
+		m_origin(c)
+	{}
+
+  /**@brief Constructor from btMatrix3x3 (optional btVector3)
+   * @param b Rotation from Matrix 
+   * @param c Translation from Vector default (0,0,0)*/
+	explicit SIMD_FORCE_INLINE btTransform(const btMatrix3x3& b, 
+		const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0)))
+		: m_basis(b),
+		m_origin(c)
+	{}
+  /**@brief Copy constructor */
+	SIMD_FORCE_INLINE btTransform (const btTransform& other)
+		: m_basis(other.m_basis),
+		m_origin(other.m_origin)
+	{
+	}
+  /**@brief Assignment Operator */
+	SIMD_FORCE_INLINE btTransform& operator=(const btTransform& other)
+	{
+		m_basis = other.m_basis;
+		m_origin = other.m_origin;
+		return *this;
+	}
+
+
+  /**@brief Set the current transform as the value of the product of two transforms
+   * @param t1 Transform 1
+   * @param t2 Transform 2
+   * This = Transform1 * Transform2 */
+		SIMD_FORCE_INLINE void mult(const btTransform& t1, const btTransform& t2) {
+			m_basis = t1.m_basis * t2.m_basis;
+			m_origin = t1(t2.m_origin);
+		}
+
+/*		void multInverseLeft(const btTransform& t1, const btTransform& t2) {
+			btVector3 v = t2.m_origin - t1.m_origin;
+			m_basis = btMultTransposeLeft(t1.m_basis, t2.m_basis);
+			m_origin = v * t1.m_basis;
+		}
+		*/
+
+/**@brief Return the transform of the vector */
+	SIMD_FORCE_INLINE btVector3 operator()(const btVector3& x) const
+	{
+		return btVector3(m_basis[0].dot(x) + m_origin.x(), 
+			m_basis[1].dot(x) + m_origin.y(), 
+			m_basis[2].dot(x) + m_origin.z());
+	}
+
+  /**@brief Return the transform of the vector */
+	SIMD_FORCE_INLINE btVector3 operator*(const btVector3& x) const
+	{
+		return (*this)(x);
+	}
+
+  /**@brief Return the transform of the btQuaternion */
+	SIMD_FORCE_INLINE btQuaternion operator*(const btQuaternion& q) const
+	{
+		return getRotation() * q;
+	}
+
+  /**@brief Return the basis matrix for the rotation */
+	SIMD_FORCE_INLINE btMatrix3x3&       getBasis()          { return m_basis; }
+  /**@brief Return the basis matrix for the rotation */
+	SIMD_FORCE_INLINE const btMatrix3x3& getBasis()    const { return m_basis; }
+
+  /**@brief Return the origin vector translation */
+	SIMD_FORCE_INLINE btVector3&         getOrigin()         { return m_origin; }
+  /**@brief Return the origin vector translation */
+	SIMD_FORCE_INLINE const btVector3&   getOrigin()   const { return m_origin; }
+
+  /**@brief Return a quaternion representing the rotation */
+	btQuaternion getRotation() const { 
+		btQuaternion q;
+		m_basis.getRotation(q);
+		return q;
+	}
+	
+	
+  /**@brief Set from an array 
+   * @param m A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation */
+	void setFromOpenGLMatrix(const btScalar *m)
+	{
+		m_basis.setFromOpenGLSubMatrix(m);
+		m_origin.setValue(m[12],m[13],m[14]);
+	}
+
+  /**@brief Fill an array representation
+   * @param m A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation */
+	void getOpenGLMatrix(btScalar *m) const 
+	{
+		m_basis.getOpenGLSubMatrix(m);
+		m[12] = m_origin.x();
+		m[13] = m_origin.y();
+		m[14] = m_origin.z();
+		m[15] = btScalar(1.0);
+	}
+
+  /**@brief Set the translational element
+   * @param origin The vector to set the translation to */
+	SIMD_FORCE_INLINE void setOrigin(const btVector3& origin) 
+	{ 
+		m_origin = origin;
+	}
+
+	SIMD_FORCE_INLINE btVector3 invXform(const btVector3& inVec) const;
+
+
+  /**@brief Set the rotational element by btMatrix3x3 */
+	SIMD_FORCE_INLINE void setBasis(const btMatrix3x3& basis)
+	{ 
+		m_basis = basis;
+	}
+
+  /**@brief Set the rotational element by btQuaternion */
+	SIMD_FORCE_INLINE void setRotation(const btQuaternion& q)
+	{
+		m_basis.setRotation(q);
+	}
+
+
+  /**@brief Set this transformation to the identity */
+	void setIdentity()
+	{
+		m_basis.setIdentity();
+		m_origin.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0));
+	}
+
+  /**@brief Multiply this Transform by another(this = this * another) 
+   * @param t The other transform */
+	btTransform& operator*=(const btTransform& t) 
+	{
+		m_origin += m_basis * t.m_origin;
+		m_basis *= t.m_basis;
+		return *this;
+	}
+
+  /**@brief Return the inverse of this transform */
+	btTransform inverse() const
+	{ 
+		btMatrix3x3 inv = m_basis.transpose();
+		return btTransform(inv, inv * -m_origin);
+	}
+
+  /**@brief Return the inverse of this transform times the other transform
+   * @param t The other transform 
+   * return this.inverse() * the other */
+	btTransform inverseTimes(const btTransform& t) const;  
+
+  /**@brief Return the product of this transform and the other */
+	btTransform operator*(const btTransform& t) const;
+
+  /**@brief Return an identity transform */
+	static const btTransform&	getIdentity()
+	{
+		static const btTransform identityTransform(btMatrix3x3::getIdentity());
+		return identityTransform;
+	}
+
+	void	serialize(struct	btTransformData& dataOut) const;
+
+	void	serializeFloat(struct	btTransformFloatData& dataOut) const;
+
+	void	deSerialize(const struct	btTransformData& dataIn);
+
+	void	deSerializeDouble(const struct	btTransformDoubleData& dataIn);
+
+	void	deSerializeFloat(const struct	btTransformFloatData& dataIn);
+
+};
+
+
+SIMD_FORCE_INLINE btVector3
+btTransform::invXform(const btVector3& inVec) const
+{
+	btVector3 v = inVec - m_origin;
+	return (m_basis.transpose() * v);
+}
+
+SIMD_FORCE_INLINE btTransform 
+btTransform::inverseTimes(const btTransform& t) const  
+{
+	btVector3 v = t.getOrigin() - m_origin;
+		return btTransform(m_basis.transposeTimes(t.m_basis),
+			v * m_basis);
+}
+
+SIMD_FORCE_INLINE btTransform 
+btTransform::operator*(const btTransform& t) const
+{
+	return btTransform(m_basis * t.m_basis, 
+		(*this)(t.m_origin));
+}
+
+/**@brief Test if two transforms have all elements equal */
+SIMD_FORCE_INLINE bool operator==(const btTransform& t1, const btTransform& t2)
+{
+   return ( t1.getBasis()  == t2.getBasis() &&
+            t1.getOrigin() == t2.getOrigin() );
+}
+
+
+///for serialization
+struct	btTransformFloatData
+{
+	btMatrix3x3FloatData	m_basis;
+	btVector3FloatData	m_origin;
+};
+
+struct	btTransformDoubleData
+{
+	btMatrix3x3DoubleData	m_basis;
+	btVector3DoubleData	m_origin;
+};
+
+
+
+SIMD_FORCE_INLINE	void	btTransform::serialize(btTransformData& dataOut) const
+{
+	m_basis.serialize(dataOut.m_basis);
+	m_origin.serialize(dataOut.m_origin);
+}
+
+SIMD_FORCE_INLINE	void	btTransform::serializeFloat(btTransformFloatData& dataOut) const
+{
+	m_basis.serializeFloat(dataOut.m_basis);
+	m_origin.serializeFloat(dataOut.m_origin);
+}
+
+
+SIMD_FORCE_INLINE	void	btTransform::deSerialize(const btTransformData& dataIn)
+{
+	m_basis.deSerialize(dataIn.m_basis);
+	m_origin.deSerialize(dataIn.m_origin);
+}
+
+SIMD_FORCE_INLINE	void	btTransform::deSerializeFloat(const btTransformFloatData& dataIn)
+{
+	m_basis.deSerializeFloat(dataIn.m_basis);
+	m_origin.deSerializeFloat(dataIn.m_origin);
+}
+
+SIMD_FORCE_INLINE	void	btTransform::deSerializeDouble(const btTransformDoubleData& dataIn)
+{
+	m_basis.deSerializeDouble(dataIn.m_basis);
+	m_origin.deSerializeDouble(dataIn.m_origin);
+}
+
+
+#endif //BT_TRANSFORM_H
+
+
+
+
+
+
diff --git a/hkl3d/bullet/src/LinearMath/btTransformUtil.h b/hkl3d/bullet/src/LinearMath/btTransformUtil.h
new file mode 100644
index 0000000..2303c27
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btTransformUtil.h
@@ -0,0 +1,228 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef BT_TRANSFORM_UTIL_H
+#define BT_TRANSFORM_UTIL_H
+
+#include "btTransform.h"
+#define ANGULAR_MOTION_THRESHOLD btScalar(0.5)*SIMD_HALF_PI
+
+
+
+
+SIMD_FORCE_INLINE btVector3 btAabbSupport(const btVector3& halfExtents,const btVector3& supportDir)
+{
+	return btVector3(supportDir.x() < btScalar(0.0) ? -halfExtents.x() : halfExtents.x(),
+      supportDir.y() < btScalar(0.0) ? -halfExtents.y() : halfExtents.y(),
+      supportDir.z() < btScalar(0.0) ? -halfExtents.z() : halfExtents.z()); 
+}
+
+
+
+
+
+
+/// Utils related to temporal transforms
+class btTransformUtil
+{
+
+public:
+
+	static void integrateTransform(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep,btTransform& predictedTransform)
+	{
+		predictedTransform.setOrigin(curTrans.getOrigin() + linvel * timeStep);
+//	#define QUATERNION_DERIVATIVE
+	#ifdef QUATERNION_DERIVATIVE
+		btQuaternion predictedOrn = curTrans.getRotation();
+		predictedOrn += (angvel * predictedOrn) * (timeStep * btScalar(0.5));
+		predictedOrn.normalize();
+	#else
+		//Exponential map
+		//google for "Practical Parameterization of Rotations Using the Exponential Map", F. Sebastian Grassia
+
+		btVector3 axis;
+		btScalar	fAngle = angvel.length(); 
+		//limit the angular motion
+		if (fAngle*timeStep > ANGULAR_MOTION_THRESHOLD)
+		{
+			fAngle = ANGULAR_MOTION_THRESHOLD / timeStep;
+		}
+
+		if ( fAngle < btScalar(0.001) )
+		{
+			// use Taylor's expansions of sync function
+			axis   = angvel*( btScalar(0.5)*timeStep-(timeStep*timeStep*timeStep)*(btScalar(0.020833333333))*fAngle*fAngle );
+		}
+		else
+		{
+			// sync(fAngle) = sin(c*fAngle)/t
+			axis   = angvel*( btSin(btScalar(0.5)*fAngle*timeStep)/fAngle );
+		}
+		btQuaternion dorn (axis.x(),axis.y(),axis.z(),btCos( fAngle*timeStep*btScalar(0.5) ));
+		btQuaternion orn0 = curTrans.getRotation();
+
+		btQuaternion predictedOrn = dorn * orn0;
+		predictedOrn.normalize();
+	#endif
+		predictedTransform.setRotation(predictedOrn);
+	}
+
+	static void	calculateVelocityQuaternion(const btVector3& pos0,const btVector3& pos1,const btQuaternion& orn0,const btQuaternion& orn1,btScalar timeStep,btVector3& linVel,btVector3& angVel)
+	{
+		linVel = (pos1 - pos0) / timeStep;
+		btVector3 axis;
+		btScalar  angle;
+		if (orn0 != orn1)
+		{
+			calculateDiffAxisAngleQuaternion(orn0,orn1,axis,angle);
+			angVel = axis * angle / timeStep;
+		} else
+		{
+			angVel.setValue(0,0,0);
+		}
+	}
+
+	static void calculateDiffAxisAngleQuaternion(const btQuaternion& orn0,const btQuaternion& orn1a,btVector3& axis,btScalar& angle)
+	{
+		btQuaternion orn1 = orn0.nearest(orn1a);
+		btQuaternion dorn = orn1 * orn0.inverse();
+		angle = dorn.getAngle();
+		axis = btVector3(dorn.x(),dorn.y(),dorn.z());
+		axis[3] = btScalar(0.);
+		//check for axis length
+		btScalar len = axis.length2();
+		if (len < SIMD_EPSILON*SIMD_EPSILON)
+			axis = btVector3(btScalar(1.),btScalar(0.),btScalar(0.));
+		else
+			axis /= btSqrt(len);
+	}
+
+	static void	calculateVelocity(const btTransform& transform0,const btTransform& transform1,btScalar timeStep,btVector3& linVel,btVector3& angVel)
+	{
+		linVel = (transform1.getOrigin() - transform0.getOrigin()) / timeStep;
+		btVector3 axis;
+		btScalar  angle;
+		calculateDiffAxisAngle(transform0,transform1,axis,angle);
+		angVel = axis * angle / timeStep;
+	}
+
+	static void calculateDiffAxisAngle(const btTransform& transform0,const btTransform& transform1,btVector3& axis,btScalar& angle)
+	{
+		btMatrix3x3 dmat = transform1.getBasis() * transform0.getBasis().inverse();
+		btQuaternion dorn;
+		dmat.getRotation(dorn);
+
+		///floating point inaccuracy can lead to w component > 1..., which breaks 
+		dorn.normalize();
+		
+		angle = dorn.getAngle();
+		axis = btVector3(dorn.x(),dorn.y(),dorn.z());
+		axis[3] = btScalar(0.);
+		//check for axis length
+		btScalar len = axis.length2();
+		if (len < SIMD_EPSILON*SIMD_EPSILON)
+			axis = btVector3(btScalar(1.),btScalar(0.),btScalar(0.));
+		else
+			axis /= btSqrt(len);
+	}
+
+};
+
+
+///The btConvexSeparatingDistanceUtil can help speed up convex collision detection 
+///by conservatively updating a cached separating distance/vector instead of re-calculating the closest distance
+class	btConvexSeparatingDistanceUtil
+{
+	btQuaternion	m_ornA;
+	btQuaternion	m_ornB;
+	btVector3	m_posA;
+	btVector3	m_posB;
+	
+	btVector3	m_separatingNormal;
+
+	btScalar	m_boundingRadiusA;
+	btScalar	m_boundingRadiusB;
+	btScalar	m_separatingDistance;
+
+public:
+
+	btConvexSeparatingDistanceUtil(btScalar	boundingRadiusA,btScalar	boundingRadiusB)
+		:m_boundingRadiusA(boundingRadiusA),
+		m_boundingRadiusB(boundingRadiusB),
+		m_separatingDistance(0.f)
+	{
+	}
+
+	btScalar	getConservativeSeparatingDistance()
+	{
+		return m_separatingDistance;
+	}
+
+	void	updateSeparatingDistance(const btTransform& transA,const btTransform& transB)
+	{
+		const btVector3& toPosA = transA.getOrigin();
+		const btVector3& toPosB = transB.getOrigin();
+		btQuaternion toOrnA = transA.getRotation();
+		btQuaternion toOrnB = transB.getRotation();
+
+		if (m_separatingDistance>0.f)
+		{
+			
+
+			btVector3 linVelA,angVelA,linVelB,angVelB;
+			btTransformUtil::calculateVelocityQuaternion(m_posA,toPosA,m_ornA,toOrnA,btScalar(1.),linVelA,angVelA);
+			btTransformUtil::calculateVelocityQuaternion(m_posB,toPosB,m_ornB,toOrnB,btScalar(1.),linVelB,angVelB);
+			btScalar maxAngularProjectedVelocity = angVelA.length() * m_boundingRadiusA + angVelB.length() * m_boundingRadiusB;
+			btVector3 relLinVel = (linVelB-linVelA);
+			btScalar relLinVelocLength = relLinVel.dot(m_separatingNormal);
+			if (relLinVelocLength<0.f)
+			{
+				relLinVelocLength = 0.f;
+			}
+	
+			btScalar	projectedMotion = maxAngularProjectedVelocity +relLinVelocLength;
+			m_separatingDistance -= projectedMotion;
+		}
+	
+		m_posA = toPosA;
+		m_posB = toPosB;
+		m_ornA = toOrnA;
+		m_ornB = toOrnB;
+	}
+
+	void	initSeparatingDistance(const btVector3& separatingVector,btScalar separatingDistance,const btTransform& transA,const btTransform& transB)
+	{
+		m_separatingDistance = separatingDistance;
+
+		if (m_separatingDistance>0.f)
+		{
+			m_separatingNormal = separatingVector;
+			
+			const btVector3& toPosA = transA.getOrigin();
+			const btVector3& toPosB = transB.getOrigin();
+			btQuaternion toOrnA = transA.getRotation();
+			btQuaternion toOrnB = transB.getRotation();
+			m_posA = toPosA;
+			m_posB = toPosB;
+			m_ornA = toOrnA;
+			m_ornB = toOrnB;
+		}
+	}
+
+};
+
+
+#endif //BT_TRANSFORM_UTIL_H
+
diff --git a/hkl3d/bullet/src/LinearMath/btVector3.h b/hkl3d/bullet/src/LinearMath/btVector3.h
new file mode 100644
index 0000000..d99b7c8
--- /dev/null
+++ b/hkl3d/bullet/src/LinearMath/btVector3.h
@@ -0,0 +1,766 @@
+/*
+Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+
+#ifndef BT_VECTOR3_H
+#define BT_VECTOR3_H
+
+
+#include "btScalar.h"
+#include "btMinMax.h"
+
+#ifdef BT_USE_DOUBLE_PRECISION
+#define btVector3Data btVector3DoubleData
+#define btVector3DataName "btVector3DoubleData"
+#else
+#define btVector3Data btVector3FloatData
+#define btVector3DataName "btVector3FloatData"
+#endif //BT_USE_DOUBLE_PRECISION
+
+
+
+
+/**@brief btVector3 can be used to represent 3D points and vectors.
+ * It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user
+ * Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers
+ */
+ATTRIBUTE_ALIGNED16(class) btVector3
+{
+public:
+
+#if defined (__SPU__) && defined (__CELLOS_LV2__)
+		btScalar	m_floats[4];
+public:
+	SIMD_FORCE_INLINE const vec_float4&	get128() const
+	{
+		return *((const vec_float4*)&m_floats[0]);
+	}
+public:
+#else //__CELLOS_LV2__ __SPU__
+#ifdef BT_USE_SSE // _WIN32
+	union {
+		__m128 mVec128;
+		btScalar	m_floats[4];
+	};
+	SIMD_FORCE_INLINE	__m128	get128() const
+	{
+		return mVec128;
+	}
+	SIMD_FORCE_INLINE	void	set128(__m128 v128)
+	{
+		mVec128 = v128;
+	}
+#else
+	btScalar	m_floats[4];
+#endif
+#endif //__CELLOS_LV2__ __SPU__
+
+	public:
+
+  /**@brief No initialization constructor */
+	SIMD_FORCE_INLINE btVector3() {}
+
+ 
+	
+  /**@brief Constructor from scalars 
+   * @param x X value
+   * @param y Y value 
+   * @param z Z value 
+   */
+	SIMD_FORCE_INLINE btVector3(const btScalar& x, const btScalar& y, const btScalar& z)
+	{
+		m_floats[0] = x;
+		m_floats[1] = y;
+		m_floats[2] = z;
+		m_floats[3] = btScalar(0.);
+	}
+
+	
+/**@brief Add a vector to this one 
+ * @param The vector to add to this one */
+	SIMD_FORCE_INLINE btVector3& operator+=(const btVector3& v)
+	{
+
+		m_floats[0] += v.m_floats[0]; m_floats[1] += v.m_floats[1];m_floats[2] += v.m_floats[2];
+		return *this;
+	}
+
+
+  /**@brief Subtract a vector from this one
+   * @param The vector to subtract */
+	SIMD_FORCE_INLINE btVector3& operator-=(const btVector3& v) 
+	{
+		m_floats[0] -= v.m_floats[0]; m_floats[1] -= v.m_floats[1];m_floats[2] -= v.m_floats[2];
+		return *this;
+	}
+  /**@brief Scale the vector
+   * @param s Scale factor */
+	SIMD_FORCE_INLINE btVector3& operator*=(const btScalar& s)
+	{
+		m_floats[0] *= s; m_floats[1] *= s;m_floats[2] *= s;
+		return *this;
+	}
+
+  /**@brief Inversely scale the vector 
+   * @param s Scale factor to divide by */
+	SIMD_FORCE_INLINE btVector3& operator/=(const btScalar& s) 
+	{
+		btFullAssert(s != btScalar(0.0));
+		return *this *= btScalar(1.0) / s;
+	}
+
+  /**@brief Return the dot product
+   * @param v The other vector in the dot product */
+	SIMD_FORCE_INLINE btScalar dot(const btVector3& v) const
+	{
+		return m_floats[0] * v.m_floats[0] + m_floats[1] * v.m_floats[1] +m_floats[2] * v.m_floats[2];
+	}
+
+  /**@brief Return the length of the vector squared */
+	SIMD_FORCE_INLINE btScalar length2() const
+	{
+		return dot(*this);
+	}
+
+  /**@brief Return the length of the vector */
+	SIMD_FORCE_INLINE btScalar length() const
+	{
+		return btSqrt(length2());
+	}
+
+  /**@brief Return the distance squared between the ends of this and another vector
+   * This is symantically treating the vector like a point */
+	SIMD_FORCE_INLINE btScalar distance2(const btVector3& v) const;
+
+  /**@brief Return the distance between the ends of this and another vector
+   * This is symantically treating the vector like a point */
+	SIMD_FORCE_INLINE btScalar distance(const btVector3& v) const;
+
+	SIMD_FORCE_INLINE btVector3& safeNormalize() 
+	{
+		btVector3 absVec = this->absolute();
+		int maxIndex = absVec.maxAxis();
+		if (absVec[maxIndex]>0)
+		{
+			*this /= absVec[maxIndex];
+			return *this /= length();
+		}
+		setValue(1,0,0);
+		return *this;
+	}
+
+  /**@brief Normalize this vector 
+   * x^2 + y^2 + z^2 = 1 */
+	SIMD_FORCE_INLINE btVector3& normalize() 
+	{
+		return *this /= length();
+	}
+
+  /**@brief Return a normalized version of this vector */
+	SIMD_FORCE_INLINE btVector3 normalized() const;
+
+  /**@brief Return a rotated version of this vector
+   * @param wAxis The axis to rotate about 
+   * @param angle The angle to rotate by */
+	SIMD_FORCE_INLINE btVector3 rotate( const btVector3& wAxis, const btScalar angle ) const;
+
+  /**@brief Return the angle between this and another vector
+   * @param v The other vector */
+	SIMD_FORCE_INLINE btScalar angle(const btVector3& v) const 
+	{
+		btScalar s = btSqrt(length2() * v.length2());
+		btFullAssert(s != btScalar(0.0));
+		return btAcos(dot(v) / s);
+	}
+  /**@brief Return a vector will the absolute values of each element */
+	SIMD_FORCE_INLINE btVector3 absolute() const 
+	{
+		return btVector3(
+			btFabs(m_floats[0]), 
+			btFabs(m_floats[1]), 
+			btFabs(m_floats[2]));
+	}
+  /**@brief Return the cross product between this and another vector 
+   * @param v The other vector */
+	SIMD_FORCE_INLINE btVector3 cross(const btVector3& v) const
+	{
+		return btVector3(
+			m_floats[1] * v.m_floats[2] -m_floats[2] * v.m_floats[1],
+			m_floats[2] * v.m_floats[0] - m_floats[0] * v.m_floats[2],
+			m_floats[0] * v.m_floats[1] - m_floats[1] * v.m_floats[0]);
+	}
+
+	SIMD_FORCE_INLINE btScalar triple(const btVector3& v1, const btVector3& v2) const
+	{
+		return m_floats[0] * (v1.m_floats[1] * v2.m_floats[2] - v1.m_floats[2] * v2.m_floats[1]) + 
+			m_floats[1] * (v1.m_floats[2] * v2.m_floats[0] - v1.m_floats[0] * v2.m_floats[2]) + 
+			m_floats[2] * (v1.m_floats[0] * v2.m_floats[1] - v1.m_floats[1] * v2.m_floats[0]);
+	}
+
+  /**@brief Return the axis with the smallest value 
+   * Note return values are 0,1,2 for x, y, or z */
+	SIMD_FORCE_INLINE int minAxis() const
+	{
+		return m_floats[0] < m_floats[1] ? (m_floats[0] <m_floats[2] ? 0 : 2) : (m_floats[1] <m_floats[2] ? 1 : 2);
+	}
+
+  /**@brief Return the axis with the largest value 
+   * Note return values are 0,1,2 for x, y, or z */
+	SIMD_FORCE_INLINE int maxAxis() const 
+	{
+		return m_floats[0] < m_floats[1] ? (m_floats[1] <m_floats[2] ? 2 : 1) : (m_floats[0] <m_floats[2] ? 2 : 0);
+	}
+
+	SIMD_FORCE_INLINE int furthestAxis() const
+	{
+		return absolute().minAxis();
+	}
+
+	SIMD_FORCE_INLINE int closestAxis() const 
+	{
+		return absolute().maxAxis();
+	}
+
+	SIMD_FORCE_INLINE void setInterpolate3(const btVector3& v0, const btVector3& v1, btScalar rt)
+	{
+		btScalar s = btScalar(1.0) - rt;
+		m_floats[0] = s * v0.m_floats[0] + rt * v1.m_floats[0];
+		m_floats[1] = s * v0.m_floats[1] + rt * v1.m_floats[1];
+		m_floats[2] = s * v0.m_floats[2] + rt * v1.m_floats[2];
+		//don't do the unused w component
+		//		m_co[3] = s * v0[3] + rt * v1[3];
+	}
+
+  /**@brief Return the linear interpolation between this and another vector 
+   * @param v The other vector 
+   * @param t The ration of this to v (t = 0 => return this, t=1 => return other) */
+	SIMD_FORCE_INLINE btVector3 lerp(const btVector3& v, const btScalar& t) const 
+	{
+		return btVector3(m_floats[0] + (v.m_floats[0] - m_floats[0]) * t,
+			m_floats[1] + (v.m_floats[1] - m_floats[1]) * t,
+			m_floats[2] + (v.m_floats[2] -m_floats[2]) * t);
+	}
+
+  /**@brief Elementwise multiply this vector by the other 
+   * @param v The other vector */
+	SIMD_FORCE_INLINE btVector3& operator*=(const btVector3& v)
+	{
+		m_floats[0] *= v.m_floats[0]; m_floats[1] *= v.m_floats[1];m_floats[2] *= v.m_floats[2];
+		return *this;
+	}
+
+	 /**@brief Return the x value */
+		SIMD_FORCE_INLINE const btScalar& getX() const { return m_floats[0]; }
+  /**@brief Return the y value */
+		SIMD_FORCE_INLINE const btScalar& getY() const { return m_floats[1]; }
+  /**@brief Return the z value */
+		SIMD_FORCE_INLINE const btScalar& getZ() const { return m_floats[2]; }
+  /**@brief Set the x value */
+		SIMD_FORCE_INLINE void	setX(btScalar x) { m_floats[0] = x;};
+  /**@brief Set the y value */
+		SIMD_FORCE_INLINE void	setY(btScalar y) { m_floats[1] = y;};
+  /**@brief Set the z value */
+		SIMD_FORCE_INLINE void	setZ(btScalar z) {m_floats[2] = z;};
+  /**@brief Set the w value */
+		SIMD_FORCE_INLINE void	setW(btScalar w) { m_floats[3] = w;};
+  /**@brief Return the x value */
+		SIMD_FORCE_INLINE const btScalar& x() const { return m_floats[0]; }
+  /**@brief Return the y value */
+		SIMD_FORCE_INLINE const btScalar& y() const { return m_floats[1]; }
+  /**@brief Return the z value */
+		SIMD_FORCE_INLINE const btScalar& z() const { return m_floats[2]; }
+  /**@brief Return the w value */
+		SIMD_FORCE_INLINE const btScalar& w() const { return m_floats[3]; }
+
+	//SIMD_FORCE_INLINE btScalar&       operator[](int i)       { return (&m_floats[0])[i];	}      
+	//SIMD_FORCE_INLINE const btScalar& operator[](int i) const { return (&m_floats[0])[i]; }
+	///operator btScalar*() replaces operator[], using implicit conversion. We added operator != and operator == to avoid pointer comparisons.
+	SIMD_FORCE_INLINE	operator       btScalar *()       { return &m_floats[0]; }
+	SIMD_FORCE_INLINE	operator const btScalar *() const { return &m_floats[0]; }
+
+	SIMD_FORCE_INLINE	bool	operator==(const btVector3& other) const
+	{
+		return ((m_floats[3]==other.m_floats[3]) && (m_floats[2]==other.m_floats[2]) && (m_floats[1]==other.m_floats[1]) && (m_floats[0]==other.m_floats[0]));
+	}
+
+	SIMD_FORCE_INLINE	bool	operator!=(const btVector3& other) const
+	{
+		return !(*this == other);
+	}
+
+	 /**@brief Set each element to the max of the current values and the values of another btVector3
+   * @param other The other btVector3 to compare with 
+   */
+		SIMD_FORCE_INLINE void	setMax(const btVector3& other)
+		{
+			btSetMax(m_floats[0], other.m_floats[0]);
+			btSetMax(m_floats[1], other.m_floats[1]);
+			btSetMax(m_floats[2], other.m_floats[2]);
+			btSetMax(m_floats[3], other.w());
+		}
+  /**@brief Set each element to the min of the current values and the values of another btVector3
+   * @param other The other btVector3 to compare with 
+   */
+		SIMD_FORCE_INLINE void	setMin(const btVector3& other)
+		{
+			btSetMin(m_floats[0], other.m_floats[0]);
+			btSetMin(m_floats[1], other.m_floats[1]);
+			btSetMin(m_floats[2], other.m_floats[2]);
+			btSetMin(m_floats[3], other.w());
+		}
+
+		SIMD_FORCE_INLINE void 	setValue(const btScalar& x, const btScalar& y, const btScalar& z)
+		{
+			m_floats[0]=x;
+			m_floats[1]=y;
+			m_floats[2]=z;
+			m_floats[3] = btScalar(0.);
+		}
+
+		void	getSkewSymmetricMatrix(btVector3* v0,btVector3* v1,btVector3* v2) const
+		{
+			v0->setValue(0.		,-z()		,y());
+			v1->setValue(z()	,0.			,-x());
+			v2->setValue(-y()	,x()	,0.);
+		}
+
+		void	setZero()
+		{
+			setValue(btScalar(0.),btScalar(0.),btScalar(0.));
+		}
+
+		SIMD_FORCE_INLINE bool isZero() const 
+		{
+			return m_floats[0] == btScalar(0) && m_floats[1] == btScalar(0) && m_floats[2] == btScalar(0);
+		}
+
+		SIMD_FORCE_INLINE bool fuzzyZero() const 
+		{
+			return length2() < SIMD_EPSILON;
+		}
+
+		SIMD_FORCE_INLINE	void	serialize(struct	btVector3Data& dataOut) const;
+
+		SIMD_FORCE_INLINE	void	deSerialize(const struct	btVector3Data& dataIn);
+
+		SIMD_FORCE_INLINE	void	serializeFloat(struct	btVector3FloatData& dataOut) const;
+
+		SIMD_FORCE_INLINE	void	deSerializeFloat(const struct	btVector3FloatData& dataIn);
+
+		SIMD_FORCE_INLINE	void	serializeDouble(struct	btVector3DoubleData& dataOut) const;
+
+		SIMD_FORCE_INLINE	void	deSerializeDouble(const struct	btVector3DoubleData& dataIn);
+
+};
+
+/**@brief Return the sum of two vectors (Point symantics)*/
+SIMD_FORCE_INLINE btVector3 
+operator+(const btVector3& v1, const btVector3& v2) 
+{
+	return btVector3(v1.m_floats[0] + v2.m_floats[0], v1.m_floats[1] + v2.m_floats[1], v1.m_floats[2] + v2.m_floats[2]);
+}
+
+/**@brief Return the elementwise product of two vectors */
+SIMD_FORCE_INLINE btVector3 
+operator*(const btVector3& v1, const btVector3& v2) 
+{
+	return btVector3(v1.m_floats[0] * v2.m_floats[0], v1.m_floats[1] * v2.m_floats[1], v1.m_floats[2] * v2.m_floats[2]);
+}
+
+/**@brief Return the difference between two vectors */
+SIMD_FORCE_INLINE btVector3 
+operator-(const btVector3& v1, const btVector3& v2)
+{
+	return btVector3(v1.m_floats[0] - v2.m_floats[0], v1.m_floats[1] - v2.m_floats[1], v1.m_floats[2] - v2.m_floats[2]);
+}
+/**@brief Return the negative of the vector */
+SIMD_FORCE_INLINE btVector3 
+operator-(const btVector3& v)
+{
+	return btVector3(-v.m_floats[0], -v.m_floats[1], -v.m_floats[2]);
+}
+
+/**@brief Return the vector scaled by s */
+SIMD_FORCE_INLINE btVector3 
+operator*(const btVector3& v, const btScalar& s)
+{
+	return btVector3(v.m_floats[0] * s, v.m_floats[1] * s, v.m_floats[2] * s);
+}
+
+/**@brief Return the vector scaled by s */
+SIMD_FORCE_INLINE btVector3 
+operator*(const btScalar& s, const btVector3& v)
+{ 
+	return v * s; 
+}
+
+/**@brief Return the vector inversely scaled by s */
+SIMD_FORCE_INLINE btVector3
+operator/(const btVector3& v, const btScalar& s)
+{
+	btFullAssert(s != btScalar(0.0));
+	return v * (btScalar(1.0) / s);
+}
+
+/**@brief Return the vector inversely scaled by s */
+SIMD_FORCE_INLINE btVector3
+operator/(const btVector3& v1, const btVector3& v2)
+{
+	return btVector3(v1.m_floats[0] / v2.m_floats[0],v1.m_floats[1] / v2.m_floats[1],v1.m_floats[2] / v2.m_floats[2]);
+}
+
+/**@brief Return the dot product between two vectors */
+SIMD_FORCE_INLINE btScalar 
+btDot(const btVector3& v1, const btVector3& v2) 
+{ 
+	return v1.dot(v2); 
+}
+
+
+/**@brief Return the distance squared between two vectors */
+SIMD_FORCE_INLINE btScalar
+btDistance2(const btVector3& v1, const btVector3& v2) 
+{ 
+	return v1.distance2(v2); 
+}
+
+
+/**@brief Return the distance between two vectors */
+SIMD_FORCE_INLINE btScalar
+btDistance(const btVector3& v1, const btVector3& v2) 
+{ 
+	return v1.distance(v2); 
+}
+
+/**@brief Return the angle between two vectors */
+SIMD_FORCE_INLINE btScalar
+btAngle(const btVector3& v1, const btVector3& v2) 
+{ 
+	return v1.angle(v2); 
+}
+
+/**@brief Return the cross product of two vectors */
+SIMD_FORCE_INLINE btVector3 
+btCross(const btVector3& v1, const btVector3& v2) 
+{ 
+	return v1.cross(v2); 
+}
+
+SIMD_FORCE_INLINE btScalar
+btTriple(const btVector3& v1, const btVector3& v2, const btVector3& v3)
+{
+	return v1.triple(v2, v3);
+}
+
+/**@brief Return the linear interpolation between two vectors
+ * @param v1 One vector 
+ * @param v2 The other vector 
+ * @param t The ration of this to v (t = 0 => return v1, t=1 => return v2) */
+SIMD_FORCE_INLINE btVector3 
+lerp(const btVector3& v1, const btVector3& v2, const btScalar& t)
+{
+	return v1.lerp(v2, t);
+}
+
+
+
+SIMD_FORCE_INLINE btScalar btVector3::distance2(const btVector3& v) const
+{
+	return (v - *this).length2();
+}
+
+SIMD_FORCE_INLINE btScalar btVector3::distance(const btVector3& v) const
+{
+	return (v - *this).length();
+}
+
+SIMD_FORCE_INLINE btVector3 btVector3::normalized() const
+{
+	return *this / length();
+} 
+
+SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btScalar angle ) const
+{
+	// wAxis must be a unit lenght vector
+
+	btVector3 o = wAxis * wAxis.dot( *this );
+	btVector3 x = *this - o;
+	btVector3 y;
+
+	y = wAxis.cross( *this );
+
+	return ( o + x * btCos( angle ) + y * btSin( angle ) );
+}
+
+class btVector4 : public btVector3
+{
+public:
+
+	SIMD_FORCE_INLINE btVector4() {}
+
+
+	SIMD_FORCE_INLINE btVector4(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w) 
+		: btVector3(x,y,z)
+	{
+		m_floats[3] = w;
+	}
+
+
+	SIMD_FORCE_INLINE btVector4 absolute4() const 
+	{
+		return btVector4(
+			btFabs(m_floats[0]), 
+			btFabs(m_floats[1]), 
+			btFabs(m_floats[2]),
+			btFabs(m_floats[3]));
+	}
+
+
+
+	btScalar	getW() const { return m_floats[3];}
+
+
+		SIMD_FORCE_INLINE int maxAxis4() const
+	{
+		int maxIndex = -1;
+		btScalar maxVal = btScalar(-BT_LARGE_FLOAT);
+		if (m_floats[0] > maxVal)
+		{
+			maxIndex = 0;
+			maxVal = m_floats[0];
+		}
+		if (m_floats[1] > maxVal)
+		{
+			maxIndex = 1;
+			maxVal = m_floats[1];
+		}
+		if (m_floats[2] > maxVal)
+		{
+			maxIndex = 2;
+			maxVal =m_floats[2];
+		}
+		if (m_floats[3] > maxVal)
+		{
+			maxIndex = 3;
+			maxVal = m_floats[3];
+		}
+		
+		
+		
+
+		return maxIndex;
+
+	}
+
+
+	SIMD_FORCE_INLINE int minAxis4() const
+	{
+		int minIndex = -1;
+		btScalar minVal = btScalar(BT_LARGE_FLOAT);
+		if (m_floats[0] < minVal)
+		{
+			minIndex = 0;
+			minVal = m_floats[0];
+		}
+		if (m_floats[1] < minVal)
+		{
+			minIndex = 1;
+			minVal = m_floats[1];
+		}
+		if (m_floats[2] < minVal)
+		{
+			minIndex = 2;
+			minVal =m_floats[2];
+		}
+		if (m_floats[3] < minVal)
+		{
+			minIndex = 3;
+			minVal = m_floats[3];
+		}
+		
+		return minIndex;
+
+	}
+
+
+	SIMD_FORCE_INLINE int closestAxis4() const 
+	{
+		return absolute4().maxAxis4();
+	}
+
+	
+ 
+
+  /**@brief Set x,y,z and zero w 
+   * @param x Value of x
+   * @param y Value of y
+   * @param z Value of z
+   */
+		
+
+/*		void getValue(btScalar *m) const 
+		{
+			m[0] = m_floats[0];
+			m[1] = m_floats[1];
+			m[2] =m_floats[2];
+		}
+*/
+/**@brief Set the values 
+   * @param x Value of x
+   * @param y Value of y
+   * @param z Value of z
+   * @param w Value of w
+   */
+		SIMD_FORCE_INLINE void	setValue(const btScalar& x, const btScalar& y, const btScalar& z,const btScalar& w)
+		{
+			m_floats[0]=x;
+			m_floats[1]=y;
+			m_floats[2]=z;
+			m_floats[3]=w;
+		}
+
+
+};
+
+
+///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
+SIMD_FORCE_INLINE void	btSwapScalarEndian(const btScalar& sourceVal, btScalar& destVal)
+{
+	#ifdef BT_USE_DOUBLE_PRECISION
+	unsigned char* dest = (unsigned char*) &destVal;
+	unsigned char* src  = (unsigned char*) &sourceVal;
+	dest[0] = src[7];
+    dest[1] = src[6];
+    dest[2] = src[5];
+    dest[3] = src[4];
+    dest[4] = src[3];
+    dest[5] = src[2];
+    dest[6] = src[1];
+    dest[7] = src[0];
+#else
+	unsigned char* dest = (unsigned char*) &destVal;
+	unsigned char* src  = (unsigned char*) &sourceVal;
+	dest[0] = src[3];
+    dest[1] = src[2];
+    dest[2] = src[1];
+    dest[3] = src[0];
+#endif //BT_USE_DOUBLE_PRECISION
+}
+///btSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
+SIMD_FORCE_INLINE void	btSwapVector3Endian(const btVector3& sourceVec, btVector3& destVec)
+{
+	for (int i=0;i<4;i++)
+	{
+		btSwapScalarEndian(sourceVec[i],destVec[i]);
+	}
+
+}
+
+///btUnSwapVector3Endian swaps vector endianness, useful for network and cross-platform serialization
+SIMD_FORCE_INLINE void	btUnSwapVector3Endian(btVector3& vector)
+{
+
+	btVector3	swappedVec;
+	for (int i=0;i<4;i++)
+	{
+		btSwapScalarEndian(vector[i],swappedVec[i]);
+	}
+	vector = swappedVec;
+}
+
+template <class T>
+SIMD_FORCE_INLINE void btPlaneSpace1 (const T& n, T& p, T& q)
+{
+  if (btFabs(n[2]) > SIMDSQRT12) {
+    // choose p in y-z plane
+    btScalar a = n[1]*n[1] + n[2]*n[2];
+    btScalar k = btRecipSqrt (a);
+    p[0] = 0;
+	p[1] = -n[2]*k;
+	p[2] = n[1]*k;
+    // set q = n x p
+    q[0] = a*k;
+	q[1] = -n[0]*p[2];
+	q[2] = n[0]*p[1];
+  }
+  else {
+    // choose p in x-y plane
+    btScalar a = n[0]*n[0] + n[1]*n[1];
+    btScalar k = btRecipSqrt (a);
+    p[0] = -n[1]*k;
+	p[1] = n[0]*k;
+	p[2] = 0;
+    // set q = n x p
+    q[0] = -n[2]*p[1];
+	q[1] = n[2]*p[0];
+	q[2] = a*k;
+  }
+}
+
+
+struct	btVector3FloatData
+{
+	float	m_floats[4];
+};
+
+struct	btVector3DoubleData
+{
+	double	m_floats[4];
+
+};
+
+SIMD_FORCE_INLINE	void	btVector3::serializeFloat(struct	btVector3FloatData& dataOut) const
+{
+	///could also do a memcpy, check if it is worth it
+	for (int i=0;i<4;i++)
+		dataOut.m_floats[i] = float(m_floats[i]);
+}
+
+SIMD_FORCE_INLINE void	btVector3::deSerializeFloat(const struct	btVector3FloatData& dataIn)
+{
+	for (int i=0;i<4;i++)
+		m_floats[i] = btScalar(dataIn.m_floats[i]);
+}
+
+
+SIMD_FORCE_INLINE	void	btVector3::serializeDouble(struct	btVector3DoubleData& dataOut) const
+{
+	///could also do a memcpy, check if it is worth it
+	for (int i=0;i<4;i++)
+		dataOut.m_floats[i] = double(m_floats[i]);
+}
+
+SIMD_FORCE_INLINE void	btVector3::deSerializeDouble(const struct	btVector3DoubleData& dataIn)
+{
+	for (int i=0;i<4;i++)
+		m_floats[i] = btScalar(dataIn.m_floats[i]);
+}
+
+
+SIMD_FORCE_INLINE	void	btVector3::serialize(struct	btVector3Data& dataOut) const
+{
+	///could also do a memcpy, check if it is worth it
+	for (int i=0;i<4;i++)
+		dataOut.m_floats[i] = m_floats[i];
+}
+
+SIMD_FORCE_INLINE void	btVector3::deSerialize(const struct	btVector3Data& dataIn)
+{
+	for (int i=0;i<4;i++)
+		m_floats[i] = dataIn.m_floats[i];
+}
+
+
+#endif //BT_VECTOR3_H
diff --git a/hkl3d/bullet/src/Makefile.am b/hkl3d/bullet/src/Makefile.am
new file mode 100644
index 0000000..199f79e
--- /dev/null
+++ b/hkl3d/bullet/src/Makefile.am
@@ -0,0 +1,358 @@
+if CONDITIONAL_BUILD_MULTITHREADED
+noinst_LTLIBRARIES = libbulletmath.la libbulletcollision.la libbulletdynamics.la libbulletmultithreaded.la
+
+libbulletmultithreaded_la_CXXFLAGS = -I./BulletMultiThreaded/vectormath/scalar/cpp
+libbulletmultithreaded_la_SOURCES =\
+		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h \
+		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp \
+		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h \
+		BulletMultiThreaded/HeapManager.h \
+		BulletMultiThreaded/SpuCollisionObjectWrapper.cpp \
+		BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp \
+		BulletMultiThreaded/SpuLibspe2Support.cpp \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp \
+		BulletMultiThreaded/btThreadSupportInterface.cpp \
+		BulletMultiThreaded/SequentialThreadSupport.cpp \
+		BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp \
+		BulletMultiThreaded/Win32ThreadSupport.cpp \
+		BulletMultiThreaded/SpuFakeDma.cpp \
+		BulletMultiThreaded/PosixThreadSupport.cpp \
+		BulletMultiThreaded/SpuCollisionTaskProcess.cpp \
+		BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp \
+		BulletMultiThreaded/SpuSampleTaskProcess.cpp \
+		BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h \
+		BulletMultiThreaded/PpuAddressSpace.h \
+		BulletMultiThreaded/SpuSampleTaskProcess.h \
+		BulletMultiThreaded/SequentialThreadSupport.h \
+		BulletMultiThreaded/PlatformDefinitions.h \
+		BulletMultiThreaded/Win32ThreadSupport.h \
+		BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h \
+		BulletMultiThreaded/btThreadSupportInterface.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h \
+		BulletMultiThreaded/SpuGatheringCollisionDispatcher.h \
+		BulletMultiThreaded/SpuFakeDma.h \
+		BulletMultiThreaded/SpuSync.h \
+		BulletMultiThreaded/TrbDynBody.h \
+		BulletMultiThreaded/TrbStateVec.h \
+		BulletMultiThreaded/SpuCollisionObjectWrapper.h \
+		BulletMultiThreaded/SpuDoubleBuffer.h \
+		BulletMultiThreaded/SpuCollisionTaskProcess.h \
+		BulletMultiThreaded/PosixThreadSupport.h \
+		BulletMultiThreaded/SpuLibspe2Support.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h \
+		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
+
+else
+noinst_LTLIBRARIES = libbulletmath.la libbulletcollision.la libbulletdynamics.la
+endif
+
+
+libbulletmath_la_SOURCES	= \
+		LinearMath/btQuickprof.cpp \
+		LinearMath/btGeometryUtil.cpp \
+		LinearMath/btAlignedAllocator.cpp \
+		LinearMath/btSerializer.cpp \
+		LinearMath/btConvexHull.cpp \
+		LinearMath/btHashMap.h \
+		LinearMath/btConvexHull.h \
+		LinearMath/btConvexHullComputer.cpp \
+		LinearMath/btConvexHullComputer.h \
+		LinearMath/btAabbUtil2.h \
+		LinearMath/btGeometryUtil.h \
+		LinearMath/btQuadWord.h \
+		LinearMath/btPoolAllocator.h \
+		LinearMath/btScalar.h \
+		LinearMath/btMinMax.h \
+		LinearMath/btVector3.h \
+		LinearMath/btList.h \
+		LinearMath/btStackAlloc.h \
+		LinearMath/btMatrix3x3.h \
+		LinearMath/btMotionState.h \
+		LinearMath/btAlignedAllocator.h \
+		LinearMath/btQuaternion.h \
+		LinearMath/btAlignedObjectArray.h \
+		LinearMath/btQuickprof.h \
+		LinearMath/btSerializer.h \
+		LinearMath/btTransformUtil.h \
+		LinearMath/btTransform.h \
+		LinearMath/btDefaultMotionState.h \
+		LinearMath/btIDebugDraw.h \
+		LinearMath/btRandom.h
+
+
+libbulletcollision_la_SOURCES = \
+		BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \
+		BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \
+		BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \
+		BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \
+		BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \
+		BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp \
+		BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \
+		BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btCollisionObject.cpp \
+		BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btGhostObject.cpp \
+		BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \
+		BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \
+		BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \
+		BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp \
+		BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \
+		BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp \
+		BulletCollision/CollisionDispatch/btManifoldResult.cpp \
+		BulletCollision/CollisionDispatch/btCollisionWorld.cpp \
+		BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btUnionFind.cpp \
+		BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \
+		BulletCollision/CollisionShapes/btTetrahedronShape.cpp \
+		BulletCollision/CollisionShapes/btShapeHull.cpp \
+		BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp \
+		BulletCollision/CollisionShapes/btCompoundShape.cpp \
+		BulletCollision/CollisionShapes/btConeShape.cpp \
+		BulletCollision/CollisionShapes/btMultiSphereShape.cpp \
+		BulletCollision/CollisionShapes/btUniformScalingShape.cpp \
+		BulletCollision/CollisionShapes/btSphereShape.cpp \
+		BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp \
+		BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btTriangleBuffer.cpp \
+		BulletCollision/CollisionShapes/btStaticPlaneShape.cpp \
+		BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \
+		BulletCollision/CollisionShapes/btEmptyShape.cpp \
+		BulletCollision/CollisionShapes/btCollisionShape.cpp \
+		BulletCollision/CollisionShapes/btConvexShape.cpp \
+		BulletCollision/CollisionShapes/btConvex2dShape.cpp \
+		BulletCollision/CollisionShapes/btConvexInternalShape.cpp \
+		BulletCollision/CollisionShapes/btConvexHullShape.cpp \
+		BulletCollision/CollisionShapes/btConvexPolyhedron.cpp \
+		BulletCollision/CollisionShapes/btConvexPolyhedron.h \
+		BulletCollision/CollisionShapes/btTriangleCallback.cpp \
+		BulletCollision/CollisionShapes/btCapsuleShape.cpp \
+		BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btConcaveShape.cpp \
+		BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp \
+		BulletCollision/CollisionShapes/btBoxShape.cpp \
+		BulletCollision/CollisionShapes/btBox2dShape.cpp \
+		BulletCollision/CollisionShapes/btOptimizedBvh.cpp \
+		BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp \
+		BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btCylinderShape.cpp \
+		BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btStridingMeshInterface.cpp \
+		BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp \
+		BulletCollision/CollisionShapes/btTriangleMesh.cpp \
+		BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \
+		BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \
+		BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp \
+		BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \
+		BulletCollision/BroadphaseCollision/btDispatcher.cpp \
+		BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \
+		BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \
+		BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \
+		BulletCollision/BroadphaseCollision/btDbvt.cpp \
+		BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \
+		BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \
+		BulletCollision/NarrowPhaseCollision/btConvexCast.h \
+		BulletCollision/NarrowPhaseCollision/btGjkEpa2.h \
+		BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \
+		BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \
+		BulletCollision/NarrowPhaseCollision/btPointCollector.h \
+		BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp \
+		BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h \
+		BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \
+		BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \
+		BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \
+		BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \
+		BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \
+		BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \
+		BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \
+		BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \
+		BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \
+		BulletCollision/CollisionDispatch/btCollisionObject.h \
+		BulletCollision/CollisionDispatch/btGhostObject.h \
+		BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \
+		BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \
+		BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h \
+		BulletCollision/CollisionDispatch/btBoxBoxDetector.h \
+		BulletCollision/CollisionDispatch/btCollisionDispatcher.h \
+		BulletCollision/CollisionDispatch/SphereTriangleDetector.h \
+		BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btUnionFind.h \
+		BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btSimulationIslandManager.h \
+		BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \
+		BulletCollision/CollisionDispatch/btCollisionWorld.h \
+		BulletCollision/CollisionDispatch/btInternalEdgeUtility.h \
+		BulletCollision/CollisionDispatch/btManifoldResult.h \
+		BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btCollisionConfiguration.h \
+		BulletCollision/CollisionShapes/btConvexShape.h \
+		BulletCollision/CollisionShapes/btConvex2dShape.h \
+		BulletCollision/CollisionShapes/btTriangleCallback.h \
+		BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \
+		BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btCompoundShape.h \
+		BulletCollision/CollisionShapes/btBoxShape.h \
+		BulletCollision/CollisionShapes/btBox2dShape.h \
+		BulletCollision/CollisionShapes/btMultiSphereShape.h \
+		BulletCollision/CollisionShapes/btCollisionMargin.h \
+		BulletCollision/CollisionShapes/btConcaveShape.h \
+		BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btEmptyShape.h \
+		BulletCollision/CollisionShapes/btUniformScalingShape.h \
+		BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btMaterial.h \
+		BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \
+		BulletCollision/CollisionShapes/btSphereShape.h \
+		BulletCollision/CollisionShapes/btConvexPointCloudShape.h \
+		BulletCollision/CollisionShapes/btCapsuleShape.h \
+		BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h \
+		BulletCollision/CollisionShapes/btCollisionShape.h \
+		BulletCollision/CollisionShapes/btStaticPlaneShape.h \
+		BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btStridingMeshInterface.h \
+		BulletCollision/CollisionShapes/btTriangleInfoMap.h \
+		BulletCollision/CollisionShapes/btTriangleMesh.h \
+		BulletCollision/CollisionShapes/btTriangleBuffer.h \
+		BulletCollision/CollisionShapes/btShapeHull.h \
+		BulletCollision/CollisionShapes/btMinkowskiSumShape.h \
+		BulletCollision/CollisionShapes/btOptimizedBvh.h \
+		BulletCollision/CollisionShapes/btTriangleShape.h \
+		BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h \
+		BulletCollision/CollisionShapes/btCylinderShape.h \
+		BulletCollision/CollisionShapes/btTetrahedronShape.h \
+		BulletCollision/CollisionShapes/btConvexInternalShape.h \
+		BulletCollision/CollisionShapes/btConeShape.h \
+		BulletCollision/CollisionShapes/btConvexHullShape.h \
+		BulletCollision/BroadphaseCollision/btAxisSweep3.h \
+		BulletCollision/BroadphaseCollision/btDbvtBroadphase.h \
+		BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \
+		BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h \
+		BulletCollision/BroadphaseCollision/btDbvt.h \
+		BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \
+		BulletCollision/BroadphaseCollision/btDispatcher.h \
+		BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \
+		BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \
+		BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \
+		BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \
+		BulletCollision/BroadphaseCollision/btQuantizedBvh.h \
+		BulletCollision/Gimpact/btGImpactBvh.cpp\
+                BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp\
+                BulletCollision/Gimpact/btTriangleShapeEx.cpp\
+                BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp\
+                BulletCollision/Gimpact/btGImpactShape.cpp\
+                BulletCollision/Gimpact/gim_box_set.cpp\
+                BulletCollision/Gimpact/gim_contact.cpp\
+                BulletCollision/Gimpact/gim_memory.cpp\
+                BulletCollision/Gimpact/gim_tri_collision.cpp \
+		BulletCollision/Gimpact/btBoxCollision.h \
+		BulletCollision/Gimpact/btGenericPoolAllocator.h  \
+		BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h  \
+		BulletCollision/Gimpact/btGImpactShape.h \
+		BulletCollision/Gimpact/btClipPolygon.h \
+		BulletCollision/Gimpact/btGeometryOperations.h \
+		BulletCollision/Gimpact/btGImpactMassUtil.h \
+		BulletCollision/Gimpact/btQuantization.h \
+		BulletCollision/Gimpact/btContactProcessing.h \
+		BulletCollision/Gimpact/btGImpactBvh.h \
+		BulletCollision/Gimpact/btGImpactQuantizedBvh.h \
+		BulletCollision/Gimpact/btTriangleShapeEx.h \
+		BulletCollision/Gimpact/gim_array.h \
+		BulletCollision/Gimpact/gim_box_collision.h  \
+		BulletCollision/Gimpact/gim_contact.h \
+		BulletCollision/Gimpact/gim_hash_table.h \
+		BulletCollision/Gimpact/gim_memory.h \
+		BulletCollision/Gimpact/gim_basic_geometry_operations.h \
+		BulletCollision/Gimpact/gim_box_set.h \
+		BulletCollision/Gimpact/gim_geometry.h \
+		BulletCollision/Gimpact/gim_linear_math.h \
+		BulletCollision/Gimpact/gim_radixsort.h \
+		BulletCollision/Gimpact/gim_bitset.h \
+		BulletCollision/Gimpact/gim_clip_polygon.h \
+		BulletCollision/Gimpact/gim_geom_types.h \
+		BulletCollision/Gimpact/gim_math.h \
+		BulletCollision/Gimpact/gim_tri_collision.h
+
+
+libbulletdynamics_la_SOURCES = \
+		BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp \
+		BulletDynamics/Dynamics/btRigidBody.cpp \
+		BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp \
+		BulletDynamics/Dynamics/Bullet-C-API.cpp \
+		BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp \
+		BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btContactConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btSliderConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btHingeConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp \
+		BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \
+		BulletDynamics/Vehicle/btWheelInfo.cpp \
+		BulletDynamics/Vehicle/btRaycastVehicle.cpp \
+		BulletDynamics/Character/btKinematicCharacterController.cpp \
+		BulletDynamics/Character/btKinematicCharacterController.h \
+		BulletDynamics/Character/btCharacterControllerInterface.h \
+		BulletDynamics/Dynamics/btActionInterface.h \
+		BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \
+		BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \
+		Bullet-C-Api.h \
+		btBulletDynamicsCommon.h \
+		btBulletCollisionCommon.h \
+		BulletDynamics/Dynamics/btRigidBody.h \
+		BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \
+		BulletDynamics/Dynamics/btDynamicsWorld.h \
+		BulletDynamics/ConstraintSolver/btSolverBody.h \
+		BulletDynamics/ConstraintSolver/btConstraintSolver.h \
+		BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \
+		BulletDynamics/ConstraintSolver/btTypedConstraint.h \
+		BulletDynamics/ConstraintSolver/btContactSolverInfo.h \
+		BulletDynamics/ConstraintSolver/btContactConstraint.h \
+		BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \
+		BulletDynamics/ConstraintSolver/btJacobianEntry.h \
+		BulletDynamics/ConstraintSolver/btSolverConstraint.h \
+		BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \
+		BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \
+		BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h \
+		BulletDynamics/ConstraintSolver/btSliderConstraint.h \
+		BulletDynamics/ConstraintSolver/btHingeConstraint.h \
+		BulletDynamics/ConstraintSolver/btHinge2Constraint.h \
+		BulletDynamics/ConstraintSolver/btUniversalConstraint.h \
+		BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \
+		BulletDynamics/Vehicle/btVehicleRaycaster.h \
+		BulletDynamics/Vehicle/btRaycastVehicle.h \
+		BulletDynamics/Vehicle/btWheelInfo.h
diff --git a/hkl3d/bullet/src/Makefile.in b/hkl3d/bullet/src/Makefile.in
new file mode 100644
index 0000000..c1889a1
--- /dev/null
+++ b/hkl3d/bullet/src/Makefile.in
@@ -0,0 +1,2212 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = hkl3d/bullet/src
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libbulletcollision_la_LIBADD =
+am_libbulletcollision_la_OBJECTS = btRaycastCallback.lo \
+	btMinkowskiPenetrationDepthSolver.lo btSubSimplexConvexCast.lo \
+	btGjkEpaPenetrationDepthSolver.lo btGjkConvexCast.lo \
+	btPersistentManifold.lo btConvexCast.lo \
+	btContinuousConvexCollision.lo btGjkPairDetector.lo \
+	btGjkEpa2.lo btVoronoiSimplexSolver.lo \
+	btActivatingCollisionAlgorithm.lo btCollisionObject.lo \
+	btEmptyCollisionAlgorithm.lo btGhostObject.lo \
+	btSphereSphereCollisionAlgorithm.lo \
+	btSphereBoxCollisionAlgorithm.lo btCollisionDispatcher.lo \
+	btDefaultCollisionConfiguration.lo \
+	btSimulationIslandManager.lo btBoxBoxDetector.lo \
+	btConvexPlaneCollisionAlgorithm.lo \
+	btConvexConcaveCollisionAlgorithm.lo \
+	btBoxBoxCollisionAlgorithm.lo \
+	btBox2dBox2dCollisionAlgorithm.lo SphereTriangleDetector.lo \
+	btInternalEdgeUtility.lo btManifoldResult.lo \
+	btCollisionWorld.lo btSphereTriangleCollisionAlgorithm.lo \
+	btConvexConvexAlgorithm.lo btConvex2dConvex2dAlgorithm.lo \
+	btUnionFind.lo btCompoundCollisionAlgorithm.lo \
+	btTetrahedronShape.lo btShapeHull.lo btMinkowskiSumShape.lo \
+	btCompoundShape.lo btConeShape.lo btMultiSphereShape.lo \
+	btUniformScalingShape.lo btSphereShape.lo \
+	btTriangleIndexVertexArray.lo btBvhTriangleMeshShape.lo \
+	btTriangleMeshShape.lo btTriangleBuffer.lo \
+	btStaticPlaneShape.lo btPolyhedralConvexShape.lo \
+	btEmptyShape.lo btCollisionShape.lo btConvexShape.lo \
+	btConvex2dShape.lo btConvexInternalShape.lo \
+	btConvexHullShape.lo btConvexPolyhedron.lo \
+	btTriangleCallback.lo btCapsuleShape.lo \
+	btConvexTriangleMeshShape.lo btConcaveShape.lo \
+	btConvexPointCloudShape.lo btBoxShape.lo btBox2dShape.lo \
+	btOptimizedBvh.lo btHeightfieldTerrainShape.lo \
+	btMultimaterialTriangleMeshShape.lo btCylinderShape.lo \
+	btScaledBvhTriangleMeshShape.lo btStridingMeshInterface.lo \
+	btTriangleIndexVertexMaterialArray.lo btTriangleMesh.lo \
+	btAxisSweep3.lo btOverlappingPairCache.lo btDbvtBroadphase.lo \
+	btMultiSapBroadphase.lo btDispatcher.lo btBroadphaseProxy.lo \
+	btQuantizedBvh.lo btCollisionAlgorithm.lo btDbvt.lo \
+	btSimpleBroadphase.lo btPolyhedralContactClipping.lo \
+	btGImpactBvh.lo btGImpactQuantizedBvh.lo btTriangleShapeEx.lo \
+	btGImpactCollisionAlgorithm.lo btGImpactShape.lo \
+	gim_box_set.lo gim_contact.lo gim_memory.lo \
+	gim_tri_collision.lo
+libbulletcollision_la_OBJECTS = $(am_libbulletcollision_la_OBJECTS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+ at CONDITIONAL_BUILD_MULTITHREADED_FALSE@am_libbulletcollision_la_rpath =
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletcollision_la_rpath =
+libbulletdynamics_la_LIBADD =
+am_libbulletdynamics_la_OBJECTS = btContinuousDynamicsWorld.lo \
+	btRigidBody.lo btSimpleDynamicsWorld.lo Bullet-C-API.lo \
+	btDiscreteDynamicsWorld.lo btGeneric6DofConstraint.lo \
+	btGeneric6DofSpringConstraint.lo btSolve2LinearConstraint.lo \
+	btPoint2PointConstraint.lo btTypedConstraint.lo \
+	btContactConstraint.lo btSliderConstraint.lo \
+	btConeTwistConstraint.lo btHingeConstraint.lo \
+	btHinge2Constraint.lo btUniversalConstraint.lo \
+	btSequentialImpulseConstraintSolver.lo btWheelInfo.lo \
+	btRaycastVehicle.lo btKinematicCharacterController.lo
+libbulletdynamics_la_OBJECTS = $(am_libbulletdynamics_la_OBJECTS)
+ at CONDITIONAL_BUILD_MULTITHREADED_FALSE@am_libbulletdynamics_la_rpath =
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletdynamics_la_rpath =
+libbulletmath_la_LIBADD =
+am_libbulletmath_la_OBJECTS = btQuickprof.lo btGeometryUtil.lo \
+	btAlignedAllocator.lo btSerializer.lo btConvexHull.lo \
+	btConvexHullComputer.lo
+libbulletmath_la_OBJECTS = $(am_libbulletmath_la_OBJECTS)
+ at CONDITIONAL_BUILD_MULTITHREADED_FALSE@am_libbulletmath_la_rpath =
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletmath_la_rpath =
+libbulletmultithreaded_la_LIBADD =
+am__libbulletmultithreaded_la_SOURCES_DIST = BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h \
+	BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp \
+	BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h \
+	BulletMultiThreaded/HeapManager.h \
+	BulletMultiThreaded/SpuCollisionObjectWrapper.cpp \
+	BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp \
+	BulletMultiThreaded/SpuLibspe2Support.cpp \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp \
+	BulletMultiThreaded/btThreadSupportInterface.cpp \
+	BulletMultiThreaded/SequentialThreadSupport.cpp \
+	BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp \
+	BulletMultiThreaded/Win32ThreadSupport.cpp \
+	BulletMultiThreaded/SpuFakeDma.cpp \
+	BulletMultiThreaded/PosixThreadSupport.cpp \
+	BulletMultiThreaded/SpuCollisionTaskProcess.cpp \
+	BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp \
+	BulletMultiThreaded/SpuSampleTaskProcess.cpp \
+	BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h \
+	BulletMultiThreaded/PpuAddressSpace.h \
+	BulletMultiThreaded/SpuSampleTaskProcess.h \
+	BulletMultiThreaded/SequentialThreadSupport.h \
+	BulletMultiThreaded/PlatformDefinitions.h \
+	BulletMultiThreaded/Win32ThreadSupport.h \
+	BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h \
+	BulletMultiThreaded/btThreadSupportInterface.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h \
+	BulletMultiThreaded/SpuGatheringCollisionDispatcher.h \
+	BulletMultiThreaded/SpuFakeDma.h BulletMultiThreaded/SpuSync.h \
+	BulletMultiThreaded/TrbDynBody.h \
+	BulletMultiThreaded/TrbStateVec.h \
+	BulletMultiThreaded/SpuCollisionObjectWrapper.h \
+	BulletMultiThreaded/SpuDoubleBuffer.h \
+	BulletMultiThreaded/SpuCollisionTaskProcess.h \
+	BulletMultiThreaded/PosixThreadSupport.h \
+	BulletMultiThreaded/SpuLibspe2Support.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h \
+	BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletmultithreaded_la_OBJECTS = libbulletmultithreaded_la-btSoftBodySolver_CPU.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuSampleTask.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuLibspe2Support.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuContactResult.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuGatheringCollisionTask.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuCollisionShapes.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-btThreadSupportInterface.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SequentialThreadSupport.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-Win32ThreadSupport.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuFakeDma.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-PosixThreadSupport.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuCollisionTaskProcess.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-SpuSampleTaskProcess.lo \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@	libbulletmultithreaded_la-boxBoxDistance.lo
+libbulletmultithreaded_la_OBJECTS =  \
+	$(am_libbulletmultithreaded_la_OBJECTS)
+libbulletmultithreaded_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
+	$(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@am_libbulletmultithreaded_la_rpath =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_ at AM_V@)
+am__v_CXX_ = $(am__v_CXX_ at AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_ at AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_ at AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(libbulletcollision_la_SOURCES) \
+	$(libbulletdynamics_la_SOURCES) $(libbulletmath_la_SOURCES) \
+	$(libbulletmultithreaded_la_SOURCES)
+DIST_SOURCES = $(libbulletcollision_la_SOURCES) \
+	$(libbulletdynamics_la_SOURCES) $(libbulletmath_la_SOURCES) \
+	$(am__libbulletmultithreaded_la_SOURCES_DIST)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+ at CONDITIONAL_BUILD_MULTITHREADED_FALSE@noinst_LTLIBRARIES = libbulletmath.la libbulletcollision.la libbulletdynamics.la
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@noinst_LTLIBRARIES = libbulletmath.la libbulletcollision.la libbulletdynamics.la libbulletmultithreaded.la
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@libbulletmultithreaded_la_CXXFLAGS = -I./BulletMultiThreaded/vectormath/scalar/cpp
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@libbulletmultithreaded_la_SOURCES = \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolverData.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/HeapManager.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuCollisionObjectWrapper.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuLibspe2Support.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/btThreadSupportInterface.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SequentialThreadSupport.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/Win32ThreadSupport.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuFakeDma.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/PosixThreadSupport.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuCollisionTaskProcess.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSampleTaskProcess.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/PpuAddressSpace.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSampleTaskProcess.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SequentialThreadSupport.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/PlatformDefinitions.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/Win32ThreadSupport.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/btThreadSupportInterface.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuGatheringCollisionDispatcher.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuFakeDma.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuSync.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/TrbDynBody.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/TrbStateVec.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuCollisionObjectWrapper.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuDoubleBuffer.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuCollisionTaskProcess.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/PosixThreadSupport.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuLibspe2Support.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h \
+ at CONDITIONAL_BUILD_MULTITHREADED_TRUE@		BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h
+
+libbulletmath_la_SOURCES = \
+		LinearMath/btQuickprof.cpp \
+		LinearMath/btGeometryUtil.cpp \
+		LinearMath/btAlignedAllocator.cpp \
+		LinearMath/btSerializer.cpp \
+		LinearMath/btConvexHull.cpp \
+		LinearMath/btHashMap.h \
+		LinearMath/btConvexHull.h \
+		LinearMath/btConvexHullComputer.cpp \
+		LinearMath/btConvexHullComputer.h \
+		LinearMath/btAabbUtil2.h \
+		LinearMath/btGeometryUtil.h \
+		LinearMath/btQuadWord.h \
+		LinearMath/btPoolAllocator.h \
+		LinearMath/btScalar.h \
+		LinearMath/btMinMax.h \
+		LinearMath/btVector3.h \
+		LinearMath/btList.h \
+		LinearMath/btStackAlloc.h \
+		LinearMath/btMatrix3x3.h \
+		LinearMath/btMotionState.h \
+		LinearMath/btAlignedAllocator.h \
+		LinearMath/btQuaternion.h \
+		LinearMath/btAlignedObjectArray.h \
+		LinearMath/btQuickprof.h \
+		LinearMath/btSerializer.h \
+		LinearMath/btTransformUtil.h \
+		LinearMath/btTransform.h \
+		LinearMath/btDefaultMotionState.h \
+		LinearMath/btIDebugDraw.h \
+		LinearMath/btRandom.h
+
+libbulletcollision_la_SOURCES = \
+		BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp \
+		BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp \
+		BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp \
+		BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp \
+		BulletCollision/NarrowPhaseCollision/btConvexCast.cpp \
+		BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp \
+		BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp \
+		BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btCollisionObject.cpp \
+		BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btGhostObject.cpp \
+		BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp \
+		BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp \
+		BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp \
+		BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp \
+		BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp \
+		BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp \
+		BulletCollision/CollisionDispatch/btManifoldResult.cpp \
+		BulletCollision/CollisionDispatch/btCollisionWorld.cpp \
+		BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp \
+		BulletCollision/CollisionDispatch/btUnionFind.cpp \
+		BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp \
+		BulletCollision/CollisionShapes/btTetrahedronShape.cpp \
+		BulletCollision/CollisionShapes/btShapeHull.cpp \
+		BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp \
+		BulletCollision/CollisionShapes/btCompoundShape.cpp \
+		BulletCollision/CollisionShapes/btConeShape.cpp \
+		BulletCollision/CollisionShapes/btMultiSphereShape.cpp \
+		BulletCollision/CollisionShapes/btUniformScalingShape.cpp \
+		BulletCollision/CollisionShapes/btSphereShape.cpp \
+		BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp \
+		BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btTriangleBuffer.cpp \
+		BulletCollision/CollisionShapes/btStaticPlaneShape.cpp \
+		BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp \
+		BulletCollision/CollisionShapes/btEmptyShape.cpp \
+		BulletCollision/CollisionShapes/btCollisionShape.cpp \
+		BulletCollision/CollisionShapes/btConvexShape.cpp \
+		BulletCollision/CollisionShapes/btConvex2dShape.cpp \
+		BulletCollision/CollisionShapes/btConvexInternalShape.cpp \
+		BulletCollision/CollisionShapes/btConvexHullShape.cpp \
+		BulletCollision/CollisionShapes/btConvexPolyhedron.cpp \
+		BulletCollision/CollisionShapes/btConvexPolyhedron.h \
+		BulletCollision/CollisionShapes/btTriangleCallback.cpp \
+		BulletCollision/CollisionShapes/btCapsuleShape.cpp \
+		BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btConcaveShape.cpp \
+		BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp \
+		BulletCollision/CollisionShapes/btBoxShape.cpp \
+		BulletCollision/CollisionShapes/btBox2dShape.cpp \
+		BulletCollision/CollisionShapes/btOptimizedBvh.cpp \
+		BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp \
+		BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btCylinderShape.cpp \
+		BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp \
+		BulletCollision/CollisionShapes/btStridingMeshInterface.cpp \
+		BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp \
+		BulletCollision/CollisionShapes/btTriangleMesh.cpp \
+		BulletCollision/BroadphaseCollision/btAxisSweep3.cpp \
+		BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp \
+		BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp \
+		BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp \
+		BulletCollision/BroadphaseCollision/btDispatcher.cpp \
+		BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp \
+		BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp \
+		BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp \
+		BulletCollision/BroadphaseCollision/btDbvt.cpp \
+		BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp \
+		BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h \
+		BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h \
+		BulletCollision/NarrowPhaseCollision/btConvexCast.h \
+		BulletCollision/NarrowPhaseCollision/btGjkEpa2.h \
+		BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h \
+		BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h \
+		BulletCollision/NarrowPhaseCollision/btPointCollector.h \
+		BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp \
+		BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h \
+		BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h \
+		BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h \
+		BulletCollision/NarrowPhaseCollision/btRaycastCallback.h \
+		BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h \
+		BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h \
+		BulletCollision/NarrowPhaseCollision/btPersistentManifold.h \
+		BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h \
+		BulletCollision/NarrowPhaseCollision/btManifoldPoint.h \
+		BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h \
+		BulletCollision/CollisionDispatch/btCollisionObject.h \
+		BulletCollision/CollisionDispatch/btGhostObject.h \
+		BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btCollisionCreateFunc.h \
+		BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h \
+		BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h \
+		BulletCollision/CollisionDispatch/btBoxBoxDetector.h \
+		BulletCollision/CollisionDispatch/btCollisionDispatcher.h \
+		BulletCollision/CollisionDispatch/SphereTriangleDetector.h \
+		BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btUnionFind.h \
+		BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btSimulationIslandManager.h \
+		BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h \
+		BulletCollision/CollisionDispatch/btCollisionWorld.h \
+		BulletCollision/CollisionDispatch/btInternalEdgeUtility.h \
+		BulletCollision/CollisionDispatch/btManifoldResult.h \
+		BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h \
+		BulletCollision/CollisionDispatch/btCollisionConfiguration.h \
+		BulletCollision/CollisionShapes/btConvexShape.h \
+		BulletCollision/CollisionShapes/btConvex2dShape.h \
+		BulletCollision/CollisionShapes/btTriangleCallback.h \
+		BulletCollision/CollisionShapes/btPolyhedralConvexShape.h \
+		BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btCompoundShape.h \
+		BulletCollision/CollisionShapes/btBoxShape.h \
+		BulletCollision/CollisionShapes/btBox2dShape.h \
+		BulletCollision/CollisionShapes/btMultiSphereShape.h \
+		BulletCollision/CollisionShapes/btCollisionMargin.h \
+		BulletCollision/CollisionShapes/btConcaveShape.h \
+		BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btEmptyShape.h \
+		BulletCollision/CollisionShapes/btUniformScalingShape.h \
+		BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btMaterial.h \
+		BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h \
+		BulletCollision/CollisionShapes/btSphereShape.h \
+		BulletCollision/CollisionShapes/btConvexPointCloudShape.h \
+		BulletCollision/CollisionShapes/btCapsuleShape.h \
+		BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h \
+		BulletCollision/CollisionShapes/btCollisionShape.h \
+		BulletCollision/CollisionShapes/btStaticPlaneShape.h \
+		BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btTriangleMeshShape.h \
+		BulletCollision/CollisionShapes/btStridingMeshInterface.h \
+		BulletCollision/CollisionShapes/btTriangleInfoMap.h \
+		BulletCollision/CollisionShapes/btTriangleMesh.h \
+		BulletCollision/CollisionShapes/btTriangleBuffer.h \
+		BulletCollision/CollisionShapes/btShapeHull.h \
+		BulletCollision/CollisionShapes/btMinkowskiSumShape.h \
+		BulletCollision/CollisionShapes/btOptimizedBvh.h \
+		BulletCollision/CollisionShapes/btTriangleShape.h \
+		BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h \
+		BulletCollision/CollisionShapes/btCylinderShape.h \
+		BulletCollision/CollisionShapes/btTetrahedronShape.h \
+		BulletCollision/CollisionShapes/btConvexInternalShape.h \
+		BulletCollision/CollisionShapes/btConeShape.h \
+		BulletCollision/CollisionShapes/btConvexHullShape.h \
+		BulletCollision/BroadphaseCollision/btAxisSweep3.h \
+		BulletCollision/BroadphaseCollision/btDbvtBroadphase.h \
+		BulletCollision/BroadphaseCollision/btSimpleBroadphase.h \
+		BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h \
+		BulletCollision/BroadphaseCollision/btDbvt.h \
+		BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h \
+		BulletCollision/BroadphaseCollision/btDispatcher.h \
+		BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h \
+		BulletCollision/BroadphaseCollision/btBroadphaseProxy.h \
+		BulletCollision/BroadphaseCollision/btOverlappingPairCache.h \
+		BulletCollision/BroadphaseCollision/btBroadphaseInterface.h \
+		BulletCollision/BroadphaseCollision/btQuantizedBvh.h \
+		BulletCollision/Gimpact/btGImpactBvh.cpp\
+                BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp\
+                BulletCollision/Gimpact/btTriangleShapeEx.cpp\
+                BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp\
+                BulletCollision/Gimpact/btGImpactShape.cpp\
+                BulletCollision/Gimpact/gim_box_set.cpp\
+                BulletCollision/Gimpact/gim_contact.cpp\
+                BulletCollision/Gimpact/gim_memory.cpp\
+                BulletCollision/Gimpact/gim_tri_collision.cpp \
+		BulletCollision/Gimpact/btBoxCollision.h \
+		BulletCollision/Gimpact/btGenericPoolAllocator.h  \
+		BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h  \
+		BulletCollision/Gimpact/btGImpactShape.h \
+		BulletCollision/Gimpact/btClipPolygon.h \
+		BulletCollision/Gimpact/btGeometryOperations.h \
+		BulletCollision/Gimpact/btGImpactMassUtil.h \
+		BulletCollision/Gimpact/btQuantization.h \
+		BulletCollision/Gimpact/btContactProcessing.h \
+		BulletCollision/Gimpact/btGImpactBvh.h \
+		BulletCollision/Gimpact/btGImpactQuantizedBvh.h \
+		BulletCollision/Gimpact/btTriangleShapeEx.h \
+		BulletCollision/Gimpact/gim_array.h \
+		BulletCollision/Gimpact/gim_box_collision.h  \
+		BulletCollision/Gimpact/gim_contact.h \
+		BulletCollision/Gimpact/gim_hash_table.h \
+		BulletCollision/Gimpact/gim_memory.h \
+		BulletCollision/Gimpact/gim_basic_geometry_operations.h \
+		BulletCollision/Gimpact/gim_box_set.h \
+		BulletCollision/Gimpact/gim_geometry.h \
+		BulletCollision/Gimpact/gim_linear_math.h \
+		BulletCollision/Gimpact/gim_radixsort.h \
+		BulletCollision/Gimpact/gim_bitset.h \
+		BulletCollision/Gimpact/gim_clip_polygon.h \
+		BulletCollision/Gimpact/gim_geom_types.h \
+		BulletCollision/Gimpact/gim_math.h \
+		BulletCollision/Gimpact/gim_tri_collision.h
+
+libbulletdynamics_la_SOURCES = \
+		BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp \
+		BulletDynamics/Dynamics/btRigidBody.cpp \
+		BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp \
+		BulletDynamics/Dynamics/Bullet-C-API.cpp \
+		BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp \
+		BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btTypedConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btContactConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btSliderConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btHingeConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp \
+		BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp \
+		BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp \
+		BulletDynamics/Vehicle/btWheelInfo.cpp \
+		BulletDynamics/Vehicle/btRaycastVehicle.cpp \
+		BulletDynamics/Character/btKinematicCharacterController.cpp \
+		BulletDynamics/Character/btKinematicCharacterController.h \
+		BulletDynamics/Character/btCharacterControllerInterface.h \
+		BulletDynamics/Dynamics/btActionInterface.h \
+		BulletDynamics/Dynamics/btContinuousDynamicsWorld.h \
+		BulletDynamics/Dynamics/btSimpleDynamicsWorld.h \
+		Bullet-C-Api.h \
+		btBulletDynamicsCommon.h \
+		btBulletCollisionCommon.h \
+		BulletDynamics/Dynamics/btRigidBody.h \
+		BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h \
+		BulletDynamics/Dynamics/btDynamicsWorld.h \
+		BulletDynamics/ConstraintSolver/btSolverBody.h \
+		BulletDynamics/ConstraintSolver/btConstraintSolver.h \
+		BulletDynamics/ConstraintSolver/btConeTwistConstraint.h \
+		BulletDynamics/ConstraintSolver/btTypedConstraint.h \
+		BulletDynamics/ConstraintSolver/btContactSolverInfo.h \
+		BulletDynamics/ConstraintSolver/btContactConstraint.h \
+		BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h \
+		BulletDynamics/ConstraintSolver/btJacobianEntry.h \
+		BulletDynamics/ConstraintSolver/btSolverConstraint.h \
+		BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h \
+		BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h \
+		BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h \
+		BulletDynamics/ConstraintSolver/btSliderConstraint.h \
+		BulletDynamics/ConstraintSolver/btHingeConstraint.h \
+		BulletDynamics/ConstraintSolver/btHinge2Constraint.h \
+		BulletDynamics/ConstraintSolver/btUniversalConstraint.h \
+		BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h \
+		BulletDynamics/Vehicle/btVehicleRaycaster.h \
+		BulletDynamics/Vehicle/btRaycastVehicle.h \
+		BulletDynamics/Vehicle/btWheelInfo.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu hkl3d/bullet/src/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu hkl3d/bullet/src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libbulletcollision.la: $(libbulletcollision_la_OBJECTS) $(libbulletcollision_la_DEPENDENCIES) $(EXTRA_libbulletcollision_la_DEPENDENCIES) 
+	$(AM_V_CXXLD)$(CXXLINK) $(am_libbulletcollision_la_rpath) $(libbulletcollision_la_OBJECTS) $(libbulletcollision_la_LIBADD) $(LIBS)
+
+libbulletdynamics.la: $(libbulletdynamics_la_OBJECTS) $(libbulletdynamics_la_DEPENDENCIES) $(EXTRA_libbulletdynamics_la_DEPENDENCIES) 
+	$(AM_V_CXXLD)$(CXXLINK) $(am_libbulletdynamics_la_rpath) $(libbulletdynamics_la_OBJECTS) $(libbulletdynamics_la_LIBADD) $(LIBS)
+
+libbulletmath.la: $(libbulletmath_la_OBJECTS) $(libbulletmath_la_DEPENDENCIES) $(EXTRA_libbulletmath_la_DEPENDENCIES) 
+	$(AM_V_CXXLD)$(CXXLINK) $(am_libbulletmath_la_rpath) $(libbulletmath_la_OBJECTS) $(libbulletmath_la_LIBADD) $(LIBS)
+
+libbulletmultithreaded.la: $(libbulletmultithreaded_la_OBJECTS) $(libbulletmultithreaded_la_DEPENDENCIES) $(EXTRA_libbulletmultithreaded_la_DEPENDENCIES) 
+	$(AM_V_CXXLD)$(libbulletmultithreaded_la_LINK) $(am_libbulletmultithreaded_la_rpath) $(libbulletmultithreaded_la_OBJECTS) $(libbulletmultithreaded_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Bullet-C-API.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SphereTriangleDetector.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btActivatingCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btAlignedAllocator.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btAxisSweep3.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBox2dBox2dCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBox2dShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBoxBoxCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBoxBoxDetector.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBoxShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBroadphaseProxy.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btBvhTriangleMeshShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCapsuleShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionDispatcher.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionObject.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCollisionWorld.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCompoundCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCompoundShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConcaveShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConeShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConeTwistConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btContactConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btContinuousConvexCollision.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btContinuousDynamicsWorld.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvex2dConvex2dAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvex2dShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexCast.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexConcaveCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexConvexAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexHull.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexHullComputer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexHullShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexInternalShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexPlaneCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexPointCloudShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexPolyhedron.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btConvexTriangleMeshShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btCylinderShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDbvt.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDbvtBroadphase.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDefaultCollisionConfiguration.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDiscreteDynamicsWorld.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btDispatcher.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btEmptyCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btEmptyShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGImpactBvh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGImpactCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGImpactQuantizedBvh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGImpactShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGeneric6DofConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGeneric6DofSpringConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGeometryUtil.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGhostObject.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGjkConvexCast.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGjkEpa2.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGjkEpaPenetrationDepthSolver.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btGjkPairDetector.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btHeightfieldTerrainShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btHinge2Constraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btHingeConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btInternalEdgeUtility.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btKinematicCharacterController.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btManifoldResult.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMinkowskiPenetrationDepthSolver.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMinkowskiSumShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMultiSapBroadphase.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMultiSphereShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btMultimaterialTriangleMeshShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btOptimizedBvh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btOverlappingPairCache.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btPersistentManifold.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btPoint2PointConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btPolyhedralContactClipping.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btPolyhedralConvexShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btQuantizedBvh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btQuickprof.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btRaycastCallback.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btRaycastVehicle.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btRigidBody.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btScaledBvhTriangleMeshShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSequentialImpulseConstraintSolver.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSerializer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btShapeHull.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSimpleBroadphase.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSimpleDynamicsWorld.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSimulationIslandManager.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSliderConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSolve2LinearConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSphereBoxCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSphereShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSphereSphereCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSphereTriangleCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btStaticPlaneShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btStridingMeshInterface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btSubSimplexConvexCast.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTetrahedronShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleBuffer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleCallback.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleIndexVertexArray.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleIndexVertexMaterialArray.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleMesh.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleMeshShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTriangleShapeEx.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btTypedConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btUniformScalingShape.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btUnionFind.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btUniversalConstraint.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btVoronoiSimplexSolver.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/btWheelInfo.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gim_box_set.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gim_contact.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gim_memory.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gim_tri_collision.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-PosixThreadSupport.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SequentialThreadSupport.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuCollisionObjectWrapper.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuCollisionShapes.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuCollisionTaskProcess.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuContactResult.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuFakeDma.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionTask.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuLibspe2Support.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuSampleTask.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-SpuSampleTaskProcess.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-Win32ThreadSupport.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-boxBoxDistance.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-btSoftBodySolver_CPU.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libbulletmultithreaded_la-btThreadSupportInterface.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+btRaycastCallback.lo: BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btRaycastCallback.lo -MD -MP -MF $(DEPDIR)/btRaycastCallback.Tpo -c -o btRaycastCallback.lo `test -f 'BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btRaycastCallback.Tpo $(DEPDIR)/btRaycastCallback.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp' object='btRaycastCallback.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btRaycastCallback.lo `test -f 'BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
+
+btMinkowskiPenetrationDepthSolver.lo: BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMinkowskiPenetrationDepthSolver.lo -MD -MP -MF $(DEPDIR)/btMinkowskiPenetrationDepthSolver.Tpo -c -o btMinkowskiPenetrationDepthSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPha [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMinkowskiPenetrationDepthSolver.Tpo $(DEPDIR)/btMinkowskiPenetrationDepthSolver.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp' object='btMinkowskiPenetrationDepthSolver.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMinkowskiPenetrationDepthSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
+
+btSubSimplexConvexCast.lo: BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSubSimplexConvexCast.lo -MD -MP -MF $(DEPDIR)/btSubSimplexConvexCast.Tpo -c -o btSubSimplexConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSubSimplexConvexCast.Tpo $(DEPDIR)/btSubSimplexConvexCast.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp' object='btSubSimplexConvexCast.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSubSimplexConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
+
+btGjkEpaPenetrationDepthSolver.lo: BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGjkEpaPenetrationDepthSolver.lo -MD -MP -MF $(DEPDIR)/btGjkEpaPenetrationDepthSolver.Tpo -c -o btGjkEpaPenetrationDepthSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/ [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGjkEpaPenetrationDepthSolver.Tpo $(DEPDIR)/btGjkEpaPenetrationDepthSolver.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp' object='btGjkEpaPenetrationDepthSolver.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGjkEpaPenetrationDepthSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
+
+btGjkConvexCast.lo: BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGjkConvexCast.lo -MD -MP -MF $(DEPDIR)/btGjkConvexCast.Tpo -c -o btGjkConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGjkConvexCast.Tpo $(DEPDIR)/btGjkConvexCast.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp' object='btGjkConvexCast.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGjkConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
+
+btPersistentManifold.lo: BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btPersistentManifold.lo -MD -MP -MF $(DEPDIR)/btPersistentManifold.Tpo -c -o btPersistentManifold.lo `test -f 'BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btPersistentManifold.Tpo $(DEPDIR)/btPersistentManifold.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp' object='btPersistentManifold.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btPersistentManifold.lo `test -f 'BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
+
+btConvexCast.lo: BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexCast.lo -MD -MP -MF $(DEPDIR)/btConvexCast.Tpo -c -o btConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexCast.Tpo $(DEPDIR)/btConvexCast.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btConvexCast.cpp' object='btConvexCast.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexCast.lo `test -f 'BulletCollision/NarrowPhaseCollision/btConvexCast.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btConvexCast.cpp
+
+btContinuousConvexCollision.lo: BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btContinuousConvexCollision.lo -MD -MP -MF $(DEPDIR)/btContinuousConvexCollision.Tpo -c -o btContinuousConvexCollision.lo `test -f 'BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btContinuous [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btContinuousConvexCollision.Tpo $(DEPDIR)/btContinuousConvexCollision.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp' object='btContinuousConvexCollision.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btContinuousConvexCollision.lo `test -f 'BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
+
+btGjkPairDetector.lo: BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGjkPairDetector.lo -MD -MP -MF $(DEPDIR)/btGjkPairDetector.Tpo -c -o btGjkPairDetector.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGjkPairDetector.Tpo $(DEPDIR)/btGjkPairDetector.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp' object='btGjkPairDetector.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGjkPairDetector.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
+
+btGjkEpa2.lo: BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGjkEpa2.lo -MD -MP -MF $(DEPDIR)/btGjkEpa2.Tpo -c -o btGjkEpa2.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGjkEpa2.Tpo $(DEPDIR)/btGjkEpa2.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp' object='btGjkEpa2.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGjkEpa2.lo `test -f 'BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp
+
+btVoronoiSimplexSolver.lo: BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btVoronoiSimplexSolver.lo -MD -MP -MF $(DEPDIR)/btVoronoiSimplexSolver.Tpo -c -o btVoronoiSimplexSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btVoronoiSimplexSolver.Tpo $(DEPDIR)/btVoronoiSimplexSolver.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp' object='btVoronoiSimplexSolver.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btVoronoiSimplexSolver.lo `test -f 'BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
+
+btActivatingCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btActivatingCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btActivatingCollisionAlgorithm.Tpo -c -o btActivatingCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btActi [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btActivatingCollisionAlgorithm.Tpo $(DEPDIR)/btActivatingCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp' object='btActivatingCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btActivatingCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp
+
+btCollisionObject.lo: BulletCollision/CollisionDispatch/btCollisionObject.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionObject.lo -MD -MP -MF $(DEPDIR)/btCollisionObject.Tpo -c -o btCollisionObject.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionObject.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionObject.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionObject.Tpo $(DEPDIR)/btCollisionObject.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btCollisionObject.cpp' object='btCollisionObject.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionObject.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionObject.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionObject.cpp
+
+btEmptyCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btEmptyCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btEmptyCollisionAlgorithm.Tpo -c -o btEmptyCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btEmptyCollisionAlgorithm.Tpo $(DEPDIR)/btEmptyCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp' object='btEmptyCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btEmptyCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp
+
+btGhostObject.lo: BulletCollision/CollisionDispatch/btGhostObject.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGhostObject.lo -MD -MP -MF $(DEPDIR)/btGhostObject.Tpo -c -o btGhostObject.lo `test -f 'BulletCollision/CollisionDispatch/btGhostObject.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btGhostObject.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGhostObject.Tpo $(DEPDIR)/btGhostObject.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btGhostObject.cpp' object='btGhostObject.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGhostObject.lo `test -f 'BulletCollision/CollisionDispatch/btGhostObject.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btGhostObject.cpp
+
+btSphereSphereCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSphereSphereCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btSphereSphereCollisionAlgorithm.Tpo -c -o btSphereSphereCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatc [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSphereSphereCollisionAlgorithm.Tpo $(DEPDIR)/btSphereSphereCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp' object='btSphereSphereCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSphereSphereCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
+
+btSphereBoxCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSphereBoxCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btSphereBoxCollisionAlgorithm.Tpo -c -o btSphereBoxCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSphereBo [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSphereBoxCollisionAlgorithm.Tpo $(DEPDIR)/btSphereBoxCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp' object='btSphereBoxCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSphereBoxCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
+
+btCollisionDispatcher.lo: BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionDispatcher.lo -MD -MP -MF $(DEPDIR)/btCollisionDispatcher.Tpo -c -o btCollisionDispatcher.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionDispatcher.Tpo $(DEPDIR)/btCollisionDispatcher.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp' object='btCollisionDispatcher.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionDispatcher.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
+
+btDefaultCollisionConfiguration.lo: BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDefaultCollisionConfiguration.lo -MD -MP -MF $(DEPDIR)/btDefaultCollisionConfiguration.Tpo -c -o btDefaultCollisionConfiguration.lo `test -f 'BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/bt [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDefaultCollisionConfiguration.Tpo $(DEPDIR)/btDefaultCollisionConfiguration.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp' object='btDefaultCollisionConfiguration.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDefaultCollisionConfiguration.lo `test -f 'BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp
+
+btSimulationIslandManager.lo: BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSimulationIslandManager.lo -MD -MP -MF $(DEPDIR)/btSimulationIslandManager.Tpo -c -o btSimulationIslandManager.lo `test -f 'BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSimulationIslandManager.Tpo $(DEPDIR)/btSimulationIslandManager.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp' object='btSimulationIslandManager.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSimulationIslandManager.lo `test -f 'BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
+
+btBoxBoxDetector.lo: BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBoxBoxDetector.lo -MD -MP -MF $(DEPDIR)/btBoxBoxDetector.Tpo -c -o btBoxBoxDetector.lo `test -f 'BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBoxBoxDetector.Tpo $(DEPDIR)/btBoxBoxDetector.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp' object='btBoxBoxDetector.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBoxBoxDetector.lo `test -f 'BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp
+
+btConvexPlaneCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexPlaneCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btConvexPlaneCollisionAlgorithm.Tpo -c -o btConvexPlaneCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/bt [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexPlaneCollisionAlgorithm.Tpo $(DEPDIR)/btConvexPlaneCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp' object='btConvexPlaneCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexPlaneCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
+
+btConvexConcaveCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexConcaveCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btConvexConcaveCollisionAlgorithm.Tpo -c -o btConvexConcaveCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDis [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexConcaveCollisionAlgorithm.Tpo $(DEPDIR)/btConvexConcaveCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp' object='btConvexConcaveCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexConcaveCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
+
+btBoxBoxCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBoxBoxCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btBoxBoxCollisionAlgorithm.Tpo -c -o btBoxBoxCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgor [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBoxBoxCollisionAlgorithm.Tpo $(DEPDIR)/btBoxBoxCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp' object='btBoxBoxCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBoxBoxCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
+
+btBox2dBox2dCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBox2dBox2dCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btBox2dBox2dCollisionAlgorithm.Tpo -c -o btBox2dBox2dCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBox2 [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBox2dBox2dCollisionAlgorithm.Tpo $(DEPDIR)/btBox2dBox2dCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp' object='btBox2dBox2dCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBox2dBox2dCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
+
+SphereTriangleDetector.lo: BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SphereTriangleDetector.lo -MD -MP -MF $(DEPDIR)/SphereTriangleDetector.Tpo -c -o SphereTriangleDetector.lo `test -f 'BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/SphereTriangleDetector.Tpo $(DEPDIR)/SphereTriangleDetector.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp' object='SphereTriangleDetector.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SphereTriangleDetector.lo `test -f 'BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
+
+btInternalEdgeUtility.lo: BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btInternalEdgeUtility.lo -MD -MP -MF $(DEPDIR)/btInternalEdgeUtility.Tpo -c -o btInternalEdgeUtility.lo `test -f 'BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btInternalEdgeUtility.Tpo $(DEPDIR)/btInternalEdgeUtility.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp' object='btInternalEdgeUtility.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btInternalEdgeUtility.lo `test -f 'BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp
+
+btManifoldResult.lo: BulletCollision/CollisionDispatch/btManifoldResult.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btManifoldResult.lo -MD -MP -MF $(DEPDIR)/btManifoldResult.Tpo -c -o btManifoldResult.lo `test -f 'BulletCollision/CollisionDispatch/btManifoldResult.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btManifoldResult.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btManifoldResult.Tpo $(DEPDIR)/btManifoldResult.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btManifoldResult.cpp' object='btManifoldResult.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btManifoldResult.lo `test -f 'BulletCollision/CollisionDispatch/btManifoldResult.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btManifoldResult.cpp
+
+btCollisionWorld.lo: BulletCollision/CollisionDispatch/btCollisionWorld.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionWorld.lo -MD -MP -MF $(DEPDIR)/btCollisionWorld.Tpo -c -o btCollisionWorld.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionWorld.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionWorld.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionWorld.Tpo $(DEPDIR)/btCollisionWorld.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btCollisionWorld.cpp' object='btCollisionWorld.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionWorld.lo `test -f 'BulletCollision/CollisionDispatch/btCollisionWorld.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCollisionWorld.cpp
+
+btSphereTriangleCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSphereTriangleCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btSphereTriangleCollisionAlgorithm.Tpo -c -o btSphereTriangleCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/Collisio [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSphereTriangleCollisionAlgorithm.Tpo $(DEPDIR)/btSphereTriangleCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp' object='btSphereTriangleCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSphereTriangleCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
+
+btConvexConvexAlgorithm.lo: BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexConvexAlgorithm.lo -MD -MP -MF $(DEPDIR)/btConvexConvexAlgorithm.Tpo -c -o btConvexConvexAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexConvexAlgorithm.Tpo $(DEPDIR)/btConvexConvexAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp' object='btConvexConvexAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexConvexAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
+
+btConvex2dConvex2dAlgorithm.lo: BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvex2dConvex2dAlgorithm.lo -MD -MP -MF $(DEPDIR)/btConvex2dConvex2dAlgorithm.Tpo -c -o btConvex2dConvex2dAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvex2dConvex2d [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvex2dConvex2dAlgorithm.Tpo $(DEPDIR)/btConvex2dConvex2dAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp' object='btConvex2dConvex2dAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvex2dConvex2dAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
+
+btUnionFind.lo: BulletCollision/CollisionDispatch/btUnionFind.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btUnionFind.lo -MD -MP -MF $(DEPDIR)/btUnionFind.Tpo -c -o btUnionFind.lo `test -f 'BulletCollision/CollisionDispatch/btUnionFind.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btUnionFind.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btUnionFind.Tpo $(DEPDIR)/btUnionFind.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btUnionFind.cpp' object='btUnionFind.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btUnionFind.lo `test -f 'BulletCollision/CollisionDispatch/btUnionFind.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btUnionFind.cpp
+
+btCompoundCollisionAlgorithm.lo: BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCompoundCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btCompoundCollisionAlgorithm.Tpo -c -o btCompoundCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCompoundColl [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCompoundCollisionAlgorithm.Tpo $(DEPDIR)/btCompoundCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp' object='btCompoundCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCompoundCollisionAlgorithm.lo `test -f 'BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
+
+btTetrahedronShape.lo: BulletCollision/CollisionShapes/btTetrahedronShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTetrahedronShape.lo -MD -MP -MF $(DEPDIR)/btTetrahedronShape.Tpo -c -o btTetrahedronShape.lo `test -f 'BulletCollision/CollisionShapes/btTetrahedronShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTetrahedronShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTetrahedronShape.Tpo $(DEPDIR)/btTetrahedronShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTetrahedronShape.cpp' object='btTetrahedronShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTetrahedronShape.lo `test -f 'BulletCollision/CollisionShapes/btTetrahedronShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTetrahedronShape.cpp
+
+btShapeHull.lo: BulletCollision/CollisionShapes/btShapeHull.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btShapeHull.lo -MD -MP -MF $(DEPDIR)/btShapeHull.Tpo -c -o btShapeHull.lo `test -f 'BulletCollision/CollisionShapes/btShapeHull.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btShapeHull.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btShapeHull.Tpo $(DEPDIR)/btShapeHull.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btShapeHull.cpp' object='btShapeHull.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btShapeHull.lo `test -f 'BulletCollision/CollisionShapes/btShapeHull.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btShapeHull.cpp
+
+btMinkowskiSumShape.lo: BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMinkowskiSumShape.lo -MD -MP -MF $(DEPDIR)/btMinkowskiSumShape.Tpo -c -o btMinkowskiSumShape.lo `test -f 'BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMinkowskiSumShape.Tpo $(DEPDIR)/btMinkowskiSumShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp' object='btMinkowskiSumShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMinkowskiSumShape.lo `test -f 'BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
+
+btCompoundShape.lo: BulletCollision/CollisionShapes/btCompoundShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCompoundShape.lo -MD -MP -MF $(DEPDIR)/btCompoundShape.Tpo -c -o btCompoundShape.lo `test -f 'BulletCollision/CollisionShapes/btCompoundShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCompoundShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCompoundShape.Tpo $(DEPDIR)/btCompoundShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btCompoundShape.cpp' object='btCompoundShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCompoundShape.lo `test -f 'BulletCollision/CollisionShapes/btCompoundShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCompoundShape.cpp
+
+btConeShape.lo: BulletCollision/CollisionShapes/btConeShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConeShape.lo -MD -MP -MF $(DEPDIR)/btConeShape.Tpo -c -o btConeShape.lo `test -f 'BulletCollision/CollisionShapes/btConeShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConeShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConeShape.Tpo $(DEPDIR)/btConeShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConeShape.cpp' object='btConeShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConeShape.lo `test -f 'BulletCollision/CollisionShapes/btConeShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConeShape.cpp
+
+btMultiSphereShape.lo: BulletCollision/CollisionShapes/btMultiSphereShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMultiSphereShape.lo -MD -MP -MF $(DEPDIR)/btMultiSphereShape.Tpo -c -o btMultiSphereShape.lo `test -f 'BulletCollision/CollisionShapes/btMultiSphereShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMultiSphereShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMultiSphereShape.Tpo $(DEPDIR)/btMultiSphereShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btMultiSphereShape.cpp' object='btMultiSphereShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMultiSphereShape.lo `test -f 'BulletCollision/CollisionShapes/btMultiSphereShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMultiSphereShape.cpp
+
+btUniformScalingShape.lo: BulletCollision/CollisionShapes/btUniformScalingShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btUniformScalingShape.lo -MD -MP -MF $(DEPDIR)/btUniformScalingShape.Tpo -c -o btUniformScalingShape.lo `test -f 'BulletCollision/CollisionShapes/btUniformScalingShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btUniformScalingShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btUniformScalingShape.Tpo $(DEPDIR)/btUniformScalingShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btUniformScalingShape.cpp' object='btUniformScalingShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btUniformScalingShape.lo `test -f 'BulletCollision/CollisionShapes/btUniformScalingShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btUniformScalingShape.cpp
+
+btSphereShape.lo: BulletCollision/CollisionShapes/btSphereShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSphereShape.lo -MD -MP -MF $(DEPDIR)/btSphereShape.Tpo -c -o btSphereShape.lo `test -f 'BulletCollision/CollisionShapes/btSphereShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btSphereShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSphereShape.Tpo $(DEPDIR)/btSphereShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btSphereShape.cpp' object='btSphereShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSphereShape.lo `test -f 'BulletCollision/CollisionShapes/btSphereShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btSphereShape.cpp
+
+btTriangleIndexVertexArray.lo: BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleIndexVertexArray.lo -MD -MP -MF $(DEPDIR)/btTriangleIndexVertexArray.Tpo -c -o btTriangleIndexVertexArray.lo `test -f 'BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleIndexVertexArray.Tpo $(DEPDIR)/btTriangleIndexVertexArray.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp' object='btTriangleIndexVertexArray.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleIndexVertexArray.lo `test -f 'BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
+
+btBvhTriangleMeshShape.lo: BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBvhTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btBvhTriangleMeshShape.Tpo -c -o btBvhTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBvhTriangleMeshShape.Tpo $(DEPDIR)/btBvhTriangleMeshShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp' object='btBvhTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBvhTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
+
+btTriangleMeshShape.lo: BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btTriangleMeshShape.Tpo -c -o btTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleMeshShape.Tpo $(DEPDIR)/btTriangleMeshShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleMeshShape.cpp' object='btTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
+
+btTriangleBuffer.lo: BulletCollision/CollisionShapes/btTriangleBuffer.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleBuffer.lo -MD -MP -MF $(DEPDIR)/btTriangleBuffer.Tpo -c -o btTriangleBuffer.lo `test -f 'BulletCollision/CollisionShapes/btTriangleBuffer.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleBuffer.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleBuffer.Tpo $(DEPDIR)/btTriangleBuffer.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleBuffer.cpp' object='btTriangleBuffer.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleBuffer.lo `test -f 'BulletCollision/CollisionShapes/btTriangleBuffer.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleBuffer.cpp
+
+btStaticPlaneShape.lo: BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btStaticPlaneShape.lo -MD -MP -MF $(DEPDIR)/btStaticPlaneShape.Tpo -c -o btStaticPlaneShape.lo `test -f 'BulletCollision/CollisionShapes/btStaticPlaneShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btStaticPlaneShape.Tpo $(DEPDIR)/btStaticPlaneShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btStaticPlaneShape.cpp' object='btStaticPlaneShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btStaticPlaneShape.lo `test -f 'BulletCollision/CollisionShapes/btStaticPlaneShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
+
+btPolyhedralConvexShape.lo: BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btPolyhedralConvexShape.lo -MD -MP -MF $(DEPDIR)/btPolyhedralConvexShape.Tpo -c -o btPolyhedralConvexShape.lo `test -f 'BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btPolyhedralConvexShape.Tpo $(DEPDIR)/btPolyhedralConvexShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp' object='btPolyhedralConvexShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btPolyhedralConvexShape.lo `test -f 'BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
+
+btEmptyShape.lo: BulletCollision/CollisionShapes/btEmptyShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btEmptyShape.lo -MD -MP -MF $(DEPDIR)/btEmptyShape.Tpo -c -o btEmptyShape.lo `test -f 'BulletCollision/CollisionShapes/btEmptyShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btEmptyShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btEmptyShape.Tpo $(DEPDIR)/btEmptyShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btEmptyShape.cpp' object='btEmptyShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btEmptyShape.lo `test -f 'BulletCollision/CollisionShapes/btEmptyShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btEmptyShape.cpp
+
+btCollisionShape.lo: BulletCollision/CollisionShapes/btCollisionShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionShape.lo -MD -MP -MF $(DEPDIR)/btCollisionShape.Tpo -c -o btCollisionShape.lo `test -f 'BulletCollision/CollisionShapes/btCollisionShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCollisionShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionShape.Tpo $(DEPDIR)/btCollisionShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btCollisionShape.cpp' object='btCollisionShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionShape.lo `test -f 'BulletCollision/CollisionShapes/btCollisionShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCollisionShape.cpp
+
+btConvexShape.lo: BulletCollision/CollisionShapes/btConvexShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexShape.lo -MD -MP -MF $(DEPDIR)/btConvexShape.Tpo -c -o btConvexShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexShape.Tpo $(DEPDIR)/btConvexShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexShape.cpp' object='btConvexShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexShape.cpp
+
+btConvex2dShape.lo: BulletCollision/CollisionShapes/btConvex2dShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvex2dShape.lo -MD -MP -MF $(DEPDIR)/btConvex2dShape.Tpo -c -o btConvex2dShape.lo `test -f 'BulletCollision/CollisionShapes/btConvex2dShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvex2dShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvex2dShape.Tpo $(DEPDIR)/btConvex2dShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvex2dShape.cpp' object='btConvex2dShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvex2dShape.lo `test -f 'BulletCollision/CollisionShapes/btConvex2dShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvex2dShape.cpp
+
+btConvexInternalShape.lo: BulletCollision/CollisionShapes/btConvexInternalShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexInternalShape.lo -MD -MP -MF $(DEPDIR)/btConvexInternalShape.Tpo -c -o btConvexInternalShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexInternalShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexInternalShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexInternalShape.Tpo $(DEPDIR)/btConvexInternalShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexInternalShape.cpp' object='btConvexInternalShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexInternalShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexInternalShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexInternalShape.cpp
+
+btConvexHullShape.lo: BulletCollision/CollisionShapes/btConvexHullShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexHullShape.lo -MD -MP -MF $(DEPDIR)/btConvexHullShape.Tpo -c -o btConvexHullShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexHullShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexHullShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexHullShape.Tpo $(DEPDIR)/btConvexHullShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexHullShape.cpp' object='btConvexHullShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexHullShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexHullShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexHullShape.cpp
+
+btConvexPolyhedron.lo: BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexPolyhedron.lo -MD -MP -MF $(DEPDIR)/btConvexPolyhedron.Tpo -c -o btConvexPolyhedron.lo `test -f 'BulletCollision/CollisionShapes/btConvexPolyhedron.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexPolyhedron.Tpo $(DEPDIR)/btConvexPolyhedron.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexPolyhedron.cpp' object='btConvexPolyhedron.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexPolyhedron.lo `test -f 'BulletCollision/CollisionShapes/btConvexPolyhedron.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexPolyhedron.cpp
+
+btTriangleCallback.lo: BulletCollision/CollisionShapes/btTriangleCallback.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleCallback.lo -MD -MP -MF $(DEPDIR)/btTriangleCallback.Tpo -c -o btTriangleCallback.lo `test -f 'BulletCollision/CollisionShapes/btTriangleCallback.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleCallback.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleCallback.Tpo $(DEPDIR)/btTriangleCallback.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleCallback.cpp' object='btTriangleCallback.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleCallback.lo `test -f 'BulletCollision/CollisionShapes/btTriangleCallback.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleCallback.cpp
+
+btCapsuleShape.lo: BulletCollision/CollisionShapes/btCapsuleShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCapsuleShape.lo -MD -MP -MF $(DEPDIR)/btCapsuleShape.Tpo -c -o btCapsuleShape.lo `test -f 'BulletCollision/CollisionShapes/btCapsuleShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCapsuleShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCapsuleShape.Tpo $(DEPDIR)/btCapsuleShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btCapsuleShape.cpp' object='btCapsuleShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCapsuleShape.lo `test -f 'BulletCollision/CollisionShapes/btCapsuleShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCapsuleShape.cpp
+
+btConvexTriangleMeshShape.lo: BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btConvexTriangleMeshShape.Tpo -c -o btConvexTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexTriangleMeshShape.Tpo $(DEPDIR)/btConvexTriangleMeshShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp' object='btConvexTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
+
+btConcaveShape.lo: BulletCollision/CollisionShapes/btConcaveShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConcaveShape.lo -MD -MP -MF $(DEPDIR)/btConcaveShape.Tpo -c -o btConcaveShape.lo `test -f 'BulletCollision/CollisionShapes/btConcaveShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConcaveShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConcaveShape.Tpo $(DEPDIR)/btConcaveShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConcaveShape.cpp' object='btConcaveShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConcaveShape.lo `test -f 'BulletCollision/CollisionShapes/btConcaveShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConcaveShape.cpp
+
+btConvexPointCloudShape.lo: BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexPointCloudShape.lo -MD -MP -MF $(DEPDIR)/btConvexPointCloudShape.Tpo -c -o btConvexPointCloudShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexPointCloudShape.Tpo $(DEPDIR)/btConvexPointCloudShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp' object='btConvexPointCloudShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexPointCloudShape.lo `test -f 'BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp
+
+btBoxShape.lo: BulletCollision/CollisionShapes/btBoxShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBoxShape.lo -MD -MP -MF $(DEPDIR)/btBoxShape.Tpo -c -o btBoxShape.lo `test -f 'BulletCollision/CollisionShapes/btBoxShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBoxShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBoxShape.Tpo $(DEPDIR)/btBoxShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btBoxShape.cpp' object='btBoxShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBoxShape.lo `test -f 'BulletCollision/CollisionShapes/btBoxShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBoxShape.cpp
+
+btBox2dShape.lo: BulletCollision/CollisionShapes/btBox2dShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBox2dShape.lo -MD -MP -MF $(DEPDIR)/btBox2dShape.Tpo -c -o btBox2dShape.lo `test -f 'BulletCollision/CollisionShapes/btBox2dShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBox2dShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBox2dShape.Tpo $(DEPDIR)/btBox2dShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btBox2dShape.cpp' object='btBox2dShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBox2dShape.lo `test -f 'BulletCollision/CollisionShapes/btBox2dShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btBox2dShape.cpp
+
+btOptimizedBvh.lo: BulletCollision/CollisionShapes/btOptimizedBvh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btOptimizedBvh.lo -MD -MP -MF $(DEPDIR)/btOptimizedBvh.Tpo -c -o btOptimizedBvh.lo `test -f 'BulletCollision/CollisionShapes/btOptimizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btOptimizedBvh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btOptimizedBvh.Tpo $(DEPDIR)/btOptimizedBvh.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btOptimizedBvh.cpp' object='btOptimizedBvh.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btOptimizedBvh.lo `test -f 'BulletCollision/CollisionShapes/btOptimizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btOptimizedBvh.cpp
+
+btHeightfieldTerrainShape.lo: BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btHeightfieldTerrainShape.lo -MD -MP -MF $(DEPDIR)/btHeightfieldTerrainShape.Tpo -c -o btHeightfieldTerrainShape.lo `test -f 'BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btHeightfieldTerrainShape.Tpo $(DEPDIR)/btHeightfieldTerrainShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp' object='btHeightfieldTerrainShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btHeightfieldTerrainShape.lo `test -f 'BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
+
+btMultimaterialTriangleMeshShape.lo: BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMultimaterialTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btMultimaterialTriangleMeshShape.Tpo -c -o btMultimaterialTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/bt [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMultimaterialTriangleMeshShape.Tpo $(DEPDIR)/btMultimaterialTriangleMeshShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp' object='btMultimaterialTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMultimaterialTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp
+
+btCylinderShape.lo: BulletCollision/CollisionShapes/btCylinderShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCylinderShape.lo -MD -MP -MF $(DEPDIR)/btCylinderShape.Tpo -c -o btCylinderShape.lo `test -f 'BulletCollision/CollisionShapes/btCylinderShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCylinderShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCylinderShape.Tpo $(DEPDIR)/btCylinderShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btCylinderShape.cpp' object='btCylinderShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCylinderShape.lo `test -f 'BulletCollision/CollisionShapes/btCylinderShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btCylinderShape.cpp
+
+btScaledBvhTriangleMeshShape.lo: BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btScaledBvhTriangleMeshShape.lo -MD -MP -MF $(DEPDIR)/btScaledBvhTriangleMeshShape.Tpo -c -o btScaledBvhTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btScaledBvhTriangl [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btScaledBvhTriangleMeshShape.Tpo $(DEPDIR)/btScaledBvhTriangleMeshShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp' object='btScaledBvhTriangleMeshShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btScaledBvhTriangleMeshShape.lo `test -f 'BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
+
+btStridingMeshInterface.lo: BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btStridingMeshInterface.lo -MD -MP -MF $(DEPDIR)/btStridingMeshInterface.Tpo -c -o btStridingMeshInterface.lo `test -f 'BulletCollision/CollisionShapes/btStridingMeshInterface.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btStridingMeshInterface.Tpo $(DEPDIR)/btStridingMeshInterface.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btStridingMeshInterface.cpp' object='btStridingMeshInterface.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btStridingMeshInterface.lo `test -f 'BulletCollision/CollisionShapes/btStridingMeshInterface.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
+
+btTriangleIndexVertexMaterialArray.lo: BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleIndexVertexMaterialArray.lo -MD -MP -MF $(DEPDIR)/btTriangleIndexVertexMaterialArray.Tpo -c -o btTriangleIndexVertexMaterialArray.lo `test -f 'BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionS [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleIndexVertexMaterialArray.Tpo $(DEPDIR)/btTriangleIndexVertexMaterialArray.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp' object='btTriangleIndexVertexMaterialArray.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleIndexVertexMaterialArray.lo `test -f 'BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp
+
+btTriangleMesh.lo: BulletCollision/CollisionShapes/btTriangleMesh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleMesh.lo -MD -MP -MF $(DEPDIR)/btTriangleMesh.Tpo -c -o btTriangleMesh.lo `test -f 'BulletCollision/CollisionShapes/btTriangleMesh.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleMesh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleMesh.Tpo $(DEPDIR)/btTriangleMesh.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/CollisionShapes/btTriangleMesh.cpp' object='btTriangleMesh.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleMesh.lo `test -f 'BulletCollision/CollisionShapes/btTriangleMesh.cpp' || echo '$(srcdir)/'`BulletCollision/CollisionShapes/btTriangleMesh.cpp
+
+btAxisSweep3.lo: BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btAxisSweep3.lo -MD -MP -MF $(DEPDIR)/btAxisSweep3.Tpo -c -o btAxisSweep3.lo `test -f 'BulletCollision/BroadphaseCollision/btAxisSweep3.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btAxisSweep3.Tpo $(DEPDIR)/btAxisSweep3.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btAxisSweep3.cpp' object='btAxisSweep3.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btAxisSweep3.lo `test -f 'BulletCollision/BroadphaseCollision/btAxisSweep3.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
+
+btOverlappingPairCache.lo: BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btOverlappingPairCache.lo -MD -MP -MF $(DEPDIR)/btOverlappingPairCache.Tpo -c -o btOverlappingPairCache.lo `test -f 'BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btOverlappingPairCache.Tpo $(DEPDIR)/btOverlappingPairCache.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp' object='btOverlappingPairCache.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btOverlappingPairCache.lo `test -f 'BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
+
+btDbvtBroadphase.lo: BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDbvtBroadphase.lo -MD -MP -MF $(DEPDIR)/btDbvtBroadphase.Tpo -c -o btDbvtBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDbvtBroadphase.Tpo $(DEPDIR)/btDbvtBroadphase.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp' object='btDbvtBroadphase.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDbvtBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
+
+btMultiSapBroadphase.lo: BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btMultiSapBroadphase.lo -MD -MP -MF $(DEPDIR)/btMultiSapBroadphase.Tpo -c -o btMultiSapBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btMultiSapBroadphase.Tpo $(DEPDIR)/btMultiSapBroadphase.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp' object='btMultiSapBroadphase.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btMultiSapBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp
+
+btDispatcher.lo: BulletCollision/BroadphaseCollision/btDispatcher.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDispatcher.lo -MD -MP -MF $(DEPDIR)/btDispatcher.Tpo -c -o btDispatcher.lo `test -f 'BulletCollision/BroadphaseCollision/btDispatcher.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDispatcher.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDispatcher.Tpo $(DEPDIR)/btDispatcher.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btDispatcher.cpp' object='btDispatcher.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDispatcher.lo `test -f 'BulletCollision/BroadphaseCollision/btDispatcher.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDispatcher.cpp
+
+btBroadphaseProxy.lo: BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btBroadphaseProxy.lo -MD -MP -MF $(DEPDIR)/btBroadphaseProxy.Tpo -c -o btBroadphaseProxy.lo `test -f 'BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btBroadphaseProxy.Tpo $(DEPDIR)/btBroadphaseProxy.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp' object='btBroadphaseProxy.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btBroadphaseProxy.lo `test -f 'BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp
+
+btQuantizedBvh.lo: BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btQuantizedBvh.lo -MD -MP -MF $(DEPDIR)/btQuantizedBvh.Tpo -c -o btQuantizedBvh.lo `test -f 'BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btQuantizedBvh.Tpo $(DEPDIR)/btQuantizedBvh.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp' object='btQuantizedBvh.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btQuantizedBvh.lo `test -f 'BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp
+
+btCollisionAlgorithm.lo: BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btCollisionAlgorithm.Tpo -c -o btCollisionAlgorithm.lo `test -f 'BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btCollisionAlgorithm.Tpo $(DEPDIR)/btCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp' object='btCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btCollisionAlgorithm.lo `test -f 'BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
+
+btDbvt.lo: BulletCollision/BroadphaseCollision/btDbvt.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDbvt.lo -MD -MP -MF $(DEPDIR)/btDbvt.Tpo -c -o btDbvt.lo `test -f 'BulletCollision/BroadphaseCollision/btDbvt.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDbvt.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDbvt.Tpo $(DEPDIR)/btDbvt.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btDbvt.cpp' object='btDbvt.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDbvt.lo `test -f 'BulletCollision/BroadphaseCollision/btDbvt.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btDbvt.cpp
+
+btSimpleBroadphase.lo: BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSimpleBroadphase.lo -MD -MP -MF $(DEPDIR)/btSimpleBroadphase.Tpo -c -o btSimpleBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSimpleBroadphase.Tpo $(DEPDIR)/btSimpleBroadphase.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp' object='btSimpleBroadphase.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSimpleBroadphase.lo `test -f 'BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp' || echo '$(srcdir)/'`BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
+
+btPolyhedralContactClipping.lo: BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btPolyhedralContactClipping.lo -MD -MP -MF $(DEPDIR)/btPolyhedralContactClipping.Tpo -c -o btPolyhedralContactClipping.lo `test -f 'BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btPolyhedral [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btPolyhedralContactClipping.Tpo $(DEPDIR)/btPolyhedralContactClipping.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp' object='btPolyhedralContactClipping.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btPolyhedralContactClipping.lo `test -f 'BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp' || echo '$(srcdir)/'`BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp
+
+btGImpactBvh.lo: BulletCollision/Gimpact/btGImpactBvh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGImpactBvh.lo -MD -MP -MF $(DEPDIR)/btGImpactBvh.Tpo -c -o btGImpactBvh.lo `test -f 'BulletCollision/Gimpact/btGImpactBvh.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactBvh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGImpactBvh.Tpo $(DEPDIR)/btGImpactBvh.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btGImpactBvh.cpp' object='btGImpactBvh.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGImpactBvh.lo `test -f 'BulletCollision/Gimpact/btGImpactBvh.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactBvh.cpp
+
+btGImpactQuantizedBvh.lo: BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGImpactQuantizedBvh.lo -MD -MP -MF $(DEPDIR)/btGImpactQuantizedBvh.Tpo -c -o btGImpactQuantizedBvh.lo `test -f 'BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGImpactQuantizedBvh.Tpo $(DEPDIR)/btGImpactQuantizedBvh.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp' object='btGImpactQuantizedBvh.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGImpactQuantizedBvh.lo `test -f 'BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp
+
+btTriangleShapeEx.lo: BulletCollision/Gimpact/btTriangleShapeEx.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTriangleShapeEx.lo -MD -MP -MF $(DEPDIR)/btTriangleShapeEx.Tpo -c -o btTriangleShapeEx.lo `test -f 'BulletCollision/Gimpact/btTriangleShapeEx.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btTriangleShapeEx.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTriangleShapeEx.Tpo $(DEPDIR)/btTriangleShapeEx.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btTriangleShapeEx.cpp' object='btTriangleShapeEx.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTriangleShapeEx.lo `test -f 'BulletCollision/Gimpact/btTriangleShapeEx.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btTriangleShapeEx.cpp
+
+btGImpactCollisionAlgorithm.lo: BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGImpactCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/btGImpactCollisionAlgorithm.Tpo -c -o btGImpactCollisionAlgorithm.lo `test -f 'BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGImpactCollisionAlgorithm.Tpo $(DEPDIR)/btGImpactCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp' object='btGImpactCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGImpactCollisionAlgorithm.lo `test -f 'BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp
+
+btGImpactShape.lo: BulletCollision/Gimpact/btGImpactShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGImpactShape.lo -MD -MP -MF $(DEPDIR)/btGImpactShape.Tpo -c -o btGImpactShape.lo `test -f 'BulletCollision/Gimpact/btGImpactShape.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactShape.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGImpactShape.Tpo $(DEPDIR)/btGImpactShape.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/btGImpactShape.cpp' object='btGImpactShape.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGImpactShape.lo `test -f 'BulletCollision/Gimpact/btGImpactShape.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/btGImpactShape.cpp
+
+gim_box_set.lo: BulletCollision/Gimpact/gim_box_set.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gim_box_set.lo -MD -MP -MF $(DEPDIR)/gim_box_set.Tpo -c -o gim_box_set.lo `test -f 'BulletCollision/Gimpact/gim_box_set.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_box_set.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gim_box_set.Tpo $(DEPDIR)/gim_box_set.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/gim_box_set.cpp' object='gim_box_set.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gim_box_set.lo `test -f 'BulletCollision/Gimpact/gim_box_set.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_box_set.cpp
+
+gim_contact.lo: BulletCollision/Gimpact/gim_contact.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gim_contact.lo -MD -MP -MF $(DEPDIR)/gim_contact.Tpo -c -o gim_contact.lo `test -f 'BulletCollision/Gimpact/gim_contact.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_contact.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gim_contact.Tpo $(DEPDIR)/gim_contact.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/gim_contact.cpp' object='gim_contact.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gim_contact.lo `test -f 'BulletCollision/Gimpact/gim_contact.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_contact.cpp
+
+gim_memory.lo: BulletCollision/Gimpact/gim_memory.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gim_memory.lo -MD -MP -MF $(DEPDIR)/gim_memory.Tpo -c -o gim_memory.lo `test -f 'BulletCollision/Gimpact/gim_memory.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_memory.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gim_memory.Tpo $(DEPDIR)/gim_memory.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/gim_memory.cpp' object='gim_memory.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gim_memory.lo `test -f 'BulletCollision/Gimpact/gim_memory.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_memory.cpp
+
+gim_tri_collision.lo: BulletCollision/Gimpact/gim_tri_collision.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT gim_tri_collision.lo -MD -MP -MF $(DEPDIR)/gim_tri_collision.Tpo -c -o gim_tri_collision.lo `test -f 'BulletCollision/Gimpact/gim_tri_collision.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_tri_collision.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/gim_tri_collision.Tpo $(DEPDIR)/gim_tri_collision.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletCollision/Gimpact/gim_tri_collision.cpp' object='gim_tri_collision.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o gim_tri_collision.lo `test -f 'BulletCollision/Gimpact/gim_tri_collision.cpp' || echo '$(srcdir)/'`BulletCollision/Gimpact/gim_tri_collision.cpp
+
+btContinuousDynamicsWorld.lo: BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btContinuousDynamicsWorld.lo -MD -MP -MF $(DEPDIR)/btContinuousDynamicsWorld.Tpo -c -o btContinuousDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btContinuousDynamicsWorld.Tpo $(DEPDIR)/btContinuousDynamicsWorld.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp' object='btContinuousDynamicsWorld.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btContinuousDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp
+
+btRigidBody.lo: BulletDynamics/Dynamics/btRigidBody.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btRigidBody.lo -MD -MP -MF $(DEPDIR)/btRigidBody.Tpo -c -o btRigidBody.lo `test -f 'BulletDynamics/Dynamics/btRigidBody.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btRigidBody.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btRigidBody.Tpo $(DEPDIR)/btRigidBody.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/btRigidBody.cpp' object='btRigidBody.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btRigidBody.lo `test -f 'BulletDynamics/Dynamics/btRigidBody.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btRigidBody.cpp
+
+btSimpleDynamicsWorld.lo: BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSimpleDynamicsWorld.lo -MD -MP -MF $(DEPDIR)/btSimpleDynamicsWorld.Tpo -c -o btSimpleDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSimpleDynamicsWorld.Tpo $(DEPDIR)/btSimpleDynamicsWorld.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp' object='btSimpleDynamicsWorld.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSimpleDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
+
+Bullet-C-API.lo: BulletDynamics/Dynamics/Bullet-C-API.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Bullet-C-API.lo -MD -MP -MF $(DEPDIR)/Bullet-C-API.Tpo -c -o Bullet-C-API.lo `test -f 'BulletDynamics/Dynamics/Bullet-C-API.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/Bullet-C-API.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/Bullet-C-API.Tpo $(DEPDIR)/Bullet-C-API.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/Bullet-C-API.cpp' object='Bullet-C-API.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Bullet-C-API.lo `test -f 'BulletDynamics/Dynamics/Bullet-C-API.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/Bullet-C-API.cpp
+
+btDiscreteDynamicsWorld.lo: BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btDiscreteDynamicsWorld.lo -MD -MP -MF $(DEPDIR)/btDiscreteDynamicsWorld.Tpo -c -o btDiscreteDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btDiscreteDynamicsWorld.Tpo $(DEPDIR)/btDiscreteDynamicsWorld.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp' object='btDiscreteDynamicsWorld.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btDiscreteDynamicsWorld.lo `test -f 'BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp' || echo '$(srcdir)/'`BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
+
+btGeneric6DofConstraint.lo: BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGeneric6DofConstraint.lo -MD -MP -MF $(DEPDIR)/btGeneric6DofConstraint.Tpo -c -o btGeneric6DofConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGeneric6DofConstraint.Tpo $(DEPDIR)/btGeneric6DofConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp' object='btGeneric6DofConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGeneric6DofConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
+
+btGeneric6DofSpringConstraint.lo: BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGeneric6DofSpringConstraint.lo -MD -MP -MF $(DEPDIR)/btGeneric6DofSpringConstraint.Tpo -c -o btGeneric6DofSpringConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btGeneric6DofS [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGeneric6DofSpringConstraint.Tpo $(DEPDIR)/btGeneric6DofSpringConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp' object='btGeneric6DofSpringConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGeneric6DofSpringConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp
+
+btSolve2LinearConstraint.lo: BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSolve2LinearConstraint.lo -MD -MP -MF $(DEPDIR)/btSolve2LinearConstraint.Tpo -c -o btSolve2LinearConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSolve2LinearConstraint.Tpo $(DEPDIR)/btSolve2LinearConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp' object='btSolve2LinearConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSolve2LinearConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp
+
+btPoint2PointConstraint.lo: BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btPoint2PointConstraint.lo -MD -MP -MF $(DEPDIR)/btPoint2PointConstraint.Tpo -c -o btPoint2PointConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btPoint2PointConstraint.Tpo $(DEPDIR)/btPoint2PointConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp' object='btPoint2PointConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btPoint2PointConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
+
+btTypedConstraint.lo: BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btTypedConstraint.lo -MD -MP -MF $(DEPDIR)/btTypedConstraint.Tpo -c -o btTypedConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btTypedConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btTypedConstraint.Tpo $(DEPDIR)/btTypedConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btTypedConstraint.cpp' object='btTypedConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btTypedConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btTypedConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
+
+btContactConstraint.lo: BulletDynamics/ConstraintSolver/btContactConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btContactConstraint.lo -MD -MP -MF $(DEPDIR)/btContactConstraint.Tpo -c -o btContactConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btContactConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btContactConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btContactConstraint.Tpo $(DEPDIR)/btContactConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btContactConstraint.cpp' object='btContactConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btContactConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btContactConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btContactConstraint.cpp
+
+btSliderConstraint.lo: BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSliderConstraint.lo -MD -MP -MF $(DEPDIR)/btSliderConstraint.Tpo -c -o btSliderConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btSliderConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSliderConstraint.Tpo $(DEPDIR)/btSliderConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btSliderConstraint.cpp' object='btSliderConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSliderConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btSliderConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
+
+btConeTwistConstraint.lo: BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConeTwistConstraint.lo -MD -MP -MF $(DEPDIR)/btConeTwistConstraint.Tpo -c -o btConeTwistConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConeTwistConstraint.Tpo $(DEPDIR)/btConeTwistConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp' object='btConeTwistConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConeTwistConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
+
+btHingeConstraint.lo: BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btHingeConstraint.lo -MD -MP -MF $(DEPDIR)/btHingeConstraint.Tpo -c -o btHingeConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btHingeConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btHingeConstraint.Tpo $(DEPDIR)/btHingeConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btHingeConstraint.cpp' object='btHingeConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btHingeConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btHingeConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
+
+btHinge2Constraint.lo: BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btHinge2Constraint.lo -MD -MP -MF $(DEPDIR)/btHinge2Constraint.Tpo -c -o btHinge2Constraint.lo `test -f 'BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btHinge2Constraint.Tpo $(DEPDIR)/btHinge2Constraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp' object='btHinge2Constraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btHinge2Constraint.lo `test -f 'BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp
+
+btUniversalConstraint.lo: BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btUniversalConstraint.lo -MD -MP -MF $(DEPDIR)/btUniversalConstraint.Tpo -c -o btUniversalConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btUniversalConstraint.Tpo $(DEPDIR)/btUniversalConstraint.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp' object='btUniversalConstraint.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btUniversalConstraint.lo `test -f 'BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp
+
+btSequentialImpulseConstraintSolver.lo: BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSequentialImpulseConstraintSolver.lo -MD -MP -MF $(DEPDIR)/btSequentialImpulseConstraintSolver.Tpo -c -o btSequentialImpulseConstraintSolver.lo `test -f 'BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp' || echo '$(srcdir)/'`BulletDynamics/Constra [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSequentialImpulseConstraintSolver.Tpo $(DEPDIR)/btSequentialImpulseConstraintSolver.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp' object='btSequentialImpulseConstraintSolver.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSequentialImpulseConstraintSolver.lo `test -f 'BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp' || echo '$(srcdir)/'`BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
+
+btWheelInfo.lo: BulletDynamics/Vehicle/btWheelInfo.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btWheelInfo.lo -MD -MP -MF $(DEPDIR)/btWheelInfo.Tpo -c -o btWheelInfo.lo `test -f 'BulletDynamics/Vehicle/btWheelInfo.cpp' || echo '$(srcdir)/'`BulletDynamics/Vehicle/btWheelInfo.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btWheelInfo.Tpo $(DEPDIR)/btWheelInfo.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Vehicle/btWheelInfo.cpp' object='btWheelInfo.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btWheelInfo.lo `test -f 'BulletDynamics/Vehicle/btWheelInfo.cpp' || echo '$(srcdir)/'`BulletDynamics/Vehicle/btWheelInfo.cpp
+
+btRaycastVehicle.lo: BulletDynamics/Vehicle/btRaycastVehicle.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btRaycastVehicle.lo -MD -MP -MF $(DEPDIR)/btRaycastVehicle.Tpo -c -o btRaycastVehicle.lo `test -f 'BulletDynamics/Vehicle/btRaycastVehicle.cpp' || echo '$(srcdir)/'`BulletDynamics/Vehicle/btRaycastVehicle.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btRaycastVehicle.Tpo $(DEPDIR)/btRaycastVehicle.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Vehicle/btRaycastVehicle.cpp' object='btRaycastVehicle.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btRaycastVehicle.lo `test -f 'BulletDynamics/Vehicle/btRaycastVehicle.cpp' || echo '$(srcdir)/'`BulletDynamics/Vehicle/btRaycastVehicle.cpp
+
+btKinematicCharacterController.lo: BulletDynamics/Character/btKinematicCharacterController.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btKinematicCharacterController.lo -MD -MP -MF $(DEPDIR)/btKinematicCharacterController.Tpo -c -o btKinematicCharacterController.lo `test -f 'BulletDynamics/Character/btKinematicCharacterController.cpp' || echo '$(srcdir)/'`BulletDynamics/Character/btKinematicCharacterCont [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btKinematicCharacterController.Tpo $(DEPDIR)/btKinematicCharacterController.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletDynamics/Character/btKinematicCharacterController.cpp' object='btKinematicCharacterController.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btKinematicCharacterController.lo `test -f 'BulletDynamics/Character/btKinematicCharacterController.cpp' || echo '$(srcdir)/'`BulletDynamics/Character/btKinematicCharacterController.cpp
+
+btQuickprof.lo: LinearMath/btQuickprof.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btQuickprof.lo -MD -MP -MF $(DEPDIR)/btQuickprof.Tpo -c -o btQuickprof.lo `test -f 'LinearMath/btQuickprof.cpp' || echo '$(srcdir)/'`LinearMath/btQuickprof.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btQuickprof.Tpo $(DEPDIR)/btQuickprof.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btQuickprof.cpp' object='btQuickprof.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btQuickprof.lo `test -f 'LinearMath/btQuickprof.cpp' || echo '$(srcdir)/'`LinearMath/btQuickprof.cpp
+
+btGeometryUtil.lo: LinearMath/btGeometryUtil.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btGeometryUtil.lo -MD -MP -MF $(DEPDIR)/btGeometryUtil.Tpo -c -o btGeometryUtil.lo `test -f 'LinearMath/btGeometryUtil.cpp' || echo '$(srcdir)/'`LinearMath/btGeometryUtil.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btGeometryUtil.Tpo $(DEPDIR)/btGeometryUtil.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btGeometryUtil.cpp' object='btGeometryUtil.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btGeometryUtil.lo `test -f 'LinearMath/btGeometryUtil.cpp' || echo '$(srcdir)/'`LinearMath/btGeometryUtil.cpp
+
+btAlignedAllocator.lo: LinearMath/btAlignedAllocator.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btAlignedAllocator.lo -MD -MP -MF $(DEPDIR)/btAlignedAllocator.Tpo -c -o btAlignedAllocator.lo `test -f 'LinearMath/btAlignedAllocator.cpp' || echo '$(srcdir)/'`LinearMath/btAlignedAllocator.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btAlignedAllocator.Tpo $(DEPDIR)/btAlignedAllocator.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btAlignedAllocator.cpp' object='btAlignedAllocator.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btAlignedAllocator.lo `test -f 'LinearMath/btAlignedAllocator.cpp' || echo '$(srcdir)/'`LinearMath/btAlignedAllocator.cpp
+
+btSerializer.lo: LinearMath/btSerializer.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btSerializer.lo -MD -MP -MF $(DEPDIR)/btSerializer.Tpo -c -o btSerializer.lo `test -f 'LinearMath/btSerializer.cpp' || echo '$(srcdir)/'`LinearMath/btSerializer.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btSerializer.Tpo $(DEPDIR)/btSerializer.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btSerializer.cpp' object='btSerializer.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btSerializer.lo `test -f 'LinearMath/btSerializer.cpp' || echo '$(srcdir)/'`LinearMath/btSerializer.cpp
+
+btConvexHull.lo: LinearMath/btConvexHull.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexHull.lo -MD -MP -MF $(DEPDIR)/btConvexHull.Tpo -c -o btConvexHull.lo `test -f 'LinearMath/btConvexHull.cpp' || echo '$(srcdir)/'`LinearMath/btConvexHull.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexHull.Tpo $(DEPDIR)/btConvexHull.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btConvexHull.cpp' object='btConvexHull.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexHull.lo `test -f 'LinearMath/btConvexHull.cpp' || echo '$(srcdir)/'`LinearMath/btConvexHull.cpp
+
+btConvexHullComputer.lo: LinearMath/btConvexHullComputer.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT btConvexHullComputer.lo -MD -MP -MF $(DEPDIR)/btConvexHullComputer.Tpo -c -o btConvexHullComputer.lo `test -f 'LinearMath/btConvexHullComputer.cpp' || echo '$(srcdir)/'`LinearMath/btConvexHullComputer.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/btConvexHullComputer.Tpo $(DEPDIR)/btConvexHullComputer.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='LinearMath/btConvexHullComputer.cpp' object='btConvexHullComputer.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o btConvexHullComputer.lo `test -f 'LinearMath/btConvexHullComputer.cpp' || echo '$(srcdir)/'`LinearMath/btConvexHullComputer.cpp
+
+libbulletmultithreaded_la-btSoftBodySolver_CPU.lo: BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-btSoftBodySolver_CPU.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-btSoftBodySolver_CPU.Tpo -c -o libbulletmultithreaded_la-btSoftBodySolver_CPU.lo `test -f 'BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_ [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-btSoftBodySolver_CPU.Tpo $(DEPDIR)/libbulletmultithreaded_la-btSoftBodySolver_CPU.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp' object='libbulletmultithreaded_la-btSoftBodySolver_CPU.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-btSoftBodySolver_CPU.lo `test -f 'BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/GpuSoftBodySolvers/CPU/btSoftBodySolver_CPU.cpp
+
+libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo: BulletMultiThreaded/SpuCollisionObjectWrapper.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionObjectWrapper.Tpo -c -o libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo `test -f 'BulletMultiThreaded/SpuCollisionObjectWrapper [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionObjectWrapper.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionObjectWrapper.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuCollisionObjectWrapper.cpp' object='libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuCollisionObjectWrapper.lo `test -f 'BulletMultiThreaded/SpuCollisionObjectWrapper.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuCollisionObjectWrapper.cpp
+
+libbulletmultithreaded_la-SpuSampleTask.lo: BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuSampleTask.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTask.Tpo -c -o libbulletmultithreaded_la-SpuSampleTask.lo `test -f 'BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp' || echo '$(srcdir)/'`BulletM [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTask.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTask.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp' object='libbulletmultithreaded_la-SpuSampleTask.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuSampleTask.lo `test -f 'BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuSampleTask/SpuSampleTask.cpp
+
+libbulletmultithreaded_la-SpuLibspe2Support.lo: BulletMultiThreaded/SpuLibspe2Support.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuLibspe2Support.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuLibspe2Support.Tpo -c -o libbulletmultithreaded_la-SpuLibspe2Support.lo `test -f 'BulletMultiThreaded/SpuLibspe2Support.cpp' || echo '$(srcdir)/'`Bulle [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuLibspe2Support.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuLibspe2Support.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuLibspe2Support.cpp' object='libbulletmultithreaded_la-SpuLibspe2Support.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuLibspe2Support.lo `test -f 'BulletMultiThreaded/SpuLibspe2Support.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuLibspe2Support.cpp
+
+libbulletmultithreaded_la-SpuContactResult.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuContactResult.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuContactResult.Tpo -c -o libbulletmultithreaded_la-SpuContactResult.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp' || [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuContactResult.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuContactResult.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp' object='libbulletmultithreaded_la-SpuContactResult.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuContactResult.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.cpp
+
+libbulletmultithreaded_la-SpuGatheringCollisionTask.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuGatheringCollisionTask.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionTask.Tpo -c -o libbulletmultithreaded_la-SpuGatheringCollisionTask.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTa [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionTask.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionTask.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp' object='libbulletmultithreaded_la-SpuGatheringCollisionTask.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuGatheringCollisionTask.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp
+
+libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.Tpo -c -o libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo `test -f 'BulletMultiThreade [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp' object='libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuMinkowskiPenetrationDepthSolver.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuM [...]
+
+libbulletmultithreaded_la-SpuCollisionShapes.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuCollisionShapes.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionShapes.Tpo -c -o libbulletmultithreaded_la-SpuCollisionShapes.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionShapes.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionShapes.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp' object='libbulletmultithreaded_la-SpuCollisionShapes.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuCollisionShapes.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.cpp
+
+libbulletmultithreaded_la-btThreadSupportInterface.lo: BulletMultiThreaded/btThreadSupportInterface.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-btThreadSupportInterface.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-btThreadSupportInterface.Tpo -c -o libbulletmultithreaded_la-btThreadSupportInterface.lo `test -f 'BulletMultiThreaded/btThreadSupportInterface.cpp [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-btThreadSupportInterface.Tpo $(DEPDIR)/libbulletmultithreaded_la-btThreadSupportInterface.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/btThreadSupportInterface.cpp' object='libbulletmultithreaded_la-btThreadSupportInterface.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-btThreadSupportInterface.lo `test -f 'BulletMultiThreaded/btThreadSupportInterface.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/btThreadSupportInterface.cpp
+
+libbulletmultithreaded_la-SequentialThreadSupport.lo: BulletMultiThreaded/SequentialThreadSupport.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SequentialThreadSupport.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SequentialThreadSupport.Tpo -c -o libbulletmultithreaded_la-SequentialThreadSupport.lo `test -f 'BulletMultiThreaded/SequentialThreadSupport.cpp' || [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SequentialThreadSupport.Tpo $(DEPDIR)/libbulletmultithreaded_la-SequentialThreadSupport.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SequentialThreadSupport.cpp' object='libbulletmultithreaded_la-SequentialThreadSupport.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SequentialThreadSupport.lo `test -f 'BulletMultiThreaded/SequentialThreadSupport.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SequentialThreadSupport.cpp
+
+libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo: BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.Tpo -c -o libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo `test -f 'BulletMultiThreaded/SpuGath [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp' object='libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuGatheringCollisionDispatcher.lo `test -f 'BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp
+
+libbulletmultithreaded_la-Win32ThreadSupport.lo: BulletMultiThreaded/Win32ThreadSupport.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-Win32ThreadSupport.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-Win32ThreadSupport.Tpo -c -o libbulletmultithreaded_la-Win32ThreadSupport.lo `test -f 'BulletMultiThreaded/Win32ThreadSupport.cpp' || echo '$(srcdir)/'`B [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-Win32ThreadSupport.Tpo $(DEPDIR)/libbulletmultithreaded_la-Win32ThreadSupport.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/Win32ThreadSupport.cpp' object='libbulletmultithreaded_la-Win32ThreadSupport.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-Win32ThreadSupport.lo `test -f 'BulletMultiThreaded/Win32ThreadSupport.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/Win32ThreadSupport.cpp
+
+libbulletmultithreaded_la-SpuFakeDma.lo: BulletMultiThreaded/SpuFakeDma.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuFakeDma.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuFakeDma.Tpo -c -o libbulletmultithreaded_la-SpuFakeDma.lo `test -f 'BulletMultiThreaded/SpuFakeDma.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuFakeDma.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuFakeDma.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuFakeDma.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuFakeDma.cpp' object='libbulletmultithreaded_la-SpuFakeDma.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuFakeDma.lo `test -f 'BulletMultiThreaded/SpuFakeDma.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuFakeDma.cpp
+
+libbulletmultithreaded_la-PosixThreadSupport.lo: BulletMultiThreaded/PosixThreadSupport.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-PosixThreadSupport.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-PosixThreadSupport.Tpo -c -o libbulletmultithreaded_la-PosixThreadSupport.lo `test -f 'BulletMultiThreaded/PosixThreadSupport.cpp' || echo '$(srcdir)/'`B [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-PosixThreadSupport.Tpo $(DEPDIR)/libbulletmultithreaded_la-PosixThreadSupport.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/PosixThreadSupport.cpp' object='libbulletmultithreaded_la-PosixThreadSupport.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-PosixThreadSupport.lo `test -f 'BulletMultiThreaded/PosixThreadSupport.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/PosixThreadSupport.cpp
+
+libbulletmultithreaded_la-SpuCollisionTaskProcess.lo: BulletMultiThreaded/SpuCollisionTaskProcess.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuCollisionTaskProcess.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionTaskProcess.Tpo -c -o libbulletmultithreaded_la-SpuCollisionTaskProcess.lo `test -f 'BulletMultiThreaded/SpuCollisionTaskProcess.cpp' || [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionTaskProcess.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuCollisionTaskProcess.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuCollisionTaskProcess.cpp' object='libbulletmultithreaded_la-SpuCollisionTaskProcess.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuCollisionTaskProcess.lo `test -f 'BulletMultiThreaded/SpuCollisionTaskProcess.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuCollisionTaskProcess.cpp
+
+libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo: BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.Tpo -c -o libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo `test -f 'BulletMultiT [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp' object='libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuContactManifoldCollisionAlgorithm.lo `test -f 'BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp
+
+libbulletmultithreaded_la-SpuSampleTaskProcess.lo: BulletMultiThreaded/SpuSampleTaskProcess.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-SpuSampleTaskProcess.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTaskProcess.Tpo -c -o libbulletmultithreaded_la-SpuSampleTaskProcess.lo `test -f 'BulletMultiThreaded/SpuSampleTaskProcess.cpp' || echo '$(src [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTaskProcess.Tpo $(DEPDIR)/libbulletmultithreaded_la-SpuSampleTaskProcess.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuSampleTaskProcess.cpp' object='libbulletmultithreaded_la-SpuSampleTaskProcess.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-SpuSampleTaskProcess.lo `test -f 'BulletMultiThreaded/SpuSampleTaskProcess.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuSampleTaskProcess.cpp
+
+libbulletmultithreaded_la-boxBoxDistance.lo: BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
+ at am__fastdepCXX_TRUE@	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -MT libbulletmultithreaded_la-boxBoxDistance.lo -MD -MP -MF $(DEPDIR)/libbulletmultithreaded_la-boxBoxDistance.Tpo -c -o libbulletmultithreaded_la-boxBoxDistance.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp' || echo '$ [...]
+ at am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libbulletmultithreaded_la-boxBoxDistance.Tpo $(DEPDIR)/libbulletmultithreaded_la-boxBoxDistance.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp' object='libbulletmultithreaded_la-boxBoxDistance.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(AM_V_CXX at am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libbulletmultithreaded_la_CXXFLAGS) $(CXXFLAGS) -c -o libbulletmultithreaded_la-boxBoxDistance.lo `test -f 'BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp' || echo '$(srcdir)/'`BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.cpp
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/hkl3d/bullet/src/btBulletCollisionCommon.h b/hkl3d/bullet/src/btBulletCollisionCommon.h
new file mode 100644
index 0000000..472690c
--- /dev/null
+++ b/hkl3d/bullet/src/btBulletCollisionCommon.h
@@ -0,0 +1,69 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BULLET_COLLISION_COMMON_H
+#define BULLET_COLLISION_COMMON_H
+
+///Common headerfile includes for Bullet Collision Detection
+
+///Bullet's btCollisionWorld and btCollisionObject definitions
+#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
+#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
+
+///Collision Shapes
+#include "BulletCollision/CollisionShapes/btBoxShape.h"
+#include "BulletCollision/CollisionShapes/btSphereShape.h"
+#include "BulletCollision/CollisionShapes/btCapsuleShape.h"
+#include "BulletCollision/CollisionShapes/btCylinderShape.h"
+#include "BulletCollision/CollisionShapes/btConeShape.h"
+#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"
+#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleMesh.h"
+#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"
+#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
+#include "BulletCollision/CollisionShapes/btCompoundShape.h"
+#include "BulletCollision/CollisionShapes/btTetrahedronShape.h"
+#include "BulletCollision/CollisionShapes/btEmptyShape.h"
+#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
+#include "BulletCollision/CollisionShapes/btUniformScalingShape.h"
+
+///Narrowphase Collision Detector
+#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h"
+
+//btSphereBoxCollisionAlgorithm is broken, use gjk for now
+//#include "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h"
+#include "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h"
+
+///Dispatching and generation of collision pairs (broadphase)
+#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
+#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
+#include "BulletCollision/BroadphaseCollision/btAxisSweep3.h"
+#include "BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h"
+#include "BulletCollision/BroadphaseCollision/btDbvtBroadphase.h"
+
+///Math library & Utils
+#include "LinearMath/btQuaternion.h"
+#include "LinearMath/btTransform.h"
+#include "LinearMath/btDefaultMotionState.h"
+#include "LinearMath/btQuickprof.h"
+#include "LinearMath/btIDebugDraw.h"
+#include "LinearMath/btSerializer.h"
+
+
+#endif //BULLET_COLLISION_COMMON_H
+
diff --git a/hkl3d/bullet/src/btBulletDynamicsCommon.h b/hkl3d/bullet/src/btBulletDynamicsCommon.h
new file mode 100644
index 0000000..db8b379
--- /dev/null
+++ b/hkl3d/bullet/src/btBulletDynamicsCommon.h
@@ -0,0 +1,49 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose, 
+including commercial applications, and to alter it and redistribute it freely, 
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BULLET_DYNAMICS_COMMON_H
+#define BULLET_DYNAMICS_COMMON_H
+
+///Common headerfile includes for Bullet Dynamics, including Collision Detection
+#include "btBulletCollisionCommon.h"
+
+#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
+#include "BulletDynamics/Dynamics/btContinuousDynamicsWorld.h"
+
+#include "BulletDynamics/Dynamics/btSimpleDynamicsWorld.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+
+#include "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btHingeConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btConeTwistConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btSliderConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btUniversalConstraint.h"
+#include "BulletDynamics/ConstraintSolver/btHinge2Constraint.h"
+
+#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"
+
+
+///Vehicle simulation, with wheel contact simulated by raycasts
+#include "BulletDynamics/Vehicle/btRaycastVehicle.h"
+
+
+
+
+
+
+#endif //BULLET_DYNAMICS_COMMON_H
+
diff --git a/hkl3d/hkl3d.cpp b/hkl3d/hkl3d.cpp
new file mode 100644
index 0000000..0db3168
--- /dev/null
+++ b/hkl3d/hkl3d.cpp
@@ -0,0 +1,1233 @@
+/* This file is part of the hkl3d library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010      Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *          Oussama Sboui <oussama.sboui at synchrotron-soleil.fr>
+ */
+
+#include <yaml.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <libgen.h>
+#include <g3d/g3d.h>
+#include <g3d/quat.h>
+#include <g3d/matrix.h>
+
+#include "hkl/ccan/container_of/container_of.h"
+#include "hkl3d.h"
+#include "hkl-axis-private.h"
+#include "hkl-geometry-private.h"
+
+#include "btBulletCollisionCommon.h"
+#include "BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h"
+#include "BulletCollision/Gimpact/btGImpactShape.h"
+
+#ifdef USE_PARALLEL_DISPATCHER
+# include "BulletMultiThreaded/SpuGatheringCollisionDispatcher.h"
+# include "BulletMultiThreaded/PlatformDefinitions.h"
+# include "BulletMultiThreaded/PosixThreadSupport.h"
+# include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
+#endif
+
+/***************/
+/* static part */
+/***************/
+
+static float identity[] = {1, 0, 0, 0,
+			   0, 1, 0, 0,
+			   0, 0, 1 ,0,
+			   0, 0, 0, 1};
+
+static void *_hkl3d_malloc(int size, const char *error)
+{
+	void *tmp;
+
+	tmp = calloc(1, size);
+	if(!tmp){
+		fprintf(stderr, "%s", error);
+		exit(128);
+	}
+
+	return tmp;
+}
+/* malloc method */
+#define HKL3D_MALLOC(type) (type *)_hkl3d_malloc(sizeof(type), "Can not allocate memory for a " #type)
+
+/***************/
+/* Hkl3DObject */
+/***************/
+
+static btTriangleMesh *trimesh_from_g3dobject(G3DObject *object)
+{
+	btTriangleMesh *trimesh;
+	float *vertex;
+	GSList *faces;
+
+	trimesh = new btTriangleMesh();
+	trimesh->preallocateVertices(object->vertex_count);
+	faces = object->faces;
+	vertex = object->vertex_data;
+	while(faces){
+		G3DFace *face;
+
+		face = (G3DFace*)faces->data;
+		btVector3 vertex0(vertex[3*(face->vertex_indices[0])],
+				  vertex[3*(face->vertex_indices[0])+1],
+				  vertex[3*(face->vertex_indices[0])+2]);
+		btVector3 vertex1(vertex[3*(face->vertex_indices[1])],
+				  vertex[3*(face->vertex_indices[1])+1],
+				  vertex[3*(face->vertex_indices[1])+2]);
+		btVector3 vertex2(vertex[3*(face->vertex_indices[2])],
+				  vertex[3*(face->vertex_indices[2])+1],
+				  vertex[3*(face->vertex_indices[2])+2]);
+		trimesh->addTriangle(vertex0, vertex1, vertex2, true);
+
+		faces = g_slist_next(faces);
+	}
+
+	return trimesh;
+}
+
+static btCollisionShape* shape_from_trimesh(btTriangleMesh *trimesh, int movable)
+{
+	btCollisionShape* shape;
+
+	/*
+	 * create the bullet shape depending on the static status or not of the piece
+	 * static : do not move
+	 * movable : connected to a HklGeometry axis.
+	 */
+	if (movable >= 0){
+		shape = dynamic_cast<btGImpactMeshShape*>(new btGImpactMeshShape(trimesh));
+		shape->setMargin(btScalar(0));
+		shape->setLocalScaling(btVector3(1,1,1));
+		/* maybe usefull for softbodies (useless for now) */
+		(dynamic_cast<btGImpactMeshShape*>(shape))->postUpdate();
+		/* needed for the collision and must be call after the postUpdate (doc) */
+		(dynamic_cast<btGImpactMeshShape*>(shape))->updateBound();
+	}else{
+		shape = dynamic_cast<btBvhTriangleMeshShape*>(new btBvhTriangleMeshShape (trimesh, true));
+		shape->setMargin(btScalar(0));
+		shape->setLocalScaling(btVector3(1,1,1));
+	}
+
+	return shape;
+}
+
+static btCollisionObject * btObject_from_shape(btCollisionShape* shape)
+{
+	btCollisionObject *btObject;
+
+	/* create the Object and add the shape */
+	btObject = new btCollisionObject();
+	btObject->setCollisionShape(shape);
+	btObject->activate(true);
+
+	return btObject;
+}
+
+
+static Hkl3DObject *hkl3d_object_new(Hkl3DModel *model, G3DObject *object, int id)
+{
+	int i;
+	GSList *faces;
+	G3DMaterial* material;
+	Hkl3DObject *self = NULL;
+
+	self = HKL3D_MALLOC(Hkl3DObject);
+
+	/* extract the color from the first face */
+	/* this is usefull for the bullet GL draw method */
+	faces = object->faces;
+	material = ((G3DFace *)faces->data)->material;
+
+	/* fill the hkl3d object structure. */
+	self->model = model;
+	self->id = id;
+	self->axis_name = strdup(object->name);
+	self->axis = NULL;
+	self->g3d = object;
+	self->meshes = trimesh_from_g3dobject(object);
+	self->btShape = shape_from_trimesh(self->meshes, false);
+	self->btObject = btObject_from_shape(self->btShape);
+	self->color = new btVector3(material->r, material->g, material->b);
+	self->hide = object->hide;
+	self->added = false;
+	self->selected = false;
+	self->movable = false;
+
+	/*
+	 * if the object already contain a transformation set the Hkl3DObject
+	 * transformation with this transformation. Otherwise set it with the
+	 * identity
+	 */
+	if(object->transformation){
+		for(i=0; i<16; i++)
+			self->transformation[i] = object->transformation->matrix[i];
+	}else{
+		/* create one as we requiered it to apply our transformations */
+		object->transformation = g_new0(G3DTransformation, 1);
+		for(i=0; i<16; i++){
+			self->transformation[i] = identity[i];
+			object->transformation->matrix[i] = identity[i];
+		}
+	}
+
+	self->is_colliding = false;
+
+	return self;
+}
+
+static void hkl3d_object_free(Hkl3DObject *self)
+{
+	if(!self)
+		return;
+
+	/* memory leak in libg3d */
+	if(self->g3d && self->g3d->transformation){
+		g_free(self->g3d->transformation);
+		self->g3d->transformation = NULL;
+	}
+	if(self->color){
+		delete self->color;
+		self->color = NULL;
+	}
+	if(self->btObject){
+		delete self->btObject;
+		self->btObject = NULL;
+	}
+	if(self->btShape){
+		delete self->btShape;
+		self->btShape = NULL;
+	}
+	if(self->meshes){
+		delete self->meshes;
+		self->meshes = NULL;
+	}
+	if(self->axis_name){
+		free(self->axis_name);
+		self->axis_name = NULL;
+	}
+
+	free(self);
+}
+
+static void hkl3d_object_set_movable(Hkl3DObject *self, int movable)
+{
+	if(!self)
+		return;
+
+	if(self->movable != movable){
+		self->movable = movable;
+		delete self->btObject;
+		delete self->btShape;
+		self->btShape = shape_from_trimesh(self->meshes, movable);
+		self->btObject = btObject_from_shape(self->btShape);
+	}
+}
+
+static void hkl3d_object_set_axis_name(Hkl3DObject *self, const char *name)
+{
+	if(!self || !name || self->axis_name == name)
+		return;
+
+	if(self->axis_name)
+		free(self->axis_name);
+	self->axis_name = strdup(name);
+}
+
+void hkl3d_object_fprintf(FILE *f, const Hkl3DObject *self)
+{
+	GSList *faces;
+	G3DMaterial* material;
+
+	faces = self->g3d->faces;
+	material = ((G3DFace *)faces->data)->material;
+	fprintf(f, "id : %d\n", self->id);
+	fprintf(f, "name : %s (%p)\n", self->axis_name, self->axis_name);
+	fprintf(f, "axis : %p\n", self->axis);
+	fprintf(f, "btObject : %p\n", self->btObject);
+	fprintf(f, "g3d : %p\n", self->g3d);
+	fprintf(f, "btShape : %p\n", self->btShape);
+	fprintf(f, "meshes : %p\n", self->meshes);
+	fprintf(f, "color : %f, %f, %f\n", material->r, material->g, material->b);
+	fprintf(f, "is_colliding : %d\n", self->is_colliding);
+	fprintf(f, "hide : %d\n", self->hide);
+	fprintf(f, "added : %d\n", self->added);
+	fprintf(f, "selected : %d\n", self->selected);
+}
+
+/**************/
+/* Hkl3DModel */
+/**************/
+
+static Hkl3DModel *hkl3d_model_new(void)
+{
+	Hkl3DModel *self = NULL;
+
+	self = HKL3D_MALLOC(Hkl3DModel);
+
+	self->filename = NULL;
+	self->objects = NULL;
+	self->len = 0;
+	self->g3d = NULL;
+
+	return self;
+}
+
+static void hkl3d_model_free(Hkl3DModel *self)
+{
+	int i;
+
+	if(!self)
+		return;
+
+	free(self->filename);
+	for(i=0; i<self->len; ++i)
+		hkl3d_object_free(self->objects[i]);
+	free(self->objects);
+	g3d_model_free(self->g3d);
+	free(self);
+}
+
+static void hkl3d_model_add_object(Hkl3DModel *self, Hkl3DObject *object)
+{
+	if(!self || !object)
+		return;
+
+	self->objects = (typeof(self->objects))realloc(self->objects, sizeof(*self->objects) * (self->len + 1));
+	self->objects[self->len++] = object;
+}
+
+static void hkl3d_model_delete_object(Hkl3DModel *self, Hkl3DObject *object)
+{
+	int i;
+
+	if(!self || !object)
+		return;
+
+	if(self != object->model)
+		return;
+
+	/* find the index of the object */
+	for(i=0; self->objects[i] != object; ++i);
+
+	hkl3d_object_free(object);
+	self->len--;
+	/* move all above objects of 1 position */
+	if(i < self->len)
+		memmove(object, object + 1, sizeof(object) * (self->len - i));
+}
+
+void hkl3d_model_fprintf(FILE *f, const Hkl3DModel *self)
+{
+	int i;
+	fprintf(f, "config (%d):\n", self->len);
+	for(i=0; i<self->len; ++i)
+		hkl3d_object_fprintf(f, self->objects[i]);
+}
+
+/*
+ * Initialize the bullet collision environment.
+ * create the Hkl3DObjects
+ * create the Hkl3DConfig
+ */
+static Hkl3DModel *hkl3d_model_new_from_file(const char *filename)
+{
+	G3DModel *model;
+	Hkl3DModel *self = NULL;
+	GSList *objects; /* lets iterate from the first object. */
+	G3DContext *context;
+
+	if(!filename)
+		return NULL;
+
+	/* load the model from the file */
+	context = g3d_context_new();
+	model = g3d_model_load_full(context, filename, 0);
+	g3d_context_free(context);
+	if(!model)
+		return NULL;
+	self = hkl3d_model_new();
+
+	self->filename = strdup(filename);
+	self->g3d = model;
+
+	/* create all the attached Hkl3DObjects */
+	objects = model->objects;
+	while(objects){
+		G3DObject *object;
+
+		object = (G3DObject*)objects->data;
+		if(object->vertex_count){
+			int id;
+			Hkl3DObject *hkl3dObject;
+
+			id = g_slist_index(model->objects, object);
+			hkl3dObject = hkl3d_object_new(self, object, id);
+
+			/* remembers objects to avoid memory leak */
+			hkl3d_model_add_object(self, hkl3dObject);
+		}
+		objects = g_slist_next(objects);
+	}
+	return self;
+}
+
+/***************/
+/* Hkl3DConfig */
+/***************/
+
+static Hkl3DConfig* hkl3d_config_new(void)
+{
+	Hkl3DConfig* self = NULL;
+
+	self = (Hkl3DConfig*)malloc(sizeof(Hkl3DConfig));
+	if(!self)
+		return NULL;
+
+	self->models = NULL;
+	self->len = 0;
+
+	return self;
+}
+
+static void hkl3d_config_free(Hkl3DConfig *self)
+{
+	int i;
+
+	if(!self)
+		return;
+
+	for(i=0; i<self->len; ++i)
+		hkl3d_model_free(self->models[i]);
+	free(self->models);
+	free(self);
+}
+
+static void hkl3d_config_add_model(Hkl3DConfig *self, Hkl3DModel *model)
+{
+	self->models = (typeof(self->models))realloc(self->models, sizeof(*self->models) * (self->len + 1));
+	self->models[self->len++] = model;
+}
+
+void hkl3d_config_fprintf(FILE *f, const Hkl3DConfig *self)
+{
+	int i;
+	fprintf(f, "models (%d):\n", self->len);
+	for(i=0; i<self->len; ++i)
+		hkl3d_model_fprintf(f, self->models[i]);
+}
+
+/**************/
+/* Hkl3DStats */
+/**************/
+
+double hkl3d_stats_get_collision_ms(const Hkl3DStats *self)
+{
+	return self->collision.tv_sec*1000. + self->collision.tv_usec/1000.;
+}
+
+void hkl3d_stats_fprintf(FILE *f, const Hkl3DStats *self)
+{
+	fprintf(f, "transformation : %f ms collision : %f ms \n",
+		self->transformation.tv_sec*1000. + self->transformation.tv_usec/1000.,
+		hkl3d_stats_get_collision_ms(self));
+}
+
+/*************/
+/* Hkl3DAxis */
+/*************/
+
+static Hkl3DAxis *hkl3d_axis_new(void)
+{
+	Hkl3DAxis *self = NULL;
+
+	self = HKL3D_MALLOC(Hkl3DAxis);
+
+	self->objects = NULL; /* do not own the objects */
+	self->len = 0;
+
+	return self;
+}
+
+static void hkl3d_axis_free(Hkl3DAxis *self)
+{
+	if(!self)
+		return;
+
+	free(self->objects);
+	free(self);
+}
+
+/* should be optimized (useless if the Hkl3DObject had a connection with the Hkl3DAxis */
+static void hkl3d_axis_attach_object(Hkl3DAxis *self, Hkl3DObject *object)
+{
+	object->axis = self;
+	self->objects = (Hkl3DObject **)realloc(self->objects, sizeof(*self->objects) * (self->len + 1));
+	self->objects[self->len++] = object;
+}
+
+/* should be optimized (useless if the Hkl3DObject had a connection with the Hkl3DAxis */
+static void hkl3d_axis_detach_object(Hkl3DAxis *self, Hkl3DObject *object)
+{
+	int i;
+
+	if(!self || !object)
+		return;
+
+	if(self != object->axis)
+		return;
+
+	/* find the index of the object in the object list */
+	for(i=0; self->objects[i] != object; ++i);
+
+	object->axis = NULL;
+	/* move all above objects of 1 position */
+	self->len--;
+	if(i < self->len)
+		memmove(object, object+1, sizeof(object) * (self->len - i));
+}
+
+static void hkl3d_axis_fprintf(FILE *f, const Hkl3DAxis *self)
+{
+	int i;
+
+	if(!f || !self)
+		return;
+
+	fprintf(f, "Axis len : %d\n", self->len);
+	for(i=0; i<self->len; ++i)
+		hkl3d_object_fprintf(f, self->objects[i]);
+}
+
+/*****************/
+/* Hkl3DGeometry */
+/*****************/
+
+static Hkl3DGeometry *hkl3d_geometry_new(HklGeometry *geometry)
+{
+	int i;
+	Hkl3DGeometry *self = NULL;
+
+	self = HKL3D_MALLOC(Hkl3DGeometry);
+
+	self->geometry = geometry;
+	self->axes = (Hkl3DAxis **)malloc(darray_size(geometry->axes) * sizeof(*self->axes));
+
+	for(i=0; i<darray_size(geometry->axes); ++i)
+		self->axes[i] = hkl3d_axis_new();
+
+	return self;
+}
+
+static void hkl3d_geometry_free(Hkl3DGeometry *self)
+{
+	int i;
+
+	if(!self)
+		return;
+
+	for(i=0; i<darray_size(self->geometry->axes); ++i)
+		hkl3d_axis_free(self->axes[i]);
+	free(self->axes);
+	free(self);
+}
+
+static void hkl3d_geometry_apply_transformations(Hkl3DGeometry *self)
+{
+	HklHolder **holder;
+
+	darray_foreach(holder, self->geometry->holders){
+		size_t j;
+		btQuaternion btQ(0, 0, 0, 1);
+
+		size_t len = (*holder)->config->len;
+		for(j=0; j<len; j++){
+			size_t k;
+			size_t idx = (*holder)->config->idx[j];
+			HklAxis *axis = container_of(darray_item(self->geometry->axes, idx),
+						     HklAxis, parameter);
+			G3DMatrix G3DM[16];
+
+			/* conversion beetween hkl -> bullet coordinates */
+			btQ *= btQuaternion(-axis->q.data[1],
+					    axis->q.data[3],
+					    axis->q.data[2],
+					    axis->q.data[0]);
+
+			/* move each object connected to that hkl Axis. */
+			/* apply the quaternion transformation to the bullet object */
+			/* use the bullet library to compute the OpenGL matrix */
+			/* apply this matrix to the G3DObject for the visualisation */
+			for(k=0; k<self->axes[idx]->len; ++k){
+				self->axes[idx]->objects[k]->btObject->getWorldTransform().setRotation(btQ);
+				self->axes[idx]->objects[k]->btObject->getWorldTransform().getOpenGLMatrix( G3DM );
+				memcpy(self->axes[idx]->objects[k]->g3d->transformation->matrix,
+				       &G3DM[0], sizeof(G3DM));
+			}
+		}
+	}
+}
+
+static void hkl3d_geometry_fprintf(FILE *f, const Hkl3DGeometry *self)
+{
+	int i;
+
+	if(!f || !self)
+		return;
+
+	fprintf(f, "Hkl3DGeometry : \n");
+	hkl_geometry_fprintf(f, self->geometry);
+	for(i=0; i<darray_size(self->geometry->axes); ++i)
+		hkl3d_axis_fprintf(f, self->axes[i]);
+}
+
+static Hkl3DAxis *hkl3d_geometry_axis_get(Hkl3DGeometry *self, const char *name)
+{
+	uint i;
+
+	for(i=0; i<darray_size(self->geometry->axes); ++i){
+		if (!strcmp(hkl_parameter_name_get(darray_item(self->geometry->axes, i)),
+			    name))
+			return self->axes[i];
+	}
+	return NULL;
+}
+
+/*********/
+/* HKL3D */
+/*********/
+
+static void hkl3d_apply_transformations(Hkl3D *self)
+{
+	struct timeval debut, fin;
+
+	/* set the right transformation of each objects and get numbers */
+	gettimeofday(&debut, NULL);
+	hkl3d_geometry_apply_transformations(self->geometry);
+	gettimeofday(&fin, NULL);
+	timersub(&fin, &debut, &self->stats.transformation);
+}
+
+void hkl3d_connect_all_axes(Hkl3D *self)
+{
+	int i;
+	int j;
+
+	/* connect use the axes names */
+	for(i=0;i<self->config->len;i++)
+		for(j=0;j<self->config->models[i]->len;j++)
+			hkl3d_connect_object_to_axis(self,
+						     self->config->models[i]->objects[j],
+						     self->config->models[i]->objects[j]->axis_name);
+}
+
+/**
+ * Hkl3D::Hkl3D:
+ * @filename:
+ * @geometry:
+ *
+ *
+ *
+ * Returns:
+ **/
+Hkl3D *hkl3d_new(const char *filename, HklGeometry *geometry)
+{
+	Hkl3D *self = NULL;
+
+	self = HKL3D_MALLOC(Hkl3D);
+
+	self->geometry = hkl3d_geometry_new(geometry);
+	self->config = hkl3d_config_new();
+	self->model= g3d_model_new();
+
+	/* initialize the bullet part */
+	self->_btCollisionConfiguration = new btDefaultCollisionConfiguration();
+
+#ifdef USE_PARALLEL_DISPATCHER
+	int maxNumOutstandingTasks = 2;
+	PosixThreadSupport::ThreadConstructionInfo constructionInfo("collision",
+								    processCollisionTask,
+								    createCollisionLocalStoreMemory,
+								    maxNumOutstandingTasks);
+	self->_btThreadSupportInterface = new PosixThreadSupport(constructionInfo);
+	self->_btDispatcher = new SpuGatheringCollisionDispatcher(self->_btThreadSupportInterface,
+								  maxNumOutstandingTasks,
+								  self->_btCollisionConfiguration);
+#else
+	self->_btDispatcher = new btCollisionDispatcher(self->_btCollisionConfiguration);
+#endif
+	btGImpactCollisionAlgorithm::registerAlgorithm(self->_btDispatcher);
+
+	btVector3 worldAabbMin(-1000,-1000,-1000);
+	btVector3 worldAabbMax( 1000, 1000, 1000);
+
+	self->_btBroadphase = new btAxisSweep3(worldAabbMin, worldAabbMax);
+
+	self->_btWorld = new btCollisionWorld(self->_btDispatcher,
+					      self->_btBroadphase,
+					      self->_btCollisionConfiguration);
+
+	self->filename = filename;
+	if (filename)
+		hkl3d_load_config(self, filename);
+
+	return self;
+}
+
+void hkl3d_free(Hkl3D *self)
+{
+	if(!self)
+		return;
+
+	int i, j;
+
+	/* remove all objects from the collision world */
+	for(i=0; i<self->config->len; ++i)
+		for(j=0; j<self->config->models[i]->len; ++j)
+			if(self->config->models[i]->objects[j]->added)
+				self->_btWorld->removeCollisionObject(self->config->models[i]->objects[j]->btObject);
+
+	hkl3d_geometry_free(self->geometry);
+	hkl3d_config_free(self->config);
+
+	if (self->_btWorld)
+		delete self->_btWorld;
+	if (self->_btBroadphase)
+		delete self->_btBroadphase;
+	if (self->_btDispatcher)
+		delete self->_btDispatcher;
+#ifdef USE_PARALLEL_DISPATCHER
+	if (self->_btThreadSupportInterface){
+		/* delete _btThreadSupportInterface; */
+		/* _btThreadSupportInterface = 0; */
+	}
+#endif
+	if (self->_btCollisionConfiguration)
+		delete self->_btCollisionConfiguration;
+	g_free(self->model); /* do not use g3d_model_free as it is juste a container for all config->model */
+
+	free(self);
+}
+
+Hkl3DModel *hkl3d_add_model_from_file(Hkl3D *self,
+				       const char *filename, const char *directory)
+{
+	char current[PATH_MAX];
+	Hkl3DModel *model = NULL;
+	int res;
+
+	/* first set the current directory using the directory parameter*/
+	getcwd(current, PATH_MAX);
+	res = chdir(directory);
+	model = hkl3d_model_new_from_file(filename);
+	res = chdir(current);
+
+	if(model){
+		/* we can not display two different models with the current g3dviewer code */
+		/* so concatenate this loaded model with the one of hkl3d */
+		self->model->objects = g_slist_concat(self->model->objects, model->g3d->objects);
+		self->model->materials = g_slist_concat(self->model->materials, model->g3d->materials);
+
+		/* update the Hkl3D internals from the model */
+		hkl3d_config_add_model(self->config, model);
+	}
+	return model;
+}
+
+/* check that the axis name is really available in the Geometry */
+/* if axis name not valid make the object static object->name = NULL */
+/* ok so check if the axis was already connected  or not */
+/* if already connected check if it was a different axis do the job */
+/* if not yet connected do the job */
+/* fill movingCollisionObject and movingG3DObjects vectors for transformations */
+void hkl3d_connect_object_to_axis(Hkl3D *self, Hkl3DObject *object, const char *name)
+{
+	Hkl3DAxis *axis3d = hkl3d_geometry_axis_get(self->geometry, name);
+	if (!object->movable){
+		if(axis3d){ /* static -> movable */
+			self->_btWorld->removeCollisionObject(object->btObject);
+			hkl3d_object_set_movable(object, true);
+			self->_btWorld->addCollisionObject(object->btObject);
+			object->added = true;
+			hkl3d_axis_attach_object(axis3d, object);
+		}
+	}else{
+		if(!axis3d){ /* movable -> static */
+			self->_btWorld->removeCollisionObject(object->btObject);
+			hkl3d_object_set_movable(object, false);
+			self->_btWorld->addCollisionObject(object->btObject);
+			object->added = true;
+		}else{ /* movable -> movable */
+			if(strcmp(object->axis_name, name)){ /* not the same axis */
+				hkl3d_axis_detach_object(object->axis, object);
+				hkl3d_axis_attach_object(axis3d, object);
+			}
+		}
+	}
+	hkl3d_object_set_axis_name(object, name);
+}
+
+void hkl3d_load_config(Hkl3D *self, const char *filename)
+{
+	int j,l;
+	int newFile=0;
+	int endEvent = 0;
+	yaml_parser_t parser;
+	yaml_event_t input_event;
+	FILE *file;
+	char *dirc;
+	char *dir;
+	Hkl3DModel *config;
+
+	/* Clear the objects. */
+	memset(&parser, 0, sizeof(parser));
+	memset(&input_event, 0, sizeof(input_event));
+
+	file = fopen(filename, "rb");
+	if (!file){
+		fprintf(stderr, "Could not open the %s config file\n", filename);
+		return;
+	}
+
+	if (!yaml_parser_initialize(&parser))
+		fprintf(stderr, "Could not initialize the parser object\n");
+	yaml_parser_set_input_file(&parser, file);
+
+	/* compute the dirname of the config file as all model files */
+	/* will be relative to this directory */
+	dirc = strdup(filename);
+	dir = dirname(dirc);
+
+	while(!endEvent){
+		/* Get the next event. */
+		yaml_parser_parse(&parser, &input_event);
+
+		/* Check if this is the stream end. */
+		if(input_event.type == YAML_STREAM_END_EVENT)
+			endEvent = 1;
+		if(input_event.type == YAML_DOCUMENT_START_EVENT){
+			j=0;
+			/* skip 4 events */
+			// DOCUMENT-START
+			// SEQUENCE-START
+			// MAPPING-START
+			// SCALAR fileName key
+			for(l=0;l<4;l++){
+				yaml_event_delete(&input_event);
+				yaml_parser_parse(&parser, &input_event);
+			}
+
+			/* the add form file method create a default Hkl3DModel and add it to the HKL3D */
+			/* we just need to update this config with the values from the configuration file */
+			config = hkl3d_add_model_from_file(self, (const char *)input_event.data.scalar.value, dir);
+			/* skip 3 events */
+			// SCALAR objects key
+			// SEQUENCE-START
+			// MAPPING-START
+			for(l=0;l<3;l++){
+				yaml_event_delete(&input_event);
+				yaml_parser_parse(&parser, &input_event);
+			}
+		}
+
+		if((input_event.type==YAML_MAPPING_START_EVENT)&& config){
+			j++;
+			/* skip 2 events */
+			// MAPPING-START
+			// SCALAR iD key
+			for(l=0;l<2;l++){
+				yaml_event_delete(&input_event);
+				yaml_parser_parse(&parser, &input_event);
+			}
+
+			/* get the object id */
+			config->objects[j-1]->id = atoi((const char *)input_event.data.scalar.value);
+
+			/* skip 2 more events */
+			// SCALAR valueId
+			// SCALAR Name key
+			for(l=0;l<2;l++){
+				yaml_event_delete(&input_event);
+				yaml_parser_parse(&parser, &input_event);
+			}
+
+			/* get the name of the object from the config file */
+			hkl3d_object_set_axis_name(config->objects[j-1], (const char *)input_event.data.scalar.value);
+			/*  skip 3 events */
+			// SCALAR NameValue
+			// SCALAR transformation key
+			// SEQUENCE-START
+			for(l=0;l<3;l++){
+				yaml_event_delete(&input_event);
+				yaml_parser_parse(&parser, &input_event);
+			}
+
+			/* get the 16 values of the transformation */
+			for(l=0;l<16;l++){
+				config->objects[j-1]->transformation[l] = atof((const char *)input_event.data.scalar.value);
+				yaml_event_delete(&input_event);
+				yaml_parser_parse(&parser, &input_event);
+			}
+
+			/* skip 2 events */
+			// SEQUENCE-END
+			// SCALAR hide key
+			for(l=0;l<2;l++){
+				yaml_event_delete(&input_event);
+				yaml_parser_parse(&parser, &input_event);
+			}
+
+			/* get the hide value */
+			config->objects[j-1]->hide = strcmp((const char *)input_event.data.scalar.value, "no");
+			config->objects[j-1]->g3d->hide = config->objects[j-1]->hide;
+		}
+		yaml_event_delete(&input_event);
+	}
+
+	free(dirc);
+	yaml_parser_delete(&parser);
+	fclose(file);
+
+	/* now that everythings goes fine we can save the filename */
+	self->filename = filename;
+
+	hkl3d_connect_all_axes(self);
+}
+
+void hkl3d_save_config(Hkl3D *self, const char *filename)
+{
+	int i;
+
+	for(i=0; i<self->config->len; i++){
+		int j;
+		char number[64];
+		int properties1, key1, value1,seq0;
+		int root;
+		time_t now;
+		yaml_emitter_t emitter;
+		yaml_document_t output_document;
+		yaml_event_t output_event;
+		FILE * file;
+
+		memset(&emitter, 0, sizeof(emitter));
+		memset(&output_document, 0, sizeof(output_document));
+		memset(&output_event, 0, sizeof(output_event));
+
+		if (!yaml_emitter_initialize(&emitter))
+			fprintf(stderr, "Could not inialize the emitter object\n");
+
+		/* Set the emitter parameters */
+		file = fopen(filename, "a+");
+		if(!file){
+			fprintf(stderr, "Could not open the config file %s to save\n", filename);
+			return;
+		}
+		yaml_emitter_set_output_file(&emitter, file);
+		yaml_emitter_open(&emitter);
+
+		/* Create an output_document object */
+		if (!yaml_document_initialize(&output_document, NULL, NULL, NULL, 0, 0))
+			fprintf(stderr, "Could not create a output_document object\n");
+
+		/* Create the root of the config file */
+		time(&now);
+		root = yaml_document_add_sequence(&output_document,
+						  (yaml_char_t *)ctime(&now),
+						  YAML_BLOCK_SEQUENCE_STYLE);
+
+		/* create the property of the root sequence */
+		properties1 = yaml_document_add_mapping(&output_document,
+							(yaml_char_t *)YAML_MAP_TAG,
+							YAML_BLOCK_MAPPING_STYLE);
+
+		yaml_document_append_sequence_item(&output_document, root, properties1);
+
+		/* add the map key1 : value1 to the property */
+		key1 = yaml_document_add_scalar(&output_document,
+						NULL,
+						(yaml_char_t *)"FileName",
+						-1,
+						YAML_PLAIN_SCALAR_STYLE);
+		value1 = yaml_document_add_scalar(&output_document,
+						  NULL,
+						  (yaml_char_t *)self->config->models[i]->filename,
+						  -1,
+						  YAML_PLAIN_SCALAR_STYLE);
+		yaml_document_append_mapping_pair(&output_document, properties1, key1, value1);
+
+		/* add the map key1 : seq0 to the first property */
+		key1 = yaml_document_add_scalar(&output_document,
+						NULL,
+						(yaml_char_t *)"Objects",
+						-1,
+						YAML_PLAIN_SCALAR_STYLE);
+		/* create the sequence of objects */
+		seq0 = yaml_document_add_sequence(&output_document,
+						  (yaml_char_t *)YAML_SEQ_TAG,
+						  YAML_BLOCK_SEQUENCE_STYLE);
+		for(j=0; j<self->config->models[i]->len; j++){
+			int k;
+			int properties;
+			int key;
+			int value;
+			int seq1;
+
+			properties = yaml_document_add_mapping(&output_document,
+							       (yaml_char_t *)YAML_MAP_TAG,
+							       YAML_BLOCK_MAPPING_STYLE);
+			yaml_document_append_sequence_item(&output_document,seq0, properties);
+
+			key = yaml_document_add_scalar(&output_document,
+						       NULL,
+						       (yaml_char_t *)"Id", -1,
+						       YAML_PLAIN_SCALAR_STYLE);
+
+			sprintf(number, "%d", self->config->models[i]->objects[j]->id);
+			value = yaml_document_add_scalar(&output_document,
+							 NULL,
+							 (yaml_char_t *)number,
+							 -1,
+							 YAML_PLAIN_SCALAR_STYLE);
+			yaml_document_append_mapping_pair(&output_document,properties,key,value);
+
+			key = yaml_document_add_scalar(&output_document,
+						       NULL,
+						       (yaml_char_t *)"Name",
+						       -1,
+						       YAML_PLAIN_SCALAR_STYLE);
+			value = yaml_document_add_scalar(&output_document,
+							 NULL,
+							 (yaml_char_t *)self->config->models[i]->objects[j]->axis_name,
+							 -1,
+							 YAML_PLAIN_SCALAR_STYLE);
+			yaml_document_append_mapping_pair(&output_document,properties,key,value);
+
+			key = yaml_document_add_scalar(&output_document,
+						       NULL,
+						       (yaml_char_t *)"Transformation",
+						       -1,
+						       YAML_PLAIN_SCALAR_STYLE);
+			seq1 = yaml_document_add_sequence(&output_document,
+							  (yaml_char_t *)YAML_SEQ_TAG,
+							  YAML_FLOW_SEQUENCE_STYLE);
+			yaml_document_append_mapping_pair(&output_document,properties, key, seq1);
+			for(k=0; k<16; k++){
+				sprintf(number, "%f", self->config->models[i]->objects[j]->transformation[k]);
+				value = yaml_document_add_scalar(&output_document,
+								 NULL,
+								 (yaml_char_t *)number,
+								 -1,
+								 YAML_PLAIN_SCALAR_STYLE);
+				yaml_document_append_sequence_item(&output_document,seq1,value);
+			}
+
+			key = yaml_document_add_scalar(&output_document,
+						       NULL,
+						       (yaml_char_t *)"Hide",
+						       -1,
+						       YAML_PLAIN_SCALAR_STYLE);
+			if(self->config->models[i]->objects[j]->hide)
+				value = yaml_document_add_scalar(&output_document,
+								 NULL,
+								 (yaml_char_t *)"yes",
+								 -1,
+								 YAML_PLAIN_SCALAR_STYLE);
+			else
+				value = yaml_document_add_scalar(&output_document,
+								 NULL,
+								 (yaml_char_t *)"no",
+								 -1,
+								 YAML_PLAIN_SCALAR_STYLE);
+			yaml_document_append_mapping_pair(&output_document,properties,key,value);
+		}
+		yaml_document_append_mapping_pair(&output_document, properties1, key1, seq0);
+
+		/* flush the document */
+		yaml_emitter_dump(&emitter, &output_document);
+		fclose(file);
+
+		yaml_document_delete(&output_document);
+		yaml_emitter_delete(&emitter);
+	}
+}
+
+/**
+ * Hkl3D::hide_object:
+ *
+ * update the visibility of an Hkl3DObject in the bullet world
+ * add or remove the object from the _btWorld depending on the hide
+ * member of the object.
+ **/
+void hkl3d_hide_object(Hkl3D *self, Hkl3DObject *object, int hide)
+{
+	/* first update the G3DObject */
+	object->hide = hide;
+	object->g3d->hide = hide;
+	if(object->hide){
+		if (object->added){
+			self->_btWorld->removeCollisionObject(object->btObject);
+			object->added = false;
+		}
+	}else{
+		if(!object->added){
+			self->_btWorld->addCollisionObject(object->btObject);
+			object->added = true;
+		}
+	}
+}
+
+/* remove an object from the model */
+void hkl3d_remove_object(Hkl3D *self, Hkl3DObject *object)
+{
+	if(!self || !object)
+		return;
+
+	hkl3d_hide_object(self, object, TRUE);
+	hkl3d_axis_detach_object(object->axis, object);
+
+	/* now remove the G3DObject from the model */
+	self->model->objects = g_slist_remove(self->model->objects, object->g3d);
+	hkl3d_model_delete_object(object->model, object);
+}
+
+/* use for the transparency of colliding objects */
+struct ContactSensorCallback : public btCollisionWorld::ContactResultCallback
+{
+	ContactSensorCallback(Hkl3DObject *object)
+		: btCollisionWorld::ContactResultCallback(),
+		  collisionObject(object->btObject),
+		  object(object)
+		{ }
+
+	btCollisionObject *collisionObject;
+	Hkl3DObject *object;
+
+	virtual btScalar addSingleResult(btManifoldPoint & cp,
+					 const btCollisionObject *colObj0, int partId0, int index0,
+					 const btCollisionObject *colObj1, int partId1, int index1)
+		{
+			if(colObj0 == collisionObject
+			   || colObj1 == collisionObject)
+				object->is_colliding = TRUE;
+			return 0;
+		}
+};
+
+int hkl3d_is_colliding(Hkl3D *self)
+{
+	int i;
+	int j;
+	bool res = true;
+	int numManifolds;
+	struct timeval debut, fin;
+
+	/* apply geometry transformation */
+	hkl3d_apply_transformations(self);
+
+	/* perform the collision detection and get numbers */
+	gettimeofday(&debut, NULL);
+	if(self->_btWorld){
+		self->_btWorld->performDiscreteCollisionDetection();
+		self->_btWorld->updateAabbs();
+	}
+	gettimeofday(&fin, NULL);
+	timersub(&fin, &debut, &self->stats.collision);
+
+	numManifolds = self->_btWorld->getDispatcher()->getNumManifolds();
+
+	/* reset all the collisions */
+	for(i=0; i<self->config->len; i++)
+		for(j=0; j<self->config->models[i]->len; j++)
+			self->config->models[i]->objects[j]->is_colliding = FALSE;
+
+	/* check all the collisions */
+	for(i=0; i<self->config->len; i++)
+		for(j=0; j<self->config->models[i]->len; j++){
+			Hkl3DObject *object = self->config->models[i]->objects[j];
+			ContactSensorCallback callback(object);
+			self->_btWorld->contactTest(object->btObject, callback);
+		}
+
+	return numManifolds != 0;
+}
+
+/**
+ * Hkl3D::get_bounding_boxes:
+ * @min:
+ * @max:
+ *
+ * get the bounding boxes of the current world from the bullet internals.
+ **/
+void hkl3d_get_bounding_boxes(Hkl3D *self,
+			      struct btVector3 *min, struct btVector3 *max)
+{
+	self->_btWorld->getBroadphase()->getBroadphaseAabb(*min, *max);
+}
+
+int hkl3d_get_nb_manifolds(Hkl3D *self)
+{
+	return self->_btDispatcher->getNumManifolds();
+}
+
+int hkl3d_get_nb_contacts(Hkl3D *self, int manifold)
+{
+	return self->_btDispatcher->getManifoldByIndexInternal(manifold)->getNumContacts();
+}
+
+void hkl3d_get_collision_coordinates(Hkl3D *self, int manifold, int contact,
+				     double *xa, double *ya, double *za,
+				     double *xb, double *yb, double *zb)
+{
+	btPersistentManifold *contactManifold;
+
+	contactManifold = self->_btDispatcher->getManifoldByIndexInternal(manifold);
+	btManifoldPoint & pt = contactManifold->getContactPoint(contact);
+	btVector3 ptA = pt.getPositionWorldOnA();
+	btVector3 ptB = pt.getPositionWorldOnB();
+
+	*xa = ptA.x();
+	*ya = ptA.y();
+	*za = ptA.z();
+	*xb = ptB.x();
+	*yb = ptB.y();
+	*zb = ptB.z();
+}
+
+void hkl3d_fprintf(FILE *f, const Hkl3D *self)
+{
+
+	fprintf(f, "filename : %s\n", self->filename);
+	hkl3d_geometry_fprintf(f, self->geometry);
+	fprintf(f, "\n");
+	fprintf(f, "model : %p\n", self->model);
+	hkl3d_stats_fprintf(f, &self->stats);
+	hkl3d_config_fprintf(f, self->config);
+
+	fprintf(f, "_btCollisionConfiguration : %p\n", self->_btCollisionConfiguration);
+	fprintf(f, "_btBroadphase : %p\n", self->_btBroadphase);
+	fprintf(f, "_btWorld : %p\n", self->_btWorld);
+	fprintf(f, "_btDispatcher : %p\n", self->_btDispatcher);
+#ifdef USE_PARALLEL_DISPATCHER
+	fprintf(f, "_btThreadSupportInterface : %p\n", self->_btThreadSupportInterface);
+#endif
+}
diff --git a/hkl3d/hkl3d.h b/hkl3d/hkl3d.h
new file mode 100644
index 0000000..1bd3672
--- /dev/null
+++ b/hkl3d/hkl3d.h
@@ -0,0 +1,186 @@
+/* This file is part of the hkl3d library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *          Oussama SBOUI <oussama.sboui at synchrotron-soleil.fr>
+ */
+
+#ifndef __HKL3D_H__
+#define __HKL3D_H__
+
+#include <g3d/types.h>
+#include "hkl.h"
+
+// forward declaration due to bullet static linking
+struct btCollisionObject;
+struct btCollisionWorld;
+struct btCollisionConfiguration;
+struct btBroadphaseInterface;
+struct btCollisionDispatcher;
+struct btCollisionShape;
+struct btVector3;
+struct btTriangleMesh;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	typedef struct _Hkl3DStats Hkl3DStats;
+	typedef struct _Hkl3DObject Hkl3DObject;
+	typedef struct _Hkl3DModel Hkl3DModel;
+	typedef struct _Hkl3DConfig Hkl3DConfig;
+	typedef struct _Hkl3DAxis Hkl3DAxis;
+	typedef struct _Hkl3DGeometry Hkl3DGeometry;
+	typedef struct _Hkl3D Hkl3D;
+
+	/**************/
+	/* Hkl3DStats */
+	/**************/
+
+	struct _Hkl3DStats
+	{
+		struct timeval collision;
+		struct timeval transformation;
+	};
+
+	extern double hkl3d_stats_get_collision_ms(const Hkl3DStats *self);
+	extern void hkl3d_stats_fprintf(FILE *f, Hkl3DStats *self);
+
+	/***************/
+	/* Hkl3DObject */
+	/***************/
+
+	struct _Hkl3DObject
+	{
+		Hkl3DModel *model; /* weak reference */
+		int id;
+		Hkl3DAxis *axis; /* weak reference */
+		G3DObject *g3d; /* weak reference */
+		struct btCollisionObject *btObject;
+		struct btCollisionShape *btShape;
+		struct btTriangleMesh *meshes;
+		struct btVector3 *color;
+		int is_colliding;
+		int hide;
+		int added;
+		int selected;
+		int movable;
+		char *axis_name;
+		float transformation[16];
+	};
+
+	extern void hkl3d_object_fprintf(FILE *f, const Hkl3DObject *self);
+
+	/**************/
+	/* Hkl3DModel */
+	/**************/
+
+	struct _Hkl3DModel
+	{
+		char *filename;
+		G3DModel *g3d;
+		Hkl3DObject **objects;
+		int len;
+	};
+
+	extern void hkl3d_model_fprintf(FILE *f, const Hkl3DModel *self);
+
+	/***************/
+	/* Hkl3DConfig */
+	/***************/
+
+	struct _Hkl3DConfig
+	{
+		Hkl3DModel **models;
+		int len;
+	};
+
+	extern void hkl3d_config_fprintf(FILE *f, const Hkl3DConfig *self);
+
+	/*************/
+	/* Hkl3DAxis */
+	/*************/
+
+	struct _Hkl3DAxis
+	{
+		Hkl3DObject **objects; /* connected object */
+		int len;
+	};
+
+	/*****************/
+	/* HKL3DGeometry */
+	/*****************/
+
+	struct _Hkl3DGeometry
+	{
+		HklGeometry *geometry; /* weak reference */
+		Hkl3DAxis **axes;
+	};
+
+	/*********/
+	/* HKL3D */
+	/*********/
+
+	struct _Hkl3D
+	{
+		char const *filename; /* config filename */
+		Hkl3DGeometry *geometry;
+		G3DModel *model;
+		Hkl3DStats stats;
+		Hkl3DConfig *config;
+
+		struct btCollisionConfiguration *_btCollisionConfiguration;
+		struct btBroadphaseInterface *_btBroadphase;
+		struct btCollisionWorld *_btWorld;
+		struct btCollisionDispatcher *_btDispatcher;
+#ifdef USE_PARALLEL_DISPATCHER
+		struct btThreadSupportInterface *_btThreadSupportInterface;
+#endif
+	};
+
+	extern Hkl3D* hkl3d_new(const char *filename, HklGeometry *geometry);
+	extern void hkl3d_free(Hkl3D *self);
+
+	extern int hkl3d_is_colliding(Hkl3D *self);
+	extern void hkl3d_load_config(Hkl3D *self, const char *filename);
+	extern void hkl3d_save_config(Hkl3D *self, const char *filename);
+	extern Hkl3DModel *hkl3d_add_model_from_file(Hkl3D *self,
+						     const char *filename, const char *directory);
+
+	extern void hkl3d_connect_all_axes(Hkl3D *self);
+	extern void hkl3d_hide_object(Hkl3D *self, Hkl3DObject *object, int hide);
+	extern void hkl3d_remove_object(Hkl3D *self, Hkl3DObject *object);
+
+	extern void hkl3d_get_bounding_boxes(Hkl3D *self,
+					     struct btVector3 *min, struct btVector3 *max);
+	extern int hkl3d_get_nb_manifolds(Hkl3D *self);
+	extern int hkl3d_get_nb_contacts(Hkl3D *self, int manifold);
+	extern void hkl3d_get_collision_coordinates(Hkl3D *self, int manifold, int contact,
+						    double *xa, double *ya, double *za,
+						    double *xb, double *yb, double *zb);
+	extern void hkl3d_connect_object_to_axis(Hkl3D *self,
+						 Hkl3DObject *object, const char *name);
+
+	extern void hkl3d_fprintf(FILE *f, const Hkl3D *self);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4
index 2cfa1e7..0ada151 100644
--- a/m4/gtk-doc.m4
+++ b/m4/gtk-doc.m4
@@ -6,6 +6,7 @@ dnl Usage:
 dnl   GTK_DOC_CHECK([minimum-gtk-doc-version])
 AC_DEFUN([GTK_DOC_CHECK],
 [
+  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
   AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
   AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
 
@@ -33,6 +34,11 @@ AC_DEFUN([GTK_DOC_CHECK],
                         AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
       [PKG_CHECK_EXISTS([gtk-doc >= $1],,
                         AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))])
+    dnl don't check for glib if we build glib
+    if test "x$PACKAGE_NAME" != "xglib"; then
+      dnl don't fail if someone does not have glib
+      PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0  >= 2.10.0,,)
+    fi
   fi
 
   AC_MSG_CHECKING([whether to build gtk-doc documentation])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index a3fee53..02b4bbe 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1,7 +1,8 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -10,7 +11,8 @@
 
 m4_define([_LT_COPYING], [dnl
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ])
 
-# serial 56 LT_INIT
+# serial 57 LT_INIT
 
 
 # LT_PREREQ(VERSION)
@@ -66,6 +68,7 @@ esac
 # ------------------
 AC_DEFUN([LT_INIT],
 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 AC_BEFORE([$0], [LT_LANG])dnl
 AC_BEFORE([$0], [LT_OUTPUT])dnl
 AC_BEFORE([$0], [LTDL_INIT])dnl
@@ -82,6 +85,8 @@ AC_REQUIRE([LTVERSION_VERSION])dnl
 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
 m4_require([_LT_PROG_LTMAIN])dnl
 
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
 dnl Parse OPTIONS
 _LT_SET_OPTIONS([$0], [$1])
 
@@ -118,7 +123,7 @@ m4_defun([_LT_CC_BASENAME],
     *) break;;
   esac
 done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
 ])
 
 
@@ -138,6 +143,11 @@ m4_defun([_LT_FILEUTILS_DEFAULTS],
 m4_defun([_LT_SETUP],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
 _LT_DECL([], [host_alias], [0], [The host system])dnl
 _LT_DECL([], [host], [0])dnl
 _LT_DECL([], [host_os], [0])dnl
@@ -160,10 +170,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
 dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
 m4_require([_LT_CMD_RELOAD])dnl
 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
 
 _LT_CONFIG_LIBTOOL_INIT([
 # See if we are running on zsh, and set the options which allow our
@@ -179,7 +192,6 @@ fi
 _LT_CHECK_OBJDIR
 
 m4_require([_LT_TAG_COMPILER])dnl
-_LT_PROG_ECHO_BACKSLASH
 
 case $host_os in
 aix3*)
@@ -193,23 +205,6 @@ aix3*)
   ;;
 esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
 # Global variables:
 ofile=libtool
 can_build_shared=yes
@@ -250,6 +245,28 @@ _LT_CONFIG_COMMANDS
 ])# _LT_SETUP
 
 
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
 # _LT_PROG_LTMAIN
 # ---------------
 # Note that this code is called both from `configure', and `config.status'
@@ -408,7 +425,7 @@ m4_define([_lt_decl_all_varnames],
 # declaration there will have the same value as in `configure'.  VARNAME
 # must have a single quote delimited value for this to work.
 m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
 
 
 # _LT_CONFIG_STATUS_DECLARATIONS
@@ -418,7 +435,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE],
 # embedded single quotes properly.  In configure, this macro expands
 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
 #
-#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
     [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
@@ -517,12 +534,20 @@ LTCC='$LTCC'
 LTCFLAGS='$LTCFLAGS'
 compiler='$compiler_DEFAULT'
 
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
 # Quote evaled strings.
 for var in lt_decl_all_varnames([[ \
 ]], lt_decl_quote_varnames); do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -533,9 +558,9 @@ done
 # Double-quote double-evaled strings.
 for var in lt_decl_all_varnames([[ \
 ]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -543,16 +568,38 @@ for var in lt_decl_all_varnames([[ \
     esac
 done
 
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\[$]0 --fallback-echo"')dnl "
-  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
-  ;;
-esac
-
 _LT_OUTPUT_LIBTOOL_INIT
 ])
 
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 
 # LT_OUTPUT
 # ---------
@@ -562,20 +609,11 @@ _LT_OUTPUT_LIBTOOL_INIT
 AC_DEFUN([LT_OUTPUT],
 [: ${CONFIG_LT=./config.lt}
 AC_MSG_NOTICE([creating $CONFIG_LT])
-cat >"$CONFIG_LT" <<_LTEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate a libtool stub with the current configuration.
-
-lt_cl_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_LTEOF
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
 
 cat >>"$CONFIG_LT" <<\_LTEOF
-AS_SHELL_SANITIZE
-_AS_PREPARE
-
-exec AS_MESSAGE_FD>&1
+lt_cl_silent=false
 exec AS_MESSAGE_LOG_FD>>config.log
 {
   echo
@@ -601,7 +639,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
 configured by $[0], generated by m4_PACKAGE_STRING.
 
-Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2011 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
@@ -646,15 +684,13 @@ chmod +x "$CONFIG_LT"
 # appending to config.log, which fails on DOS, as config.log is still kept
 # open by configure.  Here we exec the FD to /dev/null, effectively closing
 # config.log, so it can be properly (re)opened and appended to by config.lt.
-if test "$no_create" != yes; then
-  lt_cl_success=:
-  test "$silent" = yes &&
-    lt_config_lt_args="$lt_config_lt_args --quiet"
-  exec AS_MESSAGE_LOG_FD>/dev/null
-  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-  exec AS_MESSAGE_LOG_FD>>config.log
-  $lt_cl_success || AS_EXIT(1)
-fi
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
 ])# LT_OUTPUT
 
 
@@ -717,15 +753,12 @@ _LT_EOF
   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
   # text mode, it properly converts lines to CR/LF.  This bash problem
   # is reportedly fixed, but why not run on old versions too?
-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  _LT_PROG_XSI_SHELLFNS
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
 
-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
+  _LT_PROG_REPLACE_SHELLFNS
 
-  mv -f "$cfgfile" "$ofile" ||
+   mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 ],
@@ -770,6 +803,7 @@ AC_DEFUN([LT_LANG],
 m4_case([$1],
   [C],			[_LT_LANG(C)],
   [C++],		[_LT_LANG(CXX)],
+  [Go],			[_LT_LANG(GO)],
   [Java],		[_LT_LANG(GCJ)],
   [Fortran 77],		[_LT_LANG(F77)],
   [Fortran],		[_LT_LANG(FC)],
@@ -791,6 +825,31 @@ m4_defun([_LT_LANG],
 ])# _LT_LANG
 
 
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC],     [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+  fi
+fi
+if test -z "$GOC"; then
+  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
 # _LT_LANG_DEFAULT_CONFIG
 # -----------------------
 m4_defun([_LT_LANG_DEFAULT_CONFIG],
@@ -821,6 +880,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
        m4_ifdef([LT_PROG_GCJ],
 	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
 
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+  [LT_LANG(GO)],
+  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
 AC_PROVIDE_IFELSE([LT_PROG_RC],
   [LT_LANG(RC)],
   [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
@@ -831,11 +894,13 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
 dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
 
 
 # _LT_TAG_COMPILER
@@ -921,7 +986,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
 	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
         _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	# If there is a non-empty error log, and "single_module"
+	# appears in it, assume the flag caused a linker warning
+        if test -s conftest.err && $GREP single_module conftest.err; then
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	# Otherwise, if the output was created with a 0 exit code from
+	# the compiler, it worked.
+	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -929,6 +1000,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	rm -rf libconftest.dylib*
 	rm -f conftest.*
       fi])
+
     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
       [lt_cv_ld_exported_symbols_list],
       [lt_cv_ld_exported_symbols_list=no
@@ -940,6 +1012,34 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	[lt_cv_ld_exported_symbols_list=no])
 	LDFLAGS="$save_LDFLAGS"
     ])
+
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -s conftest.err && $GREP force_load conftest.err; then
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
@@ -967,7 +1067,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
     else
       _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
     fi
-    if test "$DSYMUTIL" != ":"; then
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -977,8 +1077,8 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 ])
 
 
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
 # Checks for linker and compiler features on darwin
 m4_defun([_LT_DARWIN_LINKER_FEATURES],
 [
@@ -987,7 +1087,13 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
   _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
   case $cc_basename in
@@ -995,7 +1101,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
      *) _lt_dar_can_shared=$GCC ;;
   esac
   if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
+    output_verbose_link_cmd=func_echo_all
     _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
     _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
     _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
@@ -1011,203 +1117,142 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   fi
 ])
 
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
 # Links a minimal program and checks the executable
 # for the system default hardcoded library path. In most cases,
 # this is /usr/lib:/lib, but when the MPI compilers are used
 # the location of the communication and MPI libs are included too.
 # If we don't find anything, use the default library path according
 # to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
 ])# _LT_SYS_MODULE_PATH_AIX
 
 
 # _LT_SHELL_INIT(ARG)
 # -------------------
 m4_define([_LT_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-	 [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_SHELL_INIT
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
 
 
 # _LT_PROG_ECHO_BACKSLASH
 # -----------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
 m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[_LT_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$lt_ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $ECHO works!
-  :
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
 else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<_LT_EOF
-[$]*
-_LT_EOF
-  exit 0
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
 fi
 
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
-  if test "X${echo_test_string+set}" != Xset; then
-    # find a string as large as possible, as long as the shell can cope with it
-    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
-	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
-      then
-        break
-      fi
-    done
-  fi
-
-  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-     test "X$echo_testing_string" = "X$echo_test_string"; then
-    :
-  else
-    # The Solaris, AIX, and Digital Unix default echo programs unquote
-    # backslashes.  This makes it impossible to quote backslashes using
-    #   echo "$something" | sed 's/\\/\\\\/g'
-    #
-    # So, first we look for a working echo in the user's PATH.
-
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for dir in $PATH /usr/ucb; do
-      IFS="$lt_save_ifs"
-      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        ECHO="$dir/echo"
-        break
-      fi
-    done
-    IFS="$lt_save_ifs"
-
-    if test "X$ECHO" = Xecho; then
-      # We didn't find a better echo, so look for alternatives.
-      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        # This shell has a builtin print -r that does the trick.
-        ECHO='print -r'
-      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
-	   test "X$CONFIG_SHELL" != X/bin/ksh; then
-        # If we have ksh, try running configure again with it.
-        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-        export ORIGINAL_CONFIG_SHELL
-        CONFIG_SHELL=/bin/ksh
-        export CONFIG_SHELL
-        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-      else
-        # Try using printf.
-        ECHO='printf %s\n'
-        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	  # Cool, printf works
-	  :
-        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	  export CONFIG_SHELL
-	  SHELL="$CONFIG_SHELL"
-	  export SHELL
-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
-        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
-        else
-	  # maybe with a smaller string...
-	  prev=:
-
-	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
-	    then
-	      break
-	    fi
-	    prev="$cmd"
-	  done
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
 
-	  if test "$prev" != 'sed 50q "[$]0"'; then
-	    echo_test_string=`eval $prev`
-	    export echo_test_string
-	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-	  else
-	    # Oops.  We lost completely, so just stick with echo.
-	    ECHO=echo
-	  fi
-        fi
-      fi
-    fi
-  fi
-fi
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
 
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
 
-AC_SUBST(lt_ECHO)
-])
 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1],
-    [An echo program that does not interpret backslashes])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
 ])# _LT_PROG_ECHO_BACKSLASH
 
 
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
 # _LT_ENABLE_LOCK
 # ---------------
 m4_defun([_LT_ENABLE_LOCK],
@@ -1236,7 +1281,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     if test "$lt_cv_prog_gnu_ld" = yes; then
       case `/usr/bin/file conftest.$ac_objext` in
@@ -1279,7 +1324,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
 	    ;;
 	  ppc64-*linux*|powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
@@ -1329,14 +1381,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
     CFLAGS="$SAVE_CFLAGS"
   fi
   ;;
-sparc*-*solaris*)
+*-*solaris*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      yes*)
+        case $host in
+        i?86-*-solaris*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        sparc*-*-solaris*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+        esac
+        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
+        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+          LD="${LD-ld}_sol2"
+        fi
+        ;;
       *)
 	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
 	  LD="${LD-ld} -64"
@@ -1354,14 +1419,47 @@ need_locks="$enable_libtool_lock"
 ])# _LT_ENABLE_LOCK
 
 
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test "$ac_status" -eq 0; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	AC_TRY_EVAL([lt_ar_try])
+	if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
 # _LT_CMD_OLD_ARCHIVE
 # -------------------
 m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1])
+[_LT_PROG_AR
 
 AC_CHECK_TOOL(STRIP, strip, :)
 test -z "$STRIP" && STRIP=:
@@ -1380,18 +1478,27 @@ old_postuninstall_cmds=
 if test -n "$RANLIB"; then
   case $host_os in
   openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
     ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
 fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
 _LT_DECL([], [old_postinstall_cmds], [2])
 _LT_DECL([], [old_postuninstall_cmds], [2])
 _LT_TAGDECL([], [old_archive_cmds], [2],
     [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
 ])# _LT_CMD_OLD_ARCHIVE
 
 
@@ -1416,15 +1523,15 @@ AC_CACHE_CHECK([$1], [$2],
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        $2=yes
@@ -1464,7 +1571,7 @@ AC_CACHE_CHECK([$1], [$2],
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          $2=yes
@@ -1527,6 +1634,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
   amigaos*)
     # On AmigaOS with pdksh, this test takes hours, literally.
     # So we just punt and use a minimum line length of 8192.
@@ -1552,6 +1664,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=196608
     ;;
 
+  os2*)
+    # The test takes a long time on OS/2.
+    lt_cv_sys_max_cmd_len=8192
+    ;;
+
   osf*)
     # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
     # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -1578,7 +1695,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -1591,8 +1709,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
-	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
 	      test $i != 17 # 1/2 MB should be enough
       do
         i=`expr $i + 1`
@@ -1643,7 +1761,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-[#line __oline__ "configure"
+[#line $LINENO "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -1684,7 +1802,13 @@ else
 #  endif
 #endif
 
-void fnord() { int i=42;}
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -1693,7 +1817,11 @@ int main ()
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
       /* dlclose (self); */
     }
   else
@@ -1869,16 +1997,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
@@ -2037,6 +2165,7 @@ m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_OBJDUMP])dnl
 m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
 	[], [
@@ -2045,16 +2174,23 @@ if test "$GCC" = yes; then
     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
     *) lt_awk_arg="/^libraries:/" ;;
   esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
   # Ok, now we have the path, separated by spaces, we can step through it
   # and add multilib dir if necessary.
   lt_tmp_lt_search_path_spec=
@@ -2067,7 +2203,7 @@ if test "$GCC" = yes; then
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
-  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
 BEGIN {RS=" "; FS="/|\n";} {
   lt_foo="";
   lt_count=0;
@@ -2087,7 +2223,13 @@ BEGIN {RS=" "; FS="/|\n";} {
   if (lt_foo != "") { lt_freq[[lt_foo]]++; }
   if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
 }'`
-  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi])
@@ -2113,7 +2255,7 @@ need_version=unknown
 
 case $host_os in
 aix3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
@@ -2122,7 +2264,7 @@ aix3*)
   ;;
 
 aix[[4-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
@@ -2175,7 +2317,7 @@ amigaos*)
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
@@ -2187,7 +2329,7 @@ beos*)
   ;;
 
 bsdi[[45]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
@@ -2206,8 +2348,9 @@ cygwin* | mingw* | pw32* | cegcc*)
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
@@ -2228,36 +2371,83 @@ cygwin* | mingw* | pw32* | cegcc*)
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
     ;;
 
   *)
+    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
     ;;
   esac
-  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -2278,7 +2468,7 @@ m4_if([$1], [],[
   ;;
 
 dgux*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -2286,10 +2476,6 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -2297,7 +2483,7 @@ freebsd* | dragonfly*)
     objformat=`/usr/bin/objformat`
   else
     case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
+    freebsd[[23]].*) objformat=aout ;;
     *) objformat=elf ;;
     esac
   fi
@@ -2315,7 +2501,7 @@ freebsd* | dragonfly*)
   esac
   shlibpath_var=LD_LIBRARY_PATH
   case $host_os in
-  freebsd2*)
+  freebsd2.*)
     shlibpath_overrides_runpath=yes
     ;;
   freebsd3.[[01]]* | freebsdelf3.[[01]]*)
@@ -2334,13 +2520,16 @@ freebsd* | dragonfly*)
   esac
   ;;
 
-gnu*)
-  version_type=linux
+haiku*)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
+  dynamic_linker="$host_os runtime_loader"
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 
@@ -2386,12 +2575,14 @@ hpux9* | hpux10* | hpux11*)
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
   postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
   ;;
 
 interix[[3-9]]*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -2407,7 +2598,7 @@ irix5* | irix6* | nonstopux*)
     nonstopux*) version_type=nonstopux ;;
     *)
 	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
+		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
 	fi ;;
@@ -2444,9 +2635,9 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2454,16 +2645,21 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
+
   # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
-       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
-  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
-       [shlibpath_overrides_runpath=yes])])
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+	 [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
 
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
@@ -2472,7 +2668,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -2516,7 +2712,7 @@ netbsd*)
   ;;
 
 newsos6)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
@@ -2585,7 +2781,7 @@ rdos*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2610,7 +2806,7 @@ sunos4*)
   ;;
 
 sysv4 | sysv4.3*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -2634,7 +2830,7 @@ sysv4 | sysv4.3*)
 
 sysv4*MP*)
   if test -d /usr/nec ;then
-    version_type=linux
+    version_type=linux # correct to gnu/linux during the next big refactor
     library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
     soname_spec='$libname${shared_ext}.$major'
     shlibpath_var=LD_LIBRARY_PATH
@@ -2665,7 +2861,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
 
 tpf*)
   # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2675,7 +2871,7 @@ tpf*)
   ;;
 
 uts4*)
-  version_type=linux
+  version_type=linux # correct to gnu/linux during the next big refactor
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
@@ -2717,6 +2913,8 @@ _LT_DECL([], [library_names_spec], [1],
     The last name is the one that the linker finds with -lNAME]])
 _LT_DECL([], [soname_spec], [1],
     [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
 _LT_DECL([], [postinstall_cmds], [2],
     [Command to use after installation of a shared archive])
 _LT_DECL([], [postuninstall_cmds], [2],
@@ -2829,6 +3027,7 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 m4_require([_LT_DECL_SED])dnl
 m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
 
 AC_ARG_WITH([gnu-ld],
     [AS_HELP_STRING([--with-gnu-ld],
@@ -2950,6 +3149,11 @@ case $reload_flag in
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
   darwin*)
     if test "$GCC" = yes; then
       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
@@ -2958,8 +3162,8 @@ case $host_os in
     fi
     ;;
 esac
-_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_DECL([], [reload_cmds], [2])dnl
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
 ])# _LT_CMD_RELOAD
 
 
@@ -3011,16 +3215,18 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
     lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
   ;;
 
-cegcc)
+cegcc*)
   # use the weaker test based on 'objdump'. See mingw*.
   lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
   lt_cv_file_magic_cmd='$OBJDUMP -f'
@@ -3046,7 +3252,7 @@ freebsd* | dragonfly*)
   fi
   ;;
 
-gnu*)
+haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3058,11 +3264,11 @@ hpux10.20* | hpux11*)
     lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
     ;;
   hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
     lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
     ;;
   *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
     lt_cv_file_magic_test_file=/usr/lib/libc.sl
     ;;
   esac
@@ -3083,8 +3289,8 @@ irix5* | irix6* | nonstopux*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -3162,6 +3368,21 @@ tpf*)
   ;;
 esac
 ])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -3169,7 +3390,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 _LT_DECL([], [deplibs_check_method], [1],
     [Method to check whether dependent libraries are shared objects])
 _LT_DECL([], [file_magic_cmd], [1],
-    [Command to use when deplibs_check_method == "file_magic"])
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
 ])# _LT_CHECK_MAGIC_METHOD
 
 
@@ -3226,7 +3451,19 @@ if test "$lt_cv_path_NM" != "no"; then
   NM="$lt_cv_path_NM"
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
-  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
   AC_SUBST([DUMPBIN])
   if test "$DUMPBIN" != ":"; then
     NM="$DUMPBIN"
@@ -3239,13 +3476,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
   [lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
   cat conftest.out >&AS_MESSAGE_LOG_FD
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -3260,7 +3497,68 @@ dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([AM_PROG_NM], [])
 dnl AC_DEFUN([AC_PROG_NM], [])
 
-
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
 # LT_LIB_M
 # --------
 # check for math library
@@ -3268,7 +3566,7 @@ AC_DEFUN([LT_LIB_M],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 LIBM=
 case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
   # These system don't have libm, or don't need it
   ;;
 *-ncr-sysv4.3*)
@@ -3296,7 +3594,12 @@ m4_defun([_LT_COMPILER_NO_RTTI],
 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
 if test "$GCC" = yes; then
-  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
 
   _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
     lt_cv_prog_compiler_rtti_exceptions,
@@ -3313,6 +3616,7 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([LT_PATH_NM])dnl
 AC_REQUIRE([LT_PATH_LD])dnl
 m4_require([_LT_DECL_SED])dnl
@@ -3380,8 +3684,8 @@ esac
 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -3405,6 +3709,7 @@ for ac_symprfx in "" "_"; do
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
+"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -3417,6 +3722,7 @@ for ac_symprfx in "" "_"; do
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
   fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -3438,7 +3744,7 @@ _LT_EOF
   if AC_TRY_EVAL(ac_compile); then
     # Now try to grab the symbols.
     nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
       # Try sorting and uniquifying the output.
       if sort "$nlist" | uniq > "$nlist"T; then
 	mv -f "$nlist"T "$nlist"
@@ -3450,6 +3756,18 @@ _LT_EOF
       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t at _DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT@&t at _DLSYM_CONST
+#else
+# define LT@&t at _DLSYM_CONST const
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3461,7 +3779,7 @@ _LT_EOF
 	  cat <<_LT_EOF >> conftest.$ac_ext
 
 /* The mapping between symbol names and symbols.  */
-const struct {
+LT@&t at _DLSYM_CONST struct {
   const char *name;
   void       *address;
 }
@@ -3487,15 +3805,15 @@ static const void *lt_preloaded_setup() {
 _LT_EOF
 	  # Now try linking the two files.
 	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
 	  LIBS="conftstm.$ac_objext"
 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
 	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
 	else
 	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
 	fi
@@ -3528,6 +3846,13 @@ else
   AC_MSG_RESULT(ok)
 fi
 
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
     [Take the output of nm and produce a listing of raw symbols and C names])
 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
@@ -3538,6 +3863,8 @@ _LT_DECL([global_symbol_to_c_name_address],
 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
     [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
 ]) # _LT_CMD_GLOBAL_SYMBOLS
 
 
@@ -3549,7 +3876,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)=
 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
 _LT_TAGVAR(lt_prog_compiler_static, $1)=
 
-AC_MSG_CHECKING([for $compiler option to produce PIC])
 m4_if([$1], [CXX], [
   # C++ specific cases for pic, static, wl, etc.
   if test "$GXX" = yes; then
@@ -3600,6 +3926,11 @@ m4_if([$1], [CXX], [
       # DJGPP does not support shared libraries at all
       _LT_TAGVAR(lt_prog_compiler_pic, $1)=
       ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
     interix[[3-9]]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
@@ -3649,6 +3980,12 @@ m4_if([$1], [CXX], [
 	  ;;
 	esac
 	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	m4_if([$1], [GCJ], [],
+	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+	;;
       dgux*)
 	case $cc_basename in
 	  ec++*)
@@ -3705,7 +4042,7 @@ m4_if([$1], [CXX], [
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -3738,8 +4075,8 @@ m4_if([$1], [CXX], [
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 	    ;;
-	  xlc* | xlC*)
-	    # IBM XL 8.0 on PPC
+	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
@@ -3801,7 +4138,7 @@ m4_if([$1], [CXX], [
 	;;
       solaris*)
 	case $cc_basename in
-	  CC*)
+	  CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -3905,6 +4242,12 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
       ;;
 
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
     hpux*)
       # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
       # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
@@ -3947,6 +4290,15 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
     esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+      fi
+      ;;
+    esac
   else
     # PORTME Check for flag to pass linker flags through the system compiler.
     case $host_os in
@@ -3989,7 +4341,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -4010,7 +4362,13 @@ m4_if([$1], [CXX], [
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
 	;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
+      nagfor*)
+	# NAG Fortran compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -4022,25 +4380,40 @@ m4_if([$1], [CXX], [
         # All Alpha code is PIC.
         _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         ;;
-      xl*)
-	# IBM XL C 8.0/Fortran 10.1 on PPC
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
 	;;
       *)
 	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	*Sun\ F* | *Sun*Fortran*)
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	  ;;
 	*Sun\ C*)
 	  # Sun C 5.9
 	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+        *Intel*\ [[CF]]*Compiler*)
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	  ;;
+	*Portland\ Group*)
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
 	  ;;
 	esac
 	;;
@@ -4072,7 +4445,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       case $cc_basename in
-      f77* | f90* | f95*)
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
       *)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
@@ -4129,9 +4502,11 @@ case $host_os in
     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
     ;;
 esac
-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-	[How to pass a linker flag through the compiler])
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
 
 #
 # Check to make sure the PIC flag actually works.
@@ -4150,6 +4525,8 @@ fi
 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
 	[Additional compiler flags for building library objects])
 
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
 #
 # Check to make sure the static flag actually works.
 #
@@ -4170,6 +4547,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
 m4_defun([_LT_LINKER_SHLIBS],
 [AC_REQUIRE([LT_PATH_LD])dnl
 AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_DECL_SED])dnl
@@ -4178,30 +4556,40 @@ m4_require([_LT_TAG_COMPILER])dnl
 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
 m4_if([$1], [CXX], [
   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   case $host_os in
   aix[[4-9]]*)
     # If we're using GNU nm, then we don't want the "-C" option.
     # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
       _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
+    ;;
   cygwin* | mingw* | cegcc*)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  linux* | k*bsd*-gnu)
+    case $cc_basename in
+    cl*)
+      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+      ;;
+    *)
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+      ;;
+    esac
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
     _LT_TAGVAR(link_all_deplibs, $1)=no
-  ;;
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
+    ;;
   esac
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
 ], [
   runpath_var=
   _LT_TAGVAR(allow_undefined_flag, $1)=
@@ -4216,7 +4604,6 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_direct_absolute, $1)=no
   _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
   _LT_TAGVAR(hardcode_libdir_separator, $1)=
   _LT_TAGVAR(hardcode_minus_L, $1)=no
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -4261,13 +4648,39 @@ dnl Note also adjust exclude_expsyms for C++ above.
   openbsd*)
     with_gnu_ld=no
     ;;
-  linux* | k*bsd*-gnu)
+  linux* | k*bsd*-gnu | gnu*)
     _LT_TAGVAR(link_all_deplibs, $1)=no
     ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
   if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
@@ -4301,11 +4714,12 @@ dnl Note also adjust exclude_expsyms for C++ above.
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** Warning: the GNU linker, at least up to release 2.19, is reported
 *** to be unable to reliably create shared libraries on AIX.
 *** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
 
 _LT_EOF
       fi
@@ -4341,10 +4755,12 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_TAGVAR(always_export_symbols, $1)=no
       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -4362,6 +4778,11 @@ _LT_EOF
       fi
       ;;
 
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
     interix[[3-9]]*)
       _LT_TAGVAR(hardcode_direct, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -4387,15 +4808,16 @@ _LT_EOF
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
 	 && test "$tmp_diet" = no
       then
-	tmp_addflag=
+	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -4406,13 +4828,17 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
 	  tmp_sharedflag='--shared' ;;
-	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
@@ -4428,17 +4854,16 @@ _LT_EOF
         fi
 
 	case $cc_basename in
-	xlf*)
+	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
 	  if test "x$supports_anon_versioning" = xyes; then
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
 	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -4452,8 +4877,8 @@ _LT_EOF
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -4471,8 +4896,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4518,8 +4943,8 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4559,8 +4984,10 @@ _LT_EOF
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
 	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
@@ -4648,9 +5075,9 @@ _LT_EOF
 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        _LT_SYS_MODULE_PATH_AIX
+        _LT_SYS_MODULE_PATH_AIX([$1])
         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
       else
 	if test "$host_cpu" = ia64; then
 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
@@ -4659,14 +5086,19 @@ _LT_EOF
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 _LT_SYS_MODULE_PATH_AIX
+	 _LT_SYS_MODULE_PATH_AIX([$1])
 	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
 	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  fi
 	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 	  # This is similar to how AIX traditionally builds its shared libraries.
 	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
@@ -4698,20 +5130,64 @@ _LT_EOF
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	_LT_TAGVAR(always_export_symbols, $1)=yes
+	_LT_TAGVAR(file_list_spec, $1)='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	# FIXME: Should let the user specify the lib program.
+	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -4724,10 +5200,6 @@ _LT_EOF
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
-    freebsd1*)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
     # support.  Future versions do this automatically, but an explicit c++rt0.o
     # does not break anything, and helps significantly (at the cost of a little
@@ -4740,7 +5212,7 @@ _LT_EOF
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
+    freebsd2.*)
       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -4749,7 +5221,7 @@ _LT_EOF
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
     freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
       _LT_TAGVAR(hardcode_direct, $1)=yes
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -4757,7 +5229,7 @@ _LT_EOF
 
     hpux9*)
       if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
@@ -4772,14 +5244,13 @@ _LT_EOF
       ;;
 
     hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
       if test "$with_gnu_ld" = no; then
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
@@ -4791,16 +5262,16 @@ _LT_EOF
       ;;
 
     hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
 	case $host_cpu in
 	hppa*64*)
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
@@ -4812,7 +5283,14 @@ _LT_EOF
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	m4_if($1, [], [
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  _LT_LINKER_OPTION([if $CC understands -b],
+	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
 	  ;;
 	esac
       fi
@@ -4840,19 +5318,34 @@ _LT_EOF
 
     irix5* | irix6* | nonstopux*)
       if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
-        save_LDFLAGS="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-        AC_LINK_IFELSE(int foo(void) {},
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-        )
-        LDFLAGS="$save_LDFLAGS"
+	# This should be the same for all languages, so no per-tag cache variable.
+	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+	  [lt_cv_irix_exported_symbol],
+	  [save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   AC_LINK_IFELSE(
+	     [AC_LANG_SOURCE(
+	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+			      [C++], [[int foo (void) { return 0; }]],
+			      [Fortran 77], [[
+      subroutine foo
+      end]],
+			      [Fortran], [[
+      subroutine foo
+      end]])])],
+	      [lt_cv_irix_exported_symbol=yes],
+	      [lt_cv_irix_exported_symbol=no])
+           LDFLAGS="$save_LDFLAGS"])
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
@@ -4914,17 +5407,17 @@ _LT_EOF
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
       _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
       if test "$GCC" = yes; then
 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
@@ -4934,13 +5427,13 @@ _LT_EOF
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
       if test "$GCC" = yes; then
 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -4953,9 +5446,9 @@ _LT_EOF
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
       if test "$GCC" = yes; then
 	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
@@ -5131,36 +5624,38 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
-	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
-        _LT_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
-        then
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        else
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-        fi
-        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+	[$RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+	  _LT_TAGVAR(allow_undefined_flag, $1)=
+	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+	  then
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	  else
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  fi
+	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+	])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
       ;;
     esac
   fi
@@ -5197,9 +5692,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
     [Flag to hardcode $libdir into a binary during linking.
     This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
-    [[If ld is used when linking, flag to hardcode $libdir into a binary
-    during linking.  This must work even if $libdir does not exist]])
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
@@ -5225,8 +5717,6 @@ _LT_TAGDECL([], [inherit_rpath], [0],
     to runtime path list])
 _LT_TAGDECL([], [link_all_deplibs], [0],
     [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [fix_srcfile_path], [1],
-    [Fix the shell variable $srcfile for the compiler])
 _LT_TAGDECL([], [always_export_symbols], [0],
     [Set to "yes" if exported symbols are required])
 _LT_TAGDECL([], [export_symbols_cmds], [2],
@@ -5237,6 +5727,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
     [Symbols that must always be exported])
 _LT_TAGDECL([], [prelink_cmds], [2],
     [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
 _LT_TAGDECL([], [file_list_spec], [1],
     [Specify filename containing input files])
 dnl FIXME: Not yet implemented
@@ -5330,37 +5822,22 @@ CC="$lt_save_CC"
 ])# _LT_LANG_C_CONFIG
 
 
-# _LT_PROG_CXX
-# ------------
-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
-# compiler, we have our own version here.
-m4_defun([_LT_PROG_CXX],
-[
-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
-AC_PROG_CXX
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_CXX
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_CXX], [])
-
-
 # _LT_LANG_CXX_CONFIG([TAG])
 # --------------------------
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
 # the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
-[AC_REQUIRE([_LT_PROG_CXX])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
 
 AC_LANG_PUSH(C++)
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
@@ -5372,7 +5849,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -5382,6 +5858,8 @@ _LT_TAGVAR(module_cmds, $1)=
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -5413,6 +5891,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 
   # Allow CC to be a program name with arguments.
   lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
   lt_save_LD=$LD
   lt_save_GCC=$GCC
   GCC=$GXX
@@ -5430,6 +5909,7 @@ if test "$_lt_caught_CXX_error" != yes; then
   fi
   test -z "${LDCXX+set}" || LD=$LDCXX
   CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
   compiler=$CC
   _LT_TAGVAR(compiler, $1)=$CC
   _LT_CC_BASENAME([$compiler])
@@ -5451,8 +5931,8 @@ if test "$_lt_caught_CXX_error" != yes; then
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
       if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
@@ -5484,7 +5964,7 @@ if test "$_lt_caught_CXX_error" != yes; then
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
       # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
     else
       GXX=no
@@ -5593,10 +6073,10 @@ if test "$_lt_caught_CXX_error" != yes; then
           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
-          _LT_SYS_MODULE_PATH_AIX
+          _LT_SYS_MODULE_PATH_AIX([$1])
           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
         else
           if test "$host_cpu" = ia64; then
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
@@ -5605,14 +6085,19 @@ if test "$_lt_caught_CXX_error" != yes; then
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
-	    _LT_SYS_MODULE_PATH_AIX
+	    _LT_SYS_MODULE_PATH_AIX([$1])
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
 	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
 	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    # Exported symbols can be pulled into shared objects from archives
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    fi
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 	    # This is similar to how AIX traditionally builds its shared
 	    # libraries.
@@ -5642,28 +6127,75 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-        # as there is no search path for DLLs.
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-        _LT_TAGVAR(always_export_symbols, $1)=no
-        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    cp $export_symbols $output_objdir/$soname.def;
-          else
-	    echo EXPORTS > $output_objdir/$soname.def;
-	    cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          _LT_TAGVAR(ld_shlibs, $1)=no
-        fi
-        ;;
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=yes
+	  _LT_TAGVAR(file_list_spec, $1)='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=".dll"
+	  # FIXME: Setting linknames here is a bad hack.
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	  # Don't use ranlib
+	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=no
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	  ;;
+	esac
+	;;
       darwin* | rhapsody*)
         _LT_DARWIN_LINKER_FEATURES($1)
 	;;
@@ -5686,7 +6218,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         esac
         ;;
 
-      freebsd[[12]]*)
+      freebsd2.*)
         # C++ shared libraries reported to be fairly broken before
 	# switch to ELF
         _LT_TAGVAR(ld_shlibs, $1)=no
@@ -5702,7 +6234,9 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=yes
         ;;
 
-      gnu*)
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
         ;;
 
       hpux9*)
@@ -5729,11 +6263,11 @@ if test "$_lt_caught_CXX_error" != yes; then
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
             if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               _LT_TAGVAR(ld_shlibs, $1)=no
@@ -5794,7 +6328,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
 	    if test "$GXX" = yes; then
@@ -5804,10 +6338,10 @@ if test "$_lt_caught_CXX_error" != yes; then
 	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -5837,7 +6371,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -5848,9 +6382,9 @@ if test "$_lt_caught_CXX_error" != yes; then
           *)
 	    if test "$GXX" = yes; then
 	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
 	      fi
 	    fi
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -5861,7 +6395,7 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -5879,7 +6413,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
@@ -5916,26 +6450,26 @@ if test "$_lt_caught_CXX_error" != yes; then
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
-	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
 		$RANLIB $oldlib'
 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
 		rm -rf $tpldir~
 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
-	    *) # Version 6 will use weak symbols
+	    *) # Version 6 and above use weak symbols
 	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
@@ -5943,7 +6477,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
@@ -5962,9 +6496,9 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
-	  xl*)
+	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
@@ -5984,13 +6518,13 @@ if test "$_lt_caught_CXX_error" != yes; then
 	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	      _LT_TAGVAR(compiler_needs_object, $1)=yes
 
 	      # Not sure whether something based on
 	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
 	      # would be better.
-	      output_verbose_link_cmd='echo'
+	      output_verbose_link_cmd='func_echo_all'
 
 	      # Archives containing C++ object files must be created using
 	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -6059,7 +6593,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 	  fi
-	  output_verbose_link_cmd=echo
+	  output_verbose_link_cmd=func_echo_all
 	else
 	  _LT_TAGVAR(ld_shlibs, $1)=no
 	fi
@@ -6094,15 +6628,15 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    case $host in
 	      osf3*)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
 		;;
 	      *)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
 	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
 	          $RM $lib.exp'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 		;;
@@ -6118,17 +6652,17 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
 	      case $host in
 	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 		  ;;
 	      esac
 
@@ -6138,7 +6672,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	      # Commands to make compiler produce verbose output that lists
 	      # what "hidden" libraries, object files and flags are used when
 	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 
 	    else
 	      # FIXME: insert proper C++ library support
@@ -6174,7 +6708,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 
       solaris*)
         case $cc_basename in
-          CC*)
+          CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
@@ -6195,7 +6729,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    esac
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
 
-	    output_verbose_link_cmd='echo'
+	    output_verbose_link_cmd='func_echo_all'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
@@ -6215,14 +6749,14 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
 	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
 	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
 	        # platform.
@@ -6233,7 +6767,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
@@ -6287,6 +6821,10 @@ if test "$_lt_caught_CXX_error" != yes; then
           CC*)
 	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+	      '"$_LT_TAGVAR(reload_cmds, $1)"
 	    ;;
 	  *)
 	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
@@ -6342,6 +6880,7 @@ if test "$_lt_caught_CXX_error" != yes; then
   fi # test -n "$compiler"
 
   CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
   LDCXX=$LD
   LD=$lt_save_LD
   GCC=$lt_save_GCC
@@ -6356,6 +6895,29 @@ AC_LANG_POP
 ])# _LT_LANG_CXX_CONFIG
 
 
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
 # ---------------------------------
 # Figure out "hidden" library dependencies from verbose
@@ -6364,6 +6926,7 @@ AC_LANG_POP
 # objects, libraries and library flags.
 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
 # Dependencies to place before and after the object being linked:
 _LT_TAGVAR(predep_objects, $1)=
 _LT_TAGVAR(postdep_objects, $1)=
@@ -6413,7 +6976,20 @@ public class foo {
   }
 };
 _LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
 ])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
 dnl Parse the compiler output and extract the necessary
 dnl objects, libraries and library flags.
 if AC_TRY_EVAL(ac_compile); then
@@ -6425,7 +7001,7 @@ if AC_TRY_EVAL(ac_compile); then
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case $p in
+    case ${prev}${p} in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
@@ -6434,13 +7010,22 @@ if AC_TRY_EVAL(ac_compile); then
           test $p = "-R"; then
 	 prev=$p
 	 continue
-       else
-	 prev=
        fi
 
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
        if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
+	 case ${prev} in
+	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
@@ -6460,8 +7045,10 @@ if AC_TRY_EVAL(ac_compile); then
 	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
 	 fi
        fi
+       prev=
        ;;
 
+    *.lto.$objext) ;; # Ignore GCC LTO objects
     *.$objext)
        # This assumes that the test object file only shows up
        # once in the compiler output.
@@ -6497,6 +7084,7 @@ else
 fi
 
 $RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
 
 # PORTME: override above test on systems where it is broken
 m4_if([$1], [CXX],
@@ -6533,7 +7121,7 @@ linux*)
 
 solaris*)
   case $cc_basename in
-  CC*)
+  CC* | sunCC*)
     # The more standards-conforming stlport4 library is
     # incompatible with the Cstd library. Avoid specifying
     # it if it's in CXXFLAGS. Ignore libCrun as
@@ -6577,32 +7165,16 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1],
 ])# _LT_SYS_HIDDEN_LIBDEPS
 
 
-# _LT_PROG_F77
-# ------------
-# Since AC_PROG_F77 is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_F77],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
-AC_PROG_F77
-if test -z "$F77" || test "X$F77" = "Xno"; then
-  _lt_disable_F77=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_F77
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_F77], [])
-
-
 # _LT_LANG_F77_CONFIG([TAG])
 # --------------------------
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
-[AC_REQUIRE([_LT_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
 
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_TAGVAR(allow_undefined_flag, $1)=
@@ -6612,7 +7184,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -6621,6 +7192,8 @@ _LT_TAGVAR(module_cmds, $1)=
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -6660,7 +7233,9 @@ if test "$_lt_disable_F77" != yes; then
   # Allow CC to be a program name with arguments.
   lt_save_CC="$CC"
   lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
   CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
   compiler=$CC
   _LT_TAGVAR(compiler, $1)=$CC
   _LT_CC_BASENAME([$compiler])
@@ -6714,38 +7289,24 @@ if test "$_lt_disable_F77" != yes; then
 
   GCC=$lt_save_GCC
   CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
 fi # test "$_lt_disable_F77" != yes
 
 AC_LANG_POP
 ])# _LT_LANG_F77_CONFIG
 
 
-# _LT_PROG_FC
-# -----------
-# Since AC_PROG_FC is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_FC],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
-AC_PROG_FC
-if test -z "$FC" || test "X$FC" = "Xno"; then
-  _lt_disable_FC=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_FC
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_FC], [])
-
-
 # _LT_LANG_FC_CONFIG([TAG])
 # -------------------------
 # Ensure that the configuration variables for a Fortran compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
 # to write the compiler configuration to `libtool'.
 m4_defun([_LT_LANG_FC_CONFIG],
-[AC_REQUIRE([_LT_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
 
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_TAGVAR(allow_undefined_flag, $1)=
@@ -6755,7 +7316,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
 _LT_TAGVAR(hardcode_direct, $1)=no
 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
@@ -6764,6 +7324,8 @@ _LT_TAGVAR(module_cmds, $1)=
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -6803,7 +7365,9 @@ if test "$_lt_disable_FC" != yes; then
   # Allow CC to be a program name with arguments.
   lt_save_CC="$CC"
   lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
   CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
   compiler=$CC
   GCC=$ac_cv_fc_compiler_gnu
 
@@ -6859,7 +7423,8 @@ if test "$_lt_disable_FC" != yes; then
   fi # test -n "$compiler"
 
   GCC=$lt_save_GCC
-  CC="$lt_save_CC"
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
 fi # test "$_lt_disable_FC" != yes
 
 AC_LANG_POP
@@ -6896,10 +7461,12 @@ _LT_COMPILER_BOILERPLATE
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=yes
 CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
 _LT_TAGVAR(LD, $1)="$LD"
@@ -6909,6 +7476,8 @@ _LT_CC_BASENAME([$compiler])
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 
 ## CAVEAT EMPTOR:
 ## There is no encapsulation within the following macros, do not change
@@ -6928,10 +7497,82 @@ fi
 AC_LANG_RESTORE
 
 GCC=$lt_save_GCC
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_GCJ_CONFIG
 
 
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
 # _LT_LANG_RC_CONFIG([TAG])
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
@@ -6963,9 +7604,11 @@ _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
 CC=${RC-"windres"}
+CFLAGS=
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
 _LT_CC_BASENAME([$compiler])
@@ -6978,7 +7621,8 @@ fi
 
 GCC=$lt_save_GCC
 AC_LANG_RESTORE
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
 ])# _LT_LANG_RC_CONFIG
 
 
@@ -6998,6 +7642,13 @@ dnl aclocal-1.4 backwards compatibility:
 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
 
 
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
 # LT_PROG_RC
 # ----------
 AC_DEFUN([LT_PROG_RC],
@@ -7037,6 +7688,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
 AC_SUBST([OBJDUMP])
 ])
 
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
 
 # _LT_DECL_SED
 # ------------
@@ -7130,8 +7790,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES],
 # Try some XSI features
 xsi_shell=no
 ( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
     && eval 'test $(( 1 + 1 )) -eq 2 \
     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
   && xsi_shell=yes
@@ -7170,208 +7830,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
 ])# _LT_CHECK_SHELL_FEATURES
 
 
-# _LT_PROG_XSI_SHELLFNS
-# ---------------------
-# Bourne and XSI compatible variants of some useful shell functions.
-m4_defun([_LT_PROG_XSI_SHELLFNS],
-[case $xsi_shell in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-  func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-  # positional parameters, so assign one to ordinary parameter first.
-  func_stripname_result=${3}
-  func_stripname_result=${func_stripname_result#"${1}"}
-  func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=${1%%=*}
-  func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  case ${1} in
-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-    *)    func_lo2o_result=${1} ;;
-  esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=${1%.*}.lo
-}
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
 
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=$(( $[*] ))
-}
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=${#1}
-}
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac
+    func_basename_result="${1##*/}"])
 
-_LT_EOF
-    ;;
-  *) # Bourne compatible functions.
-    cat << \_LT_EOF >> "$cfgfile"
+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary parameter first.
+    func_stripname_result=${3}
+    func_stripname_result=${func_stripname_result#"${1}"}
+    func_stripname_result=${func_stripname_result%"${2}"}])
 
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-}
+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+    func_split_long_opt_name=${1%%=*}
+    func_split_long_opt_arg=${1#*=}])
 
-# func_basename file
-func_basename ()
-{
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
 
-dnl func_dirname_and_basename
-dnl A portable version of this function is already defined in general.m4sh
-dnl so there is no need for it here.
+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+    case ${1} in
+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+      *)    func_lo2o_result=${1} ;;
+    esac])
 
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-  case ${2} in
-    .*) func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
-    *)  func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
-  esac
-}
+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
 
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
 
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
-  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
-}
+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+fi
 
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=`expr "$[@]"`
-}
+if test x"$lt_shell_append" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+    func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
 
-_LT_EOF
-esac
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
 
-case $lt_shell_append in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
+if test x"$_lt_function_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
 
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$[1]+=\$[2]"
-}
-_LT_EOF
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
     ;;
-  *)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$[1]=\$$[1]\$[2]"
-}
-
-_LT_EOF
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
     ;;
-  esac
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
 ])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
index 34151a3..5d9acd8 100644
--- a/m4/ltoptions.m4
+++ b/m4/ltoptions.m4
@@ -1,13 +1,14 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
 #   Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 6 ltoptions.m4
+# serial 7 ltoptions.m4
 
 # This is to help aclocal find these macros, as it can't see m4_define.
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -125,7 +126,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll],
 [enable_win32_dll=yes
 
 case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
   AC_CHECK_TOOL(AS, as, false)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(OBJDUMP, objdump, false)
@@ -133,13 +134,13 @@ case $host in
 esac
 
 test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [0], [Assembler program])dnl
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
 
 test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
 
 test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
 ])# win32-dll
 
 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
@@ -325,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 # MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic],
+    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
 	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
+    [lt_p=${PACKAGE-default}
+    case $withval in
+    yes|no) pic_mode=$withval ;;
+    *)
+      pic_mode=default
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for lt_pkg in $withval; do
+	IFS="$lt_save_ifs"
+	if test "X$lt_pkg" = "X$lt_p"; then
+	  pic_mode=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
     [pic_mode=default])
 
 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
index f3c5309..07a8602 100644
--- a/m4/ltversion.m4
+++ b/m4/ltversion.m4
@@ -7,17 +7,17 @@
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# Generated from ltversion.in.
+# @configure_input@
 
-# serial 3017 ltversion.m4
+# serial 3337 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.2.6b])
-m4_define([LT_PACKAGE_REVISION], [1.3017])
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.6b'
-macro_revision='1.3017'
+[macro_version='2.4.2'
+macro_revision='1.3337'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
index 637bb20..c573da9 100644
--- a/m4/lt~obsolete.m4
+++ b/m4/lt~obsolete.m4
@@ -1,13 +1,13 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 4 lt~obsolete.m4
+# serial 5 lt~obsolete.m4
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
@@ -77,7 +77,6 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
 m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
 m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
 m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
 m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
@@ -90,3 +89,10 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
 m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
 m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
 m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
diff --git a/test/Makefile.am b/test/Makefile.am
deleted file mode 100644
index fae3ca6..0000000
--- a/test/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-
-TESTS = $(check_PROGRAMS)
-
-check_PROGRAMS = test bench
-
-AM_CPPFLAGS = -std=c89 -ansi -pedantic -D_BSD_SOURCE \
-	-I$(top_srcdir) \
-	-I$(top_srcdir)/hkl
-
-AM_LDFLAGS = $(top_builddir)/hkl/libhkl.la $(GSL_LIBS)
-
-test_SOURCES = \
-hkl-test.h \
-hkl-test-error.c \
-hkl-test-pseudoaxis.c \
-hkl-test-quaternion.c \
-hkl-test-axis.c \
-hkl-test-interval.c \
-hkl-test-pseudoaxis-e4cv.c \
-hkl-test-sample.c \
-hkl-test.c \
-hkl-test-lattice.c \
-hkl-test-pseudoaxis-e6c.c \
-hkl-test-source.c \
-hkl-test-detector.c \
-hkl-test-matrix.c \
-hkl-test-pseudoaxis-k4cv.c \
-hkl-test-vector.c \
-hkl-test-geometry.c \
-hkl-test-parameter.c \
-hkl-test-pseudoaxis-k6c.c \
-main.c
-
-bench_SOURCES = \
-	bench.c
-
-# Support for GNU Flymake, in Emacs.
-check-syntax: AM_CFLAGS += -fsyntax-only -pipe
-check-syntax:
-	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
-
-.PHONY: check-syntax
\ No newline at end of file
diff --git a/test/bench.c b/test/bench.c
deleted file mode 100644
index f905612..0000000
--- a/test/bench.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <stdio.h>
-#include <sys/time.h>
-#include <hkl.h>
-
-#define SET_AXES(geometry, mu, komega, kappa, kphi, gamma, delta) do{\
-	hkl_geometry_set_values_v(geometry, 6,\
-				  mu * HKL_DEGTORAD,\
-				  komega * HKL_DEGTORAD,\
-				  kappa * HKL_DEGTORAD,\
-				  kphi * HKL_DEGTORAD,\
-				  gamma * HKL_DEGTORAD,\
-				  delta * HKL_DEGTORAD);\
-} while(0)
-
-static void hkl_test_bench_run(HklPseudoAxisEngine *engine, HklGeometry *geometry, size_t n)
-{
-	size_t i, j;
-	struct timeval debut, fin, dt;
-
-	/* pseudo -> geometry */
-	for(j=0; j<HKL_LIST_LEN(engine->modes); ++j){
-		hkl_pseudo_axis_engine_select_mode(engine, j);
-		if (HKL_LIST_LEN(engine->mode->parameters))
-			engine->mode->parameters[0].value = 1.;
-
-		gettimeofday(&debut, NULL);
-		for(i=0; i<n; ++i){
-			SET_AXES(geometry, 0, 0, 0, 0, 10, 10);
-			hkl_pseudo_axis_engine_set(engine, NULL);
-		}
-		gettimeofday(&fin, NULL);
-		timersub(&fin, &debut, &dt);
-		fprintf(stdout, "%d %s (%d/%d) iterations %f ms each\n",
-			j, engine->mode->name, n, i, (dt.tv_sec*1000.+dt.tv_usec/1000.)/n);
-	}
-
-}
-
-static void hkl_test_bench_hkl_real(HklPseudoAxisEngineList *engines, HklGeometry *geometry,
-				    char const *name, int n,
-				    double h, double k, double l)
-{
-	HklPseudoAxisEngine *engine;
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, name);
-
-	((HklParameter *)engine->pseudoAxes[0])->value = h;
-	((HklParameter *)engine->pseudoAxes[1])->value = k;
-	((HklParameter *)engine->pseudoAxes[2])->value = l;
-
-	hkl_test_bench_run(engine, geometry, n);
-}
-
-static void hkl_test_bench_eulerians_real(HklPseudoAxisEngineList *engines, HklGeometry *geometry,
-					  char const *name, int n,
-					  double omega, double chi, double phi)
-{
-	HklPseudoAxisEngine *engine;
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, name);
-
-	((HklParameter *)engine->pseudoAxes[0])->value = omega;
-	((HklParameter *)engine->pseudoAxes[1])->value = chi;
-	((HklParameter *)engine->pseudoAxes[2])->value = phi;
-
-	hkl_test_bench_run(engine, geometry, n);
-}
-
-static void hkl_test_bench_psi_real(HklPseudoAxisEngineList *engines, HklGeometry *geometry,
-				    char const *name, int n,
-				    double psi)
-{
-	HklPseudoAxisEngine *engine;
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, name);
-
-	((HklParameter *)engine->pseudoAxes[0])->value = psi;
-
-	hkl_test_bench_run(engine, geometry, n);
-}
-
-static void hkl_test_bench_q2_real(HklPseudoAxisEngineList *engines, HklGeometry *geometry,
-				   char const *name, int n,
-				   double q, double alpha)
-{
-	HklPseudoAxisEngine *engine;
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, name);
-
-	((HklParameter *)engine->pseudoAxes[0])->value = q;
-	((HklParameter *)engine->pseudoAxes[1])->value = alpha;
-
-	hkl_test_bench_run(engine, geometry, n);
-}
-
-static void hkl_test_bench_k6c(void)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, j;
-	int res, n;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA6C);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	hkl_test_bench_hkl_real(engines, geom, "hkl", 1000, 1, 0, 0 );
-	hkl_test_bench_eulerians_real(engines, geom, "eulerians", 1000, 0, 90*HKL_DEGTORAD, 0 );
-	hkl_test_bench_psi_real(engines, geom, "psi", 1000, 10*HKL_DEGTORAD);
-	hkl_test_bench_q2_real(engines, geom, "q2", 1000, 1, 10*HKL_DEGTORAD);
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-}
-
-static void hkl_test_bench_eulerians(void)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *Omega, *Chi, *Phi;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA6C);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "eulerians");
-
-	Omega = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	Chi   = &(((HklParameter *)engine->pseudoAxes[1])->value);
-	Phi   = &(((HklParameter *)engine->pseudoAxes[2])->value);
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx) {
-		double omega, chi, phi;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		if (f_idx>0)
-			engine->mode->parameters[0].value = 1.;
-
-		/* studdy this degenerated case */
-		*Omega = omega = 0;
-		*Chi = chi = 90 * HKL_DEGTORAD;
-		*Phi = phi = 0;
-
-		/* pseudo -> geometry */
-		res = hkl_pseudo_axis_engine_set(engine, NULL);
-		/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-
-		/* geometry -> pseudo */
-		if (res == HKL_SUCCESS) {
-			for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i) {
-				*Omega = *Chi = *Phi = 0;
-
-				hkl_geometry_init_geometry(engine->geometry,
-							   engines->geometries->items[i]->geometry);
-				hkl_pseudo_axis_engine_get(engine, NULL);
-				/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-}
-
-int main(int argc, char **argv)
-{
-	size_t i;
-	int res = 0;
-
-	hkl_test_bench_k6c();
-
-	return res;
-}
diff --git a/test/hkl-test-axis.c b/test/hkl-test-axis.c
deleted file mode 100644
index 5b29c8e..0000000
--- a/test/hkl-test-axis.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME axis
-
-HKL_TEST_SUITE_FUNC( new )
-{
-	HklAxis *axis;
-	HklVector v = {{1, 0, 0}};
-
-	axis = hkl_axis_new("omega", &v);
-
-	HKL_ASSERT_STRING_EQUAL("omega", ((HklParameter *)axis)->name);
-	HKL_ASSERT_DOUBLES_EQUAL(-M_PI, ((HklParameter *)axis)->range.min, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(M_PI, ((HklParameter *)axis)->range.max, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., ((HklParameter *)axis)->value, HKL_EPSILON);
-	HKL_ASSERT_EQUAL(HKL_TRUE, ((HklParameter *)axis)->fit);
-	HKL_ASSERT_EQUAL(HKL_TRUE, ((HklParameter *)axis)->changed);
-
-	hkl_axis_free(axis);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( get_quaternions )
-{
-	HklAxis *axis;
-	HklVector v = {{1, 0, 0}};
-	HklQuaternion q;
-
-	axis = hkl_axis_new("omega", &v);
-
-	hkl_axis_get_quaternion(axis, &q);
-	HKL_ASSERT_DOUBLES_EQUAL(1., q.data[0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., q.data[1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., q.data[2], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., q.data[3], HKL_EPSILON);
-
-	((HklParameter *)axis)->value = -M_PI_2;
-	hkl_axis_get_quaternion(axis, &q);
-	HKL_ASSERT_DOUBLES_EQUAL(1./sqrt(2.), q.data[0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(-1./sqrt(2.), q.data[1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., q.data[2], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., q.data[3], HKL_EPSILON);
-
-	hkl_axis_free(axis);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( is_value_compatible_with_range )
-{
-	HklAxis *axis1;
-	HklVector v = {{1, 0, 0}};
-
-	axis1 = hkl_axis_new("omega", &v);
-
-	hkl_axis_set_value_unit(axis1, 45);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_axis_is_value_compatible_with_range(axis1));
-
-	/* change the range of axis1 */
-	hkl_axis_set_range_unit(axis1, -270, 0);
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_axis_is_value_compatible_with_range(axis1));
-
-	hkl_axis_set_value_unit(axis1, -45);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_axis_is_value_compatible_with_range(axis1));
-
-	hkl_axis_set_range_unit(axis1, 350, 450);
-	hkl_axis_set_value_unit(axis1, 45);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_axis_is_value_compatible_with_range(axis1));
-	hkl_axis_set_value_unit(axis1, -45);
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_axis_is_value_compatible_with_range(axis1));
-
-	hkl_axis_set_range_unit(axis1, -10, 90);
-	hkl_axis_set_value_unit(axis1, 405);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_axis_is_value_compatible_with_range(axis1));
-	hkl_axis_set_value_unit(axis1, -405);
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_axis_is_value_compatible_with_range(axis1));
-
-	hkl_axis_free(axis1);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( set_value_smallest_in_range )
-{
-	HklAxis *axis;
-	HklVector v = {{1, 0, 0}};
-
-	axis = hkl_axis_new("omega", &v);
-
-	hkl_axis_set_range_unit(axis, -190, 190);
-
-	hkl_axis_set_value_unit(axis, 185);
-	hkl_axis_set_value_smallest_in_range(axis);
-	HKL_ASSERT_DOUBLES_EQUAL(-175, hkl_axis_get_value_unit(axis), HKL_EPSILON);
-
-	hkl_axis_set_value_unit(axis, 545);
-	hkl_axis_set_value_smallest_in_range(axis);
-	HKL_ASSERT_DOUBLES_EQUAL(-175, hkl_axis_get_value_unit(axis), HKL_EPSILON);
-
-	hkl_axis_set_value_unit(axis, -185);
-	hkl_axis_set_value_smallest_in_range(axis);
-	HKL_ASSERT_DOUBLES_EQUAL(-185, hkl_axis_get_value_unit(axis), HKL_EPSILON);
-
-	hkl_axis_set_value_unit(axis, 175);
-	hkl_axis_set_value_smallest_in_range(axis);
-	HKL_ASSERT_DOUBLES_EQUAL(-185, hkl_axis_get_value_unit(axis), HKL_EPSILON);
-
-	hkl_axis_set_value_unit(axis, 190);
-	hkl_axis_set_value_smallest_in_range(axis);
-	HKL_ASSERT_DOUBLES_EQUAL(-170, hkl_axis_get_value_unit(axis), HKL_EPSILON);
-
-	hkl_axis_set_value_unit(axis, -190);
-	hkl_axis_set_value_smallest_in_range(axis);
-	HKL_ASSERT_DOUBLES_EQUAL(-190, hkl_axis_get_value_unit(axis), HKL_EPSILON);
-
-	hkl_axis_free(axis);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( get_value_closest )
-{
-	HklAxis *axis1, *axis2;
-	HklVector v = {{1, 0, 0}};
-
-	axis1 = hkl_axis_new("omega", &v);
-	axis2 = hkl_axis_new("omega", &v);
-
-	hkl_axis_set_value_unit(axis1, 0);
-	hkl_axis_set_value_unit(axis2, 0);
-	HKL_ASSERT_DOUBLES_EQUAL(0., hkl_axis_get_value_closest(axis1, axis2), HKL_EPSILON);
-
-	/* change the range of axis1 */
-	hkl_axis_set_range_unit(axis1, -270, 180);
-	hkl_axis_set_value_unit(axis1, 100);
-
-	hkl_axis_set_value_unit(axis2, -75);
-	HKL_ASSERT_DOUBLES_EQUAL(100*HKL_DEGTORAD, hkl_axis_get_value_closest(axis1, axis2), HKL_EPSILON);
-
-	hkl_axis_set_value_unit(axis2, -85);
-	HKL_ASSERT_DOUBLES_EQUAL(-260*HKL_DEGTORAD, hkl_axis_get_value_closest(axis1, axis2), HKL_EPSILON);
-
-	hkl_axis_free(axis1);
-	hkl_axis_free(axis2);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( new );
-HKL_TEST( get_quaternions );
-HKL_TEST( is_value_compatible_with_range );
-HKL_TEST( set_value_smallest_in_range );
-HKL_TEST( get_value_closest );
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-lattice.c b/test/hkl-test-lattice.c
deleted file mode 100644
index 3def7c9..0000000
--- a/test/hkl-test-lattice.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME lattice
-
-HKL_TEST_SUITE_FUNC(new)
-{
-	HklLattice *lattice;
-
-	/* can not set this lattice */
-	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-			90*HKL_DEGTORAD, 10*HKL_DEGTORAD, 120*HKL_DEGTORAD);
-	HKL_ASSERT_POINTER_EQUAL(NULL, lattice);
-
-	/* but can create this one */
-	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-			90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
-	HKL_ASSERT_EQUAL(0, !lattice);
-
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, lattice->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, lattice->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, lattice->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90*HKL_DEGTORAD, lattice->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90*HKL_DEGTORAD, lattice->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90*HKL_DEGTORAD, lattice->gamma->value, HKL_EPSILON);
-	hkl_lattice_free(lattice);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( new_copy )
-{
-	HklLattice *lattice;
-	HklLattice *copy;
-
-	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-			90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
-
-	/* copy constructor */
-	copy = hkl_lattice_new_copy(lattice);
-
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, copy->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, copy->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, copy->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, copy->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, copy->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, copy->gamma->value, HKL_EPSILON);
-
-	hkl_lattice_free(lattice);
-	hkl_lattice_free(copy);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(set)
-{
-	HklLattice *lattice;
-
-	/* can not set this lattice */
-	lattice = hkl_lattice_new_default();
-
-	/* but can create this one */
-	hkl_lattice_set(lattice, 1.54, 1.54, 1.54,
-			90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 92*HKL_DEGTORAD);
-
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, lattice->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, lattice->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, lattice->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90*HKL_DEGTORAD, lattice->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(91*HKL_DEGTORAD, lattice->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(92*HKL_DEGTORAD, lattice->gamma->value, HKL_EPSILON);
-	hkl_lattice_free(lattice);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( reciprocal )
-{
-	HklLattice *lattice;
-	HklLattice *reciprocal;
-
-	lattice = hkl_lattice_new_default();
-	reciprocal = hkl_lattice_new_default();
-
-	/* cubic */
-	hkl_lattice_set(lattice, 1.54, 1.54, 1.54,
-			90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
-
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, hkl_lattice_reciprocal(lattice, reciprocal));
-
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU / 1.54, reciprocal->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU / 1.54, reciprocal->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU / 1.54, reciprocal->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->gamma->value, HKL_EPSILON);
-
-	/* orthorombic */
-	hkl_lattice_set(lattice, 1., 3., 4., 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, hkl_lattice_reciprocal(lattice, reciprocal));
-
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU / 1., reciprocal->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU / 3., reciprocal->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU / 4., reciprocal->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->gamma->value, HKL_EPSILON);
-
-	/* hexagonal1 */
-	hkl_lattice_set(lattice, 1., 2., 1., 90 * HKL_DEGTORAD, 120 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, hkl_lattice_reciprocal(lattice, reciprocal));
-
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 2. / sqrt(3.), reciprocal->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU / 2., reciprocal->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 2. / sqrt(3.), reciprocal->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(60. * HKL_DEGTORAD, reciprocal->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->gamma->value, HKL_EPSILON);
-
-	/* hexagonal2 */
-	hkl_lattice_set(lattice, 2., 1., 1., 120 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, hkl_lattice_reciprocal(lattice, reciprocal));
-
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU / 2., reciprocal->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 2. / sqrt(3.), reciprocal->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 2. / sqrt(3.), reciprocal->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(60. * HKL_DEGTORAD, reciprocal->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, reciprocal->gamma->value, HKL_EPSILON);
-
-	/* triclinic1 */
-	hkl_lattice_set(lattice, 9.32, 8.24, 13.78, 91.23 * HKL_DEGTORAD, 93.64 * HKL_DEGTORAD, 122.21 * HKL_DEGTORAD);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, hkl_lattice_reciprocal(lattice, reciprocal));
-
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 0.1273130168, reciprocal->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 0.1437422974, reciprocal->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 0.0728721120, reciprocal->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.5052513337, reciprocal->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.482101482, reciprocal->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.0055896011, reciprocal->gamma->value, HKL_EPSILON);
-
-	/* triclinic2 */
-	hkl_lattice_set(lattice, 18.423, 18.417, 18.457, 89.99 * HKL_DEGTORAD, 89.963 * HKL_DEGTORAD, 119.99 * HKL_DEGTORAD);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, hkl_lattice_reciprocal(lattice, reciprocal));
-
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 0.0626708259, reciprocal->a->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 0.0626912310, reciprocal->b->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(HKL_TAU * 0.0541800061, reciprocal->c->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.5713705262, reciprocal->alpha->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.5716426508, reciprocal->beta->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.0473718249, reciprocal->gamma->value, HKL_EPSILON);
-
-	hkl_lattice_free(lattice);
-	hkl_lattice_free(reciprocal);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( get_B )
-{
-	static HklMatrix B_ref = {{{HKL_TAU / 1.54,              0,              0},
-				   {             0, HKL_TAU / 1.54,              0},
-				   {             0,              0, HKL_TAU / 1.54}}};
-	HklLattice *lattice;
-	HklMatrix B;
-
-	/* cubic */
-	lattice = hkl_lattice_new(1.54, 1.54, 1.54, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
-
-	hkl_lattice_get_B(lattice, &B);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&B_ref, &B));
-
-	hkl_lattice_free(lattice);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( get_1_B )
-{
-	static HklMatrix I_ref = {{{1, 0, 0},
-				   {0, 1, 0},
-				   {0, 0, 1}}};
-	HklLattice *lattice;
-	HklMatrix I;
-	HklMatrix B_1;
-
-	/* cubic */
-	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
-				  90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
-
-	hkl_lattice_get_B(lattice, &I);
-	hkl_lattice_get_1_B(lattice, &B_1);
-
-	/* B times B^-1 = Identity */
-	hkl_matrix_times_matrix(&I, &B_1);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&I_ref, &I));
-
-	hkl_lattice_free(lattice);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( new );
-HKL_TEST( new_copy );
-HKL_TEST( set );
-HKL_TEST( reciprocal );
-HKL_TEST( get_B );
-HKL_TEST( get_1_B );
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-matrix.c b/test/hkl-test-matrix.c
deleted file mode 100644
index 6dbe772..0000000
--- a/test/hkl-test-matrix.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME smatrix
-
-HKL_TEST_SUITE_FUNC(init)
-{
-	HklMatrix m;
-
-	hkl_matrix_init(&m, 1, 1, 0, 0, 1, 0, 0, 0, 1);
-	HKL_ASSERT_DOUBLES_EQUAL(1., m.data[0][0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1., m.data[0][1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., m.data[0][2], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., m.data[1][0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1., m.data[1][1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., m.data[1][2], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., m.data[2][0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., m.data[2][1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1., m.data[2][2], HKL_EPSILON);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(cmp)
-{
-	HklMatrix m1 = {{{0.0, 1.0, 2.0},
-		{3.0, 4.0, 5.0},
-		{6.0, 7.0, 8.0}}};
-
-	HklMatrix m2 = {{{1.0, 1.0, 2.0},
-		{3.0, 4.0, 5.0},
-		{6.0, 7.0, 8.0}}};
-
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m1, &m1));
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_matrix_cmp(&m1, &m2));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(assignement)
-{
-	HklMatrix m1 = {{{0.0, 1.0, 2.0},
-		{3.0, 4.0, 5.0},
-		{6.0, 7.0, 8.0}}};
-	HklMatrix m;
-
-	m = m1;
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m1, &m));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(init_from_euler)
-{
-	HklMatrix m_ref = {{{             1./2.,             -1./2., sqrt(2)/2.},
-		{ sqrt(2.)/4.+1./2., -sqrt(2.)/4.+1./2.,     -1./2.},
-		{-sqrt(2.)/4.+1./2.,  sqrt(2.)/4.+1./2.,      1./2.}}};
-	HklMatrix m;
-
-	hkl_matrix_init_from_euler(&m, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_ref, &m));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(init_from_two_vector)
-{
-	HklVector v1 = {{0.0, 1.0, 2.0}};
-	HklVector v2 = {{1.0, 2.0, 3.0}};
-	HklMatrix m_ref = {{{0.0,             5.0 / sqrt(30.0), -1.0 / sqrt(6.0)},
-		{1.0 / sqrt(5.0), 2.0 / sqrt(30.0),  2.0 / sqrt(6.0)},
-		{2.0 / sqrt(5.0),-1.0 / sqrt(30.0), -1.0 / sqrt(6.0)}}
-	};
-	HklMatrix m;
-
-	hkl_matrix_init_from_two_vector(&m, &v1, &v2);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_ref, &m));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(times_vector)
-{
-	HklMatrix m = {{{ 1.0, 3.0,-2.0},
-		{10.0, 5.0, 5.0},
-		{-3.0, 2.0, 0.0}}
-	};
-	HklVector v = {{1, 2, 3}};
-	HklVector v_ref = {{1, 35, 1}};
-
-	hkl_matrix_times_vector(&m, &v);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&v_ref, &v));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(times_matrix)
-{
-	HklMatrix m_ref = {{{37., 14., 13.},
-		{45., 65.,  5.},
-		{17.,  1., 16.}}
-	};
-
-	HklMatrix m = {{{ 1., 3.,-2.},
-		{10., 5., 5.},
-		{-3., 2., 0.}}
-	};
-
-	hkl_matrix_times_matrix(&m, &m);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_ref, &m));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(transpose)
-{
-	HklMatrix m_ref = {{{37., 14., 13.},
-		{45., 65.,  5.},
-		{17.,  1., 16.}}
-	};
-
-	HklMatrix m = {{{37., 45., 17.},
-		{14., 65.,  1.},
-		{13.,  5., 16.}}
-	};
-
-	hkl_matrix_transpose(&m);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_ref, &m));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-	HKL_TEST(init);
-	HKL_TEST(cmp);
-	HKL_TEST(assignement);
-	HKL_TEST(init_from_euler);
-	HKL_TEST(init_from_two_vector);
-	HKL_TEST(times_vector);
-	HKL_TEST(times_matrix);
-	HKL_TEST(transpose);
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-parameter.c b/test/hkl-test-parameter.c
deleted file mode 100644
index 8031616..0000000
--- a/test/hkl-test-parameter.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME parameter
-
-HKL_TEST_SUITE_FUNC(new)
-{
-	HklParameter *p;
-
-	HKL_ASSERT_POINTER_EQUAL(NULL, hkl_parameter_new("", 2, 1, 3,
-							 HKL_FALSE, HKL_TRUE,
-							 &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-	HKL_ASSERT_POINTER_EQUAL(NULL, hkl_parameter_new("", 2, 1, 3,
-							 HKL_FALSE, HKL_TRUE,
-							 &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-	HKL_ASSERT_POINTER_EQUAL(NULL, hkl_parameter_new("", 2, 1, 3,
-							 HKL_FALSE, HKL_TRUE,
-							 &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-	HKL_ASSERT_POINTER_EQUAL(NULL, hkl_parameter_new("toto", 2, 1, 3,
-							 HKL_FALSE, HKL_TRUE,
-							 &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-
-	HKL_ASSERT_POINTER_EQUAL(NULL, hkl_parameter_new("toto", 1, 2, 3,
-							 HKL_FALSE, HKL_TRUE,
-							 &hkl_unit_angle_rad, &hkl_unit_length_nm));
-
-	p = hkl_parameter_new("toto", 1, 2, 3,
-			      HKL_FALSE, HKL_TRUE,
-			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-	HKL_ASSERT_EQUAL(0, !p);
-	HKL_ASSERT_DOUBLES_EQUAL(1., p->range.min, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(2., p->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(3., p->range.max, HKL_EPSILON);
-	HKL_ASSERT_EQUAL(HKL_FALSE, p->fit);
-	HKL_ASSERT_EQUAL(HKL_TRUE, p->changed);
-	HKL_ASSERT_POINTER_EQUAL(&hkl_unit_angle_rad, p->unit);
-	HKL_ASSERT_POINTER_EQUAL(&hkl_unit_angle_deg, p->punit);
-
-	hkl_parameter_free(p);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(new_copy)
-{
-	HklParameter *copy, p;
-
-	hkl_parameter_init(&p, "toto", 1, 2, 3,
-			   HKL_FALSE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-
-	copy = hkl_parameter_new_copy(&p);
-
-	HKL_ASSERT_POINTER_EQUAL(copy->name, p.name);
-	HKL_ASSERT_DOUBLES_EQUAL(copy->range.min, p.range.min, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(copy->value, p.value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(copy->range.max, p.range.max, HKL_EPSILON);
-	HKL_ASSERT_EQUAL(copy->fit, p.fit);
-	HKL_ASSERT_EQUAL(copy->changed, p.changed);
-	HKL_ASSERT_POINTER_EQUAL(&hkl_unit_angle_rad, copy->unit);
-	HKL_ASSERT_POINTER_EQUAL(&hkl_unit_angle_deg, copy->punit);
-
-	hkl_parameter_free(copy);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(init)
-{
-	HklParameter p;
-
-	HKL_ASSERT_EQUAL(HKL_FAIL, hkl_parameter_init(&p, "", 2, 1, 3,
-						      HKL_FALSE, HKL_TRUE,
-						      &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-	HKL_ASSERT_EQUAL(HKL_FAIL, hkl_parameter_init(&p, "", 2, 1, 3,
-						      HKL_FALSE, HKL_TRUE,
-						      &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-	HKL_ASSERT_EQUAL(HKL_FAIL, hkl_parameter_init(&p, "", 2, 1, 3,
-						      HKL_FALSE, HKL_TRUE,
-						      &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-	HKL_ASSERT_EQUAL(HKL_FAIL, hkl_parameter_init(&p, "toto", 2, 1, 3,
-						      HKL_FALSE, HKL_TRUE,
-						      &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-	HKL_ASSERT_EQUAL(HKL_FAIL, hkl_parameter_init(&p, "toto", 1, 2, 3,
-						      HKL_FALSE, HKL_TRUE,
-						      &hkl_unit_angle_rad, &hkl_unit_length_nm));
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, hkl_parameter_init(&p, "toto", 1, 2, 3,
-							 HKL_FALSE, HKL_TRUE,
-							 &hkl_unit_angle_rad, &hkl_unit_angle_deg));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(is_valid)
-{
-	HklParameter p;
-
-	hkl_parameter_init(&p, "toto", 1, 2, 3,
-			   HKL_FALSE, HKL_TRUE,
-			   &hkl_unit_angle_rad, &hkl_unit_angle_deg);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_parameter_is_valid(&p));
-
-	hkl_parameter_set_value(&p, 10);
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_parameter_is_valid(&p));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( new );
-HKL_TEST( new_copy );
-HKL_TEST( init );
-HKL_TEST( is_valid );
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-pseudoaxis-e4cv.c b/test/hkl-test-pseudoaxis-e4cv.c
deleted file mode 100644
index 888c668..0000000
--- a/test/hkl-test-pseudoaxis-e4cv.c
+++ /dev/null
@@ -1,479 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME pseudoaxis_E4CV
-
-#define SET_AXES(geom, omega, chi, phi, tth) do{		\
-		hkl_geometry_set_values_v(geom, 4,		\
-					  omega * HKL_DEGTORAD,	\
-					  chi * HKL_DEGTORAD,	\
-					  phi * HKL_DEGTORAD,	\
-					  tth * HKL_DEGTORAD);	\
-	} while(0)
-
-#define CHECK_PSEUDOAXES(engine, a, b, c) do{				\
-		HklParameter *H = (HklParameter *)(engine->pseudoAxes[0]); \
-		HklParameter *K = (HklParameter *)(engine->pseudoAxes[1]); \
-		HklParameter *L = (HklParameter *)(engine->pseudoAxes[2]); \
-									\
-		HKL_ASSERT_DOUBLES_EQUAL(a, H->value, HKL_EPSILON);	\
-		HKL_ASSERT_DOUBLES_EQUAL(b, K->value, HKL_EPSILON);	\
-		HKL_ASSERT_DOUBLES_EQUAL(c, L->value, HKL_EPSILON);	\
-	} while(0)
-
-HKL_TEST_SUITE_FUNC(new)
-{
-	HklPseudoAxisEngine *engine = hkl_pseudo_axis_engine_e4cv_hkl_new();
-	hkl_pseudo_axis_engine_free(engine);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(getter)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "hkl");
-
-	/* geometry -> pseudo */
-	SET_AXES(geom, 30., 0., 0., 60.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, 0., 0., 1.);
-
-	SET_AXES(geom, 30., 0., 90., 60.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, 1., 0., 0.);
-
-	SET_AXES(geom, 30, 0., -90., 60.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, -1., 0., 0.);
-
-	SET_AXES(geom, 30., 0., 180., 60.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, 0., 0., -1.);
-
-	SET_AXES(geom, 45., 0., 135., 90.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, 1., 0., -1.);
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(degenerated)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *H, *K, *L;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "hkl");
-
-	H = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	K = &(((HklParameter *)engine->pseudoAxes[1])->value);
-	L = &(((HklParameter *)engine->pseudoAxes[2])->value);
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx){
-		double h, k, l;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		if (HKL_LIST_LEN(engine->mode->parameters))
-			engine->mode->parameters[0].value = 0.;
-
-		/* studdy this degenerated case */
-		*H = h = 0;
-		*K = k = 0;
-		*L = l = 1;
-
-		/* pseudo -> geometry */
-		res = hkl_pseudo_axis_engine_set(engine, NULL);
-		/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-
-		/* geometry -> pseudo */
-		if(res == HKL_SUCCESS){
-			/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-			for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i){
-				*H = *K = *L = 0;
-
-				hkl_geometry_init_geometry(engines->geometry,
-							   engines->geometries->items[i]->geometry);
-				hkl_pseudo_axis_engine_get(engine, NULL);
-
-				HKL_ASSERT_DOUBLES_EQUAL(h, *H, HKL_EPSILON);
-				HKL_ASSERT_DOUBLES_EQUAL(k, *K, HKL_EPSILON);
-				HKL_ASSERT_DOUBLES_EQUAL(l, *L, HKL_EPSILON);
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(psi_getter)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *psi;
-	double *h_ref;
-	double *k_ref;
-	double *l_ref;
-	int status;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "psi");
-
-	psi = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	h_ref = &engine->mode->parameters[0].value;
-	k_ref = &engine->mode->parameters[1].value;
-	l_ref = &engine->mode->parameters[2].value;
-
-	/* the getter part */
-	SET_AXES(geom, 30., 0., 0., 60.);
-	hkl_pseudo_axis_engine_initialize(engine, NULL);
-
-	*h_ref = 1;
-	*k_ref = 0;
-	*l_ref = 0;
-	status = hkl_pseudo_axis_engine_get(engine, NULL);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, status);
-	HKL_ASSERT_DOUBLES_EQUAL(0 * HKL_DEGTORAD, *psi, HKL_EPSILON);
-
-	*h_ref = 0;
-	*k_ref = 1;
-	*l_ref = 0;
-	status = hkl_pseudo_axis_engine_get(engine, NULL);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, status);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, *psi, HKL_EPSILON);
-
-	/* here Q and <h, k, l>_ref are colinear */
-	*h_ref = 0;
-	*k_ref = 0;
-	*l_ref = 1;
-	status = hkl_pseudo_axis_engine_get(engine, NULL);
-	HKL_ASSERT_EQUAL(HKL_FAIL, status);
-
-	*h_ref = -1;
-	*k_ref = 0;
-	*l_ref = 0;
-	status = hkl_pseudo_axis_engine_get(engine, NULL);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, status);
-	HKL_ASSERT_DOUBLES_EQUAL(180 * HKL_DEGTORAD, *psi, HKL_EPSILON);
-
-	*h_ref = 0;
-	*k_ref = -1;
-	*l_ref = 0;
-	status = hkl_pseudo_axis_engine_get(engine, NULL);
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, status);
-	HKL_ASSERT_DOUBLES_EQUAL(-90 * HKL_DEGTORAD, *psi, HKL_EPSILON);
-	
-	*h_ref = 0;
-	*k_ref = 0;
-	*l_ref = -1;
-	status = hkl_pseudo_axis_engine_get(engine, NULL);
-	HKL_ASSERT_EQUAL(HKL_FAIL, status);
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(psi_setter)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *Psi;
-	double *h_ref, *k_ref, *l_ref;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "psi");
-
-	Psi = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	h_ref = &engine->mode->parameters[0].value;
-	k_ref = &engine->mode->parameters[1].value;
-	l_ref = &engine->mode->parameters[2].value;
-
-	/* the init part */
-	SET_AXES(geom, 30., 0., 0., 60.);
-	*h_ref = 1;
-	*k_ref = 0;
-	*l_ref = 0;
-	hkl_pseudo_axis_engine_initialize(engine, NULL);
-
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx){
-		double psi;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		for(psi=-180;psi<180;psi++){
-			*Psi = psi * HKL_DEGTORAD;
-			
-			/* pseudo -> geometry */
-			res = hkl_pseudo_axis_engine_set(engine, NULL);
-			/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-			
-			/* geometry -> pseudo */
-			if(res == HKL_SUCCESS){
-				/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-				for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i){
-					*Psi = 0;
-					
-					hkl_geometry_init_geometry(geom,
-								   engines->geometries->items[i]->geometry);
-					hkl_pseudo_axis_engine_get(engine, NULL);
-					HKL_ASSERT_DOUBLES_EQUAL(psi * HKL_DEGTORAD, *Psi, HKL_EPSILON);
-				}
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(q)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *Q;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "q");
-
-	Q = &(((HklParameter *)engine->pseudoAxes[0])->value);
-
-	/* the init part */
-	SET_AXES(geom, 30., 0., 0., 60.);
-	hkl_pseudo_axis_engine_initialize(engine, NULL);
-
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx){
-		double q;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		for(q=-1.; q<1.; q += 0.1){
-			*Q = q;
-			
-			/* pseudo -> geometry */
-			res = hkl_pseudo_axis_engine_set(engine, NULL);
-			
-			/* geometry -> pseudo */
-			if(res == HKL_SUCCESS){
-				for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i){
-					*Q = 0;
-					
-					hkl_geometry_init_geometry(geom,
-								   engines->geometries->items[i]->geometry);
-					hkl_pseudo_axis_engine_get(engine, NULL);
-					
-					HKL_ASSERT_DOUBLES_EQUAL(q, *Q, HKL_EPSILON);
-				}
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(hkl_psi_constant_vertical)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *H, *K, *L;
-	double h, k, l;
-	double *h_ref, *k_ref, *l_ref, *psi_ref;
-	int res;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "hkl");
-
-	H = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	K = &(((HklParameter *)engine->pseudoAxes[1])->value);
-	L = &(((HklParameter *)engine->pseudoAxes[2])->value);
-
-
-	hkl_pseudo_axis_engine_select_mode(engine, 5);
-	h_ref = &engine->mode->parameters[0].value;
-	k_ref = &engine->mode->parameters[1].value;
-	l_ref = &engine->mode->parameters[2].value;
-	psi_ref = &engine->mode->parameters[3].value;
-
-	/* the init part */
-	SET_AXES(geom, 30., 0., 0., 60.);
-	*h_ref = 1;
-	*k_ref = 1;
-	*l_ref = 0;
-	hkl_pseudo_axis_engine_initialize(engine, NULL);
-
-	*H = h = 1;
-	*K = k = 0;
-	*L = l = 1;
-	res = hkl_pseudo_axis_engine_set(engine, NULL);
-			
-	/* geometry -> pseudo */
-	if(res == HKL_SUCCESS){
-		/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-		for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i){
-			*H = *K = *L = 0;
-					
-			hkl_geometry_init_geometry(geom,
-						   engines->geometries->items[i]->geometry);
-			hkl_pseudo_axis_engine_get(engine, NULL);
-			HKL_ASSERT_DOUBLES_EQUAL(h, *H, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(k, *K, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(l, *L, HKL_EPSILON);
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( new );
-HKL_TEST( getter );
-HKL_TEST( degenerated );
-HKL_TEST( psi_getter );
-HKL_TEST( psi_setter );
-HKL_TEST( q );
-HKL_TEST( hkl_psi_constant_vertical );
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-pseudoaxis-e6c.c b/test/hkl-test-pseudoaxis-e6c.c
deleted file mode 100644
index 329b600..0000000
--- a/test/hkl-test-pseudoaxis-e6c.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME pseudoaxis_E6C
-
-#define SET_AXES(geometry, mu, omega, chi, phi, gamma, delta) do{	\
-		hkl_geometry_set_values_v(geometry, 6,			\
-					  mu * HKL_DEGTORAD,		\
-					  omega * HKL_DEGTORAD,		\
-					  chi * HKL_DEGTORAD,		\
-					  phi * HKL_DEGTORAD,		\
-					  gamma * HKL_DEGTORAD,		\
-					  delta * HKL_DEGTORAD);	\
-	} while(0)
-
-#define CHECK_PSEUDOAXES(engine, a, b, c) do{				\
-		HklParameter *H = (HklParameter *)(engine->pseudoAxes[0]); \
-		HklParameter *K = (HklParameter *)(engine->pseudoAxes[1]); \
-		HklParameter *L = (HklParameter *)(engine->pseudoAxes[2]); \
-									\
-		HKL_ASSERT_DOUBLES_EQUAL(a, H->value, HKL_EPSILON);	\
-		HKL_ASSERT_DOUBLES_EQUAL(b, K->value, HKL_EPSILON);	\
-		HKL_ASSERT_DOUBLES_EQUAL(c, L->value, HKL_EPSILON);	\
-	} while(0)
-
-HKL_TEST_SUITE_FUNC(new)
-{
-	HklPseudoAxisEngine *engine = hkl_pseudo_axis_engine_e6c_hkl_new();
-	hkl_pseudo_axis_engine_free(engine);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(getter)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN6C);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "hkl");
-
-	/* geometry -> pseudo */
-	SET_AXES(geom, 0., 30., 0., 0., 0., 60.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, 0., 0., 1.);
-
-	SET_AXES(geom, 0., 30., 0., 90., 0., 60.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, 1., 0., 0.);
-
-	SET_AXES(geom, 0., 30, 0., -90., 0., 60.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, -1., 0., 0.);
-
-	SET_AXES(geom, 0., 30., 0., 180., 0., 60.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, 0., 0., -1.);
-
-	SET_AXES(geom, 0., 45., 0., 135., 0., 90.);
-	hkl_pseudo_axis_engine_get(engine, NULL);
-	CHECK_PSEUDOAXES(engine, 1., 0., -1.);
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(degenerated)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *H, *K, *L;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN6C);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "hkl");
-
-	H = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	K = &(((HklParameter *)engine->pseudoAxes[1])->value);
-	L = &(((HklParameter *)engine->pseudoAxes[2])->value);
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx) {
-		double h, k, l;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		if (HKL_LIST_LEN(engine->mode->parameters))
-			engine->mode->parameters[0].value = 0.;
-
-		/* studdy this degenerated case */
-		*H = h = 0;
-		*K = k = 0;
-		*L = l = 1;
-
-		/* pseudo -> geometry */
-		res = hkl_pseudo_axis_engine_set(engine, NULL);
-		/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-
-		/* geometry -> pseudo */
-		if (res == HKL_SUCCESS) {
-			/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-			for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i) {
-				*H = *K = *L = 0;
-
-				hkl_geometry_init_geometry(geom,
-							   engines->geometries->items[i]->geometry);
-				hkl_pseudo_axis_engine_get(engine, NULL);
-
-				HKL_ASSERT_DOUBLES_EQUAL(h, *H, HKL_EPSILON);
-				HKL_ASSERT_DOUBLES_EQUAL(k, *K, HKL_EPSILON);
-				HKL_ASSERT_DOUBLES_EQUAL(l, *L, HKL_EPSILON);
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(q2)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *Q, *Alpha;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN6C);
-	geom = hkl_geometry_factory_new(config);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "q2");
-
-	Q = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	Alpha = &(((HklParameter *)engine->pseudoAxes[1])->value);
-
-	/* the init part */
-	SET_AXES(geom, 0., 30., 0., 0., 0., 60.);
-	hkl_pseudo_axis_engine_initialize(engine, NULL);
-
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx){
-		double q, alpha;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		for(q=0.1; q<1.; q += 0.1){
-			for(alpha = -M_PI; alpha<M_PI; alpha += M_PI/180.){
-				*Q = q;
-				*Alpha = alpha;
-			
-				/* pseudo -> geometry */
-				res = hkl_pseudo_axis_engine_set(engine, NULL);
-			
-				/* geometry -> pseudo */
-				if(res == HKL_SUCCESS){
-					for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i){
-						*Q = 0.;
-						*Alpha = 0.;
-					
-						hkl_geometry_init_geometry(geom,
-									   engines->geometries->items[i]->geometry);
-						hkl_pseudo_axis_engine_get(engine, NULL);
-
-						HKL_ASSERT_DOUBLES_EQUAL(q, *Q, HKL_EPSILON);
-						HKL_ASSERT_DOUBLES_EQUAL(alpha, *Alpha, HKL_EPSILON);
-					}
-				}
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( new );
-HKL_TEST( getter );
-HKL_TEST( degenerated );
-HKL_TEST( q2 );
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-pseudoaxis-k4cv.c b/test/hkl-test-pseudoaxis-k4cv.c
deleted file mode 100644
index dee7de0..0000000
--- a/test/hkl-test-pseudoaxis-k4cv.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME pseudoaxis_K4CV
-
-#define SET_AXES(geometry, komega, kappa, kphi, tth) do{		\
-		hkl_geometry_set_values_v(geometry, 4,			\
-					  komega * HKL_DEGTORAD,	\
-					  kappa * HKL_DEGTORAD,		\
-					  kphi * HKL_DEGTORAD,		\
-					  tth * HKL_DEGTORAD);		\
-	} while(0)
-
-#define CHECK_PSEUDOAXES(engine, a, b, c) do{				\
-		HklParameter *H = (HklPArameter *)(engine->pseudoAxes[0]); \
-		HklParameter *K = (HklParameter *)(engine->pseudoAxes[1]); \
-		HklParameter *L = (HklParameter *)(engine->pseudoAxes[2]); \
-									\
-		HKL_ASSERT_DOUBLES_EQUAL(a, H->value, HKL_EPSILON);	\
-		HKL_ASSERT_DOUBLES_EQUAL(b, K->value, HKL_EPSILON);	\
-		HKL_ASSERT_DOUBLES_EQUAL(c, L->value, HKL_EPSILON);	\
-	} while(0)
-
-HKL_TEST_SUITE_FUNC(new)
-{
-	HklPseudoAxisEngine *engine = hkl_pseudo_axis_engine_k4cv_hkl_new();
-	hkl_pseudo_axis_engine_free(engine);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(degenerated)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *H, *K, *L;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "hkl");
-
-	H = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	K = &(((HklParameter *)engine->pseudoAxes[1])->value);
-	L = &(((HklParameter *)engine->pseudoAxes[2])->value);
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx) {
-		double h, k, l;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		if (f_idx>0)
-			engine->mode->parameters[0].value = 1.;
-
-		/* studdy this degenerated case */
-		*H = h = 0;
-		*K = k = 1;
-		*L = l = 0;
-
-		/* pseudo -> geometry */
-		res = hkl_pseudo_axis_engine_set(engine, NULL);
-		/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-
-		/* geometry -> pseudo */
-		if (res == HKL_SUCCESS) {
-			for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i) {
-				*H = *K = *L = 0;
-
-				hkl_geometry_init_geometry(geom,
-							   engines->geometries->items[i]->geometry);
-				hkl_pseudo_axis_engine_get(engine, NULL);
-
-				HKL_ASSERT_DOUBLES_EQUAL(h, *H, HKL_EPSILON);
-				HKL_ASSERT_DOUBLES_EQUAL(k, *K, HKL_EPSILON);
-				HKL_ASSERT_DOUBLES_EQUAL(l, *L, HKL_EPSILON);
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(eulerians)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *Omega, *Chi, *Phi;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "eulerians");
-
-	Omega = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	Chi   = &(((HklParameter *)engine->pseudoAxes[1])->value);
-	Phi   = &(((HklParameter *)engine->pseudoAxes[2])->value);
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx) {
-		double omega, chi, phi;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		if (f_idx>0)
-			engine->mode->parameters[0].value = 1.;
-
-		/* studdy this degenerated case */
-		*Omega = omega = 0;
-		*Chi = chi = 90 * HKL_DEGTORAD;
-		*Phi = phi = 0;
-
-		/* pseudo -> geometry */
-		res = hkl_pseudo_axis_engine_set(engine, NULL);
-
-		/* geometry -> pseudo */
-		if (res == HKL_SUCCESS) {
-			
-			HKL_ASSERT_EQUAL(2, hkl_geometry_list_len(engines->geometries));
-
-			/* hkl_geometry_list_fprintf(stdout, engines->geometries); */
-
-			/* first solution = 0, 90, 0 */
-			hkl_geometry_init_geometry(geom,
-						   engines->geometries->items[1]->geometry);
-			hkl_pseudo_axis_engine_get(engine, NULL);
-			HKL_ASSERT_DOUBLES_EQUAL(0., *Omega, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, *Chi, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(0. * HKL_DEGTORAD, *Phi, HKL_EPSILON);
-
-			hkl_geometry_init_geometry(geom,
-						   engines->geometries->items[0]->geometry);
-			hkl_pseudo_axis_engine_get(engine, NULL);
-			HKL_ASSERT_DOUBLES_EQUAL(-180.* HKL_DEGTORAD, *Omega, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(-90. * HKL_DEGTORAD, *Chi, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(180. * HKL_DEGTORAD, *Phi, HKL_EPSILON);
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(q)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *Q;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "q");
-
-	Q = &(((HklParameter *)engine->pseudoAxes[0])->value);
-
-	/* the init part */
-	SET_AXES(geom, 30., 0., 0., 60.);
-	hkl_pseudo_axis_engine_initialize(engine, NULL);
-
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx){
-		double q;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		for(q=-1.; q<1.; q += 0.1){
-			*Q = q;
-			
-			/* pseudo -> geometry */
-			res = hkl_pseudo_axis_engine_set(engine, NULL);
-			
-			/* geometry -> pseudo */
-			if(res == HKL_SUCCESS){
-				for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i){
-					*Q = 0;
-					
-					hkl_geometry_init_geometry(geom,
-								   engines->geometries->items[i]->geometry);
-					hkl_pseudo_axis_engine_get(engine, NULL);
-					
-					HKL_ASSERT_DOUBLES_EQUAL(q, *Q, HKL_EPSILON);
-				}
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( new );
-HKL_TEST( degenerated );
-HKL_TEST( eulerians );
-HKL_TEST( q );
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-pseudoaxis-k6c.c b/test/hkl-test-pseudoaxis-k6c.c
deleted file mode 100644
index d8897bd..0000000
--- a/test/hkl-test-pseudoaxis-k6c.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME pseudoaxis_K6C
-
-#define SET_AXES(geometry, mu, komega, kappa, kphi, gamma, delta) do{	\
-		hkl_geometry_set_values_v(geometry, 6,			\
-					  mu * HKL_DEGTORAD,		\
-					  komega * HKL_DEGTORAD,	\
-					  kappa * HKL_DEGTORAD,		\
-					  kphi * HKL_DEGTORAD,		\
-					  gamma * HKL_DEGTORAD,		\
-					  delta * HKL_DEGTORAD);	\
-	} while(0)
-
-HKL_TEST_SUITE_FUNC(new)
-{
-	HklPseudoAxisEngine *engine = hkl_pseudo_axis_engine_k6c_hkl_new();
-	hkl_pseudo_axis_engine_free(engine);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(degenerated)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *H, *K, *L;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA6C);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "hkl");
-
-	H = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	K = &(((HklParameter *)engine->pseudoAxes[1])->value);
-	L = &(((HklParameter *)engine->pseudoAxes[2])->value);
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx) {
-		double h, k, l;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		if (HKL_LIST_LEN(engine->mode->parameters))
-			engine->mode->parameters[0].value = 1.;
-
-		/* studdy this degenerated case */
-		*H = h = 0;
-		*K = k = 1;
-		*L = l = 0;
-
-		/* pseudo -> geometry */
-		res = hkl_pseudo_axis_engine_set(engine, NULL);
-		/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-
-		/* geometry -> pseudo */
-		if (res == HKL_SUCCESS) {
-			/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-			for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i) {
-				*H = *K = *L = 0;
-
-				hkl_geometry_init_geometry(geom,
-							   engines->geometries->items[i]->geometry);
-				hkl_pseudo_axis_engine_get(engine, NULL);
-
-				HKL_ASSERT_DOUBLES_EQUAL(h, *H, HKL_EPSILON);
-				HKL_ASSERT_DOUBLES_EQUAL(k, *K, HKL_EPSILON);
-				HKL_ASSERT_DOUBLES_EQUAL(l, *L, HKL_EPSILON);
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(eulerians)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *Omega, *Chi, *Phi;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA6C);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "eulerians");
-
-	Omega = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	Chi   = &(((HklParameter *)engine->pseudoAxes[1])->value);
-	Phi   = &(((HklParameter *)engine->pseudoAxes[2])->value);
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx) {
-		double omega, chi, phi;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		if (f_idx>0)
-			engine->mode->parameters[0].value = 1.;
-
-		/* studdy this degenerated case */
-		*Omega = omega = 0;
-		*Chi = chi = 90 * HKL_DEGTORAD;
-		*Phi = phi = 0;
-
-		/* pseudo -> geometry */
-		res = hkl_pseudo_axis_engine_set(engine, NULL);
-		/* hkl_pseudo_axis_engine_fprintf(stdout, engine); */
-
-		/* geometry -> pseudo */
-		if (res == HKL_SUCCESS) {
-			HKL_ASSERT_EQUAL(2, hkl_geometry_list_len(engines->geometries));
-
-			/* first solution = 0, 90, 0 */
-			hkl_geometry_init_geometry(geom,
-						   engines->geometries->items[1]->geometry);
-			hkl_pseudo_axis_engine_get(engine, NULL);
-			HKL_ASSERT_DOUBLES_EQUAL(0., *Omega, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(90. * HKL_DEGTORAD, *Chi, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(0. * HKL_DEGTORAD, *Phi, HKL_EPSILON);
-
-			hkl_geometry_init_geometry(geom,
-						   engines->geometries->items[0]->geometry);
-			hkl_pseudo_axis_engine_get(engine, NULL);
-			HKL_ASSERT_DOUBLES_EQUAL(-180.* HKL_DEGTORAD, *Omega, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(-90. * HKL_DEGTORAD, *Chi, HKL_EPSILON);
-			HKL_ASSERT_DOUBLES_EQUAL(180. * HKL_DEGTORAD, *Phi, HKL_EPSILON);
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(manip)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *hkl;
-	HklPseudoAxisEngine *psi;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *H, *K, *L;
-	double H2, K2, L2;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA6C);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	hkl_source_init(&geom->source, 2.0837, 1., 0., 0.);
-	hkl_source_fprintf(stdout, &geom->source);
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	/* hkl_matrix_init_from_euler(&sample->U, -90 * HKL_DEGTORAD, 0., 0.); */
-	hkl_sample_set_lattice(sample,
-			       2.88, 2.88, 2.88,
-			       90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
-	hkl_matrix_init_from_euler(&sample->U, -90 * HKL_DEGTORAD, 0., 0.);
-	hkl_sample_fprintf(stdout, sample);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	hkl = hkl_pseudo_axis_engine_list_get_by_name(engines, "hkl");
-	psi = hkl_pseudo_axis_engine_list_get_by_name(engines, "psi");
-
-	H = &(((HklParameter *)hkl->pseudoAxes[0])->value);
-	K = &(((HklParameter *)hkl->pseudoAxes[1])->value);
-	L = &(((HklParameter *)hkl->pseudoAxes[2])->value);
-
-	hkl_pseudo_axis_engine_select_mode(hkl, 9);
-
-	*H = 0;
-	*K = 0;
-	*L = 1. - 0.047;
-	H2 = hkl->mode->parameters[0].value = 0;
-	K2 = hkl->mode->parameters[1].value = 1.;
-	L2 = hkl->mode->parameters[2].value = 1. - 2*0.047;
-	if( HKL_SUCCESS == hkl_pseudo_axis_engine_set(hkl, NULL)){
-		for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i) {
-			*H = *K = *L = 0;
-
-			hkl_geometry_init_geometry(geom,
-						   engines->geometries->items[i]->geometry);
-			hkl_pseudo_axis_engine_initialize(psi, NULL);
-			hkl_pseudo_axis_engine_list_get(engines);
-			hkl_pseudo_axis_engine_list_fprintf(stdout, engines);
-		}
-	}
-
-	hkl_geometry_init_geometry(geom,
-				   engines->geometries->items[0]->geometry);
-	hkl_pseudo_axis_engine_select_mode(hkl, 7);
-	*H = H2;
-	*K = K2;
-	*L = L2;
-	fprintf(stdout, "coucou\n");
-	if (HKL_SUCCESS == hkl_pseudo_axis_engine_set(hkl, NULL)){
-		fprintf(stdout, "coucou\n");
-		for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i){
-			*H = *K = *L = 0;
-			hkl_geometry_init_geometry(geom,
-						   engines->geometries->items[i]->geometry);
-			hkl_pseudo_axis_engine_list_get(engines);
-			hkl_pseudo_axis_engine_list_fprintf(stdout, engines);
-		}
-	}
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(q2)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	size_t i, f_idx;
-	double *Q, *Alpha;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA6C);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "q2");
-
-	Q = &(((HklParameter *)engine->pseudoAxes[0])->value);
-	Alpha = &(((HklParameter *)engine->pseudoAxes[1])->value);
-
-	/* the init part */
-	SET_AXES(geom, 0., 30., 0., 0., 0., 60.);
-	hkl_pseudo_axis_engine_initialize(engine, NULL);
-
-
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx){
-		double q, alpha;
-		int res;
-
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		for(q=0.1; q<1.; q += 0.1){
-			for(alpha = -M_PI; alpha<M_PI; alpha += M_PI/180.){
-				*Q = q;
-				*Alpha = alpha;
-			
-				/* pseudo -> geometry */
-				res = hkl_pseudo_axis_engine_set(engine, NULL);
-			
-				/* geometry -> pseudo */
-				if(res == HKL_SUCCESS){
-					for(i=0; i<hkl_geometry_list_len(engines->geometries); ++i){
-						*Q = 0;
-						*Alpha = 0.;
-					
-						hkl_geometry_init_geometry(geom,
-									   engines->geometries->items[i]->geometry);
-						hkl_pseudo_axis_engine_get(engine, NULL);
-
-						/* why this precision problem ?	*/
-						HKL_ASSERT_DOUBLES_EQUAL(q, *Q, HKL_EPSILON * 10);
-						HKL_ASSERT_DOUBLES_EQUAL(alpha, *Alpha, HKL_EPSILON);
-					}
-				}
-			}
-		}
-	}
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-
-HKL_TEST_SUITE_FUNC(m15110)
-{
-	HklPseudoAxisEngineList *engines;
-	HklPseudoAxisEngine *engine;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklDetector *detector;
-	HklSample *sample;
-	int res;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA6C);
-	geom = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geom, detector, sample);
-
-	engine = hkl_pseudo_axis_engine_list_get_by_name(engines, "psi");
-
-	/* the init part must succed */
-	SET_AXES(geom, 0., 62.95, 134.75, 0., 0., 60.);
-	res = hkl_pseudo_axis_engine_initialize(engine, NULL);
-
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, res);
-
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( new );
-HKL_TEST( degenerated );
-HKL_TEST( eulerians );
-/* HKL_TEST( manip ); */
-HKL_TEST( q2 );
-HKL_TEST( m15110 ); 
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-pseudoaxis.c b/test/hkl-test-pseudoaxis.c
deleted file mode 100644
index 05f05d5..0000000
--- a/test/hkl-test-pseudoaxis.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <alloca.h>
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME pseudoaxis
-
-#define with_log 0
-#define N 2
-
-static int test_engine(struct hkl_test *test,
-		       HklPseudoAxisEngine *engine, HklGeometry *geometry,
-		       HklDetector *detector, HklSample *sample)
-{
-	size_t i, j, k, f_idx;
-	double *values = alloca(HKL_LIST_LEN(engine->pseudoAxes) * sizeof(*values));
-	int miss = 0;
-
-	/* randomize the geometry */
-	hkl_geometry_randomize(geometry);
-	
-	for(f_idx=0; f_idx<HKL_LIST_LEN(engine->modes); ++f_idx) {
-		hkl_pseudo_axis_engine_select_mode(engine, f_idx);
-		/* for now unactive the eulerians check */
-		if(!strcmp(engine->mode->name, "eulerians"))
-			continue;
-		miss = 0;
-		for(i=0;i<N;++i) {
-			int res;
-			size_t len = HKL_LIST_LEN(engine->pseudoAxes);
-
-			/* randomize the pseudoAxes values */
-			for(j=0; j<len; ++j) {
-				HklParameter *parameter = (HklParameter *)(engine->pseudoAxes[j]);
-				hkl_parameter_randomize(parameter);
-
-				values[j] = parameter->value;
-			}
-
-			/* randomize the parameters */
-			for(j=0; j<HKL_LIST_LEN(engine->mode->parameters); ++j)
-				hkl_parameter_randomize(&engine->mode->parameters[j]);
-
-			/* pseudo -> geometry */
-			hkl_pseudo_axis_engine_initialize(engine, NULL);
-			/* hkl_pseudo_axis_engine_fprintf(stderr, engine); */
-			res = hkl_pseudo_axis_engine_set(engine, NULL);
-
-			/* geometry -> pseudo */
-			if (res == HKL_SUCCESS) {
-				size_t g_len = hkl_geometry_list_len(engine->engines->geometries);
-				/* check all finded geometries */
-				/* hkl_pseudo_axis_engine_fprintf(stderr, engine); */
-
-				for(j=0; j<g_len; ++j) {
-					/* first modify the pseudoAxes values */
-					/* to be sure that the result is the */
-					/* computed result. */
-					for(k=0; k<len; ++k)
-						((HklParameter *)engine->pseudoAxes[k])->value = 0.;
-
-					hkl_geometry_init_geometry(geometry,
-								   engine->engines->geometries->items[j]->geometry);
-					hkl_pseudo_axis_engine_get(engine, NULL);
-
-					for(k=0; k<len; ++k) {
-						HKL_ASSERT_DOUBLES_EQUAL(values[k],
-									 ((HklParameter *)engine->pseudoAxes[k])->value,
-									 HKL_EPSILON);
-					}
-				}
-			} else
-				miss++;
-		}
-
-#if with_log
-		fprintf(stderr, "\n\"%s\" \"%s\" missed : %d",
-			engine->geometry->name,
-			engine->mode->name, miss);
-#endif
-
-	}
-	
-#if with_log
-	fprintf(stderr, "\n");
-#endif
-
-	return HKL_TEST_PASS;
-}
-
-#define test_engines(test, engines) do{					\
-		size_t i;						\
-		for(i=0; i<HKL_LIST_LEN(engines->engines); ++i){	\
-			if (!test_engine(test, engines->engines[i],	\
-					 engines->geometry,		\
-					 engines->detector,		\
-					 engines->sample))		\
-				return HKL_TEST_FAIL;			\
-		}							\
-	}while(0)
-
-HKL_TEST_SUITE_FUNC(set)
-{
-	const HklGeometryConfig *config;
-	HklGeometry *geometry = NULL;
-	HklDetector *detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	HklSample *sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	HklPseudoAxisEngineList *engines;
-
-	/* attach to the second holder */
-	detector->idx = 1;
-
-	/* test all E4CV engines */
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geometry = hkl_geometry_factory_new(config);
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geometry, detector, sample);
-	test_engines(test, engines);
-	hkl_geometry_free(geometry);
-	hkl_pseudo_axis_engine_list_free(engines);
-
-	/* test all E6C HKL engines */
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN6C);
-	geometry = hkl_geometry_factory_new(config);
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geometry, detector, sample);
-	test_engines(test, engines);
-	hkl_geometry_free(geometry);
-	hkl_pseudo_axis_engine_list_free(engines);
-
-	/* test all K4CV HKL engines */
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL);
-	geometry = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geometry, detector, sample);
-	test_engines(test, engines);
-	hkl_geometry_free(geometry);
-	hkl_pseudo_axis_engine_list_free(engines);
-
-	/* test all K6C engines */
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_KAPPA6C);
-	geometry = hkl_geometry_factory_new(config, 50 * HKL_DEGTORAD);
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geometry, detector, sample);
-	test_engines(test, engines);
-	hkl_geometry_free(geometry);
-	hkl_pseudo_axis_engine_list_free(engines);
-
-	/* test all ZAXIS engines */
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_ZAXIS);
-	geometry = hkl_geometry_factory_new(config);
-	engines = hkl_pseudo_axis_engine_list_factory(config);
-	hkl_pseudo_axis_engine_list_init(engines, geometry, detector, sample);
-	test_engines(test, engines);
-	hkl_geometry_free(geometry);
-	hkl_pseudo_axis_engine_list_free(engines);
-	hkl_detector_free(detector);
-	hkl_sample_free(sample);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( set );
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test-sample.c b/test/hkl-test-sample.c
deleted file mode 100644
index 24dc0b1..0000000
--- a/test/hkl-test-sample.c
+++ /dev/null
@@ -1,494 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME sample
-
-#define SET_ANGLES(geom, a, b, c, d) hkl_geometry_set_values_v(geom, 4,	\
-							      (a) * HKL_DEGTORAD, \
-							      (b) * HKL_DEGTORAD, \
-							      (c) * HKL_DEGTORAD, \
-							      (d) * HKL_DEGTORAD)
-HKL_TEST_SUITE_FUNC(new)
-{
-	HklSample *sample;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	hkl_sample_free(sample);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(add_reflection)
-{
-	HklDetector *detector;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklSample *sample;
-	HklSampleReflection *ref;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	ref = hkl_sample_add_reflection(sample, geom, detector, 1, 0, 0);
-
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(get_reflection)
-{
-	HklDetector *detector;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklSample *sample;
-	HklSampleReflection *ref;
-	HklSampleReflection *ref2;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	ref = hkl_sample_add_reflection(sample, geom, detector, 1, 0, 0);
-	ref2 = hkl_sample_get_ith_reflection(sample, 0);
-	HKL_ASSERT_EQUAL(0, !ref);
-	HKL_ASSERT_POINTER_EQUAL(ref, ref2);
-	HKL_ASSERT_EQUAL(1, HKL_LIST_LEN(sample->reflections));
-
-	ref = hkl_sample_add_reflection(sample, geom, detector, -1, 0, 0);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 1, 0);
-
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(del_reflection)
-{
-	HklDetector *detector;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklSample *sample;
-	HklSampleReflection *ref;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	ref = hkl_sample_add_reflection(sample, geom, detector, 1, 0, 0);
-	hkl_sample_del_reflection(sample, 0);
-	HKL_ASSERT_EQUAL(0, HKL_LIST_LEN(sample->reflections));
-
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC( set_UB )
-{
-	HklSample *sample;
-	static HklMatrix UB = {{{HKL_TAU/1.54,           0.,           0.},
-				{          0.,           0., HKL_TAU/1.54},
-				{          0.,-HKL_TAU/1.54,           0.}}};
-	static HklMatrix U = {{{1., 0., 0.},
-			       {0., 0., 1.},
-			       {0.,-1., 0.}}};
-
-	sample = hkl_sample_new("test",  HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	hkl_sample_set_UB(sample, &UB);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&U, &sample->U));
-	HKL_ASSERT_DOUBLES_EQUAL(-90. * HKL_DEGTORAD, sample->ux->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uy->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uz->value, HKL_EPSILON);
-
-	hkl_sample_free(sample);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(compute_UB_busing_levy)
-{
-	HklDetector *detector;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklSample *sample;
-	HklSampleReflection *ref;
-	HklMatrix m_I = {{{1,0,0}, {0,1,0}, {0, 0, 1}}};
-	HklMatrix m_ref = {{{1., 0., 0.}, {0., 0., 1.}, {0.,-1., 0.}}};
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	SET_ANGLES(geom, 30, 0, 0, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 0, 1);
-
-	SET_ANGLES(geom, 30, 0, -90, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, -1, 0, 0);
-
-	hkl_sample_compute_UB_busing_levy(sample, 0, 1);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_I, &sample->U));
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->ux->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uy->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uz->value, HKL_EPSILON);
-
-	SET_ANGLES(geom, 30, 0, 90, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 1, 0, 0);
-
-	SET_ANGLES(geom, 30, 0, 180, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 1, 0);
-
-	hkl_sample_compute_UB_busing_levy(sample, 2, 3);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_ref, &sample->U));
-	HKL_ASSERT_DOUBLES_EQUAL(-90. * HKL_DEGTORAD, sample->ux->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uy->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uz->value, HKL_EPSILON);
-
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(affine)
-{
-	double a, b, c, alpha, beta, gamma;
-	const HklGeometryConfig *config;
-	HklDetector *detector;
-	HklGeometry *geom;
-	HklSample *sample;
-	HklSampleReflection *ref;
-	HklMatrix m_ref = {{{1., 0., 0.}, {0., 1., 0.}, {0., 0., 1.}}};
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	sample->lattice->a->value = 1;
-	sample->lattice->b->value = 5;
-	sample->lattice->c->value = 4;
-	sample->lattice->alpha->value = 92 * HKL_DEGTORAD;
-	sample->lattice->beta->value = 81 * HKL_DEGTORAD;
-	sample->lattice->gamma->value = 90 * HKL_DEGTORAD;
-
-	SET_ANGLES(geom, 30, 0, 90, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 1, 0, 0);
-
-	SET_ANGLES(geom, 30, 90, 0, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 1, 0);
-
-	SET_ANGLES(geom, 30, 0, 0, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 0, 1);
-
-	SET_ANGLES(geom, 60, 60, 60, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, .625, .75, -.216506350946);
-
-	SET_ANGLES(geom, 45, 45, 45, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, .665975615037, .683012701892, .299950211252);
-
-	hkl_sample_affine(sample);
-
-	a = sample->lattice->a->value;
-	b = sample->lattice->b->value;
-	c = sample->lattice->c->value;
-	alpha = sample->lattice->alpha->value;
-	beta = sample->lattice->beta->value;
-	gamma = sample->lattice->gamma->value;
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_ref, &sample->U));
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, a, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, b, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, c, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, alpha, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, beta, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, gamma, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->ux->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uy->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uz->value, HKL_EPSILON);
-
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(get_reflections_xxx_angle)
-{
-	HklDetector *detector;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklSample *sample;
-	HklSampleReflection *ref;
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	hkl_sample_set_lattice(sample,
-			       1.54, 1.54, 1.54,
-			       90*HKL_DEGTORAD, 90*HKL_DEGTORAD,90*HKL_DEGTORAD);
-
-	SET_ANGLES(geom, 30, 0, 90, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 1, 0, 0);
-
-	SET_ANGLES(geom, 30, 90, 0, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 1, 0);
-
-	SET_ANGLES(geom, 30, 0, 0, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 0, 1);
-
-	SET_ANGLES(geom, 60, 60, 60, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, .625, .75, -.216506350946);
-
-	SET_ANGLES(geom, 45, 45, 45, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, .665975615037, .683012701892, .299950211252);
-
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD,
-				 hkl_sample_get_reflection_theoretical_angle(sample, 0, 1),
-				 HKL_EPSILON);
-
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD,
-				 hkl_sample_get_reflection_mesured_angle(sample, 0, 1),
-				 HKL_EPSILON);
-
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD,
-				 hkl_sample_get_reflection_theoretical_angle(sample, 1, 2),
-				 HKL_EPSILON);
-
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD,
-				 hkl_sample_get_reflection_mesured_angle(sample, 1, 2),
-				 HKL_EPSILON);
-
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(reflection_set_geometry)
-{
-	double a, b, c, alpha, beta, gamma;
-	HklDetector *detector;
-	const HklGeometryConfig *config;
-	HklGeometry *geom;
-	HklSample *sample;
-	HklSampleReflection *ref;
-	HklMatrix m_ref = {{{1., 0., 0.}, {0., 1., 0.}, {0., 0., 1.}}};
-
-	config = hkl_geometry_factory_get_config_from_type(HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL);
-	geom = hkl_geometry_factory_new(config);
-
-	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	detector->idx = 1;
-
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	hkl_sample_set_lattice(sample,
-			       1.54, 1.54, 1.54,
-			       90*HKL_DEGTORAD, 90*HKL_DEGTORAD,90*HKL_DEGTORAD);
-
-	SET_ANGLES(geom, 30, 0, 90, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 1, 0, 0);
-
-	SET_ANGLES(geom, 30, 90, 0, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 1, 0);
-
-	SET_ANGLES(geom, 30, 0, 0, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, 0, 0, 1);
-
-	SET_ANGLES(geom, 60, 60, 60, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, .625, .75, -.216506350946);
-
-	SET_ANGLES(geom, 46, 45, 45, 60);
-	ref = hkl_sample_add_reflection(sample, geom, detector, .665975615037, .683012701892, .299950211252);
-
-	/* correct the last reflection so the sample affinement must be ok. */
-	SET_ANGLES(geom, 45, 45, 45, 60);
-	hkl_sample_reflection_set_geometry(ref, geom);
-
-	hkl_sample_affine(sample);
-
-	a = sample->lattice->a->value;
-	b = sample->lattice->b->value;
-	c = sample->lattice->c->value;
-	alpha = sample->lattice->alpha->value;
-	beta = sample->lattice->beta->value;
-	gamma = sample->lattice->gamma->value;
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_ref, &sample->U));
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, a, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, b, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1.54, c, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, alpha, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, beta, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, gamma, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->ux->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uy->value, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., sample->uz->value, HKL_EPSILON);
-
-	hkl_sample_free(sample);
-	hkl_detector_free(detector);
-	hkl_geometry_free(geom);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(list_new)
-{
-	HklSampleList *samples;
-
-	samples = hkl_sample_list_new();
-
-	hkl_sample_list_free(samples);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(list_append_sample)
-{
-	HklSampleList *samples;
-	HklSample *sample1;
-	HklSample *sample2;
-
-	samples = hkl_sample_list_new();
-	sample1 = hkl_sample_new("test1", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-	sample2 = hkl_sample_new("test2", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	HKL_ASSERT_POINTER_EQUAL(sample1, hkl_sample_list_append(samples, sample1));
-	HKL_ASSERT_EQUAL(0, hkl_sample_list_get_idx_from_name(samples, "test1"));
-
-	HKL_ASSERT_POINTER_EQUAL(sample2, hkl_sample_list_append(samples, sample2));
-	HKL_ASSERT_EQUAL(0, hkl_sample_list_get_idx_from_name(samples, "test1"));
-	HKL_ASSERT_EQUAL(1, hkl_sample_list_get_idx_from_name(samples, "test2"));
-
-	/* can not have two samples with the same name. */
-	HKL_ASSERT_POINTER_EQUAL(NULL, hkl_sample_list_append(samples, sample1));
-
-	/* also relase sample1 and sample2 */
-	hkl_sample_list_free(samples);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(list_select_current)
-{
-	HklSampleList *samples;
-	HklSample *sample;
-
-	samples = hkl_sample_list_new();
-	sample = hkl_sample_new("test", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-	hkl_sample_list_append(samples, sample);
-
-	HKL_ASSERT_EQUAL(HKL_SUCCESS, hkl_sample_list_select_current(samples, "test"));
-	HKL_ASSERT_EQUAL(HKL_FAIL, hkl_sample_list_select_current(samples, "tests"));
-
-	/* also relase sample */
-	hkl_sample_list_free(samples);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(list_clear)
-{
-	size_t i;
-	HklSampleList *samples;
-	HklSample *sample1;
-	HklSample *sample2;
-
-	samples = hkl_sample_list_new();
-	for(i=0; i<2; ++i){
-		/* two times to see if the clear has no side effect */
-		sample1 = hkl_sample_new("test1", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-		sample2 = hkl_sample_new("test2", HKL_SAMPLE_TYPE_MONOCRYSTAL);
-
-		hkl_sample_list_append(samples, sample1);
-		hkl_sample_list_append(samples, sample2);
-		hkl_sample_list_clear(samples);
-
-		HKL_ASSERT_EQUAL(0, hkl_sample_list_len(samples));
-	}
-
-	/* also release sample1 and sample2 */
-	hkl_sample_list_free(samples);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( new );
-HKL_TEST( add_reflection );
-HKL_TEST( get_reflection );
-HKL_TEST( del_reflection );
-HKL_TEST( set_UB );
-HKL_TEST( compute_UB_busing_levy );
-HKL_TEST( affine );
-HKL_TEST( get_reflections_xxx_angle );
-
-HKL_TEST( reflection_set_geometry );
-
-HKL_TEST( list_new );
-HKL_TEST( list_append_sample );
-HKL_TEST( list_select_current );
-HKL_TEST( list_clear );
-
-HKL_TEST_SUITE_END
-
-#undef SET_ANGLES
diff --git a/test/hkl-test-vector.c b/test/hkl-test-vector.c
deleted file mode 100644
index c362926..0000000
--- a/test/hkl-test-vector.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME vector
-
-HKL_TEST_SUITE_FUNC(init)
-{
-	HklVector v;
-
-	hkl_vector_init(&v, 1, 2, 3);
-
-	HKL_ASSERT_DOUBLES_EQUAL(1., v.data[0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(2., v.data[1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(3., v.data[2], HKL_EPSILON);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(cmp)
-{
-	HklVector v1 = {{0.0, 1.0, 2.0}};
-	HklVector v2 = {{1.0, 2.0, 3.0}};
-
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&v1, &v1));
-	HKL_ASSERT_EQUAL(1, hkl_vector_cmp(&v1, &v2));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(is_opposite)
-{
-	HklVector v_ref = {{0, 1, 2}};
-	HklVector v1 = {{1, 2, 3}};
-	HklVector v2 = {{0, -1, -2}};
-
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_vector_is_opposite(&v_ref, &v1));
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_vector_is_opposite(&v_ref, &v2));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(norm2)
-{
-	HklVector v1 = {{0.0, 1.0, 2.0}};
-	HklVector v2 = {{-1.0, 1.0, 2.0}};
-
-	HKL_ASSERT_DOUBLES_EQUAL(sqrt(5.0), hkl_vector_norm2(&v1), HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(sqrt(6.0), hkl_vector_norm2(&v2), HKL_EPSILON);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(normalize)
-{
-	HklVector v_ref = {{1. /sqrt(2.), 1. / sqrt(2.), 0.}};
-	HklVector v = {{1., 1., 0.}};
-
-	hkl_vector_normalize(&v);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&v_ref, &v));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(scalar_product)
-{
-	HklVector v = {{0.0, 1.0, 2.0}};
-
-	double scalar = hkl_vector_scalar_product(&v, &v);
-	HKL_ASSERT_DOUBLES_EQUAL( 5.0, scalar, HKL_EPSILON );
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(vectorial_product)
-{
-	HklVector v = {{0.0, 1.0, 2.0}};
-	HklVector v1 = {{1.0, 2.0, 3.0}};
-	HklVector v_ref = {{-1.0, 2.0, -1.0}};
-
-	hkl_vector_vectorial_product(&v, &v1);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&v_ref, &v));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(angle)
-{
-	double angle;
-	HklVector v = {{1., 0., 0.}};
-	HklVector v1 = {{1., 1., 0.}};
-	HklVector v2 = {{1., 1., .5}};
-	HklVector v3 = {{1., .5, -1}};
-	HklVector v4 = {{0., 1., 0.}};
-	HklVector v5 = {{0., -1., 0.}};
-
-	angle = hkl_vector_angle(&v, &v);
-	HKL_ASSERT_DOUBLES_EQUAL(0., angle, HKL_EPSILON);
-
-	angle = hkl_vector_angle(&v, &v1);
-	HKL_ASSERT_DOUBLES_EQUAL(acos(1./sqrt(2.)), angle, HKL_EPSILON);
-
-	angle = hkl_vector_angle(&v2, &v3);
-	HKL_ASSERT_DOUBLES_EQUAL(acos(1./2.25), angle, HKL_EPSILON);
-
-	angle = hkl_vector_angle(&v, &v4);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, angle, HKL_EPSILON);
-
-	angle = hkl_vector_angle(&v, &v5);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, angle, HKL_EPSILON);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(oriented_angle)
-{
-	double angle;
-	HklVector v = {{1., 0., 0.}};
-	HklVector v1 = {{1., 1., 0.}};
-	HklVector v2 = {{0., 1., 0.}};
-	HklVector v3 = {{0., -1., 0.}};
-	HklVector ref = {{0, 0, 1}};
-
-	angle = hkl_vector_oriented_angle(&v, &v, &ref);
-	HKL_ASSERT_DOUBLES_EQUAL(0., angle, HKL_EPSILON);
-
-	angle = hkl_vector_oriented_angle(&v, &v1, &ref);
-	HKL_ASSERT_DOUBLES_EQUAL(acos(1./sqrt(2.)), angle, HKL_EPSILON);
-
-	angle = hkl_vector_oriented_angle(&v, &v2, &ref);
-	HKL_ASSERT_DOUBLES_EQUAL(90 * HKL_DEGTORAD, angle, HKL_EPSILON);
-
-	angle = hkl_vector_oriented_angle(&v, &v3, &ref);
-	HKL_ASSERT_DOUBLES_EQUAL(-90 * HKL_DEGTORAD, angle, HKL_EPSILON);
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(rotated_around_vector)
-{
-	HklVector x = {{1, 0, 0}};
-	HklVector z = {{0, 0, 1}};
-	HklVector y_ref = {{0, 1, 0}};
-
-	hkl_vector_rotated_around_vector(&x, &z, 90*HKL_DEGTORAD);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&y_ref, &x));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(times_matrix)
-{
-	HklMatrix m = {{{ 1.0, 3.0,-2.0},
-		{10.0, 5.0, 5.0},
-		{-3.0, 2.0, 0.0}}
-	};
-	HklVector v = {{1.0, 2.0, 3.0}};
-	HklVector v_ref = {{12., 19., 8.}};
-
-	hkl_vector_times_matrix(&v, &m);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&v_ref, &v));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_FUNC(project_on_plan)
-{
-	HklVector v;
-	HklVector v_ref = {{1, 0, 0}};
-	HklVector v1 = {{1, 0, 2}};
-	HklVector plan = {{0, 0, 1}};
-
-	v = v1;
-	hkl_vector_project_on_plan(&v, &plan);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&v_ref, &v));
-
-	return HKL_TEST_PASS;
-}
-
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( init );
-HKL_TEST( cmp );
-HKL_TEST( is_opposite );
-HKL_TEST( norm2 );
-HKL_TEST( normalize );
-HKL_TEST( scalar_product );
-HKL_TEST( vectorial_product );
-HKL_TEST( angle );
-HKL_TEST( oriented_angle );
-HKL_TEST( rotated_around_vector );
-HKL_TEST( times_matrix );
-HKL_TEST( project_on_plan );
-
-HKL_TEST_SUITE_END
diff --git a/test/hkl-test.c b/test/hkl-test.c
deleted file mode 100644
index 9ddaf52..0000000
--- a/test/hkl-test.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <alloca.h>
-#include <hkl.h>
-
-#include "hkl-test.h"
-
-void hkl_tests_grow(struct hkl_tests * tests, size_t extra)
-{
-	if (tests->len + extra <= tests->len){
-		fprintf(stderr, "you want to use way too much memory");
-		exit(128);
-	}
-	if (!tests->alloc)
-		tests->tests = NULL;
-	ALLOC_GROW(tests->tests, tests->len + extra, tests->alloc);
-}
-
-void hkl_tests_init(struct hkl_tests *tests, size_t hint)
-{
-	tests->alloc = tests->len = 0;
-	if (hint)
-		hkl_tests_grow(tests, hint);
-	else
-		tests->tests = NULL;
-}
-
-void hkl_tests_release(struct hkl_tests *tests)
-{
-	if (tests->alloc) {
-		free(tests->tests);
-		hkl_tests_init(tests, 0);
-	}
-}
-
-void hkl_tests_add_test(struct hkl_tests *tests, const char *name, hkl_test_method method)
-{
-	struct hkl_test *test;
-
-	hkl_tests_grow(tests, 1);
-
-	test = &tests->tests[tests->len];
-	test->name = name;
-	test->method = method;
-
-	tests->len++;
-}
-
-int hkl_test_run(struct hkl_test * test)
-{
-	return (*(test->method))(test);
-}
-
-int hkl_tests_run(struct hkl_tests * tests)
-{
-	size_t i;
-	int *results = alloca(tests->len * sizeof(*results));
-	int res = 0;
-
-	for(i=0; i<tests->len; i++) {
-		size_t j;
-		struct hkl_test *test;
-
-		test = &tests->tests[i];
-		results[i] = hkl_test_run(test);
-
-		/* pretty print of the test */
-		fprintf(stderr, "[");
-		for(j=0; j<=i; ++j)
-			if(results[j])
-				fprintf(stderr, ".");
-			else
-				fprintf(stderr, "X");
-
-		/* fill with spaces the rest */
-		for(j=i+1; j<tests->len; ++j)
-			fprintf(stderr, " ");
-		fprintf(stderr, "]\r");
-		fflush(stderr);
-
-		if (!results[i]) {
-			fprintf(stderr, "\n%s:%d: FAIL %s\n", test->file, test->line, test->name);
-			res = -1;
-			break;
-		}	
-	}
-	fprintf(stderr, "\n");
-	return res;
-}
diff --git a/test/hkl-test.h b/test/hkl-test.h
deleted file mode 100644
index 0b9b87f..0000000
--- a/test/hkl-test.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#ifndef __HKL_TEST_H__
-#define __HKL_TEST_H__
-
-#include <stdio.h>
-#include <math.h>
-#include <string.h>
-
-#define HKL_TEST_PASS 1
-#define HKL_TEST_FAIL 0
-
-#define HKL_ASSERT_EQUAL(a, b) do {			\
-		test->file = __FILE__;			\
-		test->line = __LINE__;			\
-		if ((a) != (b)) {			\
-			printf("%d != %d", a, b);	\
-			return HKL_TEST_FAIL;		\
-		}					\
-	} while(0)
-
-#define HKL_ASSERT_DOUBLES_EQUAL(a, b, c) do {				\
-		test->file = __FILE__;					\
-		test->line = __LINE__;					\
-		if (isnan(a) || isnan(b) || fabs((a)-(b)) > (c)) {	\
-			printf("%.7f != %.7f (%.7f)", a, b, c);		\
-			return HKL_TEST_FAIL;				\
-		}							\
-	} while(0)
-
-#define HKL_ASSERT_POINTER_EQUAL(a, b) do {		\
-		test->file = __FILE__;			\
-		test->line = __LINE__;			\
-		if ((a) != (b)) {			\
-			printf("%p != %p", a, b);	\
-			return HKL_TEST_FAIL;		\
-		}					\
-	} while(0)
-
-#define HKL_ASSERT_STRING_EQUAL(a, b) do {			\
-		test->file = __FILE__;				\
-		test->line = __LINE__;				\
-		if (strcmp((a),(b))) {				\
-			printf("\"%s\" != \"%s\"", a, b);	\
-			return HKL_TEST_FAIL;			\
-		}						\
-	} while(0)
-
-#define xstr(s) str(s)
-#define str(s) #s
-#define _concat(a, b) a ## _ ## b
-#define concat(a, b) _concat(a, b)
-
-#define HKL_TEST_SUITE_FUNC(a) int HKL_TEST_SUITE_FUNC_NAME(a) (struct hkl_test *test)
-#define HKL_TEST_SUITE_FUNC_NAME(a) concat(hkl_test, concat(HKL_TEST_SUITE_NAME, a))
-
-#define HKL_TEST_SUITE(a) do{						\
-		extern void hkl_test_suite_ ## a (struct hkl_tests *tests); \
-		hkl_test_suite_ ## a (&tests);				\
-	} while(0)
-
-#define HKL_TEST_SUITE_FULLNAME concat(hkl_test_suite, HKL_TEST_SUITE_NAME)
-#define HKL_TEST_SUITE_BEGIN void HKL_TEST_SUITE_FULLNAME (struct hkl_tests *tests) {
-
-#define HKL_TEST(a) hkl_tests_add_test( tests, xstr(HKL_TEST_SUITE_FUNC_NAME(a)), &HKL_TEST_SUITE_FUNC_NAME(a) )
-
-#define HKL_TEST_SUITE_END }
-
-/* forward declaration for the hkl_test_method typedef */
-struct hkl_test;
-
-typedef int (*hkl_test_method)(struct hkl_test *test);
-
-struct hkl_test {
-	const char *name;
-	hkl_test_method method;
-	const char *file;
-	int line;
-};
-
-struct hkl_tests {
-	size_t alloc;
-	size_t len;
-	struct hkl_test *tests;
-};
-
-
-extern void hkl_tests_init(struct hkl_tests * tests, size_t hint);
-
-extern void hkl_tests_add_test(struct hkl_tests *tests, const char *name, hkl_test_method method);
-
-extern int hkl_tests_run(struct hkl_tests *tests);
-
-extern void hkl_tests_release(struct hkl_tests *tests);
-
-#endif /* __HKL_TEST_H__ */
diff --git a/test/main.c b/test/main.c
deleted file mode 100644
index f3ebbe0..0000000
--- a/test/main.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* This file is part of the hkl library.
- *
- * The hkl library 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 3 of the License, or
- * (at your option) any later version.
- *
- * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
- *                         L'Orme des Merisiers Saint-Aubin
- *                         BP 48 91192 GIF-sur-YVETTE CEDEX
- *
- * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
- */
-#include <stdio.h>
-
-#include "hkl-test.h"
-
-int main(int argc, char **argv)
-{
-	int res;
-
-	struct hkl_tests tests;
-
-	hkl_tests_init(&tests, 0);
-
-	HKL_TEST_SUITE( error );
-	HKL_TEST_SUITE( vector );
-	HKL_TEST_SUITE( smatrix );
-	HKL_TEST_SUITE( quaternion );
-	/* HKL_TEST_SUITE( interval ); */
-	HKL_TEST_SUITE( source );
-	HKL_TEST_SUITE( axis );
-	HKL_TEST_SUITE( detector );
-	HKL_TEST_SUITE( geometry );
-	HKL_TEST_SUITE( parameter );
-	HKL_TEST_SUITE( lattice );
-	HKL_TEST_SUITE( sample );
-	HKL_TEST_SUITE( pseudoaxis );
-	HKL_TEST_SUITE( pseudoaxis_E4CV );
-	HKL_TEST_SUITE( pseudoaxis_E6C );
-	HKL_TEST_SUITE( pseudoaxis_K4CV );
-	HKL_TEST_SUITE( pseudoaxis_K6C );
-
-	res = hkl_tests_run(&tests);
-	hkl_tests_release(&tests);
-
-	return res;
-}
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..f13138c
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,64 @@
+SUBDIRS = tap .
+if HAVE_INTROSPECTION
+SUBDIRS += bindings
+endif
+
+all_tests = \
+	hkl-unit-t \
+	hkl-bench-t \
+	hkl-axis-t \
+	hkl-error-t \
+	hkl-pseudoaxis-t \
+	hkl-quaternion-t \
+	hkl-interval-t \
+	hkl-pseudoaxis-e4cv-t \
+	hkl-pseudoaxis-e4ch-t \
+	hkl-sample-t \
+	hkl-lattice-t \
+	hkl-pseudoaxis-e6c-t \
+	hkl-source-t \
+	hkl-detector-t \
+	hkl-matrix-t \
+	hkl-pseudoaxis-k4cv-t \
+	hkl-vector-t \
+	hkl-geometry-t \
+	hkl-parameter-t \
+	hkl-pseudoaxis-k6c-t \
+	hkl-pseudoaxis-zaxis-t \
+	hkl-pseudoaxis-soleil-sixs-med-t
+
+AM_CPPFLAGS = -Wextra -pedantic -D_BSD_SOURCE \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/hkl \
+	-I$(top_srcdir)/tests
+
+LDADD = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a \
+	$(GSL_LIBS)
+
+AM_LDFLAGS=-static
+
+if HKL3D
+
+all_tests += hkl3d-test-t
+
+AM_CPPFLAGS += -I$(top_srcdir)/hkl3d \
+	$(G3D_CFLAGS)
+
+LDADD += $(top_builddir)/hkl3d/libhkl3d.la
+
+endif
+
+check_PROGRAMS = runtests $(all_tests)
+
+## tap tests
+
+check-local: $(check_PROGRAMS)
+	./runtests -s $(abs_top_srcdir) $(all_tests)
+
+# Support for GNU Flymake, in Emacs.
+check-syntax: AM_CFLAGS += -fsyntax-only -pipe
+check-syntax:
+	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
+
+.PHONY: check-syntax
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644
index 0000000..05f40d9
--- /dev/null
+++ b/tests/Makefile.in
@@ -0,0 +1,1054 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at HAVE_INTROSPECTION_TRUE@am__append_1 = bindings
+ at HKL3D_TRUE@am__append_2 = hkl3d-test-t
+ at HKL3D_TRUE@am__append_3 = -I$(top_srcdir)/hkl3d \
+ at HKL3D_TRUE@	$(G3D_CFLAGS)
+
+ at HKL3D_TRUE@am__append_4 = $(top_builddir)/hkl3d/libhkl3d.la
+check_PROGRAMS = runtests$(EXEEXT) $(am__EXEEXT_2)
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+ at HKL3D_TRUE@am__EXEEXT_1 = hkl3d-test-t$(EXEEXT)
+am__EXEEXT_2 = hkl-unit-t$(EXEEXT) hkl-bench-t$(EXEEXT) \
+	hkl-axis-t$(EXEEXT) hkl-error-t$(EXEEXT) \
+	hkl-pseudoaxis-t$(EXEEXT) hkl-quaternion-t$(EXEEXT) \
+	hkl-interval-t$(EXEEXT) hkl-pseudoaxis-e4cv-t$(EXEEXT) \
+	hkl-pseudoaxis-e4ch-t$(EXEEXT) hkl-sample-t$(EXEEXT) \
+	hkl-lattice-t$(EXEEXT) hkl-pseudoaxis-e6c-t$(EXEEXT) \
+	hkl-source-t$(EXEEXT) hkl-detector-t$(EXEEXT) \
+	hkl-matrix-t$(EXEEXT) hkl-pseudoaxis-k4cv-t$(EXEEXT) \
+	hkl-vector-t$(EXEEXT) hkl-geometry-t$(EXEEXT) \
+	hkl-parameter-t$(EXEEXT) hkl-pseudoaxis-k6c-t$(EXEEXT) \
+	hkl-pseudoaxis-zaxis-t$(EXEEXT) \
+	hkl-pseudoaxis-soleil-sixs-med-t$(EXEEXT) $(am__EXEEXT_1)
+hkl_axis_t_SOURCES = hkl-axis-t.c
+hkl_axis_t_OBJECTS = hkl-axis-t.$(OBJEXT)
+hkl_axis_t_LDADD = $(LDADD)
+am__DEPENDENCIES_1 =
+hkl_axis_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+hkl_bench_t_SOURCES = hkl-bench-t.c
+hkl_bench_t_OBJECTS = hkl-bench-t.$(OBJEXT)
+hkl_bench_t_LDADD = $(LDADD)
+hkl_bench_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_detector_t_SOURCES = hkl-detector-t.c
+hkl_detector_t_OBJECTS = hkl-detector-t.$(OBJEXT)
+hkl_detector_t_LDADD = $(LDADD)
+hkl_detector_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_error_t_SOURCES = hkl-error-t.c
+hkl_error_t_OBJECTS = hkl-error-t.$(OBJEXT)
+hkl_error_t_LDADD = $(LDADD)
+hkl_error_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_geometry_t_SOURCES = hkl-geometry-t.c
+hkl_geometry_t_OBJECTS = hkl-geometry-t.$(OBJEXT)
+hkl_geometry_t_LDADD = $(LDADD)
+hkl_geometry_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_interval_t_SOURCES = hkl-interval-t.c
+hkl_interval_t_OBJECTS = hkl-interval-t.$(OBJEXT)
+hkl_interval_t_LDADD = $(LDADD)
+hkl_interval_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_lattice_t_SOURCES = hkl-lattice-t.c
+hkl_lattice_t_OBJECTS = hkl-lattice-t.$(OBJEXT)
+hkl_lattice_t_LDADD = $(LDADD)
+hkl_lattice_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_matrix_t_SOURCES = hkl-matrix-t.c
+hkl_matrix_t_OBJECTS = hkl-matrix-t.$(OBJEXT)
+hkl_matrix_t_LDADD = $(LDADD)
+hkl_matrix_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_parameter_t_SOURCES = hkl-parameter-t.c
+hkl_parameter_t_OBJECTS = hkl-parameter-t.$(OBJEXT)
+hkl_parameter_t_LDADD = $(LDADD)
+hkl_parameter_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_pseudoaxis_e4ch_t_SOURCES = hkl-pseudoaxis-e4ch-t.c
+hkl_pseudoaxis_e4ch_t_OBJECTS = hkl-pseudoaxis-e4ch-t.$(OBJEXT)
+hkl_pseudoaxis_e4ch_t_LDADD = $(LDADD)
+hkl_pseudoaxis_e4ch_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_pseudoaxis_e4cv_t_SOURCES = hkl-pseudoaxis-e4cv-t.c
+hkl_pseudoaxis_e4cv_t_OBJECTS = hkl-pseudoaxis-e4cv-t.$(OBJEXT)
+hkl_pseudoaxis_e4cv_t_LDADD = $(LDADD)
+hkl_pseudoaxis_e4cv_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_pseudoaxis_e6c_t_SOURCES = hkl-pseudoaxis-e6c-t.c
+hkl_pseudoaxis_e6c_t_OBJECTS = hkl-pseudoaxis-e6c-t.$(OBJEXT)
+hkl_pseudoaxis_e6c_t_LDADD = $(LDADD)
+hkl_pseudoaxis_e6c_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_pseudoaxis_k4cv_t_SOURCES = hkl-pseudoaxis-k4cv-t.c
+hkl_pseudoaxis_k4cv_t_OBJECTS = hkl-pseudoaxis-k4cv-t.$(OBJEXT)
+hkl_pseudoaxis_k4cv_t_LDADD = $(LDADD)
+hkl_pseudoaxis_k4cv_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_pseudoaxis_k6c_t_SOURCES = hkl-pseudoaxis-k6c-t.c
+hkl_pseudoaxis_k6c_t_OBJECTS = hkl-pseudoaxis-k6c-t.$(OBJEXT)
+hkl_pseudoaxis_k6c_t_LDADD = $(LDADD)
+hkl_pseudoaxis_k6c_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_pseudoaxis_soleil_sixs_med_t_SOURCES =  \
+	hkl-pseudoaxis-soleil-sixs-med-t.c
+hkl_pseudoaxis_soleil_sixs_med_t_OBJECTS =  \
+	hkl-pseudoaxis-soleil-sixs-med-t.$(OBJEXT)
+hkl_pseudoaxis_soleil_sixs_med_t_LDADD = $(LDADD)
+hkl_pseudoaxis_soleil_sixs_med_t_DEPENDENCIES =  \
+	$(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_pseudoaxis_t_SOURCES = hkl-pseudoaxis-t.c
+hkl_pseudoaxis_t_OBJECTS = hkl-pseudoaxis-t.$(OBJEXT)
+hkl_pseudoaxis_t_LDADD = $(LDADD)
+hkl_pseudoaxis_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_pseudoaxis_zaxis_t_SOURCES = hkl-pseudoaxis-zaxis-t.c
+hkl_pseudoaxis_zaxis_t_OBJECTS = hkl-pseudoaxis-zaxis-t.$(OBJEXT)
+hkl_pseudoaxis_zaxis_t_LDADD = $(LDADD)
+hkl_pseudoaxis_zaxis_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_quaternion_t_SOURCES = hkl-quaternion-t.c
+hkl_quaternion_t_OBJECTS = hkl-quaternion-t.$(OBJEXT)
+hkl_quaternion_t_LDADD = $(LDADD)
+hkl_quaternion_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_sample_t_SOURCES = hkl-sample-t.c
+hkl_sample_t_OBJECTS = hkl-sample-t.$(OBJEXT)
+hkl_sample_t_LDADD = $(LDADD)
+hkl_sample_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_source_t_SOURCES = hkl-source-t.c
+hkl_source_t_OBJECTS = hkl-source-t.$(OBJEXT)
+hkl_source_t_LDADD = $(LDADD)
+hkl_source_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_unit_t_SOURCES = hkl-unit-t.c
+hkl_unit_t_OBJECTS = hkl-unit-t.$(OBJEXT)
+hkl_unit_t_LDADD = $(LDADD)
+hkl_unit_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl_vector_t_SOURCES = hkl-vector-t.c
+hkl_vector_t_OBJECTS = hkl-vector-t.$(OBJEXT)
+hkl_vector_t_LDADD = $(LDADD)
+hkl_vector_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+hkl3d_test_t_SOURCES = hkl3d-test-t.c
+hkl3d_test_t_OBJECTS = hkl3d-test-t.$(OBJEXT)
+hkl3d_test_t_LDADD = $(LDADD)
+hkl3d_test_t_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+runtests_SOURCES = runtests.c
+runtests_OBJECTS = runtests.$(OBJEXT)
+runtests_LDADD = $(LDADD)
+runtests_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(am__DEPENDENCIES_1) \
+	$(am__append_4)
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = hkl-axis-t.c hkl-bench-t.c hkl-detector-t.c hkl-error-t.c \
+	hkl-geometry-t.c hkl-interval-t.c hkl-lattice-t.c \
+	hkl-matrix-t.c hkl-parameter-t.c hkl-pseudoaxis-e4ch-t.c \
+	hkl-pseudoaxis-e4cv-t.c hkl-pseudoaxis-e6c-t.c \
+	hkl-pseudoaxis-k4cv-t.c hkl-pseudoaxis-k6c-t.c \
+	hkl-pseudoaxis-soleil-sixs-med-t.c hkl-pseudoaxis-t.c \
+	hkl-pseudoaxis-zaxis-t.c hkl-quaternion-t.c hkl-sample-t.c \
+	hkl-source-t.c hkl-unit-t.c hkl-vector-t.c hkl3d-test-t.c \
+	runtests.c
+DIST_SOURCES = hkl-axis-t.c hkl-bench-t.c hkl-detector-t.c \
+	hkl-error-t.c hkl-geometry-t.c hkl-interval-t.c \
+	hkl-lattice-t.c hkl-matrix-t.c hkl-parameter-t.c \
+	hkl-pseudoaxis-e4ch-t.c hkl-pseudoaxis-e4cv-t.c \
+	hkl-pseudoaxis-e6c-t.c hkl-pseudoaxis-k4cv-t.c \
+	hkl-pseudoaxis-k6c-t.c hkl-pseudoaxis-soleil-sixs-med-t.c \
+	hkl-pseudoaxis-t.c hkl-pseudoaxis-zaxis-t.c hkl-quaternion-t.c \
+	hkl-sample-t.c hkl-source-t.c hkl-unit-t.c hkl-vector-t.c \
+	hkl3d-test-t.c runtests.c
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = tap . bindings
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+SUBDIRS = tap . $(am__append_1)
+all_tests = hkl-unit-t hkl-bench-t hkl-axis-t hkl-error-t \
+	hkl-pseudoaxis-t hkl-quaternion-t hkl-interval-t \
+	hkl-pseudoaxis-e4cv-t hkl-pseudoaxis-e4ch-t hkl-sample-t \
+	hkl-lattice-t hkl-pseudoaxis-e6c-t hkl-source-t hkl-detector-t \
+	hkl-matrix-t hkl-pseudoaxis-k4cv-t hkl-vector-t hkl-geometry-t \
+	hkl-parameter-t hkl-pseudoaxis-k6c-t hkl-pseudoaxis-zaxis-t \
+	hkl-pseudoaxis-soleil-sixs-med-t $(am__append_2)
+AM_CPPFLAGS = -Wextra -pedantic -D_BSD_SOURCE -I$(top_srcdir) \
+	-I$(top_srcdir)/hkl -I$(top_srcdir)/tests $(am__append_3)
+LDADD = $(top_builddir)/hkl/libhkl.la \
+	$(top_builddir)/tests/tap/libtap.a $(GSL_LIBS) $(am__append_4)
+AM_LDFLAGS = -static
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+hkl-axis-t$(EXEEXT): $(hkl_axis_t_OBJECTS) $(hkl_axis_t_DEPENDENCIES) $(EXTRA_hkl_axis_t_DEPENDENCIES) 
+	@rm -f hkl-axis-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_axis_t_OBJECTS) $(hkl_axis_t_LDADD) $(LIBS)
+
+hkl-bench-t$(EXEEXT): $(hkl_bench_t_OBJECTS) $(hkl_bench_t_DEPENDENCIES) $(EXTRA_hkl_bench_t_DEPENDENCIES) 
+	@rm -f hkl-bench-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_bench_t_OBJECTS) $(hkl_bench_t_LDADD) $(LIBS)
+
+hkl-detector-t$(EXEEXT): $(hkl_detector_t_OBJECTS) $(hkl_detector_t_DEPENDENCIES) $(EXTRA_hkl_detector_t_DEPENDENCIES) 
+	@rm -f hkl-detector-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_detector_t_OBJECTS) $(hkl_detector_t_LDADD) $(LIBS)
+
+hkl-error-t$(EXEEXT): $(hkl_error_t_OBJECTS) $(hkl_error_t_DEPENDENCIES) $(EXTRA_hkl_error_t_DEPENDENCIES) 
+	@rm -f hkl-error-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_error_t_OBJECTS) $(hkl_error_t_LDADD) $(LIBS)
+
+hkl-geometry-t$(EXEEXT): $(hkl_geometry_t_OBJECTS) $(hkl_geometry_t_DEPENDENCIES) $(EXTRA_hkl_geometry_t_DEPENDENCIES) 
+	@rm -f hkl-geometry-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_geometry_t_OBJECTS) $(hkl_geometry_t_LDADD) $(LIBS)
+
+hkl-interval-t$(EXEEXT): $(hkl_interval_t_OBJECTS) $(hkl_interval_t_DEPENDENCIES) $(EXTRA_hkl_interval_t_DEPENDENCIES) 
+	@rm -f hkl-interval-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_interval_t_OBJECTS) $(hkl_interval_t_LDADD) $(LIBS)
+
+hkl-lattice-t$(EXEEXT): $(hkl_lattice_t_OBJECTS) $(hkl_lattice_t_DEPENDENCIES) $(EXTRA_hkl_lattice_t_DEPENDENCIES) 
+	@rm -f hkl-lattice-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_lattice_t_OBJECTS) $(hkl_lattice_t_LDADD) $(LIBS)
+
+hkl-matrix-t$(EXEEXT): $(hkl_matrix_t_OBJECTS) $(hkl_matrix_t_DEPENDENCIES) $(EXTRA_hkl_matrix_t_DEPENDENCIES) 
+	@rm -f hkl-matrix-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_matrix_t_OBJECTS) $(hkl_matrix_t_LDADD) $(LIBS)
+
+hkl-parameter-t$(EXEEXT): $(hkl_parameter_t_OBJECTS) $(hkl_parameter_t_DEPENDENCIES) $(EXTRA_hkl_parameter_t_DEPENDENCIES) 
+	@rm -f hkl-parameter-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_parameter_t_OBJECTS) $(hkl_parameter_t_LDADD) $(LIBS)
+
+hkl-pseudoaxis-e4ch-t$(EXEEXT): $(hkl_pseudoaxis_e4ch_t_OBJECTS) $(hkl_pseudoaxis_e4ch_t_DEPENDENCIES) $(EXTRA_hkl_pseudoaxis_e4ch_t_DEPENDENCIES) 
+	@rm -f hkl-pseudoaxis-e4ch-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_pseudoaxis_e4ch_t_OBJECTS) $(hkl_pseudoaxis_e4ch_t_LDADD) $(LIBS)
+
+hkl-pseudoaxis-e4cv-t$(EXEEXT): $(hkl_pseudoaxis_e4cv_t_OBJECTS) $(hkl_pseudoaxis_e4cv_t_DEPENDENCIES) $(EXTRA_hkl_pseudoaxis_e4cv_t_DEPENDENCIES) 
+	@rm -f hkl-pseudoaxis-e4cv-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_pseudoaxis_e4cv_t_OBJECTS) $(hkl_pseudoaxis_e4cv_t_LDADD) $(LIBS)
+
+hkl-pseudoaxis-e6c-t$(EXEEXT): $(hkl_pseudoaxis_e6c_t_OBJECTS) $(hkl_pseudoaxis_e6c_t_DEPENDENCIES) $(EXTRA_hkl_pseudoaxis_e6c_t_DEPENDENCIES) 
+	@rm -f hkl-pseudoaxis-e6c-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_pseudoaxis_e6c_t_OBJECTS) $(hkl_pseudoaxis_e6c_t_LDADD) $(LIBS)
+
+hkl-pseudoaxis-k4cv-t$(EXEEXT): $(hkl_pseudoaxis_k4cv_t_OBJECTS) $(hkl_pseudoaxis_k4cv_t_DEPENDENCIES) $(EXTRA_hkl_pseudoaxis_k4cv_t_DEPENDENCIES) 
+	@rm -f hkl-pseudoaxis-k4cv-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_pseudoaxis_k4cv_t_OBJECTS) $(hkl_pseudoaxis_k4cv_t_LDADD) $(LIBS)
+
+hkl-pseudoaxis-k6c-t$(EXEEXT): $(hkl_pseudoaxis_k6c_t_OBJECTS) $(hkl_pseudoaxis_k6c_t_DEPENDENCIES) $(EXTRA_hkl_pseudoaxis_k6c_t_DEPENDENCIES) 
+	@rm -f hkl-pseudoaxis-k6c-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_pseudoaxis_k6c_t_OBJECTS) $(hkl_pseudoaxis_k6c_t_LDADD) $(LIBS)
+
+hkl-pseudoaxis-soleil-sixs-med-t$(EXEEXT): $(hkl_pseudoaxis_soleil_sixs_med_t_OBJECTS) $(hkl_pseudoaxis_soleil_sixs_med_t_DEPENDENCIES) $(EXTRA_hkl_pseudoaxis_soleil_sixs_med_t_DEPENDENCIES) 
+	@rm -f hkl-pseudoaxis-soleil-sixs-med-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_pseudoaxis_soleil_sixs_med_t_OBJECTS) $(hkl_pseudoaxis_soleil_sixs_med_t_LDADD) $(LIBS)
+
+hkl-pseudoaxis-t$(EXEEXT): $(hkl_pseudoaxis_t_OBJECTS) $(hkl_pseudoaxis_t_DEPENDENCIES) $(EXTRA_hkl_pseudoaxis_t_DEPENDENCIES) 
+	@rm -f hkl-pseudoaxis-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_pseudoaxis_t_OBJECTS) $(hkl_pseudoaxis_t_LDADD) $(LIBS)
+
+hkl-pseudoaxis-zaxis-t$(EXEEXT): $(hkl_pseudoaxis_zaxis_t_OBJECTS) $(hkl_pseudoaxis_zaxis_t_DEPENDENCIES) $(EXTRA_hkl_pseudoaxis_zaxis_t_DEPENDENCIES) 
+	@rm -f hkl-pseudoaxis-zaxis-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_pseudoaxis_zaxis_t_OBJECTS) $(hkl_pseudoaxis_zaxis_t_LDADD) $(LIBS)
+
+hkl-quaternion-t$(EXEEXT): $(hkl_quaternion_t_OBJECTS) $(hkl_quaternion_t_DEPENDENCIES) $(EXTRA_hkl_quaternion_t_DEPENDENCIES) 
+	@rm -f hkl-quaternion-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_quaternion_t_OBJECTS) $(hkl_quaternion_t_LDADD) $(LIBS)
+
+hkl-sample-t$(EXEEXT): $(hkl_sample_t_OBJECTS) $(hkl_sample_t_DEPENDENCIES) $(EXTRA_hkl_sample_t_DEPENDENCIES) 
+	@rm -f hkl-sample-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_sample_t_OBJECTS) $(hkl_sample_t_LDADD) $(LIBS)
+
+hkl-source-t$(EXEEXT): $(hkl_source_t_OBJECTS) $(hkl_source_t_DEPENDENCIES) $(EXTRA_hkl_source_t_DEPENDENCIES) 
+	@rm -f hkl-source-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_source_t_OBJECTS) $(hkl_source_t_LDADD) $(LIBS)
+
+hkl-unit-t$(EXEEXT): $(hkl_unit_t_OBJECTS) $(hkl_unit_t_DEPENDENCIES) $(EXTRA_hkl_unit_t_DEPENDENCIES) 
+	@rm -f hkl-unit-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_unit_t_OBJECTS) $(hkl_unit_t_LDADD) $(LIBS)
+
+hkl-vector-t$(EXEEXT): $(hkl_vector_t_OBJECTS) $(hkl_vector_t_DEPENDENCIES) $(EXTRA_hkl_vector_t_DEPENDENCIES) 
+	@rm -f hkl-vector-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl_vector_t_OBJECTS) $(hkl_vector_t_LDADD) $(LIBS)
+
+hkl3d-test-t$(EXEEXT): $(hkl3d_test_t_OBJECTS) $(hkl3d_test_t_DEPENDENCIES) $(EXTRA_hkl3d_test_t_DEPENDENCIES) 
+	@rm -f hkl3d-test-t$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(hkl3d_test_t_OBJECTS) $(hkl3d_test_t_LDADD) $(LIBS)
+
+runtests$(EXEEXT): $(runtests_OBJECTS) $(runtests_DEPENDENCIES) $(EXTRA_runtests_DEPENDENCIES) 
+	@rm -f runtests$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(runtests_OBJECTS) $(runtests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-axis-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-bench-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-detector-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-error-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-geometry-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-interval-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-lattice-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-matrix-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-parameter-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e4ch-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e4cv-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-e6c-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k4cv-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-k6c-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-soleil-sixs-med-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-pseudoaxis-zaxis-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-quaternion-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-sample-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-source-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-unit-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-vector-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl3d-test-t.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/runtests.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-local
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) check-am install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am check-local clean clean-checkPROGRAMS clean-generic \
+	clean-libtool cscopelist-am ctags ctags-am distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am
+
+
+check-local: $(check_PROGRAMS)
+	./runtests -s $(abs_top_srcdir) $(all_tests)
+
+# Support for GNU Flymake, in Emacs.
+check-syntax: AM_CFLAGS += -fsyntax-only -pipe
+check-syntax:
+	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
+
+.PHONY: check-syntax
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/bindings/Makefile.am b/tests/bindings/Makefile.am
new file mode 100644
index 0000000..92a040c
--- /dev/null
+++ b/tests/bindings/Makefile.am
@@ -0,0 +1,9 @@
+TESTS_ENVIRONMENT=env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la
+TESTS = python.py trajectory.py
+
+EXTRA_DIST = $(TESTS)
+
+ipython:
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la ipython
+
+CLEANFILES = trajectories.pdf
\ No newline at end of file
diff --git a/tests/bindings/Makefile.in b/tests/bindings/Makefile.in
new file mode 100644
index 0000000..f3145e8
--- /dev/null
+++ b/tests/bindings/Makefile.in
@@ -0,0 +1,862 @@
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tests/bindings
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/test-driver
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[ 	]*:recheck:[ 	]*
+am__global_test_result_rx = ^[ 	]*:global-test-result:[ 	]*
+am__copy_in_global_log_rx = ^[ 	]*:copy-in-global-log:[ 	]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+	    recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[ 	]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);					\
+$(am__vpath_adj_setup) $(am__vpath_adj)			\
+$(am__tty_colors);					\
+srcdir=$(srcdir); export srcdir;			\
+case "$@" in						\
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;	\
+    *) am__odir=.;; 					\
+esac;							\
+test "x$$am__odir" = x"." || test -d "$$am__odir" 	\
+  || $(MKDIR_P) "$$am__odir" || exit $$?;		\
+if test -f "./$$f"; then dir=./;			\
+elif test -f "$$f"; then dir=;				\
+else dir="$(srcdir)/"; fi;				\
+tst=$$dir$$f; log='$@'; 				\
+if test -n '$(DISABLE_HARD_ERRORS)'; then		\
+  am__enable_hard_errors=no; 				\
+else							\
+  am__enable_hard_errors=yes; 				\
+fi; 							\
+case " $(XFAIL_TESTS) " in				\
+  *[\ \	]$$f[\ \	]* | *[\ \	]$$dir$$f[\ \	]*) \
+    am__expect_failure=yes;;				\
+  *)							\
+    am__expect_failure=no;;				\
+esac; 							\
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT at .log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+	$(TEST_LOG_FLAGS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+ASY = @ASY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CONFIG = @GSL_CONFIG@
+GSL_LIBS = @GSL_LIBS@
+GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
+GTKDOC_MKPDF = @GTKDOC_MKPDF@
+GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+HTML_DIR = @HTML_DIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SHTOOL = @SHTOOL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+release_info = @release_info@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+version_info = @version_info@
+TESTS_ENVIRONMENT = env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la
+TESTS = python.py trajectory.py
+EXTRA_DIST = $(TESTS)
+CLEANFILES = trajectories.pdf
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .log .test .test$(EXEEXT) .trs
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/bindings/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu tests/bindings/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+	rm -f $< $@
+	$(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+	@:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+	@$(am__set_TESTS_bases); \
+	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+	redo_bases=`for i in $$bases; do \
+	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+	            done`; \
+	if test -n "$$redo_bases"; then \
+	  redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+	  redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+	  if $(am__make_dryrun); then :; else \
+	    rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+	  fi; \
+	fi; \
+	if test -n "$$am__remaking_logs"; then \
+	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+	       "recursion detected" >&2; \
+	else \
+	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+	fi; \
+	if $(am__make_dryrun); then :; else \
+	  st=0;  \
+	  errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+	  for i in $$redo_bases; do \
+	    test -f $$i.trs && test -r $$i.trs \
+	      || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+	    test -f $$i.log && test -r $$i.log \
+	      || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+	  done; \
+	  test $$st -eq 0 || exit 1; \
+	fi
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+	ws='[ 	]'; \
+	results=`for b in $$bases; do echo $$b.trs; done`; \
+	test -n "$$results" || results=/dev/null; \
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+	  success=true; \
+	else \
+	  success=false; \
+	fi; \
+	br='==================='; br=$$br$$br$$br$$br; \
+	result_count () \
+	{ \
+	    if test x"$$1" = x"--maybe-color"; then \
+	      maybe_colorize=yes; \
+	    elif test x"$$1" = x"--no-color"; then \
+	      maybe_colorize=no; \
+	    else \
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+	    fi; \
+	    shift; \
+	    desc=$$1 count=$$2; \
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
+	      color_start=$$3 color_end=$$std; \
+	    else \
+	      color_start= color_end=; \
+	    fi; \
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
+	}; \
+	create_testsuite_report () \
+	{ \
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
+	}; \
+	{								\
+	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
+	    $(am__rst_title);						\
+	  create_testsuite_report --no-color;				\
+	  echo;								\
+	  echo ".. contents:: :depth: 2";				\
+	  echo;								\
+	  for b in $$bases; do echo $$b; done				\
+	    | $(am__create_global_log);					\
+	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
+	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
+	if $$success; then						\
+	  col="$$grn";							\
+	 else								\
+	  col="$$red";							\
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
+	fi;								\
+	echo "$${col}$$br$${std}"; 					\
+	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
+	echo "$${col}$$br$${std}"; 					\
+	create_testsuite_report --maybe-color;				\
+	echo "$$col$$br$$std";						\
+	if $$success; then :; else					\
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
+	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
+	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\
+	  fi;								\
+	  echo "$$col$$br$$std";					\
+	fi;								\
+	$$success || exit 1
+
+check-TESTS:
+	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+	@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+	log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+	exit $$?;
+recheck: all 
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	bases=`for i in $$bases; do echo $$i; done \
+	         | $(am__list_recheck_tests)` || exit 1; \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	log_list=`echo $$log_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+	        am__force_recheck=am--force-recheck \
+	        TEST_LOGS="$$log_list"; \
+	exit $$?
+python.py.log: python.py
+	@p='python.py'; \
+	b='python.py'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+trajectory.py.log: trajectory.py
+	@p='trajectory.py'; \
+	b='trajectory.py'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+	@p='$<'; \
+	$(am__set_b); \
+	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+	"$$tst" $(AM_TESTS_FD_REDIRECT)
+ at am__EXEEXT_TRUE@.test$(EXEEXT).log:
+ at am__EXEEXT_TRUE@	@p='$<'; \
+ at am__EXEEXT_TRUE@	$(am__set_b); \
+ at am__EXEEXT_TRUE@	$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ at am__EXEEXT_TRUE@	--log-file $$b.log --trs-file $$b.trs \
+ at am__EXEEXT_TRUE@	$(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ at am__EXEEXT_TRUE@	"$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+	-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+	-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+	-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+	clean-libtool cscopelist-am ctags-am distclean \
+	distclean-generic distclean-libtool distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \
+	uninstall uninstall-am
+
+
+ipython:
+	env GI_TYPELIB_PATH=$(top_builddir)/hkl $(LIBTOOL) --mode=execute -dlopen $(top_builddir)/hkl/libhkl.la ipython
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/bindings/python.py b/tests/bindings/python.py
new file mode 100755
index 0000000..773347a
--- /dev/null
+++ b/tests/bindings/python.py
@@ -0,0 +1,265 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+This file is part of the hkl library.
+
+The hkl library 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 3 of the License, or
+(at your option) any later version.
+
+The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+
+Copyright (C) 2012-2013 Synchrotron SOLEIL
+                        L'Orme des Merisiers Saint-Aubin
+                        BP 48 91192 GIF-sur-YVETTE CEDEX
+Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+"""
+
+import sys
+import math
+import unittest
+from gi.repository import GLib
+from gi.repository import Hkl
+
+
+class TestAPI(unittest.TestCase):
+
+    @unittest.skip("factory not yet ready")
+    def test_factory_api(self):
+        """
+        enforce the Factory API
+        """
+        # factories dict <name, Factory>
+        factories = Hkl.factories()
+        for key, value in factories.iteritems():
+            self.assertTrue(type(key) == str)
+            self.assertTrue(type(value) == Hkl.Factory)
+
+        kappa6C_factory = factories['Kappa6C']
+        geometry = kappa6C_factory.create_new_geometry()
+        engines = kappa6C_factory.create_new_engine_list()
+
+    def test_detector_api(self):
+        """
+        enforce the detector API
+        """
+
+        # create an 0D HklDetector
+        detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
+        self.assertTrue(type(detector) is Hkl.Detector)
+
+        # mount the detector on the 2nd holder of the geometry
+        # yes numbering follow the C convention !
+        detector.idx_set(1)
+
+    def test_geometry_api(self):
+        """
+        enforce the geometry API
+        """
+
+        # get the config for a given geometry and create the
+        # corresponding HklGeometry
+        factory = Hkl.factories()['K6C']
+        geometry = factory.create_new_geometry()
+
+        # axes names are accessible
+        self.assertTrue(
+            isinstance([axis.name_get() for axis in geometry.axes()],
+                       list))
+
+        # set the geometry axes values
+        values_w = [0, 30, 0, 0, 0, 60]
+        geometry.set_axes_values_unit(values_w)
+        values_r = geometry.get_axes_values_unit()
+
+        # check that the read and write values of the geometry are
+        # almost equals
+        for r, w in zip(values_w, values_r):
+            self.assertAlmostEqual(r, w)
+
+        # check that we can access the axes
+        axes = geometry.axes()
+        self.assertTrue(len([axis.name_get() for axis in axes]) != 0)
+        for axis in axes:
+            self.assertTrue(type(axis.name_get()) is str)
+            axis.min_max_unit_set(0, math.radians(180))
+
+    def test_mode_api(self):
+        """
+        enforce the HklMode API
+        """
+        factory = Hkl.factories()['K6C']
+        engines = factory.create_new_engine_list()
+        engine = engines.get_by_name("hkl")
+
+        # check for all modes
+        for mode in engine.modes():
+            self.assertTrue(type(mode) is Hkl.Mode)
+            self.assertTrue(type(mode.name()) is str)
+
+            # check the parameters
+            parameters = mode.parameters()
+            self.assertTrue(type(parameters) is Hkl.ParameterList)
+            for parameter in parameters.parameters():
+                self.assertTrue(type(parameter) is Hkl.Parameter)
+
+    def test_engine_api(self):
+        """
+        enforce the HklEngine API
+        """
+
+        detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
+        detector.idx_set(1)
+
+        factory = Hkl.factories()['K6C']
+        geometry = factory.create_new_geometry()
+        values_w = [0., 30., 0., 0., 0., 60.]
+        geometry.set_axes_values_unit(values_w)
+
+        sample = Hkl.Sample.new("toto")
+        lattice = sample.lattice_get()
+        lattice.set(1.54, 1.54, 1.54,
+                    math.radians(90.0),
+                    math.radians(90.0),
+                    math.radians(90.0))
+        sample.lattice_set(lattice)
+
+        # compute all the pseudo axes managed by all engines
+        engines = factory.create_new_engine_list()
+        engines.init(geometry, detector, sample)
+        engines.get()
+
+        # get the hkl engine and do a computation
+        hkl = engines.get_by_name("hkl")
+        values = hkl.pseudo_axes().values_unit_get()
+
+        # check for all modes
+        for mode in hkl.modes():
+            self.assertTrue(type(mode) is Hkl.Mode)
+
+        # set the hkl engine and get the results
+        for _ in range(100):
+            try:
+                hkl.set_values_unit(values)
+            except GLib.GError, err:
+                print values, err
+            solutions = engines.geometries()
+            self.assertTrue(type(solutions) is Hkl.GeometryList)
+            for item in solutions.items():
+                self.assertTrue(type(item) is Hkl.GeometryListItem)
+                self.assertTrue(type(item.geometry()) is Hkl.Geometry)
+            values[1] += .01
+
+        # check that all the values computed are reachable
+        for engine in engines.engines():
+            self.assertTrue(type(engine) is Hkl.Engine)
+            self.assertTrue(type(engine.name()) is str)
+            for parameter in engine.pseudo_axes().parameters():
+                self.assertTrue(type(parameter) is Hkl.Parameter)
+                self.assertTrue(type(parameter.value_get()) is float)
+
+    @unittest.skip("for testing figures")
+    def test_doc_exemple(self):
+        # execfile("../../Documentation/sphinx/source/bindings/python.py")
+        execfile(
+            "../../Documentation/sphinx/source/pyplots/trajectory_simple.py")
+        execfile(
+            "../../Documentation/sphinx/source/pyplots/trajectory_full.py")
+
+        self.assertTrue(False)
+
+    def test_sample_api(self):
+        """
+        enforce the HklSample API
+        """
+
+        # create a sample
+        sample = Hkl.Sample.new("toto")
+        self.assertTrue(sample.name_get() == "toto")
+
+        # check that the copy constructor is working
+        copy = sample.copy()
+        self.assertTrue(copy.name_get() == sample.name_get())
+        # we can change the name of the copy without affecting the original
+        copy.name_set("titi")
+        self.assertTrue(copy.name_get() != sample.name_get())
+
+        # set the lattice parameters
+        lattice = Hkl.Lattice.new(1.54, 1.54, 1.54,
+                                  math.radians(90.),
+                                  math.radians(90.),
+                                  math.radians(90.))
+        sample.lattice_set(lattice)
+
+        # change the lattice parameter by expanding the tuple from
+        # the get method. the lattice should not change.
+        lattice.set(*lattice.get())
+
+        # this new lattice is identical to the one from the sample
+        self.assertTrue(lattice.get() == sample.lattice_get().get())
+
+        # now change the lattice parameter
+        lattice.set(1, 2, 3,
+                    math.radians(90),
+                    math.radians(90),
+                    math.radians(90))
+
+        # this new lattice is different from the one in the sample
+        self.assertTrue(lattice.get() != sample.lattice_get().get())
+
+        # gives access to the ux, uy, uz part
+        ux = sample.ux_get()
+        uy = sample.uy_get()
+        uz = sample.uz_get()
+        sample.ux_set(ux)
+        sample.uy_set(uy)
+        sample.uz_set(uz)
+
+        # read and write the U matrix
+        U = sample.U_get()
+        UB = sample.UB_get()
+        sample.UB_set(UB)
+
+        # get the reciprocal lattice
+        reciprocal = lattice.copy()
+        lattice.reciprocal(reciprocal)
+
+    def test_reflection_api(self):
+
+        detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
+        detector.idx_set(1)
+
+        factory = Hkl.factories()['K6C']
+        geometry = factory.create_new_geometry()
+        values_w = [0., 30., 0., 0., 0., 60.]
+        geometry.set_axes_values_unit(values_w)
+
+        sample = Hkl.Sample.new("toto")
+
+        # add reflection
+        r1 = sample.add_reflection(geometry, detector, 1, 1, 1)
+        r2 = sample.add_reflection(geometry, detector, 1, 1, 1)
+
+        # get the hkl part
+        self.assertTrue(r2.hkl_get() == (1.0, 1.0, 1.0))
+        r2.hkl_set(1, 0, 1)
+        self.assertTrue(r2.hkl_get() == (1.0, 0.0, 1.0))
+
+        # compute the angles
+        print sample.get_reflection_mesured_angle(r1, r2)
+        print sample.get_reflection_theoretical_angle(r1, r2)
+
+        # remove all the reflections
+        reflections = sample.reflections_get()
+        for reflection in reflections:
+            sample.del_reflection(reflection)
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/tests/bindings/trajectory.py b/tests/bindings/trajectory.py
new file mode 100755
index 0000000..ed20498
--- /dev/null
+++ b/tests/bindings/trajectory.py
@@ -0,0 +1,144 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import math
+import numpy
+import matplotlib
+matplotlib.use('Agg')
+
+import matplotlib.pyplot as plt
+
+from matplotlib.backends.backend_pdf import PdfPages
+from matplotlib import rcParams
+from gi.repository import GLib
+from gi.repository import Hkl
+
+
+def compute_hkl_trajectories(engine, hkl1=None, hkl2=None, n=100):
+    """
+    compute all the trajectories for a given engine already configured
+    """
+    if not hkl1:
+        hkl1 = [0, 0, 1]
+    if not hkl2:
+        hkl2 = [0, 1, 1]
+
+    h = numpy.linspace(hkl1[0], hkl2[0], n + 1)
+    k = numpy.linspace(hkl1[1], hkl2[1], n + 1)
+    l = numpy.linspace(hkl1[2], hkl2[2], n + 1)
+
+    # set the hkl engine and get the results
+    trajectories = []
+    for hh, kk, ll in zip(h, k, l):
+        try:
+            engine.set_values_unit([hh, kk, ll])
+            solutions = engine.engines().geometries()
+            for i, item in enumerate(solutions.items()):
+                try:
+                    trajectories[i]
+                except IndexError:
+                    trajectories.append([])
+                values = item.geometry().get_axes_values_unit()
+                trajectories[i].append(values)
+            engine.engines().select_solution(0)
+        except GLib.GError, err:
+            pass
+
+    return trajectories
+
+
+def _plot_legend(axes):
+    plt.subplot(3, 4, 1)
+    plt.title("legend")
+    print "legende", 1
+    for name in axes:
+        plt.plot([0, 0], label=name)
+    plt.legend()
+
+
+def plot_hkl_trajectory(filename, geometry, engines,
+                        hkl1=None, hkl2=None, n=100):
+    """
+    plot the trajectory for a engine. It is possible to limit the
+    number of trajectory using the max_traj keyword
+    """
+    axes_names = [axis.name_get() for axis in geometry.axes()]
+
+    hkl = engines.get_by_name("hkl")
+    page = 1
+    plt.clf()
+    plt.suptitle("\"" + filename + "\" " + repr(
+        hkl1) + " -> " + repr(hkl2) + " page " + str(page))
+    _plot_legend(axes_names)
+    idx = 2
+    for mode in hkl.modes():
+        hkl.select_mode(mode)
+        trajectories = compute_hkl_trajectories(hkl, hkl1=hkl1, hkl2=hkl2, n=n)
+        print "\"" + filename + "\"", idx, mode.name(), len(trajectories)
+
+        plt.subplot(3, 4, idx)
+        plt.title("%s" % (mode.name(),))
+        if not len(trajectories):
+            plt.text(0.5, 0.5, "Failed", size=20, rotation=0.,
+                     ha="center", va="center",
+                     bbox=dict(boxstyle="round",
+                               ec=(1., 0.5, 0.5),
+                               fc=(1., 0.8, 0.8),
+                               )
+                     )
+            plt.draw()
+        else:
+            plt.ylim(-180, 180)
+            if len(trajectories[0]) == 1:
+                plt.plot(trajectories[0], 'o-')
+            else:
+                plt.plot(trajectories[0], '-')
+
+        idx += 1
+        if idx > 12:
+            pp.savefig()
+            plt.clf()
+            page += 1
+            _plot_legend(axes_names)
+            plt.suptitle(filename + " " + repr(
+                hkl1) + " -> " + repr(hkl2) + " page " + str(page))
+            idx = 2
+    pp.savefig()
+
+
+pp = PdfPages('trajectories.pdf')
+rcParams['font.size'] = 6
+
+
+def main():
+    sample = Hkl.Sample.new("toto")
+    lattice = sample.lattice_get()
+    lattice.set(1.54, 1.54, 1.54,
+                math.radians(90.0),
+                math.radians(90.0),
+                math.radians(90.))
+    sample.lattice_set(lattice)
+
+    detector = Hkl.Detector.factory_new(Hkl.DetectorType(0))
+    detector.idx_set(1)
+
+    for key, factory in Hkl.factories().iteritems():
+        geometry = factory.create_new_geometry()
+        engines = factory.create_new_engine_list()
+
+        # here we set the detector arm with only positiv values for
+        # now tth or delta arm
+        for axis in geometry.axes():
+            if axis.name_get() in ["tth", "delta"]:
+                axis.min_max_unit_set(0, 180.)
+
+        engines.init(geometry, detector, sample)
+
+        engines_names = [engine.name() for engine in engines.engines()]
+        if 'hkl' in engines_names:
+            plot_hkl_trajectory(key, geometry, engines,
+                                hkl1=[0, 0, 1], hkl2=[0, 1, 1], n=100)
+    pp.close()
+
+if __name__ == '__main__':
+    main()
diff --git a/tests/hkl-axis-t.c b/tests/hkl-axis-t.c
new file mode 100644
index 0000000..3869591
--- /dev/null
+++ b/tests/hkl-axis-t.c
@@ -0,0 +1,211 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
+
+#include "hkl/ccan/container_of/container_of.h"
+#include "hkl-axis-private.h"
+
+static void new(void)
+{
+	HklParameter *axis;
+	static HklVector v = {{1, 0, 0}};
+
+	axis = hkl_parameter_new_axis("omega", &v);
+
+	is_string("omega", axis->name, __func__);
+	is_double(-M_PI, axis->range.min, HKL_EPSILON, __func__);
+	is_double(M_PI, axis->range.max, HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(axis), HKL_EPSILON, __func__);
+	ok(HKL_TRUE == axis->fit, __func__);
+	ok(HKL_TRUE == axis->changed, __func__);
+
+	hkl_parameter_free(axis);
+}
+
+static void get_quaternions(void)
+{
+	HklAxis *axis;
+	static HklVector v = {{1, 0, 0}};
+
+	axis = container_of(hkl_parameter_new_axis("omega", &v),
+			    HklAxis, parameter);
+
+	is_double(1., axis->q.data[0], HKL_EPSILON, __func__);
+	is_double(0., axis->q.data[1], HKL_EPSILON, __func__);
+	is_double(0., axis->q.data[2], HKL_EPSILON, __func__);
+	is_double(0., axis->q.data[3], HKL_EPSILON, __func__);
+
+	hkl_parameter_value_set(&axis->parameter, -M_PI_2, NULL);
+	is_double(1./sqrt(2.), axis->q.data[0], HKL_EPSILON, __func__);
+	is_double(-1./sqrt(2.), axis->q.data[1], HKL_EPSILON, __func__);
+	is_double(0., axis->q.data[2], HKL_EPSILON, __func__);
+	is_double(0., axis->q.data[3], HKL_EPSILON, __func__);
+
+	hkl_parameter_free(&axis->parameter);
+}
+
+static void copy(void)
+{
+	HklAxis *axis;
+	HklAxis *copy;
+	static HklVector v = {{1, 0, 0}};
+
+	axis = container_of(hkl_parameter_new_axis("omega", &v),
+			    HklAxis, parameter);
+	hkl_parameter_value_set(&axis->parameter, -M_PI_2, NULL);
+
+	copy = container_of(hkl_parameter_new_copy(&axis->parameter),
+			    HklAxis, parameter);
+	is_string("omega", copy->parameter.name, __func__);
+	is_double(-M_PI, copy->parameter.range.min, HKL_EPSILON, __func__);
+	is_double(M_PI, copy->parameter.range.max, HKL_EPSILON, __func__);
+	is_double(-M_PI_2, hkl_parameter_value_get(&copy->parameter), HKL_EPSILON, __func__);
+	ok(HKL_TRUE == copy->parameter.fit, __func__);
+	ok(HKL_TRUE == copy->parameter.changed, __func__);
+	is_double(1./sqrt(2.), copy->q.data[0], HKL_EPSILON, __func__);
+	is_double(-1./sqrt(2.), copy->q.data[1], HKL_EPSILON, __func__);
+	is_double(0., copy->q.data[2], HKL_EPSILON, __func__);
+	is_double(0., copy->q.data[3], HKL_EPSILON, __func__);
+	
+	hkl_parameter_free(&axis->parameter);
+	hkl_parameter_free(&copy->parameter);
+}
+
+static void is_valid(void)
+{
+	HklAxis *axis1;
+	static HklVector v = {{1, 0, 0}};
+
+	axis1 = container_of(hkl_parameter_new_axis("omega", &v),
+			     HklAxis, parameter);
+
+	hkl_parameter_value_unit_set(&axis1->parameter, 45, NULL);
+	ok(HKL_TRUE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+
+	/* change the range of axis1 */
+	hkl_parameter_min_max_unit_set(&axis1->parameter, -270, 0);
+	ok(HKL_FALSE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+
+	hkl_parameter_value_unit_set(&axis1->parameter, -45, NULL);
+	ok(HKL_TRUE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+
+	hkl_parameter_min_max_unit_set(&axis1->parameter, 350, 450);
+	hkl_parameter_value_unit_set(&axis1->parameter, 45, NULL);
+	ok(HKL_TRUE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+	hkl_parameter_value_unit_set(&axis1->parameter, -45, NULL);
+	ok(HKL_FALSE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+
+	hkl_parameter_min_max_unit_set(&axis1->parameter, -10, 90);
+	hkl_parameter_value_unit_set(&axis1->parameter, 405, NULL);
+	ok(HKL_TRUE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+	hkl_parameter_value_unit_set(&axis1->parameter, -405, NULL);
+	ok(HKL_FALSE == hkl_parameter_is_valid(&axis1->parameter), __func__);
+
+	hkl_parameter_free(&axis1->parameter);
+}
+
+static void set_value_smallest_in_range(void)
+{
+	HklAxis *axis;
+	static HklVector v = {{1, 0, 0}};
+
+	axis = container_of(hkl_parameter_new_axis("omega", &v),
+			    HklAxis, parameter);
+
+	hkl_parameter_min_max_unit_set(&axis->parameter, -190, 190);
+
+	hkl_parameter_value_unit_set(&axis->parameter, 185, NULL);
+	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
+	is_double(-175., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+
+	hkl_parameter_value_unit_set(&axis->parameter, 545, NULL);
+	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
+	is_double(-175., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+
+	hkl_parameter_value_unit_set(&axis->parameter, -185, NULL);
+	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
+	is_double(-185., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+
+	hkl_parameter_value_unit_set(&axis->parameter, 175, NULL);
+	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
+	is_double(-185., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+
+	hkl_parameter_value_unit_set(&axis->parameter, 190, NULL);
+	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
+	is_double(-170., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+
+	hkl_parameter_value_unit_set(&axis->parameter, -190, NULL);
+	hkl_parameter_value_set_smallest_in_range(&axis->parameter);
+	is_double(-190., hkl_parameter_value_unit_get(&axis->parameter), HKL_EPSILON, __func__);
+
+	hkl_parameter_free(&axis->parameter);
+}
+
+static void get_value_closest(void)
+{
+	HklAxis *axis1, *axis2;
+	static HklVector v = {{1, 0, 0}};
+
+	axis1 = container_of(hkl_parameter_new_axis("omega", &v),
+			     HklAxis, parameter);
+	axis2 = container_of(hkl_parameter_new_axis("omega", &v),
+			     HklAxis, parameter);
+
+	hkl_parameter_value_unit_set(&axis1->parameter, 0, NULL);
+	hkl_parameter_value_unit_set(&axis2->parameter, 0, NULL);
+	is_double(0., hkl_parameter_value_get_closest(&axis1->parameter,
+						      &axis2->parameter),
+		  HKL_EPSILON, __func__);
+
+	/* change the range of axis1 */
+	hkl_parameter_min_max_unit_set(&axis1->parameter, -270, 180);
+	hkl_parameter_value_unit_set(&axis1->parameter, 100, NULL);
+
+	hkl_parameter_value_unit_set(&axis2->parameter, -75, NULL);
+	is_double(100 * HKL_DEGTORAD, hkl_parameter_value_get_closest(&axis1->parameter,
+								      &axis2->parameter),
+		  HKL_EPSILON, __func__);
+
+	hkl_parameter_value_unit_set(&axis2->parameter, -85, NULL);
+	is_double(-260 * HKL_DEGTORAD, hkl_parameter_value_get_closest(&axis1->parameter,
+								       &axis2->parameter),
+		  HKL_EPSILON, __func__);
+
+	hkl_parameter_free(&axis1->parameter);
+	hkl_parameter_free(&axis2->parameter);
+}
+
+int main(int argc, char** argv)
+{
+	plan(40);
+
+	new();
+	get_quaternions();
+	copy();
+	is_valid();
+	set_value_smallest_in_range();
+	get_value_closest();
+
+	return 0;
+}
diff --git a/tests/hkl-bench-t.c b/tests/hkl-bench-t.c
new file mode 100644
index 0000000..330e917
--- /dev/null
+++ b/tests/hkl-bench-t.c
@@ -0,0 +1,191 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <stdio.h>
+#include <sys/time.h>
+#include <tap/basic.h>
+#include "hkl.h"
+
+static void hkl_test_bench_run_real(HklEngine *engine, HklGeometry *geometry, size_t n)
+{
+	size_t i;
+	HklMode **mode;
+	darray_mode *modes = hkl_engine_modes(engine);
+
+	/* pseudo -> geometry */
+	darray_foreach(mode, *modes){
+		double min, max, mean;
+		darray_parameter *parameters;
+
+		hkl_engine_select_mode(engine, *mode);
+		parameters = hkl_mode_parameters(*mode);
+		if (darray_size(*parameters))
+			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+
+		mean = max = 0;
+		min = 1000; /* arbitrary value always greater than the real min */
+		for(i=0; i<n; ++i){
+			struct timeval debut, fin, dt;
+			double t;
+
+			hkl_geometry_set_values_unit_v(geometry, 0, 0, 0, 0, 10, 10);
+			gettimeofday(&debut, NULL);
+			hkl_engine_set(engine, NULL);
+			gettimeofday(&fin, NULL);
+			timersub(&fin, &debut, &dt);
+			t = dt.tv_sec * 1000. + dt.tv_usec / 1000.;
+			min = t < min ? t : min;
+			max = t > max ? t : max;
+			mean += t;
+		}
+		fprintf(stdout, "\"%s\" \"%s\" \"%s\" (%d/%d) iterations %f / %f / %f [min/mean/max] ms each\n",
+			hkl_geometry_name_get(geometry),
+			hkl_engine_name(engine),
+			hkl_mode_name(*mode), n, i, min, mean/n, max);
+	}
+}
+
+static void hkl_test_bench_run_v(HklEngineList *engines, HklGeometry *geometry,
+				 char const *name, int n, ...)
+{
+	va_list ap;
+	HklEngine *engine = hkl_engine_list_get_by_name(engines, name);
+	HklParameter **pseudo_axis;
+	darray_parameter *pseudo_axes = (darray_parameter *)hkl_engine_pseudo_axes(engine);
+
+	va_start(ap, n);
+	/* TODO replace with a specialise HklParameterList */
+	darray_foreach(pseudo_axis, *pseudo_axes){
+		hkl_parameter_value_set(*pseudo_axis,
+					va_arg(ap, double), NULL);
+	}
+	va_end(ap);
+
+	hkl_test_bench_run_real(engine, geometry, n);
+}
+
+static void hkl_test_bench_k6c(int n)
+{
+	const HklFactory *factory;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklGeometry *geom;
+	HklDetector *detector;
+	HklSample *sample;
+	size_t i, j;
+	int res;
+
+	factory = hkl_factory_get_by_name("K6C");
+
+	geom = hkl_factory_create_new_geometry(factory);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geom, detector, sample);
+
+	hkl_test_bench_run_v(engines, geom, "hkl", n, 1., 0., 0.);
+	hkl_test_bench_run_v(engines, geom, "eulerians", n, 0., 90*HKL_DEGTORAD, 0.);
+	hkl_test_bench_run_v(engines, geom, "psi", n, 10.*HKL_DEGTORAD);
+	hkl_test_bench_run_v(engines, geom, "q2", n, 1., 10.*HKL_DEGTORAD);
+	hkl_test_bench_run_v(engines, geom, "qper_qpar", n, 1., 1.);
+
+	hkl_engine_list_free(engines);
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geom);
+}
+
+static void hkl_test_bench_eulerians(void)
+{
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+
+	factory = hkl_factory_get_by_name("K6C");
+
+	geometry = hkl_factory_create_new_geometry(factory);
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+
+	engine = hkl_engine_list_get_by_name(engines, "eulerians");
+	modes = hkl_engine_modes(engine);
+
+	darray_foreach(mode, *modes){
+		static double eulerians[] = {0, 90 * HKL_DEGTORAD, 0};
+		HklParameterList *pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+		hkl_engine_select_mode(engine, *mode);
+
+		/* studdy this degenerated case */
+		hkl_parameter_list_values_set(pseudo_axes, eulerians, 3, NULL);
+		if (hkl_engine_set(engine, NULL)) {
+			const HklGeometryList *geometries = hkl_engine_list_geometries(engines);
+			const darray_item *items = hkl_geometry_list_items_get(geometries);
+			HklGeometryListItem **item;
+
+			darray_foreach(item, *items){
+				static double null[] = {0, 0, 0};
+
+				hkl_parameter_list_values_set(pseudo_axes, null, 3, NULL);
+				hkl_geometry_set(geometry,
+						 hkl_geometry_list_item_geometry_get(*item));
+				hkl_engine_get(engine, NULL);
+			}
+		}
+	}
+
+	hkl_engine_list_free(engines);
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geometry);
+}
+
+int main(int argc, char **argv)
+{
+	int n;
+
+	plan(1);
+
+	if (argc > 1)
+		n = atoi(argv[1]);
+	else
+		n = 10;
+
+	hkl_test_bench_k6c(n);
+	hkl_test_bench_eulerians();
+
+	ok(HKL_TRUE == HKL_TRUE, __func__);
+
+	return 0;
+}
diff --git a/test/hkl-test-detector.c b/tests/hkl-detector-t.c
similarity index 67%
rename from test/hkl-test-detector.c
rename to tests/hkl-detector-t.c
index 0beb16b..2c29022 100644
--- a/test/hkl-test-detector.c
+++ b/tests/hkl-detector-t.c
@@ -13,62 +13,55 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <hkl.h>
+#include "hkl.h"
+#include <tap/basic.h>
 
-#include "hkl-test.h"
+#include "hkl-axis-private.h" /* temporary */
+#include "hkl-detector-private.h"
 
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME detector
-
-HKL_TEST_SUITE_FUNC(new)
+static void new(void)
 {
 	HklDetector *detector1;
 	HklDetector *detector2;
 
 	detector1 = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	HKL_ASSERT_EQUAL(0, detector1->idx);
-	HKL_ASSERT_POINTER_EQUAL(NULL, detector1->holder);
+	ok(0 == detector1->idx, __func__);
+	ok(NULL == detector1->holder, __func__);
 
 	detector2 = hkl_detector_new_copy(detector1);
 
-	HKL_ASSERT_EQUAL(detector1->idx, detector2->idx);
-	HKL_ASSERT_POINTER_EQUAL(detector1->holder, detector2->holder);
+	ok(detector1->idx == detector2->idx, __func__);
+	ok(detector1->holder == detector2->holder, __func__);
 
 	hkl_detector_free(detector1);
 	hkl_detector_free(detector2);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(attach_to_holder)
+static void attach_to_holder(void)
 {
 	HklDetector *detector = NULL;
 	HklGeometry *geometry = NULL;
 	HklHolder *holder = NULL;
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	geometry = hkl_geometry_new();
+	geometry = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(geometry);
 	hkl_detector_attach_to_holder(detector, holder);
 
-	HKL_ASSERT_EQUAL(0, detector->idx);
-	HKL_ASSERT_POINTER_EQUAL(holder, detector->holder);
+	ok(0 == detector->idx, __func__);
+	ok(holder == detector->holder, __func__);
 
 	hkl_geometry_free(geometry);
 	hkl_detector_free(detector);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(compute_kf)
+static void compute_kf(void)
 {
 	HklDetector *detector = NULL;
 	HklGeometry *geometry = NULL;
@@ -79,28 +72,29 @@ HKL_TEST_SUITE_FUNC(compute_kf)
 	HklVector kf_ref = {{0, HKL_TAU / HKL_SOURCE_DEFAULT_WAVE_LENGTH, 0}};
 
 	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
-	geometry = hkl_geometry_new();
+	geometry = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(geometry);
 	hkl_holder_add_rotation_axis(holder, "a", 1, 0, 0);
 	hkl_holder_add_rotation_axis(holder, "b", 0, 1, 0);
 
-	hkl_axis_set_value(&geometry->axes[0], M_PI_2);
-	hkl_axis_set_value(&geometry->axes[1], M_PI_2);
+	hkl_parameter_value_set(darray_item(geometry->axes, 0), M_PI_2, NULL);
+	hkl_parameter_value_set(darray_item(geometry->axes, 1), M_PI_2, NULL);
 
 	hkl_detector_attach_to_holder(detector, holder);
 	hkl_detector_compute_kf(detector, geometry, &kf);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&kf_ref, &kf));
+	ok(0 == hkl_vector_cmp(&kf_ref, &kf), __func__);
 
 	hkl_geometry_free(geometry);
 	hkl_detector_free(detector);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_BEGIN
+int main(int argc, char** argv)
+{
+	plan(7);
 
-HKL_TEST( new );
-HKL_TEST( attach_to_holder );
-HKL_TEST( compute_kf );
+	new();
+	attach_to_holder();
+	compute_kf();
 
-HKL_TEST_SUITE_END
+	return 0;
+}
diff --git a/test/hkl-test-error.c b/tests/hkl-error-t.c
similarity index 64%
rename from test/hkl-test-error.c
rename to tests/hkl-error-t.c
index d859929..355da64 100644
--- a/test/hkl-test-error.c
+++ b/tests/hkl-error-t.c
@@ -13,37 +13,31 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <hkl.h>
+#include "hkl.h"
+#include <tap/basic.h>
 
-#include "hkl-test.h"
+#include "hkl-error-private.h"
 
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME error
-
-HKL_TEST_SUITE_FUNC(new)
+static void new(void)
 {
 	HklError *error;
 
 	error = hkl_error_new("salut %s", "fred");
-	HKL_ASSERT_STRING_EQUAL(error->message, "salut fred");
+	is_string("salut fred", error->message, __func__);
 	hkl_error_free(error);
 
 	error = hkl_error_new_literal("salut fred");
-	HKL_ASSERT_STRING_EQUAL(error->message, "salut fred");
+	is_string("salut fred", error->message, __func__);
 	hkl_error_free(error);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(copy)
+static void copy(void)
 {
 	HklError *error;
 	HklError *copy;
@@ -51,31 +45,27 @@ HKL_TEST_SUITE_FUNC(copy)
 	error = hkl_error_new ("salut %s", "fred");
 	copy = hkl_error_new_copy (error);
 
-	HKL_ASSERT_STRING_EQUAL (copy->message, "salut fred");
+	is_string ("salut fred", copy->message, __func__);
 
 	hkl_error_free (error);
 	hkl_error_free (copy);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(set)
+static void set(void)
 {
 	HklError *error = NULL;
 
 	hkl_error_set (&error, "salut %s", "bob");
-	HKL_ASSERT_STRING_EQUAL (error->message, "salut bob");
+	is_string ("salut bob", error->message, __func__);
 	hkl_error_clear (&error);
 
 	hkl_error_set_literal (&error, "salut fred");
-	HKL_ASSERT_STRING_EQUAL (error->message, "salut fred");
+	is_string ("salut fred", error->message, __func__);
 
 	hkl_error_free (error);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(propagate)
+static void propagate(void)
 {
 	HklError *dest = NULL;
 	HklError *src;
@@ -86,26 +76,22 @@ HKL_TEST_SUITE_FUNC(propagate)
 
 	src = hkl_error_new ("salut %s", "fred");
 	hkl_error_propagate (&dest, src);
-	HKL_ASSERT_STRING_EQUAL (dest->message, "salut fred");
+	is_string ("salut fred", dest->message, __func__);
 	/* transfer the error into dest so no need to release src anymore */
 	hkl_error_free (dest);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(clear)
+static void clear(void)
 {
 	HklError *error;
 
 	error = hkl_error_new ("salut %s", "fred");
 	hkl_error_clear (&error);
 
-	HKL_ASSERT_POINTER_EQUAL (NULL, error);
-
-	return HKL_TEST_PASS;
+	ok(NULL == error, __func__);
 }
 
-HKL_TEST_SUITE_FUNC(prefix)
+static void prefix(void)
 {
 	HklError *error;
 	HklError *dest = NULL;
@@ -113,23 +99,24 @@ HKL_TEST_SUITE_FUNC(prefix)
 	error = hkl_error_new ("%s", "fred");
 
 	hkl_error_prefix (&error, "%s", "salut ");
-	HKL_ASSERT_STRING_EQUAL (error->message, "salut fred");
+	is_string ("salut fred", error->message, __func__);
 
 	hkl_error_propagate_prefixed (&dest, error, "%s", "oh ");
-	HKL_ASSERT_STRING_EQUAL (dest->message, "oh salut fred");
+	is_string ("oh salut fred", dest->message, __func__);
 
 	hkl_error_free (dest);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_BEGIN
+int main(int argc, char** argv)
+{
+	plan(9);
 
-HKL_TEST( new );
-HKL_TEST( copy );
-HKL_TEST( set );
-HKL_TEST( propagate );
-HKL_TEST( clear );
-HKL_TEST( prefix );
+	new();
+	copy();
+	set();
+	propagate();
+	clear();
+	prefix();
 
-HKL_TEST_SUITE_END
+	return 0;
+}
diff --git a/test/hkl-test-geometry.c b/tests/hkl-geometry-t.c
similarity index 55%
rename from test/hkl-test-geometry.c
rename to tests/hkl-geometry-t.c
index b62d584..5477024 100644
--- a/test/hkl-test-geometry.c
+++ b/tests/hkl-geometry-t.c
@@ -13,53 +13,50 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <hkl.h>
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
 
-#include "hkl-test.h"
+#include "hkl/ccan/container_of/container_of.h"
+#include "hkl-axis-private.h" /* temporary */
+#include "hkl-geometry-private.h"
 
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME geometry
-
-HKL_TEST_SUITE_FUNC(add_holder)
+static void add_holder(void)
 {
 	HklGeometry *g = NULL;
 	HklHolder *holder = NULL;
 
-	g = hkl_geometry_new();
-	HKL_ASSERT_EQUAL(0, HKL_LIST_LEN(g->holders));
+	g = hkl_geometry_new(NULL);
+	is_int(0, darray_size(g->holders), __func__);
 
 	holder = hkl_geometry_add_holder(g);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
-	HKL_ASSERT_EQUAL(1, HKL_LIST_LEN(g->holders));
+	is_int(1, darray_size(g->holders), __func__);
 
 	holder = hkl_geometry_add_holder(g);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
-	HKL_ASSERT_EQUAL(2, HKL_LIST_LEN(g->holders));
+	is_int(2, darray_size(g->holders), __func__);
 
-	HKL_ASSERT_POINTER_EQUAL(holder, &g->holders[1]);
+	ok(holder == darray_item(g->holders, 1), __func__);
 
 	hkl_geometry_free(g);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(get_axis)
+static void get_axis(void)
 {
 	HklGeometry *g = NULL;
 	HklHolder *holder = NULL;
 	HklAxis *axis0, *axis1, *axis2;
 
-	g = hkl_geometry_new();
+	g = hkl_geometry_new(NULL);
 
 	holder = hkl_geometry_add_holder(g);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
@@ -69,23 +66,21 @@ HKL_TEST_SUITE_FUNC(get_axis)
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
-	HKL_ASSERT_EQUAL(0, !hkl_geometry_get_axis_by_name(g, "A"));
-	HKL_ASSERT_EQUAL(0, !hkl_geometry_get_axis_by_name(g, "B"));
-	HKL_ASSERT_EQUAL(0, !hkl_geometry_get_axis_by_name(g, "C"));
-	HKL_ASSERT_EQUAL(1, !hkl_geometry_get_axis_by_name(g, "D"));
+	ok(0 == !hkl_geometry_get_axis_by_name(g, "A"), __func__);
+	ok(0 == !hkl_geometry_get_axis_by_name(g, "B"), __func__);
+	ok(0 == !hkl_geometry_get_axis_by_name(g, "C"), __func__);
+	ok(1 == !hkl_geometry_get_axis_by_name(g, "D"), __func__);
 
 	hkl_geometry_free(g);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(update)
+static void update(void)
 {
 	HklGeometry *g = NULL;
 	HklHolder *holder = NULL;
 	HklAxis *axis0, *axis1, *axis2;
 
-	g = hkl_geometry_new();
+	g = hkl_geometry_new(NULL);
 
 	holder = hkl_geometry_add_holder(g);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
@@ -95,52 +90,68 @@ HKL_TEST_SUITE_FUNC(update)
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
-	axis1 = hkl_geometry_get_axis_by_name(g, "B");
-	hkl_axis_set_value(axis1, M_PI_2);
+	axis1 = container_of(hkl_geometry_get_axis_by_name(g, "B"), HklAxis, parameter);
+	hkl_parameter_value_set(&axis1->parameter, M_PI_2, NULL);
 	/* now axis1 is dirty */
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_axis_get_changed(axis1));
-	
+	ok(HKL_TRUE == axis1->parameter.changed, __func__);
+
 	hkl_geometry_update(g);
-	HKL_ASSERT_DOUBLES_EQUAL(1./sqrt(2), g->holders[0].q.data[0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1./sqrt(2), g->holders[0].q.data[1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(.0, g->holders[0].q.data[2], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(.0, g->holders[0].q.data[3], HKL_EPSILON);
+	holder = darray_item(g->holders, 0);
+	is_double(1./sqrt(2), holder->q.data[0], HKL_EPSILON, __func__);
+	is_double(1./sqrt(2), holder->q.data[1], HKL_EPSILON, __func__);
+	is_double(.0, holder->q.data[2], HKL_EPSILON, __func__);
+	is_double(.0, holder->q.data[3], HKL_EPSILON, __func__);
 	/* now axis1 is clean */
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_axis_get_changed(axis1));
+	ok(HKL_FALSE == axis1->parameter.changed, __func__);
 
 	hkl_geometry_free(g);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(set_values)
+static void set_values(void)
 {
 	HklGeometry *g;
 	HklHolder *holder;
 
-	g = hkl_geometry_new();
+	g = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(g);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
 	hkl_geometry_set_values_v(g, 3, 1., 1., 1.);
-	HKL_ASSERT_DOUBLES_EQUAL(1., hkl_axis_get_value(&g->axes[0]), HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1., hkl_axis_get_value(&g->axes[1]), HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1., hkl_axis_get_value(&g->axes[2]), HKL_EPSILON);
+	is_double(1., hkl_parameter_value_get(darray_item(g->axes, 0)), HKL_EPSILON, __func__);
+	is_double(1., hkl_parameter_value_get(darray_item(g->axes, 1)), HKL_EPSILON, __func__);
+	is_double(1., hkl_parameter_value_get(darray_item(g->axes, 2)), HKL_EPSILON, __func__);
 
 	hkl_geometry_free(g);
+}
 
-	return HKL_TEST_PASS;
+static void set_values_unit(void)
+{
+	HklGeometry *g;
+	HklHolder *holder;
+
+	g = hkl_geometry_new(NULL);
+	holder = hkl_geometry_add_holder(g);
+	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
+	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
+	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
+
+	hkl_geometry_set_values_unit_v(g, 10., 10., 10.);
+	is_double(10. * HKL_DEGTORAD, hkl_parameter_value_get(darray_item(g->axes, 0)), HKL_EPSILON, __func__);
+	is_double(10. * HKL_DEGTORAD, hkl_parameter_value_get(darray_item(g->axes, 1)), HKL_EPSILON, __func__);
+	is_double(10. * HKL_DEGTORAD, hkl_parameter_value_get(darray_item(g->axes, 2)), HKL_EPSILON, __func__);
+
+	hkl_geometry_free(g);
 }
 
-HKL_TEST_SUITE_FUNC(distance)
+static void distance(void)
 {
 	HklGeometry *g1 = NULL;
 	HklGeometry *g2 = NULL;
 	HklHolder *holder = NULL;
 
-	g1 = hkl_geometry_new();
+	g1 = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(g1);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
@@ -150,43 +161,46 @@ HKL_TEST_SUITE_FUNC(distance)
 
 	hkl_geometry_set_values_v(g1, 3, 0., 0., 0.);
 	hkl_geometry_set_values_v(g2, 3, 1., 1., 1.);
-	HKL_ASSERT_DOUBLES_EQUAL(3, hkl_geometry_distance(g1, g2), HKL_EPSILON);
+	is_double(3., hkl_geometry_distance(g1, g2), HKL_EPSILON, __func__);
 
 	hkl_geometry_free(g1);
 	hkl_geometry_free(g2);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC(is_valid)
+static void is_valid(void)
 {
 	HklGeometry *geom = NULL;
 	HklHolder *holder = NULL;
 
-	geom = hkl_geometry_new();
+	geom = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(geom);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "C", 1., 0., 0.);
 
 	hkl_geometry_set_values_v(geom, 3, 0., 0., 0.);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_geometry_is_valid(geom));
+	ok(HKL_TRUE == hkl_geometry_is_valid(geom), __func__);
 
-	hkl_geometry_set_values_v(geom, 3, -180., 0., 0.);
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_geometry_is_valid(geom));
+	hkl_geometry_set_values_v(geom, 3, -181. * HKL_DEGTORAD, 0., 0.);
+	ok(HKL_TRUE == hkl_geometry_is_valid(geom), __func__);
 
-	hkl_geometry_free(geom);
+	hkl_parameter_min_max_set(darray_item(geom->axes, 0),
+				-100 * HKL_DEGTORAD, 100 * HKL_DEGTORAD);
+	ok(HKL_FALSE == hkl_geometry_is_valid(geom), __func__);
 
-	return HKL_TEST_PASS;
+	hkl_geometry_free(geom);
 }
 
-HKL_TEST_SUITE_FUNC(list)
+static void list(void)
 {
+	int i = 0;
 	HklGeometry *g;
 	HklGeometryList *list;
+	HklGeometryListItem **item;
 	HklHolder *holder;
+	static double values[] = {0. * HKL_DEGTORAD, 10 * HKL_DEGTORAD, 30 * HKL_DEGTORAD};
 
-	g = hkl_geometry_new();
+	g = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(g);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
@@ -194,47 +208,43 @@ HKL_TEST_SUITE_FUNC(list)
 
 	list = hkl_geometry_list_new();
 
-	hkl_geometry_set_values_v(g, 3, 0., 0., 0.);
+	hkl_geometry_set_values_v(g, 3, values[0], 0., 0.);
+	hkl_geometry_fprintf(stderr, g);
 	hkl_geometry_list_add(list, g);
-	HKL_ASSERT_EQUAL(1, HKL_LIST_LEN(list->items));
+	is_int(1, darray_size(list->items), __func__);
 
 	/* can not add two times the same geometry */
 	hkl_geometry_list_add(list, g);
-	HKL_ASSERT_EQUAL(1, HKL_LIST_LEN(list->items));
+	is_int(1, darray_size(list->items), __func__);
 
-	hkl_geometry_set_values_v(g, 3, 30*HKL_DEGTORAD, 0., 0.);
+	hkl_geometry_set_values_v(g, 3, values[2], 0., 0.);
 	hkl_geometry_list_add(list, g);
-	hkl_geometry_set_values_v(g, 3, 10*HKL_DEGTORAD, 0., 0.);
+	hkl_geometry_set_values_v(g, 3, values[1], 0., 0.);
 	hkl_geometry_list_add(list, g);
-	HKL_ASSERT_EQUAL(3, HKL_LIST_LEN(list->items));
+	is_int(3, darray_size(list->items), __func__);
 
-	hkl_geometry_set_values_v(g, 3, 0., 0., 0.);
+	hkl_geometry_set_values_v(g, 3, values[0], 0., 0.);
 	hkl_geometry_list_sort(list, g);
-	HKL_ASSERT_DOUBLES_EQUAL(0.,
-				 hkl_axis_get_value(&list->items[0]->geometry->axes[0]),
-				 HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(10*HKL_DEGTORAD,
-				 hkl_axis_get_value(&list->items[1]->geometry->axes[0]),
-				 HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(30*HKL_DEGTORAD,
-				 hkl_axis_get_value(&list->items[2]->geometry->axes[0]),
-				 HKL_EPSILON);
 
+	hkl_geometry_list_fprintf(stderr, list);
+	darray_foreach(item, list->items){
+		is_double(values[i++],
+			  hkl_parameter_value_get(darray_item((*item)->geometry->axes, 0)),
+			  HKL_EPSILON, __func__);
+	}
 
 	hkl_geometry_free(g);
 	hkl_geometry_list_free(list);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC( list_multiply_from_range )
+static void  list_multiply_from_range(void)
 {
 	HklGeometry *g;
 	HklGeometryList *list;
 	HklHolder *holder;
-	HklAxis *axisA, *axisB, *axisC;
+	HklParameter *axisA, *axisB, *axisC;
 
-	g = hkl_geometry_new();
+	g = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(g);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
@@ -244,9 +254,9 @@ HKL_TEST_SUITE_FUNC( list_multiply_from_range )
 	axisB = hkl_geometry_get_axis_by_name(g, "B");
 	axisC = hkl_geometry_get_axis_by_name(g, "C");
 
-	hkl_axis_set_range_unit(axisA, -190, 190);
-	hkl_axis_set_range_unit(axisB, -190, 190);
-	hkl_axis_set_range_unit(axisC, -190, 190);
+	hkl_parameter_min_max_unit_set(axisA, -190, 190);
+	hkl_parameter_min_max_unit_set(axisB, -190, 190);
+	hkl_parameter_min_max_unit_set(axisC, -190, 190);
 
 	list = hkl_geometry_list_new();
 
@@ -257,18 +267,16 @@ HKL_TEST_SUITE_FUNC( list_multiply_from_range )
 
 	hkl_geometry_free(g);
 	hkl_geometry_list_free(list);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_FUNC( list_remove_invalid )
+static void  list_remove_invalid(void)
 {
 	HklGeometry *g;
 	HklGeometryList *list;
 	HklHolder *holder;
-	HklAxis *axisA, *axisB, *axisC;
+	HklParameter *axisA, *axisB, *axisC;
 
-	g = hkl_geometry_new();
+	g = hkl_geometry_new(NULL);
 	holder = hkl_geometry_add_holder(g);
 	hkl_holder_add_rotation_axis(holder, "A", 1., 0., 0.);
 	hkl_holder_add_rotation_axis(holder, "B", 1., 0., 0.);
@@ -278,9 +286,9 @@ HKL_TEST_SUITE_FUNC( list_remove_invalid )
 	axisB = hkl_geometry_get_axis_by_name(g, "B");
 	axisC = hkl_geometry_get_axis_by_name(g, "C");
 
-	hkl_axis_set_range_unit(axisA, -190., 180.);
-	hkl_axis_set_range_unit(axisB, -190., 180.);
-	hkl_axis_set_range_unit(axisC, -190., 180.);
+	hkl_parameter_min_max_unit_set(axisA, -100, 180.);
+	hkl_parameter_min_max_unit_set(axisB, -100., 180.);
+	hkl_parameter_min_max_unit_set(axisC, -100., 180.);
 
 	list = hkl_geometry_list_new();
 
@@ -302,27 +310,29 @@ HKL_TEST_SUITE_FUNC( list_remove_invalid )
 				  180.* HKL_DEGTORAD);
 	hkl_geometry_list_add(list, g);
 
-	HKL_ASSERT_EQUAL(3, HKL_LIST_LEN(list->items));
+	is_int(3, darray_size(list->items), __func__);
 	hkl_geometry_list_remove_invalid(list);
-	HKL_ASSERT_EQUAL(2, HKL_LIST_LEN(list->items));
+	is_int(2, darray_size(list->items), __func__);
 
 	hkl_geometry_free(g);
 	hkl_geometry_list_free(list);
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_BEGIN
+int main(int argc, char** argv)
+{
+	plan(32);
 
-HKL_TEST( add_holder );
-HKL_TEST( get_axis );
-HKL_TEST( update );
-HKL_TEST( set_values );
-HKL_TEST( distance );
-HKL_TEST( is_valid );
+	add_holder();
+	get_axis();
+	update();
+	set_values();
+	set_values_unit();
+	distance();
+	is_valid();
 
-HKL_TEST( list );
-HKL_TEST( list_multiply_from_range );
-HKL_TEST( list_remove_invalid );
+	list();
+	list_multiply_from_range();
+	list_remove_invalid();
 
-HKL_TEST_SUITE_END
+	return 0;
+}
diff --git a/test/hkl-test-interval.c b/tests/hkl-interval-t.c
similarity index 61%
rename from test/hkl-test-interval.c
rename to tests/hkl-interval-t.c
index decafa7..957a006 100644
--- a/test/hkl-test-interval.c
+++ b/tests/hkl-interval-t.c
@@ -13,102 +13,86 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#define _GNU_SOURCE
-#include <hkl.h>
 
-#include "hkl-test.h"
+#define _GNU_SOURCE
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
 
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME interval
+#include "hkl-interval-private.h"
 
-HKL_TEST_SUITE_FUNC(cmp)
+static void cmp(void)
 {
 	HklInterval interval_ref = {-1, 1};
 	HklInterval interval;
 
 	interval = interval_ref;
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&interval_ref, &interval));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&interval_ref, &interval), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(plus_interval)
+static void plus_interval(void)
 {
 	HklInterval i_ref = {-2, 8};
 	HklInterval i1 = {-1, 4};
 	HklInterval i2 = {-1, 4};
 
 	hkl_interval_plus_interval(&i1, &i2);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i1));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(plus_double)
+static void plus_double(void)
 {
 	HklInterval i_ref = {-1, 9};
 	HklInterval i1 = {-2, 8};
 
 	hkl_interval_plus_double(&i1, 1);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i1));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(times_interval)
+static void times_interval(void)
 {
 	HklInterval i_ref = {-9, 36};
 	HklInterval i1 = {-1, 9};
 	HklInterval i2 = {-1, 4};
 
 	hkl_interval_times_interval(&i1, &i2);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i1));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(times_double)
+static void times_double(void)
 {
 	HklInterval i_ref = {-108, 27};
 	HklInterval i1 = {-9, 36};
 
 	hkl_interval_times_double(&i1, -3);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i1));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(divides_double)
+static void divides_double(void)
 {
 	HklInterval i_ref = {-9, 36};
 	HklInterval i1 = {-108, 27};
 
 	hkl_interval_divides_double(&i1, -3);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i1));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i1), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(contain_zero)
+static void contain_zero(void)
 {
 	HklInterval i1 = {-9, 36};
 	HklInterval i2 = {-108, -27};
 
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_contain_zero(&i1));
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_interval_contain_zero(&i2));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_contain_zero(&i1), __func__);
+	ok(HKL_FALSE == hkl_interval_contain_zero(&i2), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(cos)
+static void cosinus(void)
 {
 	/* we will test all 16 cases. */
 	/* we devide the trigonometric circle in 4 from quaters */
@@ -121,19 +105,19 @@ HKL_TEST_SUITE_FUNC(cos)
 	double min;
 	double max;
 
-#define COS(a, b, min_ref, max_ref)  do {\
-	i.min = min = a * HKL_DEGTORAD;\
-	i.max = max = b * HKL_DEGTORAD;\
-	i_ref.min = min_ref;\
-	i_ref.max = max_ref;\
-	hkl_interval_cos(&i);\
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i));\
-} while(0)
+#define COS(a, b, min_ref, max_ref)  do {				\
+		i.min = min = a * HKL_DEGTORAD;				\
+		i.max = max = b * HKL_DEGTORAD;				\
+		i_ref.min = min_ref;					\
+		i_ref.max = max_ref;					\
+		hkl_interval_cos(&i);					\
+		ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
+	} while(0)
 
 	/* 1st max(0) */
 	/* min(0) */
 	COS(10, 14, cos(max), cos(min));
-	 /* min(3) */
+	/* min(3) */
 	COS(-15, 14,cos(min), 1);
 	/* min(2) */
 	COS(-95, 14, cos(min), 1);
@@ -174,22 +158,18 @@ HKL_TEST_SUITE_FUNC(cos)
 	COS(-100, -30, cos(min), cos(max));
 	/* min(1) */
 	COS(-190, -30, -1, cos(max));
+}
 
-	return HKL_TEST_PASS;
-	}
-
-HKL_TEST_SUITE_FUNC(acos)
+static void acosinus(void)
 {
 	HklInterval i_ref = {acos(.5), acos(-.5)};
 	HklInterval i = {-.5, .5};
 
 	hkl_interval_acos(&i);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(sin)
+static void sinus(void)
 {
 	/* we will test all 16 cases. */
 	/* we devide the trigonometric circle in 4 from quaters */
@@ -201,14 +181,14 @@ HKL_TEST_SUITE_FUNC(sin)
 	HklInterval i;
 	double min, max;
 
-#define SIN(a,b, min_ref, max_ref)  do {\
-	i.min = min = a *  HKL_DEGTORAD;\
-	i.max = max = b *  HKL_DEGTORAD;\
-	i_ref.min = min_ref;\
-	i_ref.max = max_ref;\
-	hkl_interval_sin(&i);\
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i));\
-} while(0)
+#define SIN(a,b, min_ref, max_ref)  do {				\
+		i.min = min = a *  HKL_DEGTORAD;			\
+		i.max = max = b *  HKL_DEGTORAD;			\
+		i_ref.min = min_ref;					\
+		i_ref.max = max_ref;					\
+		hkl_interval_sin(&i);					\
+		ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
+	} while(0)
 
 	/* 1st max(0) */
 	/*  min(0) */
@@ -257,35 +237,31 @@ HKL_TEST_SUITE_FUNC(sin)
 	SIN(-170, -30, -1, sin(min));
 	/* min(1); */
 	SIN(-190, -30, -1, sin(min));
+}
 
-	return HKL_TEST_PASS;
-	}
-
-HKL_TEST_SUITE_FUNC(asin)
+static void asinus(void)
 {
 	HklInterval i_ref = {asin(-.5), asin(.5)};
 	HklInterval i = {-.5, .5};
 
 	hkl_interval_asin(&i);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(tan)
+static void tangeante(void)
 {
 	HklInterval i;
 	HklInterval i_ref;
 	double min, max;
 
-#define TAN(a,b, min_ref, max_ref)  do {\
-	i.min = min = a *  HKL_DEGTORAD;\
-	i.max = max = b *  HKL_DEGTORAD;\
-	i_ref.min = min_ref;\
-	i_ref.max = max_ref;\
-	hkl_interval_tan(&i);\
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i));\
-} while(0)
+#define TAN(a,b, min_ref, max_ref)  do {				\
+		i.min = min = a *  HKL_DEGTORAD;			\
+		i.max = max = b *  HKL_DEGTORAD;			\
+		i_ref.min = min_ref;					\
+		i_ref.max = max_ref;					\
+		hkl_interval_tan(&i);					\
+		ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);	\
+	} while(0)
 
 	TAN(-100, -89, -INFINITY, INFINITY);
 
@@ -293,53 +269,50 @@ HKL_TEST_SUITE_FUNC(tan)
 	// The limit case is not yet ok
 	TAN(-100, 11, 12, -90);
 	r_ref.set(-hklconstantmathinfinity, tan(current), tan(consign), hklconstantmathinfinity);
-	HKL_ASSERT_EQUAL(r_ref, r);
+	ok(r_ref, r);
 	*/
+}
 
-	return HKL_TEST_PASS;
-	}
-
-HKL_TEST_SUITE_FUNC(atan)
+static void atangeante(void)
 {
 	HklInterval i_ref = {atan(-10.), atan(10)};
 	HklInterval i = {-10, 10};
 
 	hkl_interval_atan(&i);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_interval_cmp(&i_ref, &i));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_interval_cmp(&i_ref, &i), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(length)
+static void length(void)
 {
 	HklInterval interval;
 
 	interval.min = 10;
 	interval.max = 11;
-	HKL_ASSERT_DOUBLES_EQUAL(1, hkl_interval_length(&interval), HKL_EPSILON);
+	is_double(1., hkl_interval_length(&interval), HKL_EPSILON, __func__);
 
 	interval.min = -11;
 	interval.max = -10;
-	HKL_ASSERT_DOUBLES_EQUAL(1, hkl_interval_length(&interval), HKL_EPSILON);
-
-	return HKL_TEST_PASS;
+	is_double(1., hkl_interval_length(&interval), HKL_EPSILON, __func__);
 }
 
-HKL_TEST_SUITE_BEGIN
-
-HKL_TEST( cmp );
-HKL_TEST( plus_interval );
-HKL_TEST( plus_double );
-HKL_TEST( times_interval );
-HKL_TEST( times_double );
-HKL_TEST( divides_double );
-HKL_TEST( contain_zero );
-HKL_TEST( cos );
-HKL_TEST( acos );
-HKL_TEST( sin );
-HKL_TEST( asin );
-HKL_TEST( tan );
-HKL_TEST( atan );
-HKL_TEST( length );
-
-HKL_TEST_SUITE_END
+int main(int argc, char** argv)
+{
+	plan(59);
+
+	cmp();
+	plus_interval();
+	plus_double();
+	times_interval();
+	times_double();
+	divides_double();
+	contain_zero();
+	cosinus();
+	acosinus();
+	sinus();
+	asinus();
+	tangeante();
+	atangeante();
+	length();
+
+	return 0;
+}
diff --git a/tests/hkl-lattice-t.c b/tests/hkl-lattice-t.c
new file mode 100644
index 0000000..6c2a4d6
--- /dev/null
+++ b/tests/hkl-lattice-t.c
@@ -0,0 +1,228 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
+
+static void new(void)
+{
+	HklLattice *lattice;
+
+	/* can not set this lattice */
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90*HKL_DEGTORAD, 10*HKL_DEGTORAD, 120*HKL_DEGTORAD);
+	ok(NULL == lattice, __func__);
+
+	/* but can create this one */
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+	ok(0 == !lattice, __func__);
+
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_a_get(lattice)), HKL_EPSILON, __func__);
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_b_get(lattice)), HKL_EPSILON, __func__);
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_c_get(lattice)), HKL_EPSILON, __func__);
+	is_double(90*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(lattice)), HKL_EPSILON, __func__);
+	is_double(90*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(lattice)), HKL_EPSILON, __func__);
+	is_double(90*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(lattice)), HKL_EPSILON, __func__);
+	hkl_lattice_free(lattice);
+}
+
+static void  new_copy(void )
+{
+	HklLattice *lattice;
+	HklLattice *copy;
+
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+
+	/* copy constructor */
+	copy = hkl_lattice_new_copy(lattice);
+
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_a_get(copy)), HKL_EPSILON, __func__);
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_b_get(copy)), HKL_EPSILON, __func__);
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_c_get(copy)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(copy)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(copy)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(copy)), HKL_EPSILON, __func__);
+
+	hkl_lattice_free(lattice);
+	hkl_lattice_free(copy);
+}
+
+static void set(void)
+{
+	HklLattice *lattice;
+
+	/* can not set this lattice */
+	lattice = hkl_lattice_new_default();
+
+	/* but can create this one */
+	hkl_lattice_set(lattice, 1.54, 1.54, 1.54,
+			90*HKL_DEGTORAD, 91*HKL_DEGTORAD, 92*HKL_DEGTORAD);
+
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_a_get(lattice)), HKL_EPSILON, __func__);
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_b_get(lattice)), HKL_EPSILON, __func__);
+	is_double(1.54, hkl_parameter_value_get(hkl_lattice_c_get(lattice)), HKL_EPSILON, __func__);
+	is_double(90*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(lattice)), HKL_EPSILON, __func__);
+	is_double(91*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(lattice)), HKL_EPSILON, __func__);
+	is_double(92*HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(lattice)), HKL_EPSILON, __func__);
+	hkl_lattice_free(lattice);
+}
+
+static void  reciprocal(void )
+{
+	HklLattice *lattice;
+	HklLattice *reciprocal;
+
+	lattice = hkl_lattice_new_default();
+	reciprocal = hkl_lattice_new_default();
+
+	/* cubic */
+	hkl_lattice_set(lattice, 1.54, 1.54, 1.54,
+			90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+
+	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+
+	is_double(HKL_TAU / 1.54, hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU / 1.54, hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU / 1.54, hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+
+	/* orthorombic */
+	hkl_lattice_set(lattice, 1., 3., 4., 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
+	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+
+	is_double(HKL_TAU / 1., hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU / 3., hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU / 4., hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+
+	/* hexagonal1 */
+	hkl_lattice_set(lattice, 1., 2., 1., 90 * HKL_DEGTORAD, 120 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
+	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+
+	is_double(HKL_TAU * 2. / sqrt(3.), hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU / 2., hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU * 2. / sqrt(3.), hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(60. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+
+	/* hexagonal2 */
+	hkl_lattice_set(lattice, 2., 1., 1., 120 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
+	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+
+	is_double(HKL_TAU / 2., hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU * 2. / sqrt(3.), hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU * 2. / sqrt(3.), hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(60. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+
+	/* triclinic1 */
+	hkl_lattice_set(lattice, 9.32, 8.24, 13.78, 91.23 * HKL_DEGTORAD, 93.64 * HKL_DEGTORAD, 122.21 * HKL_DEGTORAD);
+	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+
+	is_double(HKL_TAU * 0.1273130168, hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU * 0.1437422974, hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU * 0.0728721120, hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(1.5052513337, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(1.482101482, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(1.0055896011, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+
+	/* triclinic2 */
+	hkl_lattice_set(lattice, 18.423, 18.417, 18.457, 89.99 * HKL_DEGTORAD, 89.963 * HKL_DEGTORAD, 119.99 * HKL_DEGTORAD);
+	ok(HKL_TRUE == hkl_lattice_reciprocal(lattice, reciprocal), __func__);
+
+	is_double(HKL_TAU * 0.0626708259, hkl_parameter_value_get(hkl_lattice_a_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU * 0.0626912310, hkl_parameter_value_get(hkl_lattice_b_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(HKL_TAU * 0.0541800061, hkl_parameter_value_get(hkl_lattice_c_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(1.5713705262, hkl_parameter_value_get(hkl_lattice_alpha_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(1.5716426508, hkl_parameter_value_get(hkl_lattice_beta_get(reciprocal)), HKL_EPSILON, __func__);
+	is_double(1.0473718249, hkl_parameter_value_get(hkl_lattice_gamma_get(reciprocal)), HKL_EPSILON, __func__);
+
+	hkl_lattice_free(lattice);
+	hkl_lattice_free(reciprocal);
+}
+
+static void  get_B(void )
+{
+	HklMatrix *B_ref = hkl_matrix_new_full(HKL_TAU / 1.54, 0, 0,
+					       0, HKL_TAU / 1.54, 0,
+					       0, 0, HKL_TAU / 1.54);
+	HklLattice *lattice;
+	HklMatrix *B = hkl_matrix_new();
+
+	/* cubic */
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
+
+	hkl_lattice_get_B(lattice, B);
+	ok(HKL_TRUE == hkl_matrix_cmp(B_ref, B), __func__);
+
+	hkl_lattice_free(lattice);
+	hkl_matrix_free(B);
+	hkl_matrix_free(B_ref);
+}
+
+static void  get_1_B(void )
+{
+	HklMatrix *I_ref = hkl_matrix_new_full(1, 0, 0,
+					       0, 1, 0,
+					       0, 0, 1);
+	HklLattice *lattice;
+	HklMatrix *I = hkl_matrix_new();
+	HklMatrix *B_1 = hkl_matrix_new();
+
+	/* cubic */
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD, 90 * HKL_DEGTORAD);
+
+	hkl_lattice_get_B(lattice, I);
+	hkl_lattice_get_1_B(lattice, B_1);
+
+	/* B times B^-1 = Identity */
+	hkl_matrix_times_matrix(I, B_1);
+	ok(HKL_TRUE == hkl_matrix_cmp(I_ref, I), __func__);
+
+	hkl_lattice_free(lattice);
+	hkl_matrix_free(B_1);
+	hkl_matrix_free(I);
+	hkl_matrix_free(I_ref);
+}
+
+int main(int argc, char** argv)
+{
+	plan(64);
+
+	new();
+	new_copy();
+	set();
+	reciprocal();
+	get_B();
+	get_1_B();
+
+	return 0;
+}
diff --git a/tests/hkl-matrix-t.c b/tests/hkl-matrix-t.c
new file mode 100644
index 0000000..8ef01bb
--- /dev/null
+++ b/tests/hkl-matrix-t.c
@@ -0,0 +1,153 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
+
+#include "hkl-matrix-private.h" /* we will check also the private API */
+
+static void init(void)
+{
+	HklMatrix m;
+
+	hkl_matrix_init(&m, 1, 1, 0, 0, 1, 0, 0, 0, 1);
+	is_double(1., m.data[0][0], HKL_EPSILON, __func__);
+	is_double(1., m.data[0][1], HKL_EPSILON, __func__);
+	is_double(0., m.data[0][2], HKL_EPSILON, __func__);
+	is_double(0., m.data[1][0], HKL_EPSILON, __func__);
+	is_double(1., m.data[1][1], HKL_EPSILON, __func__);
+	is_double(0., m.data[1][2], HKL_EPSILON, __func__);
+	is_double(0., m.data[2][0], HKL_EPSILON, __func__);
+	is_double(0., m.data[2][1], HKL_EPSILON, __func__);
+	is_double(1., m.data[2][2], HKL_EPSILON, __func__);
+}
+
+static void cmp(void)
+{
+	HklMatrix m1 = {{{0.0, 1.0, 2.0},
+			 {3.0, 4.0, 5.0},
+			 {6.0, 7.0, 8.0}}};
+
+	HklMatrix m2 = {{{1.0, 1.0, 2.0},
+			 {3.0, 4.0, 5.0},
+			 {6.0, 7.0, 8.0}}};
+
+	ok(HKL_TRUE == hkl_matrix_cmp(&m1, &m1), __func__);
+	ok(HKL_FALSE == hkl_matrix_cmp(&m1, &m2), __func__);
+}
+
+static void assignement(void)
+{
+	HklMatrix m1 = {{{0.0, 1.0, 2.0},
+			 {3.0, 4.0, 5.0},
+			 {6.0, 7.0, 8.0}}};
+	HklMatrix m;
+
+	m = m1;
+	ok(HKL_TRUE == hkl_matrix_cmp(&m1, &m), __func__);
+}
+
+static void init_from_euler(void)
+{
+	HklMatrix m_ref = {{{             1./2.,             -1./2., sqrt(2)/2.},
+			    { sqrt(2.)/4.+1./2., -sqrt(2.)/4.+1./2.,     -1./2.},
+			    {-sqrt(2.)/4.+1./2.,  sqrt(2.)/4.+1./2.,      1./2.}}};
+	HklMatrix m;
+
+	hkl_matrix_init_from_euler(&m, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD);
+	ok(HKL_TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
+}
+
+static void init_from_two_vector(void)
+{
+	HklVector v1 = {{0.0, 1.0, 2.0}};
+	HklVector v2 = {{1.0, 2.0, 3.0}};
+	HklMatrix m_ref = {{{0.0,             5.0 / sqrt(30.0), -1.0 / sqrt(6.0)},
+			    {1.0 / sqrt(5.0), 2.0 / sqrt(30.0),  2.0 / sqrt(6.0)},
+			    {2.0 / sqrt(5.0),-1.0 / sqrt(30.0), -1.0 / sqrt(6.0)}}
+	};
+	HklMatrix m;
+
+	hkl_matrix_init_from_two_vector(&m, &v1, &v2);
+	ok(HKL_TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
+}
+
+static void times_vector(void)
+{
+	HklMatrix m = {{{ 1.0, 3.0,-2.0},
+			{10.0, 5.0, 5.0},
+			{-3.0, 2.0, 0.0}}
+	};
+	HklVector v = {{1, 2, 3}};
+	HklVector v_ref = {{1, 35, 1}};
+
+	hkl_matrix_times_vector(&m, &v);
+	ok(0 == hkl_vector_cmp(&v_ref, &v), __func__);
+}
+
+static void times_matrix(void)
+{
+	HklMatrix m_ref = {{{37., 14., 13.},
+			    {45., 65.,  5.},
+			    {17.,  1., 16.}}
+	};
+
+	HklMatrix m = {{{ 1., 3.,-2.},
+			{10., 5., 5.},
+			{-3., 2., 0.}}
+	};
+
+	hkl_matrix_times_matrix(&m, &m);
+	ok(HKL_TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
+}
+
+static void transpose(void)
+{
+	HklMatrix m_ref = {{{37., 14., 13.},
+			    {45., 65.,  5.},
+			    {17.,  1., 16.}}
+	};
+
+	HklMatrix m = {{{37., 45., 17.},
+			{14., 65.,  1.},
+			{13.,  5., 16.}}
+	};
+
+	hkl_matrix_transpose(&m);
+	ok(HKL_TRUE == hkl_matrix_cmp(&m_ref, &m), __func__);
+}
+
+int main(int argc, char** argv)
+{
+	plan(17);
+
+	init();
+	cmp();
+	assignement();
+	init_from_euler();
+	init_from_two_vector();
+	times_vector();
+	times_matrix();
+	transpose();
+
+	return 0;
+}
diff --git a/tests/hkl-parameter-t.c b/tests/hkl-parameter-t.c
new file mode 100644
index 0000000..332bb7f
--- /dev/null
+++ b/tests/hkl-parameter-t.c
@@ -0,0 +1,139 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
+
+#include "hkl-parameter-private.h"
+
+static void new(void)
+{
+	HklParameter *p;
+
+	ok(NULL == hkl_parameter_new("", 2, 1, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
+	ok(NULL == hkl_parameter_new("", 2, 1, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
+	ok(NULL == hkl_parameter_new("", 2, 1, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
+	ok(NULL == hkl_parameter_new("toto", 2, 1, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
+
+	ok(NULL == hkl_parameter_new("toto", 1, 2, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_length_nm), __func__);
+
+	p = hkl_parameter_new("toto", 1, 2, 3,
+			      HKL_FALSE, HKL_TRUE,
+			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+	ok(0 == !p, __func__);
+	is_double(1., p->range.min, HKL_EPSILON, __func__);
+	is_double(2., p->_value, HKL_EPSILON, __func__);
+	is_double(3., p->range.max, HKL_EPSILON, __func__);
+	ok(HKL_FALSE == p->fit, __func__);
+	ok(HKL_TRUE == p->changed, __func__);
+	ok(&hkl_unit_angle_rad == p->unit, __func__);
+	ok(&hkl_unit_angle_deg == p->punit, __func__);
+
+	hkl_parameter_free(p);
+}
+
+static void new_copy(void)
+{
+	HklParameter *copy, *p;
+
+	p = hkl_parameter_new("toto", 1, 2, 3,
+			      HKL_FALSE, HKL_TRUE,
+			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+
+	copy = hkl_parameter_new_copy(p);
+
+	ok(copy->name == p->name, __func__);
+	is_double(copy->range.min, p->range.min, HKL_EPSILON, __func__);
+	is_double(copy->_value, p->_value, HKL_EPSILON, __func__);
+	is_double(copy->range.max, p->range.max, HKL_EPSILON, __func__);
+	ok(copy->fit == p->fit, __func__);
+	ok(copy->changed == p->changed, __func__);
+	ok(&hkl_unit_angle_rad == copy->unit, __func__);
+	ok(&hkl_unit_angle_deg == copy->punit, __func__);
+
+	hkl_parameter_free(copy);
+	hkl_parameter_free(p);
+}
+
+static void init(void)
+{
+	HklParameter *p;
+
+	ok(NULL == hkl_parameter_new("", 2, 1, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
+	ok(NULL == hkl_parameter_new("", 2, 1, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
+	ok(NULL == hkl_parameter_new("", 2, 1, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
+	ok(NULL == hkl_parameter_new("toto", 2, 1, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_angle_deg), __func__);
+	ok(NULL == hkl_parameter_new("toto", 1, 2, 3,
+				     HKL_FALSE, HKL_TRUE,
+				     &hkl_unit_angle_rad, &hkl_unit_length_nm), __func__);
+	p = hkl_parameter_new("toto", 1, 2, 3,
+			      HKL_FALSE, HKL_TRUE,
+			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+	ok(NULL != p, __func__);
+
+	hkl_parameter_free(p);
+}
+
+static void is_valid(void)
+{
+	HklParameter *p;
+
+	p = hkl_parameter_new("toto", 1, 2, 3,
+			      HKL_FALSE, HKL_TRUE,
+			      &hkl_unit_angle_rad, &hkl_unit_angle_deg);
+	ok(HKL_TRUE == hkl_parameter_is_valid(p), __func__);
+
+	hkl_parameter_value_set(p, 10, NULL);
+	ok(HKL_FALSE == hkl_parameter_is_valid(p), __func__);
+
+	hkl_parameter_free(p);
+}
+
+int main(int argc, char** argv)
+{
+	plan(29);
+
+	new();
+	new_copy();
+	init();
+	is_valid();
+
+	return 0;
+}
diff --git a/tests/hkl-pseudoaxis-e4ch-t.c b/tests/hkl-pseudoaxis-e4ch-t.c
new file mode 100644
index 0000000..fdee7b4
--- /dev/null
+++ b/tests/hkl-pseudoaxis-e4ch-t.c
@@ -0,0 +1,426 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *          Jens Krüger <jens.krueger at frm.tum.de>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/hkl-tap.h>
+
+static void getter(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+
+	factory = hkl_factory_get_by_name("E4CH");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+
+	/* geometry -> pseudo */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 0., 1., 0.);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 1., 0., 0.);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., -90., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, -1., 0., 0.);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 180., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 0., -1., 0.);
+
+	hkl_geometry_set_values_unit_v(geometry, 45., 0., 135., 90.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 1., -1., 0.);
+
+	ok(res == HKL_TRUE, "getter");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void degenerated(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("E4CH");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	darray_foreach(mode, *modes){
+		static double values[] = {0, 0, 1};
+		darray_parameter *parameters;
+
+		hkl_engine_select_mode(engine, *mode);
+		parameters = hkl_mode_parameters(*mode);
+		if (darray_size(*parameters))
+			hkl_parameter_value_set(darray_item(*parameters, 0), 0, NULL);
+
+		/* studdy this degenerated case */
+		hkl_parameter_list_values_set(pseudo_axes, values, 3, NULL);
+		if(hkl_engine_set(engine, NULL)){
+			const darray_item *items = hkl_geometry_list_items_get(geometries);
+			HklGeometryListItem **item;
+
+			darray_foreach(item, *items){
+				static double null[] = {0, 0, 0};
+
+				hkl_parameter_list_values_set(pseudo_axes, null, 3, NULL);
+				hkl_geometry_set(geometry,
+						 hkl_geometry_list_item_geometry_get(*item));
+				hkl_engine_get(engine, NULL);
+				res &= check_pseudoaxes(engine, values, 3);
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "degenerated");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void psi_getter(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+	double hkl[3];
+	HklMode *mode;
+	HklParameterList *parameters;
+
+	factory = hkl_factory_get_by_name("E4CH");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+
+	engine = hkl_engine_list_get_by_name(engines, "psi");
+	mode = hkl_engine_mode(engine);
+	parameters = hkl_mode_parameters(mode);
+
+	/* the getter part */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_engine_initialize(engine, NULL);
+
+	hkl[0] = 1, hkl[1] = 0, hkl[2] = 0;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 0.);
+
+	/* here Q and <h, k, l>_ref are colinear must FAIL */
+	hkl[0] = 0, hkl[1] = 1, hkl[2] = 0;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= !hkl_engine_get(engine, NULL);
+
+	hkl[0] = -1, hkl[1] = 0, hkl[2] = 0;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 180. * HKL_DEGTORAD);
+
+	hkl[0] = 0, hkl[1] = 0, hkl[2] = -1;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 90. * HKL_DEGTORAD);
+
+	/* Q and <h, k, l>_ref are colinear so must FAIL */
+	hkl[0] = 0, hkl[1] = -1, hkl[2] = 0;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= !hkl_engine_get(engine, NULL);
+
+	ok(res == HKL_TRUE, "psi getter");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void psi_setter(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	static double hkl[] = {1, 0, 0};
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("E4CH");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "psi");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_parameter_list_values_set(hkl_mode_parameters(hkl_engine_mode(engine)),
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	hkl_engine_initialize(engine, NULL);
+
+	darray_foreach(mode, *modes){
+		double psi;
+
+		hkl_engine_select_mode(engine, *mode);
+		for(psi=-180 * HKL_DEGTORAD;psi<180 * HKL_DEGTORAD;psi += HKL_DEGTORAD){
+			hkl_parameter_list_values_set(pseudo_axes, &psi, 1, NULL);
+			if(hkl_engine_set(engine, NULL)){
+				const darray_item *items = hkl_geometry_list_items_get(geometries);
+				HklGeometryListItem **item;
+
+				darray_foreach(item, *items){
+					static double null[] = {0};
+
+					hkl_parameter_list_values_set(pseudo_axes,
+								      null, ARRAY_SIZE(null),
+								      NULL);
+					hkl_geometry_set(geometry,
+							 hkl_geometry_list_item_geometry_get(*item));
+					hkl_engine_get(engine, NULL);
+					res &= check_pseudoaxes_v(engine, psi);
+				}
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "psi setter");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+
+static void q(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("E4CH");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "q");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_engine_initialize(engine, NULL);
+
+	darray_foreach(mode, *modes){
+		double q;
+
+		hkl_engine_select_mode(engine, *mode);
+		for(q=-1.; q<1.; q += 0.1){
+			hkl_parameter_list_values_set(pseudo_axes, &q, 1, NULL);
+
+			if(hkl_engine_set(engine, NULL)){
+				const darray_item *items = hkl_geometry_list_items_get(geometries);
+				HklGeometryListItem **item;
+
+				darray_foreach(item, *items){
+					static double null[] = {0};
+					hkl_parameter_list_values_set(pseudo_axes,
+								      null, ARRAY_SIZE(null),
+								      NULL);
+
+					hkl_geometry_set(geometry,
+							 hkl_geometry_list_item_geometry_get(*item));
+					hkl_engine_get(engine, NULL);
+					res &= check_pseudoaxes(engine, &q, 1);
+				}
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "q");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void hkl_psi_constant_horizontal(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode *mode;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	static double hkl[] = {1, 0, 1};
+	static double hkl2[] = {1, 1, 0};
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("E4CH");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	mode = hkl_engine_mode(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	hkl_engine_select_mode_by_name(engine,
+				       "psi_constant");
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      hkl2, ARRAY_SIZE(hkl2), NULL);
+	hkl_engine_initialize(engine, NULL);
+
+	hkl_parameter_list_values_set(pseudo_axes,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	if(hkl_engine_set(engine, NULL)){
+		const darray_item *items = hkl_geometry_list_items_get(geometries);
+		HklGeometryListItem **item;
+
+		darray_foreach(item, *items){
+			static double null[] = {0, 0, 0};
+
+			hkl_parameter_list_values_set(pseudo_axes,
+						      null, ARRAY_SIZE(null),
+						      NULL);
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(*item));
+			hkl_engine_get(engine, NULL);
+			res &= check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl));
+		}
+	}
+
+	ok(res == HKL_TRUE, "psi constant horizontal");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+int main(int argc, char** argv)
+{
+	plan(6);
+
+	getter();
+	degenerated();
+	psi_getter();
+	psi_setter();
+	q();
+	hkl_psi_constant_horizontal();
+
+	return 0;
+}
diff --git a/tests/hkl-pseudoaxis-e4cv-t.c b/tests/hkl-pseudoaxis-e4cv-t.c
new file mode 100644
index 0000000..ad51cf8
--- /dev/null
+++ b/tests/hkl-pseudoaxis-e4cv-t.c
@@ -0,0 +1,428 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/hkl-tap.h>
+
+static void getter(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	const HklFactory *factory;
+	HklGeometry *geom;
+	HklDetector *detector;
+	HklSample *sample;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geom = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geom, detector, sample);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+
+	/* geometry -> pseudo */
+	hkl_geometry_set_values_unit_v(geom, 30., 0., 0., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 0., 0., 1.);
+
+	hkl_geometry_set_values_unit_v(geom, 30., 0., 90., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 1., 0., 0.);
+
+	hkl_geometry_set_values_unit_v(geom, 30., 0., -90., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, -1., 0., 0.);
+
+	hkl_geometry_set_values_unit_v(geom, 30., 0., 180., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 0., 0., -1.);
+
+	hkl_geometry_set_values_unit_v(geom, 45., 0., 135., 90.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 1., 0., -1.);
+
+	ok(res == HKL_TRUE, "getter");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geom);
+}
+
+static void degenerated(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+	const HklGeometryList *geometries;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	modes = hkl_engine_modes(engine);
+
+	darray_foreach(mode, *modes){
+		static double values[] = {0, 0, 1};
+		HklParameterList *pseudo_axes = hkl_engine_pseudo_axes(engine);
+		darray_parameter *parameters = hkl_mode_parameters(*mode);
+
+		hkl_engine_select_mode(engine, *mode);
+		if (darray_size(*parameters))
+			hkl_parameter_value_set(darray_item(*parameters, 0), 0, NULL);
+
+		/* studdy this degenerated case */
+		hkl_parameter_list_values_set(pseudo_axes, values, 3, NULL);
+
+		if(hkl_engine_set(engine, NULL)){
+			const darray_item *items = hkl_geometry_list_items_get(geometries);
+			HklGeometryListItem **item;
+
+			darray_foreach(item, *items){
+				static double null[] = {0, 0, 0};
+
+				hkl_parameter_list_values_set(pseudo_axes, null, 3, NULL);
+				hkl_geometry_set(geometry,
+						 hkl_geometry_list_item_geometry_get(*item));
+				hkl_engine_get(engine, NULL);
+				res &= check_pseudoaxes(engine, values, 3);
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "degenerated");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void psi_getter(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode *mode;
+	HklParameterList *parameters;
+	const HklFactory *factory;
+	HklGeometry *geom;
+	HklDetector *detector;
+	HklSample *sample;
+	double hkl[3];
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geom = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geom, detector, sample);
+
+	engine = hkl_engine_list_get_by_name(engines, "psi");
+	mode = hkl_engine_mode(engine);
+	parameters = hkl_mode_parameters(mode);
+
+	/* the getter part */
+	hkl_geometry_set_values_unit_v(geom, 30., 0., 0., 60.);
+	hkl_engine_initialize(engine, NULL);
+
+	hkl[0] = 1, hkl[1] = 0, hkl[2] = 0;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 0.);
+
+	hkl[0] = 0, hkl[1] = 1, hkl[2] = 0;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 90. * HKL_DEGTORAD);
+
+	/* here Q and <h, k, l>_ref are colinear must FAIL */
+	hkl[0] = 0, hkl[1] = 0, hkl[2] = 1;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= !hkl_engine_get(engine, NULL);
+
+	hkl[0] = -1, hkl[1] = 0, hkl[2] = 0;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 180. * HKL_DEGTORAD);
+
+	hkl[0] = 0, hkl[1] = -1, hkl[2] = 0;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, -90. * HKL_DEGTORAD);
+
+	/* Q and <h, k, l>_ref are colinear so must FAIL */
+	hkl[0] = 0, hkl[1] = 0, hkl[2] = -1;
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	res &= !hkl_engine_get(engine, NULL);
+
+	ok(res == HKL_TRUE, "psi getter");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geom);
+}
+
+static void psi_setter(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklParameterList *pseudo_axes;
+	HklMode **mode;
+	darray_mode *modes;
+	HklParameterList *parameters;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+	static double hkl[] = {1, 0, 0};
+	const HklGeometryList *geometries;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "psi");
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+	modes = hkl_engine_modes(engine);
+	parameters = hkl_mode_parameters(hkl_engine_mode(engine));
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_parameter_list_values_set(parameters,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	hkl_engine_initialize(engine, NULL);
+
+	darray_foreach(mode, *modes){
+		double psi;
+
+		hkl_engine_select_mode(engine, *mode);
+		for(psi=-180 * HKL_DEGTORAD;psi<180 * HKL_DEGTORAD;psi += HKL_DEGTORAD){
+			hkl_parameter_list_values_set(pseudo_axes, &psi, 1, NULL);
+			if(hkl_engine_set(engine, NULL)){
+				const darray_item *items = hkl_geometry_list_items_get(geometries);
+				HklGeometryListItem **item;
+
+				darray_foreach(item, *items){
+					static double null[] = {0};
+
+					hkl_parameter_list_values_set(pseudo_axes, null, 1, NULL);
+					hkl_geometry_set(geometry,
+							 hkl_geometry_list_item_geometry_get(*item));
+					hkl_engine_get(engine, NULL);
+					res &= check_pseudoaxes_v(engine, psi);
+				}
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "psi setter");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void q(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+	const HklGeometryList *geometries;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "q");
+	modes = hkl_engine_modes(engine);
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_engine_initialize(engine, NULL);
+
+	darray_foreach(mode, *modes){
+		double q;
+		HklParameterList *pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+		hkl_engine_select_mode(engine, *mode);
+		for(q=-1.; q<1.; q += 0.1){
+			hkl_parameter_list_values_set(pseudo_axes, &q, 1, NULL);
+			if(hkl_engine_set(engine, NULL)){
+				const darray_item *items = hkl_geometry_list_items_get(geometries);
+				HklGeometryListItem **item;
+
+				darray_foreach(item, *items){
+					static double null[] = {0};
+
+					hkl_parameter_list_values_set(pseudo_axes, null, 1, NULL);
+					hkl_geometry_set(geometry,
+							 hkl_geometry_list_item_geometry_get(*item));
+					hkl_engine_get(engine, NULL);
+					res &= check_pseudoaxes(engine, &q, 1);
+				}
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "q");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void hkl_psi_constant_vertical(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	static double hkl[] = {1, 0, 1};
+	static double hkl2[] = {1, 1, 0};
+	HklParameterList *pseudo_axes;
+	HklMode *mode;
+	HklParameterList *parameters;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	hkl_engine_select_mode_by_name(engine,
+				       "psi_constant");
+
+	mode = hkl_engine_mode(engine);
+	parameters = hkl_mode_parameters(mode);
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_parameter_list_values_set(parameters,
+				      hkl2, ARRAY_SIZE(hkl2), NULL);
+	hkl_engine_initialize(engine, NULL);
+
+	hkl_parameter_list_values_set(pseudo_axes,
+				      hkl, ARRAY_SIZE(hkl), NULL);
+	if(hkl_engine_set(engine, NULL)){
+		const darray_item *items = hkl_geometry_list_items_get(geometries);
+		HklGeometryListItem **item;
+
+		darray_foreach(item, *items){
+			static double null[] = {0, 0, 0};
+
+			hkl_parameter_list_values_set(pseudo_axes,
+						      null, ARRAY_SIZE(null),
+						      NULL);
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(*item));
+			hkl_engine_get(engine, NULL);
+			res &= check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl));
+		}
+	}
+
+	ok(res == HKL_TRUE, "psi constant vertical");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+int main(int argc, char** argv)
+{
+	plan(6);
+
+	getter();
+	degenerated();
+	psi_getter();
+	psi_setter();
+	q();
+	hkl_psi_constant_vertical();
+
+	return 0;
+}
diff --git a/tests/hkl-pseudoaxis-e6c-t.c b/tests/hkl-pseudoaxis-e6c-t.c
new file mode 100644
index 0000000..6abe411
--- /dev/null
+++ b/tests/hkl-pseudoaxis-e6c-t.c
@@ -0,0 +1,543 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/hkl-tap.h>
+
+#include "hkl-axis-private.h" /* temporary */
+
+#define CHECK_AXIS_VALUE(axis, value) fabs((value) - hkl_parameter_value_get(axis)) < HKL_EPSILON
+
+
+static int hkl_geometry_list_check_geometry_unit(const HklGeometryList *self,
+						 double mu,
+						 double omega,
+						 double chi,
+						 double phi,
+						 double gamma,
+						 double delta)
+{
+	const darray_item *items = hkl_geometry_list_items_get(self);
+	HklGeometryListItem **item;
+	int res = HKL_TRUE;
+
+	darray_foreach(item, *items){
+		const darray_parameter *axes = hkl_geometry_axes_get(hkl_geometry_list_item_geometry_get(*item));
+
+		res = HKL_TRUE;
+		res &= CHECK_AXIS_VALUE(darray_item(*axes, 0), mu * HKL_DEGTORAD);
+		res &= CHECK_AXIS_VALUE(darray_item(*axes, 1), omega * HKL_DEGTORAD);
+		res &= CHECK_AXIS_VALUE(darray_item(*axes, 2), chi * HKL_DEGTORAD);
+		res &= CHECK_AXIS_VALUE(darray_item(*axes, 3), phi * HKL_DEGTORAD);
+		res &= CHECK_AXIS_VALUE(darray_item(*axes, 4), gamma * HKL_DEGTORAD);
+		res &= CHECK_AXIS_VALUE(darray_item(*axes, 5), delta * HKL_DEGTORAD);
+
+		if (res)
+			break;
+	}
+	return res;
+}
+
+static void getter(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+
+	factory = hkl_factory_get_by_name("E6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+
+	/* geometry -> pseudo */
+	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 0., 0., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 0., 0., 1.);
+
+	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 90., 0., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 1., 0., 0.);
+
+	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., -90., 0., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, -1., 0., 0.);
+
+	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 180., 0., 60.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 0., 0., -1.);
+
+	hkl_geometry_set_values_unit_v(geometry, 0., 45., 0., 135., 0., 90.);
+	hkl_engine_get(engine, NULL);
+	res &= check_pseudoaxes_v(engine, 1., 0., -1.);
+
+	ok(res == HKL_TRUE, "getter");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void degenerated(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	static double hkl[] = {0, 0, 1};
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("E6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	darray_foreach(mode, *modes) {
+		darray_parameter *parameters;
+
+		hkl_engine_select_mode(engine, *mode);
+		parameters = hkl_mode_parameters(*mode);
+		if (darray_size(*parameters))
+			hkl_parameter_value_set(darray_item(*parameters, 0), 0, NULL);
+
+		/* studdy this degenerated case */
+		hkl_parameter_list_values_set(pseudo_axes,
+					      hkl, ARRAY_SIZE(hkl),
+					      NULL);
+		if (hkl_engine_set(engine, NULL)){
+			const darray_item *items = hkl_geometry_list_items_get(geometries);
+			HklGeometryListItem **item;
+
+			darray_foreach(item, *items) {
+				static double null[] = {0, 0, 0};
+
+				hkl_parameter_list_values_set(pseudo_axes,
+							      null, ARRAY_SIZE(null),
+							      NULL);
+				hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
+				hkl_engine_get(engine, NULL);
+				res &= check_pseudoaxes(engine, hkl, 3);
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "degenerated");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void q2(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("E6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "q2");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 0., 0., 60.);
+	hkl_engine_initialize(engine, NULL);
+
+
+	darray_foreach(mode, *modes){
+		double q, alpha;
+
+		hkl_engine_select_mode(engine, *mode);
+		for(q=0.1; q<1.; q += 0.1)
+			for(alpha = -M_PI; alpha<M_PI; alpha += M_PI/180.){
+				double values[] = {q, alpha};
+
+				hkl_parameter_list_values_set(pseudo_axes,
+							      values, ARRAY_SIZE(values),
+							      NULL);
+				if(hkl_engine_set(engine, NULL)){
+					const darray_item *items = hkl_geometry_list_items_get(geometries);
+					HklGeometryListItem **item;
+
+					darray_foreach(item, *items){
+						static double null[] = {0, 0};
+
+						hkl_parameter_list_values_set(pseudo_axes,
+									      null, ARRAY_SIZE(null),
+									      NULL);
+						hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
+						hkl_engine_get(engine, NULL);
+						res &= check_pseudoaxes(engine, values, 2);
+					}
+				}
+			}
+	}
+
+	ok(res == HKL_TRUE, "q2");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void petra3(void)
+{
+	static double values[] = {1, 1, 0};
+	static double parameters[] = {0, 0, 1, 90 * HKL_DEGTORAD};
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *hkl;
+	HklEngine *psi;
+	HklMode *mode;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	HklLattice *lattice;
+	HklMatrix *U;
+
+	factory = hkl_factory_get_by_name("E6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	hkl_geometry_wavelength_set(geometry, 2.033);
+
+	sample = hkl_sample_new("test");
+	lattice = hkl_lattice_new(7.813, 7.813, 7.813,
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+	hkl_sample_lattice_set(sample, lattice);
+	hkl_lattice_free(lattice);
+
+	U = hkl_matrix_new_euler(-112.5 * HKL_DEGTORAD,
+				 -87.84 * HKL_DEGTORAD,
+				 157.48 * HKL_DEGTORAD);
+	hkl_sample_U_set(sample, U);
+	hkl_matrix_free(U);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	/* set the hkl pseudo axis in psi_constant_vertical */
+	hkl = hkl_engine_list_get_by_name(engines, "hkl");
+	hkl_engine_select_mode_by_name(hkl, "psi_constant_vertical");
+	hkl_engine_set_values_v(hkl, 1, 1, 0);
+	/* set the mode parameters 0, 0, 1, 90. */
+	mode = hkl_engine_mode(hkl);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      parameters, ARRAY_SIZE(parameters),
+				      NULL);
+
+	/* set the psi pseudo axis */
+	psi = hkl_engine_list_get_by_name(engines, "psi");
+	hkl_engine_select_mode_by_name(psi, "psi_constant_vertical");
+	/* set the mode parameters 0, 0, 1 */
+	mode = hkl_engine_mode(psi);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      parameters, ARRAY_SIZE(parameters), NULL);
+
+	/* Compute the hkl [1, 1, 0] in psi_constant_vertical mode with */
+	/* h2,k2,l2= [0, 0,1] and psi = 90 */
+	if(hkl_engine_set(hkl, NULL)){
+		const darray_item *items = hkl_geometry_list_items_get(geometries);
+		HklGeometryListItem **item;
+		darray_parameter *pseudo_axes = hkl_engine_pseudo_axes(psi);
+
+		darray_foreach(item, *items) {
+			double PSI = parameters[3];
+
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(*item));
+			hkl_engine_initialize(psi, NULL);
+			hkl_engine_list_get(engines);
+			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		}
+	}
+
+	ok(res == HKL_TRUE, "petra3");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+/* Problem observed with the psi_constant_vertical mode */
+static void petra3_2(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *hkl;
+	HklEngine *psi;
+	HklMode *mode;
+	const HklFactory *factory;
+	const darray_item *items;
+	HklGeometryListItem **item;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	HklLattice *lattice;
+	HklMatrix *U;
+	double PSI;
+	double parameters[4];
+	darray_parameter *pseudo_axes;
+
+	/* Wavelength 1.0332035 */
+	/* Mode       psi_constant_vertical */
+	/* UB11  0.000 UB12  1.232 UB13  0.000  */
+	/* UB21  0.000 UB22 -0.000 UB23  1.232  */
+	/* UB31  1.232 UB32 -0.000 UB33 -0.000  */
+	/* Ux -90 Uy 6.84979352816457e-15 Uz -90  */
+	/* A 5.1 B 5.1 C 5.1  */
+	/* Alpha 90 Beta 90 Gamma 90  */
+
+	factory = hkl_factory_get_by_name("E6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	hkl_geometry_wavelength_set(geometry, 1.0332035);
+
+	sample = hkl_sample_new("test");
+	lattice = hkl_lattice_new(5.1, 5.1, 5.1,
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD, 90*HKL_DEGTORAD);
+	hkl_sample_lattice_set(sample, lattice);
+	hkl_lattice_free(lattice);
+	U = hkl_matrix_new_euler(-90.0 * HKL_DEGTORAD,
+				 0.0 * HKL_DEGTORAD,
+				 -90.0 * HKL_DEGTORAD);
+	hkl_sample_U_set(sample, U);
+	hkl_matrix_free(U);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+	items = hkl_geometry_list_items_get(geometries);
+
+	/* set the hkl pseudo axis in psi_constant_vertical */
+	hkl = hkl_engine_list_get_by_name(engines, "hkl");
+	hkl_engine_select_mode_by_name(hkl, "psi_constant_vertical");
+	/* set the psi pseudo engine to read the psi value */
+	psi = hkl_engine_list_get_by_name(engines, "psi");
+	pseudo_axes = hkl_engine_pseudo_axes(psi);
+
+	/* PsiRef 0 1 0 */
+	/* freeze 0; ca 0 0 2 */
+	/* for hkl */
+	parameters[0] = 0;
+	parameters[1] = 1;
+	parameters[2] = 0;
+	parameters[3] = PSI = 0;
+	mode = hkl_engine_mode(hkl);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      parameters, ARRAY_SIZE(parameters),
+				      NULL);
+	/* for psi */
+	mode = hkl_engine_mode(psi);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      parameters, ARRAY_SIZE(parameters),
+				      NULL);
+
+	/* freeze 0; ca 0 0 2 */
+	hkl_engine_set_values_v(hkl, 0., 0., 2.);
+
+	/*      del              th               chi              phi */
+	/*      23.37668         11.68835         90               -90 */
+	/*      gamma            mu */
+	/*      -2.384186e-09    -1.182388e-14 */
+	/* the -90 value of phi is problematic, the right value is 0 */
+	if(hkl_engine_set(hkl, NULL)){
+		res &= hkl_geometry_list_check_geometry_unit(
+			geometries,
+			0., 11.688393153063114, 90., 0., 0.,  23.376786185344031);
+
+		/* check that all solution gives the right psi */
+		darray_foreach(item, *items) {
+			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
+			hkl_engine_initialize(psi, NULL);
+			hkl_engine_list_get(engines);
+			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		}
+	}
+
+	/* freeze 45; ca 0 0 2 */
+	parameters[3] = PSI = 45.0 * HKL_DEGTORAD;
+	mode = hkl_engine_mode(hkl);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      parameters, ARRAY_SIZE(parameters), NULL);
+	hkl_engine_set_values_v(hkl, 0., 0., 2.);
+
+	/*      del              th               chi              phi */
+	/*      23.3768          11.68831         90               -135 */
+	/*      gamma            mu */
+	/*      -2.384186e-09    -1.182388e-14 */
+	/* -135 n'est pas bon il faudrait plutôt -45 */
+	if(hkl_engine_set(hkl, NULL)){
+		res &= hkl_geometry_list_check_geometry_unit(
+			geometries,
+			0., 11.688393153063114, 90., -45., 0.,  23.376786185344031);
+
+		/* check that all solution gives the right psi */
+		darray_foreach(item, *items) {
+			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
+			hkl_engine_initialize(psi, NULL);
+			hkl_engine_list_get(engines);
+			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		}
+	}
+
+	/* PsiRef 1 1 0 */
+	/* freeze 0; ca 0 0 2 */
+	parameters[0] = 1;
+	parameters[1] = 1;
+	parameters[2] = 0;
+	parameters[3] = PSI = 0;
+	/* for hkl */
+	mode = hkl_engine_mode(hkl);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      parameters, ARRAY_SIZE(parameters),
+				      NULL);
+	hkl_engine_set_values_v(hkl, 0., 0., 2.);
+
+	/* for psi */
+	mode = hkl_engine_mode(psi);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      parameters, ARRAY_SIZE(parameters),
+				      NULL);
+
+	/*      del              th               chi              phi */
+	/*      23.37681         11.68839         90               -90 */
+	/*      gamma            mu */
+	/*      -2.384186e-09    -1.182388e-14 */
+	/* phi is wrong it should be -45 */
+	if(hkl_engine_set(hkl, NULL)){
+		res &= hkl_geometry_list_check_geometry_unit(
+			geometries,
+			0, 11.688393153063114, 90, -45, 0,  23.376786185344031);
+
+		/* check that all solution gives the right psi */
+		darray_foreach(item, *items) {
+			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
+			hkl_engine_initialize(psi, NULL);
+			hkl_engine_list_get(engines);
+			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		}
+	}
+
+	/* freeze 45; ca 0 0 2 */
+	parameters[3] = PSI = 45 * HKL_DEGTORAD;
+	/* for hkl */
+	mode = hkl_engine_mode(hkl);
+	hkl_parameter_list_values_set(hkl_mode_parameters(mode),
+				      parameters, ARRAY_SIZE(parameters),
+				      NULL);
+	hkl_engine_set_values_v(hkl, 0., 0., 2.);
+
+	/*      del              th               chi              phi */
+	/*      23.37666         11.68837         90               -135 */
+	/*      gamma            mu */
+	/*      -2.384186e-09    -1.182388e-14 */
+	/* phi is wrong it should be -90 */
+	if(hkl_engine_set(hkl, NULL)){
+		res &= hkl_geometry_list_check_geometry_unit(
+			geometries,
+			0, 11.688393153063114, 90, -90, 0,  23.376786185344031);
+
+		/* check that all solution gives the right psi */
+		darray_foreach(item, *items){
+			hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
+			hkl_engine_initialize(psi, NULL);
+			hkl_engine_list_get(engines);
+			res &= fabs(PSI - hkl_parameter_value_get(darray_item(*pseudo_axes, 0))) < HKL_EPSILON;
+		}
+	}
+
+	ok(res == HKL_TRUE, __func__);
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+int main(int argc, char** argv)
+{
+	plan(5);
+
+	getter();
+	degenerated();
+	q2();
+	petra3();
+	petra3_2();
+
+	return 0;
+}
diff --git a/tests/hkl-pseudoaxis-k4cv-t.c b/tests/hkl-pseudoaxis-k4cv-t.c
new file mode 100644
index 0000000..94eab22
--- /dev/null
+++ b/tests/hkl-pseudoaxis-k4cv-t.c
@@ -0,0 +1,229 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/hkl-tap.h>
+
+static void degenerated(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	static double hkl[] = {0, 1, 0};
+	HklParameterList *pseudo_axes;
+	darray_parameter *parameters;
+
+	factory = hkl_factory_get_by_name("K4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	darray_foreach(mode, *modes) {
+		hkl_engine_select_mode(engine, *mode);
+		parameters = hkl_mode_parameters(*mode);
+		if(darray_size(*parameters))
+			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+
+		/* studdy this degenerated case */
+		hkl_parameter_list_values_set(pseudo_axes, hkl, ARRAY_SIZE(hkl), NULL);
+		if (hkl_engine_set(engine, NULL)){
+			const darray_item *items = hkl_geometry_list_items_get(geometries);
+			HklGeometryListItem **item;
+
+			darray_foreach(item, *items){
+				static double null[] = {0, 0, 0};
+
+				hkl_parameter_list_values_set(pseudo_axes,
+							      null, ARRAY_SIZE(null),
+							      NULL);
+				hkl_geometry_set(geometry,
+						 hkl_geometry_list_item_geometry_get(*item));
+				hkl_engine_get(engine, NULL);
+				res &= check_pseudoaxes(engine, hkl, 3);
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "degenerated");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void eulerians(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	static double eulerians[] = {0., 90 * HKL_DEGTORAD, 0.};
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("K4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "eulerians");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	darray_foreach(mode, *modes){
+		darray_parameter *parameters;
+
+		hkl_engine_select_mode(engine, *mode);
+		parameters = hkl_mode_parameters(*mode);
+		if(darray_size(*parameters))
+			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+
+		/* studdy this degenerated case */
+		hkl_parameter_list_values_set(pseudo_axes,
+					      eulerians, ARRAY_SIZE(eulerians),
+					      NULL);
+		if (hkl_engine_set(engine, NULL)) {
+			const darray_item *items = hkl_geometry_list_items_get(geometries);
+
+			res &= darray_size(*items) == 2;
+
+			/* first solution = 0, 90, 0 */
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(darray_item(*items, 1)));
+			hkl_engine_get(engine, NULL);
+			res &= check_pseudoaxes_v(engine, 0., 90 * HKL_DEGTORAD, 0.);
+
+			/* second solution = -180, -90, 180 */
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(darray_item(*items, 0)));
+			hkl_engine_get(engine, NULL);
+			res &= check_pseudoaxes_v(engine, -180. * HKL_DEGTORAD, -90 * HKL_DEGTORAD, 180. * HKL_DEGTORAD);
+		}
+	}
+
+	ok(res == HKL_TRUE, "eulerians");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void q(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+
+	factory = hkl_factory_get_by_name("K4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "q");
+	modes = hkl_engine_modes(engine);
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	hkl_engine_initialize(engine, NULL);
+
+	darray_foreach(mode, *modes){
+		double q;
+
+		hkl_engine_select_mode(engine, *mode);
+		for(q=-1.; q<1.; q += 0.1){
+			hkl_engine_set_values_v(engine, q, NULL);
+			if(hkl_engine_set(engine, NULL)){
+				const darray_item *items = hkl_geometry_list_items_get(geometries);
+				HklGeometryListItem **item;
+
+				darray_foreach(item, *items){
+					hkl_engine_set_values_v(engine, 0.);
+					hkl_geometry_set(geometry,
+							 hkl_geometry_list_item_geometry_get(*item));
+					hkl_engine_get(engine, NULL);
+					res &= check_pseudoaxes_v(engine, q);
+				}
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "q");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+int main(int argc, char** argv)
+{
+	plan(3);
+
+	degenerated();
+	eulerians();
+	q();
+
+	return 0;
+}
diff --git a/tests/hkl-pseudoaxis-k6c-t.c b/tests/hkl-pseudoaxis-k6c-t.c
new file mode 100644
index 0000000..ecb4fed
--- /dev/null
+++ b/tests/hkl-pseudoaxis-k6c-t.c
@@ -0,0 +1,278 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/hkl-tap.h>
+
+static void degenerated(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	static double hkl[] = {0, 1, 0};
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("K6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	darray_foreach(mode, *modes){
+		darray_parameter *parameters;
+
+		hkl_engine_select_mode(engine, *mode);
+		parameters = hkl_mode_parameters(*mode);
+		if (!strcasecmp(hkl_mode_name(*mode),
+				"constant_chi_vertical"))
+			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+		if (!strcasecmp(hkl_mode_name(*mode),
+				"constant_incidence"))
+			hkl_parameter_value_set(darray_item(*parameters, 3), 1, NULL);
+
+		/* studdy this degenerated case */
+		hkl_parameter_list_values_set(pseudo_axes,
+					      hkl, ARRAY_SIZE(hkl), NULL);
+		if (hkl_engine_set(engine, NULL)){
+			const darray_item *items = hkl_geometry_list_items_get(geometries);
+			HklGeometryListItem **item;
+
+			darray_foreach(item, *items){
+				static double null[] = {0, 0, 0};
+
+				hkl_parameter_list_values_set(pseudo_axes,
+							      null, ARRAY_SIZE(null),
+							      NULL);
+				hkl_geometry_set(geometry, hkl_geometry_list_item_geometry_get(*item));
+				hkl_engine_get(engine, NULL);
+				res &= check_pseudoaxes(engine, hkl, ARRAY_SIZE(hkl));
+			}
+		}
+	}
+
+	ok(res == HKL_TRUE, "degenerated");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void eulerians(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	HklGeometryListItem *item;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+
+	factory = hkl_factory_get_by_name("K6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "eulerians");
+	modes = hkl_engine_modes(engine);
+
+	darray_foreach(mode, *modes){
+		double omega, chi, phi;
+		darray_parameter *parameters;
+
+		hkl_engine_select_mode(engine, *mode);
+		parameters = hkl_mode_parameters(*mode);
+		if (darray_size(*parameters))
+			hkl_parameter_value_set(darray_item(*parameters, 0), 1, NULL);
+
+		/* studdy this degenerated case */
+		hkl_engine_set_values_v(engine, 0., 90. * HKL_DEGTORAD, 0.);
+		if (hkl_engine_set(engine, NULL)) {
+			const darray_item *items = hkl_geometry_list_items_get(geometries);
+
+			res &= darray_size(*items) == 2;
+
+			/* first solution = 0, 90, 0 */
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(darray_item(*items, 1)));
+			hkl_engine_get(engine, NULL);
+			res &= check_pseudoaxes_v(engine, 0., 90. * HKL_DEGTORAD, 0.);
+
+			/* second solution = -180, -90, 180 */
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(darray_item(*items, 0)));
+			hkl_engine_get(engine, NULL);
+			res &= check_pseudoaxes_v(engine, -180. * HKL_DEGTORAD, -90. * HKL_DEGTORAD, 180. * HKL_DEGTORAD);
+		}
+	}
+
+	ok(res == HKL_TRUE, "eulerians");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+static void q2(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	HklMode **mode;
+	darray_mode *modes;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	HklParameterList *pseudo_axes;
+
+	factory = hkl_factory_get_by_name("K6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+
+	engine = hkl_engine_list_get_by_name(engines, "q2");
+	modes = hkl_engine_modes(engine);
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geometry, 0., 30., 0., 0., 0., 60.);
+	hkl_engine_initialize(engine, NULL);
+
+	darray_foreach(mode, *modes){
+		double q, alpha;
+
+		hkl_engine_select_mode(engine, *mode);
+		for(q=0.1; q<1.; q += 0.1)
+			for(alpha = -M_PI; alpha<M_PI; alpha += M_PI/180.){
+				double values[] = {q, alpha};
+
+				hkl_parameter_list_values_set(pseudo_axes,
+							      values, ARRAY_SIZE(values),
+							      NULL);
+				if(hkl_engine_set(engine, NULL)){
+					const darray_item *items = hkl_geometry_list_items_get(geometries);
+					HklGeometryListItem **item;
+
+					darray_foreach(item, *items){
+						static double null[] = {0, 0};
+
+						hkl_parameter_list_values_set(pseudo_axes,
+									      null, ARRAY_SIZE(null),
+									      NULL);
+						hkl_geometry_set(geometry,
+								 hkl_geometry_list_item_geometry_get(*item));
+						hkl_engine_get(engine, NULL);
+						res &= check_pseudoaxes(engine, values, 2);
+					}
+				}
+			}
+	}
+
+	ok(res == HKL_TRUE, "q2");
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+}
+
+
+static void m15110(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklDetector *detector;
+	HklSample *sample;
+
+	factory = hkl_factory_get_by_name("K6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+	sample = hkl_sample_new("test");
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+
+	engine = hkl_engine_list_get_by_name(engines, "psi");
+
+	/* the init part must succed */
+	hkl_geometry_set_values_unit_v(geometry, 0., 62.95, 134.75, 0., 0., 60.);
+	res &= hkl_engine_initialize(engine, NULL);
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+
+	ok(res == HKL_TRUE, "m15110");
+}
+
+int main(int argc, char** argv)
+{
+	plan(4);
+
+	degenerated();
+	eulerians();
+	q2();
+	m15110();
+
+	return 0;
+}
diff --git a/tests/hkl-pseudoaxis-soleil-sixs-med-t.c b/tests/hkl-pseudoaxis-soleil-sixs-med-t.c
new file mode 100644
index 0000000..1d15aeb
--- /dev/null
+++ b/tests/hkl-pseudoaxis-soleil-sixs-med-t.c
@@ -0,0 +1,107 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
+#include <tap/hkl-tap.h>
+
+#include "hkl-axis-private.h" /* temporary */
+
+#define GET_GAMMA(items, index) hkl_parameter_value_unit_get(		\
+		darray_item(*hkl_geometry_axes_get(			\
+				     hkl_geometry_list_item_geometry_get( \
+					     darray_item(*(items), (index)))), \
+			     3))
+
+
+static void qper_qpar(void)
+{
+	HklEngineList *engines;
+	HklEngine *engine;
+	const HklFactory *factory;
+	HklGeometry *geom;
+	HklDetector *detector;
+	HklSample *sample;
+	size_t i, f_idx;
+	double *Qper, *Qpar;
+	double gamma;
+	darray_parameter *pseudo_axes;
+	const HklGeometryList *geometries;
+	const darray_item *items;
+	HklMatrix *U;
+
+	factory = hkl_factory_get_by_name("SOLEIL SIXS MED2+3");
+	geom = hkl_factory_create_new_geometry(factory);
+
+	sample = hkl_sample_new("test");
+	U = hkl_matrix_new_euler(-90.0 * HKL_DEGTORAD, 0., 0.);
+	hkl_sample_U_set(sample, U);
+	hkl_matrix_free(U);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geom, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+	items = hkl_geometry_list_items_get(geometries);
+
+	engine = hkl_engine_list_get_by_name(engines, "qper_qpar");
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	Qper = &darray_item(*pseudo_axes, 0)->_value;
+	Qpar = &darray_item(*pseudo_axes, 1)->_value;
+
+	/* the init part */
+	hkl_geometry_set_values_unit_v(geom, 0., 0.1, 0., 0., 90., 0.);
+	hkl_engine_initialize(engine, NULL);
+
+	/* gamma must be positif */
+	*Qper = 0.1;
+	*Qpar = 4.;
+	if(hkl_engine_set(engine, NULL) == HKL_TRUE){
+		gamma = GET_GAMMA(items, 0);
+		is_double(2.61077, gamma, HKL_EPSILON * 10, __func__);
+	}
+
+	/* gamma must be negatif */
+	*Qper = -0.1;
+	*Qpar = 4.;
+	if(hkl_engine_set(engine, NULL) == HKL_TRUE){
+		gamma = GET_GAMMA(items, 0);
+		is_double(-2.7956354, gamma, HKL_EPSILON * 10, __func__);
+	}
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geom);
+}
+
+int main(int argc, char** argv)
+{
+	plan(2);
+
+	qper_qpar();
+
+	return 0;
+}
diff --git a/tests/hkl-pseudoaxis-t.c b/tests/hkl-pseudoaxis-t.c
new file mode 100644
index 0000000..42e2e75
--- /dev/null
+++ b/tests/hkl-pseudoaxis-t.c
@@ -0,0 +1,200 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <alloca.h>
+#include <string.h>
+#include "hkl.h"
+#include <tap/basic.h>
+
+#define with_log 1
+
+static int test_engine(HklEngine *engine, HklEngineList *engine_list, unsigned int n)
+{
+	uint i;
+	double values[10]; /* this should be the number of pseudo_axis */
+	int unreachable = 0;
+	int ko = HKL_FALSE;
+	HklMode **mode;
+	const HklGeometryList *geometries = hkl_engine_list_geometries(engine_list);
+	HklGeometry *geometry = hkl_engine_list_get_geometry(engine_list);
+	darray_mode *modes = hkl_engine_modes(engine);
+	darray_parameter *pseudo_axes = (darray_parameter *)hkl_engine_pseudo_axes(engine);
+
+	/* randomize the geometry */
+	hkl_geometry_randomize(geometry);
+
+	darray_foreach(mode, *modes){
+		hkl_engine_select_mode(engine, *mode);
+		/* for now unactive the eulerians check */
+		if(!strcmp(hkl_mode_name(*mode), "eulerians"))
+			continue;
+		unreachable = 0;
+
+		for(i=0;i<n && !ko;++i) {
+			unsigned int j = 0;
+			HklParameter **pseudo_axis;
+
+			/* randomize the pseudoAxes values */
+			darray_foreach(pseudo_axis, *pseudo_axes){
+				hkl_parameter_randomize(*pseudo_axis);
+				values[j++] = hkl_parameter_value_get(*pseudo_axis);
+			}
+
+			/* randomize the parameters */
+			hkl_parameter_list_randomize(hkl_mode_parameters(*mode));
+
+			/* pseudo -> geometry */
+			hkl_engine_initialize(engine, NULL);
+			/* hkl_engine_fprintf(stderr, engine); */
+
+			/* geometry -> pseudo */
+			if(hkl_engine_set(engine, NULL)) {
+				const darray_item *items = hkl_geometry_list_items_get(geometries);
+				HklGeometryListItem **item;
+
+				darray_foreach(item, *items){
+					/* first modify the pseudoAxes values */
+					/* to be sure that the result is the */
+					/* computed result. */
+
+					darray_foreach(pseudo_axis, *pseudo_axes){
+						hkl_parameter_value_set(*pseudo_axis, 0., NULL);
+					}
+
+					hkl_geometry_set(geometry,
+							 hkl_geometry_list_item_geometry_get(*item));
+					hkl_engine_get(engine, NULL);
+
+					j = 0;
+					darray_foreach(pseudo_axis, *pseudo_axes){
+						ko |= fabs(values[j] - hkl_parameter_value_get(*pseudo_axis)) >= HKL_EPSILON;
+						++j;
+					}
+					if(ko)
+						break;
+				}
+			}else
+				unreachable++;
+		}
+#if with_log
+		fprintf(stderr, "\n\"%s\" \"%s\" \"%s\"",
+			hkl_geometry_name_get(geometry),
+			hkl_engine_name(engine),
+			hkl_mode_name(*mode));
+		fprintf(stderr, " unreachable : %d/%d", unreachable, i);
+		if(ko){
+			fprintf(stderr, " ko");
+			/* print the hkl internals if the test failed */
+			fprintf(stderr, "\n    expected : ");
+			for(uint j=0; j<darray_size(*pseudo_axes); ++j)
+				fprintf(stderr, " %f", values[j]);
+			fprintf(stderr, " obtained : ");
+			for(uint j=0; j<darray_size(*pseudo_axes); ++j)
+				fprintf(stderr, " %f",
+					hkl_parameter_value_get(darray_item(*pseudo_axes, j)));
+			hkl_engine_fprintf(stderr, engine);
+			exit(0);
+		}else{
+			fprintf(stderr, " ok");
+		}
+#endif
+	}
+
+	return !ko;
+}
+
+static int test_engines(HklEngineList *engine_list, int n)
+{
+	int res = HKL_TRUE;
+	HklEngine **engine;
+	darray_engine *engines = hkl_engine_list_engines(engine_list);
+
+	darray_foreach(engine, *engines){
+		res &= test_engine(*engine, engine_list, n);
+	}
+
+#if with_log
+	fprintf(stderr, "\n");
+#endif
+	return res;
+}
+
+static void factories(void)
+{
+	int res = HKL_TRUE;
+	uint i, n;
+	HklEngineList *engines;
+	HklFactory **factories;
+
+	factories = hkl_factory_get_all(&n);
+	for(i=0;i<n; i++){
+		engines = hkl_factory_create_new_engine_list(factories[i]);
+		hkl_engine_list_free(engines);
+	}
+
+	ok(res == HKL_TRUE, "factories");
+}
+
+static void set(int nb_iter)
+{
+	HklFactory **factories;
+	unsigned int i, n;
+	HklGeometry *geometry = NULL;
+	HklDetector *detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	HklSample *sample = hkl_sample_new("test");
+	HklEngineList *engines;
+	int res = HKL_TRUE;
+
+	/* attach to the second holder */
+	hkl_detector_idx_set(detector, 1);
+
+	factories = hkl_factory_get_all(&n);
+	for(i=0; i<n; i++){
+		geometry = hkl_factory_create_new_geometry(factories[i]);
+		engines = hkl_factory_create_new_engine_list(factories[i]);
+		hkl_engine_list_init(engines, geometry, detector, sample);
+		res &= test_engines(engines, nb_iter);
+		hkl_geometry_free(geometry);
+		hkl_engine_list_free(engines);
+	}
+
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+
+	ok(res == HKL_TRUE, "set");
+}
+
+int main(int argc, char** argv)
+{
+	double n;
+
+	plan(2);
+
+	if (argc > 1)
+		n = atoi(argv[1]);
+	else
+		n = 10;
+
+	factories();
+	set(n);
+
+	return 0;
+}
diff --git a/tests/hkl-pseudoaxis-zaxis-t.c b/tests/hkl-pseudoaxis-zaxis-t.c
new file mode 100644
index 0000000..dccc48f
--- /dev/null
+++ b/tests/hkl-pseudoaxis-zaxis-t.c
@@ -0,0 +1,107 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/hkl-tap.h>
+
+static void solution(void)
+{
+	int res = HKL_TRUE;
+	HklEngineList *engines;
+	HklEngine *engine;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	const HklGeometryList *geometries;
+	HklDetector *detector;
+	HklSample *sample;
+	HklLattice *lattice;
+	static double hkl[] = {1, 1, 0};
+	HklParameterList *pseudo_axes;
+	HklMatrix *U;
+
+	/* get the geometry and set the source */
+	factory = hkl_factory_get_by_name("ZAXIS");
+	geometry = hkl_factory_create_new_geometry(factory);
+	hkl_geometry_wavelength_set(geometry, 0.842);
+
+	/* set up the sample */
+	sample = hkl_sample_new("test");
+	lattice = hkl_lattice_new(5.432, 5.432, 5.432,
+				  90 * HKL_DEGTORAD,
+				  90 * HKL_DEGTORAD,
+				  90 * HKL_DEGTORAD);
+	hkl_sample_lattice_set(sample, lattice);
+	U = hkl_matrix_new_euler(-90*HKL_DEGTORAD, 0, 0);
+	hkl_sample_U_set(sample, U);
+	hkl_lattice_free(lattice);
+	hkl_matrix_free(U);
+
+	/* use a 0D detector */
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	/* select the hkl pseudo axis */
+	engines = hkl_factory_create_new_engine_list(factory);
+	hkl_engine_list_init(engines, geometry, detector, sample);
+	geometries = hkl_engine_list_geometries(engines);
+	engine = hkl_engine_list_get_by_name(engines, "hkl");
+	pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	/* the init part must succed */
+	hkl_geometry_set_values_unit_v(geometry, 1., 0., 0., 0.);
+
+	/* compute the 1 1 0 */
+	hkl_parameter_list_values_set(pseudo_axes, hkl, ARRAY_SIZE(hkl), NULL);
+	if (hkl_engine_set(engine, NULL)){
+		const darray_item *items = hkl_geometry_list_items_get(geometries);
+		HklGeometryListItem **item;
+
+		darray_foreach(item, *items){
+			static double null[] = {0, 0, 0};
+
+			hkl_parameter_list_values_set(pseudo_axes, null, ARRAY_SIZE(null), NULL);
+			hkl_geometry_set(geometry,
+					 hkl_geometry_list_item_geometry_get(*item));
+			hkl_engine_get(engine, NULL);
+			res &= check_pseudoaxes(engine, hkl, 3);
+		}
+	}else
+		res = HKL_FALSE;
+	if(!res)
+		hkl_engine_fprintf(stdout, engine);
+
+	hkl_engine_list_free(engines);
+	hkl_detector_free(detector);
+	hkl_sample_free(sample);
+	hkl_geometry_free(geometry);
+
+	ok(res == HKL_TRUE, "solution");
+}
+
+int main(int argc, char** argv)
+{
+	plan(1);
+
+	solution();
+
+	return 0;
+}
diff --git a/test/hkl-test-quaternion.c b/tests/hkl-quaternion-t.c
similarity index 53%
rename from test/hkl-test-quaternion.c
rename to tests/hkl-quaternion-t.c
index a5ed4a4..e7147c8 100644
--- a/test/hkl-test-quaternion.c
+++ b/tests/hkl-quaternion-t.c
@@ -13,63 +13,54 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <hkl.h>
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
 
-#include "hkl-test.h"
+#include "hkl-quaternion-private.h"
 
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME quaternion
-
-HKL_TEST_SUITE_FUNC(assignment)
+static void assignment(void)
 {
 	HklQuaternion q = {{1, 0, 0, 0}};
 	HklQuaternion copy = q;
 
-	HKL_ASSERT_DOUBLES_EQUAL(1., copy.data[0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., copy.data[1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., copy.data[2], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., copy.data[3], HKL_EPSILON);
-
-	return HKL_TEST_PASS;
+	is_double(1., copy.data[0], HKL_EPSILON, __func__);
+	is_double(0., copy.data[1], HKL_EPSILON, __func__);
+	is_double(0., copy.data[2], HKL_EPSILON, __func__);
+	is_double(0., copy.data[3], HKL_EPSILON, __func__);
 }
 
-HKL_TEST_SUITE_FUNC(cmp)
+static void cmp(void)
 {
 	HklQuaternion q_ref = {{1., 2., 3., 4.}};
 	HklQuaternion q = {{1., 2., 3., 4.}};
 	HklQuaternion q1 = {{1., 1., 3., 4.}};
 
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_quaternion_cmp(&q_ref, &q));
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_quaternion_cmp(&q_ref, &q1));
+	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
+	ok(HKL_FALSE == hkl_quaternion_cmp(&q_ref, &q1), __func__);
 
 	/* test the assignation */
 	q1 = q_ref;
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_quaternion_cmp(&q_ref, &q1));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q1), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(init_from_vector)
+static void init_from_vector(void)
 {
 	HklQuaternion q_ref = {{0, 1, -1, .5}};
 	HklVector v = {{1., -1., .5}};
 	HklQuaternion q;
 
 	hkl_quaternion_init_from_vector(&q, &v);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_quaternion_cmp(&q_ref, &q));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(init_from_angle_and_axe)
+static void init_from_angle_and_axe(void)
 {
 	HklQuaternion q_ref1 = {{1, 0, 0, 0}};
 	HklQuaternion q_ref2 = {{sqrt(2.)/2., sqrt(2./9.), -sqrt(2./9.), sqrt(1./18.)}};
@@ -77,60 +68,53 @@ HKL_TEST_SUITE_FUNC(init_from_angle_and_axe)
 	HklQuaternion q;
 
 	hkl_quaternion_init_from_angle_and_axe(&q, 0, &v_ref2);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_quaternion_cmp(&q_ref1, &q));
+	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref1, &q), __func__);
 
 	hkl_quaternion_init_from_angle_and_axe(&q, 90. * HKL_DEGTORAD, &v_ref2);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_quaternion_cmp(&q_ref2, &q));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref2, &q), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(times_quaternion)
+static void times_quaternion(void)
 {
 	HklQuaternion q_ref = {{-28., 4., 6., 8.}};
 	HklQuaternion q = {{1., 2., 3., 4.}};
 
 	hkl_quaternion_times_quaternion(&q, &q);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_quaternion_cmp(&q_ref, &q));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(norm2)
+static void norm2(void)
 {
 	HklQuaternion q = {{1., 2., 3., 4.}};
 
-	HKL_ASSERT_DOUBLES_EQUAL(sqrt(30.), hkl_quaternion_norm2(&q), HKL_EPSILON);
-
-	return HKL_TEST_PASS;
+	is_double(sqrt(30.), hkl_quaternion_norm2(&q), HKL_EPSILON, __func__);
 }
 
-HKL_TEST_SUITE_FUNC(conjugate)
+static void conjugate(void)
 {
 	HklQuaternion q_ref = {{1., -2., -3., -4.}};
 	HklQuaternion q = {{1., 2., 3., 4.}};
 
 	hkl_quaternion_conjugate(&q);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_quaternion_cmp(&q_ref, &q));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_quaternion_cmp(&q_ref, &q), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(to_matrix)
+static void to_matrix(void)
 {
 	HklQuaternion q_ref = {{1./sqrt(2), 0, 0, 1./sqrt(2)}};
-	HklMatrix m_ref = {{{0,-1, 0},
-		{1, 0, 0},
-		{0, 0, 1}}};
-	HklMatrix m;
+	HklMatrix *m_ref = hkl_matrix_new_full(0,-1, 0,
+					       1, 0, 0,
+					       0, 0, 1);
+	HklMatrix *m = hkl_matrix_new();
 
-	hkl_quaternion_to_matrix(&q_ref, &m);
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_matrix_cmp(&m_ref, &m));
+	hkl_quaternion_to_matrix(&q_ref, m);
+	ok(HKL_TRUE == hkl_matrix_cmp(m_ref, m), __func__);
 
-	return HKL_TEST_PASS;
+	hkl_matrix_free(m_ref);
+	hkl_matrix_free(m);
 }
 
-HKL_TEST_SUITE_FUNC(to_angle_and_axe)
+static void to_angle_and_axe(void)
 {
 	HklVector v_ref = {{0 ,0, 1}};
 	HklVector v_null = {{0 ,0, 0}};
@@ -145,8 +129,8 @@ HKL_TEST_SUITE_FUNC(to_angle_and_axe)
 
 	/* test the q = (1, 0, 0, 0) solution axe == (0, 0, 0) and angle = 0. */
 	hkl_quaternion_to_angle_and_axe(&q_I, &angle, &v);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&v_null, &v));
-	HKL_ASSERT_DOUBLES_EQUAL(0., angle, HKL_EPSILON);
+	ok(0 == hkl_vector_cmp(&v_null, &v), __func__);
+	is_double(0., angle, HKL_EPSILON, __func__);
 
 	/* test other cases */
 	for(i=-180; i<180; i++) {
@@ -155,24 +139,25 @@ HKL_TEST_SUITE_FUNC(to_angle_and_axe)
 		hkl_quaternion_to_angle_and_axe(&q, &angle, &v);
 
 		if (!hkl_vector_cmp(&v_ref, &v))
-			HKL_ASSERT_DOUBLES_EQUAL(angle_ref, angle, HKL_EPSILON);
+			is_double(angle_ref, angle, HKL_EPSILON, __func__);
 		else if (hkl_vector_is_opposite(&v, &v_ref))
-			HKL_ASSERT_DOUBLES_EQUAL(angle_ref, -angle, HKL_EPSILON);
+			is_double(angle_ref, -angle, HKL_EPSILON, __func__);
 	}
-
-	return HKL_TEST_PASS;
 }
 
-HKL_TEST_SUITE_BEGIN
-
-	HKL_TEST( assignment );
-	HKL_TEST( cmp );
-	HKL_TEST( init_from_vector );
-	HKL_TEST( init_from_angle_and_axe );
-	HKL_TEST( times_quaternion );
-	HKL_TEST( norm2 );
-	HKL_TEST( conjugate );
-	HKL_TEST( to_matrix );
-	HKL_TEST( to_angle_and_axe );
-
-HKL_TEST_SUITE_END
+int main(int argc, char** argv)
+{
+	plan(375);
+
+	assignment();
+	cmp();
+	init_from_vector();
+	init_from_angle_and_axe();
+	times_quaternion();
+	norm2();
+	conjugate();
+	to_matrix();
+	to_angle_and_axe();
+
+	return 0;
+}
diff --git a/tests/hkl-sample-t.c b/tests/hkl-sample-t.c
new file mode 100644
index 0000000..a85d9a6
--- /dev/null
+++ b/tests/hkl-sample-t.c
@@ -0,0 +1,426 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
+
+static void new(void)
+{
+	HklSample *sample;
+
+	sample = hkl_sample_new("test");
+
+	hkl_sample_free(sample);
+}
+
+static void add_reflection(void)
+{
+	HklDetector *detector;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklSample *sample;
+	HklSampleReflection *ref;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	hkl_sample_add_reflection(sample, ref);
+
+	/* we can not add two times the same reflection */
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geometry);
+}
+
+static void get_reflection(void)
+{
+	HklDetector *detector;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklSample *sample;
+	HklSampleReflection *ref;
+	HklSampleReflection *ref2;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	hkl_sample_add_reflection(sample, ref);
+	ref2 = hkl_sample_first_reflection_get(sample);
+	ok(0 == !ref, __func__);
+	ok(ref == ref2, __func__);
+	ok(NULL == hkl_sample_next_reflection_get(sample, ref2), __func__);
+
+	ref = hkl_sample_reflection_new(geometry, detector, -1, 0, 0);
+	hkl_sample_add_reflection(sample, ref);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geometry);
+}
+
+static void del_reflection(void)
+{
+	HklDetector *detector;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklSample *sample;
+	HklSampleReflection *ref;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	hkl_sample_add_reflection(sample, ref);
+	hkl_sample_del_reflection(sample, ref);
+	ok (NULL == hkl_sample_first_reflection_get(sample), __func__);
+
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geometry);
+}
+
+static void  set_UB(void )
+{
+	HklSample *sample;
+	HklMatrix *UB = hkl_matrix_new_full(HKL_TAU/1.54, 0., 0.,
+					    0., 0., HKL_TAU/1.54,
+					    0., -HKL_TAU/1.54, 0.);
+	HklMatrix *U = hkl_matrix_new_full(1., 0., 0.,
+					   0., 0., 1.,
+					   0.,-1., 0.);
+
+	sample = hkl_sample_new("test");
+
+	hkl_sample_UB_set(sample, UB);
+	ok(HKL_TRUE == hkl_matrix_cmp(U,
+				      hkl_sample_U_get(sample)), __func__);
+	is_double(-90. * HKL_DEGTORAD,
+		  hkl_parameter_value_get(hkl_sample_ux_get(sample)),
+		  HKL_EPSILON, __func__);
+	is_double(0.,
+		  hkl_parameter_value_get(hkl_sample_uy_get(sample)),
+		  HKL_EPSILON, __func__);
+	is_double(0.,
+		  hkl_parameter_value_get(hkl_sample_uz_get(sample)),
+		  HKL_EPSILON, __func__);
+
+	hkl_sample_free(sample);
+	hkl_matrix_free(U);
+	hkl_matrix_free(UB);
+}
+
+static void compute_UB_busing_levy(void)
+{
+	HklDetector *detector;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklSample *sample;
+	HklSampleReflection *r0, *r1, *r2, *r3;
+	HklMatrix *m_I = hkl_matrix_new_full(1,0,0,
+					     0,1,0,
+					     0, 0, 1);
+	HklMatrix *m_ref = hkl_matrix_new_full(1., 0., 0.,
+					       0., 0., 1.,
+					       0.,-1., 0.);
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	r0 = hkl_sample_reflection_new(geometry, detector, 0, 0, 1);
+	hkl_sample_add_reflection(sample, r0);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., -90., 60.);
+	r1 = hkl_sample_reflection_new(geometry, detector, -1, 0, 0);
+	hkl_sample_add_reflection(sample, r1);
+
+	hkl_sample_compute_UB_busing_levy(sample, r0, r1);
+	ok(HKL_TRUE == hkl_matrix_cmp(m_I, hkl_sample_U_get(sample)), __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_ux_get(sample)), HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_uy_get(sample)), HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_uz_get(sample)), HKL_EPSILON, __func__);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
+	r2 = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	hkl_sample_add_reflection(sample, r2);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 180., 60.);
+	r3 = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	hkl_sample_add_reflection(sample, r3);
+
+	hkl_sample_compute_UB_busing_levy(sample, r2, r3);
+	ok(HKL_TRUE == hkl_matrix_cmp(m_ref, hkl_sample_U_get(sample)), __func__);
+	is_double(-90. * HKL_DEGTORAD, hkl_parameter_value_get(hkl_sample_ux_get(sample)), HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_uy_get(sample)), HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_uz_get(sample)), HKL_EPSILON, __func__);
+
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geometry);
+	hkl_matrix_free(m_ref);
+	hkl_matrix_free(m_I);
+}
+
+static void affine(void)
+{
+	double a, b, c, alpha, beta, gamma;
+	const HklFactory *factory;
+	HklDetector *detector;
+	HklGeometry *geometry;
+	HklSample *sample;
+	HklLattice *lattice;
+	HklSampleReflection *ref;
+	HklMatrix *m_ref = hkl_matrix_new_full(1., 0., 0.,
+					       0., 1., 0.,
+					       0., 0., 1.);
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+	lattice = hkl_lattice_new(1, 5, 4,
+				  92 * HKL_DEGTORAD,
+				  81 * HKL_DEGTORAD,
+				  90 * HKL_DEGTORAD);
+	hkl_sample_lattice_set(sample, lattice);
+	hkl_lattice_free(lattice);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 90., 0., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 0, 1);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_geometry_set_values_unit_v(geometry, 60., 60., 60., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_geometry_set_values_unit_v(geometry, 45., 45., 45., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_sample_affine(sample);
+
+	hkl_lattice_get(hkl_sample_lattice_get(sample),
+			&a, &b, &c, &alpha, &beta, &gamma);
+
+	ok(HKL_TRUE == hkl_matrix_cmp(m_ref, hkl_sample_U_get(sample)), __func__);
+	is_double(1.54, a, HKL_EPSILON, __func__);
+	is_double(1.54, b, HKL_EPSILON, __func__);
+	is_double(1.54, c, HKL_EPSILON, __func__);
+	is_double(90 * HKL_DEGTORAD, alpha, HKL_EPSILON, __func__);
+	is_double(90 * HKL_DEGTORAD, beta, HKL_EPSILON, __func__);
+	is_double(90 * HKL_DEGTORAD, gamma, HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_ux_get(sample)), HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_uy_get(sample)), HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_uz_get(sample)), HKL_EPSILON, __func__);
+
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geometry);
+	hkl_matrix_free(m_ref);
+}
+
+static void get_reflections_xxx_angle(void)
+{
+	HklDetector *detector;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklSample *sample;
+	HklLattice *lattice;
+	HklSampleReflection *r0, *r1, *r2, *r3, *r4;
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD,90*HKL_DEGTORAD);
+	hkl_sample_lattice_set(sample, lattice);
+	hkl_lattice_free(lattice);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
+	r0 = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	hkl_sample_add_reflection(sample, r0);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 90., 0., 60.);
+	r1 = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	hkl_sample_add_reflection(sample, r1);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	r2 = hkl_sample_reflection_new(geometry, detector, 0, 0, 1);
+	hkl_sample_add_reflection(sample, r2);
+
+	hkl_geometry_set_values_unit_v(geometry, 60., 60., 60., 60.);
+	r3 = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946);
+	hkl_sample_add_reflection(sample, r3);
+
+	hkl_geometry_set_values_unit_v(geometry, 45., 45., 45., 60.);
+	r4 = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252);
+	hkl_sample_add_reflection(sample, r4);
+
+	is_double(90 * HKL_DEGTORAD,
+		  hkl_sample_get_reflection_theoretical_angle(sample, r0, r1),
+		  HKL_EPSILON, __func__);
+
+	is_double(90 * HKL_DEGTORAD,
+		  hkl_sample_get_reflection_mesured_angle(sample, r0, r1),
+		  HKL_EPSILON, __func__);
+
+	is_double(90 * HKL_DEGTORAD,
+		  hkl_sample_get_reflection_theoretical_angle(sample, r1, r2),
+		  HKL_EPSILON, __func__);
+
+	is_double(90 * HKL_DEGTORAD,
+		  hkl_sample_get_reflection_mesured_angle(sample, r1, r2),
+		  HKL_EPSILON, __func__);
+
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geometry);
+}
+
+static void reflection_set_geometry(void)
+{
+	double a, b, c, alpha, beta, gamma;
+	HklDetector *detector;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	HklSample *sample;
+	HklLattice *lattice;
+	HklSampleReflection *ref;
+	HklMatrix *m_ref = hkl_matrix_new_full(1., 0., 0.,
+					       0., 1., 0.,
+					       0., 0., 1.);
+
+	factory = hkl_factory_get_by_name("E4CV");
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	detector = hkl_detector_factory_new(HKL_DETECTOR_TYPE_0D);
+	hkl_detector_idx_set(detector, 1);
+
+	sample = hkl_sample_new("test");
+	lattice = hkl_lattice_new(1.54, 1.54, 1.54,
+				  90*HKL_DEGTORAD, 90*HKL_DEGTORAD,90*HKL_DEGTORAD);
+	hkl_sample_lattice_set(sample, lattice);
+	hkl_lattice_free(lattice);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 90., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, 1, 0, 0);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 90., 0., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 1, 0);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_geometry_set_values_unit_v(geometry, 30., 0., 0., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, 0, 0, 1);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_geometry_set_values_unit_v(geometry, 60., 60., 60., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, .625, .75, -.216506350946);
+	hkl_sample_add_reflection(sample, ref);
+
+	hkl_geometry_set_values_unit_v(geometry, 46., 45., 45., 60.);
+	ref = hkl_sample_reflection_new(geometry, detector, .665975615037, .683012701892, .299950211252);
+	hkl_sample_add_reflection(sample, ref);
+
+	/* correct the last reflection so the sample affinement must be ok. */
+	hkl_geometry_set_values_unit_v(geometry, 45., 45., 45., 60.);
+	hkl_sample_reflection_geometry_set(ref, geometry);
+
+	hkl_sample_affine(sample);
+	hkl_lattice_get(hkl_sample_lattice_get(sample),
+			&a, &b, &c, &alpha, &beta, &gamma);
+
+	ok(HKL_TRUE == hkl_matrix_cmp(m_ref, hkl_sample_U_get(sample)), __func__);
+	is_double(1.54, a, HKL_EPSILON, __func__);
+	is_double(1.54, b, HKL_EPSILON, __func__);
+	is_double(1.54, c, HKL_EPSILON, __func__);
+	is_double(90 * HKL_DEGTORAD, alpha, HKL_EPSILON, __func__);
+	is_double(90 * HKL_DEGTORAD, beta, HKL_EPSILON, __func__);
+	is_double(90 * HKL_DEGTORAD, gamma, HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_ux_get(sample)), HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_uy_get(sample)), HKL_EPSILON, __func__);
+	is_double(0., hkl_parameter_value_get(hkl_sample_uz_get(sample)), HKL_EPSILON, __func__);
+
+	hkl_sample_free(sample);
+	hkl_detector_free(detector);
+	hkl_geometry_free(geometry);
+	hkl_matrix_free(m_ref);
+}
+
+int main(int argc, char** argv)
+{
+	plan(40);
+
+	new();
+	add_reflection();
+	get_reflection();
+	del_reflection();
+	set_UB();
+	compute_UB_busing_levy();
+	affine();
+	get_reflections_xxx_angle();
+
+	reflection_set_geometry();
+
+	return 0;
+}
diff --git a/test/hkl-test-source.c b/tests/hkl-source-t.c
similarity index 52%
rename from test/hkl-test-source.c
rename to tests/hkl-source-t.c
index ad77afc..8e9d09b 100644
--- a/test/hkl-test-source.c
+++ b/tests/hkl-source-t.c
@@ -13,49 +13,42 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <hkl.h>
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
 
-#include "hkl-test.h"
+#include "hkl-source-private.h"
 
-#ifdef HKL_TEST_SUITE_NAME
-# undef HKL_TEST_SUITE_NAME
-#endif
-#define HKL_TEST_SUITE_NAME source
-
-HKL_TEST_SUITE_FUNC(new_copy)
+static void new_copy(void)
 {
 	HklSource s, c;
 
 	hkl_source_init(&s, 1.54, 1, 0, 0);
 	c = s;
 
-	HKL_ASSERT_DOUBLES_EQUAL(c.wave_length, s.wave_length, HKL_EPSILON);
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_vector_cmp(&c.direction, &s.direction));
-
-	return HKL_TEST_PASS;
+	is_double(c.wave_length, s.wave_length, HKL_EPSILON, __func__);
+	ok(HKL_FALSE == hkl_vector_cmp(&c.direction, &s.direction), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(init)
+static void init(void)
 {
 	HklSource s;
 
 	hkl_source_init(&s, 1, 1, 0, 0);
 
-	HKL_ASSERT_DOUBLES_EQUAL(1., s.wave_length, HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(1., s.direction.data[0], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., s.direction.data[1], HKL_EPSILON);
-	HKL_ASSERT_DOUBLES_EQUAL(0., s.direction.data[2], HKL_EPSILON);
-
-	return HKL_TEST_PASS;
+	is_double(1., s.wave_length, HKL_EPSILON, __func__);
+	is_double(1., s.direction.data[0], HKL_EPSILON, __func__);
+	is_double(0., s.direction.data[1], HKL_EPSILON, __func__);
+	is_double(0., s.direction.data[2], HKL_EPSILON, __func__);
 }
 
-HKL_TEST_SUITE_FUNC(cmp)
+static void cmp(void)
 {
 	HklSource ref, s1, s2;
 
@@ -63,13 +56,11 @@ HKL_TEST_SUITE_FUNC(cmp)
 	hkl_source_init(&s1, 1.54, 1, 0, 0);
 	hkl_source_init(&s2, 1, 1, 0, 0);
 
-	HKL_ASSERT_EQUAL(HKL_TRUE, hkl_source_cmp(&ref, &s1));
-	HKL_ASSERT_EQUAL(HKL_FALSE, hkl_source_cmp(&ref, &s2));
-
-	return HKL_TEST_PASS;
+	ok(HKL_TRUE == hkl_source_cmp(&ref, &s1), __func__);
+	ok(HKL_FALSE == hkl_source_cmp(&ref, &s2), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(compute_ki)
+static void compute_ki(void)
 {
 	HklSource s;
 	HklVector ki_ref = {{HKL_TAU / 1.54, 0, 0}};
@@ -78,28 +69,27 @@ HKL_TEST_SUITE_FUNC(compute_ki)
 	hkl_source_init(&s, 1.54, 1, 0, 0);
 
 	hkl_source_compute_ki(&s, &ki);
-	HKL_ASSERT_EQUAL(0, hkl_vector_cmp(&ki_ref, &ki));
-
-	return HKL_TEST_PASS;
+	ok(0 == hkl_vector_cmp(&ki_ref, &ki), __func__);
 }
 
-HKL_TEST_SUITE_FUNC(get_wavelength)
+static void get_wavelength(void)
 {
 	HklSource s;
 
 	hkl_source_init(&s, 1, 1, 0, 0);
 
-	HKL_ASSERT_DOUBLES_EQUAL(1., hkl_source_get_wavelength(&s), HKL_EPSILON);
-
-	return HKL_TEST_PASS;
+	is_double(1., hkl_source_get_wavelength(&s), HKL_EPSILON, __func__);
 }
 
-HKL_TEST_SUITE_BEGIN
+int main(int argc, char** argv)
+{
+	plan(10);
 
-HKL_TEST( new_copy );
-HKL_TEST( init );
-HKL_TEST( cmp );
-HKL_TEST( compute_ki );
-HKL_TEST( get_wavelength );
+	new_copy();
+	init();
+	cmp();
+	compute_ki();
+	get_wavelength();
 
-HKL_TEST_SUITE_END
+	return 0;
+}
diff --git a/gui/main.cpp b/tests/hkl-unit-t.c
similarity index 55%
copy from gui/main.cpp
copy to tests/hkl-unit-t.c
index 413b44d..e69682a 100644
--- a/gui/main.cpp
+++ b/tests/hkl-unit-t.c
@@ -13,21 +13,44 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#include <gtkmm/main.h>
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
 
-#include "ghkl.h"
+#include "hkl-unit-private.h"
 
-int main(int argc, char *argv[])
+static void compatible(void)
 {
-	Gtk::Main kit(argc, argv);
-	HKLWindow window;
-	kit.run();
+	int res = HKL_TRUE;
+
+	const HklUnit *unit;
+	const HklUnit *punit;
+
+	res &= hkl_unit_compatible(&hkl_unit_angle_deg, &hkl_unit_angle_rad);
+	res &= !hkl_unit_compatible(&hkl_unit_angle_deg, &hkl_unit_length_nm);
+	res &= !hkl_unit_compatible(&hkl_unit_angle_rad, &hkl_unit_length_nm);
+	res &= hkl_unit_compatible(NULL, NULL);
+
+	ok(res == HKL_TRUE, __func__);
+}
+
+static void factor(void)
+{
+	is_double(HKL_DEGTORAD, hkl_unit_factor(&hkl_unit_angle_deg, &hkl_unit_angle_rad), HKL_EPSILON, __func__);
+}
+
+int main(int argc, char** argv)
+{
+	plan(2);
+
+	compatible();
+	factor();
 
 	return 0;
 }
diff --git a/tests/hkl-vector-t.c b/tests/hkl-vector-t.c
new file mode 100644
index 0000000..1d57a7e
--- /dev/null
+++ b/tests/hkl-vector-t.c
@@ -0,0 +1,246 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include "hkl.h"
+#include <tap/basic.h>
+#include <tap/float.h>
+
+#include "hkl-vector-private.h" /* use to test also the private API */
+
+static void init(void)
+{
+	HklVector v;
+
+	hkl_vector_init(&v, 1, 2, 3);
+
+	is_double(1., v.data[0], HKL_EPSILON, __func__);
+	is_double(2., v.data[1], HKL_EPSILON, __func__);
+	is_double(3., v.data[2], HKL_EPSILON, __func__);
+}
+
+static void cmp(void)
+{
+	HklVector v1 = {{0.0, 1.0, 2.0}};
+	HklVector v2 = {{1.0, 2.0, 3.0}};
+
+	ok(0 == hkl_vector_cmp(&v1, &v1), __func__);
+	ok(1 == hkl_vector_cmp(&v1, &v2), __func__);
+}
+
+static void is_opposite(void)
+{
+	HklVector v_ref = {{0, 1, 2}};
+	HklVector v1 = {{1, 2, 3}};
+	HklVector v2 = {{0, -1, -2}};
+
+	ok(HKL_FALSE == hkl_vector_is_opposite(&v_ref, &v1), __func__);
+	ok(HKL_TRUE == hkl_vector_is_opposite(&v_ref, &v2), __func__);
+}
+
+static void norm2(void)
+{
+	HklVector v1 = {{0.0, 1.0, 2.0}};
+	HklVector v2 = {{-1.0, 1.0, 2.0}};
+
+	is_double(sqrt(5.0), hkl_vector_norm2(&v1), HKL_EPSILON, __func__);
+	is_double(sqrt(6.0), hkl_vector_norm2(&v2), HKL_EPSILON, __func__);
+}
+
+static void normalize(void)
+{
+	HklVector v_ref = {{1. /sqrt(2.), 1. / sqrt(2.), 0.}};
+	HklVector v = {{1., 1., 0.}};
+
+	hkl_vector_normalize(&v);
+	ok(0 == hkl_vector_cmp(&v_ref, &v), __func__);
+}
+
+static void scalar_product(void)
+{
+	HklVector v = {{0.0, 1.0, 2.0}};
+
+	double scalar = hkl_vector_scalar_product(&v, &v);
+	is_double( 5.0, scalar, HKL_EPSILON, __func__ );
+}
+
+static void vectorial_product(void)
+{
+	HklVector v = {{0.0, 1.0, 2.0}};
+	HklVector v1 = {{1.0, 2.0, 3.0}};
+	HklVector v_ref = {{-1.0, 2.0, -1.0}};
+
+	hkl_vector_vectorial_product(&v, &v1);
+	ok(0 == hkl_vector_cmp(&v_ref, &v), __func__);
+}
+
+static void angle(void)
+{
+	double angle;
+	HklVector v = {{1., 0., 0.}};
+	HklVector v1 = {{1., 1., 0.}};
+	HklVector v2 = {{1., 1., .5}};
+	HklVector v3 = {{1., .5, -1}};
+	HklVector v4 = {{0., 1., 0.}};
+	HklVector v5 = {{0., -1., 0.}};
+
+	angle = hkl_vector_angle(&v, &v);
+	is_double(0., angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_angle(&v, &v1);
+	is_double(acos(1./sqrt(2.)), angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_angle(&v2, &v3);
+	is_double(acos(1./2.25), angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_angle(&v, &v4);
+	is_double(90 * HKL_DEGTORAD, angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_angle(&v, &v5);
+	is_double(90 * HKL_DEGTORAD, angle, HKL_EPSILON, __func__);
+}
+
+static void oriented_angle(void)
+{
+	double angle;
+	HklVector v = {{1., 0., 0.}};
+	HklVector v1 = {{1., 1., 0.}};
+	HklVector v2 = {{0., 1., 0.}};
+	HklVector v3 = {{0., -1., 0.}};
+	HklVector ref = {{0, 0, 1}};
+
+	angle = hkl_vector_oriented_angle(&v, &v, &ref);
+	is_double(0., angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_oriented_angle(&v, &v1, &ref);
+	is_double(acos(1./sqrt(2.)), angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_oriented_angle(&v, &v2, &ref);
+	is_double(90 * HKL_DEGTORAD, angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_oriented_angle(&v, &v3, &ref);
+	is_double(-90 * HKL_DEGTORAD, angle, HKL_EPSILON, __func__);
+}
+
+static void oriented_angle_points(void)
+{
+	double angle;
+	HklVector v = {{1., 0., 1.}};
+	HklVector v1 = {{1., 1., 1.}};
+	HklVector v2 = {{0., 1., 1.}};
+	HklVector v3 = {{0., -1., 1.}};
+	HklVector ref = {{0, 0, 1}};
+
+	angle = hkl_vector_oriented_angle_points(&v, &ref, &v, &ref);
+	is_double(0., angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_oriented_angle_points(&v, &ref, &v1, &ref);
+	is_double(acos(1./sqrt(2.)), angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_oriented_angle_points(&v, &ref, &v2, &ref);
+	is_double(90 * HKL_DEGTORAD, angle, HKL_EPSILON, __func__);
+
+	angle = hkl_vector_oriented_angle_points(&v, &ref, &v3, &ref);
+	is_double(-90 * HKL_DEGTORAD, angle, HKL_EPSILON, __func__);
+}
+
+static void rotated_around_vector(void)
+{
+	HklVector x = {{1, 0, 0}};
+	HklVector z = {{0, 0, 1}};
+	HklVector y_ref = {{0, 1, 0}};
+
+	hkl_vector_rotated_around_vector(&x, &z, 90*HKL_DEGTORAD);
+	ok(0 == hkl_vector_cmp(&y_ref, &x), __func__);
+}
+
+static void rotated_around_line(void)
+{
+	HklVector x = {{1, 0, 0}};
+	HklVector c1 = {{0, 0, 0}};
+	HklVector c2 = {{0, 0, 1}};
+	HklVector x_ref = {{1, 0, 0}};
+	HklVector y_ref = {{0, 1, 0}};
+
+	hkl_vector_rotated_around_line(&x, 0*HKL_DEGTORAD, &c1, &c2);
+	ok(0 == hkl_vector_cmp(&x_ref, &x), __func__);
+
+	hkl_vector_rotated_around_line(&x, 90*HKL_DEGTORAD, &c1, &c2);
+	ok(0 == hkl_vector_cmp(&y_ref, &x), __func__);
+}
+
+static void times_matrix(void)
+{
+	HklMatrix *m = hkl_matrix_new_full(1.0, 3.0,-2.0,
+					   10.0, 5.0, 5.0,
+					   -3.0, 2.0, 0.0);
+	HklVector v = {{1.0, 2.0, 3.0}};
+	HklVector v_ref = {{12., 19., 8.}};
+
+	hkl_vector_times_matrix(&v, m);
+	ok(0 == hkl_vector_cmp(&v_ref, &v), __func__);
+	hkl_matrix_free(m);
+}
+
+static void project_on_plan(void)
+{
+	HklVector v;
+	HklVector v_ref = {{1, 0, 0}};
+	HklVector v1_ref = {{1, 0, 1}};
+	HklVector v2_ref = {{1, 0, -2}};
+	HklVector v1 = {{1, 0, 2}};
+	HklVector plan = {{0, 0, 1}};
+	HklVector point1 = {{0, 0, 1}};
+	HklVector point2 = {{0, 0, -2}};
+
+	v = v1;
+	hkl_vector_project_on_plan(&v, &plan);
+	ok(0 == hkl_vector_cmp(&v_ref, &v), __func__);
+
+	v = v1;
+	hkl_vector_project_on_plan_with_point(&v, &plan, &point1);
+	ok(0 == hkl_vector_cmp(&v1_ref, &v), __func__);
+
+	v = v1;
+	hkl_vector_project_on_plan_with_point(&v, &plan, &point2);
+	ok(0 == hkl_vector_cmp(&v2_ref, &v), __func__);
+}
+
+int main(int argc, char** argv)
+{
+	plan(32);
+
+	init();
+	cmp();
+	is_opposite();
+	norm2();
+	normalize();
+	scalar_product();
+	vectorial_product();
+	angle();
+	oriented_angle();
+	oriented_angle_points();
+	rotated_around_vector();
+	rotated_around_line();
+	times_matrix();
+	project_on_plan();
+
+	return 0;
+}
diff --git a/tests/hkl3d-test-t.c b/tests/hkl3d-test-t.c
new file mode 100644
index 0000000..2ad2a79
--- /dev/null
+++ b/tests/hkl3d-test-t.c
@@ -0,0 +1,160 @@
+/* This file is part of the hkl3d library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2010-2013 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ *          Oussama Sboui <sboui at synchrotron-soleil.fr>
+ */
+#include <string.h>
+
+#include "hkl3d.h"
+#include "tap/basic.h"
+
+#define MODEL_FILENAME "data/diffabs.yaml"
+
+static void check_model_validity(Hkl3D *hkl3d)
+{
+	uint i, j;
+	uint len;
+	int res;
+	Hkl3DObject *obji;
+	Hkl3DObject *objj;
+	const darray_parameter *axes;
+
+	res = TRUE;
+
+	/* imported 1 config files with 7 Hkl3DObjects */
+	res &= hkl3d->config->len == 1;
+	res &= hkl3d->config->models[0]->len == 7;
+
+	/* all Hkl3DObjects must have a different axis_name */
+	len = hkl3d->config->models[0]->len;
+	for(i=0;i<len; ++i){
+		obji = hkl3d->config->models[0]->objects[i];
+		for (j=1; j<len-i; ++j){
+			objj = hkl3d->config->models[0]->objects[i+j];
+			if(!(strcmp(obji->axis_name, objj->axis_name))){
+				res &= FALSE;
+				break;
+			}
+		}
+		obji++;
+	}
+
+	/* check the _movingObjects validity, all Hkl3DAxis must have a size of 1 */
+	axes = hkl_geometry_axes_get(hkl3d->geometry->geometry);
+	for(i=0; i<darray_size(*axes); ++i)
+		res &= hkl3d->geometry->axes[i]->len == 1;
+
+	ok(res == TRUE, "no identical objects");
+}
+
+/* check the collision and that the right axes are colliding */
+static void check_collision(Hkl3D *hkl3d)
+{
+	char buffer[1000];
+	int res;
+	int i;
+
+	/* check the collision and that the right axes are colliding */
+	res = TRUE;
+	hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
+				       23., 0., 0., 0., 0., 0.);
+
+	res &= hkl3d_is_colliding(hkl3d) == TRUE;
+	strcpy(buffer, "");
+
+	/* now check that only delta and mu are colliding */
+	for(i=0; i<hkl3d->config->models[0]->len; ++i){
+		const char *name;
+		int tmp;
+
+		name = hkl3d->config->models[0]->objects[i]->axis_name;
+		tmp = hkl3d->config->models[0]->objects[i]->is_colliding == TRUE;
+		/* add the colliding axes to the buffer */
+		if(tmp){
+			strcat(buffer, " ");
+			strcat(buffer, name);
+		}
+
+		if(!strcmp(name, "mu") || !strcmp(name, "delta"))
+			res &= tmp == TRUE;
+		else
+			res &= tmp == FALSE;
+	}
+	ok(res == TRUE,  "collision [%s]", buffer);
+}
+
+static void check_no_collision(Hkl3D *hkl3d)
+{
+	int res;
+	int i;
+
+	/* check that rotating around komega/kappa/kphi do not create collisison */
+	res = TRUE;
+	hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
+				       0., 0., 0., 0., 0., 0.);
+	/* komega */
+	for(i=0; i<=360; i=i+10){
+		hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
+					       0., i, 0., 0., 0., 0.);
+		res &= hkl3d_is_colliding(hkl3d) == FALSE;
+	}
+
+	/* kappa */
+	for(i=0; i<=360; i=i+10){
+		hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
+					       0., 0., i, 0., 0., 0.);
+		res &= hkl3d_is_colliding(hkl3d) == FALSE;
+	}
+
+	/* kphi */
+	for(i=0; i<=360; i=i+10){
+		hkl_geometry_set_values_unit_v(hkl3d->geometry->geometry,
+					       0., 0., 0., i, 0., 0.);
+		res &= hkl3d_is_colliding(hkl3d) == FALSE;
+	}
+	ok(res == TRUE, "no-collision");
+}
+
+int main(int argc, char** argv)
+{
+	char* filename;
+	const HklFactory *factory;
+	HklGeometry *geometry;
+	Hkl3D *hkl3d;
+
+	factory = hkl_factory_get_by_name("K6C");
+	geometry = hkl_factory_create_new_geometry(factory);
+
+	/* compute the filename of the diffractometer config file */
+	filename  = test_file_path(MODEL_FILENAME);
+	hkl3d = hkl3d_new(filename, geometry);
+
+	plan(3);
+	check_model_validity(hkl3d);
+	check_collision(hkl3d);
+	check_no_collision(hkl3d);
+	/* TODO add/remove object*/
+
+	hkl3d_free(hkl3d);
+	test_file_path_free(filename);
+	hkl_geometry_free(geometry);
+
+	return 0;
+}
diff --git a/tests/runtests.c b/tests/runtests.c
new file mode 100644
index 0000000..5518c39
--- /dev/null
+++ b/tests/runtests.c
@@ -0,0 +1,1377 @@
+/*
+ * Run a set of tests, reporting results.
+ *
+ * Usage:
+ *
+ *      runtests [-b <build-dir>] [-s <source-dir>] <test-list>
+ *      runtests -o [-b <build-dir>] [-s <source-dir>] <test>
+ *
+ * In the first case, expects a list of executables located in the given file,
+ * one line per executable.  For each one, runs it as part of a test suite,
+ * reporting results.  Test output should start with a line containing the
+ * number of tests (numbered from 1 to this number), optionally preceded by
+ * "1..", although that line may be given anywhere in the output.  Each
+ * additional line should be in the following format:
+ *
+ *      ok <number>
+ *      not ok <number>
+ *      ok <number> # skip
+ *      not ok <number> # todo
+ *
+ * where <number> is the number of the test.  An optional comment is permitted
+ * after the number if preceded by whitespace.  ok indicates success, not ok
+ * indicates failure.  "# skip" and "# todo" are a special cases of a comment,
+ * and must start with exactly that formatting.  They indicate the test was
+ * skipped for some reason (maybe because it doesn't apply to this platform)
+ * or is testing something known to currently fail.  The text following either
+ * "# skip" or "# todo" and whitespace is the reason.
+ *
+ * As a special case, the first line of the output may be in the form:
+ *
+ *      1..0 # skip some reason
+ *
+ * which indicates that this entire test case should be skipped and gives a
+ * reason.
+ *
+ * Any other lines are ignored, although for compliance with the TAP protocol
+ * all lines other than the ones in the above format should be sent to
+ * standard error rather than standard output and start with #.
+ *
+ * This is a subset of TAP as documented in Test::Harness::TAP or
+ * TAP::Parser::Grammar, which comes with Perl.
+ *
+ * If the -o option is given, instead run a single test and display all of its
+ * output.  This is intended for use with failing tests so that the person
+ * running the test suite can get more details about what failed.
+ *
+ * If built with the C preprocessor symbols SOURCE and BUILD defined, C TAP
+ * Harness will export those values in the environment so that tests can find
+ * the source and build directory and will look for tests under both
+ * directories.  These paths can also be set with the -b and -s command-line
+ * options, which will override anything set at build time.
+ *
+ * Any bug reports, bug fixes, and improvements are very much welcome and
+ * should be sent to the e-mail address below.  This program is part of C TAP
+ * Harness <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+ *
+ * Copyright 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010, 2011
+ *     Russ Allbery <rra at stanford.edu>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+*/
+
+/* Required for fdopen(), getopt(), and putenv(). */
+#if defined(__STRICT_ANSI__) || defined(PEDANTIC)
+# ifndef _XOPEN_SOURCE
+#  define _XOPEN_SOURCE 500
+# endif
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <time.h>
+#include <unistd.h>
+
+/* sys/time.h must be included before sys/resource.h on some platforms. */
+#include <sys/resource.h>
+
+/* AIX doesn't have WCOREDUMP. */
+#ifndef WCOREDUMP
+# define WCOREDUMP(status)      ((unsigned)(status) & 0x80)
+#endif
+
+/*
+ * Used for iterating through arrays.  Returns the number of elements in the
+ * array (useful for a < upper bound in a for loop).
+ */
+#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+
+/*
+ * The source and build versions of the tests directory.  This is used to set
+ * the SOURCE and BUILD environment variables and find test programs, if set.
+ * Normally, this should be set as part of the build process to the test
+ * subdirectories of $(abs_top_srcdir) and $(abs_top_builddir) respectively.
+ */
+#ifndef SOURCE
+# define SOURCE NULL
+#endif
+#ifndef BUILD
+# define BUILD NULL
+#endif
+
+/* Test status codes. */
+enum test_status {
+    TEST_FAIL,
+    TEST_PASS,
+    TEST_SKIP,
+    TEST_INVALID
+};
+
+/* Indicates the state of our plan. */
+enum plan_status {
+    PLAN_INIT,                  /* Nothing seen yet. */
+    PLAN_FIRST,                 /* Plan seen before any tests. */
+    PLAN_PENDING,               /* Test seen and no plan yet. */
+    PLAN_FINAL                  /* Plan seen after some tests. */
+};
+
+/* Error exit statuses for test processes. */
+#define CHILDERR_DUP    100     /* Couldn't redirect stderr or stdout. */
+#define CHILDERR_EXEC   101     /* Couldn't exec child process. */
+#define CHILDERR_STDERR 102     /* Couldn't open stderr file. */
+
+/* Structure to hold data for a set of tests. */
+struct testset {
+    char *file;                 /* The file name of the test. */
+    char *path;                 /* The path to the test program. */
+    enum plan_status plan;      /* The status of our plan. */
+    unsigned long count;        /* Expected count of tests. */
+    unsigned long current;      /* The last seen test number. */
+    unsigned int length;        /* The length of the last status message. */
+    unsigned long passed;       /* Count of passing tests. */
+    unsigned long failed;       /* Count of failing lists. */
+    unsigned long skipped;      /* Count of skipped tests (passed). */
+    unsigned long allocated;    /* The size of the results table. */
+    enum test_status *results;  /* Table of results by test number. */
+    unsigned int aborted;       /* Whether the set was aborted. */
+    int reported;               /* Whether the results were reported. */
+    int status;                 /* The exit status of the test. */
+    unsigned int all_skipped;   /* Whether all tests were skipped. */
+    char *reason;               /* Why all tests were skipped. */
+};
+
+/* Structure to hold a linked list of test sets. */
+struct testlist {
+    struct testset *ts;
+    struct testlist *next;
+};
+
+/*
+ * Usage message.  Should be used as a printf format with two arguments: the
+ * path to runtests, given twice.
+ */
+static const char usage_message[] = "\
+Usage: %s [-b <build-dir>] [-s <source-dir>] <test> ...\n\
+       %s [-b <build-dir>] [-s <source-dir>] -l <test-list>\n\
+       %s -o [-b <build-dir>] [-s <source-dir>] <test>\n\
+\n\
+Options:\n\
+    -b <build-dir>      Set the build directory to <build-dir>\n\
+    -l <list>           Take the list of tests to run from <test-list>\n\
+    -o                  Run a single test rather than a list of tests\n\
+    -s <source-dir>     Set the source directory to <source-dir>\n\
+\n\
+runtests normally runs each test listed on the command line.  With the -l\n\
+option, it instead runs every test listed in a file.  With the -o option,\n\
+it instead runs a single test and shows its complete output.\n";
+
+/*
+ * Header used for test output.  %s is replaced by the file name of the list
+ * of tests.
+ */
+static const char banner[] = "\n\
+Running all tests listed in %s.  If any tests fail, run the failing\n\
+test program with runtests -o to see more details.\n\n";
+
+/* Header for reports of failed tests. */
+static const char header[] = "\n\
+Failed Set                 Fail/Total (%) Skip Stat  Failing Tests\n\
+-------------------------- -------------- ---- ----  ------------------------";
+
+/* Include the file name and line number in malloc failures. */
+#define xcalloc(n, size)  x_calloc((n), (size), __FILE__, __LINE__)
+#define xmalloc(size)     x_malloc((size), __FILE__, __LINE__)
+#define xrealloc(p, size) x_realloc((p), (size), __FILE__, __LINE__)
+#define xstrdup(p)        x_strdup((p), __FILE__, __LINE__)
+
+/*
+ * __attribute__ is available in gcc 2.5 and later, but only with gcc 2.7
+ * could you use the __format__ form of the attributes, which is what we use
+ * (to avoid confusion with other macros).
+ */
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#  define __attribute__(spec)   /* empty */
+# endif
+#endif
+
+/*
+ * We use __alloc_size__, but it was only available in fairly recent versions
+ * of GCC.  Suppress warnings about the unknown attribute if GCC is too old.
+ * We know that we're GCC at this point, so we can use the GCC variadic macro
+ * extension, which will still work with versions of GCC too old to have C99
+ * variadic macro support.
+ */
+#if !defined(__attribute__) && !defined(__alloc_size__)
+# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+#  define __alloc_size__(spec, args...) /* empty */
+# endif
+#endif
+
+/*
+ * LLVM and Clang pretend to be GCC but don't support all of the __attribute__
+ * settings that GCC does.  For them, suppress warnings about unknown
+ * attributes on declarations.  This unfortunately will affect the entire
+ * compilation context, but there's no push and pop available.
+ */
+#if !defined(__attribute__) && (defined(__llvm__) || defined(__clang__))
+# pragma GCC diagnostic ignored "-Wattributes"
+#endif
+
+/* Declare internal functions that benefit from compiler attributes. */
+static void sysdie(const char *, ...)
+    __attribute__((__nonnull__, __noreturn__, __format__(printf, 1, 2)));
+static void *x_calloc(size_t, size_t, const char *, int)
+    __attribute__((__alloc_size__(1, 2), __malloc__, __nonnull__));
+static void *x_malloc(size_t, const char *, int)
+    __attribute__((__alloc_size__(1), __malloc__, __nonnull__));
+static void *x_realloc(void *, size_t, const char *, int)
+    __attribute__((__alloc_size__(2), __malloc__, __nonnull__(3)));
+static char *x_strdup(const char *, const char *, int)
+    __attribute__((__malloc__, __nonnull__));
+
+
+/*
+ * Report a fatal error, including the results of strerror, and exit.
+ */
+static void
+sysdie(const char *format, ...)
+{
+    int oerrno;
+    va_list args;
+
+    oerrno = errno;
+    fflush(stdout);
+    fprintf(stderr, "runtests: ");
+    va_start(args, format);
+    vfprintf(stderr, format, args);
+    va_end(args);
+    fprintf(stderr, ": %s\n", strerror(oerrno));
+    exit(1);
+}
+
+
+/*
+ * Allocate zeroed memory, reporting a fatal error and exiting on failure.
+ */
+static void *
+x_calloc(size_t n, size_t size, const char *file, int line)
+{
+    void *p;
+
+    n = (n > 0) ? n : 1;
+    size = (size > 0) ? size : 1;
+    p = calloc(n, size);
+    if (p == NULL)
+        sysdie("failed to calloc %lu bytes at %s line %d",
+               (unsigned long) size, file, line);
+    return p;
+}
+
+
+/*
+ * Allocate memory, reporting a fatal error and exiting on failure.
+ */
+static void *
+x_malloc(size_t size, const char *file, int line)
+{
+    void *p;
+
+    p = malloc(size);
+    if (p == NULL)
+        sysdie("failed to malloc %lu bytes at %s line %d",
+               (unsigned long) size, file, line);
+    return p;
+}
+
+
+/*
+ * Reallocate memory, reporting a fatal error and exiting on failure.
+ */
+static void *
+x_realloc(void *p, size_t size, const char *file, int line)
+{
+    p = realloc(p, size);
+    if (p == NULL)
+        sysdie("failed to realloc %lu bytes at %s line %d",
+               (unsigned long) size, file, line);
+    return p;
+}
+
+
+/*
+ * Copy a string, reporting a fatal error and exiting on failure.
+ */
+static char *
+x_strdup(const char *s, const char *file, int line)
+{
+    char *p;
+    size_t len;
+
+    len = strlen(s) + 1;
+    p = malloc(len);
+    if (p == NULL)
+        sysdie("failed to strdup %lu bytes at %s line %d",
+               (unsigned long) len, file, line);
+    memcpy(p, s, len);
+    return p;
+}
+
+
+/*
+ * Given a struct timeval, return the number of seconds it represents as a
+ * double.  Use difftime() to convert a time_t to a double.
+ */
+static double
+tv_seconds(const struct timeval *tv)
+{
+    return difftime(tv->tv_sec, 0) + tv->tv_usec * 1e-6;
+}
+
+
+/*
+ * Given two struct timevals, return the difference in seconds.
+ */
+static double
+tv_diff(const struct timeval *tv1, const struct timeval *tv0)
+{
+    return tv_seconds(tv1) - tv_seconds(tv0);
+}
+
+
+/*
+ * Given two struct timevals, return the sum in seconds as a double.
+ */
+static double
+tv_sum(const struct timeval *tv1, const struct timeval *tv2)
+{
+    return tv_seconds(tv1) + tv_seconds(tv2);
+}
+
+
+/*
+ * Given a pointer to a string, skip any leading whitespace and return a
+ * pointer to the first non-whitespace character.
+ */
+static const char *
+skip_whitespace(const char *p)
+{
+    while (isspace((unsigned char)(*p)))
+        p++;
+    return p;
+}
+
+
+/*
+ * Start a program, connecting its stdout to a pipe on our end and its stderr
+ * to /dev/null, and storing the file descriptor to read from in the two
+ * argument.  Returns the PID of the new process.  Errors are fatal.
+ */
+static pid_t
+test_start(const char *path, int *fd)
+{
+    int fds[2], errfd;
+    pid_t child;
+
+    if (pipe(fds) == -1) {
+        puts("ABORTED");
+        fflush(stdout);
+        sysdie("can't create pipe");
+    }
+    child = fork();
+    if (child == (pid_t) -1) {
+        puts("ABORTED");
+        fflush(stdout);
+        sysdie("can't fork");
+    } else if (child == 0) {
+        /* In child.  Set up our stdout and stderr. */
+        errfd = open("/dev/null", O_WRONLY);
+        if (errfd < 0)
+            _exit(CHILDERR_STDERR);
+        if (dup2(errfd, 2) == -1)
+            _exit(CHILDERR_DUP);
+        close(fds[0]);
+        if (dup2(fds[1], 1) == -1)
+            _exit(CHILDERR_DUP);
+
+        /* Now, exec our process. */
+        if (execl(path, path, (char *) 0) == -1)
+            _exit(CHILDERR_EXEC);
+    } else {
+        /* In parent.  Close the extra file descriptor. */
+        close(fds[1]);
+    }
+    *fd = fds[0];
+    return child;
+}
+
+
+/*
+ * Back up over the output saying what test we were executing.
+ */
+static void
+test_backspace(struct testset *ts)
+{
+    unsigned int i;
+
+    if (!isatty(STDOUT_FILENO))
+        return;
+    for (i = 0; i < ts->length; i++)
+        putchar('\b');
+    for (i = 0; i < ts->length; i++)
+        putchar(' ');
+    for (i = 0; i < ts->length; i++)
+        putchar('\b');
+    ts->length = 0;
+}
+
+
+/*
+ * Read the plan line of test output, which should contain the range of test
+ * numbers.  We may initialize the testset structure here if we haven't yet
+ * seen a test.  Return true if initialization succeeded and the test should
+ * continue, false otherwise.
+ */
+static int
+test_plan(const char *line, struct testset *ts)
+{
+    unsigned long i;
+    long n;
+
+    /*
+     * Accept a plan without the leading 1.. for compatibility with older
+     * versions of runtests.  This will only be allowed if we've not yet seen
+     * a test result.
+     */
+    line = skip_whitespace(line);
+    if (strncmp(line, "1..", 3) == 0)
+        line += 3;
+
+    /*
+     * Get the count, check it for validity, and initialize the struct.  If we
+     * have something of the form "1..0 # skip foo", the whole file was
+     * skipped; record that.  If we do skip the whole file, zero out all of
+     * our statistics, since they're no longer relevant.  strtol is called
+     * with a second argument to advance the line pointer past the count to
+     * make it simpler to detect the # skip case.
+     */
+    n = strtol(line, (char **) &line, 10);
+    if (n == 0) {
+        line = skip_whitespace(line);
+        if (*line == '#') {
+            line = skip_whitespace(line + 1);
+            if (strncasecmp(line, "skip", 4) == 0) {
+                line = skip_whitespace(line + 4);
+                if (*line != '\0') {
+                    ts->reason = xstrdup(line);
+                    ts->reason[strlen(ts->reason) - 1] = '\0';
+                }
+                ts->all_skipped = 1;
+                ts->aborted = 1;
+                ts->count = 0;
+                ts->passed = 0;
+                ts->skipped = 0;
+                ts->failed = 0;
+                return 0;
+            }
+        }
+    }
+    if (n <= 0) {
+        puts("ABORTED (invalid test count)");
+        ts->aborted = 1;
+        ts->reported = 1;
+        return 0;
+    }
+    if (ts->plan == PLAN_INIT && ts->allocated == 0) {
+        ts->count = n;
+        ts->allocated = n;
+        ts->plan = PLAN_FIRST;
+        ts->results = xmalloc(ts->count * sizeof(enum test_status));
+        for (i = 0; i < ts->count; i++)
+            ts->results[i] = TEST_INVALID;
+    } else if (ts->plan == PLAN_PENDING) {
+        if ((unsigned long) n < ts->count) {
+            test_backspace(ts);
+            printf("ABORTED (invalid test number %lu)\n", ts->count);
+            ts->aborted = 1;
+            ts->reported = 1;
+            return 0;
+        }
+        ts->count = n;
+        if ((unsigned long) n > ts->allocated) {
+            ts->results = xrealloc(ts->results, n * sizeof(enum test_status));
+            for (i = ts->allocated; i < ts->count; i++)
+                ts->results[i] = TEST_INVALID;
+            ts->allocated = n;
+        }
+        ts->plan = PLAN_FINAL;
+    }
+    return 1;
+}
+
+
+/*
+ * Given a single line of output from a test, parse it and return the success
+ * status of that test.  Anything printed to stdout not matching the form
+ * /^(not )?ok \d+/ is ignored.  Sets ts->current to the test number that just
+ * reported status.
+ */
+static void
+test_checkline(const char *line, struct testset *ts)
+{
+    enum test_status status = TEST_PASS;
+    const char *bail;
+    char *end;
+    long number;
+    unsigned long i, current;
+    int outlen;
+
+    /* Before anything, check for a test abort. */
+    bail = strstr(line, "Bail out!");
+    if (bail != NULL) {
+        bail = skip_whitespace(bail + strlen("Bail out!"));
+        if (*bail != '\0') {
+            size_t length;
+
+            length = strlen(bail);
+            if (bail[length - 1] == '\n')
+                length--;
+            test_backspace(ts);
+            printf("ABORTED (%.*s)\n", (int) length, bail);
+            ts->reported = 1;
+        }
+        ts->aborted = 1;
+        return;
+    }
+
+    /*
+     * If the given line isn't newline-terminated, it was too big for an
+     * fgets(), which means ignore it.
+     */
+    if (line[strlen(line) - 1] != '\n')
+        return;
+
+    /* If the line begins with a hash mark, ignore it. */
+    if (line[0] == '#')
+        return;
+
+    /* If we haven't yet seen a plan, look for one. */
+    if (ts->plan == PLAN_INIT && isdigit((unsigned char)(*line))) {
+        if (!test_plan(line, ts))
+            return;
+    } else if (strncmp(line, "1..", 3) == 0) {
+        if (ts->plan == PLAN_PENDING) {
+            if (!test_plan(line, ts))
+                return;
+        } else {
+            test_backspace(ts);
+            puts("ABORTED (multiple plans)");
+            ts->aborted = 1;
+            ts->reported = 1;
+            return;
+        }
+    }
+
+    /* Parse the line, ignoring something we can't parse. */
+    if (strncmp(line, "not ", 4) == 0) {
+        status = TEST_FAIL;
+        line += 4;
+    }
+    if (strncmp(line, "ok", 2) != 0)
+        return;
+    line = skip_whitespace(line + 2);
+    errno = 0;
+    number = strtol(line, &end, 10);
+    if (errno != 0 || end == line)
+        number = ts->current + 1;
+    current = number;
+    if (number <= 0 || (current > ts->count && ts->plan == PLAN_FIRST)) {
+        test_backspace(ts);
+        printf("ABORTED (invalid test number %lu)\n", current);
+        ts->aborted = 1;
+        ts->reported = 1;
+        return;
+    }
+
+    /* We have a valid test result.  Tweak the results array if needed. */
+    if (ts->plan == PLAN_INIT || ts->plan == PLAN_PENDING) {
+        ts->plan = PLAN_PENDING;
+        if (current > ts->count)
+            ts->count = current;
+        if (current > ts->allocated) {
+            unsigned long n;
+
+            n = (ts->allocated == 0) ? 32 : ts->allocated * 2;
+            if (n < current)
+                n = current;
+            ts->results = xrealloc(ts->results, n * sizeof(enum test_status));
+            for (i = ts->allocated; i < n; i++)
+                ts->results[i] = TEST_INVALID;
+            ts->allocated = n;
+        }
+    }
+
+    /*
+     * Handle directives.  We should probably do something more interesting
+     * with unexpected passes of todo tests.
+     */
+    while (isdigit((unsigned char)(*line)))
+        line++;
+    line = skip_whitespace(line);
+    if (*line == '#') {
+        line = skip_whitespace(line + 1);
+        if (strncasecmp(line, "skip", 4) == 0)
+            status = TEST_SKIP;
+        if (strncasecmp(line, "todo", 4) == 0)
+            status = (status == TEST_FAIL) ? TEST_SKIP : TEST_FAIL;
+    }
+
+    /* Make sure that the test number is in range and not a duplicate. */
+    if (ts->results[current - 1] != TEST_INVALID) {
+        test_backspace(ts);
+        printf("ABORTED (duplicate test number %lu)\n", current);
+        ts->aborted = 1;
+        ts->reported = 1;
+        return;
+    }
+
+    /* Good results.  Increment our various counters. */
+    switch (status) {
+        case TEST_PASS: ts->passed++;   break;
+        case TEST_FAIL: ts->failed++;   break;
+        case TEST_SKIP: ts->skipped++;  break;
+        case TEST_INVALID:              break;
+    }
+    ts->current = current;
+    ts->results[current - 1] = status;
+    if (isatty(STDOUT_FILENO)) {
+        test_backspace(ts);
+        if (ts->plan == PLAN_PENDING)
+            outlen = printf("%lu/?", current);
+        else
+            outlen = printf("%lu/%lu", current, ts->count);
+        ts->length = (outlen >= 0) ? outlen : 0;
+        fflush(stdout);
+    }
+}
+
+
+/*
+ * Print out a range of test numbers, returning the number of characters it
+ * took up.  Takes the first number, the last number, the number of characters
+ * already printed on the line, and the limit of number of characters the line
+ * can hold.  Add a comma and a space before the range if chars indicates that
+ * something has already been printed on the line, and print ... instead if
+ * chars plus the space needed would go over the limit (use a limit of 0 to
+ * disable this).
+ */
+static unsigned int
+test_print_range(unsigned long first, unsigned long last, unsigned int chars,
+                 unsigned int limit)
+{
+    unsigned int needed = 0;
+    unsigned long n;
+
+    for (n = first; n > 0; n /= 10)
+        needed++;
+    if (last > first) {
+        for (n = last; n > 0; n /= 10)
+            needed++;
+        needed++;
+    }
+    if (chars > 0)
+        needed += 2;
+    if (limit > 0 && chars + needed > limit) {
+        needed = 0;
+        if (chars <= limit) {
+            if (chars > 0) {
+                printf(", ");
+                needed += 2;
+            }
+            printf("...");
+            needed += 3;
+        }
+    } else {
+        if (chars > 0)
+            printf(", ");
+        if (last > first)
+            printf("%lu-", first);
+        printf("%lu", last);
+    }
+    return needed;
+}
+
+
+/*
+ * Summarize a single test set.  The second argument is 0 if the set exited
+ * cleanly, a positive integer representing the exit status if it exited
+ * with a non-zero status, and a negative integer representing the signal
+ * that terminated it if it was killed by a signal.
+ */
+static void
+test_summarize(struct testset *ts, int status)
+{
+    unsigned long i;
+    unsigned long missing = 0;
+    unsigned long failed = 0;
+    unsigned long first = 0;
+    unsigned long last = 0;
+
+    if (ts->aborted) {
+        fputs("ABORTED", stdout);
+        if (ts->count > 0)
+            printf(" (passed %lu/%lu)", ts->passed, ts->count - ts->skipped);
+    } else {
+        for (i = 0; i < ts->count; i++) {
+            if (ts->results[i] == TEST_INVALID) {
+                if (missing == 0)
+                    fputs("MISSED ", stdout);
+                if (first && i == last)
+                    last = i + 1;
+                else {
+                    if (first)
+                        test_print_range(first, last, missing - 1, 0);
+                    missing++;
+                    first = i + 1;
+                    last = i + 1;
+                }
+            }
+        }
+        if (first)
+            test_print_range(first, last, missing - 1, 0);
+        first = 0;
+        last = 0;
+        for (i = 0; i < ts->count; i++) {
+            if (ts->results[i] == TEST_FAIL) {
+                if (missing && !failed)
+                    fputs("; ", stdout);
+                if (failed == 0)
+                    fputs("FAILED ", stdout);
+                if (first && i == last)
+                    last = i + 1;
+                else {
+                    if (first)
+                        test_print_range(first, last, failed - 1, 0);
+                    failed++;
+                    first = i + 1;
+                    last = i + 1;
+                }
+            }
+        }
+        if (first)
+            test_print_range(first, last, failed - 1, 0);
+        if (!missing && !failed) {
+            fputs(!status ? "ok" : "dubious", stdout);
+            if (ts->skipped > 0) {
+                if (ts->skipped == 1)
+                    printf(" (skipped %lu test)", ts->skipped);
+                else
+                    printf(" (skipped %lu tests)", ts->skipped);
+            }
+        }
+    }
+    if (status > 0)
+        printf(" (exit status %d)", status);
+    else if (status < 0)
+        printf(" (killed by signal %d%s)", -status,
+               WCOREDUMP(ts->status) ? ", core dumped" : "");
+    putchar('\n');
+}
+
+
+/*
+ * Given a test set, analyze the results, classify the exit status, handle a
+ * few special error messages, and then pass it along to test_summarize() for
+ * the regular output.  Returns true if the test set ran successfully and all
+ * tests passed or were skipped, false otherwise.
+ */
+static int
+test_analyze(struct testset *ts)
+{
+    if (ts->reported)
+        return 0;
+    if (ts->all_skipped) {
+        if (ts->reason == NULL)
+            puts("skipped");
+        else
+            printf("skipped (%s)\n", ts->reason);
+        return 1;
+    } else if (WIFEXITED(ts->status) && WEXITSTATUS(ts->status) != 0) {
+        switch (WEXITSTATUS(ts->status)) {
+        case CHILDERR_DUP:
+            if (!ts->reported)
+                puts("ABORTED (can't dup file descriptors)");
+            break;
+        case CHILDERR_EXEC:
+            if (!ts->reported)
+                puts("ABORTED (execution failed -- not found?)");
+            break;
+        case CHILDERR_STDERR:
+            if (!ts->reported)
+                puts("ABORTED (can't open /dev/null)");
+            break;
+        default:
+            test_summarize(ts, WEXITSTATUS(ts->status));
+            break;
+        }
+        return 0;
+    } else if (WIFSIGNALED(ts->status)) {
+        test_summarize(ts, -WTERMSIG(ts->status));
+        return 0;
+    } else if (ts->plan != PLAN_FIRST && ts->plan != PLAN_FINAL) {
+        puts("ABORTED (no valid test plan)");
+        ts->aborted = 1;
+        return 0;
+    } else {
+        test_summarize(ts, 0);
+        return (ts->failed == 0);
+    }
+}
+
+
+/*
+ * Runs a single test set, accumulating and then reporting the results.
+ * Returns true if the test set was successfully run and all tests passed,
+ * false otherwise.
+ */
+static int
+test_run(struct testset *ts)
+{
+    pid_t testpid, child;
+    int outfd, status;
+    unsigned long i;
+    FILE *output;
+    char buffer[BUFSIZ];
+
+    /* Run the test program. */
+    testpid = test_start(ts->path, &outfd);
+    output = fdopen(outfd, "r");
+    if (!output) {
+        puts("ABORTED");
+        fflush(stdout);
+        sysdie("fdopen failed");
+    }
+
+    /* Pass each line of output to test_checkline(). */
+    while (!ts->aborted && fgets(buffer, sizeof(buffer), output))
+        test_checkline(buffer, ts);
+    if (ferror(output) || ts->plan == PLAN_INIT)
+        ts->aborted = 1;
+    test_backspace(ts);
+
+    /*
+     * Consume the rest of the test output, close the output descriptor,
+     * retrieve the exit status, and pass that information to test_analyze()
+     * for eventual output.
+     */
+    while (fgets(buffer, sizeof(buffer), output))
+        ;
+    fclose(output);
+    child = waitpid(testpid, &ts->status, 0);
+    if (child == (pid_t) -1) {
+        if (!ts->reported) {
+            puts("ABORTED");
+            fflush(stdout);
+        }
+        sysdie("waitpid for %u failed", (unsigned int) testpid);
+    }
+    if (ts->all_skipped)
+        ts->aborted = 0;
+    status = test_analyze(ts);
+
+    /* Convert missing tests to failed tests. */
+    for (i = 0; i < ts->count; i++) {
+        if (ts->results[i] == TEST_INVALID) {
+            ts->failed++;
+            ts->results[i] = TEST_FAIL;
+            status = 0;
+        }
+    }
+    return status;
+}
+
+
+/* Summarize a list of test failures. */
+static void
+test_fail_summary(const struct testlist *fails)
+{
+    struct testset *ts;
+    unsigned int chars;
+    unsigned long i, first, last, total;
+
+    puts(header);
+
+    /* Failed Set                 Fail/Total (%) Skip Stat  Failing (25)
+       -------------------------- -------------- ---- ----  -------------- */
+    for (; fails; fails = fails->next) {
+        ts = fails->ts;
+        total = ts->count - ts->skipped;
+        printf("%-26.26s %4lu/%-4lu %3.0f%% %4lu ", ts->file, ts->failed,
+               total, total ? (ts->failed * 100.0) / total : 0,
+               ts->skipped);
+        if (WIFEXITED(ts->status))
+            printf("%4d  ", WEXITSTATUS(ts->status));
+        else
+            printf("  --  ");
+        if (ts->aborted) {
+            puts("aborted");
+            continue;
+        }
+        chars = 0;
+        first = 0;
+        last = 0;
+        for (i = 0; i < ts->count; i++) {
+            if (ts->results[i] == TEST_FAIL) {
+                if (first != 0 && i == last)
+                    last = i + 1;
+                else {
+                    if (first != 0)
+                        chars += test_print_range(first, last, chars, 19);
+                    first = i + 1;
+                    last = i + 1;
+                }
+            }
+        }
+        if (first != 0)
+            test_print_range(first, last, chars, 19);
+        putchar('\n');
+    }
+}
+
+
+/*
+ * Check whether a given file path is a valid test.  Currently, this checks
+ * whether it is executable and is a regular file.  Returns true or false.
+ */
+static int
+is_valid_test(const char *path)
+{
+    struct stat st;
+
+    if (access(path, X_OK) < 0)
+        return 0;
+    if (stat(path, &st) < 0)
+        return 0;
+    if (!S_ISREG(st.st_mode))
+        return 0;
+    return 1;
+}
+
+
+/*
+ * Given the name of a test, a pointer to the testset struct, and the source
+ * and build directories, find the test.  We try first relative to the current
+ * directory, then in the build directory (if not NULL), then in the source
+ * directory.  In each of those directories, we first try a "-t" extension and
+ * then a ".t" extension.  When we find an executable program, we return the
+ * path to that program.  If none of those paths are executable, just fill in
+ * the name of the test as is.
+ *
+ * The caller is responsible for freeing the path member of the testset
+ * struct.
+ */
+static char *
+find_test(const char *name, const char *source, const char *build)
+{
+    char *path;
+    const char *bases[3], *suffix, *base;
+    unsigned int i, j;
+    const char *suffixes[3] = { "-t", ".t", "" };
+
+    /* Possible base directories. */
+    bases[0] = ".";
+    bases[1] = build;
+    bases[2] = source;
+
+    /* Try each suffix with each base. */
+    for (i = 0; i < ARRAY_SIZE(suffixes); i++) {
+        suffix = suffixes[i];
+        for (j = 0; j < ARRAY_SIZE(bases); j++) {
+            base = bases[j];
+            if (base == NULL)
+                continue;
+            path = xmalloc(strlen(base) + strlen(name) + strlen(suffix) + 2);
+            sprintf(path, "%s/%s%s", base, name, suffix);
+            if (is_valid_test(path))
+                return path;
+            free(path);
+            path = NULL;
+        }
+    }
+    if (path == NULL)
+        path = xstrdup(name);
+    return path;
+}
+
+
+/*
+ * Read a list of tests from a file, returning the list of tests as a struct
+ * testlist.  Reports an error to standard error and exits if the list of
+ * tests cannot be read.
+ */
+static struct testlist *
+read_test_list(const char *filename)
+{
+    FILE *file;
+    unsigned int line;
+    size_t length;
+    char buffer[BUFSIZ];
+    struct testlist *listhead, *current;
+
+    /* Create the initial container list that will hold our results. */
+    listhead = xmalloc(sizeof(struct testlist));
+    listhead->ts = NULL;
+    listhead->next = NULL;
+    current = NULL;
+
+    /*
+     * Open our file of tests to run and read it line by line, creating a new
+     * struct testlist and struct testset for each line.
+     */
+    file = fopen(filename, "r");
+    if (file == NULL)
+        sysdie("can't open %s", filename);
+    line = 0;
+    while (fgets(buffer, sizeof(buffer), file)) {
+        line++;
+        length = strlen(buffer) - 1;
+        if (buffer[length] != '\n') {
+            fprintf(stderr, "%s:%u: line too long\n", filename, line);
+            exit(1);
+        }
+        buffer[length] = '\0';
+        if (current == NULL)
+            current = listhead;
+        else {
+            current->next = xmalloc(sizeof(struct testlist));
+            current = current->next;
+            current->next = NULL;
+        }
+        current->ts = xcalloc(1, sizeof(struct testset));
+        current->ts->plan = PLAN_INIT;
+        current->ts->file = xstrdup(buffer);
+        current->ts->reason = NULL;
+    }
+    fclose(file);
+
+    /* Return the results. */
+    return listhead;
+}
+
+
+/*
+ * Build a list of tests from command line arguments.  Takes the argv and argc
+ * representing the command line arguments and returns a newly allocated test
+ * list.  The caller is responsible for freeing.
+ */
+static struct testlist *
+build_test_list(char *argv[], int argc)
+{
+    int i;
+    struct testlist *listhead, *current;
+
+    /* Create the initial container list that will hold our results. */
+    listhead = xmalloc(sizeof(struct testlist));
+    listhead->ts = NULL;
+    listhead->next = NULL;
+    current = NULL;
+
+    /* Walk the list of arguments and create test sets for them. */
+    for (i = 0; i < argc; i++) {
+        if (current == NULL)
+            current = listhead;
+        else {
+            current->next = xmalloc(sizeof(struct testlist));
+            current = current->next;
+            current->next = NULL;
+        }
+        current->ts = xcalloc(1, sizeof(struct testset));
+        current->ts->plan = PLAN_INIT;
+        current->ts->file = xstrdup(argv[i]);
+        current->ts->reason = NULL;
+    }
+
+    /* Return the results. */
+    return listhead;
+}
+
+
+/* Free a struct testset. */
+static void
+free_testset(struct testset *ts)
+{
+    free(ts->file);
+    free(ts->path);
+    free(ts->results);
+    if (ts->reason != NULL)
+        free(ts->reason);
+    free(ts);
+}
+
+
+/*
+ * Run a batch of tests.  Takes two additional parameters: the root of the
+ * source directory and the root of the build directory.  Test programs will
+ * be first searched for in the current directory, then the build directory,
+ * then the source directory.  Returns true iff all tests passed, and always
+ * frees the test list that's passed in.
+ */
+static int
+test_batch(struct testlist *tests, const char *source, const char *build)
+{
+    size_t length;
+    unsigned int i;
+    unsigned int longest = 0;
+    unsigned int count = 0;
+    struct testset *ts;
+    struct timeval start, end;
+    struct rusage stats;
+    struct testlist *failhead = NULL;
+    struct testlist *failtail = NULL;
+    struct testlist *current, *next;
+    int succeeded;
+    unsigned long total = 0;
+    unsigned long passed = 0;
+    unsigned long skipped = 0;
+    unsigned long failed = 0;
+    unsigned long aborted = 0;
+
+    /* Walk the list of tests to find the longest name. */
+    for (current = tests; current != NULL; current = current->next) {
+        length = strlen(current->ts->file);
+        if (length > longest)
+            longest = length;
+    }
+
+    /*
+     * Add two to longest and round up to the nearest tab stop.  This is how
+     * wide the column for printing the current test name will be.
+     */
+    longest += 2;
+    if (longest % 8)
+        longest += 8 - (longest % 8);
+
+    /* Start the wall clock timer. */
+    gettimeofday(&start, NULL);
+
+    /* Now, plow through our tests again, running each one. */
+    for (current = tests; current != NULL; current = current->next) {
+        ts = current->ts;
+
+        /* Print out the name of the test file. */
+        fputs(ts->file, stdout);
+        for (i = strlen(ts->file); i < longest; i++)
+            putchar('.');
+        if (isatty(STDOUT_FILENO))
+            fflush(stdout);
+
+        /* Run the test. */
+        ts->path = find_test(ts->file, source, build);
+        succeeded = test_run(ts);
+        fflush(stdout);
+
+        /* Record cumulative statistics. */
+        aborted += ts->aborted;
+        total += ts->count + ts->all_skipped;
+        passed += ts->passed;
+        skipped += ts->skipped + ts->all_skipped;
+        failed += ts->failed;
+        count++;
+
+        /* If the test fails, we shuffle it over to the fail list. */
+        if (!succeeded) {
+            if (failhead == NULL) {
+                failhead = xmalloc(sizeof(struct testset));
+                failtail = failhead;
+            } else {
+                failtail->next = xmalloc(sizeof(struct testset));
+                failtail = failtail->next;
+            }
+            failtail->ts = ts;
+            failtail->next = NULL;
+        }
+    }
+    total -= skipped;
+
+    /* Stop the timer and get our child resource statistics. */
+    gettimeofday(&end, NULL);
+    getrusage(RUSAGE_CHILDREN, &stats);
+
+    /* Summarize the failures and free the failure list. */
+    if (failhead != NULL) {
+        test_fail_summary(failhead);
+        while (failhead != NULL) {
+            next = failhead->next;
+            free(failhead);
+            failhead = next;
+        }
+    }
+
+    /* Free the memory used by the test lists. */
+    while (tests != NULL) {
+        next = tests->next;
+        free_testset(tests->ts);
+        free(tests);
+        tests = next;
+    }
+
+    /* Print out the final test summary. */
+    putchar('\n');
+    if (aborted != 0) {
+        if (aborted == 1)
+            printf("Aborted %lu test set", aborted);
+        else
+            printf("Aborted %lu test sets", aborted);
+        printf(", passed %lu/%lu tests", passed, total);
+    }
+    else if (failed == 0)
+        fputs("All tests successful", stdout);
+    else
+        printf("Failed %lu/%lu tests, %.2f%% okay", failed, total,
+               (total - failed) * 100.0 / total);
+    if (skipped != 0) {
+        if (skipped == 1)
+            printf(", %lu test skipped", skipped);
+        else
+            printf(", %lu tests skipped", skipped);
+    }
+    puts(".");
+    printf("Files=%u,  Tests=%lu", count, total);
+    printf(",  %.2f seconds", tv_diff(&end, &start));
+    printf(" (%.2f usr + %.2f sys = %.2f CPU)\n",
+           tv_seconds(&stats.ru_utime), tv_seconds(&stats.ru_stime),
+           tv_sum(&stats.ru_utime, &stats.ru_stime));
+    return (failed == 0 && aborted == 0);
+}
+
+
+/*
+ * Run a single test case.  This involves just running the test program after
+ * having done the environment setup and finding the test program.
+ */
+static void
+test_single(const char *program, const char *source, const char *build)
+{
+    char *path;
+
+    path = find_test(program, source, build);
+    if (execl(path, path, (char *) 0) == -1)
+        sysdie("cannot exec %s", path);
+}
+
+
+/*
+ * Main routine.  Set the SOURCE and BUILD environment variables and then,
+ * given a file listing tests, run each test listed.
+ */
+int
+main(int argc, char *argv[])
+{
+    int option;
+    int status = 0;
+    int single = 0;
+    char *source_env = NULL;
+    char *build_env = NULL;
+    const char *shortlist;
+    const char *list = NULL;
+    const char *source = SOURCE;
+    const char *build = BUILD;
+    struct testlist *tests;
+
+    while ((option = getopt(argc, argv, "b:hl:os:")) != EOF) {
+        switch (option) {
+        case 'b':
+            build = optarg;
+            break;
+        case 'h':
+            printf(usage_message, argv[0], argv[0], argv[0]);
+            exit(0);
+            break;
+        case 'l':
+            list = optarg;
+            break;
+        case 'o':
+            single = 1;
+            break;
+        case 's':
+            source = optarg;
+            break;
+        default:
+            exit(1);
+        }
+    }
+    argv += optind;
+    argc -= optind;
+    if ((list == NULL && argc < 1) || (list != NULL && argc > 0)) {
+        fprintf(stderr, usage_message, argv[0], argv[0], argv[0]);
+        exit(1);
+    }
+
+    /* Set SOURCE and BUILD environment variables. */
+    if (source != NULL) {
+        source_env = xmalloc(strlen("SOURCE=") + strlen(source) + 1);
+        sprintf(source_env, "SOURCE=%s", source);
+        if (putenv(source_env) != 0)
+            sysdie("cannot set SOURCE in the environment");
+    }
+    if (build != NULL) {
+        build_env = xmalloc(strlen("BUILD=") + strlen(build) + 1);
+        sprintf(build_env, "BUILD=%s", build);
+        if (putenv(build_env) != 0)
+            sysdie("cannot set BUILD in the environment");
+    }
+
+    /* Run the tests as instructed. */
+    if (single)
+        test_single(argv[0], source, build);
+    else if (list != NULL) {
+        shortlist = strrchr(list, '/');
+        if (shortlist == NULL)
+            shortlist = list;
+        else
+            shortlist++;
+        printf(banner, shortlist);
+        tests = read_test_list(list);
+        status = test_batch(tests, source, build) ? 0 : 1;
+    } else {
+        tests = build_test_list(argv, argc);
+        status = test_batch(tests, source, build) ? 0 : 1;
+    }
+
+    /* For valgrind cleanliness, free all our memory. */
+    if (source_env != NULL) {
+        putenv((char *) "SOURCE=");
+        free(source_env);
+    }
+    if (build_env != NULL) {
+        putenv((char *) "BUILD=");
+        free(build_env);
+    }
+    exit(status);
+}
diff --git a/tests/tap/Makefile.am b/tests/tap/Makefile.am
new file mode 100644
index 0000000..a55a30b
--- /dev/null
+++ b/tests/tap/Makefile.am
@@ -0,0 +1,20 @@
+AM_CFLAGS = \
+	-I$(top_srcdir) \
+	-I$(abs_top_srcdir)/tests
+
+check_LIBRARIES = libtap.a
+libtap_a_SOURCES = \
+	basic.c \
+	basic.h \
+	float.h \
+	float.c \
+	macros.h \
+	hkl-tap.h \
+	hkl-tap.c
+
+# Support for GNU Flymake, in Emacs.
+check-syntax: AM_CFLAGS += -fsyntax-only -pipe
+check-syntax:
+	test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
+
+.PHONY: check-syntax
diff --git a/test/Makefile.in b/tests/tap/Makefile.in
similarity index 53%
rename from test/Makefile.in
rename to tests/tap/Makefile.in
index ae37eaa..a157d36 100644
--- a/test/Makefile.in
+++ b/tests/tap/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,6 +14,51 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -33,9 +77,9 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-check_PROGRAMS = test$(EXEEXT) bench$(EXEEXT)
-subdir = test
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+subdir = tests/tap
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/config/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
 	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@@ -47,45 +91,87 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-am_bench_OBJECTS = bench.$(OBJEXT)
-bench_OBJECTS = $(am_bench_OBJECTS)
-bench_LDADD = $(LDADD)
-am_test_OBJECTS = hkl-test-error.$(OBJEXT) \
-	hkl-test-pseudoaxis.$(OBJEXT) hkl-test-quaternion.$(OBJEXT) \
-	hkl-test-axis.$(OBJEXT) hkl-test-interval.$(OBJEXT) \
-	hkl-test-pseudoaxis-e4cv.$(OBJEXT) hkl-test-sample.$(OBJEXT) \
-	hkl-test.$(OBJEXT) hkl-test-lattice.$(OBJEXT) \
-	hkl-test-pseudoaxis-e6c.$(OBJEXT) hkl-test-source.$(OBJEXT) \
-	hkl-test-detector.$(OBJEXT) hkl-test-matrix.$(OBJEXT) \
-	hkl-test-pseudoaxis-k4cv.$(OBJEXT) hkl-test-vector.$(OBJEXT) \
-	hkl-test-geometry.$(OBJEXT) hkl-test-parameter.$(OBJEXT) \
-	hkl-test-pseudoaxis-k6c.$(OBJEXT) main.$(OBJEXT)
-test_OBJECTS = $(am_test_OBJECTS)
-test_LDADD = $(LDADD)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_ at AM_V@)
+am__v_AR_ = $(am__v_AR_ at AM_DEFAULT_V@)
+am__v_AR_0 = @echo "  AR      " $@;
+am__v_AR_1 = 
+libtap_a_AR = $(AR) $(ARFLAGS)
+libtap_a_LIBADD =
+am_libtap_a_OBJECTS = basic.$(OBJEXT) float.$(OBJEXT) \
+	hkl-tap.$(OBJEXT)
+libtap_a_OBJECTS = $(am_libtap_a_OBJECTS)
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_lt = $(am__v_lt_ at AM_V@)
+am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(bench_SOURCES) $(test_SOURCES)
-DIST_SOURCES = $(bench_SOURCES) $(test_SOURCES)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(libtap_a_SOURCES)
+DIST_SOURCES = $(libtap_a_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-am__tty_colors = \
-red=; grn=; lgn=; blu=; std=
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
+ASY = @ASY@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -102,6 +188,7 @@ CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -110,13 +197,29 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+G3D_CFLAGS = @G3D_CFLAGS@
+G3D_LIBS = @G3D_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GLU_CFLAGS = @GLU_CFLAGS@
+GLU_LIBS = @GLU_LIBS@
+GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
+GOBJECT_LIBS = @GOBJECT_LIBS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
 GREP = @GREP@
 GSL_CFLAGS = @GSL_CFLAGS@
 GSL_CONFIG = @GSL_CONFIG@
 GSL_LIBS = @GSL_LIBS@
 GTKDOC_CHECK = @GTKDOC_CHECK@
+GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
+GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
 GTKDOC_MKPDF = @GTKDOC_MKPDF@
 GTKDOC_REBASE = @GTKDOC_REBASE@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
 GTKMM_CFLAGS = @GTKMM_CFLAGS@
 GTKMM_LIBS = @GTKMM_LIBS@
 HTML_DIR = @HTML_DIR@
@@ -125,6 +228,14 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
+INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
+INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
+INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
+INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
+INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
+INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
+INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
@@ -133,7 +244,10 @@ LIBTOOL = @LIBTOOL@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LTP = @LTP@
+LTP_GENHTML = @LTP_GENHTML@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -156,12 +270,17 @@ RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SHTOOL = @SHTOOL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+VMAJ = @VMAJ@
+YAML_CFLAGS = @YAML_CFLAGS@
+YAML_LIBS = @YAML_LIBS@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -195,14 +314,15 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
+opengl_LIBS = @opengl_LIBS@
 pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+release_info = @release_info@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -211,36 +331,20 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-TESTS = $(check_PROGRAMS)
-AM_CPPFLAGS = -std=c89 -ansi -pedantic -D_BSD_SOURCE \
+version_info = @version_info@
+AM_CFLAGS = \
 	-I$(top_srcdir) \
-	-I$(top_srcdir)/hkl
-
-AM_LDFLAGS = $(top_builddir)/hkl/libhkl.la $(GSL_LIBS)
-test_SOURCES = \
-hkl-test.h \
-hkl-test-error.c \
-hkl-test-pseudoaxis.c \
-hkl-test-quaternion.c \
-hkl-test-axis.c \
-hkl-test-interval.c \
-hkl-test-pseudoaxis-e4cv.c \
-hkl-test-sample.c \
-hkl-test.c \
-hkl-test-lattice.c \
-hkl-test-pseudoaxis-e6c.c \
-hkl-test-source.c \
-hkl-test-detector.c \
-hkl-test-matrix.c \
-hkl-test-pseudoaxis-k4cv.c \
-hkl-test-vector.c \
-hkl-test-geometry.c \
-hkl-test-parameter.c \
-hkl-test-pseudoaxis-k6c.c \
-main.c
-
-bench_SOURCES = \
-	bench.c
+	-I$(abs_top_srcdir)/tests
+
+check_LIBRARIES = libtap.a
+libtap_a_SOURCES = \
+	basic.c \
+	basic.h \
+	float.h \
+	float.c \
+	macros.h \
+	hkl-tap.h \
+	hkl-tap.c
 
 all: all-am
 
@@ -255,9 +359,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/tap/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu test/Makefile
+	  $(AUTOMAKE) --gnu tests/tap/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -277,20 +381,13 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
-clean-checkPROGRAMS:
-	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-bench$(EXEEXT): $(bench_OBJECTS) $(bench_DEPENDENCIES) 
-	@rm -f bench$(EXEEXT)
-	$(LINK) $(bench_OBJECTS) $(bench_LDADD) $(LIBS)
-test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) 
-	@rm -f test$(EXEEXT)
-	$(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS)
+clean-checkLIBRARIES:
+	-test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES)
+
+libtap.a: $(libtap_a_OBJECTS) $(libtap_a_DEPENDENCIES) $(EXTRA_libtap_a_DEPENDENCIES) 
+	$(AM_V_at)-rm -f libtap.a
+	$(AM_V_AR)$(libtap_a_AR) libtap.a $(libtap_a_OBJECTS) $(libtap_a_LIBADD)
+	$(AM_V_at)$(RANLIB) libtap.a
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -298,47 +395,30 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bench.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-axis.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-detector.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-error.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-geometry.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-interval.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-lattice.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-matrix.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-parameter.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-pseudoaxis-e4cv.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-pseudoaxis-e6c.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-pseudoaxis-k4cv.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-pseudoaxis-k6c.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-pseudoaxis.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-quaternion.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-sample.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-source.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test-vector.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-test.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/basic.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/float.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hkl-tap.Po at am__quote@
 
 .c.o:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
- at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -346,26 +426,15 @@ mostlyclean-libtool:
 clean-libtool:
 	-rm -rf .libs _libs
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -377,15 +446,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -394,101 +459,24 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
 
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-check-TESTS: $(TESTS)
-	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
-	srcdir=$(srcdir); export srcdir; \
-	list=' $(TESTS) '; \
-	$(am__tty_colors); \
-	if test -n "$$list"; then \
-	  for tst in $$list; do \
-	    if test -f ./$$tst; then dir=./; \
-	    elif test -f $$tst; then dir=; \
-	    else dir="$(srcdir)/"; fi; \
-	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
-	      all=`expr $$all + 1`; \
-	      case " $(XFAIL_TESTS) " in \
-	      *[\ \	]$$tst[\ \	]*) \
-		xpass=`expr $$xpass + 1`; \
-		failed=`expr $$failed + 1`; \
-		col=$$red; res=XPASS; \
-	      ;; \
-	      *) \
-		col=$$grn; res=PASS; \
-	      ;; \
-	      esac; \
-	    elif test $$? -ne 77; then \
-	      all=`expr $$all + 1`; \
-	      case " $(XFAIL_TESTS) " in \
-	      *[\ \	]$$tst[\ \	]*) \
-		xfail=`expr $$xfail + 1`; \
-		col=$$lgn; res=XFAIL; \
-	      ;; \
-	      *) \
-		failed=`expr $$failed + 1`; \
-		col=$$red; res=FAIL; \
-	      ;; \
-	      esac; \
-	    else \
-	      skip=`expr $$skip + 1`; \
-	      col=$$blu; res=SKIP; \
-	    fi; \
-	    echo "$${col}$$res$${std}: $$tst"; \
-	  done; \
-	  if test "$$all" -eq 1; then \
-	    tests="test"; \
-	    All=""; \
-	  else \
-	    tests="tests"; \
-	    All="All "; \
-	  fi; \
-	  if test "$$failed" -eq 0; then \
-	    if test "$$xfail" -eq 0; then \
-	      banner="$$All$$all $$tests passed"; \
-	    else \
-	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
-	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
-	    fi; \
-	  else \
-	    if test "$$xpass" -eq 0; then \
-	      banner="$$failed of $$all $$tests failed"; \
-	    else \
-	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
-	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
-	    fi; \
-	  fi; \
-	  dashes="$$banner"; \
-	  skipped=""; \
-	  if test "$$skip" -ne 0; then \
-	    if test "$$skip" -eq 1; then \
-	      skipped="($$skip test was not run)"; \
-	    else \
-	      skipped="($$skip tests were not run)"; \
-	    fi; \
-	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
-	      dashes="$$skipped"; \
-	  fi; \
-	  report=""; \
-	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
-	    report="Please report to $(PACKAGE_BUGREPORT)"; \
-	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
-	      dashes="$$report"; \
-	  fi; \
-	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  if test "$$failed" -eq 0; then \
-	    echo "$$grn$$dashes"; \
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
 	  else \
-	    echo "$$red$$dashes"; \
+	    echo "$$sdir/$$i"; \
 	  fi; \
-	  echo "$$banner"; \
-	  test -z "$$skipped" || echo "$$skipped"; \
-	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes$$std"; \
-	  test "$$failed" -eq 0; \
-	else :; fi
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -521,8 +509,7 @@ distdir: $(DISTFILES)
 	  fi; \
 	done
 check-am: all-am
-	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
-	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+	$(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES)
 check: check-am
 all-am: Makefile
 installdirs:
@@ -536,10 +523,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 clean-generic:
@@ -553,7 +545,7 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+clean-am: clean-checkLIBRARIES clean-generic clean-libtool \
 	mostlyclean-am
 
 distclean: distclean-am
@@ -624,9 +616,9 @@ uninstall-am:
 
 .MAKE: check-am install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
-	clean-checkPROGRAMS clean-generic clean-libtool ctags \
-	distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+	clean-checkLIBRARIES clean-generic clean-libtool cscopelist-am \
+	ctags ctags-am distclean distclean-compile distclean-generic \
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
 	install-data-am install-dvi install-dvi-am install-exec \
@@ -636,7 +628,7 @@ uninstall-am:
 	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am
+	tags tags-am uninstall uninstall-am
 
 
 # Support for GNU Flymake, in Emacs.
diff --git a/tests/tap/basic.c b/tests/tap/basic.c
new file mode 100644
index 0000000..e8196fc
--- /dev/null
+++ b/tests/tap/basic.c
@@ -0,0 +1,629 @@
+/*
+ * Some utility routines for writing tests.
+ *
+ * Here are a variety of utility routines for writing tests compatible with
+ * the TAP protocol.  All routines of the form ok() or is*() take a test
+ * number and some number of appropriate arguments, check to be sure the
+ * results match the expected output using the arguments, and print out
+ * something appropriate for that test number.  Other utility routines help in
+ * constructing more complex tests, skipping tests, reporting errors, setting
+ * up the TAP output format, or finding things in the test environment.
+ *
+ * This file is part of C TAP Harness.  The current version plus supporting
+ * documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+ *
+ * Copyright 2009, 2010, 2011, 2012 Russ Allbery <rra at stanford.edu>
+ * Copyright 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2011, 2012
+ *     The Board of Trustees of the Leland Stanford Junior University
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _WIN32
+# include <direct.h>
+#else
+# include <sys/stat.h>
+#endif
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <tests/tap/basic.h>
+
+/* Windows provides mkdir and rmdir under different names. */
+#ifdef _WIN32
+# define mkdir(p, m) _mkdir(p)
+# define rmdir(p)    _rmdir(p)
+#endif
+
+/*
+ * The test count.  Always contains the number that will be used for the next
+ * test status.
+ */
+unsigned long testnum = 1;
+
+/*
+ * Status information stored so that we can give a test summary at the end of
+ * the test case.  We store the planned final test and the count of failures.
+ * We can get the highest test count from testnum.
+ *
+ * We also store the PID of the process that called plan() and only summarize
+ * results when that process exits, so as to not misreport results in forked
+ * processes.
+ *
+ * If _lazy is true, we're doing lazy planning and will print out the plan
+ * based on the last test number at the end of testing.
+ */
+static unsigned long _planned = 0;
+static unsigned long _failed  = 0;
+static pid_t _process = 0;
+static int _lazy = 0;
+
+
+/*
+ * Our exit handler.  Called on completion of the test to report a summary of
+ * results provided we're still in the original process.  This also handles
+ * printing out the plan if we used plan_lazy(), although that's suppressed if
+ * we never ran a test (due to an early bail, for example).
+ */
+static void
+finish(void)
+{
+    unsigned long highest = testnum - 1;
+
+    if (_planned == 0 && !_lazy)
+        return;
+    fflush(stderr);
+    if (_process != 0 && getpid() == _process) {
+        if (_lazy && highest > 0) {
+            printf("1..%lu\n", highest);
+            _planned = highest;
+        }
+        if (_planned > highest)
+            printf("# Looks like you planned %lu test%s but only ran %lu\n",
+                   _planned, (_planned > 1 ? "s" : ""), highest);
+        else if (_planned < highest)
+            printf("# Looks like you planned %lu test%s but ran %lu extra\n",
+                   _planned, (_planned > 1 ? "s" : ""), highest - _planned);
+        else if (_failed > 0)
+            printf("# Looks like you failed %lu test%s of %lu\n", _failed,
+                   (_failed > 1 ? "s" : ""), _planned);
+        else if (_planned > 1)
+            printf("# All %lu tests successful or skipped\n", _planned);
+        else
+            printf("# %lu test successful or skipped\n", _planned);
+    }
+}
+
+
+/*
+ * Initialize things.  Turns on line buffering on stdout and then prints out
+ * the number of tests in the test suite.
+ */
+void
+plan(unsigned long count)
+{
+    if (setvbuf(stdout, NULL, _IOLBF, BUFSIZ) != 0)
+        fprintf(stderr, "# cannot set stdout to line buffered: %s\n",
+                strerror(errno));
+    fflush(stderr);
+    printf("1..%lu\n", count);
+    testnum = 1;
+    _planned = count;
+    _process = getpid();
+    atexit(finish);
+}
+
+
+/*
+ * Initialize things for lazy planning, where we'll automatically print out a
+ * plan at the end of the program.  Turns on line buffering on stdout as well.
+ */
+void
+plan_lazy(void)
+{
+    if (setvbuf(stdout, NULL, _IOLBF, BUFSIZ) != 0)
+        fprintf(stderr, "# cannot set stdout to line buffered: %s\n",
+                strerror(errno));
+    testnum = 1;
+    _process = getpid();
+    _lazy = 1;
+    atexit(finish);
+}
+
+
+/*
+ * Skip the entire test suite and exits.  Should be called instead of plan(),
+ * not after it, since it prints out a special plan line.
+ */
+void
+skip_all(const char *format, ...)
+{
+    fflush(stderr);
+    printf("1..0 # skip");
+    if (format != NULL) {
+        va_list args;
+
+        putchar(' ');
+        va_start(args, format);
+        vprintf(format, args);
+        va_end(args);
+    }
+    putchar('\n');
+    exit(0);
+}
+
+
+/*
+ * Print the test description.
+ */
+static void
+print_desc(const char *format, va_list args)
+{
+    printf(" - ");
+    vprintf(format, args);
+}
+
+
+/*
+ * Takes a boolean success value and assumes the test passes if that value
+ * is true and fails if that value is false.
+ */
+void
+ok(int success, const char *format, ...)
+{
+    fflush(stderr);
+    printf("%sok %lu", success ? "" : "not ", testnum++);
+    if (!success)
+        _failed++;
+    if (format != NULL) {
+        va_list args;
+
+        va_start(args, format);
+        print_desc(format, args);
+        va_end(args);
+    }
+    putchar('\n');
+}
+
+
+/*
+ * Same as ok(), but takes the format arguments as a va_list.
+ */
+void
+okv(int success, const char *format, va_list args)
+{
+    fflush(stderr);
+    printf("%sok %lu", success ? "" : "not ", testnum++);
+    if (!success)
+        _failed++;
+    if (format != NULL)
+        print_desc(format, args);
+    putchar('\n');
+}
+
+
+/*
+ * Skip a test.
+ */
+void
+skip(const char *reason, ...)
+{
+    fflush(stderr);
+    printf("ok %lu # skip", testnum++);
+    if (reason != NULL) {
+        va_list args;
+
+        va_start(args, reason);
+        putchar(' ');
+        vprintf(reason, args);
+        va_end(args);
+    }
+    putchar('\n');
+}
+
+
+/*
+ * Report the same status on the next count tests.
+ */
+void
+ok_block(unsigned long count, int status, const char *format, ...)
+{
+    unsigned long i;
+
+    fflush(stderr);
+    for (i = 0; i < count; i++) {
+        printf("%sok %lu", status ? "" : "not ", testnum++);
+        if (!status)
+            _failed++;
+        if (format != NULL) {
+            va_list args;
+
+            va_start(args, format);
+            print_desc(format, args);
+            va_end(args);
+        }
+        putchar('\n');
+    }
+}
+
+
+/*
+ * Skip the next count tests.
+ */
+void
+skip_block(unsigned long count, const char *reason, ...)
+{
+    unsigned long i;
+
+    fflush(stderr);
+    for (i = 0; i < count; i++) {
+        printf("ok %lu # skip", testnum++);
+        if (reason != NULL) {
+            va_list args;
+
+            va_start(args, reason);
+            putchar(' ');
+            vprintf(reason, args);
+            va_end(args);
+        }
+        putchar('\n');
+    }
+}
+
+
+/*
+ * Takes an expected integer and a seen integer and assumes the test passes
+ * if those two numbers match.
+ */
+void
+is_int(long wanted, long seen, const char *format, ...)
+{
+    fflush(stderr);
+    if (wanted == seen)
+        printf("ok %lu", testnum++);
+    else {
+        printf("# wanted: %ld\n#   seen: %ld\n", wanted, seen);
+        printf("not ok %lu", testnum++);
+        _failed++;
+    }
+    if (format != NULL) {
+        va_list args;
+
+        va_start(args, format);
+        print_desc(format, args);
+        va_end(args);
+    }
+    putchar('\n');
+}
+
+
+/*
+ * Takes a string and what the string should be, and assumes the test passes
+ * if those strings match (using strcmp).
+ */
+void
+is_string(const char *wanted, const char *seen, const char *format, ...)
+{
+    if (wanted == NULL)
+        wanted = "(null)";
+    if (seen == NULL)
+        seen = "(null)";
+    fflush(stderr);
+    if (strcmp(wanted, seen) == 0)
+        printf("ok %lu", testnum++);
+    else {
+        printf("# wanted: %s\n#   seen: %s\n", wanted, seen);
+        printf("not ok %lu", testnum++);
+        _failed++;
+    }
+    if (format != NULL) {
+        va_list args;
+
+        va_start(args, format);
+        print_desc(format, args);
+        va_end(args);
+    }
+    putchar('\n');
+}
+
+
+/*
+ * Takes an expected unsigned long and a seen unsigned long and assumes the
+ * test passes if the two numbers match.  Otherwise, reports them in hex.
+ */
+void
+is_hex(unsigned long wanted, unsigned long seen, const char *format, ...)
+{
+    fflush(stderr);
+    if (wanted == seen)
+        printf("ok %lu", testnum++);
+    else {
+        printf("# wanted: %lx\n#   seen: %lx\n", (unsigned long) wanted,
+               (unsigned long) seen);
+        printf("not ok %lu", testnum++);
+        _failed++;
+    }
+    if (format != NULL) {
+        va_list args;
+
+        va_start(args, format);
+        print_desc(format, args);
+        va_end(args);
+    }
+    putchar('\n');
+}
+
+
+/*
+ * Bail out with an error.
+ */
+void
+bail(const char *format, ...)
+{
+    va_list args;
+
+    fflush(stderr);
+    fflush(stdout);
+    printf("Bail out! ");
+    va_start(args, format);
+    vprintf(format, args);
+    va_end(args);
+    printf("\n");
+    exit(1);
+}
+
+
+/*
+ * Bail out with an error, appending strerror(errno).
+ */
+void
+sysbail(const char *format, ...)
+{
+    va_list args;
+    int oerrno = errno;
+
+    fflush(stderr);
+    fflush(stdout);
+    printf("Bail out! ");
+    va_start(args, format);
+    vprintf(format, args);
+    va_end(args);
+    printf(": %s\n", strerror(oerrno));
+    exit(1);
+}
+
+
+/*
+ * Report a diagnostic to stderr.
+ */
+void
+diag(const char *format, ...)
+{
+    va_list args;
+
+    fflush(stderr);
+    fflush(stdout);
+    printf("# ");
+    va_start(args, format);
+    vprintf(format, args);
+    va_end(args);
+    printf("\n");
+}
+
+
+/*
+ * Report a diagnostic to stderr, appending strerror(errno).
+ */
+void
+sysdiag(const char *format, ...)
+{
+    va_list args;
+    int oerrno = errno;
+
+    fflush(stderr);
+    fflush(stdout);
+    printf("# ");
+    va_start(args, format);
+    vprintf(format, args);
+    va_end(args);
+    printf(": %s\n", strerror(oerrno));
+}
+
+
+/*
+ * Allocate cleared memory, reporting a fatal error with bail on failure.
+ */
+void *
+bcalloc(size_t n, size_t size)
+{
+    void *p;
+
+    p = calloc(n, size);
+    if (p == NULL)
+        sysbail("failed to calloc %lu", (unsigned long)(n * size));
+    return p;
+}
+
+
+/*
+ * Allocate memory, reporting a fatal error with bail on failure.
+ */
+void *
+bmalloc(size_t size)
+{
+    void *p;
+
+    p = malloc(size);
+    if (p == NULL)
+        sysbail("failed to malloc %lu", (unsigned long) size);
+    return p;
+}
+
+
+/*
+ * Reallocate memory, reporting a fatal error with bail on failure.
+ */
+void *
+brealloc(void *p, size_t size)
+{
+    p = realloc(p, size);
+    if (p == NULL)
+        sysbail("failed to realloc %lu bytes", (unsigned long) size);
+    return p;
+}
+
+
+/*
+ * Copy a string, reporting a fatal error with bail on failure.
+ */
+char *
+bstrdup(const char *s)
+{
+    char *p;
+    size_t len;
+
+    len = strlen(s) + 1;
+    p = malloc(len);
+    if (p == NULL)
+        sysbail("failed to strdup %lu bytes", (unsigned long) len);
+    memcpy(p, s, len);
+    return p;
+}
+
+
+/*
+ * Copy up to n characters of a string, reporting a fatal error with bail on
+ * failure.  Don't use the system strndup function, since it may not exist and
+ * the TAP library doesn't assume any portability support.
+ */
+char *
+bstrndup(const char *s, size_t n)
+{
+    const char *p;
+    char *copy;
+    size_t length;
+
+    /* Don't assume that the source string is nul-terminated. */
+    for (p = s; (size_t) (p - s) < n && *p != '\0'; p++)
+        ;
+    length = p - s;
+    copy = malloc(length + 1);
+    if (p == NULL)
+        sysbail("failed to strndup %lu bytes", (unsigned long) length);
+    memcpy(copy, s, length);
+    copy[length] = '\0';
+    return copy;
+}
+
+
+/*
+ * Locate a test file.  Given the partial path to a file, look under BUILD and
+ * then SOURCE for the file and return the full path to the file.  Returns
+ * NULL if the file doesn't exist.  A non-NULL return should be freed with
+ * test_file_path_free().
+ *
+ * This function uses sprintf because it attempts to be independent of all
+ * other portability layers.  The use immediately after a memory allocation
+ * should be safe without using snprintf or strlcpy/strlcat.
+ */
+char *
+test_file_path(const char *file)
+{
+    char *base;
+    char *path = NULL;
+    size_t length;
+    const char *envs[] = { "BUILD", "SOURCE", NULL };
+    int i;
+
+    for (i = 0; envs[i] != NULL; i++) {
+        base = getenv(envs[i]);
+        if (base == NULL)
+            continue;
+        length = strlen(base) + 1 + strlen(file) + 1;
+        path = bmalloc(length);
+        sprintf(path, "%s/%s", base, file);
+        if (access(path, R_OK) == 0)
+            break;
+        free(path);
+        path = NULL;
+    }
+    return path;
+}
+
+
+/*
+ * Free a path returned from test_file_path().  This function exists primarily
+ * for Windows, where memory must be freed from the same library domain that
+ * it was allocated from.
+ */
+void
+test_file_path_free(char *path)
+{
+    if (path != NULL)
+        free(path);
+}
+
+
+/*
+ * Create a temporary directory, tmp, under BUILD if set and the current
+ * directory if it does not.  Returns the path to the temporary directory in
+ * newly allocated memory, and calls bail on any failure.  The return value
+ * should be freed with test_tmpdir_free.
+ *
+ * This function uses sprintf because it attempts to be independent of all
+ * other portability layers.  The use immediately after a memory allocation
+ * should be safe without using snprintf or strlcpy/strlcat.
+ */
+char *
+test_tmpdir(void)
+{
+    const char *build;
+    char *path = NULL;
+    size_t length;
+
+    build = getenv("BUILD");
+    if (build == NULL)
+        build = ".";
+    length = strlen(build) + strlen("/tmp") + 1;
+    path = bmalloc(length);
+    sprintf(path, "%s/tmp", build);
+    if (access(path, X_OK) < 0)
+        if (mkdir(path, 0777) < 0)
+            sysbail("error creating temporary directory %s", path);
+    return path;
+}
+
+
+/*
+ * Free a path returned from test_tmpdir() and attempt to remove the
+ * directory.  If we can't delete the directory, don't worry; something else
+ * that hasn't yet cleaned up may still be using it.
+ */
+void
+test_tmpdir_free(char *path)
+{
+    rmdir(path);
+    if (path != NULL)
+        free(path);
+}
diff --git a/tests/tap/basic.h b/tests/tap/basic.h
new file mode 100644
index 0000000..fa4adaf
--- /dev/null
+++ b/tests/tap/basic.h
@@ -0,0 +1,134 @@
+/*
+ * Basic utility routines for the TAP protocol.
+ *
+ * This file is part of C TAP Harness.  The current version plus supporting
+ * documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+ *
+ * Copyright 2009, 2010, 2011, 2012 Russ Allbery <rra at stanford.edu>
+ * Copyright 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2011, 2012
+ *     The Board of Trustees of the Leland Stanford Junior University
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef TAP_BASIC_H
+#define TAP_BASIC_H 1
+
+#include <tests/tap/macros.h>
+#include <stdarg.h>             /* va_list */
+#include <sys/types.h>          /* size_t */
+
+/*
+ * Used for iterating through arrays.  ARRAY_SIZE returns the number of
+ * elements in the array (useful for a < upper bound in a for loop) and
+ * ARRAY_END returns a pointer to the element past the end (ISO C99 makes it
+ * legal to refer to such a pointer as long as it's never dereferenced).
+ */
+#define ARRAY_SIZE(array)       (sizeof(array) / sizeof((array)[0]))
+#define ARRAY_END(array)        (&(array)[ARRAY_SIZE(array)])
+
+BEGIN_DECLS
+
+/*
+ * The test count.  Always contains the number that will be used for the next
+ * test status.
+ */
+extern unsigned long testnum;
+
+/* Print out the number of tests and set standard output to line buffered. */
+void plan(unsigned long count);
+
+/*
+ * Prepare for lazy planning, in which the plan will be  printed automatically
+ * at the end of the test program.
+ */
+void plan_lazy(void);
+
+/* Skip the entire test suite.  Call instead of plan. */
+void skip_all(const char *format, ...)
+    __attribute__((__noreturn__, __format__(printf, 1, 2)));
+
+/*
+ * Basic reporting functions.  The okv() function is the same as ok() but
+ * takes the test description as a va_list to make it easier to reuse the
+ * reporting infrastructure when writing new tests.
+ */
+void ok(int success, const char *format, ...)
+    __attribute__((__format__(printf, 2, 3)));
+void okv(int success, const char *format, va_list args);
+void skip(const char *reason, ...)
+    __attribute__((__format__(printf, 1, 2)));
+
+/* Report the same status on, or skip, the next count tests. */
+void ok_block(unsigned long count, int success, const char *format, ...)
+    __attribute__((__format__(printf, 3, 4)));
+void skip_block(unsigned long count, const char *reason, ...)
+    __attribute__((__format__(printf, 2, 3)));
+
+/* Check an expected value against a seen value. */
+void is_int(long wanted, long seen, const char *format, ...)
+    __attribute__((__format__(printf, 3, 4)));
+void is_string(const char *wanted, const char *seen, const char *format, ...)
+    __attribute__((__format__(printf, 3, 4)));
+void is_hex(unsigned long wanted, unsigned long seen, const char *format, ...)
+    __attribute__((__format__(printf, 3, 4)));
+
+/* Bail out with an error.  sysbail appends strerror(errno). */
+void bail(const char *format, ...)
+    __attribute__((__noreturn__, __nonnull__, __format__(printf, 1, 2)));
+void sysbail(const char *format, ...)
+    __attribute__((__noreturn__, __nonnull__, __format__(printf, 1, 2)));
+
+/* Report a diagnostic to stderr prefixed with #. */
+void diag(const char *format, ...)
+    __attribute__((__nonnull__, __format__(printf, 1, 2)));
+void sysdiag(const char *format, ...)
+    __attribute__((__nonnull__, __format__(printf, 1, 2)));
+
+/* Allocate memory, reporting a fatal error with bail on failure. */
+void *bcalloc(size_t, size_t)
+    __attribute__((__alloc_size__(1, 2), __malloc__));
+void *bmalloc(size_t)
+    __attribute__((__alloc_size__(1), __malloc__));
+void *brealloc(void *, size_t)
+    __attribute__((__alloc_size__(2), __malloc__));
+char *bstrdup(const char *)
+    __attribute__((__malloc__, __nonnull__));
+char *bstrndup(const char *, size_t)
+    __attribute__((__malloc__, __nonnull__));
+
+/*
+ * Find a test file under BUILD or SOURCE, returning the full path.  The
+ * returned path should be freed with test_file_path_free().
+ */
+char *test_file_path(const char *file)
+    __attribute__((__malloc__, __nonnull__));
+void test_file_path_free(char *path);
+
+/*
+ * Create a temporary directory relative to BUILD and return the path.  The
+ * returned path should be freed with test_tmpdir_free.
+ */
+char *test_tmpdir(void)
+    __attribute__((__malloc__));
+void test_tmpdir_free(char *path);
+
+END_DECLS
+
+#endif /* TAP_BASIC_H */
diff --git a/tests/tap/float.c b/tests/tap/float.c
new file mode 100644
index 0000000..67dd555
--- /dev/null
+++ b/tests/tap/float.c
@@ -0,0 +1,67 @@
+/*
+ * Utility routines for writing floating point tests.
+ *
+ * Currently provides only one function, which checks whether a double is
+ * equal to an expected value within a given epsilon.  This is broken into a
+ * separate source file from the rest of the basic C TAP library because it
+ * may require linking with -lm on some platforms, and the package may not
+ * otherwise care about floating point.
+ *
+ * This file is part of C TAP Harness.  The current version plus supporting
+ * documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+ *
+ * Copyright 2008, 2010, 2012 Russ Allbery <rra at stanford.edu>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/* Required for isnan() and isinf(). */
+#if defined(__STRICT_ANSI__) || defined(PEDANTIC)
+# ifndef _XOPEN_SOURCE
+#  define _XOPEN_SOURCE 600
+# endif
+#endif
+
+#include <math.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#include <tests/tap/basic.h>
+#include <tests/tap/float.h>
+
+/*
+ * Takes an expected double and a seen double and assumes the test passes if
+ * those two numbers are within delta of each other.
+ */
+void
+is_double(double wanted, double seen, double epsilon, const char *format, ...)
+{
+    va_list args;
+
+    va_start(args, format);
+    fflush(stderr);
+    if ((isnan(wanted) && isnan(seen))
+        || (isinf(wanted) && isinf(seen) && wanted == seen)
+        || fabs(wanted - seen) <= epsilon)
+        okv(1, format, args);
+    else {
+        printf("# wanted: %g\n#   seen: %g\n", wanted, seen);
+        okv(0, format, args);
+    }
+}
diff --git a/tests/tap/float.h b/tests/tap/float.h
new file mode 100644
index 0000000..7464535
--- /dev/null
+++ b/tests/tap/float.h
@@ -0,0 +1,42 @@
+/*
+ * Floating point check function for the TAP protocol.
+ *
+ * This file is part of C TAP Harness.  The current version plus supporting
+ * documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+ *
+ * Copyright 2008, 2010, 2012 Russ Allbery <rra at stanford.edu>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef TAP_FLOAT_H
+#define TAP_FLOAT_H 1
+
+#include <tests/tap/macros.h>
+
+BEGIN_DECLS
+
+/* Check an expected value against a seen value within epsilon. */
+void is_double(double wanted, double seen, double epsilon,
+               const char *format, ...)
+    __attribute__((__format__(printf, 4, 5)));
+
+END_DECLS
+
+#endif /* TAP_FLOAT_H */
diff --git a/tests/tap/hkl-tap.c b/tests/tap/hkl-tap.c
new file mode 100644
index 0000000..2e8ad2a
--- /dev/null
+++ b/tests/tap/hkl-tap.c
@@ -0,0 +1,89 @@
+/* This file is part of the hkl library.
+ *
+ * The hkl library 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The hkl library 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 the hkl library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Copyright (C) 2003-2012 Synchrotron SOLEIL
+ *                         L'Orme des Merisiers Saint-Aubin
+ *                         BP 48 91192 GIF-sur-YVETTE CEDEX
+ *
+ * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
+ */
+#include <stdarg.h>
+
+#include "hkl-tap.h"
+#include "hkl/hkl-macros-private.h"
+
+int check_pseudoaxes_v(HklEngine *engine, ...)
+{
+	uint i;
+	va_list ap;
+	unsigned int len = hkl_engine_len(engine);
+	double values[len];
+
+	/* extract the variable part of the method */
+	va_start(ap, engine);
+	for(i=0; i<len; ++i)
+		values[i] = va_arg(ap, double);
+	va_end(ap);
+
+	return check_pseudoaxes(engine, values, len);
+}
+
+int check_pseudoaxes(HklEngine *engine,
+		     double expected[], uint len)
+{
+	int res = HKL_TRUE;
+	unsigned int i = 0;
+	HklParameter **pseudo_axis;
+	darray_parameter *pseudo_axes = hkl_engine_pseudo_axes(engine);
+
+	hkl_assert(hkl_engine_len(engine) == len);
+
+	darray_foreach(pseudo_axis, *pseudo_axes){
+		double current = hkl_parameter_value_get(*pseudo_axis);
+		res &= fabs(current - expected[i]) <= HKL_EPSILON;
+		if (!res){
+			fprintf(stderr, "current: %f, expected: %f, epsilon: %f\n",
+				current, expected[i], HKL_EPSILON);
+		}
+		++i;
+	}
+	return res;
+}
+
+/**
+ * hkl_engine_set_values_v: (skip)
+ * @self: the Engine
+ * @values: the values to set 
+ *
+ * set the values of the PseudoAxes with the given values. This method
+ * is only available for test as it is sort of brittle.
+ **/
+void hkl_engine_set_values_v(HklEngine *self, ...)
+{
+	uint i;
+	va_list ap;
+	unsigned int len = hkl_engine_len(self);
+	HklParameterList *pseudo_axes = hkl_engine_pseudo_axes(self);
+	double values[len];
+
+	va_start(ap, self);
+	for(i=0; i<len; ++i)
+		values[i] = va_arg(ap, double);
+		
+	va_end(ap);
+	hkl_parameter_list_values_set(pseudo_axes,
+				      values, len,
+				      NULL);
+}
diff --git a/hkl/hkl-pseudoaxis-factory.h b/tests/tap/hkl-tap.h
similarity index 73%
rename from hkl/hkl-pseudoaxis-factory.h
rename to tests/tap/hkl-tap.h
index 39b7188..20939af 100644
--- a/hkl/hkl-pseudoaxis-factory.h
+++ b/tests/tap/hkl-tap.h
@@ -13,23 +13,26 @@
  * You should have received a copy of the GNU General Public License
  * along with the hkl library.  If not, see <http://www.gnu.org/licenses/>.
  *
- * Copyright (C) 2003-2010 Synchrotron SOLEIL
+ * Copyright (C) 2003-2013 Synchrotron SOLEIL
  *                         L'Orme des Merisiers Saint-Aubin
  *                         BP 48 91192 GIF-sur-YVETTE CEDEX
  *
  * Authors: Picca Frédéric-Emmanuel <picca at synchrotron-soleil.fr>
  */
-#ifndef __HKL_PSEUDOAXIS_FACTORY_H__
-#define __HKL_PSEUDOAXIS_FACTORY_H__
+#ifndef __HKL_TAP_H__
+#define __HKL_TAP_H__
 
-#include <hkl/hkl-geometry-factory.h>
-#include <hkl/hkl-pseudoaxis.h>
+#include "hkl.h"
 
 HKL_BEGIN_DECLS
 
+extern int check_pseudoaxes_v(HklEngine *engine, ...);
 
-extern HklPseudoAxisEngineList *hkl_pseudo_axis_engine_list_factory(const HklGeometryConfig *config);
+extern int check_pseudoaxes(HklEngine *engine,
+			    double expected[], uint len);
+
+extern void hkl_engine_set_values_v(HklEngine *self, ...);
 
 HKL_END_DECLS
 
-#endif /* __HKL_PSEUDOAXIS_FACTORY_H__ */
+#endif /* __HKL_TAP_H__ */
diff --git a/tests/tap/macros.h b/tests/tap/macros.h
new file mode 100644
index 0000000..33fee42
--- /dev/null
+++ b/tests/tap/macros.h
@@ -0,0 +1,88 @@
+/*
+ * Helpful macros for TAP header files.
+ *
+ * This is not, strictly speaking, related to TAP, but any TAP add-on is
+ * probably going to need these macros, so define them in one place so that
+ * everyone can pull them in.
+ *
+ * This file is part of C TAP Harness.  The current version plus supporting
+ * documentation is at <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+ *
+ * Copyright 2008, 2012 Russ Allbery <rra at stanford.edu>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef TAP_MACROS_H
+#define TAP_MACROS_H 1
+
+/*
+ * __attribute__ is available in gcc 2.5 and later, but only with gcc 2.7
+ * could you use the __format__ form of the attributes, which is what we use
+ * (to avoid confusion with other macros), and only with gcc 2.96 can you use
+ * the attribute __malloc__.  2.96 is very old, so don't bother trying to get
+ * the other attributes to work with GCC versions between 2.7 and 2.96.
+ */
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
+#  define __attribute__(spec)   /* empty */
+# endif
+#endif
+
+/*
+ * We use __alloc_size__, but it was only available in fairly recent versions
+ * of GCC.  Suppress warnings about the unknown attribute if GCC is too old.
+ * We know that we're GCC at this point, so we can use the GCC variadic macro
+ * extension, which will still work with versions of GCC too old to have C99
+ * variadic macro support.
+ */
+#if !defined(__attribute__) && !defined(__alloc_size__)
+# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+#  define __alloc_size__(spec, args...) /* empty */
+# endif
+#endif
+
+/*
+ * LLVM and Clang pretend to be GCC but don't support all of the __attribute__
+ * settings that GCC does.  For them, suppress warnings about unknown
+ * attributes on declarations.  This unfortunately will affect the entire
+ * compilation context, but there's no push and pop available.
+ */
+#if !defined(__attribute__) && (defined(__llvm__) || defined(__clang__))
+# pragma GCC diagnostic ignored "-Wattributes"
+#endif
+
+/* Used for unused parameters to silence gcc warnings. */
+#define UNUSED __attribute__((__unused__))
+
+/*
+ * BEGIN_DECLS is used at the beginning of declarations so that C++
+ * compilers don't mangle their names.  END_DECLS is used at the end.
+ */
+#undef BEGIN_DECLS
+#undef END_DECLS
+#ifdef __cplusplus
+# define BEGIN_DECLS    extern "C" {
+# define END_DECLS      }
+#else
+# define BEGIN_DECLS    /* empty */
+# define END_DECLS      /* empty */
+#endif
+
+#endif /* TAP_MACROS_H */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/hkl.git



More information about the debian-science-commits mailing list